@classmethod
    def extract_card_params(cls, customer):
        card_data = customer.cards.data[0]
        exp_date = datetime.date(card_data.exp_year, card_data.exp_month, 1)

        card = {
            'brand': card_data.brand,
            'last4': card_data.last4,
            'exp_date': exp_date,
            'is_expiring': CreditCard.is_expiring_soon(exp_date=exp_date)
        }

        return card
constructor
dataset/ETHPy150Open nickjj/build-a-saas-app-with-flask/catwatch/blueprints/billing/models/credit_card.py/CreditCard.extract_card_params--crossover with--dataset/ETHPy150Open projectatomic/atomic-reactor/atomic_reactor/plugins/post_rpmqa.py/PostBuildRPMqaPlugin.__init__