99a1522f89b93b12917087ae7ae7d910cf0c2cf1,sounds/models.py,Sound,compute_crc,#Sound#Any#,731

Before Change



    def compute_crc(self, commit=True):
        p = subprocess.Popen(["crc32", self.locations("path")], stdout=subprocess.PIPE)
        self.crc = p.communicate()[0].split(" ")[0][:-1]
        if commit:
            self.save()

    def create_moderation_ticket(self):

After Change


            self.save()

    def compute_crc(self, commit=True):
        with open(self.locations("path"), "rb") as fp:
            data = fp.read()
        crc = zlib.crc32(data)
        self.crc = "{:0>8x}".format(crc & 0xffffffff)  // right aligned with zero-padding, width of 8 chars

        if commit:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: MTG/freesound
Commit Name: 99a1522f89b93b12917087ae7ae7d910cf0c2cf1
Time: 2018-07-18
Author: phil.tgun@gmail.com
File Name: sounds/models.py
Class Name: Sound
Method Name: compute_crc


Project Name: osmr/imgclsmob
Commit Name: d9f6e28568406c162b79f582ae037a89a3118d26
Time: 2021-02-16
Author: osemery@gmail.com
File Name: prep_model.py
Class Name:
Method Name: post_process


Project Name: undertheseanlp/underthesea
Commit Name: 80ee39154b951c2c50ae2067f560aad81510a13f
Time: 2017-07-04
Author: brother.rain.1024@gmail.com
File Name: tests/word_sent/test_word_sent.py
Class Name:
Method Name: load_input