TODO maybe calculate with filelength in visualizer
355073
public VisualizerBuilder setBytesPerPixel(int bytes, long fileLength) {
		Preconditions.checkArgument(bytes > 0);
		double nrOfPixels = fileLength / (double) bytes;
		double pixelsPerRow = Math.floor(settings.fileWidth
				/ (double) settings.pixelSize);
		double pixelsPerCol = Math.ceil(nrOfPixels / (double) pixelsPerRow);
		settings.height = (int) Math.ceil(pixelsPerCol * settings.pixelSize);
		return this;
	}
1182776
def file_size(f):
    
    if isinstance(f, (six.string_types, six.text_type)):
        return os.path.getsize(f)
    else:
        cur = f.tell()
        f.seek(0, 2)
        size = f.tell()
        f.seek(cur)
        return size
55055
function getFileSize(filepath, options) {
			var stats = fs.statSync(filepath);
			return filesize(stats.size, options);
		}
1139667
def waveform_length(X):
    '''  '''
    return np.sum(np.abs(np.diff(X, axis=1)), axis=1)
150844
function calculateDraggerSize() {
    var cw = $container.width() / scale;
    var ch = $container.height() / scale;
    // doc.x / container.x = canvas.x / dragger.x
    var width = (cw * canvasSize.x) / docSize.x;
    var height = (ch * canvasSize.y) / docSize.y;

    // limit size to bounds of canvas
    if (width > canvasSize.x) {
      width = canvasSize.x;
    }

    if (height > canvasSize.y) {
      height = canvasSize.y;
    }

    view.setDraggerSize(width, height);
  }
1293254
def display_len(text):
    
    text = unicodedata.normalize('NFD', text)
    return sum(char_width(char) for char in text)
838458
private static double getLength(BoundingBox boundingBox,
			ProjectionTransform toWebMercatorTransform) {
		BoundingBox transformedBoundingBox = boundingBox
				.transform(toWebMercatorTransform);
		return getLength(transformedBoundingBox);
	}
936190
def length(self, rows=None):
    
    rows = tf.range(self._capacity) if rows is None else rows
    return tf.gather(self._length, rows)
793330
function sizeForFileName(fileName, size) {
	const m = fileName.match(/@(\d+)x\./);
	const scale = m ? +m[1] : 1;

	return {
		realWidth: size.width,
		realHeight: size.height,
		width: Math.floor(size.width / scale),
		height: Math.floor(size.height / scale)
	};
}
592766
def get_size(self, boundary):
        """"""
        if self.filesize is not None:
            valuesize = self.filesize
        else:
            valuesize = len(self.value)

        return len(self.encode_hdr(boundary)) + 2 + valuesize
865111
def length(cls, dataset):
        
        return np.product([len(d.points) for d in dataset.data.coords(dim_coords=True)], dtype=np.intp)
329870
function printFileSizes(stats, previousSizeMap) {
    const assets = stats.toJson().assets
    .filter((asset) => (/\.(js|css)$/.test(asset.name)))
    .map((asset) => {
        const fileContents = fs.readFileSync(`${paths.appBuild}/${asset.name}`);
        const size = gzipSize(fileContents);
        const previousSize = previousSizeMap[removeFileNameHash(asset.name)];
        const difference = getDifferenceLabel(size, previousSize);
        return {
            folder: path.join('build', path.dirname(asset.name)),
            name: path.basename(asset.name),
            size: size,
            sizeLabel: filesize(size) + (difference ? ` (${difference})` : '')
        };
    });

    assets.sort((a, b) => b.size - a.size);

    const longestSizeLabelLength = Math.max.apply(null,
        assets.map((a) => stripAnsi(a.sizeLabel).length)
    );

    assets.forEach((asset) => {
        let sizeLabel = asset.sizeLabel;
        const sizeLength = stripAnsi(sizeLabel).length;
        if (sizeLength < longestSizeLabelLength) {
            const rightPadding = ' '.repeat(longestSizeLabelLength - sizeLength);
            sizeLabel += rightPadding;
        }
        console.log(sizeLabel, chalk.dim(asset.folder + path.sep) + chalk.cyan(asset.name));
    });
}
75823
function intLength(num) {
		num = num.replace(/^\-/, '');
		if (~num.indexOf('.')) {
			return num.split('.')[0].length;
		}
		
		return num.length;
	}
210418
def _calc_dir_size(path):
    
    dir_size = 0
    for (root, dirs, files) in os.walk(path):
        for fn in files:
            full_fn = os.path.join(root, fn)
            dir_size += os.path.getsize(full_fn)

    return dir_size
653265
def read(self, fileobj):
        """"""

        fileobj.seek(self._dataoffset, 0)
        data = fileobj.read(self.datalength)
        return len(data) == self.datalength, data
776701
def length(self):
        
        total_length = 0
        for location_a, location_b in zip(
                self.locations[:-1], self.locations[1:]):
            total_length += Line(location_a, location_b).length
        return total_length
707488
def length(self):
        
        item = self.head
        counter = 0

        while item is not None:
            counter += 1
            item = item.next_node

        return counter