Returns a list of tuples, the fileid and size on disk of the file.
        This function is used to detect oddly large files in the corpus.
558152
def sizes(self, fileids=None) -> Generator[int, int, None]:
        
        if not fileids:
            fileids = self.fileids()
        # Create a generator, getting every path and computing filesize
        for path in self.abspaths(fileids):
            yield os.path.getsize(path)
700260
def get_size(self):
        
        if self._size is None:
            self._size = self._filepath.stat().st_size
        return self._size
268220
def dimensions(self):
        
        return ImageDimensions(self._info.file.width, self._info.file.height)
773843
def grouped_count_sizes(fileslist, fgrouped):  # pragma: no cover
    ''''''
    fsizes = {}
    total_files = 0
    allitems = None
    if isinstance(fgrouped, dict):
        allitems = fgrouped.iteritems()
    elif isinstance(fgrouped, list):
        allitems = enumerate(fgrouped)
    for fkey, cluster in allitems:
        fsizes[fkey] = []
        for subcluster in cluster:
            tot = 0
            if subcluster is not None:
                for fname in subcluster:
                    tot += fileslist[fname]
                    total_files += 1
            fsizes[fkey].append(tot)
    return fsizes, total_files
231386
private void read_block_sizes_from_disk(boolean coalesce_blocks)
    throws IOException
    {
        long addr = FIRST_TAIL;
        int length;
        long new_tail = tail_ptr;

        while (addr < tail_ptr) {
            seek(addr);
            if (coalesce_blocks) {
                length = combine_blocks(addr);
            } else {
                length = readInt();
            }
            if (length > 0) {
                if ((length + addr >= tail_ptr) && (!readOnly)) {
                    // add last block to tail
                    new_tail = addr;
                } else {
                    add_to_freelist(addr, length);
                }
            } else {
                length = - length;
                allocated_blocks++;
                allocated_words += length;
            }
            addr = addr + length;
        }
        if ((new_tail != tail_ptr) && (!readOnly)) {
            tail_ptr = new_tail;
            seek(TAIL_DPTR);
            writeLong(tail_ptr);
        }

    }
1046286
def get_file_size(fileobj):
    
    currpos = fileobj.tell()
    fileobj.seek(0, 2)
    total_size = fileobj.tell()
    fileobj.seek(currpos)
    return total_size
549022
def get_files(file_tokens, cwd=None):
    
    if not file_tokens:
        return []

    token = file_tokens.pop()
    try:
        filename = token.filename
    except AttributeError:
        filename = ''

    if cwd:
        input = Input(token.alias, filename, cwd=cwd)
    else:
        input = Input(token.alias, filename)

    return [input] + get_files(file_tokens)
1107751
def get_dimensions(filenames):
    """"""

    dims = []
    for filename in filenames:
        implemented = False
        with open(filename, 'rb') as fp:

            img_types = (PNGFile, GIFFile, JPEGFile)
            for img_type in img_types:
                sig = str(getattr(img_type, 'SIGNATURE')[0])
                magic = fp.read(len(sig))
                fp.seek(0)
                if magic == sig:
                    cls = img_type.__name__.split('.')[-1]
                    img = getattr(img_type, cls)(fp)
                    x, y = img.size
                    dims.append((x, y, img.content_type, filename))
                    implemented = True
                    break
            if not implemented:
                # might want to fail silently, or print error to stdout...
                print('cannot handle file: %s' % filename)
                raise NotImplementedError
    return dims
473247
def filesize(self):
        """"""
        if self.kind == 'data':
            return len(self._data.data)
        return self._data.filesize
1154376
function size(file) {
  if (!exists(file) || !isFile(file)) {
    return -1;
  } else {
    try {
      return _fileStats(file).size;
    } catch (e) {
      return -1;
    }
  }
}
678616
def fileSize(f):
    ''''''
    offset = f.tell()

    f.seek(0, 2)
    size = f.tell()

    f.seek(offset)  # return to the previous position in the file
    return size
950760
def filesizes(images):
    
    # Pull each image and push its filesize
    while True:
        img = yield marv.pull(images)
        if img is None:
            break
        yield marv.push(img.size)
1029186
def disk_check_size(ctx, param, value):
    
    if value:
        # if we've got a prefix
        if isinstance(value, tuple):
            val = value[1]
        else:
            val = value
        if val % 1024:
            raise click.ClickException('Size must be a multiple of 1024.')
    return value
552785
def get_file(self,pattern):
        '''
         
        '''
        flag=[fnmatch.fnmatch(l,pattern) for l in self.filelist]
        id=self.fid_list.compress(flag)
        flag = self.fileid == id
        return flag
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]
877606
def size_limit(self):
        
        limits = [
            lim for lim in current_files_rest.file_size_limiters(
                self)
            if lim.limit is not None
        ]
        return min(limits) if limits else None
852377
def file_info_long(self):
        
        self.file_info()
        for ii in np.arange(self.signals_in_file):
            print("label:", self.getSignalLabels()[ii], "fs:",
                  self.getSampleFrequencies()[ii], "nsamples",
                  self.getNSamples()[ii])