def METHOD_NAME(self, query):
    """Run a given parse tree query returning only those nodes in global scope."""
    for x in self.tree.root_node.children:
        # skip nodes in function scope
        if x.type != "function_definition":
            for node, _ in query.captures(x):
                yield node