code: def _do_inf_pots(mri_rr, bem_rr, mri_Q, sol):
      """Calculate infinite potentials for MEG or EEG sensors using chunks.
  
      Parameters
      ----------
      mri_rr : ndarray, shape (n_dipoles, 3)
          3D dipole source positions in MRI coordinates
      bem_rr : ndarray, shape (n_BEM_vertices, 3)
          3D vertex positions for all surfaces in the BEM
      mri_Q :
          3x3 head -> MRI transform. I.e., head_mri_t.dot(np.eye(3))
      sol : ndarray, shape (n_sensors_subset, n_BEM_vertices_subset)
          Comes from _bem_specify_coils
  
      Returns
      -------
      B : ndarray, (n_dipoles * 3, n_sensors)
          Forward solution for sensors due to volume currents
      """
      # Doing work of 'fwd_bem_pot_calc' in MNE-C
      # The following code is equivalent to this, but saves memory
      # v0s = _bem_inf_pots(rr, bem_rr, Q)  # n_rr x 3 x n_bem_rr
      # v0s.shape = (len(rr) * 3, v0s.shape[2])
      # B = np.dot(v0s, sol)
  
      # We chunk the source mri_rr's in order to save memory
      B = np.empty((len(mri_rr) * 3, sol.shape[1]))
      for start, stop in _rr_bounds(mri_rr):
          # v0 in Hämäläinen et al., 1989 == v_inf in Mosher, et al., 1999
          v0s = _bem_inf_pots(mri_rr[start:stop], bem_rr, mri_Q)
          v0s = v0s.reshape(-1, v0s.shape[2])
          B[3 * start : 3 * stop] = np.dot(v0s, sol)
      return B
  
imports: from copy import deepcopy
  import numpy
  from .._fiff.constants import FIFF
  from ..bem import _import_openmeeg, _make_openmeeg_geometry
  from ..fixes import bincount, jit
  from ..parallel import parallel_func
  from ..surface import _jit_cross, _project_onto_surface
  from ..transforms import apply_trans, invert_transform
  from ..utils import _check_option, _pl, fill_doc, logger, verbose, warn
label_desc: Use image node_id 13 for calling a global function with example usage: _do_inf_pots(mri_rr, bem_rr, mri_Q, sol) and returns: B