code: def test_nsx_ver_22():
      """Primary tests for NEURALCD reader."""
      raw = read_raw_nsx(
          nsx_22_fname,
      )
      assert getattr(raw, "_data", False) is False
      assert raw.info["sfreq"] == 2000
  
      # Check info object
      assert raw.info["meas_date"].day == 31
      assert raw.info["meas_date"].year == 2023
      assert raw.info["meas_date"].month == 1
      assert raw.info["chs"][0]["cal"] == 0.6103515625
      assert raw.info["chs"][0]["range"] == 0.001
  
      # check raw_extras
      for r in raw._raw_extras:
          assert r["orig_format"] == raw.orig_format
          assert r["orig_nchan"] == 128
          assert len(r["timestamp"]) == len(r["nb_data_points"])
          assert len(r["timestamp"]) == len(r["offset_to_data_block"])
  
      # Check annotations
      assert len(raw.annotations) == 0
  
      raw = _test_raw_reader(
          read_raw_nsx,
          input_fname=nsx_22_fname,
          eog=None,
          misc=None,
          test_scaling=False,  # XXX this should be True
          test_rank=False,
      )
      raw_data, _ = raw[:]
      n_channels, n_times = raw_data.shape
      assert n_times == 100
      assert n_channels == 128
  
      # Check data
      # There is only one contiguous data packet, samples 0--100. Data
      # was generated as:
      #     ```data = np.ones((n_samples, ch_count))
      #        data[n_samples // 2] = np.arange(ch_count) + 10
      #        data[:, ch_count // 2] = np.arange(n_samples) + 100```
      orig_data = raw_data / (
          raw.info["chs"][0]["cal"] * raw.info["chs"][0]["range"]
      )
      assert_allclose(
          sum(orig_data[:, 50] - 10 - np.arange(n_channels)), 76.0
      )
  
      assert_allclose(
          orig_data[n_channels // 2, :100] - 100, np.arange(100)
      )
  
      data, _ = raw.get_data(start=10, stop=20, return_times=True)
      assert 128, 10 == data.shape
  
      data, _ = raw.get_data(start=0, stop=300, return_times=True)
      assert 128, 100 == data.shape
  
      epochs = make_fixed_length_epochs(
          raw, duration=0.05, preload=True, id=1
      )
      assert len(epochs) == 1
      assert epochs.event_id["1"] == 1
      with pytest.raises(ValueError, match="No events produced"):
          _ = make_fixed_length_epochs(raw, duration=0.5, preload=True)
  
file_path: mne-python/mne/io/nsx/tests/test_nsx.py
imports: import os
  import numpy
  import pytest
  from numpy.testing import assert_allclose
  from mne import make_fixed_length_epochs
  from mne._fiff.constants import FIFF
  from mne._fiff.meas_info import _empty_info
  from mne.datasets.testing import data_path, requires_testing_data
  from mne.io import read_raw_nsx
  from mne.io.nsx.nsx import _decode_online_filters, _read_header
  from mne.io.tests.test_raw import _test_raw_reader
label_desc: Use image node_id 4 for calling a global function with example usage: test_nsx_ver_22() without return types