def unroll_definitions(definitions):

    for key, spec in definitions.iteritems():
        if isinstance(spec, dict):
            for arg_type in ['args', 'kwargs']:
                if arg_type in spec:
                    spec[arg_type] = _unroll_spec(spec[arg_type])
Unrolls definitions ensuring all arg/kwarg specs are tuples of (key, expected_type).
dataset/ETHPy150Open Fizzadar/ElasticQuery/elasticquery/dsl_util.py/unroll_definitions