code: def test_approximate_mode():
      """Make sure sklearn.utils._approximate_mode returns valid
      results for cases where "class_counts * n_draws" is enough
      to overflow 32-bit signed integer.
  
      Non-regression test for:
      https://github.com/scikit-learn/scikit-learn/issues/20774
      """
      X = np.array([99000, 1000], dtype=np.int32)
      ret = _approximate_mode(class_counts=X, n_draws=25000, rng=0)
  
      # Draws 25% of the total population, so in this case a fair draw means:
      # 25% * 99.000 = 24.750
      # 25% *  1.000 =    250
      assert_array_equal(ret, [24750, 250])
  
imports: import string
  import timeit
  import warnings
  from copy import copy
  from itertools import chain
  import numpy
  import pytest
  from sklearn import config_context
  from sklearn.utils import _approximate_mode, _determine_key_type, _get_column_indices, _is_polars_df, _message_with_time, _print_elapsed_time, _safe_assign, _safe_indexing, _to_object_array, check_random_state, column_or_1d, deprecated, gen_even_slices, get_chunk_n_rows, is_scalar_nan, resample, safe_mask, shuffle
  from sklearn.utils._mocking import MockDataFrame
  from sklearn.utils._testing import _convert_container, assert_allclose_dense_sparse, assert_array_equal, assert_no_warnings
  from sklearn.utils.fixes import CSC_CONTAINERS, CSR_CONTAINERS
label_desc: Use image node_id 38 for calling a global function with example usage: test_approximate_mode() without return types