<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fetch_and_convert_dataset(source_files, target_filename):
 """ Decorator applied to a dataset conversion function that converts acquired source files into a dataset file that BatchUp can use. Parameters source_file: list of `AbstractSourceFile` instances A list of files to be acquired target_filename: str or callable The name of the target file in which to store the converted data either as a string or as a function of the form `fn() -> str` that returns it. The conversion function is of the form `fn(source_paths, target_path)`. It should return `target_path` if successful, `None` otherwise. After the conversion function is successfully applied, the temporary source files that were downloaded or copied into BatchUp's temporary directory are deleted, unless the conversion function moved or deleted them in which case no action is taken. Example ------- In this example, we will show how to acquire the USPS dataset from an online source. USPS is provided as an HDF5 file anyway, so the conversion function simply moves it to the target path: In this example, the USPS dataset will be acquired from a file on the filesystem. Note that the source path is fixed; the next example shows how we can determine the source path dynamically: The source path is provided as an argument to the decorated fetch function: """

    if not isinstance(target_filename, six.string_types) and \
            not callable(target_filename):
        raise TypeError(
            'target_filename must either be a string or be callable (it is '
            'a {})'.format(type(target_filename)))

    for src in source_files:
        if not isinstance(src, AbstractSourceFile):
            raise TypeError('source_files should contain'
                            '`AbstractSourceFile` instances, '
                            'not {}'.format(type(src)))

    def decorate_fetcher(convert_function):
        def fetch(**kwargs):
            target_fn = path_string(target_filename)
            target_path = config.get_data_path(target_fn)

            # If the target file does not exist, we need to acquire the
            # source files and convert them
            if not os.path.exists(target_path):
                # Acquire the source files
                source_paths = []
                for src in source_files:
                    p = src.acquire(**kwargs)
                    if p is not None:
                        if p in source_paths:
                            raise ValueError(
                                'Duplicate source file {}'.format(p))
                        source_paths.append(p)
                    else:
                        print('Failed to acquire {}'.format(src))
                        return None

                # Got the source files
                # Convert
                converted_path = convert_function(source_paths, target_path)

                # If successful, delete the source files
                if converted_path is not None:
                    for src in source_files:
                        src.clean_up()

                return converted_path
            else:
                # Target file already exists
                return target_path

        fetch.__name__ = convert_function.__name__

        return fetch

    return decorate_fetcher