code: def test_pickle_disallow(tmpdir):
      data_dir = os.path.join(os.path.dirname(__file__), "data")
  
      path = os.path.join(data_dir, "py2-objarr.npy")
      assert_raises(
          ValueError,
          np.load,
          path,
          allow_pickle=False,
          encoding="latin1",
      )
  
      path = os.path.join(data_dir, "py2-objarr.npz")
      with np.load(path, allow_pickle=False, encoding="latin1") as f:
          assert_raises(ValueError, f.__getitem__, "x")
  
      path = os.path.join(tmpdir, "pickle-disabled.npy")
      assert_raises(
          ValueError,
          np.save,
          path,
          np.array([None], dtype=object),
          allow_pickle=False,
      )
  
imports: import sys
  import os
  import warnings
  import pytest
  from io import BytesIO
  import numpy
  from numpy.testing import assert_, assert_array_equal, assert_raises, assert_raises_regex, assert_warns, IS_PYPY, IS_WASM
  from numpy.testing._private.utils import requires_memory
  from numpy.lib import format
label_desc: Use image node_id 14 for calling a global function with example usage: test_pickle_disallow(tmpdir) without return types