code: def test_polars_indexing():
      """Check _safe_indexing for polars as expected."""
      pl = pytest.importorskip("polars", minversion="0.18.2")
      df = pl.DataFrame(
          {"a": [1, 2, 3, 4], "b": [4, 5, 6, 8], "c": [1, 4, 1, 10]},
          orient="row",
      )
  
      from polars.testing import assert_frame_equal
  
      str_keys = [["b"], ["a", "b"], ["b", "a", "c"], ["c"], ["a"]]
  
      for key in str_keys:
          out = _safe_indexing(df, key, axis=1)
          assert_frame_equal(df[key], out)
  
      bool_keys = [
          ([True, False, True], ["a", "c"]),
          ([False, False, True], ["c"]),
      ]
  
      for bool_key, str_key in bool_keys:
          out = _safe_indexing(df, bool_key, axis=1)
          assert_frame_equal(df[:, str_key], out)
  
      int_keys = [([0, 1], ["a", "b"]), ([2], ["c"])]
  
      for int_key, str_key in int_keys:
          out = _safe_indexing(df, int_key, axis=1)
          assert_frame_equal(df[:, str_key], out)
  
      axis_0_keys = [[0, 1], [1, 3], [3, 2]]
      for key in axis_0_keys:
          out = _safe_indexing(df, key, axis=0)
          assert_frame_equal(df[key], out)
  
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 44 for calling a global function with example usage: test_polars_indexing() without return types