Resolve a rfc 6901 path, returning the parent and the last path part.

def resolve_path(root, path):
  """Resolve a rfc 6901 path, returning the parent and the last path part."""
  path = parse_path(path)

  parent = root

  for part in path[:-1]:
    parent = get_child(parent, rfc_6901_replace(part))

  return (parent, rfc_6901_replace(path[-1]))