From de60a5c528539fa73caad10f7012e7bf680757bd Mon Sep 17 00:00:00 2001 From: hrshdhgd Date: Fri, 9 Feb 2024 20:02:31 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20hrshdhgd?= =?UTF-8?q?/CoderGPT@0ddb440a605cd5598539d560dca7bbce8e6755be=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- codergpt.explainer.html | 48 +++++++++++++++++++++++++---------------- codergpt.html | 10 +++++---- genindex.html | 37 +++++++++++++++---------------- objects.inv | 4 ++-- searchindex.js | 2 +- 5 files changed, 56 insertions(+), 45 deletions(-) diff --git a/codergpt.explainer.html b/codergpt.explainer.html index 31a99d2..6780ed6 100644 --- a/codergpt.explainer.html +++ b/codergpt.explainer.html @@ -143,41 +143,53 @@

Submodules +

Module contents

+

Code explanation module.

-
-class codergpt.explainer.explainer.ExpressionEvaluator(source_code, function_name=None, class_name=None)
-

Bases: NodeVisitor

-

Evaluate the code expression and extract the source code of the specified function or class.

+
+class codergpt.explainer.CodeExplainer(chain)
+

Bases: object

+

Code Explainer class that extracts and explains code from a given file.

-
-visit_ClassDef(node)
-

Visit a ClassDef (class definition) node in the AST.

-

If the class name matches the target class name, it extracts the source segment.

+
+explain(path, function=None, classname=None)
+

Explain the contents of the code file by invoking the runnable chain.

Parameters:
-

node (ast.ClassDef) – The node representing a class definition in the AST.

+
    +
  • path (Union[str, Path]) – The path to the code file to be explained.

  • +
  • function (Optional[str]) – The name of the function to explain. Default is None.

  • +
  • classname (Optional[str]) – The name of the class to explain. Default is None.

  • +
-
-visit_FunctionDef(node)
-

Visit a FunctionDef (function definition) node in the AST.

-

If the function name matches the target function name, it extracts the source segment.

+
+get_function_code(filename, function_name=None, class_name=None)
+

Extract and return the source code of the specified function or class from a file.

Parameters:
-

node (ast.FunctionDef) – The node representing a function definition in the AST.

+
    +
  • filename (str) – The path to the file containing the code.

  • +
  • function_name (Optional[str]) – The name of the function to extract code for. Default is None.

  • +
  • class_name (Optional[str]) – The name of the class to extract code for. Default is None.

  • +
+
+
Return type:
+

Optional[str]

+
+
Returns:
+

The extracted source code of the specified function or class, if found.

- -
-

Module contents

-

Code explanation module.

diff --git a/codergpt.html b/codergpt.html index b23a296..4f7a0fa 100644 --- a/codergpt.html +++ b/codergpt.html @@ -112,14 +112,16 @@

SubpackagesCodeExplainer.get_function_code() -
  • ExpressionEvaluator +
  • +
  • Module contents
  • -
  • Module contents
  • codergpt.optimizer package
      diff --git a/genindex.html b/genindex.html index 12cd59c..d30e340 100644 --- a/genindex.html +++ b/genindex.html @@ -78,14 +78,17 @@

      Index

      | G | I | M - | V

      C

      + -
      +
      • codergpt.explainer @@ -116,8 +121,6 @@

        C

      • module
      -
      -

      V

      - - - -
      - diff --git a/objects.inv b/objects.inv index 991d8ad..986a42e 100644 --- a/objects.inv +++ b/objects.inv @@ -2,5 +2,5 @@ # Project: CoderGPT # Version: # The remainder of this file is compressed using zlib. -xڵN0 } -#vc H@X"Ҥjܱq5x=filCۭO~;:" 4I)ɒ2yA:P6Ab̑ʸ%jLM@8k2.Kf ܌#6힑:9:E$miD*%#}_d۳>zzik3kʅ29rsXBtN"c7MP^7`i9ݶP/!p?0{>`[dzCjlJ[d(-: vjΊ/:5{M$эubuÏ6՝P}~'g? \ No newline at end of file +xڵN0 } +#v!H@Xti5X9OBӴ][Rim߮N )N7xc\)_Aua%XF2*wmed$n!uz,0CJ6*qǠO_/ܘz=UY}jX"+zm>WN_4 \ No newline at end of file diff --git a/searchindex.js b/searchindex.js index 9a7e201..959d492 100644 --- a/searchindex.js +++ b/searchindex.js @@ -1 +1 @@ -Search.setIndex({"docnames": ["codergpt", "codergpt.commenter", "codergpt.explainer", "codergpt.optimizer", "codergpt.test_writer", "index", "modules"], "filenames": ["codergpt.rst", "codergpt.commenter.rst", "codergpt.explainer.rst", "codergpt.optimizer.rst", "codergpt.test_writer.rst", "index.rst", "modules.rst"], "titles": ["codergpt package", "codergpt.commenter package", "codergpt.explainer package", "codergpt.optimizer package", "codergpt.test_writer package", "Welcome to CoderGPT\u2019s documentation!", "codergpt"], "terms": {"comment": [0, 6], "explain": [0, 6], "codeexplain": [0, 2], "get_function_cod": [0, 2], "expressionevalu": [0, 2], "visit_classdef": [0, 2], "visit_functiondef": [0, 2], "optim": [0, 6], "test_writ": [0, 6], "all": 0, "us": 0, "python": 0, "file": [0, 2], "class": [0, 2], "base": [0, 2], "object": [0, 2], "path": [0, 2], "function": [0, 2], "none": [0, 2], "classnam": [0, 2], "code": [0, 2, 3], "inspect_packag": [0, 6], "inspect": 0, "displai": 0, "map": 0, "languag": 0, "tabl": 0, "chain": 2, "extract": 2, "from": 2, "given": 2, "invok": 2, "runnabl": 2, "paramet": 2, "union": 2, "str": 2, "The": 2, "option": 2, "name": 2, "default": 2, "i": 2, "filenam": 2, "function_nam": 2, "class_nam": 2, "return": 2, "sourc": 2, "specifi": 2, "contain": 2, "type": 2, "found": 2, "source_cod": 2, "nodevisitor": 2, "evalu": 2, "express": 2, "node": 2, "visit": 2, "classdef": 2, "definit": 2, "ast": 2, "If": 2, "match": 2, "target": 2, "segment": 2, "repres": 2, "functiondef": 2, "explan": 2, "test": 4, "write": 4, "packag": [5, 6], "index": 5, "modul": [5, 6], "search": 5, "page": 5, "subpackag": 6, "content": 6, "submodul": 6, "cli": 6, "constant": 6, "main": 6}, "objects": {"": [[0, 0, 0, "-", "codergpt"]], "codergpt": [[1, 0, 0, "-", "commenter"], [0, 0, 0, "-", "constants"], [2, 0, 0, "-", "explainer"], [0, 0, 0, "-", "main"], [3, 0, 0, "-", "optimizer"], [4, 0, 0, "-", "test_writer"]], "codergpt.explainer": [[2, 0, 0, "-", "explainer"]], "codergpt.explainer.explainer": [[2, 1, 1, "", "CodeExplainer"], [2, 1, 1, "", "ExpressionEvaluator"]], "codergpt.explainer.explainer.CodeExplainer": [[2, 2, 1, "", "explain"], [2, 2, 1, "", "get_function_code"]], "codergpt.explainer.explainer.ExpressionEvaluator": [[2, 2, 1, "", "visit_ClassDef"], [2, 2, 1, "", "visit_FunctionDef"]], "codergpt.main": [[0, 1, 1, "", "CoderGPT"]], "codergpt.main.CoderGPT": [[0, 2, 1, "", "explainer"], [0, 2, 1, "", "inspect_package"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:method"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "method", "Python method"]}, "titleterms": {"codergpt": [0, 1, 2, 3, 4, 5, 6], "packag": [0, 1, 2, 3, 4], "subpackag": 0, "submodul": [0, 2], "cli": 0, "modul": [0, 1, 2, 3, 4], "constant": 0, "main": 0, "content": [0, 1, 2, 3, 4, 5], "comment": 1, "explain": 2, "optim": 3, "test_writ": 4, "welcom": 5, "": 5, "document": 5, "indic": 5, "tabl": 5}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 60}, "alltitles": {"codergpt package": [[0, "codergpt-package"]], "Subpackages": [[0, "subpackages"]], "Submodules": [[0, "submodules"], [2, "submodules"]], "codergpt.cli module": [[0, "codergpt-cli-module"]], "codergpt.constants module": [[0, "module-codergpt.constants"]], "codergpt.main module": [[0, "module-codergpt.main"]], "Module contents": [[0, "module-codergpt"], [1, "module-codergpt.commenter"], [2, "module-codergpt.explainer"], [3, "module-codergpt.optimizer"], [4, "module-codergpt.test_writer"]], "codergpt.commenter package": [[1, "codergpt-commenter-package"]], "codergpt.explainer package": [[2, "codergpt-explainer-package"]], "codergpt.explainer.explainer module": [[2, "module-codergpt.explainer.explainer"]], "codergpt.optimizer package": [[3, "codergpt-optimizer-package"]], "codergpt.test_writer package": [[4, "codergpt-test-writer-package"]], "Welcome to CoderGPT\u2019s documentation!": [[5, "welcome-to-codergpt-s-documentation"]], "Contents:": [[5, null]], "Indices and tables": [[5, "indices-and-tables"]], "codergpt": [[6, "codergpt"]]}, "indexentries": {"codergpt (class in codergpt.main)": [[0, "codergpt.main.CoderGPT"]], "codergpt": [[0, "module-codergpt"]], "codergpt.constants": [[0, "module-codergpt.constants"]], "codergpt.main": [[0, "module-codergpt.main"]], "explainer() (codergpt.main.codergpt method)": [[0, "codergpt.main.CoderGPT.explainer"]], "inspect_package() (codergpt.main.codergpt method)": [[0, "codergpt.main.CoderGPT.inspect_package"]], "module": [[0, "module-codergpt"], [0, "module-codergpt.constants"], [0, "module-codergpt.main"], [1, "module-codergpt.commenter"], [2, "module-codergpt.explainer"], [2, "module-codergpt.explainer.explainer"], [3, "module-codergpt.optimizer"], [4, "module-codergpt.test_writer"]], "codergpt.commenter": [[1, "module-codergpt.commenter"]], "codeexplainer (class in codergpt.explainer.explainer)": [[2, "codergpt.explainer.explainer.CodeExplainer"]], "expressionevaluator (class in codergpt.explainer.explainer)": [[2, "codergpt.explainer.explainer.ExpressionEvaluator"]], "codergpt.explainer": [[2, "module-codergpt.explainer"]], "codergpt.explainer.explainer": [[2, "module-codergpt.explainer.explainer"]], "explain() (codergpt.explainer.explainer.codeexplainer method)": [[2, "codergpt.explainer.explainer.CodeExplainer.explain"]], "get_function_code() (codergpt.explainer.explainer.codeexplainer method)": [[2, "codergpt.explainer.explainer.CodeExplainer.get_function_code"]], "visit_classdef() (codergpt.explainer.explainer.expressionevaluator method)": [[2, "codergpt.explainer.explainer.ExpressionEvaluator.visit_ClassDef"]], "visit_functiondef() (codergpt.explainer.explainer.expressionevaluator method)": [[2, "codergpt.explainer.explainer.ExpressionEvaluator.visit_FunctionDef"]], "codergpt.optimizer": [[3, "module-codergpt.optimizer"]], "codergpt.test_writer": [[4, "module-codergpt.test_writer"]]}}) \ No newline at end of file +Search.setIndex({"docnames": ["codergpt", "codergpt.commenter", "codergpt.explainer", "codergpt.optimizer", "codergpt.test_writer", "index", "modules"], "filenames": ["codergpt.rst", "codergpt.commenter.rst", "codergpt.explainer.rst", "codergpt.optimizer.rst", "codergpt.test_writer.rst", "index.rst", "modules.rst"], "titles": ["codergpt package", "codergpt.commenter package", "codergpt.explainer package", "codergpt.optimizer package", "codergpt.test_writer package", "Welcome to CoderGPT\u2019s documentation!", "codergpt"], "terms": {"comment": [0, 6], "explain": [0, 6], "codeexplain": [0, 2], "get_function_cod": [0, 2], "optim": [0, 6], "test_writ": [0, 6], "all": 0, "us": 0, "python": 0, "file": [0, 2], "class": [0, 2], "base": [0, 2], "object": [0, 2], "path": [0, 2], "function": [0, 2], "none": [0, 2], "classnam": [0, 2], "code": [0, 2, 3], "inspect_packag": [0, 6], "inspect": 0, "displai": 0, "map": 0, "languag": 0, "tabl": 0, "chain": 2, "extract": 2, "from": 2, "given": 2, "invok": 2, "runnabl": 2, "paramet": 2, "union": 2, "str": 2, "The": 2, "option": 2, "name": 2, "default": 2, "i": 2, "filenam": 2, "function_nam": 2, "class_nam": 2, "return": 2, "sourc": 2, "specifi": 2, "contain": 2, "type": 2, "found": 2, "explan": 2, "test": 4, "write": 4, "packag": [5, 6], "index": 5, "modul": [5, 6], "search": 5, "page": 5, "subpackag": 6, "content": 6, "submodul": 6, "cli": 6, "constant": 6, "main": 6}, "objects": {"": [[0, 0, 0, "-", "codergpt"]], "codergpt": [[1, 0, 0, "-", "commenter"], [0, 0, 0, "-", "constants"], [2, 0, 0, "-", "explainer"], [0, 0, 0, "-", "main"], [3, 0, 0, "-", "optimizer"], [4, 0, 0, "-", "test_writer"]], "codergpt.explainer": [[2, 1, 1, "", "CodeExplainer"], [2, 0, 0, "-", "explainer"]], "codergpt.explainer.CodeExplainer": [[2, 2, 1, "", "explain"], [2, 2, 1, "", "get_function_code"]], "codergpt.explainer.explainer": [[2, 1, 1, "", "CodeExplainer"]], "codergpt.explainer.explainer.CodeExplainer": [[2, 2, 1, "", "explain"], [2, 2, 1, "", "get_function_code"]], "codergpt.main": [[0, 1, 1, "", "CoderGPT"]], "codergpt.main.CoderGPT": [[0, 2, 1, "", "explainer"], [0, 2, 1, "", "inspect_package"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:method"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "method", "Python method"]}, "titleterms": {"codergpt": [0, 1, 2, 3, 4, 5, 6], "packag": [0, 1, 2, 3, 4], "subpackag": 0, "submodul": [0, 2], "cli": 0, "modul": [0, 1, 2, 3, 4], "constant": 0, "main": 0, "content": [0, 1, 2, 3, 4, 5], "comment": 1, "explain": 2, "optim": 3, "test_writ": 4, "welcom": 5, "": 5, "document": 5, "indic": 5, "tabl": 5}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 60}, "alltitles": {"codergpt package": [[0, "codergpt-package"]], "Subpackages": [[0, "subpackages"]], "Submodules": [[0, "submodules"], [2, "submodules"]], "codergpt.cli module": [[0, "codergpt-cli-module"]], "codergpt.constants module": [[0, "module-codergpt.constants"]], "codergpt.main module": [[0, "module-codergpt.main"]], "Module contents": [[0, "module-codergpt"], [1, "module-codergpt.commenter"], [2, "module-codergpt.explainer"], [3, "module-codergpt.optimizer"], [4, "module-codergpt.test_writer"]], "codergpt.commenter package": [[1, "codergpt-commenter-package"]], "codergpt.explainer package": [[2, "codergpt-explainer-package"]], "codergpt.explainer.explainer module": [[2, "module-codergpt.explainer.explainer"]], "codergpt.optimizer package": [[3, "codergpt-optimizer-package"]], "codergpt.test_writer package": [[4, "codergpt-test-writer-package"]], "Welcome to CoderGPT\u2019s documentation!": [[5, "welcome-to-codergpt-s-documentation"]], "Contents:": [[5, null]], "Indices and tables": [[5, "indices-and-tables"]], "codergpt": [[6, "codergpt"]]}, "indexentries": {"codergpt (class in codergpt.main)": [[0, "codergpt.main.CoderGPT"]], "codergpt": [[0, "module-codergpt"]], "codergpt.constants": [[0, "module-codergpt.constants"]], "codergpt.main": [[0, "module-codergpt.main"]], "explainer() (codergpt.main.codergpt method)": [[0, "codergpt.main.CoderGPT.explainer"]], "inspect_package() (codergpt.main.codergpt method)": [[0, "codergpt.main.CoderGPT.inspect_package"]], "module": [[0, "module-codergpt"], [0, "module-codergpt.constants"], [0, "module-codergpt.main"], [1, "module-codergpt.commenter"], [2, "module-codergpt.explainer"], [2, "module-codergpt.explainer.explainer"], [3, "module-codergpt.optimizer"], [4, "module-codergpt.test_writer"]], "codergpt.commenter": [[1, "module-codergpt.commenter"]], "codeexplainer (class in codergpt.explainer)": [[2, "codergpt.explainer.CodeExplainer"]], "codeexplainer (class in codergpt.explainer.explainer)": [[2, "codergpt.explainer.explainer.CodeExplainer"]], "codergpt.explainer": [[2, "module-codergpt.explainer"]], "codergpt.explainer.explainer": [[2, "module-codergpt.explainer.explainer"]], "explain() (codergpt.explainer.codeexplainer method)": [[2, "codergpt.explainer.CodeExplainer.explain"]], "explain() (codergpt.explainer.explainer.codeexplainer method)": [[2, "codergpt.explainer.explainer.CodeExplainer.explain"]], "get_function_code() (codergpt.explainer.codeexplainer method)": [[2, "codergpt.explainer.CodeExplainer.get_function_code"]], "get_function_code() (codergpt.explainer.explainer.codeexplainer method)": [[2, "codergpt.explainer.explainer.CodeExplainer.get_function_code"]], "codergpt.optimizer": [[3, "module-codergpt.optimizer"]], "codergpt.test_writer": [[4, "module-codergpt.test_writer"]]}}) \ No newline at end of file