Whether a given MetricDescriptorType value is a gauge.

    :type md_type: int
    :param md_type: A MetricDescriptorType enum value.
961669
def is_gauge(md_type):
    
    if md_type not in metric_descriptor.MetricDescriptorType:
        raise ValueError  # pragma: NO COVER

    return md_type in {
        metric_descriptor.MetricDescriptorType.GAUGE_INT64,
        metric_descriptor.MetricDescriptorType.GAUGE_DOUBLE,
        metric_descriptor.MetricDescriptorType.GAUGE_DISTRIBUTION
    }
857942
def get_metric_descriptor(self):
          # noqa
        with self._md_cache_lock:
            if self._metric_descriptor is None:
                self._metric_descriptor = metric_descriptor.MetricDescriptor(
                    self.name,
                    self.description,
                    self.measure.unit,
                    metric_utils.get_metric_type(self.measure,
                                                 self.aggregation),
                    # TODO: add label key description
                    [label_key.LabelKey(tk, "") for tk in self.columns])
        return self._metric_descriptor
302078
def gauge(self, stats, value):
        
        self.update_stats(stats, value, self.SC_GAUGE)
821176
public boolean isType(final org.efaps.admin.datamodel.Type _type)
    {
        return getType().equals(_type);
    }
1014732
private Object getEnumValue(EnumValueDescriptor enumDesc) {
    if (enumSerialization == EnumSerialization.NAME) {
      return getCustSerializedEnumValue(enumDesc.getOptions(), enumDesc.getName());
    } else {
      return enumDesc.getNumber();
    }
  }
331151
def has_value_of_type(self, var_type):
        
        if self.has_value() and self.has_type(var_type):
            return True
        return False
24883
def is_valid_intensity_measure_types(self):
        
        if self.ground_motion_correlation_model:
            for imt in self.imtls:
                if not (imt.startswith('SA') or imt == 'PGA'):
                    raise ValueError(
                        'Correlation model %s does not accept IMT=%s' % (
                            self.ground_motion_correlation_model, imt))
        if self.risk_files:  # IMTLs extracted from the risk files
            return (self.intensity_measure_types is None and
                    self.intensity_measure_types_and_levels is None)
        elif not hasattr(self, 'hazard_imtls') and not hasattr(
                self, 'risk_imtls'):
            return False
        return True
431963
def is_protected_type(obj):
    
    return isinstance(obj, six.integer_types + (type(None), float, Decimal,
        datetime.datetime, datetime.date, datetime.time))
498086
def _MakeEnumValueDescriptor(self, value_proto, index):
    

    return descriptor.EnumValueDescriptor(
        name=value_proto.name,
        index=index,
        number=value_proto.number,
        options=_OptionsOrNone(value_proto),
        type=None)
481173
@VisibleForTesting
  static MetricKind createMetricKind(Type type) {
    if (type == Type.GAUGE_INT64 || type == Type.GAUGE_DOUBLE) {
      return MetricKind.GAUGE;
    } else if (type == Type.CUMULATIVE_INT64
        || type == Type.CUMULATIVE_DOUBLE
        || type == Type.CUMULATIVE_DISTRIBUTION) {
      return MetricKind.CUMULATIVE;
    }
    return MetricKind.UNRECOGNIZED;
  }
660783
def data_type(self, data_type):
        
        allowed_values = ["string", "number", "date", "color"]
        if data_type is not None and data_type not in allowed_values:
            raise ValueError(
                "Invalid value for `data_type` ({0}), must be one of {1}"
                .format(data_type, allowed_values)
            )

        self._data_type = data_type
476713
@VisibleForTesting
  static MetricDescriptor.ValueType createValueType(Type type) {
    if (type == Type.CUMULATIVE_DOUBLE || type == Type.GAUGE_DOUBLE) {
      return MetricDescriptor.ValueType.DOUBLE;
    } else if (type == Type.GAUGE_INT64 || type == Type.CUMULATIVE_INT64) {
      return MetricDescriptor.ValueType.INT64;
    } else if (type == Type.GAUGE_DISTRIBUTION || type == Type.CUMULATIVE_DISTRIBUTION) {
      return MetricDescriptor.ValueType.DISTRIBUTION;
    }
    return MetricDescriptor.ValueType.UNRECOGNIZED;
  }
904666
def chart_type(self, value):
        
        if value not in self._allowed_charts:
            raise ValueError("Not a valid chart type")

        self.options["chart_type"] = value
818933
def _astype(self, dtype, **kwargs):
        
        dtype = pandas_dtype(dtype)

        # if we are passed a datetime64[ns, tz]
        if is_datetime64tz_dtype(dtype):
            values = self.values
            if getattr(values, 'tz', None) is None:
                values = DatetimeIndex(values).tz_localize('UTC')
            values = values.tz_convert(dtype.tz)
            return self.make_block(values)

        # delegate
        return super()._astype(dtype=dtype, **kwargs)
896829
def dnxhd_type=(dnxhd_type)
      validator = EnumAttributeValidator.new('String', ["36", "45", "60", "75", "90", "90x", "110", "115", "120", "145", "175x", "175", "185x", "185", "220x", "220"])
      unless validator.valid?(dnxhd_type)
        fail ArgumentError, "invalid value for 'dnxhd_type', must be one of #{validator.allowable_values}."
      end
      @dnxhd_type = dnxhd_type
    end
1031983
private boolean isTypedTimeLegalSoFar() {
        Node node = mLegalTimesTree;
        for (int keyCode : mTypedTimes) {
            node = node.canReach(keyCode);
            if (node == null) {
                return false;
            }
        }
        return true;
    }
291499
def register_metric_descriptor(self, oc_md):
        """"""
        metric_type = self.get_metric_type(oc_md)
        with self._md_lock:
            if metric_type in self._md_cache:
                return self._md_cache[metric_type]

        descriptor = self.get_metric_descriptor(oc_md)
        project_name = self.client.project_path(self.options.project_id)
        sd_md = self.client.create_metric_descriptor(project_name, descriptor)
        with self._md_lock:
            self._md_cache[metric_type] = sd_md
        return sd_md