@AiGenLabsStyles · Post #1698 · 13.10.2025 г., 09:14
🔝🔝 --sref 2089811485 --s 150 --v 7 #Cinematic#Surreal#Vibrant#Detailed#Magenta#StyleRandom#MidJourney#AiGenLabs#Ai 〰️〰️〰️〰️〰️ 🔥AiGenLabs - main channel
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
Пребарај: #magenta
@AiGenLabsStyles · Post #1698 · 13.10.2025 г., 09:14
🔝🔝 --sref 2089811485 --s 150 --v 7 #Cinematic#Surreal#Vibrant#Detailed#Magenta#StyleRandom#MidJourney#AiGenLabs#Ai 〰️〰️〰️〰️〰️ 🔥AiGenLabs - main channel
@djangoproject · Post #252 · 02.02.2017 г., 18:13
https://magenta.tensorflow.org/welcome-to-magenta We’re happy to announce #Magenta, a project from the Google Brain team that asks: Can we use #machine_learning to create compelling art and music? If so, how? If not, why not? We’ll use #TensorFlow, and we’ll release our models and tools in open source on our GitHub. We’ll also post demos, tutorial blog postings and technical papers. Soon we’ll begin accepting code contributions from the community at large. If you’d like to keep up on Magenta as it grows, you can follow us on our GitHub and join our discussion group.
@AiGenLabsStyles · Post #1153 · 13.03.2025 г., 11:16
⭐️ --sref 2376998380 #Photography#Vintage#Muted#Orange#Magenta#Cinematic#Detailed#StyleRandom#MidJourney#AiGenLabs#Ai 〰️〰️〰️〰️〰️ 👥TheLab - our community 🔥AiGenLabs - main channel
@AiGenLabsStyles · Post #1734 · 30.10.2025 г., 07:12
🔝🔝 --sref 708454023 --v 7 #Cinematic#Surreal#Vibrant#Magenta#White#Minimalist#Detailed#StyleRandom#MidJourney#AiGenLabs#Ai 〰️〰️〰️〰️〰️ 🔥AiGenLabs - main channel
@AiGenLabsStyles · Post #1414 · 25.07.2025 г., 09:45
🔝🔝 --sref 2851911678 --v 7 #Illustration#2d#Vibrant#Minimalist#Magenta#Vector#Cute#StyleRandom#MidJourney#AiGenLabs#Ai 〰️〰️〰️〰️〰️ 🔥AiGenLabs - main channel
@AiGenLabsStyles · Post #1467 · 09.08.2025 г., 07:12
🔝🔝 --sref 481102813 --v 7 #Illustration#2d#Vibrant#Detailed#Dark#Magenta#Neon#Cartoon#StyleRandom#MidJourney#AiGenLabs#Ai 〰️〰️〰️〰️〰️ 🔥AiGenLabs - main channel
@DMJ_Themes · Post #141 · 04.10.2019 г., 05:39
Jimi Hendrix Psy Theme. https://t.me/addtheme/JimiHendrixPsy #violet#magenta#blue#aquamarine#psychedelic (Original theme here)
@DMJ_Themes · Post #56 · 07.05.2017 г., 21:05
#violet#magenta#blue#aquamarine#psychedelic @DMJ_Themes
@DMJ_Themes · Post #55 · 07.05.2017 г., 21:00
Jimi Hendrix desktop theme. A psychedelic telegram desktop theme. @DMJ_Themes #violet#magenta#blue#aquamarine#psychedelic t.me/DMJ_Themes
@AiGenLabsStyles · Post #1493 · 16.08.2025 г., 08:13
🔝🔝 --sref 3706150594 --v 7 #Illustration#2d#Vibrant#Minimalist#Magenta#Pink#Vector#Cute#StyleRandom#MidJourney#AiGenLabs#Ai 〰️〰️〰️〰️〰️ 🔥AiGenLabs - main channel
@AiGenLabsStyles · Post #1390 · 19.07.2025 г., 08:13
🔝🔝 --sref 3323562529 --v 7 #Illustration#2d#Vibrant#Minimalist#Magenta#Vector#Art#StyleRandom#MidJourney#AiGenLabs#Ai 〰️〰️〰️〰️〰️ 🔥AiGenLabs - main channel
@ThemesM8 · Post #210 · 06.09.2021 г., 13:28
https://t.me/addtheme/wyYnTX8llrx61I5B 🌈@ThemesM8✨ #dark#cat#kitten#android#purple#blue#black#amoled#pink#cute#cyan#magenta#violet#night#colors#colorful#desktop