<commit_before>"""
Wraps interfaces modules to work with pipeline engine
"""
import os
import sys
from copy import deepcopy
import logging
from shutil import rmtree
from tempfile import mkdtemp
import numpy as np

from nipype.utils.filemanip import (copyfiles, fname_presuffix,
                                    filename_to_list, list_to_filename,
                                    fnames_presuffix, save_json,
                                    FileNotFoundError)
from nipype.interfaces.base import Bunch, InterfaceResult, CommandLine
from nipype.interfaces.fsl import FSLCommand
import nipype.pipeline.engine as pe

logger = logging.getLogger('nodewrapper')

class NodeWrapper(object):
    """Wraps interface objects for use in pipeline
    

    Parameters
    ----------
    interface : interface object
        node specific interface  (fsl.Bet(), spm.Coregister())
    iterables : generator
        input field and list to iterate using the pipeline engine
        for example to iterate over different frac values in fsl.Bet()
        for a single field the input can be a tuple, otherwise a list
        of tuples
        node.iterables = ('frac',[0.5,0.6,0.7])
        node.iterables = [('fwhm',[2,4]),('fieldx',[0.5,0.6,0.7])]
    iterfield : 1+-element list
        key(s) over which to repeatedly call the interface.
        for example, to iterate FSL.Bet over multiple files, one can
        set node.iterfield = ['infile'].  If this list has more than 1 item
        then the inputs are selected in order simultaneously from each of these
        fields and each field will need to have the same number of members.<commit_msg>removed unused imports from node_wrapper<commit_after>"""
Wraps interfaces modules to work with pipeline engine
"""
import os
import sys
from copy import deepcopy
import logging
from shutil import rmtree
from tempfile import mkdtemp
import numpy as np

from nipype.utils.filemanip import (copyfiles, fname_presuffix,
                                    filename_to_list, list_to_filename,
                                    fnames_presuffix, save_json,
                                    FileNotFoundError)
from nipype.interfaces.base import Bunch, InterfaceResult, CommandLine

logger = logging.getLogger('nodewrapper')

class NodeWrapper(object):
    """Wraps interface objects for use in pipeline
    

    Parameters
    ----------
    interface : interface object
        node specific interface  (fsl.Bet(), spm.Coregister())
    iterables : generator
        input field and list to iterate using the pipeline engine
        for example to iterate over different frac values in fsl.Bet()
        for a single field the input can be a tuple, otherwise a list
        of tuples
        node.iterables = ('frac',[0.5,0.6,0.7])
        node.iterables = [('fwhm',[2,4]),('fieldx',[0.5,0.6,0.7])]
    iterfield : 1+-element list
        key(s) over which to repeatedly call the interface.
        for example, to iterate FSL.Bet over multiple files, one can
        set node.iterfield = ['infile'].  If this list has more than 1 item
        then the inputs are selected in order simultaneously from each of these
        fields and each field will need to have the same number of members.
{'fraction_non_alphanumeric': 0.07288449660284126, 'fraction_numerical': 0.009882643607164917, 'mean_word_length': 2.5790055248618784, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4530631', 'n_tokens_mistral': 862, 'n_tokens_neox': 845, 'n_words': 341}