class_docstr: Scheduler to upload a local folder to the Hub at regular intervals (e.g. push to hub every 5 minutes).
  
  The scheduler is started when instantiated and run indefinitely. At the end of your script, a last commit is
  triggered. Checkout the [upload guide](https://huggingface.co/docs/huggingface_hub/guides/upload#scheduled-uploads)
  to learn more about how to use it.
  
  Args:
      repo_id (`str`):
          The id of the repo to commit to.
      folder_path (`str` or `Path`):
          Path to the local folder to upload regularly.
      every (`int` or `float`, *optional*):
          The number of minutes between each commit. Defaults to 5 minutes.
      path_in_repo (`str`, *optional*):
          Relative path of the directory in the repo, for example: `"checkpoints/"`. Defaults to the root folder
          of the repository.
      repo_type (`str`, *optional*):
          The type of the repo to commit to. Defaults to `model`.
      revision (`str`, *optional*):
          The revision of the repo to commit to. Defaults to `main`.
      private (`bool`, *optional*):
          Whether to make the repo private. Defaults to `False`. This value is ignored if the repo already exist.
      token (`str`, *optional*):
          The token to use to commit to the repo. Defaults to the token saved on the machine.
      allow_patterns (`List[str]` or `str`, *optional*):
          If provided, only files matching at least one pattern are uploaded.
      ignore_patterns (`List[str]` or `str`, *optional*):
          If provided, files matching any of the patterns are not uploaded.
      squash_history (`bool`, *optional*):
          Whether to squash the history of the repo after each commit. Defaults to `False`. Squashing commits is
          useful to avoid degraded performances on the repo when it grows too large.
      hf_api (`HfApi`, *optional*):
          The [`HfApi`] client to use to commit to the Hub. Can be set with custom settings (user agent, token,...).
  
  Example:
  ```py
  >>> from pathlib import Path
  >>> from huggingface_hub import CommitScheduler
  
  # Scheduler uploads every 10 minutes
  >>> csv_path = Path("watched_folder/data.csv")
  >>> CommitScheduler(repo_id="test_scheduler", repo_type="dataset", folder_path=csv_path.parent, every=10)
  
  >>> with csv_path.open("a") as f:
  ...     f.write("first line")
  
  # Some time later (...)
  >>> with csv_path.open("a") as f:
  ...     f.write("second line")
  ```
class_docstr_tok: ["Scheduler","to","upload","a","local","folder","to","the","Hub","at","regular","intervals","(","e.g",".","push","to","hub","every","5","minutes",")",".","The","scheduler","is","started","when","instantiated","and","run","indefinitely",".","At","the","end","of","your","script",",","a","last","commit","is","triggered",".","Checkout","the","[","upload","guide","]","(","https",":","\/\/huggingface.co\/docs\/huggingface_hub\/guides\/upload","#","scheduled-uploads",")","to","learn","more","about","how","to","use","it",".","Args",":","repo_id","(","`","str","`",")",":","The","id","of","the","repo","to","commit","to",".","folder_path","(","`","str","`","or","`","Path","`",")",":","Path","to","the","local","folder","to","upload","regularly",".","every","(","`","int","`","or","`","float","`",",","*","optional","*",")",":","The","number","of","minutes","between","each","commit",".","Defaults","to","5","minutes",".","path_in_repo","(","`","str","`",",","*","optional","*",")",":","Relative","path","of","the","directory","in","the","repo",",","for","example",":","`","``","checkpoints\/","''","`",".","Defaults","to","the","root","folder","of","the","repository",".","repo_type","(","`","str","`",",","*","optional","*",")",":","The","type","of","the","repo","to","commit","to",".","Defaults","to","`","model","`",".","revision","(","`","str","`",",","*","optional","*",")",":","The","revision","of","the","repo","to","commit","to",".","Defaults","to","`","main","`",".","private","(","`","bool","`",",","*","optional","*",")",":","Whether","to","make","the","repo","private",".","Defaults","to","`","False","`",".","This","value","is","ignored","if","the","repo","already","exist",".","token","(","`","str","`",",","*","optional","*",")",":","The","token","to","use","to","commit","to","the","repo",".","Defaults","to","the","token","saved","on","the","machine",".","allow_patterns","(","`","List","[","str","]","`","or","`","str","`",",","*","optional","*",")",":","If","provided",",","only","files","matching","at","least","one","pattern","are","uploaded",".","ignore_patterns","(","`","List","[","str","]","`","or","`","str","`",",","*","optional","*",")",":","If","provided",",","files","matching","any","of","the","patterns","are","not","uploaded",".","squash_history","(","`","bool","`",",","*","optional","*",")",":","Whether","to","squash","the","history","of","the","repo","after","each","commit",".","Defaults","to","`","False","`",".","Squashing","commits","is","useful","to","avoid","degraded","performances","on","the","repo","when","it","grows","too","large",".","hf_api","(","`","HfApi","`",",","*","optional","*",")",":","The","[","`","HfApi","`","]","client","to","use","to","commit","to","the","Hub",".","Can","be","set","with","custom","settings","(","user","agent",",","token",",","...",")",".","Example",":","``","`","py",">",">",">","from","pathlib","import","Path",">",">",">","from","huggingface_hub","import","CommitScheduler","#","Scheduler","uploads","every","10","minutes",">",">",">","csv_path","=","Path","(","``","watched_folder\/data.csv","''",")",">",">",">","CommitScheduler","(","repo_id=","''","test_scheduler","''",",","repo_type=","''","dataset","''",",","folder_path=csv_path.parent",",","every=10",")",">",">",">","with","csv_path.open","(","``","a","''",")","as","f",":","...","f.write","(","``","first","line","''",")","#","Some","time","later","(","...",")",">",">",">","with","csv_path.open","(","``","a","''",")","as","f",":","...","f.write","(","``","second","line","''",")","``","`"]
docstr: Stop the scheduler.
  
  A stopped scheduler cannot be restarted. Mostly for tests purposes.
docstr_tok: ["Stop","the","scheduler",".","A","stopped","scheduler","can","not","be","restarted",".","Mostly","for","tests","purposes","."]
code: def stop(self) -> None:
      """Stop the scheduler.
  
      A stopped scheduler cannot be restarted. Mostly for tests purposes.
      """
      self.__stopped = True
  
imports: import atexit
  import logging
  import os
  import time
  from concurrent.futures import Future
  from dataclasses import dataclass
  from io import SEEK_END, SEEK_SET, BytesIO
  from pathlib import Path
  from threading import Lock, Thread
  from typing import Dict, List, Optional, Union
  from .hf_api import IGNORE_GIT_FOLDER_PATTERNS, CommitInfo, CommitOperationAdd, HfApi
  from .utils import filter_repo_objects
label_desc: Use image node_id 2 for calling the CommitScheduler obj's underlying member method code with example usage: obj.stop() without return types