code: def decode_if_bytes(obj, mode=True):
      
      if mode is True:
          mode = unicode_errors_default
      if isinstance(obj, bytes):
          return obj.decode("utf-8", errors=mode)
      return obj
docs: Decode obj if it is bytes.