code: def apt_packages(conf: CalibanConfig, mode: JobMode) -> List[str]:
      """Returns the list of aptitude packages that should be installed to satisfy
      the requests in the config.
  
      """
      packages = conf.get("apt_packages", [])
  
      if isinstance(packages, dict):
          k = "gpu" if gpu(mode) else "cpu"
          return packages[k]
  
      return packages
  
imports: import os
  import sys
  from enum import Enum
  from typing import Any, Dict, List, Optional, Tuple
  import schema
  import caliban.platform.cloud.types
  import caliban.util.schema
label_desc: Use image node_id 8 for calling a global function with example usage: apt_packages(conf, mode) and returns: packages, packages