code: def register_encoder(name: str, features: Union[str, List[str]]):
      if isinstance(features, str):
          features = [features]
  
      def update_registry(registry_getter_fn, cls, feature):
          feature_registry = registry_getter_fn().get(feature, {})
          feature_registry[name] = cls
          registry_getter_fn()[feature] = feature_registry
  
      def wrap(cls):
          for feature in features:
              update_registry(get_encoder_registry, cls, feature)
          return cls
  
      return wrap
  
file_path: ludwig/ludwig/encoders/registry.py
imports: from typing import Dict, List, Type, Union
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.encoders.base import Encoder
  from ludwig.utils.registry import Registry
label_desc: Use image node_id 4 for calling a global function with example usage: register_encoder(name, features) and returns: wrap, cls