b796de41049aa3b3696a6b7242799284c3f0c641,python/ray/util/metrics.py,Metric,record,#Metric#Any#Any#,75

Before Change


                        f"Tag values must be str, got {type(val)}.")

        default_tag_copy = self._default_tags.copy()
        default_tag_copy.update(tags or {})
        self._metric.record(value, tags=default_tag_copy)

    @property
    def info(self) -> Dict[str, Any]:

After Change


                    raise TypeError(
                        f"Tag values must be str, got {type(val)}.")

        final_tags = {}
        tags_copy = tags.copy() if tags else {}
        for tag_key in self._tag_keys:
            // Prefer passed tags over default tags.
            if tags is not None and tag_key in tags:
                final_tags[tag_key] = tags_copy.pop(tag_key)
            elif tag_key in self._default_tags:
                final_tags[tag_key] = self._default_tags[tag_key]
            else:
                raise ValueError(f"Missing value for tag key {tag_key}.")

        if len(tags_copy) > 0:
            raise ValueError(
                f"Unrecognized tag keys: {list(tags_copy.keys())}.")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 8

Instances


Project Name: ray-project/ray
Commit Name: b796de41049aa3b3696a6b7242799284c3f0c641
Time: 2021-01-20
Author: ed.nmi.oakes@gmail.com
File Name: python/ray/util/metrics.py
Class Name: Metric
Method Name: record


Project Name: has2k1/plotnine
Commit Name: 0811f4f25cdaee7bd49098441b4adce1fe8edfdc
Time: 2014-02-01
Author: greg@yhatHQ.com
File Name: ggplot/geoms/geom.py
Class Name: geom
Method Name: __init__


Project Name: merenlab/anvio
Commit Name: 04bd843050842490a291ce610079a268f043a287
Time: 2019-12-12
Author: alon.shaiber@gmail.com
File Name: anvio/migrations/config/v0_to_v1.py
Class Name:
Method Name: migrate


Project Name: prody/ProDy
Commit Name: bfe9a636ea6bd4f858b86880aa84de45b33b511a
Time: 2018-03-13
Author: shz66@pitt.edu
File Name: prody/atomic/atomic.py
Class Name:
Method Name: