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

Before Change


                    "by this schema: {}".format(arg, required_args))

        // Check if given args have all required args.
        if len(required_args) != len(given_args):
            raise ValidationError("Given args: {} doesn"t have all the "
                                  "necessary args for this schema: {}".format(
                                      given_args, required_args))

        return cls(**obj)


class IngestRequest(BaseModel):

After Change


        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 "
                                          "exist in a given object {}".format(
                                              field, obj))
                else:
                    // Set default value if the field is optional
                    obj[field] = default

        return cls(**obj)


class IngestRequest(BaseModel):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

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: NifTK/NiftyNet
Commit Name: baecce5a6fbe4576ca8348a93dc56f07e7ba84f6
Time: 2019-06-05
Author: ucabtmv@ucl.ac.uk
File Name: niftynet/contrib/csv_reader/csv_reader.py
Class Name: CSVReader
Method Name: _parse_csv


Project Name: NifTK/NiftyNet
Commit Name: 2562b8547fce15f995bc36cadba34d3fd95acf58
Time: 2017-08-08
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/layer/histogram_normalisation.py
Class Name: HistogramNormalisationLayer
Method Name: train