Crossing Lines and Code Switching: A Sociological Take

What is code switching and how can sociological theories from W.E.B DuBois help us understand this concept in relation to the double consciousness?