def percent(self, numerator, denominator):
        if denominator:
            return round((100. * numerator) / denominator, 1)
        return 0.0
Return percentage if non-zero denominator else 0.0
dataset/ETHPy150Open swcarpentry/amy/workshops/management/commands/trainings_completion_rates.py/Command.percent