def getTenantInfo(user):
    slices =Slice.objects.all()
    userSliceInfo = []
    for entry in slices:
       if (entry.site == user.site):
           sliceName = Slice.objects.get(id=entry.id).name
           slice = Slice.objects.get(name=Slice.objects.get(id=entry.id).name)
           sliceServiceClass = entry.serviceClass.name
           preferredImage =  entry.image_preference
           #sliceDataSet = entry.mount_data_sets
           sliceNetwork = {}
           numInstance = 0
           sliceImage=""
           sliceSite = {}
           sliceNode = {}
           sliceInstance= {}
           #createPrivateVolume(user,sliceName)
           available_sites = getAvailableSites()
           for instance in slice.instances.all():
                if instance.node.site.name in available_sites:
                    sliceSite[instance.node.site.name] = sliceSite.get(instance.node.site.name,0) + 1
                    sliceImage = instance.image.name
                    sliceNode[str(instance)] = instance.node.name
           numInstance = sum(sliceSite.values())
           numSites = len(sliceSite)
           userSliceInfo.append({'sliceName': sliceName,'sliceServiceClass': sliceServiceClass,'preferredImage':preferredImage,'numOfSites':numSites, 'sliceSite':sliceSite,'sliceImage':sliceImage,'numOfInstances':numInstance,'instanceNodePair':sliceNode})
    return userSliceInfo
dataset/ETHPy150Open open-cloud/xos/xos/core/dashboard/views/tenant.py/getTenantInfo/original