def render_select2_options_code(self, options, id_):
output = []<EOL>for key, value in options.items():<EOL><INDENT>if isinstance(value, (dict, list)):<EOL><INDENT>value = json.dumps(value)<EOL><DEDENT>output.append("<STR_LIT>".format(<EOL>name=key,<EOL>value=mark_safe(value)))<EOL><DEDENT>return mark_safe('<STR_LIT:U+0020>'.join(output))<EOL>
Render options for select2.