Unable to import 'tensorflow.keras' PylintE0401:import-error in visual studio code

Just an update. I am able to fix this issue by using the following code. Seems like keras is not a package under tensorflow which is why vsc complains, though still not sure as to how the code execution works and finds the correct keras submodules. I saw that there is some code to lazy-load keras v2/3 in the init.py module of tensorflow, but do not understand how this works and if this is what makes the code execution work.