code: def decode_bytes(byt, enc='utf-8'):
      
      try:
          strg = byt.decode(enc)
      except UnicodeDecodeError as err:
          strg = "Unable to decode message:\n{}\n{}".format(str(byt), err)
      except (AttributeError, UnicodeEncodeError):
          # If byt is already a string, just return it
          return byt
      return strg
docs: Given a string or bytes input, return a string.
  
          Args: bytes - bytes or string
                enc - encoding to use for decoding the byte string.