code: def test_invalid_modes(self):
      # Modes 'r+', 'r', and 'w+' cannot work with PyTensor, becausei
      # the output array may be modified inplace, and that should not
      # modify the original file.
      path = Variable(Generic(), None)
      for mmap_mode in ("r+", "r", "w+", "toto"):
          with pytest.raises(ValueError):
              load(path, "int32", (None,), mmap_mode)
  
file_path: pytensor/tests/tensor/test_io.py
imports: import os
  import numpy
  import pytest
  import pytensor
  from pytensor import function
  from pytensor.graph.basic import Variable
  from pytensor.link.c.type import Generic
  from pytensor.tensor.io import load
label_desc: Use image node_id 3 for calling the TestLoadTensor obj's underlying member method code with example usage: obj.test_invalid_modes() without return types