code: def smart_join(base, path, abspath=False):
      if is_local_file(base):
          full = os.path.join(base, path)
          if abspath:
              return os.path.abspath(full)
          return full
      else:
          from smart_open import parse_uri
  
          uri = parse_uri(f"{base}/{path}")
          if not ON_WINDOWS:
              # Norm the path such that it does not contain any ../,
              # which is invalid in an URL.
              assert uri.uri_path[0] == "/"
              uri_path = os.path.normpath(uri.uri_path)
          else:
              uri_path = uri.uri_path
          return f"{uri.scheme}:/{uri_path}"
  
imports: import contextlib
  import itertools
  import math
  import operator
  import platform
  import hashlib
  import inspect
  import sys
  import uuid
  import os
  import asyncio
  import collections
  from pathlib import Path
  from snakemake._version import get_versions
  from snakemake_interface_common.exceptions import WorkflowError
label_desc: Use image node_id 9 for calling a global function with example usage: smart_join(base, path, abspath) and returns: full, uri, str, uri_path, os