code: def list_groups(self, filtr, url_prefix, auth, session, send_opts):
          
          req = self.get_group_request(
              'GET', 'application/json', url_prefix, auth)
          if filtr is not None:
              if not filtr == 'member' and not filtr == 'maintainer':
                  raise RuntimeError(
                      'filtr must be either "member", "maintainer", or None.')
              req.params = {'filter': filtr}
  
          prep = session.prepare_request(req)
          resp = session.send(prep, **send_opts)
          if resp.status_code == 200:
              resp_json = resp.json()
              return resp_json['groups']
  
          msg = ('List groups failed, got HTTP response: ({}) - {}'.format(
              resp.status_code, resp.text))
  
          raise HTTPError(msg, request = req, response = resp)
docs: Get the groups the logged in user is a member of.
  
          Optionally filter by 'member' or 'maintainer'.
  
          Args:
              filtr (string|None): ['member'|'maintainer'] or defaults to None.
              url_prefix (string): Protocol + host such as https://api.theboss.io
              auth (string): Token to send in the request header.
              session (requests.Session): HTTP session to use for request.
              send_opts (dictionary): Additional arguments to pass to session.send().
  
          Returns:
              (list[string]): List of group names.
  
          Raises:
              requests.HTTPError on failure.