def make_params(d):
    """Make a fake params structure from a dictionary

    e.g., x = dict(foo=dict(bar=5)) -> x.foo.bar = 5
    """

    class X(object):
        def __init__(self, d):
            for key in list(d.keys()):
                value = d[key]
                if isinstance(value, dict):
                    value = X(value)
                setattr(self, key, value)

    return X(d)