def attr_func_city(attr_vals): count = 0 size = len(attr_vals) for value in attr_vals: if not value or value == '': continue if res_person_obj.match(value): # print 'value match', value count += 1 if count == 0: return False # print float(count), size if float(count) / size < 0.6: return False return True
def valid_person(string): if not res_person_obj.match(string): return False return True