code: def _read_segments_file(
      raw,
      data,
      idx,
      fi,
      start,
      stop,
      cals,
      mult,
      dtype,
      n_channels=None,
      offset=0,
      trigger_ch=None,
  ):
      """Read a chunk of raw data."""
      if n_channels is None:
          n_channels = raw._raw_extras[fi]["orig_nchan"]
  
      n_bytes = np.dtype(dtype).itemsize
      # data_offset and data_left count data samples (channels x time points),
      # not bytes.
      data_offset = n_channels * start * n_bytes + offset
      data_left = (stop - start) * n_channels
  
      # Read up to 100 MB of data at a time, block_size is in data samples
      block_size = ((int(100e6) // n_bytes) // n_channels) * n_channels
      block_size = min(data_left, block_size)
      with open(raw._filenames[fi], "rb", buffering=0) as fid:
          fid.seek(data_offset)
          # extract data in chunks
          for sample_start in (
              np.arange(0, data_left, block_size) // n_channels
          ):
              count = min(
                  block_size, data_left - sample_start * n_channels
              )
              block = np.fromfile(fid, dtype, count)
              if block.size != count:
                  raise RuntimeError(
                      f"Incorrect number of samples ({block.size} != {count}), please "
                      "report this error to MNE-Python developers"
                  )
              block = block.reshape(n_channels, -1, order="F")
              n_samples = block.shape[1]  # = count // n_channels
              sample_stop = sample_start + n_samples
              if trigger_ch is not None:
                  stim_ch = trigger_ch[start:stop][
                      sample_start:sample_stop
                  ]
                  block = np.vstack((block, stim_ch))
              data_view = data[:, sample_start:sample_stop]
              _mult_cal_one(data_view, block, idx, cals, mult)
  
file_path: mne-python/mne/_fiff/utils.py
imports: import os
  import os.path
  import numpy
  from .constants import FIFF
  from .meas_info import _get_valid_units
label_desc: Use image node_id 6 for calling a global function with example usage: _read_segments_file(raw, data, idx, fi, start, stop, cals, mult, dtype, n_channels, offset, trigger_ch) without return types