def input_filters(
    **filters
):
    def decorator(func):
        @functools.wraps(func)
        def wrapper(*args, **kwargs):
            filtered_kwargs = {}
            for key, value in kwargs.items():
                if key in filters:
                    if filters[key](value, *args, **kwargs):
                        filtered_kwargs[key] = value
                    else:
                        logging.debug(
                            'ignore filtered input key %s' % key
                        )
                else:
                    filtered_kwargs[key] = value
            return func(*args, **filtered_kwargs)
        return wrapper
    return decorator
Request kernel info.
dataset/ETHPy150Open openstack/compass-core/compass/db/api/utils.py/input_filters--crossover with--dataset/ETHPy150Open jupyter/jupyter_client/jupyter_client/client.py/KernelClient.kernel_info