juneja-codebase 0.1.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- juneja_codebase/__init__.py +6 -0
- juneja_codebase/main.py +197 -0
- juneja_codebase/templates/compiler_design/AnshJuneja_Practical10_CD.l +15 -0
- juneja_codebase/templates/compiler_design/AnshJuneja_Practical10_CD.y +27 -0
- juneja_codebase/templates/compiler_design/AnshJuneja_Practical11_CD.l +15 -0
- juneja_codebase/templates/compiler_design/AnshJuneja_Practical11_CD.y +36 -0
- juneja_codebase/templates/compiler_design/AnshJuneja_Practical12_CD.l +14 -0
- juneja_codebase/templates/compiler_design/AnshJuneja_Practical12_CD.y +31 -0
- juneja_codebase/templates/compiler_design/AnshJuneja_Practical13_CD.l +14 -0
- juneja_codebase/templates/compiler_design/AnshJuneja_Practical13_CD.y +38 -0
- juneja_codebase/templates/compiler_design/AnshJuneja_Practical1_CD.l +38 -0
- juneja_codebase/templates/compiler_design/AnshJuneja_Practical2_CD.l +27 -0
- juneja_codebase/templates/compiler_design/AnshJuneja_Practical3_CD.l +39 -0
- juneja_codebase/templates/compiler_design/AnshJuneja_Practical4_CD.l +32 -0
- juneja_codebase/templates/compiler_design/AnshJuneja_Practical5_CD.l +51 -0
- juneja_codebase/templates/compiler_design/AnshJuneja_Practical6_CD.l +46 -0
- juneja_codebase/templates/compiler_design/AnshJuneja_Practical7_CD.l +36 -0
- juneja_codebase/templates/compiler_design/AnshJuneja_Practical8_CD.l +33 -0
- juneja_codebase/templates/compiler_design/AnshJuneja_Practical9_CD.l +19 -0
- juneja_codebase/templates/compiler_design/AnshJuneja_Practical9_CD.y +36 -0
- juneja_codebase/templates/social_network_analysis/1_try.ipynb +286 -0
- juneja_codebase/templates/social_network_analysis/2_try.ipynb +352 -0
- juneja_codebase/templates/social_network_analysis/3_try.ipynb +207 -0
- juneja_codebase/templates/social_network_analysis/4_try.ipynb +1218 -0
- juneja_codebase/templates/social_network_analysis/5_try.ipynb +326 -0
- juneja_codebase/templates/social_network_analysis/6_try.ipynb +241 -0
- juneja_codebase/templates/social_network_analysis/new.ipynb +592 -0
- juneja_codebase-0.1.3.dist-info/LICENSE +21 -0
- juneja_codebase-0.1.3.dist-info/METADATA +75 -0
- juneja_codebase-0.1.3.dist-info/RECORD +33 -0
- juneja_codebase-0.1.3.dist-info/WHEEL +5 -0
- juneja_codebase-0.1.3.dist-info/entry_points.txt +3 -0
- juneja_codebase-0.1.3.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cells": [
|
|
3
|
+
{
|
|
4
|
+
"cell_type": "code",
|
|
5
|
+
"execution_count": 5,
|
|
6
|
+
"id": "749b4c68",
|
|
7
|
+
"metadata": {},
|
|
8
|
+
"outputs": [
|
|
9
|
+
{
|
|
10
|
+
"name": "stdout",
|
|
11
|
+
"output_type": "stream",
|
|
12
|
+
"text": [
|
|
13
|
+
"Defaulting to user installation because normal site-packages is not writeable\n",
|
|
14
|
+
"Requirement already satisfied: ndlib in /home/aj/.local/lib/python3.10/site-packages (5.1.1)\n",
|
|
15
|
+
"Requirement already satisfied: bokeh in /home/aj/.local/lib/python3.10/site-packages (from ndlib) (3.8.1)\n",
|
|
16
|
+
"Requirement already satisfied: dynetx in /home/aj/.local/lib/python3.10/site-packages (from ndlib) (0.3.2)\n",
|
|
17
|
+
"Requirement already satisfied: python-igraph in /home/aj/.local/lib/python3.10/site-packages (from ndlib) (1.0.0)\n",
|
|
18
|
+
"Requirement already satisfied: numpy in /home/aj/.local/lib/python3.10/site-packages (from ndlib) (2.2.6)\n",
|
|
19
|
+
"Requirement already satisfied: scipy in /home/aj/.local/lib/python3.10/site-packages (from ndlib) (1.15.3)\n",
|
|
20
|
+
"Requirement already satisfied: networkx in /home/aj/.local/lib/python3.10/site-packages (from ndlib) (3.4.2)\n",
|
|
21
|
+
"Requirement already satisfied: future in /usr/lib/python3/dist-packages (from ndlib) (0.18.2)\n",
|
|
22
|
+
"Requirement already satisfied: netdispatch in /home/aj/.local/lib/python3.10/site-packages (from ndlib) (0.1.0)\n",
|
|
23
|
+
"Requirement already satisfied: narwhals>=1.13 in /home/aj/.local/lib/python3.10/site-packages (from bokeh->ndlib) (2.13.0)\n",
|
|
24
|
+
"Requirement already satisfied: contourpy>=1.2 in /home/aj/.local/lib/python3.10/site-packages (from bokeh->ndlib) (1.3.2)\n",
|
|
25
|
+
"Requirement already satisfied: packaging>=16.8 in /home/aj/.local/lib/python3.10/site-packages (from bokeh->ndlib) (25.0)\n",
|
|
26
|
+
"Requirement already satisfied: tornado>=6.2 in /home/aj/.local/lib/python3.10/site-packages (from bokeh->ndlib) (6.5.2)\n",
|
|
27
|
+
"Requirement already satisfied: pillow>=7.1.0 in /usr/lib/python3/dist-packages (from bokeh->ndlib) (9.0.1)\n",
|
|
28
|
+
"Requirement already satisfied: pandas>=1.2 in /home/aj/.local/lib/python3.10/site-packages (from bokeh->ndlib) (2.3.3)\n",
|
|
29
|
+
"Requirement already satisfied: PyYAML>=3.10 in /usr/lib/python3/dist-packages (from bokeh->ndlib) (5.4.1)\n",
|
|
30
|
+
"Requirement already satisfied: xyzservices>=2021.09.1 in /home/aj/.local/lib/python3.10/site-packages (from bokeh->ndlib) (2025.11.0)\n",
|
|
31
|
+
"Requirement already satisfied: Jinja2>=2.9 in /home/aj/.local/lib/python3.10/site-packages (from bokeh->ndlib) (3.1.6)\n",
|
|
32
|
+
"Requirement already satisfied: decorator in /home/aj/.local/lib/python3.10/site-packages (from dynetx->ndlib) (5.2.1)\n",
|
|
33
|
+
"Requirement already satisfied: tqdm in /home/aj/.local/lib/python3.10/site-packages (from dynetx->ndlib) (4.67.1)\n",
|
|
34
|
+
"Requirement already satisfied: igraph==1.0.0 in /home/aj/.local/lib/python3.10/site-packages (from python-igraph->ndlib) (1.0.0)\n",
|
|
35
|
+
"Requirement already satisfied: texttable>=1.6.2 in /home/aj/.local/lib/python3.10/site-packages (from igraph==1.0.0->python-igraph->ndlib) (1.7.0)\n",
|
|
36
|
+
"Requirement already satisfied: MarkupSafe>=2.0 in /home/aj/.local/lib/python3.10/site-packages (from Jinja2>=2.9->bokeh->ndlib) (3.0.2)\n",
|
|
37
|
+
"Requirement already satisfied: pytz>=2020.1 in /usr/lib/python3/dist-packages (from pandas>=1.2->bokeh->ndlib) (2022.1)\n",
|
|
38
|
+
"Requirement already satisfied: tzdata>=2022.7 in /home/aj/.local/lib/python3.10/site-packages (from pandas>=1.2->bokeh->ndlib) (2025.2)\n",
|
|
39
|
+
"Requirement already satisfied: python-dateutil>=2.8.2 in /home/aj/.local/lib/python3.10/site-packages (from pandas>=1.2->bokeh->ndlib) (2.9.0.post0)\n",
|
|
40
|
+
"Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil>=2.8.2->pandas>=1.2->bokeh->ndlib) (1.16.0)\n"
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"source": [
|
|
45
|
+
"!pip install ndlib"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"cell_type": "code",
|
|
50
|
+
"execution_count": 6,
|
|
51
|
+
"id": "0948ceb4",
|
|
52
|
+
"metadata": {},
|
|
53
|
+
"outputs": [],
|
|
54
|
+
"source": [
|
|
55
|
+
"import random\n",
|
|
56
|
+
"import networkx as nx\n",
|
|
57
|
+
"import ndlib.models.ModelConfig as mc\n",
|
|
58
|
+
"import ndlib.models.epidemics as ec\n",
|
|
59
|
+
"from ndlib.viz.mpl.DiffusionTrend import DiffusionTrend\n",
|
|
60
|
+
"import matplotlib.pyplot as plt"
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"cell_type": "code",
|
|
65
|
+
"execution_count": 7,
|
|
66
|
+
"id": "e1e99f19",
|
|
67
|
+
"metadata": {},
|
|
68
|
+
"outputs": [],
|
|
69
|
+
"source": [
|
|
70
|
+
"G = nx.erdos_renyi_graph(1000 , 0.1)"
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"cell_type": "code",
|
|
75
|
+
"execution_count": 8,
|
|
76
|
+
"id": "d9eb1522",
|
|
77
|
+
"metadata": {},
|
|
78
|
+
"outputs": [
|
|
79
|
+
{
|
|
80
|
+
"name": "stderr",
|
|
81
|
+
"output_type": "stream",
|
|
82
|
+
"text": [
|
|
83
|
+
"/home/aj/.local/lib/python3.10/site-packages/ndlib/models/DiffusionModel.py:120: UserWarning: Initial infection missing: a random sample of 5% of graph nodes will be set as infected\n",
|
|
84
|
+
" warnings.warn('Initial infection missing: a random sample of 5% of graph nodes will be set as infected')\n"
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"data": {
|
|
89
|
+
"text/plain": [
|
|
90
|
+
"<Figure size 2000x1000 with 0 Axes>"
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
"metadata": {},
|
|
94
|
+
"output_type": "display_data"
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"source": [
|
|
98
|
+
"model = ec.SIRModel(G)\n",
|
|
99
|
+
"config = mc.Configuration()\n",
|
|
100
|
+
"config.add_model_parameter(\"beta\" , 0.03)\n",
|
|
101
|
+
"config.add_model_parameter(\"gamma\" , 0.05)\n",
|
|
102
|
+
"config.add_model_parameter(\"Percentage Infected\" , 0.25)\n",
|
|
103
|
+
"\n",
|
|
104
|
+
"model.set_initial_status(config)\n",
|
|
105
|
+
"\n",
|
|
106
|
+
"iterations = model.iteration_bunch(500)\n",
|
|
107
|
+
"trends = model.build_trends(iterations)\n",
|
|
108
|
+
"\n",
|
|
109
|
+
"viz_sir = DiffusionTrend(model, trends)\n",
|
|
110
|
+
"viz_sir.plot(filename=\"AnshNewLatestTrial_SIRMODEL.png\")"
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"cell_type": "code",
|
|
115
|
+
"execution_count": 11,
|
|
116
|
+
"id": "571258e7",
|
|
117
|
+
"metadata": {},
|
|
118
|
+
"outputs": [
|
|
119
|
+
{
|
|
120
|
+
"data": {
|
|
121
|
+
"text/plain": [
|
|
122
|
+
"<Figure size 2000x1000 with 0 Axes>"
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
"metadata": {},
|
|
126
|
+
"output_type": "display_data"
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
"source": [
|
|
130
|
+
"model = ec.SISModel(G)\n",
|
|
131
|
+
"config = mc.Configuration()\n",
|
|
132
|
+
"config.add_model_parameter(\"beta\" , 0.01)\n",
|
|
133
|
+
"config.add_model_parameter(\"lambda\" , 0.03)\n",
|
|
134
|
+
"config.add_model_parameter(\"Percentage Infected\" , 0.25)\n",
|
|
135
|
+
"\n",
|
|
136
|
+
"model.set_initial_status(config)\n",
|
|
137
|
+
"\n",
|
|
138
|
+
"iterations = model.iteration_bunch(200)\n",
|
|
139
|
+
"trends = model.build_trends(iterations)\n",
|
|
140
|
+
"\n",
|
|
141
|
+
"viz_sis = DiffusionTrend(model , trends)\n",
|
|
142
|
+
"viz_sis.plot(filename=\"AnshNewLatestTrial_SISMODEL.png\")"
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"cell_type": "code",
|
|
147
|
+
"execution_count": 10,
|
|
148
|
+
"id": "ee7c524e",
|
|
149
|
+
"metadata": {},
|
|
150
|
+
"outputs": [
|
|
151
|
+
{
|
|
152
|
+
"data": {
|
|
153
|
+
"text/plain": [
|
|
154
|
+
"<Figure size 2000x1000 with 0 Axes>"
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
"metadata": {},
|
|
158
|
+
"output_type": "display_data"
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
"source": [
|
|
162
|
+
"model = ec.SEIRModel(G)\n",
|
|
163
|
+
"\n",
|
|
164
|
+
"config = mc.Configuration()\n",
|
|
165
|
+
"config.add_model_parameter(\"beta\" , 0.04)\n",
|
|
166
|
+
"config.add_model_parameter(\"alpha\" , 0.02)\n",
|
|
167
|
+
"config.add_model_parameter(\"gamma\" , 0.03)\n",
|
|
168
|
+
"config.add_model_parameter(\"Percentage Infected\" , 0.25)\n",
|
|
169
|
+
"\n",
|
|
170
|
+
"model.set_initial_status(config)\n",
|
|
171
|
+
"\n",
|
|
172
|
+
"iterations = model.iteration_bunch(200)\n",
|
|
173
|
+
"trends = model.build_trends(iterations)\n",
|
|
174
|
+
"\n",
|
|
175
|
+
"viz_seir = DiffusionTrend(model , trends)\n",
|
|
176
|
+
"viz_seir.plot(filename=\"AnshNewLatestTrial_SEIRMODEL.png\")"
|
|
177
|
+
]
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"cell_type": "code",
|
|
181
|
+
"execution_count": 13,
|
|
182
|
+
"id": "85833fdc",
|
|
183
|
+
"metadata": {},
|
|
184
|
+
"outputs": [
|
|
185
|
+
{
|
|
186
|
+
"data": {
|
|
187
|
+
"text/plain": [
|
|
188
|
+
"<Figure size 2000x1000 with 0 Axes>"
|
|
189
|
+
]
|
|
190
|
+
},
|
|
191
|
+
"metadata": {},
|
|
192
|
+
"output_type": "display_data"
|
|
193
|
+
}
|
|
194
|
+
],
|
|
195
|
+
"source": [
|
|
196
|
+
"model_ic = ec.IndependentCascadesModel(G)\n",
|
|
197
|
+
"\n",
|
|
198
|
+
"cfg_ic = mc.Configuration()\n",
|
|
199
|
+
"cfg_ic.add_model_initial_configuration(\"Infected\", list(range(10)))\n",
|
|
200
|
+
"cfg_ic.add_model_parameter(\"threshold\", 0.5)\n",
|
|
201
|
+
"cfg_ic.add_model_parameter(\"fraction_infected\", 0.05)\n",
|
|
202
|
+
"model_ic.set_initial_status(cfg_ic)\n",
|
|
203
|
+
"\n",
|
|
204
|
+
"its_ic = model_ic.iteration_bunch(200)\n",
|
|
205
|
+
"tr_ic = model_ic.build_trends(its_ic)\n",
|
|
206
|
+
"\n",
|
|
207
|
+
"viz_ic = DiffusionTrend(model_ic, tr_ic)\n",
|
|
208
|
+
"viz_ic.plot(filename=\"ansh_ic_diffusion_trend.png\")\n"
|
|
209
|
+
]
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"cell_type": "code",
|
|
213
|
+
"execution_count": null,
|
|
214
|
+
"id": "eb4b3c91",
|
|
215
|
+
"metadata": {},
|
|
216
|
+
"outputs": [],
|
|
217
|
+
"source": []
|
|
218
|
+
}
|
|
219
|
+
],
|
|
220
|
+
"metadata": {
|
|
221
|
+
"kernelspec": {
|
|
222
|
+
"display_name": "Python 3",
|
|
223
|
+
"language": "python",
|
|
224
|
+
"name": "python3"
|
|
225
|
+
},
|
|
226
|
+
"language_info": {
|
|
227
|
+
"codemirror_mode": {
|
|
228
|
+
"name": "ipython",
|
|
229
|
+
"version": 3
|
|
230
|
+
},
|
|
231
|
+
"file_extension": ".py",
|
|
232
|
+
"mimetype": "text/x-python",
|
|
233
|
+
"name": "python",
|
|
234
|
+
"nbconvert_exporter": "python",
|
|
235
|
+
"pygments_lexer": "ipython3",
|
|
236
|
+
"version": "3.10.12"
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
"nbformat": 4,
|
|
240
|
+
"nbformat_minor": 5
|
|
241
|
+
}
|