def MultiOpen(self, urns, aff4_type=None, mode="r"):
    result = []
    not_opened_urns = []

    for urn in urns:
      key = self._ObjectKey(urn, mode)
      try:
        result.append(self._objects_cache[key])
      except KeyError:
        not_opened_urns.append(urn)

    if not_opened_urns:
      objs = FACTORY.MultiOpen(not_opened_urns, follow_symlinks=False,
                               mode=mode, token=self._token)
      for obj in objs:
        result.append(obj)

        key = self._ObjectKey(obj.urn, mode)
        self._objects_cache[key] = obj

    if aff4_type is not None:
      type_checked_result = []
      for obj in result:
        if isinstance(obj, AFF4Object.classes[aff4_type]):
          type_checked_result.append(obj)

      return type_checked_result
    else:
      return result
Opens many urns efficiently, returning cached objects when possible.
dataset/ETHPy150Open google/grr/grr/lib/aff4.py/DeletionPool.MultiOpen