class_docstr: Bundle warnings, convergence stats and metadata of a sampling run.
class_docstr_tok: ["Bundle","warnings",",","convergence","stats","and","metadata","of","a","sampling","run","."]
code: def _slice(self, start, stop, step):
      report = SamplerReport()
  
      def filter_warns(warnings):
          filtered = []
          for warn in warnings:
              if warn.step is None:
                  filtered.append(warn)
              elif (
                  start <= warn.step < stop
                  and (warn.step - start) % step == 0
              ):
                  warn = dataclasses.replace(
                      warn, step=warn.step - start
                  )
                  filtered.append(warn)
          return filtered
  
      report._add_warnings(filter_warns(self._global_warnings))
      for chain in self._chain_warnings:
          report._add_warnings(
              filter_warns(self._chain_warnings[chain]), chain
          )
  
      return report
  
file_path: pymc/pymc/backends/report.py
imports: import dataclasses
  import logging
  from typing import Dict, List, Optional
  from pymc.stats.convergence import _LEVELS, SamplerWarning
label_desc: Use image node_id 9 for calling the SamplerReport obj's underlying member method code with example usage: obj._slice(start, stop, step) and returns: report, filtered