Типизация в Python с использованием модуля typing
В Python модуль typing предоставляет возможность добавлять подсказки типов для переменных, функций и классов, что делает код более явным и понятным.
Зачем использовать типизацию?
1. Ясность и понятность кода: Добавление аннотаций типов помогает читателям быстро понять, какие данные ожидаются и какие типы переменных возвращаются из функций.
2. Предотвращение ошибок: Статические анализаторы кода, такие как mypy, могут обнаруживать потенциальные ошибки до выполнения программы, что уменьшает количество багов.
3. Документация кода: Подсказки типов могут служить формой документации, особенно полезной при совместной разработке. Разработчики могут быстро понимать интерфейсы функций и классов.
Пример использования типизации для переменных и функций:
from typing import List, Tuple
def multiply(a: int, b: int) -> int:
return a * b
def process_list(data: List[int]) -> Tuple[int, int]:
sum_values = sum(data)
average = sum_values / len(data)
return sum_values, average
# Пример использования
result1 = multiply(5, 3)# Ожидается int
data_list = [1, 2, 3, 4, 5]
result2 = process_list(data_list)# Ожидается Tuple[int, int]
Здесь a: int и b: int указывают на типы аргументов функции, а -> int и -> Tuple[int, int] - на типы возвращаемых значений. Это помогает читателям кода лучше понимать ожидаемую структуру данных и типы переменных.
Типизация делает ваш код более структурированным, улучшает его читабельность и может служить документацией, облегчая разработку.
#python#typing
#python#download_music#hacktoberfest#mp3#music#playlists#python#song#song_lyrics#spotdl#spotdl_cli#spotify#youtube_music
spotDL is a fast, easy tool that downloads songs from Spotify playlists by finding them on YouTube, including album art, lyrics, and metadata. You install it via Python’s pip and need FFmpeg for audio processing. It works mainly through the command line and supports batch downloads, syncing playlists, and updating metadata. Audio quality is up to 128 kbps for free users and 256 kbps for YouTube Music Premium users. This tool helps you get your Spotify music offline with metadata, but the quality depends on YouTube sources. It’s great if you want a free, quick way to save Spotify songs with details included.
https://github.com/spotDL/spotify-downloader
#python#3d#3d_aigc#3d_generation#diffusion_models#hunyuan3d#image_to_3d#shape#shape_generation#text_to_3d#texture_generation
Hunyuan3D 2.0 is a powerful tool that creates detailed 3D models with textures in two steps: first building the shape, then adding colors and materials. It works efficiently on standard computers (as low as 5GB VRAM for basic models) and offers multiple ways to use it, like coding, Blender plugins, or online demos, making it accessible for creating game-ready 3D assets, VR/AR content, or custom designs without needing advanced hardware.
https://github.com/Tencent/Hunyuan3D-2
#python#agent#agentic_ai#agentic_framework#agentic_workflow#ai#ai_agents#ai_companion#ai_roleplay#benchmark#framework#llm#mcp#memory#open_source#python#sandbox
MemU lets AI systems take in conversations, documents, and media, turn them into structured memories, and store them in a clear three-layer file system. It offers both fast embedding search and deeper LLM-based retrieval, works with many data types, and supports cloud or self-hosted setups with simple APIs. This helps you build AI agents that truly remember past interactions, retrieve the right context when needed, and improve over time, making your applications more accurate, personal, and efficient.
https://github.com/NevaMind-AI/memU
#engineering#machinelearning#cloud#datascience#python#engineer#aws#mathematics#google
Roadmap to Become a Professional Machine Learning Engineer
-----
Canal principal:@repo_science
Cupones:@freecoupons_reposcience
-----
#other#artificial_intelligence#artificial_intelligence_projects#awesome#computer_vision#computer_vision_project#data_science#deep_learning#deep_learning_project#machine_learning#machine_learning_projects#nlp#nlp_projects#python
You can access a huge, constantly updated list of over 500 artificial intelligence projects with ready-to-use code covering machine learning, deep learning, computer vision, and natural language processing. This collection includes projects for beginners and advanced users, with links to tutorials, datasets, and real-world applications like chatbots, healthcare, and time series forecasting. Using this resource helps you learn AI by doing practical projects, speeding up your coding skills, and building a strong portfolio for jobs or research. It saves you time searching for quality projects and gives you tested, working code to study and modify.
https://github.com/ashishpatel26/500-AI-Machine-learning-Deep-learning-Computer-vision-NLP-Projects-with-code
#python#asr#deeplearning#generative_ai#large_language_models#machine_translation#multimodal#neural_networks#speaker_diariazation#speaker_recognition#speech_synthesis#speech_translation#tts
NVIDIA NeMo is a powerful, easy-to-use platform for building, customizing, and deploying generative AI models like large language models (LLMs), vision language models, and speech AI. It lets you quickly train and fine-tune models using pre-built code and checkpoints, supports the latest model architectures, and works on cloud, data center, or edge environments. NeMo 2.0 is even more flexible and scalable, with Python-based configuration and modular design, making it simple to experiment and scale up. The main benefit is that you can create advanced AI applications faster, with less effort, and at lower cost, while getting high performance and easy deployment options[1][2][3].
https://github.com/NVIDIA/NeMo
#typescript#ai#chatgpt#docsgpt#hacktoberfest#information_retrieval#language_model#llm#machine_learning#natural_language_processing#python#pytorch#rag#react#semantic_search#transformers#web_app
DocsGPT is an open-source AI tool that helps you quickly find accurate answers from many types of documents and web sources without errors. It supports formats like PDF, DOCX, images, and integrates with websites, APIs, and chat platforms like Discord and Telegram. You can deploy it privately for security, customize it to fit your brand, and connect it to tools for advanced actions. This means you save time searching for information, get reliable answers with sources, and improve productivity whether you’re a developer, support team, or business user. It’s easy to set up and scales well for many users[2][3][4].
https://github.com/arc53/DocsGPT
https://docs.pipenv.org/
#Pipenv — the officially recommended #Python#packaging tool from Python.org, free (as in freedom).
Pipenv is a tool that aims to bring the best of all packaging worlds (#bundler, #composer, #npm, #cargo, #yarn, etc.) to the Python world. #Windows is a first–class citizen, in our world.
It automatically creates and manages a #virtualenv for your projects, as well as adds/removes #packages from your #Pipfile as you install/uninstall packages. It also generates the ever–important Pipfile.lock, which is used to produce deterministic builds.
http://www.jaggedverge.com/2017/11/how-a-web-page-request-makes-it-down-to-the-metal/
How a web page request makes it down to the metal
by : Janis Posted in : Tutorials, work-in-progess Tags : #NGINX, #Python No Comments
The other day I was interested in how many steps occur between sending a #POST or #GET#request from a website to the actual processing that happens on the CPU of the #server. I figured that I knew bits and pieces of the puzzle but I wanted to see the complete path from the highest levels of abstraction all the way to the lowest without missing anything too big in-between. It turns out that in a modern web system there are a lot of steps. I have been really fascinated by this much like the explorer that wants to find a path from one known place to another. If you are interested in better understanding how your computer works you might find walking along this path with your tech stack helpful.
Frontend
prelude: GET request
Browser page #rendering
POST request
sidenote: #CSRF#token
Network stack
sidenote: The Internet
#TCP
sidenote: more comprehensive treatment of network stack
Backend
Handling web request
#WSGI
#Django
Django URL routing
Django views
Python implementations
#CPython
CPython bytecode
CPython bytecode execution details
Machine Code
CPython to machine code
Machine code execution
Hardware implementation details
Microcode
Processor #pipeline
Silicon implementation of addition
Silicon adder unit
AND gate
Transistor
#python#artificial_intelligence#cloud_ml#computer_systems#courseware#deep_learning#edge_machine_learning#embedded_ml#machine_learning#machine_learning_systems#mobile_ml#textbook#tinyml
You can learn how to build real-world AI systems from start to finish with an open-source textbook originally from Harvard University. It teaches you not just how to train AI models but how to design scalable systems, manage data pipelines, deploy models in production, monitor them continuously, and optimize for devices like phones or IoT gadgets. This helps you become an engineer who can create efficient, reliable, and sustainable AI systems that work well in practice. The book offers hands-on labs, community support, and free online access, making it easier to gain practical skills in machine learning systems engineering.
https://github.com/harvard-edge/cs249r_book
#cplusplus#apple_silicon#bsd#c_plus_plus#cmake#floss#game#gplv2#json#linux#lua#macos_app#python#strategy#windows
Widelands is a free, open-source real-time strategy game like Settlers II, where you lead a small clan to build roads, gather resources like wood and gold, manage four unique tribes, trade, or fight in single-player campaigns and multiplayer. Download it easily for Windows, Mac, or Linux, or compile from source with simple scripts and tools like CMake on various systems. This lets you enjoy deep, replayable empire-building fun at no cost, anytime with friends or AI.
https://github.com/widelands/widelands
#python#data_analysis#dingtalk_robot#docker#feishu_robot#hot_news#mail#mcp#mcp_server#news#ntfy#python#telegram_bot#trending_topics#wechat_robot
TrendRadar is a lightweight, easy-to-deploy tool that gathers trending topics from 11+ major platforms like Zhihu, Douyin, and Baidu in just 30 seconds. It lets you set custom keywords to filter only news you care about, eliminating information overload. The tool offers three smart notification modes—daily summaries, current rankings, or incremental alerts—and supports multiple channels including WeChat Work, Feishu, DingTalk, Telegram, and email. You can customize how trends are ranked using a personalized algorithm that weighs ranking position, frequency, and hotness. With GitHub Pages for web reports, Docker support, and AI-powered analysis through MCP protocol, TrendRadar transforms scattered platform algorithms into one unified, user-controlled news feed tailored to your interests.
https://github.com/sansan0/TrendRadar