def attr(*args, **kwargs):
ctx = dom_tag._with_contexts[_get_thread_context()]<EOL>if ctx and ctx[-<NUM_LIT:1>]:<EOL><INDENT>dicts = args + (kwargs,)<EOL>for d in dicts:<EOL><INDENT>for attr, value in d.items():<EOL><INDENT>ctx[-<NUM_LIT:1>].tag.set_attribute(*dom_tag.clean_pair(attr, value))<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>
Set attributes on the current active tag context