code: def base_extras(
      job_mode: c.JobMode, path: str, extras: Optional[List[str]]
  ) -> Optional[List[str]]:
      """Returns None if the supplied path doesn't exist (it's assumed it points to a
      setup.py file).
  
      If the path DOES exist, generates a list of extras to install. gpu or cpu are
      always added to the beginning of the list, depending on the mode.
  
      """
      ret = None
  
      if os.path.exists(path):
          base = extras or []
          extra = "gpu" if c.gpu(job_mode) else "cpu"
          ret = base if extra in base else [extra] + base
  
      return ret
  
imports: from __future__ import absolute_import, division, print_function
  import json
  import os
  import subprocess
  import tempfile
  from enum import Enum
  from pathlib import Path
  from typing import Any, Dict, List, NamedTuple, NewType, Optional, Union
  from absl import logging
  from blessings import Terminal
  import caliban.config
  import caliban.util
  import caliban.util.fs
  import caliban.util.metrics
label_desc: Use image node_id 11 for calling a global function with example usage: base_extras(job_mode, path, extras) and returns: ret