code: def test_box_size():
      """Test calculation of box sizes."""
      # No points. Box size should be 1,1.
      assert_allclose(_box_size([]), (1.0, 1.0))
  
      # Create one point. Box size should be 1,1.
      point = [(0, 0)]
      assert_allclose(_box_size(point), (1.0, 1.0))
  
      # Create two points. Box size should be 0.5,1.
      points = [(0.25, 0.5), (0.75, 0.5)]
      assert_allclose(_box_size(points), (0.5, 1.0))
  
      # Create three points. Box size should be (0.5, 0.5).
      points = [(0.25, 0.25), (0.75, 0.25), (0.5, 0.75)]
      assert_allclose(_box_size(points), (0.5, 0.5))
  
      # Create a grid of points. Box size should be (0.1, 0.1).
      x, y = np.meshgrid(
          np.linspace(-0.5, 0.5, 11), np.linspace(-0.5, 0.5, 11)
      )
      x, y = x.ravel(), y.ravel()
      assert_allclose(_box_size(np.c_[x, y]), (0.1, 0.1))
  
      # Create a random set of points. This should never break the function.
      rng = np.random.RandomState(42)
      points = rng.rand(100, 2)
      width, height = _box_size(points)
      assert width is not None
      assert height is not None
  
      # Test specifying an existing width.
      points = [(0.25, 0.25), (0.75, 0.25), (0.5, 0.75)]
      assert_allclose(_box_size(points, width=0.4), (0.4, 0.5))
  
      # Test specifying an existing width that has influence on the calculated
      # height.
      points = [(0.25, 0.25), (0.75, 0.25), (0.5, 0.75)]
      assert_allclose(_box_size(points, width=0.2), (0.2, 1.0))
  
      # Test specifying an existing height.
      points = [(0.25, 0.25), (0.75, 0.25), (0.5, 0.75)]
      assert_allclose(_box_size(points, height=0.4), (0.5, 0.4))
  
      # Test specifying an existing height that has influence on the calculated
      # width.
      points = [(0.25, 0.25), (0.75, 0.45), (0.5, 0.75)]
      assert_allclose(_box_size(points, height=0.1), (1.0, 0.1))
  
      # Test specifying both width and height. The function should simply return
      # these.
      points = [(0.25, 0.25), (0.75, 0.45), (0.5, 0.75)]
      assert_array_equal(
          _box_size(points, width=0.1, height=0.1), (0.1, 0.1)
      )
  
      # Test specifying a width that will cause unfixable horizontal overlap and
      # essentially breaks the function (height will be 0).
      points = [(0.25, 0.25), (0.75, 0.25), (0.5, 0.75)]
      assert_array_equal(_box_size(points, width=1), (1, 0))
  
      # Test adding some padding.
      # Create three points. Box size should be a little less than (0.5, 0.5).
      points = [(0.25, 0.25), (0.75, 0.25), (0.5, 0.75)]
      assert_allclose(
          _box_size(points, padding=0.1), (0.9 * 0.5, 0.9 * 0.5)
      )
  
imports: import copy
  from pathlib import Path
  import matplotlib.pyplot
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_equal
  from mne import pick_info, pick_types
  from mne._fiff.constants import FIFF
  from mne._fiff.meas_info import _empty_info
  from mne.channels import find_layout, make_eeg_layout, make_grid_layout, read_layout
  from mne.channels.layout import _box_size, _find_topomap_coords, generate_2d_layout
  from mne.defaults import HEAD_SIZE_DEFAULT
  from mne.io import read_info, read_raw_kit
label_desc: Use image node_id 8 for calling a global function with example usage: test_box_size() without return types