Female children's python does this in her tank every few weeks.
She is kept in a tank 60x45x45, has a 75 watt infrared light which is only turned on every now & then to increase temperature in tank. There's a heat mat under a third of her tank.
Temps in the tank range from 25-35 from one end to the other. Where she sits like that is 28 degrees.
She doesn't normally do this but around once a month she will. She will stay like this all night & then move around a little & come back. She doesn't rub her snout in the wire or anything but just sits in this position for hours.
Not sure what she is doing? Is she just hot? Is it because she's hungry?