(node, basename)
return full_basename
Resolve where a node is defined to get its fully qualified name.

    :param node: The node representing the base name.
    :type node: astroid.NodeNG
    :param basename: The partial base name to resolve.
    :type basename: str

    :returns: The fully resolved base name.
    :rtype: str
Resolve where a node is defined to get its fully qualified name.
Resolve where a node is defined to get its fully qualified name .
def resolve_qualname(node, basename):
    """Resolve where a node is defined to get its fully qualified name.

    :param node: The node representing the base name.
    :type node: astroid.NodeNG
    :param basename: The partial base name to resolve.
    :type basename: str

    :returns: The fully resolved base name.
    :rtype: str
    """
    full_basename = basename

    top_level_name = re.sub(r"\(.*\)", "", basename).split(".", 1)[0]
    # Disable until pylint uses astroid 2.7
    if isinstance(
        node, astroid.nodes.node_classes.LookupMixIn  # pylint: disable=no-member
    ):
        lookup_node = node
    else:
        lookup_node = node.scope()

    assigns = lookup_node.lookup(top_level_name)[1]

    for assignment in assigns:
        if isinstance(assignment, astroid.nodes.ImportFrom):
            import_name = get_full_import_name(assignment, top_level_name)
            full_basename = basename.replace(top_level_name, import_name, 1)
            break
        if isinstance(assignment, astroid.nodes.Import):
            import_name = resolve_import_alias(top_level_name, assignment.names)
            full_basename = basename.replace(top_level_name, import_name, 1)
            break
        if isinstance(assignment, astroid.nodes.ClassDef):
            full_basename = assignment.qname()
            break
        if isinstance(assignment, astroid.nodes.AssignName):
            full_basename = "{}.{}".format(assignment.scope().qname(), assignment.name)

    if isinstance(node, astroid.nodes.Call):
        full_basename = re.sub(r"\(.*\)", "()", full_basename)

    if full_basename.startswith("builtins."):
        return full_basename[len("builtins.") :]

    if full_basename.startswith("__builtin__."):
        return full_basename[len("__builtin__.") :]

    return full_basename
def resolve_qualname ( node , basename ) : full_basename = basename top_level_name = re . sub ( r"\(.*\)" , "" , basename ) . split ( "." , 1 ) [ 0 ] # Disable until pylint uses astroid 2.7 if isinstance ( node , astroid . nodes . node_classes . LookupMixIn # pylint: disable=no-member ) : lookup_node = node else : lookup_node = node . scope ( ) assigns = lookup_node . lookup ( top_level_name ) [ 1 ] for assignment in assigns : if isinstance ( assignment , astroid . nodes . ImportFrom ) : import_name = get_full_import_name ( assignment , top_level_name ) full_basename = basename . replace ( top_level_name , import_name , 1 ) break if isinstance ( assignment , astroid . nodes . Import ) : import_name = resolve_import_alias ( top_level_name , assignment . names ) full_basename = basename . replace ( top_level_name , import_name , 1 ) break if isinstance ( assignment , astroid . nodes . ClassDef ) : full_basename = assignment . qname ( ) break if isinstance ( assignment , astroid . nodes . AssignName ) : full_basename = "{}.{}" . format ( assignment . scope ( ) . qname ( ) , assignment . name ) if isinstance ( node , astroid . nodes . Call ) : full_basename = re . sub ( r"\(.*\)" , "()" , full_basename ) if full_basename . startswith ( "builtins." ) : return full_basename [ len ( "builtins." ) : ] if full_basename . startswith ( "__builtin__." ) : return full_basename [ len ( "__builtin__." ) : ] return full_basename