def retrieve_import_alias_mapping ( names_list ) : import_alias_names = dict ( ) for alias in names_list : if alias . asname : import_alias_names [ alias . asname ] = alias . name return import_alias_names
making an alias list in python
Creates a dictionary mapping aliases to their respective name . import_alias_names is used in module_definitions . py and visit_Call
def retrieve_import_alias_mapping(names_list):
    """Creates a dictionary mapping aliases to their respective name.
    import_alias_names is used in module_definitions.py and visit_Call"""
    import_alias_names = dict()

    for alias in names_list:
        if alias.asname:
            import_alias_names[alias.asname] = alias.name
    return import_alias_names