docs: def extract_module_name(absolute_path):
      """
      This function tries to extract a valid module name from the basename of the supplied path.
      If it's a directory, the directory name is returned, if it's a file, the file name
      without extension is returned. If the basename starts with _ or . or it's a file with an
      ending different from .py, the function returns None
  
      :param absolute_path: Absolute path of something that might be a module.
      :return: Module name or None.
      """
      base_name = osp.basename(osp.normpath(absolute_path))
  
      # If the basename starts with _ it's probably __init__.py or __pycache__ or something internal.
      # At the moment there seems to be no use case for those
      if base_name[0] in ('.', '_'):
          return None
  
      # If it's a directory, there's nothing else to check, so it can be returned directly
      if osp.isdir(absolute_path):
          return base_name
  
      module_name, extension = osp.splitext(base_name)
  
      # If it's a file, it must have a .py ending
      if extension == '.py':
          return module_name
  
      return None