[docs]defget_list_type(_list:List[Any])->Type:""" Return the type of list elements if all are the same type, otherwise raise an error. """ifnot_list:raiseValueError("The list is empty and has no element type.")element_types={type(item)foritemin_list}iflen(element_types)>1:raiseBadRequest(f"The list contains multiple types: {element_types}. Enter a list with only numbers, strings, or bools.")returnelement_types.pop()