def format_counter_name(s):
 def splitCamels(s):
  ' Convert "fooBar" to "foo bar" '
  return re.sub('[a-z][A-Z]', (lambda x: ((x.group(0)[0] + ' ') + x.group(0)[1].lower())), s)
 return string.capwords(re.sub('_', ' ', splitCamels(s)).lower())

def format_counter_name ( s ) : def splitCamels ( s ) : return re . sub ( '[a-z][A-Z]' , ( lambda x : ( ( x . group ( 0 ) [ 0 ] + ' ' ) + x . group ( 0 ) [ 1 ] . lower ( ) ) ) , s ) return string . capwords ( re . sub ( '_' , ' ' , splitCamels ( s ) ) . lower ( ) )
makes counter/config names human readable: foobar_baz -> "foobar baz" foo_barbaz -> "foo bar baz" .