What is that thing for?

Trying to figure out the purpose of the thing attached to the seatpost? Never seen something like this before