async def METHOD_NAME(backend, author, realm_id=None, now=None):
    realm_id = realm_id or RealmID.new()
    now = now or next_timestamp()
    certif = RealmRoleCertificate.build_realm_root_certif(
        author=author.device_id, timestamp=now, realm_id=realm_id
    ).dump_and_sign(author.signing_key)
    with backend.event_bus.listen() as spy:
        await backend.realm.create(
            organization_id=author.organization_id,
            self_granted_role=RealmGrantedRole(
                realm_id=realm_id,
                user_id=author.user_id,
                certificate=certif,
                role=RealmRole.OWNER,
                granted_by=author.device_id,
                granted_on=now,
            ),
        )
        await spy.wait_with_timeout(BackendEventRealmRolesUpdated)
    return realm_id