Thats how they self regulate their temps. Its one of the cool things about a ball python. Not all snakes have this ability. This is why its ok to let balls incubate maturnally. But remember they cant regulate to warm up they can only regulate to cool down. Females will do this when they are egg bearing as well. If they feel they are too warm they will lay over to regulate their temps.