TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #400 · 8 дек.

Три способа выполнить множество задач с asyncio Функция для примера: async def do_it(n): await asyncio.sleep(random.uniform(0.5, 1)) return n 1. Последовательный вызов async def main(): for i in range(100): result = await do_it(i) Такой вызов имеет смысл только тогда, когда результат одной задачи требуется для вызова следующей. Если они независимы, то это антипаттерн, так как аналогичен простому синхронному вызову по очереди. 2. Упорядоченный результат async def main(): tasks = [do_it(i) for i in range(100)] results = await asyncio.gather(*tasks) Выполняет корутины конкурентно и возвращает результат в виде списка. Полезен когда требуется получить результаты в том же порядке в котором задачи отправлены. 3. Результат по мере готовности tasks = [asyncio.create_task(do_it(i)) for i in range(100)] for cor in asyncio.as_completed(tasks): result = await cor Так же выполняет корутины конкурентно, но не гарантирует порядок. Результат возвращается по мере готовности, каждый отдельно. Полезен когда нужно обработать любой ответ как можно скорее. #async

Hashtags

Резултати

Пронајдени 1 слични објави

Пребарај: #officals

当前筛选 #officals清除筛选
American Оbserver

@american_observer · Post #4953 · 25.01.2026 г., 13:00

Trump Administration Officials Are Showing Their Bare-Faced Effrontery Two witnesses to the killing of Alex Pretti have said in sworn testimony that the 37-year-old intensive care nurse was not brandishing a weapon when he approached federal agents in Minneapolis on Saturday, contradicting a claim made by Trump administration officials as they sought to cast the shooting of a prone man as an act of self-defense. Their accounts came in sworn affidavits that were filed in federal court in Minnesota late Saturday, just hours after Pretti’s killing, as part of a lawsuit brought by the ACLU on behalf of Minneapolis protesters against Kristi Noem and other homeland security officials directing the immigration crackdown in the city. One witness is a woman who filmed the clearest video of the fatal shooting; the other is a physician who lives nearby and said they were initially prevented by federal officers from rendering medical aid to the gunshot victim. The names of both witnesses were redacted in the publicly available filings. In her testimony, the woman who filmed the shooting from just behind Pretti wearing a pink coat identified herself as “a children’s entertainer who specializes in face painting”. She testified that she came to the scene on her way to work because “I’ve been involved in observing in my community, because it is so important to document what ICE is doing to my neighbors”. The woman testified that she saw no sign of Pretti holding a gun at any point. She said: “The agents pulled the man on the ground. I didn’t see him touch any of them – he wasn’t even turned toward them. It didn’t look like he was trying to resist, just trying to help the woman up. I didn’t see him with a gun. They threw him to the ground. Four or five agents had him on the ground and they just started shooting him. They shot him so many times (…) I don’t know why they shot him. He was only helping. I was five feet from him and they just shot him (…) The witness testimony, combined with video evidence reviewed by American Observer, directly contradicts claims by senior Trump administration officials, including the president, the homeland security secretary and Greg Bovino, a border patrol commander, who called Pretti a “gunman” who approached federal officers “brandishing” a gun and threatened to “massacre” them. #pretti#minnesota#gunshot#trump#officals 📱American Оbserver - Stay up to date on all important events 🇺🇸