class_docstr: Create a retryable version of a function.
  
  Calling this will call the passed function, retrying if any exceptions in
  retryable_exceptions are caught, with exponential backoff.
class_docstr_tok: ["Create","a","retryable","version","of","a","function",".","Calling","this","will","call","the","passed","function",",","retrying","if","any","exceptions","in","retryable_exceptions","are","caught",",","with","exponential","backoff","."]
code: def _sleep_check_cancelled(
      self, wait_seconds: float, cancel_event: Optional[threading.Event]
  ) -> bool:
      if not cancel_event:
          SLEEP_FN(wait_seconds)
          return False
      cancelled = cancel_event.wait(wait_seconds)
      return cancelled
  
imports: import abc
  import asyncio
  import datetime
  import functools
  import logging
  import os
  import random
  import threading
  import time
  from typing import Any, Awaitable, Callable, Generic, Optional, Tuple, Type, TypeVar
  from requests import HTTPError
  import wandb
  from wandb.util import CheckRetryFnType
  from .mailbox import ContextCancelledError
label_desc: Use image node_id 2 for calling the Retry obj's underlying member method code with example usage: obj._sleep_check_cancelled(wait_seconds, cancel_event) and returns: cancelled, False