class_docstr: Indicator for periodically resetting the tree state after a certain time.
  
  The indicator will maintain a state to track the previous restart time.
class_docstr_tok: ["Indicator","for","periodically","resetting","the","tree","state","after","a","certain","time",".","The","indicator","will","maintain","a","state","to","track","the","previous","restart","time","."]
docstr: Gets next bool indicator and advances the state.
  
  Args:
    state: The current state.
  
  Returns:
    A pair (value, new_state) where value is the bool indicator and new_state
      of time.
docstr_tok: ["Gets","next","bool","indicator","and","advances","the","state",".","Args",":","state",":","The","current","state",".","Returns",":","A","pair","(","value",",","new_state",")","where","value","is","the","bool","indicator","and","new_state","of","time","."]
code: def next(self, state):
      """Gets next bool indicator and advances the state.
  
      Args:
        state: The current state.
  
      Returns:
        A pair (value, new_state) where value is the bool indicator and new_state
          of time.
      """
      current_time = tf.timestamp()
      current_period = current_time - state
      reset_flag = tf.math.greater(
          current_period,
          tf.convert_to_tensor(
              self.period_seconds, current_period.dtype
          ),
      )
      if reset_flag:
          state = current_time
      return reset_flag, state
  
imports: import abc
  import collections
  from typing import Optional
  import tensorflow
  from tensorflow_privacy.privacy.dp_query import dp_query
label_desc: Use image node_id 3 for calling the PeriodicTimeRestartIndicator obj's underlying member method code with example usage: obj.next(state) and returns: reset_flag,  state