code: def raises(exception, glob=None, regex=None, match_case=None):
      """
      To assert that the test case raises Exception with the message matching given glob pattern
          @raises(Exception, "abc * def")
          def test():
              raise Exception("It's: abc 42 def, and has some suffix.")
  
      To assert that the test case raises Exception with the message matching given regex pattern
          @raises(Exception, regex="abc[0-9]{2}def")
          def test():
              raise Exception("It's: abc42def, and has some suffix too.")
  
      You can also use it like regular nose.raises
          @raises(Exception)
          def test():
              raise Exception("This message is not checked")
  
      By default, the check is not case-sensitive, to change that pass `match_case`=True.
  
      You can pass a tuple of exception classes to assert that the raised exception is
      an instance of at least one of the classes.
      """
  
      def decorator(func):
          def new_func(*args, **kwargs):
              with assert_raises(
                  exception,
                  glob=glob,
                  regex=regex,
                  match_case=match_case,
              ):
                  return func(*args, **kwargs)
  
          return tools.make_decorator(func)(new_func)
  
      return decorator
  
file_path: DALI/dali/test/python/nose_utils.py
imports: import sys
  import collections
  import nose.case
  import nose.inspector
  import nose.loader
  import nose.suite
  import nose.plugins.attrib
  import nose.tools
  import re
  import fnmatch
label_desc: Use image node_id 5 for calling a global function with example usage: raises(exception, glob, regex, match_case) and returns: decorator, tools, func