@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 #65 · 8 апр.
Небольшой трик с регулярными выражениями который редко вижу в чужом коде. Допустим, вам нужно распарсить простой текст и вытащить оттуда пары имя+телефон. Вернуть всё это надо в виде списка словарей. Возьмем очень простой пример текста. >>> text = ''' >>> Alex:8999123456 >>> Mike:+799987654 >>> Oleg:+344456789 >>> ''' Соответственно, для выделения нужных элементов будем использовать группы. Получится такой паттерн: (\w+):([\d+]+) Как мы будем формировать словарь из найденных групп? >>> import re >>> results = [] >>> for match in re.finditer(r"(\w+):([\d+]+)", text): >>> results.append({ >>> "name": match.group(1), >>> "phone": match.group(2) >>> }) >>> print(results) [{'name': 'Alex', 'phone': '8999123456'}, ...] Можно немного сократить запись используя zip >>> results = [] >>> for match in re.finditer(r"(\w+):([\d+]+)", text): >>> results.append(dict(zip(['name', 'phone'], match.groups()))) Но есть способ лучше! Это именованные группы в regex. Можно в паттерне указать имя группы и результат сразу забрать в виде словаря. >>> for match in re.finditer(r"(?P<name>\w+):(?P<phone>[\d+]+)", text): >>> results.append(match.groupdict()) То есть всё что я сделал, это добавил в начале группы (внутри сбокочек) такую запись: (?P<group-name>...) Теперь найденная группа имеет имя и можно обратиться к ней как к элементу списка >>> name = match['name'] Либо забрать сразу весь словарь методом groupdict() >>> match.groupdict() #tricks#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