def _parse_list_rule(rule):
 if (not rule):
  return TrueCheck()
 or_list = []
 for inner_rule in rule:
  if (not inner_rule):
   continue
  if isinstance(inner_rule, basestring):
   inner_rule = [inner_rule]
  and_list = [_parse_check(r) for r in inner_rule]
  if (len(and_list) == 1):
   or_list.append(and_list[0])
  else:
   or_list.append(AndCheck(and_list))
 if (not or_list):
  return FalseCheck()
 elif (len(or_list) == 1):
  return or_list[0]
 return OrCheck(or_list)

def _parse_list_rule ( rule ) : if ( not rule ) : return TrueCheck ( ) or_list = [ ] for inner_rule in rule : if ( not inner_rule ) : continue if isinstance ( inner_rule , basestring ) : inner_rule = [ inner_rule ] and_list = [ _parse_check ( r ) for r in inner_rule ] if ( len ( and_list ) == 1 ) : or_list . append ( and_list [ 0 ] ) else : or_list . append ( AndCheck ( and_list ) ) if ( not or_list ) : return FalseCheck ( ) elif ( len ( or_list ) == 1 ) : return or_list [ 0 ] return OrCheck ( or_list )
provided for backwards compatibility .