def decode(dct, intype='json', raise_error=False):
    """ decode dict objects, via decoder plugins, to new type

    Parameters
    ----------
    intype: str
        use decoder method from_<intype> to encode
    raise_error : bool
        if True, raise ValueError if no suitable plugin found

    Examples
    --------
    >>> load_builtin_plugins('decoders')
    []

    >>> from decimal import Decimal
    >>> decode({'_python_Decimal_':'1.3425345'})
    Decimal('1.3425345')

    >>> unload_all_plugins()

    """
    for decoder in get_plugins('decoders').values():
        if (set(list(decoder.dict_signature)).issubset(dct.keys())
            and hasattr(decoder, 'from_{}'.format(intype))
                and getattr(decoder, 'allow_other_keys', False)):
            return getattr(decoder, 'from_{}'.format(intype))(dct)
            break
        elif (sorted(list(decoder.dict_signature)) == sorted(dct.keys())
              and hasattr(decoder, 'from_{}'.format(intype))):
            return getattr(decoder, 'from_{}'.format(intype))(dct)
            break

    if raise_error:
        raise ValueError('no suitable plugin found for: {}'.format(dct))
    else:
        return dct
def decode ( dct , intype = 'json' , raise_error = False ) : for decoder in get_plugins ( 'decoders' ) . values ( ) : if ( set ( list ( decoder . dict_signature ) ) . issubset ( dct . keys ( ) ) and hasattr ( decoder , 'from_{}' . format ( intype ) ) and getattr ( decoder , 'allow_other_keys' , False ) ) : return getattr ( decoder , 'from_{}' . format ( intype ) ) ( dct ) break elif ( sorted ( list ( decoder . dict_signature ) ) == sorted ( dct . keys ( ) ) and hasattr ( decoder , 'from_{}' . format ( intype ) ) ) : return getattr ( decoder , 'from_{}' . format ( intype ) ) ( dct ) break if raise_error : raise ValueError ( 'no suitable plugin found for: {}' . format ( dct ) ) else : return dct
decode dict objects, via decoder plugins, to new type

    Parameters
    ----------
    intype: str
        use decoder method from_<intype> to encode
    raise_error : bool
        if True, raise ValueError if no suitable plugin found

    Examples
    --------
    >>> load_builtin_plugins('decoders')
    []

    >>> from decimal import Decimal
    >>> decode({'_python_Decimal_':'1.3425345'})
    Decimal('1.3425345')

    >>> unload_all_plugins()