original_docstring: Convert a filename to a module relative to pythonpath.
  
    This method tries to deduce the module name from the pythonpath and the
    filename. This will not always be possible. (It depends on the filename
    starting with an entry in the pythonpath.)
  
    Args:
      filename: The filename of a Python file. E.g. "foo/bar/baz.py".
      pythonpath: The path Python uses to search for modules.
  
    Returns:
      A Module object.
    
docstring: Convert a filename to a module relative to pythonpath.
  This method tries to deduce the module name from the pythonpath and the
  filename. This will not always be possible. (It depends on the filename
  starting with an entry in the pythonpath.)
docstring_tokens: Convert a filename to a module relative to pythonpath . This method tries to deduce the module name from the pythonpath and the filename . This will not always be possible . ( It depends on the filename starting with an entry in the pythonpath . )
code: def infer_module(filename, pythonpath):
    """Convert a filename to a module relative to pythonpath.
  
    This method tries to deduce the module name from the pythonpath and the
    filename. This will not always be possible. (It depends on the filename
    starting with an entry in the pythonpath.)
  
    Args:
      filename: The filename of a Python file. E.g. "foo/bar/baz.py".
      pythonpath: The path Python uses to search for modules.
  
    Returns:
      A Module object.
    """
    # We want '' in our lookup path, but we don't want it for prefix tests.
    for path in filter(bool, pythonpath):
      if not path.endswith(os.sep):
        path += os.sep
      if filename.startswith(path):
        filename = filename[len(path):]
        break
    else:
      # We have not found filename relative to anywhere in pythonpath.
      path = ""
    return Module(path, filename, path_to_module_name(filename))
code_tokens: def infer_module ( filename , pythonpath ) : for path in filter ( bool , pythonpath ) : if not path . endswith ( os . sep ) : path += os . sep if filename . startswith ( path ) : filename = filename [ len ( path ) : ] break else : path = "" return Module ( path , filename , path_to_module_name ( filename ) )
short_docstring: Convert a filename to a module relative to pythonpath.
short_docstring_tokens: Convert a filename to a module relative to pythonpath .
comment: """Convert a filename to a module relative to pythonpath.
  
    This method tries to deduce the module name from the pythonpath and the
    filename. This will not always be possible. (It depends on the filename
    starting with an entry in the pythonpath.)
  
    Args:
      filename: The filename of a Python file. E.g. "foo/bar/baz.py".
      pythonpath: The path Python uses to search for modules.
  
    Returns:
      A Module object.
    """$SEP$# We want '' in our lookup path, but we don't want it for prefix tests.$SEP$# We have not found filename relative to anywhere in pythonpath.