code: def to_bool(self, invert=False):
          
          if invert:
              def function(x, y):
                  return False if x else True
          else:
              def function(x, y):
                  return True if x else False
          return self.operation(None, function)
docs: Return the truth value of each element.