This item is a cold flash shoe for connecting a small electronic flash to a Pentax camera. It is called a "cold" shoe because there is no electrical contact on it (compared to the circular contact of a "hot shoe" or the 5 or so contacts on a "dedicated hot shoe" on much newer cameras).
The shoe slides over guides on either side of the eyepiece with a spring-mounted clasp. The metal shoe has a rubber piece on the underside of its top which protects it from scratching the top of the pentaprism, on which it rests.
One would slide a flash into the shoe, and then run a PC cable from the flash into the X-sync port on the front of the camera.
Single owner, purchased new approximately 1982.
Photos are of the actual item, not stock photos.