code: def generate_indices(
      random_state, bootstrap, n_population, n_samples
  ):
      """Draw randomly sampled indices. Internal use only.
  
      See sklearn/ensemble/bagging.py
  
      Parameters
      ----------
      random_state : RandomState
          A random number generator instance to define the state of the random
          permutations generator.
  
      bootstrap :  bool
          Specifies whether to bootstrap indice generation
  
      n_population : int
          Specifies the population size when generating indices
  
      n_samples : int
          Specifies number of samples to draw
  
      Returns
      -------
      indices : numpy array, shape (n_samples,)
          randomly drawn indices
      """
  
      # Draw sample indices
      if bootstrap:
          indices = random_state.randint(0, n_population, n_samples)
      else:
          indices = sample_without_replacement(
              n_population, n_samples, random_state=random_state
          )
  
      return indices
  
imports: from __future__ import division
  from __future__ import print_function
  import numbers
  import numpy
  import sklearn
  from numpy import percentile
  from sklearn.metrics import precision_score
  from sklearn.preprocessing import StandardScaler
  from sklearn.utils import check_array
  from sklearn.utils import check_consistent_length
  from sklearn.utils import check_random_state
  from sklearn.utils import column_or_1d
  from sklearn.utils.random import sample_without_replacement
label_desc: Use image node_id 14 for calling a global function with example usage: generate_indices(random_state, bootstrap, n_population, n_samples) and returns: indices