human
Complete this python program:
def get_encoder(encoding, *args, **kwargs):
assistant
#Here is the Python code you requested.

    """Returns a L{codec.Encoder} capable of encoding AMF[C{encoding}] streams.
    @raise ValueError: Unknown C{encoding}.
    """
    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)