Returns a tuple for the number of containers and total bytes in the
        account.
495779
def get_account_info(self):
        
        headers = self._manager.get_account_headers()
        return (headers.get("x-account-container-count"),
                headers.get("x-account-bytes-used"))
829924
def getCountGT(self, item):
        """"""
        index = bisect.bisect_right(self._list, item)
        return len(self._list) - index
633317
def get_num_ruptures(self):
        
        return {grp.id: sum(src.num_ruptures for src in grp)
                for grp in self.src_groups}
252376
def _restrict_items_to_count(items: List[Tuple[Key, Any]], count: int) -> List[Tuple[Key, Any]]:
        
        if abs(count) > len(items):
            count = Store._sign(count) * len(items)

        if count < 0:
            return items[count:]
        else:
            return items[:count]
1374738
def _get_container_service(container):
    '''
    
    '''
    if 'account_key' in container:
        account = azure.storage.CloudStorageAccount(container['account_name'], account_key=container['account_key'])
    elif 'sas_token' in container:
        account = azure.storage.CloudStorageAccount(container['account_name'], sas_token=container['sas_token'])
    else:
        account = azure.storage.CloudStorageAccount(container['account_name'])
    blob_service = account.create_block_blob_service()
    return blob_service
942348
def tcounts(self):
        
        df = pd.DataFrame([[t.name(), t.size()] for t in self.tables()], columns=["name", "size"])
        df.index = df.name
        return df
681225
def containers(self) -> list:
        

        all_containers: List = list()
        for slot in self:
            all_containers += slot.get_children_list()

        for container in all_containers:
            if getattr(container, 'stackable', False):
                all_containers += container.get_children_list()

        return all_containers
389658
def nbytes(self):
        """"""
        try:
            N, L, I = get_shape([self])
        except AllEmptyProbabilityMaps:
            return 0
        return BYTES_PER_FLOAT * N * L * I
983105
async def tuple(self, elem=None, elem_type=None, params=None):
        
        if hasattr(elem_type, 'blob_serialize'):
            container = elem_type() if elem is None else elem
            return await container.blob_serialize(self, elem=elem, elem_type=elem_type, params=params)

        if self.writing:
            return await self.dump_tuple(elem, elem_type, params)
        else:
            return await self.load_tuple(elem_type, params=params, elem=elem)
73197
def total_size(obj, verbose=False):
    
    seen = set()

    def sizeof(o):
        if id(o) in seen:
            return 0
        seen.add(id(o))
        s = sys.getsizeof(o, default=0)
        if verbose:
            print(s, type(o), repr(o))
        if isinstance(o, (tuple, list, set, frozenset, deque)):
            s += sum(map(sizeof, iter(o)))
        elif isinstance(o, dict):
            s += sum(map(sizeof, chain.from_iterable(o.items())))
        elif "__dict__" in dir(o):
            s += sum(map(sizeof, chain.from_iterable(o.__dict__.items())))
        return s

    return sizeof(obj)
96011
def get_export(self):
        
        ret = []
        try:
            ret = self.stats['containers']
        except KeyError as e:
            logger.debug("docker plugin - Docker export error {}".format(e))
        return ret
1282273
def _unit_info(self) -> Tuple[str, int]:
        
        abs_bytes = abs(self.size)
        if abs_bytes < 1024:
            unit = 'B'
            unit_divider = 1
        elif abs_bytes < (1024 ** 2):
            unit = 'KB'
            unit_divider = 1024
        elif abs_bytes < (1024 ** 3):
            unit = 'MB'
            unit_divider = (1024 ** 2)
        elif abs_bytes < (1024 ** 4):
            unit = 'GB'
            unit_divider = (1024 ** 3)
        else:
            unit = 'TB'
            unit_divider = (1024 ** 4)

        return unit, unit_divider
182585
def usage():
    '''
    
    '''
    drives = []
    ret = {}
    drive_bitmask = ctypes.windll.kernel32.GetLogicalDrives()
    for letter in UPPERCASE:
        if drive_bitmask & 1:
            drives.append(letter)
        drive_bitmask >>= 1
    for drive in drives:
        try:
            (available_bytes,
             total_bytes,
             total_free_bytes) = win32api.GetDiskFreeSpaceEx(
                 '{0}:\\'.format(drive)
            )
            used = total_bytes - total_free_bytes
            capacity = used / float(total_bytes) * 100
            ret['{0}:\\'.format(drive)] = {
                'filesystem': '{0}:\\'.format(drive),
                '1K-blocks': total_bytes / 1024,
                'used': used / 1024,
                'available': total_free_bytes / 1024,
                'capacity': '{0:.0f}%'.format(capacity),
            }
        except Exception:
            ret['{0}:\\'.format(drive)] = {
                'filesystem': '{0}:\\'.format(drive),
                '1K-blocks': None,
                'used': None,
                'available': None,
                'capacity': None,
            }
    return ret
1279610
def retrieveVals(self):
        """"""
        file_stats = self._fileInfo.getContainerStats()
        for contname in self._fileContList:
            stats = file_stats.get(contname)
            if stats is not None:
                if self.hasGraph('rackspace_cloudfiles_container_size'):
                    self.setGraphVal('rackspace_cloudfiles_container_size', contname,
                                     stats.get('size'))
                if self.hasGraph('rackspace_cloudfiles_container_count'):
                    self.setGraphVal('rackspace_cloudfiles_container_count', contname,
                                     stats.get('count'))
1262239
public int countCurrentDockerSlaves(final DockerSlaveTemplate template) throws Exception {
        int count = 0;
        List<Container> containers = getClient().listContainersCmd().exec();

        for (Container container : containers) {
            final Map<String, String> labels = container.getLabels();

            if (labels.containsKey(DOCKER_CLOUD_LABEL) && labels.get(DOCKER_CLOUD_LABEL).equals(getDisplayName())) {
                if (template == null) {
                    // count only total cloud capacity
                    count++;
                } else if (labels.containsKey(DOCKER_TEMPLATE_LABEL) &&
                        labels.get(DOCKER_TEMPLATE_LABEL).equals(template.getId())) {
                    count++;
                }
            }
        }

        return count;
    }
1117995
def purge_blob_containers(account, account_key):
    
    bs = BlockBlobService(account, account_key)

    with concurrent.futures.ThreadPoolExecutor(max_workers=20) as executor:
        # use a map to keep track of futures
        future_to_container_map = {executor.submit(delete_container, bs, container): container for container in bs.list_containers()}

        # as the futures are completed, print results
        for future in concurrent.futures.as_completed(future_to_container_map):
            container_name = future_to_container_map[future].name

            try:
                is_deleted = future.result()
                if is_deleted:
                    print("Deleted container {} on first try".format(container_name))
                else:
                    print("Skipped container {} as it no longer exists".format(container_name))
            except AzureException as e:
                # if the deletion failed because there's an active lease on the container, we will break it
                # since it is most likely left-over from previous tests
                if 'lease' in str(e):
                    bs.break_container_lease(container_name)
                    is_deleted = bs.delete_container(container_name)

                    if is_deleted:
                        print("Deleted container {} after having broken lease".format(container_name))
                    else:
                        print("Skipped container {} as it stopped existing after having broken lease".format(container_name))
                else:
                    raise e
            except Exception as e:
                print("Skipped container " + container_name + " due to error " + str(e))
1230113
def volumes(self):
    """"""
    if not self._is_parsed:
      self._Parse()
      self._is_parsed = True

    return iter(self._volumes.values())