Return a titlecased version of the value. I.e. words will start with
    uppercase letters, all remaining characters are lowercase.
188444
def do_title(s):
    
    return ''.join(
        [item[0].upper() + item[1:].lower()
         for item in _word_beginning_split_re.split(soft_unicode(s))
         if item])
885336
def get_title(self, properly_capitalized=False):
        """"""
        if properly_capitalized:
            self.title = _extract(
                self._request(self.ws_prefix + ".getInfo", True), "name"
            )

        return self.title
870497
def generate_uppercase_key(key, namespace=None):
    """"""
    if namespace:
        namespace = [part for part in listify(namespace) if part]
        key = '_'.join(namespace + [key])

    key = key.upper()
    return key
388037
def format_title(text):
    
    text = text.strip()
    # if empty string, return ""
    if len(text) == 0:
        return text
    else:
        text = text.lower()  # lower all char

        # Change to in single space format
        words = [word for word in text.strip().split(" ") if len(word) >= 1]

        # Capitalize all words except function word
        words_new = list()
        for word in words:
            if word not in FUNCTION_WORD:
                word = word[0].upper() + word[1:]
            words_new.append(word)

        # Make sure first word always be capitalized
        words_new[0] = words_new[0][0].upper() + words_new[0][1:]

        return " ".join(words_new)
1080974
def _make_one_char_uppercase(string: str) -> str:
        """"""
        if not isinstance(string, str):
            raise TypeError('string must be a string')

        if Aux.lowercase_count(string) > 0:
            while True:
                cindex = randbelow(len(string))
                if string[cindex].islower():
                    aux = list(string)
                    aux[cindex] = aux[cindex].upper()
                    string = ''.join(aux)
                    break

        return string
625743
def acceptable(value, capitalize=False):
    """"""
    name = regexes['punctuation'].sub("", regexes['joins'].sub("_", value))
    # Clean up irregularities in underscores.
    name = regexes['repeated_underscore'].sub("_", name.strip('_'))
    if capitalize:
        # We don't use python's built in capitalize method here because it
        # turns all upper chars into lower chars if not at the start of
        # the string and we only want to change the first character.
        name_parts = []
        for word in name.split('_'):
            name_parts.append(word[0].upper())
            if len(word) > 1:
                name_parts.append(word[1:])
        name = ''.join(name_parts)
    return name
1300217
public static String upperCase(String str) {
        if(isNullOrEmpty(str)) {
            return str;
        }
        return str.toUpperCase(LOCALE_ENGLISH);
    }
890801
private static String firstCharToLowerCase(String word) {
		if (word.length() == 1) {
			return word.toLowerCase();
		}
		char c = word.charAt(0);
		char newChar;
		if (c >= 'A' && c <= 'Z') {
			newChar = (char) (c + 32);
		}
		else {
			newChar = c;
		}
		return newChar + word.substring(1);
	}
345515
function( str, keepCase ) {
			return str.charAt( 0 ).toUpperCase() + ( keepCase ? str.slice( 1 ) : str.slice( 1 ).toLowerCase() );
		}
1255229
function titlecase(val, conjunctions) {
    if (!is_1.isValue(val))
        return null;
    // conjunctions
    var conj = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;
    return val.replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function (m, i, t) {
        if (i > 0 && i + m.length !== t.length &&
            m.search(conj) > -1 && t.charAt(i - 2) !== ';' &&
            (t.charAt(i + m.length) !== '-' || t.charAt(i - 1) === '-') &&
            t.charAt(i - 1).search(/[^\s-]/) < 0) {
            if (conjunctions === false)
                return capitalize(m);
            return m.toLowerCase();
        }
        if (m.substr(1).search(/[A-Z]|\../) > -1)
            /* istanbul ignore next */
            return m;
        return m.charAt(0).toUpperCase() + m.substr(1);
    });
}
571463
public static String lowerCase(String str) {
        if(isNullOrEmpty(str)) {
            return str;
        }
        return str.toLowerCase(LOCALE_ENGLISH);
    }
209487
public static String toTitleCase(String text) {
		StringBuilder str = new StringBuilder();
		String[] words = text.trim().split("\\s");
		for (int i = 0; i < words.length; i++) {
			if (words[i].length() > 0) {
				if (i > 0) {
					str.append(" ");
				}
				String lower = words[i].toLowerCase(Locale.getDefault());
				if (words[i].length() == 1) {
					str.append(lower);
				} else if (words[i].length() == 2) {
					if (lower.equals("da") || lower.equals("de") || lower.equals("do") || lower.equals("di"))
						str.append(lower);
					else
						str.append(StringUtils.capitalize(lower));
				} else {
					str.append(StringUtils.capitalize(lower));
				}
			}
		}
		return str.toString();
	}
874837
def alpha_cased(text, lower=False):
    
    text = "".join(filter(
            lambda c: c.isalpha() or c == GENERIC_PROTOCOL_KEY, text))
    return text.lower() if lower else text.upper()
270729
private static String getWordShape(String string) {
        if (string.toUpperCase().equals(string) && string.toLowerCase().equals(string)) return "no-case";
        if (string.toUpperCase().equals(string)) return "upper-case";
        if (string.toLowerCase().equals(string)) return "lower-case";
        if (string.length() > 1 && Character.isUpperCase(string.charAt(0)) && string.substring(1).toLowerCase().equals(string.substring(1))) return "capitalized";
        return "mixed-case";
    }
1115759
public static String toTitleCase(String str) {
        if (str.length() == 0) {
            return str;
        } else {
            return Character.toUpperCase(str.charAt(0)) + str.substring(1).toLowerCase();
        }
    }
691218
public static String capitalize(String s) {
		if (s == null || isEmpty(s)) {
			return s;
		}
		return (new StringBuilder(s.length())).append(Character.toTitleCase(s.charAt(0))).append(s.substring(1)).toString();
	}
474739
def _capitalize_first_letter(word):
    
    if word[0].isalpha():
        # These two cases are necessary in order to get a regex pattern
        # starting with '[xX]' and not '[Xx]'. This allows to check for
        # colliding regex afterwards.
        if word[0].isupper():
            return "[" + word[0].swapcase() + word[0] + "]" + word[1:]
        else:
            return "[" + word[0] + word[0].swapcase() + "]" + word[1:]
    return word