def add_path_to_file(self, dictionary, path_to_add, input_file=True, output_file=False):
        """
        This function add a path in front of each value in a dictionary (provided by the parser) for option that are files or folders.
        This function can affect option files that represent input and/or output with "input_file" and output_file" parameters.
        The parameter path_to_add must contain the character "/" at its end.
        Output is the same dictionary as provided but modified with added path.
        """
        for key, option in dictionary.iteritems():
            # Check if option is present in this parser
            if self.options in key:
                # If input file is a list, we need to check what type of list it is.
                # If it contains files, it must be updated.
                if (input_file and self.options[key].type_value in Option.OPTION_PATH_INPUT) or (output_file and self.options[key].type_value in Option.OPTION_PATH_OUTPUT):
                    if isinstance(self.options[key].type_value, list):
                        for i, value in enumerate(option):
                            option[i] = path_to_add + value
                        dictionary[key] = option
                    else:
                        dictionary[key] = str(path_to_add) + str(option)
            else:
                sct.printv("ERROR: the option you provided is not contained in this parser. Please check the dictionary", verbose=1, type='error')

        return dictionary
dataset/ETHPy150Open neuropoly/spinalcordtoolbox/scripts/msct_parser.py/Parser.add_path_to_file/swapped operands of `in`