code: def category(self, title, pageid=None, cparams=None, namespace=None):
          
          query = self.LIST.substitute(
              WIKI=self.uri,
              ENDPOINT=self.endpoint,
              LIST='categorymembers')
          status = pageid or title
  
          query += "&cmlimit=500"
  
          if namespace is not None:
              query += "&cmnamespace=%d" % namespace
  
          if title and pageid:
              title = None
  
          if title:
              query += "&cmtitle=" + safequote(title)
  
          if pageid:
              query += "&cmpageid=%d" % pageid
  
          if cparams:
              query += cparams
              status += ' (%s)' % cparams
  
          self.set_status('categorymembers', status)
  
          return query
docs: Returns category query string