def construct_kwargs(**kwargs):
    ret = {}
    ret['source'] = {'provider_params': {}}

    # extend this when adding more args that should be passed to build_* functions
    recognized_kwargs = ['image', 'parent_registry', 'parent_registry_insecure',
                         'target_registries', 'target_registries_insecure', 'dont_pull_base_image']
    is_recognized_kwarg = lambda x: recognized_kwargs in x or x.startswith('source__')

    for k, v in kwargs.items():
        if is_recognized_kwarg(k):
            if k.startswith('source__provider_params__'):
                ret['source']['provider_params'][k.split('__')[-1]] = v
            elif k.startswith('source__'):
                ret['source'][k.split('__')[-1]] = v
            else:
                ret[k] = v

    return ret
dataset/ETHPy150Open projectatomic/atomic-reactor/atomic_reactor/cli/main.py/construct_kwargs/swapped operands of `in`