code: def _run_entry_point(
      command: str, work_dir: Optional[str]
  ) -> AbstractRun:
      """Run an entry point command in a subprocess.
  
      Arguments:
          command: Entry point command to run
          work_dir: Working directory in which to run the command
  
      Returns:
          An instance of `LocalSubmittedRun`
      """
      if work_dir is None:
          work_dir = os.getcwd()
      env = os.environ.copy()
      run = LocalSubmittedRun()
      thread = threading.Thread(
          target=_thread_process_runner,
          args=(run, ["bash", "-c", command], work_dir, env),
      )
      run.set_thread(thread)
      thread.start()
      return run
  
imports: import asyncio
  import logging
  import os
  import shlex
  import subprocess
  import sys
  import threading
  from typing import TYPE_CHECKING, Any, Dict, List, Optional
  import wandb
  from wandb.sdk.launch.environment.abstract import AbstractEnvironment
  from wandb.sdk.launch.registry.abstract import AbstractRegistry
  from .._project_spec import LaunchProject
  from ..builder.build import get_env_vars_dict
  from ..errors import LaunchError
  from ..utils import LOG_PREFIX, MAX_ENV_LENGTHS, PROJECT_SYNCHRONOUS, _is_wandb_dev_uri, _is_wandb_local_uri, docker_image_exists, event_loop_thread_exec, pull_docker_image, sanitize_wandb_api_key
  from .abstract import AbstractRun, AbstractRunner, Status
label_desc: Use image node_id 1 for calling a global function with example usage: _run_entry_point(command, work_dir) and returns: run