def METHOD_NAME(
    app_or_count: typing.Union[traits.ShardAware, int], guild: SnowflakeishOr[guilds.PartialGuild]
) -> int:
    """Calculate the shard ID for a guild based on it's shard aware app or shard count.
    Parameters
    ----------
    app_or_count : typing.Union[hikari.traits.ShardAware, int]
        The shard aware app of the current application or the integer count of
        the current app's shards.
    guild : SnowflakeishOr[hikari.guilds.PartialGuild]
        The object or ID of the guild to get the shard ID of.
    Returns
    -------
    int
        The zero-indexed integer ID of the shard that should cover this guild.
    """
    shard_count = app_or_count if isinstance(app_or_count, int) else app_or_count.shard_count
    return (int(guild) >> 22) % shard_count