def _iterate_over_sub_policies(sub_policies, check_statement_func):
 for sub_policy_name in sub_policies:
  sub_policy = sub_policies[sub_policy_name]
  _iterate_over_statements(sub_policy, check_statement_func)

def _iterate_over_sub_policies ( sub_policies , check_statement_func ) : for sub_policy_name in sub_policies : sub_policy = sub_policies [ sub_policy_name ] _iterate_over_statements ( sub_policy , check_statement_func )
for each named policy in the policy document .