80e4f15860b6b002f2dd3f420eaeff63e202eb2f,numerapi/numerapi.py,NumerAPI,upload_predictions,#NumerAPI#Any#,375

Before Change



        // get information for current competition
        competition = self.get_competition()
        dataset_id = competition["dataset_id"]
        competition_id = competition["_id"]

        // open file
        with open(file_path, "rb") as fp:

After Change


            }
            """
        variable = {"filename": os.path.basename(file_path)}
        submission_resp = self._call(auth_query, variable, authorization=True)
        submission_auth = submission_resp["data"]["submission_upload_auth"]
        file_object = open(file_path, "rb").read()
        requests.put(submission_auth["url"], data=file_object)
        create_query = \
            """
            mutation($filename: String!) {
                create_submission(filename: $filename) {
                    id
                }
            }
            """
        variables = {"filename": submission_auth["filename"]}
        create = self._call(create_query, variables, authorization=True)
        self.submission_id = create["data"]["create_submission"]["id"]
        return self.submission_id
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: uuazed/numerapi
Commit Name: 80e4f15860b6b002f2dd3f420eaeff63e202eb2f
Time: 2017-11-18
Author: wolfgang@steitz.me
File Name: numerapi/numerapi.py
Class Name: NumerAPI
Method Name: upload_predictions


Project Name: lufficc/SSD
Commit Name: 685250f5ee3ba20f6dd796a6730c9e8a0b450064
Time: 2019-06-25
Author: luffy.lcc@gmail.com
File Name: ssd/structures/container.py
Class Name: Container
Method Name: to


Project Name: lufficc/SSD
Commit Name: 685250f5ee3ba20f6dd796a6730c9e8a0b450064
Time: 2019-06-25
Author: luffy.lcc@gmail.com
File Name: ssd/structures/container.py
Class Name: Container
Method Name: numpy