gammapy/modeling/parameter.py
def restore_status(self, restore_values=True):
        """Context manager to restore status.

        A copy of the values is made on enter,
        and those values are restored on exit.

        Parameters
        ----------
        restore_values : bool
            Restore values if True, otherwise restore only frozen status.

        Examples
        --------
        ::

            from gammapy.modeling.models import PowerLawSpectralModel
            pwl = PowerLawSpectralModel(index=2)
            with pwl.parameters.restore_status():
                pwl.parameters["index"].value = 3
            print(pwl.parameters["index"].value)
        """
        return restore_parameters_status(self, restore_values)
Context manager to restore status.

        A copy of the values is made on enter,
        and those values are restored on exit.

        Parameters
        ----------
        restore_values : bool
            Restore values if True, otherwise restore only frozen status.

        Examples
        --------
        ::

            from gammapy.modeling.models import PowerLawSpectralModel
            pwl = PowerLawSpectralModel(index=2)
            with pwl.parameters.restore_status():
                pwl.parameters["index"].value = 3
            print(pwl.parameters["index"].value)
        
Context manager to restore status.
A copy of the values is made on enter,
and those values are restored on exit.

Parameters

restore_values : bool
Restore values if True, otherwise restore only frozen status.

Examples
Context manager to restore status . A copy of the values is made on enter and those values are restored on exit . Parameters restore_values : bool Restore values if True otherwise restore only frozen status . Examples
def restore_status(self, restore_values=True):
        return restore_parameters_status(self, restore_values)
def restore_status ( self , restore_values = True ) : return restore_parameters_status ( self , restore_values )
Context manager to restore status.
Context manager to restore status .
"""Context manager to restore status.

        A copy of the values is made on enter,
        and those values are restored on exit.

        Parameters
        ----------
        restore_values : bool
            Restore values if True, otherwise restore only frozen status.

        Examples
        --------
        ::

            from gammapy.modeling.models import PowerLawSpectralModel
            pwl = PowerLawSpectralModel(index=2)
            with pwl.parameters.restore_status():
                pwl.parameters["index"].value = 3
            print(pwl.parameters["index"].value)
        """
self
restore_values
from
pwl.parameters["index"].value = 3
print(pwl.parameters["index"].value)
pwl . parameters [ " index " ] . value = 3 print ( pwl . parameters [ " index " ] . value )