docs: def contains(self, other):
          """
          Return True if this contains other. Other may be either range of same
          type or scalar of same type as the boundaries.
  
              >>> intrange(1, 10).contains(intrange(1, 5))
              True
              >>> intrange(1, 10).contains(intrange(5, 10))
              True
              >>> intrange(1, 10).contains(intrange(5, 10, upper_inc=True))
              False
              >>> intrange(1, 10).contains(1)
              True
              >>> intrange(1, 10).contains(10)
              False
  
          Contains can also be called using the ``in`` operator.
  
              >>> 1 in intrange(1, 10)
              True
  
          This is the same as the ``self @> other`` in PostgreSQL.
  
          :param other: Object to be checked whether it exists within this range
                        or not.
          :return: ``True`` if `other` is completely within this range, otherwise
                   ``False``.
          :raises TypeError: If `other` is not of the correct type.
          """
  
          if self.is_valid_range(other):
              if not self:
                  return not other
              elif not other or other.startsafter(self) and other.endsbefore(self):
                  return True
              else:
                  return False
          elif self.is_valid_scalar(other):
              # If the lower bounary is not unbound we can safely perform the
              # comparison. Otherwise we'll try to compare a scalar to None, which
              # is bad
              is_within_lower = True
              if not self.lower_inf:
                  lower_cmp = operator.le if self.lower_inc else operator.lt
                  is_within_lower = lower_cmp(self.lower, other)
  
              # If the upper bounary is not unbound we can safely perform the
              # comparison. Otherwise we'll try to compare a scalar to None, which
              # is bad
              is_within_upper = True
              if not self.upper_inf:
                  upper_cmp = operator.ge if self.upper_inc else operator.gt
                  is_within_upper = upper_cmp(self.upper, other)
  
              return is_within_lower and is_within_upper
          else:
              raise TypeError(
                  "Unsupported type to test for inclusion '{0.__class__.__name__}'".format(
                      other))