human
Complete the below
def create_experiment(output_dir):

    ''''Creates a new Experiment instance.
    Args:
    output_dir: Output directory for model checkpoints and summaries.'
    '''
assistant
#Here is the Python code you requested.
    config = run_config.RunConfig(tf_random_seed=FLAGS.tf_random_seed, save_checkpoints_secs=FLAGS.save_checkpoints_secs, save_checkpoints_steps=FLAGS.save_checkpoints_steps, keep_checkpoint_max=FLAGS.keep_checkpoint_max, keep_checkpoint_every_n_hours=FLAGS.keep_checkpoint_every_n_hours, gpu_memory_fraction=FLAGS.gpu_memory_fraction)
    config.tf_config.gpu_options.allow_growth = FLAGS.gpu_allow_growth
    config.tf_config.log_device_placement = FLAGS.log_device_placement
    train_options = training_utils.TrainOptions(model_class=FLAGS.model, model_params=FLAGS.model_params)
    if config.is_chief:
        gfile.MakeDirs(output_dir)
        train_options.dump(output_dir)
    bucket_boundaries = None
    if FLAGS.buckets:
        bucket_boundaries = list(map(int, FLAGS.buckets.split(u',')))
    train_input_pipeline = input_pipeline.make_input_pipeline_from_def(def_dict=FLAGS.input_pipeline_train, mode=tf.contrib.learn.ModeKeys.TRAIN)
    train_input_fn = training_utils.create_input_fn(pipeline=train_input_pipeline, batch_size=FLAGS.batch_size, bucket_boundaries=bucket_boundaries, scope=u'train_input_fn')
    dev_input_pipeline = input_pipeline.make_input_pipeline_from_def(def_dict=FLAGS.input_pipeline_dev, mode=tf.contrib.learn.ModeKeys.EVAL, shuffle=False, num_epochs=1)
    eval_input_fn = training_utils.create_input_fn(pipeline=dev_input_pipeline, batch_size=FLAGS.batch_size, allow_smaller_final_batch=True, scope=u'dev_input_fn')
    def model_fn(features, labels, params, mode):
        u'Builds    the    model    graph'
        model = _create_from_dict({u'class': train_options.model_class, u'params': train_options.model_params}, models, mode=mode)
        return model(features, labels, params)
    estimator = tf.contrib.learn.Estimator(model_fn=model_fn, model_dir=output_dir, config=config, params=FLAGS.model_params)
    train_hooks = []
    for dict_ in FLAGS.hooks:
        hook = _create_from_dict(dict_, hooks, model_dir=estimator.model_dir, run_config=config)
        train_hooks.append(hook)
   ...