Decode a BSON int64 to bson.int64.Int64.
428883
def _get_int64(data, position, dummy0, dummy1, dummy2):
    """"""
    end = position + 8
    return Int64(_UNPACK_LONG(data[position:end])[0]), end
1205379
def decode(bstr):
  

  bstr = bstr.replace(b':', b'')
  if len(bstr) != 12:
    raise ValueError('not a valid MAC address: {!r}'.format(bstr))

  try:
    return int(bstr, 16)
  except ValueError:
    raise ValueError('not a valid MAC address: {!r}'.format(bstr))
1255488
def decode_ber(ber):
    
    ber = bytearray(ber)
    length = ber[0]
    bytes_read = 1
    if length > 127:
        bytes_read += length & 127 # Strip off the high bit
        length = 0
        for i in range(1, bytes_read):
            length += ber[i] << (8 * (bytes_read - i - 1))
    return length, bytes_read
1293146
public static int decodeInt(byte[] src, int srcOffset)
        throws CorruptEncodingException
    {
        try {
            int value = (src[srcOffset] << 24) | ((src[srcOffset + 1] & 0xff) << 16) |
                ((src[srcOffset + 2] & 0xff) << 8) | (src[srcOffset + 3] & 0xff);
            return value ^ 0x80000000;
        } catch (IndexOutOfBoundsException e) {
            throw new CorruptEncodingException(null, e);
        }
    }
292329
def base64_bytes(x):
    """"""
    if six.PY2:
        return base64.decodestring(x)
    return base64.decodebytes(bytes_encode(x))
896832
def decode(binary):
    """"""
    encoded = io.BytesIO(binary)
    with gzip.GzipFile(mode='rb', fileobj=encoded) as file_:
        decoded = file_.read()
    return decoded
794870
def _decode(value):
        
        if value.isdigit():
            return int(value)
        if isinstance(value, bytes):
            return value.decode('utf-8')
        else:
            return value
803734
def encode_bu64(b):
    
    s = base64.standard_b64encode(b)
    s = s.rstrip('=')
    s = s.replace('+', '-')
    s = s.replace('/', '_')
    return s
899753
def to_bson(buffer = ByteBuffer.new, validating_keys = Config.validating_keys?)
      buffer.put_int64((to_i * 1000) + (usec / 1000))
    end
619110
def b64decode(foo, *args):
    ''
    if isinstance(foo, str):
        foo = foo.encode('utf8')
    return base64.b64decode(foo, *args)
503374
def base64(self, charset=None):
        ''''''
        return b64encode(self.bytes()).decode(charset or self.charset)
1229715
def decode_bytes(string):
    

    if is_string_type(type(string)):
        string = bytes(string, "utf-8")
    return base64.decodebytes(string)
599555
def from_raw(self, raw: RawScalar) -> Optional[bytes]:
        """"""
        try:
            return base64.b64decode(raw, validate=True)
        except TypeError:
            return None
136605
def decode_values(fct):
    '''  '''
    def inner(*args, **kwargs):
        ''' decorator '''
        data = fct(*args, **kwargs)
        if 'error' not in data:
            for result in data:
                result['Value'] = base64.b64decode(result['Value'])
        return data
    return inner
894933
public function decodeUint64()
    {
        $value = $this->decodeBytes(8);
        if ($value === null) {
            return null;
        }
        return gmp_init(bin2hex($value), 16);
    }
613757
function int64_to_bytes(num) {
        var retval = []
        for (var i = 0; i < 8; i++) {
            retval.push(num & 0xFF)
            num = num >>> 8
        }
        return retval
    }
702840
def _bytes_from_json(value, field):
    """"""
    if _not_null(value, field):
        return base64.standard_b64decode(_to_bytes(value))