class_docstr: Array of boolean (True/False) data with missing values.
  
  This is a pandas Extension array for boolean data, under the hood
  represented by 2 numpy arrays: a boolean array with the data and
  a boolean array with the mask (True indicating missing).
  
  BooleanArray implements Kleene logic (sometimes called three-value
  logic) for logical operations. See :ref:`boolean.kleene` for more.
  
  To construct an BooleanArray from generic array-like input, use
  :func:`pandas.array` specifying ``dtype="boolean"`` (see examples
  below).
  
  .. warning::
  
     BooleanArray is considered experimental. The implementation and
     parts of the API may change without warning.
  
  Parameters
  ----------
  values : numpy.ndarray
      A 1-d boolean-dtype array with the data.
  mask : numpy.ndarray
      A 1-d boolean-dtype array indicating missing values (True
      indicates missing).
  copy : bool, default False
      Whether to copy the `values` and `mask` arrays.
  
  Attributes
  ----------
  None
  
  Methods
  -------
  None
  
  Returns
  -------
  BooleanArray
  
  Examples
  --------
  Create an BooleanArray with :func:`pandas.array`:
  
  >>> pd.array([True, False, None], dtype="boolean")
  <BooleanArray>
  [True, False, <NA>]
  Length: 3, dtype: boolean
class_docstr_tok: ["Array","of","boolean","(","True\/False",")","data","with","missing","values",".","This","is","a","pandas","Extension","array","for","boolean","data",",","under","the","hood","represented","by","2","numpy","arrays",":","a","boolean","array","with","the","data","and","a","boolean","array","with","the","mask","(","True","indicating","missing",")",".","BooleanArray","implements","Kleene","logic","(","sometimes","called","three-value","logic",")","for","logical","operations",".","See",":","ref",":","`","boolean.kleene","`","for","more",".","To","construct","an","BooleanArray","from","generic","array-like","input",",","use",":","func",":","`","pandas.array","`","specifying","``","dtype=","''","boolean","''","``","(","see","examples","below",")",".","..","warning",":",":","BooleanArray","is","considered","experimental",".","The","implementation","and","parts","of","the","API","may","change","without","warning",".","Parameters","--","--","--","--","--","values",":","numpy.ndarray","A","1-d","boolean-dtype","array","with","the","data",".","mask",":","numpy.ndarray","A","1-d","boolean-dtype","array","indicating","missing","values","(","True","indicates","missing",")",".","copy",":","bool",",","default","False","Whether","to","copy","the","`","values","`","and","`","mask","`","arrays",".","Attributes","--","--","--","--","--","None","Methods","--","--","--","-","None","Returns","--","--","--","-","BooleanArray","Examples","--","--","--","--","Create","an","BooleanArray","with",":","func",":","`","pandas.array","`",":",">",">",">","pd.array","(","[","True",",","False",",","None","]",",","dtype=","''","boolean","''",")","<","BooleanArray",">","[","True",",","False",",","<","NA",">","]","Length",":","3",",","dtype",":","boolean"]
code: def _logical_method(self, other, op):
      assert op.__name__ in {
          "or_",
          "ror_",
          "and_",
          "rand_",
          "xor",
          "rxor",
      }
      other_is_scalar = lib.is_scalar(other)
      mask = None
  
      if isinstance(other, BooleanArray):
          other, mask = other._data, other._mask
      elif is_list_like(other):
          other = np.asarray(other, dtype="bool")
          if other.ndim > 1:
              raise NotImplementedError(
                  "can only perform ops with 1-d structures"
              )
          other, mask = coerce_to_array(other, copy=False)
      elif isinstance(other, np.bool_):
          other = other.item()
  
      if (
          other_is_scalar
          and other is not libmissing.NA
          and not lib.is_bool(other)
      ):
          raise TypeError(
              "'other' should be pandas.NA or a bool. "
              f"Got {type(other).__name__} instead."
          )
  
      if not other_is_scalar and len(self) != len(other):
          raise ValueError("Lengths must match")
  
      if op.__name__ in {"or_", "ror_"}:
          result, mask = ops.kleene_or(
              self._data, other, self._mask, mask
          )
      elif op.__name__ in {"and_", "rand_"}:
          result, mask = ops.kleene_and(
              self._data, other, self._mask, mask
          )
      else:
          # i.e. xor, rxor
          result, mask = ops.kleene_xor(
              self._data, other, self._mask, mask
          )
  
      # i.e. BooleanArray
      return self._maybe_mask_result(result, mask)
  
imports: from __future__ import annotations
  import numbers
  from typing import TYPE_CHECKING, cast
  import numpy
  from pandas._libs import lib, missing
  from pandas._typing import Dtype, DtypeObj, type_t
  from pandas.core.dtypes.common import is_list_like, is_numeric_dtype
  from pandas.core.dtypes.dtypes import register_extension_dtype
  from pandas.core.dtypes.missing import isna
  from pandas.core import ops
  from pandas.core.array_algos import masked_accumulations
  from pandas.core.arrays.masked import BaseMaskedArray, BaseMaskedDtype
label_desc: Use image node_id 5 for calling the BooleanArray obj's underlying member method code with example usage: obj._logical_method(other, op) and returns: self