If you keep company with someone, you are consorting with them. "The students tended to consort only with other students from similar backgrounds. The staff wanted to break them out of their comfort zone, so they organized games to force them to mingle and meet new people."
Consort is usually followed by the preposition with, and sometimes the verb consort is followed by the phrase "with the enemy." The military frowns on consorting with the enemy in a war. Her best friend accused her of consorting with the enemy when she walked home with another girl. As a noun, the term consort refers to the spouse of the reigning monarch. Prince Albert was called the prince consort because he was married to Queen Victoria when she ruled Great Britain.