def _canonical_unit_name(name):
 if (not isinstance(name, six.string_types)):
  name = str(name)
 if any((name.endswith(suffix) for suffix in VALID_UNIT_TYPES)):
  return name
 return ('%s.service' % name)

def _canonical_unit_name ( name ) : if ( not isinstance ( name , six . string_types ) ) : name = str ( name ) if any ( ( name . endswith ( suffix ) for suffix in VALID_UNIT_TYPES ) ) : return name return ( '%s.service' % name )
build a canonical unit name treating unit names without one of the valid suffixes as a service .