@staticmethod<EOL><INDENT>def process_dataset(dataset, models, **kargs):<DEDENT>
dset = collections.OrderedDict()<EOL>for m in MultiFitter.flatten_models(models):<EOL><INDENT>dset[m.datatag] = (<EOL>m.builddataset(dataset) if m.ncg <= <NUM_LIT:1> else<EOL>MultiFitter.coarse_grain(m.builddataset(dataset), ncg=m.ncg)<EOL>)<EOL><DEDENT>return gvar.dataset.avg_data(dset, **kargs)<EOL>
Convert ``dataset`` to processed data using ``models``.

        :class:`gvar.dataset.Dataset` (or similar dictionary) object
        ``dataset`` is processed by each model in list ``models``,
        and the results collected into a new dictionary ``pdata`` for use in
        :meth:`MultiFitter.lsqfit` and :meth:`MultiFitter.chained_lsqft`.
        Assumes that the models have defined method
        :meth:`MultiFitterModel.builddataset`. Keyword arguments
        ``kargs`` are passed on to :func:`gvar.dataset.avg_data` when
        averaging the data.