code: def encodeDeltaRunAsWords_(deltas, offset, bytearr):
      pos = offset
      numDeltas = len(deltas)
      while pos < numDeltas:
          value = deltas[pos]
          # Within a word-encoded run of deltas, it is easiest
          # to start a new run (with a different encoding)
          # whenever we encounter a zero value. For example,
          # the sequence [0x6666, 0, 0x7777] needs 7 bytes when
          # storing the zero literally (42 66 66 00 00 77 77),
          # and equally 7 bytes when starting a new run
          # (40 66 66 80 40 77 77).
          if value == 0:
              break
  
          # Within a word-encoded run of deltas, a single value
          # in the range (-128..127) should be encoded literally
          # because it is more compact. For example, the sequence
          # [0x6666, 2, 0x7777] becomes 7 bytes when storing
          # the value literally (42 66 66 00 02 77 77), but 8 bytes
          # when starting a new run (40 66 66 00 02 40 77 77).
          if (
              (-128 <= value <= 127)
              and pos + 1 < numDeltas
              and (-128 <= deltas[pos + 1] <= 127)
          ):
              break
          pos += 1
      runLength = pos - offset
      while runLength >= 64:
          bytearr.append(DELTAS_ARE_WORDS | 63)
          a = array.array("h", deltas[offset : offset + 64])
          if sys.byteorder != "big":
              a.byteswap()
          bytearr.extend(a)
          offset += 64
          runLength -= 64
      if runLength:
          bytearr.append(DELTAS_ARE_WORDS | (runLength - 1))
          a = array.array("h", deltas[offset:pos])
          if sys.byteorder != "big":
              a.byteswap()
          bytearr.extend(a)
      return pos
  
imports: from fontTools.misc.fixedTools import fixedToFloat, floatToFixed, floatToFixedToStr, strToFixedToFloat, otRound
  from fontTools.misc.textTools import safeEval
  import array
  from collections import Counter, defaultdict
  import io
  import logging
  import struct
  import sys
label_desc: Use image node_id 18 for calling the TupleVariation obj's underlying member method code with example usage: obj.encodeDeltaRunAsWords_(deltas, offset, bytearr) and returns: pos