code: def path2route(path: SchemaPath) -> SchemaRoute:
          
          if path == "/" or path == "":
              return []
          nlist = path.split("/")
          prevns = None
          res = []
          for n in (nlist[1:] if path[0] == "/" else nlist):
              p, s, loc = n.partition(":")
              if s:
                  if p == prevns:
                      raise InvalidSchemaPath(path)
                  res.append((loc, p))
                  prevns = p
              elif prevns:
                  res.append((p, prevns))
              else:
                  raise InvalidSchemaPath(path)
          return res
docs: Translate a schema/data path to a schema/data route.
  
          Args:
              path: Schema path.
  
          Raises:
              InvalidSchemaPath: Invalid path.