def locations(self, exists=True):
result = []<EOL>for config_files in self.config_paths:<EOL><INDENT>if not config_files:<EOL><INDENT>continue<EOL><DEDENT>if os.path.isdir(config_files):<EOL><INDENT>config_files = [os.path.join(config_files, i)<EOL>for i in sorted(os.listdir(config_files))<EOL>if i.endswith('<STR_LIT>')]<EOL><DEDENT>else:<EOL><INDENT>config_files = [config_files]<EOL><DEDENT>for config_file in config_files:<EOL><INDENT>if not exists or os.path.exists(config_file):<EOL><INDENT>config_file = os.path.abspath(config_file)<EOL>if config_file in result:<EOL><INDENT>result.remove(config_file)<EOL><DEDENT>result.append(config_file)<EOL><DEDENT><DEDENT><DEDENT>return result<EOL>
Return the location of the config file(s).

            A given directory will be scanned for ``*.conf`` files, in alphabetical order.
            Any duplicates will be eliminated.

            If ``exists`` is True, only existing configuration locations are returned.