anchor.diff:      tqdm
     ];
   
  +  preCheck = ''
  +    export HOME=$TMP
  +    export TEST_DEVICE=cpu
  +    export TEST_DTYPES=float32,float64  # half-precision tests fail on CPU
  +  '';
  +  # package only requires `unittest`, but use `pytest` to exclude tests
  +  checkInputs = [ pytestCheckHook ];
  +  disabledTests = [
  +    # requires FAISS (not in Nixpkgs)
  +    "test_accuracy_calculator_and_faiss"
  +    # require network access:
  +    "test_get_nearest_neighbors"
  +    "test_tuplestoweights_sampler"
  +    "test_untrained_indexer"
  +  ];
  +
     meta = {
       description = "Metric learning library for PyTorch";
       homepage = "https://github.com/KevinMusgrave/pytorch-metric-learning";
  
positive.code: 
  buildPythonPackage rec {
    pname   = "pytorch-metric-learning";
    version = "0.9.81";
  
    disabled = isPy27;
  
    src = fetchFromGitHub {
      owner = "KevinMusgrave";
      repo = pname;
      rev = "cb23328aba64f7f4658374cc2920ef5d56cda5c8";  # no version tag
      sha256 = "0c2dyi4qi7clln43481xq66f6r4fadrz84jphjc5phz97bp33ds8";
    };
  
    propagatedBuildInputs = [
  
negative.code: , isPy27
  , numpy
  , scikitlearn
  , pytestCheckHook
  , pytorch
  , torchvision
  , tqdm
  