<commit_before>import binascii
import os
import subprocess
import sys

from litex.gen.fhdl import *
from litex.soc.interconnect.csr import *

def git_root():
    if sys.platform == "win32":
        git = subprocess.Popen(
            "git rev-parse --show-toplevel",
            cwd=os.path.dirname(__file__),
            stdout=subprocess.PIPE,
        )
        path = subprocess.check_output(
            "cygpath -wf -",
            stdin=git.stdout,
        )
        git.wait()
        return path.decode('ascii').strip()
    else:
        return subprocess.check_output(
            "git rev-parse --show-toplevel",<commit_msg>Move comment from pull request into the code.<commit_after>import binascii
import os
import subprocess
import sys

from litex.gen.fhdl import *
from litex.soc.interconnect.csr import *

def git_root():
    if sys.platform == "win32":
	# Git on Windows is likely to use Unix-style paths (`/c/path/to/repo`),
	# whereas directories passed to Python should be Windows-style paths
	# (`C:/path/to/repo`) (because Python calls into the Windows API). 
	# `cygpath` converts between the two.
        git = subprocess.Popen(
            "git rev-parse --show-toplevel",
            cwd=os.path.dirname(__file__),
            stdout=subprocess.PIPE,
        )
        path = subprocess.check_output(
            "cygpath -wf -",
            stdin=git.stdout,
        )
        git.wait()
        return path.decode('ascii').strip()
    else:
        return subprocess.check_output(
            "git rev-parse --show-toplevel",
{'fraction_non_alphanumeric': 0.11218568665377177, 'fraction_numerical': 0.0025789813023855577, 'mean_word_length': 2.2132505175983437, 'pattern_counts': {'":': 2, '<': 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': '2930373', 'n_tokens_mistral': 492, 'n_tokens_neox': 472, 'n_words': 118}