def dynamize_value(val):
    def _str(val):
        """
        DynamoDB stores booleans as numbers. True is 1, False is 0.
        This function converts Python booleans into DynamoDB friendly
        representation.
        """
        if isinstance(val, bool):
            return str(int(val))
        return str(val)

    dynamodb_type = get_dynamodb_type(val)
    if dynamodb_type == 'N':
        val = {dynamodb_type: _str(val)}
    elif dynamodb_type == 'S':
        val = {dynamodb_type: val}
    elif dynamodb_type == 'NS':
        val = {dynamodb_type: [str(n) for n in val]}
    elif dynamodb_type == 'SS':
        val = {dynamodb_type: [n for n in val]}
    return val
POST to:
dataset/ETHPy150Open darcyliu/storyboard/boto/dynamodb/types.py/dynamize_value--crossover with--dataset/ETHPy150Open mozilla/inventory/core/keyvalue/api.py/kv_delete