def get_opts(opts):
defaults = {<EOL>'<STR_LIT>': None,<EOL>'<STR_LIT>': Opt.random,<EOL>'<STR_LIT>': Opt.preset,<EOL>'<STR_LIT>': Opt.preset,<EOL>'<STR_LIT>': Opt.preset,<EOL>'<STR_LIT>': Opt.preset,<EOL>}<EOL>_opts = defaults.copy()<EOL>if opts is None:<EOL><INDENT>opts = dict()<EOL><DEDENT>try:<EOL><INDENT>for key, val in opts.copy().items():<EOL><INDENT>if key == '<STR_LIT>':<EOL><INDENT>continue<EOL><DEDENT>opts[key] = Opt(val)<EOL><DEDENT>_opts.update(opts)<EOL><DEDENT>except Exception:<EOL><INDENT>raise ValueError('<STR_LIT>'.format(opts))<EOL><DEDENT>logging.debug('<STR_LIT>'.format(<EOL>pprint.pformat(defaults),<EOL>pprint.pformat(opts),<EOL>pprint.pformat(_opts)))<EOL>return _opts<EOL>
Validate options and apply defaults for options not supplied.

:param opts: dictionary mapping str->str.
:return: dictionary mapping str->Opt. All possible keys are present.