docstr: Check a few basic examples of the tie correction factor.
docstr_tok: ["Check","a","few","basic","examples","of","the","tie","correction","factor","."]
code: def test_basic(self):
      """Check a few basic examples of the tie correction factor."""
      # One tie of two elements
      ranks = np.array([1.0, 2.5, 2.5])
      c = tiecorrect(ranks)
      T = 2.0
      N = ranks.size
      expected = 1.0 - (T**3 - T) / (N**3 - N)
      assert_equal(c, expected)
  
      # One tie of two elements (same as above, but tie is not at the end)
      ranks = np.array([1.5, 1.5, 3.0])
      c = tiecorrect(ranks)
      T = 2.0
      N = ranks.size
      expected = 1.0 - (T**3 - T) / (N**3 - N)
      assert_equal(c, expected)
  
      # One tie of three elements
      ranks = np.array([1.0, 3.0, 3.0, 3.0])
      c = tiecorrect(ranks)
      T = 3.0
      N = ranks.size
      expected = 1.0 - (T**3 - T) / (N**3 - N)
      assert_equal(c, expected)
  
      # Two ties, lengths 2 and 3.
      ranks = np.array([1.5, 1.5, 4.0, 4.0, 4.0])
      c = tiecorrect(ranks)
      T1 = 2.0
      T2 = 3.0
      N = ranks.size
      expected = 1.0 - ((T1**3 - T1) + (T2**3 - T2)) / (N**3 - N)
      assert_equal(c, expected)
  
imports: import numpy
  from numpy.testing import assert_equal, assert_array_equal
  import pytest
  from scipy.stats import rankdata, tiecorrect
  from scipy._lib._util import np_long
label_desc: Use image node_id 4 for calling the TestTieCorrect obj's underlying member method code with example usage: obj.test_basic() without return types