def string_to_class_name(string):
 string = re.sub('[A-Za-z]', (lambda m: m.group().title()), string, count=1)
 string = re.sub('_[A-Za-z0-9]+', (lambda m: m.group()[1:].title()), string)
 return str(string)

def string_to_class_name ( string ) : string = re . sub ( '[A-Za-z]' , ( lambda m : m . group ( ) . title ( ) ) , string , count = 1 ) string = re . sub ( '_[A-Za-z0-9]+' , ( lambda m : m . group ( ) [ 1 : ] . title ( ) ) , string ) return str ( string )
single function to handle turning object names into class names .