def prepare_metadata(metadata):
pairs = {<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': [{<EOL>'<STR_LIT:key>': '<STR_LIT>',<EOL>'<STR_LIT:value>': '<STR_LIT>'<EOL>}<EOL>]<EOL>}<EOL>}<EOL>for key,val in metadata.items():<EOL><INDENT>if not isinstance(val,dict) and not isinstance(val,list):<EOL><INDENT>pairs['<STR_LIT>']['<STR_LIT>'].append({'<STR_LIT:key>':key,'<STR_LIT:value>':val})<EOL><DEDENT>elif isinstance(val,dict):            <EOL><INDENT>for k,v in val.items():<EOL><INDENT>if not isinstance(v,dict) and not isinstance(v,list):<EOL><INDENT>pairs['<STR_LIT>']['<STR_LIT>'].append({'<STR_LIT:key>':k,'<STR_LIT:value>':v})<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return pairs<EOL>
prepare a key/value list of metadata for the request. The metadata
       object that comes in is only parsed one level.