{"id":317791,"date":"2021-02-10T15:00:40","date_gmt":"2021-02-10T15:00:40","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=317791"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=317791","title":{"rendered":"12 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e @dataclass"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<blockquote>\n<p><em>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 <\/em><a href=\"https:\/\/otus.pw\/cx1u\/\"><em>\u043a\u0443\u0440\u0441\u0430 \u00abPython Developer. Basic\u00bb<\/em><\/a><em> \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0438 \u0434\u043b\u044f \u0432\u0430\u0441 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u0432\u0441\u0435\u0445 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u043d\u0430 <\/em><a href=\"https:\/\/otus.pw\/w3sv\/\"><em>\u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0432\u0435\u0431\u0438\u043d\u0430\u0440 \u043f\u043e \u0442\u0435\u043c\u0435 \u00ab\u0422\u0440\u0438 \u043a\u0438\u0442\u0430: map(), filter() \u0438 zip()\u00bb<\/em><\/a><em>. \u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434, \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0439 \u0446\u0438\u043a\u043b\u043e\u0432, \u043d\u043e \u0431\u0435\u0437 \u0446\u0438\u043a\u043b\u043e\u0432? \u041c\u043e\u0436\u043d\u043e. \u041c\u043e\u0436\u0435\u0442 \u043b\u0438 \u043e\u043d \u0431\u044b\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c, \u0435\u0441\u043b\u0438 \u0431\u044b \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0446\u0438\u043a\u043b\u044b \u0432 Python? \u041c\u043e\u0436\u0435\u0442. \u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u0434\u0443\u043c\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0437\u043d\u0430\u043d\u0438\u0435 \u0441\u043b\u043e\u0432 &#171;callback&#187;, &#171;iterator&#187; \u0438 &#171;lambda&#187;. \u0411\u0443\u0434\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e, \u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e. \u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0439\u0442\u0435\u0441\u044c. <\/em><\/p>\n<\/blockquote>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/354\/be7\/0c2\/354be70c2cb7715e2a76c8845c1358cc\" width=\"780\" height=\"439\"><figcaption><\/figcaption><\/figure>\n<hr>\n<p>\u041c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u043a\u0435\u0442\u043e\u0432 scikit-learn, Keras \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0432 \u043f\u0430\u043a\u0435\u0442 Photonai. \u041d\u0430 12 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u043c\u044b \u043f\u043e\u043a\u0430\u0436\u0435\u043c, \u043a\u0430\u043a <code>@dataclass<\/code> \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442 \u043a\u043e\u0434 \u043d\u0430 Python. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043a\u043e\u0434 \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 Photonai \u0434\u043b\u044f Machine Learning.<\/p>\n<p><strong>\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u0435\u0441\u044c \u0434\u043e Python 3.7 \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0437\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438<\/strong><\/p>\n<p>\u0414\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440 <code>@dataclass<\/code> \u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432 Python 3.7. \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Python 3.7 \u0438\u0437 Docker-\u043e\u0431\u0440\u0430\u0437\u0430, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u0444\u0430\u0439\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>\/.bashrc_profile<\/code><em> <\/em>\u0438\u043b\u0438 <code>\/bashrc.txt<\/code>.<\/p>\n<pre><code class=\"python\">devdir='&lt;path-to-projects&gt;\/photon\/photonai\/dockerSeasons\/dev\/' testdir='&lt;path-to-projects&gt;\/photon\/photonai\/dockerSeasons\/test\/' echo $devdir echo $testdir export testdir export devdir # alias updev=\"(cd $devdir; docker-compose up) &amp;\" alias downdev=\"(cd $devdir; docker-compose down) &amp;\" alias builddev=\"(cd $devdir; docker-compose build) &amp;\" # alias uptest=\"(cd $testdir; docker-compose up) &amp; \" alias downtest=\"(cd $testdir; docker-compose down) &amp;\" alias buildtest=\"cd $testdir; docker-compose build) &amp;\"<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u0444\u0430\u0439\u043b <code>\/bashrc.txt<\/code> \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0435\u0433\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>touch\/bashrc.txt<\/code>. (\u0432 \u0441\u043b\u0443\u0447\u0430\u0435 MacOS \u0438\u043b\u0438 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0440\u0430\u0437\u043d\u043e\u0432\u0438\u0434\u043d\u043e\u0441\u0442\u0435\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c Linux \u0438\u043b\u0438 Unix.)<\/p>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/em> \u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430 <code>\u02dc\/.bashrc_profile<\/code><em> <\/em>\u0438\u043b\u0438 <code>\u02dc\/bashrc.txt<\/code>, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u0435 \u0438\u0445 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c.&nbsp;<\/p>\n<p><a href=\"https:\/\/medium.com\/@dr.bruce.cottman\/a-docker-solution-for-the-test-groups-use-cases-8e8ed6c28e11\">\u0417\u0434\u0435\u0441\u044c<\/a> \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Docker, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c.&nbsp;<\/p>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/em>: \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0434 Docker \u0432 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u0437 <a href=\"https:\/\/github.com\/bcottman\/dockerSeasons\">\u043a\u043b\u043e\u043d\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u043d\u0430 GitHub<\/a>.<\/p>\n<h4>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438 \u0442\u0438\u043f\u043e\u0432<\/h4>\n<p>Python \u2013 \u044f\u0437\u044b\u043a \u0441 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0435\u0439. \u0412 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 Python \u043e\u0442 3.5 \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438 \u0442\u0438\u043f\u043e\u0432 (<a href=\"https:\/\/www.python.org\/dev\/peps\/pep-0484\/\">PEP 484<\/a>). \u042f \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u0438\u0432\u0430\u044e, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0438 \u043d\u0435 \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 Python. \u041d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 Python \u0432\u043e\u043e\u0431\u0449\u0435 \u0438\u0445 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442.<\/p>\n<p>\u041f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438 \u0442\u0438\u043f\u043e\u0432 (\u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043d\u0435 \u0441\u0442\u0440\u043e\u0433\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0442\u0438\u043f\u043e\u0432) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0438\u0441\u043a\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0434\u044b\u0440\u044b \u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0442\u0438\u043f\u044b \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0438 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438.<\/p>\n<p>\u0412 Python 3.7 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438 \u0442\u0438\u043f\u043e\u0432 \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u043f\u043e\u043b\u0435\u0439 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u0430 <code>@dataclass<\/code>.<\/p>\n<p>\u042f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438 \u0442\u0438\u043f\u043e\u0432 \u0432\u043e \u0432\u0441\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b <code>@dataclass<\/code>. \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u043e \u043d\u0438\u0445 \u0431\u043e\u043b\u044c\u0448\u0435, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c:<\/p>\n<ol>\n<li>\n<p><a href=\"https:\/\/medium.com\/swlh\/future-proof-your-python-code-20ef2b75e9f5\"><u>https:\/\/medium.com\/swlh\/future-proof-your-python-code-20ef2b75e9f5<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/realpython.com\/python-type-checking\/\"><u>https:\/\/realpython.com\/python-type-checking\/<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.python.org\/3\/library\/typing.html\"><u>https:\/\/docs.python.org\/3\/library\/typing.html<\/u><\/a><\/p>\n<\/li>\n<\/ol>\n<h4>\u0414\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440 @dataclass \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0441\u0442\u044c<\/h4>\n<p><code>@dataclass<\/code> \u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432 Python 3.7. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0434\u0432\u0438\u0436\u0443\u0449\u0435\u0439 \u0441\u0438\u043b\u043e\u0439 \u0431\u044b\u043b\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0441\u0442\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u0441 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 <code>def<\/code>.&nbsp;<\/p>\n<p>\u041a\u043b\u0430\u0441\u0441\u044b \u043c\u043e\u0433\u0443\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0431\u0435\u0437 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0441 \u043e\u0434\u043d\u0438\u043c\u0438 \u043b\u0438\u0448\u044c \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438, \u043d\u043e \u043a\u0430\u043a\u043e\u0439 \u0432 \u044d\u0442\u043e\u043c \u0441\u043c\u044b\u0441\u043b? \u041a\u043b\u0430\u0441\u0441\u044b \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f (\u043f\u043e\u043b\u0435\u0439 \u0434\u0430\u043d\u043d\u044b\u0445) \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u043f\u043e\u043b\u044f\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/em>: \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 <em>pandas<\/em>, \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 <code>@jit<\/code> \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 <em>numba<\/em>.<\/p>\n<p><code>@dataclass<\/code> \u0434\u0435\u043a\u043e\u0440\u0438\u0440\u0443\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 <code>def<\/code> \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 5 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 <code>init()<\/code><em>, <\/em><code>repr()<\/code><em>, <\/em><code>str<\/code><em>, <\/em><code>eq()<\/code><em>,<\/em> \u0438 <code>hash()<\/code>.<\/p>\n<p> <em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/em> \u043e\u043d \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432\u0441\u0435 \u044d\u0442\u0438 5 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u0435\u0439 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430. <code>@dataclass<\/code><em> <\/em>\u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0431\u0438\u0440\u0430\u0435\u0442 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0439\u0441\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0439 \u043a\u043e\u0434, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0440\u043e\u0442\u0435\u043d\u044c\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 <code>photon\/photonai\/base\/hyperpipe.py<\/code>, \u0434\u0435\u043a\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <em><a class=\"mention\" href=\"\/users\/dataclass.\">@dataclass.<\/a><\/em><\/p>\n<pre><code class=\"python\">### Example #1  class Data:     def __init__(self, X=None, y=None, kwargs=None):         self.X = X         self.y = y         self.kwargs = kwargs<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 1, \u043f\u043e\u0441\u043b\u0435 \u0434\u0435\u043a\u043e\u0440\u0430\u0446\u0438\u0438 =&gt; <\/p>\n<pre><code class=\"python\">from dataclasses import dataclass from typing import Dict import numpy as np @dataclass class Data:     X: np.ndarray = None  # The field declaration: X     y: np.array = None    # The field declaration: y     kwargs: Dict = None   # The field declaration: kwargs<\/code><\/pre>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/em>: \u0415\u0441\u043b\u0438 \u0442\u0438\u043f \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f, \u0442\u043e \u043f\u043e\u043b\u0435 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0442\u0438\u043f <code>any<\/code> \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0442\u0438\u043f\u0430, \u0435\u0441\u043b\u0438 \u043e\u043d \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0438\u043b\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d.<\/p>\n<p>\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u043b\u0438 \u043a\u043e\u0434 <code>eq()<\/code>?<\/p>\n<pre><code class=\"python\">### Example #2  data1 = Data() data2 = Data() data1 == data1<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 2, \u0432\u044b\u0432\u043e\u0434 =&gt;<\/p>\n<pre><code>True<\/code><\/pre>\n<p>\u0414\u0430! \u0410 \u0447\u0442\u043e \u043d\u0430\u0441\u0447\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 <code>repr()<\/code> \u0438 <code>str<\/code>?<\/p>\n<pre><code class=\"python\">### Example #3  print(data1) data1<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 , \u0432\u044b\u0432\u043e\u0434 =&gt;<\/p>\n<pre><code class=\"python\">Data(X=None, y=None, kwargs=None) Data(X=None, y=None, kwargs=None)<\/code><\/pre>\n<p>\u0414\u0430! \u0410 \u043c\u0435\u0442\u043e\u0434\u044b <code>hash()<\/code> \u0438 <code>init<\/code>?<\/p>\n<pre><code>Example #4  @dataclass(unsafe_hash=True) class Data:     X: np.ndarray = None     y: np.array = None     kwargs: Dict = None          data3 = Data(1,2,3) {data3:1}<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 4, \u0432\u044b\u0432\u043e\u0434 =&gt;<\/p>\n<pre><code class=\"python\">{Data(X=1, y=2, kwargs=3): 1}<\/code><\/pre>\n<p>\u0414\u0430!<\/p>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/em>: \u0423 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 <code>init<\/code> \u0432\u0441\u0435 \u0435\u0449\u0435 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430 <em>(X, y, kwargs)<\/em>. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438 \u0442\u0438\u043f\u043e\u0432 \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u043e\u043c Python 3.7.<\/p>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: <\/em>\u0423<em> <\/em><code>init()<\/code><em>, <\/em><code>repr()<\/code><em>, <\/em><code>str<\/code><em>&nbsp;\u0438 <\/em><code>eq()<\/code><em> <\/em>\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <em>True<\/em>, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u0443 <code>hash()<\/code> \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <em>False<\/em>.<\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>inspect<\/code> \u0442\u0430\u043a\u0436\u0435, \u043a\u0430\u043a \u0438 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430.<\/p>\n<pre><code class=\"python\">### Example #5  from inspect import signature print(signature(data3.__init__))<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 5, \u0432\u044b\u0432\u043e\u0434 =&gt;<\/p>\n<pre><code>(X: numpy.ndarray = None, y: &lt;built-in function array&gt; = None,  kwargs: Dict = None) -&gt; None<\/code><\/pre>\n<p>\u041a\u0440\u0443\u0442\u043e!<\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 <code>photon\/photonai\/base\/hyperpipe.py<\/code><\/p>\n<pre><code class=\"python\">### Example #6  class CrossValidation:      def __init__(self, inner_cv, outer_cv,                  eval_final_performance, test_size,                  calculate_metrics_per_fold,                  calculate_metrics_across_folds):         self.inner_cv = inner_cv         self.outer_cv = outer_cv         self.eval_final_performance = eval_final_performance         self.test_size = test_size         self.calculate_metrics_per_fold = calculate_metrics_per_fold         self.calculate_metrics_across_folds =             calculate_metrics_across_folds          self.outer_folds = None         self.inner_folds = dict()Example #6 Output=&gt;<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 6, \u043f\u043e\u0441\u043b\u0435 \u0434\u0435\u043a\u043e\u0440\u0430\u0446\u0438\u0438 =&gt;<\/p>\n<pre><code class=\"python\">from dataclasses import dataclass @dataclass class CrossValidation:     inner_cv: int     outer_cv: int     eval_final_performance: bool = True     test_size: float = 0.2     calculate_metrics_per_fold: bool = True     calculate_metrics_across_folds: bool = False Note:(Example #6) As any signature, keyword arguments fields with default values must be declared last. Note:(Example #6)  class CrossValidation: Readability has increased substantially by using @dataclass and type hinting.<\/code><\/pre>\n<pre><code class=\"python\">### Example #7 cv1 = CrossValidation()<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 7, \u0432\u044b\u0432\u043e\u0434 =&gt;<\/p>\n<pre><code class=\"python\">TypeError: __init__() missing 2 required positional arguments: 'inner_cv' and 'outer_cv' Note:(Example #7) inner_cv and outer_cv are positional arguments. With any signature, you declare a non-default field after a default one. (Hint: If this were allowed, inheritance from a parent class breaks.)((Why? Goggle interview question #666.))<\/code><\/pre>\n<pre><code class=\"python\">### Example #8 cv1 = CrossValidation(1,2) cv2 = CrossValidation(1,2) cv3 = CrossValidation(3,2,test_size=0.5) print(cv1) cv3<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 8, \u0432\u044b\u0432\u043e\u0434 =&gt;<\/p>\n<pre><code class=\"python\">CrossValidation(inner_cv=1, outer_cv=2, eval_final_performance=True, test_size=0.2, calculate_metrics_per_fold=True, calculate_metrics_across_folds=False) CrossValidation(inner_cv=3, outer_cv=2, eval_final_performance=True, test_size=0.5, calculate_metrics_per_fold=True, calculate_metrics_across_folds=False)<\/code><\/pre>\n<pre><code class=\"python\">### Example #9 cv1 == cv2<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 9, \u0432\u044b\u0432\u043e\u0434 =&gt;<\/p>\n<pre><code>True<\/code><\/pre>\n<pre><code class=\"python\">### Example #10  cv1 == cv3<\/code><\/pre>\n<p>    \u041f\u0440\u0438\u043c\u0435\u0440 10, \u0432\u044b\u0432\u043e\u0434 =&gt;<\/p>\n<pre><code>False<\/code><\/pre>\n<pre><code class=\"python\">### Example #11 from inspect import signature print(signature(cv3.__init__)) cv3<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 11, \u0432\u044b\u0432\u043e\u0434 =&gt;<\/p>\n<pre><code class=\"python\">(inner_cv: int, outer_cv: int, eval_final_performance: bool = True, test_size: float = 0.2, calculate_metrics_per_fold: bool = True, calculate_metrics_across_folds: bool = False) -&gt; None CrossValidation(inner_cv=3, outer_cv=2, eval_final_performance=True, test_size=0.5, calculate_metrics_per_fold=True, calculate_metrics_across_folds=False) Note: (Example #11) The inspect function shows the signature of the class object while the__str__ default shows the instance state variables and their values.<\/code><\/pre>\n<p>\u041e\u0447\u0435\u043d\u044c \u043a\u0440\u0443\u0442\u043e!<\/p>\n<p>\u0423\u043f\u0441, \u0430 \u0447\u0442\u043e \u043d\u0430\u0441\u0447\u0435\u0442:<\/p>\n<pre><code class=\"python\">self.outer_folds = None self.inner_folds = dict()<\/code><\/pre>\n<p>\u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u043d\u043e \u043e\u043d\u0438 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435. \u041d\u0435 \u0432\u043e\u043b\u043d\u0443\u0439\u0442\u0435\u0441\u044c, <code>@dataclass<\/code> \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0438 \u0441 \u044d\u0442\u0438\u043c. \u041f\u043e\u043a\u0430\u0436\u0443 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435.<\/p>\n<h4>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u043e\u0441\u043b\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/h4>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u043c\u0435\u0442\u043e\u0434, \u043a\u0430\u043a <code>post-init<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f <code>@dataclass<\/code>. \u041c\u0435\u0442\u043e\u0434 <code>post_init<\/code> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 <code>init<\/code>, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e <code>@dataclass<\/code>. \u041e\u043d \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b.&nbsp;<\/p>\n<p>\u041c\u044b \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u043c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 \u043e\u0441\u0442\u0430\u0432\u0448\u0435\u0435\u0441\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 <code>CrossValidation<\/code>:<\/p>\n<pre><code class=\"python\">### Example 12 from dataclasses import dataclass @dataclass class CrossValidation:     inner_cv: int     outer_cv: int     eval_final_performance: bool = True     test_size: float = 0.2     calculate_metrics_per_fold: bool = True     calculate_metrics_across_folds: bool = False     def __post_init__(self):         self.outer_folds = None         self.inner_folds = dict()<\/code><\/pre>\n<p><strong>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438<\/strong><\/p>\n<p><strong>    <\/strong>\u0417\u0434\u0435\u0441\u044c \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u0430 <code>@dataclass<\/code>:<\/p>\n<ol>\n<li>\n<p><a href=\"https:\/\/realpython.com\/python-data-classes\/\"><u>https:\/\/realpython.com\/python-data-classes\/<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/blog.usejournal.com\/new-buzzword-in-python-is-here-dataclasses-843dd1d372a5\"><u>https:\/\/blog.usejournal.com\/new-buzzword-in-python-is-here-dataclasses-843dd1d372a5<\/u><\/a><\/p>\n<\/li>\n<\/ol>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041d\u0430 12 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u00ab\u0434\u043e \u0438 \u043f\u043e\u0441\u043b\u0435\u00bb \u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u043a\u0430\u043a <code>@dataclass<\/code> \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u043a\u043b\u0430\u0441\u0441\u044b \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 Photonai Machine Learning. \u041c\u044b \u0432\u0438\u0434\u0435\u043b\u0438, \u043a\u0430\u043a <code>@dataclass<\/code> \u043f\u043e\u0432\u044b\u0441\u0438\u043b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430.&nbsp;<\/p>\n<p>\u0423\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u0438 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u043d\u0430 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445. \u0412\u044b \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u0442\u0435, \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u043c\u0435\u043d\u044c\u0448\u0435 \u0442\u0440\u0430\u0442\u0438\u0442\u0435\u0441\u044c \u043d\u0430 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 <code>@dataclass<\/code> \u0438 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043e\u043a \u0442\u0438\u043f\u043e\u0432 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e Python \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0440\u0430\u0441\u0442\u0438 \u0438 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/em>: \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 Photonai \u0432 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u0437 <a href=\"https:\/\/github.com\/bcottman\/photon\">\u043a\u043b\u043e\u043d\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/a> \u043d\u0430 GitHub.<\/p>\n<p>\u042f \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 <code>@dataclass<\/code>. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044e, \u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0443 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 photonai.<\/p>\n<hr>\n<blockquote>\n<p><a href=\"https:\/\/otus.pw\/cx1u\/\"><strong>\u0423\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043a\u0443\u0440\u0441\u0435<\/strong><\/a><strong> \u00abPython Developer. Basic\u00bb.<\/p>\n<p><\/strong><a href=\"https:\/\/otus.pw\/w3sv\/\"><strong>\u0421\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0432\u0435\u0431\u0438\u043d\u0430\u0440<\/strong><\/a><strong> \u043f\u043e \u0442\u0435\u043c\u0435 \u00ab\u0422\u0440\u0438 \u043a\u0438\u0442\u0430: map(), filter() \u0438 zip()\u00bb.<\/strong><\/p>\n<\/blockquote>\n<\/div>\n<p> \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\/otus\/blog\/541812\/\"> https:\/\/habr.com\/ru\/company\/otus\/blog\/541812\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<blockquote>\n<p><em>\u0412 \u0440\u0430\u043c\u043a\u0430\u0445 <\/em><a href=\"https:\/\/otus.pw\/cx1u\/\"><em>\u043a\u0443\u0440\u0441\u0430 \u00abPython Developer. Basic\u00bb<\/em><\/a><em> \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0438 \u0434\u043b\u044f \u0432\u0430\u0441 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0433\u043e \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0430.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0430\u0435\u043c \u0432\u0441\u0435\u0445 \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u043d\u0430 <\/em><a href=\"https:\/\/otus.pw\/w3sv\/\"><em>\u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0432\u0435\u0431\u0438\u043d\u0430\u0440 \u043f\u043e \u0442\u0435\u043c\u0435 \u00ab\u0422\u0440\u0438 \u043a\u0438\u0442\u0430: map(), filter() \u0438 zip()\u00bb<\/em><\/a><em>. \u041c\u043e\u0436\u043d\u043e \u043b\u0438 \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434, \u0442\u0440\u0435\u0431\u0443\u044e\u0449\u0438\u0439 \u0446\u0438\u043a\u043b\u043e\u0432, \u043d\u043e \u0431\u0435\u0437 \u0446\u0438\u043a\u043b\u043e\u0432? \u041c\u043e\u0436\u043d\u043e. \u041c\u043e\u0436\u0435\u0442 \u043b\u0438 \u043e\u043d \u0431\u044b\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c, \u0435\u0441\u043b\u0438 \u0431\u044b \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0446\u0438\u043a\u043b\u044b \u0432 Python? \u041c\u043e\u0436\u0435\u0442. \u0414\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0437\u0430\u0434\u0443\u043c\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0437\u043d\u0430\u043d\u0438\u0435 \u0441\u043b\u043e\u0432 &#171;callback&#187;, &#171;iterator&#187; \u0438 &#171;lambda&#187;. \u0411\u0443\u0434\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e, \u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e. \u041f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u044f\u0439\u0442\u0435\u0441\u044c. <\/em><\/p>\n<\/blockquote>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<hr>\n<p>\u041c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u043a\u0435\u0442\u043e\u0432 scikit-learn, Keras \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0432 \u043f\u0430\u043a\u0435\u0442 Photonai. \u041d\u0430 12 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u043c\u044b \u043f\u043e\u043a\u0430\u0436\u0435\u043c, \u043a\u0430\u043a <code>@dataclass<\/code> \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u0442 \u043a\u043e\u0434 \u043d\u0430 Python. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043a\u043e\u0434 \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 Photonai \u0434\u043b\u044f Machine Learning.<\/p>\n<p><strong>\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u0435\u0441\u044c \u0434\u043e Python 3.7 \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0437\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438<\/strong><\/p>\n<p>\u0414\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440 <code>@dataclass<\/code> \u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432 Python 3.7. \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Python 3.7 \u0438\u0437 Docker-\u043e\u0431\u0440\u0430\u0437\u0430, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u0444\u0430\u0439\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>\/.bashrc_profile<\/code><em> <\/em>\u0438\u043b\u0438 <code>\/bashrc.txt<\/code>.<\/p>\n<pre><code class=\"python\">devdir='&lt;path-to-projects&gt;\/photon\/photonai\/dockerSeasons\/dev\/' testdir='&lt;path-to-projects&gt;\/photon\/photonai\/dockerSeasons\/test\/' echo $devdir echo $testdir export testdir export devdir # alias updev=\"(cd $devdir; docker-compose up) &amp;\" alias downdev=\"(cd $devdir; docker-compose down) &amp;\" alias builddev=\"(cd $devdir; docker-compose build) &amp;\" # alias uptest=\"(cd $testdir; docker-compose up) &amp; \" alias downtest=\"(cd $testdir; docker-compose down) &amp;\" alias buildtest=\"cd $testdir; docker-compose build) &amp;\"<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u0444\u0430\u0439\u043b <code>\/bashrc.txt<\/code> \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0435\u0433\u043e \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>touch\/bashrc.txt<\/code>. (\u0432 \u0441\u043b\u0443\u0447\u0430\u0435 MacOS \u0438\u043b\u0438 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0440\u0430\u0437\u043d\u043e\u0432\u0438\u0434\u043d\u043e\u0441\u0442\u0435\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c Linux \u0438\u043b\u0438 Unix.)<\/p>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/em> \u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430 <code>\u02dc\/.bashrc_profile<\/code><em> <\/em>\u0438\u043b\u0438 <code>\u02dc\/bashrc.txt<\/code>, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u0442\u0435 \u0438\u0445 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c.&nbsp;<\/p>\n<p><a href=\"https:\/\/medium.com\/@dr.bruce.cottman\/a-docker-solution-for-the-test-groups-use-cases-8e8ed6c28e11\">\u0417\u0434\u0435\u0441\u044c<\/a> \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Docker, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c.&nbsp;<\/p>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/em>: \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0434 Docker \u0432 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u0437 <a href=\"https:\/\/github.com\/bcottman\/dockerSeasons\">\u043a\u043b\u043e\u043d\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f \u043d\u0430 GitHub<\/a>.<\/p>\n<h4>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438 \u0442\u0438\u043f\u043e\u0432<\/h4>\n<p>Python \u2013 \u044f\u0437\u044b\u043a \u0441 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u0435\u0439. \u0412 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 Python \u043e\u0442 3.5 \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438 \u0442\u0438\u043f\u043e\u0432 (<a href=\"https:\/\/www.python.org\/dev\/peps\/pep-0484\/\">PEP 484<\/a>). \u042f \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u0438\u0432\u0430\u044e, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043e\u043d\u0438 \u043d\u0435 \u0432\u043b\u0438\u044f\u044e\u0442 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 Python. \u041d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440 Python \u0432\u043e\u043e\u0431\u0449\u0435 \u0438\u0445 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442.<\/p>\n<p>\u041f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438 \u0442\u0438\u043f\u043e\u0432 (\u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043d\u0435 \u0441\u0442\u0440\u043e\u0433\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0442\u0438\u043f\u043e\u0432) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0438\u0441\u043a\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438, \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0434\u044b\u0440\u044b \u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0442\u0438\u043f\u044b \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438 \u043f\u0440\u0438 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438.<\/p>\n<p>\u0412 Python 3.7 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438 \u0442\u0438\u043f\u043e\u0432 \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u043f\u043e\u043b\u0435\u0439 \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u0430 <code>@dataclass<\/code>.<\/p>\n<p>\u042f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438 \u0442\u0438\u043f\u043e\u0432 \u0432\u043e \u0432\u0441\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b <code>@dataclass<\/code>. \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u043e \u043d\u0438\u0445 \u0431\u043e\u043b\u044c\u0448\u0435, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c:<\/p>\n<ol>\n<li>\n<p><a href=\"https:\/\/medium.com\/swlh\/future-proof-your-python-code-20ef2b75e9f5\"><u>https:\/\/medium.com\/swlh\/future-proof-your-python-code-20ef2b75e9f5<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/realpython.com\/python-type-checking\/\"><u>https:\/\/realpython.com\/python-type-checking\/<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/docs.python.org\/3\/library\/typing.html\"><u>https:\/\/docs.python.org\/3\/library\/typing.html<\/u><\/a><\/p>\n<\/li>\n<\/ol>\n<h4>\u0414\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440 @dataclass \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0441\u0442\u044c<\/h4>\n<p><code>@dataclass<\/code> \u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432 Python 3.7. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0434\u0432\u0438\u0436\u0443\u0449\u0435\u0439 \u0441\u0438\u043b\u043e\u0439 \u0431\u044b\u043b\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0441\u0442\u0438, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u0441 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435\u043c \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 <code>def<\/code>.&nbsp;<\/p>\n<p>\u041a\u043b\u0430\u0441\u0441\u044b \u043c\u043e\u0433\u0443\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0431\u0435\u0437 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0441 \u043e\u0434\u043d\u0438\u043c\u0438 \u043b\u0438\u0448\u044c \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438, \u043d\u043e \u043a\u0430\u043a\u043e\u0439 \u0432 \u044d\u0442\u043e\u043c \u0441\u043c\u044b\u0441\u043b? \u041a\u043b\u0430\u0441\u0441\u044b \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f (\u043f\u043e\u043b\u0435\u0439 \u0434\u0430\u043d\u043d\u044b\u0445) \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u043f\u043e\u043b\u044f\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0443\u0436\u043d\u043e \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/em>: \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 <em>pandas<\/em>, \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u044b\u0441\u0442\u0440\u043e\u0439 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 <code>@jit<\/code> \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 <em>numba<\/em>.<\/p>\n<p><code>@dataclass<\/code> \u0434\u0435\u043a\u043e\u0440\u0438\u0440\u0443\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 <code>def<\/code> \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 5 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 <code>init()<\/code><em>, <\/em><code>repr()<\/code><em>, <\/em><code>str<\/code><em>, <\/em><code>eq()<\/code><em>,<\/em> \u0438 <code>hash()<\/code>.<\/p>\n<p> <em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/em> \u043e\u043d \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432\u0441\u0435 \u044d\u0442\u0438 5 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u044f\u0446\u0438\u0435\u0439 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u0430. <code>@dataclass<\/code><em> <\/em>\u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0431\u0438\u0440\u0430\u0435\u0442 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u044e\u0449\u0438\u0439\u0441\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0439 \u043a\u043e\u0434, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0440\u043e\u0442\u0435\u043d\u044c\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0432 <code>photon\/photonai\/base\/hyperpipe.py<\/code>, \u0434\u0435\u043a\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <em><a class=\"mention\" href=\"\/users\/dataclass.\">@dataclass.<\/a><\/em><\/p>\n<pre><code class=\"python\">### Example #1  class Data:     def __init__(self, X=None, y=None, kwargs=None):         self.X = X         self.y = y         self.kwargs = kwargs<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 1, \u043f\u043e\u0441\u043b\u0435 \u0434\u0435\u043a\u043e\u0440\u0430\u0446\u0438\u0438 =&gt; <\/p>\n<pre><code class=\"python\">from dataclasses import dataclass from typing import Dict import numpy as np @dataclass class Data:     X: np.ndarray = None  # The field declaration: X     y: np.array = None    # The field declaration: y     kwargs: Dict = None   # The field declaration: kwargs<\/code><\/pre>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/em>: \u0415\u0441\u043b\u0438 \u0442\u0438\u043f \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f, \u0442\u043e \u043f\u043e\u043b\u0435 \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0442\u0438\u043f <code>any<\/code> \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0442\u0438\u043f\u0430, \u0435\u0441\u043b\u0438 \u043e\u043d \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0438\u043b\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d.<\/p>\n<p>\u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u043b\u0438 \u043a\u043e\u0434 <code>eq()<\/code>?<\/p>\n<pre><code class=\"python\">### Example #2  data1 = Data() data2 = Data() data1 == data1<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 2, \u0432\u044b\u0432\u043e\u0434 =&gt;<\/p>\n<pre><code>True<\/code><\/pre>\n<p>\u0414\u0430! \u0410 \u0447\u0442\u043e \u043d\u0430\u0441\u0447\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 <code>repr()<\/code> \u0438 <code>str<\/code>?<\/p>\n<pre><code class=\"python\">### Example #3  print(data1) data1<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 , \u0432\u044b\u0432\u043e\u0434 =&gt;<\/p>\n<pre><code class=\"python\">Data(X=None, y=None, kwargs=None) Data(X=None, y=None, kwargs=None)<\/code><\/pre>\n<p>\u0414\u0430! \u0410 \u043c\u0435\u0442\u043e\u0434\u044b <code>hash()<\/code> \u0438 <code>init<\/code>?<\/p>\n<pre><code>Example #4  @dataclass(unsafe_hash=True) class Data:     X: np.ndarray = None     y: np.array = None     kwargs: Dict = None          data3 = Data(1,2,3) {data3:1}<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 4, \u0432\u044b\u0432\u043e\u0434 =&gt;<\/p>\n<pre><code class=\"python\">{Data(X=1, y=2, kwargs=3): 1}<\/code><\/pre>\n<p>\u0414\u0430!<\/p>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/em>: \u0423 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 <code>init<\/code> \u0432\u0441\u0435 \u0435\u0449\u0435 \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0430 <em>(X, y, kwargs)<\/em>. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438 \u0442\u0438\u043f\u043e\u0432 \u0431\u044b\u043b\u0438 \u043f\u0440\u043e\u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u043e\u043c Python 3.7.<\/p>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: <\/em>\u0423<em> <\/em><code>init()<\/code><em>, <\/em><code>repr()<\/code><em>, <\/em><code>str<\/code><em>&nbsp;\u0438 <\/em><code>eq()<\/code><em> <\/em>\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <em>True<\/em>, \u0442\u043e\u0433\u0434\u0430 \u043a\u0430\u043a \u0443 <code>hash()<\/code> \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <em>False<\/em>.<\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>inspect<\/code> \u0442\u0430\u043a\u0436\u0435, \u043a\u0430\u043a \u0438 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430.<\/p>\n<pre><code class=\"python\">### Example #5  from inspect import signature print(signature(data3.__init__))<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 5, \u0432\u044b\u0432\u043e\u0434 =&gt;<\/p>\n<pre><code>(X: numpy.ndarray = None, y: &lt;built-in function array&gt; = None,  kwargs: Dict = None) -&gt; None<\/code><\/pre>\n<p>\u041a\u0440\u0443\u0442\u043e!<\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u0434\u043b\u0438\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 <code>photon\/photonai\/base\/hyperpipe.py<\/code><\/p>\n<pre><code class=\"python\">### Example #6  class CrossValidation:      def __init__(self, inner_cv, outer_cv,                  eval_final_performance, test_size,                  calculate_metrics_per_fold,                  calculate_metrics_across_folds):         self.inner_cv = inner_cv         self.outer_cv = outer_cv         self.eval_final_performance = eval_final_performance         self.test_size = test_size         self.calculate_metrics_per_fold = calculate_metrics_per_fold         self.calculate_metrics_across_folds =             calculate_metrics_across_folds          self.outer_folds = None         self.inner_folds = dict()Example #6 Output=&gt;<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 6, \u043f\u043e\u0441\u043b\u0435 \u0434\u0435\u043a\u043e\u0440\u0430\u0446\u0438\u0438 =&gt;<\/p>\n<pre><code class=\"python\">from dataclasses import dataclass @dataclass class CrossValidation:     inner_cv: int     outer_cv: int     eval_final_performance: bool = True     test_size: float = 0.2     calculate_metrics_per_fold: bool = True     calculate_metrics_across_folds: bool = False Note:(Example #6) As any signature, keyword arguments fields with default values must be declared last. Note:(Example #6)  class CrossValidation: Readability has increased substantially by using @dataclass and type hinting.<\/code><\/pre>\n<pre><code class=\"python\">### Example #7 cv1 = CrossValidation()<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 7, \u0432\u044b\u0432\u043e\u0434 =&gt;<\/p>\n<pre><code class=\"python\">TypeError: __init__() missing 2 required positional arguments: 'inner_cv' and 'outer_cv' Note:(Example #7) inner_cv and outer_cv are positional arguments. With any signature, you declare a non-default field after a default one. (Hint: If this were allowed, inheritance from a parent class breaks.)((Why? Goggle interview question #666.))<\/code><\/pre>\n<pre><code class=\"python\">### Example #8 cv1 = CrossValidation(1,2) cv2 = CrossValidation(1,2) cv3 = CrossValidation(3,2,test_size=0.5) print(cv1) cv3<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 8, \u0432\u044b\u0432\u043e\u0434 =&gt;<\/p>\n<pre><code class=\"python\">CrossValidation(inner_cv=1, outer_cv=2, eval_final_performance=True, test_size=0.2, calculate_metrics_per_fold=True, calculate_metrics_across_folds=False) CrossValidation(inner_cv=3, outer_cv=2, eval_final_performance=True, test_size=0.5, calculate_metrics_per_fold=True, calculate_metrics_across_folds=False)<\/code><\/pre>\n<pre><code class=\"python\">### Example #9 cv1 == cv2<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 9, \u0432\u044b\u0432\u043e\u0434 =&gt;<\/p>\n<pre><code>True<\/code><\/pre>\n<pre><code class=\"python\">### Example #10  cv1 == cv3<\/code><\/pre>\n<p>    \u041f\u0440\u0438\u043c\u0435\u0440 10, \u0432\u044b\u0432\u043e\u0434 =&gt;<\/p>\n<pre><code>False<\/code><\/pre>\n<pre><code class=\"python\">### Example #11 from inspect import signature print(signature(cv3.__init__)) cv3<\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 11, \u0432\u044b\u0432\u043e\u0434 =&gt;<\/p>\n<pre><code class=\"python\">(inner_cv: int, outer_cv: int, eval_final_performance: bool = True, test_size: float = 0.2, calculate_metrics_per_fold: bool = True, calculate_metrics_across_folds: bool = False) -&gt; None CrossValidation(inner_cv=3, outer_cv=2, eval_final_performance=True, test_size=0.5, calculate_metrics_per_fold=True, calculate_metrics_across_folds=False) Note: (Example #11) The inspect function shows the signature of the class object while the__str__ default shows the instance state variables and their values.<\/code><\/pre>\n<p>\u041e\u0447\u0435\u043d\u044c \u043a\u0440\u0443\u0442\u043e!<\/p>\n<p>\u0423\u043f\u0441, \u0430 \u0447\u0442\u043e \u043d\u0430\u0441\u0447\u0435\u0442:<\/p>\n<pre><code class=\"python\">self.outer_folds = None self.inner_folds = dict()<\/code><\/pre>\n<p>\u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u043d\u043e \u043e\u043d\u0438 \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435. \u041d\u0435 \u0432\u043e\u043b\u043d\u0443\u0439\u0442\u0435\u0441\u044c, <code>@dataclass<\/code> \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0438 \u0441 \u044d\u0442\u0438\u043c. \u041f\u043e\u043a\u0430\u0436\u0443 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435.<\/p>\n<h4>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043f\u043e\u0441\u043b\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438<\/h4>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u043c\u0435\u0442\u043e\u0434, \u043a\u0430\u043a <code>post-init<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f <code>@dataclass<\/code>. \u041c\u0435\u0442\u043e\u0434 <code>post_init<\/code> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 <code>init<\/code>, \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e <code>@dataclass<\/code>. \u041e\u043d \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b.&nbsp;<\/p>\n<p>\u041c\u044b \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u043c \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 \u043e\u0441\u0442\u0430\u0432\u0448\u0435\u0435\u0441\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 <code>CrossValidation<\/code>:<\/p>\n<pre><code class=\"python\">### Example 12 from dataclasses import dataclass @dataclass class CrossValidation:     inner_cv: int     outer_cv: int     eval_final_performance: bool = True     test_size: float = 0.2     calculate_metrics_per_fold: bool = True     calculate_metrics_across_folds: bool = False     def __post_init__(self):         self.outer_folds = None         self.inner_folds = dict()<\/code><\/pre>\n<p><strong>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438<\/strong><\/p>\n<p><strong>    <\/strong>\u0417\u0434\u0435\u0441\u044c \u0432\u044b \u043d\u0430\u0439\u0434\u0435\u0442\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u0430 <code>@dataclass<\/code>:<\/p>\n<ol>\n<li>\n<p><a href=\"https:\/\/realpython.com\/python-data-classes\/\"><u>https:\/\/realpython.com\/python-data-classes\/<\/u><\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/blog.usejournal.com\/new-buzzword-in-python-is-here-dataclasses-843dd1d372a5\"><u>https:\/\/blog.usejournal.com\/new-buzzword-in-python-is-here-dataclasses-843dd1d372a5<\/u><\/a><\/p>\n<\/li>\n<\/ol>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041d\u0430 12 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u00ab\u0434\u043e \u0438 \u043f\u043e\u0441\u043b\u0435\u00bb \u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u043a\u0430\u043a <code>@dataclass<\/code> \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u043a\u043b\u0430\u0441\u0441\u044b \u0432 \u043f\u0430\u043a\u0435\u0442\u0435 Photonai Machine Learning. \u041c\u044b \u0432\u0438\u0434\u0435\u043b\u0438, \u043a\u0430\u043a <code>@dataclass<\/code> \u043f\u043e\u0432\u044b\u0441\u0438\u043b \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430.&nbsp;<\/p>\n<p>\u0423\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u0438 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u043d\u0430 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445. \u0412\u044b \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b, \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u0442\u0435, \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u043c\u0435\u043d\u044c\u0448\u0435 \u0442\u0440\u0430\u0442\u0438\u0442\u0435\u0441\u044c \u043d\u0430 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 <code>@dataclass<\/code> \u0438 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043e\u043a \u0442\u0438\u043f\u043e\u0432 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e Python \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0440\u0430\u0441\u0442\u0438 \u0438 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/em>: \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 Photonai \u0432 \u0441\u0432\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u0437 <a href=\"https:\/\/github.com\/bcottman\/photon\">\u043a\u043b\u043e\u043d\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f<\/a> \u043d\u0430 GitHub.<\/p>\n<p>\u042f \u043f\u043e\u043a\u0430\u0437\u0430\u043b<\/p>\n<\/hr>\n<\/blockquote>\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-317791","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/317791","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=317791"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/317791\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=317791"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=317791"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=317791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}