def titleify(self, lang='<STR_LIT>', allwords=False, lastword=True):
if lang in LOWERCASE_WORDS:<EOL><INDENT>lc_words = LOWERCASE_WORDS[lang]<EOL><DEDENT>else:<EOL><INDENT>lc_words = []<EOL><DEDENT>s = str(self).strip()<EOL>l = re.split(r"<STR_LIT>", s)<EOL>for i in range(len(l)):<EOL><INDENT>l[i] = l[i].lower()<EOL>if (<EOL>allwords == True<EOL>or i == <NUM_LIT:0><EOL>or (lastword == True and i == len(l) - <NUM_LIT:1>)<EOL>or l[i].lower() not in lc_words<EOL>):<EOL><INDENT>w = l[i]<EOL>if len(w) > <NUM_LIT:1>:<EOL><INDENT>w = w[<NUM_LIT:0>].upper() + w[<NUM_LIT:1>:]<EOL><DEDENT>else:<EOL><INDENT>w = w.upper()<EOL><DEDENT>l[i] = w<EOL><DEDENT><DEDENT>s = "<STR_LIT>".join(l)<EOL>return String(s)<EOL>
takes a string and makes a title from it