How to get all twig variables from template

This is how I use to debug any twig template and it's variables. Just include into your twig template and pass variable = object | array | null

{% partial 'debug' variable=post %}