@staticmethod<EOL><INDENT>def set(clear=False, **defaults):<DEDENT>
old_defaults = dict(nonlinear_fit.DEFAULTS)<EOL>if clear:<EOL><INDENT>nonlinear_fit.DEFAULTS = {}<EOL><DEDENT>for k in defaults:<EOL><INDENT>if k == '<STR_LIT>' and defaults[k] not in nonlinear_fit.FITTERS:<EOL><INDENT>raise ValueError('<STR_LIT>' + str(defaults[k]))<EOL><DEDENT>nonlinear_fit.DEFAULTS[k] = defaults[k]<EOL><DEDENT>return old_defaults<EOL>
Set default parameters for :class:`lsqfit.nonlinear_fit`.

        Use to set default values for parameters: ``svdcut``,
        ``debug``, ``tol``, ``maxit``, and ``fitter``. Can also set
        parameters specific to the fitter specified by the ``fitter``
        argument.

        Sample usage::

            import lsqfit

            old_defaults = lsqfit.nonlinear_fit.set(
                fitter='gsl_multifit', alg='subspace2D', solver='cholesky',
                tol=1e-10, debug=True,
                )

        ``nonlinear_fit.set()`` without arguments returns a
        dictionary containing the current defaults.

        Args:
            clear (bool): If ``True`` remove earlier settings,
                restoring the original defaults, before adding new
                defaults. The default value is ``clear=False``.
                ``nonlinear_fit.set(clear=True)`` restores the
                original defaults.
            defaults (dict): Dictionary containing new defaults.

        Returns:
            A dictionary containing the old defaults,
            before they were updated. These can be restored using
            ``nonlinear_fit.set(old_defaults)`` where ``old_defaults``
            is the dictionary containint the old defaults.