They are ferrite cores, sometmes called beads. They are a flavor of choke.
Chokes are inductance devices, the traditional flavor looks like a one-sided transformer.
They are there to suppress electromagnetic noise from the end it is closest to.
FWIW
Scott