code: def register_scorer(scorer_id: str, scorer_name: str):
      def register_scorer_class(
          scorer: Type[VizSeqScorer],
      ) -> Type[VizSeqScorer]:
          if scorer_id in _SCORER_REGISTRY:
              raise ValueError(
                  f"Cannot register duplicate scorer ({scorer_id})"
              )
          if not issubclass(scorer, VizSeqScorer):
              raise ValueError(
                  f"Scorer must be VizSeqScorer ({scorer_id})"
              )
          _SCORER_REGISTRY[scorer_id] = scorer
          _SCORER_ID_TO_NAME[scorer_id] = scorer_name
          return scorer
  
      return register_scorer_class
  
imports: from abc import abstractmethod
  import importlib
  import os
  import sys
  from pathlib import Path
  import math
  from typing import List, Optional, Set, Dict, Callable, NamedTuple, Tuple, Type
  from concurrent.futures import ProcessPoolExecutor, as_completed
  from multiprocessing import cpu_count
  import numpy
  from tqdm import tqdm
  from vizseq._utils.optional import map_optional
label_desc: Use image node_id 2 for calling a global function with example usage: register_scorer(scorer_id, scorer_name) and returns: register_scorer_class, scorer