<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def deleteInactiveDevicesByAge(self, age_days):
 """ Delete all inactive devices from the device list storage and cache that are older then a given number of days. This also deletes the corresponding sessions, so if a device comes active again and tries to send you an encrypted message you will not be able to decrypt it. You are not allowed to delete inactive devices that were inactive for less than a day. Thus, the minimum value for age_days is 1. It is recommended to keep inactive devices for a longer period of time (e.g. multiple months), as it reduces the chance for message loss and doesn't require a lot of storage. The recommended alternative to deleting inactive devices by age is to delete them by count/quota. Look at the deleteInactiveDevicesByQuota method for that variant. """


        if age_days < 1:
            return

        now = time.time()

        bare_jids = yield self._storage.listJIDs()

        for bare_jid in bare_jids:
            devices = yield self.__loadInactiveDevices(bare_jid)

            delete_devices = []
            for device, timestamp in list(devices.items()):
                elapsed_s = now - timestamp
                elapsed_m = elapsed_s / 60
                elapsed_h = elapsed_m / 60
                elapsed_d = elapsed_h / 24

                if elapsed_d >= age_days:
                    delete_devices.append(device)

            if len(delete_devices) > 0:
                yield self.__deleteInactiveDevices(bare_jid, delete_devices)