Really naive case-insensitive search.
482428
def filter(self, table, flavors, filter_string):
        """"""
        q = filter_string.lower()

        def comp(flavor):
            return q in flavor.name.lower()

        return filter(comp, flavors)
42045
def filter(self, table, keypairs, filter_string):
        """"""
        query = filter_string.lower()
        return [keypair for keypair in keypairs
                if query in keypair.name.lower()]
282915
def _regexSearchRegPolData(search_string, policy_data):
    '''
    
    '''
    if policy_data:
        if search_string:
            match = re.search(search_string, policy_data, re.IGNORECASE)
            if match:
                return True
    return False
658997
String convertCase(String str) {
        if (str == null) {
            return null;
        }
        return sensitive ? str : str.toLowerCase();
    }
499558
def findByBiSearch(self, strSeq) :
		""""""
		arr = self.encode(strSeq)
		return self._dichFind(arr[0], self, 0, lst = None)
1330538
def _preprocess(argument, casesensitive):
        """"""
        pattern_set = PatternSet()
        if argument is not None:
            if isinstance(argument, STRING_TYPES):
                argument = [argument, ]

            for glob in argument:
                if isinstance(glob, str):
                    patterns = Pattern.create(glob, casesensitive)
                    pattern_set.extend(patterns)

                elif isinstance(glob, Pattern):
                    pattern_set.append(glob)

        return pattern_set
72688
function lowercaseContains(arr, elem) {
    return arr.map(function (arrElem) {
        return arrElem.toLowerCase();
    }).indexOf(elem) !== -1;
}
1360904
def str_search(self, search: str) -> List[HistoryItem]:
        
        def isin(history_item):
            """filter function for string search of history"""
            sloppy = utils.norm_fold(search)
            return sloppy in utils.norm_fold(history_item) or sloppy in utils.norm_fold(history_item.expanded)
        return [item for item in self if isin(item)]
538806
def case(self, case_id):
        """"""
        case_obj = self.query(Case).filter_by(case_id=case_id).first()
        return case_obj
686722
function bsearch(arr, val, key) {
  var pred = typeof val === 'function' ? val : (typeof key === 'string'
    ? function(item) { return val <= item[key]; }
    : function(item) { return val <= item; });

  var lo = -1, hi = arr.length;
  while (1 + lo !== hi) {
    var mi = lo + ((hi - lo) >> 1);
    if (pred(arr[mi])) {
      hi = mi;
    } else {
      lo = mi;
    }
  }
  return hi;
}
215480
public static function contains(
        $string,
        $search,
        $caseSensitive = true,
        $encoding = null
    ) {
        $encoding = $encoding === null ? mb_internal_encoding() : $encoding;

        if ($caseSensitive) {
            return Mbstring::strpos($string, $search, 0, $encoding) !== false;
        } else {
            return Mbstring::stripos($string, $search, 0, $encoding) !== false;
        }
    }
483042
def downcaseTokens(s,l,t):
    """"""
    return [ tt.lower() for tt in map(_ustr,t) ]
397083
def search(self, string, default=None):
        """"""
        default = default if default else []
        result = [item[1] for item in self.container if item[0].search(string)]
        if self.ensure_mapping:
            assert len(result) < 2, "%s matches more than one pattern: %s" % (
                string,
                result,
            )
        return result if result else default
958198
def fuzzyfinder(text, collection):
    """"""
    suggestions = []
    if not isinstance(text, six.text_type):
        text = six.u(text)
    pat = '.*?'.join(map(re.escape, text))
    regex = re.compile(pat, flags=re.IGNORECASE)
    for item in collection:
        r = regex.search(item)
        if r:
            suggestions.append((len(r.group()), r.start(), item))

    return (z for _, _, z in sorted(suggestions))
262483
def fulltext(search, lang=Lang.English, ignore_case=True):
        
        return {
            "$text": {
                "$search": search,
                "$language": lang,
                "$caseSensitive": not ignore_case,
                "$diacriticSensitive": False,
            }
        }
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;
	}
64020
def find(self, string, default=None):
        """"""
        return self.match(string) or self.search(string) or default