<commit_before># -*- coding: utf-8 -*-
import dulwich
import StringIO
from eforge.browser.interface import *

class GitRepository(IRepository):
    def __init__(self, path):
        self.repo = dulwich.repo.Repo(path)

    def __findrefs(self, prefix):
        grefs = self.repo.refs
        refs = {}
        for ref in grefs.keys():
            if ref.startswith(prefix):
                refs[ref[len(prefix):]] = GitRevision(self, self.repo.refs.follow(ref))

        return refs

    @property
    def branches(self):
        return self.__findrefs('refs/heads/')

    @property
    def tags(self):
        return self.__findrefs('refs/tags/')

    def revision(self, id):
        return GitRevision(self, id)

    @property
    def head(self):
        return GitRevision(self, self.repo.head())

    @property
    def revisions(self, num):
        revs = []

        walk = self.repo.get_graph_walker()<commit_msg>I left the @property marker on the GitRepository::revisions method. Gaah.<commit_after># -*- coding: utf-8 -*-
import dulwich
import StringIO
from eforge.browser.interface import *

class GitRepository(IRepository):
    def __init__(self, path):
        self.repo = dulwich.repo.Repo(path)

    def __findrefs(self, prefix):
        grefs = self.repo.refs
        refs = {}
        for ref in grefs.keys():
            if ref.startswith(prefix):
                refs[ref[len(prefix):]] = GitRevision(self, self.repo.refs.follow(ref))

        return refs

    @property
    def branches(self):
        return self.__findrefs('refs/heads/')

    @property
    def tags(self):
        return self.__findrefs('refs/tags/')

    def revision(self, id):
        return GitRevision(self, id)

    @property
    def head(self):
        return GitRevision(self, self.repo.head())

    def revisions(self, num):
        revs = []

        walk = self.repo.get_graph_walker()
{'fraction_non_alphanumeric': 0.12420382165605096, 'fraction_numerical': 0.0010615711252653928, 'mean_word_length': 2.458715596330275, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '1758733', 'n_tokens_mistral': 618, 'n_tokens_neox': 564, 'n_words': 133}