<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add(self, defn):
 """Adds the given Packet Definition to this Telemetry Dictionary."""

        if defn.name not in self:
            self[defn.name] = defn
        else:
            msg = "Duplicate packet name '%s'" % defn.name
            log.error(msg)
            raise util.YAMLError(msg)