Returns the chunk immediately following (and adjacent to) this one.
431944
def next_chunk(self):
        
        raise NotImplementedError("%s not implemented for %s" % (self.next_chunk.__func__.__name__,
                                                                 self.__class__.__name__))
410276
def next(self):
        
        if self._has_finished:
            raise StopIteration

        if not len(self._buffer):
                    
            results = self.fetch_next_block()
            self._buffer.extend(results)
            
        if not len(self._buffer):
            raise StopIteration
            
        return self._buffer.popleft()
476497
public alluxio.grpc.Chunk getChunk() {
    return chunk_ == null ? alluxio.grpc.Chunk.getDefaultInstance() : chunk_;
  }
69065
def _GetChunkForReading(self, chunk):
    """"""
    try:
      return self.chunk_cache.Get(chunk)
    except KeyError:
      pass

    # We don't have this chunk already cached. The most common read
    # access pattern is contiguous reading so since we have to go to
    # the data store already, we read ahead to reduce round trips.

    missing_chunks = []
    for chunk_number in range(chunk, chunk + 10):
      if chunk_number not in self.chunk_cache:
        missing_chunks.append(chunk_number)

    self._ReadChunks(missing_chunks)
    # This should work now - otherwise we just give up.
    try:
      return self.chunk_cache.Get(chunk)
    except KeyError:
      raise aff4.ChunkNotFoundError("Cannot open chunk %s" % chunk)
1140249
def parseChunk(self, chunk, size, terminate):
        
        ret = libxml2mod.xmlParseChunk(self._o, chunk, size, terminate)
        return ret
277665
def prev_chunk(self):
        
        raise NotImplementedError("%s not implemented for %s" % (self.prev_chunk.__func__.__name__,
                                                                 self.__class__.__name__))
206461
synchronized List<SegmentChunk> chunks() {
        if (this.sealed) {
            return this.segmentChunks; // This is already an unmodifiable list.
        } else {
            return Collections.unmodifiableList(this.segmentChunks.subList(0, this.segmentChunks.size()));
        }
    }
1321886
private final String getChunk(String s, int slength, int marker)
    {
        StringBuilder chunk = new StringBuilder();
        char c = s.charAt(marker);
        chunk.append(c);
        marker++;
        if (isDigit(c))
        {
            while (marker < slength)
            {
                c = s.charAt(marker);
                if (!isDigit(c))
                    break;
                chunk.append(c);
                marker++;
            }
        } else
        {
            while (marker < slength)
            {
                c = s.charAt(marker);
                if (isDigit(c))
                    break;
                chunk.append(c);
                marker++;
            }
        }
        return chunk.toString();
    }
747387
def stream(self):
        '''
        '''
        chunk_a = None
        chunk_b = None
        chunk_a_index = 0
        chunk_b_index = 0
        search_start_index = 0

        while True:
            chunk_a = chunk_b
            chunk_a_index = chunk_b_index
            chunk_b = self._file.read(self._read_size)

            if chunk_a is None:
                continue

            chunk_b_index = chunk_a_index + len(chunk_a)

            if not chunk_a:
                break

            current_chunk = chunk_a + chunk_b[:self._overlap_size]

            offset_end = len(chunk_a) + self._overlap_size

            while True:
                offset_start = search_start_index - chunk_a_index
                match = self._pattern.search(
                    current_chunk, offset_start, offset_end)

                if not match:
                    unmatched_part = chunk_a[offset_start:]

                    if unmatched_part:
                        yield (None, unmatched_part)

                    search_start_index += len(unmatched_part)
                    break

                start_index, end_index = match.span(match.lastindex)

                unmatched_part = current_chunk[offset_start:start_index]

                if unmatched_part:
                    yield (None, unmatched_part)

                yield (match, match.group(match.lastindex))

                search_start_index += len(unmatched_part) + \
                    len(match.group(match.lastindex))
705112
def get_starting_chunk(filename, length=1024):
    
    # Ensure we open the file in binary mode
    try:
        with open(filename, 'rb') as f:
            chunk = f.read(length)
            return chunk
    except IOError as e:
        print(e)
244485
public ArrayList getChunks() {
		ArrayList tmp = new ArrayList();
		for (Iterator i = arrayList.iterator(); i.hasNext(); ) {
			tmp.addAll(((Element) i.next()).getChunks());
		}
		return tmp;
	}
235999
public ArrayList getChunks() {
        ArrayList tmp = new ArrayList();
        Chunk chunk;
        Iterator i = iterator();
        boolean localDestination = (reference != null && reference.startsWith("#"));
        boolean notGotoOK = true;
        while (i.hasNext()) {
            chunk = (Chunk) i.next();
            if (name != null && notGotoOK && !chunk.isEmpty()) {
                chunk.setLocalDestination(name);
                notGotoOK = false;
            }
            if (localDestination) {
                chunk.setLocalGoto(reference.substring(1));
            }
            else if (reference != null)
                chunk.setAnchor(reference);
            tmp.add(chunk);
        }
        return tmp;
    }
1329316
def read_chunked(self):
        """"""
        self._load_metadata()
        for i in range(self.npartitions):
            yield self._get_partition(i)
1111579
def get_chunk_path_from_string(string, chunk=3):
    """"""
    return os.path.join(
        *list(generate_chunks(
            string,
            chunk
        ))
    )
280095
private void seekToChunkStart()
    {
        if (getOnDiskFilePointer() != chunkOffset)
        {
            try
            {
                out.seek(chunkOffset);
            }
            catch (IOException e)
            {
                throw new FSReadError(e, getPath());
            }
        }
    }
1316543
def ChunkBy(self, f=None):
    
    if f is None:
        return _chunk(self)
    if is_to_destruct(f):
        f = destruct_func(f)
    return _chunk(self, f)
700352
function chunk(start, end) {
                // Slice, unescape and push onto result array.
                res.push(str.slice(start, end).replace(/\\\\/g, '\\').replace(/\\\./g, '.'));
                // Set starting position of next chunk.
                pos = end + 1;
            }