code: def _getbugs(self, idlist, permissive,
              include_fields=None, exclude_fields=None, extra_fields=None):
          oldidlist = idlist
          idlist = []
          for i in oldidlist:
              try:
                  idlist.append(int(i))
              except ValueError:
                  idlist.append(i)
          extra_fields = self._listify(extra_fields or [])
          extra_fields += self._getbug_extra_fields
          getbugdata = {"ids": idlist}
          if permissive:
              getbugdata["permissive"] = 1
          getbugdata.update(self._process_include_fields(
              include_fields, exclude_fields, extra_fields))
          r = self._proxy.Bug.get(getbugdata)
          if self._check_version(4, 0):
              bugdict = dict([(b['id'], b) for b in r['bugs']])
          else:
              bugdict = dict([(b['id'], b['internals']) for b in r['bugs']])
          ret = []
          for i in idlist:
              found = None
              if i in bugdict:
                  found = bugdict[i]
              else:
                  for valdict in bugdict.values():
                      if i in self._listify(valdict.get("alias", None)):
                          found = valdict
                          break
              ret.append(found)
          return ret