code: def test_gamma_online_offline(online, expected):
      """Tests online and offline knee detection.
      Notable that a large number of samples are highly sensitive to S parameter
      """
      np.random.seed(23)
      n = 1000
      x = range(1, n + 1)
      y = sorted(np.random.gamma(0.5, 1.0, n), reverse=True)
      kl = KneeLocator(
          x,
          y,
          curve_nature="convex",
          curve_direction="decreasing",
          online=online,
      )
      assert kl.knee == expected
  
file_path: yellowbrick/tests/test_utils/test_kneed.py
imports: import pytest
  import matplotlib.pyplot
  import numpy
  from yellowbrick.utils.kneed import KneeLocator
label_desc: Use image node_id 10 for calling a global function with example usage: test_gamma_online_offline(online, expected) without return types