@nijiuramaids · Post #8979 · 03.04.2026 г., 13:03
〘🫖〙#Usai ㅤ┈┈┈┈┈┈┈┈┈ Подписаться | Предложка | Буст
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #146 · 16 сеп.
Функция sub в regex может принимать функцию в качестве аргумента repl. 📄 Из документации: If repl is a function, it is called for every non-overlapping occurrence of pattern. The function takes a single match object argument, and returns the replacement string. То есть для каждого совпадения будет вызвана функция для вычисления замены вместо замены на одну и ту же строку для всех совпадений. Иными словами, для замены разных совпадений на разные строки не потребуется запускать re.sub() много раз для каждой строки замены. Достаточно определить функцию, которая вернёт строку для каждого из совпадений. Описание слишком запутанное🤔, давайте лучше рассмотрим на простом примере: Создаем карту замены. То есть какие строки на какие требуется менять. remap = { 'раз': '1', 'два': '2', 'три': '3', 'четыре': '4', 'пять': '5', } Пишем функцию поиска строки для замены. Единственным аргументом будет объект re.Match. Используя данные этого объекта мы вычисляем замену on-the-fly! def get_str(match: re.Match): word = match.group(1) return remap.get(word.lower()) or word Пример текста. text = '''Раз Два Три Четыре Пять Вместе будем мы считать Пять Четыре Три Два Раз Мы считать научим вас ''' Теперь запускаем re.sub и вместо строки замены (repl) подаём имя функции. (Данный паттерн ищет отдельные слова в тексте) >>> print(re.sub(r'(\w+)', get_str, text)) 1 2 3 4 5 Вместе будем мы считать 5 4 3 2 1 Мы считать научим вас Думаю, достаточно наглядно 🤓 #libs#regex
Пребарај: #usai
@nijiuramaids · Post #8979 · 03.04.2026 г., 13:03
〘🫖〙#Usai ㅤ┈┈┈┈┈┈┈┈┈ Подписаться | Предложка | Буст
Hashtags
@nijiuramaids · Post #8932 · 30.03.2026 г., 05:03
〘🫖〙#Usai ㅤ┈┈┈┈┈┈┈┈┈ Подписаться | Предложка | Буст
Hashtags
@nijiuramaids · Post #8310 · 10.08.2025 г., 17:01
〘🫖〙#Usai
Hashtags
@nijiuramaids · Post #8188 · 31.07.2025 г., 05:03
〘🫖〙#Usai
Hashtags
@nijiuramaids · Post #7783 · 27.05.2025 г., 17:07
〘🫖〙#Usai
Hashtags
@papaevaticanonews · Post #9520 · 02.03.2026 г., 15:58
“Il conflitto in crescita rischia di sfociare in una guerra regionale più ampia”. Con queste parole mons. Paul S. Coakley, arcivescovo di Oklahoma City e presidente della Conferenza episcopale degli Stati Uniti (Usccb), ha chiesto agli #USAi, all’#Iran e all’intera comunità internazionale di tornare al dialogo e di percorrere ogni strada verso una pace giusta e duratura. Facendo proprie le parole di Papa #LeoneXIV – che all’Angelus di ieri ha invitato a fermare “la spirale della violenza prima che diventi una voragine irreparabile” e a promuovere “il bene dei popoli, che anelano a una convivenza pacifica, fondata sulla giustizia” – il presule ha rivolto “un appello accorato a tutte le parti coinvolte perché la diplomazia riacquisti il suo ruolo” e ha chiesto “una cessazione della spirale della violenza” e un ritorno al “coinvolgimento diplomatico multilaterale”. Mons. Coakley ha quindi invitato “i cattolici e tutti gli uomini di buona volontà a continuare le ardenti preghiere per la pace in Medio Oriente, per la sicurezza delle truppe e degli innocenti”, affidando il mondo all’intercessione di Maria, “Regina della pace”.
@nijiuramaids · Post #7920 · 14.06.2025 г., 10:59
ᵒˢ 💿#Usai и Саба #ОСтан Канал о персонификациях OS
@ai_and_law · Post #724 · 16.12.2025 г., 08:04
🇺🇸U.S. Executive Order Signals Federal Preemption in AI Policy President Donald Trump has signed a new Executive Order aimed at implementing the U.S. AI Action Plan and removing what the administration views as barriers to American leadership in AI. The Order represents the White House’s second effort to limit state-level AI regulation, following the Senate’s rejection of a proposed 10-year moratorium. It frames extensive state AI laws as a legal and strategic risk, arguing that fragmented regulation across states could undermine innovation and national competitiveness. The Order advances federal authority through three core rationales. First, it argues that AI companies must operate without burdensome, inconsistent state rules, particularly given the absence of a comprehensive federal AI law and the existence of over 1,000 state-level AI bills. Second, it targets state laws that, in the administration’s view, mandate “ideological bias” in AI systems, framing such requirements as potentially violating the Federal Trade Commission Act’s ban on unfair or deceptive practices. Third, it establishes an AI Litigation Task Force within the Department of Justice to challenge state AI laws deemed to unlawfully regulate interstate commerce, conflict with federal policy, or otherwise be unlawful in the Attorney General’s judgment. Together, these measures consolidate regulatory control at the federal level while deferring the adoption of a comprehensive national AI statute. The Executive Order positions federal enforcement and preemption as the primary tools for shaping U.S. AI governance, with significant implications for the future role of state-level AI regulation. #AIRegulation#USAI ##AIPolicy#AILaw
@nijiuramaids · Post #8798 · 20.03.2026 г., 08:01
〘🫖〙#Usai#bTensai#Group ㅤ┈┈┈┈┈┈┈┈┈ Подписаться | Предложка | Буст
@nijiuramaids · Post #8591 · 03.12.2025 г., 16:04
〘🫖〙#Yabai#Usai#Group tumblr: huongie ㅤ┈┈┈┈┈┈┈┈┈ Подписаться | Предложка | Буст
@nijiuramaids · Post #8386 · 05.11.2025 г., 12:02
☾⚞𖤎⚟☽ #Group #Usankusai#Usai ウサ銀
Hashtags
@ai_and_law · Post #631 · 08.08.2025 г., 07:04
🇺🇸White House Centralizes AI Policy Resources in New Online Hub The White House has launched a dedicated AI policy website, consolidating key U.S. federal actions on artificial intelligence. Other useful relevant documents on US AI policy: ✔️Promoting the Export of the American AI Technology Stack ✔️Accelerating Federal Permitting of Data Center Infrastructure ✔️Removing Barriers to American Leadership in Artificial Intelligence ✔️Advancing Artificial Intelligence Education for American Youth ✔️Preventing Woke AI in the Federal Government ✔️Restoring Common Sense to Federal Procurement #USAI#ExecutiveOrders#AIGovernance#WhiteHouse