code: def random_initialization_stratified(
      y, n_samples=10, multilabel_strategy="labelsets"
  ):
      """Randomly draws a subset stratified by class labels.
  
      Parameters
      ----------
      y : np.ndarray[int] or csr_matrix
          Labels to be used for stratification.
      n_samples :  int
          Number of samples to draw.
      multilabel_strategy : {'labelsets'}, default='labelsets'
          The multi-label strategy to be used in case of a multi-label labeling.
          This is only used if `y` is of type csr_matrix.
  
      Returns
      -------
      indices : np.ndarray[int]
          Indices relative to y.
  
      See Also
      --------
      small_text.data.sampling.multilabel_stratified_subsets_sampling : Details on the `labelsets`
          multi-label strategy.
      """
      if isinstance(y, csr_matrix):
          if multilabel_strategy == "labelsets":
              return multilabel_stratified_subsets_sampling(
                  y, n_samples=n_samples
              )
          else:
              raise ValueError(
                  f"Invalid multilabel_strategy: {multilabel_strategy}"
              )
      else:
          return stratified_sampling(y, n_samples=n_samples)
  
file_path: small-text/small_text/initialization/strategies.py
imports: import numpy
  from scipy.sparse import csr_matrix
  from small_text.utils.data import list_length
  from small_text.data.sampling import balanced_sampling
  from small_text.data.sampling import multilabel_stratified_subsets_sampling
  from small_text.data.sampling import stratified_sampling
label_desc: Use image node_id 2 for calling a global function with example usage: random_initialization_stratified(y, n_samples, multilabel_strategy) and returns: stratified_sampling, multilabel_stratified_subsets_sampling