code: def _get_blocks(filepath):
      """Get info from meta data blocks."""
      binfile = os.path.join(filepath)
      n_blocks = 0
      samples_block = []
      header_sizes = []
      n_channels = []
      sfreq = []
      # Meta data consists of:
      # * 1 byte of flag (1 for meta data, 0 for data)
      # * 1 byte of header size
      # * 1 byte of block size
      # * 1 byte of n_channels
      # * n_channels bytes of offsets
      # * n_channels bytes of sigfreqs?
      with open(binfile, "rb") as fid:
          fid.seek(0, 2)  # go to end of file
          file_length = fid.tell()
          block_size = file_length
          fid.seek(0)
          position = 0
          while position < file_length:
              block = _block_r(fid)
              if block is None:
                  samples_block.append(samples_block[n_blocks - 1])
                  n_blocks += 1
                  fid.seek(block_size, 1)
                  position = fid.tell()
                  continue
              block_size = block["block_size"]
              header_size = block["header_size"]
              header_sizes.append(header_size)
              samples_block.append(block["nsamples"])
              n_blocks += 1
              fid.seek(block_size, 1)
              sfreq.append(block["sfreq"])
              n_channels.append(block["nc"])
              position = fid.tell()
  
      if any([n != n_channels[0] for n in n_channels]):
          raise RuntimeError(
              "All the blocks don't have the same amount of "
              "channels."
          )
      if any([f != sfreq[0] for f in sfreq]):
          raise RuntimeError(
              "All the blocks don't have the same sampling "
              "frequency."
          )
      if len(samples_block) < 1:
          raise RuntimeError("There seems to be no data")
      samples_block = np.array(samples_block)
      signal_blocks = dict(
          n_channels=n_channels[0],
          sfreq=sfreq[0],
          n_blocks=n_blocks,
          samples_block=samples_block,
          header_sizes=header_sizes,
      )
      return signal_blocks
  
file_path: mne-python/mne/io/egi/general.py
imports: import os
  import re
  import numpy
  from ...utils import _pl, _soft_import
label_desc: Use image node_id 4 for calling a global function with example usage: _get_blocks(filepath) and returns: signal_blocks