code: def test_warn_report():
      """Checks if calling session.report function outside of session raises warning."""
  
      fn = report
  
      with warnings.catch_warnings(record=True) as record:
          warnings.simplefilter("always")
          # Ignore Deprecation warnings.
          warnings.filterwarnings("ignore", category=DeprecationWarning)
          assert not fn(dict())
  
      assert fn.__name__ in record[0].message.args[0]
  
      reset_log_once_with_str(fn.__name__)
  
imports: import tempfile
  import time
  import warnings
  import pytest
  import ray
  from ray.air._internal.util import StartTraceback
  from ray.air.constants import SESSION_MISUSE_LOG_ONCE_KEY
  from ray.air.session import get_checkpoint, get_dataset_shard, get_local_rank, get_world_rank, get_world_size, report
  from ray.train._internal.accelerator import Accelerator
  from ray.train._internal.session import get_accelerator, get_session, init_session, set_accelerator, shutdown_session
  from ray.train._internal.storage import StorageContext
  from ray.train.error import SessionMisuseError
  from ray.train.tests.util import create_dict_checkpoint, load_dict_checkpoint
label_desc: Use image node_id 19 for calling a global function with example usage: test_warn_report() without return types