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

Резултати

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

Пребарај: #gaia

当前筛选 #gaia清除筛选
Universe Mysteries 🪐

@cosmomyst · Post #511 · 21.11.2025 г., 12:21

🪐 As scientists plan for the future of interstellar travel, precision targeting has become a top priority, with research focusing on how to accurately send spacecraft toward stars like Alpha Centauri, over 4 light-years from Earth. To achieve this, astronomers use extremely detailed maps of nearby stars—created by ESA’s Gaia mission—which charts the exact positions and motions of more than a billion stars, allowing future probes to steer through space with unprecedented accuracy as they journey beyond our solar system. ✨ #spaceships⚡#navigation⚡#gaia⚡#nasa⚡#galaxy⚡#stars⚡#astronomy⚡#universe⚡#cosmos⚡#space 👉subscribe Universe Mysteries 👉more Channels ​

GitHub Trends

@githubtrending · Post #15145 · 14.09.2025 г., 13:00

#javascript#gaia#general_purpose#multiagent_systems#multimodel DeepResearchAgent is a smart system that uses a top-level planner to break down big tasks into smaller parts and assigns them to specialized agents like analyzers, researchers, and browser tools. It can deeply analyze data, do thorough research, and automatically gather up-to-date information from the web. It supports many AI models and tools, including image and video generation, and runs tasks efficiently with asynchronous operations. This system helps you get detailed, well-organized research results faster and with less effort by automating complex, multi-step tasks and combining many AI capabilities in one framework. https://github.com/SkyworkAI/DeepResearchAgent

GitHub Trends

@githubtrending · Post #15399 · 07.01.2026 г., 13:30

#python#agent#agent_framework#browsecomp#deep_research#futurex#gaia#hle#research_agent#search_agent#xbench MiroThinker v1.5 is the top open-source AI search agent with a 256K context window and up to 400 tool calls per task for deep web research, code execution, and multi-step reasoning. It leads benchmarks like HLE-Text (39.2%), BrowseComp (69.8%), and GAIA (80.8%), beating other free agents at low cost. You benefit by getting accurate, real-world research help—like finding arXiv papers or solving complex queries—faster and cheaper than paid tools, with full open-source access on GitHub and Hugging Face. https://github.com/MiroMindAI/MiroThinker

Venture Village Wall 🦄

@venturevillagewall · Post #4020 · 29.01.2025 г., 13:00

Recent Funding Rounds Overview 🔍 Latest funding rounds: - Zhongke Era: $27.61M - R&D in industrial control tech. Learn more - EIGHT Brewing Co: $26M - Organic lager by Troy Aikman. Learn more - Oncomatryx: $26.30M - Precision drugs for cancer treatment. Learn more - Atomicwork: $25M - AI-based IT service management. Learn more - Manas AI: $24.60M - AI models for drug development. Learn more - Token Security: $20M - Machine-First Identity Security. Learn more - iPronics: $20.86M - Solid-state optical switches for AI. Learn more - Gaia: $14M - Improving IVF payments. Learn more - Astrome Technologies: $10M - 5G internet infrastructure. Learn more - Paytner Factoring: $8.97M - B2B payment services. Learn more Keep an eye on these innovative startups! #Funding#ZhongkeEra#EIGHTBrewingCo#Oncomatryx#Atomicwork#ManasAI#TokenSecurity#iPronics#Gaia#Astrome#Paytner#AI#VC