returns how much to add to offset
13956
private int generateGroupEncodeDecode(
        final List<Token> tokens,
        final String typeName,
        final StringBuilder encode,
        final StringBuilder decode,
        final StringBuilder rc,
        final int currentOffset)
    {
        final char varName = Character.toLowerCase(typeName.charAt(0));
        final Token signalToken = tokens.get(0);
        final String propertyName = formatPropertyName(signalToken.name());
        final Token blockLengthToken = Generators.findFirst("blockLength", tokens, 0);
        final Token numInGroupToken = Generators.findFirst("numInGroup", tokens, 0);
        final int blockLengthOffset = blockLengthToken.offset();
        final String blockLengthType = golangTypeName(blockLengthToken.encoding().primitiveType());
        final String blockLengthMarshalType = golangMarshalType(blockLengthToken.encoding().primitiveType());
        final int numInGroupOffset = numInGroupToken.offset();
        final String numInGroupType = golangTypeName(numInGroupToken.encoding().primitiveType());
        final String numInGroupMarshalType = golangMarshalType(numInGroupToken.encoding().primitiveType());

        // Offset handling
        final int gap = Math.max(signalToken.offset() - currentOffset, 0);
        encode.append(generateEncodeOffset(gap, ""));
        decode.append(generateDecodeOffset(gap, ""));

        final String encBlockLengthTmpl =
            "\tvar %7$sBlockLength %1$s = %2$d\n" +
            "\tif err := _m.Write%6$s(_w, %7$sBlockLength); err != nil {\n" +
            "\t\treturn err\n" +
            "\t}\n";

        final String encNumInGroupTmpl =
            "\tvar %7$sNumInGroup %3$s = %3$s(len(%4$s.%5$s))\n" +
            "\tif err := _m.Write%8$s(_w, %7$sNumInGroup); err != nil {\n" +
            "\t\treturn err\n" +
            "\t}\n";

        // Order write based on offset
        final String encGrpMetaTmpl = blockLengthOffset < numInGroupOffset ?
            encBlockLengthTmpl + encNumInGroupTmpl : encNumInGroupTmpl + encBlockLengthTmpl;

        encode.append(String.format(encGrpMetaTmpl,
            blockLengthType,
            signalToken.encodedLength(),
            numInGroupType,
            varName,
            toUpperFirstChar(signalToken.name()),
            blockLengthMarshalType,
            propertyName,
            numInGroupMarshalType));

        // Write the group itself
        encode.append(String.format(
            "\tfor _, prop := range %1$s.%2$s {\n" +
            "\t\tif err := prop.Encode(_m, _w); err != nil {\n" +
            "\t\t\treturn err\n" +
            "\t\t}\n",
            varName,
            toUpperFirstChar(signalToken.name())));

        decode.append(String.format(
            "\n" +
            "\tif %1$s.%2$sInActingVersion(actingVersion) {\n",
            varName,
            propertyName));

        final String decBlockLengthTmpl =
            "\t\tvar %1$sBlockLength %2$s\n" +
            "\t\tif err := _m.Read%4$s(_r, &%1$sBlockLength); err != nil {\n" +
            "\t\t\treturn err\n" +
            "\t\t}\n";

        final String decNumInGroupTmpl =
            "\t\tvar %1$sNumInGroup %3$s\n" +
            "\t\tif err := _m.Read%5$s(_r, &%1$sNumInGroup); err != nil {\n" +
            "\t\t\treturn err\n" +
            "\t\t}\n";

        final String decGrpMetaTmpl = blockLengthOffset < numInGroupOffset ?
            decBlockLengthTmpl + decNumInGroupTmpl : decNumInGroupTmpl + decBlockLengthTmpl;

        decode.append(String.format(decGrpMetaTmpl,
            propertyName,
            blockLengthType,
            numInGroupType,
            blockLengthMarshalType,
            numInGroupMarshalType));

        // Read the group itself
        decode.append(String.format(
            "\t\tif cap(%1$c.%2$s) < int(%2$sNumInGroup) {\n" +
            "\t\t\t%1$s.%2$s = make([]%3$s%2$s, %2$sNumInGroup)\n" +
            "\t\t}\n" +
            "\t\tfor i, _ := range %1$s.%2$s {\n" +
            "\t\t\tif err := %1$s.%2$s[i].Decode(_m, _r, actingVersion, uint(%4$sBlockLength)); err != nil {\n" +
            "\t\t\t\treturn err\n" +
            "\t\t\t}\n" +
            "\t\t}\n",
            varName,
            toUpperFirstChar(signalToken.name()),
            typeName,
            propertyName));

        // Range check the group itself
        rc.append(String.format(
            "\tfor _, prop := range %1$s.%2$s {\n" +
            "\t\tif err := prop.RangeCheck(actingVersion, schemaVersion); err != nil {\n" +
            "\t\t\treturn err\n" +
            "\t\t}\n" +
            "\t}\n",
            varName,
            toUpperFirstChar(signalToken.name())));

        return gap;
    }
854165
function getOffset() {
      var indentation = []
      var pos = line + 1

      // Done.  Called when the last character is eaten to retrieve the range’s
      // offsets.
      return function() {
        var last = line + 1

        while (pos < last) {
          indentation.push((offset[pos] || 0) + 1)

          pos++
        }

        return indentation
      }
    }
154595
@Override
  public QueryBuilder<V> increaseOffsetBy(Integer amount) {
    if (offset == null) {
      offset = 0;
    }
    this.offset += amount;
    return this;
  }
500713
def offset(self):
    """"""
    if not self._registry_key and self._registry:
      self._GetKeyFromRegistry()

    if not self._registry_key:
      return None

    return self._registry_key.offset
196793
private static int put(byte[] block, int offset, ByteBuffer buf) {
    int len = Math.min(block.length - offset, buf.remaining());
    buf.get(block, offset, len);
    return len;
  }
40007
function getOffset(reader, offSize) {
            var v = 0;
            for (var i = 0; i < offSize; i++) {
                v <<= 8;
                v += reader.readUint8();
            }
            return v;
        }
1066024
def calculate_offset(cls, labels):
        ''''''
        used_strings = set(cls._nice_strings.keys()) & set(labels)
        return max([len(cls._nice_strings[s]) for s in used_strings])
910066
function(offset) {
        var index = this._indexArray,
            l = this.index_pointer;
        index[0 + l] = 0 + offset;
        index[1 + l] = 1 + offset;
        index[2 + l] = 2 + offset;
        index[3 + l] = 1 + offset;
        index[4 + l] = 2 + offset;
        index[5 + l] = 3 + offset;
        this.index_pointer += 6;
    }
1361332
def apply_offset(self):
    ''''''
    self._ensure_modification_is_safe()

    if self.query.offset != 0:
      self._iterable = \
        offset_gen(self.query.offset, self._iterable, self._skipped_inc)
898721
def get_offset(self):
        """"""
        return self.p1.y-self.get_slope()*self.p1.x
301029
def read_to_offset(self, offset):
    
    assert offset >= self._offset
    result = self._buffer[self._offset: offset]
    self._offset += len(result)
    return result
739117
function offset (ev, target) {
  var cx = ev.clientX || 0
  var cy = ev.clientY || 0
  var rect = bounds(target)
  return [ cx - rect.left, cy - rect.top ]
}
1025047
function offset(element) {
	const elemBCR = element.getBoundingClientRect();
	return {
		width: Math.round(isNumber(elemBCR.width) ? elemBCR.width : element.offsetWidth),
		height: Math.round(isNumber(elemBCR.height) ? elemBCR.height : element.offsetHeight),
		top: Math.round(elemBCR.top + (window.pageYOffset || document.documentElement.scrollTop)),
		left: Math.round(elemBCR.left + (window.pageXOffset || document.documentElement.scrollLeft))
	};
}
1345025
def set_offset( self, offset ):
        """"""
        assert offset in range( len( self.buffer ) )
        self.pos = offset
        self._fill_buffer()
170153
private long findAfter(long offset) {
    if (size == 0) {
      return -1;
    }

    int low  = 0;
    int high = size-1;

    while (low <= high) {
      int mid = low + ((high - low) / 2);

      long i = buffer.readLong(mid * ENTRY_SIZE);
      if (i < offset) {
        low = mid + 1;
      } else if (i > offset) {
        high = mid - 1;
      } else {
        return mid;
      }
    }

    return (low < high) ? low + 1 : high + 1;
  }
414609
public static int addOffset(int index, int offset, int size) {
		index += offset;
		if( index < 0 ) {
			return size + index;
		} else {
			return index%size;
		}
	}
1260757
def offset(self, offset):
        
        query = self._copy()
        query._offset = offset
        return query