code: def find_module(
      self,
      module_name,
      relative_to=None,
      pos=None,
      need_pxd=1,
      absolute_fallback=True,
  ):
      # Finds and returns the module scope corresponding to
      # the given relative or absolute module name. If this
      # is the first time the module has been requested, finds
      # the corresponding .pxd file and process it.
      # If relative_to is not None, it must be a module scope,
      # and the module will first be searched for relative to
      # that module, provided its name is not a dotted name.
      debug_find_module = 0
      if debug_find_module:
          print(
              "Context.find_module: module_name = %s, relative_to = %s, pos = %s, need_pxd = %s"
              % (module_name, relative_to, pos, need_pxd)
          )
  
      scope = None
      pxd_pathname = None
      if relative_to:
          if module_name:
              # from .module import ...
              qualified_name = relative_to.qualify_name(module_name)
          else:
              # from . import ...
              qualified_name = relative_to.qualified_name
              scope = relative_to
              relative_to = None
      else:
          qualified_name = module_name
  
      if not module_name_pattern.match(qualified_name):
          raise CompileError(
              pos or (module_name, 0, 0),
              "'%s' is not a valid module name" % module_name,
          )
  
      if relative_to:
          if debug_find_module:
              print("...trying relative import")
          scope = relative_to.lookup_submodule(module_name)
          if not scope:
              pxd_pathname = self.find_pxd_file(qualified_name, pos)
              if pxd_pathname:
                  scope = relative_to.find_submodule(module_name)
      if not scope:
          if debug_find_module:
              print("...trying absolute import")
          if absolute_fallback:
              qualified_name = module_name
          scope = self
          for name in qualified_name.split("."):
              scope = scope.find_submodule(name)
  
      if debug_find_module:
          print("...scope = %s" % scope)
      if not scope.pxd_file_loaded:
          if debug_find_module:
              print("...pxd not loaded")
          if not pxd_pathname:
              if debug_find_module:
                  print("...looking for pxd file")
              pxd_pathname = self.find_pxd_file(qualified_name, pos)
              if debug_find_module:
                  print("......found %s" % pxd_pathname)
              if not pxd_pathname and need_pxd:
                  # Set pxd_file_loaded such that we don't need to
                  # look for the non-existing pxd file next time.
                  scope.pxd_file_loaded = True
                  package_pathname = self.search_include_directories(
                      qualified_name, ".py", pos
                  )
                  if package_pathname and package_pathname.endswith(
                      "__init__.py"
                  ):
                      pass
                  else:
                      error(
                          pos,
                          "'%s.pxd' not found"
                          % qualified_name.replace(".", os.sep),
                      )
          if pxd_pathname:
              scope.pxd_file_loaded = True
              try:
                  if debug_find_module:
                      print(
                          "Context.find_module: Parsing %s"
                          % pxd_pathname
                      )
                  rel_path = (
                      module_name.replace(".", os.sep)
                      + os.path.splitext(pxd_pathname)[1]
                  )
                  if not pxd_pathname.endswith(rel_path):
                      rel_path = pxd_pathname  # safety measure to prevent printing incorrect paths
                  if Options.source_root:
                      rel_path = os.path.relpath(
                          pxd_pathname, Options.source_root
                      )
                  source_desc = FileSourceDescriptor(
                      pxd_pathname, rel_path
                  )
                  err, result = self.process_pxd(
                      source_desc, scope, qualified_name
                  )
                  if err:
                      raise err
                  (pxd_codenodes, pxd_scope) = result
                  self.pxds[module_name] = (pxd_codenodes, pxd_scope)
              except CompileError:
                  pass
      return scope
  
imports: from __future__ import absolute_import
  import os
  import re
  import sys
  import io
  from .None import Errors
  from .StringEncoding import EncodedString
  from .Scanning import PyrexScanner, FileSourceDescriptor
  from .Errors import PyrexError, CompileError, error, warning
  from .Symtab import ModuleScope
  from ..None import Utils
  from .None import Options
  from .None import Version
label_desc: Use image node_id 7 for calling the Context obj's underlying member method code with example usage: obj.find_module(module_name, relative_to, pos, need_pxd, absolute_fallback) and returns: scope