aws_lambda_decorators/decoders.py
def decode(annotation, value):
    """
    Converts an annotated string to a python dictionary.

    If :annotation: is not empty, use decode_:annotation:(:value:) to convert to dictionary.

    Existing decoders:
         annotation     decoder
          [json]      decode_json
          [jwt]       decode_jwt
           [n]        where n is a number. Decodes the value as an array, and picks item n from the array

    Args:
        annotation (str): the type of encoding of the value (e.g. 'json', 'jwt').
        value (str): the value to be converted from given annotation to a dictionary.

    Returns:
        decoded dictionary.
    """
    if annotation:
        if annotation.isdigit():
            return value[int(annotation)]

        module_name = sys.modules[__name__]
        func_name = DECODE_FUNC_NAME % annotation
        if hasattr(module_name, func_name):
            func = getattr(module_name, func_name)
            return func(value)

        LOGGER.error(DECODE_FUNC_MISSING_ERROR, annotation)

    return value

    Converts an annotated string to a python dictionary.

    If :annotation: is not empty, use decode_:annotation:(:value:) to convert to dictionary.

    Existing decoders:
         annotation     decoder
          [json]      decode_json
          [jwt]       decode_jwt
           [n]        where n is a number. Decodes the value as an array, and picks item n from the array

    Args:
        annotation (str): the type of encoding of the value (e.g. 'json', 'jwt').
        value (str): the value to be converted from given annotation to a dictionary.

    Returns:
        decoded dictionary.
    
Converts an annotated string to a python dictionary.

Existing decoders:
annotation     decoder
[json]      decode_json
[jwt]       decode_jwt
[n]        where n is a number. Decodes the value as an array, and picks item n from the array
Converts an annotated string to a python dictionary . Existing decoders : annotation decoder [ json ] decode_json [ jwt ] decode_jwt [ n ] where n is a number . Decodes the value as an array and picks item n from the array
def decode(annotation, value):
    if annotation:
        if annotation.isdigit():
            return value[int(annotation)]
        module_name = sys.modules[__name__]
        func_name = DECODE_FUNC_NAME % annotation
        if hasattr(module_name, func_name):
            func = getattr(module_name, func_name)
            return func(value)
        LOGGER.error(DECODE_FUNC_MISSING_ERROR, annotation)
    return value
def decode ( annotation , value ) : if annotation : if annotation . isdigit ( ) : return value [ int ( annotation ) ] module_name = sys . modules [ __name__ ] func_name = DECODE_FUNC_NAME % annotation if hasattr ( module_name , func_name ) : func = getattr ( module_name , func_name ) return func ( value ) LOGGER . error ( DECODE_FUNC_MISSING_ERROR , annotation ) return value
Converts an annotated string to a python dictionary.
Converts an annotated string to a python dictionary .
"""
    Converts an annotated string to a python dictionary.

    If :annotation: is not empty, use decode_:annotation:(:value:) to convert to dictionary.

    Existing decoders:
         annotation     decoder
          [json]      decode_json
          [jwt]       decode_jwt
           [n]        where n is a number. Decodes the value as an array, and picks item n from the array

    Args:
        annotation (str): the type of encoding of the value (e.g. 'json', 'jwt').
        value (str): the value to be converted from given annotation to a dictionary.

    Returns:
        decoded dictionary.
    """
None
annotation
the type of encoding of the value .
the type of encoding of the value .
value
the value to be converted from given annotation to a dictionary.
the value to be converted from given annotation to a dictionary .