def _is_valid_for_logical_operator(right: Any) -> bool:
    from pyspark.pandas.base import IndexOpsMixin
    return (isinstance(right, (int, bool)) or (isinstance(right, IndexOpsMixin) and (isinstance(right.spark.data_type, BooleanType) or isinstance(right.spark.data_type, IntegralType))))
def _is_valid_for_logical_operator(right: Any) -> bool:
    from pyspark.pandas.base import IndexOpsMixin
    return (isinstance(right, (int, bool)) or (isinstance(right, IndexOpsMixin) and (isinstance(right.spark.data_type, BooleanType) or isinstance(right.spark.data_type, IntegralType))))