code: def test_process_results_per_session(seed: int):
      rng = np.random.default_rng(seed=seed)
  
      (
          per_session_results,
          preceding_user_turn_numbers_used_per_marker,
      ) = _generate_random_examples(num_markers=3, rng=rng)
      markers = sorted(
          preceding_user_turn_numbers_used_per_marker.keys()
      )
      num_sessions = len(per_session_results)
  
      stats = MarkerStatistics()
      sender_ids = []
      session_indices = []
      for session_idx, results in enumerate(per_session_results):
          sender_id = str(rng.choice(100))
          session_idx = int(rng.choice(100))
          stats.process(
              session_idx=session_idx,
              sender_id=sender_id,
              meta_data_on_relevant_events_per_marker=results,
          )
          sender_ids.append(sender_id)
          session_indices.append(session_idx)
  
      assert stats.num_sessions == len(per_session_results)
      for marker in markers:
          for idx in range(num_sessions):
              expected_stats = compute_statistics(
                  preceding_user_turn_numbers_used_per_marker[marker][
                      idx
                  ]
              )
              for stat_name, stat_value in expected_stats.items():
                  assert (
                      pytest.approx(
                          stats.session_results[marker][stat_name][idx],
                          nan_ok=True,
                      )
                      == stat_value
                  )
      for idx in range(num_sessions):
          assert stats.session_identifier[idx] == (
              sender_ids[idx],
              session_indices[idx],
          )
  
file_path: rasa/tests/core/evaluation/test_marker_stats.py
imports: import csv
  from pathlib import Path
  from typing import Dict, List, Text, Tuple
  import itertools
  import pytest
  import numpy
  from rasa.core.evaluation.marker_stats import EventMetaData, MarkerStatistics, compute_statistics
label_desc: Use image node_id 5 for calling a global function with example usage: test_process_results_per_session(seed) without return types