code: def setGroups(self, *args, **kwargs):
          
  
          requests = 0
          groups = []
          try:
              for gk in self['groupKeys']:
                  try:
                      g = self.mambugroupclass(entid=gk, *args, **kwargs)
                  except AttributeError as ae:
                      from .mambugroup import MambuGroup
                      self.mambugroupclass = MambuGroup
                      g = self.mambugroupclass(entid=gk, *args, **kwargs)
                  requests += 1
                  groups.append(g)
          except KeyError:
              pass
  
          self['groups'] = groups
  
          return requests
docs: Adds the groups to which this client belongs.
  
          The 'groupKeys' field of the client holds a list of the
          encodedKeys of the groups to which this client belongs.
  
          Returns the number of requests done to Mambu.