code: def robust_query(
      self, max_trials: Optional[int] = None, *args, **kwargs
  ):
      from snowflake.connector.errors import (
          OperationalError,
          ProgrammingError,
      )
  
      ntrials = 0
      while True:
          try:
              return self.query(*args, **kwargs)
          except (OperationalError, ProgrammingError) as e:
              if max_trials is not None and ntrials >= max_trials:
                  raise
              logger.info(
                  f"Snowflake insert failed, will retry in 5s {e}"
              )
              ntrials += 1
              time.sleep(5)
  
file_path: evals/evals/utils/snowflake.py
imports: import logging
  import os
  import time
  from contextlib import contextmanager
  from typing import Optional
label_desc: Use image node_id 6 for calling the SnowflakeConnection obj's underlying member method code with example usage: obj.robust_query(max_trials) and returns: self