code: def test_safe_indexing_pandas_no_settingwithcopy_warning():
      # Using safe_indexing with an array-like indexer gives a copy of the
      # DataFrame -> ensure it doesn't raise a warning if modified
      pd = pytest.importorskip("pandas")
  
      X = pd.DataFrame({"a": [1, 2, 3], "b": [3, 4, 5]})
      subset = _safe_indexing(X, [0, 1], axis=0)
      if hasattr(pd.errors, "SettingWithCopyWarning"):
          SettingWithCopyWarning = pd.errors.SettingWithCopyWarning
      else:
          # backward compatibility for pandas < 1.5
          SettingWithCopyWarning = pd.core.common.SettingWithCopyWarning
      with warnings.catch_warnings():
          warnings.simplefilter("error", SettingWithCopyWarning)
          subset.iloc[0, 0] = 10
      # The original dataframe is unaffected by the assignment on the subset:
      assert X.iloc[0, 0] == 1
  
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 27 for calling a global function with example usage: test_safe_indexing_pandas_no_settingwithcopy_warning() without return types