<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def connect(self):
 """Connect the |LinkSequence| instances handled by the actual model to the |NodeSequence| instances handled by one inlet node and multiple oulet nodes. The HydPy-H-Branch model passes multiple output values to different outlet nodes. This requires additional information regarding the `direction` of each output value. Therefore, node names are used as keywords. Assume the discharge values of both nodes `inflow1` and `inflow2` shall be branched to nodes `outflow1` and `outflow2` via element `branch`: Then parameter |YPoints| relates different supporting points via its keyword arguments to the respective nodes: After connecting the model with its element the total discharge value of nodes `inflow1` and `inflow2` can be properly divided: sim(2.0) sim(4.0) In case of missing (or misspelled) outlet nodes, the following error is raised: Traceback (most recent call last):
 RuntimeError: Model `hbranch` of element `branch` tried to connect \ to an outlet node named `outflow1`, which is not an available outlet node \ of element `branch`. """

        nodes = self.element.inlets
        total = self.sequences.inlets.total
        if total.shape != (len(nodes),):
            total.shape = len(nodes)
        for idx, node in enumerate(nodes):
            double = node.get_double('inlets')
            total.set_pointer(double, idx)
        for (idx, name) in enumerate(self.nodenames):
            try:
                outlet = getattr(self.element.outlets, name)
                double = outlet.get_double('outlets')
            except AttributeError:
                raise RuntimeError(
                    f'Model {objecttools.elementphrase(self)} tried '
                    f'to connect to an outlet node named `{name}`, '
                    f'which is not an available outlet node of element '
                    f'`{self.element.name}`.')
            self.sequences.outlets.branched.set_pointer(double, idx)