<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_encoding(value=None):
 """Parse a value to a valid encoding. This function accepts either a member of :py:class:`~cg:cryptography.hazmat.primitives.serialization.Encoding` or a string describing a member. If no value is passed, it will assume ``PEM`` as a default value. Note that ``"ASN1"`` is treated as an alias for ``"DER"``. <Encoding.PEM: 'PEM'> <Encoding.DER: 'DER'> <Encoding.PEM: 'PEM'> """

    if value is None:
        return ca_settings.CA_DEFAULT_ENCODING
    elif isinstance(value, Encoding):
        return value
    elif isinstance(value, six.string_types):
        if value == 'ASN1':
            value = 'DER'

        try:
            return getattr(Encoding, value)
        except AttributeError:
            raise ValueError('Unknown encoding: %s' % value)
    else:
        raise ValueError('Unknown type passed: %s' % type(value).__name__)