def MultiOpen(self, urns, aff4_type=None, mode="r"):
    """Opens many urns efficiently, returning cached objects when possible."""
    result = []
    not_opened_urns = []

    for urn in urns:
      key = self._ObjectKey(urn, mode)
      try:
        result.append(self._objects_cache[key])
      except __HOLE__:
        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
dataset/ETHPy150Open google/grr/grr/lib/aff4.py/DeletionPool.MultiOpen