parameters: (parent, child)
return_statement: return child == os.path.join(prefix, child_suffix)
docstring: Return true if child is subdirectory of parent.
    Assumes both paths are absolute and don't contain symlinks.
docstring_summary: Return true if child is subdirectory of parent.
    Assumes both paths are absolute and don't contain symlinks.
docstring_tokens: Return true if child is subdirectory of parent . Assumes both paths are absolute and don t contain symlinks .
function: def _IsParentOrSame(parent, child):
      """Return true if child is subdirectory of parent.
    Assumes both paths are absolute and don't contain symlinks.
    """
      parent = os.path.normpath(parent)
      child = os.path.normpath(child)
      if parent == child:
          return True
  
      prefix = os.path.commonprefix([parent, child])
      if prefix != parent:
          return False
      # Note: os.path.commonprefix operates on character basis, so
      # take extra care of situations like '/foo/ba' and '/foo/bar/baz'
      child_suffix = child[len(prefix):]
      child_suffix = child_suffix.lstrip(os.sep)
      return child == os.path.join(prefix, child_suffix)
function_tokens: def _IsParentOrSame ( parent , child ) : parent = os . path . normpath ( parent ) child = os . path . normpath ( child ) if parent == child : return True prefix = os . path . commonprefix ( [ parent , child ] ) if prefix != parent : return False # Note: os.path.commonprefix operates on character basis, so # take extra care of situations like '/foo/ba' and '/foo/bar/baz' child_suffix = child [ len ( prefix ) : ] child_suffix = child_suffix . lstrip ( os . sep ) return child == os . path . join ( prefix , child_suffix )