if __name__ == "__main__"
these lines are used to determine if the module was included in another file, or run by itself.
if __name__ is indeed __main__ then it means the script is the "main" script running, i.e. you ran it on it's own. this is often used to execute some example code for a library/module.
if __name__ is not __main__ this means you have included the script as a module in another script. this means the code after the if statement will not execute.