def colon_separated_user_group(arg):
 try:
  parts = arg.split(':', 1)
  if (len(parts) == 1):
   uid = name_to_uid(parts[0])
   gid = (-1)
  else:
   uid = name_to_uid(parts[0])
   gid = name_to_gid(parts[1])
  return (uid, gid)
 except:
  raise ValueError(('Invalid user:group definition %s' % arg))

def colon_separated_user_group ( arg ) : try : parts = arg . split ( ':' , 1 ) if ( len ( parts ) == 1 ) : uid = name_to_uid ( parts [ 0 ] ) gid = ( - 1 ) else : uid = name_to_uid ( parts [ 0 ] ) gid = name_to_gid ( parts [ 1 ] ) return ( uid , gid ) except : raise ValueError ( ( 'Invalid user:group definition %s' % arg ) )
find a user id and group id from a string like user:group .