def _format_field_name(attr):
 parts = attr.rsplit(':', 1)
 name = parts[(-1)].replace('_', ' ')
 if (name.isupper() or name.islower()):
  name = name.title()
 parts[(-1)] = name
 return ': '.join(parts)

def _format_field_name ( attr ) : parts = attr . rsplit ( ':' , 1 ) name = parts [ ( - 1 ) ] . replace ( '_' , ' ' ) if ( name . isupper ( ) or name . islower ( ) ) : name = name . title ( ) parts [ ( - 1 ) ] = name return ': ' . join ( parts )
format an object attribute in a human-friendly way .