scripts/github_stats.py
def get_license(self, repo):
        """
        Checks to see if the given repo has a top level LICENSE file.
        """
        if self.search_limit >= 28:
            print 'Hit search limit. Sleeping for 60 sec.'
            time.sleep(60)
            self.search_limit = 0
        self.search_limit += 1
        search_results = self.logged_in_gh.search_code('license'
            + 'in:path repo:' + repo.full_name)
        try:
            for result in search_results:
                path = result.path[1:]
                if '/' not in path and 'license' in path.lower():
                    self.total_licenses += 1
                    return path
            return 'MISS'
        except (StopIteration) as e:
            return 'MISS'
def get_license(self, repo):
        """
        Checks to see if the given repo has a top level LICENSE file.
        """
        if self.search_limit >= 28:
            print 'Hit search limit. Sleeping for 60 sec.'
            time.sleep(60)
            self.search_limit = 0
        self.search_limit += 1
        search_results = self.logged_in_gh.search_code('license'
            + 'in:path repo:' + repo.full_name)
        try:
            for result in search_results:
                path = result.path[1:]
                if '/' not in path and 'license' in path.lower():
                    self.total_licenses += 1
                    return path
            return 'MISS'
        except (StopIteration) as e:
            return 'MISS'
Checks to see if the given repo has a top level LICENSE file.