code: def assert_warns(
      exception=Warning,
      *args,
      glob=None,
      regex=None,
      match_case=None,
      **kwargs,
  ):
      if glob is None and regex is None:
          return tools.assert_warns(exception, *args, **kwargs)
  
      pattern = get_pattern(glob, regex, match_case)
      return tools.assert_warns_regex(
          exception, pattern, *args, **kwargs
      )
  
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 4 for calling a global function with example usage: assert_warns(exception) and returns: tools, tools