Given a country code abbreviation, check to see if it matches the
    country table.

    abbrev: (str) Country code to evaluate.
    case_sensitive: (bool) When True, enforce case sensitivity.

    Returns True if valid, False if not.
179551
def is_valid_country_abbrev(abbrev, case_sensitive=False):
    
    if case_sensitive:
        country_code = abbrev
    else:
        country_code = abbrev.upper()

    for code, full_name in COUNTRY_TUPLES:
        if country_code == code:
            return True

    return False
586393
private static boolean isCollationCorrect(String collation) {
    return containsIgnoreCase(collation, CASE_SENSITIVE_ACCENT_SENSITIVE)
      || containsIgnoreCase(collation, BIN)
      || containsIgnoreCase(collation, BIN2);
  }
618828
def _is_valid_language(self):
        

        comp_str = self._encoded_value.lower()
        lang_rxc = re.compile(CPEComponentSimple._LANGTAG_PATTERN)
        return lang_rxc.match(comp_str) is not None
3465
def case_insensitive(self):
        
        if "--case-ins" in self.flag:
            data = []
            data = Utils().package_name(self.PACKAGES_TXT)
            data_dict = Utils().case_sensitive(data)
            for pkg in self.packages:
                index = self.packages.index(pkg)
                for key, value in data_dict.iteritems():
                    if key == pkg.lower():
                        self.packages[index] = value
1006851
function (query, string, exact) {
        if (typeof string !== 'string' || string === '') {
          return false;
        }
        if (exact) {
          return string.toLowerCase() === query.toLowerCase();
        }
        return string.toLowerCase().indexOf(query.toLowerCase()) !== -1;
      }
520169
def valid_for_country?(country)
      country = country.to_s.upcase
      tdata = analyze(sanitized, passed_country(country))
      tdata.find do |iso2, data|
        country == iso2 && data[:valid].any?
      end.is_a? Array
    end
762947
public static boolean isCaseInsensitive()
  {
    Boolean value = _caseInsensitive.get();

    if (value == null) {
      return _isCaseInsensitive;
    }
    else
      return value.booleanValue();
  }
8823
String applyCaseInsensitivity(String name) {
        return (name != null)
                ? isCaseSensitiveTableNames() ? name : isCaseInsensitiveStrategyLowerCase()
                        ? name.toLowerCase(Locale.ENGLISH)
                        : name.toUpperCase(Locale.ENGLISH)
                : null;
    }
495412
def validate(value):
        
        if not helpers.has_len(value):
            return False

        return COUNTRIES.has_key(str(value).lower())
1112167
def validate_query(query):
        
        tokens = _quote_re.findall(query)
        for token in tokens:
            if token.startswith('"') and token.endswith('"'):
                continue
            if set(token) & _invalid_ascii:
                return False
        return True
976324
def bin_case_insensitive(self):
        
        if "--case-ins" in self.flag:
            data_dict = Utils().case_sensitive(self.names)
            for key, value in data_dict.iteritems():
                if key == self.name.lower():
                    self.name = value
5240
private static boolean isTargetValid(File fi, boolean ignoreCase, String... fileExt) {
        if (fi == null || fileExt == null || fileExt.length == 0)
            return true;

        String ext = getExtension(fi);

        for (String str : fileExt) {
            if (ignoreCase ? ext.equalsIgnoreCase(str) : ext.equals(str))
                return true;
        }

        return false;
    }
1251277
function applyCase(wordA, wordB) {
	// Exception to avoid words like "I" being converted to "ME"
	if (wordA.length === 1 && wordB.length !== 1) return wordB;
	// Uppercase
	if (wordA === wordA.toUpperCase()) return wordB.toUpperCase();
	// Lowercase
	if (wordA === wordA.toLowerCase()) return wordB.toLowerCase();
	// Capitialized
	var firstChar = wordA.slice(0, 1);
	var otherChars = wordA.slice(1);
	if (firstChar === firstChar.toUpperCase() && otherChars === otherChars.toLowerCase()) {
		return wordB.slice(0, 1).toUpperCase() + wordB.slice(1).toLowerCase();
	}
	// Other cases
	return wordB;
}
1071073
def has_reg(value):
    """"""
    try:
        SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, value)
        ret = True
    except SCons.Util.WinError:
        ret = False
    return ret
566437
private boolean caseMapCheck(Path f, RelativePath name) {
        if (fileSystemIsCaseSensitive) return true;
        // Note that toRealPath() returns the case-sensitive
        // spelled file name.
        String path;
        char sep;
        try {
            path = f.toRealPath(LinkOption.NOFOLLOW_LINKS).toString();
            sep = f.getFileSystem().getSeparator().charAt(0);
        } catch (IOException ex) {
            return false;
        }
        char[] pcs = path.toCharArray();
        char[] ncs = name.path.toCharArray();
        int i = pcs.length - 1;
        int j = ncs.length - 1;
        while (i >= 0 && j >= 0) {
            while (i >= 0 && pcs[i] == sep) i--;
            while (j >= 0 && ncs[j] == '/') j--;
            if (i >= 0 && j >= 0) {
                if (pcs[i] != ncs[j]) return false;
                i--;
                j--;
            }
        }
        return j < 0;
    }
484857
def is_code(self):
        """"""
        if self.cell_type == 'code':
            return True
        if self.cell_type == 'raw' and 'active' in self.metadata:
            return True
        return False
291760
def _should_trigger_abbreviation(self, buffer):
        
        return any(self.__checkInput(buffer, abbr) for abbr in self.abbreviations)