returns the compressor depending on the size of the layer
14807
function(payload) {
    var self = this;
    if (this.options.compressor) {
      return this.options.compressor;
    }

    payload = payload || JSON.stringify(this.toJSON());
    if (!this.options.force_compress && payload.length < this.options.MAX_GET_SIZE) {
      return function(data, level, callback) {
        callback("config=" + encodeURIComponent(data));
      };
    }

    return function(data, level, callback) {
      data = JSON.stringify({ config: data });
      LZMA.compress(data, level, function(encoded) {
        callback("lzma=" + encodeURIComponent(cdb.core.util.array2hex(encoded)));
      });
    };

  }
473247
def filesize(self):
        """"""
        if self.kind == 'data':
            return len(self._data.data)
        return self._data.filesize
645412
def get_layer(self, x, layer, **kwargs):
    
    return self.fprop(x, **kwargs)[layer]
1135688
function (layer) {
            var bounds = layer instanceof me.TMXLayer ? me.pool.pull("me.Rect", 0, 0, 0, 0) : this.bounds;
            bounds.setShape(
                0, 0,
                this.cols * this.tilewidth,
                this.rows * this.tileheight
            );
            return bounds;
        }
460366
def filesize(fileobj):
    
    current = fileobj.tell()
    fileobj.seek(0, 2)
    end = fileobj.tell()
    fileobj.seek(current)
    return end
686462
function(buff, off, buff_size) {
    var n;

    if(!zip_initflag)
    {
	zip_init_deflate();
	zip_initflag = true;
	if(zip_lookahead == 0) { // empty
	    zip_complete = true;
	    return 0;
	}
    }

    if((n = zip_qcopy(buff, off, buff_size)) == buff_size)
	return buff_size;

    if(zip_complete)
	return n;

    if(zip_compr_level <= 3) // optimized for speed
	zip_deflate_fast();
    else
	zip_deflate_better();
    if(zip_lookahead == 0) {
	if(zip_match_available != 0)
	    zip_ct_tally(0, zip_window[zip_strstart - 1] & 0xff);
	zip_flush_block(1);
	zip_complete = true;
    }
    return n + zip_qcopy(buff, n + off, buff_size - n);
}
1054618
function compareSizes(task) {
  var compressors = task.options.compress,
    newsizes = helpers.sizes(task, compressors),
    files = Object.keys(newsizes),
    sizecache = defaultCache,
    cache = helpers.get_cache(sizecache),
    tips = cache[""].tips,
    labels = helpers.sorted_labels(cache);

  // Obtain the current branch and continue...
  helpers.git_status(function(err, status) {
    var prefixes = compressors ? [""].concat(Object.keys(compressors)) : [""],
      commonHeader = prefixes.map(
        (label, i) => (i === 0 && compressors ? "raw" : label)
      );

    const tableOptions = {
      align: prefixes.map(() => "r").concat("l"),
      // eslint-disable-next-line no-control-regex
      stringLength: s => s.replace(/\x1B\[\d+m/g, "").length // Return a string, uncolored (suitable for testing .length, etc).
    };

    if (err) {
      console.warn(err);
      status = {};
    }

    let rows = [];
    rows.push(commonHeader.concat("Sizes"));

    // Raw sizes
    files.forEach(function(key) {
      rows.push(prefixes.map(prefix => newsizes[key][prefix]).concat(key + ""));
    });

    console.log(table(rows, tableOptions));

    // Comparisons
    labels.forEach(function(label) {
      var oldsizes = cache[label];

      // Skip metadata key and empty cache entries
      if (label === "" || !cache[label]) {
        return;
      }

      rows = [];

      // Header
      rows.push(
        commonHeader.concat("Compared to " + helpers.label(label, tips[label]))
      );

      // Data
      files.forEach(function(key) {
        var old = oldsizes && oldsizes[key];
        rows.push(
          prefixes
            .map(function(prefix) {
              return helpers.delta(old && newsizes[key][prefix] - old[prefix]);
            })
            .concat(key + "")
        );
      });

      console.log();
      console.log(table(rows, tableOptions));
    });

    // Update "last run" sizes
    cache[lastrun] = newsizes;

    // Remember if we're at a branch tip and the branch name is an available key
    if (
      status.branch &&
      !status.changed &&
      (status.branch in tips || !cache[status.branch])
    ) {
      tips[status.branch] = status.head;
      cache[status.branch] = newsizes;
      console.log("\nSaved as: " + status.branch);
    }

    // Write to file
    file.write(sizecache, JSON.stringify(cache));
  });
}
642288
public int getSize() {
		if (size < 0) {
			size = 0;
			for (byte[] cache: start) {
				size += new RemoteOneFileCache(cache).getSize();
			}
			for (byte[] cache: end) {
				size += new RemoteOneFileCache(cache).getSize();
			}
		}
		return size;
	}
600922
def sizes(x):
  """"""
  def size(x):
    try:
      return x.size
    except Exception:  # pylint: disable=broad-except
      return 0
  return nested_map(x, size)
701342
protected Compress getCompress()
    {
        final Compress compress;
        if (this.store.getResourceProperties().containsKey(Store.PROPERTY_COMPRESS)) {
            compress = Compress.valueOf(this.store.getResourceProperties().get(Store.PROPERTY_COMPRESS).toUpperCase());
        } else {
            compress = Compress.NONE;
        }
        return compress;
    }
660478
def get_rendition_size(self, width=0, height=0):
        ''''''
        if width == 0 and height == 0:
            return (self.master_width, self.master_height)

        target_width = int(width)
        target_height = int(height)

        ratio = self.master_width / float(self.master_height)
        if target_height == 0 and target_width != 0:
            target_height = int(target_width / ratio)

        if target_height != 0 and target_width == 0:
            target_width = int(target_height * ratio)

        return target_width, target_height
1256515
def afx_small():
  """"""
  hparams = transformer.transformer_tpu()
  hparams.filter_size = 1024
  hparams.num_heads = 4
  hparams.num_hidden_layers = 3
  hparams.batch_size = 512
  return hparams
1115424
def _get_size(fileno):
    # Thanks to fabric (fabfile.org), and
    # http://sqizit.bartletts.id.au/2011/02/14/pseudo-terminals-in-python/
    
    # Inline imports, because these modules are not available on Windows.
    # (This file is used by ConEmuOutput, which is used on Windows.)
    import fcntl
    import termios

    # Buffer for the C call
    buf = array.array(b'h' if six.PY2 else u'h', [0, 0, 0, 0])

    # Do TIOCGWINSZ (Get)
    # Note: We should not pass 'True' as a fourth parameter to 'ioctl'. (True
    #       is the default.) This causes segmentation faults on some systems.
    #       See: https://github.com/jonathanslenders/python-prompt-toolkit/pull/364
    fcntl.ioctl(fileno, termios.TIOCGWINSZ, buf)

    # Return rows, cols
    return buf[0], buf[1]
66763
def mtf_bitransformer_all_layers_tiny():
  """"""
  hparams = mtf_bitransformer_tiny()
  hparams.moe_num_experts = 4
  hparams.moe_expert_x = 4
  hparams.moe_expert_y = 4
  hparams.moe_hidden_size = 512
  hparams.encoder_layers = [
      "self_att", "local_self_att", "moe_1d", "moe_2d", "drd"]
  hparams.decoder_layers = [
      "self_att", "local_self_att", "enc_att", "moe_1d", "moe_2d", "drd"]
  return hparams
1211071
def get_size(
            self,
            bucket: str,
            key: str
    ) -> int:
        
        blob_obj = self._get_blob_obj(bucket, key)
        return blob_obj.size
201953
public int compress(int[] inBlock, int blockSize) {
                // find the best b that can lead to the smallest overall
                // compressed size
                int currentB = POSSIBLE_B[0];
                int tmpB = currentB;
                boolean hasBigNum = checkBigNumbers(inBlock, blockSize,
                        POSSIBLE_B[POSSIBLE_B.length - 1]);
                if (hasBigNum) {
                        currentB = 4;
                } else {
                        int optSize = estimateCompressedSize(inBlock,
                                blockSize, tmpB);
                        for (int i = 1; i < POSSIBLE_B.length; ++i) {
                                tmpB = POSSIBLE_B[i];
                                int curSize = estimateCompressedSize(inBlock,
                                        blockSize, tmpB);
                                if (curSize < optSize) {
                                        currentB = tmpB;
                                        optSize = curSize;
                                }
                        }
                }

                // compress the block using the above best b
                int compressedSizeInInts = compressOneBlockCore(inBlock,
                        blockSize, currentB);

                return compressedSizeInInts;
        }
462925
def conv_layer(x,
               hidden_size,
               kernel_size,
               stride,
               pooling_window,
               dropout_rate,
               dilation_rate,
               name="conv"):
  """"""
  with tf.variable_scope(name):
    out = x
    out = common_layers.conv1d_block(
        out,
        hidden_size, [(dilation_rate, kernel_size)],
        strides=stride,
        first_relu=False,
        padding="same")
    out = tf.nn.relu(out)
    if pooling_window:
      out = tf.layers.max_pooling1d(
          out, pooling_window, pooling_window, padding="same")
    out = tf.layers.dropout(out, dropout_rate)
    return out