{"id":337863,"date":"2022-09-02T21:00:23","date_gmt":"2022-09-02T21:00:23","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=337863"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=337863","title":{"rendered":"<span>\u0413\u0440\u0443\u0433 \u043f\u0440\u043e\u0442\u0438\u0432 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438. \u042f \u043f\u0440\u043e\u043b\u0438\u043d\u0442\u0438\u043b \u0432\u0441\u0435 \u043f\u043e\u0441\u0442\u044b \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u043f\u0440\u043e Python, \u0438 \u0432\u043e\u0442 \u0447\u0442\u043e \u044f \u043d\u0430\u0448\u0451\u043b<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u044f \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0432 <s>\u043f\u0435\u0434\u0430\u043d\u0442\u0430<\/s> \u0431\u0440\u044e\u0437\u0433\u0443. \u0412 \u0444\u0438\u043b\u044c\u043c\u0430\u0445 \u043c\u0430\u043b\u0435\u0439\u0448\u0438\u0435 \u043d\u0435\u0441\u0442\u044b\u043a\u043e\u0432\u043a\u0438 \u0438 \u043f\u0440\u043e\u0432\u0430\u043b\u044b \u0432 \u043b\u043e\u0433\u0438\u043a\u0435 \u043f\u043e\u0440\u0442\u044f\u0442 \u043c\u043d\u0435 \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440. \u0412 \u0447\u0430\u0442\u0430\u0445 \u043c\u0435\u043d\u044f \u0431\u0435\u0441\u0438\u0442 <code>it's<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>its<\/code>. \u0410 \u0432 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043f\u0440\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435&#8230; \u0412\u0441\u0451 \u043f\u043b\u043e\u0445\u043e. \u0417\u0430 \u043c\u0435\u043d\u044f \u0432\u0441\u0451 \u0443\u0436\u0435 \u0441\u043a\u0430\u0437\u0430\u043b <a class=\"mention\" href=\"\/users\/AlexanderAstafiev\">@AlexanderAstafiev<\/a>, \u044f \u043b\u0438\u0448\u044c \u043f\u0440\u043e\u0446\u0438\u0442\u0438\u0440\u0443\u044e:<\/p>\n<blockquote>\n<p>\u041f\u0440\u043e\u0441\u0442\u0438\u0442\u0435, \u044f \u043d\u0435 \u043c\u043e\u0433\u0443 \u0442\u0430\u043a \u0431\u043e\u043b\u044c\u0448\u0435. \u042f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0445\u043e\u0440\u043e\u0448\u043e \u0437\u043d\u0430\u044e Python, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u043b\u0447\u0430\u0442\u044c \u043f\u0440\u0438 \u0432\u0438\u0434\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<br \/>\u042f \u0443\u0441\u0442\u0430\u043b. \u042f \u043d\u0435 \u043c\u043e\u0433\u0443 \u044d\u0442\u043e \u0447\u0438\u0442\u0430\u0442\u044c. \u041f\u0440\u043e\u0441\u0442\u0438\u0442\u0435 \u0437\u0430 \u0442\u043e\u043a\u0441\u0438\u0447\u043d\u0443\u044e \u043a\u0440\u0438\u0442\u0438\u043a\u0443, \u043d\u0430\u043a\u0438\u043f\u0435\u043b\u043e.<\/p>\n<\/blockquote>\n<p>\u0421\u0430\u043c\u043e\u0435 \u0437\u0430\u0431\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e, \u043f\u043e \u043c\u043e\u0438\u043c \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u044f\u043c, \u0432\u0435\u0437\u0434\u0435 \u044f \u0432\u0438\u0436\u0443 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u042f \u0434\u0430\u0436\u0435 \u0437\u0430\u043f\u0438\u043b\u0438\u043b \u0441\u0435\u0440\u0432\u0438\u0441, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043a\u0438\u043d\u0443\u0442\u044c \u043a\u043e\u0434 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u0434 \u0440\u0435\u0432\u044c\u044e, \u0438, \u0441\u043e\u0431\u0440\u0430\u0432 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438, \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e <a href=\"https:\/\/breakpoint.black\/review\/cases\/\">50 \u0442\u0438\u043f\u043e\u0432 \u043e\u0448\u0438\u0431\u043e\u043a<\/a> \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432 \u0447\u0443\u0436\u043e\u043c \u043a\u043e\u0434\u0435. \u041d\u043e \u0432\u044b\u0431\u043e\u0440\u043a\u0430 \u0443 \u043c\u0435\u043d\u044f \u0431\u044b\u043b\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f, \u0438 \u044f \u043f\u043e\u0434\u0443\u043c\u0430\u043b: \u0430 \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c <em>\u043c\u043d\u043e\u0433\u043e<\/em> \u043a\u043e\u0434\u0430? \u0418 \u0432\u0441\u0451 \u0437\u0430\u0432\u0435\u0440\u0442\u0435&#8230;<\/p>\n<h2>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u043f\u0440\u043e \u0433\u0440\u0443\u0433\u043e\u0432<\/h2>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/c80\/866\/3b0\/c808663b07b7c5aaab33e63542b72a3d.jpg\" width=\"493\" height=\"437\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c80\/866\/3b0\/c808663b07b7c5aaab33e63542b72a3d.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0413\u0434\u0435-\u0442\u043e \u0442\u0443\u0442 \u043f\u0440\u043e\u0441\u043a\u0430\u043a\u0438\u0432\u0430\u043b\u0430 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e \u0433\u0440\u0443\u0433\u043e\u0432: <a href=\"https:\/\/habr.com\/ru\/post\/673640\/\">\u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c<\/a>, <a href=\"https:\/\/grugbrain.dev\/\">\u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c<\/a>.<\/p>\n<blockquote>\n<p>\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441 \u043c\u043e\u0437\u0433\u043e\u043c \u0433\u0440\u0443\u0433\u0430 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u043c\u043d\u044b\u0439, \u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441 \u043c\u043e\u0437\u0433\u043e\u043c \u0433\u0440\u0443\u0433\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043b\u0435\u0442 \u0438 \u043d\u0430\u0443\u0447\u0438\u043b\u0441\u044f \u043a\u043e\u0435 \u0447\u0435\u043c\u0443, \u0445\u043e\u0442\u044c \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u0437\u0430\u043f\u0443\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f<\/p>\n<\/blockquote>\n<p>\u042f \u043a\u0430\u043a \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b \u0435\u0451, \u0442\u0430\u043a \u0441\u0440\u0430\u0437\u0443 \u0438 \u043f\u043e\u043d\u044f\u043b: \u044d\u0442\u043e \u044f. \u041d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u043c\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442, \u043d\u043e \u0437\u0430 \u043f\u043b\u0435\u0447\u0430\u043c\u0438 \u0433\u043e\u0440\u044b \u043e\u043f\u044b\u0442\u0430, \u0438 \u044d\u0442\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u043c\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043a\u043e\u0434\u0430: \u043d\u0435 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0439. \u041d\u0430 \u0440\u0430\u0431\u043e\u0442\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0447\u0435\u043b &#8212; \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0433\u043e\u043b\u043e\u0432\u0430, \u043e\u043d \u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u0441\u0432\u043e\u0435\u0439 &#171;\u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438&#187; \u0438 \u043f\u0438\u0448\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u043e\u0442\u043d\u0430 \u043a\u043e\u0434\u0430 \u0441 \u043a\u0443\u0447\u0435\u0439 \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u0439, \u0438 \u0433\u0434\u0435-\u0442\u043e \u0432 \u043a\u043e\u043d\u0446\u0435 \u043e\u043d \u0435\u0449\u0451 \u043f\u043e\u043c\u043d\u0438\u0442, \u0447\u0442\u043e \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0431\u044b\u043b if \u0438 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c else. \u042f \u0442\u0430\u043a \u043d\u0435 \u043c\u043e\u0433\u0443, \u044f \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u044b\u0433\u0430\u044e jump-to-definition, \u043d\u0430 \u0447\u0435\u0442\u0432\u0451\u0440\u0442\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0443\u0436\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u044e, \u043e\u0442\u043a\u0443\u0434\u0430 \u044f \u043f\u0440\u0438\u0448\u0451\u043b \u0438 \u0447\u0442\u043e \u044f \u0434\u0435\u043b\u0430\u043b. \u042f \u043a\u0430\u043a \u0431\u0435\u043b\u044c\u0447\u043e\u043d\u043e\u043a \u0441 \u0445\u043e\u0440\u043e\u0448\u0435\u043d\u044c\u043a\u0438\u043c \u0445\u0432\u043e\u0441\u0442\u0438\u043a\u043e\u043c, \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435, \u043e \u0447\u0451\u043c \u044f.<\/p>\n<blockquote>\n<p>\u0427\u0442\u043e \u0436\u0435 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0431\u0435\u043b\u044c\u0447\u043e\u043d\u043a\u0430, \u0442\u043e \u043e\u043d \u0441\u0438\u0434\u0435\u043b \u0432 \u043b\u0435\u0441\u043d\u043e\u0439 \u0447\u0430\u0449\u0435 \u0438 \u0440\u0430\u0441\u0441\u0435\u044f\u043d\u043d\u043e \u043f\u043e\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u043b \u0442\u043e \u043d\u0430 \u043e\u0434\u043d\u043e \u0434\u0435\u0440\u0435\u0432\u043e, \u0442\u043e \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0435. \u041e\u043d \u043d\u0435 \u043c\u043e\u0433, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0431\u044b \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u043e\u0436\u0435\u0440\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438\u043c \u0445\u0432\u043e\u0441\u0442\u0438\u043a\u043e\u043c, \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0432 \u0434\u0443\u043f\u043b\u0435 \u043a\u0430\u043a\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u043e\u043d \u0436\u0438\u043b \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0440\u0430\u0434\u0438 \u0447\u0435\u0433\u043e \u043e\u043d \u043f\u0440\u0438\u0441\u043a\u0430\u043a\u0430\u043b \u0432 \u043b\u0435\u0441 \u0438 \u0447\u0442\u043e \u0442\u0430\u043c \u0438\u0441\u043a\u0430\u043b.<\/p>\n<\/blockquote>\n<p>\u042f \u043d\u0435 \u043c\u043e\u0433\u0443 \u043f\u0438\u0441\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0448\u0442\u0443\u043a\u0438, \u0430 \u0435\u0441\u043b\u0438 \u0438 \u043d\u0430\u043f\u0438\u0448\u0443, \u0442\u043e \u0442\u0430\u043c \u0436\u0435 \u0438 \u0443\u043c\u0440\u0443. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0444\u0438\u043b\u043e\u0441\u043e\u0444\u0438\u044f \u0433\u0440\u0443\u0433\u043e\u0432 \u043c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442:<\/p>\n<blockquote>\n<p>\u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043e\u0445\u043e\u0442\u043d\u0438\u043a \u043d\u0430 \u0433\u0440\u0443\u0433\u0430 \u044d\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c<br \/>\u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043b\u043e\u0445\u043e<br \/>\u0441\u043a\u0430\u0436\u0443 \u0441\u043d\u043e\u0432\u0430:<br \/>\u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u00a0<em>\u043e\u0447\u0435\u043d\u044c<\/em>\u00a0\u043f\u043b\u043e\u0445\u043e<br \/>\u0442\u0435\u043f\u0435\u0440\u044c\u00a0<em>\u0442\u044b<\/em>\u00a0\u0441\u043a\u0430\u0436\u0438 \u0441\u0430\u043c:<br \/>\u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u00a0<em>\u043e\u0447\u0435\u043d\u044c<\/em>,\u00a0<em>\u043e\u0447\u0435\u043d\u044c<\/em>\u00a0\u043f\u043b\u043e\u0445\u043e<br \/>\u0435\u0441\u043b\u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438 \u0431\u0438\u0442\u044c\u0441\u044f \u0441 \u0434\u0438\u043d\u043e\u0437\u0430\u0432\u0440\u043e\u043c, \u0433\u0440\u0443\u0433 \u0432\u044b\u0431\u0435\u0440\u0438 \u0434\u0438\u043d\u043e\u0437\u0430\u0432\u0440: \u0433\u0440\u0443\u0433 \u0445\u043e\u0442\u044f \u0431\u044b \u0432\u0438\u0434\u0435\u0442\u044c \u0434\u0438\u043d\u043e\u0437\u0430\u0432\u0440\u0430<\/p>\n<\/blockquote>\n<p>\u0418 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0442\u0435\u043b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0442\u0435\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u0440\u043e\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0432 \u043f\u0438\u0442\u043e\u043d\u0435.<\/p>\n<blockquote>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441 \u043c\u043e\u0437\u0433\u043e\u043c \u0433\u0440\u0443\u0433\u0430 \u0445\u043e\u0447\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0437\u043d\u0430\u043d\u0438\u044f \u0432 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0443\u044e, \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443<\/p>\n<\/blockquote>\n<h2>\u0415\u0441\u043b\u0438 \u0432\u044b \u0443\u043c\u043d\u044b\u0439<\/h2>\n<p>&#8230; \u0442\u043e \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u044c\u0441\u044f \u0443\u043f\u0440\u043e\u0449\u0430\u0442\u044c. \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 \u0441\u0442\u0430\u0442\u044c\u044e \u0438\u043b\u0438 \u0432\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0435 \u0447\u0442\u043e-\u0442\u043e \u0432 \u043e\u043f\u0435\u043d\u0441\u043e\u0440\u0441, \u0432\u0430\u0448 \u043a\u043e\u0434 (\u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e) \u0447\u0438\u0442\u0430\u044e\u0442 \u0438\/\u0438\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u0430\u0431\u043e\u0442\u0438\u0442\u044c\u0441\u044f \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u0445 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430? \u041a\u0441\u0442\u0430\u0442\u0438, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0442\u0430\u0442\u044c \u0432\u044b \u0441\u0430\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442.<\/p>\n<h2>\u0427\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 &#171;\u0443\u043f\u0440\u043e\u0449\u0430\u0442\u044c&#187; \u0438 &#171;\u0437\u0430\u0431\u043e\u0442\u0438\u0442\u044c\u0441\u044f \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u0445&#187;?<\/h2>\n<p>\u042f \u043f\u043e\u043d\u0438\u043c\u0430\u044e \u044d\u0442\u043e \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439<\/p>\n<ol>\n<li>\n<p>\u043b\u0435\u0433\u043a\u043e \u0447\u0438\u0442\u0430\u0442\u044c<\/p>\n<\/li>\n<li>\n<p>\u043b\u0435\u0433\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c<\/p>\n<\/li>\n<li>\n<p>\u043b\u0435\u0433\u043a\u043e \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c<\/p>\n<\/li>\n<li>\n<p>\u043b\u0435\u0433\u043a\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/p>\n<\/li>\n<\/ol>\n<p>\u041a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434? \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u0438\u043d\u0442\u0435\u0440\u044b \u0438 \u043c\u043e\u0437\u0433, \u0447\u0442\u043e\u0431\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u0431\u0441\u0443\u0434\u0438\u043c \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0430\u043d\u0442\u0438\u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b.<\/p>\n<h2>\u0422\u044b \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0448\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/h2>\n<p>\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0432 \u043d\u043e\u0433\u0443 \u043c\u043e\u0436\u043d\u043e \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u043e\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u044f\u0437\u044b\u043a\u0435. \u041d\u043e \u043c\u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043c\u043e\u0439 \u0445\u043e\u0443\u043c\u0438 aka <s>\u041d\u0438\u043a\u043e\u043b\u0430\u0439 \u0413\u0443\u043c\u0438\u043b\u0451\u0432<\/s> \u0412\u0438\u043b\u044c\u0444\u0440\u0435\u0434\u043e \u041f\u0430\u0440\u0435\u0442\u043e.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/e71\/f11\/8a5\/e71f118a5d489ab965af52299a76e936.jpg\" width=\"800\" height=\"400\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e71\/f11\/8a5\/e71f118a5d489ab965af52299a76e936.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<h4>\u0417\u0430\u043a\u043e\u043d\u00a0\u041f\u0430\u0440\u0435\u0442\u043e<\/h4>\n<ul>\n<li>\n<p>\u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043e\u043a\u043e\u043b\u043e 80% \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0438\u0437 20% \u043f\u0440\u0438\u0447\u0438\u043d.<\/p>\n<\/li>\n<li>\n<p>\u0410 \u0432\u0434\u0440\u0443\u0433 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u043e\u043f 20% \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u043d\u0430\u0434\u0435\u044f\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043f\u043e\u043a\u0440\u043e\u0435\u043c 80% \u0441\u043b\u0443\u0447\u0430\u0435\u0432?<\/p>\n<\/li>\n<\/ul>\n<h3>\u0410 \u043a\u0430\u043a \u0442\u044b \u0443\u0437\u043d\u0430\u0435\u0448\u044c \u0441\u0430\u043c\u044b\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438?<\/h3>\n<p>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<p>\u0412\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0432\u0441\u0451 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043b\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043b\u043e\u0445\u043e\u0439 \u0434\u0438\u0437\u0430\u0439\u043d \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439. \u041a\u0430\u043a-\u0442\u043e \u044f \u0432\u0438\u0434\u0435\u043b \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435:<\/p>\n<pre><code class=\"python\">def swagger_support(func):     @wraps(func)     def wrapper(self, *args, **kwargs):         if args[0] == 1:             return getattr(super(type(self), self), func.__name__)(*args, **kwargs)         else:             return func(self, *args, **kwargs)     return wrapper <\/code><\/pre>\n<p>\u041d\u0435 \u0437\u043d\u0430\u044e, \u043a\u0430\u043a\u043e\u0439 \u0442\u0430\u043c \u0431\u044b\u043b \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u043d\u043e \u0435\u0441\u043b\u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043b\u0438\u0431\u043e \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434, \u043b\u0438\u0431\u043e \u043c\u0435\u0442\u043e\u0434 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430, \u0442\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0433\u0434\u0435-\u0442\u043e \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0432\u044b\u0448\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043b\u0438\u0431\u043e \u043e\u0431\u044a\u0435\u043a\u0442 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f, \u043b\u0438\u0431\u043e \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430 &#8212; \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u043a \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043e\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043c\u0435\u0442\u043e\u0434, \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u0430\u0441 \u043f\u0438\u0441\u0430\u0442\u044c <code>if<\/code>. \u041a\u0430\u043a \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c &#8212; \u044f \u043d\u0435 \u0437\u043d\u0430\u044e. \u042d\u0442\u043e \u0441\u0430\u043c\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043e\u0448\u0438\u0431\u043e\u043a, \u043d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0438\u0445 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u0441\u043e\u0440\u044f\u043d.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043a\u0430\u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0441\u043a\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438? \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u043f\u043e\u0441\u0442\u0440\u043e\u044e \u0432\u0443\u043d\u0434\u0435\u0440\u0432\u0430\u0444\u043b\u044e, \u043f\u0440\u044f\u043c \u043a\u0430\u043a \u0430\u043d\u043d\u0438\u0433\u0438\u043b\u044f\u0442\u043e\u0440 \u0432 &#171;\u041f\u043e\u043b\u0438\u0446\u0435\u0439\u0441\u043a\u0438\u0439 \u0438\u0437 \u0411\u0435\u0432\u0435\u0440\u043b\u0438-\u0425\u0438\u043b\u043b\u0437 3&#187;.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/961\/dd9\/605\/961dd9605653f313030705169d157343.jpg\" alt=\"CD-\u043f\u043b\u0435\u0435\u0440, \u0442\u0435\u043b\u0435\u0444\u043e\u043d, \u043a\u0430\u043c\u0435\u0440\u0430, \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440, \u0434\u0438\u043d\u0430\u043c\u0438\u043a, \u043c\u0438\u043a\u0440\u043e\u0432\u043e\u043b\u043d\u043e\u0432\u043a\u0430, \u043c\u0438\u043d\u0438\u0433\u0430\u043d \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435\" title=\"CD-\u043f\u043b\u0435\u0435\u0440, \u0442\u0435\u043b\u0435\u0444\u043e\u043d, \u043a\u0430\u043c\u0435\u0440\u0430, \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440, \u0434\u0438\u043d\u0430\u043c\u0438\u043a, \u043c\u0438\u043a\u0440\u043e\u0432\u043e\u043b\u043d\u043e\u0432\u043a\u0430, \u043c\u0438\u043d\u0438\u0433\u0430\u043d \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435\" width=\"750\" height=\"367\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/961\/dd9\/605\/961dd9605653f313030705169d157343.jpg\" data-blurred=\"true\"\/><figcaption>CD-\u043f\u043b\u0435\u0435\u0440, \u0442\u0435\u043b\u0435\u0444\u043e\u043d, \u043a\u0430\u043c\u0435\u0440\u0430, \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440, \u0434\u0438\u043d\u0430\u043c\u0438\u043a, \u043c\u0438\u043a\u0440\u043e\u0432\u043e\u043b\u043d\u043e\u0432\u043a\u0430, \u043c\u0438\u043d\u0438\u0433\u0430\u043d \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435<\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u044d\u0442\u0430 \u0448\u0442\u0443\u043a\u0430 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u0432\u0430\u043c flake8 \u0441 \u043f\u043b\u0430\u0433\u0438\u043d\u0430\u043c\u0438, \u0442\u043e \u0432\u044b \u0443\u0433\u0430\u0434\u0430\u043b\u0438 &#8212; \u044d\u0442\u043e \u043e\u043d \u0438 \u0435\u0441\u0442\u044c.<\/p>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 pylint | mypy | dlint | black | &#8230;? \u041c\u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u0431\u044b\u043b \u043b\u0438\u043d\u0442\u0435\u0440 (\u043d\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0442\u0435\u0440), \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0435\u0441\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u043c\u043d\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432, \u0438 \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u044f \u043c\u043e\u0433 \u0431\u044b \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0438. Flake8 \u043c\u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u043c.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u044f \u043f\u0440\u043e\u0448\u0451\u043b\u0441\u044f \u043f\u043e <a href=\"https:\/\/github.com\/DmytroLitvinov\/awesome-flake8-extensions\">awesome flake8<\/a>, \u043f\u043e\u0441\u043a\u0440\u0451\u0431 \u043f\u043e \u0437\u0430\u043a\u043e\u0443\u043b\u043a\u0430\u043c \u0433\u0438\u0442\u0445\u0430\u0431\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0441\u0432\u043e\u0439 \u043c\u0438\u043d\u0438-\u043f\u043b\u0430\u0433\u0438\u043d \u0441 \u0442\u0435\u043c, \u0447\u0435\u0433\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u043b\u043e, \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0432\u043e\u0442 \u044d\u0442\u043e:<\/p>\n<pre><code>flake8==5.0.4 flake8-json==21.7.0  flake8-adjustable-complexity==0.0.6 flake8-annotations-coverage==0.0.6 flake8-annotations==2.9.1 flake8-builtins==1.5.3 flake8-cognitive-complexity==0.1.0 flake8-commas==2.1.0 flake8-comprehensions==3.10.0 flake8-eradicate==1.3.0 flake8-expression-complexity==0.0.11 flake8-functions==0.0.7 flake8-simplify==0.19.3 flake8-scream==0.1.0 git+https:\/\/github.com\/i02sopop\/flake8-global-variables pep8-naming==0.13.1 flake8-bugbear==22.7.1 flake8-pie==0.16.0 flake8-print==5.0.0 flake8-use-pathlib==0.3.0 git+https:\/\/github.com\/c0ntribut0r\/flake8-grug  pylint==2.14.5 flake8-pylint==0.1.3 <\/code><\/pre>\n<p>\u042f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0442\u044c \u0442\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0434\u0435\u043b\u0430\u044e\u0442 \u043a\u043e\u0434 \u0447\u0438\u0449\u0435, \u043d\u043e \u043d\u0435 \u0441\u0442\u0430\u043b \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0441\u043f\u043e\u0440\u043d\u044b\u0435 \u0448\u0442\u0443\u043a\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0441\u044f\u043a\u0438\u0435 \u0441\u043b\u0435\u0434\u0438\u043b\u043a\u0438 \u0437\u0430 \u0434\u043e\u043a\u0441\u0442\u0440\u0438\u043d\u0433\u0430\u043c\u0438) \u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0438 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0435 \u0432\u0435\u0449\u0438 (\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0432\u0441\u044f\u043a\u0438\u0435 \u0442\u0430\u043c \u043e\u0442\u0441\u0442\u0443\u043f\u044b \u0438 \u043f\u0440\u043e\u0431\u0435\u043b\u044b). \u0414\u0430\u0436\u0435 \u0441\u0440\u0435\u0434\u0438 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044f \u0432\u044b\u0431\u0440\u0430\u043b, \u0431\u044b\u043b\u043e \u043c\u043d\u043e\u0433\u043e \u043c\u0443\u0441\u043e\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043e\u0442\u0431\u0438\u0440\u0430\u043b \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u043e\u0448\u0442\u0443\u0447\u043d\u043e, \u0435\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e &#8212; \u0432\u043e\u0442 \u043c\u043e\u0439 <code>.flake8<\/code>, \u043e\u043d \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u0447\u0438\u0442\u0430\u0435\u043c:<\/p>\n<details class=\"spoiler\">\n<summary>.flake8<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>[flake8] # statistics = True select =     # -------- https:\/\/github.com\/best-doctor\/flake8-adjustable-complexity --------     CAC001,     # func is too complex (complexity > max allowed complexity)     CAC002,     # func is too complex (complexity). Bad variable names penalty is too high (penalty)      # -------- https:\/\/github.com\/best-doctor\/flake8-annotations-coverage --------     TAE001,     # Too few type annotations in file      # -------- https:\/\/github.com\/sco1\/flake8-annotations --------     ANN001,     # Missing type annotation for function argument     ANN002,     # Missing type annotation for *args     ANN003,     # Missing type annotation for **kwargs     ; ANN101,     # Missing type annotation for self in method     ; ANN102,     # Missing type annotation for cls in classmethod     ANN201,     # Missing return type annotation for public function     ANN202,     # Missing return type annotation for protected function     ANN203,     # Missing return type annotation for secret function     ANN204,     # Missing return type annotation for special method     ANN205,     # Missing return type annotation for staticmethod     ANN206,     # Missing return type annotation for classmethod     ANN301,     # PEP 484 disallows both type annotations and type comments     ANN401,     # Dynamically typed expressions (typing.Any) are disallowed.2      # -------- https:\/\/github.com\/gforcada\/flake8-builtins --------     A001,     # variable \"max\" is shadowing a python builtin     A002,     # argument \"dict\" is shadowing a python builtin      # -------- https:\/\/github.com\/Melevir\/flake8-cognitive-complexity --------     CCR001,     # Cognitive complexity is too high (X > Y)      # -------- https:\/\/github.com\/PyCQA\/flake8-commas --------     # C812,  # too many FPs     # missing trailing comma     C813,     # missing trailing comma in Python 3     # C814,     # missing trailing comma in Python 2     C815,     # missing trailing comma in Python 3.5+     C816,     # missing trailing comma in Python 3.6+     C818,     # trailing comma on bare tuple prohibited     C819,     # trailing comma prohibited      # -------- https:\/\/github.com\/adamchainz\/flake8-comprehensions --------     C400,     C401,     C402,     # Unnecessary generator - rewrite as a &lt;list\/set\/dict> comprehension.     C403,     C404,     # Unnecessary list comprehension - rewrite as a &lt;set\/dict> comprehension.     C405,     C406,     #  Unnecessary &lt;list\/tuple> literal - rewrite as a &lt;set\/dict> literal.     # C408,     # Unnecessary &lt;dict\/list\/tuple> call - rewrite as a literal.     C409,     C410,     # Unnecessary &lt;list\/tuple> passed to &lt;list\/tuple>() - (remove the outer call to &lt;list\/tuple>``()\/rewrite as a ``&lt;list\/tuple> literal).     C411,     # Unnecessary list call - remove the outer call to list().     C413,     # Unnecessary &lt;list\/reversed> call around sorted().     C414,     # Unnecessary &lt;list\/reversed\/set\/sorted\/tuple> call within &lt;list\/set\/sorted\/tuple>().     C415,     # Unnecessary subscript reversal of iterable within &lt;reversed\/set\/sorted>().     C416,     # Unnecessary &lt;list\/set> comprehension - rewrite using &lt;list\/set>().     C417,     # Unnecessary map usage - rewrite using a generator expression\/&lt;list\/set\/dict> comprehension.      # -------- https:\/\/github.com\/wemake-services\/flake8-eradicate --------     # E800,     # Found commented out code      # -------- https:\/\/github.com\/best-doctor\/flake8-expression-complexity --------     ECE001,     # Expression is too complex (X > Y)      # -------- https:\/\/github.com\/best-doctor\/flake8-functions --------     CFQ001,     # function length (default max length is 100)     # CFQ002,     # function arguments number (default max arguments amount is 6)     CFQ003,     # function is not pure.     ; CFQ004,     # function returns number (default max returns amount is 3)      # -------- https:\/\/github.com\/MartinThoma\/flake8-simplify --------      # Python-specific rules:     SIM101,     # Multiple isinstance-calls which can be merged into a single call by using a tuple as a second argument (example)     SIM104,     #: Use 'yield from iterable' (introduced in Python 3.3, see PEP 380) (example)     SIM105,     # Use 'contextlib.suppress(...)' instead of try-except-pass (example)     SIM107,     # Don't use return in try\/except and finally (example)     SIM108,     # Use the ternary operator if it's reasonable (example)     SIM109,     # Use a tuple to compare a value against multiple values (example)     SIM110,     # Use any(...) (example)     SIM111,     # Use all(...) (example)     SIM113,     # Use enumerate instead of manually incrementing a counter (example)     SIM114,     # Combine conditions via a logical or to prevent duplicating code (example)     SIM115,     # Use context handler for opening files (example)     SIM116,     # Use a dictionary instead of many if\/else equality checks (example)     SIM117,     # Merge with-statements that use the same scope (example)     SIM119,     #  Moved to flake8-scream due to issue 63     SIM120,     #: Use 'class FooBar:' instead of 'class FooBar(object):' (example)     SIM121,     # Reserved for SIM908 once it's stable     SIM125,     # Reserved for SIM905 once it's stable     SIM126,     # Reserved for SIM906 once it's stable     SIM127,     # Reserved for SIM907 once it's stable      # Simplifying Comparisons:     SIM201,     # Use 'a != b' instead of 'not a == b' (example)     SIM202,     # Use 'a == b' instead of 'not a != b' (example)     SIM203,     # Use 'a not in b' instead of 'not (a in b)' (example)     SIM204,     #  Moved to flake8-scream due to issue 116     SIM205,     #  Moved to flake8-scream due to issue 116     SIM206,     #  Moved to flake8-scream due to issue 116     SIM207,     #  Moved to flake8-scream due to issue 116     SIM208,     # Use 'a' instead of 'not (not a)' (example)     SIM210,     # Use 'bool(a)' instead of 'True if a else False' (example)     SIM211,     # Use 'not a' instead of 'False if a else True' (example)     SIM212,     # Use 'a if a else b' instead of 'b if not a else a' (example)     SIM220,     # Use 'False' instead of 'a and not a' (example)     SIM221,     # Use 'True' instead of 'a or not a' (example)     SIM222,     # Use 'True' instead of '... or True' (example)     SIM223,     # Use 'False' instead of '... and False' (example)     SIM224,     # Reserved for SIM901 once it's stable     SIM300,     # Use 'age == 42' instead of '42 == age' (example)      # Simplifying usage of dictionaries:     SIM401,     # Use 'a_dict.get(key, \"default_value\")' instead of an if-block (example)     SIM118,     # Use 'key in dict' instead of 'key in dict.keys()' (example)      # General Code Style:     SIM102,     # Use a single if-statement instead of nested if-statements (example)     SIM103,     # Return the boolean condition directly (example)     SIM106,     # Handle error-cases first (example). This rule was removed due to too many false-positives.     SIM112,     # Use CAPITAL environment variables (example)     SIM122,     #\/ SIM902:  Moved to flake8-scream due to issue 125     SIM123,     #\/ SIM902:  Moved to flake8-scream due to issue 130     SIM124,     # Reserved for SIM909 once it's stable      # Current experimental rules:     SIM901,     # Use comparisons directly instead of wrapping them in a bool(...) call (example)     SIM904,     # Assign values to dictionary directly at initialization (example)     SIM905,     # Split string directly if only constants are used (example)     SIM906,     # Merge nested os.path.join calls (example)     SIM907,     # Use Optional[Type] instead of Union[Type, None] (example)     SIM908,     # Use dict.get(key) (example)     SIM909,     # Avoid reflexive assignments (example)      # -------- https:\/\/github.com\/MartinThoma\/flake8-scream --------     SCR119,     #: Use dataclasses for data containers (example)     SCR902,     # Use keyword-argument instead of magic boolean (example)     SCR903,     # Use keyword-argument instead of magic number (example)      # -------- https:\/\/github.com\/i02sopop\/flake8-global-variables --------     # W001,     # Global variable {0} defined     W002,     # Global variable {0} used      # ---- https:\/\/github.com\/PyCQA\/pep8-naming ----     # N801,     # class names should use CapWords convention (class names)     # N802,     # function name should be lowercase (function names)     # N803,     # argument name should be lowercase (function arguments)     N804,     # first argument of a classmethod should be named 'cls' (function arguments)     N805,     # first argument of a method should be named 'self' (function arguments)     N806,     # variable in function should be lowercase     N807,     # function name should not start and end with '__'     N811,     # constant imported as non constant (constants)     N812,     # lowercase imported as non-lowercase     N813,     # camelcase imported as lowercase     N814,     # camelcase imported as constant (distinct from N817 for selective enforcement)     N815,     # mixedCase variable in class scope (constants, method names)     N816,     # mixedCase variable in global scope (constants)     N817,     # camelcase imported as acronym (distinct from N814 for selective enforcement)     N818,     # error suffix in exception names (exceptions)      # -------- https:\/\/github.com\/PyCQA\/flake8-bugbear --------     B001,     # Do not use bare except:, it also catches unexpected events like memory errors, interrupts, system exit, and so on. Prefer except Exception:. If you're sure what you're doing, be explicit and write except BaseException:. Disable E722 to avoid duplicate warnings.     B002,     # Python does not support the unary prefix increment. Writing ++n is equivalent to +(+(n)), which equals n. You meant n += 1.     B003,     # Assigning to os.environ doesn't clear the environment. Subprocesses are going to see outdated variables, in disagreement with the current process. Use os.environ.clear() or the env= argument to Popen.     B004,     # Using hasattr(x, '__call__') to test if x is callable is unreliable. If x implements custom __getattr__ or its __call__ is itself not callable, you might get misleading results. Use callable(x) for consistent results.     B005,     # Using .strip() with multi-character strings is misleading the reader. It looks like stripping a substring. Move your character set to a constant if this is deliberate. Use .replace() or regular expressions to remove string fragments.     B006,     # Do not use mutable data structures for argument defaults. They are created during function definition time. All calls to the function reuse this one instance of that data structure, persisting changes between them.     B007,     # Loop control variable not used within the loop body. If this is intended, start the name with an underscore.     B008,     # Do not perform function calls in argument defaults. The call is performed only once at function definition time. All calls to your function will reuse the result of that definition-time function call. If this is intended, assign the function call to a module-level variable and use that variable as a default value.     B009,     # Do not call getattr(x, 'attr'), instead use normal property access: x.attr. Missing a default to getattr will cause an AttributeError to be raised for non-existent properties. There is no additional safety in using getattr if you know the attribute name ahead of time.     B010,     # Do not call setattr(x, 'attr', val), instead use normal property access: x.attr = val. There is no additional safety in using setattr if you know the attribute name ahead of time.     B011,     # Do not call assert False since python -O removes these calls. Instead callers should raise AssertionError().     B012,     # Use of break, continue or return inside finally blocks will silence exceptions or override return values from the try or except blocks. To silence an exception, do it explicitly in the except block. To properly use a break, continue or return refactor your code so these statements are not in the finally block.     B013,     # A length-one tuple literal is redundant. Write except SomeError: instead of except (SomeError,):.     B014,     # Redundant exception types in except (Exception, TypeError):. Write except Exception:, which catches exactly the same exceptions.     B015,     # Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend assert or remove it.     B016,     # Cannot raise a literal. Did you intend to return it or raise an Exception?     B017,     # self.assertRaises(Exception): should be considered evil. It can lead to your test passing even if the code being tested is never executed due to a typo. Either assert for a more specific exception (builtin or custom), use assertRaisesRegex, or use the context manager form of assertRaises (with self.assertRaises(Exception) as ex:) with an assertion against the data available in ex.     B018,     # Found useless expression. Either assign it to a variable or remove it.     B019,     # Use of functools.lru_cache or functools.cache on methods can lead to memory leaks. The cache may retain instance references, preventing garbage collection.     B020,     # Loop control variable overrides iterable it iterates     B021,     # f-string used as docstring. This will be interpreted by python as a joined string rather than a docstring.     B022,     # No arguments passed to contextlib.suppress. No exceptions will be suppressed and therefore this context manager is redundant. N.B. this rule currently does not flag suppress calls to avoid potential false positives due to similarly named user-defined functions.     B023,     # Functions defined inside a loop must not use variables redefined in the loop, because late-binding closures are a classic gotcha.      # -------- https:\/\/github.com\/sbdchd\/flake8-pie --------     ; PIE781,     # assign-and-return     # Based on Clippy's let_and_return and Microsoft's TSLint rule no-unnecessary-local-variable.      # PIE783,     # celery-explicit-names     # Warn about Celery task definitions that don't have explicit names.      # PIE784,     # celery-explicit-crontab-args     # The crontab class provided by Celery has some default args that are suprising to new users. Specifically, crontab(hour=\"0,12\") won't run a task at midnight and noon, it will run the task at every minute during those two hours. This lint makes that call an error, forcing you to write crontab(hour=\"0, 12\", minute=\"*\").      # PIE785,     # celery-require-tasks-expire     # Celery tasks can bunch up if they don't have expirations.      PIE786,     # precise-exception-handlers     # Be precise in what exceptions you catch. Bare except: handlers, catching BaseException, or catching Exception can lead to unexpected bugs.      PIE787,     # no-len-condition     # Empty collections are fasley in Python so calling len() is unnecessary when checking for emptiness in an if statement\/expression.      PIE788,     # no-bool-condition     # If statements\/expressions evalute the truthiness of the their test argument, so calling bool() is unnecessary.      PIE789,     # prefer-isinstance-type-compare     # Using type() doesn't take into account subclassess and type checkers won't refine the type, use isinstance instead.      PIE790,     # no-unnecessary-pass     # pass is unnecessary when definining a class or function with an empty body.      PIE791,     # no-pointless-statements     # Comparisions without an assignment or assertion are probably a typo.      # PIE792,  # same as SIM120     # no-inherit-object     # Inheriting from object isn't necessary in Python 3.      PIE793,     # prefer-dataclass     # Attempts to find cases where the @dataclass decorator is unintentionally missing.      PIE794,     # dupe-class-field-definitions     # Finds duplicate definitions for the same field, which can occur in large ORM model definitions.      PIE795,     # prefer-stdlib-enums     # Instead of defining various constant properties on a class, use the stdlib enum which typecheckers support for type refinement.      PIE796,     # prefer-unique-enums     # By default the stdlib enum allows multiple field names to map to the same value, this lint requires each enum value be unique.      PIE797,     # no-unnecessary-if-expr     # Call bool() directly rather than reimplementing its functionality.      PIE798,     # no-unnecessary-class     # Instead of using class to namespace functions, use a module.      PIE799,     # prefer-col-init     # Check that values are passed in when collections are created rather than creating an empty collection and then inserting.      PIE800,     # no-unnecessary-spread     # Check for unnecessary dict unpacking.      PIE801,     # prefer-simple-return     # Return boolean expressions directly instead of returning True and False.      PIE802,     # prefer-simple-any-all     # Remove unnecessary comprehensions for any and all      PIE803,     # prefer-logging-interpolation     # Don't format strings before logging. Let logging interpolate arguments.      PIE804,     # no-unnecessary-dict-kwargs     # As long as the keys of the dict are valid Python identifier names, we can safely remove the surrounding dict.      # PIE805,     # prefer-literal     # Currently only checks for byte string literals.      PIE806,     # no-assert-except     # Instead of asserting and catching the exception, use an if statement.      PIE807,     # prefer-list-builtin     # lambda: [] is equivalent to the builtin list      PIE808,     # prefer-simple-range     # We can leave out the first argument to range in some cases since the default start position is 0.      PIE809,     # django-prefer-bulk     # Bulk create multiple objects instead of executing O(N) queries.      # -------- https:\/\/github.com\/JBKahn\/flake8-print --------     T201,     # print found     T203,     # pprint found     T204,     # pprint declared      # -------- https:\/\/gitlab.com\/RoPP\/flake8-use-pathlib --------     PL100,     # os.path.abspath(\"foo\") should be replaced by foo_path.resolve()     PL101,     # os.chmod(\"foo\", 0o444) should be replaced by foo_path.chmod(0o444)     PL102,     # os.mkdir(\"foo\") should be replaced by foo_path.mkdir()     PL103,     # os.makedirs(\"foo\/bar\") should be replaced by bar_path.mkdir(parents=True)     PL104,     # os.rename(\"foo\", \"bar\") should be replaced by foo_path.rename(Path(\"bar\"))     PL105,     # os.replace(\"foo\", \"bar\") should be replaced by foo_path.replace(Path(\"bar\"))     PL106,     # os.rmdir(\"foo\") should be replaced by foo_path.rmdir()     PL107,     # os.remove(\"foo\") should be replaced by foo_path.unlink()     PL108,     # os.unlink(\"foo\") should be replaced by foo_path.unlink()     PL109,     # os.getcwd() should be replaced by Path.cwd()     PL110,     # os.path.exists(\"foo\") should be replaced by foo_path.exists()     PL111,     # os.path.expanduser(\"~\/foo\") should be replaced by foo_path.expanduser()     PL112,     # os.path.isdir(\"foo\") should be replaced by foo_path.is_dir()     PL113,     # os.path.isfile(\"foo\") should be replaced by foo_path.is_file()     PL114,     # os.path.islink(\"foo\") should be replaced by foo_path.is_symlink()     PL115,     # os.readlink(\"foo\") should be replaced by foo_path.readlink()     PL116,     # os.stat(\"foo\") should be replaced by foo_path.stat() or foo_path.owner() or foo_path.group()     PL117,     # os.path.isabs should be replaced by foo_path.is_absolute()     PL118,     # os.path.join(\"foo\", \"bar\") should be replaced by foo_path \/ \"bar\"     PL119,     # os.path.basename(\"foo\/bar\") should be replaced by bar_path.name     PL120,     # os.path.dirname(\"foo\/bar\") should be replaced by bar_path.parent     PL121,     # os.path.samefile(\"foo\", \"bar\") should be replaced by foo_path.samefile(bar_path)     PL122,     # os.path.splitext(\"foo.bar\") should be replaced by foo_path.suffix     PL123,     # open(\"foo\") should be replaced by Path(\"foo\").open()     PL124,     # py.path.local is in maintenance mode, use pathlib instead      # -------- https:\/\/github.com\/c0ntribut0r\/flake8-grug --------     GRG001,     # copy-paste     GRG002,     # early quit     GRG003,     # eval     GRG004,     # try too much     GRG005,     # requests no status check  <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f, \u043f\u043e\u043a\u0430 \u044f \u0432\u0441\u0451 \u044d\u0442\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u043b:<\/p>\n<ul>\n<li>\n<p>\u041d\u0430\u0448\u0451\u043b \u0440\u0435\u043f\u043e \u043e\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u044b BestDoctor. \u041e\u043d\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u0434\u043b\u044f flake8, \u043f\u043b\u044e\u0441 \u0432\u043e\u043e\u0431\u0449\u0435 \u0443 \u043d\u0438\u0445 \u043f\u0440\u0438\u044f\u0442\u043d\u043e &#8212; \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e <a href=\"https:\/\/github.com\/best-doctor\/guides\/blob\/master\/guides\/python_styleguide.md\">python styleguide<\/a> \u0438 \u043f\u043e\u0433\u0443\u043b\u044f\u0442\u044c \u043f\u043e \u0440\u0435\u043f\u0435. BestDoctor, \u043e\u043f\u043b\u0430\u0442\u0443 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u0435 \u043d\u0430 \u043a\u0430\u0440\u0442\u0443, \u043a\u0430\u043a \u0438 \u0434\u043e\u0433\u043e\u0432\u0430\u0440\u0438\u0432\u0430\u043b\u0438\u0441\u044c.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/MartinThoma\/flake8-simplify\">flake8-simplify<\/a> \u0442\u043e\u0436\u0435 \u0432\u043f\u043e\u043b\u043d\u0435 \u0445\u043e\u0440\u043e\u0448, \u044f \u0434\u0436\u0432\u0430 \u0433\u043e\u0434\u0430 \u0438\u0441\u043a\u0430\u043b \u043d\u0430\u0431\u043e\u0440 \u0442\u0430\u043a\u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b<\/p>\n<\/li>\n<li>\n<p>\u0412\u0441\u044f\u043a\u0438\u0435 code quality tools \u0436\u0438\u0432\u0443\u0442 \u0432 <a href=\"https:\/\/github.com\/PyCQA\">PyCQA<\/a>, \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f<\/p>\n<\/li>\n<li>\n<p>\u0410\u043d\u043d\u0438\u0433\u0438\u043b\u044f\u0442\u043e\u0440 \u0443\u0436\u0435 <a href=\"https:\/\/github.com\/wemake-services\/wemake-python-styleguide\">\u0438\u0437\u043e\u0431\u0440\u0435\u043b\u0438 \u0432 wemake<\/a>, \u043d\u043e \u043c\u043d\u0435 \u043d\u0435 \u0432\u0441\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u043b\u0438, \u0438 \u0443 \u043d\u0435\u0433\u043e \u0444\u0430\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u0441\u043b\u0435 \u0432\u0441\u0435\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u044f \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b \u0430\u043d\u043d\u0438\u0433\u0438\u043b\u044f\u0442\u043e\u0440, \u044f \u043f\u043e\u043d\u044f\u043b: \u044f \u0441\u043e\u0437\u0434\u0430\u043b \u0442\u0430\u043a\u043e\u0433\u043e \u0436\u0435 \u0431\u0440\u044e\u0437\u0433\u0443, \u043a\u0430\u043a \u044f. \u0423\u0440\u0430!<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/e52\/ac6\/276\/e52ac62760fd1753aa8443d9ce33aeb8.jpg\" width=\"1000\" height=\"641\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e52\/ac6\/276\/e52ac62760fd1753aa8443d9ce33aeb8.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/51a\/7b7\/500\/51a7b75009742e0962d48f4f25634a49.jpg\" width=\"1069\" height=\"800\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/51a\/7b7\/500\/51a7b75009742e0962d48f4f25634a49.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0418 \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0439 \u043c\u0435\u0433\u0430-\u043b\u0438\u043d\u0442\u0435\u0440 \u043d\u0430\u0447\u0430\u043b \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0442\u044c \u043c\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u0431\u0435\u0441\u0438\u0442\u044c \u043c\u0435\u043d\u044f, \u044f \u043f\u043e\u043d\u044f\u043b: \u043e\u043d \u0433\u043e\u0442\u043e\u0432 \u043a \u0440\u0430\u0431\u043e\u0442\u0435.<\/p>\n<h2>\u0412\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0430\u043d\u043d\u0438\u0433\u0438\u043b\u044f\u0442\u043e\u0440<\/h2>\n<p>\u0412\u0441\u0451 \u043d\u0430\u0447\u0430\u043b\u043e\u0441\u044c \u0441\u043e \u0441\u0442\u0430\u0442\u0435\u0439 \u0425\u0430\u0431\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u043e\u0441\u043a\u0440\u0430\u043f\u0430\u0442\u044c \u0438\u0445 \u0432\u0441\u0435 \u0438 \u0441\u043a\u043e\u0440\u043c\u0438\u0442\u044c flake8. \u042f \u043d\u0430\u043f\u0438\u0441\u0430\u043b <a href=\"https:\/\/github.com\/c0ntribut0r\/habr-scraper\">\u043f\u0440\u043e\u0441\u0442\u0443\u044e \u043e\u0431\u0451\u0440\u0442\u043a\u0443 \u043d\u0430\u0434 \u0425\u0430\u0431\u0440\u043e\u043c<\/a> \u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u043b \u043d\u0430 \u043d\u043e\u0447\u044c. \u0410 \u043f\u043e\u0442\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b \u0430\u043d\u043d\u0438\u0433\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0430 \u0432\u0441\u0435\u0445 \u043f\u043e\u0441\u0442\u0430\u0445.<\/p>\n<pre><code>flake8 --config .flake8 --format json samples\/posts\/ > results\/posts-results.json<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0446\u0438\u0444\u0440\u044b:<\/p>\n<ul>\n<li>\n<p>115,661 \u0441\u0442\u0430\u0442\u0435\u0439 \u0432 \u043f\u043e\u0442\u043e\u043a\u0435 &#171;\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430&#187;<\/p>\n<\/li>\n<li>\n<p>5,500 \u043f\u043e\u0441\u0442\u043e\u0432 \u0432 \u0425\u0430\u0431\u0435 &#171;python&#187;<\/p>\n<\/li>\n<li>\n<p>1,723 \u043f\u043e\u0441\u0442\u0430 \u043f\u0440\u043e \u043f\u0438\u0442\u043e\u043d \u0431\u0435\u0437 \u043a\u043e\u0434\u0430 \u0438\u043b\u0438 \u043a\u043e\u0434 \u043c\u0435\u043d\u044c\u0448\u0435 5 \u0441\u0442\u0440\u043e\u0447\u0435\u043a <code>\u00af\\_(\u30c4)_\/\u00af<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u043e\u0434\u043e\u043c \u044f \u0441\u0447\u0438\u0442\u0430\u043b \u0441\u0435\u043a\u0446\u0438\u0438 \u0441 \u0442\u0435\u0433\u043e\u043c <code>&lt;code><\/code>. \u0418\u043d\u043e\u0433\u0434\u0430 \u0442\u0430\u043c \u043d\u0435 \u043a\u043e\u0434, \u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0438\u043b\u0438 \u0434\u0443\u0440\u0430\u0446\u043a\u043e\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0442\u0430\u043a \u0447\u0442\u043e \u0433\u0434\u0435 flake8 \u0441\u043c\u043e\u0433 \u043f\u0435\u0440\u0435\u0432\u0430\u0440\u0438\u0442\u044c &#8212; \u0445\u043e\u0440\u043e\u0448\u043e, \u0433\u0434\u0435 \u043d\u0435 \u0441\u043c\u043e\u0433 &#8212; \u043d\u0435 \u043e\u0431\u0435\u0441\u0441\u0443\u0434\u044c\u0442\u0435.<\/p>\n<pre><code>Total posts: 2,791 Overall issues: 63,614 Unique issues (one per post): 12,166<\/code><\/pre>\n<p>\u0418 \u0432\u043e\u0442, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u0434\u043e\u043b\u0433\u043e\u0436\u0434\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430.<\/p>\n<ul>\n<li>\n<p><code>% of posts<\/code> &#8212; \u043f\u0440\u043e\u0446\u0435\u043d\u0442 \u043f\u043e\u0441\u0442\u043e\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u0441\u0442\u0435\u0447\u0430\u043b\u0430\u0441\u044c \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d \u0440\u0430\u0437<\/p>\n<\/li>\n<li>\n<p><code>cnt<\/code> &#8212; \u0442\u043e \u0436\u0435, \u043d\u043e \u0432 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438 (\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e)<\/p>\n<\/li>\n<li>\n<p><code>code<\/code> &#8212; \u043a\u043e\u0434 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 Flake8<\/p>\n<\/li>\n<li>\n<p><code>name<\/code> &#8212; \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0435\u043a\u0441\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0438, \u043c\u043e\u0436\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f \u043e\u0442 \u0441\u043b\u0443\u0447\u0430\u044f \u043a \u0441\u043b\u0443\u0447\u0430\u044e<\/p>\n<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/64e\/05f\/f0e\/64e05ff0e6e8f1366c8dbe401bcd617b.jpg\" width=\"1534\" height=\"989\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/64e\/05f\/f0e\/64e05ff0e6e8f1366c8dbe401bcd617b.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<h2>\u041d\u0443 \u0447\u0442\u043e, \u043f\u043e\u0435\u0445\u0430\u043b\u0438?<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/89e\/7db\/d4a\/89e7dbd4ad7cf0db3e8898a4732be6f6.jpg\" width=\"800\" height=\"384\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/89e\/7db\/d4a\/89e7dbd4ad7cf0db3e8898a4732be6f6.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041c\u044b \u043f\u0440\u043e\u0433\u0443\u043b\u044f\u0435\u043c\u0441\u044f \u043f\u043e \u0442\u043e\u043f\u0447\u0438\u043a\u0443 \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430, \u0438 \u0435\u0449\u0451 \u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0435 \u043f\u043e\u043f\u0430\u043b\u043e \u0432 \u0441\u043f\u0438\u0441\u043e\u043a, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044f \u043d\u0435 \u0437\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043b \u0438\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0441\u043e\u0439\u0442\u0438 \u0441 \u0443\u043c\u0430, \u0440\u0430\u0437\u043e\u0431\u044c\u0451\u043c \u0432\u0441\u0451 \u043f\u043e \u0441\u0435\u043a\u0446\u0438\u044f\u043c, \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u043c \u0432\u044b\u0448\u0435. \u0423\u0441\u0442\u0440\u0430\u043d\u0438\u0432 \u043e\u0448\u0438\u0431\u043a\u0438 \u0441\u0435\u043a\u0446\u0438\u0438, \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442<\/p>\n<ol>\n<li>\n<p>\u043b\u0435\u0433\u043a\u043e \u0447\u0438\u0442\u0430\u0442\u044c<\/p>\n<\/li>\n<li>\n<p>\u043b\u0435\u0433\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c<\/p>\n<\/li>\n<li>\n<p>\u043b\u0435\u0433\u043a\u043e \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c<\/p>\n<\/li>\n<li>\n<p>\u043b\u0435\u0433\u043a\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/p>\n<\/li>\n<\/ol>\n<hr\/>\n<h2>\u041b\u0435\u0433\u043a\u043e \u0447\u0438\u0442\u0430\u0442\u044c<\/h2>\n<h3>\u041b\u0435\u0433\u043a\u043e \u0447\u0438\u0442\u0430\u0442\u044c > \u0421\u0430\u043c\u043e\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/h3>\n<p>\u041b\u0435\u043d\u044c &#8212; \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0430. \u041b\u0435\u043d\u0438\u0432\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u044b \u043d\u0435 \u043b\u044e\u0431\u044f\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e (\u0434\u0430 \u0438 \u043a\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u043b\u044e\u0431\u0438\u0442?), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043d\u0438 \u0441\u0442\u0430\u0440\u0430\u044e\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0430\u043c \u0441\u0435\u0431\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u0438 \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u043a\u043d\u0438\u0433\u0443. \u0411\u043e\u043d\u0443\u0441\u043e\u043c \u0438\u0434\u0451\u0442 \u0442\u043e, \u0447\u0442\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0432 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438.<\/p>\n<details class=\"spoiler\">\n<summary>\u041b\u0435\u0433\u043a\u043e \u0447\u0438\u0442\u0430\u0442\u044c > \u0421\u0430\u043c\u043e\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f > \u0422\u0438\u043f\u044b<\/summary>\n<div class=\"spoiler__content\">\n<p>\u042d\u0442\u043e \u043f\u0438\u0442\u043e\u043d\u0443\u0448\u043a\u0430. \u0422\u0443\u0442 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u0441\u0451 \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e, \u0445\u043e\u0442\u0438\u0442\u0435 int, \u0445\u043e\u0442\u0438\u0442\u0435 \u0433\u0435\u0442\u0435\u0440\u043e\u0433\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432\u043f\u0435\u0440\u0435\u043c\u0435\u0436\u043a\u0443 \u0441\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f\u043c\u0438 \u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u043e\u0439. \u0421\u0447\u0438\u0442\u0430\u044e \u043b\u0438 \u044f \u044d\u0442\u043e \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u0438\u0442\u043e\u043d\u0430? \u041d\u0435\u0442. \u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0442\u0430\u043a\u0430\u044f \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u0430, \u0438 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0433\u0434\u0435 \u043a\u0430\u043a\u0438\u0435 \u0442\u0438\u043f\u044b, \u0442\u0430\u043a <a href=\"https:\/\/nim-lang.org\">\u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u044d\u0442\u043e \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c<\/a> ? (\u0438\u0437\u0432\u0438\u043d\u0438\u0442\u0435, \u043d\u0435 \u0443\u0434\u0435\u0440\u0436\u0430\u043b\u0441\u044f \u043e\u0442 \u043f\u0440\u043e\u043f\u0430\u0433\u0430\u043d\u0434\u044b)<\/p>\n<p>\u041d\u043e \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0442\u043e, \u0447\u0442\u043e \u0438\u043c\u0435\u0435\u043c:<\/p>\n<pre><code class=\"python\">def fn(items):     # ... <\/code><\/pre>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u0430 \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0430\u0432\u0430\u0442\u044c \u0432 <code>items<\/code>, \u0438 \u0447\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0438\u0437 <code>fn<\/code>?<\/p>\n<h3>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 1: \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434.<\/h3>\n<p>\u0422\u043e\u043f\u043e\u0440\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 &#8212; \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434 \u0438 \u043f\u043e\u043d\u044f\u0442\u044c. \u0418 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u0443\u0441\u043f\u0435\u0445 &#8212; \u043c\u043e\u0436\u0435\u0442, \u0432\u044b \u043f\u043e\u0439\u043c\u0451\u0442\u0435, \u0447\u0442\u043e <code>items<\/code> &#8212; \u044d\u0442\u043e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f <em>\u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432<\/em>, \u043d\u043e \u0432\u043e\u0442 \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a\u0438\u0445 &#8212; \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043f\u0440\u044b\u0433\u0430\u0442\u044c \u043f\u043e \u0432\u044b\u0437\u043e\u0432\u0430\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>fn<\/code> \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0447\u0442\u043e \u0442\u0443\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f. \u041d\u0443 \u0442\u0430\u043a\u043e\u0435.<\/p>\n<h3>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 2: \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c docstring.<\/h3>\n<p>\u041f\u0435\u0449\u0435\u0440\u043d\u044b\u0435 \u043b\u044e\u0434\u0438 \u0436\u0438\u043b\u0438 \u0432 \u043d\u0435\u0432\u0435\u0434\u0435\u043d\u0438\u0438, \u043d\u043e \u043f\u043e\u0442\u043e\u043c \u043e\u0442\u043a\u0440\u044b\u043b\u0438 \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0434\u043e\u043a\u0441\u0442\u0440\u0438\u043d\u0433\u0438, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0438 \u0447\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442.<\/p>\n<pre><code class=\"python\">def fn(items):     \"\"\"     Sort items using mega-algo.      Args:         items: list - list of items     Returns:         list of sorted elements     \"\"\"     # ... <\/code><\/pre>\n<p>\u042d\u0442\u043e \u043f\u043e\u0447\u0442\u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u0435\u0441\u043b\u0438 \u0431\u044b \u043d\u0435:<\/p>\n<ul>\n<li>\n<p>\u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u0442\u0438\u043b\u0438: \u0433\u0434\u0435-\u0442\u043e google-style, \u0433\u0434\u0435-\u0442\u043e sphinx-style<\/p>\n<\/li>\n<li>\n<p>\u043c\u043d\u043e\u0433\u043e \u043f\u0438\u0441\u0430\u0442\u044c (\u043d\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u043f\u043b\u0430\u0433\u0438\u043d\u044b)<\/p>\n<\/li>\n<li>\n<p>\u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0451 \u0432\u0440\u0435\u043c\u044f \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e: \u0443\u0431\u0440\u0430\u043b\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0438 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 &#8212; \u0431\u0443\u0434\u044c\u0442\u0435 \u0434\u043e\u0431\u0440\u044b \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0434\u043e\u043a\u0441\u0442\u0440\u0438\u043d\u0433 (\u044f \u0432\u0441\u0451 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u0431\u044b\u0432\u0430\u044e)<\/p>\n<\/li>\n<\/ul>\n<h3>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 3: \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c type hints<\/h3>\n<p>\u041f\u043e\u0442\u043e\u043c \u043f\u0435\u0449\u0435\u0440\u043d\u044b\u0435 \u043b\u044e\u0434\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043d\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u044f\u0437\u044b\u043a\u0438 \u0438 \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u043b\u0438, \u0447\u0442\u043e \u044d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u043e, \u0438 \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u0438 \u0442\u0430\u043a \u0436\u0435. \u041d\u0443 \u0445\u043e\u0442\u044f \u0431\u044b \u0447\u0442\u043e\u0431 \u0431\u044b\u043b\u043e \u043f\u043e\u0445\u043e\u0436\u0435. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u0442:<\/p>\n<pre><code class=\"python\">from typing import List, Union, Optional  def fn(items: List[Optional[Union[int, float]]]) -> list[Union[int, float]]:     # ... <\/code><\/pre>\n<p>\u0421\u043c\u0435\u0448\u043d\u043e, \u0447\u0442\u043e, \u0445\u043e\u0442\u044f \u0434\u043b\u044f <code>items<\/code> \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d \u0442\u0438\u043f, \u043f\u043e \u0444\u0430\u043a\u0442\u0443 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0442\u0443\u0434\u0430 \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u043b\u0435\u0434\u0438\u0442\u044c, \u0447\u0442\u043e \u043a\u0443\u0434\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f, \u043d\u043e, \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435, \u044d\u0442\u043e \u043f\u0440\u043e\u0449\u0435, \u0438 \u0432\u0441\u044f\u043a\u0438\u0435 \u043b\u0438\u043d\u0442\u0435\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u043c\u043e\u0433\u0430\u0442\u044c.<\/p>\n<h3>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 4: \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c python >= 3.10 \u0438 \u043d\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043b\u0438\u0448\u043d\u0435\u0433\u043e<\/h3>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u0435\u0449\u0435\u0440\u043d\u044b\u0435 \u043b\u044e\u0434\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043d\u0430 <code>List[Optional[Union[int, float]]]<\/code>, \u043f\u0440\u0438\u0444\u0438\u0433\u0435\u043b\u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e (\u044d\u0442\u043e \u0432\u0435\u0434\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442!) \u0438 \u0440\u0435\u0448\u0438\u043b\u0438 \u0432\u0441\u0451 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c:<\/p>\n<pre><code class=\"python\">def fn(items: list[int | float | None]) -> list[int, float]:  # \u0430 \u0435\u0449\u0451 \u043b\u0443\u0447\u0448\u0435 TypeVar ;) # ... <\/code><\/pre>\n<p>\u0421\u043e\u0433\u043b\u0430\u0441\u0438\u0442\u0435\u0441\u044c, \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u044f \u043d\u0430\u043b\u0438\u0446\u043e. \u041d\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0435\u0441\u0442\u044c:<\/p>\n<ol>\n<li>\n<p>type hints \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438. \u041f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u0430\u044f \u0442\u0435\u043c\u0430: <code>dict[str, list[dict]]<\/code> &#8212; \u044d\u0442\u043e \u0447\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u0430\u043c? \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0442\u0438\u043f \u0434\u043b\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430, \u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043f\u043e\u0434\u0441\u043a\u0430\u0436\u0435\u0442, \u0447\u0442\u043e \u0438\u043c\u0435\u043b \u0432 \u0432\u0438\u0434\u0443 \u0430\u0432\u0442\u043e\u0440. \u0410 \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0442\u0438\u043f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0442\u043e&#8230;<\/p>\n<\/li>\n<li>\n<p>return type hint \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442!<\/p>\n<\/li>\n<\/ol>\n<p>\u0412\u043e\u0442 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0441\u0430\u043c\u0438:<\/p>\n<pre><code class=\"python\">def get_orientation(obj: Ufo) -> tuple[float, float, float]:  # WAT? \u044d\u0442\u043e \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435?     # ...     return pitch, roll, yaw  # plot twist: \u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043e \u043a\u043e\u043d\u0446\u0430 \u0438 \u0443\u0437\u043d\u0430\u043b, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 <\/code><\/pre>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0442\u0443\u0442 \u043f\u043e\u043a\u0430 &#8212; \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 <code>namedtuple<\/code> \u0438\u043b\u0438 \u0438\u043d\u044b\u0445 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u043b\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043d\u043e \u043a\u0430\u043a \u043f\u043e \u043c\u043d\u0435 &#8212; \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e boilerplate \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"python\">from collections import namedtuple  Orientation = namedtuple('FunctionResult', ('pitch', 'roll', 'yaw'))  def get_orientation(obj: Ufo) -> Orientation:     # ...     return Orientation(         pitch=...,         roll=...,         yaw=...,     ) <\/code><\/pre>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0443\u0436\u0430\u0441\u043d\u043e. \u0414\u0430 \u0437\u0434\u0440\u0430\u0432\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0438\u0442\u043e\u043d!<\/p>\n<h3>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 5?<\/h3>\n<p>\u0418 \u043f\u043e\u043a\u0430 \u043f\u0435\u0449\u0435\u0440\u043d\u044b\u0435 \u043b\u044e\u0434\u0438 \u0432\u044b\u0445\u043e\u0434\u044f\u0442 \u043d\u0430 \u043d\u043e\u0432\u044b\u0439 \u0432\u0438\u0442\u043e\u043a \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u0438, \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0432\u043e\u043e\u0431\u0449\u0435 \u0436\u0438\u0432\u0443\u0442 \u043c\u0438\u043c\u043e \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u0438 \u0438 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 type annotations &#8212; \u0432 80% \u043f\u043e\u0441\u0442\u043e\u0432 \u043e\u043d\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442.<\/p>\n<pre><code>  0  80%            2252  ANN     Missing type annotation for function argument 'self'   1  77%            2154  TAE001  too few type annotations (0%) <\/code><\/pre>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443? \u042f \u043d\u0435 \u0437\u043d\u0430\u044e. \u041f\u0438\u0442\u043e\u043d 3.5 (\u0430 \u0441 \u043d\u0438\u043c \u0438 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u0442\u0438\u043f\u043e\u0432) \u0432\u044b\u0448\u0435\u043b 7 \u043b\u0435\u0442 \u043d\u0430\u0437\u0430\u0434!<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/9f1\/d88\/544\/9f1d8854412ed8068d51004c8f4ee582.jpg\" width=\"671\" height=\"140\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9f1\/d88\/544\/9f1d8854412ed8068d51004c8f4ee582.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043d\u0430\u043f\u0438\u0448\u0443 \u044d\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0435\u0449\u0451 \u0440\u0430\u0437: \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 type hints. \u042d\u0442\u043e \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e (\u043a\u0440\u043e\u043c\u0435 <code>Generator[yield type, send type, return type]<\/code>, \u043e\u043d\u0438 \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0431\u0435\u0441\u044f\u0442).<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041b\u0435\u0433\u043a\u043e \u0447\u0438\u0442\u0430\u0442\u044c > \u0421\u0430\u043c\u043e\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f > \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041b\u0430\u0434\u043d\u043e, \u0432\u043e\u0442 \u0432\u0430\u043c \u043d\u043e\u0432\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f?<\/p>\n<pre><code class=\"python\">def fn(items: list[int | float | None]) -> list[int, float]: <\/code><\/pre>\n<p>\u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442: \u0430 \u0445\u0440\u0435\u043d \u0435\u0451 \u0437\u043d\u0430\u0435\u0442!<\/p>\n<h3>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 1: \u0447\u0438\u0442\u0430\u0442\u044c \u043a\u043e\u0434<\/h3>\n<pre><code class=\"python\">def fn(items: list[int]) -> list[int]:     return sorted(items, key=math.sin) <\/code><\/pre>\n<p>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c: O(n). \u041d\u0435\u0442, \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430.<\/p>\n<h3>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 2: \u0447\u0438\u0442\u0430\u0442\u044c docstring<\/h3>\n<pre><code class=\"python\">def fn(items: list[int]) -> list[int]:     \"\"\"Sorts items by their sin() values\"\"\"     # ... <\/code><\/pre>\n<p>\u042d\u0442\u043e \u0443\u0434\u043e\u0431\u043d\u0435\u0435, \u043d\u043e, \u043a\u0430\u043a \u044f \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b, \u044d\u0442\u0438 \u0434\u043e\u043a\u0441\u0442\u0440\u0438\u043d\u0433\u0438 \u0434\u043e\u043b\u0436\u043d\u044b <em>\u0431\u044b\u0442\u044c<\/em>, \u043f\u0440\u0438\u0447\u0451\u043c \u0432 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438.<\/p>\n<h3>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 3: \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c<\/h3>\n<pre><code class=\"python\">def sorted_by_sin(items: list[int]) -> list[int]:     # ... <\/code><\/pre>\n<p>\u0422\u0443\u0442 \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u043d\u044f\u0442\u043d\u043e: \u0438\u0442\u0435\u043c\u0441\u044b \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043f\u043e \u0433\u0440\u0435\u0445\u0430\u043c \u0438\u0445. \u0421\u0442\u043e\u043f, \u0447\u0442\u043e?<\/p>\n<p>\u041d\u0443 \u043a\u043e\u0440\u043e\u0447\u0435 \u0432\u044b \u043f\u043e\u043d\u044f\u043b\u0438. \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0439, \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0439 \u043a\u043e\u0434 \u0437\u0430\u043c\u0435\u043d\u044f\u044e\u0442 docstring. \u041f\u0440\u0438\u0437\u043d\u0430\u0442\u044c\u0441\u044f, \u0440\u0430\u043d\u044c\u0448\u0435 \u044f \u0431\u044b\u043b \u0441\u0432\u0438\u0434\u0435\u0442\u0435\u043b\u0435\u043c \u0434\u043e\u043a\u0441\u0442\u0440\u0438\u043d\u0433\u043e\u0432\u044b\u043c \u0438 \u0432\u0435\u0437\u0434\u0435 \u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u0438\u0445 \u043f\u0438\u0441\u0430\u0442\u044c, \u043d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u044f \u0438\u0445 \u043f\u0438\u0448\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043e \u0432\u0441\u044f\u043a\u0438\u0445 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u043b\u0438\u0431, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043a\u0440\u0430\u0441\u0438\u0432\u043e \u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0430\u0441\u044c.<\/p>\n<p>\u0412\u043e\u043f\u0440\u043e\u0441 \u0432 \u043a\u0430\u0441\u0441\u0443: \u043a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0445\u043e\u0440\u043e\u0448\u0435\u0435? \u041e\u0442\u0432\u0435\u0442: \u043b\u044e\u0434\u0438 \u0432 \u0447\u0451\u0440\u043d\u043e\u043c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/34b\/526\/283\/34b52628338f13ef79d050fec1f0afe9.jpg\" width=\"1000\" height=\"667\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/34b\/526\/283\/34b52628338f13ef79d050fec1f0afe9.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0411\u0435\u0440\u0451\u0442\u0435 \u0423\u0438\u043b\u043b\u0430 \u0421\u043c\u0438\u0442\u0430, \u043e\u043d \u0441\u0442\u0438\u0440\u0430\u0435\u0442 \u0432\u0430\u043c \u043f\u0430\u043c\u044f\u0442\u044c, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0443\u0433\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u0435\u043b\u0430\u0435\u0442 &#8212; \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0445\u043e\u0440\u043e\u0448\u0435\u0435.<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041b\u0435\u0433\u043a\u043e \u0447\u0438\u0442\u0430\u0442\u044c > \u0421\u0430\u043c\u043e\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f > \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0422\u0430 \u0436\u0435 \u0442\u0435\u043c\u0430 \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0447\u0443 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c: \u043d\u0438\u043a\u0442\u043e \u0432\u0430\u0441 \u043d\u0435 \u043d\u0430\u0440\u0443\u0433\u0430\u0435\u0442, \u0435\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0432 \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0438 \u043e\u043d\u0430 \u0432\u0434\u0440\u0443\u0433 \u043e\u0442 \u044d\u0442\u043e\u0433\u043e \u0441\u0442\u0430\u043d\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0439.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 &#8212; \u0434\u0435\u043b\u043e \u0441\u0443\u0431\u044a\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0435, \u0442\u043e \u0432\u043e\u0442 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>list<\/code>, <code>set<\/code>, <code>next<\/code>) &#8212; \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0435 \u0437\u043b\u043e. \u0427\u0442\u043e\u0431\u044b \u0432\u044b \u043d\u0435 \u0442\u0435\u0440\u044f\u043b\u0438 \u0431\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0432 5% \u043f\u043e\u0441\u0442\u043e\u0432 \u0430\u0432\u0442\u043e\u0440\u044b \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u0430 \u0432 3% &#8212; \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<pre><code>5% 150 A001 variable \"xxx\" is shadowing a python builtin 3% 100 A002 argument \"xxx\" is shadowing a python builtin 2% 72 CAC002 function is too complex. Bad variable names penalty is too high<\/code><\/pre>\n<p>\u042f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e \u043a\u043e\u0434\u0443 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432\u044b\u0434\u0430\u0451\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u044f\u043c \u0438\u0437 \u0441\u0442\u0430\u0442\u0435\u0439 \u0441 \u0425\u0430\u0431\u0440\u0430, \u0442\u0430\u043a \u0447\u0442\u043e \u0432\u043e\u0442 \u0436\u0438\u0432\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440: \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0434\u0443\u0440\u0430\u0447\u043e\u043a \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b <code>repr<\/code>.<\/p>\n<pre><code class=\"python\">def repr(group_start, group_end) -> str:  # &lt;--------------------------------!!!     # \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442 \u0433\u0440\u0443\u043f\u043f\u0443      if last_group_start == last_group_end:         return str(last_group_end) <\/code><\/pre>\n<p>\u0427\u0442\u043e-\u0442\u043e \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0435&#8230; \u0411\u043b\u0438\u043d, <a href=\"https:\/\/habr.com\/ru\/post\/550088\/\">\u0434\u0430 \u044d\u0442\u043e \u0436 \u044f<\/a>!  \u0422\u0430\u043a, \u0437\u0430\u0431\u044b\u043b\u0438.<\/p>\n<p>\u041a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0445\u043e\u0440\u043e\u0448\u0435\u0435?<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/8d4\/93d\/584\/8d493d584829431a297e9cd162172739.jpg\" width=\"1000\" height=\"667\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8d4\/93d\/584\/8d493d584829431a297e9cd162172739.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041b\u0435\u0433\u043a\u043e \u0447\u0438\u0442\u0430\u0442\u044c > \u0421\u0430\u043c\u043e\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f > \u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0422\u0443\u0442 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e: \u043a\u043e\u0434 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0443, \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c. \u041a\u043e\u0433\u0434\u0430 \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u0447\u0438\u0442\u0430\u0435\u0442 \u043a\u043e\u0434, \u043e\u043d \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0435 \u043d\u0430\u0434\u043e. \u0422\u0430\u043a\u0438\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u043c\u0435\u0441\u0442\u043e \u0438 \u043d\u0435 \u043f\u0440\u0438\u043d\u043e\u0441\u044f\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u044b.<\/p>\n<pre><code class=\"python\"># \u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043f\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0443 26 data.loc[26]<\/code><\/pre>\n<p>\u041d\u043e \u0432\u043e\u0442 \u0435\u0441\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 \u0423\u0438\u043b\u043b\u0430 \u0421\u043c\u0438\u0442\u0430 \u0432\u044b \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435, <em>\u0447\u0442\u043e<\/em> \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 (\u0438\u043b\u0438 <em>\u0437\u0430\u0447\u0435\u043c<\/em>) &#8212; \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u043b\u0438\u0448\u043d\u0438\u043c:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/df2\/a57\/75f\/df2a5775f07c75b0398d20bc17cc78ba.jpg\" width=\"879\" height=\"315\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/df2\/a57\/75f\/df2a5775f07c75b0398d20bc17cc78ba.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<h3>\u041b\u0435\u0433\u043a\u043e \u0447\u0438\u0442\u0430\u0442\u044c > Low RAM<\/h3>\n<p>\u042f \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b, \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f \u0432 \u0433\u043e\u043b\u043e\u0432\u0435 \u043c\u0435\u0441\u0442\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0441\u0438\u043b\u044c\u043d\u0435\u0435 \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u043a\u043e\u0433\u043d\u0438\u0442\u0438\u0432\u043d\u0443\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 &#8212; \u0438\u043d\u0430\u0447\u0435 \u0433\u043e\u0432\u043e\u0440\u044f, \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0433\u043e\u043b\u043e\u0432\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0442\u044c, \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0442\u044c \u0438 \u0443\u043f\u0440\u043e\u0449\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<details class=\"spoiler\">\n<summary>\u041b\u0435\u0433\u043a\u043e \u0447\u0438\u0442\u0430\u0442\u044c > Low RAM > \u041d\u0435\u0432\u044b\u0441\u043e\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0422\u0443\u0442 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e: \u0447\u0435\u043c \u043a\u043e\u0440\u043e\u0447\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0442\u0435\u043c \u043f\u0440\u043e\u0449\u0435 \u0435\u0451 \u043f\u043e\u043d\u044f\u0442\u044c.<\/p>\n<h3>\u0420\u0430\u0437\u0431\u0438\u0442\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h3>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0434\u043b\u0438\u043d\u043d\u0430\u044f? \u0420\u0435\u0446\u0435\u043f\u0442 \u043f\u0440\u043e\u0441\u0442: \u0440\u0430\u0437\u0431\u0435\u0439\u0442\u0435 \u0435\u0451 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e! \u0423\u0432\u044b, \u0432 16% \u043f\u043e\u0441\u0442\u043e\u0432 \u0430\u0432\u0442\u043e\u0440\u044b \u043f\u0438\u0448\u0443\u0442 \u043c\u0435\u0433\u0430-\u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code>16% 447 CCR001 Cognitive complexity is too high 12% 359 CAC001 function is too complex<\/code><\/pre>\n<p>\u041d\u0443 \u0432\u043e\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"python\">def run(self): pixels = pygame.surfarray.pixels3d(self.display)  index = 0 running = True while running: self.model.stimulate()  pixels[:, :, :] = (255 * (self.model.activity > 0))[:, :, None] pygame.display.flip()  for event in pygame.event.get(): if event.type == pygame.QUIT: running = False elif event.type == pygame.KEYDOWN: if event.key == pygame.K_ESCAPE: running = False elif event.key == pygame.K_s: imsave(\"{0:04d}.png\".format(index), pixels[:, :, 0]) index = index + 1 elif event.type == pygame.MOUSEBUTTONDOWN: position = pygame.mouse.get_pos() self.model.activity[position] = 1 <\/code><\/pre>\n<p>\u0422\u0443\u0442 \u0438\u0433\u0440\u043e\u0432\u043e\u0439 \u0446\u0438\u043a\u043b, \u0433\u0434\u0435 \u0441\u043c\u0435\u0448\u0430\u043b\u0438\u0441\u044c \u0432\u044b\u0437\u043e\u0432 \u0441\u0438\u043c\u0443\u043b\u044f\u0446\u0438\u0438, \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0430 \u043f\u0438\u043a\u0441\u0435\u043b\u0435\u0439, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b, \u0441\u043a\u0440\u0438\u043d\u0448\u043e\u0442\u044b&#8230; \u041a\u0430\u043a \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c? \u0420\u0430\u0437\u0431\u0435\u0439\u0442\u0435 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"python\">def run(self):     while self.is_running:     self.model.simulate()     self.draw()     self.handle_input() <\/code><\/pre>\n<h3>\u0413\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0439 \u0432 one-liner<\/h3>\n<p>\u041c\u0430\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0447\u0435\u0442\u044b\u0440\u0451\u0445 \u0441\u0442\u0440\u043e\u0447\u0435\u043a \u0432 \u043e\u0434\u043d\u0443! \u0421\u043b\u0435\u0434\u0438\u0442\u0435 \u0437\u0430 \u0440\u0443\u043a\u0430\u043c\u0438:<\/p>\n<pre><code class=\"python\">if a > b:     max_ = a else:     max_ = b  # ...\u0432\u0436\u0443\u0445!  max_ = a if a > b else b <\/code><\/pre>\n<p>\u042f \u043b\u044e\u0431\u043b\u044e \u0442\u0430\u043a\u0438\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u043c\u0435\u043d\u044c\u0448\u0435 \u043c\u0435\u0441\u0442\u0430. \u041d\u043e \u0435\u0449\u0451 \u0432\u0430\u0436\u043d\u0430\u044f \u0444\u0438\u0448\u043a\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0443 \u043c\u0435\u043d\u044f <em>\u043e\u0434\u043d\u043e<\/em> \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0432 \u043a\u043e\u0434\u0435 \u0432\u043c\u0435\u0441\u0442\u043e \u0434\u0432\u0443\u0445, \u0437\u043d\u0430\u0447\u0438\u0442, \u043c\u0435\u043d\u044c\u0448\u0435 \u0448\u0430\u043d\u0441\u043e\u0432 \u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041b\u0435\u0433\u043a\u043e \u0447\u0438\u0442\u0430\u0442\u044c > Low RAM > \u041d\u0435\u0448\u0438\u0440\u043e\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041a\u043e\u0433\u0434\u0430 \u0443 \u0432\u0430\u0441 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u0432 \u0432 \u043a\u043e\u0434\u0435 &#8212; \u044d\u0442\u043e \u0437\u043d\u0430\u043a, \u0447\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<h3>\u0426\u0438\u043a\u043b\u044b<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u0432 \u0446\u0438\u043a\u043b\u0435 \u043c\u043d\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u043e, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u044d\u0442\u043e \u0432\u0441\u0451 \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u0412\u044b \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442\u0435 \u043a\u043e\u0434, \u043d\u043e \u0438 &#171;\u0441\u0434\u0432\u0438\u0433\u0430\u0435\u0442\u0435&#187; \u0432\u0441\u0451 \u0438\u0437 \u0446\u0438\u043a\u043b\u0430 \u043d\u0430 \u043e\u0434\u0438\u043d \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u043d\u044c\u0448\u0435:<\/p>\n<pre><code class=\"python\">def run(): for event in pygame.event.get(): if event.type == pygame.QUIT:  # \u0442\u0443\u0442 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u0432 == 2 running = False            # \u0442\u0443\u0442 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u0432 == 3 # ...  # ...\u0432\u0436\u0443\u0445!  def process_event(event: Event): if event.type == pygame.QUIT:  # \u0442\u0443\u0442 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u0432 == 1 running = False            # \u0442\u0443\u0442 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u0432 == 2 # ...  def run(): for event in pygame.event.get(): process_event(event) <\/code><\/pre>\n<p>\u041c\u0438\u043d\u0438-\u0431\u043e\u043d\u0443\u0441: \u0435\u0441\u043b\u0438 \u0432 \u0446\u0438\u043a\u043b\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0442\u043e \u044d\u0442\u043e\u0442 \u0446\u0438\u043a\u043b \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0442\u044c (\u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>ThreadPoolExecutor<\/code>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440).<\/p>\n<h3>\u0414\u043b\u0438\u043d\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f<\/h3>\n<p>\u041d\u0443 \u043b\u044e\u0431\u0438\u0442 \u043d\u0430\u0440\u043e\u0434 \u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0443\u0431\u043e\u0434\u0440\u043e\u0431\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f (11%):<\/p>\n<pre><code>11% 325 ECE001 Expression is too complex (13.5 > 7)<\/code><\/pre>\n<p>\u0412\u043e\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"python\"># constraints on communist's or zhulik's votes def findVariants(s, aim, cnt, suffix):     s.add((r9916['com'] - aim['com'] == \\  # &lt;--------------------------------!!!       Sum([If(Bool('v_%d_%s' % (i, suffix)), rewritten_pecs[i]['increase']['com'], 0) for i in range(19)]) + \\       Sum([If(Bool('a_%d_%s' % (k, suffix)), 0, approved_pecs[k]['first']['com']) for k in range(53)])))  <\/code><\/pre>\n<p>\u042f \u043d\u0435 \u0437\u043d\u0430\u044e, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u0432\u044b\u0448\u0435, \u043d\u043e \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u044d\u043f\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0434\u043b\u0438\u043d\u044b, \u0442\u043e \u0445\u043e\u0442\u044f \u0431\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u0435\u0451 \u043d\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e &#8212; \u0442\u0430\u043a \u043b\u0435\u0433\u0447\u0435 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f. \u0412 \u044d\u0442\u043e\u043c \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0441\u043a\u043e\u0431\u043a\u0438, \u0432\u0435\u0434\u044c \u0442\u043e, \u0447\u0442\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u043c \u043c\u0438\u0440\u0435, \u0432 \u043c\u0438\u0440\u0435 \u0441\u043a\u043e\u0431\u043e\u043a \u0434\u043e\u0437\u0432\u043e\u043b\u0435\u043d\u043e.<\/p>\n<p>\u0412\u043e\u0442 \u0442\u0443\u0442 \u0441\u043a\u043e\u0431\u043a\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u0438\u0441\u0430\u0442\u044c <code>+ \u0447\u0442\u043e-\u0442\u043e<\/code> \u0441 \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0438, \u0434\u0430 \u0435\u0449\u0451 \u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c:<\/p>\n<pre><code class=\"python\">missing_set =  (  # &lt;--------------------------------!!!     [(all_letters, '-' * len(all_letters))] * 3 # \u0442\u0443\u0442 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0432\u0441\u0435 \u0431\u0443\u043a\u0432\u044b \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u043c\u0438     + [(all_letters, all_letters)] * 10 # \u0442\u0443\u0442 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0432\u0441\u0435 \u0431\u0443\u043a\u0432\u044b \u041d\u0415 \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u043c\u0438     + [('aeiouy', '------')] * 30 # \u0442\u0443\u0442 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u043f\u0440\u043e\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u043c\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0433\u043b\u0430\u0441\u043d\u044b\u0435 ) <\/code><\/pre>\n<p>\u0418\u043b\u0438 \u0432\u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u044b\u043d\u044f \u0442\u0435\u043a\u0441\u0442\u0430 \u0440\u0430\u0437\u0440\u0443\u043b\u0435\u043d\u0430 \u0441\u043a\u043e\u0431\u043a\u0430\u043c\u0438:<\/p>\n<pre><code class=\"python\">fragment = (     '\u0410\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u0435\u0441\u0442\u044c \u0434\u043b\u044f \u0441\u0435\u0431\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u043d\u0435\u0439 \u043d\u0435\u0442 \u043d\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430, '     '\u043d\u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u0441\u044b\u043b\u043e\u043a \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0438\u043a\u0430\u043a\u043e\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0431\u044b\u043b\u0438 \u0431\u044b '     '\u0442\u0435\u043a\u0443\u0447\u0438 \u0438 \u043f\u0440\u043e\u0437\u0440\u0430\u0447\u043d\u044b; \u043e\u043d\u0430 \u0435\u0441\u0442\u044c \u0447\u0438\u0441\u0442\u0430\u044f \u0444\u043e\u0440\u043c\u0430 \u043f\u043e\u043d\u044f\u0442\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0437\u0435\u0440\u0446\u0430\u0435\u0442 '     '\u0441\u0432\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u043a\u0430\u043a \u0441\u0430\u043c\u043e\u0435 \u0441\u0435\u0431\u044f. \u041e\u043d\u0430 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435, '     '\u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0430 \u0435\u0441\u0442\u044c \u0438\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u0441\u0430\u043c\u043e\u0439 \u0441\u0435\u0431\u044f \u043e\u0442 \u0441\u0435\u0431\u044f, \u0438 \u043e\u0434\u043d\u043e \u0438\u0437 '     '\u044d\u0442\u0438\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0439 \u0435\u0441\u0442\u044c \u0442\u043e\u0436\u0434\u0435\u0441\u0442\u0432\u043e \u0441 \u0441\u043e\u0431\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u043e\u0435, \u043e\u0434\u043d\u0430\u043a\u043e, \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 '     '\u0442\u043e\u0442\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0444\u043e\u0440\u043c \u043a\u0430\u043a \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0439. '     '\u042d\u0442\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0435\u0441\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e.'     f'({author})' ) <\/code><\/pre>\n<h3>Nested conditions<\/h3>\n<p>\u0422\u0443\u0442 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e: \u0437\u0430\u0447\u0435\u043c \u0434\u0432\u0430 <code>if<\/code>, \u0435\u0441\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u043e\u0434\u0438\u043d? \u0412\u0440\u043e\u0434\u0435 \u0431\u0430\u043d\u0430\u043b\u044c\u0449\u0438\u043d\u0430, \u0430 \u0442\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 &#8212; 2%:<\/p>\n<pre><code>2% 65 SIM102 Use a single if-statement instead of nested if-statements<\/code><\/pre>\n<pre><code class=\"python\">if min_val is not None and max_val is not None:     if max_val &lt; min_val:         raise ValueError(\"max_val is greater than min_val\")  # \u0442\u0443\u0442 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u0432 == 2  # ...\u0432\u0436\u0443\u0445!  if min_val is not None and max_val is not None and max_val &lt; min_val: raise ValueError(\"max_val is greater than min_val\")      # \u0442\u0443\u0442 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u0432 == 1 <\/code><\/pre>\n<h3>Pathlib<\/h3>\n<p><code>pathlib<\/code> (\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044f \u0437\u0430\u043c\u043e\u043b\u0432\u043b\u044e \u0441\u043b\u043e\u0432\u0435\u0447\u043a\u043e \u043f\u043e\u0437\u0436\u0435) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u0447\u043a\u0443:<\/p>\n<pre><code class=\"python\">with open('test.txt') as file:     content = open.read()               # \u0442\u0443\u0442 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u0432 == 1  # ...\u0432\u0436\u0443\u0445!  content = Path('test.txt').read_text()  # \u0442\u0443\u0442 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u0432 == 0<\/code><\/pre>\n<h3>Redundant else<\/h3>\n<p>\u041e\u0434\u0438\u043d \u0438\u0437 \u043c\u043e\u0438\u0445 \u043b\u044e\u0431\u0438\u043c\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0443\u043c\u0435\u043d\u044c\u0448\u0435\u043d\u0438\u044f \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u0432: \u0435\u0441\u043b\u0438 \u0432 \u0442\u0435\u043b\u0435 \u043f\u043e\u0441\u043b\u0435 <code>if<\/code> \u0443 \u0432\u0430\u0441 <code>return<\/code> \u0438\u043b\u0438 <code>raise<\/code>, \u0442\u043e <code>else<\/code> \u043d\u0435 \u043d\u0443\u0436\u0435\u043d. \u041f\u0440\u043e\u0449\u0435 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435:<\/p>\n<pre><code class=\"python\">if user_profile: # ... return HttpResponseRedirect(reverse(\"main:dashboard\"))  # \u0438\u043b\u0438 raise  else: # ... messages.success(request, _(\"\u0423\u0441\u043f\u0435\u0448\u043d\u0430\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f.\"))  # \u0442\u0443\u0442 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u0432 == 1 return HttpResponseRedirect(reverse(\"main:dashboard\"))  # ...\u0432\u0436\u0443\u0445!  if user_profile: # ... return HttpResponseRedirect(reverse(\"main:dashboard\"))  # ... messages.success(request, _(\"\u0423\u0441\u043f\u0435\u0448\u043d\u0430\u044f \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f.\"))  # \u0442\u0443\u0442 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u0432 == 0 return HttpResponseRedirect(reverse(\"main:dashboard\")) <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041b\u0435\u0433\u043a\u043e \u0447\u0438\u0442\u0430\u0442\u044c > Low RAM > \u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 <code>if<\/code> \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0430\u0441 \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 2 \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u0443\u0447\u0430\u044f. \u041a\u0430\u0436\u0434\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u0430\u0441 \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u0430 \u0435\u0441\u0442\u044c \u0438 \u0432 \u043d\u0435\u0439 \u0447\u0442\u043e-\u0442\u043e \u043b\u0435\u0436\u0438\u0442. \u041a\u0430\u0436\u0434\u044b\u0439 <code>try<\/code> \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0436\u0438\u0434\u0430\u0442\u044c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0435 \u0434\u043e \u0441\u0430\u043c\u043e\u0433\u043e <code>except<\/code>. \u0412\u0440\u043e\u0434\u0435 \u043f\u0443\u0441\u0442\u044f\u043a\u0438, \u043d\u043e \u0447\u0435\u043c \u0438\u0445 \u0431\u043e\u043b\u044c\u0448\u0435, \u0442\u0435\u043c \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0437\u0430 \u0432\u0441\u0435\u043c \u0443\u0441\u043b\u0435\u0434\u0438\u0442\u044c. \u0412\u0441\u0451, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0433\u043e\u043b\u043e\u0432\u0435, \u044f \u043d\u0430\u0437\u044b\u0432\u0430\u044e &#171;\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u043c&#187;, \u0438 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0435\u043a\u0446\u0438\u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0435\u0433\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0442\u044c.<\/p>\n<h3>Early quit<\/h3>\n<p>\u042f \u0443\u0436\u0435 <a href=\"https:\/\/habr.com\/ru\/post\/564598\/\">\u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b<\/a> \u043f\u0440\u043e \u043d\u0435\u0433\u043e, \u043d\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u043a\u043b\u0430\u0441\u0441\u043d\u044b\u0439 \u043f\u0430\u0442\u0442\u0435\u0440\u043d, \u0447\u0442\u043e \u044f \u0434\u0430\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0435\u0433\u043e \u0432 \u043f\u043b\u0430\u0433\u0438\u043d \u0434\u043b\u044f flake8 (\u043f\u0440\u0430\u0432\u0434\u0430, \u0442\u0430\u043c \u043c\u043d\u043e\u0433\u043e false positives). \u041f\u0440\u0430\u0432\u0438\u043b\u043e \u0442\u0430\u043a\u043e\u0435: \u0441\u0442\u0430\u0440\u0430\u0439\u0442\u0435\u0441\u044c \u0432\u044b\u0439\u0442\u0438 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \/ \u0446\u0438\u043a\u043b\u0430 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435. \u041d\u0430 \u043b\u044e\u0431\u043e\u0439 \u0440\u0430\u0437\u0432\u0438\u043b\u043a\u0435 <code>if-else<\/code> \u043f\u0435\u0440\u0432\u044b\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0439\u0442\u0435 \u0442\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432\u044b\u0439\u0442\u0438 \u0438\u0437 \u0442\u0435\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \/ \u0446\u0438\u043a\u043b\u0430.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"python\">if rate is not None: # \u0432 \u044d\u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0435\u0449\u0451 \u0441\u043b\u0443\u0447\u0430\u0439 `if rate is None`, \u0438 \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0442\u043e\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c     r1 = (df[minus] \/ df[column] - 1).abs()     r2 = (df[plus] \/ df[column] - 1).abs()     return df.loc[(df['new_cases'].ge(100)) &amp; ((r1.notnull() &amp; (r1 &lt;= rate)) | (r2.notnull() &amp; (r2 &lt;= rate)))] else:  # \u0438 \u0432\u043e\u0442 \u043c\u044b \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0435\u0433\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c     raise Exception  # ...\u0432\u0436\u0443\u0445!  if rate is None:  # \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0441 \u0432\u044b\u043a\u0438\u043d\u0435\u0442 \u0438\u0437 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 raise Exception  # \u0435\u0441\u043b\u0438 \u043d\u0435 \u0432\u044b\u043a\u0438\u043d\u0443\u043b - \u0442\u043e \u0445\u043e\u0442\u044f \u0431\u044b \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e \u043d\u0435\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u043c\u043d\u0438\u0442\u044c r1 = (df[minus] \/ df[column] - 1).abs() r2 = (df[plus] \/ df[column] - 1).abs() return df.loc[(df['new_cases'].ge(100)) &amp; ((r1.notnull() &amp; (r1 &lt;= rate)) | (r2.notnull() &amp; (r2 &lt;= rate)))] <\/code><\/pre>\n<p>\u0418\u043b\u0438 \u0432\u043e\u0442:<\/p>\n<pre><code class=\"python\">if response.status == httplib.OK: parser = DNSParser() parser.feed(response.read()) return parser.saved_data else: return 'Error ' + str(response.status)  # ...\u0432\u0436\u0443\u0445!  if response.status != httplib.OK: return 'Error ' + str(response.status)  parser = DNSParser() parser.feed(response.read()) return parser.saved_data <\/code><\/pre>\n<p>\u041e\u0431\u043e\u0431\u0449\u0430\u044f, \u043f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">\u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043d\u0435 \u0442\u0430\u043a:     return  \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u0435\u0449\u0451 \u043d\u0435 \u0442\u0430\u043a:     return  \u0435\u0441\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0430:     raise  # \u0442\u0443\u0442 \u043c\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0432\u0441\u0451 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u043a\u043e\u0434, \u0434\u0435\u043b\u0430\u044e\u0449\u0438\u0439 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0435 <\/code><\/pre>\n<h3>Small try blocks<\/h3>\n<p>\u0412 4% \u043f\u043e\u0441\u0442\u043e\u0432 \u0430\u0432\u0442\u043e\u0440\u044b \u043f\u044b\u0442\u0430\u044e\u0442\u0441\u044f \u0441\u043a\u043e\u0440\u043c\u0438\u0442\u044c \u0432 <code>try<\/code> \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e. \u041d\u0430\u0432\u0435\u0440\u043d\u043e, \u044d\u0442\u043e \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043a\u043e\u0440\u043d\u0438 \u0440\u044b\u0431\u043e\u043b\u043e\u0432\u043e\u0432 \u0434\u0430\u044e\u0442 \u043e \u0441\u0435\u0431\u0435 \u0437\u043d\u0430\u0442\u044c &#8212; \u043d\u0430\u0442\u044f\u043d\u0443\u043b \u0441\u0435\u0442\u044c \u043f\u043e\u0448\u0438\u0440\u0435 \u0438 \u043b\u043e\u0432\u0438\u0448\u044c \u0441\u0435\u0431\u0435 \u0432\u0441\u0451, \u0447\u0442\u043e \u0435\u0441\u0442\u044c, \u0438\u043d\u043e\u0433\u0434\u0430 \u0434\u0430\u0436\u0435 \u043d\u0435 \u0433\u043d\u0443\u0448\u0430\u044f\u0441\u044c \u043b\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e <code>Exception<\/code>.<\/p>\n<pre><code>4% 106 GRG004 Too big \"try\" code block<\/code><\/pre>\n<p>\u0412 \u0438\u0434\u0435\u0430\u043b\u0435 \u0432\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0438 \u0433\u0434\u0435 \u0432\u044b \u043b\u043e\u0432\u0438\u0442\u0435 &#8212; \u0442\u043e\u0433\u0434\u0430 \u043f\u0440\u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0438 \u0431\u043b\u043e\u043a\u0430 <code>except<\/code> \u0432\u044b \u0442\u043e\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u0442\u0435 \u0437\u043d\u0430\u0442\u044c, \u0438\u0437 \u043a\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u0435\u0442\u0435\u043b\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u0438\u0434\u0435\u0430\u043b\u0435 \u043c\u0435\u0436\u0434\u0443 <code>try<\/code> \u0438 <code>except<\/code> \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c 1-3 \u0441\u0442\u0440\u043e\u0447\u043a\u0438, \u0430 \u0435\u0441\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 &#8212; \u0437\u0430\u0434\u0443\u043c\u0430\u0439\u0442\u0435\u0441\u044c, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, <code>try-except<\/code> \u0432\u0432\u043e\u0434\u044f\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043e\u0442\u0441\u0442\u0443\u043f, \u0430 \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0442\u0441\u0442\u0443\u043f\u043e\u0432&#8230; \u043d\u0443 \u0432\u044b \u043f\u043e\u043c\u043d\u0438\u0442\u0435.<\/p>\n<pre><code class=\"python\">def new_from_file(self, filename, selected=True):     try:         file_path = normalize_path(filename, True)         obj = DesktopParser(file_path)         sname = obj.get('Name',locale=LOCALE)         desc = obj.get('Comment',locale=LOCALE)         icon = obj.get('Icon')         pix = IconManager().get_icon(ThemedIcon('image-missing'),32)         if icon:             if icon.rfind('.') != -1:                 pix = IconManager().get_icon(FileIcon(File(icon)),32)             else:                 pix = IconManager().get_icon(ThemedIcon(icon),32)              data = (pix, '%s' % sname, obj, sname.upper(), file_path)         return self.launcher_view.add_row(data,selected)     except:         return None  # ...\u0432\u0436\u0443\u0445!  def new_from_file(self, filename, selected=True):     file_path = normalize_path(filename, True)     try:         obj = DesktopParser(file_path)     except DesktopParserError:     return      sname = obj.get('Name',locale=LOCALE) desc = obj.get('Comment',locale=LOCALE) icon = obj.get('Icon') try: pix = IconManager().get_icon(ThemedIcon('image-missing'),32) except IconError: return  if icon: if icon.rfind('.') != -1: pix = IconManager().get_icon(FileIcon(File(icon)),32) else: pix = IconManager().get_icon(ThemedIcon(icon),32)  data = (pix, '%s' % sname, obj, sname.upper(), file_path) return self.launcher_view.add_row(data,selected)  <\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043f\u0440\u044f\u043c \u043a\u0430\u043a\u0430\u044f-\u0442\u043e \u043d\u0435\u043d\u0430\u0434\u0451\u0436\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u0435\u0441\u044c \u0435\u0451 \u043a\u043e\u0434 \u0437\u0430\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432 <code>try-except<\/code>, \u0442\u043e \u0445\u043e\u0442\u044f \u0431\u044b <a href=\"https:\/\/stackoverflow.com\/a\/27500036\/1935381\">\u044e\u0437\u0430\u0439\u0442\u0435 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440<\/a>.<\/p>\n<h3>Context manager<\/h3>\n<pre><code>7% 208 SIM115 Use context handler for opening files<\/code><\/pre>\n<p>\u0412\u043d\u0435\u0437\u0430\u043f\u043d\u043e, \u0432 7% \u043f\u043e\u0441\u0442\u043e\u0432 \u0430\u0432\u0442\u043e\u0440\u044b \u043e\u0431\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0431\u0435\u0437 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u044b\u0445 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432. \u041e\u043d\u0438, \u043d\u0430\u0432\u0435\u0440\u043d\u043e, \u0441\u0443\u043f\u0435\u0440\u043c\u0435\u043d\u044b \u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043c\u043d\u044f\u0442, \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b?<\/p>\n<pre><code class=\"python\">@profile def create_file():     x = [(random.random(),           random_string(),           random.randint(0, 2 ** 64))          for _ in xrange(1000000)]      pickle.dump(x, open('machin.pkl', 'w')) <\/code><\/pre>\n<p>\u042f \u0432\u043e\u0442 \u043c\u043e\u0433\u0443 \u0438 \u0437\u0430\u0431\u044b\u0442\u044c \u043f\u0440\u043e <code>file.close()<\/code>. \u042d\u0442\u0438 \u0432\u0430\u0448\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u044b <a href=\"https:\/\/lerner.co.il\/2015\/01\/18\/dont-use-python-close-files-answer-depends\/\">\u0433\u043e\u0432\u043e\u0440\u044f\u0442<\/a>, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0441\u0430\u043c\u043e\u043c\u0443 \u043d\u0435 \u0432\u044b\u0437\u0432\u0430\u0442\u044c <code>close()<\/code>, \u0442\u043e cpython \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0444\u0430\u0439\u043b\u044b, \u043a\u043e\u0433\u0434\u0430 \u0438\u0445 refcount = 0 \u0438 \u0441\u0431\u043e\u0440\u0449\u0438\u043a \u043c\u0443\u0441\u043e\u0440\u0430 \u0434\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0434\u043e \u043d\u0438\u0445, \u0430 \u0432\u043e\u0442 pypy &#8212; \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u0422\u0430\u043a \u0447\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u044b\u0435 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b, \u0438 \u043f\u0443\u0441\u0442\u044c \u043e\u043d\u043e \u0442\u0430\u043c \u0441\u0430\u043c\u043e \u043f\u043e\u043c\u043d\u0438\u0442, \u043a\u043e\u0433\u0434\u0430 \u0447\u0442\u043e \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u0438 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c:<\/p>\n<pre><code class=\"python\">with open('machin.pkl', 'w') as out_file:     pickle.dump(x, out_file) <\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u044b\u0439 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0434\u043b\u044f <code>open()<\/code>, \u043d\u043e \u0435\u0441\u0442\u044c \u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u044b\u0435 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u044b \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u043e\u0433\u043e &#8212; \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 &#8212; \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0448\u0442\u0443\u043a\u0438!<\/p>\n<h3>Yagni<\/h3>\n<p>\u0412 \u043a\u043e\u0434\u0435 \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0435\u043d\u0443\u0436\u043d\u043e\u0433\u043e. \u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043a\u043e\u0434 \u043f\u043e\u0434 VCS, \u0442\u043e \u0441\u043c\u0435\u043b\u043e \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0439\u0442\u0435 \u043c\u0451\u0440\u0442\u0432\u044b\u0439 \u043a\u043e\u0434 &#8212; \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043f\u043e\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u0435\u0440\u043d\u0443\u0442\u044c (\u043d\u043e, \u0441\u043a\u043e\u0440\u0435\u0439 \u0432\u0441\u0435\u0433\u043e, \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0434\u043e\u0439\u0434\u0451\u0442). \u041d\u0443 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e \u043c\u0435\u043b\u043e\u0447\u0438:<\/p>\n<p>\u0417\u0430\u043c\u0435\u043d\u044f\u0439\u0442\u0435 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 underscore<\/p>\n<pre><code>10% 285 B007 Loop control variable 'i' not used within the loop body. If this is intended, start the name with an underscore.<\/code><\/pre>\n<pre><code class=\"python\">for i in range(32):     print(quantum_randbit(), end='')  # ...\u0432\u0436\u0443\u0445!  for _ in range(32):     print(quantum_randbit(), end='') <\/code><\/pre>\n<p>\u0414\u043b\u044f \u043f\u0443\u0442\u0435\u0448\u0435\u0441\u0442\u0435\u043e\u0432\u0435\u043d\u043d\u0438\u043a\u043e\u0432 \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438: \u0443 \u043d\u0430\u0441 \u0432 2022 <code>object<\/code> \u0443\u0436\u0435 \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u0435\u043d.<\/p>\n<pre><code>5% 160 SIM120 Use 'class Bot:' instead of 'class Bot(object):'<\/code><\/pre>\n<pre><code class=\"python\">class DataItem(object):     __slots__ = ['name', 'age', 'address']  # ...\u0432\u0436\u0443\u0445!  class DataItem:     __slots__ = ['name', 'age', 'address'] <\/code><\/pre>\n<p>\u041d\u0435 \u043d\u0430\u0434\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0430 \u043f\u043e\u0442\u043e\u043c \u043d\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0435\u0433\u043e. \u041d\u0430\u043f\u043e\u043b\u043d\u044f\u0439\u0442\u0435 \u0441\u0440\u0430\u0437\u0443!<\/p>\n<pre><code>1% 44 PIE799 prefer-col-init: Consider passing values in when creating the collection.<\/code><\/pre>\n<pre><code class=\"python\">Contour=[] Contour.append( [pcbnew.Millimeter2iu(plane_size[0]),   pcbnew.Millimeter2iu(plane_size[1]) ]) Contour.append( [pcbnew.Millimeter2iu(plane_size[0]),  -pcbnew.Millimeter2iu(plane_size[1]) ]) Contour.append( [-pcbnew.Millimeter2iu(plane_size[0]), -pcbnew.Millimeter2iu(plane_size[1]) ]) Contour.append( [-pcbnew.Millimeter2iu(plane_size[0]),  pcbnew.Millimeter2iu(plane_size[1]) ])    # ...\u0432\u0436\u0443\u0445!  Countour = [    [pcbnew.Millimeter2iu(plane_size[0]),   pcbnew.Millimeter2iu(plane_size[1]) ],    [pcbnew.Millimeter2iu(plane_size[0]),  -pcbnew.Millimeter2iu(plane_size[1]) ],    [-pcbnew.Millimeter2iu(plane_size[0]), -pcbnew.Millimeter2iu(plane_size[1]) ],    [-pcbnew.Millimeter2iu(plane_size[0]),  pcbnew.Millimeter2iu(plane_size[1]) ], ] <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041b\u0435\u0433\u043a\u043e \u0447\u0438\u0442\u0430\u0442\u044c > Low RAM > Best practices<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0410 \u0435\u0449\u0451 \u043a\u043e\u0434 \u043b\u0435\u0433\u0447\u043e \u0447\u0438\u0442\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u043f\u0438\u0448\u0443\u0442 \u0442\u0430\u043a, \u043a\u0430\u043a \u043e\u0431\u0449\u0435\u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0438 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e \u043f\u043e \u043d\u044b\u043d\u0435\u0448\u043d\u0435\u0439 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<h3>Range<\/h3>\n<p>\u0412\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u0434\u043b\u044f 4%, <code>range<\/code> \u0443\u0436\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u043d\u0443\u043b\u044f!<\/p>\n<pre><code>4% 119 PIE808 prefer-simple-range: range starts at 0 by default.<\/code><\/pre>\n<pre><code class=\"python\">for i in range(0, n):     dydt[i] = y[i + n]  # ...\u0432\u0436\u0443\u0445!  for i in range(n): dydt[i] = y[i + n] <\/code><\/pre>\n<h3>Enumerate<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u0446\u0438\u043a\u043b\u0435 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u0441\u0447\u0451\u0442\u0447\u0438\u043a \u0438 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0435 \u0435\u0433\u043e \u043d\u0430 1 \u0432 \u043a\u043e\u043d\u0446\u0435 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438, \u0442\u043e, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u0434\u043e\u043a\u0442\u043e\u0440 \u0432\u0430\u043c \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u0442 <code>enumerate()<\/code>.<\/p>\n<pre><code>2% 70 SIM113 Use enumerate for 'val'<\/code><\/pre>\n<pre><code class=\"python\">counter = 0 for vk in vk_apis: change_photo(vk) print(counter, 'done') counter += 1  # ...\u0432\u0436\u0443\u0445!  for i, vk in enumerate(vk_apis):     change_photo(vk)     print(i, 'done') <\/code><\/pre>\n<h3>Suppress<\/h3>\n<pre><code>1% 55 SIM105 Use 'contextlib.suppress(Exception)'<\/code><\/pre>\n<p>\u0421\u0430\u043c \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0443\u0437\u043d\u0430\u043b! \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u043a\u043e\u0440\u043e\u0442\u0438\u0442\u044c <code>try-except-pass<\/code>:<\/p>\n<pre><code class=\"python\">try: flatPriceDelta = float(flatPriceInfo) - float(oldFlatPriceInfo) except ValueError: pass  # ...\u0432\u0436\u0443\u0445!  with suppress(ValueError):     flatPriceDelta = float(flatPriceInfo) - float(oldFlatPriceInfo) <\/code><\/pre>\n<h3>Pathlib<\/h3>\n<p><code>pathlib<\/code> &#8212; \u044d\u0442\u043e \u043a\u0430\u043a type hints: \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u0448\u0442\u0443\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u0447\u0430\u0441\u0442\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u044e\u0442. \u0415\u0441\u043b\u0438 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 <code>os.path<\/code>, \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0435\u0441\u0442\u044c \u0432 \u0434\u0435\u043b\u043e\u0440\u0435\u0430\u043d, \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c\u0441\u044f \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u0435 \u0438 \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <code>pathlib<\/code>.<\/p>\n<pre><code>1% 41 PL107 os.remove(\"foo\") should be replaced by foo_path.unlink() 1% 38 PL103 os.makedirs(\"foo\/bar\") should be replaced by bar_path.mkdir(parents=True) 14% 395 PL123 open(\"foo\") should be replaced by Path(\"foo\").open() 3% 96 PL118 os.path.join(\"foo\", \"bar\") should be replaced by foo_path \/ \"bar\" 2% 67 PL110 os.path.exists(\"foo\") should be replaced by foo_path.exists()<\/code><\/pre>\n<pre><code class=\"python\">os.remove(\"..\/m3u8_downloader\/segments\/temp.ts\") # ...\u0432\u0436\u0443\u0445! Path(\"..\/m3u8_downloader\/segments\/temp.ts\").unlink()   if not os.path.exists(tools_path):     os.makedirs(tools_path) # ...\u0432\u0436\u0443\u0445! tools_path.mkdir(parents=True, exist_ok=True)   with open('posts.txt') as file: # ...\u0432\u0436\u0443\u0445! with Path('posts.txt').open() as file:   def SaveDriverFile(self):   winPath = os.environ['WINDIR']   sys32Path = os.path.join(winPath, \"System32\")   targetPath = os.path.join(sys32Path, \"drivers\\\\\" + self.name + \".sys\")   file_data = open(self.file_path, \"rb\").read()   open(targetPath, \"wb\").write(file_data) # ...\u0432\u0436\u0443\u0445! def SaveDriverFile(self):   winPath = Path(os.environ['WINDIR'])   sys32Path = winPath \/ \"System32\"   targetPath = sys32Path \/ \"drivers\" \/ self.name + \".sys\"   file_data = self.file_path.read_bytes()   targetPath.write_bytes(file_data)   if not os.path.exists(HOME_DIR+'\/'+'ShootAndView'): # ...\u0432\u0436\u0443\u0445! if not (HOME_DIR \/ 'ShootAndView').exists(): <\/code><\/pre>\n<p>\u041a\u0441\u0442\u0430\u0442\u0438, pathlib \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 argparse:<\/p>\n<pre><code class=\"python\">from argparse import ArgumentParser  parser = ArgumentParser() parser.add_argument('path', type=Path) args = parser.parse_args()  subpath = args.path \/ 'subpath' <\/code><\/pre>\n<h3>Boolean expressions<\/h3>\n<pre><code>1% 31 PIE801 prefer-simple-return: Return boolean expressions directly instead of returning `True` and `False`.<\/code><\/pre>\n<pre><code class=\"python\">if q.measure()[:~0] == '0' * n:     return True else:     return False  # ...\u0432\u0436\u0443\u0445!  return q.measure()[:~0] == '0' * n <\/code><\/pre>\n<h3>Filter \/ map<\/h3>\n<pre><code>1% 37 C417 Unnecessary use of map - use a generator expression instead.<\/code><\/pre>\n<p>\u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 <code>filter<\/code> \u0438 <code>map<\/code> \u043b\u0435\u0433\u043a\u043e \u0437\u0430\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u0433\u0435\u043d\u0435\u0442\u0430\u0442\u043e\u0440\u044b \u0438\u043b\u0438 list comprehension, \u0430 \u0431\u043e\u043d\u0443\u0441\u043e\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043b\u0443\u0447\u0448\u0430\u044f \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c.<\/p>\n<pre><code class=\"python\">key_dicts = map(lambda key: key.as_key(), keys) return dict(keys=list(key_dicts), nextApplicationKeyId=next_application_key_id)  # ...\u0432\u0436\u0443\u0445!  key_dicts = [key.as_key() for key in keys] return dict(keys=key_dicts, nextApplicationKeyId=next_application_key_id) <\/code><\/pre>\n<p>\u041d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0435 \u0437\u043b\u043e\u0434\u0435\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 <code>filter(map(...))<\/code>, \u0432\u043e\u0442 \u0432\u0430\u043c \u043c\u043e\u0439 \u0448\u0435\u0434\u0435\u0432\u0440:<\/p>\n<pre><code class=\"python\">params = { '--write-buffer-size': 123, '--skip-hash-verification': None, '--max-download-streams-per-file': 8, } args = list(map(str, filter(None, chain.from_iterable(params.items())))) <\/code><\/pre>\n<p>\u041d\u0435 \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0442\u0430\u043a.<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041b\u0435\u0433\u043a\u043e \u0447\u0438\u0442\u0430\u0442\u044c > Low RAM > Well-known libs<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0437\u0443\u0431\u043e\u0434\u0440\u043e\u0431\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0434, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0443\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438. \u0422\u0443\u0442 \u044f \u043e\u043f\u0438\u0448\u0443 \u043b\u0438\u0448\u044c \u0442\u0435, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435 \u043c\u043e\u0433\u0443 \u043f\u0440\u043e\u043c\u043e\u043b\u0447\u0430\u0442\u044c.<\/p>\n<h3>Requests<\/h3>\n<p>\u0414\u0430-\u0434\u0430, \u043c\u044b \u0432\u0441\u0435 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c, \u043d\u043e \u043c\u043d\u043e\u0433\u0438\u0435 \u043d\u0435 \u0437\u043d\u0430\u044e\u0442 \u0434\u0432\u0443\u0445 \u0444\u0438\u0448\u0435\u043a:<\/p>\n<ol>\n<li>\n<p><code>requests.get(...)<\/code> \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u043d\u043e\u0432\u0443\u044e \u0441\u0435\u0441\u0441\u0438\u044e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430, \u0447\u0442\u043e \u043d\u0430\u043a\u043b\u0430\u0434\u043d\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0434\u0435\u043b\u0430\u0435\u0442\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0438 \u0442\u043e\u043c\u0443 \u0436\u0435 \u0441\u0430\u0439\u0442\u0443. \u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 &#8212; \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0441\u0441\u0438\u0438, \u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u044d\u0442\u043e \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u0432 &#171;<a href=\"https:\/\/requests.readthedocs.io\/en\/latest\/user\/advanced\/\">advanced usage<\/a>&#187; <code>\u00af\\_(\u30c4)_\/\u00af<\/code><\/p>\n<\/li>\n<li>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <a href=\"https:\/\/github.com\/psf\/requests\/issues\/3070\">\u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0430 \u043d\u0430 \u0437\u0430\u043f\u0440\u043e\u0441<\/a>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u0441\u0430\u0439\u0442 \u0434\u043e\u043b\u0433\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442, \u0442\u043e \u0432\u0430\u0448 \u043a\u043e\u0434 \u0442\u043e\u0436\u0435 \u0431\u0443\u0434\u0435\u0442 \u0442\u043e\u0440\u043c\u043e\u0437\u0438\u0442\u044c.<\/p>\n<\/li>\n<\/ol>\n<h3>Tenacity<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u044f \u0443\u0432\u0438\u0434\u0435\u043b <a href=\"https:\/\/github.com\/jd\/tenacity\">tenacity<\/a>, \u044f \u043d\u0435 \u0445\u043e\u0447\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0438\u043a\u0430\u043a\u0438\u043c\u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 retry-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438. \u0422\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u043a\u0430\u043a \u043e\u043d \u043b\u0435\u0433\u043a\u043e \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f:<\/p>\n<pre><code class=\"python\">@retry( reraise=True, wait=wait_incrementing(start=1, increment=2), stop=stop_after_attempt(20), ) def request(self, method: str, path: str, **kwargs) -> requests.Response: if path.startswith('\/'): path = self.BASE_URL + path  kwargs.setdefault('timeout', self.TIMEOUT) response = self.session.request(method, path, **kwargs)  if response.status_code == requests.codes.too_many_requests: raise TryAgain()  return response <\/code><\/pre>\n<p>\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043d\u0435 \u0438\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0439\u0442\u0435 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u044b, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u043b\u0438\u0442\u044c retry \u043b\u043e\u0433\u0438\u043a\u0443. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <code>tenacity<\/code>.<\/p>\n<h3>More-itertools<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0441\u043b\u044b\u0448\u0430\u043b\u0438 \u043f\u0440\u043e <a href=\"https:\/\/docs.python.org\/3\/library\/itertools.html\">itertools<\/a> \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0442\u043e \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c. <code>itertools.chain<\/code> \u043c\u0435\u043d\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0432\u044b\u0440\u0443\u0447\u0430\u0435\u0442.<br \/> \u041d\u043e \u0435\u0441\u043b\u0438 <code>itertools<\/code> \u0432\u0430\u043c \u0443\u0436\u0435 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442, \u0442\u043e \u0432\u044d\u043b\u043a\u0430\u043c: <a href=\"https:\/\/more-itertools.readthedocs.io\">more-itertools<\/a>. \u0422\u0443\u0442 \u0435\u0441\u0442\u044c <code>chunked<\/code>, <code>spy<\/code>, <code>first<\/code>, <code>one<\/code>, <code>only<\/code>, <code>unique_everseen<\/code> \u0438 \u043f\u0440\u043e\u0447\u0438\u0435 \u043f\u0440\u0435\u043b\u0435\u0441\u0442\u0438. \u041e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e, \u0441 \u044d\u0442\u043e\u0439 \u0434\u0440\u044f\u043d\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u043b\u0435\u0437\u0442\u044c.<\/p>\n<\/div>\n<\/details>\n<h2>\u041b\u0435\u0433\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c<\/h2>\n<p>\u041c\u043e\u0436\u0435\u0442, \u0432\u044b \u0441\u0430\u043c\u0438, \u0430 \u043c\u043e\u0436\u0435\u0442, \u043a\u0442\u043e-\u0442\u043e \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0430 \u043e\u0434\u043d\u0430\u0436\u0434\u044b \u0437\u0430\u0445\u043e\u0447\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432 \u0432\u0430\u0448\u0435\u043c \u043a\u043e\u0434\u0435. \u0418 \u044d\u0442\u043e\u0442 \u043a\u0442\u043e-\u0442\u043e \u043c\u044b\u0441\u043b\u0435\u043d\u043d\u043e \u0441\u043a\u0430\u0436\u0435\u0442 \u0432\u0430\u043c \u0441\u043f\u0430\u0441\u0438\u0431\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u0437\u0430\u0431\u043e\u0442\u0438\u0442\u0435\u0441\u044c \u043e\u0431 \u044d\u0442\u043e\u043c.<\/p>\n<details class=\"spoiler\">\n<summary>\u041b\u0435\u0433\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c > \u041a\u043b\u0430\u0441\u0441\u044b<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0412\u043d\u0435\u0437\u0430\u043f\u043d\u043e, \u043a\u043b\u0430\u0441\u0441\u044b \u043f\u043e\u043b\u0435\u0437\u043d\u044b \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043d\u043e \u0438 \u0434\u043b\u044f \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f! \u0412\u043e\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u043e\u0441\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f:<\/p>\n<pre><code class=\"python\">SOME_CONSTANT = 5  def do_something(value: int) -> int:     return value * SOME_CONSTANT <\/code><\/pre>\n<p>\u041a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0447\u0442\u043e\u0431 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043e\u0439? \u041f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 \u044f\u0432\u043d\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u043c\u0435\u0441\u0442\u0435, \u0433\u0434\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443. \u0418\u043b\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c <code>new_do_something = partial(do_something, constant=6)<\/code> \u0438 \u0432\u0435\u0437\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u041d\u043e&#8230;<\/p>\n<p>\u0412\u043e\u0442 \u0442\u043e \u0436\u0435, \u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u043a\u043b\u0430\u0441\u0441. \u0422\u0435\u043f\u0435\u0440\u044c \u043a\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0438 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443, \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0438 \u0432\u0441\u0451 \u0432\u043c\u0435\u0441\u0442\u0435, \u0438 \u043d\u0430\u0434\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0432\u0435\u0440\u0445.<\/p>\n<pre><code class=\"python\">class Something:     SOME_CONSTANT = 5      @classmethod     def do_something(cls, value: int) -> int:         return value * cls.SOME_CONSTANT   class Other(Something):     SOME_CONSTANT = 6      @classmethod     def do_something(cls, value: int) -> int:         result = super().do_something(value)         return result - 3 <\/code><\/pre>\n<p>\u041d\u0435 \u0442\u043e \u0447\u0442\u043e\u0431\u044b \u044f \u0442\u043e\u043f\u0438\u043b \u0437\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0432\u0435\u0437\u0434\u0435 &#8212; \u0438\u043d\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u0438\u0437\u043b\u0438\u0448\u043d\u0435, \u0438 \u0441\u0442\u0430\u0440\u044b\u0435 \u0434\u043e\u0431\u0440\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u0443\u0434\u0443\u0442 \u0440\u0435\u0448\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u0447\u0443 \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u041d\u043e \u0435\u0441\u043b\u0438 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 &#8212; \u044f \u0431\u044b \u0441\u043c\u043e\u0442\u0440\u0435\u043b \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043a\u043b\u0430\u0441\u0441\u043e\u0432.<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041b\u0435\u0433\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c > \u0424\u0443\u043d\u043a\u0446\u0438\u0438<\/summary>\n<div class=\"spoiler__content\">\n<p>\u042f \u043f\u0440\u044f\u043c \u0441\u0440\u0430\u0437\u0443 \u0432\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u044e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u0438 Django. \u041d\u0435 \u0434\u0430\u0439 \u0431\u043e\u0433 \u043c\u043d\u0435 \u0432\u0434\u0440\u0443\u0433 \u043d\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0447\u0442\u043e-\u0442\u043e \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 &#8212; \u0432\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u043a\u0430\u043a\u043e\u0435 \u0442\u0430\u043c \u043f\u043e\u043b\u043e\u0442\u043d\u043e!<\/p>\n<details class=\"spoiler\">\n<summary>base.py (\u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e, \u043e\u043f\u0430\u0441\u043d\u043e \u0434\u043b\u044f \u0433\u043b\u0430\u0437)<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"python\">class ModelBase(type):     \"\"\"Metaclass for all models.\"\"\"      def __new__(cls, name, bases, attrs, **kwargs):         super_new = super().__new__          # Also ensure initialization is only performed for subclasses of Model         # (excluding Model class itself).         parents = [b for b in bases if isinstance(b, ModelBase)]         if not parents:             return super_new(cls, name, bases, attrs)          # Create the class.         module = attrs.pop(\"__module__\")         new_attrs = {\"__module__\": module}         classcell = attrs.pop(\"__classcell__\", None)         if classcell is not None:             new_attrs[\"__classcell__\"] = classcell         attr_meta = attrs.pop(\"Meta\", None)         # Pass all attrs without a (Django-specific) contribute_to_class()         # method to type.__new__() so that they're properly initialized         # (i.e. __set_name__()).         contributable_attrs = {}         for obj_name, obj in attrs.items():             if _has_contribute_to_class(obj):                 contributable_attrs[obj_name] = obj             else:                 new_attrs[obj_name] = obj         new_class = super_new(cls, name, bases, new_attrs, **kwargs)          abstract = getattr(attr_meta, \"abstract\", False)         meta = attr_meta or getattr(new_class, \"Meta\", None)         base_meta = getattr(new_class, \"_meta\", None)          app_label = None          # Look for an application configuration to attach the model to.         app_config = apps.get_containing_app_config(module)          if getattr(meta, \"app_label\", None) is None:             if app_config is None:                 if not abstract:                     raise RuntimeError(                         \"Model class %s.%s doesn't declare an explicit \"                         \"app_label and isn't in an application in \"                         \"INSTALLED_APPS.\" % (module, name)                     )              else:                 app_label = app_config.label          new_class.add_to_class(\"_meta\", Options(meta, app_label))         if not abstract:             new_class.add_to_class(                 \"DoesNotExist\",                 subclass_exception(                     \"DoesNotExist\",                     tuple(                         x.DoesNotExist                         for x in parents                         if hasattr(x, \"_meta\") and not x._meta.abstract                     )                     or (ObjectDoesNotExist,),                     module,                     attached_to=new_class,                 ),             )             new_class.add_to_class(                 \"MultipleObjectsReturned\",                 subclass_exception(                     \"MultipleObjectsReturned\",                     tuple(                         x.MultipleObjectsReturned                         for x in parents                         if hasattr(x, \"_meta\") and not x._meta.abstract                     )                     or (MultipleObjectsReturned,),                     module,                     attached_to=new_class,                 ),             )             if base_meta and not base_meta.abstract:                 # Non-abstract child classes inherit some attributes from their                 # non-abstract parent (unless an ABC comes before it in the                 # method resolution order).                 if not hasattr(meta, \"ordering\"):                     new_class._meta.ordering = base_meta.ordering                 if not hasattr(meta, \"get_latest_by\"):                     new_class._meta.get_latest_by = base_meta.get_latest_by          is_proxy = new_class._meta.proxy          # If the model is a proxy, ensure that the base class         # hasn't been swapped out.         if is_proxy and base_meta and base_meta.swapped:             raise TypeError(                 \"%s cannot proxy the swapped model '%s'.\" % (name, base_meta.swapped)             )          # Add remaining attributes (those with a contribute_to_class() method)         # to the class.         for obj_name, obj in contributable_attrs.items():             new_class.add_to_class(obj_name, obj)          # All the fields of any type declared on this model         new_fields = chain(             new_class._meta.local_fields,             new_class._meta.local_many_to_many,             new_class._meta.private_fields,         )         field_names = {f.name for f in new_fields}          # Basic setup for proxy models.         if is_proxy:             base = None             for parent in [kls for kls in parents if hasattr(kls, \"_meta\")]:                 if parent._meta.abstract:                     if parent._meta.fields:                         raise TypeError(                             \"Abstract base class containing model fields not \"                             \"permitted for proxy model '%s'.\" % name                         )                     else:                         continue                 if base is None:                     base = parent                 elif parent._meta.concrete_model is not base._meta.concrete_model:                     raise TypeError(                         \"Proxy model '%s' has more than one non-abstract model base \"                         \"class.\" % name                     )             if base is None:                 raise TypeError(                     \"Proxy model '%s' has no non-abstract model base class.\" % name                 )             new_class._meta.setup_proxy(base)             new_class._meta.concrete_model = base._meta.concrete_model         else:             new_class._meta.concrete_model = new_class          # Collect the parent links for multi-table inheritance.         parent_links = {}         for base in reversed([new_class] + parents):             # Conceptually equivalent to `if base is Model`.             if not hasattr(base, \"_meta\"):                 continue             # Skip concrete parent classes.             if base != new_class and not base._meta.abstract:                 continue             # Locate OneToOneField instances.             for field in base._meta.local_fields:                 if isinstance(field, OneToOneField) and field.remote_field.parent_link:                     related = resolve_relation(new_class, field.remote_field.model)                     parent_links[make_model_tuple(related)] = field          # Track fields inherited from base models.         inherited_attributes = set()         # Do the appropriate setup for any model parents.         for base in new_class.mro():             if base not in parents or not hasattr(base, \"_meta\"):                 # Things without _meta aren't functional models, so they're                 # uninteresting parents.                 inherited_attributes.update(base.__dict__)                 continue              parent_fields = base._meta.local_fields + base._meta.local_many_to_many             if not base._meta.abstract:                 # Check for clashes between locally declared fields and those                 # on the base classes.                 for field in parent_fields:                     if field.name in field_names:                         raise FieldError(                             \"Local field %r in class %r clashes with field of \"                             \"the same name from base class %r.\"                             % (                                 field.name,                                 name,                                 base.__name__,                             )                         )                     else:                         inherited_attributes.add(field.name)                  # Concrete classes...                 base = base._meta.concrete_model                 base_key = make_model_tuple(base)                 if base_key in parent_links:                     field = parent_links[base_key]                 elif not is_proxy:                     attr_name = \"%s_ptr\" % base._meta.model_name                     field = OneToOneField(                         base,                         on_delete=CASCADE,                         name=attr_name,                         auto_created=True,                         parent_link=True,                     )                      if attr_name in field_names:                         raise FieldError(                             \"Auto-generated field '%s' in class %r for \"                             \"parent_link to base class %r clashes with \"                             \"declared field of the same name.\"                             % (                                 attr_name,                                 name,                                 base.__name__,                             )                         )                      # Only add the ptr field if it's not already present;                     # e.g. migrations will already have it specified                     if not hasattr(new_class, attr_name):                         new_class.add_to_class(attr_name, field)                 else:                     field = None                 new_class._meta.parents[base] = field             else:                 base_parents = base._meta.parents.copy()                  # Add fields from abstract base class if it wasn't overridden.                 for field in parent_fields:                     if (                         field.name not in field_names                         and field.name not in new_class.__dict__                         and field.name not in inherited_attributes                     ):                         new_field = copy.deepcopy(field)                         new_class.add_to_class(field.name, new_field)                         # Replace parent links defined on this base by the new                         # field. It will be appropriately resolved if required.                         if field.one_to_one:                             for parent, parent_link in base_parents.items():                                 if field == parent_link:                                     base_parents[parent] = new_field                  # Pass any non-abstract parent classes onto child.                 new_class._meta.parents.update(base_parents)              # Inherit private fields (like GenericForeignKey) from the parent             # class             for field in base._meta.private_fields:                 if field.name in field_names:                     if not base._meta.abstract:                         raise FieldError(                             \"Local field %r in class %r clashes with field of \"                             \"the same name from base class %r.\"                             % (                                 field.name,                                 name,                                 base.__name__,                             )                         )                 else:                     field = copy.deepcopy(field)                     if not base._meta.abstract:                         field.mti_inherited = True                     new_class.add_to_class(field.name, field)          # Copy indexes so that index names are unique when models extend an         # abstract model.         new_class._meta.indexes = [             copy.deepcopy(idx) for idx in new_class._meta.indexes         ]          if abstract:             # Abstract base models can't be instantiated and don't appear in             # the list of models for an app. We do the final setup for them a             # little differently from normal models.             attr_meta.abstract = False             new_class.Meta = attr_meta             return new_class          new_class._prepare()         new_class._meta.apps.register_model(new_class._meta.app_label, new_class)         return new_class <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u043f\u0430\u0442\u0447\u0438\u0442\u044c \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0432 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c! \u0410 \u043f\u043e\u0442\u043e\u043c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0435\u043b\u0438\u0437\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u044b \u0434\u0436\u0430\u043d\u0433\u043e \u0442\u0430\u043c \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u043c\u0435\u043d\u044f\u044e\u0442, \u0438 \u043c\u043e\u0439 \u043f\u0430\u0442\u0447 \u0441\u043b\u043e\u043c\u0430\u0435\u0442\u0441\u044f.<\/p>\n<p>\u041c\u043e\u0440\u0430\u043b\u044c? \u0427\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u043c\u0435\u0442\u043e\u0434, \u0442\u0435\u043c \u043b\u0435\u0433\u0447\u0435 \u0435\u0433\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c.<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041b\u0435\u0433\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c > \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b \u0432\u044b\u0448\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 &#8212; \u0442\u043e \u043b\u0438\u0431\u043e \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0438\u0445 class variables, \u043b\u0438\u0431\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u044f\u0432\u043d\u043e \u043a\u0430\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e. \u041d\u0438\u043a\u0430\u043a\u0438\u0445 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Magic_number_(programming)\">magic numbers<\/a> \u0432 \u0442\u0435\u043b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438!<\/p>\n<pre><code class=\"python\"># \u0431\u0440\u043e class Some:     CONST = 5  # \u0431\u0440\u043e def do(const: int = 5):     # ...  # \u043d\u0435 \u0431\u0440\u043e def do():     for i in range(5):         # ... <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041b\u0435\u0433\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c > Dependency injection<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0421\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e\u0441\u0442\u0438 \u0440\u0430\u0434\u0438 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044c dependency injection, \u043a\u0430\u043a \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u044e\u0449\u0438\u0439 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430, \u043d\u043e, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0437\u0430 \u043c\u0435\u043d\u044f <a href=\"https:\/\/python-dependency-injector.ets-labs.org\/introduction\/di_in_python.html\">\u043f\u0440\u043e \u044d\u0442\u043e \u0443\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0442\u0443\u0442<\/a>.<\/p>\n<\/div>\n<\/details>\n<h2>\u041b\u0435\u0433\u043a\u043e \u0434\u0435\u0431\u0430\u0436\u0438\u0442\u044c<\/h2>\n<p>\u041b\u0435\u0433\u043a\u043e \u0434\u0435\u0431\u0430\u0436\u0438\u0442\u044c &#8212; \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u0438\u043c\u0435\u0442\u044c \u043c\u0435\u0441\u0442\u043e \u0434\u043b\u044f \u0431\u0440\u0435\u0439\u043a\u043f\u043e\u0438\u043d\u0442\u0430, \u0438 \u0447\u0442\u043e\u0431 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442.<\/p>\n<details class=\"spoiler\">\n<summary>\u041b\u0435\u0433\u043a\u043e \u0434\u0435\u0431\u0430\u0436\u0438\u0442\u044c > except \u0438\u043b\u0438 except Exception<\/summary>\n<div class=\"spoiler__content\">\n<p>\u042f \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b \u043f\u0440\u043e \u043c\u043e\u0440\u044f\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043b\u043e\u0432\u044f\u0442 \u0432\u0441\u0451. \u0418 \u044d\u0442\u043e \u043f\u043b\u043e\u0445\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e, \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u044f \u0432\u0441\u0451 \u043f\u043e\u0434\u0440\u044f\u0434, \u0432\u044b \u043f\u044b\u0442\u0430\u0435\u0442\u0435\u0441\u044c \u043f\u043e\u0444\u0438\u043a\u0441\u0438\u0442\u044c \u0441\u0432\u043e\u0451 \u043d\u0435\u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 &#8212; \u0432\u044b \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435, \u043a\u0430\u043a\u0438\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u043b\u0435\u0442\u0435\u0442\u044c. \u0420\u0430\u0437\u0431\u0435\u0440\u0438\u0442\u0435\u0441\u044c \u0432 \u043a\u043e\u0434\u0435, \u0430 \u043d\u0435 \u043f\u044b\u0442\u0430\u0439\u0442\u0435\u0441\u044c \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u043f\u043b\u0430\u0442\u043a\u0443!<\/p>\n<pre><code>6% 171 B001 Do not use bare `except:`, it also catches unexpected events like memory errors, interrupts, system exit, and so on. 9% 274 PIE786 Use precise exception handlers.<\/code><\/pre>\n<pre><code class=\"python\">for node in G.nodes():     try:         labels[node]=names['keysets']['generated'][nodeStdict[node]+'-name']['ru']     except: labels[node]='error'  # ...\u0432\u0436\u0443\u0445!  for node in G.nodes(): try: labels[node]=names['keysets']['generated'][nodeStdict[node]+'-name']['ru'] except KeyError:     labels[node] = 'error' <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041b\u0435\u0433\u043a\u043e \u0434\u0435\u0431\u0430\u0436\u0438\u0442\u044c > mega-statements<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0427\u0435\u043c \u0434\u043b\u0438\u043d\u043d\u0435\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435, \u0442\u0435\u043c \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0435\u0433\u043e \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c.<br \/> \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0442 \u043c\u0435\u0441\u0442\u0430 \u0434\u043b\u044f \u0431\u0440\u0435\u0439\u043a\u043f\u043e\u0438\u043d\u0442\u0430, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043c\u0435\u0433\u0430-\u043e\u0431\u044a\u0435\u043a\u0442 \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0432 \u0446\u0438\u043a\u043b\u0435 \u0438\u0437 <code>itertools.product<\/code>, \u0438 \u0441\u0440\u0430\u0437\u0443 \u0441 \u043d\u0438\u043c \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f <code>assert<\/code>. \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0436\u0430\u0441\u043d\u043e!<\/p>\n<pre><code class=\"python\">assert replication_status_json in [ { \"replication-one\": [ { \"count\": 1, \"destination_replication_status\": None, \"hash_differs\": None, \"metadata_differs\": None, \"source_has_file_retention\": None, \"source_has_hide_marker\": None, \"source_has_large_metadata\": None, \"source_has_legal_hold\": None, \"source_has_sse_c_enabled\": None, \"source_replication_status\": None, } ], \"replication-two\": [ { \"count\": 1, \"destination_replication_status\": None, \"hash_differs\": None, \"metadata_differs\": None, \"source_has_file_retention\": False, \"source_has_hide_marker\": False, \"source_has_large_metadata\": False, \"source_has_legal_hold\": True, \"source_has_sse_c_enabled\": False, \"source_replication_status\": first, }, { \"count\": 1, \"destination_replication_status\": None, \"hash_differs\": None, \"metadata_differs\": None, \"source_has_file_retention\": False, \"source_has_hide_marker\": False, \"source_has_large_metadata\": False, \"source_has_legal_hold\": False, \"source_has_sse_c_enabled\": False, \"source_replication_status\": second, }, { \"count\": 1, \"destination_replication_status\": None, \"hash_differs\": None, \"metadata_differs\": None, \"source_has_file_retention\": False, \"source_has_hide_marker\": False, \"source_has_large_metadata\": False, \"source_has_legal_hold\": False, \"source_has_sse_c_enabled\": True, \"source_replication_status\": None, }, { \"count\": 1, \"destination_replication_status\": None, \"hash_differs\": None, \"metadata_differs\": None, \"source_has_file_retention\": False, \"source_has_hide_marker\": False, \"source_has_large_metadata\": False, \"source_has_legal_hold\": True, \"source_has_sse_c_enabled\": True, \"source_replication_status\": None, } ] } for first, second in itertools.product(['FAILED', 'PENDING'], ['FAILED', 'PENDING']) ] <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u041b\u0435\u0433\u043a\u043e \u0434\u0435\u0431\u0430\u0436\u0438\u0442\u044c > \u0434\u0443\u043c\u0430\u0442\u044c \u0432\u043f\u0435\u0440\u0451\u0434<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0418\u043d\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0442\u043e\u043c \u043d\u0435 \u0434\u0435\u0431\u0430\u0436\u0438\u0442\u044c \ud83d\ude42<\/p>\n<h3>Copy-paste<\/h3>\n<p>\u0425\u043e\u0442\u0438\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u043f\u0435\u0447\u0430\u0442\u043a\u0443? \u042e\u0437\u0430\u0439\u0442\u0435 copy-paste! \u0417\u0430 \u043f\u0440\u0443\u0444\u0430\u043c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/pvs-studio\/blog\/112276\/\">\u043e\u0442\u0441\u044b\u043b\u0430\u044e \u0432\u0430\u0441 \u043a PVS Studio<\/a>, \u0430 \u043d\u0430 \u0425\u0430\u0431\u0440\u0435&#8230; \u043d\u0430 \u0425\u0430\u0431\u0440\u0435 \u043a\u043e\u043f\u0438-\u043f\u0430\u0441\u0442\u0443 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e.<\/p>\n<pre><code>44% 715 GRG001 Copy-paste of code<\/code><\/pre>\n<p>\u0418 \u0445\u043e\u0442\u044f \u0432 \u043c\u043e\u0451\u043c \u043f\u043b\u0430\u0433\u0438\u043d\u0435 \u043c\u043d\u043e\u0433\u043e false positives, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0435\u0441\u0442\u044c:<\/p>\n<pre><code class=\"python\">xn = fincoords[0][:,0] yn = fincoords[0][:,1] zn = fincoords[0][:,2] l=[labels[idi] for idi in myIDs] <\/code><\/pre>\n<p>\u0427\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u0442\u0440\u043e\u0447\u0435\u043a \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043e, \u0442\u0435\u043c \u043b\u0435\u0433\u0447\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u0438\u0442\u044c\u0441\u044f &#8212; \u0437\u0430\u0431\u044b\u0442\u044c \u043f\u043e\u043c\u0435\u043d\u044f\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0432 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0441\u0442\u0440\u043e\u0447\u0435\u043a. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 &#8212;  \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u043e\u0431\u0449\u0438\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0432 \u0446\u0438\u043a\u043b \/ \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e.<\/p>\n<h3>Response status<\/h3>\n<p>\u0412\u043e\u0442 \u0432\u0430\u043c \u0437\u0430\u0431\u0430\u0432\u043d\u044b\u0439 \u0444\u0430\u043a\u0442: \u0432 4% \u043f\u043e\u0441\u0442\u043e\u0432 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443 \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u043b\u0435\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043c \u0432\u0435\u0440\u043d\u0443\u043b \u0441\u0435\u0440\u0432\u0435\u0440. \u041d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u043e\u0433\u0438\u0431\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434 \u0438\u0437\u043c\u0435\u043d\u0447\u0438\u0432\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440, \u043f\u0443\u0441\u0442\u044c \u043b\u0443\u0447\u0448\u0435 \u043e\u043d \u043f\u0440\u043e\u0433\u043d\u0451\u0442\u0441\u044f \u043f\u043e\u0434 \u043d\u0430\u0441!<\/p>\n<pre><code>4% 111 GRG005 Not checking response status code<\/code><\/pre>\n<pre><code class=\"python\">def uncapcha(url): imager = requests.get(url) r = requests.post('http:\/\/rucaptcha.com\/in.php', data = {'method': 'base64', 'key': RUCAPTCHA_KEY, 'body': base64.b64encode(imager.content)}) if (r.text[:3] != 'OK|'): print('captcha failed') return -1 capid = r.text[3:] sleep(5)  <\/code><\/pre>\n<p><code>response.ok<\/code> \u0438\u043b\u0438 <code>response.raise_for_status()<\/code> \u0432 \u043f\u043e\u043c\u043e\u0449\u044c!<\/p>\n<h3>Print<\/h3>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 <code>print()<\/code> \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0438\u043c \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f. \u0412\u043e\u0442 \u0432\u0441\u0435 \u0438\u043c \u0438 \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f, \u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0434\u0440\u0443\u0433\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u0430 \u043a\u0430\u043a \u0435\u0433\u043e \u0437\u0430\u0442\u043a\u043d\u0443\u0442\u044c?<br \/> \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0441\u0440\u0430\u0437\u0443, \u043f\u0440\u044f\u043c \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c <code>logging<\/code> \u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0442\u044c \u0432\u044b\u0432\u043e\u0434 \u043d\u0430 <code>debug<\/code>, <code>info<\/code>, <code>warning<\/code> \u0438 <code>error<\/code>. \u0422\u043e\u0433\u0434\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0432\u0441\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0434\u0430\u0436\u0435 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u044b\u0435, \u0430 \u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043c\u0435\u043d\u0438\u0442\u0435 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043d\u0430 <code>info<\/code> \u0438\u043b\u0438 <code>warning<\/code>, \u0438 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0441\u043e\u0440\u044f\u0442\u044c \u0432\u0430\u043c \u0432\u044b\u0432\u043e\u0434.<\/p>\n<pre><code>44% 1246 T201 print found.<\/code><\/pre>\n<pre><code class=\"python\">async def fun2(x):     print(x**0.5)     await asyncio.sleep(3)     print('fun2 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430')  # ...\u0432\u0436\u0443\u0445!  import logging  log = logging.getLogger(__name__)  async def fun2(x):     print(x**0.5)     await asyncio.sleep(3)     log.debug('fun2 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430')  if __name__ == '__main__':     logging.basicConfig(level=logging.DEBUG) <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>\u041b\u0435\u0433\u043a\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/h2>\n<details class=\"spoiler\">\n<summary>\u041b\u0435\u0433\u043a\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043b\u0451\u0433\u043a\u0438\u043c \u0438 \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u043c? \u0410 \u0432\u043e\u0442 \u043a\u0430\u043a: \u043f\u0438\u0448\u0438\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435<\/p>\n<ul>\n<li>\n<p>\u043d\u0438 \u043e\u0442 \u0447\u0435\u0433\u043e \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0442, \u043a\u0440\u043e\u043c\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0434\u0435\u043b\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0443 \u0432\u0435\u0449\u044c<\/p>\n<\/li>\n<li>\n<p>\u0431\u0435\u0437 side effects, \u0430 \u0435\u0441\u043b\u0438 \u0438 \u0441 \u043d\u0438\u043c\u0438, \u0442\u043e \u044d\u0442\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0438\u0445 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<\/p>\n<\/li>\n<\/ul>\n<p>\u042f \u0441\u043e\u0431\u0440\u0430\u043b \u0434\u0436\u0435\u043a\u043f\u043e\u0442 \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430:<\/p>\n<pre><code class=\"python\">items = [1, 2]  def append_double(el: int) -> int: # \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0438\u043c\u0435\u0435\u0442 side effect: \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442 items double = el * 2     items.append(double)  # \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 items     return double  # \u043f\u043e\u043c\u0438\u043c\u043e side effect, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0435\u0449\u0451 \u0447\u0442\u043e-\u0442\u043e \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435\u0442 \u0430\u0432\u0442\u043e-\u0434\u0435\u0442\u0435\u043a\u0442\u043e\u0440\u043e\u0432, \u043d\u043e \u0432\u043e\u0442 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 <code>global<\/code>:<\/p>\n<pre><code>3% 98 W002 Global variable next used<\/code><\/pre>\n<p>\u041d\u0435 \u0434\u0435\u043b\u0430\u0439\u0442\u0435 \u0442\u0430\u043a!<\/p>\n<pre><code class=\"python\">def format_time(x, pos=None):     global duration, nframes, k     progress = int(x \/ float(nframes) * duration * k) # ...<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<hr\/>\n<h2>\u0412\u0440\u0435\u043c\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438<\/h2>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u043d\u0430\u0448\u0435 \u0437\u043d\u0430\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u043e\u043d\u044f\u0442\u044c.<\/p>\n<h3>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u043e \u043f\u043e\u0441\u0442\u0430\u043c<\/h3>\n<p>\u0420\u0435\u0439\u0442\u0438\u043d\u0433 \u043e\u0442 \u043e\u0431\u0449\u0435\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043e\u0448\u0438\u0431\u043e\u043a \u043d\u0430 \u043f\u043e\u0441\u0442:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/a3a\/a30\/299\/a3aa302991531f67e239ac083b2e0e17.jpg\" width=\"1920\" height=\"1001\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a3a\/a30\/299\/a3aa302991531f67e239ac083b2e0e17.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u043e\u0445\u043e\u0436\u0435, \u0447\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u0433\u0440\u044f\u0437\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435, \u0442\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435 \u0443 \u0432\u0430\u0441 \u0448\u0430\u043d\u0441\u043e\u0432 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u044b\u0441\u043e\u043a\u0438\u0439 \u0440\u0435\u0439\u0442\u0438\u043d\u0433. \u041d\u043e \u044d\u0442\u043e \u043d\u0435\u0442\u043e\u0447\u043d\u043e.<\/p>\n<h3>\u0421\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u043f\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u043f\u0438\u0442\u043e\u043d-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c<\/h3>\n<p>\u0421\u0442\u0430\u0432\u0438\u043b \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0430 1.09.2022.<\/p>\n<details class=\"spoiler\">\n<summary>django<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0423 \u043c\u0435\u043d\u044f \u0441 django <a href=\"https:\/\/habr.com\/ru\/post\/594601\/\">\u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043d\u0435\u0436\u043d\u044b\u0435 \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f<\/a>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043d\u0435 \u0431\u044b\u043b\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e: \u0442\u0430\u043a \u043b\u0438 \u0442\u0430\u043c \u0432\u0441\u0451 \u043f\u043b\u043e\u0445\u043e, \u043a\u0430\u043a \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f?<br \/>\u0425\u0435\u0445, \u043f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e \u0434\u0430!<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/26d\/461\/509\/26d461509cd24f7482e30f0df461e060.jpg\" width=\"1362\" height=\"683\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/26d\/461\/509\/26d461509cd24f7482e30f0df461e060.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u0434\u0436\u0430\u043d\u0433\u043e \u043a\u043b\u0430\u0434\u0451\u0442 \u043e\u0433\u0440\u043e\u043c\u0435\u043d\u043d\u044b\u0439 \u0431\u043e\u043b\u0442 \u043d\u0430 type annotations. \u0423 \u043d\u0438\u0445 \u0442\u0430\u043a \u043f\u0440\u0438\u043d\u044f\u0442\u043e<\/p>\n<pre><code>python show-me-sample.py --results results\/libs-results-django.json --order random --context 8 ANN <\/code><\/pre>\n<pre><code class=\"python\">-------------------- samples\/libs\/django\/contrib\/postgres\/validators.py ----  -------------------- ANN Missing type annotation for function argument 'a'  class RangeMinValueValidator(MinValueValidator):     def compare(self, a, b):  # &lt;--------------------------------!!!         return a.lower is None or a.lower &lt; b <\/code><\/pre>\n<pre><code class=\"python\">-------------------- samples\/libs\/django\/contrib\/admin\/utils.py ----  -------------------- ANN Missing type annotation for function argument 'obj'  def model_format_dict(obj):  # &lt;--------------------------------!!!     \"\"\"     Return a `dict` with keys 'verbose_name' and 'verbose_name_plural',     typically for use with string formatting.      `obj` may be a `Model` instance, `Model` subclass, or `QuerySet` instance.  <\/code><\/pre>\n<p>\u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0434\u0436\u0430\u043d\u0433\u043e \u043b\u044e\u0431\u0438\u0442 \u043f\u043e\u0432\u044b\u043d\u043e\u0441\u0438\u0442\u044c \u043c\u043e\u0437\u0433:<\/p>\n<pre><code class=\"python\">-------------------- samples\/libs\/django\/utils\/translation\/__init__.py ----  -------------------- CCR001 Cognitive complexity is too high (17 > 7)   def lazy_number(func, resultclass, number=None, **kwargs):  # &lt;--------------------------------!!!     if isinstance(number, int):         kwargs[\"number\"] = number         proxy = lazy(func, resultclass)(**kwargs)     else:         original_kwargs = kwargs.copy()          class NumberAwareString(resultclass):             def __bool__(self):                 return bool(kwargs[\"singular\"])              def _get_number_value(self, values):                 try:                     return values[number]                 except KeyError:                     raise KeyError(                         \"Your dictionary lacks key '%s'. Please provide \"                         \"it, because it is required to determine whether \"     # ...  <\/code><\/pre>\n<pre><code class=\"python\">-------------------- samples\/libs\/django\/db\/models\/base.py ----  -------------------- CCR001 Cognitive complexity is too high (67 > 7)  class Model(metaclass=ModelBase):     def __init__(self, *args, **kwargs):  # &lt;--------------------------------!!!         # Alias some things as locals to avoid repeat global lookups         cls = self.__class__         opts = self._meta         _setattr = setattr         _DEFERRED = DEFERRED         if opts.abstract:             raise TypeError(\"Abstract models cannot be instantiated.\")          pre_init.send(sender=cls, args=args, kwargs=kwargs)          # Set up the storage for instance state         self._state = ModelState()          # There is a rather weird disparity here; if kwargs, it's set, then args         # overrides it. It should be one or the other; don't duplicate the work         # The reason for the kwargs check is that standard iterator passes in by         # args, and instantiation for iteration is 33% faster.         if len(args) > len(opts.concrete_fields):             # Daft, but matches old exception sans the err msg.             raise IndexError(\"Number of args exceeds number of fields\")          if not kwargs:             fields_iter = iter(opts.concrete_fields)             # The ordering of the zip calls matter - zip throws StopIteration             # when an iter throws it. So if the first iter throws it, the second             # is *not* consumed. We rely on this, so don't change the order             # without changing the logic.             for val, field in zip(args, fields_iter):                 if val is _DEFERRED:                     continue                 _setattr(self, field.attname, val)         else:             # Slower, kwargs-ready version.     # ...  <\/code><\/pre>\n<p>\u0412\u0441\u044f\u043a\u0438\u0435 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 <code>if-else<\/code> &#8212; \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c \u0432 \u043d\u0430\u043b\u0438\u0447\u0438\u0438, \u043c\u043e\u0436\u0435\u0442\u0435 \u0431\u0440\u0430\u0442\u044c \u043e\u043f\u0442\u043e\u043c.<\/p>\n<pre><code class=\"python\">-------------------- samples\/libs\/django\/contrib\/auth\/views.py ----  -------------------- GRG002 Missing early quit  class LoginView(RedirectURLMixin, FormView):     # ...      def get_default_redirect_url(self):         \"\"\"Return the default redirect URL.\"\"\"         if self.next_page:  # &lt;--------------------------------!!!             return resolve_url(self.next_page)         else:             return resolve_url(settings.LOGIN_REDIRECT_URL)  <\/code><\/pre>\n<pre><code class=\"python\">GRG002 Missing early quit  def distinct_sql(self, fields, params):     \"\"\"     Return an SQL DISTINCT clause which removes duplicate rows from the     result set. If any fields are given, only check the given fields for     duplicates.     \"\"\"     if fields:  # &lt;--------------------------------!!!         raise NotSupportedError(             \"DISTINCT ON fields is not supported by this database backend\"         )     else:         return [\"DISTINCT\"], []  <\/code><\/pre>\n<pre><code class=\"python\">-------------------- samples\/libs\/django\/utils\/cache.py ----  -------------------- GRG002 Missing early quit  def learn_cache_key(request, response, cache_timeout=None, key_prefix=None, cache=None):     \"\"\"     Learn what headers to take into account for some request URL from the     response object. Store those headers in a global URL registry so that     later access to that URL will know what headers to take into account     without building the response object itself. The headers are named in the     Vary header of the response, but we want to prevent response generation.      The list of headers to use for cache key generation is stored in the same     cache as the pages themselves. If the cache ages some data out of the     cache, this just means that we have to build the response once to get at     the Vary header and so at the list of headers to use for the cache key.     \"\"\"     if key_prefix is None:         key_prefix = settings.CACHE_MIDDLEWARE_KEY_PREFIX     if cache_timeout is None:         cache_timeout = settings.CACHE_MIDDLEWARE_SECONDS     cache_key = _generate_cache_header_key(key_prefix, request)     if cache is None:         cache = caches[settings.CACHE_MIDDLEWARE_ALIAS]     if response.has_header(\"Vary\"):  # &lt;--------------------------------!!!         is_accept_language_redundant = settings.USE_I18N         # If i18n is used, the generated cache key will be suffixed with the         # current locale. Adding the raw value of Accept-Language is redundant         # in that case and would result in storing the same content under         # multiple keys in the cache. See #18191 for details.         headerlist = []         for header in cc_delim_re.split(response.headers[\"Vary\"]):             header = header.upper().replace(\"-\", \"_\")             if header != \"ACCEPT_LANGUAGE\" or not is_accept_language_redundant:                 headerlist.append(\"HTTP_\" + header)         headerlist.sort()         cache.set(cache_key, headerlist, cache_timeout)         return _generate_cache_key(request, request.method, headerlist, key_prefix)     else:         # if there is no Vary header, we still need a cache key         # for the request.build_absolute_uri()         cache.set(cache_key, [], cache_timeout)         return _generate_cache_key(request, request.method, [], key_prefix)  <\/code><\/pre>\n<p>\u041d\u0443 \u0438 \u043b\u044e\u0431\u0438\u043c\u0430\u044f \u043d\u0430\u043c\u0438 \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0430, \u043a\u0443\u0434\u0430 \u0436 \u0431\u0435\u0437 \u043d\u0435\u0451!<\/p>\n<pre><code class=\"python\">-------------------- samples\/libs\/django\/db\/backends\/postgresql\/client.py ----  -------------------- GRG001 Copy-paste of code   class DatabaseClient(BaseDatabaseClient):     executable_name = \"psql\"      @classmethod     def settings_to_cmd_args_env(cls, settings_dict, parameters):         args = [cls.executable_name]         options = settings_dict.get(\"OPTIONS\", {})  # &lt;--------------------------------!!!         host = settings_dict.get(\"HOST\")         port = settings_dict.get(\"PORT\")         dbname = settings_dict.get(\"NAME\")         user = settings_dict.get(\"USER\")         passwd = settings_dict.get(\"PASSWORD\")         passfile = options.get(\"passfile\")         service = options.get(\"service\")         sslmode = options.get(\"sslmode\")  <\/code><\/pre>\n<pre><code class=\"python\">-------------------- samples\/libs\/django\/contrib\/postgres\/apps.py ----  -------------------- GRG001 Copy-paste of code  if (     not enter     and setting == \"INSTALLED_APPS\"     and \"django.contrib.postgres\" not in set(value) ):     connection_created.disconnect(register_type_handlers)  # &lt;--------------------------------!!!     CharField._unregister_lookup(Unaccent)     TextField._unregister_lookup(Unaccent)     CharField._unregister_lookup(SearchLookup)     TextField._unregister_lookup(SearchLookup)     CharField._unregister_lookup(TrigramSimilar)     TextField._unregister_lookup(TrigramSimilar)     CharField._unregister_lookup(TrigramWordSimilar)     TextField._unregister_lookup(TrigramWordSimilar)     # Disconnect this receiver until the next time this app is installed  <\/code><\/pre>\n<pre><code class=\"python\">-------------------- samples\/libs\/django\/template\/smartif.py ----  -------------------- GRG001 Copy-paste of code      \"and\": infix(7, lambda context, x, y: x.eval(context) and y.eval(context)),     \"not\": prefix(8, lambda context, x: not x.eval(context)),     \"in\": infix(9, lambda context, x, y: x.eval(context) in y.eval(context)),     \"not in\": infix(9, lambda context, x, y: x.eval(context) not in y.eval(context)),     \"is\": infix(10, lambda context, x, y: x.eval(context) is y.eval(context)),     \"is not\": infix(10, lambda context, x, y: x.eval(context) is not y.eval(context)),     \"==\": infix(10, lambda context, x, y: x.eval(context) == y.eval(context)),     \"!=\": infix(10, lambda context, x, y: x.eval(context) != y.eval(context)),  # &lt;--------------------------------!!!     \">\": infix(10, lambda context, x, y: x.eval(context) > y.eval(context)),     \">=\": infix(10, lambda context, x, y: x.eval(context) >= y.eval(context)),     \"&lt;\": infix(10, lambda context, x, y: x.eval(context) &lt; y.eval(context)),     \"&lt;=\": infix(10, lambda context, x, y: x.eval(context) &lt;= y.eval(context)),  <\/code><\/pre>\n<pre><code class=\"python\">-------------------- samples\/libs\/django\/contrib\/gis\/geos\/io.py ----  -------------------- GRG001 Copy-paste of code  from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gis.geos.prototypes.io import (     WKBWriter,     WKTWriter,     _WKBReader,     _WKTReader,  # &lt;--------------------------------!!! ) <\/code><\/pre>\n<p>\u041c\u044b-\u0442\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0441 \u0432\u0430\u043c\u0438 \u0437\u043d\u0430\u0435\u043c \u043f\u0440\u043e <code>suppress()<\/code>, \u0430 \u0432\u043e\u0442 \u0434\u0436\u0430\u043d\u0433\u043e &#8212; \u043d\u0435\u0442 \ud83d\ude09<\/p>\n<pre><code class=\"python\">-------------------- samples\/libs\/django\/views\/debug.py ----  -------------------- SIM105 Use 'contextlib.suppress(OSError)'          try:             source = loader.get_source(module_name)         except ImportError:             pass         if source is not None:             source = source.splitlines()     if source is None:         try:  # &lt;--------------------------------!!!             with open(filename, \"rb\") as fp:                 source = fp.read().splitlines()         except OSError:             pass     return source <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>fastapi<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0421\u0442\u0430\u0432\u043b\u044e \u0432\u0441\u0451 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0447\u0435\u043b, \u043d\u0430\u043f\u0438\u0441\u0430\u0432\u0448\u0438\u0439 <code>pydantic<\/code> \u0438 <code>fastapi<\/code>, \u0437\u043d\u0430\u0435\u0442 \u0434\u0435\u043b\u043e \u0438 \u043f\u0438\u0448\u0435\u0442 \u0441\u0440\u0430\u0437\u0443 \u0433\u043e\u0434\u043d\u043e\u0442\u0443!<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/f6b\/fd0\/6a5\/f6bfd06a5347458c33027254abfc6f7a.jpg\" width=\"1287\" height=\"311\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f6b\/fd0\/6a5\/f6bfd06a5347458c33027254abfc6f7a.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0430\u043a \u0438 \u0435\u0441\u0442\u044c! \u041a\u043e\u0434 \u043a\u043b\u0430\u0441\u0441\u043d\u044b\u0439, \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043e\u0448\u0438\u0431\u043a\u0438 &#8212; \u043d\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u0430 false positives, \u043b\u0438\u0448\u044c \u0438\u043d\u043e\u0433\u0434\u0430 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u044f\u043a\u043e\u0435:<\/p>\n<pre><code class=\"python\">-------------------- samples\/libs\/fastapi\/dependencies\/models.py ----  -------------------- CCR001 Cognitive complexity is too high (8 > 7)  class Dependant:     def __init__(  # &lt;--------------------------------!!!         self,         *,         path_params: Optional[List[ModelField]] = None,         query_params: Optional[List[ModelField]] = None,         header_params: Optional[List[ModelField]] = None,         cookie_params: Optional[List[ModelField]] = None,         body_params: Optional[List[ModelField]] = None,         dependencies: Optional[List[\"Dependant\"]] = None,         security_schemes: Optional[List[SecurityRequirement]] = None,         name: Optional[str] = None,         call: Optional[Callable[..., Any]] = None,         request_param_name: Optional[str] = None,         websocket_param_name: Optional[str] = None,         http_connection_param_name: Optional[str] = None,         response_param_name: Optional[str] = None,         background_tasks_param_name: Optional[str] = None,         security_scopes_param_name: Optional[str] = None,         security_scopes: Optional[List[str]] = None,         use_cache: bool = True,         path: Optional[str] = None,     ) -> None:         self.path_params = path_params or []         self.query_params = query_params or []         self.header_params = header_params or []         self.cookie_params = cookie_params or []         self.body_params = body_params or []         self.dependencies = dependencies or []         self.security_requirements = security_schemes or []         self.request_param_name = request_param_name         self.websocket_param_name = websocket_param_name         self.http_connection_param_name = http_connection_param_name         self.response_param_name = response_param_name         self.background_tasks_param_name = background_tasks_param_name  <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>mypy<\/summary>\n<div class=\"spoiler__content\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/200\/103\/8d1\/2001038d1a6b673b3e4ea676b97eaf08.jpg\" width=\"1363\" height=\"481\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/200\/103\/8d1\/2001038d1a6b673b3e4ea676b97eaf08.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p><code>mypy<\/code> \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043b\u044e\u0431\u0438\u0442 \u0432\u0437\u0440\u044b\u0432\u0430\u0442\u044c \u043c\u043e\u0437\u0433. \u041f\u0440\u043e\u0441\u0442\u0438\u0442\u0435 \u0437\u0430 \u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"python\">-------------------- samples\/libs\/mypy\/exprtotype.py ----  -------------------- CCR001 Cognitive complexity is too high (62 > 7)  def expr_to_unanalyzed_type(expr: Expression,                             options: Optional[Options] = None,                             allow_new_syntax: bool = False,                             _parent: Optional[Expression] = None) -> ProperType:     \"\"\"Translate an expression to the corresponding type.      The result is not semantically analyzed. It can be UnboundType or TypeList.     Raise TypeTranslationError if the expression cannot represent a type.      If allow_new_syntax is True, allow all type syntax independent of the target     Python version (used in stubs).     \"\"\"     # The `parent` parameter is used in recursive calls to provide context for     # understanding whether an CallableArgument is ok.     name: Optional[str] = None     if isinstance(expr, NameExpr):         name = expr.name         if name == 'True':             return RawExpressionType(True, 'builtins.bool', line=expr.line, column=expr.column)         elif name == 'False':             return RawExpressionType(False, 'builtins.bool', line=expr.line, column=expr.column)         else:             return UnboundType(name, line=expr.line, column=expr.column)     elif isinstance(expr, MemberExpr):         fullname = get_member_expr_fullname(expr)         if fullname:             return UnboundType(fullname, line=expr.line, column=expr.column)         else:             raise TypeTranslationError()     elif isinstance(expr, IndexExpr):         base = expr_to_unanalyzed_type(expr.base, options, allow_new_syntax, expr)         if isinstance(base, UnboundType):             if base.args:                 raise TypeTranslationError()             if isinstance(expr.index, TupleExpr):                 args = expr.index.items             else:                 args = [expr.index]              if isinstance(expr.base, RefExpr) and expr.base.fullname in ANNOTATED_TYPE_NAMES:                 # TODO: this is not the optimal solution as we are basically getting rid                 # of the Annotation definition and only returning the type information,                 # losing all the annotations.                  return expr_to_unanalyzed_type(args[0], options, allow_new_syntax, expr)             else:                 base.args = tuple(expr_to_unanalyzed_type(arg, options, allow_new_syntax, expr)                                   for arg in args)             if not base.args:                 base.empty_tuple_index = True             return base         else:             raise TypeTranslationError()     elif (isinstance(expr, OpExpr)           and expr.op == '|'           and ((options and options.python_version >= (3, 10)) or allow_new_syntax)):         return UnionType([expr_to_unanalyzed_type(expr.left, options, allow_new_syntax),                           expr_to_unanalyzed_type(expr.right, options, allow_new_syntax)])     elif isinstance(expr, CallExpr) and isinstance(_parent, ListExpr):         c = expr.callee         names = []         # Go through the dotted member expr chain to get the full arg         # constructor name to look up         while True:             if isinstance(c, NameExpr):                 names.append(c.name)                 break             elif isinstance(c, MemberExpr):                 names.append(c.name)                 c = c.expr             else:                 raise TypeTranslationError()         arg_const = '.'.join(reversed(names))          # Go through the constructor args to get its name and type.         name = None         default_type = AnyType(TypeOfAny.unannotated)         typ: Type = default_type         for i, arg in enumerate(expr.args):             if expr.arg_names[i] is not None:                 if expr.arg_names[i] == \"name\":                     if name is not None:                         # Two names                         raise TypeTranslationError()                     name = _extract_argument_name(arg)                     continue                 elif expr.arg_names[i] == \"type\":                     if typ is not default_type:                         # Two types                         raise TypeTranslationError()                     typ = expr_to_unanalyzed_type(arg, options, allow_new_syntax, expr)                     continue                 else:                     raise TypeTranslationError()             elif i == 0:                 typ = expr_to_unanalyzed_type(arg, options, allow_new_syntax, expr)             elif i == 1:                 name = _extract_argument_name(arg)             else:                 raise TypeTranslationError()         return CallableArgument(typ, name, arg_const, expr.line, expr.column)     elif isinstance(expr, ListExpr):         return TypeList([expr_to_unanalyzed_type(t, options, allow_new_syntax, expr)                          for t in expr.items],                         line=expr.line, column=expr.column)     elif isinstance(expr, StrExpr):         return parse_type_string(expr.value, 'builtins.str', expr.line, expr.column,                                  assume_str_is_unicode=expr.from_python_3)     elif isinstance(expr, BytesExpr):         return parse_type_string(expr.value, 'builtins.bytes', expr.line, expr.column,                                  assume_str_is_unicode=False)     elif isinstance(expr, UnicodeExpr):         return parse_type_string(expr.value, 'builtins.unicode', expr.line, expr.column,                                  assume_str_is_unicode=True)     elif isinstance(expr, UnaryExpr):         typ = expr_to_unanalyzed_type(expr.expr, options, allow_new_syntax)         if isinstance(typ, RawExpressionType):             if isinstance(typ.literal_value, int) and expr.op == '-':                 typ.literal_value *= -1                 return typ         raise TypeTranslationError()     elif isinstance(expr, IntExpr):         return RawExpressionType(expr.value, 'builtins.int', line=expr.line, column=expr.column)     elif isinstance(expr, FloatExpr):         # Floats are not valid parameters for RawExpressionType , so we just         # pass in 'None' for now. We'll report the appropriate error at a later stage.         return RawExpressionType(None, 'builtins.float', line=expr.line, column=expr.column)     elif isinstance(expr, ComplexExpr):         # Same thing as above with complex numbers.         return RawExpressionType(None, 'builtins.complex', line=expr.line, column=expr.column)     elif isinstance(expr, EllipsisExpr):         return EllipsisType(expr.line)     else:         raise TypeTranslationError()  <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>flake8<\/summary>\n<div class=\"spoiler__content\">\n<p><code>flake8<\/code> \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448. \u042f \u0445\u043e\u0442\u0435\u043b \u043f\u043e\u0433\u043b\u0443\u043c\u0438\u0442\u044c\u0441\u044f, \u0442\u0438\u043f\u0430 &#171;\u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u043b\u0438\u043d\u0442\u0435\u0440, \u0430 \u0441\u0430\u043c\u0438 \u043f\u0438\u0448\u0443\u0442 \u043a\u043e\u0435-\u043a\u0430\u043a&#187;, \u043d\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0440\u043e\u0432\u043d\u043e \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/1cc\/c20\/e0d\/1ccc20e0d80069e8a938aa624bb9f0b2.jpg\" width=\"1504\" height=\"423\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1cc\/c20\/e0d\/1ccc20e0d80069e8a938aa624bb9f0b2.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<pre><code class=\"python\">-------------------- samples\/libs\/flake8\/utils.py ----  -------------------- CCR001 Cognitive complexity is too high (23 > 7)  def parse_files_to_codes_mapping(  # noqa: C901  # &lt;--------------------------------!!!     value_: Union[Sequence[str], str] ) -> List[Tuple[str, List[str]]]:     \"\"\"Parse a files-to-codes mapping.      A files-to-codes mapping a sequence of values specified as     `filenames list:codes list ...`.  Each of the lists may be separated by     either comma or whitespace tokens.      :param value: String to be parsed and normalized.     \"\"\"     if not isinstance(value_, str):         value = \"\\n\".join(value_)     else:         value = value_      ret: List[Tuple[str, List[str]]] = []     if not value.strip():         return ret      class State:         seen_sep = True         seen_colon = False         filenames: List[str] = []         codes: List[str] = []      def _reset() -> None:         if State.codes:             for filename in State.filenames:                 ret.append((filename, State.codes))         State.seen_sep = True         State.seen_colon = False         State.filenames = []         State.codes = []  <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>requests<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041f\u043e\u0447\u0442\u0438 \u0445\u043e\u0440\u043e\u0448\u043e. \u041d\u0435 \u043b\u044e\u0431\u0438\u0442 type hints, \u0432 \u0440\u0435\u0434\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0432\u044b\u043d\u043e\u0441\u0438\u0442 \u043c\u043e\u0437\u0433.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/cbc\/075\/106\/cbc075106e5b71f0e503642d9087043d.jpg\" width=\"878\" height=\"207\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cbc\/075\/106\/cbc075106e5b71f0e503642d9087043d.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>scrapy<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041e, \u0443 \u043c\u0435\u043d\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u043d\u0438\u044f \u043d\u0430\u0441\u0447\u0451\u0442 <code>scrapy<\/code>. \u041c\u043d\u0435 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0438\u0445 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0441\u043a\u0440\u0435\u0439\u043f\u0438\u043d\u0433\u0443, \u0438 \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0442\u0430\u043c \u0443\u0436 \u0442\u043e\u0447\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u043d\u0435\u0447\u0438\u0441\u0442\u043e!<br \/>\u041f\u0440\u0430\u0432 \u043b\u0438 \u044f? \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0435\u0442! <code>scrapy<\/code>, \u043a\u0430\u043a \u0438 \u043c\u043d\u043e\u0433\u0438\u0435, \u043d\u0435 \u0443\u0432\u0430\u0436\u0430\u0435\u0442 type hints \u0438 \u0438\u043d\u043e\u0433\u0434\u0430 \u043c\u0443\u0434\u0440\u0438\u0442, \u043d\u043e \u0432 \u0446\u0435\u043b\u043e\u043c \u0442\u0435\u0440\u043f\u0438\u043c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/125\/988\/61a\/12598861ab4823bbc4f54b88c05df211.jpg\" width=\"832\" height=\"205\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/125\/988\/61a\/12598861ab4823bbc4f54b88c05df211.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>pytest<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041b\u044e\u0431\u043b\u044e <code>pytest<\/code>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/f1e\/980\/a24\/f1e980a24fa722189bf936faef568c88.jpg\" width=\"1304\" height=\"369\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f1e\/980\/a24\/f1e980a24fa722189bf936faef568c88.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041d\u043e \u043e\u043d \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u0440\u044b\u0431\u0430\u0447\u0438\u0442:<\/p>\n<pre><code class=\"python\">PIE786 Use precise exception handlers.  def _should_repr_global_name(obj: object) -> bool:     if callable(obj):         return False      try:         return not hasattr(obj, \"__name__\")     except Exception:  # &lt;--------------------------------!!!         return True <\/code><\/pre>\n<p>\u0418 \u043b\u044e\u0431\u0438\u0442 \u043b\u0435\u0441\u0435\u043d\u043a\u0438:<\/p>\n<pre><code class=\"python\">-------------------- samples\/libs\/_pytest\/recwarn.py ----  -------------------- CCR001 Cognitive complexity is too high (25 > 7)  @final class WarningsChecker(WarningsRecorder):     # ...     def __exit__(  # &lt;--------------------------------!!!         self,         exc_type: Optional[Type[BaseException]],         exc_val: Optional[BaseException],         exc_tb: Optional[TracebackType],     ) -> None:         super().__exit__(exc_type, exc_val, exc_tb)          __tracebackhide__ = True          # only check if we're not currently handling an exception         if exc_type is None and exc_val is None and exc_tb is None:             if self.expected_warning is not None:                 if not any(issubclass(r.category, self.expected_warning) for r in self):                     __tracebackhide__ = True                     fail(                         \"DID NOT WARN. No warnings of type {} were emitted. \"                         \"The list of emitted warnings is: {}.\".format(                             self.expected_warning, [each.message for each in self]                         )                     )                 elif self.match_expr is not None:                     for r in self:                         if issubclass(r.category, self.expected_warning):                             if re.compile(self.match_expr).search(str(r.message)):                                 break                     else:                         fail(                             \"DID NOT WARN. No warnings of type {} matching\"                             \" ('{}') were emitted. The list of emitted warnings\"                             \" is: {}.\".format(                                 self.expected_warning,                                 self.match_expr,                                 [each.message for each in self],         # ... <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>sentry-sdk<\/summary>\n<div class=\"spoiler__content\">\n<p>\u0412\u044b \u0443\u0436\u0435 \u0432\u0438\u0434\u0438\u0442\u0435 \u0442\u0435\u043d\u0434\u0435\u043d\u0446\u0438\u044e? \u0412\u0435\u0437\u0434\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u043c\u0438 \u0442\u0438\u043f\u043e\u0432 \u0438 \u0438\u0437\u043b\u0438\u0448\u043d\u0435\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/c97\/ade\/4ea\/c97ade4eabcf7c3926dea702314d7af5.jpg\" width=\"940\" height=\"335\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c97\/ade\/4ea\/c97ade4eabcf7c3926dea702314d7af5.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>boto3<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041f\u043e \u043c\u043e\u0435\u043c\u0443 \u043e\u043f\u044b\u0442\u0443, \u0430\u043c\u0430\u0437\u043e\u043d \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e <em>\u043f\u0440\u043e\u0441\u0442\u043e<\/em>. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0445 \u0440\u0430\u0437\u043d\u0435\u0441\u0451\u043c!..<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/963\/30e\/16d\/96330e16ddda694ab3024189eec8f786.jpg\" width=\"739\" height=\"179\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/963\/30e\/16d\/96330e16ddda694ab3024189eec8f786.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0435 \u0430\u043d\u043d\u043e\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043f\u043e\u0447\u0442\u0438 \u043d\u0438\u0447\u0435\u0433\u043e, \u043d\u043e \u0432\u0441\u0451 \u0441\u0443\u043f\u0435\u0440-\u043f\u0440\u043e\u0441\u0442\u043e. \u0412\u044b\u043d\u0443\u0436\u0434\u0435\u043d \u043f\u0440\u0438\u0437\u043d\u0430\u0442\u044c, \u044d\u0442\u043e \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u043f\u043b\u043e\u0445\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442.<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>pandas<\/summary>\n<div class=\"spoiler__content\">\n<p>\u041d\u0443 \u0447\u0442\u043e, \u0434\u0430\u0442\u0430\u0441\u0430\u0435\u043d\u0442\u0438\u0441\u0442\u044b? \u0423 \u043c\u0435\u043d\u044f \u0434\u0430\u0436\u0435 flake \u043f\u0440\u0438\u043b\u0438\u0447\u043d\u043e \u0437\u0430\u0434\u0443\u043c\u0430\u043b\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043b <code>pandas<\/code>, \u0438 \u044f \u043f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0441\u044f \u043a \u0445\u0443\u0434\u0448\u0435\u043c\u0443.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/906\/b08\/1bc\/906b081bc8471e6be1108dbc325a65b5.jpg\" width=\"1053\" height=\"373\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/906\/b08\/1bc\/906b081bc8471e6be1108dbc325a65b5.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u042f \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043f\u043e\u043a\u0430 \u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0441\u044f <code>pandas<\/code>, \u0438 \u0432\u043e\u0442 \u0447\u0442\u043e \u044f \u0443\u0432\u0438\u0434\u0435\u043b:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/86a\/70c\/e88\/86a70ce882b5a81c993749e9b7fc418d.jpg\" width=\"1353\" height=\"480\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/86a\/70c\/e88\/86a70ce882b5a81c993749e9b7fc418d.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0410 \u043d\u0438\u0447\u0435\u0433\u043e! \u041a \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044e \u0442\u0438\u043f\u043e\u0432 \u043c\u044b \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438, \u0432\u044b\u043d\u043e\u0441\u043e\u043c \u043c\u043e\u0437\u0433\u0430 \u043d\u0430\u0441 \u043d\u0435 \u0443\u0434\u0438\u0432\u0438\u0448\u044c:<\/p>\n<pre><code class=\"python\">-------------------- samples\/libs\/pandas\/core\/window\/common.py ----  -------------------- CCR001 Cognitive complexity is too high (70 > 7)  def flex_binary_moment(arg1, arg2, f, pairwise=False):  # &lt;--------------------------------!!!      if isinstance(arg1, ABCSeries) and isinstance(arg2, ABCSeries):         X, Y = prep_binary(arg1, arg2)         return f(X, Y)      elif isinstance(arg1, ABCDataFrame):         from pandas import DataFrame          def dataframe_from_int_dict(data, frame_template):             result = DataFrame(data, index=frame_template.index)             if len(result.columns) > 0:                 result.columns = frame_template.columns[result.columns]             return result          results = {}         if isinstance(arg2, ABCDataFrame):             if pairwise is False:                 if arg1 is arg2:                     # special case in order to handle duplicate column names                     for i in range(len(arg1.columns)):                         results[i] = f(arg1.iloc[:, i], arg2.iloc[:, i])                     return dataframe_from_int_dict(results, arg1)                 else:                     if not arg1.columns.is_unique:                         raise ValueError(\"'arg1' columns are not unique\")                     if not arg2.columns.is_unique:                         raise ValueError(\"'arg2' columns are not unique\")                     X, Y = arg1.align(arg2, join=\"outer\")                     X, Y = prep_binary(X, Y)                     res_columns = arg1.columns.union(arg2.columns)                     for col in res_columns:                         if col in X and col in Y:                             results[col] = f(X[col], Y[col])                     return DataFrame(results, index=X.index, columns=res_columns)             elif pairwise is True:                 results = defaultdict(dict)                 for i in range(len(arg1.columns)):                     for j in range(len(arg2.columns)):                         if j &lt; i and arg2 is arg1:                             # Symmetric case                             results[i][j] = results[j][i]                         else:                             results[i][j] = f(                                 *prep_binary(arg1.iloc[:, i], arg2.iloc[:, j])                             )                  from pandas import concat                  result_index = arg1.index.union(arg2.index)                 if len(result_index):                      # construct result frame                     result = concat(                         [                             concat(                                 [results[i][j] for j in range(len(arg2.columns))],                                 ignore_index=True,                             )                             for i in range(len(arg1.columns))                         ],                         ignore_index=True,                         axis=1,                     )                     result.columns = arg1.columns  <\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<h2>\u041a\u043e\u043d\u0435\u0446<\/h2>\n<p>\u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438. \u042f \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b \u0432\u0441\u0435 2\u043a \u0441\u0442\u0430\u0442\u0435\u0439 \u0441 60\u043a \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u0432\u0441\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u041d\u043e \u044f \u0447\u0430\u0441\u0442\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u043b \u0436\u0438\u0432\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043e\u0448\u0438\u0431\u043e\u043a. \u0418 \u0432\u043e\u0442 \u0447\u0442\u043e \u044f \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043d\u044f\u043b.<\/p>\n<ul>\n<li>\n<p>type hints \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u043b\u044e\u0431\u0438\u0442<\/p>\n<\/li>\n<li>\n<p>\u0432\u0441\u0435 \u0441\u043a\u043b\u043e\u043d\u043d\u044b \u043f\u0435\u0440\u0435\u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c \u043a\u043e\u0434<\/p>\n<\/li>\n<\/ul>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c plot twist: \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043e\u0448\u0438\u0431\u043e\u043a \u044f \u0431\u0440\u0430\u043b \u0438\u0437 \u0441\u0442\u0430\u0442\u0435\u0439 \u0441 \u0441\u0430\u043c\u044b\u043c \u0432\u044b\u0441\u043e\u043a\u0438\u043c \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u043e\u043c. \u041a\u0430\u043a\u043e\u0439 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434? \u0415\u0433\u043e \u043e\u0437\u0432\u0443\u0447\u0438\u043b <a class=\"mention\" href=\"\/users\/economist75\">@economist75<\/a>:<\/p>\n<blockquote>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0430\u0441\u044c. \u041d\u0435 \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0447\u0442\u0438 \u0447\u0442\u043e \u0443\u0436\u0430\u0441\u0435\u043d, \u0430 \u0442\u0435\u043c\u043e\u0439 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u0432 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u0430\u0445.<\/p>\n<\/blockquote>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0432 \u043e\u0431\u0449\u0435\u043c-\u0442\u043e, \u043d\u0435 \u0432\u0430\u0436\u043d\u043e, <em>\u043a\u0430\u043a<\/em> \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435, \u0432\u0430\u0436\u043d\u043e, <em>\u0447\u0442\u043e<\/em> \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435. \u041d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0438\u0441\u0442\u044b\u0439, \u043b\u0435\u0433\u043a\u043e \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0439 \u043a\u043e\u0434 &#8212; \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0448\u0435\u043d\u043a\u0430 \u043d\u0430 \u0442\u043e\u0440\u0442\u0435.<\/p>\n<hr\/>\n<p>\u041c\u043e\u044f \u043f\u043e\u0432\u043e\u0437\u043a\u0430: <a href=\"https:\/\/t.me\/blog_pogromista\">\u0411\u043b\u043e\u0433 \u043f\u043e\u0433\u0440\u043e\u043c\u0438\u0441\u0442\u0430<\/a>.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/breakpoint\/blog\/686104\/\"> https:\/\/habr.com\/ru\/company\/breakpoint\/blog\/686104\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u044f \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u043b\u0441\u044f \u0432 <s>\u043f\u0435\u0434\u0430\u043d\u0442\u0430<\/s> \u0431\u0440\u044e\u0437\u0433\u0443. \u0412 \u0444\u0438\u043b\u044c\u043c\u0430\u0445 \u043c\u0430\u043b\u0435\u0439\u0448\u0438\u0435 \u043d\u0435\u0441\u0442\u044b\u043a\u043e\u0432\u043a\u0438 \u0438 \u043f\u0440\u043e\u0432\u0430\u043b\u044b \u0432 \u043b\u043e\u0433\u0438\u043a\u0435 \u043f\u043e\u0440\u0442\u044f\u0442 \u043c\u043d\u0435 \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440. \u0412 \u0447\u0430\u0442\u0430\u0445 \u043c\u0435\u043d\u044f \u0431\u0435\u0441\u0438\u0442 <code>it's<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>its<\/code>. \u0410 \u0432 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u043f\u0440\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435&#8230; \u0412\u0441\u0451 \u043f\u043b\u043e\u0445\u043e. \u0417\u0430 \u043c\u0435\u043d\u044f \u0432\u0441\u0451 \u0443\u0436\u0435 \u0441\u043a\u0430\u0437\u0430\u043b <a class=\"mention\" href=\"\/users\/AlexanderAstafiev\">@AlexanderAstafiev<\/a>, \u044f \u043b\u0438\u0448\u044c \u043f\u0440\u043e\u0446\u0438\u0442\u0438\u0440\u0443\u044e:<\/p>\n<blockquote>\n<p>\u041f\u0440\u043e\u0441\u0442\u0438\u0442\u0435, \u044f \u043d\u0435 \u043c\u043e\u0433\u0443 \u0442\u0430\u043a \u0431\u043e\u043b\u044c\u0448\u0435. \u042f \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0445\u043e\u0440\u043e\u0448\u043e \u0437\u043d\u0430\u044e Python, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u043b\u0447\u0430\u0442\u044c \u043f\u0440\u0438 \u0432\u0438\u0434\u0435 \u0442\u0430\u043a\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<br \/>\u042f \u0443\u0441\u0442\u0430\u043b. \u042f \u043d\u0435 \u043c\u043e\u0433\u0443 \u044d\u0442\u043e \u0447\u0438\u0442\u0430\u0442\u044c. \u041f\u0440\u043e\u0441\u0442\u0438\u0442\u0435 \u0437\u0430 \u0442\u043e\u043a\u0441\u0438\u0447\u043d\u0443\u044e \u043a\u0440\u0438\u0442\u0438\u043a\u0443, \u043d\u0430\u043a\u0438\u043f\u0435\u043b\u043e.<\/p>\n<\/blockquote>\n<p>\u0421\u0430\u043c\u043e\u0435 \u0437\u0430\u0431\u0430\u0432\u043d\u043e\u0435, \u0447\u0442\u043e, \u043f\u043e \u043c\u043e\u0438\u043c \u043e\u0449\u0443\u0449\u0435\u043d\u0438\u044f\u043c, \u0432\u0435\u0437\u0434\u0435 \u044f \u0432\u0438\u0436\u0443 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u042f \u0434\u0430\u0436\u0435 \u0437\u0430\u043f\u0438\u043b\u0438\u043b \u0441\u0435\u0440\u0432\u0438\u0441, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043a\u0438\u043d\u0443\u0442\u044c \u043a\u043e\u0434 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u043e\u0434 \u0440\u0435\u0432\u044c\u044e, \u0438, \u0441\u043e\u0431\u0440\u0430\u0432 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438, \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e <a href=\"https:\/\/breakpoint.black\/review\/cases\/\">50 \u0442\u0438\u043f\u043e\u0432 \u043e\u0448\u0438\u0431\u043e\u043a<\/a> \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0440\u044b\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432 \u0447\u0443\u0436\u043e\u043c \u043a\u043e\u0434\u0435. \u041d\u043e \u0432\u044b\u0431\u043e\u0440\u043a\u0430 \u0443 \u043c\u0435\u043d\u044f \u0431\u044b\u043b\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f, \u0438 \u044f \u043f\u043e\u0434\u0443\u043c\u0430\u043b: \u0430 \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c <em>\u043c\u043d\u043e\u0433\u043e<\/em> \u043a\u043e\u0434\u0430? \u0418 \u0432\u0441\u0451 \u0437\u0430\u0432\u0435\u0440\u0442\u0435&#8230;<\/p>\n<h2>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u043f\u0440\u043e \u0433\u0440\u0443\u0433\u043e\u0432<\/h2>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0413\u0434\u0435-\u0442\u043e \u0442\u0443\u0442 \u043f\u0440\u043e\u0441\u043a\u0430\u043a\u0438\u0432\u0430\u043b\u0430 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e \u0433\u0440\u0443\u0433\u043e\u0432: <a href=\"https:\/\/habr.com\/ru\/post\/673640\/\">\u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c<\/a>, <a href=\"https:\/\/grugbrain.dev\/\">\u043d\u0430 \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u043e\u043c<\/a>.<\/p>\n<blockquote>\n<p>\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441 \u043c\u043e\u0437\u0433\u043e\u043c \u0433\u0440\u0443\u0433\u0430 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u043c\u043d\u044b\u0439, \u043d\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441 \u043c\u043e\u0437\u0433\u043e\u043c \u0433\u0440\u0443\u0433\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u0435\u0442 \u043c\u043d\u043e\u0433\u043e \u043b\u0435\u0442 \u0438 \u043d\u0430\u0443\u0447\u0438\u043b\u0441\u044f \u043a\u043e\u0435 \u0447\u0435\u043c\u0443, \u0445\u043e\u0442\u044c \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0447\u0430\u0441\u0442\u043e \u0437\u0430\u043f\u0443\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f<\/p>\n<\/blockquote>\n<p>\u042f \u043a\u0430\u043a \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b \u0435\u0451, \u0442\u0430\u043a \u0441\u0440\u0430\u0437\u0443 \u0438 \u043f\u043e\u043d\u044f\u043b: \u044d\u0442\u043e \u044f. \u041d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u043c\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442, \u043d\u043e \u0437\u0430 \u043f\u043b\u0435\u0447\u0430\u043c\u0438 \u0433\u043e\u0440\u044b \u043e\u043f\u044b\u0442\u0430, \u0438 \u044d\u0442\u043e \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u043c\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043a\u043e\u0434\u0430: \u043d\u0435 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0439. \u041d\u0430 \u0440\u0430\u0431\u043e\u0442\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0447\u0435\u043b &#8212; \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0433\u043e\u043b\u043e\u0432\u0430, \u043e\u043d \u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0435\u0441\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u0441\u0432\u043e\u0435\u0439 &#171;\u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438&#187; \u0438 \u043f\u0438\u0448\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u043e\u0442\u043d\u0430 \u043a\u043e\u0434\u0430 \u0441 \u043a\u0443\u0447\u0435\u0439 \u0432\u0435\u0442\u0432\u043b\u0435\u043d\u0438\u0439, \u0438 \u0433\u0434\u0435-\u0442\u043e \u0432 \u043a\u043e\u043d\u0446\u0435 \u043e\u043d \u0435\u0449\u0451 \u043f\u043e\u043c\u043d\u0438\u0442, \u0447\u0442\u043e \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0431\u044b\u043b if \u0438 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c else. \u042f \u0442\u0430\u043a \u043d\u0435 \u043c\u043e\u0433\u0443, \u044f \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u044b\u0433\u0430\u044e jump-to-definition, \u043d\u0430 \u0447\u0435\u0442\u0432\u0451\u0440\u0442\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0443\u0436\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u044e, \u043e\u0442\u043a\u0443\u0434\u0430 \u044f \u043f\u0440\u0438\u0448\u0451\u043b \u0438 \u0447\u0442\u043e \u044f \u0434\u0435\u043b\u0430\u043b. \u042f \u043a\u0430\u043a \u0431\u0435\u043b\u044c\u0447\u043e\u043d\u043e\u043a \u0441 \u0445\u043e\u0440\u043e\u0448\u0435\u043d\u044c\u043a\u0438\u043c \u0445\u0432\u043e\u0441\u0442\u0438\u043a\u043e\u043c, \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435, \u043e \u0447\u0451\u043c \u044f.<\/p>\n<blockquote>\n<p>\u0427\u0442\u043e \u0436\u0435 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0431\u0435\u043b\u044c\u0447\u043e\u043d\u043a\u0430, \u0442\u043e \u043e\u043d \u0441\u0438\u0434\u0435\u043b \u0432 \u043b\u0435\u0441\u043d\u043e\u0439 \u0447\u0430\u0449\u0435 \u0438 \u0440\u0430\u0441\u0441\u0435\u044f\u043d\u043d\u043e \u043f\u043e\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u043b \u0442\u043e \u043d\u0430 \u043e\u0434\u043d\u043e \u0434\u0435\u0440\u0435\u0432\u043e, \u0442\u043e \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0435. \u041e\u043d \u043d\u0435 \u043c\u043e\u0433, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0431\u044b \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u043e\u0436\u0435\u0440\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438\u043c \u0445\u0432\u043e\u0441\u0442\u0438\u043a\u043e\u043c, \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0432 \u0434\u0443\u043f\u043b\u0435 \u043a\u0430\u043a\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u043e\u043d \u0436\u0438\u043b \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0440\u0430\u0434\u0438 \u0447\u0435\u0433\u043e \u043e\u043d \u043f\u0440\u0438\u0441\u043a\u0430\u043a\u0430\u043b \u0432 \u043b\u0435\u0441 \u0438 \u0447\u0442\u043e \u0442\u0430\u043c \u0438\u0441\u043a\u0430\u043b.<\/p>\n<\/blockquote>\n<p>\u042f \u043d\u0435 \u043c\u043e\u0433\u0443 \u043f\u0438\u0441\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0448\u0442\u0443\u043a\u0438, \u0430 \u0435\u0441\u043b\u0438 \u0438 \u043d\u0430\u043f\u0438\u0448\u0443, \u0442\u043e \u0442\u0430\u043c \u0436\u0435 \u0438 \u0443\u043c\u0440\u0443. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0444\u0438\u043b\u043e\u0441\u043e\u0444\u0438\u044f \u0433\u0440\u0443\u0433\u043e\u0432 \u043c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442:<\/p>\n<blockquote>\n<p>\u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043e\u0445\u043e\u0442\u043d\u0438\u043a \u043d\u0430 \u0433\u0440\u0443\u0433\u0430 \u044d\u0442\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c<br \/>\u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u043b\u043e\u0445\u043e<br \/>\u0441\u043a\u0430\u0436\u0443 \u0441\u043d\u043e\u0432\u0430:<br \/>\u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u00a0<em>\u043e\u0447\u0435\u043d\u044c<\/em>\u00a0\u043f\u043b\u043e\u0445\u043e<br \/>\u0442\u0435\u043f\u0435\u0440\u044c\u00a0<em>\u0442\u044b<\/em>\u00a0\u0441\u043a\u0430\u0436\u0438 \u0441\u0430\u043c:<br \/>\u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u00a0<em>\u043e\u0447\u0435\u043d\u044c<\/em>,\u00a0<em>\u043e\u0447\u0435\u043d\u044c<\/em>\u00a0\u043f\u043b\u043e\u0445\u043e<br \/>\u0435\u0441\u043b\u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438 \u0431\u0438\u0442\u044c\u0441\u044f \u0441 \u0434\u0438\u043d\u043e\u0437\u0430\u0432\u0440\u043e\u043c, \u0433\u0440\u0443\u0433 \u0432\u044b\u0431\u0435\u0440\u0438 \u0434\u0438\u043d\u043e\u0437\u0430\u0432\u0440: \u0433\u0440\u0443\u0433 \u0445\u043e\u0442\u044f \u0431\u044b \u0432\u0438\u0434\u0435\u0442\u044c \u0434\u0438\u043d\u043e\u0437\u0430\u0432\u0440\u0430<\/p>\n<\/blockquote>\n<p>\u0418 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0442\u0435\u043b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0442\u0435\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u0440\u043e\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0432 \u043f\u0438\u0442\u043e\u043d\u0435.<\/p>\n<blockquote>\n<p>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0441 \u043c\u043e\u0437\u0433\u043e\u043c \u0433\u0440\u0443\u0433\u0430 \u0445\u043e\u0447\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0437\u043d\u0430\u043d\u0438\u044f \u0432 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0443\u044e, \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443<\/p>\n<\/blockquote>\n<h2>\u0415\u0441\u043b\u0438 \u0432\u044b \u0443\u043c\u043d\u044b\u0439<\/h2>\n<p>&#8230; \u0442\u043e \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u044c\u0441\u044f \u0443\u043f\u0440\u043e\u0449\u0430\u0442\u044c. \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 \u0441\u0442\u0430\u0442\u044c\u044e \u0438\u043b\u0438 \u0432\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0435 \u0447\u0442\u043e-\u0442\u043e \u0432 \u043e\u043f\u0435\u043d\u0441\u043e\u0440\u0441, \u0432\u0430\u0448 \u043a\u043e\u0434 (\u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e) \u0447\u0438\u0442\u0430\u044e\u0442 \u0438\/\u0438\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0442. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0437\u0430\u0431\u043e\u0442\u0438\u0442\u044c\u0441\u044f \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u0445 \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430? \u041a\u0441\u0442\u0430\u0442\u0438, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u0432\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0442\u0430\u0442\u044c \u0432\u044b \u0441\u0430\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u0442.<\/p>\n<h2>\u0427\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 &#171;\u0443\u043f\u0440\u043e\u0449\u0430\u0442\u044c&#187; \u0438 &#171;\u0437\u0430\u0431\u043e\u0442\u0438\u0442\u044c\u0441\u044f \u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u0445&#187;?<\/h2>\n<p>\u042f \u043f\u043e\u043d\u0438\u043c\u0430\u044e \u044d\u0442\u043e \u043a\u0430\u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439<\/p>\n<ol>\n<li>\n<p>\u043b\u0435\u0433\u043a\u043e \u0447\u0438\u0442\u0430\u0442\u044c<\/p>\n<\/li>\n<li>\n<p>\u043b\u0435\u0433\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c<\/p>\n<\/li>\n<li>\n<p>\u043b\u0435\u0433\u043a\u043e \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c<\/p>\n<\/li>\n<li>\n<p>\u043b\u0435\u0433\u043a\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/p>\n<\/li>\n<\/ol>\n<p>\u041a\u0430\u043a \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434? \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u0438\u043d\u0442\u0435\u0440\u044b \u0438 \u043c\u043e\u0437\u0433, \u0447\u0442\u043e\u0431\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u0431\u0441\u0443\u0434\u0438\u043c \u0442\u0438\u043f\u0438\u0447\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0430\u043d\u0442\u0438\u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b.<\/p>\n<h2>\u0422\u044b \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0448\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438<\/h2>\n<p>\u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u0432 \u043d\u043e\u0433\u0443 \u043c\u043e\u0436\u043d\u043e \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u043e\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u044f\u0437\u044b\u043a\u0435. \u041d\u043e \u043c\u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043c\u043e\u0439 \u0445\u043e\u0443\u043c\u0438 aka <s>\u041d\u0438\u043a\u043e\u043b\u0430\u0439 \u0413\u0443\u043c\u0438\u043b\u0451\u0432<\/s> \u0412\u0438\u043b\u044c\u0444\u0440\u0435\u0434\u043e \u041f\u0430\u0440\u0435\u0442\u043e.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<h4>\u0417\u0430\u043a\u043e\u043d\u00a0\u041f\u0430\u0440\u0435\u0442\u043e<\/h4>\n<ul>\n<li>\n<p>\u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u043e\u043a\u043e\u043b\u043e 80% \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442 \u0438\u0437 20% \u043f\u0440\u0438\u0447\u0438\u043d.<\/p>\n<\/li>\n<li>\n<p>\u0410 \u0432\u0434\u0440\u0443\u0433 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u043e\u043f 20% \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u043d\u0430\u0434\u0435\u044f\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043f\u043e\u043a\u0440\u043e\u0435\u043c 80% \u0441\u043b\u0443\u0447\u0430\u0435\u0432?<\/p>\n<\/li>\n<\/ul>\n<h3>\u0410 \u043a\u0430\u043a \u0442\u044b \u0443\u0437\u043d\u0430\u0435\u0448\u044c \u0441\u0430\u043c\u044b\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438?<\/h3>\n<p>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<p>\u0412\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0432\u0441\u0451 \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043b\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043b\u043e\u0445\u043e\u0439 \u0434\u0438\u0437\u0430\u0439\u043d \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0438 \u043c\u043e\u0434\u0443\u043b\u0435\u0439. \u041a\u0430\u043a-\u0442\u043e \u044f \u0432\u0438\u0434\u0435\u043b \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435:<\/p>\n<pre><code class=\"python\">def swagger_support(func):     @wraps(func)     def wrapper(self, *args, **kwargs):         if args[0] == 1:             return getattr(super(type(self), self), func.__name__)(*args, **kwargs)         else:             return func(self, *args, **kwargs)     return wrapper <\/code><\/pre>\n<p>\u041d\u0435 \u0437\u043d\u0430\u044e, \u043a\u0430\u043a\u043e\u0439 \u0442\u0430\u043c \u0431\u044b\u043b \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u043d\u043e \u0435\u0441\u043b\u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u0430\u043a\u043e\u0433\u043e-\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043b\u0438\u0431\u043e \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434, \u043b\u0438\u0431\u043e \u043c\u0435\u0442\u043e\u0434 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430, \u0442\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0433\u0434\u0435-\u0442\u043e \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0432\u044b\u0448\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043b\u0438\u0431\u043e \u043e\u0431\u044a\u0435\u043a\u0442 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f, \u043b\u0438\u0431\u043e \u043e\u0431\u044a\u0435\u043a\u0442 \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0430 &#8212; \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u043a \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043e\u043d\u043e \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043c\u0435\u0442\u043e\u0434, \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u0430\u0441 \u043f\u0438\u0441\u0430\u0442\u044c <code>if<\/code>. \u041a\u0430\u043a \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435 \u043e\u0442\u043b\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c &#8212; \u044f \u043d\u0435 \u0437\u043d\u0430\u044e. \u042d\u0442\u043e \u0441\u0430\u043c\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u043e\u0448\u0438\u0431\u043e\u043a, \u043d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0438\u0445 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u0441\u043e\u0440\u044f\u043d.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u043a\u0430\u043a \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0441\u043a\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438? \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f \u043f\u043e\u0441\u0442\u0440\u043e\u044e \u0432\u0443\u043d\u0434\u0435\u0440\u0432\u0430\u0444\u043b\u044e, \u043f\u0440\u044f\u043c \u043a\u0430\u043a \u0430\u043d\u043d\u0438\u0433\u0438\u043b\u044f\u0442\u043e\u0440 \u0432 &#171;\u041f\u043e\u043b\u0438\u0446\u0435\u0439\u0441\u043a\u0438\u0439 \u0438\u0437 \u0411\u0435\u0432\u0435\u0440\u043b\u0438-\u0425\u0438\u043b\u043b\u0437 3&#187;.<\/p>\n<figure class=\"full-width\"><figcaption>CD-\u043f\u043b\u0435\u0435\u0440, \u0442\u0435\u043b\u0435\u0444\u043e\u043d, \u043a\u0430\u043c\u0435\u0440\u0430, \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440, \u0434\u0438\u043d\u0430\u043c\u0438\u043a, \u043c\u0438\u043a\u0440\u043e\u0432\u043e\u043b\u043d\u043e\u0432\u043a\u0430, \u043c\u0438\u043d\u0438\u0433\u0430\u043d \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435<\/figcaption><\/figure>\n<p>\u0415\u0441\u043b\u0438 \u044d\u0442\u0430 \u0448\u0442\u0443\u043a\u0430 \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u0432\u0430\u043c flake8 \u0441 \u043f\u043b\u0430\u0433\u0438\u043d\u0430\u043c\u0438, \u0442\u043e \u0432\u044b \u0443\u0433\u0430\u0434\u0430\u043b\u0438 &#8212; \u044d\u0442\u043e \u043e\u043d \u0438 \u0435\u0441\u0442\u044c.<\/p>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435 pylint | mypy | dlint | black | &#8230;? \u041c\u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u0431\u044b\u043b \u043b\u0438\u043d\u0442\u0435\u0440 (\u043d\u0435 \u0444\u043e\u0440\u043c\u0430\u0442\u0442\u0435\u0440), \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0435\u0441\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u043c\u043d\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432, \u0438 \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u044f \u043c\u043e\u0433 \u0431\u044b \u043b\u0435\u0433\u043a\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0438. Flake8 \u043c\u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u043c.<\/p>\n<p>\u0418\u0442\u0430\u043a, \u044f \u043f\u0440\u043e\u0448\u0451\u043b\u0441\u044f \u043f\u043e <a href=\"https:\/\/github.com\/DmytroLitvinov\/awesome-flake8-extensions\">awesome flake8<\/a>, \u043f\u043e\u0441\u043a\u0440\u0451\u0431 \u043f\u043e \u0437\u0430\u043a\u043e\u0443\u043b\u043a\u0430\u043c \u0433\u0438\u0442\u0445\u0430\u0431\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u0441\u0432\u043e\u0439 \u043c\u0438\u043d\u0438-\u043f\u043b\u0430\u0433\u0438\u043d \u0441 \u0442\u0435\u043c, \u0447\u0435\u0433\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u043b\u043e, \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0432\u043e\u0442 \u044d\u0442\u043e:<\/p>\n<pre><code>flake8==5.0.4 flake8-json==21.7.0  flake8-adjustable-complexity==0.0.6 flake8-annotations-coverage==0.0.6 flake8-annotations==2.9.1 flake8-builtins==1.5.3 flake8-cognitive-complexity==0.1.0 flake8-commas==2.1.0 flake8-comprehensions==3.10.0 flake8-eradicate==1.3.0 flake8-expression-complexity==0.0.11 flake8-functions==0.0.7 flake8-simplify==0.19.3 flake8-scream==0.1.0 git+https:\/\/github.com\/i02sopop\/flake8-global-variables pep8-naming==0.13.1 flake8-bugbear==22.7.1 flake8-pie==0.16.0 flake8-print==5.0.0 flake8-use-pathlib==0.3.0 git+https:\/\/github.com\/c0ntribut0r\/flake8-grug  pylint==2.14.5 flake8-pylint==0.1.3 <\/code><\/pre>\n<p>\u042f \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0442\u044c \u0442\u0435 \u043f\u043b\u0430\u0433\u0438\u043d\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0434\u0435\u043b\u0430\u044e\u0442 \u043a\u043e\u0434 \u0447\u0438\u0449\u0435, \u043d\u043e \u043d\u0435 \u0441\u0442\u0430\u043b \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0441\u043f\u043e\u0440\u043d\u044b\u0435 \u0448\u0442\u0443\u043a\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0441\u044f\u043a\u0438\u0435 \u0441\u043b\u0435\u0434\u0438\u043b\u043a\u0438 \u0437\u0430 \u0434\u043e\u043a\u0441\u0442\u0440\u0438\u043d\u0433\u0430\u043c\u0438) \u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0438 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0435 \u0432\u0435\u0449\u0438 (\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u0432\u0441\u044f\u043a\u0438\u0435 \u0442\u0430\u043c \u043e\u0442\u0441\u0442\u0443\u043f\u044b \u0438 \u043f\u0440\u043e\u0431\u0435\u043b\u044b). \u0414\u0430\u0436\u0435 \u0441\u0440\u0435\u0434\u0438 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044f \u0432\u044b\u0431\u0440\u0430\u043b, \u0431\u044b\u043b\u043e \u043c\u043d\u043e\u0433\u043e \u043c\u0443\u0441\u043e\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043e\u0442\u0431\u0438\u0440\u0430\u043b \u043e\u0448\u0438\u0431\u043a\u0438 \u043f\u043e\u0448\u0442\u0443\u0447\u043d\u043e, \u0435\u0441\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e &#8212; \u0432\u043e\u0442 \u043c\u043e\u0439 <code>.flake8<\/code>, \u043e\u043d \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u043e\u0447\u0438\u0442\u0430\u0435\u043c:<\/p>\n<details class=\"spoiler\">\n<summary>.flake8<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>[flake8] # statistics = True select =     # -------- https:\/\/github.com\/best-doctor\/flake8-adjustable-complexity --------     CAC001,     # func is too complex (complexity > max allowed complexity)     CAC002,     # func is too complex (complexity). Bad variable names penalty is too high (penalty)      # -------- https:\/\/github.com\/best-doctor\/flake8-annotations-coverage --------     TAE001,     # Too few type annotations in file      # -------- https:\/\/github.com\/sco1\/flake8-annotations --------     ANN001,     # Missing type annotation for function argument     ANN002,     # Missing type annotation for *args     ANN003,     # Missing type annotation for **kwargs     ; ANN101,     # Missing type annotation for self in method     ; ANN102,     # Missing type annotation for cls in classmethod     ANN201,     # Missing return type annotation for public function     ANN202,     # Missing return type annotation for protected function     ANN203,     # Missing return type annotation for secret function     ANN204,     # Missing return type annotation for special method     ANN205,     # Missing return type annotation for staticmethod     ANN206,     # Missing return type annotation for classmethod     ANN301,     # PEP 484 disallows both type annotations and type comments     ANN401,     # Dynamically typed expressions (typing.Any) are disallowed.2      # -------- https:\/\/github.com\/gforcada\/flake8-builtins --------     A001,     # variable \"max\" is shadowing a python builtin     A002,     # argument \"dict\" is shadowing a python builtin      # -------- https:\/\/github.com\/Melevir\/flake8-cognitive-complexity --------     CCR001,     # Cognitive complexity is too high (X > Y)      # -------- https:\/\/github.com\/PyCQA\/flake8-commas --------     # C812,  # too many FPs     # missing trailing comma     C813,     # missing trailing comma in Python 3     # C814,     # missing trailing comma in Python 2     C815,     # missing trailing comma in Python 3.5+     C816,     # missing trailing comma in Python 3.6+     C818,     # trailing comma on bare tuple prohibited     C819,     # trailing comma prohibited      # -------- https:\/\/github.com\/adamchainz\/flake8-comprehensions --------     C400,     C401,     C402,     # Unnecessary generator - rewrite as a &lt;list\/set\/dict> comprehension.     C403,     C404,     # Unnecessary list comprehension - rewrite as a &lt;set\/dict> comprehension.     C405,     C406,     #  Unnecessary &lt;list\/tuple> literal - rewrite as a &lt;set\/dict> literal.     # C408,     # Unnecessary &lt;dict\/list\/tuple> call - rewrite as a literal.     C409,     C410,     # Unnecessary &lt;list\/tuple> passed to &lt;list\/tuple>() - (remove the outer call to &lt;list\/tuple>``()\/rewrite as a ``&lt;list\/tuple> literal).     C411,     # Unnecessary list call - remove the outer call to list().     C413,     # Unnecessary &lt;list\/reversed> call around sorted().     C414,     # Unnecessary &lt;list\/reversed\/set\/sorted\/tuple> call within &lt;list\/set\/sorted\/tuple>().     C415,     # Unnecessary subscript reversal of iterable within &lt;reversed\/set\/sorted>().     C416,     # Unnecessary &lt;list\/set> comprehension - rewrite using &lt;list\/set>().     C417,     # Unnecessary map usage - rewrite using a generator expression\/&lt;list\/set\/dict> comprehension.      # -------- https:\/\/github.com\/wemake-services\/flake8-eradicate --------     # E800,     # Found commented out code      # -------- https:\/\/github.com\/best-doctor\/flake8-expression-complexity --------     ECE001,     # Expression is too complex (X > Y)      # -------- https:\/\/github.com\/best-doctor\/flake8-functions --------     CFQ001,     # function length (default max length is 100)     # CFQ002,     # function arguments number (default max arguments amount is 6)     CFQ003,     # function is not pure.     ; CFQ004,     # function returns number (default max returns amount is 3)      # -------- https:\/\/github.com\/MartinThoma\/flake8-simplify --------      # Python-specific rules:     SIM101,     # Multiple isinstance-calls which can be merged into a single call by using a<\/code><\/pre>\n<\/div>\n<\/details>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-337863","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/337863","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=337863"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/337863\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=337863"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=337863"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=337863"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}