Call the provided function to return the Gauge value.

        The function must return a float, and may be called from
        multiple threads. All other methods of the Gauge become NOOPs.
967003
def set_function(self, f):
        

        def samples(self):
            return (('', {}, float(f())),)

        self._child_samples = types.MethodType(samples, self)
1306758
function(value, attr, fn, model, computed, indices) {
        return fn.call(this, value, attr, model, computed, indices);
      }
775005
function(func, context, argCount) {
                if (context === void 0) return func;
                switch (argCount == null ? 3 : argCount) {
                  case 1: return function(value) {
                    return func.call(context, value);
                  };
                  case 2: return function(value, other) {
                    return func.call(context, value, other);
                  };
                  case 3: return function(value, index, collection) {
                    return func.call(context, value, index, collection);
                  };
                  case 4: return function(accumulator, value, index, collection) {
                    return func.call(context, accumulator, value, index, collection);
                  };
                }
                return function() {
                  return func.apply(context, arguments);
                };
              }
1231757
def call(function):
    
    message = 'call:%s.%s' % (function.__module__,function.__name__)
    @functools.wraps(function)
    def wrapper(*args, **kwargs):
        _collect(message)
        return function(*args, **kwargs)

    return wrapper
304929
def gauge(self, stat, value, rate=1, delta=False):
        """"""
        if value < 0 and not delta:
            if rate < 1:
                if random.random() > rate:
                    return
            with self.pipeline() as pipe:
                pipe._send_stat(stat, '0|g', 1)
                pipe._send_stat(stat, '%s|g' % value, 1)
        else:
            prefix = '+' if delta and value >= 0 else ''
            self._send_stat(stat, '%s%s|g' % (prefix, value), rate)
603779
def run(self):
        
        target = getattr(self, '_Thread__target', getattr(self, '_target', None))
        args = getattr(self, '_Thread__args', getattr(self, '_args', None))
        kwargs = getattr(self, '_Thread__kwargs', getattr(self, '_kwargs', None))
        if target is not None:
            self._return = target(*args, **kwargs)

        return None
486394
def get_gauge(self, name=None):
        '''
        '''
        return self.get_client(name=name, class_=statsd.Gauge)
1005928
def invoke_in_mainloop(func, *args, **kwargs):
    
    results = queue.Queue()

    @gcall
    def run():
        try:
            data = func(*args, **kwargs)
            results.put(data)
            results.put(None)
        except BaseException:  # XXX: handle
            results.put(None)
            results.put(sys.exc_info())
            raise

    data = results.get()
    exception = results.get()

    if exception is None:
        return data
    else:
        tp, val, tb = results.get()
        raise tp, val, tb
236648
def getfloat(self, key, **kwargs):
        

        return self.get(key, cast_func=float, **kwargs)
1175038
def const_return(func):
    
    result = _undef

    def ret_call(*args, **kwargs):
        nonlocal result
        if result is _undef:
            result = func(*args, **kwargs)
        return result

    return ret_call
801541
def _call(self, x):
        """"""

        if abs(x.ufuncs.sum() / self.sum_value - 1) <= self.sum_rtol:
            return 0
        else:
            return np.inf
1212195
def call_decorator(cls, func):
        

        @wraps(func)
        def _wrap(self, *args, **kwargs):
            try:
                return func(self, *args, **kwargs)
            except Exception:
                self.logger.exception('While executing benchmark')
                if not (self.catch_child_exception or False):
                    raise

        return _wrap
1049698
def _at_return(self, calculator, rule, scope, block):
        
        # TODO should assert this only happens within a @function
        ret = calculator.calculate(block.argument)
        raise SassReturn(ret)
810097
def getValue(self):
        
        func = dill.loads(self._func)
        return func(*self._args)
790971
def fn_float(self, value):
        

        if is_ndarray(value) or isinstance(value, (list, tuple)):
            return self._to_ndarray(value).astype('float')
        else:
            return float(value)
156882
function displayValue(gauge) {
    if (gauge.options.animatedValue) {
        return gauge.options.value;
    }

    return gauge.value;
}
1231278
def getFloat(t):
    
    d = c_double()
    if PL_get_float(t, byref(d)):
        return d.value
    else:
        raise InvalidTypeError("float")