def init(policy_file=None, rules=None, default_rule=None, use_conf=True):
global _ENFORCER<EOL>global saved_file_rules<EOL>if not _ENFORCER:<EOL><INDENT>_ENFORCER = policy.Enforcer(CONF,<EOL>policy_file=policy_file,<EOL>rules=rules,<EOL>default_rule=default_rule,<EOL>use_conf=use_conf<EOL>)<EOL>register_rules(_ENFORCER)<EOL>_ENFORCER.load_rules()<EOL><DEDENT>current_file_rules = _ENFORCER.file_rules<EOL>current_file_rules = _serialize_rules(current_file_rules)<EOL>if saved_file_rules != current_file_rules:<EOL><INDENT>_warning_for_deprecated_user_based_rules(current_file_rules)<EOL>saved_file_rules = copy.deepcopy(current_file_rules)<EOL><DEDENT>
Init an Enforcer class.

       :param policy_file: Custom policy file to use, if none is specified,
                           `CONF.policy_file` will be used.
       :param rules: Default dictionary / Rules to use. It will be
                     considered just in the first instantiation.
       :param default_rule: Default rule to use, CONF.default_rule will
                            be used if none is specified.
       :param use_conf: Whether to load rules from config file.