docstr: Rerun the app with all state values up to date from the beginning to
  fix rollbacks.
docstr_tok: ["Rerun","the","app","with","all","state","values","up","to","date","from","the","beginning","to","fix","rollbacks","."]
code: def sync(self):
      """
      Rerun the app with all state values up to date from the beginning to
      fix rollbacks.
      """
      data_to_bytes = self._state["hasher"].to_bytes(
          self._state["data"], None
      )
  
      # Ensure to rerun only once to avoid infinite loops
      # caused by a constantly changing state value at each run.
      #
      # Example: state.value += 1
      if self._state["is_rerun"]:
          self._state["is_rerun"] = False
  
      elif self._state["hash"] is not None:
          if self._state["hash"] != data_to_bytes:
              self._state["is_rerun"] = True
              self._state["session"].request_rerun(None)
  
      self._state["hash"] = data_to_bytes
  
file_path: promptsource/promptsource/session.py
imports: from streamlit.hashing import _CodeHasher
  from streamlit.report_thread import get_report_ctx
  from streamlit.server.server import Server
label_desc: Use image node_id 8 for calling the _SessionState obj's underlying member method code with example usage: obj.sync() without return types