def _serialize(self, value, attr, obj):
        if value is None:
            return None
        try:
            days = value.days
            if self.precision == self.DAYS:
                return days
            else:
                seconds = days * 86400 + value.seconds
                if self.precision == self.SECONDS:
                    return seconds
                else:  # microseconds
                    return seconds * 10**6 + value.microseconds  # flake8: noqa
        except __HOLE__:
            self.fail('format', input=value)
dataset/ETHPy150Open marshmallow-code/marshmallow/marshmallow/fields.py/TimeDelta._serialize