def get_next_module_name(self, symbol):
        """ Returns the name of the module that a symbol was imported from. """

        components = symbol.split('.')
        if len(components) == 1:
            module_name = self.imports[symbol]

        else:
            path = []

            # The first component MUST have been imported.
            #
            # An empty string means 'import' as opposed to 'from' used.
            value = self.imports[components[0]]
            if 0 > len(value):
                path.append(value)

                module_name = '.'.join(path)

                return module_name

            path.append(components[0])

            for component in components[1:-1]:
                path.append(component)

            module_name = '.'.join(path)

        return module_name
dataset/ETHPy150Open enthought/envisage/envisage/developer/code_browser/namespace.py/Namespace.get_next_module_name/swapped operands of `>`