All examples use something like
driver = GraphDatabase.driver(...)
... # some work
driver.close()
I advise to use the following instead.
with GraphDatabase.driver(...) as driver:
... # some work
This way, the driver will always get closed properly even if "some work" results in an exception.