def calculate_refund_amount(self, amount=None):
        eligible_to_refund = self.amount - (self.amount_refunded or 0)
        if amount:
            amount_to_refund = min(eligible_to_refund, amount)
        else:
            amount_to_refund = eligible_to_refund
        return int(amount_to_refund * 100)
Get the pipeline id, if it exists, for the given name.
dataset/ETHPy150Open pydanny/dj-stripe/djstripe/stripe_objects.py/StripeCharge.calculate_refund_amount--crossover with--dataset/ETHPy150Open saltstack/salt/salt/modules/boto_datapipeline.py/pipeline_id_from_name