Get the position of an entry or raise :exc:`ValueError`.

        :param key: The key to be looked up.

        .. versionchanged:: 0.5
           This used to raise :exc:`IndexError`, which was inconsistent
           with the list API.
770860
def index(self, key):
        
        if isinstance(key, str):
            for idx, (item, quality) in enumerate(self):
                if self._value_matches(key, item):
                    return idx
            raise ValueError(key)
        return list.index(self, key)
590679
def check_key(data_object, key, cardinal=False):
    
    itype = (int, np.int32, np.int64)
    if not isinstance(key, itype + (slice, tuple, list, np.ndarray)):
        raise KeyError("Unknown key type {} for key {}".format(type(key), key))
    keys = data_object.index.values
    if cardinal and data_object._cardinal is not None:
        keys = data_object[data_object._cardinal[0]].unique()
    elif isinstance(key, itype) and key in keys:
        key = list(sorted(data_object.index.values[key]))
    elif isinstance(key, itype) and key < 0:
        key = list(sorted(data_object.index.values[key]))
    elif isinstance(key, itype):
        key = [key]
    elif isinstance(key, slice):
        key = list(sorted(data_object.index.values[key]))
    elif isinstance(key, (tuple, list, pd.Index)) and not np.all(k in keys for k in key):
        key = list(sorted(data_object.index.values[key]))
    return key
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)
930363
def ldContains(self, what, key):
    
    if isListKey(key):
      i = listKeyIndex(key)
      return i < len(what) and what[i] != missing_value
    else:
      return key in what and what[key] != missing_value
52669
public Integer getFirstPosition(String key) {
        int position = -1;
        String processedKey = processKey(key);

        if (this.values.containsKey(processedKey) == true) {
            position = this.order.indexOf(processedKey);
        }
        return position;
    }
65587
def get(self, key):
        
        if key in self.cache:
            self.hits += 1
            return self.cache[key]
        self.misses += 1
        return None
638210
def key_to_scan_codes(key, error_if_missing=True):
    
    if _is_number(key):
        return (key,)
    elif _is_list(key):
        return sum((key_to_scan_codes(i) for i in key), ())
    elif not _is_str(key):
        raise ValueError('Unexpected key type ' + str(type(key)) + ', value (' + repr(key) + ')')

    normalized = normalize_name(key)
    if normalized in sided_modifiers:
        left_scan_codes = key_to_scan_codes('left ' + normalized, False)
        right_scan_codes = key_to_scan_codes('right ' + normalized, False)
        return left_scan_codes + tuple(c for c in right_scan_codes if c not in left_scan_codes)

    try:
        # Put items in ordered dict to remove duplicates.
        t = tuple(_collections.OrderedDict((scan_code, True) for scan_code, modifier in _os_keyboard.map_name(normalized)))
        e = None
    except (KeyError, ValueError) as exception:
        t = ()
        e = exception

    if not t and error_if_missing:
        raise ValueError('Key {} is not mapped to any known key.'.format(repr(key)), e)
    else:
        return t
636904
def get_value(self, series, key):
        

        # if we have something that is Index-like, then
        # use this, e.g. DatetimeIndex
        # Things like `Series._get_value` (via .at) pass the EA directly here.
        s = getattr(series, '_values', series)
        if isinstance(s, (ExtensionArray, Index)) and is_scalar(key):
            # GH 20882, 21257
            # Unify Index and ExtensionArray treatment
            # First try to convert the key to a location
            # If that fails, raise a KeyError if an integer
            # index, otherwise, see if key is an integer, and
            # try that
            try:
                iloc = self.get_loc(key)
                return s[iloc]
            except KeyError:
                if (len(self) > 0 and
                        (self.holds_integer() or self.is_boolean())):
                    raise
                elif is_integer(key):
                    return s[key]

        s = com.values_from_object(series)
        k = com.values_from_object(key)

        k = self._convert_scalar_indexer(k, kind='getitem')
        try:
            return self._engine.get_value(s, k,
                                          tz=getattr(series.dtype, 'tz', None))
        except KeyError as e1:
            if len(self) > 0 and (self.holds_integer() or self.is_boolean()):
                raise

            try:
                return libindex.get_value_box(s, key)
            except IndexError:
                raise
            except TypeError:
                # generator/iterator-like
                if is_iterator(key):
                    raise InvalidIndexError(key)
                else:
                    raise e1
            except Exception:  # pragma: no cover
                raise e1
        except TypeError:
            # python 3
            if is_scalar(key):  # pragma: no cover
                raise IndexError(key)
            raise InvalidIndexError(key)
137085
def get(self, key, default=None):
        
        try:
            val = self
            if "." not in key:
                return self[key]
            for k in key.split('.'):
                if k.isdigit():
                    k = int(k)
                val = val[k]
            return val
        except (TypeError, KeyError, IndexError) as e:
            return default
650508
def _handle_status(self, key, value):
        
        if key in ("DELETE_PROBLEM", "KEY_CONSIDERED"):
            self.status = self.problem_reason.get(value, "Unknown error: %r"
                                                  % value)
        else:
            raise ValueError("Unknown status message: %r" % key)
493842
def get_storer(self, key):
        
        group = self.get_node(key)
        if group is None:
            raise KeyError('No object named {key} in the file'.format(key=key))

        s = self._create_storer(group)
        s.infer_axes()
        return s
180425
def _convert_key(self, key, is_setter=False):
        

        # allow arbitrary setting
        if is_setter:
            return list(key)

        for ax, i in zip(self.obj.axes, key):
            if ax.is_integer():
                if not is_integer(i):
                    raise ValueError("At based indexing on an integer index "
                                     "can only have integer indexers")
            else:
                if is_integer(i) and not ax.holds_integer():
                    raise ValueError("At based indexing on an non-integer "
                                     "index can only have non-integer "
                                     "indexers")
        return key
446609
def getKey(self, key):
		
		data = self.getDictionary()
		if key in data:
			return data[key]
		else:
			return None
1058676
def get(self, key):
        
        self.inspect_if_not_inspected()

        def get_value(dictionary, key):
            return (dictionary or {}).get(key)

        return reduce(get_value, key.split('.'), self.dictionary)
1219639
def handle_key(self, key):
        
        try:
            func = None
            if key.is_sequence:
                try:
                    func = self.config.keymap[key.name]
                except:
                    try:
                        func = self.config.keymap[key.code]
                    except:
                        func = self.config.keymap[str(key)]
            else:
                func = self.config.keymap[str(key)]

            if func in self.valid_key_funcs:
                getattr(self, func)()
        except:
            raise
927078
def get(self, key, key_length=0):
        
        if key_length < 1:
            key_length = len(key)
        return self.get_method(self, key, key_length)
52023
def get(self, key, default=None):
        '''
        
        '''
        valu = self.data.get(key, default)
        if key in self.data:
            self.data.move_to_end(key)
        return valu