code: def reset_state(chain):
      assert isinstance(chain, (chainer.Chain, chainer.ChainList))
      for link in chain.children():
          if isinstance(link, chainer.links.LSTM):
              link.reset_state()
          elif isinstance(link, Recurrent):
              link.reset_state()
          elif isinstance(link, (chainer.Chain, chainer.ChainList)):
              reset_state(link)
  
imports: from abc import ABCMeta
  from abc import abstractmethod
  import collections
  import contextlib
  import chainer
label_desc: Use image node_id 5 for calling a global function with example usage: reset_state(chain) without return types