<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def factory(data):
 """Tahoma Event factory."""

        if data['name'] is "DeviceStateChangedEvent":
            return DeviceStateChangedEvent(data)
        elif data['name'] is "ExecutionStateChangedEvent":
            return ExecutionStateChangedEvent(data)
        elif data['name'] is "CommandExecutionStateChangedEvent":
            return CommandExecutionStateChangedEvent(data)
        else:
            raise ValueError("Unknown event '" + data['name'] + "' occurred.")