<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_type(cls, type_string):
 """Parse KATCP formatted type code into Sensor type constant. Parameters type_string : str KATCP formatted type code. Returns ------- sensor_type : Sensor type constant The corresponding Sensor type constant. """

        if type_string in cls.SENSOR_TYPE_LOOKUP:
            return cls.SENSOR_TYPE_LOOKUP[type_string]
        else:
            raise KatcpSyntaxError("Invalid sensor type string %s" %
                                   type_string)