<commit_before>{ stdenv, python, buildEnv, makeWrapper, recursivePthLoader, extraLibs ? [], postBuild ? ""
, stdLibs ? stdenv.lib.attrValues python.modules
}:

# Create a python executable that knows about additional packages.

(buildEnv {
  name = "python-${python.version}-wrapper";
  paths = stdenv.lib.filter (x : x ? pythonPath) (stdenv.lib.closePropagation extraLibs) ++ stdLibs ++ [ python recursivePthLoader ];
  ignoreCollisions = false;

  postBuild = ''
    . "${makeWrapper}/nix-support/setup-hook"

    if [ -L "$out/bin" ]; then
        unlink "$out/bin"
    fi
    mkdir -p "$out/bin"

    cd "${python}/bin"
    for prg in *; do
      rm -f "$out/bin/$prg"
      makeWrapper "${python}/bin/$prg" "$out/bin/$prg" --set PYTHONHOME "$out"
    done
  '' + postBuild;
}) // {
  inherit python;
  inherit (python) meta;
}<commit_msg>python-wrapper: add 'ignoreCollisions' parameter (which default to 'false')<commit_after>{ stdenv, python, buildEnv, makeWrapper, recursivePthLoader, extraLibs ? [], postBuild ? ""
, stdLibs ? stdenv.lib.attrValues python.modules, ignoreCollisions ? false
}:

# Create a python executable that knows about additional packages.

(buildEnv {
  name = "python-${python.version}-wrapper";
  paths = stdenv.lib.filter (x : x ? pythonPath) (stdenv.lib.closePropagation extraLibs) ++ stdLibs ++ [ python recursivePthLoader ];

  inherit ignoreCollisions;

  postBuild = ''
    . "${makeWrapper}/nix-support/setup-hook"

    if [ -L "$out/bin" ]; then
        unlink "$out/bin"
    fi
    mkdir -p "$out/bin"

    cd "${python}/bin"
    for prg in *; do
      rm -f "$out/bin/$prg"
      makeWrapper "${python}/bin/$prg" "$out/bin/$prg" --set PYTHONHOME "$out"
    done
  '' + postBuild;
}) // {
  inherit python;
  inherit (python) meta;
}
{'fraction_non_alphanumeric': 0.1571830985915493, 'fraction_numerical': 0.0, 'mean_word_length': 3.3529411764705883, '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': '5993579', 'n_tokens_mistral': 608, 'n_tokens_neox': 591, 'n_words': 147}