class_docstr: A registry for task schedulers.
class_docstr_tok: ["A","registry","for","task","schedulers","."]
docstr: Returns a scheduler class or a builder function for node type or raises error if none registered.
docstr_tok: ["Returns","a","scheduler","class","or","a","builder","function","for","node","type","or","raises","error","if","none","registered","."]
code: def _scheduler_cls_or_builder_for_node_type(
      cls: Type[T], task: task_lib.ExecNodeTask
  ) -> Union[Type[TaskScheduler], TaskSchedulerBuilder]:
      """Returns a scheduler class or a builder function for node type or raises error if none registered."""
      node_type = task.get_node().node_info.type.name
      scheduler_cls_or_builder = cls._task_scheduler_registry.get(
          node_type
      )
      if scheduler_cls_or_builder is None:
          raise ValueError(
              "No task scheduler class or builder registered for node type: "
              f"{node_type}"
          )
      return scheduler_cls_or_builder
  
imports: import abc
  from typing import Callable, Dict, Generic, List, Optional, Type, TypeVar, Union
  import attr
  from tfx import types
  from tfx.orchestration import metadata
  from tfx.orchestration.experimental.core import task
  from tfx.proto.orchestration import execution_result_pb2
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.utils import status
label_desc: Use image node_id 4 for calling the TaskSchedulerRegistry obj's underlying member method code with example usage: obj._scheduler_cls_or_builder_for_node_type(cls, task) and returns: scheduler_cls_or_builder