code: def is_stalemate(self) -> bool:
          
          if self.is_check():
              return False
  
          if self.is_variant_end():
              return False
  
          return not any(self.generate_legal_moves())
docs: Checks if the current position is a stalemate.