def _check_name_used_prior_global(self, node):
    scope_globals = {name: child for child in node.nodes_of_class(astroid.Global) for name in child.names if (child.scope() is node)}
    if (not scope_globals):
        return
    for node_name in node.nodes_of_class(astroid.Name):
        if (node_name.scope() is not node):
            continue
        name = node_name.name
        corresponding_global = scope_globals.get(name)
        if (not corresponding_global):
            continue
        global_lineno = corresponding_global.fromlineno
        if (global_lineno and (global_lineno > node_name.fromlineno)):
            self.add_message('used-prior-global-declaration', node=node_name, args=(name,))
def _check_name_used_prior_global(self, node):
    scope_globals = {name: child for child in node.nodes_of_class(astroid.Global) for name in child.names if (child.scope() is node)}
    if (not scope_globals):
        return
    for node_name in node.nodes_of_class(astroid.Name):
        if (node_name.scope() is not node):
            continue
        name = node_name.name
        corresponding_global = scope_globals.get(name)
        if (not corresponding_global):
            continue
        global_lineno = corresponding_global.fromlineno
        if (global_lineno and (global_lineno > node_name.fromlineno)):
            self.add_message('used-prior-global-declaration', node=node_name, args=(name,))