def clean_path(path):
  """ remove . and .. from path

  Args:
    path (str): file or folder path
  Return:
    str: clean path
  """
  segs = path.split('/')
  segs1 = [seg for seg in segs if seg not in ['.', '..']]
  path1 = '/'.join(segs1)
  return path1