def to_rule(self, fields, label='name', missing=None):
        # externally forcing missing to True or False depending on the path
        if missing is None:
            missing = self.missing
        if label is not None:
            name = fields[self.field][label]
        else:
            name = u""
        full_term = self.is_full_term(fields)
        relation_missing = u" or missing" if missing else u""
        if self.term is not None:
            relation_suffix = ''
            if ((self.operator == '<' and self.value <= 1) or
                    (self.operator == '<=' and self.value == 0)):
                relation_literal = (u'is not equal to' if full_term
                                    else u'does not contain')
            else:
                relation_literal = u'is equal to' if full_term else u'contains'
                if not full_term:
                    if self.operator != '>' or self.value != 0:
                        relation_suffix = (RELATIONS[self.operator] %
                                           (self.value,
                                            plural('time', self.value)))
            return u"%s %s %s %s%s" % (name, relation_literal,
                                       self.term, relation_suffix,
                                       relation_missing)
        if self.value is None:
            return u"%s %s" % (name,
                               u"is missing" if self.operator == '='
                               else u"is not missing")
        return u"%s %s %s%s" % (name,
                                self.operator,
                                self.value,
                                relation_missing)
Construct a metric descriptor from the parsed JSON representation.
dataset/ETHPy150Open bigmlcom/python/bigml/predicate.py/Predicate.to_rule--crossover with--dataset/ETHPy150Open GoogleCloudPlatform/gcloud-python/gcloud/monitoring/metric.py/MetricDescriptor._from_dict