A ferrite core is designed to clean common mode noise (signal) generated from either a signal line or power cable. They are used to suppress electromagnetic emissions by blocking low-frequency noise and absorbing high-frequency noise. This avoids electromagnetic interference.
I used to see these come with computer monitors quite often.
I don’t think I’ve seen these in a pin before.