use black to format Python code pip install black black . Ref: https://yiwanqingzhou.github.io/format_code