code: def _lazyselect(condlist, choicelist, arrays, default=0):
      """
      Mimic `np.select(condlist, choicelist)`.
  
      Notice it assumes that all `arrays` are of the same shape, or can be
      broadcasted together.
  
      All functions in `choicelist` must accept array arguments in the order
      given in `arrays` and must return an array of the same shape as broadcasted
      `arrays`.
  
      Examples
      --------
      >>> x = np.arange(6)
      >>> np.select([x <3, x > 3], [x**2, x**3], default=0)
      array([  0,   1,   4,   0,  64, 125])
  
      >>> _lazyselect([x < 3, x > 3], [lambda x: x**2, lambda x: x**3], (x,))
      array([   0.,    1.,    4.,   0.,   64.,  125.])
  
      >>> a = -np.ones_like(x)
      >>> _lazyselect([x < 3, x > 3],
      ...             [lambda x, a: x**2, lambda x, a: a * x**3],
      ...             (x, a), default=np.nan)
      array([   0.,    1.,    4.,   nan,  -64., -125.])
  
      """
      arrays = np.broadcast_arrays(*arrays)
      tcode = np.mintypecode([a.dtype.char for a in arrays])
      out = _valarray(
          np.shape(arrays[0]), value=default, typecode=tcode
      )
      for index in range(len(condlist)):
          func, cond = choicelist[index], condlist[index]
          if np.all(cond is False):
              continue
          cond, _ = np.broadcast_arrays(cond, arrays[0])
          temp = tuple(np.extract(cond, arr) for arr in arrays)
          np.place(out, cond, func(*temp))
      return out
  
imports: from __future__ import division, print_function, absolute_import
  import functools
  import operator
  import sys
  import warnings
  import numbers
  from collections import namedtuple
  from multiprocessing import Pool
  import inspect
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: _lazyselect(condlist, choicelist, arrays, default) and returns: out