Parse a rfc 6901 path.

def parse_path(path):
  """Parse a rfc 6901 path."""
  if not path:
    raise ValueError("Invalid path")

  if isinstance(path, str):
    if path == "/":
      raise ValueError("Invalid path")
    if path[0] != "/":
      raise ValueError("Invalid path")
    return path.split(_PATH_SEP)[1:]
  elif isinstance(path, (tuple, list)):
    return path
  else:
    raise ValueError("A path must be a string, tuple or list")