Gets the first key from given value.

        :param value: Value.
        :type value: object
        :return: Key.
        :rtype: object
15103
def get_first_key_from_value(self, value):
        

        for key, data in self.iteritems():
            if data == value:
                return key
232634
def key_on(self, value):
        
        if isinstance(value, BASESTRING):
            value = (value,)
        self._key_on = value
1060402
def get(self, key, *val):
        
        data = self.get_data()
        if data is not None:
            return data.get(key, *val)
        if val:
            return val[0]
        raise KeyError(key)
334149
def parse(self, key, value):
        
        if value is not None:
            try:
                return self._parser(value)
            except Exception:
                raise ParsingError("Error parsing {}".format(key))
        elif self._default is not SENTINAL:
            return self._default
        else:
            raise KeyError(key)
463916
def from_value(cls, value: str) -> T:
        
        return [x for x in cls.__members__.values() if x.value[0] == value][0]
1269476
def setKey(self, key, value):
		
		data = self.getDictionary()
		data[key] = value
		self.setDictionary(data)
172121
def _handle_key_value(t_dict, key, value):
    
    if key in t_dict:
        val = t_dict[key]
        if isinstance(val, str):
            val = [val]
        val.append(value)
        return val
    return value
331990
def get_first_defined(data, keys, default_value=None):
    
    for key in keys:
        if key in data:
            return data[key]
    return default_value
703800
def get(expr, key, default=None):
    
    return ops.MapValueOrDefaultForKey(expr, key, default).to_expr()
112827
def first_value_of(self, name, default_value = None):
        
        vals = self.values_of(name)
        if vals is not None:
            return vals if type(vals) is not list else vals[0]
        return default_value
826031
def get_value(cls, value):
        ''''''
        if isinstance(value, (basestring, int)):
            value = cls.fetch_by(id=value)
        return value if isinstance(value, cls) else None
962258
def key(value)
      if self.map? && @data.has_value?(value)
        @data.invert[value]
      elsif (self.map?  && @data.has_key?(value)) ||
            (self.list? && @data.include?(value))
        value
      else
        nil
      end
    end
362253
def get_formatted_value(self, value):
        

        def get_formatter(parser_desc):
            try:
                return parser_desc['formatter']
            except TypeError:
                if isinstance(parser_desc, str):
                    try:
                        return get_formatter(self.date_parsers[parser_desc])
                    except KeyError:
                        return parser_desc
                else:
                    pass
            except KeyError:
                try:
                    if isinstance(parser_desc['parser'], str):
                        return parser_desc['parser']
                except KeyError:
                    pass

        formatter = get_formatter(self.parse_format)

        if formatter is None:
            return str(value)

        if callable(formatter):
            return formatter(value)

        return value.strftime(format=formatter)
1371312
def clean(self, value):
		

		# If the value is None and it's optional, return as is
		if value is None and self._optional:
			return None

		# If the value is not a dict
		if not isinstance(value, dict):
			raise ValueError('value')

		# Recurse and return it
		return {str(self._key.clean(k)):self._node.clean(v) for k,v in iteritems(value)}
296736
public LiteralMap selectFirst(String key, Object value) {
		for (LiteralMap lm : this) {
			if (isEqual(value, lm.get(key)))
				return lm;
		}
		return null;
	}
744685
def get(self, key):
        

        match = self._get_match(key=key)

        if not match:
            return None

        return self._get_value_from_match(key=key, match=match)
1188904
def retrieve(self, value):  # type: (Any) -> Any
        """"""
        if isinstance(value, string_types):
            for key, this_value in self.secrets.items():
                value = value.replace(key, this_value)
        elif isinstance(value, MutableMapping):
            return {k: self.retrieve(v) for k, v in value.items()}
        elif isinstance(value, MutableSequence):
            return [self.retrieve(v) for k, v in enumerate(value)]
        return value