def list_solvers(args=None):
parser = argparse.ArgumentParser(<EOL>description='''<STR_LIT>''')<EOL>parser.add_argument(<EOL>'<STR_LIT>', nargs='<STR_LIT:*>', type=str,<EOL>help='<STR_LIT>')<EOL>parsed_args = parser.parse_args(args)<EOL>requirements = {}<EOL>for arg in parsed_args.requirement:<EOL><INDENT>try:<EOL><INDENT>key, value = parse_solver_setting(arg)<EOL><DEDENT>except ValueError as e:<EOL><INDENT>parser.error(str(e))<EOL><DEDENT>else:<EOL><INDENT>requirements[key] = value<EOL><DEDENT><DEDENT>solvers = list(filter_solvers(_solvers, requirements))<EOL>solver_names = set(solver['<STR_LIT:name>'] for solver in solvers)<EOL>priority = {}<EOL>if '<STR_LIT>' in os.environ:<EOL><INDENT>names = os.environ['<STR_LIT>'].split('<STR_LIT:U+002C>')<EOL>for i, solver_name in enumerate(names):<EOL><INDENT>priority[solver_name] = len(names) - i<EOL><DEDENT>solvers = [s for s in solvers if s['<STR_LIT:name>'] in priority]<EOL>solver_names = set(priority)<EOL><DEDENT>else:<EOL><INDENT>for solver in solvers:<EOL><INDENT>priority[solver['<STR_LIT:name>']] = solver['<STR_LIT>']<EOL><DEDENT><DEDENT>solvers = sorted(solvers, key=lambda s: priority.get(s['<STR_LIT:name>'], <NUM_LIT:0>),<EOL>reverse=True)<EOL>status = <NUM_LIT:0><EOL>if len(solvers) > <NUM_LIT:0>:<EOL><INDENT>print('<STR_LIT>')<EOL>for solver in solvers:<EOL><INDENT>print('<STR_LIT>'.format(solver['<STR_LIT:name>']))<EOL>print('<STR_LIT>'.format(solver['<STR_LIT>']))<EOL>print('<STR_LIT>'.format(<EOL>solver['<STR_LIT>']))<EOL>print('<STR_LIT>'.format(<EOL>solver['<STR_LIT>']))<EOL>print('<STR_LIT>'.format(solver['<STR_LIT>']))<EOL>print('<STR_LIT>'.format(solver['<STR_LIT:class>']))<EOL>print()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>status = <NUM_LIT:1><EOL>print('<STR_LIT>')<EOL>print()<EOL><DEDENT>filtered_solvers_count = len(_solvers) - len(solvers)<EOL>if filtered_solvers_count > <NUM_LIT:0> or len(_solver_import_errors) > <NUM_LIT:0>:<EOL><INDENT>print('<STR_LIT>')<EOL>for solver in _solvers:<EOL><INDENT>if solver['<STR_LIT:name>'] not in solver_names:<EOL><INDENT>print('<STR_LIT>'.format(<EOL>solver['<STR_LIT:name>']))<EOL><DEDENT><DEDENT>for solver, error in iteritems(_solver_import_errors):<EOL><INDENT>print('<STR_LIT>'.format(solver, error))<EOL><DEDENT><DEDENT>if status != <NUM_LIT:0>:<EOL><INDENT>parser.exit(status)<EOL><DEDENT>
Entry point for listing available solvers.