code: def _ensure_str(value):
      if isinstance(value, str):
          return value
      elif isinstance(value, bytes):
          return value.decode("utf-8")
      else:
          raise TypeError(f"Unexpected type {type(value)}.")
  
file_path: tfx/tfx/components/trainer/rewriting/tfjs_rewriter.py
imports: from tensorflowjs.converters import converter
  from tfx.components.trainer.rewriting import rewriter
label_desc: Use image node_id 2 for calling a global function with example usage: _ensure_str(value) and returns: value, value