human
I wrote the below code

    param.seq_len = 1
    ds = CharRNNData(param.corpus, 100000)
    pred = OfflinePredictor(PredictConfig(model=Model(), session_init=SaverRestore(path), input_names=['input', 'c0', 'h0', 'c1', 'h1'], output_names=['prob', 'last_state']))
    initial = np.zeros((1, param.rnn_size))
    for c in start[:(-1)]:
        x = np.array([[ds.char2idx[c]]], dtype='int32')
        (_, state) = pred(x, initial, initial, initial, initial)
    def pick(prob):
        t = np.cumsum(prob)
        s = np.sum(prob)
        return int(np.searchsorted(t, (np.random.rand(1) * s)))
    ret = start
    c = start[(-1)]
    for k in range(length):
        x = np.array([[ds.char2idx[c]]], dtype='int32')
        (prob, state) = pred(x, state[(0, 0)], state[(0, 1)], state[(1, 0)], state[(1, 1)])
        c = ds.chars[pick(prob[0])]
        ret += c
    print ret

What's a good function header?
 Give me a Python code to print ret?
assistant
#Here is Python code to print ret
.

def sample(path, start, length):