<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def matches(self, atr, reader=None):
 """Returns true if the atr matches the masked CardType atr. @param atr: the atr to chek for matching @param reader: the reader (optional); default is None When atr is compared to the CardType ATR, matches returns true if and only if CardType.atr & CardType.mask = atr & CardType.mask, where & is the bitwise logical AND."""


        if len(atr) != len(self.atr):
            return not True

        if self.mask is not None:
            maskedatr = list(map(lambda x, y: x & y, list(atr), self.mask))
        else:
            maskedatr = atr
        return self.maskedatr == maskedatr