<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def hist_calls_with_dims(**dims):
 """Decorator to check the distribution of return values of a function with dimensions. """

    def hist_wrapper(fn):
        @functools.wraps(fn)
        def fn_wrapper(*args, **kwargs):
            _histogram = histogram(
                "%s_calls" % pyformance.registry.get_qualname(fn), **dims)
            rtn = fn(*args, **kwargs)
            if type(rtn) in (int, float):
                _histogram.add(rtn)
            return rtn
        return fn_wrapper
    return hist_wrapper