Access particular scanline(s) at passed +index_or_range+.

 It returns a single Scanline or an array of Scanline.
510158
def scanline_at index_or_range
      base = self
      prev_filters = self.filter_types
      filter_codecs = Array.new(prev_filters.size)
      scanlines = []
      index_or_range = self.filter_types.size - 1 if index_or_range == -1
      range = index_or_range.is_a?(Range) ? index_or_range : [index_or_range]

      at = 0
      scanline_positions.push(@filtered_data.size).inject do |pos, delimit|
        if range.include? at
          s = Scanline.new(@filtered_data, pos, (delimit - pos - 1), at) do |scanline|
            if base.fabricate_scanline(scanline, prev_filters, filter_codecs)
              base.apply_filters(prev_filters, filter_codecs)
            end
            base.compress
          end
          scanlines << s
        end
        at += 1
        delimit
      end
      scanlines.size <= 1 ? scanlines.first : scanlines
    end
1358927
def scan(self, ids=range(254)):
        
        return [id for id in ids if self.ping(id)]
345945
def get_line_numbers(self, buffer):
        
        # Get absolute cursor positions from the text object.
        from_, to = self.operator_range(buffer.document)
        from_ += buffer.cursor_position
        to += buffer.cursor_position

        # Take the start of the lines.
        from_, _ = buffer.document.translate_index_to_position(from_)
        to, _ = buffer.document.translate_index_to_position(to)

        return from_, to
592113
def index_of(pattern):
    ''''''
    return (pattern[0,0] * 2**0 + pattern[0,1] * 2**1 + pattern[0,2] * 2**2 +
            pattern[1,0] * 2**3 + pattern[1,1] * 2**4 + pattern[1,2] * 2**5 +
            pattern[2,0] * 2**6 + pattern[2,1] * 2**7 + pattern[2,2] * 2**8)
786554
private int scanForOne(byte[] data , int index , int end ) {
		while (index < end && data[index] != 1) {
			index++;
		}
		return index;
	}
470197
def index(self):
        
        top, bottom = self.margins or Margins(0, self.lines - 1)
        if self.cursor.y == bottom:
            # TODO: mark only the lines within margins?
            self.dirty.update(range(self.lines))
            for y in range(top, bottom):
                self.buffer[y] = self.buffer[y + 1]
            self.buffer.pop(bottom, None)
        else:
            self.cursor_down()
838809
def get( index )
      raise "Only positive indexes, #{index}" if index < 0
      if index >= data_length
        return nil unless next_list
        return next_list.get( index - data_length)
      else
        ret = nil
        if(index < get_length)
          ret = get_internal_word(index + self.class.type_length )
        end
        return ret
      end
    end
892186
def _get_slice_request_data(self, index):
        '''
        
        '''
        # Do a check on list indices for early error detection
        if not is_slice_or_dim_range(index):
            single_depth = self._get_single_depth(index)
            # Single value indices for first single_depth values
            if single_depth > 0:
                # We have integer request first
                subindicies = index[:single_depth]
                sublist = self
                # Use the other side of __getitem__ to grab subindices
                for sind in subindicies:
                    sublist = sublist[sind]
                # If we still have some index requests left or dimension
                # restrictions, then return a FixedListSubset
                if single_depth < len(index) or isinstance(sublist, FixedListSubset):
                    new_dim_ranges = self._combine_dimension_lists(self._dim_ranges, index)
                    return self.builder(sublist, *new_dim_ranges[single_depth:])
                # Otherwise our sublist is actually an element of the
                # original data, so just return it
                else:
                    return sublist
        new_dim_ranges = self._combine_dimension_lists(self._dim_ranges, index)
        return self.builder(self._data, *new_dim_ranges)
638458
def find_next_matching_line(self, match_func, count=1):
        
        result = None

        for index, line in enumerate(self.lines[self.cursor_position_row + 1:]):
            if match_func(line):
                result = 1 + index
                count -= 1

            if count == 0:
                break

        return result
810336
def get_line(thing):
    
    try:
        return inspect.getsourcelines(thing)[1]
    except TypeError:
        # Might be a property
        return inspect.getsourcelines(thing.fget)[1]
    except Exception as e:
        # print(thing)
        raise e
1078167
function findIndex(array, exp) {
  return (isArray(array) && isDefined(exp))
    //return the the index of the member
    ? findInArray(array, $parse(exp), true)
    : array;
}
1283226
def _index_range(self, version, symbol, from_version=None, **kwargs):
        
        from_index = None
        if from_version:
            from_index = from_version['up_to']
        return from_index, None
1353992
def getline(self):
        """"""
        if self.index >= len(self.lines):
            line = ''
        else:
            line = self.lines[self.index]
            self.index += 1
        return line
764363
function getArrayFromRange(l, h, s) {
  var a = [];
  s = s || 1;
  for(var i = l; i < h; i += s) {
    a.push(i);
  }
  return a;
}
1047429
def readlines(self, size=None):
        
        last_pos = self._pos
        result = []
        if size is not None:
            end = min(self.limit, last_pos + size)
        else:
            end = self.limit
        while 1:
            if size is not None:
                size -= last_pos - self._pos
            if self._pos >= end:
                break
            result.append(self.readline(size))
            if size is not None:
                last_pos = self._pos
        return result
556458
def _get_slicers(self, index):
        
        if not index:  # first item.
            return slice(0, self.SIGNATURE[0])
        if index >= len(self.SIGNATURE):
            raise IndexError('index out of self.SIGNATURE range')
        pad_start = sum(self.SIGNATURE[:index])
        pad_stop = pad_start + self.SIGNATURE[index]
        return slice(pad_start, pad_stop)
527200
def _IndexedScan(self, i, max_records=None):
    """"""
    self._ReadIndex()

    # The record number that we will read next.
    idx = 0
    # The timestamp that we will start reading from.
    start_ts = 0
    if i >= self._max_indexed:
      start_ts = max((0, 0), (self._index[self._max_indexed][0],
                              self._index[self._max_indexed][1] - 1))
      idx = self._max_indexed
    else:
      try:
        possible_idx = i - i % self.INDEX_SPACING
        start_ts = (max(0, self._index[possible_idx][0]),
                    self._index[possible_idx][1] - 1)
        idx = possible_idx
      except KeyError:
        pass

    if max_records is not None:
      max_records += i - idx

    with data_store.DB.GetMutationPool() as mutation_pool:
      for (ts, value) in self.Scan(
          after_timestamp=start_ts,
          max_records=max_records,
          include_suffix=True):
        self._MaybeWriteIndex(idx, ts, mutation_pool)
        if idx >= i:
          yield (idx, ts, value)
        idx += 1