Return a method supplying a value for a gauge.
426019
static Method getGaugeMethod(Registry registry, Id id, Object obj, String method) {
    try {
      final Method m = Utils.getMethod(obj.getClass(), method);
      try {
        // Make sure we can cast the response to a Number
        final Number n = (Number) m.invoke(obj);
        REGISTRY_LOGGER.debug(
            "registering gauge {}, using method [{}], with initial value {}", id, m, n);
        return m;
      } catch (Exception e) {
        final String msg = "exception thrown invoking method [" + m
            + "], skipping registration of gauge " + id;
        registry.propagate(msg, e);
      }
    } catch (NoSuchMethodException e) {
      final String mname = obj.getClass().getName() + "." + method;
      final String msg = "invalid method [" + mname + "], skipping registration of gauge " + id;
      registry.propagate(msg, e);
    }
    return null;
  }
976498
def value_get(method_name):
    

    def value_get(value, context, **_params):
        method = getattr(value, method_name)
        return _get(method, context["key"], (), {})

    return value_get
1135786
def get_value(self, expression):
        """"""
        self._check_valid()
        return super(Result, self).get_value(expression)
739430
def _value(self, obj, cls=None):
        """"""
        if obj is not None:
            return getattr(obj, self.propname)
        else:
            return getattr(cls, self.propname)
7873
protected Object getValue(SetterMethodCover method, Variable variable) {
        if(method.isTwoDimensionsArray()) 
            return assignValuesToTwoDimensionsArray(method, variable.getSFSArrayValue());
        if(method.isArray())
            return assignValuesToArray(method, variable);
        
        if(method.isColection())
            return assignValuesToCollection(method, variable);

        if(method.isObject())
            return assignValuesToObject(method, variable.getSFSObjectValue());
        if(method.isByte())
            return variable.getIntValue().byteValue();
        if(method.isChar())
            return (char)variable.getIntValue().byteValue();
        if(method.isFloat())
            return variable.getDoubleValue().floatValue();
        if(method.isLong())
            return variable.getDoubleValue().longValue();
        if(method.isShort())
            return variable.getIntValue().shortValue();
        return variable.getValue();
    }
1255372
def gauge(self, slug, current_value):
        
        k = self._gauge_key(slug)
        self.r.sadd(self._gauge_slugs_key, slug)  # keep track of all Gauges
        self.r.set(k, current_value)
1082308
def value(self):
        
        if self.opts['int']:
            return int(self.val)
        else:
            return float(self.val)
995145
private Object generateValue(MethodSymbol meth, Attribute attr) {
        ValueVisitor vv = new ValueVisitor(meth);
        return vv.getValue(attr);
    }
1341755
def value(self):
        """"""
        if self.ready is True:
            flag, load = self.__queue.get()
            if flag:
                return load
            raise load
218059
def get(self):
        
        self.log.info('starting the ``get`` method')

        # PRECISION TEST
        decprecision = len(repr(self.dec).split(".")[-1])
        raprecision = len(repr(self.ra).split(".")[-1])

        dec2 = self.dec + self.north

        ra2 = self.ra + \
            ((self.east) /
             (math.cos((self.dec + dec2) * self.DEG_TO_RAD_FACTOR / 2.)))

        # FIX VALUES THAT CROSS RA/DEC LIMITS
        while ra2 > 360. or ra2 < 0.:
            while ra2 > 360.:
                ra2 = ra2 - 360.
            while ra2 < 0.:
                ra2 = ra2 + 360.
        while dec2 > 90. or dec2 < -90.:
            while dec2 > 90.:
                dec2 = 180. - dec2
            while dec2 < -90.:
                dec2 = -180. - dec2

        ra2 = "%0.*f" % (raprecision, ra2)
        dec2 = "%0.*f" % (decprecision, dec2)

        self.log.info('completed the ``get`` method')
        return ra2, dec2
533511
def value(self, index):
        ""
        offset = units.offset(self._units[index])
        value_index = (index ^ offset) & units.PRECISION_MASK
        return units.value(self._units[value_index])
675344
def get(self):
        """"""
        if self.timer() > self.deadline:
            self.value = None
        return self.value
822577
def free(self):
        """"""
        if self._ptr is None:
            return
        Gauged.array_free(self.ptr)
        FloatArray.ALLOCATIONS -= 1
        self._ptr = None
215367
def compute(self):
        """"""
        self.value = self.value_provider()
        if self.value is not_computed:
            return None
        else:
            return self.value
626651
public <T> Gauge<T> register(
      final String component, final String methodName, final Gauge<T> gauge) {
    registry.register(
        MetricRegistry.name(component, methodName),
        new Gauge<T>() {
          @Override
          public T getValue() {
            return gauge.getValue();
          }
        });

    return gauge;
  }
1330750
def get(self, timeout=None):
        """"""
        self.wait(timeout)
        if self._state==self.FULFILLED:
            return self.value
        else:
            raise ValueError("Calculation didn't yield a value")
1123936
def get_value(self, key, args, kwargs):
        """"""
        if hasattr(self._item, key):
            return getattr(self._item, key)
        return super().get_value(key, args, kwargs)