def filter_match_kwargs(kwargs, children=False):
 kwargs = kwargs.copy()
 for key in ('pattern', 'start', 'end', 'parent', 'formatter', 'value'):
  if (key in kwargs):
   del kwargs[key]
 if children:
  for key in ('name',):
   if (key in kwargs):
    del kwargs[key]
 return kwargs

def filter_match_kwargs ( kwargs , children = False ) : kwargs = kwargs . copy ( ) for key in ( 'pattern' , 'start' , 'end' , 'parent' , 'formatter' , 'value' ) : if ( key in kwargs ) : del kwargs [ key ] if children : for key in ( 'name' , ) : if ( key in kwargs ) : del kwargs [ key ] return kwargs
filters out kwargs for match construction .