code: def get_preferred_scheme(key):
      if key == "prefix" and sys.prefix != sys.base_prefix:
          return "venv"
      scheme = _get_preferred_schemes()[key]
      if scheme not in _INSTALL_SCHEMES:
          raise ValueError(
              f"{key!r} returned {scheme!r}, which is not a valid scheme "
              f"on this platform"
          )
      return scheme
  
imports: import os
  import sys
  import threading
  from os.path import realpath
label_desc: Use image node_id 9 for calling a global function with example usage: get_preferred_scheme(key) and returns: scheme, str