'Create a release on GitHub or if it already exists, return the existing release'

def create_release(self, releases):

    for release in releases:
        if (release[u'tag_name'] == self.current_tag_name):
            return release
    url = (self.API + (u'repos/%s/%s/releases' % (self.username, self.reponame)))
    r = self.requests.post(url, data=json.dumps({u'tag_name': self.current_tag_name, u'target_commitish': u'master', u'name': (u'version    %s' % self.version), u'body': (u'Release    version    %s' % self.version), u'draft': False, u'prerelease': False}))
    if (r.status_code != 201):
        self.fail(r, (u'Failed    to    create    release    for    version:    %s' % self.version))
    return r.json()
