def configure(filename=None):
global retry<EOL>if getattr(configure, '<STR_LIT>', False):<EOL><INDENT>return<EOL><DEDENT>filename = filename or DEFAULT_CONFIG_FILENAME<EOL>_ensure_directory(filename)<EOL>parser = SafeConfigParser()<EOL>if os.path.isfile(filename):<EOL><INDENT>with open(filename, '<STR_LIT:r>') as fp:<EOL><INDENT>parser.readfp(fp)<EOL><DEDENT><DEDENT>if not parser.has_section(RETRY_SECTION):<EOL><INDENT>parser.add_section(RETRY_SECTION)<EOL>parser.set(RETRY_SECTION, '<STR_LIT>', str(constants.BACKOFF_DEFAULT_MAXTRIES))<EOL>parser.set(RETRY_SECTION, '<STR_LIT>', str(constants.BACKOFF_DEFAULT_DELAY))<EOL>parser.set(RETRY_SECTION, '<STR_LIT>', str(constants.BACKOFF_DEFAULT_FACTOR))<EOL>with open(filename, '<STR_LIT:wb>') as fp:<EOL><INDENT>parser.write(fp)<EOL><DEDENT><DEDENT>retry = RetrySettings(<EOL>max_tries=parser.getint(RETRY_SECTION, '<STR_LIT>'),<EOL>delay=parser.getint(RETRY_SECTION, '<STR_LIT>'),<EOL>factor=parser.getint(RETRY_SECTION, '<STR_LIT>'))<EOL>setattr(configure, '<STR_LIT>', True)<EOL>setattr(configure, '<STR_LIT>', filename)<EOL>
This function gives to the user application a chance to define where
    configuration file should live. Subsequent calls to this function will have
    no effect, unless you call :func:`reconfigure`.

    :param str filename: Full path to configuration file.