async def capabilities(self, ability_set):
    abilities = []
    if self.executors:
        preferred = ('psh' if ('psh' in self.executors) else self.executors[0])
        executors = self.executors
        for ai in set([pa.ability_id for pa in ability_set]):
            total_ability = [ab for ab in ability_set if ((ab.ability_id == ai) and (ab.platform == self.platform) and (ab.executor in executors))]
            if (len(total_ability) > 0):
                val = next((ta for ta in total_ability if (ta.executor == preferred)), total_ability[0])
                if self.privileged_to_run(val):
                    abilities.append(val)
    return abilities
async def capabilities(self, ability_set):
    abilities = []
    if self.executors:
        preferred = ('psh' if ('psh' in self.executors) else self.executors[0])
        executors = self.executors
        for ai in set([pa.ability_id for pa in ability_set]):
            total_ability = [ab for ab in ability_set if ((ab.ability_id == ai) and (ab.platform == self.platform) and (ab.executor in executors))]
            if (len(total_ability) > 0):
                val = next((ta for ta in total_ability if (ta.executor == preferred)), total_ability[0])
                if self.privileged_to_run(val):
                    abilities.append(val)
    return abilities