class_docstr: Runs a user-defined Python function.
class_docstr_tok: ["Runs","a","user-defined","Python","function","."]
docstr: Creates Executables.
docstr_tok: ["Creates","Executables","."]
code: def to_executables(nodes, label, launch_context):
      """Creates Executables."""
      if launch_context.launch_type in [
          context.LaunchType.LOCAL_MULTI_THREADING,
          context.LaunchType.TEST_MULTI_THREADING,
      ]:
          return [node.function for node in nodes]
      elif (
          launch_context.launch_type
          is context.LaunchType.LOCAL_MULTI_PROCESSING
      ):
          return local_multi_processing.to_multiprocessing_executables(
              nodes,
              label,
              launch_context.launch_config,
              pdb_post_mortem=True,
          )
      elif (
          launch_context.launch_type
          is context.LaunchType.TEST_MULTI_PROCESSING
      ):
          return local_multi_processing.to_multiprocessing_executables(
              nodes,
              label,
              launch_context.launch_config,
              pdb_post_mortem=False,
          )
      elif launch_context.launch_type == context.LaunchType.VERTEX_AI:
          from launchpad.nodes.python import xm_docker
  
          return xm_docker.to_docker_executables(
              nodes, label, launch_context.launch_config
          )
      raise NotImplementedError(
          "Unsupported launch type: {}".format(
              launch_context.launch_type
          )
      )
  
imports: import functools
  import itertools
  from typing import Any, Callable, Generic, TypeVar
  from absl import flags
  from absl import logging
  from launchpad import context
  from launchpad import lazy_loader
  from launchpad.nodes import base
  from launchpad.nodes import dereference
  from launchpad.nodes.python import addressing
  from launchpad.nodes.python import local_multi_processing
  import tree
label_desc: Use image node_id 5 for calling the PyNode obj's underlying member method code with example usage: obj.to_executables(nodes, label, launch_context) and returns: unknown, local_multi_processing, local_multi_processing, xm_docker