def record(self, ekey, entry, diff=False):
if ekey not in self.entities:<EOL><INDENT>self.entities[ekey] = []<EOL><DEDENT>if diff and len(self.entities[ekey]) > <NUM_LIT:0>:<EOL><INDENT>from acorn.logging.diff import cascade, compress<EOL>sequence = [e["<STR_LIT:c>"] for e in self.entities[ekey]<EOL>if e["<STR_LIT:m>"] == entry["<STR_LIT:m>"]]<EOL>original = cascade(sequence)<EOL>difference = compress(original, entry["<STR_LIT:c>"])<EOL>entry["<STR_LIT:c>"] = difference<EOL><DEDENT>self.entities[ekey].append(entry)<EOL>from uuid import UUID<EOL>uid = None<EOL>if entry["<STR_LIT:r>"] is not None:<EOL><INDENT>uid = entry["<STR_LIT:r>"]<EOL><DEDENT>elif isinstance(ekey, str):<EOL><INDENT>try:<EOL><INDENT>uid = str(UUID(ekey))<EOL><DEDENT>except ValueError: <EOL><INDENT>pass<EOL><DEDENT><DEDENT>if uid is not None and isinstance(uid, str):<EOL><INDENT>self.log_uuid(uid)<EOL><DEDENT>if entry["<STR_LIT:a>"] is None:<EOL><INDENT>return<EOL><DEDENT>for larg in entry["<STR_LIT:a>"]["<STR_LIT:_>"]:<EOL><INDENT>if not isinstance(larg, str):<EOL><INDENT>continue<EOL><DEDENT>try:<EOL><INDENT>uid = str(UUID(larg))<EOL>self.log_uuid(uid)<EOL><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>for key, karg in entry["<STR_LIT:a>"].items():<EOL><INDENT>if key == "<STR_LIT:_>" or not isinstance(karg, str):<EOL><INDENT>continue<EOL><DEDENT>try:<EOL><INDENT>uid = str(UUID(karg))<EOL>self.log_uuid(uid)<EOL><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>
Records the specified entry to the key-value store under the specified
        entity key.

        Args:
            ekey (str): fqdn/uuid of the method/object to store the entry for.
            entry (dict): attributes and values gleaned from the execution.
            diff (bool): when True, the "c" element of `entry` will be diffed
              against previous entries under the same `ekey` if their method
              (attribute "m") matches.