        def remove_callables(x):
            """Omit callable elements from input with arbitrary nesting."""
            if isinstance(x, dict):
                return {
                    k: remove_callables(v)
                    for k, v in six.iteritems(x)
                    if not callable(v)
                }
            elif isinstance(x, list):
                return [remove_callables(i) for i in x if not callable(i)]
            return x
Omit callable elements from input with arbitrary nesting.
utils/hparam.py