class_docstr: Bootstrap using stratified resampling.
  
  Supports numpy arrays. Data returned has the same type as the input data.
  Data entered using keyword arguments is directly accessibly as an attribute.
  
  To ensure a reproducible bootstrap, you must set the `random_state`
  attribute after the bootstrap has been created. See the example below.
  Note that `random_state` is a reserved keyword and any variable
  passed using this keyword must be an instance of `RandomState`.
  
  Examples
  --------
  Data can be accessed in a number of ways.  Positional data is retained in
  the same order as it was entered when the bootstrap was initialized.
  Keyword data is available both as an attribute or using a dictionary syntax
  on kw_data.
  
  >>> from rliable.library import StratifiedBootstrap
  >>> from numpy.random import standard_normal
  >>> x = standard_normal((5, 50))
  >>> bs = StratifiedBootstrap(x)
  >>> for data in bs.bootstrap(100):
  ...     bs_x = data[0][0]
  >>> bs.conf_int(np.mean, method='percentile', reps=50000)  # 95% CIs for mean
  
  Set the random_state if reproducibility is required.
  
  >>> from numpy.random import RandomState
  >>> rs = RandomState(1234)
  >>> bs = StratifiedBootstrap(x, random_state=rs)
  
  See also: `arch.bootstrap.IIDBootstrap`
  
  Attributes:
    data: tuple, Two-element tuple with the pos_data in the first position and
      kw_data in the second (pos_data, kw_data). Derived from `IIDBootstrap`.
    pos_data: tuple, Tuple containing the positional arguments (in the order
      entered). Derived from `IIDBootstrap`.
    kw_data: dict, Dictionary containing the keyword arguments. Derived from
      `IIDBootstrap`.
class_docstr_tok: ["Bootstrap","using","stratified","resampling",".","Supports","numpy","arrays",".","Data","returned","has","the","same","type","as","the","input","data",".","Data","entered","using","keyword","arguments","is","directly","accessibly","as","an","attribute",".","To","ensure","a","reproducible","bootstrap",",","you","must","set","the","`","random_state","`","attribute","after","the","bootstrap","has","been","created",".","See","the","example","below",".","Note","that","`","random_state","`","is","a","reserved","keyword","and","any","variable","passed","using","this","keyword","must","be","an","instance","of","`","RandomState","`",".","Examples","--","--","--","--","Data","can","be","accessed","in","a","number","of","ways",".","Positional","data","is","retained","in","the","same","order","as","it","was","entered","when","the","bootstrap","was","initialized",".","Keyword","data","is","available","both","as","an","attribute","or","using","a","dictionary","syntax","on","kw_data",".",">",">",">","from","rliable.library","import","StratifiedBootstrap",">",">",">","from","numpy.random","import","standard_normal",">",">",">","x","=","standard_normal","(","(","5",",","50",")",")",">",">",">","bs","=","StratifiedBootstrap","(","x",")",">",">",">","for","data","in","bs.bootstrap","(","100",")",":","...","bs_x","=","data","[","0","]","[","0","]",">",">",">","bs.conf_int","(","np.mean",",","method='percentile","'",",","reps=50000",")","#","95","%","CIs","for","mean","Set","the","random_state","if","reproducibility","is","required",".",">",">",">","from","numpy.random","import","RandomState",">",">",">","rs","=","RandomState","(","1234",")",">",">",">","bs","=","StratifiedBootstrap","(","x",",","random_state=rs",")","See","also",":","`","arch.bootstrap.IIDBootstrap","`","Attributes",":","data",":","tuple",",","Two-element","tuple","with","the","pos_data","in","the","first","position","and","kw_data","in","the","second","(","pos_data",",","kw_data",")",".","Derived","from","`","IIDBootstrap","`",".","pos_data",":","tuple",",","Tuple","containing","the","positional","arguments","(","in","the","order","entered",")",".","Derived","from","`","IIDBootstrap","`",".","kw_data",":","dict",",","Dictionary","containing","the","keyword","arguments",".","Derived","from","`","IIDBootstrap","`","."]
docstr: Samples partial indices for bootstrap resamples.
  
  Returns:
    A list of arrays of size N x 1 x 1 x .., 1 x M x 1 x ..,
    1 x 1 x L x .. and so on, where the `args_shape` is `N x M x L x ..`.
docstr_tok: ["Samples","partial","indices","for","bootstrap","resamples",".","Returns",":","A","list","of","arrays","of","size","N","x","1","x","1","x","..",",","1","x","M","x","1","x","..",",","1","x","1","x","L","x","..","and","so","on",",","where","the","`","args_shape","`","is","`","N","x","M","x","L","x","..","`","."]
code: def _get_strata_indices(self) -> List[np.ndarray]:
      """Samples partial indices for bootstrap resamples.
  
      Returns:
        A list of arrays of size N x 1 x 1 x .., 1 x M x 1 x ..,
        1 x 1 x L x .. and so on, where the `args_shape` is `N x M x L x ..`.
      """
      ogrid_indices = tuple(
          slice(x) for x in (0, *self._args_shape[1:])
      )
      strata_indices = np.ogrid[ogrid_indices]
      return strata_indices[1:]
  
file_path: rliable/rliable/library.py
imports: from typing import Callable, Dict, List, Optional, Tuple, Union, Mapping
  from absl import logging
  import arch.bootstrap
  import numpy
  from numpy import random
label_desc: Use image node_id 2 for calling the StratifiedBootstrap obj's underlying member method code with example usage: obj._get_strata_indices() and returns: strata_indices