code: def get_conn(cls):
          
          conn = cls._conn
          if conn is None or conn.closed:
              conn = ldap3.Connection(
                  settings.CAS_LDAP_SERVER,
                  settings.CAS_LDAP_USER,
                  settings.CAS_LDAP_PASSWORD,
                  client_strategy="RESTARTABLE",
                  auto_bind=True
              )
              cls._conn = conn
          return conn
docs: Return a connection object to the ldap database