code: def test_nondistributed_average():
      artificial_time = 1  # seconds
      num_tokens = 100
      average_upper_bound = num_tokens / artificial_time
      average_lower_bound = average_upper_bound * 0.9
      freq_metric = Frequency()
      freq_metric.reset()
      time.sleep(artificial_time)
      freq_metric.update(num_tokens)
      average = freq_metric.compute()
      assert average_lower_bound < average < average_upper_bound
  
file_path: ignite/tests/ignite/metrics/test_frequency.py
imports: import os
  import sys
  import time
  import pytest
  import torch
  import ignite.distributed
  from ignite.engine import Engine, Events
  from ignite.metrics import Frequency
label_desc: Use image node_id 1 for calling a global function with example usage: test_nondistributed_average() without return types