Code Duplication    Length = 17-17 lines in 2 locations

savu/core/iterative_plugin_runner.py 2 locations

@@ 350-366 (lines=17) @@
347
                           f"plugin's plugin_out_datasets"
348
                print(info_str)
349
350
            if s2 in p[0]:
351
                new_cloned_data_pData = \
352
                    self._ip_plugin_data_dict['clone']['start_plugin']
353
                self.start_plugin.parameters['plugin_in_datasets'] = \
354
                    [new_cloned_data_pData]
355
                p[0][0]._set_plugin_data(new_cloned_data_pData)
356
            elif s2 in p[1]:
357
                new_cloned_data_pData = \
358
                    self._ip_plugin_data_dict['clone']['end_plugin']
359
                self.end_plugin.parameters['plugin_out_datasets'] = \
360
                    [new_cloned_data_pData]
361
                p[1][0]._set_plugin_data(new_cloned_data_pData)
362
            else:
363
                info_str = f"s2 {s2.backing_file} wasn't in either the start " \
364
                           f"plugin's plugin_in_datasets, nor the end " \
365
                           f"plugin's plugin_out_datasets"
366
                print(info_str)
367
368
        # reset the values inside Data.data_info that have an effect on how the
369
        # value of core_slice in SliceLists comes out
@@ 332-348 (lines=17) @@
329
        for s1, s2 in self._ip_data_dict['iterating'].items():
330
            # change the PluginData obejcts for the in and out datasets, to take
331
            # care of the potential switching of patterns
332
            if s1 in p[0]:
333
                new_original_data_pData = \
334
                    self._ip_plugin_data_dict['original']['start_plugin']
335
                self.start_plugin.parameters['plugin_in_datasets'] = \
336
                    [new_original_data_pData]
337
                p[0][0]._set_plugin_data(new_original_data_pData)
338
            elif s1 in p[1]:
339
                new_original_data_pData = \
340
                    self._ip_plugin_data_dict['original']['end_plugin']
341
                self.end_plugin.parameters['plugin_out_datasets'] = \
342
                    [new_original_data_pData]
343
                p[1][0]._set_plugin_data(new_original_data_pData)
344
            else:
345
                info_str = f"s1 {s1.backing_file} wasn't in either the start " \
346
                           f"plugin's plugin_in_datasets, nor the end " \
347
                           f"plugin's plugin_out_datasets"
348
                print(info_str)
349
350
            if s2 in p[0]:
351
                new_cloned_data_pData = \