def cancel(self, reason, **kwargs):
        merchant_uid = kwargs.get('merchant_uid')
        if merchant_uid:
            return self.cancel_by_merchant_uid(merchant_uid, reason)
        try:
            imp_uid = kwargs['imp_uid']
        except __HOLE__:
            raise KeyError('merchant_uid or imp_uid is required')
        return self.cancel_by_imp_uid(imp_uid, reason)
dataset/ETHPy150Open iamport/iamport-rest-client-python/iamport/client.py/Iamport.cancel