Code-switching can be observed at various linguistic levels of representation for different language pairs: phonological, morphological, lexical, syntactic, semantic, and discourse/pragmatic switching.
very little codeswitching corpora exist from which researchers can train statistical models.