def METHOD_NAME(normalized_ident: str, identifier: str, max_length: int, collision_prob: float = _DEFAULT_COLLISION_PROB) -> str:
    """Shortens the `name` to `max_length` and adds a tag to it to make it unique. Tag may be placed in the middle or at the end"""
    if max_length and len(normalized_ident) > max_length:
        # use original identifier to compute tag
        tag = NamingConvention._compute_tag(identifier, collision_prob)
        normalized_ident = NamingConvention._trim_and_tag(normalized_ident, tag, max_length)
    return normalized_ident