<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_yaml(self, y):
        '''Parse a YAML specification of a data port connector into this
        object.

        '''
        self.connector_id = y['connectorId']
        self.name = y['name']
        self.data_type = y['dataType']
        self.interface_type = y['interfaceType']
        self.data_flow_type = y['dataflowType']
        if 'subscriptionType' in y:
            self.subscription_type = y['subscriptionType']
        else:
            self.subscription_type = ''
        if 'pushInterval' in y:
            self.push_interval = float(y['pushInterval'])
        else:
            self.push_interval = 0.0
        if RTS_EXT_NS_YAML + 'comment' in y:
            self.comment = y[RTS_EXT_NS_YAML + 'comment']
        else:
            self.comment = ''
        if RTS_EXT_NS_YAML + 'visible' in y:
            visible = y[RTS_EXT_NS_YAML + 'visible']
            if visible == True or visible == 'true' or visible == '1':
                self.visible = True
            else:
                self.visible = False
        if not 'sourceDataPort' in y:
            raise InvalidDataPortConnectorNodeError
        self.source_data_port = \
                TargetPort().parse_yaml(y['sourceDataPort'])
        if not 'targetDataPort' in y:
            raise InvalidDataPortConnectorNodeError
        self.target_data_port = \
                TargetPort().parse_yaml(y['targetDataPort'])
        if RTS_EXT_NS_YAML + 'properties' in y:
            for p in y[RTS_EXT_NS_YAML + 'properties']:
                if 'value' in p:
                    value = p['value']
                else:
                    value = None
                self._properties[p['name']] = value
        return self