This function uses string patterns to match a title cased name.
        This is done in a loop until there are no more names to match so as
        to be able to include surnames etc. in the output.
506776
def parse_name(self):
        """"""
        name = []
        while True:
            # Match the current char until it doesnt match the given pattern:
            # first char must be an uppercase alpha and the rest must be lower
            # cased alphas.
            part = self.match_string_pattern(spat.alphau, spat.alphal)
            if part == '':
                break  # There is no more matchable strings.
            self.eat_string(part)  # Eat the found string
            name.append(part)  # Store this name part
            if self.get_char() == ' ':  # if the current char is a single space
                # eat it. This allows one space between parts
                self.eat_length(1)

        if not len(name):  # if no name parts where detected raise an expection.
            raise PartpyError(self, 'Expecting a title cased name')
        return ' '.join(name)
275306
def normalize_name(name):
    
    name = name.casefold()
    name = name.replace("’", "'")
    name = name.replace("-", " ")
    name = name.replace("(", "")
    name = name.replace(")", "")
    name = name.replace(",", "")
    return name.strip()
29837
private static boolean isNameCase(String str) {
    if (str.length() < 2) {
      return false;
    }
    if (!(Character.isUpperCase(str.charAt(0)) || Character.isTitleCase(str.charAt(0)))) {
      return false;
    }
    for (int i = 1; i < str.length(); i++) {
      if (Character.isUpperCase(str.charAt(i))) {
        return false;
      }
    }
    return true;
  }
843894
function titlecase() {
  return function(data, render) {
    var text = render(data);
    if (text.length === 0) {
      return text;
    }

    return text[0].toUpperCase() + text.substring(1);
  };
}
1095545
static Matcher ignoreCase(Matcher matcher) {
    if (matcher instanceof CharClassMatcher) {
      CharClassMatcher m = matcher.as();
      return new CharClassMatcher(m.set(), true);
    } else if (matcher instanceof CharSeqMatcher) {
      CharSeqMatcher m = matcher.as();
      return new CharSeqMatcher(m.pattern(), true);
    } else if (matcher instanceof IndexOfMatcher) {
      IndexOfMatcher m = matcher.as();
      return new IndexOfMatcher(m.pattern(), m.next(), true);
    } else if (matcher instanceof StartsWithMatcher) {
      StartsWithMatcher m = matcher.as();
      return new StartsWithMatcher(m.pattern(), true);
    } else {
      return matcher;
    }
  }
942053
function stringCase(str, caseValue) {
		switch (String(caseValue || '').toLowerCase()) {
			case 'lower':
				return str.toLowerCase();
			case 'upper':
				return str.toUpperCase();
		}
		
		return str;
	}
79373
def match(self, string):
        """"""
        if self.casesensitive:
            return self.pattern == os.path.normcase(string)
        else:
            return self.pattern.lower() == os.path.normcase(string).lower()
200567
def _publish_match(self, publish, names=False, name_only=False):
        
        if names:
            for name in names:
                if not name_only and isinstance(name, re._pattern_type):
                    if re.match(name, publish.name):
                        return True
                else:
                    operand = name if name_only else [name, './%s' % name]
                    if publish in operand:
                        return True
            return False
        else:
            return True
617400
public static boolean contains(String name, Iterable<String> patterns) {
        String nameUpper = name.toUpperCase();
        for (String pattern : patterns) {
            String patternUpper = pattern.toUpperCase();
            if (nameUpper.equals(patternUpper) || nameUpper.contains(patternUpper)) {
                return true;
            }
        }

        return false;
    }
565602
def match_case_tokens(loc, tokens, check_var, top):
    """"""
    if len(tokens) == 2:
        matches, stmts = tokens
        cond = None
    elif len(tokens) == 3:
        matches, cond, stmts = tokens
    else:
        raise CoconutInternalException("invalid case match tokens", tokens)
    matching = Matcher(loc, check_var)
    matching.match(matches, match_to_var)
    if cond:
        matching.add_guard(cond)
    return matching.build(stmts, set_check_var=top)
188414
def _check_names_match(data_names, data_shapes, name, throw):
    """"""
    actual = [x[0] for x in data_shapes]
    if sorted(data_names) != sorted(actual):
        msg = "Data provided by %s_shapes don't match names specified by %s_names (%s vs. %s)"%(
            name, name, str(data_shapes), str(data_names))
        if throw:
            raise ValueError(msg)
        else:
            warnings.warn(msg)
1258367
function(match) {
			match = $.isFunction(match) ? match : _makeNodeTitleMatcher(match);
			var res = [];
			this.visit(function(n) {
				if (match(n)) {
					res.push(n);
				}
			});
			return res;
		}
325578
def query_names(self, pat):
        """"""

        for item in self.chnames.items():
            if fnmatch.fnmatchcase(item[1], pat):
                print item
1282390
protected static boolean matchesOne(String str, Pattern... patterns) {
        for (Pattern pattern : patterns) {
            if (pattern.matcher(str).matches()) {
                return true;
            }
        }
        return false;
    }
1312910
public static boolean matchAny(final String pattern, final String[] candidate, boolean ignoreCase) {

        for (int i = 0; i < candidate.length; i++) {
            final String string = candidate[i];
            if (match(pattern, string, ignoreCase)) {
                return true;
            }
        }

        return false;
    }
1182987
public static int getStringCase(String str) {
        if (str.length() == 0) {
            return MIXED;
        }

        int state = -1;

        char ch = str.charAt(0);
        if (Character.isLetter(ch)) {
            if (Character.isUpperCase(ch)) {
                state = UPPER_CASE;
            } else {
                state = LOWER_CASE;
            }
        }

        for (int i = 1; i < str.length(); i++) {
            ch = str.charAt(i);
            if (!Character.isLetter(ch)) {
                continue;
            }

            switch (state) {
                case UPPER_CASE:
                    if (Character.isLowerCase(ch)) {
                        if (i == 1) {
                            state = TITLE_CASE;
                        } else {
                            return MIXED;
                        }
                    }
                    break;
                case LOWER_CASE:
                case TITLE_CASE:
                    if (Character.isUpperCase(ch)) {
                        return MIXED;
                    }
                    break;
            }
        }

        return state;
    }
968800
static String nameConvert(String name, boolean mapCamelCaseToUnderscore) {
    if (!mapCamelCaseToUnderscore)
      return name;
    StringBuilder sbd = new StringBuilder();
    char prevChar = name.charAt(0);
    sbd.append(Character.toLowerCase(prevChar));
    for (int i = 1, len = name.length(); i < len; i++) {
      char c = name.charAt(i);
      if (Character.isUpperCase(c)) {
        int next = i + 1;
        char nextChar = (next < len) ? name.charAt(next) : '\0';
        if (Character.isLowerCase(prevChar) || Character.isLowerCase(nextChar)) {
          sbd.append('_');
        }
        sbd.append(Character.toLowerCase(c));
      } else {
        sbd.append(c);
      }
      prevChar = c;
    }
    return sbd.toString();
  }