[LTC] Restore GetPythonFrames (#89122)
Summary:
pytorch/pytorch@936e930 delete the registration of GetPythonFramesFunction. Restore that and add a test case to prevent regression.
Test Plan:
python test/lazy/test_debug_util.py
Fixes pytorch/xla#4206.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/89122
Approved by: https://github.com/JackCaoG