Prepares container for serialization
        :param size:
        :param container:
        :return:
767798
async def prepare_container(self, size, container, elem_type=None):
        
        if not self.writing:
            if container is None:
                return gen_elem_array(size, elem_type)

            fvalue = get_elem(container)
            if fvalue is None:
                fvalue = []
            fvalue += gen_elem_array(max(0, size - len(fvalue)), elem_type)
            set_elem(container, fvalue)
            return fvalue
726198
def resize(self, size=None):
        

        if not self.operation.israw():
            return

        size = size or tty.size(self.operation.stdout)

        if size is not None:
            rows, cols = size
            try:
                self.operation.resize(height=rows, width=cols)
            except IOError:  # Container already exited
                pass
1166181
def set_cached_resource_size(self, resource_name, size):
        
        size_data = json_dumps({"size": size, "recorded_time": time()})
        self.cache.set(
            "SIZE:%s" % resource_name, size_data,
            ex=self.size_cache_timeout)
        return
901786
def resize(self, size):
		
		if size < len(self):
			raise ValueError("Value is out of bound. Array can't be shrinked")
		current_size = self.__size
		for i in range(size - current_size):
			self.__array.append(WBinArray(0, self.__class__.byte_size))
		self.__size = size
37859
def stat_container(self, container):
        
        LOG.debug('stat_container() with %s is success.', self.driver)
        return self.driver.stat_container(container)
995471
def container(self, name, length, type, *parameters):
        
        self.new_struct('Container', name, 'length=%s' % length)
        BuiltIn().run_keyword(type, *parameters)
        self.end_struct()
31386
def _convert_container(self, container, input_transformer, output_transformer):
        
        output = {}
        for parameter, options in ARG_MAP.items():
            output_name = options.get(self.output_type, {}).get('name')
            output_required = options.get(self.output_type, {}).get('required')

            input_name = options.get(self.input_type, {}).get('name')

            if container.get(input_name) and \
                    hasattr(input_transformer, 'ingest_{}'.format(parameter)) and \
                    output_name and hasattr(output_transformer, 'emit_{}'.format(parameter)):
                # call transform_{}
                ingest_func = getattr(input_transformer, 'ingest_{}'.format(parameter))
                emit_func = getattr(output_transformer, 'emit_{}'.format(parameter))

                output[output_name] = emit_func(ingest_func(container.get(input_name)))

            if not container.get(input_name) and output_required:
                msg_template = 'Container {name} is missing required parameter "{output_name}".'
                self.messages.add(
                    msg_template.format(
                        output_name=output_name,
                        output_type=self.output_type,
                        name=container.get('name', container)
                    )
                )

        return output
1057983
def set_size(self, name: str, size: int):
        """"""
        if self._needs_to_be_in_name_map(name):
            if len(name) >= 128:
                raise ValueError("Name is too long")
            self.name_map[name] = size
        else:
            crc32 = binascii.crc32(name.encode())
            self.crc32_map[crc32] = size
997448
def fill(self, filler, size):
        
        return lib.zchunk_fill(self._as_parameter_, filler, size)
1349728
def store_container(self, container):
    
    with self._store_lock:
      self.store.setdefault(container.CONTAINER_TYPE, []).append(container)
569461
public EvictionConfigurationBuilder size(long size) {
      attributes.attribute(SIZE).set(size);
      memory().size(size);
      memory().storageType(StorageType.OBJECT);
      return this;
   }
1116368
def extend(self, data, size):
        
        return lib.zchunk_extend(self._as_parameter_, data, size)
356969
def resize(self, size:Union[int,TensorImageSize])->'Image':
        ""
        assert self._flow is None
        if isinstance(size, int): size=(self.shape[0], size, size)
        if tuple(size)==tuple(self.shape): return self
        self.flow = _affine_grid(size)
        return self
1231148
def _FormatHumanReadableSize(self, size):
    
    magnitude_1000 = 0
    size_1000 = float(size)
    while size_1000 >= 1000:
      size_1000 /= 1000
      magnitude_1000 += 1

    magnitude_1024 = 0
    size_1024 = float(size)
    while size_1024 >= 1024:
      size_1024 /= 1024
      magnitude_1024 += 1

    size_string_1000 = None
    if 0 < magnitude_1000 <= 7:
      size_string_1000 = '{0:.1f}{1:s}'.format(
          size_1000, self._UNITS_1000[magnitude_1000])

    size_string_1024 = None
    if 0 < magnitude_1024 <= 7:
      size_string_1024 = '{0:.1f}{1:s}'.format(
          size_1024, self._UNITS_1024[magnitude_1024])

    if not size_string_1000 or not size_string_1024:
      return '{0:d} B'.format(size)

    return '{0:s} / {1:s} ({2:d} B)'.format(
        size_string_1024, size_string_1000, size)
772990
def start_container(self, cls, **kwargs):
        """"""
        # Convert stylename strings to actual style elements.
        kwargs = self._replace_stylename(kwargs)
        # Create the container.
        container = cls(**kwargs)
        self._containers.append(container)
732065
def _formatinfo(format):
    
    size = struct.calcsize(format)
    return size, len(struct.unpack(format, B('\x00') * size))
296073
def estimate_size_in_bytes(cls, key, value, headers):
        
        return (
            cls.HEADER_STRUCT.size + cls.MAX_RECORD_OVERHEAD +
            cls.size_of(key, value, headers)
        )