<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def version(self, v):
 """ Sets the CoAP version :param v: the version :raise AttributeError: if value is not 1 """

        if not isinstance(v, int) or v != 1:
            raise AttributeError
        self._version = v