1d532d1cb8b829bdf7055a22c206032ca0b72e46,python/ray/dashboard/metrics_exporter/schema.py,BaseModel,parse_obj,#Any#Any#,32

Before Change


    def parse_obj(cls, obj):
        assert type(obj) == dict, ("It can only parse dict type object.")
        required_args = cls.__slots__
        given_args = obj.keys()

        // Check if given_args have args that is not required.
        for arg in given_args:
            if arg not in required_args:

After Change


        // Validation.
        assert type(obj) == dict, ("It can only parse dict type object.")
        for field, schema in cls.__schema__.items():
            required, default, arg_type = schema
            if field not in obj:
                if required:
                    raise ValidationError("{} is required, but doesn"t "
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: ray-project/ray
Commit Name: 1d532d1cb8b829bdf7055a22c206032ca0b72e46
Time: 2020-04-02
Author: rkooo567@gmail.com
File Name: python/ray/dashboard/metrics_exporter/schema.py
Class Name: BaseModel
Method Name: parse_obj


Project Name: ray-project/ray
Commit Name: 460c2757a3a954f4de8812381bf83b86ecc07ec3
Time: 2021-03-03
Author: antoine@foobot.io
File Name: python/ray/experimental/tf_utils.py
Class Name: TensorFlowVariables
Method Name: set_weights


Project Name: ray-project/ray
Commit Name: ef498e8aa5cdfe09247d9c9efc7ef636378165c2
Time: 2020-05-15
Author: ed.nmi.oakes@gmail.com
File Name: python/ray/serve/policy.py
Class Name: PowerOfTwoPolicy
Method Name: __init__


Project Name: hanxiao/bert-as-service
Commit Name: b44d6115097e2bebc4a1ecef869e04e2c60af7bb
Time: 2018-12-15
Author: hanhxiao@tencent.com
File Name: benchmark.py
Class Name:
Method Name: