code: def _where_v1(condition, x=None, y=None):
      """Implements tf1.where."""
      # V1 did not support broadcasting, and instead applied the dimensions of
      # `condition` to the left hand dims of x and y.
      if x is None and y is None:
          return np.where(condition)
      dtype = utils.common_dtype([x, y])
      x = convert_to_tensor(x, dtype=dtype)
      y = convert_to_tensor(y, dtype=dtype)
      while condition.ndim < max(x.ndim, y.ndim):
          condition = condition[
              ..., np.newaxis
          ]  # add 1 dims until rank matches
      return np.where(condition, x, y)
  
imports: import collections
  import contextlib
  import numpy
  from tensorflow_probability.python.internal.backend.numpy import _utils
  from tensorflow_probability.python.internal.backend.numpy import initializers
  from tensorflow_probability.python.internal.backend.numpy import linalg_impl
  from tensorflow_probability.python.internal.backend.numpy import numpy_logging
  from tensorflow_probability.python.internal.backend.numpy.gen.tensor_shape import Dimension
  from tensorflow_probability.python.internal.backend.numpy.numpy_array import *
  from tensorflow_probability.python.internal.backend.numpy.ops import convert_to_tensor
  from tensorflow_probability.python.internal.backend.numpy.ops import Module
  from tensorflow_probability.python.internal.backend.numpy.ops import name_scope
  from tensorflow_probability.python.internal.backend.numpy.ops import Variable
  from tensorflow_probability.python.internal.backend.numpy.random_generators import set_seed
  from tensorflow_probability.python.internal.backend.numpy.tensor_array_ops import TensorArray
label_desc: Use image node_id 4 for calling a global function with example usage: _where_v1(condition, x, y) and returns: np, np