def _check_str(text, testfunc):
 if ((text is not None) and (not testfunc(text))):
  warnings.warn(("String %s doesn't match the given regexp" % text), PhyloXMLWarning, stacklevel=2)

def _check_str ( text , testfunc ) : if ( ( text is not None ) and ( not testfunc ( text ) ) ) : warnings . warn ( ( "String %s doesn't match the given regexp" % text ) , PhyloXMLWarning , stacklevel = 2 )
check a string using testfunc .