code: def get_module_paths(module: types.ModuleType) -> Set[str]:
      paths_extractors = [
          # https://docs.python.org/3/reference/datamodel.html
          # __file__ is the pathname of the file from which the module was loaded
          # if it was loaded from a file.
          # The __file__ attribute may be missing for certain types of modules
          lambda m: [m.__file__],
          # https://docs.python.org/3/reference/import.html#__spec__
          # The __spec__ attribute is set to the module spec that was used
          # when importing the module. one exception is __main__,
          # where __spec__ is set to None in some cases.
          # https://www.python.org/dev/peps/pep-0451/#id16
          # "origin" in an import context means the system
          # (or resource within a system) from which a module originates
          # ... It is up to the loader to decide on how to interpret
          # and use a module's origin, if at all.
          lambda m: [m.__spec__.origin],
          # https://www.python.org/dev/peps/pep-0420/
          # Handling of "namespace packages" in which the __path__ attribute
          # is a _NamespacePath object with a _path attribute containing
          # the various paths of the package.
          lambda m: [p for p in m.__path__._path],
      ]
  
      all_paths = set()
      for extract_paths in paths_extractors:
          potential_paths = []
          try:
              potential_paths = extract_paths(module)
          except AttributeError:
              # Some modules might not have __file__ or __spec__ attributes.
              pass
          except Exception as e:
              LOGGER.warning(
                  f"Examining the path of {module.__name__} raised: {e}"
              )
  
          all_paths.update(
              [
                  os.path.abspath(str(p))
                  for p in potential_paths
                  if _is_valid_path(p)
              ]
          )
      return all_paths
  
imports: import collections
  import os
  import sys
  import types
  from typing import Callable, Dict, List, Optional, Set
  from streamlit import config, file_util
  from streamlit.folder_black_list import FolderBlackList
  from streamlit.logger import get_logger
  from streamlit.source_util import get_pages
  from streamlit.watcher.path_watcher import NoOpPathWatcher, get_default_path_watcher_class
label_desc: Use image node_id 1 for calling a global function with example usage: get_module_paths(module) and returns: all_paths