def __contains__(self, key):
    'Returns True if `key` is in this Categorical.'
    if isna(key):
        return self.isna().any()
    return contains(self, key, container=self._codes)
Returns True if `key` is in this Categorical.
def __contains__(self, key):
    
    if isna(key):
        return self.isna().any()
    return contains(self, key, container=self._codes)