human
I wrote the below code

    if (not isinstance(sequences, list)):
        sequences = [sequences]
    if (not isinstance(outputs_info, list)):
        outputs_info = [outputs_info]
    if (not isinstance(non_sequences, list)):
        non_sequences = [non_sequences]
    for element in outputs_info:
        if (isinstance(element, dict) and ('taps' in element)):
            raise RuntimeError("scan_checkpoints    doesn't    work    with    taps.")
    if (n_steps is None):
        n_steps = sequences[0].shape[0]
    o_n_steps = theano.tensor.cast(theano.tensor.ceil((n_steps / save_every_N)), 'int64')
    i_n_steps = (save_every_N * theano.tensor.ones((o_n_steps,), 'int64'))
    mod = (n_steps % save_every_N)
    last_n_steps = theano.tensor.switch(theano.tensor.eq(mod, 0), save_every_N, mod)
    i_n_steps = theano.tensor.set_subtensor(i_n_steps[(-1)], last_n_steps)
    if padding:
        join = Join(view=0)
        for (i, s) in enumerate(sequences):
            n = (s.shape[0] % save_every_N)
            z = theano.tensor.zeros((n, s.shape[1:]), dtype=s.dtype)
            sequences[i] = join(0, [s, z])
    o_sequences = [s.reshape(([(s.shape[0] / save_every_N), save_every_N] + [s.shape[i] for i in range(1, s.ndim)]), (s.ndim + 1)) for s in sequences]
    o_sequences.append(i_n_steps)
    new_nitsots = [i for i in outputs_info if (i is None)]
    o_nonsequences = non_sequences
    def outer_step(*args):
        i_sequences = list(args[:len(o_sequences)])
        i_prev_outputs = list(args[len(o_sequences):(- len(o_nonsequences))])
        i_non_sequences = list(args[(- len(o_nonsequences)):])
        i_outputs_infos = (i_prev_outputs + ([None] * len(new_nitsots)))
        (results, updates) = theano.scan(fn=fn, sequences=i_sequences[:(-1)], outputs_info=i_outputs_infos, non_sequences=i_non_sequences, name=(name + '_inner'), n_steps=i_sequences[(-1)])
        if (not isinstance(results, list)):
            results = [results]
        if (not isinstance(results, list)):
            return (results[(-1)], updates)
        else:
       ...

What's a good function header?

Here's a good function header?
assistant
#Here's a good function header.

def scan_checkpoints(fn, sequences=[], outputs_info=None, non_sequences=[], name='checkpointscan_fn', n_steps=None, save_every_N=10, padding=True):