code: def byteify(input_object):
      
      if isinstance(input_object, dict):
          return {byteify(key): byteify(value)
                  for key, value in list(input_object.items())}
      elif isinstance(input_object, list):
          return [byteify(element) for element in input_object]
      elif isinstance(input_object, str):
          return input_object.encode('utf-8')
      else:
          return input_object
docs: Recursive function to transform an object to byte.
  
      :param input_object: A python object such as unicode, dictionary or list.
      :type: unicode, list, dict
  
      :return: The object with byte only.