def _text_match(vobject_item, filter_, child_name, attrib_name=None):
 match = next(filter_.itertext()).lower()
 children = getattr(vobject_item, ('%s_list' % child_name), [])
 if attrib_name:
  condition = any(((match in attrib.lower()) for child in children for attrib in child.params.get(attrib_name, [])))
 else:
  condition = any(((match in child.value.lower()) for child in children))
 if (filter_.get('negate-condition') == 'yes'):
  return (not condition)
 else:
  return condition

def _text_match ( vobject_item , filter_ , child_name , attrib_name = None ) : match = next ( filter_ . itertext ( ) ) . lower ( ) children = getattr ( vobject_item , ( '%s_list' % child_name ) , [ ] ) if attrib_name : condition = any ( ( ( match in attrib . lower ( ) ) for child in children for attrib in child . params . get ( attrib_name , [ ] ) ) ) else : condition = any ( ( ( match in child . value . lower ( ) ) for child in children ) ) if ( filter_ . get ( 'negate-condition' ) == 'yes' ) : return ( not condition ) else : return condition
check whether the item matches the text-match filter_ .