code: def removeUserGroups(self, users=None):
           
          admin = None
          userCommunity = None
          portal = None
          groupAdmin = None
          user = None
          userCommData = None
          group = None
          try:
  
              admin = arcrest.manageorg.Administration(securityHandler=self._securityHandler)
              if users is None:
                  print ("You have selected to remove all users groups, you must modify the code to do this")
                  usersObj = []
                  commUsers = admin.portals.portalSelf.users(start=1, num=100)
                  usersObj = commUsers['users']
  
                  return
              else:
                  usersObj = []
                  userStr = users.split(',')
                  for user in userStr:
                      try:
                          user = admin.community.users.user(str(user).strip())
                          usersObj.append(user)
                      except:
                          print ("%s does not exist" % str(user).strip())
              if usersObj:
                  for userCommData in usersObj:
                      print ("Loading groups for user: %s" % userCommData.username)
  
                      if userCommData.groups:
                          for group in userCommData.groups:
                              groupObj = admin.community.groups.group(groupId=group['id'])
                              if groupObj.owner == userCommData.username:
                                  print (groupObj.delete())
                      else:
                          print ("No Groups Found")
          except:
              line, filename, synerror = trace()
              raise common.ArcRestHelperError({
                          "function": "removeUserGroups",
                          "line": line,
                          "filename":  filename,
                          "synerror": synerror,
                                          }
                                          )
          finally:
              admin = None
              userCommunity = None
              portal = None
              groupAdmin = None
              user = None
              userCommData = None
              group = None
  
              del admin
              del userCommunity
              del portal
              del groupAdmin
              del user
              del userCommData
              del group
  
              gc.collect()
docs: Removes users' groups.
          
          Args:
              users (str): A comma delimited list of user names.
                  Defaults to ``None``.
          
          Warning:
              When ``users`` is not provided (``None``), all users
              in the organization will have their groups deleted!