<commit_before>"""Path related utilities."""

from os.path import commonprefix


def sub_path(path, parent):
    """Returns the portion of ``path`` that lies under ``parent``"""
    return path[len(commonprefix((path, parent))) + 1:]<commit_msg>pyflu: path.sub_path converts paths to absolute paths<commit_after>"""Path related utilities."""

from os.path import commonprefix, abspath


def sub_path(path, parent):
    """Returns the portion of ``path`` that lies under ``parent``"""
    path = abspath(path)
    parent = abspath(parent)
    return path[len(commonprefix((path, parent))) + 1:]
{'fraction_non_alphanumeric': 0.15008431703204048, 'fraction_numerical': 0.003372681281618887, 'mean_word_length': 5.252631578947368, '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': '4841393', 'n_tokens_mistral': 179, 'n_tokens_neox': 170, 'n_words': 56}