class_docstr: A handler for check-ins for a given run.
  
  Uses filesystem to store the check-ins. Handles resumed `Run`s.
  Background thread is used to adjust the rate of check-ins written
  to the filesystem in order to avoid overloading.
  
  Calling `report_successful_finish()` is required to mark the run as
  finished, otherwise the run will be marked as failed.
class_docstr_tok: ["A","handler","for","check-ins","for","a","given","run",".","Uses","filesystem","to","store","the","check-ins",".","Handles","resumed","`","Run","`","s",".","Background","thread","is","used","to","adjust","the","rate","of","check-ins","written","to","the","filesystem","in","order","to","avoid","overloading",".","Calling","`","report_successful_finish","(",")","`","is","required","to","mark","the","run","as","finished",",","otherwise","the","run","will","be","marked","as","failed","."]
docstr: Touches the check-in file on the filesystem. This is blocking call.
  This will also queue the check-in for the next flush if necessary.
code: def _touch_flag(
      self,
      flag_name: str,
  ):
      """
      Touches the check-in file on the filesystem. This is blocking call.
      This will also queue the check-in for the next flush if necessary.
      """
      check_in = self.last_check_ins[flag_name]
  
      if (
          flag_name in self.physical_check_ins
          and self.physical_check_ins[flag_name].idx == check_in.idx
      ):
          logger.debug(
              f"Skipping touching `{flag_name}` as it is already up to date"
          )
          self.timed_tasks.pop(flag_name, None)
          logger.debug(
              f"{flag_name} is not scheduled anymore. It will be invoked as soon as next one appears"
          )
          return
  
      # Now let's touch the file on the filesystem
      new_check_in = check_in.touch(
          file_mgr=self.file_manager,
          run_hash=self.run_hash,
      )
  
      self.physical_check_ins[flag_name] = new_check_in
  
      # We will take the target (recommended) flush time much shorter.
      expiry_date = min(
          new_check_in.expiry_date, time.monotonic() + MAX_SUSPEND_TIME
      )
      # Now we reschedule the check-in for the next flush.
      new_timed_task = TimedTask(
          when=expiry_date,
          flag_name=flag_name,
      )
      self._schedule(new_timed_task)
      return new_check_in
  
imports: import math
  import time
  import queue
  import threading
  from collections import defaultdict
  from dataclasses import dataclass, field
  from pathlib import Path
  from typing import ClassVar, Dict, Optional, Tuple, Set, Union, TYPE_CHECKING
  from cachetools import LRUCache
  from aim.sdk.reporter.file_manager import FileManager
  import logging
label_desc: Use image node_id 2 for calling the RunStatusReporter obj's underlying member method code with example usage: obj._touch_flag(flag_name) and returns: new_check_in