def add_tenant_hours(self, tenant_info, unit_hours):
        tenant = tenant_info['tenant']
        cts = dict(count=0, unit_hours=0.0)
        for tname, tvalue in tenant_info['types'].items():
            if tvalue not in self.by_tenant[tname]:
                self.by_tenant[tname][tvalue] = dict()
            if tenant not in self.by_tenant[tname][tvalue]:
                self.by_tenant[tname][tvalue][tenant] = cts
            cts = self.by_tenant[tname][tvalue][tenant]
            cts[tname] = tvalue
        cts['count'] += 1
        cts['unit_hours'] += unit_hours
        cts['percent_count'] = (float(cts['count'])/self.count) * 100
        cts['percent_unit_hours'] = (cts['unit_hours']/self.unit_hours) * 100
        cts['tenant'] = tenant
        cts['account_name'] = tenant_info['account_name']
dataset/ETHPy150Open openstack/stacktach/reports/instance_hours.py/InstanceHoursReport.add_tenant_hours/original