def METHOD_NAME(self, need_time=False, need_disk=False):
    if need_time:
        if self.time_used >= self.time_quota:
            raise UsageError(
                'Out of time quota: %s'
                % formatting.ratio_str(formatting.duration_str, self.time_used, self.time_quota)
            )
    if need_disk:
        if self.disk_used >= self.disk_quota:
            raise UsageError(
                'Out of disk quota: %s'
                % formatting.ratio_str(formatting.size_str, self.disk_used, self.disk_quota)
            )