<commit_before>import os
from utils import normalize_path


def ensure(links, basedir):
    for src, dst in links.iteritems():
        if not os.path.isabs(src):
            src = os.path.join(basedir, src)
        dst = normalize_path(dst)
        if not os.path.islink(dst):
            print "linking {src} to {dst}".format(src=src, dst=dst)
            os.symlink(src, dst)
<commit_msg>make path normalization more robust<commit_after>import os
from utils import normalize_path


def ensure(links, basedir):
    for src, dst in links.iteritems():
        dst, src = normalize_path(dst), normalize_path(src)
        if not os.path.isabs(src):
            src = os.path.join(basedir, src)
        if not os.path.islink(dst):
            print "linking {src} to {dst}".format(src=src, dst=dst)
            os.symlink(src, dst)

{'fraction_non_alphanumeric': 0.11835748792270531, 'fraction_numerical': 0.0, 'mean_word_length': 2.6519823788546257, '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': '2595657', 'n_tokens_mistral': 273, 'n_tokens_neox': 264, 'n_words': 72}