code: def generate_sample_indices(random_state, n_samples):
      """
      Generates bootstrap indices for each tree fit.
  
      Parameters
      ----------
      random_state: int, RandomState instance or None
          If int, random_state is the seed used by the random number generator.
          If RandomState instance, random_state is the random number generator.
          If None, the random number generator is the RandomState instance used
          by np.random.
      n_samples: int
          Number of samples to generate from each tree.
  
      Returns
      -------
      sample_indices: array-like, shape=(n_samples), dtype=np.int32
          Sample indices.
      """
      random_instance = check_random_state(random_state)
      sample_indices = random_instance.randint(0, n_samples, n_samples)
      return sample_indices
  
imports: import logging
  from functools import partial
  import numpy
  import pandas
  from sklearn.ensemble._forest import ForestRegressor
  from sklearn.tree import BaseDecisionTree, DecisionTreeRegressor, ExtraTreeRegressor
  from sklearn.utils import check_array, check_random_state, check_X_y
label_desc: Use image node_id 2 for calling a global function with example usage: generate_sample_indices(random_state, n_samples) and returns: sample_indices