Code Duplication    Length = 17-17 lines in 2 locations

savu/core/iterative_plugin_runner.py 2 locations

@@ 374-390 (lines=17) @@
371
                           f"plugin's plugin_out_datasets"
372
                print(info_str)
373
374
            if s2 in p[0]:
375
                new_cloned_data_pData = \
376
                    self._ip_plugin_data_dict['clone']['start_plugin']
377
                self.start_plugin.parameters['plugin_in_datasets'] = \
378
                    [new_cloned_data_pData]
379
                p[0][0]._set_plugin_data(new_cloned_data_pData)
380
            elif s2 in p[1]:
381
                new_cloned_data_pData = \
382
                    self._ip_plugin_data_dict['clone']['end_plugin']
383
                self.end_plugin.parameters['plugin_out_datasets'] = \
384
                    [new_cloned_data_pData]
385
                p[1][0]._set_plugin_data(new_cloned_data_pData)
386
            else:
387
                info_str = f"s2 {s2.backing_file} wasn't in either the start " \
388
                           f"plugin's plugin_in_datasets, nor the end " \
389
                           f"plugin's plugin_out_datasets"
390
                print(info_str)
391
392
        # reset the values inside Data.data_info that have an effect on how the
393
        # value of core_slice in SliceLists comes out
@@ 356-372 (lines=17) @@
353
        for s1, s2 in self._ip_data_dict['iterating'].items():
354
            # change the PluginData obejcts for the in and out datasets, to take
355
            # care of the potential switching of patterns
356
            if s1 in p[0]:
357
                new_original_data_pData = \
358
                    self._ip_plugin_data_dict['original']['start_plugin']
359
                self.start_plugin.parameters['plugin_in_datasets'] = \
360
                    [new_original_data_pData]
361
                p[0][0]._set_plugin_data(new_original_data_pData)
362
            elif s1 in p[1]:
363
                new_original_data_pData = \
364
                    self._ip_plugin_data_dict['original']['end_plugin']
365
                self.end_plugin.parameters['plugin_out_datasets'] = \
366
                    [new_original_data_pData]
367
                p[1][0]._set_plugin_data(new_original_data_pData)
368
            else:
369
                info_str = f"s1 {s1.backing_file} wasn't in either the start " \
370
                           f"plugin's plugin_in_datasets, nor the end " \
371
                           f"plugin's plugin_out_datasets"
372
                print(info_str)
373
374
            if s2 in p[0]:
375
                new_cloned_data_pData = \