code: def test_fast_isin():
      Y = np.random.randint(0, 10000, size=(100,))
      X = np.arange(10000)
      Z = fast_isin(X, Y)
      D = np.unique(Y)
      D.sort()
      T1 = (X[Z] == D).all()
  
      X = np.array(list(range(10000)) + list(range(10000)))
      Z = fast_isin(X, Y)
      T2 = (X[Z] == np.append(D, D.copy())).all()
  
      X = np.random.randint(0, 100, size=(40,))
      X.sort()
      Y = np.random.randint(0, 100, size=(60,))
      Y.sort()
  
      XinY = np.array([ind for ind in range(len(X)) if X[ind] in Y])
      YinX = np.array([ind for ind in range(len(Y)) if Y[ind] in X])
  
      T3 = (fast_isin(X, Y).nonzero()[0] == XinY).all()
      T4 = (fast_isin(Y, X).nonzero()[0] == YinX).all()
  
      assert T1 & T2 & T3 & T4
  
file_path: hyperopt/hyperopt/tests/unit/test_utils.py
imports: import numpy
  from nose.tools import raises, eq_
  import shutil
  import os
  from hyperopt.utils import fast_isin
  from hyperopt.utils import get_most_recent_inds
  from hyperopt.utils import temp_dir, working_dir, get_closest_dir, path_split_all
label_desc: Use image node_id 1 for calling a global function with example usage: test_fast_isin() without return types