def structs2records(structs):
try:<EOL><INDENT>n = len(structs)<EOL><DEDENT>except TypeError:<EOL><INDENT>yield struct2dict(structs)<EOL>return<EOL><DEDENT>for i in range(n):<EOL><INDENT>struct = structs[i]<EOL>yield struct2dict(struct)<EOL><DEDENT>
convert one or more structs and generate dictionaries