Naive case-insensitive search.
552155
def filter(self, table, volumes, filter_string):
        """"""
        q = filter_string.lower()
        return [volume for volume in volumes
                if q in volume.name.lower()]
295865
function search(query, cols, max) {
    var url;
    var token = cache.get('token');
    var cases;
    var fields;
    var dfrd = Q.defer();

    function extractCases(xml) {
      var r = _parse(xml, dfrd);
      if (!r ||
        !r.response ||
        !r.response.cases ||
        !r.response.cases.length ||
        !r.response.cases[0].case) {
        return dfrd.reject(MODULE_ERRORS.bugNotFound);
      }
      cases = r.response.cases[0].case.map(function(kase) {
        var bug = new Case({
          id: kase.$.ixBug,
          operations: kase.$.operations.split(','),
          title: kase.sTitle[0].trim(),
          status: kase.sStatus[0].trim(),
          url: format('%s://%s/default.asp?%s', PROTOCOL, conf.host,
            kase.$.ixBug),
          fixFor: kase.sFixFor[0].trim()
        });
        if (kase.sPersonAssignedTo) {
          bug.assignedTo = kase.sPersonAssignedTo[0].trim();
          bug.assignedToEmail = kase.sEmailAssignedTo[0].trim();
        }
        if (kase.tags && kase.tags[0].tag) {
          bug.tags = kase.tags[0].tag.join(', ');
        }
        // find anything leftover in the case, disregarding the fields we
        // already
        _(kase)
          .keys()
          .difference(_.keys(bug).concat('sTitle', 'sStatus', '$',
            'sFixFor', 'sPersonAssignedTo',
            'sEmailAssignedTo'))
          .each(function(key) {
            var value = kase[key];
            bug[key] = _.isArray(value) && value.length === 1 ?
              // dereference
              bug[key] = value[0].trim() :
              value;
          });
        bug._raw = kase;
        return bug;
      });
      if (cases.length > 1) {
        return cases;
      }
      return cases[0];
    }

    fields = (cols || DEFAULT_COLS).join(',');
    max = max || DEFAULT_MAX;
    query = encodeURIComponent(query);
    if (!token) {
      dfrd.reject(MODULE_ERRORS.undefinedToken);
    } else {
      url = format(URLs.search, PROTOCOL, conf.host, query, fields, max,
        token);
      request(url, function(err, res, body) {
        var newCases;
        if (err) {
          dfrd.reject(err);
        } else {
          newCases = extractCases(body);
          if (!newCases) {
            console.error(body);
            dfrd.reject(MODULE_ERRORS.unknown);
          } else {
            dfrd.resolve(newCases);
          }
        }
      });
    }
    return dfrd.promise;
  }
786320
def __search_iterable(self,
                          obj,
                          item,
                          parent="root",
                          parents_ids=frozenset({})):
        """"""

        for i, thing in enumerate(obj):
            new_parent = "%s[%s]" % (parent, i)
            if self.__skip_this(thing, parent=new_parent):
                continue

            if self.case_sensitive or not isinstance(thing, strings):
                thing_cased = thing
            else:
                thing_cased = thing.lower()

            if thing_cased == item:
                self.__report(
                    report_key='matched_values', key=new_parent, value=thing)
            else:
                item_id = id(thing)
                if parents_ids and item_id in parents_ids:
                    continue
                parents_ids_added = add_to_frozen_set(parents_ids, item_id)
                self.__search(thing, item, "%s[%s]" %
                              (parent, i), parents_ids_added)
3841
public static int indexOfIgnoreCase(final String str, final String searchStr) {// NOSONAR
		if (searchStr.isEmpty() || str.isEmpty()) {
			return str.indexOf(searchStr);
		}
		for (int i = 0; i < str.length(); ++i) {
			if (i + searchStr.length() > str.length()) {
				return -1;
			}
			int j = 0;
			int ii = i;
			while (ii < str.length() && j < searchStr.length()) {
				char c = Character.toLowerCase(str.charAt(ii));
				char c2 = Character.toLowerCase(searchStr.charAt(j));
				if (c != c2) {
					break;
				}
				j++;
				ii++;
			}
			if (j == searchStr.length()) {
				return i;
			}
		}
		return -1;
	}
196276
def match_fields(fields, searches,
                 ignore_case=False, wholename=False, complement=False):
    
    if ignore_case:
        fields = [f.lower() for f in fields]
        searches = [s.lower() for s in searches]
    if wholename:
        match_found = _complete_match
    else:
        match_found = _partial_match

    fields = [(i, field) for i, field in enumerate(fields)]
    matched = []
    for search, (idx, field) in itertools.product(searches, fields):
        if not search:  ## don't return all fields for ''
            continue
        if match_found(search, field) and idx not in matched:
            matched.append(idx)

    if complement:
        matched = [idx for idx in list(zip(*fields))[0] if idx not in matched]

    return matched
262483
def fulltext(search, lang=Lang.English, ignore_case=True):
        
        return {
            "$text": {
                "$search": search,
                "$language": lang,
                "$caseSensitive": not ignore_case,
                "$diacriticSensitive": False,
            }
        }
700710
def search(self, matchStr, numSyllables=None, wordInitial='ok',
               wordFinal='ok', spanSyllable='ok', stressedSyllable='ok',
               multiword='ok', pos=None):
        '''
        
        '''
        return search(self.data.items(), matchStr, numSyllables=numSyllables,
                      wordInitial=wordInitial, wordFinal=wordFinal,
                      spanSyllable=spanSyllable,
                      stressedSyllable=stressedSyllable,
                      multiword=multiword, pos=pos)
45058
def _match_literal(self, a, b=None):
        """"""

        return a.lower() == b if not self.case_sensitive else a == b
1213279
private static boolean containsIgnoreCase(List<String> names, String nameToFind) {
		if (CollUtil.isEmpty(names)) {
			return false;
		}
		if (StrUtil.isEmpty(nameToFind)) {
			return false;
		}
		for (String name : names) {
			if (nameToFind.equalsIgnoreCase(name)) {
				return true;
			}
		}
		return false;
	}
466562
def spell(word):
    """"""
    w = Word(word)
    candidates = (common([word]) or exact([word]) or known([word]) or
                  known(w.typos()) or common(w.double_typos()) or
                  [word])
    correction = max(candidates, key=NLP_COUNTS.get)
    return get_case(word, correction)
468800
def Search(self, text):
    """"""
    if isinstance(text, rdfvalue.RDFString):
      text = str(text)

    return self._regex.search(text)
872891
def __search_text_check_convert(cls, text):
        """"""
        text = cls.check_convert_string(text, name='text', no_leading_trailing_whitespace=False)
        if len(text) > VALIDATION_META_SEARCH_TEXT:
            raise ValueError("Search text can contain at most %d characters" % VALIDATION_META_SEARCH_TEXT)
        text = ' '.join(_PATTERN_WORDS.findall(text))
        if not text:
            raise ValueError('Search text must contain at least one non-whitespace term (word)')
        return text
404679
def _search_vals(self, compiled_pattern, fld_val):
        """"""
        matches = []
        if isinstance(fld_val, set):
            for val in fld_val:
                self._search_val(matches, compiled_pattern, val)
        elif isinstance(fld_val, str):
            self._search_val(matches, compiled_pattern, fld_val)
        return matches
85887
def case_insensitive(self):
        
        if "--case-ins" in self.flag:
            data_dict = Utils().case_sensitive(self.data)
            for key, value in data_dict.iteritems():
                if key == self.name.lower():
                    self.name = value
64020
def find(self, string, default=None):
        """"""
        return self.match(string) or self.search(string) or default
499558
def findByBiSearch(self, strSeq) :
		""""""
		arr = self.encode(strSeq)
		return self._dichFind(arr[0], self, 0, lst = None)
371554
def findAllByBiSearch(self, strSeq) :
		""""""
		arr = self.encode(strSeq)
		lst = []
		self._dichFind(arr[0], self, 0, lst)
		return lst