<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def context_to_app(self, dataType):
 """Return an application encoded tag."""

        if self.tagClass != Tag.contextTagClass:
            raise ValueError("context tag required")

        # context booleans have value in data
        if (dataType == Tag.booleanAppTag):
            return Tag(Tag.applicationTagClass, Tag.booleanAppTag, struct.unpack('B', self.tagData)[0], '')
        else:
            return ApplicationTag(dataType, self.tagData)