code: def _shell_f(shell_cmd):
      try:
          import pty
      except ImportError:
          cli.error(
              f"shell is not supported on this platform ({util.get_platform()})"
          )
  
      shell_cmd = shell_cmd or os.getenv("SHELL", "bash")
  
      def f(path):
          if os.path.isfile(path):
              path = os.path.dirname(path)
          cli.note(
              f"Running a new shell in {path}\n"
              "To exit the shell, type 'exit' and press Enter."
          )
          with util.Chdir(path):
              with _fix_shell_columns():
                  pty.spawn([shell_cmd])
  
      return f
  
imports: import logging
  import os
  import shlex
  import shutil
  import subprocess
  import sys
  from guild import cli
  from guild import cmd_impl_support
  from guild import run_util
  from guild import util
  from .None import runs_impl
label_desc: Use image node_id 10 for calling a global function with example usage: _shell_f(shell_cmd) and returns: f