docs: def _is_json(string):
          """Test if input string is in JSON format.
  
          :param string: Input string.
          :type string: :py:class:`str` or :py:class:`bytes`
          :return: Input string if in JSON format or False otherwise.
          :rtype: :py:class:`str` or :py:obj:`False`
          """
          try:
              if isinstance(string, bytes):
                  string = string.decode("utf-8")
                  json.loads(string)
              elif isinstance(string, str):
                  json.loads(string)
              else:
                  raise TypeError("Expecting <class 'str'> or <class 'bytes'>, but {} was passed".format(type(string)))
              return string
  
          except ValueError:
              return False