8a420e8ef11ebf828e5e5b33e8a830eb74c39d6a,baseline/services.py,ClassifierService,predict,#ClassifierService#Any#Any#Any#,215

Before Change


        tokens_batch = self.batch_input(tokens)
        self.prepare_vectorizers(tokens_batch)
        if self.preproc == "client":
            examples = self.vectorize(tokens_batch)
        elif self.preproc == "server":
            // TODO: here we allow vectorizers even for preproc=server to get `word_lengths`.
            // vectorizers should not be available when preproc=server.
            featurized_examples = self.vectorize(tokens_batch)
            examples = {
                        "tokens": np.array([" ".join(x) for x in tokens_batch]),
                        self.model.lengths_key: featurized_examples[self.model.lengths_key]
            }

After Change



        if backend not in {"tf"}:
            raise ValueError("only Tensorflow is currently supported for remote Services")
        import_user_module("baseline.{}.remote".format(backend))
        exp_type = kwargs.get("remote_type")
        if exp_type is None:
            exp_type = "http" if remote.startswith("http") else "grpc"
            exp_type = "{}-preproc".format(exp_type) if preproc == "server" else exp_type
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: dpressel/mead-baseline
Commit Name: 8a420e8ef11ebf828e5e5b33e8a830eb74c39d6a
Time: 2020-03-09
Author: blester125@gmail.com
File Name: baseline/services.py
Class Name: ClassifierService
Method Name: predict


Project Name: rodluger/starry
Commit Name: 099e35f9db7e3098d8a88b99a9f5460b52bab2fc
Time: 2019-05-01
Author: rodluger@gmail.com
File Name: starry/Map/bases/ld.py
Class Name: LimbDarkenedBase
Method Name: flux


Project Name: WZBSocialScienceCenter/tmtoolkit
Commit Name: 6ddfab1ac6105dddabc8463866f988645ed0d9c4
Time: 2019-07-26
Author: markus.konrad@wzb.eu
File Name: tmtoolkit/preprocess/_preprocworker.py
Class Name: PreprocWorker
Method Name: _task_filter_for_pos