code: def avg_num_tokens_decoder(x):
      if x is None:
          return None
      if type(x) == bytes:
          return x.decode("utf-8")
      return str(x)
  
file_path: ludwig/ludwig/utils/automl/utils.py
imports: import bisect
  import logging
  from typing import Dict
  from numpy import nan_to_num
  from pandas import Series
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.constants import BINARY, CATEGORY, COMBINER, CONFIG, HYPEROPT, IMBALANCE_DETECTION_RATIO, NAME, NUMBER, PARAMETERS, SEARCH_ALG, TRAINER, TYPE
  from ludwig.features.feature_registries import get_output_type_registry
  from ludwig.modules.metric_registry import get_metric_objective
  from ludwig.schema.combiners.utils import get_combiner_jsonschema
label_desc: Use image node_id 1 for calling a global function with example usage: avg_num_tokens_decoder(x) and returns: str, None, x