code: def piece_at(self, square: Square) -> Optional[Piece]:
          
          piece_type = self.piece_type_at(square)
          if piece_type:
              mask = BB_SQUARES[square]
              color = bool(self.occupied_co[WHITE] & mask)
              return Piece(piece_type, color)
          else:
              return None
docs: Gets the :class:`piece <chess.Piece>` at the given square.