def serialize_options(opts):
options = (opts or {}).copy()<EOL>for key in opts.keys():<EOL><INDENT>if key not in DEFAULT_OPTIONS:<EOL><INDENT>LOG.warning("<STR_LIT>", key)<EOL><DEDENT><DEDENT>options['<STR_LIT>'] = sanitize_regex_param(options.get('<STR_LIT>'))<EOL>options['<STR_LIT>'] = sanitize_regex_param(options.get('<STR_LIT>'))<EOL>if r'<STR_LIT>' in options['<STR_LIT>'] and options['<STR_LIT>'] and options['<STR_LIT>']:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>serialize_option(options, '<STR_LIT>')<EOL>serialize_option(options, '<STR_LIT>', upper=True)<EOL>if isinstance(options.get('<STR_LIT>'), timedelta):<EOL><INDENT>options['<STR_LIT>'] = str(int(options['<STR_LIT>'].total_seconds()))<EOL><DEDENT>return options<EOL>
A helper method to serialize and processes the options dictionary.