<commit_before>import requests

GITHUB_API_URL = "https://api.github.com/graphql"

QUERY = """
query($repository_owner:String!,
      $repository_name: String!,
      $count: Int!) {
  repository(owner: $repository_owner,
             name: $repository_name) {
    
    refs(last: $count,refPrefix:"refs/tags/") {
      nodes {
        name
        target {
          commitUrl
        }
      }
    }
    
    releases(last: $count) {
      nodes {
        tag {
          name
          prefix
        }
      }
    }

  }
}
"""

class Github:

    def __authorization_header(self):
        return "token " + self.token

    def __request_headers(self):
        return {
            'authorization': self.__authorization_header(),
        }

    def __init__(self, token):
        self.token = token

    def getTagsAndReleases(self, repository_owner, repository_name, count):
        payload = {"query": QUERY,
                   "variables": {
                       "repository_owner": repository_owner,
                       "repository_name": repository_name,
                       "count": count
                   }}
        print "Requesting for", repository_name
        response = requests.post(GITHUB_API_URL, json=payload, headers=self.__request_headers())
        print "Got status code for", repository_name, response.status_code
        return response.json()<commit_msg>Newline change<commit_after>import requests

GITHUB_API_URL = "https://api.github.com/graphql"

QUERY = """
query($repository_owner:String!,
      $repository_name: String!,
      $count: Int!) {
  repository(owner: $repository_owner,
             name: $repository_name) {
    
    refs(last: $count,refPrefix:"refs/tags/") {
      nodes {
        name
        target {
          commitUrl
        }
      }
    }
    
    releases(last: $count) {
      nodes {
        tag {
          name
          prefix
        }
      }
    }

  }
}
"""


class Github:
    def __authorization_header(self):
        return "token " + self.token

    def __request_headers(self):
        return {
            'authorization': self.__authorization_header(),
        }

    def __init__(self, token):
        self.token = token

    def getTagsAndReleases(self, repository_owner, repository_name, count):
        payload = {"query": QUERY,
                   "variables": {
                       "repository_owner": repository_owner,
                       "repository_name": repository_name,
                       "count": count
                   }}
        print "Requesting for", repository_name
        response = requests.post(GITHUB_API_URL, json=payload, headers=self.__request_headers())
        print "Got status code for", repository_name, response.status_code
        return response.json()
{'fraction_non_alphanumeric': 0.10499820208558072, 'fraction_numerical': 0.0, 'mean_word_length': 1.8858921161825726, 'pattern_counts': {'":': 10, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '438388', 'n_tokens_mistral': 789, 'n_tokens_neox': 756, 'n_words': 150}