class_docstr: Operator Registry
docstr: Register a class, function, or callable as a towhee operator.
  
  Args:
      name (str, optional): operator name, will use the class/function name if None.
  
      input_schema, output_schema, flag for legacy operators.
  
  Returns:
      [type]: [description]
docstr_tok: ["Register","a","class",",","function",",","or","callable","as","a","towhee","operator",".","Args",":","name","(","str",",","optional",")",":","operator","name",",","will","use","the","class\/function","name","if","None",".","input_schema",",","output_schema",",","flag","for","legacy","operators",".","Returns",":","[","type","]",":","[","description","]"]
code: def register(
      name: str = None,
      input_schema=None,  # pylint: disable=unused-argument
      output_schema=None,  # pylint: disable=unused-argument
      flag=None,  # pylint: disable=unused-argument
  ):
      """
      Register a class, function, or callable as a towhee operator.
  
      Args:
          name (str, optional): operator name, will use the class/function name if None.
  
          input_schema, output_schema, flag for legacy operators.
  
      Returns:
          [type]: [description]
      """
      if callable(name):
          # the decorator is called directly without any arguments,
          # relaunch the register
          cls = name
          return OperatorRegistry.register()(cls)
  
      def wrapper(cls):
          nonlocal name
          name = URI(
              cls.__name__ if name is None else name
          ).resolve_repo("anon")
  
          if isinstance(cls, types.FunctionType):
              OperatorRegistry.REGISTRY[name + "_func"] = cls
  
          # wrap a callable to a class
          if not isinstance(cls, type) and callable(cls):
              func = cls
              cls = type(
                  cls.__name__,
                  (object,),
                  {
                      "__call__": lambda _, *arg, **kws: func(
                          *arg, **kws
                      ),
                      "__doc__": func.__doc__,
                  },
              )
  
          if not hasattr(cls, "shared_type"):
              cls.shared_type = SharedType.Shareable
          OperatorRegistry.REGISTRY[name] = cls
  
          return cls
  
      return wrapper
  
imports: import types
  from typing import Any, Dict
  from towhee.operator import SharedType
  from .uri import URI
label_desc: Use image node_id 2 for calling the OperatorRegistry obj's underlying member method code with example usage: obj.register(name, input_schema, output_schema, flag) and returns: wrapper, OperatorRegistry, cls