|"Is this all real? Or has this been happening inside my head?"
The topic of this article is of a real-life subject that has been mentioned "in-universe" in a canon source. The Harry Potter Wiki is written from the perspective that all information presented in canon is true (e.g., Hogwarts really exists), and, as such, details contained in this article may differ from real world facts.
It was famously performed by Jarleth Hobart along with several speeches, just before to his "maiden flight" on 16 July, 1544 — a public demonstration of his self-invented Levitation Charm on himself. He climbed onto the roof of his local church and leapt and, having cast the spell, was left hovering in mid-air. At first, he seemed to have succeeded but, apparently, he did not.
In a Defence Against the Dark Arts class in 1994, Dean Thomas hopped around the room three times while singing this song after being put under the Imperius Curse by Bartemius Crouch Jr (disguised as Alastor Moody).