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/tflite_rewriter.py
imports: import os
  import time
  from typing import Iterable, Optional, Sequence
  import numpy
  import tensorflow
  from tfx.components.trainer.rewriting import rewriter
  from tfx.dsl.io import fileio
  from tfx.utils import io_utils
label_desc: Use image node_id 2 for calling a global function with example usage: _ensure_str(value) and returns: value, value