"There is the case where the disciple of the noble ones recollects the devas, thus: 'There are the Devas of the Four Great Kings, the Devas of the Thirty-three, the Yama Devas, the Contented Devas, the devas who delight in creation, the devas who have power over the creations of others, the devas of Brahma's retinue, the devas beyond them. Whatever conviction they were endowed with that when falling away from this life they re-arose there, the same sort of conviction is present in me as well. Whatever virtue they were endowed with that when falling away from this life they re-arose there, the same sort of virtue is present in me as well. Whatever learning they were endowed with that when falling away from this life they re-arose there, the same sort of learning is present in me as well. Whatever generosity they were endowed with that when falling away from this life they re-arose there, the same sort of generosity is present in me as well. Whatever discernment they were endowed with that when falling away from this life they re-arose there, the same sort of discernment is present in me as well.' As he is recollecting the devas, his mind is calmed, and joy arises; the defilements of his mind are abandoned, just as when gold is cleansed through the proper technique. And how is gold cleansed through the proper technique? Through the use of a furnace, salt earth, red chalk, a blow-pipe, tongs, & the appropriate human effort. This is how gold is cleansed through the proper technique. In the same way, the defiled mind is cleansed through the proper technique. And how is the defiled mind cleansed through the proper technique? There is the case where the disciple of the noble ones recollects the devas... As he is recollecting the devas, his mind is cleansed, and joy arises; the defilements of his mind are abandoned. He is thus called a disciple of the noble ones undertaking the Deva-Uposatha. He lives with the devas. It is owing to the devas that his mind is calmed, that joy arises, and that whatever defilements there are in his mind are abandoned. This is how the mind is cleansed through the proper technique.
zugangzureinsicht.org/html/tipitaka/an/an03/an03.070.than_en.html