def _iterate_over_statements(sub_policy, check_statement_func):
 if (type(sub_policy['Statement']) is list):
  statements = sub_policy['Statement']
  for statement in statements:
   check_statement_func(statement)
 else:
  check_statement_func(sub_policy['Statement'])

def _iterate_over_statements ( sub_policy , check_statement_func ) : if ( type ( sub_policy [ 'Statement' ] ) is list ) : statements = sub_policy [ 'Statement' ] for statement in statements : check_statement_func ( statement ) else : check_statement_func ( sub_policy [ 'Statement' ] )
for every statement in a given policy .