18cdb177d7e87c34cdbc8245ce1b8e28cd070af2,dvaapp/models.py,Video,create_directory,#Video#Any#,68

Before Change



    def create_directory(self, create_subdirs=True):
        os.mkdir("{}/{}".format(settings.MEDIA_ROOT, self.pk))
        if create_subdirs:
            os.mkdir("{}/{}/video/".format(settings.MEDIA_ROOT, self.pk))
            os.mkdir("{}/{}/frames/".format(settings.MEDIA_ROOT, self.pk))
            os.mkdir("{}/{}/segments/".format(settings.MEDIA_ROOT, self.pk))
            os.mkdir("{}/{}/indexes/".format(settings.MEDIA_ROOT, self.pk))
            os.mkdir("{}/{}/regions/".format(settings.MEDIA_ROOT, self.pk))
            os.mkdir("{}/{}/transforms/".format(settings.MEDIA_ROOT, self.pk))
            os.mkdir("{}/{}/audio/".format(settings.MEDIA_ROOT, self.pk))


class IngestEntry(models.Model):
    video = models.ForeignKey(Video)
    ingest_index = models.IntegerField()
    ingest_filename = models.CharField(max_length=500)

After Change


                os.mkdir(d)
            except OSError:
                pass
        if create_subdirs:
            for s in ["video","frames","segments","indexes","regions","transforms","audio"]:
                d = "{}/{}/{}/".format(settings.MEDIA_ROOT, self.pk, s)
                if not os.path.exists(d):
                    try:
                        os.mkdir(d)
                    except OSError:
                        pass

class IngestEntry(models.Model):
    video = models.ForeignKey(Video)
    ingest_index = models.IntegerField()
    ingest_filename = models.CharField(max_length=500)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: AKSHAYUBHAT/DeepVideoAnalytics
Commit Name: 18cdb177d7e87c34cdbc8245ce1b8e28cd070af2
Time: 2017-11-05
Author: akshayubhat@gmail.com
File Name: dvaapp/models.py
Class Name: Video
Method Name: create_directory


Project Name: tryolabs/luminoth
Commit Name: fbcbb710c465da13ed6705fb8d904fe2795b246a
Time: 2018-02-08
Author: agustin@tryolabs.com
File Name: luminoth/models/base/truncated_base_network.py
Class Name: TruncatedBaseNetwork
Method Name: get_trainable_vars


Project Name: GPflow/GPflow
Commit Name: baf110d82f60c51a5680e728cd3c5c6d3536117d
Time: 2017-09-24
Author: art.art.v@gmail.com
File Name: gpflow/params.py
Class Name: ParamList
Method Name: __init__