def format_parameters(params):
if not params:<EOL><INDENT>return {}<EOL><DEDENT>if len(params) == <NUM_LIT:1>:<EOL><INDENT>if params[<NUM_LIT:0>].find('<STR_LIT:;>') != -<NUM_LIT:1>:  <EOL><INDENT>params = params[<NUM_LIT:0>].split('<STR_LIT:;>')<EOL><DEDENT>else:<EOL><INDENT>params = params[<NUM_LIT:0>].split('<STR_LIT:U+002C>')<EOL><DEDENT><DEDENT>parameters = {}<EOL>for p in params:<EOL><INDENT>try:<EOL><INDENT>(n, v) = p.split('<STR_LIT:=>', <NUM_LIT:1>)<EOL><DEDENT>except ValueError:<EOL><INDENT>msg = '<STR_LIT>' % ('<STR_LIT>', p,<EOL>'<STR_LIT>')<EOL>raise exc.CommandError(msg)<EOL><DEDENT>if n not in parameters:<EOL><INDENT>parameters[n] = v<EOL><DEDENT>else:<EOL><INDENT>if not isinstance(parameters[n], list):<EOL><INDENT>parameters[n] = [parameters[n]]<EOL><DEDENT>parameters[n].append(v)<EOL><DEDENT><DEDENT>return parameters<EOL>
Reformat parameters into dict of format expected by the API.