def field_eq(p, e):
if isinstance(e, dict):<EOL><INDENT>return all(field_eq(p[i], j) for (i, j) in iter(e.items()))<EOL><DEDENT>elif isinstance(e, list):<EOL><INDENT>return all(field_eq(p[i], j) for (i, j) in enumerate(e))<EOL><DEDENT>else:<EOL><INDENT>return p == e<EOL><DEDENT>
Checks the field values of a parsed message for equality against
some ground truth value.

Parameters
----------
p : object with dict-like attributed access
  Parsed field contents.
e : object with dict-like attributed access
  Expected field contents.

Returns
----------
True if fields are equal, else False.