I’ve heard British people use this phrase many times. From the context it usually seems to mean either 1) imitating, or 2) making fun of, as in, “You’re wearing the exact same waistcoat as I am. Are you taking the mickey?” But a few times neither of these seemed to make sense.
What does the phrase mean, and where did it originate?