def connect(self, config):
        """Connect to database with given configuration, which may be a dict or
        a path to a pymatgen-db configuration.
        """
        if isinstance(config, str):
            conn = dbutil.get_database(config_file=config)
        elif isinstance(config, dict):
            conn = dbutil.get_database(settings=config)
        else:
            raise ValueError("Configuration, '{}',  must be a path to "
                             "a configuration file or dict".format(config))
        return conn
def connect ( self , config ) : if isinstance ( config , str ) : conn = dbutil . get_database ( config_file = config ) elif isinstance ( config , dict ) : conn = dbutil . get_database ( settings = config ) else : raise ValueError ( "Configuration, '{}',  must be a path to " "a configuration file or dict" . format ( config ) ) return conn
Connect to database with given configuration, which may be a dict or
        a path to a pymatgen-db configuration.