parameters: (self, item: object)
docstring: Return for `item in self`.
docstring_summary: Return for `item in self`.
docstring_tokens: Return for item in self .
function: def __contains__(self, item: object) -> bool | np.bool_:
          """
          Return for `item in self`.
          """
          # GH37867
          # comparisons of any item to pd.NA always return pd.NA, so e.g. "a" in [pd.NA]
          # would raise a TypeError. The implementation below works around that.
          if is_scalar(item) and isna(item):
              if not self._can_hold_na:
                  return False
              elif item is self.dtype.na_value or isinstance(item, self.dtype.type):
                  return self.isna().any()
              else:
                  return False
          else:
              # error: Item "ExtensionArray" of "Union[ExtensionArray, ndarray]" has no
              # attribute "any"
              return (item == self).any()
function_tokens: def __contains__ ( self , item : object ) -> bool | np . bool_ : # GH37867 # comparisons of any item to pd.NA always return pd.NA, so e.g. "a" in [pd.NA] # would raise a TypeError. The implementation below works around that. if is_scalar ( item ) and isna ( item ) : if not self . _can_hold_na : return False elif item is self . dtype . na_value or isinstance ( item , self . dtype . type ) : return self . isna ( ) . any ( ) else : return False else : # error: Item "ExtensionArray" of "Union[ExtensionArray, ndarray]" has no # attribute "any" return ( item == self ) . any ( )