<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ParentAndBaseName(path):
 """Given a path return only the parent name and file name as a string."""

  dirname, basename = os.path.split(path)
  dirname = dirname.rstrip(os.path.sep)
  if os.path.altsep:
    dirname = dirname.rstrip(os.path.altsep)
  _, parentname = os.path.split(dirname)
  return os.path.join(parentname, basename)