code: def test_info():
      """Test info object."""
      raw = read_raw_fif(raw_fname)
      event_id, tmin, tmax = 1, -0.2, 0.5
      events = read_events(event_name)
      event_id = int(events[0, 2])
      epochs = Epochs(raw, events[:1], event_id, tmin, tmax, picks=None)
  
      evoked = epochs.average()
  
      # Test subclassing was successful.
      info = Info(a=7, b="aaaaa")
      assert "a" in info
      assert "b" in info
  
      # Test info attribute in API objects
      for obj in [raw, epochs, evoked]:
          assert isinstance(obj.info, Info)
          rep = repr(obj.info)
          assert "2002-12-03 19:01:10 UTC" in rep, rep
          assert (
              "146 items (3 Cardinal, 4 HPI, 61 EEG, 78 Extra)" in rep
          )
          dig_rep = repr(obj.info["dig"][0])
          assert "LPA" in dig_rep, dig_rep
          assert "(-71.4, 0.0, 0.0) mm" in dig_rep, dig_rep
          assert "head frame" in dig_rep, dig_rep
          # Test our BunchConstNamed support
          for func in (str, repr):
              assert "4 (FIFFV_COORD_HEAD)" == func(
                  obj.info["dig"][0]["coord_frame"]
              )
  
      # Test read-only fields
      info = raw.info.copy()
      nchan = len(info["chs"])
      ch_names = [ch["ch_name"] for ch in info["chs"]]
      assert info["nchan"] == nchan
      assert list(info["ch_names"]) == ch_names
  
      # Deleting of regular fields should work
      info["experimenter"] = "bar"
      del info["experimenter"]
  
      # Test updating of fields
      del info["chs"][-1]
      info._update_redundant()
      assert info["nchan"] == nchan - 1
      assert list(info["ch_names"]) == ch_names[:-1]
  
      info["chs"][0]["ch_name"] = "foo"
      info._update_redundant()
      assert info["ch_names"][0] == "foo"
  
      # Test casting to and from a dict
      info_dict = dict(info)
      info2 = Info(info_dict)
      assert info == info2
  
imports: import pickle
  import string
  from datetime import date, datetime, timedelta, timezone
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal
  from scipy import sparse
  from mne import Annotations, Epochs, compute_covariance, make_forward_solution, make_sphere_model, pick_info, pick_types, read_cov, read_epochs, read_events, read_evokeds, read_forward_solution, setup_volume_source_space, write_cov, write_forward_solution
  from mne._fiff import meas_info
  from mne._fiff._digitization import DigPoint, _make_dig_points
  from mne._fiff.constants import FIFF
  from mne._fiff.meas_info import RAW_INFO_FIELDS, Info, MNEBadsList, _add_timedelta_to_stamp, _bad_chans_comp, _dt_to_stamp, _force_update_info, _get_valid_units, _merge_info, _read_extended_ch_info, _stamp_to_dt, anonymize_info, create_info, read_fiducials, read_info, write_fiducials, write_info
  from mne._fiff.proj import Projection
  from mne._fiff.tag import _coil_trans_to_loc, _loc_to_coil_trans
  from mne._fiff.write import DATE_NONE, _generate_meas_id
  from mne.channels import equalize_channels, make_standard_montage, read_polhemus_fastscan
  from mne.datasets import testing
  from mne.event import make_fixed_length_events
  from mne.io import BaseRaw, RawArray, read_raw_ctf, read_raw_fif
  from mne.minimum_norm import apply_inverse, make_inverse_operator, read_inverse_operator, write_inverse_operator
  from mne.transforms import Transform
  from mne.utils import _empty_hash, _record_warnings, assert_object_equal, catch_logging
label_desc: Use image node_id 7 for calling a global function with example usage: test_info() without return types