code: def find(name, return_package=False):
      names = name.split(".")
      spec = find_spec(names[0])
      if spec is None:
          raise ArgcompleteMarkerNotFound(
              'no module named "{}"'.format(names[0])
          )
      if not spec.has_location:
          raise ArgcompleteMarkerNotFound("cannot locate file")
      if spec.submodule_search_locations is None:
          if len(names) != 1:
              raise ArgcompleteMarkerNotFound(
                  "{} is not a package".format(names[0])
              )
          return spec.origin
      if len(spec.submodule_search_locations) != 1:
          raise ArgcompleteMarkerNotFound(
              "expecting one search location"
          )
      path = os.path.join(
          spec.submodule_search_locations[0], *names[1:]
      )
      if os.path.isdir(path):
          filename = "__main__.py"
          if return_package:
              filename = "__init__.py"
          return os.path.join(path, filename)
      else:
          return path + ".py"
  
imports: import os
  import sys
  import tokenize
label_desc: Use image node_id 1 for calling a global function with example usage: find(name, return_package) and returns: spec, os, unknown