<commit_before>import os

from pyrsistent import pvector
import attr

from filesystems.exceptions import InvalidPath


@attr.s(these={"segments": attr.ib()}, init=False, hash=True)
class Path(object):
    def __init__(self, *segments):
        self.segments = pvector(segments)

    def __str__(self):
        return os.sep + os.sep.join(self.segments)

    @classmethod
    def cwd(cls):
        return cls.from_string(os.getcwd())

    @classmethod
    def root(cls):
        return cls()

    @classmethod
    def from_string(cls, path):
        """
        Create a path out of an OS-specific string.

        """

        if not path:
            raise InvalidPath(path)

        split = path.split(os.sep)
        if split[0]:
            return RelativePath(*split)
        return cls(*split[1:])
<commit_msg>And now maybe this fixes that test, even though it's not fully correct yet.<commit_after>import os

from pyrsistent import pvector
import attr

from filesystems.exceptions import InvalidPath


@attr.s(these={"segments": attr.ib()}, init=False, hash=True)
class Path(object):
    def __init__(self, *segments):
        self.segments = pvector(segments)

    def __str__(self):
        return os.sep + os.sep.join(self.segments)

    @classmethod
    def cwd(cls):
        return cls.from_string(os.getcwd())

    @classmethod
    def root(cls):
        return cls()

    @classmethod
    def from_string(cls, path):
        """
        Create a path out of an OS-specific string.

        """

        if not path:
            raise InvalidPath(path)

        drive, rest = os.path.splitdrive(path)
        split = rest.split(os.sep)
        if split[0]:
            return RelativePath(*split)
        return cls(*split[1:])

{'fraction_non_alphanumeric': 0.11085582998276852, 'fraction_numerical': 0.0022975301550832855, 'mean_word_length': 2.463220675944334, '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': '3352510', 'n_tokens_mistral': 553, 'n_tokens_neox': 532, 'n_words': 142}