tools/code_coverage/coverage_utils.py
def GetRelativePathToDirectoryOfFile(target_path, base_path):
  """Returns a target path relative to the directory of base_path.

  This method requires base_path to be a file, otherwise, one should call
  os.path.relpath directly.
  """
  assert os.path.dirname(base_path) != base_path, (
      'Base path: "%s" is a directory, please call os.path.relpath directly.' %
      base_path)
  base_dir = os.path.dirname(base_path)
  return os.path.relpath(target_path, base_dir)
Returns a target path relative to the directory of base_path.

  This method requires base_path to be a file, otherwise, one should call
  os.path.relpath directly.
  
Returns a target path relative to the directory of base_path.
This method requires base_path to be a file, otherwise, one should call
os.path.relpath directly.
Returns a target path relative to the directory of base_path . This method requires base_path to be a file otherwise one should call os . path . relpath directly .
def GetRelativePathToDirectoryOfFile(target_path, base_path):
  assert os.path.dirname(base_path) != base_path, (
      'Base path: "%s" is a directory, please call os.path.relpath directly.' %
      base_path)
  base_dir = os.path.dirname(base_path)
  return os.path.relpath(target_path, base_dir)
def GetRelativePathToDirectoryOfFile ( target_path , base_path ) : assert os . path . dirname ( base_path ) != base_path , ( 'Base path: "%s" is a directory, please call os.path.relpath directly.' % base_path ) base_dir = os . path . dirname ( base_path ) return os . path . relpath ( target_path , base_dir )
Returns a target path relative to the directory of base_path.
Returns a target path relative to the directory of base_path .
"""Returns a target path relative to the directory of base_path.

  This method requires base_path to be a file, otherwise, one should call
  os.path.relpath directly.
  """
target_path
base_path