Files
pr-agent/usage-guide/EXAMPLE_BEST_PRACTICE/index.html
2025-07-06 18:47:48 +00:00

2497 lines
66 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="icon" href="../../assets/favicon.ico">
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.6.15">
<title>EXAMPLE BEST PRACTICE - Qodo Merge (and open-source PR-Agent)</title>
<link rel="stylesheet" href="../../assets/stylesheets/main.342714a4.min.css">
<link rel="stylesheet" href="../../assets/stylesheets/palette.06af60db.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
<link rel="stylesheet" href="../../css/custom.css">
<script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-M6PJSFV');</script>
<!-- End Google Tag Manager -->
<script>"undefined"!=typeof __md_analytics&&__md_analytics()</script>
<meta property="og:type" content="website" >
<meta property="og:title" content="EXAMPLE BEST PRACTICE - Qodo Merge (and open-source PR-Agent)" >
<meta property="og:description" content="None" >
<meta property="og:image" content="./assets/images/social/usage-guide/EXAMPLE_BEST_PRACTICE.png" >
<meta property="og:image:type" content="image/png" >
<meta property="og:image:width" content="1200" >
<meta property="og:image:height" content="630" >
<meta property="og:url" content="None" >
<meta name="twitter:card" content="summary_large_image" >
<meta name="twitter:title" content="EXAMPLE BEST PRACTICE - Qodo Merge (and open-source PR-Agent)" >
<meta name="twitter:description" content="None" >
<meta name="twitter:image" content="./assets/images/social/usage-guide/EXAMPLE_BEST_PRACTICE.png" >
<link href="../../assets/stylesheets/glightbox.min.css" rel="stylesheet"/><style>
html.glightbox-open { overflow: initial; height: 100%; }
.gslide-title { margin-top: 0px; user-select: text; }
.gslide-desc { color: #666; user-select: text; }
.gslide-image img { background: white; }
.gscrollbar-fixer { padding-right: 15px; }
.gdesc-inner { font-size: 0.75rem; }
body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}</style> <script src="../../assets/javascripts/glightbox.min.js"></script></head>
<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="indigo" data-md-color-accent="indigo">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#recommend-python-best-practices" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href="../.." title="Qodo Merge (and open-source PR-Agent)" class="md-header__button md-logo" aria-label="Qodo Merge (and open-source PR-Agent)" data-md-component="logo">
<img src="../../assets/logo.svg" alt="logo">
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
Qodo Merge (and open-source PR-Agent)
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
EXAMPLE BEST PRACTICE
</span>
</div>
</div>
</div>
<form class="md-header__option" data-md-component="palette">
<input class="md-option" data-md-color-media="(prefers-color-scheme)" data-md-color-scheme="default" data-md-color-primary="indigo" data-md-color-accent="indigo" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_0">
<label class="md-header__button md-icon" title="Switch to light mode" for="__palette_1" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m14.3 16-.7-2h-3.2l-.7 2H7.8L11 7h2l3.2 9zM20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zm-9.15 3.96h2.3L12 9z"/></svg>
</label>
<input class="md-option" data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme="default" data-md-color-primary="custom" data-md-color-accent="custom" aria-label="Switch to dark mode" type="radio" name="__palette" id="__palette_1">
<label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_2" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 6H7c-3.31 0-6 2.69-6 6s2.69 6 6 6h10c3.31 0 6-2.69 6-6s-2.69-6-6-6m0 10H7c-2.21 0-4-1.79-4-4s1.79-4 4-4h10c2.21 0 4 1.79 4 4s-1.79 4-4 4M7 9c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"/></svg>
</label>
<input class="md-option" data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme="slate" data-md-color-primary="custom" data-md-color-accent="custom" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_2">
<label class="md-header__button md-icon" title="Switch to light mode" for="__palette_0" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 7H7a5 5 0 0 0-5 5 5 5 0 0 0 5 5h10a5 5 0 0 0 5-5 5 5 0 0 0-5-5m0 8a3 3 0 0 1-3-3 3 3 0 0 1 3-3 3 3 0 0 1 3 3 3 3 0 0 1-3 3"/></svg>
</label>
</form>
<script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
<label class="md-header__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
</label>
<nav class="md-search__options" aria-label="Search">
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
</button>
</nav>
<div class="md-search__suggest" data-md-component="search-suggest"></div>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list" role="presentation"></ol>
</div>
</div>
</div>
</div>
</div>
<div class="md-header__source">
<a href="https://github.com/qodo-ai/pr-agent" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6m-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3m44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9M244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8M97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1m-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7m32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1m-11.4-14.7c-1.6 1-1.6 3.6 0 5.9s4.3 3.3 5.6 2.3c1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2"/></svg>
</div>
<div class="md-source__repository">
Qodo-ai/pr-agent
</div>
</a>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<nav class="md-tabs" aria-label="Tabs" data-md-component="tabs">
<div class="md-grid">
<ul class="md-tabs__list">
<li class="md-tabs__item">
<a href="../.." class="md-tabs__link">
Overview
</a>
</li>
<li class="md-tabs__item">
<a href="../../installation/" class="md-tabs__link">
Installation
</a>
</li>
<li class="md-tabs__item">
<a href="../" class="md-tabs__link">
Usage Guide
</a>
</li>
<li class="md-tabs__item">
<a href="../../tools/" class="md-tabs__link">
Tools
</a>
</li>
<li class="md-tabs__item">
<a href="../../core-abilities/" class="md-tabs__link">
Core Abilities
</a>
</li>
<li class="md-tabs__item">
<a href="../../pr_benchmark/" class="md-tabs__link">
PR Benchmark
</a>
</li>
<li class="md-tabs__item">
<a href="../../recent_updates/" class="md-tabs__link">
Recent Updates
</a>
</li>
<li class="md-tabs__item">
<a href="../../ai_search/" class="md-tabs__link">
AI Docs Search
</a>
</li>
</ul>
</div>
</nav>
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary md-nav--lifted" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href="../.." title="Qodo Merge (and open-source PR-Agent)" class="md-nav__button md-logo" aria-label="Qodo Merge (and open-source PR-Agent)" data-md-component="logo">
<img src="../../assets/logo.svg" alt="logo">
</a>
Qodo Merge (and open-source PR-Agent)
</label>
<div class="md-nav__source">
<a href="https://github.com/qodo-ai/pr-agent" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6m-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3m44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9M244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8M97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1m-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7m32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1m-11.4-14.7c-1.6 1-1.6 3.6 0 5.9s4.3 3.3 5.6 2.3c1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2"/></svg>
</div>
<div class="md-source__repository">
Qodo-ai/pr-agent
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_1" >
<div class="md-nav__link md-nav__container">
<a href="../.." class="md-nav__link ">
<span class="md-ellipsis">
Overview
</span>
</a>
<label class="md-nav__link " for="__nav_1" id="__nav_1_label" tabindex="0">
<span class="md-nav__icon md-icon"></span>
</label>
</div>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_1_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_1">
<span class="md-nav__icon md-icon"></span>
Overview
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../overview/pr_agent_pro/" class="md-nav__link">
<span class="md-ellipsis">
💎 Qodo Merge
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../overview/data_privacy/" class="md-nav__link">
<span class="md-ellipsis">
Data Privacy
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_2" >
<div class="md-nav__link md-nav__container">
<a href="../../installation/" class="md-nav__link ">
<span class="md-ellipsis">
Installation
</span>
</a>
<label class="md-nav__link " for="__nav_2" id="__nav_2_label" tabindex="0">
<span class="md-nav__icon md-icon"></span>
</label>
</div>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_2">
<span class="md-nav__icon md-icon"></span>
Installation
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../installation/pr_agent/" class="md-nav__link">
<span class="md-ellipsis">
PR-Agent
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../installation/qodo_merge/" class="md-nav__link">
<span class="md-ellipsis">
💎 Qodo Merge
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_3" >
<div class="md-nav__link md-nav__container">
<a href="../" class="md-nav__link ">
<span class="md-ellipsis">
Usage Guide
</span>
</a>
<label class="md-nav__link " for="__nav_3" id="__nav_3_label" tabindex="0">
<span class="md-nav__icon md-icon"></span>
</label>
</div>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_3">
<span class="md-nav__icon md-icon"></span>
Usage Guide
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../introduction/" class="md-nav__link">
<span class="md-ellipsis">
Introduction
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../enabling_a_wiki/" class="md-nav__link">
<span class="md-ellipsis">
Enabling a Wiki
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../configuration_options/" class="md-nav__link">
<span class="md-ellipsis">
Configuration File
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../automations_and_usage/" class="md-nav__link">
<span class="md-ellipsis">
Usage and Automation
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../mail_notifications/" class="md-nav__link">
<span class="md-ellipsis">
Managing Mail Notifications
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../changing_a_model/" class="md-nav__link">
<span class="md-ellipsis">
Changing a Model
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../additional_configurations/" class="md-nav__link">
<span class="md-ellipsis">
Additional Configurations
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../faq/" class="md-nav__link">
<span class="md-ellipsis">
Frequently Asked Questions
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../qodo_merge_models/" class="md-nav__link">
<span class="md-ellipsis">
💎 Qodo Merge Models
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_4" >
<div class="md-nav__link md-nav__container">
<a href="../../tools/" class="md-nav__link ">
<span class="md-ellipsis">
Tools
</span>
</a>
<label class="md-nav__link " for="__nav_4" id="__nav_4_label" tabindex="0">
<span class="md-nav__icon md-icon"></span>
</label>
</div>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_4_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_4">
<span class="md-nav__icon md-icon"></span>
Tools
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../tools/describe/" class="md-nav__link">
<span class="md-ellipsis">
Describe
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../tools/review/" class="md-nav__link">
<span class="md-ellipsis">
Review
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../tools/improve/" class="md-nav__link">
<span class="md-ellipsis">
Improve
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../tools/ask/" class="md-nav__link">
<span class="md-ellipsis">
Ask
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../tools/help/" class="md-nav__link">
<span class="md-ellipsis">
Help
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../tools/help_docs/" class="md-nav__link">
<span class="md-ellipsis">
Help Docs
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../tools/update_changelog/" class="md-nav__link">
<span class="md-ellipsis">
Update Changelog
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../tools/documentation/" class="md-nav__link">
<span class="md-ellipsis">
💎 Add Documentation
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../tools/analyze/" class="md-nav__link">
<span class="md-ellipsis">
💎 Analyze
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../tools/ci_feedback/" class="md-nav__link">
<span class="md-ellipsis">
💎 CI Feedback
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../tools/custom_prompt/" class="md-nav__link">
<span class="md-ellipsis">
💎 Custom Prompt
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../tools/custom_labels/" class="md-nav__link">
<span class="md-ellipsis">
💎 Generate Labels
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../tools/test/" class="md-nav__link">
<span class="md-ellipsis">
💎 Generate Tests
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../tools/implement/" class="md-nav__link">
<span class="md-ellipsis">
💎 Implement
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../tools/improve_component/" class="md-nav__link">
<span class="md-ellipsis">
💎 Improve Components
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../tools/scan_repo_discussions/" class="md-nav__link">
<span class="md-ellipsis">
💎 Scan Repo Discussions
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../tools/similar_code/" class="md-nav__link">
<span class="md-ellipsis">
💎 Similar Code
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_5" >
<div class="md-nav__link md-nav__container">
<a href="../../core-abilities/" class="md-nav__link ">
<span class="md-ellipsis">
Core Abilities
</span>
</a>
<label class="md-nav__link " for="__nav_5" id="__nav_5_label" tabindex="0">
<span class="md-nav__icon md-icon"></span>
</label>
</div>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_5">
<span class="md-nav__icon md-icon"></span>
Core Abilities
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../core-abilities/auto_approval/" class="md-nav__link">
<span class="md-ellipsis">
Auto approval
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../core-abilities/auto_best_practices/" class="md-nav__link">
<span class="md-ellipsis">
Auto best practices
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../core-abilities/chat_on_code_suggestions/" class="md-nav__link">
<span class="md-ellipsis">
Chat on code suggestions
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../chrome-extension/" class="md-nav__link">
<span class="md-ellipsis">
Chrome extension
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../core-abilities/code_validation/" class="md-nav__link">
<span class="md-ellipsis">
Code validation
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../core-abilities/dynamic_context/" class="md-nav__link">
<span class="md-ellipsis">
Dynamic context
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../core-abilities/fetching_ticket_context/" class="md-nav__link">
<span class="md-ellipsis">
Fetching ticket context
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../core-abilities/impact_evaluation/" class="md-nav__link">
<span class="md-ellipsis">
Impact evaluation
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../core-abilities/incremental_update/" class="md-nav__link">
<span class="md-ellipsis">
Incremental Update
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../core-abilities/interactivity/" class="md-nav__link">
<span class="md-ellipsis">
Interactivity
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../core-abilities/metadata/" class="md-nav__link">
<span class="md-ellipsis">
Local and global metadata
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../core-abilities/rag_context_enrichment/" class="md-nav__link">
<span class="md-ellipsis">
RAG context enrichment
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../core-abilities/self_reflection/" class="md-nav__link">
<span class="md-ellipsis">
Self-reflection
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../core-abilities/static_code_analysis/" class="md-nav__link">
<span class="md-ellipsis">
Static code analysis
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_6" >
<div class="md-nav__link md-nav__container">
<a href="../../pr_benchmark/" class="md-nav__link ">
<span class="md-ellipsis">
PR Benchmark
</span>
</a>
</div>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_6">
<span class="md-nav__icon md-icon"></span>
PR Benchmark
</label>
<ul class="md-nav__list" data-md-scrollfix>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle md-toggle--indeterminate" type="checkbox" id="__nav_7" >
<div class="md-nav__link md-nav__container">
<a href="../../recent_updates/" class="md-nav__link ">
<span class="md-ellipsis">
Recent Updates
</span>
</a>
</div>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_7_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_7">
<span class="md-nav__icon md-icon"></span>
Recent Updates
</label>
<ul class="md-nav__list" data-md-scrollfix>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../../ai_search/" class="md-nav__link">
<span class="md-ellipsis">
AI Docs Search
</span>
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="On this page">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
On this page
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#recommend-python-best-practices" class="md-nav__link">
<span class="md-ellipsis">
Recommend Python Best Practices
</span>
</a>
<nav class="md-nav" aria-label="Recommend Python Best Practices">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#imports" class="md-nav__link">
<span class="md-ellipsis">
Imports
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#packages" class="md-nav__link">
<span class="md-ellipsis">
Packages
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#default-iterators-and-operators" class="md-nav__link">
<span class="md-ellipsis">
Default Iterators and Operators
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#lambda-functions" class="md-nav__link">
<span class="md-ellipsis">
Lambda Functions
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#default-argument-values" class="md-nav__link">
<span class="md-ellipsis">
Default Argument Values
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#truefalse-evaluations" class="md-nav__link">
<span class="md-ellipsis">
True/False Evaluations
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#lexical-scoping" class="md-nav__link">
<span class="md-ellipsis">
Lexical Scoping
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#threading" class="md-nav__link">
<span class="md-ellipsis">
Threading
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
<h1>EXAMPLE BEST PRACTICE</h1>
<h2 id="recommend-python-best-practices">Recommend Python Best Practices<a class="headerlink" href="#recommend-python-best-practices" title="Permanent link">&para;</a></h2>
<p>This document outlines a series of recommended best practices for Python development. These guidelines aim to improve code quality, maintainability, and readability.</p>
<h3 id="imports">Imports<a class="headerlink" href="#imports" title="Permanent link">&para;</a></h3>
<p>Use <code>import</code> statements for packages and modules only, not for individual types, classes, or functions.</p>
<h4 id="definition">Definition<a class="headerlink" href="#definition" title="Permanent link">&para;</a></h4>
<p>Reusability mechanism for sharing code from one module to another.</p>
<h4 id="decision">Decision<a class="headerlink" href="#decision" title="Permanent link">&para;</a></h4>
<ul>
<li>Use <code>import x</code> for importing packages and modules.</li>
<li>Use <code>from x import y</code> where <code>x</code> is the package prefix and <code>y</code> is the module name with no prefix.</li>
<li>Use <code>from x import y as z</code> in any of the following circumstances:</li>
<li>Two modules named <code>y</code> are to be imported.</li>
<li><code>y</code> conflicts with a top-level name defined in the current module.</li>
<li><code>y</code> conflicts with a common parameter name that is part of the public API (e.g., <code>features</code>).</li>
<li><code>y</code> is an inconveniently long name, or too generic in the context of your code</li>
<li>Use <code>import y as z</code> only when <code>z</code> is a standard abbreviation (e.g., <code>import numpy as np</code>).</li>
</ul>
<p>For example the module <code>sound.effects.echo</code> may be imported as follows:</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a>from sound.effects import echo
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a>...
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a>echo.EchoFilter(input, output, delay=0.7, atten=4)
</code></pre></div>
<p>Do not use relative names in imports. Even if the module is in the same package, use the full package name. This helps prevent unintentionally importing a package twice.</p>
<h5 id="exemptions">Exemptions<a class="headerlink" href="#exemptions" title="Permanent link">&para;</a></h5>
<p>Exemptions from this rule:</p>
<ul>
<li>Symbols from the following modules are used to support static analysis and type checking:</li>
<li><a href="https://google.github.io/styleguide/pyguide.html#typing-imports"><code>typing</code> module</a></li>
<li><a href="https://google.github.io/styleguide/pyguide.html#typing-imports"><code>collections.abc</code> module</a></li>
<li><a href="https://github.com/python/typing_extensions/blob/main/README.md"><code>typing_extensions</code> module</a></li>
<li>Redirects from the <a href="https://six.readthedocs.io/#module-six.moves">six.moves module</a>.</li>
</ul>
<h3 id="packages">Packages<a class="headerlink" href="#packages" title="Permanent link">&para;</a></h3>
<p>Import each module using the full pathname location of the module.</p>
<h4 id="decision_1">Decision<a class="headerlink" href="#decision_1" title="Permanent link">&para;</a></h4>
<p>All new code should import each module by its full package name.</p>
<p>Imports should be as follows:</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a>Yes:
<a id="__codelineno-1-2" name="__codelineno-1-2" href="#__codelineno-1-2"></a> # Reference absl.flags in code with the complete name (verbose).
<a id="__codelineno-1-3" name="__codelineno-1-3" href="#__codelineno-1-3"></a> import absl.flags
<a id="__codelineno-1-4" name="__codelineno-1-4" href="#__codelineno-1-4"></a> from doctor.who import jodie
<a id="__codelineno-1-5" name="__codelineno-1-5" href="#__codelineno-1-5"></a>
<a id="__codelineno-1-6" name="__codelineno-1-6" href="#__codelineno-1-6"></a> _FOO = absl.flags.DEFINE_string(...)
</code></pre></div>
<div class="highlight"><pre><span></span><code><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a>Yes:
<a id="__codelineno-2-2" name="__codelineno-2-2" href="#__codelineno-2-2"></a> # Reference flags in code with just the module name (common).
<a id="__codelineno-2-3" name="__codelineno-2-3" href="#__codelineno-2-3"></a> from absl import flags
<a id="__codelineno-2-4" name="__codelineno-2-4" href="#__codelineno-2-4"></a> from doctor.who import jodie
<a id="__codelineno-2-5" name="__codelineno-2-5" href="#__codelineno-2-5"></a>
<a id="__codelineno-2-6" name="__codelineno-2-6" href="#__codelineno-2-6"></a> _FOO = flags.DEFINE_string(...)
</code></pre></div>
<p><em>(assume this file lives in <code>doctor/who/</code> where <code>jodie.py</code> also exists)</em></p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a>No:
<a id="__codelineno-3-2" name="__codelineno-3-2" href="#__codelineno-3-2"></a> # Unclear what module the author wanted and what will be imported. The actual
<a id="__codelineno-3-3" name="__codelineno-3-3" href="#__codelineno-3-3"></a> # import behavior depends on external factors controlling sys.path.
<a id="__codelineno-3-4" name="__codelineno-3-4" href="#__codelineno-3-4"></a> # Which possible jodie module did the author intend to import?
<a id="__codelineno-3-5" name="__codelineno-3-5" href="#__codelineno-3-5"></a> import jodie
</code></pre></div>
<p>The directory the main binary is located in should not be assumed to be in <code>sys.path</code> despite that happening in some environments. This being the case, code should assume that <code>import jodie</code> refers to a third-party or top-level package named <code>jodie</code>, not a local <code>jodie.py</code>.</p>
<h3 id="default-iterators-and-operators">Default Iterators and Operators<a class="headerlink" href="#default-iterators-and-operators" title="Permanent link">&para;</a></h3>
<p>Use default iterators and operators for types that support them, like lists, dictionaries, and files.</p>
<h4 id="definition_1">Definition<a class="headerlink" href="#definition_1" title="Permanent link">&para;</a></h4>
<p>Container types, like dictionaries and lists, define default iterators and membership test operators (“in” and “not in”).</p>
<h4 id="decision_2">Decision<a class="headerlink" href="#decision_2" title="Permanent link">&para;</a></h4>
<p>Use default iterators and operators for types that support them, like lists, dictionaries, and files. The built-in types define iterator methods, too. Prefer these methods to methods that return lists, except that you should not mutate a container while iterating over it.</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a>Yes: for key in adict: ...
<a id="__codelineno-4-2" name="__codelineno-4-2" href="#__codelineno-4-2"></a> if obj in alist: ...
<a id="__codelineno-4-3" name="__codelineno-4-3" href="#__codelineno-4-3"></a> for line in afile: ...
<a id="__codelineno-4-4" name="__codelineno-4-4" href="#__codelineno-4-4"></a> for k, v in adict.items(): ...
</code></pre></div>
<div class="highlight"><pre><span></span><code><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a>No: for key in adict.keys(): ...
<a id="__codelineno-5-2" name="__codelineno-5-2" href="#__codelineno-5-2"></a> for line in afile.readlines(): ...
</code></pre></div>
<h3 id="lambda-functions">Lambda Functions<a class="headerlink" href="#lambda-functions" title="Permanent link">&para;</a></h3>
<p>Okay for one-liners. Prefer generator expressions over <code>map()</code> or <code>filter()</code> with a <code>lambda</code>.</p>
<h4 id="decision_3">Decision<a class="headerlink" href="#decision_3" title="Permanent link">&para;</a></h4>
<p>Lambdas are allowed. If the code inside the lambda function spans multiple lines or is longer than 60-80 chars, it might be better to define it as a regular <a href="https://google.github.io/styleguide/pyguide.html#lexical-scoping">nested function</a>.</p>
<p>For common operations like multiplication, use the functions from the <code>operator</code> module instead of lambda functions. For example, prefer <code>operator.mul</code> to <code>lambda x, y: x * y</code>.</p>
<h3 id="default-argument-values">Default Argument Values<a class="headerlink" href="#default-argument-values" title="Permanent link">&para;</a></h3>
<p>Okay in most cases.</p>
<h4 id="definition_2">Definition<a class="headerlink" href="#definition_2" title="Permanent link">&para;</a></h4>
<p>You can specify values for variables at the end of a functions parameter list, e.g., <code>def foo(a, b=0):</code>. If <code>foo</code> is called with only one argument, <code>b</code> is set to 0. If it is called with two arguments, <code>b</code> has the value of the second argument.</p>
<h4 id="decision_4">Decision<a class="headerlink" href="#decision_4" title="Permanent link">&para;</a></h4>
<p>Okay to use with the following caveat:</p>
<p>Do not use mutable objects as default values in the function or method definition.</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-6-1" name="__codelineno-6-1" href="#__codelineno-6-1"></a>Yes: def foo(a, b=None):
<a id="__codelineno-6-2" name="__codelineno-6-2" href="#__codelineno-6-2"></a> if b is None:
<a id="__codelineno-6-3" name="__codelineno-6-3" href="#__codelineno-6-3"></a> b = []
<a id="__codelineno-6-4" name="__codelineno-6-4" href="#__codelineno-6-4"></a>Yes: def foo(a, b: Sequence | None = None):
<a id="__codelineno-6-5" name="__codelineno-6-5" href="#__codelineno-6-5"></a> if b is None:
<a id="__codelineno-6-6" name="__codelineno-6-6" href="#__codelineno-6-6"></a> b = []
<a id="__codelineno-6-7" name="__codelineno-6-7" href="#__codelineno-6-7"></a>Yes: def foo(a, b: Sequence = ()): # Empty tuple OK since tuples are immutable.
<a id="__codelineno-6-8" name="__codelineno-6-8" href="#__codelineno-6-8"></a> ...
</code></pre></div>
<div class="highlight"><pre><span></span><code><a id="__codelineno-7-1" name="__codelineno-7-1" href="#__codelineno-7-1"></a>from absl import flags
<a id="__codelineno-7-2" name="__codelineno-7-2" href="#__codelineno-7-2"></a>_FOO = flags.DEFINE_string(...)
<a id="__codelineno-7-3" name="__codelineno-7-3" href="#__codelineno-7-3"></a>
<a id="__codelineno-7-4" name="__codelineno-7-4" href="#__codelineno-7-4"></a>No: def foo(a, b=[]):
<a id="__codelineno-7-5" name="__codelineno-7-5" href="#__codelineno-7-5"></a> ...
<a id="__codelineno-7-6" name="__codelineno-7-6" href="#__codelineno-7-6"></a>No: def foo(a, b=time.time()): # Is `b` supposed to represent when this module was loaded?
<a id="__codelineno-7-7" name="__codelineno-7-7" href="#__codelineno-7-7"></a> ...
<a id="__codelineno-7-8" name="__codelineno-7-8" href="#__codelineno-7-8"></a>No: def foo(a, b=_FOO.value): # sys.argv has not yet been parsed...
<a id="__codelineno-7-9" name="__codelineno-7-9" href="#__codelineno-7-9"></a> ...
<a id="__codelineno-7-10" name="__codelineno-7-10" href="#__codelineno-7-10"></a>No: def foo(a, b: Mapping = {}): # Could still get passed to unchecked code.
<a id="__codelineno-7-11" name="__codelineno-7-11" href="#__codelineno-7-11"></a> ...
</code></pre></div>
<h3 id="truefalse-evaluations">True/False Evaluations<a class="headerlink" href="#truefalse-evaluations" title="Permanent link">&para;</a></h3>
<p>Use the “implicit” false if possible, e.g., <code>if foo:</code> rather than <code>if foo != []:</code></p>
<h3 id="lexical-scoping">Lexical Scoping<a class="headerlink" href="#lexical-scoping" title="Permanent link">&para;</a></h3>
<p>Okay to use.</p>
<p>An example of the use of this feature is:</p>
<div class="highlight"><pre><span></span><code><a id="__codelineno-8-1" name="__codelineno-8-1" href="#__codelineno-8-1"></a>def get_adder(summand1: float) -&gt; Callable[[float], float]:
<a id="__codelineno-8-2" name="__codelineno-8-2" href="#__codelineno-8-2"></a> &quot;&quot;&quot;Returns a function that adds numbers to a given number.&quot;&quot;&quot;
<a id="__codelineno-8-3" name="__codelineno-8-3" href="#__codelineno-8-3"></a> def adder(summand2: float) -&gt; float:
<a id="__codelineno-8-4" name="__codelineno-8-4" href="#__codelineno-8-4"></a> return summand1 + summand2
<a id="__codelineno-8-5" name="__codelineno-8-5" href="#__codelineno-8-5"></a>
<a id="__codelineno-8-6" name="__codelineno-8-6" href="#__codelineno-8-6"></a> return adder
</code></pre></div>
<h4 id="decision_5">Decision<a class="headerlink" href="#decision_5" title="Permanent link">&para;</a></h4>
<p>Okay to use.</p>
<h3 id="threading">Threading<a class="headerlink" href="#threading" title="Permanent link">&para;</a></h3>
<p>Do not rely on the atomicity of built-in types.</p>
<p>While Pythons built-in data types such as dictionaries appear to have atomic operations, there are corner cases where they arent atomic (e.g. if <code>__hash__</code> or <code>__eq__</code> are implemented as Python methods) and their atomicity should not be relied upon. Neither should you rely on atomic variable assignment (since this in turn depends on dictionaries).</p>
<p>Use the <code>queue</code> modules <code>Queue</code> data type as the preferred way to communicate data between threads. Otherwise, use the <code>threading</code> module and its locking primitives. Prefer condition variables and <code>threading.Condition</code> instead of using lower-level locks.</p>
</article>
</div>
<script>var tabs=__md_get("__tabs");if(Array.isArray(tabs))e:for(var set of document.querySelectorAll(".tabbed-set")){var labels=set.querySelector(".tabbed-labels");for(var tab of tabs)for(var label of labels.getElementsByTagName("label"))if(label.innerText.trim()===tab){var input=document.getElementById(label.htmlFor);input.checked=!0;continue e}}</script>
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
</div>
<button type="button" class="md-top md-icon" data-md-component="top" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg>
Back to top
</button>
</main>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Footer</title>
<style>
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
font-size: 16px;
}
.wrapper {
background-color: #171518;
}
.container {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
color: white;
padding: 20px;
max-width: 61rem;
margin-left: auto;
margin-right: auto;
}
.footer-links, .social-icons {
padding: 0;
list-style-type: none;
display: flex;
justify-content: center;
gap: 20px;
align-items: center;
}
.footer-links a:hover, .social-icons a:hover {
color: #AEA1F1;
}
.social-icons svg {
width: 24px;
height: auto;
fill: white;
}
.footer-text {
width: 240px;
}
@media (max-width: 768px) {
.container {
flex-direction: column;
align-items: center;
text-align: center;
}
.footer-links, .social-icons, .footer-text {
width: 100%;
justify-content: center;
margin: 10px 0;
}
.footer-links {
order: 1;
}
.social-icons {
order: 2;
}
.footer-text {
order: 3;
}
}
</style>
<link href="../../assets/stylesheets/glightbox.min.css" rel="stylesheet"/><style>
html.glightbox-open { overflow: initial; height: 100%; }
.gslide-title { margin-top: 0px; user-select: text; }
.gslide-desc { color: #666; user-select: text; }
.gslide-image img { background: white; }
.gscrollbar-fixer { padding-right: 15px; }
.gdesc-inner { font-size: 0.75rem; }
body[data-md-color-scheme="slate"] .gdesc-inner { background: var(--md-default-bg-color);}
body[data-md-color-scheme="slate"] .gslide-title { color: var(--md-default-fg-color);}
body[data-md-color-scheme="slate"] .gslide-desc { color: var(--md-default-fg-color);}</style> <script src="../../assets/javascripts/glightbox.min.js"></script></head>
<body>
<footer class="wrapper">
<div class="container">
<p class="footer-text">© 2025 <a href="https://www.qodo.ai/" target="_blank" rel="noopener">Qodo</a></p>
<div class="footer-links">
<a href="https://qodo-gen-docs.qodo.ai/">Qodo Gen</a>
<p>|</p>
<a href="https://qodo-flow-docs.qodo.ai/">AlphaCodium</a>
</div>
<div class="social-icons">
<a href="https://github.com/Codium-ai" target="_blank" rel="noopener" title="github.com" class="social-link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg>
</a>
<a href="https://discord.com/invite/SgSxuQ65GF" target="_blank" rel="noopener" title="discord.com" class="social-link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--! Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M524.531 69.836a1.5 1.5 0 0 0-.764-.7A485.065 485.065 0 0 0 404.081 32.03a1.816 1.816 0 0 0-1.923.91 337.461 337.461 0 0 0-14.9 30.6 447.848 447.848 0 0 0-134.426 0 309.541 309.541 0 0 0-15.135-30.6 1.89 1.89 0 0 0-1.924-.91 483.689 483.689 0 0 0-119.688 37.107 1.712 1.712 0 0 0-.788.676C39.068 183.651 18.186 294.69 28.43 404.354a2.016 2.016 0 0 0 .765 1.375 487.666 487.666 0 0 0 146.825 74.189 1.9 1.9 0 0 0 2.063-.676A348.2 348.2 0 0 0 208.12 430.4a1.86 1.86 0 0 0-1.019-2.588 321.173 321.173 0 0 1-45.868-21.853 1.885 1.885 0 0 1-.185-3.126 251.047 251.047 0 0 0 9.109-7.137 1.819 1.819 0 0 1 1.9-.256c96.229 43.917 200.41 43.917 295.5 0a1.812 1.812 0 0 1 1.924.233 234.533 234.533 0 0 0 9.132 7.16 1.884 1.884 0 0 1-.162 3.126 301.407 301.407 0 0 1-45.89 21.83 1.875 1.875 0 0 0-1 2.611 391.055 391.055 0 0 0 30.014 48.815 1.864 1.864 0 0 0 2.063.7A486.048 486.048 0 0 0 610.7 405.729a1.882 1.882 0 0 0 .765-1.352c12.264-126.783-20.532-236.912-86.934-334.541ZM222.491 337.58c-28.972 0-52.844-26.587-52.844-59.239s23.409-59.241 52.844-59.241c29.665 0 53.306 26.82 52.843 59.239 0 32.654-23.41 59.241-52.843 59.241Zm195.38 0c-28.971 0-52.843-26.587-52.843-59.239s23.409-59.241 52.843-59.241c29.667 0 53.307 26.82 52.844 59.239 0 32.654-23.177 59.241-52.844 59.241Z"></path></svg>
</a>
<a href="https://www.youtube.com/@QodoAI" target="_blank" rel="noopener" title="www.youtube.com" class="social-link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><!--! Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305zm-317.51 213.508V175.185l142.739 81.205-142.739 81.201z"></path></svg>
</a>
<a href="https://www.linkedin.com/company/qodoai" target="_blank" rel="noopener" title="www.linkedin.com" class="social-link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"></path></svg>
</a>
<a href="https://twitter.com/QodoAI" target="_blank" rel="noopener" title="twitter.com" class="social-link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"></path></svg>
</a>
<a href="https://www.instagram.com/qodo_ai" target="_blank" rel="noopener" title="www.instagram.com" class="social-link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"></path></svg>
</a>
</div>
</div>
</footer>
<script id="init-glightbox">const lightbox = GLightbox({"touchNavigation": true, "loop": false, "zoomable": true, "draggable": true, "openEffect": "zoom", "closeEffect": "zoom", "slideEffect": "slide"});
document$.subscribe(() => { lightbox.reload() });
</script></body>
</html>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "../..", "features": ["navigation.tabs", "navigation.expand", "navigation.path", "navigation.top", "navigation.tracking", "navigation.indexes", "search.suggest", "search.highlight", "content.tabs.link", "content.code.annotation", "content.code.copy"], "search": "../../assets/javascripts/workers/search.d50fe291.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script>
<script src="../../assets/javascripts/bundle.56ea9cef.min.js"></script>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5C9KZBM3"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
</body>
</html>