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

Before Change


        self.logger.info("uploading prediction...")

        // parse information for file upload
        filename, signed_url, headers = self.__authorize_file_upload(file_path)

        // get information for current competition
        competition = self.get_competition()

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: 5

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: bjherger/ResumeParser
Commit Name: e08fcab00157590859a9a19bd483825e9ba75c18
Time: 2019-03-29
Author: 13herger@gmail.com
File Name: bin/lib.py
Class Name:
Method Name: convert_pdf


Project Name: dPys/PyNets
Commit Name: b9e5bdd6e23ee782268b7f36e68fe23dd3bba4c5
Time: 2019-07-28
Author: dpisner@utexas.edu
File Name: pynets/registration/reg_utils.py
Class Name:
Method Name: match_target_vox_res