parameters: ()
return_statement: return EncodeVarint
docstring: Return an encoder for a basic varint value (does not include tag).
docstring_summary: Return an encoder for a basic varint value (does not include tag).
docstring_tokens: Return an encoder for a basic varint value ( does not include tag ) .
function: def _VarintEncoder():
    """Return an encoder for a basic varint value (does not include tag)."""
  
    local_chr = _PY2 and chr or (lambda x: bytes((x,)))  ##PY25
  ##!PY25  local_chr = chr if bytes is str else lambda x: bytes((x,))
    def EncodeVarint(write, value):
      bits = value & 0x7f
      value >>= 7
      while value:
        write(local_chr(0x80|bits))
        bits = value & 0x7f
        value >>= 7
      return write(local_chr(bits))
  
    return EncodeVarint
function_tokens: def _VarintEncoder ( ) : local_chr = _PY2 and chr or ( lambda x : bytes ( ( x , ) ) ) ##PY25 ##!PY25  local_chr = chr if bytes is str else lambda x: bytes((x,)) def EncodeVarint ( write , value ) : bits = value & 0x7f value >>= 7 while value : write ( local_chr ( 0x80 | bits ) ) bits = value & 0x7f value >>= 7 return write ( local_chr ( bits ) ) return EncodeVarint