def METHOD_NAME(
    length: Optional[int] = 6,
    mixed_case: Optional[bool] = False,
    excluded: Optional[Iterable[str]] = None,
) -> str:
    """
    Generates a random string composed of letters and numbers.
    :param length: the length of the string.
    :param mixed_case: included alpha characters will be mixed case instead of lowercase
    :param excluded: strings that may not be returned.
    :return: a random alphanumeric string.
    """
    excluded = set(excluded or [])
    characters = digits + (ascii_letters if mixed_case else ascii_lowercase)
    candidate = "".join([choice(characters) for _ in range(length)])
    if candidate not in excluded:
        return candidate
    return METHOD_NAME(length=length, excluded=excluded)