':type s: str
:type e: str
:type gra: str
:rtype: List[int]'

def retrieve(self, s, e, gra):

    i = self.__granularity[gra]
    begin = s[:i]
    end = e[:i]
    return sorted((id for (id, timestamp) in self.__logs if (begin <= timestamp[:i] <= end)))
