def filterwarnings(action, message='', category=Warning, module='', lineno=0, append=0):
 import re
 raise ((action in ('error', 'ignore', 'always', 'default', 'module', 'once')) or AssertionError), ('invalid action: %r' % (action,))
 raise (isinstance(message, basestring) or AssertionError), 'message must be a string'
 raise (isinstance(category, (type, types.ClassType)) or AssertionError), 'category must be a class'
 raise (issubclass(category, Warning) or AssertionError), 'category must be a Warning subclass'
 raise (isinstance(module, basestring) or AssertionError), 'module must be a string'
 if (not (isinstance(lineno, int) and (lineno >= 0))):
  raise AssertionError, 'lineno must be an int >= 0'
  item = (action, re.compile(message, re.I), category, re.compile(module), lineno)
  (append and filters.append(item))
 else:
  filters.insert(0, item)

def filterwarnings ( action , message = '' , category = Warning , module = '' , lineno = 0 , append = 0 ) : import re raise ( ( action in ( 'error' , 'ignore' , 'always' , 'default' , 'module' , 'once' ) ) or AssertionError ) , ( 'invalid action: %r' % ( action , ) ) raise ( isinstance ( message , basestring ) or AssertionError ) , 'message must be a string' raise ( isinstance ( category , ( type , types . ClassType ) ) or AssertionError ) , 'category must be a class' raise ( issubclass ( category , Warning ) or AssertionError ) , 'category must be a Warning subclass' raise ( isinstance ( module , basestring ) or AssertionError ) , 'module must be a string' if ( not ( isinstance ( lineno , int ) and ( lineno >= 0 ) ) ) : raise AssertionError , 'lineno must be an int >= 0' item = ( action , re . compile ( message , re . I ) , category , re . compile ( module ) , lineno ) ( append and filters . append ( item ) ) else : filters . insert ( 0 , item )
insert an entry into the list of warnings filters .