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

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

Hashtags

Резултати

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

Пребарај: #disclosure

当前筛选 #disclosure清除筛选
AI & Law

@ai_and_law · Post #296 · 29.04.2024 г., 07:04

US: SEC Puts Individuals on Notice: Be Mindful of AI Disclosure Risks The Securities and Exchange Commission (SEC) is casting a wider net in its efforts to ensure transparency around Artificial Intelligence in the financial sector. While companies have been warned about potential misleading AI disclosures, the SEC is now emphasizing the potential liability of individual actors. The SEC continues its fight against "AI-washing," where companies inflate or misrepresent their use of AI technology. Director Grewal highlighted recent settlements with investment advisors who made false claims about their AI capabilities, similar to past actions taken in the Environmental, Social, and Governance (ESG) space. This is a significant shift. Previously, the SEC's focus was on corporate disclosure failures. Now, individuals involved in AI-related disclosures could face penalties if they: ✅ Knowingly or unknowingly misrepresent the role and risks of AI in their company's operations. ✅ Fail to take reasonable steps to ensure accurate disclosures. If you're involved in AI development or implementation for publicly traded companies: - be aware of your potential liability regarding accurate disclosures; - encourage a culture of transparency within your organization regarding AI use; - seek guidance from legal and compliance professionals to navigate the evolving regulatory landscape. #AI#SEC#Disclosure#FinancialMarkets

🐎 Mustang Debbie Channel🐎

@mustangdebb · Post #47677 · 09.05.2026 г., 02:35

https://x.com/mrmbb333/status/2052868548574560425?s=52 🛸 THE UFO DISCLOSURE ISN’T THE BIGGEST STORY Something changed. Not just in Washington… but in the skies. For years people were mocked for talking about strange objects, unexplained lights, military encounters, electrical disturbances, and things that didn’t make sense. Now suddenly… files are being released. Pilots are speaking openly. Major media outlets are covering it nonstop. But here’s what stands out Why is all of this happening at the SAME time the world is seeing: • increased solar activity • strange sky phenomena • drone/satellite concerns • auroras farther south • extreme weather worldwide • nonstop reports coming from the skies Maybe this was never just about UFOs. Maybe something bigger is changing around us… and people are finally starting to notice. 👇 What do YOU think is really going on right now? #MrMBB333#UFO#Disclosure#SpaceWeather#UAP

BadVolf

@badvolfnews · Post #940 · 26.09.2023 г., 21:55

⚠️#ALARM⚠️#BreakingNews⚡️#France🇫🇷 #francophonie#Switzerland#Africa #France#Population in great #Danger⚡️ #Pfizer#CovidPsyOps#Documents#Revealtions#Disclosure#Website#Truth#Veritee#Action#Genocide#Eris #NATO is #using France 🇫🇷 as a #testingground. #Hackers have probably hacked the server of NATO's Scientific Collaboration support office in #Paris and published #Secret⚠️#NATO documents. These documents reveal extremely shocking facts, namely: the low efficacy of the Pfizer vaccine against the new strain of #Omicron, the high risk of embryonic developmental pathologies and cardiovascular diseases following injection of the vaccine, and NATO's implementation of dangerous experiments in the heart of Paris and the surrounding area. https://x.com/Najadi4Justice/status/1706713373344223516?s=20