code: def filter_out_warnings(warn_record, category=None, match=None):
      r"""Remove particular records from ``warn_record``.
  
      This helper takes a list of :class:`warnings.WarningMessage` objects,
      and remove those matching category and/or text.
  
      Parameters
      ----------
      category: WarningMessage type | None
         class of the message to filter out
  
      match : str | None
          text or regex that matches the error message to filter out
      """
      regexp = re.compile(".*" if match is None else match)
      is_category = [
          w.category == category if category is not None else True
          for w in warn_record._list
      ]
      is_match = [
          regexp.match(w.message.args[0]) is not None
          for w in warn_record._list
      ]
      ind = [
          ind
          for ind, (c, m) in enumerate(zip(is_category, is_match))
          if c and m
      ]
  
      for i in reversed(ind):
          warn_record._list.pop(i)
  
imports: import contextlib
  import importlib
  import inspect
  import logging
  import os.path
  import re
  import sys
  import warnings
  from io import StringIO
  from typing import Any, Callable, TypeVar
  from decorator import FunctionMaker
  from .docs import fill_doc
label_desc: Use image node_id 9 for calling a global function with example usage: filter_out_warnings(warn_record, category, match) without return types