code: def connect(self, *args, **kwargs):
          from copy import deepcopy
          if args:
              self.__args = deepcopy(args)
          if kwargs:
              for k,v in kwargs.items():
                  self.__kwargs[k] = deepcopy(v)
          jsresp = {}
          if not self.__urlfunc:
              return
          offset = self.__offset
          window = True
          jsresp = {}
          while window:
              if not self.__limit or self.__limit > OUT_OF_BOUNDS_PAGINATION_LIMIT_VALUE:
                  limit = OUT_OF_BOUNDS_PAGINATION_LIMIT_VALUE
              else:
                  limit = self.__limit
              retries = 0
              while retries < MambuStruct.RETRIES:
                  try:
                      user = self.__kwargs.get('user', apiuser)
                      pwd = self.__kwargs.get('pwd', apipwd)
                      if self.__data:
                          headers = {'content-type': 'application/json'}
                          data = json.dumps(encoded_dict(self.__data))
                          url = iriToUri(self.__urlfunc(self.entid, limit=limit, offset=offset, *self.__args, **self.__kwargs))
                          if self.__method=="PATCH":
                              resp = requests.patch(url, data=data, headers=headers, auth=(user, pwd))
                          else:
                              resp = requests.post(url, data=data, headers=headers, auth=(user, pwd))
                      else:
                          url = iriToUri(self.__urlfunc(self.entid, limit=limit, offset=offset, *self.__args, **self.__kwargs))
                          resp = requests.get(url, auth=(user, pwd))
                      self.rc.add(datetime.now())
                      try:
                          jsonresp = json.loads(resp.content)
                          if type(jsonresp) == list:
                              try:
                                  jsresp.extend(jsonresp)
                              except AttributeError:
                                  jsresp=jsonresp
                              if len(jsonresp) < limit:
                                  window = False
                          else:
                              jsresp = jsonresp
                              window = False
                      except ValueError as ex:
                          raise ex
                      except Exception as ex:
                          raise MambuError("JSON Error: %s" % repr(ex))
                      break
                  except MambuError as merr:
                      raise merr
                  except requests.exceptions.RequestException:
                      retries += 1
                  except Exception as ex:
                      raise ex
              else:
                  raise MambuCommError("ERROR I can't communicate with Mambu")
              offset = offset + limit
              if self.__limit:
                  self.__limit -= limit
                  if self.__limit <= 0:
                      window = False
                      self.__limit = self.__inilimit
          try:
              if u'returnCode' in jsresp and u'returnStatus' in jsresp and jsresp[u'returnCode'] != 0:
                  raise MambuError(jsresp[u'returnStatus'])
          except AttributeError:
              pass
          if self.__method != "PATCH":
              self.init(attrs=jsresp, *self.__args, **self.__kwargs)