def _consolidate_descriptive_type(descriptive_type: str) -> str:
    """
    Convert type descriptions with "or" into respective type signature.

    "x or None" or "None or x" -> "Optional[x]"
    "x or x" or "x or y[ or z [...]]" -> "Union[x, y, ...]"

    Args:
        descriptive_type: Descriptions of an item's type.

    Returns:
        Type signature for descriptive type.
    """
    types = descriptive_type.split("or")
    if len(types) == 1:
        return descriptive_type
    types = [pt.strip() for pt in types]
    if len(types) == 2:
        if types[0] == "None":
            return f"Optional[{types[1]}]"
        if types[1] == "None":
            return f"Optional[{types[0]}]"
    return f"Union[{','.join(types)}]"