code: def encode_varint_3(value, buf):
      append = buf.append
      value = (value << 1) ^ (value >> 63)
  
      bits = value & 0x7F
      value >>= 7
      while value:
          append(0x80 | bits)
          bits = value & 0x7F
          value >>= 7
      append(bits)
      return value
  
file_path: kafka-python/benchmarks/varint_speed.py
imports: from __future__ import print_function
  import pyperf
  from kafka.vendor import six
label_desc: Use image node_id 6 for calling a global function with example usage: encode_varint_3(value, buf) and returns: value