def __init__(self, settings=None, custom_base_path=None, sp_validation_only=False):
self.__sp_validation_only = sp_validation_only<EOL>self.__paths = {}<EOL>self.__strict = False<EOL>self.__debug = False<EOL>self.__sp = {}<EOL>self.__idp = {}<EOL>self.__security = {}<EOL>self.__contacts = {}<EOL>self.__organization = {}<EOL>self.__errors = []<EOL>self.__load_paths(base_path=custom_base_path)<EOL>self.__update_paths(settings)<EOL>if settings is None:<EOL><INDENT>try:<EOL><INDENT>valid = self.__load_settings_from_file()<EOL><DEDENT>except Exception as e:<EOL><INDENT>raise e<EOL><DEDENT>if not valid:<EOL><INDENT>raise OneLogin_Saml2_Error(<EOL>'<STR_LIT>',<EOL>OneLogin_Saml2_Error.SETTINGS_INVALID,<EOL>'<STR_LIT:U+002C>'.join(self.__errors)<EOL>)<EOL><DEDENT><DEDENT>elif isinstance(settings, dict):<EOL><INDENT>if not self.__load_settings_from_dict(settings):<EOL><INDENT>raise OneLogin_Saml2_Error(<EOL>'<STR_LIT>',<EOL>OneLogin_Saml2_Error.SETTINGS_INVALID,<EOL>'<STR_LIT:U+002C>'.join(self.__errors)<EOL>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise OneLogin_Saml2_Error(<EOL>'<STR_LIT>',<EOL>OneLogin_Saml2_Error.UNSUPPORTED_SETTINGS_OBJECT<EOL>)<EOL><DEDENT>self.format_idp_cert()<EOL>if '<STR_LIT>' in self.__idp:<EOL><INDENT>self.format_idp_cert_multi()<EOL><DEDENT>self.format_sp_cert()<EOL>if '<STR_LIT>' in self.__sp:<EOL><INDENT>self.format_sp_cert_new()<EOL><DEDENT>self.format_sp_key()<EOL>
Initializes the settings:
- Sets the paths of the different folders
- Loads settings info from settings file or array/object provided

:param settings: SAML Toolkit Settings
:type settings: dict

:param custom_base_path: Path where are stored the settings file and the cert folder
:type custom_base_path: string

:param sp_validation_only: Avoid the IdP validation
:type sp_validation_only: boolean