code: def prettify_commandline(cmdline, color_command="", color_text=""):
      """
      Prettify and colorize a full command-line (given as list of strings),
      where command (basename) is highlighted in a different color.
      """
      # cmdline: Iterable[str]
      if isinstance(cmdline, str):
          return cmdline
      assert cmdline
  
      command_p, command_b = os.path.split(cmdline[0])
      s = color_text + os.path.join(
          command_p, color_command + command_b + color_text
      )
  
      if len(cmdline) > 1:
          s += " "
          s += " ".join(cmdline[1:])
      return s
  
file_path: gpustat/gpustat/util.py
imports: import collections
  import os.path
  import sys
  import traceback
  from typing import Callable, Tuple, Type, TypeVar, Union
label_desc: Use image node_id 2 for calling a global function with example usage: prettify_commandline(cmdline, color_command, color_text) and returns: s, cmdline