def get_encoder(encoding, *args, **kwargs):
 def _get_encoder_class():
  if (encoding == AMF0):
   try:
    from cpyamf import amf0
   except ImportError:
    from pyamf import amf0
   return amf0.Encoder
  elif (encoding == AMF3):
   try:
    from cpyamf import amf3
   except ImportError:
    from pyamf import amf3
   return amf3.Encoder
  raise ValueError(('Unknown encoding %r' % (encoding,)))
 return _get_encoder_class()(*args, **kwargs)

def get_encoder ( encoding , * args , ** kwargs ) : def _get_encoder_class ( ) : if ( encoding == AMF0 ) : try : from cpyamf import amf0 except ImportError : from pyamf import amf0 return amf0 . Encoder elif ( encoding == AMF3 ) : try : from cpyamf import amf3 except ImportError : from pyamf import amf3 return amf3 . Encoder raise ValueError ( ( 'Unknown encoding %r' % ( encoding , ) ) ) return _get_encoder_class ( ) ( * args , ** kwargs )
returns a l{codec .