code: def register(
      cls: Type[IssueManager], task: str = "classification"
  ) -> Type[IssueManager]:
      """Registers the issue manager factory.
  
      Parameters
      ----------
      cls :
          A subclass of
          :py:class:`IssueManager <cleanlab.datalab.internal.issue_manager.issue_manager.IssueManager>`.
  
      task :
          Specific machine learning task like classification or regression.
  
      Returns
      -------
      cls :
          The same class that was passed in.
  
      Example
      -------
  
      When defining a new subclass of
      :py:class:`IssueManager <cleanlab.datalab.internal.issue_manager.issue_manager.IssueManager>`,
      you can register it like so:
  
      .. code-block:: python
  
          from cleanlab import IssueManager
          from cleanlab.datalab.internal.issue_manager_factory import register
  
          @register
          class MyIssueManager(IssueManager):
              issue_name: str = "my_issue"
              def find_issues(self, **kwargs):
                  # Some logic to find issues
                  pass
  
      or in a function call:
  
      .. code-block:: python
  
          from cleanlab import IssueManager
          from cleanlab.datalab.internal.issue_manager_factory import register
  
          class MyIssueManager(IssueManager):
              issue_name: str = "my_issue"
              def find_issues(self, **kwargs):
                  # Some logic to find issues
                  pass
  
          register(MyIssueManager, task="classification")
      """
  
      if not issubclass(cls, IssueManager):
          raise ValueError(
              f"Class {cls} must be a subclass of IssueManager"
          )
  
      name: str = str(cls.issue_name)
  
      if task not in REGISTRY:
          raise ValueError(
              f"Invalid task type: {task}, must be in {list(REGISTRY.keys())}"
          )
  
      if name in REGISTRY[task]:
          print(
              f"Warning: Overwriting existing issue manager {name} with {cls} for task {task}."
              "This may cause unexpected behavior."
          )
  
      REGISTRY[task][name] = cls
      return cls
  
file_path: cleanlab/cleanlab/datalab/internal/issue_manager_factory.py
imports: from __future__ import annotations
  from typing import Dict, List, Type
  from cleanlab.datalab.internal.issue_manager import ClassImbalanceIssueManager, DataValuationIssueManager, IssueManager, LabelIssueManager, NearDuplicateIssueManager, NonIIDIssueManager, ClassImbalanceIssueManager, UnderperformingGroupIssueManager, DataValuationIssueManager, OutlierIssueManager, NullIssueManager
  from cleanlab.datalab.internal.issue_manager.regression import RegressionLabelIssueManager
label_desc: Use image node_id 1 for calling a global function with example usage: register(cls, task) and returns: cls