Retrieves one or more bugs by id
 @return [Array<Bug>] a list of bugs
8865
def get_bugs(*ids)
      params = {}
      params[:ids] = normalize_ids ids

      bugs = []
      ret = @client.call('Bug.get', params)
      handle_faults(ret)
      ret['bugs'].each do |bug_data|
        bugs << Bug.new(self, bug_data)
      end
      bugs
    end
486673
def get_many(self, ids):
        """"""
        return [self.instance(id, **fields)
                    for id, fields in zip(ids, self.api.mget(ids))]
26922
def _ids(self):
        """"""
        for pk in self._pks:
            yield getattr(self, pk)

        for pk in self._pks:

            try:
                yield str(getattr(self, pk))
            except ValueError:
                pass
723048
def _parse_status(bug_el):
    """"""
    bug = Bugreport()

    # plain fields
    for field in ('originator', 'subject', 'msgid', 'package', 'severity',
                  'owner', 'summary', 'location', 'source', 'pending',
                  'forwarded'):
        setattr(bug, field, _parse_string_el(bug_el(field)))

    bug.date = datetime.utcfromtimestamp(float(bug_el('date')))
    bug.log_modified = datetime.utcfromtimestamp(float(bug_el('log_modified')))
    bug.tags = [_uc(tag) for tag in str(bug_el('tags')).split()]
    bug.done = _parse_bool(bug_el('done'))
    bug.archived = _parse_bool(bug_el('archived'))
    bug.unarchived = _parse_bool(bug_el('unarchived'))
    bug.bug_num = int(bug_el('bug_num'))
    bug.mergedwith = [int(i) for i in str(bug_el('mergedwith')).split()]
    bug.blockedby = [int(i) for i in str(bug_el('blockedby')).split()]
    bug.blocks = [int(i) for i in str(bug_el('blocks')).split()]

    bug.found_versions = [_uc(str(el)) for el in
                          bug_el('found_versions').children() or []]
    bug.fixed_versions = [_uc(str(el)) for el in
                          bug_el('fixed_versions').children() or []]
    affects = [_f for _f in str(bug_el('affects')).split(',') if _f]
    bug.affects = [_uc(a).strip() for a in affects]
    # Also available, but unused or broken
    # bug.keywords = [_uc(keyword) for keyword in
    #                 str(bug_el('keywords')).split()]
    # bug.fixed = _parse_crappy_soap(tmp, "fixed")
    # bug.found = _parse_crappy_soap(tmp, "found")
    # bug.found_date = \
    #     [datetime.utcfromtimestamp(i) for i in tmp["found_date"]]
    # bug.fixed_date = \
    #     [datetime.utcfromtimestamp(i) for i in tmp["fixed_date"]]
    return bug
711248
def [](id)
      interfaces_hash.fetch(id.to_s) do
        raise UnknownInterface.new(id.to_s),
              "Unknown interface: #{id}"
      end
    end
472936
def duplicate_ids(instance):
    
    if instance['type'] != 'bundle' or 'objects' not in instance:
        return

    unique_ids = {}
    for obj in instance['objects']:
        if 'id' not in obj or 'modified' not in obj:
            continue
        elif obj['id'] not in unique_ids:
            unique_ids[obj['id']] = obj['modified']
        elif obj['modified'] == unique_ids[obj['id']]:
            yield JSONError("Duplicate ID '%s' has identical `modified` timestamp."
                            " If they are different versions of the same object, "
                            "they should have different `modified` properties."
                            % obj['id'], instance['id'], 'duplicate-ids')
240981
def get_bug_simple(self, bugid):
        
        payload = {'ids': bugid}
        d = self.call('Bug.get', payload)
        d.addCallback(self._parse_bug_callback)
        return d
655988
def update(self):
        
        if 'id' in self._bug:
            result = self._bugsy.request('bug/%s' % self._bug['id'])
            self._bug = dict(**result['bugs'][0])
        else:
            raise BugException("Unable to update bug that isn't in Bugzilla")
229186
def put_bug(self, bugid, bug_update):
        ''''''
        assert type(bug_update) is DotDict
        if (not 'ids' in bug_update):
            bug_update.ids = [bugid]

        return self._put('bug/{bugid}'.format(bugid=bugid),
                json.dumps(bug_update))
429415
def has_bug?(name, _options = {})
      unless self.respond_to?(:version) && version
        puts 'To test for the presence of a bug the object must implement an attribute'
        puts "called 'version' which returns the IP version represented by the the object."
        fail 'Version undefined!'
      end
      name = name.to_s.downcase.to_sym
      if bugs[name]
        bugs[name].present_on_version?(version)
      else
        false
      end
    end
1069886
def method_missing(id, *args, &block)
      ids = id.to_s
      if instance_variable_defined?(:@attributes)
        return @attributes[id] if @attributes.has_key?(id)
        return @attributes[ids] if @attributes.has_key?(ids)
      end
      raise NoMethodError.new("#{ids} not found", name)
    end
1071423
def find(id)
      raise ArgumentError.new("Missing id/slug") unless id

      result = access_token.get("#{API_BASE}#{self.class::API_PATH}#{id}")
      raise ServiceError.new(result.code, result.body) unless result.code == "200"

      self.class::ITEM_CLASS.new(result.body)
    end
1148041
def rules
      return [] if result[:rules].nil?
      Array.wrap(result[:rules][:rule_compliance_response]).map do |rule|
        ComplianceRule.new(rule)
      end
    end
883578
function (id) {
    var todos = [];
    for (var i in _todos) {
      if (_todos[i].todo_list_id === id) {
        todos.push(_todos[i]);
      }
    }
    return todos;
  }
260055
def _parse_bugs_callback(self, value):
        
        return list(map(lambda x: self._parse_bug(x), value['bugs']))
1074763
def list(self, id):
        
        id = self.__unpack_id(id)        
        return self.__api_request('GET', '/api/v1/lists/{0}'.format(id))
100817
def get(cls, id):
        

        # cached?
        if CACHE:
            if id in _cache['Pool']:
                log.debug('cache hit for pool %d' % id)
                return _cache['Pool'][id]
            log.debug('cache miss for pool %d' % id)

        try:
            pool = Pool.list({'id': id})[0]
        except (IndexError, KeyError):
            raise NipapNonExistentError('no pool with ID ' + str(id) + ' found')

        _cache['Pool'][id] = pool
        return pool