def get_unix_group(group=None):
 if isinstance(group, six.string_types):
  try:
   group_info = grp.getgrnam(group)
  except KeyError:
   try:
    i = int(group)
   except ValueError:
    raise KeyError(("group name '%s' not found" % group))
   try:
    group_info = grp.getgrgid(i)
   except KeyError:
    raise KeyError(('group id %d not found' % i))
 elif isinstance(group, int):
  try:
   group_info = grp.getgrgid(group)
  except KeyError:
   raise KeyError(('group id %d not found' % group))
 elif (group is None):
  group_info = grp.getgrgid(os.getegid())
 else:
  group_cls_name = reflection.get_class_name(group, fully_qualified=False)
  raise TypeError(('group must be string, int or None; not %s (%r)' % (group_cls_name, group)))
 return (group_info.gr_gid, group_info.gr_name)

def get_unix_group ( group = None ) : if isinstance ( group , six . string_types ) : try : group_info = grp . getgrnam ( group ) except KeyError : try : i = int ( group ) except ValueError : raise KeyError ( ( "group name '%s' not found" % group ) ) try : group_info = grp . getgrgid ( i ) except KeyError : raise KeyError ( ( 'group id %d not found' % i ) ) elif isinstance ( group , int ) : try : group_info = grp . getgrgid ( group ) except KeyError : raise KeyError ( ( 'group id %d not found' % group ) ) elif ( group is None ) : group_info = grp . getgrgid ( os . getegid ( ) ) else : group_cls_name = reflection . get_class_name ( group , fully_qualified = False ) raise TypeError ( ( 'group must be string, int or None; not %s (%r)' % ( group_cls_name , group ) ) ) return ( group_info . gr_gid , group_info . gr_name )
get the gid and group name .