code: def test_merge_info():
      """Test merging of multiple Info objects."""
      info_a = create_info(ch_names=["a", "b", "c"], sfreq=1000.0)
      info_b = create_info(ch_names=["d", "e", "f"], sfreq=1000.0)
      info_merged = _merge_info([info_a, info_b])
      assert info_merged["nchan"], 6
      assert info_merged["ch_names"], ["a", "b", "c", "d", "e", "f"]
      pytest.raises(ValueError, _merge_info, [info_a, info_a])
  
      # Testing for force updates before merging
      info_c = create_info(ch_names=["g", "h", "i"], sfreq=500.0)
      # This will break because sfreq is not equal
      pytest.raises(RuntimeError, _merge_info, [info_a, info_c])
      _force_update_info(info_a, info_c)
      assert info_c["sfreq"] == info_a["sfreq"]
      assert info_c["ch_names"][0] != info_a["ch_names"][0]
      # Make sure it works now
      _merge_info([info_a, info_c])
      # Check that you must supply Info
      pytest.raises(
          ValueError,
          _force_update_info,
          info_a,
          dict([("sfreq", 1000.0)]),
      )
      # KIT System-ID
      info_a._unlocked = info_b._unlocked = True
      info_a["kit_system_id"] = 50
      assert _merge_info((info_a, info_b))["kit_system_id"] == 50
      info_b["kit_system_id"] = 50
      assert _merge_info((info_a, info_b))["kit_system_id"] == 50
      info_b["kit_system_id"] = 60
      pytest.raises(ValueError, _merge_info, (info_a, info_b))
  
      # hpi infos
      info_d = create_info(ch_names=["d", "e", "f"], sfreq=1000.0)
      info_merged = _merge_info([info_a, info_d])
      assert not info_merged["hpi_meas"]
      assert not info_merged["hpi_results"]
      info_a["hpi_meas"] = [{"f1": 3, "f2": 4}]
      assert (
          _merge_info([info_a, info_d])["hpi_meas"]
          == info_a["hpi_meas"]
      )
      info_d._unlocked = True
      info_d["hpi_meas"] = [{"f1": 3, "f2": 4}]
      assert (
          _merge_info([info_a, info_d])["hpi_meas"]
          == info_d["hpi_meas"]
      )
      # This will break because of inconsistency
      info_d["hpi_meas"] = [{"f1": 3, "f2": 5}]
      pytest.raises(ValueError, _merge_info, [info_a, info_d])
  
      info_0 = read_info(raw_fname)
      info_0["bads"] = ["MEG 2443", "EEG 053"]
      assert len(info_0["chs"]) == 376
      assert len(info_0["dig"]) == 146
      info_1 = create_info(["STI YYY"], info_0["sfreq"], ["stim"])
      assert info_1["bads"] == []
      info_out = _merge_info(
          [info_0, info_1], force_update_to_first=True
      )
      assert len(info_out["chs"]) == 377
      assert len(info_out["bads"]) == 2
      assert len(info_out["dig"]) == 146
      assert len(info_0["chs"]) == 376
      assert len(info_0["bads"]) == 2
      assert len(info_0["dig"]) == 146
  
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 14 for calling a global function with example usage: test_merge_info() without return types