code: def _resolve_AttributeNode(env, node):
      path = []
      while isinstance(node, AttributeNode):
          path.insert(0, node.attribute)
          node = node.obj
      if isinstance(node, NameNode):
          path.insert(0, node.name)
      else:
          raise CompileError(node.pos, EXPR_ERR)
      modnames = path[:-1]
      # must be at least 1 module name, o/w not an AttributeNode.
      assert modnames
  
      scope = env
      for modname in modnames:
          mod = scope.lookup(modname)
          if not mod or not mod.as_module:
              raise CompileError(
                  node.pos, "undeclared name not builtin: %s" % modname
              )
          scope = mod.as_module
  
      entry = scope.lookup(path[-1])
      if not entry:
          raise CompileError(
              node.pos, "No such attribute '%s'" % path[-1]
          )
  
      return entry
  
imports: from __future__ import absolute_import
  from .Errors import CompileError, error
  from .None import ExprNodes
  from .ExprNodes import IntNode, NameNode, AttributeNode
  from .None import Options
  from .Code import UtilityCode, TempitaUtilityCode
  from .UtilityCode import CythonUtilityCode
  from .None import Buffer
  from .None import PyrexTypes
  from .None import ModuleNode
label_desc: Use image node_id 24 for calling a global function with example usage: _resolve_AttributeNode(env, node) and returns: entry