I don’t think most people in this thread are using the term “code-switching” correctly. This term refers to switching between languages (or dialects, or varieties) in a single conversation (or more commonly a single sentence), but most of the examples of “code-switching” presented in this thread are about using different languages with different conversation partners. (For example, @SmartAleq describes call centre agents adapting their speech to whoever is calling, @pulykamell talks about using his native accent (only) with his childhood friends, @China_Guy says that he adapts his English variety when speaking to native Asians, etc.)
However, since I’m really interested in bona-fide code-switching, and don’t want to hijack this thread, I’ve started a new one: Do you (unwittingly) code-switch when speaking?