code: def _maybe_reset_state(reset, s_zero, s):
      if not isinstance(s, tf.TensorArray) and s.shape.rank > 0:
          return tf.compat.v1.where(reset, s_zero, s)
      else:
          return s
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
  from tf_agents.utils import common
label_desc: Use image node_id 4 for calling a global function with example usage: _maybe_reset_state(reset, s_zero, s) and returns: tf, s