<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def struct2dict(struct):
 """convert a ctypes structure to a dictionary"""

    return {x: getattr(struct, x) for x in dict(struct._fields_).keys()}