code: def _get_relative_base_path(filename, path_to_check):
      
      importable_path = None
      path_to_check = os.path.normcase(path_to_check)
      abs_filename = os.path.abspath(filename)
      if os.path.normcase(abs_filename).startswith(path_to_check):
          importable_path = abs_filename
  
      real_filename = os.path.realpath(filename)
      if os.path.normcase(real_filename).startswith(path_to_check):
          importable_path = real_filename
  
      if importable_path:
          base_path = os.path.splitext(importable_path)[0]
          relative_base_path = base_path[len(path_to_check) :]
          return [pkg for pkg in relative_base_path.split(os.sep) if pkg]
  
      return None
docs: Extracts the relative mod path of the file to import from
  
      Check if a file is within the passed in path and if so, returns the
      relative mod path from the one passed in.
  
      If the filename is no in path_to_check, returns None
  
      Note this function will look for both abs and realpath of the file,
      this allows to find the relative base path even if the file is a
      symlink of a file in the passed in path
  
      Examples:
          _get_relative_base_path("/a/b/c/d.py", "/a/b") ->  ["c","d"]
          _get_relative_base_path("/a/b/c/d.py", "/dev") ->  None