code: def zoneout(h, x, ratio=0.5, **kwargs):
      """zoneout(h, x, ratio=.5)
  
      Drops elements of input variable and sets to previous variable randomly.
  
      This function drops input elements randomly with probability ``ratio`` and
      instead sets dropping element to their previous variable. In testing mode ,
      it does nothing and just returns ``x``.
  
      Args:
          h (:class:`~chainer.Variable` or :ref:`ndarray`): Previous variable.
          x (:class:`~chainer.Variable` or :ref:`ndarray`): Input variable.
          ratio (float): Zoneout ratio.
  
      Returns:
          ~chainer.Variable: Output variable.
  
      See the paper: `Zoneout: Regularizing RNNs by Randomly Preserving Hidden
      Activations <https://arxiv.org/abs/1606.01305>`_.
  
      """
      if kwargs:
          argument.check_unexpected_kwargs(
              kwargs,
              train="train argument is not supported anymore. "
              "Use chainer.using_config",
          )
          argument.assert_kwargs_empty(kwargs)
  
      if configuration.config.train:
          return Zoneout(ratio).apply((h, x))[0]
      return x
  
file_path: chainer/chainer/functions/noise/zoneout.py
imports: import numpy
  from chainer import backend
  from chainer import configuration
  from chainer import function_node
  from chainer.utils import argument
  from chainer.utils import type_check
label_desc: Use image node_id 1 for calling a global function with example usage: zoneout(h, x, ratio) and returns: x, Zoneout