def create_source(self, project, **kwargs):
        if 'revision_sha' not in kwargs:
            revision = self.create_revision(repository=project.repository)
            kwargs['revision_sha'] = revision.sha
        if 'data' not in kwargs:
            data = {
                'phabricator.revisionID': '1234',
                'phabricator.diffID': '54321',
                'phabricator.revisionURL': 'https://tails.corp.dropbox.com/D1234'
            }
            kwargs['data'] = data

        source = Source(
            repository_id=project.repository_id,
            **kwargs
        )
        db.session.add(source)
        db.session.commit()

        return source
dataset/ETHPy150Open dropbox/changes/changes/testutils/fixtures.py/Fixtures.create_source/original