docs: def _load_cell(args, cell_body):
    """Implements the BigQuery load magic used to load data from GCS to a table.
  
     The supported syntax is:
  
         %bq load <optional args>
  
    Args:
      args: the arguments following '%bq load'.
      cell_body: optional contents of the cell interpreted as YAML or JSON.
    Returns:
      A message about whether the load succeeded or failed.
    """
    env = google.datalab.utils.commands.notebook_environment()
    config = google.datalab.utils.commands.parse_config(cell_body, env, False) or {}
  
    parameters = config.get('parameters') or []
    if parameters:
      jsonschema.validate({'parameters': parameters}, BigQuerySchema.QUERY_PARAMS_SCHEMA)
    name = google.datalab.bigquery.Query.resolve_parameters(args['table'], parameters)
  
    table = _get_table(name)
    if not table:
      table = bigquery.Table(name)
  
    if args['mode'] == 'create':
      if table.exists():
        raise Exception('table %s already exists; use "append" or "overwrite" as mode.' % name)
      if not cell_body or 'schema' not in cell_body:
        raise Exception('Table does not exist, and no schema specified in cell; cannot load.')
  
      schema = config['schema']
      # schema can be an instance of bigquery.Schema.
      # For example, user can run "my_schema = bigquery.Schema.from_data(df)" in a previous cell and
      # specify "schema: $my_schema" in cell input.
      if not isinstance(schema, bigquery.Schema):
        jsonschema.validate({'schema': schema}, BigQuerySchema.TABLE_SCHEMA_SCHEMA)
        schema = bigquery.Schema(schema)
      table.create(schema=schema)
    elif not table.exists():
      raise Exception('table %s does not exist; use "create" as mode.' % name)
  
    csv_options = bigquery.CSVOptions(delimiter=args['delimiter'], skip_leading_rows=args['skip'],
                                      allow_jagged_rows=not args['strict'], quote=args['quote'])
    path = google.datalab.bigquery.Query.resolve_parameters(args['path'], parameters)
    job = table.load(path, mode=args['mode'], source_format=args['format'], csv_options=csv_options,
                     ignore_unknown_values=not args['strict'])
    if job.failed:
      raise Exception('Load failed: %s' % str(job.fatal_error))
    elif job.errors:
      raise Exception('Load completed with errors: %s' % str(job.errors))