code: def main(*argv):
      
      try:
          #   Inputs
          #
          adminUsername = argv[0]
          adminPassword = argv[1]
          siteURL = argv[2]
          groupTitle = argv[3]
          groupTags = argv[4]
          description = argv[5]
          access = argv[6]
  
          #   Logic
          #
          #   Connect to the site
          #
          sh = arcrest.AGOLTokenSecurityHandler(adminUsername, adminPassword)
          admin = arcrest.manageorg.Administration(url=siteURL,
                                                  securityHandler=sh,
                                                  initialize=True)
          community = admin.community
          #   Create Group
          #
          res = community.createGroup(title=groupTitle,
                                      tags=groupTags,
                                      description=description,
                                      snippet="",
                                      phone="",
                                      access=access,
                                      sortField="title",
                                      sortOrder="asc",
                                      isViewOnly=False,
                                      isInvitationOnly=False,
                                      thumbnail=None)
          arcpy.SetParameterAsText(7, str(res))
      except arcpy.ExecuteError:
          line, filename, synerror = trace()
          arcpy.AddError("error on line: %s" % line)
          arcpy.AddError("error in file name: %s" % filename)
          arcpy.AddError("with error message: %s" % synerror)
          arcpy.AddError("ArcPy Error Message: %s" % arcpy.GetMessages(2))
      except FunctionError, f_e:
          messages = f_e.args[0]
          arcpy.AddError("error in function: %s" % messages["function"])
          arcpy.AddError("error on line: %s" % messages["line"])
          arcpy.AddError("error in file name: %s" % messages["filename"])
          arcpy.AddError("with error message: %s" % messages["synerror"])
          arcpy.AddError("ArcPy Error Message: %s" % messages["arc"])
      except:
          line, filename, synerror = trace()
          arcpy.AddError("error on line: %s" % line)
          arcpy.AddError("error in file name: %s" % filename)
          arcpy.AddError("with error message: %s" % synerror)
docs: main driver of program