'This is called in the context of an external process launched by a Task (possibly not on the Galaxy machine)
to create the input files for the Task. The parameters:
data - a dict containing the contents of the split file'

def process_split_file(data):

    args = data['args']
    input_name = data['input_name']
    output_name = data['output_name']
    start_sequence = long(args['start_sequence'])
    sequence_count = long(args['num_sequences'])
    if ('toc_file' in args):
        toc_file = json.load(open(args['toc_file'], 'r'))
        commands = Sequence.get_split_commands_with_toc(input_name, output_name, toc_file, start_sequence, sequence_count)
    else:
        commands = Sequence.get_split_commands_sequential(is_gzip(input_name), input_name, output_name, start_sequence, sequence_count)
    for cmd in commands:
        if (0 != os.system(cmd)):
            raise Exception(("Executing    '%s'    failed" % cmd))
    return True
