def buildfitfcn(self):
def _fitfcn(p, flatmodels=self.flatmodels):<EOL><INDENT>ans = gvar.BufferDict()<EOL>for m in flatmodels:<EOL><INDENT>ans[m.datatag] = (<EOL>m.fitfcn(p) if m.ncg <= <NUM_LIT:1> else<EOL>MultiFitter.coarse_grain(m.fitfcn(p), m.ncg)<EOL>)<EOL><DEDENT>return ans<EOL><DEDENT>return _fitfcn<EOL>
Create fit function to fit models in list ``models``.