Get the index of a given entry, raising an IndexError if it's not
        present.

        `key` can be an iterable of entries that is not a string, in which case
        this returns a list of indices.
8390
def index(self, key):
        
        if is_iterable(key):
            return [self.index(subkey) for subkey in key]
        return self.map[key]
515260
def GetSubkeyByIndex(self, index):
    
    subkeys = list(self._subkeys.values())

    if index < 0 or index >= len(subkeys):
      raise IndexError('Index out of bounds.')

    return subkeys[index]
283505
def get_all_for(self, key):
        
        if not isinstance(key, _string_type):
            raise TypeError("Key needs to be a string.")
        return [self[(idx, key)] for idx in _range(self.__kcount[key])]
1116052
def matching_key_for(self, key):
		
		try:
			return next(e_key for e_key in self.keys() if e_key == key)
		except StopIteration:
			raise KeyError(key)
785021
def _get_key_index(self, row):
        """"""
        # Don't bother with empty tracks
        if len(self.keys) == 0:
            return -1

        # No track values are defined yet
        if row < self.keys[0].row:
            return -1

        # Get the insertion index
        index = bisect.bisect_left(self.keys, row)
        # Index is within the array size?
        if index < len(self.keys):
            # Are we inside an interval?
            if row < self.keys[index].row:
                return index - 1
            return index

        # Return the last index
        return len(self.keys) - 1
587140
def get(self, key, default=None):
        
        try:
            return self[key]
        except KeyError:
            return default or self._default
463609
def _get_index_for_insert(self, key, instance):
        """"""
        if instance == 0:
            # Index method will return the first occurence of the key
            index = self.keys().index(key)
        else:
            occurrence = -1
            for index, k in enumerate(self.keys()):
                if k == key:
                    occurrence += 1
                    if occurrence == instance:
                        # Found the key and the correct occurence of the key
                        break

            if occurrence != instance:
                # Gone through the entire list of keys and the instance number
                # given is too high for the number of occurences of the key
                raise ValueError(
                    (
                        "Cannot insert before/after the %d "
                        "instance of the key '%s' since there are "
                        "only %d occurences of the key" % (
                            instance, key, occurrence)
                    ))
        return index
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)
1196868
def _iget(key, lookup_dict):
    
    for k, v in lookup_dict.items():
        if k.lower() == key.lower():
            return v
    return None
1130358
def _int_to_key(keys, index):
    ''
    if isinstance(index, int):
        try:
            return keys[index]
        except IndexError:
            # use KeyError rather than IndexError for compatibility
            raise KeyError('Index out of range of keys: %s' % (index,))
    return index
1221586
def key(self) -> Tuple[int, int]:
        
        return self._source.index, self._target.index
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
229024
def get(self, key, default=None):
        
        try:
            val = self[key]
        except KeyError:
            val = default
        return val
702949
def ensure_index(self, key, unique=False):
        
        return self.collection.ensure_index(key, unique=unique)
882303
def get_item(self, key):
        
        keys = list(self.keys())

        # make sure it exists
        if not key in keys:
            self.print_message("ERROR: '"+str(key)+"' not found.")
            return None

        try:
            x = eval(self.get_value(1,keys.index(key)))
            return x

        except:
            self.print_message("ERROR: '"+str(self.get_value(1,keys.index(key)))+"' cannot be evaluated.")
            return None
137130
def get_item(self, key):
        
        result = self._db.search(self._urls.key == key)
        return result[0].get('url') if result else None
1028170
def get_entry(key):
    
    if type(key) != str:
        raise TypeError("key must be str")
    if key not in _config:
        raise KeyError("Nonexistent entry '{key}'".format(key=key))
    return _config[key]