-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparsed_code.json
126 lines (126 loc) · 5.65 KB
/
parsed_code.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
{
"file_description": {
"summary": "This file contains:",
"components": [
"A Calculator class for A Calculator class with properties implementing __init__, version, add",
"A global variable API_VERSION",
"A global variable DEBUG_MODE",
"A function __init__ that \n The function `__init__` is a constructor method in Python that initializes an instance of a class. It takes an optional parameter `precision` which specifies the number of decimal places to round the result to. The default value of `precision` is 2, meaning the result will be rounded to two decimal places.",
"A function version that \"Version: 1.0\"",
"A function add that \"Returns the sum of two numbers, rounded to the specified precision.\"\n \nThis function takes two parameters, `a` and `b`, and returns the sum of these two numbers. It also allows for an optional second parameter `b` to be passed in, which defaults to 0.0. The function then rounds the result to the specified precision.",
"A global variable results",
"A global variable result",
"A global variable chunk"
]
},
"classes": [
{
"name": "Calculator",
"responsibility": "A Calculator class with properties implementing __init__, version, add",
"docstring": "A simple calculator class.",
"methods": [
{
"name": "__init__",
"purpose": "\n The function `__init__` is a constructor method in Python that initializes an instance of a class. It takes an optional parameter `precision` which specifies the number of decimal places to round the result to. The default value of `precision` is 2, meaning the result will be rounded to two decimal places.",
"signature": "__init__(self, precision: int)",
"docstring": "Initialize calculator with given precision.",
"body": " \"\"\"Initialize calculator with given precision.\"\"\"\n self.precision = precision",
"decorators": "",
"return_type": "None",
"is_method": true,
"class_name": "Calculator"
},
{
"name": "version",
"purpose": "\"Version: 1.0\"",
"signature": "version(self)",
"docstring": "Get calculator version.",
"body": " \"\"\"Get calculator version.\"\"\"\n return \"1.0\"",
"decorators": "@property",
"return_type": "str",
"is_method": true,
"class_name": "Calculator"
},
{
"name": "add",
"purpose": "\"Returns the sum of two numbers, rounded to the specified precision.\"\n \nThis function takes two parameters, `a` and `b`, and returns the sum of these two numbers. It also allows for an optional second parameter `b` to be passed in, which defaults to 0.0. The function then rounds the result to the specified precision.",
"signature": "add(self, a: float, b: float)",
"docstring": "Add two numbers.",
"body": " \"\"\"Add two numbers.\"\"\"\n result = a + b\n return round(result, self.precision)",
"decorators": "",
"return_type": "float",
"is_method": true,
"class_name": "Calculator"
}
],
"inheritance": "",
"decorators": "@dataclass"
}
],
"functions": [
{
"name": "__init__",
"purpose": "\n The function `__init__` is a constructor method in Python that initializes an instance of a class. It takes an optional parameter `precision` which specifies the number of decimal places to round the result to. The default value of `precision` is 2, meaning the result will be rounded to two decimal places.",
"signature": "__init__(self, precision: int)",
"docstring": "Initialize calculator with given precision.",
"body": " \"\"\"Initialize calculator with given precision.\"\"\"\n self.precision = precision",
"decorators": "",
"return_type": "None",
"is_method": false,
"class_name": null
},
{
"name": "version",
"purpose": "\"Version: 1.0\"",
"signature": "version(self)",
"docstring": "Get calculator version.",
"body": " \"\"\"Get calculator version.\"\"\"\n return \"1.0\"",
"decorators": "@property",
"return_type": "str",
"is_method": false,
"class_name": null
},
{
"name": "add",
"purpose": "\"Returns the sum of two numbers, rounded to the specified precision.\"\n \nThis function takes two parameters, `a` and `b`, and returns the sum of these two numbers. It also allows for an optional second parameter `b` to be passed in, which defaults to 0.0. The function then rounds the result to the specified precision.",
"signature": "add(self, a: float, b: float)",
"docstring": "Add two numbers.",
"body": " \"\"\"Add two numbers.\"\"\"\n result = a + b\n return round(result, self.precision)",
"decorators": "",
"return_type": "float",
"is_method": false,
"class_name": null
}
],
"variables": [
{
"name": "API_VERSION",
"value": "'1.0'",
"purpose": "Global API_VERSION set to '1.0'"
},
{
"name": "DEBUG_MODE",
"value": "True",
"purpose": "Global DEBUG_MODE set to True"
},
{
"name": "results",
"value": "[]",
"purpose": "Global results set to []"
},
{
"name": "result",
"value": "a + b",
"purpose": "Global result set to a + b"
},
{
"name": "chunk",
"value": "items[i:i + chunk_size]",
"purpose": "Global chunk set to items[i:i + chunk_size]"
}
],
"relationships": [
"Class Calculator contains methods: __init__, version, add",
"Function add uses global variables: result"
]
}