code: def _get_unsampled_indices(tree, n_samples):
      """
      An interface to get unsampled indices regardless of sklearn version.
      """
      if LooseVersion(sklearn.__version__) >= LooseVersion("0.24"):
          # Version 0.24 moved forest package name
          from sklearn.ensemble._forest import _get_n_samples_bootstrap
  
          n_samples_bootstrap = _get_n_samples_bootstrap(
              n_samples, n_samples
          )
          return _generate_unsampled_indices(
              tree.random_state, n_samples, n_samples_bootstrap
          )
      elif LooseVersion(sklearn.__version__) >= LooseVersion("0.22"):
          # Version 0.22 or newer uses 3 arguments.
          from sklearn.ensemble.forest import _get_n_samples_bootstrap
  
          n_samples_bootstrap = _get_n_samples_bootstrap(
              n_samples, n_samples
          )
          return _generate_unsampled_indices(
              tree.random_state, n_samples, n_samples_bootstrap
          )
      else:
          # Version 0.21 or older uses only two arguments.
          return _generate_unsampled_indices(
              tree.random_state, n_samples
          )
  
imports: import pandas
  import numpy
  import matplotlib.pyplot
  import sklearn
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.ensemble import RandomForestRegressor
  from distutils.version import LooseVersion
  from sklearn.model_selection import cross_val_score
  from sklearn.base import clone
  from sklearn.metrics import r2_score
  from sklearn.metrics import f1_score
  from sklearn.preprocessing import LabelEncoder
  from scipy import stats
  from pandas.api.types import is_numeric_dtype
  from matplotlib.colors import ListedColormap
  from matplotlib.ticker import FormatStrFormatter
  from copy import copy
  import warnings
  import tempfile
  from os import getpid, makedirs
label_desc: Use image node_id 11 for calling a global function with example usage: _get_unsampled_indices(tree, n_samples) and returns: _generate_unsampled_indices, _generate_unsampled_indices, _generate_unsampled_indices