code: def _normalize_url(url: str) -> str:
      # os.path.normpath mangles url schemes: gs://etc -> gs:/etc
      # urlparse.urljoin doesn't normalize paths
      url_scheme, sep, url_path = url.partition("://")
      # 2021-03-12 @ludwig this method is often called with paths that are not URLs.
      # thus, url_path may be empty
      # in this case we can't call `os.path.normpath(url_path)`
      # as it "normalizes" an empty input to "." (current directory)
      normalized_path = os.path.normpath(url_path) if url_path else ""
      joined = url_scheme + sep + normalized_path
      return joined
  
file_path: lucid/lucid/misc/io/scoping.py
imports: import os
  from copy import copy
  import threading
  import sys
  from contextlib import contextmanager
label_desc: Use image node_id 4 for calling a global function with example usage: _normalize_url(url) and returns: joined