<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _assertField(self, name):
 """Raise AttributeError when PacketHistory has no field with the given name. """

        if name not in self._names:
            msg    = 'PacketHistory "%s" has no field "%s"'
            values = self._defn.name, name
            raise AttributeError(msg % values)