<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_pinned(self, color: Color, square: Square) -> bool: """ Detects if the given square is pinned to the king of the given color. """

        return self.pin_mask(color, square) != BB_ALL