def _create_cell(args, cell_body):
  """Implements the pipeline cell create magic used to create Pipeline objects.
  The supported syntax is:
      %%pipeline create <args>
      [<inline YAML>]
  Args:
    args: the arguments following '%%pipeline create'.
    cell_body: the contents of the cell
  """
  name = args.get('name')
  if name is None:
    raise Exception("Pipeline name was not specified.")
  pipeline_spec = google.datalab.utils.commands.parse_config(
    cell_body, google.datalab.utils.commands.notebook_environment())
  airflow_spec = google.datalab.contrib.pipeline._pipeline.PipelineGenerator.generate_airflow_spec(
      name, pipeline_spec)

  debug = args.get('debug')
  if debug is True:
    return airflow_spec
Implements the pipeline cell create magic used to create Pipeline objects.
  The supported syntax is:
      %%pipeline create <args>
      [<inline YAML>]
  Args:
    args: the arguments following '%%pipeline create'.
    cell_body: the contents of the cell