Since you didn't specify a Doctor, I'm running through them in order...
(01) Wild West
Having dispatched with the bandits, delivered a load of sugar and salt and more vegetables than anyone in town had ever seen, and healed Ma Cottle's fever, the two swatted their horses and rode away at a gallop before anyone could try to push some coin on them as thanks.
On the top of a sandstone ridge, the town below appearing as small and inconsequential as any of the scrub nearer to their mounts' hooves, the Man With No Name pulled up and turned around.
"One day, I shall come back," he said, with a thoughtful distance in his voice. "Yes, I shall come back. Until then, there must be no regrets, no tears, no--"
"Dammit, Doc," said the Man Who Had A Name But Odds Were Good It Wasn't Really His, "do you have to do that with every town we leave?"
(02) Cyberpunk
The neofascist Network Administrators had locked the prisoners in a cell blocked off from all neuronet access, with no exposed wiring and absolutely no keypads. Oh, and they had taken the sonic screwdriver.
Jack paced the length of the cell. The Doctor sat on the bed and played his recorder.
After three measures, the entrance hatch whirred and the mechanical panels slid open.
"Imitation of the encoded harmonic frequencies!" exclaimed Jack, bounding to the exit. "That was brilliant, Doctor!"
"What?" said the Doctor. "Oh, yes! I meant to do that."
Ten Doctors, Ten AUs (1-2)
(01) Wild West
Having dispatched with the bandits, delivered a load of sugar and salt and more vegetables than anyone in town had ever seen, and healed Ma Cottle's fever, the two swatted their horses and rode away at a gallop before anyone could try to push some coin on them as thanks.
On the top of a sandstone ridge, the town below appearing as small and inconsequential as any of the scrub nearer to their mounts' hooves, the Man With No Name pulled up and turned around.
"One day, I shall come back," he said, with a thoughtful distance in his voice. "Yes, I shall come back. Until then, there must be no regrets, no tears, no--"
"Dammit, Doc," said the Man Who Had A Name But Odds Were Good It Wasn't Really His, "do you have to do that with every town we leave?"
(02) Cyberpunk
The neofascist Network Administrators had locked the prisoners in a cell blocked off from all neuronet access, with no exposed wiring and absolutely no keypads. Oh, and they had taken the sonic screwdriver.
Jack paced the length of the cell. The Doctor sat on the bed and played his recorder.
After three measures, the entrance hatch whirred and the mechanical panels slid open.
"Imitation of the encoded harmonic frequencies!" exclaimed Jack, bounding to the exit. "That was brilliant, Doctor!"
"What?" said the Doctor. "Oh, yes! I meant to do that."