code: def test_minor_breaks():
      n = 10
      x = np.arange(n)
  
      # Default
      s = scale_x_continuous()
      s.train(x)
      breaks = s.get_breaks()
      minor_breaks = s.get_minor_breaks(breaks)
      expected_minor_breaks = (breaks[:-1] + breaks[1:]) / 2
      assert np.allclose(
          minor_breaks, expected_minor_breaks, rtol=1e-12
      )
  
      # List
      expected_minor_breaks = [2, 4, 6, 8]
      s = scale_x_continuous(minor_breaks=expected_minor_breaks)
      s.train(x)
      breaks = s.get_breaks()
      minor_breaks = s.get_minor_breaks(breaks)
      assert np.allclose(
          minor_breaks, expected_minor_breaks, rtol=1e-12
      )
  
      # Callable
      def func(limits):
          return np.linspace(limits[0], limits[1], n)
  
      s = scale_x_continuous(minor_breaks=func)
      s.train(x)
      breaks = s.get_breaks()
      minor_breaks = s.get_minor_breaks(breaks)
      _breaks = set(breaks)
      expected_minor_breaks = [
          x for x in np.arange(n) if x not in _breaks
      ]
      assert np.allclose(
          minor_breaks, expected_minor_breaks, rtol=1e-12
      )
      assert not (_breaks & set(minor_breaks))
  
      # Number of minor breaks
      s = scale_x_continuous(limits=[0, 20], minor_breaks=3)
      minor_breaks = s.get_minor_breaks(major=[0, 10, 20])
      expected_minor_breaks = [2.5, 5, 7.5, 12.5, 15, 17.5]
      assert np.allclose(
          minor_breaks, expected_minor_breaks, rtol=1e-12
      )
  
imports: import warnings
  from datetime import datetime
  import numpy
  import numpy.testing
  import pandas
  import pytest
  import plotnine
  from plotnine import aes, annotate, element_text, expand_limits, facet_wrap, geom_bar, geom_col, geom_point, ggplot, lims, theme
  from plotnine.exceptions import PlotnineError, PlotnineWarning
  from plotnine.scales import scale_color, scale_color_manual, scale_identity, scale_manual, scale_xy
  from plotnine.scales.scale_alpha import scale_alpha_continuous, scale_alpha_discrete
  from plotnine.scales.scale_linetype import scale_linetype_continuous, scale_linetype_discrete
  from plotnine.scales.scale_manual import _scale_manual
  from plotnine.scales.scale_shape import scale_shape_continuous, scale_shape_discrete
  from plotnine.scales.scale_size import scale_size_area, scale_size_continuous, scale_size_discrete, scale_size_radius
  from plotnine.scales.scale_xy import scale_x_continuous, scale_x_discrete, scale_x_log10, scale_y_continuous
  from plotnine.scales.scales import make_scale
label_desc: Use image node_id 18 for calling a global function with example usage: test_minor_breaks() and returns: np