Returns value in mapping corresponding to matching searchVal key.
485359
function getNextVal(searchVal, mapping) {
  let value
  if (isMap(mapping)) {
    for (let [key, val] of mapping.entries()) {
      if (deepEqual(key, searchVal)) {
        value = val
        break
      }
    }
  } else {
    value = (mapping.find(keyVal => deepEqual(keyVal[0], searchVal)) || [])[1]
  }

  if (typeof value === 'function') {
    return value()
  }
  return value
}
908897
public V get(String key)
    {
        int index = exactMatchSearch(key);
        if (index >= 0)
        {
            return getValueAt(index);
        }

        return null;
    }
443040
def get_values_of_matching_keys(pattern_dict, user_name):
    '''
    
    '''
    ret = []
    for expr in pattern_dict:
        if salt.utils.stringutils.expr_match(user_name, expr):
            ret.extend(pattern_dict[expr])
    return ret
815447
def get_item_by_key(passed_list, key, value):
    '''
    
    '''

    if value in [None, '']:
        return

    if type(passed_list) in [QuerySet, PolymorphicQuerySet]:
        sub_list = passed_list.filter(**{key: value})
    else:
        sub_list = [x for x in passed_list if x.get(key) == value]

    if len(sub_list) == 1:
        return sub_list[0]
    return sub_list
1085516
public String getValueForDisplayValue(final String key) {
        if (mapDisplayValuesToValues.containsKey(key)) {
            return mapDisplayValuesToValues.get(key);
        }
        return key;
    }
67303
def _get_match(self, key):
        

        return self._get_string_match(key=key) or \
            self._get_non_string_match(key=key)
1125115
def _get_key_value(self, event, event_type):
        """"""
        if event_type == 10:
            value = 1
        elif event_type == 11:
            value = 0
        elif event_type == 12:
            value = self._get_flag_value(event)
        else:
            value = -1
        return value
590465
def _regexSearchKeyValueCombo(policy_data, policy_regpath, policy_regkey):
    '''
    
    '''
    if policy_data:
        specialValueRegex = salt.utils.stringutils.to_bytes(r'(\*\*Del\.|\*\*DelVals\.){0,1}')
        _thisSearch = b''.join([salt.utils.stringutils.to_bytes(r'\['),
                               re.escape(policy_regpath),
                               b'\00;',
                               specialValueRegex,
                               re.escape(policy_regkey),
                               b'\00;'])
        match = re.search(_thisSearch, policy_data, re.IGNORECASE)
        if match:
            # add 2 so we get the ']' and the \00
            # to return the full policy entry
            return policy_data[match.start():(policy_data.index(b']', match.end())) + 2]

    return None
618360
def getin(m, path, default=None):
    """"""
    keynotfound = ':com.gooey-project/not-found'
    result = reduce(lambda acc, val: acc.get(val, {keynotfound: None}), path, m)
    # falsey values like 0 would incorrectly trigger the default to be returned
    # so the keynotfound val is used to signify a miss vs just a falesy val
    if isinstance(result, dict) and keynotfound in result:
        return default
    return result
323788
def add_query(self, key_val={}):
        

        q = Q("match", **key_val)
        self.search = self.search.query(q)
        return self
1104718
def find_value(self, key):
        """"""
        values = self.values
        if key not in values:
            raise AttributeError("Config has no value for {}".format(key))

        val = values[key]
        if isinstance(val, Default):
            return val.val
        else:
            return val
1231134
def search(self, value):
        """"""
        if self.payload == value:
            return self
        else:
            if value <= self.payload:
                if self.left:
                    return self.left.search(value)
            else:
                if self.right:
                    return self.right.search(value)
        return None
685050
function (key) {
        var index = this.indexOfKey(key);

        if (index >= 0) {
            return this.slot.values[index];
        }

        error(ERROR_KEY_NOT_FOUND);
    }
1359571
def mapping_match(uri, mapping):
    
    try:
        val = mapping_get(uri, mapping)
        return True
    except KeyError:
        return False
342053
def get(self, key, defaultvalue = None):
        
        (t, k) = self._getsubitem(key, False)
        if t is None:
            return defaultvalue
        else:
            return t.__dict__.get(k, defaultvalue)
955095
def get(self, key, namespace=None):
        """"""
        full_key = generate_uppercase_key(key, namespace)
        logger.debug('Searching %s for %s', self, full_key)
        return get_key_from_envs(os.environ, full_key)
679169
def get_value(self, key, args, kwargs):
        """"""
        if (self.tolerant and
                not isinstance(key, basestring) and
                key not in kwargs):
            key = str(key)

        return kwargs[key]