(values_conf)
Returns a function to generate metric values based on configuration

    There are two modes of operation:
    1. Use functions from the python random library to generate data; the config
       should be a dict in the format

       {'distribution': <function_name>, 'params': <distribution_parameters>}

       where function_name is a function from random, and distribution_parameters
       is the kwargs for the distribution function.
    2. Return a constant
Returns a function to generate metric values based on configuration
Returns a function to generate metric values based on configuration
def get_values_function(values_conf):
    """ Returns a function to generate metric values based on configuration

    There are two modes of operation:
    1. Use functions from the python random library to generate data; the config
       should be a dict in the format

       {'distribution': <function_name>, 'params': <distribution_parameters>}

       where function_name is a function from random, and distribution_parameters
       is the kwargs for the distribution function.
    2. Return a constant
    """
    try:
        gen_func = getattr(random, values_conf["distribution"])
        return lambda: gen_func(**values_conf["params"])
    except (AttributeError, TypeError):
        return lambda: int(values_conf)
def get_values_function ( values_conf ) : try : gen_func = getattr ( random , values_conf [ "distribution" ] ) return lambda : gen_func ( * * values_conf [ "params" ] ) except ( AttributeError , TypeError ) : return lambda : int ( values_conf )