code: def encode(*args, **kwargs):
      
      encoding = kwargs.pop('encoding', DEFAULT_ENCODING)
      encoder = get_encoder(encoding, **kwargs)
  
      [encoder.writeElement(el) for el in args]
  
      stream = encoder.stream
      stream.seek(0)
  
      return stream
docs: A helper function to encode an element.
  
      @param args: The python data to be encoded.
      @kwarg encoding: AMF encoding type. One of L{ENCODING_TYPES}.
      @return: A L{util.BufferedByteStream} object that contains the data.