code: def join_uri(uri, *segments):
      
      sub = "/".join(segments)
      if not sub:
          return uri
      return uri.rstrip("/") + "/" + sub
docs: Append segments to URI.
  
      Example: join_uri("/a/b", "c", "d")