When someone who exists in multiple cultures and/or uses multiple dialects, manners of speaking, etc., switches from one mode of language use to another situationally, they are said to be "code-switching." I am looking for a word or phrase that is analogous in terms of changing behavior situationally—in effect, putting on another persona for a different situation.
The analogy would look like this:
Bob, a paramedic, gets really riled up when his kids are misbehaving, or when arguing with peers, but when on the job, he instantly _________ to fit the situation when he needs to keep a patient calm, becoming serene in the blink of an eye.
The word or phrase would mean roughly "changes behavior to fit the situation," but be less cumbersome.