code: def as_str_any(value, encoding="utf-8"):
      """Converts input to `str` type.
  
         Uses `str(value)`, except for `bytes` typed inputs, which are converted
         using `as_str`.
  
      Args:
        value: A object that can be converted to `str`.
        encoding: Encoding for `bytes` typed inputs.
  
      Returns:
        A `str` object.
      """
      if isinstance(value, bytes):
          return as_str(value, encoding=encoding)
      else:
          return str(value)
  
file_path: tensorflow-upstream/tensorflow/python/util/compat.py
imports: import codecs
  import collections.abc
  import numbers
  import numpy
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 4 for calling a global function with example usage: as_str_any(value, encoding) and returns: as_str, str