def to_dict(ramons, flatten=False):
if type(ramons) is not list:<EOL><INDENT>ramons = [ramons]<EOL><DEDENT>out_ramons = {}<EOL>for r in ramons:<EOL><INDENT>out_ramons[r.id] = {<EOL>"<STR_LIT:id>": r.id,<EOL>"<STR_LIT:type>": _reverse_ramon_types[type(r)],<EOL>"<STR_LIT>": vars(r)<EOL>}<EOL><DEDENT>return out_ramons<EOL>
Converts a RAMON object list to a JSON-style dictionary. Useful for going
from an array of RAMONs to a dictionary, indexed by ID.

Arguments:
    ramons (RAMON[]): A list of RAMON objects
    flatten (boolean: False): Not implemented

Returns:
    dict: A python dictionary of RAMON objects.