(self, node: ast.ImportFrom, alias: ast.alias,
                                       names_to_replace: Dict[str, Tuple[str, str]])
return ast.ImportFrom(
            module=module_name,
            names=[ast.alias(name=name,
                             asname=alias.asname or alias.name)],
            level=node.level)
Returns import from statement with changed module or alias.
Returns import from statement with changed module or alias.
Returns import from statement with changed module or alias .
def _get_replaced_import_from_part(self, node: ast.ImportFrom, alias: ast.alias,
                                       names_to_replace: Dict[str, Tuple[str, str]]) -> ast.ImportFrom:
        """Returns import from statement with changed module or alias."""
        full_name = '{}.{}'.format(node.module, alias.name)
        if full_name in names_to_replace:
            full_name = full_name.replace(names_to_replace[full_name][0],
                                          names_to_replace[full_name][1],
                                          1)
        module_name = '.'.join(full_name.split('.')[:-1])
        name = full_name.split('.')[-1]
        return ast.ImportFrom(
            module=module_name,
            names=[ast.alias(name=name,
                             asname=alias.asname or alias.name)],
            level=node.level)
def _get_replaced_import_from_part ( self , node : ast . ImportFrom , alias : ast . alias , names_to_replace : Dict [ str , Tuple [ str , str ] ] ) -> ast . ImportFrom : full_name = '{}.{}' . format ( node . module , alias . name ) if full_name in names_to_replace : full_name = full_name . replace ( names_to_replace [ full_name ] [ 0 ] , names_to_replace [ full_name ] [ 1 ] , 1 ) module_name = '.' . join ( full_name . split ( '.' ) [ : - 1 ] ) name = full_name . split ( '.' ) [ - 1 ] return ast . ImportFrom ( module = module_name , names = [ ast . alias ( name = name , asname = alias . asname or alias . name ) ] , level = node . level )