A key transformer that returns the last RestAPI key.

    :param str key: The attribute name
    :param dict attr_desc: The attribute metadata
    :param object value: The value
    :returns: The last RestAPI key.
332162
def last_restapi_key_transformer(key, attr_desc, value):
    
    key, value = full_restapi_key_transformer(key, attr_desc, value)
    return (key[-1], value)
1057336
def get_attr(obj, string_rep, default=_get_attr_raise_on_attribute_error, separator="."):
    
    attribute_chain = string_rep.split(separator)

    current_obj = obj

    for attr in attribute_chain:
        try:
            current_obj = getattr(current_obj, attr)
        except AttributeError:
            if default is _get_attr_raise_on_attribute_error:
                raise AttributeError(
                    "Bad attribute \"{}\" in chain: \"{}\"".format(attr, string_rep)
                )
            return default

    return current_obj
896674
def get_last(self, type_, key):
        
        self._check_type(type_)
        with self._lock:
            return self._config[type_]['last'][key]
30898
def value_attr(attr_name):
    

    def value_attr(value, context, **_params):
        value = getattr(value, attr_name)
        return _attr(value)

    return value_attr
387963
def get_attr(item, name, default=None):
    '''  '''
    try:
        val = item[name]
    except (KeyError, TypeError):
        try:
            val = getattr(item, name)
        except AttributeError:
            val = default
    return val
248841
def getattr(self, key):
		
		if ((key == "classId") and (self.__dict__.has_key(key))):
			return self.__dict__[key]

		if UcsUtils.FindClassIdInMoMetaIgnoreCase(self.classId):
			if self.__dict__.has_key(key):
				if key in _ManagedObjectMeta[self.classId]:
					""" property exists """
					return self.__dict__[key]
			else:
				if self.__dict__.has_key('XtraProperty'):
					if self.__dict__['XtraProperty'].has_key(key):
						return self.__dict__['XtraProperty'][UcsUtils.WordU(key)]
					else:
						raise AttributeError(key)
				else:
					# TODO: Add Warning/Error messages in Logger.
					print "No XtraProperty in mo:", self.classId, " key:", key
		else:
			""" property does not exist """
			if self.__dict__['XtraProperty'].has_key(key):
				return self.__dict__['XtraProperty'][UcsUtils.WordU(key)]
			elif key == "Dn" or key == "Rn":
				return None
			else:
				raise AttributeError(key)
875499
def attrs(self, dynamizer):
        
        ret = {
            self.key: {
                'Action': self.action,
            }
        }
        if not is_null(self.value):
            ret[self.key]['Value'] = dynamizer.encode(self.value)
        return ret
459624
def _index_key_for(self, att, value=None):
        
        if value is None:
            value = getattr(self, att)
            if callable(value):
                value = value()
        if value is None:
            return None
        if att not in self.lists:
            return self._get_index_key_for_non_list_attr(att, value)
        else:
            return self._tuple_for_index_key_attr_list(att, value)
464826
def get_attribute(instance, attrs):
    
    for attr in attrs:
        if instance is None:
            # Break out early if we get `None` at any point in a nested lookup.
            return None
        try:
            if isinstance(instance, collections.Mapping):
                instance = instance[attr]
            else:
                instance = getattr(instance, attr)
        except ObjectDoesNotExist:
            return None
        if is_simple_callable(instance):
            try:
                instance = instance()
            except (AttributeError, KeyError) as exc:
                # If we raised an Attribute or KeyError here it'd get treated
                # as an omitted field in `Field.get_attribute()`. Instead we
                # raise a ValueError to ensure the exception is not masked.
                raise ValueError('Exception raised in callable attribute "{0}"; original exception was: {1}'.format(attr, exc))

    return instance
1008136
function(attr, value, keepKey) {
                    // Convert `attr` to attr parts (if it isn't already).
                    var parts = can.Map.helpers.attrParts(attr, keepKey),
                        // The immediate prop we are setting.
                        prop = parts.shift(),
                        // We only need to get the current value if we are not in init.
                        current = this._init ? undefined : this.__get(prop);

                    if (parts.length && Map.helpers.isObservable(current)) {
                        // If we have an `object` and remaining parts that `object` should set it.
                        current._set(parts, value);
                    } else if (!parts.length) {
                        // We're in "real" set territory.
                        if (this.__convert) {
                            //Convert if there is a converter
                            value = this.__convert(prop, value);
                        }
                        this.__set(prop, this.__type(value, prop), current);
                    } else {
                        throw "can.Map: Object does not exist";
                    }
                }
1040117
def hstrlen(self, name, key):
        
        with self.pipe as pipe:
            return pipe.hstrlen(self.redis_key(name), key)
1315201
def get(self, key):
        
        warnings.warn(
            'The settings.get(key) is superseded by the dot attribute access.',
            PendingDeprecationWarning
        )
        try:
            return getattr(self, key)
        except AttributeError:
            raise ImproperlyConfigured('Missing settings: {}[\'{}\']'.format(
                DJOSER_SETTINGS_NAMESPACE, key)
            )
1323482
def lastKey(self, key):
        """"""
        update = self._updateList(key)[0]
        return (update[0].key
                if update
                else None)
1121112
def get_dataset_key(self, key, **kwargs):
        
        return get_key(key, self.ids.keys(), **kwargs)
1255215
def deserialize_attribute(serialized_attribute):  # noqa: C901 pylint: disable=too-many-locals
    # type: (bytes) -> dynamodb_types.RAW_ATTRIBUTE
    

    def _transform_binary_value(value):
        # (bytes) -> bytes
        """Transforms a serialized binary value.

        :param bytes value: Raw deserialized value
        :rtype: bytes
        """
        if isinstance(value, Binary):
            return value.value
        return value

    def _deserialize_binary(stream):
        # type: (io.BytesIO) -> Dict[Text, bytes]
        """Deserializes a binary object.

        :param stream: Stream containing serialized object
        :type stream: io.BytesIO
        :rtype: dict
        """
        value = decode_value(stream)
        return {Tag.BINARY.dynamodb_tag: _transform_binary_value(value)}

    def _transform_string_value(value):
        # (bytes) -> dynamodb_types.STRING
        """Transforms a serialized string value.

        :param bytes value: Raw deserialized value
        :rtype: dynamodb_encryption_sdk.internal.dynamodb_types.STRING
        """
        return codecs.decode(value, TEXT_ENCODING)

    def _deserialize_string(stream):
        # type: (io.BytesIO) -> Dict[Text, dynamodb_types.STRING]
        """Deserializes a string object.

        :param stream: Stream containing serialized object
        :type stream: io.BytesIO
        :rtype: dict
        """
        value = decode_value(stream)
        return {Tag.STRING.dynamodb_tag: _transform_string_value(value)}

    def _transform_number_value(value):
        # (bytes) -> dynamodb_types.STRING
        """Transforms a serialized number value.

        :param bytes value: Raw deserialized value
        :rtype: dynamodb_encryption_sdk.internal.dynamodb_types.STRING
        """
        raw_value = codecs.decode(value, TEXT_ENCODING)
        decimal_value = Decimal(to_str(raw_value)).normalize()
        return "{0:f}".format(decimal_value)

    def _deserialize_number(stream):
        # type: (io.BytesIO) -> Dict[Text, dynamodb_types.STRING]
        """Deserializes a number object.

        :param stream: Stream containing serialized object
        :type stream: io.BytesIO
        :rtype: dict
        """
        value = decode_value(stream)
        return {Tag.NUMBER.dynamodb_tag: _transform_number_value(value)}

    _boolean_map = {TagValues.FALSE.value: False, TagValues.TRUE.value: True}

    def _deserialize_boolean(stream):
        # type: (io.BytesIO) -> Dict[Text, dynamodb_types.BOOLEAN]
        """Deserializes a boolean object.

        :param stream: Stream containing serialized object
        :type stream: io.BytesIO
        :rtype: dict
        """
        value = decode_byte(stream)
        return {Tag.BOOLEAN.dynamodb_tag: _boolean_map[value]}

    def _deserialize_null(stream):  # we want a consistent API but don't use stream, so pylint: disable=unused-argument
        # type: (io.BytesIO) -> Dict[Text, dynamodb_types.BOOLEAN]
        """Deserializes a null object.

        :param stream: Stream containing serialized object
        :type stream: io.BytesIO
        :rtype: dict
        """
        return {Tag.NULL.dynamodb_tag: True}

    def _deserialize_set(stream, member_transform):
        # type: (io.BytesIO, Callable) -> List[Union[dynamodb_types.BINARY, dynamodb_types.STRING]]
        """Deserializes contents of serialized set.

        :param stream: Stream containing serialized object
        :type stream: io.BytesIO
        :rtype: list
        """
        member_count = decode_length(stream)
        return sorted([member_transform(decode_value(stream)) for _ in range(member_count)])

    def _deserialize_binary_set(stream):
        # type: (io.BytesIO) -> Dict[Text, dynamodb_types.SET[dynamodb_types.BINARY]]
        """Deserializes a binary set object.

        :param stream: Stream containing serialized object
        :type stream: io.BytesIO
        :rtype: dict
        """
        return {Tag.BINARY_SET.dynamodb_tag: _deserialize_set(stream, _transform_binary_value)}

    def _deserialize_string_set(stream):
        # type: (io.BytesIO) -> Dict[Text, dynamodb_types.SET[dynamodb_types.STRING]]
        """Deserializes a string set object.

        :param stream: Stream containing serialized object
        :type stream: io.BytesIO
        :rtype: dict
        """
        return {Tag.STRING_SET.dynamodb_tag: _deserialize_set(stream, _transform_string_value)}

    def _deserialize_number_set(stream):
        # type: (io.BytesIO) -> Dict[Text, dynamodb_types.SET[dynamodb_types.STRING]]
        """Deserializes a number set object.

        :param stream: Stream containing serialized object
        :type stream: io.BytesIO
        :rtype: dict
        """
        return {Tag.NUMBER_SET.dynamodb_tag: _deserialize_set(stream, _transform_number_value)}

    def _deserialize_list(stream):
        # type: (io.BytesIO) -> Dict[Text, dynamodb_types.LIST]
        """Deserializes a list object.

        :param stream: Stream containing serialized object
        :type stream: io.BytesIO
        :rtype: dict
        """
        member_count = decode_length(stream)
        return {Tag.LIST.dynamodb_tag: [_deserialize(stream) for _ in range(member_count)]}

    def _deserialize_map(stream):
        # type: (io.BytesIO) -> Dict[Text, dynamodb_types.MAP]
        """Deserializes a map object.

        :param stream: Stream containing serialized object
        :type stream: io.BytesIO
        :rtype: dict
        """
        member_count = decode_length(stream)
        members = {}  # type: dynamodb_types.MAP
        for _ in range(member_count):
            key = _deserialize(stream)
            if Tag.STRING.dynamodb_tag not in key:
                raise DeserializationError(
                    'Malformed serialized map: found "{}" as map key.'.format(list(key.keys())[0])
                )

            value = _deserialize(stream)
            members[key[Tag.STRING.dynamodb_tag]] = value

        return {Tag.MAP.dynamodb_tag: members}

    def _deserialize_function(tag):
        # type: (bytes) -> Callable
        """Identifies the correct deserialization function based on the provided tag.

        :param tag: Identifying tag, read from start of serialized object
        :type tag: dynamodb_encryption_sdk.internal.identifiers.Tag
        :rtype: callable
        """
        deserialize_functions = {
            Tag.BINARY.tag: _deserialize_binary,
            Tag.BINARY_SET.tag: _deserialize_binary_set,
            Tag.NUMBER.tag: _deserialize_number,
            Tag.NUMBER_SET.tag: _deserialize_number_set,
            Tag.STRING.tag: _deserialize_string,
            Tag.STRING_SET.tag: _deserialize_string_set,
            Tag.BOOLEAN.tag: _deserialize_boolean,
            Tag.NULL.tag: _deserialize_null,
            Tag.LIST.tag: _deserialize_list,
            Tag.MAP.tag: _deserialize_map,
        }
        try:
            return deserialize_functions[tag]
        except KeyError:
            raise DeserializationError('Unsupported tag: "{}"'.format(tag))

    def _deserialize(stream):
        # type: (io.BytesIO) -> Dict[Text, dynamodb_types.RAW_ATTRIBUTE]
        """Deserializes a serialized object.

        :param stream: Stream containing serialized object
        :type stream: io.BytesIO
        :rtype: dict
        """
        try:
            tag = decode_tag(stream)
            return _deserialize_function(tag)(stream)
        except struct.error:
            raise DeserializationError("Malformed serialized data")

    if not serialized_attribute:
        raise DeserializationError("Empty serialized attribute data")

    stream = io.BytesIO(serialized_attribute)
    return _deserialize(stream)
688037
private Map<String, AttributeValue> getLastExaminedKey(boolean removeHashKey) {
        Map<String, AttributeValue> generatedKey = new HashMap<String, AttributeValue>(getKeyFields().size());

        if (!dynamoDBIterator.hasNext0()) {
            return null;
        }

        for (String keyField : getKeyFields()) {
            if (removeHashKey && keyField.equals(getHashKeyField())) {
                continue;
            }

            generatedKey.put(keyField, dynamoDBIterator.getLastItem().get(keyField));
        }

        return generatedKey;
    }
1205662
def key(self, key=""):
    
    params = join_params(self.parameters, {"key": key})

    return self.__class__(**params)