@staticmethod
    def fetch_card_holds(participant_ids):
        log('Fetching card holds.')
        holds = {}
        existing_holds = braintree.Transaction.search(
            braintree.TransactionSearch.status == 'authorized'
        )
        for hold in existing_holds.items:
            log_amount = hold.amount
            p_id = int(hold.custom_fields['participant_id'])
            if p_id in participant_ids:
                log('Reusing a ${:.2f} hold for {}.'.format(log_amount, p_id))
                holds[p_id] = hold
            else:
                cancel_card_hold(hold)
        return holds
dataset/ETHPy150Open gratipay/gratipay.com/gratipay/billing/payday.py/Payday.fetch_card_holds/original