code: def contains(self, key, value=None):
          
          if value is not None:
              return self.contains(lambda x: data_get(x, key) == value)
  
          if self._use_as_callable(key):
              return self.first(key) is not None
  
          return key in self.items
docs: Determine if an element is in the collection
  
          :param key: The element
          :type key: int or str or callable
  
          :param value: The value of the element
          :type value: mixed
  
          :return: Whether the element is in the collection
          :rtype: bool