Videos
What is Code Formatter Pro?
What context-setting options are available in Workik’s AI for Code Formatter?
What are some popular use cases of Workik’s AI-powered Code Formatter?
autopep8
autopep8 would auto-format your python script. not only the code indentation, but also other coding spacing styles. It makes your python script to conform PEP8 Style Guide.
pip install autopep8
autopep8 your_script.py # dry-run, only print
autopep8 -i your_script.py # replace content
Update:
Many editors have pep8 plugins that automatically reformat your code right after you save the file. py-autopep8 in emacs
yapf
yapf is a new and better python code formatter. which tries to get the best formatting, not just to conform the guidelines. The usage is quite the same as autopep8.
pip install yapf
yapf your_script.py # dry-run, only print
yapf -i your_script.py # replace content
For more information, like formatting configurations, please read the README.rst on yapf github
Update 2:
Black
Black is much better than yapf. It's smarter and fits most complex formatting cases.
Edit: Nowadays, I would recommend autopep8, since it not only corrects indentation problems but also (at your discretion) makes code conform to many other PEP8 guidelines.
Use reindent.py. It should come with the standard distribution of Python, though on Ubuntu you need to install the python2.6-examples package.
You can also find it on the web.
This script attempts to convert any python script to conform with the 4-space standard.
Or simply install Black Formatter from VSC extension menu:
https://marketplace.visualstudio.com/items?itemName=ms-python.black-formatter

:)
Based on the comments by @starball, @jarmod and additional googling I found that you need to follow those steps:
Step 1. Install Python extension from marketplace: https://marketplace.visualstudio.com/items?itemName=ms-python.python
Step 2. Install one of the formatter packages for Python.
The Python extension supports source code formatting using either autopep8 (the default), black, or yapf.
from and More about it here: https://code.visualstudio.com/docs/python/editing#_formatting
Step 3. Select which code formatter you want to use in python.formatting.provider which is in settings>Extensions>Python (this maybe automatically set after step 1 and step 2). Also, in settings>Extensions>Python there are more options to select.
How to use formatting:
The code formatting is available in Visual Studio Code (VSCode) through the following shortcuts or key combinations:
On Windows Shift + Alt + F
On macOS Shift + Option + F
On Linux Ctrl + Shift + I
Format Selection (Ctrl+K Ctrl+F) - Format the selected text.
Or you can use right click menu:

from: https://mkyong.com/vscode/how-to-format-source-code-in-visual-studio-code-vscode/
and from: https://code.visualstudio.com/docs/editor/codebasics#_formatting