Module ImportFrom alias Import alias Import alias Import alias Import alias Assign NameStore ListLoad Str Str Str FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad Num body Expr Str If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr If NameLoad body For NameStore Call AttributeLoad NameLoad attr NameLoad body Assign SubscriptStore AttributeLoad SubscriptLoad NameLoad Index Num attr Index Str Dict Delete NameDel For TupleStore NameStore NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr body If CompareIn Str NameLoad body Continue TryExcept body Expr Call AttributeLoad AttributeLoad NameLoad attr attr handlers ExceptHandler type NameLoad body Pass With Call AttributeLoad NameLoad attr keyword NameLoad NameStore body Expr Call AttributeLoad NameLoad attr Str Expr Yield NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str With Call NameLoad NameStore body Expr Yield NameLoad Assign NameStore ListComp NameLoad comprehension NameStore NameLoad CompareNotIn Str Call AttributeLoad NameLoad attr Str For NameStore NameLoad body Assign NameStore NameLoad For NameStore NameLoad body If CompareIsNot Call AttributeLoad NameLoad attr NameLoad Call NameLoad AttributeLoad NameLoad attr NameLoad body Assign NameStore NameLoad If CompareIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Raise Call NameLoad BinOpMod Str Call NameLoad AttributeLoad NameLoad attr If CompareGt Call NameLoad NameLoad Num body Assign NameStore BinOpMod Str Call AttributeLoad Str attr NameLoad Raise Call NameLoad NameLoad decorator_list NameLoad
N/A contextlib contextmanager N/A sys N/A warnings N/A inspect N/A re N/A __all__ N/A all_warnings expected_warnings warn warn N/A N/A message category stacklevel N/A None 2 N/A N/A A version of `warnings.warn` with a default stacklevel of 2.
     N/A N/A category None N/A N/A N/A N/A warnings warn message category category stacklevel stacklevel N/A N/A N/A N/A warnings warn message stacklevel stacklevel N/A all_warnings N/A N/A N/A N/A N/A 
    Context for use in testing to ensure that all warnings are raised.

    Examples
    --------
    >>> import warnings
    >>> def foo():
    ...     warnings.warn(RuntimeWarning("bar"))

    We raise the warning once, while the warning filter is set to "once".
    Hereafter, the warning is invisible, even with custom filters:

    >>> with warnings.catch_warnings():
    ...     warnings.simplefilter('once')
    ...     foo()

    We can now run ``foo()`` without a warning being raised:

    >>> from numpy.testing import assert_warns
    >>> foo()

    To catch the warning, we call in the help of ``all_warnings``:

    >>> with all_warnings():
    ...     assert_warns(RuntimeWarning, foo)
     N/A frame N/A N/A inspect currentframe N/A frame N/A N/A f N/A N/A inspect getouterframes frame N/A N/A N/A N/A N/A f N/A 0 f_locals N/A __warningregistry__ N/A N/A frame N/A N/A mod_name mod N/A list N/A N/A N/A sys modules items N/A N/A N/A six.moves mod_name N/A N/A N/A N/A N/A N/A N/A N/A mod __warningregistry__ clear N/A N/A N/A AttributeError N/A N/A N/A N/A N/A warnings catch_warnings record True w N/A N/A N/A N/A warnings simplefilter always N/A N/A w N/A contextmanager expected_warnings N/A N/A matching N/A N/A N/A Context for use in testing to catch known warnings matching regexes

    Parameters
    ----------
    matching : list of strings or compiled regexes
        Regexes for the desired warning to catch


    Examples
    --------
    >>> from skimage import data, img_as_ubyte, img_as_float
    >>> with expected_warnings(['precision loss']):
    ...     d = img_as_ubyte(img_as_float(data.coins()))

    Notes
    -----
    Uses `all_warnings` to ensure all warnings are raised.
    Upon exiting, it checks the recorded warnings for the desired matching
    pattern(s).
    Raises a ValueError if any match was not found or an unexpected
    warning was raised.
    Allows for three types of behaviors: "and", "or", and "optional" matches.
    This is done to accomodate different build enviroments or loop conditions
    that may produce different warnings.  The behaviors can be combined.
    If you pass multiple patterns, you get an orderless "and", where all of the
    warnings must be raised.
    If you use the "|" operator in a pattern, you can catch one of several
    warnings.
    Finally, you can use "|\A\Z" in a pattern to signify it as optional.

     N/A N/A all_warnings w N/A N/A N/A w N/A remaining N/A m N/A m matching N/A \A\Z N/A N/A m split | N/A warn w N/A N/A found False N/A match matching N/A N/A N/A N/A N/A re search match N/A str N/A warn message None N/A N/A found True N/A N/A match remaining N/A N/A N/A N/A remaining remove match N/A N/A found N/A N/A N/A ValueError N/A Unexpected warning: %s N/A str N/A warn message N/A N/A N/A len remaining 0 N/A N/A msg N/A No warning raised matching:
%s N/A N/A join remaining N/A N/A ValueError msg N/A contextmanager