code: def _lazywhere(cond, arrays, f, fillvalue=None, f2=None):
      """
      np.where(cond, x, fillvalue) always evaluates x even where cond is False.
      This one only evaluates f(arr1[cond], arr2[cond], ...).
      For example,
      >>> a, b = np.array([1, 2, 3, 4]), np.array([5, 6, 7, 8])
      >>> def f(a, b):
          return a*b
      >>> _lazywhere(a > 2, (a, b), f, np.nan)
      array([ nan,  nan,  21.,  32.])
  
      Notice it assumes that all `arrays` are of the same shape, or can be
      broadcasted together.
  
      """
      if fillvalue is None:
          if f2 is None:
              raise ValueError("One of (fillvalue, f2) must be given.")
          else:
              fillvalue = np.nan
      else:
          if f2 is not None:
              raise ValueError(
                  "Only one of (fillvalue, f2) can be given."
              )
  
      arrays = np.broadcast_arrays(*arrays)
      temp = tuple(np.extract(cond, arr) for arr in arrays)
      tcode = np.mintypecode([a.dtype.char for a in arrays])
      out = _valarray(
          np.shape(arrays[0]), value=fillvalue, typecode=tcode
      )
      np.place(out, cond, f(*temp))
      if f2 is not None:
          temp = tuple(np.extract(~cond, arr) for arr in arrays)
          np.place(out, ~cond, f2(*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 3 for calling a global function with example usage: _lazywhere(cond, arrays, f, fillvalue, f2) and returns: out