<commit_before>{ lib
, fetchFromGitHub
, buildPythonPackage
, numpy
, nose
, nbformat
, nbconvert
, jupyter
, chainer
, pytorch
, mxnet
, tensorflow
, keras
}:

buildPythonPackage rec {
  pname = "einops";
  version = "0.3.2";

  src = fetchFromGitHub {
    owner = "arogozhnikov";
    repo = pname;
    rev = "v${version}";
    sha256 = "0ix094cfh6w4bvx6ymp5dpm35y9nkaibcn1y50g6kwdp4f0473y8";
  };

  checkInputs = [
    nose
    numpy
    # For notebook tests
    nbformat
    nbconvert
    jupyter
    # For backend tests
    chainer
    pytorch
    mxnet
    tensorflow
    keras
  ];

  # No CUDA in sandbox
  EINOPS_SKIP_CUPY = 1;

  checkPhase = ''
    export HOME=$TMPDIR

    # Prevent hangs on PyTorch-related tests, see
    # https://discuss.pytorch.org/t/pytorch-cpu-hangs-on-nn-linear/17748/4
    export OMP_NUM_THREADS=1
<commit_msg>python3Packages.einops: 0.3.2 -> 0.4.1<commit_after>{ lib
, fetchFromGitHub
, buildPythonPackage
, numpy
, nose
, nbformat
, nbconvert
, jupyter
, chainer
, parameterized
, pytorch
, mxnet
, tensorflow
, keras
}:

buildPythonPackage rec {
  pname = "einops";
  version = "0.4.1";

  src = fetchFromGitHub {
    owner = "arogozhnikov";
    repo = pname;
    rev = "v${version}";
    hash = "sha256-n4R4lcRimuOncisCTs2zJWPlqZ+W2yPkvkWAnx4R91s=";
  };

  checkInputs = [
    nose
    numpy
    # For notebook tests
    nbformat
    nbconvert
    jupyter
    # For backend tests
    chainer
    parameterized
    pytorch
    mxnet
    tensorflow
    keras
  ];

  # No CUDA in sandbox
  EINOPS_SKIP_CUPY = 1;

  checkPhase = ''
    export HOME=$TMPDIR

    # Prevent hangs on PyTorch-related tests, see
    # https://discuss.pytorch.org/t/pytorch-cpu-hangs-on-nn-linear/17748/4
    export OMP_NUM_THREADS=1

{'fraction_non_alphanumeric': 0.10171428571428572, 'fraction_numerical': 0.036, 'mean_word_length': 2.8399122807017543, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 2, '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': '3220433', 'n_tokens_mistral': 759, 'n_tokens_neox': 714, 'n_words': 134}