title: Access Jupyter code-cell metadata in a kernel
body: <p>I'm developing a Jupyter kernel for Elm, and I would like users to be able to split their code over multiple code cells. To do this, I plan to let the kernel accumulate code from multiple cells without compiling it. Once it has received all of the code the should be compiled together, it will compile it and return the results.</p>
  
  <p>What I haven't figured out yet is how to let users "mark" the last cell in a multi-cell example. One option is to have them insert a special comment (e.g. <code>-- compile-cells</code> or something like that) that the kernel looks for, but this feels like a hack.</p>
  
  <p>It seems like it would be more jupyter-esque to let the user set a metadata flag (probably via a helper extension) on cells which are at the end of an example. Setting metadata is easy enough, but I can't figure out how to access the metadata in the kernel.</p>
  
  <p>So, is there a way to access cell metadata in the kernel? Specifically, I'm currently using the <code>ipykernel.kernelbase.Kernel</code> base class for my kernel, so ideally I would be able to access the cell metadata from the <code>do_execute</code> function.</p>
  
  <p>If this is not possible, is there some other way I could accomplish the same thing?</p>