def METHOD_NAME(cls):
    # query for all expired
    cls._log(
        logging.DEBUG,
        u'NDBOpenIDStore: Querying datastore for OpenID associations.')
    query = cls.query(cls.expiration_date <= datetime.datetime.now())
    # fetch keys only
    expired = query.fetch(keys_only=True)
    # delete all expired
    cls._log(
        logging.DEBUG,
        u'NDBOpenIDStore: Deleting expired OpenID associations from datastore.')
    ndb.delete_multi(expired)
    return len(expired)