Lookup function used when value is not found.
774179
def _missing_(cls, value):
        """"""
        if not (isinstance(value, int) and 0 <= value <= 65535):
            raise ValueError('%r is not a valid %s' % (value, cls.__name__))
        if 2 <= value <= 6:
            extend_enum(cls, 'Unassigned [%d]' % value, value)
            return cls(value)
        if 8 <= value <= 13:
            extend_enum(cls, 'Unassigned [%d]' % value, value)
            return cls(value)
        if 21 <= value <= 23:
            extend_enum(cls, 'Unassigned [%d]' % value, value)
            return cls(value)
        if 29 <= value <= 31:
            extend_enum(cls, 'Unassigned [%d]' % value, value)
            return cls(value)
        if 33 <= value <= 39:
            extend_enum(cls, 'Unassigned [%d]' % value, value)
            return cls(value)
        if 52 <= value <= 59:
            extend_enum(cls, 'Unassigned [%d]' % value, value)
            return cls(value)
        if 63 <= value <= 69:
            extend_enum(cls, 'Unassigned [%d]' % value, value)
            return cls(value)
        if 71 <= value <= 89:
            extend_enum(cls, 'Unassigned [%d]' % value, value)
            return cls(value)
        if 91 <= value <= 99:
            extend_enum(cls, 'Unassigned [%d]' % value, value)
            return cls(value)
        if 101 <= value <= 8191:
            extend_enum(cls, 'Unassigned [%d]' % value, value)
            return cls(value)
        if 8192 <= value <= 16383:
            # [RFC 7401]
            extend_enum(cls, 'Reserved for Private Use [%d]' % value, value)
            return cls(value)
        if 16385 <= value <= 40959:
            extend_enum(cls, 'Unassigned [%d]' % value, value)
            return cls(value)
        if 40960 <= value <= 65535:
            # [RFC 7401]
            extend_enum(cls, 'Reserved for Private Use [%d]' % value, value)
            return cls(value)
        super()._missing_(value)
29020
def bool_lookup(value)
      return 'yes' if %w(true yes yep).include? value.to_s.downcase
      return 'no' if %w(false no nope).include? value.to_s.downcase
      value
    end
119014
public T find(V value) {
		checkInit();

		for (T obj : preDefined) {
			if (matches(obj, value)) {
				return obj;
			}
		}
		return null;
	}
36783
def _resolve_value(self, value, environment=None):
        

        # here we care about Undefined values
        if value == values.Undefined:
            if isinstance(self._missing, type) and issubclass(self._missing, Missing):
                # instantiate the missing thing
                missing = self._missing(self, environment)

                # invoke missing callback
                # the default is to raise a MissingValue() exception
                value = missing(value)

            elif hasattr(self._missing, "__call__"):
                value = self._missing()

            else:
                # we just assign any value
                value = self._missing

        return value
1339311
def not_found(self, *args, **kwargs):
        """"""
        kwargs['api'] = self.api
        return not_found(*args, **kwargs)
597572
private function lookupValue($value)
    {
        foreach ($this->pairs as $pair) {
            if ($pair->value === $value) {
                return $pair;
            }
        }
    }
543738
def get_missing_value_key(d):
    
    _mv = "nan"

    # Attempt to find a table-level missing value key
    try:
        # check for missing value key at the table root
        _mv = d["missingValue"]
    except KeyError as e:
        logger_misc.info("get_missing_value: No missing value key found: {}".format(e))
    except AttributeError as e:
        logger_misc.warn("get_missing_value: Column is wrong data type: {}".format(e))

    # No table-level missing value found. Attempt to find a column-level missing value key
    if not _mv:
        try:
            # loop for each column of data, searching for a missing value key
            for k, v in d["columns"].items():
                # found a column with a missing value key. Store it and exit the loop.
                _mv = v["missingValue"]
                break
        except KeyError:
            # There are no columns in this table. We've got bigger problems!
            pass

    # No table-level or column-level missing value. Out of places to look. Ask the user to enter the missing value
    # used in this data
    # if not _mv:
    #     print("No 'missingValue' key provided. Please type the missingValue used in this file: {}\n".format(filename))
    #     _mv = input("missingValue: ")
    return _mv
82573
def lookup(self,value):
        
        for k,v in self.iteritems():
            if value == v:
                return k
        return None
1112415
def coerce(self, value):
        """"""
        if isinstance(value, dict):
            value = [value]
        if not isiterable_notstring(value):
            value = [value]
        return [coerce_single_instance(self.lookup_field, v) for v in value]
255530
def lookup_function(val):
	""
	
	type = val.type
	
	if type.code == gdb.TYPE_CODE_REF:
		type = type.target()
	
	type = type.unqualified().strip_typedefs()
	
	typename = type.tag
	if typename == None:
		return None
	
	for function in pretty_printers_dict:
		if function.search(typename):
			return pretty_printers_dict[function](val)
	
	return None
1260952
def do_find(lookup, term):
    """"""

    space = defaultdict(list)

    for name in lookup.keys():
        space[name].append(name)

    try:
        iter_lookup = lookup.iteritems()  # Python 2
    except AttributeError:
        iter_lookup = lookup.items()  # Python 3

    for name, definition in iter_lookup:
        for keyword in definition['keywords']:
            space[keyword].append(name)
        space[definition['category']].append(name)

    matches = fnmatch.filter(space.keys(), term)

    results = set()
    for match in matches:
        results.update(space[match])

    return [(r, translate(lookup, r)) for r in results]
1050134
def get(self, item, not_found_value=None):
        ""

        if item in self.keys:
            return self.__data[item]
        else:
            return not_found_value
99505
public static int find(int[] arr, int start, int end, int valueToFind) {
    assert arr != null;
    assert end >= 0;
    assert end <= arr.length;


    for (int i = start; i < end; i++) {
      if (arr[i] == valueToFind) {
        return i;
      }
    }

    return NOT_FOUND;
  }
998790
def __get_lookup(in_fn, selected_type=None):
  """"""
  lookup_func = None
  if selected_type is not None:
    lookup_func = get_lookup_by_filetype(selected_type)
  else:
    extension = os.path.splitext(in_fn)[1]
    lookup_func = get_lookup_by_file_extension(extension)
  assert(lookup_func is not None)
  return lookup_func
1213609
function find(list, match) {
	  for (var i = 0; i < list.length; i++) {
	    if (match(list[i])) {
	      return list[i];
	    }
	  }
	  return undefined;
	}
1183501
def find(self, item):
		
		for i, seg in enumerate(self):
			if item in seg:
				return i
		raise ValueError(item)
99533
def _get_value(obj, key):
    """"""
    if isinstance(obj, (list, tuple)):
        for item in obj:
            v = _find_value(key, item)
            if v is not None:
                return v
        return None
    if isinstance(obj, dict):
        return obj.get(key)
    if obj is not None:
        return getattr(obj, key, None)