organizing module contents inside any one modulewe can specify variablesclassesor functions they can be handy way to store the global state without namespace conflicts for examplewe have been importing the database class into various modules and then instantiating itbut it might make more sense to have only one database object globally available from the database module the database module might look like thisclass databasethe database implementation pass database database(then we can use any of the import methods we've discussed to access the database objectfor examplefrom ecommerce database import database problem with the preceding class is that the database object is created immediately when the module is first importedwhich is usually when the program starts up this isn' always ideal since connecting to database can take whileslowing down startupor the database connection information may not yet be available we could delay creating the database until it is actually needed by calling an initialize_database function to create the module-level variableclass databasethe database implementation pass database none def initialize_database()global database database database(the global keyword tells python that the database variable inside initialize_ database is the module level one we just defined if we had not specified the variable as globalpython would have created new local variable that would be discarded when the method exitsleaving the module-level value unchanged