human
I wrote the below code

    keras.layers.core.K.set_learning_phase(0)
    report = AccuracyReport()
    tf.set_random_seed(1234)
    if (not hasattr(backend, u'tf')):
        raise RuntimeError(u'This    tutorial    requires    keras    to    be    configured    to    use    the    TensorFlow    backend.')
    if (keras.backend.image_dim_ordering() != u'tf'):
        keras.backend.set_image_dim_ordering(u'tf')
        print(u"INFO:    '~/.keras/keras.json'    sets    'image_dim_ordering'    to    'th',    temporarily    setting    to    'tf'")
    sess = tf.Session()
    keras.backend.set_session(sess)
    (X_train, Y_train, X_test, Y_test) = data_mnist(train_start=train_start, train_end=train_end, test_start=test_start, test_end=test_end)
    assert (Y_train.shape[1] == 10.0)
    label_smooth = 0.1
    Y_train = Y_train.clip((label_smooth / 9.0), (1.0 - label_smooth))
    x = tf.placeholder(tf.float32, shape=(None, 28, 28, 1))
    y = tf.placeholder(tf.float32, shape=(None, 10))
    model = cnn_model()
    preds = model(x)
    print(u'Defined    TensorFlow    model    graph.')
    def evaluate():
        eval_params = {u'batch_size': batch_size}
        acc = model_eval(sess, x, y, preds, X_test, Y_test, args=eval_params)
        report.clean_train_clean_eval = acc
        assert (X_test.shape[0] == (test_end - test_start)), X_test.shape
        print((u'Test    accuracy    on    legitimate    examples:    %0.4f' % acc))
    train_params = {u'nb_epochs': nb_epochs, u'batch_size': batch_size, u'learning_rate': learning_rate, u'train_dir': train_dir, u'filename': filename}
    ckpt = tf.train.get_checkpoint_state(train_dir)
    ckpt_path = (False if (ckpt is None) else ckpt.model_checkpoint_path)
    if (load_model and ckpt_path):
        saver = tf.train.Saver()
        saver.restore(sess, ckpt_path)
        print(u'Model    loaded    from:    {}'.format(ckpt_path))
        evaluate()
    else:
        print(u'Model    was    not    loaded,    training    from    scratch.')
        model_train(sess, x, y, preds, X_train, Y_train,...

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

def mnist_tutorial(train_start=0, train_end=60000, test_start=0, test_end=10000, nb_epochs=6, batch_size=128, learning_rate=0.001, train_dir=u'/tmp', filename=u'mnist.ckpt', load_model=False, testing=False):