class_docstr: A registry for task schedulers.
class_docstr_tok: ["A","registry","for","task","schedulers","."]
docstr: Registers a new task scheduler.
  
  Args:
    url: The URL associated with the task scheduler. It should either be the
      node type url or executor spec url.
    scheduler_cls_or_builder: Either a task scheduler class or a function that
      builds an instantiated scheduler for a matched task.
  
  Raises:
    ValueError: If `url` is already in the registry.
docstr_tok: ["Registers","a","new","task","scheduler",".","Args",":","url",":","The","URL","associated","with","the","task","scheduler",".","It","should","either","be","the","node","type","url","or","executor","spec","url",".","scheduler_cls_or_builder",":","Either","a","task","scheduler","class","or","a","function","that","builds","an","instantiated","scheduler","for","a","matched","task",".","Raises",":","ValueError",":","If","`","url","`","is","already","in","the","registry","."]
code: def register(
      cls: Type[T],
      url: str,
      scheduler_cls_or_builder: Union[
          Type[TaskScheduler], TaskSchedulerBuilder
      ],
  ) -> None:
      """Registers a new task scheduler.
  
      Args:
        url: The URL associated with the task scheduler. It should either be the
          node type url or executor spec url.
        scheduler_cls_or_builder: Either a task scheduler class or a function that
          builds an instantiated scheduler for a matched task.
  
      Raises:
        ValueError: If `url` is already in the registry.
      """
      if cls._task_scheduler_registry.get(url) not in (
          None,
          scheduler_cls_or_builder,
      ):
          raise ValueError(
              f"A task scheduler already exists for the url: {url}"
          )
      cls._task_scheduler_registry[url] = 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 1 for calling the TaskSchedulerRegistry obj's underlying member method code with example usage: obj.register(cls, url, scheduler_cls_or_builder) without return types