Skip to content

Commit

Permalink
Deploying to gh-pages from @ 0ddb440 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
hrshdhgd committed Feb 9, 2024
1 parent 18f0794 commit de60a5c
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 45 deletions.
48 changes: 30 additions & 18 deletions codergpt.explainer.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,41 +143,53 @@ <h2>Submodules<a class="headerlink" href="#submodules" title="Link to this headi

</dd></dl>

</section>
<section id="module-codergpt.explainer">
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-codergpt.explainer" title="Link to this heading"></a></h2>
<p>Code explanation module.</p>
<dl class="py class">
<dt class="sig sig-object py" id="codergpt.explainer.explainer.ExpressionEvaluator">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">codergpt.explainer.explainer.</span></span><span class="sig-name descname"><span class="pre">ExpressionEvaluator</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">source_code</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">function_name</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">class_name</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#codergpt.explainer.explainer.ExpressionEvaluator" title="Link to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">NodeVisitor</span></code></p>
<p>Evaluate the code expression and extract the source code of the specified function or class.</p>
<dt class="sig sig-object py" id="codergpt.explainer.CodeExplainer">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">codergpt.explainer.</span></span><span class="sig-name descname"><span class="pre">CodeExplainer</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">chain</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#codergpt.explainer.CodeExplainer" title="Link to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Code Explainer class that extracts and explains code from a given file.</p>
<dl class="py method">
<dt class="sig sig-object py" id="codergpt.explainer.explainer.ExpressionEvaluator.visit_ClassDef">
<span class="sig-name descname"><span class="pre">visit_ClassDef</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">node</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#codergpt.explainer.explainer.ExpressionEvaluator.visit_ClassDef" title="Link to this definition"></a></dt>
<dd><p>Visit a ClassDef (class definition) node in the AST.</p>
<p>If the class name matches the target class name, it extracts the source segment.</p>
<dt class="sig sig-object py" id="codergpt.explainer.CodeExplainer.explain">
<span class="sig-name descname"><span class="pre">explain</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">path</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">function</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">classname</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#codergpt.explainer.CodeExplainer.explain" title="Link to this definition"></a></dt>
<dd><p>Explain the contents of the code file by invoking the runnable chain.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>node</strong> (<em>ast.ClassDef</em>) – The node representing a class definition in the AST.</p>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> (<span class="sphinx_autodoc_typehints-type"><code class="xref py py-data docutils literal notranslate"><span class="pre">Union</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">Path</span></code>]</span>) – The path to the code file to be explained.</p></li>
<li><p><strong>function</strong> (<span class="sphinx_autodoc_typehints-type"><code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]</span>) – The name of the function to explain. Default is None.</p></li>
<li><p><strong>classname</strong> (<span class="sphinx_autodoc_typehints-type"><code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]</span>) – The name of the class to explain. Default is None.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="codergpt.explainer.explainer.ExpressionEvaluator.visit_FunctionDef">
<span class="sig-name descname"><span class="pre">visit_FunctionDef</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">node</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#codergpt.explainer.explainer.ExpressionEvaluator.visit_FunctionDef" title="Link to this definition"></a></dt>
<dd><p>Visit a FunctionDef (function definition) node in the AST.</p>
<p>If the function name matches the target function name, it extracts the source segment.</p>
<dt class="sig sig-object py" id="codergpt.explainer.CodeExplainer.get_function_code">
<span class="sig-name descname"><span class="pre">get_function_code</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">function_name</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">class_name</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#codergpt.explainer.CodeExplainer.get_function_code" title="Link to this definition"></a></dt>
<dd><p>Extract and return the source code of the specified function or class from a file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
<dd class="field-odd"><p><strong>node</strong> (<em>ast.FunctionDef</em>) – The node representing a function definition in the AST.</p>
<dd class="field-odd"><ul class="simple">
<li><p><strong>filename</strong> (<span class="sphinx_autodoc_typehints-type"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></span>) – The path to the file containing the code.</p></li>
<li><p><strong>function_name</strong> (<span class="sphinx_autodoc_typehints-type"><code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]</span>) – The name of the function to extract code for. Default is None.</p></li>
<li><p><strong>class_name</strong> (<span class="sphinx_autodoc_typehints-type"><code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]</span>) – The name of the class to extract code for. Default is None.</p></li>
</ul>
</dd>
<dt class="field-even">Return type<span class="colon">:</span></dt>
<dd class="field-even"><p><span class="sphinx_autodoc_typehints-type"><code class="xref py py-data docutils literal notranslate"><span class="pre">Optional</span></code>[<code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code>]</span></p>
</dd>
<dt class="field-odd">Returns<span class="colon">:</span></dt>
<dd class="field-odd"><p>The extracted source code of the specified function or class, if found.</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

</section>
<section id="module-codergpt.explainer">
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-codergpt.explainer" title="Link to this heading"></a></h2>
<p>Code explanation module.</p>
</section>
</section>

Expand Down
10 changes: 6 additions & 4 deletions codergpt.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,16 @@ <h2>Subpackages<a class="headerlink" href="#subpackages" title="Link to this hea
<li class="toctree-l4"><a class="reference internal" href="codergpt.explainer.html#codergpt.explainer.explainer.CodeExplainer.get_function_code"><code class="docutils literal notranslate"><span class="pre">CodeExplainer.get_function_code()</span></code></a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="codergpt.explainer.html#codergpt.explainer.explainer.ExpressionEvaluator"><code class="docutils literal notranslate"><span class="pre">ExpressionEvaluator</span></code></a><ul>
<li class="toctree-l4"><a class="reference internal" href="codergpt.explainer.html#codergpt.explainer.explainer.ExpressionEvaluator.visit_ClassDef"><code class="docutils literal notranslate"><span class="pre">ExpressionEvaluator.visit_ClassDef()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="codergpt.explainer.html#codergpt.explainer.explainer.ExpressionEvaluator.visit_FunctionDef"><code class="docutils literal notranslate"><span class="pre">ExpressionEvaluator.visit_FunctionDef()</span></code></a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="codergpt.explainer.html#module-codergpt.explainer">Module contents</a><ul>
<li class="toctree-l3"><a class="reference internal" href="codergpt.explainer.html#codergpt.explainer.CodeExplainer"><code class="docutils literal notranslate"><span class="pre">CodeExplainer</span></code></a><ul>
<li class="toctree-l4"><a class="reference internal" href="codergpt.explainer.html#codergpt.explainer.CodeExplainer.explain"><code class="docutils literal notranslate"><span class="pre">CodeExplainer.explain()</span></code></a></li>
<li class="toctree-l4"><a class="reference internal" href="codergpt.explainer.html#codergpt.explainer.CodeExplainer.get_function_code"><code class="docutils literal notranslate"><span class="pre">CodeExplainer.get_function_code()</span></code></a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="codergpt.explainer.html#module-codergpt.explainer">Module contents</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="codergpt.optimizer.html">codergpt.optimizer package</a><ul>
Expand Down
37 changes: 17 additions & 20 deletions genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,17 @@ <h1 id="index">Index</h1>
| <a href="#G"><strong>G</strong></a>
| <a href="#I"><strong>I</strong></a>
| <a href="#M"><strong>M</strong></a>
| <a href="#V"><strong>V</strong></a>

</div>
<h2 id="C">C</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="codergpt.explainer.html#codergpt.explainer.explainer.CodeExplainer">CodeExplainer (class in codergpt.explainer.explainer)</a>
<li><a href="codergpt.explainer.html#codergpt.explainer.CodeExplainer">CodeExplainer (class in codergpt.explainer)</a>

<ul>
<li><a href="codergpt.explainer.html#codergpt.explainer.explainer.CodeExplainer">(class in codergpt.explainer.explainer)</a>
</li>
</ul></li>
<li>
codergpt

Expand All @@ -109,15 +112,15 @@ <h2 id="C">C</h2>
<li><a href="codergpt.html#module-codergpt.constants">module</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
codergpt.explainer

<ul>
<li><a href="codergpt.explainer.html#module-codergpt.explainer">module</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li>
codergpt.explainer.explainer

Expand Down Expand Up @@ -152,22 +155,28 @@ <h2 id="C">C</h2>
<h2 id="E">E</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="codergpt.explainer.html#codergpt.explainer.explainer.CodeExplainer.explain">explain() (codergpt.explainer.explainer.CodeExplainer method)</a>
<li><a href="codergpt.explainer.html#codergpt.explainer.CodeExplainer.explain">explain() (codergpt.explainer.CodeExplainer method)</a>

<ul>
<li><a href="codergpt.explainer.html#codergpt.explainer.explainer.CodeExplainer.explain">(codergpt.explainer.explainer.CodeExplainer method)</a>
</li>
</ul></li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="codergpt.html#codergpt.main.CoderGPT.explainer">explainer() (codergpt.main.CoderGPT method)</a>
</li>
<li><a href="codergpt.explainer.html#codergpt.explainer.explainer.ExpressionEvaluator">ExpressionEvaluator (class in codergpt.explainer.explainer)</a>
</li>
</ul></td>
</tr></table>

<h2 id="G">G</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="codergpt.explainer.html#codergpt.explainer.explainer.CodeExplainer.get_function_code">get_function_code() (codergpt.explainer.explainer.CodeExplainer method)</a>
<li><a href="codergpt.explainer.html#codergpt.explainer.CodeExplainer.get_function_code">get_function_code() (codergpt.explainer.CodeExplainer method)</a>

<ul>
<li><a href="codergpt.explainer.html#codergpt.explainer.explainer.CodeExplainer.get_function_code">(codergpt.explainer.explainer.CodeExplainer method)</a>
</li>
</ul></li>
</ul></td>
</tr></table>

Expand Down Expand Up @@ -206,18 +215,6 @@ <h2 id="M">M</h2>
</ul></td>
</tr></table>

<h2 id="V">V</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="codergpt.explainer.html#codergpt.explainer.explainer.ExpressionEvaluator.visit_ClassDef">visit_ClassDef() (codergpt.explainer.explainer.ExpressionEvaluator method)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="codergpt.explainer.html#codergpt.explainer.explainer.ExpressionEvaluator.visit_FunctionDef">visit_FunctionDef() (codergpt.explainer.explainer.ExpressionEvaluator method)</a>
</li>
</ul></td>
</tr></table>



</div>
Expand Down
4 changes: 2 additions & 2 deletions objects.inv
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# Project: CoderGPT
# Version:
# The remainder of this file is compressed using zlib.
xڵ��N�0 ��}
#�v��c H�@�X���"Ҥjܱq�5x=��fi���lCۭ���O~;�:�"� ��4�I)����ɒ2y����A��:�P��6�Ab�̑ʸ�%jL�M@8k2���.�Kf ܌��#6�힑�:9:E���$��m�iD*������%#}_<��JA�̢oqq���:w�Y��ʚ.>��d۳�>z�z�ik3�k��ʅ29r�s��X��BtN"c7�M����P�^��7��`���i�9��ݶP������/��!p��?0�{�����>`�[�d�z�C��jl�J��[�d�(-��:��� v�j�Ί��������/���:��5���{��M�$�э��u�b��u�����Ï6՝P}����~����'���g?����
xڵ��N�0 ��}
#�v��!H�@�X��ti5�X9��OBӴ][R�i�m����߮�N�� �)��N7�xc\�)���_Au��a�����%��X�F2��*w���me���d���$n����!�uz,0CJ�6���*q�ǠO���<��gT7o[���.�n��_= ��rF����t��AN�a��e8��\|N�O�~9����ǣ0IK�2��Q��?h�Y���ɂХw� �6����Bh$c`_�r,5���`3TB���Q���t����g� k*�"^PV�"��v��-T��4s�ET=P̔q��G�>��_�/ܘ���z�=�UY}jX�"+�z��m>���WN�_���4
Expand Down
Loading

0 comments on commit de60a5c

Please sign in to comment.