code: def is_subpath(path, parent):
    '''
    Returns True if *path* points to the same or a subpath of *parent*.
    '''
  
    try:
      relpath = os.path.relpath(path, parent)
    except ValueError:
      return False  # happens on Windows if drive letters don't match
    return relpath == os.curdir or not relpath.startswith(os.pardirf is_subpath(path, parent):
    '''
    Returns True if *path* points to the same or a subpath of *parent*.
    '''
  
    try:
      relpath = os.path.relpath(path, parent)
    except ValueError:
      return False  # happens on Windows if drive letters don't match
    return relpath == os.curdir or not relpath.startswith(os.pardir)
docs: Returns True if *path* points to the same or a subpath of *parent*.