<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_output(self, spec_name, node, node_output, format=None, # @ReservedAssignment @IgnorePep8 **kwargs):
 """ Connects an output to a study fileset spec Parameters spec_name : str Name of the study fileset spec to connect to node : arcana.Node The node to connect the output from node_output : str Name of the output on the node to connect to the fileset format : FileFormat | None The file format the output is returned in. If it differs from the format in data spec then an implicit conversion is performed. If None the it is assumed to be returned in the file format of the entry the data spec """

        name = self._map_name(spec_name, self._output_map)
        if name not in self.study.data_spec_names():
            raise ArcanaDesignError(
                "Proposed output '{}' to {} is not a valid spec name ('{}')"
                .format(name, self._error_msg_loc,
                        "', '".join(self.study.data_spec_names())))
        if name in self._output_conns:
            prev_node, prev_node_output, _, _ = self._output_conns[name]
            logger.info(
                "Reassigning '{}' output from {}:{} to {}:{} in {}"
                .format(name, prev_node.name, prev_node_output,
                        node.name, node_output, self._error_msg_loc))
        self._output_conns[name] = (node, node_output, format, kwargs)