def remove_last(path):
  """Removes the last path element and returns both parts.

  Note the last '/' is not returned in either part.

  Args:
      path: A path string represented as a / separated string

  Returns:
    A tuple of:
      0: the path with the last element removed (string)
      1: the name of the last element (string)
  """
  components = path.split("/")
  last = components.pop()
  prefix = "/".join(components)
  return (prefix, last)