internal type decode
186141
private static Class<?> decodeType0(
            String className,
            JodaBeanSer settings,
            String basePackage,
            Map<String, Class<?>> knownTypes,
            Class<?> defaultType) throws ClassNotFoundException {

        // basic type
        Class<?> result = BASIC_TYPES_REVERSED.get(className);
        if (result != null) {
            return result;
        }
        // check cache
        if (knownTypes != null) {
            result = knownTypes.get(className);
            if (result != null) {
                return result;
            }
        }
        // calculate
        String fullName = className;
        boolean expanded = false;
        if (basePackage != null && className.length() > 0 && Character.isUpperCase(className.charAt(0))) {
            fullName = basePackage + className;
            expanded = true;
        }
        try {
            result = RenameHandler.INSTANCE.lookupType(fullName);
            if (knownTypes != null) {
                // cache full name
                knownTypes.put(fullName, result);
                if (expanded) {
                    // cache short name
                    knownTypes.put(className, result);
                } else {
                    // derive and cache short name
                    String simpleName = result.getSimpleName();
                    // handle renames
                    if (fullName.equals(result.getName()) == false &&
                            RenameHandler.INSTANCE.getTypeRenames().containsKey(fullName) &&
                            result.getEnclosingClass() == null) {
                        simpleName = fullName.substring(fullName.lastIndexOf(".") + 1);
                    }
                    if (Character.isUpperCase(simpleName.charAt(0)) &&
                            BASIC_TYPES_REVERSED.containsKey(simpleName) == false &&
                            knownTypes.containsKey(simpleName) == false) {
                        knownTypes.put(simpleName, result);
                    }
                }
            }
            return result;
        } catch (ClassNotFoundException ex) {
            // handle pathological case of package name starting with upper case
            if (fullName.equals(className) == false) {
                try {
                    result = RenameHandler.INSTANCE.lookupType(className);
                    if (knownTypes != null) {
                        knownTypes.put(className, result);
                    }
                    return result;
                } catch (ClassNotFoundException ignored) {
                }
            }
            if (defaultType == null) {
                throw ex;
            }
            return defaultType;
        }
    }
1028141
def decode_union(self, data_type, obj):
        
        val = None
        if isinstance(obj, six.string_types):
            # Handles the shorthand format where the union is serialized as only
            # the string of the tag.
            tag = obj
            if data_type.definition._is_tag_present(tag, self.caller_permissions):
                val_data_type = data_type.definition._get_val_data_type(
                    tag, self.caller_permissions)
                if not isinstance(val_data_type, (bv.Void, bv.Nullable)):
                    raise bv.ValidationError(
                        "expected object for '%s', got symbol" % tag)
                if tag == data_type.definition._catch_all:
                    raise bv.ValidationError(
                        "unexpected use of the catch-all tag '%s'" % tag)
            elif not self.strict and data_type.definition._catch_all:
                tag = data_type.definition._catch_all
            else:
                raise bv.ValidationError("unknown tag '%s'" % tag)
        elif isinstance(obj, dict):
            tag, val = self.decode_union_dict(
                data_type, obj)
        else:
            raise bv.ValidationError("expected string or object, got %s" %
                                     bv.generic_type_name(obj))
        return data_type.definition(tag, val)
966525
function decode(str) {
  const [hrp, data] = deserialize(str);

  if (data.length === 0 || data.length > 65)
    throw new Error('Invalid bech32 data length.');

  if (data[0] > 16)
    throw new Error('Invalid bech32 version.');

  const version = data[0];
  const output = data;
  const hash = convert(data, output, 5, 8, -1, 1);

  if (hash.length < 2 || hash.length > 40)
    throw new Error('Invalid bech32 data length.');

  return new AddrResult(hrp, version, hash);
}
1306488
def _decode(self, obj, context):
        
        return b''.join(map(int2byte, [c + 0x60 for c in bytearray(obj)])).decode("utf8")
767994
def decode(cls, s):
        
        b = ByteString(s)
        bd = base64.b64decode(b)
        return String(bd)
395871
public VALUEFROM decodeFromRaw(Object o) {
        if (o == null && !isOptional()) return null;
        return decodeFromRawInternal(o);
    }
804275
protected final void decodeAttributeXsiNilStructure() throws EXIException,
			IOException {
		attributeQNameContext = getXsiNilContext();
		// handle AT prefix
		handleAttributePrefix(attributeQNameContext);

		if (preserveLexicalValues) {
			// as String
			attributeValue = typeDecoder.readValue(booleanDatatype,
					getXsiNilContext(), channel, stringDecoder);
		} else {
			// as Boolean
			attributeValue = channel.decodeBooleanValue();
			// attributeValue = booleanDatatype.readValue(null, channel,
			// stringDecoder);
		}

		boolean xsiNil = false;

		if (attributeValue instanceof BooleanValue) {
			BooleanValue bv = (BooleanValue) attributeValue;
			xsiNil = bv.toBoolean();
		} else {
			// parse string value again (lexical value mode)
			if (attributeValue instanceof BooleanValue) {
				xsiNil = ((BooleanValue) attributeValue).toBoolean();
			} else {
				BooleanValue bv = BooleanValue.parse(attributeValue.toString());
				if (bv != null) {
					xsiNil = bv.toBoolean();
				}
			}
			// booleanDatatype.isValid(attributeValue);
			// xsiNil = booleanDatatype.getBoolean();
		}

		final Grammar currentGrammar = getCurrentGrammar();
		if (xsiNil && currentGrammar.isSchemaInformed()) {
			// jump to typeEmpty
			updateCurrentRule(((SchemaInformedFirstStartTagGrammar) currentGrammar)
					.getTypeEmpty());
		}
	}
583233
private function decodeInteger()
    {
        $offsetOfE = strpos($this->source, "e", $this->offset);
        if (false === $offsetOfE) {
            throw new RuntimeException("Unterminated integer entity at offset $this->offset");
        }

        $currentOffset = $this->offset;
        if ("-" == $this->getChar($currentOffset)) {
            ++$currentOffset;
        }

        if ($offsetOfE === $currentOffset) {
            throw new RuntimeException("Empty integer entity at offset $this->offset");
        }

        while ($currentOffset < $offsetOfE) {
            if (!ctype_digit($this->getChar($currentOffset))) {
                throw new RuntimeException("Non-numeric character found in integer entity at offset $this->offset");
            }
            ++$currentOffset;
        }

        $value = substr($this->source, $this->offset, $offsetOfE - $this->offset);

        // One last check to make sure zero-padded integers don't slip by, as
        // they're not allowed per bencode specification.
        $absoluteValue = (string) abs($value);
        if (1 < strlen($absoluteValue) && "0" == $value[0]) {
            throw new RuntimeException("Illegal zero-padding found in integer entity at offset $this->offset");
        }

        $this->offset = $offsetOfE + 1;

        // The +0 auto-casts the chunk to either an integer or a float(in cases
        // where an integer would overrun the max limits of integer types)
        return $value + 0;
    }
672202
def decode_return(codec="ascii"):
    """"""

    def outer(f):
        def wrap(*args, **kwargs):
            res = f(*args, **kwargs)
            if res is not None:
                return res.decode(codec)
            return res
        return wrap
    return outer
670974
private static byte[] decodeInternal(byte[] data)
    {
        int tail = data.length;
        while (data[tail-1] == '=')  tail--;
        byte dest[] = new byte[tail - data.length/4];

        // ascii printable to 0-63 conversion
        for (int idx = 0; idx <data.length; idx++)
        {
            if (data[idx] == '=')    data[idx] = 0;
            else if (data[idx] == '/') data[idx] = 63;
            else if (data[idx] == '+') data[idx] = 62;
            else if (data[idx] >= '0'  &&  data[idx] <= '9')
                data[idx] = (byte)(data[idx] - ('0' - 52));
            else if (data[idx] >= 'a'  &&  data[idx] <= 'z')
                data[idx] = (byte)(data[idx] - ('a' - 26));
            else if (data[idx] >= 'A'  &&  data[idx] <= 'Z')
                data[idx] = (byte)(data[idx] - 'A');
        }

        // 4-byte to 3-byte conversion
        int sidx, didx;
        for (sidx = 0, didx=0; didx < dest.length-2; sidx += 4, didx += 3)
        {
            dest[didx]   = (byte) ( ((data[sidx] << 2) & 255) |
                    ((data[sidx+1] >>> 4) & 3) );
            dest[didx+1] = (byte) ( ((data[sidx+1] << 4) & 255) |
                    ((data[sidx+2] >>> 2) & 017) );
            dest[didx+2] = (byte) ( ((data[sidx+2] << 6) & 255) |
                    (data[sidx+3] & 077) );
        }
        if (didx < dest.length)
        {
            dest[didx]   = (byte) ( ((data[sidx] << 2) & 255) |
                    ((data[sidx+1] >>> 4) & 3) );
        }
        if (++didx < dest.length)
        {
            dest[didx]   = (byte) ( ((data[sidx+1] << 4) & 255) |
                    ((data[sidx+2] >>> 2) & 017) );
        }
        return dest;
    }
346841
def decode(self, s, _w=WHITESPACE.match):
        
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
        end = _w(s, end).end()
        if end != len(s):
            raise JSONDecodeError("Extra data", s, end, len(s))
        return obj
279659
def decode_event_to_internal(abi, log_event):
    
    # Note: All addresses inside the event_data must be decoded.

    decoded_event = decode_event(abi, log_event)

    if not decoded_event:
        raise UnknownEventType()

    # copy the attribute dict because that data structure is immutable
    data = dict(decoded_event)
    args = dict(data['args'])

    data['args'] = args
    # translate from web3's to raiden's name convention
    data['block_number'] = log_event.pop('blockNumber')
    data['transaction_hash'] = log_event.pop('transactionHash')
    data['block_hash'] = bytes(log_event.pop('blockHash'))

    assert data['block_number'], 'The event must have the block_number'
    assert data['transaction_hash'], 'The event must have the transaction hash field'

    event = data['event']
    if event == EVENT_TOKEN_NETWORK_CREATED:
        args['token_network_address'] = to_canonical_address(args['token_network_address'])
        args['token_address'] = to_canonical_address(args['token_address'])

    elif event == ChannelEvent.OPENED:
        args['participant1'] = to_canonical_address(args['participant1'])
        args['participant2'] = to_canonical_address(args['participant2'])

    elif event == ChannelEvent.DEPOSIT:
        args['participant'] = to_canonical_address(args['participant'])

    elif event == ChannelEvent.BALANCE_PROOF_UPDATED:
        args['closing_participant'] = to_canonical_address(args['closing_participant'])

    elif event == ChannelEvent.CLOSED:
        args['closing_participant'] = to_canonical_address(args['closing_participant'])

    elif event == ChannelEvent.UNLOCKED:
        args['participant'] = to_canonical_address(args['participant'])
        args['partner'] = to_canonical_address(args['partner'])

    return Event(
        originating_contract=to_canonical_address(log_event['address']),
        event_data=data,
    )
139913
def decode_ay(ay):
    """"""
    if ay is None:
        return ''
    elif isinstance(ay, str):
        return ay
    elif isinstance(ay, bytes):
        return ay.decode('utf-8')
    else:
        # dbus.Array([dbus.Byte]) or any similar sequence type:
        return bytearray(ay).rstrip(bytearray((0,))).decode('utf-8')
899076
function decode(base32String) {
	// Decode to Buffer
	var bytes = base32.parse(base32String, {
		out: Buffer.alloc,
		loose: true
	});

	return bytes.toString("hex");
}
1254176
private static boolean isReturnTypeDecodable(HttpResponseDecodeData decodeData) {
        Type returnType = decodeData.returnType();
        if (returnType == null) {
            return false;
        } else {
            return !FluxUtil.isFluxByteBuf(returnType)
                    && !(TypeUtil.isTypeOrSubTypeOf(returnType, Mono.class) && TypeUtil.isTypeOrSubTypeOf(TypeUtil.getTypeArgument(returnType), Void.class))
                    && !TypeUtil.isTypeOrSubTypeOf(returnType, byte[].class)
                    && !TypeUtil.isTypeOrSubTypeOf(returnType, Void.TYPE) && !TypeUtil.isTypeOrSubTypeOf(returnType, Void.class);
        }
    }
610584
def json_compat_obj_decode_helper(self, data_type, obj):
        
        if isinstance(data_type, bv.StructTree):
            return self.decode_struct_tree(data_type, obj)
        elif isinstance(data_type, bv.Struct):
            return self.decode_struct(data_type, obj)
        elif isinstance(data_type, bv.Union):
            if self.old_style:
                return self.decode_union_old(data_type, obj)
            else:
                return self.decode_union(data_type, obj)
        elif isinstance(data_type, bv.List):
            return self.decode_list(
                data_type, obj)
        elif isinstance(data_type, bv.Map):
            return self.decode_map(
                data_type, obj)
        elif isinstance(data_type, bv.Nullable):
            return self.decode_nullable(
                data_type, obj)
        elif isinstance(data_type, bv.Primitive):
            # Set validate to false because validation will be done by the
            # containing struct or union when the field is assigned.
            return self.make_stone_friendly(data_type, obj, False)
        else:
            raise AssertionError('Cannot handle type %r.' % data_type)
631629
function decodeDeltaArrayInt( bundle, database, len, num_type ) {
	var fromType = NUMTYPE_DELTA_INT.FROM[ num_type ],
		ans = new NUMTYPE_CLASS[ fromType ]( len ), v=0;

	// readTypedNum(fromType)
	switch (fromType) {
		case 0: v = bundle.u8[bundle.i8++]; break;
		case 1: v = bundle.s8[bundle.i8++]; break;
		case 2: v = bundle.u16[bundle.i16++]; break;
		case 3: v = bundle.s16[bundle.i16++]; break;
		case 4: v = bundle.u32[bundle.i32++]; break;
		case 5: v = bundle.s32[bundle.i32++]; break;
		case 6: v = bundle.f32[bundle.i32++]; break;
		case 7: v = bundle.f64[bundle.i64++]; break;
	}

	var values = bundle.readTypedArray( NUMTYPE_DELTA_INT.TO[ num_type ] , len - 1 );

	// Decode array
	ans[0] = v;
	for (var i=0, llen=values.length; i<llen; ++i) {
		v += values[i];
		ans[i+1] = v;
	}

	// Return
	return DEBUG
		? __debugMeta( ans, 'array.delta.int', {} )
		: ans;
}