content/test/gpu/flake_suppressor/queries.py
def GetFlakyOrFailingTests(sample_period, billing_project):
  """Gets all flaky or failing GPU tests in the given |sample_period|.

  Args:
    sample_period: An int containing the number of days in the past from the
        current time to pull results from.
    billing_project: A string containing the billing project to use for
        BigQuery queries.

  Returns:
    A JSON representation of the BigQuery results containing all found flaky or
    failing test results.
  """
  cmd = [
      'bq',
      'query',
      '--max_rows=%d' % MAX_ROWS,
      '--format=json',
      '--project_id=%s' % billing_project,
      '--use_legacy_sql=false',
      '--parameter=sample_period:INT64:%d' % sample_period,
      QUERY,
  ]

  with open(os.devnull, 'w') as devnull:
    completed_process = subprocess.run(cmd,
                                       stdout=subprocess.PIPE,
                                       stderr=devnull,
                                       check=True,
                                       text=True)
  return json.loads(completed_process.stdout)
Gets all flaky or failing GPU tests in the given |sample_period|.

  Args:
    sample_period: An int containing the number of days in the past from the
        current time to pull results from.
    billing_project: A string containing the billing project to use for
        BigQuery queries.

  Returns:
    A JSON representation of the BigQuery results containing all found flaky or
    failing test results.
  
Gets all flaky or failing GPU tests in the given |sample_period|.
Gets all flaky or failing GPU tests in the given |sample_period| .
def GetFlakyOrFailingTests(sample_period, billing_project):
  cmd = [
      'bq',
      'query',
      '--max_rows=%d' % MAX_ROWS,
      '--format=json',
      '--project_id=%s' % billing_project,
      '--use_legacy_sql=false',
      '--parameter=sample_period:INT64:%d' % sample_period,
      QUERY,
  ]
  with open(os.devnull, 'w') as devnull:
    completed_process = subprocess.run(cmd,
                                       stdout=subprocess.PIPE,
                                       stderr=devnull,
                                       check=True,
                                       text=True)
  return json.loads(completed_process.stdout)
def GetFlakyOrFailingTests ( sample_period , billing_project ) : cmd = [ 'bq' , 'query' , '--max_rows=%d' % MAX_ROWS , '--format=json' , '--project_id=%s' % billing_project , '--use_legacy_sql=false' , '--parameter=sample_period:INT64:%d' % sample_period , QUERY , ] with open ( os . devnull , 'w' ) as devnull : completed_process = subprocess . run ( cmd , stdout = subprocess . PIPE , stderr = devnull , check = True , text = True ) return json . loads ( completed_process . stdout )
Gets all flaky or failing GPU tests in the given |sample_period|.
Gets all flaky or failing GPU tests in the given |sample_period| .
"""Gets all flaky or failing GPU tests in the given |sample_period|.

  Args:
    sample_period: An int containing the number of days in the past from the
        current time to pull results from.
    billing_project: A string containing the billing project to use for
        BigQuery queries.

  Returns:
    A JSON representation of the BigQuery results containing all found flaky or
    failing test results.
  """
A JSON representation of the BigQuery results containing all found flaky or
failing test results.
A JSON representation of the BigQuery results containing all found flaky or failing test results .
sample_period
An int containing the number of days in the past from the
current time to pull results from.
An int containing the number of days in the past from the current time to pull results from .
billing_project
A string containing the billing project to use for
BigQuery queries.
A string containing the billing project to use for BigQuery queries .