code: def mask_recurrent_state_at(link, recurrent_state, indices):
      if recurrent_state is None:
          return None
      if isinstance(link, L.NStepLSTM):
          h, c = recurrent_state
          # shape: (n_layers, batch_size, out_size)
          assert h.ndim == 3
          assert c.ndim == 3
          mask = link.xp.ones_like(h.array)
          mask[:, indices] = 0
          c = c * mask
          h = h * mask
          return (h, c)
      if isinstance(link, (L.NStepGRU, L.NStepRNNReLU, L.NStepRNNTanh)):
          h = recurrent_state
          # shape: (n_layers, batch_size, out_size)
          assert h.ndim == 3
          mask = link.xp.ones_like(h.array)
          mask[:, indices] = 0
          h = h * mask
          return h
      if isinstance(link, StatelessRecurrent):
          return link.mask_recurrent_state_at(recurrent_state, indices)
      else:
          raise ValueError("{} is not a recurrent link".format(link))
  
imports: from cached_property import cached_property
  import chainer
  import chainer.functions
  import chainer.links
  import numpy
label_desc: Use image node_id 9 for calling a global function with example usage: mask_recurrent_state_at(link, recurrent_state, indices) and returns: None, h,  c, h, link