docs: def classify_import(module_name, application_directories=('.',)):
      """Classifies an import by its package.
  
      Returns a value in ImportType.__all__
  
      :param text module_name: The dotted notation of a module
      :param tuple application_directories: tuple of paths which are considered
          application roots.
      """
      # Only really care about the first part of the path
      base, _, _ = module_name.partition('.')
      found, module_path, is_builtin = _get_module_info(
          base, application_directories,
      )
      if base == '__future__':
          return ImportType.FUTURE
      # Relative imports: `from .foo import bar`
      elif base == '':
          return ImportType.APPLICATION
      # If imp tells us it is builtin, it is builtin
      elif is_builtin:
          return ImportType.BUILTIN
      # If the module path exists in the project directories
      elif _module_path_is_local_and_is_not_symlinked(
              module_path, application_directories,
      ):
          return ImportType.APPLICATION
      # Otherwise we assume it is a system module or a third party module
      elif (
              found and
              PACKAGES_PATH not in module_path and
              not _due_to_pythonpath(module_path)
      ):
          return ImportType.BUILTIN
      else:
          return ImportType.THIRD_PARTY