<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Demonstration of Materials Project Energy Corrections
This notebook illustrates how to apply and obtain an explanation of energy corrections used in the Materials Project database.
Author
Step1:  Default behavior - MaterialsProject2020Compatibility
Let's retrieve entries in the Cl-Mo-O system to demonstrate how this works.
Step2:  You can examine the energy corrections via the energy_adjustments attribute 
of the ComputedEntry. This attribute contains a list of each energy correction that has been applied.
Step3:  If you want even more detail, you can examine an indiviual EnergyAdjustment (one element of the list)
Applying the legacy corrections with MaterialsProjectCompatibility
If you want to use the old corrections, or apply your own, you can re-process the ComputedEntry obtained from MPRester using a Compatibility class. The .process_entries method will remove any previously-applied energy corrections and re-process the entry in-place.
Step4:  Notice how the energy adjustments have changed. The class name, description and values are all different. You will also notice that the descriptions of the legacy corrections are less verbose than those of the modern MaterialsProject2020Compatibility corrections.
Removing corrections altogther
If you want to remove all corrections from a ComputedEntry, simply set energy_adjustments to an empty list. You can verify that you have removed corrections by checking the energy_per_atom and the correction_per_atom of the ComputedEntry before and after.
Step5:  Alternatively, you can simply pass compatible_only=False to the MPRester call when you download data.
<ASSISTANT_TASK:>
Python Code:
from pymatgen.entries.computed_entries import ComputedEntry
from pymatgen.entries.compatibility import MaterialsProjectCompatibility, \
                                           MaterialsProject2020Compatibility
from pymatgen.ext.matproj import MPRester
Explanation: Demonstration of Materials Project Energy Corrections
This notebook illustrates how to apply and obtain an explanation of energy corrections used in the Materials Project database.
Author: Ryan Kingsbury
Date: May 2021
pymatgen==2022.0.8
Overview
The Materials Project API (MPRester) returns ComputedEntry objects that contain information about DFT calculations. By default, these objects have adjustments applied to the energies of certain elements to reduce certain systematic errors. See our documentation for complete details.
As of Spring 2021, ComputedEntry are processed using the MaterialsProject2020Compatibility class in pymatgen by default. The legacy correction scheme, used from 2010-2020, is still available in MaterialsProjectCompatibility.
End of explanation
# retrieve 
with MPRester() as m:
    entries = m.get_entries_in_chemsys("Cl-Mo-O")
entry = entries[0]
Explanation: Default behavior - MaterialsProject2020Compatibility
Let's retrieve entries in the Cl-Mo-O system to demonstrate how this works.
End of explanation
entries[25].energy_adjustments
Explanation: You can examine the energy corrections via the energy_adjustments attribute 
of the ComputedEntry. This attribute contains a list of each energy correction that has been applied.
End of explanation
compat = MaterialsProjectCompatibility()
entries = compat.process_entries(entries)
entries[25].energy_adjustments
Explanation: If you want even more detail, you can examine an indiviual EnergyAdjustment (one element of the list)
Applying the legacy corrections with MaterialsProjectCompatibility
If you want to use the old corrections, or apply your own, you can re-process the ComputedEntry obtained from MPRester using a Compatibility class. The .process_entries method will remove any previously-applied energy corrections and re-process the entry in-place.
End of explanation
entries[25].energy_per_atom
entries[25].correction_per_atom
entries[25].energy_adjustments = []
entries[25].energy_per_atom
entries[25].correction_per_atom
Explanation: Notice how the energy adjustments have changed. The class name, description and values are all different. You will also notice that the descriptions of the legacy corrections are less verbose than those of the modern MaterialsProject2020Compatibility corrections.
Removing corrections altogther
If you want to remove all corrections from a ComputedEntry, simply set energy_adjustments to an empty list. You can verify that you have removed corrections by checking the energy_per_atom and the correction_per_atom of the ComputedEntry before and after.
End of explanation
# retrieve 
with MPRester() as m:
    entries = m.get_entries_in_chemsys("Cl-Mo-O", compatible_only=False)
entry = entries[0]
entries[25].energy_adjustments
Explanation: Alternatively, you can simply pass compatible_only=False to the MPRester call when you download data.
End of explanation
<END_TASK>