           scroll_to_top()
 
     run_context.cli = cli = bind_cli run_context
+    _.defaults run_context, extra_contexts...
 
     run_context
 


    output_cell

  create_run_context = (input_cell, output_cell) ->
    $top = input_cell.$el

    scroll_to_top = ->
      setTimeout ->
        $('html, body').scrollTop $top.offset().top
      , 10

    result_handlers =[
      ignored,
      handle_cli_cmd,
      handle_renderable,
      handle_lead_node,
      handle_any_object
    ]

    output = ($target) ->
      (output) ->
        $target.removeClass 'clean'
        $item = $ '<div class="item"/>'
        if output?
          $item.append output
        $target.append $item
        $item

    notebook = input_cell.notebook
    run_context =
      cell: output_cell
      input_cell: input_cell
      notebook: notebook
      ops: all_ops
      current_options: {}
      default_options: notebook.default_options
      output: output output_cell.$el
      scroll_to_top: scroll_to_top
      functions: lead.define_functions {}, graphite_function_names
      vars: lead: {github, graphite, colors}
      set_code: (code) ->
        cell = add_input_cell notebook, code: code, after: run_context.cell
        focus_cell cell

      clear_output: -> clear_notebook notebook
      previously_run: -> input_cell_at_offset(input_cell, -1).editor.getValue()
      hide_input: -> hide_cell input_cell
      open_file: -> open_file_picker run_context
      export_notebook: -> export_notebook input_cell
      save: ->
