code: def _compute_pairs(n_rows, n_cols, n=1):
      n_tot = n_rows * n_cols
      sd_idx = (np.arange(n_tot) // 2).reshape(n_rows, n_cols)
      d_bool = np.empty((n_rows, n_cols), bool)
      for ri in range(n_rows):
          d_bool[ri] = np.arange(ri, ri + n_cols) % 2
      pairs = list()
      for ri in range(n_rows):
          # First iterate over connections within the row
          for ci in range(n_cols - 1):
              pair = (sd_idx[ri, ci], sd_idx[ri, ci + 1])
              if d_bool[ri, ci]:  # reverse
                  pair = pair[::-1]
              pairs.append(pair)
          # Next iterate over row-row connections, if applicable
          if ri >= n_rows - 1:
              continue
          for ci in range(n_cols):
              pair = (sd_idx[ri, ci], sd_idx[ri + 1, ci])
              if d_bool[ri, ci]:
                  pair = pair[::-1]
              pairs.append(pair)
      if n > 1:
          assert n == 2  # only one supported for now
          pairs = np.array(pairs, int)
          second = pairs + pairs.max(axis=0) + 1
          pairs = np.r_[pairs, second]
          pairs = tuple(tuple(row) for row in pairs)
      return tuple(pairs)
  
file_path: mne-python/mne/io/hitachi/hitachi.py
imports: import datetime
  import re
  import numpy
  from ..._fiff.constants import FIFF
  from ..._fiff.meas_info import _merge_info, create_info
  from ..._fiff.utils import _mult_cal_one
  from ...utils import _check_fname, _check_option, fill_doc, logger, verbose, warn
  from ..base import BaseRaw
  from ..nirx.nirx import _read_csv_rows_cols
label_desc: Use image node_id 4 for calling a global function with example usage: _compute_pairs(n_rows, n_cols, n) and returns: tuple