def _display_unit(unit):
 name = getattr(unit, 'display_name', None)
 if name:
  return u'{0} ({1})'.format(name, unit.location.to_deprecated_string())
 else:
  return unit.location.to_deprecated_string()

def _display_unit ( unit ) : name = getattr ( unit , 'display_name' , None ) if name : return u'{0} ({1})' . format ( name , unit . location . to_deprecated_string ( ) ) else : return unit . location . to_deprecated_string ( )
gets string for displaying unit to user .