Skip to content

Commit

Permalink
Deploying to gh-pages from @ 20e6167 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
hrshdhgd committed Feb 11, 2024
1 parent e4d0bdc commit 6fbc007
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 13 deletions.
49 changes: 45 additions & 4 deletions _sources/description.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,52 @@ Commands
results in ....

.. code-block:: python
"""
Optimized and Documented Code.
"""
"""
Optimized and Documented Code:
...
"""
from typing import List
def calculate_sum(numbers: List[int]) -> int:
"""
Calculates the sum of a list of numbers.
Parameters:
numbers (List[int]): A list of integers.
Returns:
int: The sum of the numbers.
"""
result = sum(numbers)
return result
class MathOperations:
def multiply(self, a: int, b: int) -> int:
"""
Multiplies two numbers.
Parameters:
a (int): The first number.
b (int): The second number.
Returns:
int: The result of multiplying a and b.
"""
answer = a * b
return answer
"""
Optimization:
1. In the 'calculate_sum' function, we can use the built-in 'sum' function to calculate the sum of the numbers in the list. This is more efficient than manually iterating over the list and adding each number to the result.
2. In the 'multiply' method of the 'MathOperations' class, we can directly multiply the two numbers using the '*' operator. This eliminates the need for a loop and improves performance.
By using these optimizations, we improve the efficiency and readability of the code.
"""
Development
-----------
Expand Down
4 changes: 2 additions & 2 deletions codergpt.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ <h2>codergpt.cli module<a class="headerlink" href="#codergpt-cli-module" title="
<p>Main python file.</p>
<dl class="py class">
<dt class="sig sig-object py" id="codergpt.main.CoderGPT">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">codergpt.main.</span></span><span class="sig-name descname"><span class="pre">CoderGPT</span></span><a class="headerlink" href="#codergpt.main.CoderGPT" title="Link to this definition"></a></dt>
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">codergpt.main.</span></span><span class="sig-name descname"><span class="pre">CoderGPT</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">model</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'gpt-3.5-turbo'</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#codergpt.main.CoderGPT" 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>CoderGPT class.</p>
<dl class="py method">
Expand Down Expand Up @@ -357,7 +357,7 @@ <h2>codergpt.cli module<a class="headerlink" href="#codergpt-cli-module" title="

<dl class="py class">
<dt class="sig sig-object py" id="codergpt.CoderGPT">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">codergpt.</span></span><span class="sig-name descname"><span class="pre">CoderGPT</span></span><a class="headerlink" href="#codergpt.CoderGPT" title="Link to this definition"></a></dt>
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">codergpt.</span></span><span class="sig-name descname"><span class="pre">CoderGPT</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">model</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'gpt-3.5-turbo'</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#codergpt.CoderGPT" 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>CoderGPT class.</p>
<dl class="py method">
Expand Down
6 changes: 0 additions & 6 deletions description.html
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,6 @@ <h3>Commands<a class="headerlink" href="#commands" title="Link to this heading">
</pre></div>
</div>
<p>results in ….</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd">Optimized and Documented Code:</span>
<span class="sd">...</span>
<span class="sd">&quot;&quot;&quot;</span>
</pre></div>
</div>
</li>
</ol>
</section>
Expand Down
Loading

0 comments on commit 6fbc007

Please sign in to comment.