def filter_errors(errors, select=None, ignore=None, **params):
 select = (select or [])
 ignore = (ignore or [])
 for e in errors:
  for s in select:
   if e.number.startswith(s):
    (yield e)
    break
  else:
   for s in ignore:
    if e.number.startswith(s):
     break
   else:
    (yield e)

def filter_errors ( errors , select = None , ignore = None , ** params ) : select = ( select or [ ] ) ignore = ( ignore or [ ] ) for e in errors : for s in select : if e . number . startswith ( s ) : ( yield e ) break else : for s in ignore : if e . number . startswith ( s ) : break else : ( yield e )
filter a erros by select and ignore options .