Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .gitattributes +31 -0
- README.md +3 -9
- __pycache__/gradio_app.cpython-311.pyc +0 -0
- gradio_app.py +110 -0
- requirements.txt +56 -0
- streamlit_app.py +121 -0
- venv/bin/Activate.ps1 +247 -0
- venv/bin/activate +69 -0
- venv/bin/activate.csh +26 -0
- venv/bin/activate.fish +69 -0
- venv/bin/distro +8 -0
- venv/bin/f2py +8 -0
- venv/bin/httpx +8 -0
- venv/bin/jsonschema +8 -0
- venv/bin/markdown-it +8 -0
- venv/bin/normalizer +8 -0
- venv/bin/openai +8 -0
- venv/bin/pip +8 -0
- venv/bin/pip3 +8 -0
- venv/bin/pip3.11 +8 -0
- venv/bin/pygmentize +8 -0
- venv/bin/python +3 -0
- venv/bin/python3 +3 -0
- venv/bin/python3.11 +3 -0
- venv/bin/streamlit +8 -0
- venv/bin/streamlit.cmd +16 -0
- venv/bin/tqdm +8 -0
- venv/bin/watchmedo +8 -0
- venv/etc/jupyter/nbconfig/notebook.d/pydeck.json +5 -0
- venv/lib/python3.11/site-packages/GitPython-3.1.41.dist-info/AUTHORS +57 -0
- venv/lib/python3.11/site-packages/GitPython-3.1.41.dist-info/INSTALLER +1 -0
- venv/lib/python3.11/site-packages/GitPython-3.1.41.dist-info/LICENSE +29 -0
- venv/lib/python3.11/site-packages/GitPython-3.1.41.dist-info/METADATA +340 -0
- venv/lib/python3.11/site-packages/GitPython-3.1.41.dist-info/RECORD +82 -0
- venv/lib/python3.11/site-packages/GitPython-3.1.41.dist-info/WHEEL +5 -0
- venv/lib/python3.11/site-packages/GitPython-3.1.41.dist-info/top_level.txt +1 -0
- venv/lib/python3.11/site-packages/Jinja2-3.1.3.dist-info/INSTALLER +1 -0
- venv/lib/python3.11/site-packages/Jinja2-3.1.3.dist-info/LICENSE.rst +28 -0
- venv/lib/python3.11/site-packages/Jinja2-3.1.3.dist-info/METADATA +105 -0
- venv/lib/python3.11/site-packages/Jinja2-3.1.3.dist-info/RECORD +58 -0
- venv/lib/python3.11/site-packages/Jinja2-3.1.3.dist-info/WHEEL +5 -0
- venv/lib/python3.11/site-packages/Jinja2-3.1.3.dist-info/entry_points.txt +2 -0
- venv/lib/python3.11/site-packages/Jinja2-3.1.3.dist-info/top_level.txt +1 -0
- venv/lib/python3.11/site-packages/MarkupSafe-2.1.5.dist-info/INSTALLER +1 -0
- venv/lib/python3.11/site-packages/MarkupSafe-2.1.5.dist-info/LICENSE.rst +28 -0
- venv/lib/python3.11/site-packages/MarkupSafe-2.1.5.dist-info/METADATA +93 -0
- venv/lib/python3.11/site-packages/MarkupSafe-2.1.5.dist-info/RECORD +14 -0
- venv/lib/python3.11/site-packages/MarkupSafe-2.1.5.dist-info/WHEEL +6 -0
- venv/lib/python3.11/site-packages/MarkupSafe-2.1.5.dist-info/top_level.txt +1 -0
- venv/lib/python3.11/site-packages/PIL/BdfFontFile.py +133 -0
.gitattributes
CHANGED
@@ -33,3 +33,34 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
venv/bin/python filter=lfs diff=lfs merge=lfs -text
|
37 |
+
venv/bin/python3 filter=lfs diff=lfs merge=lfs -text
|
38 |
+
venv/bin/python3.11 filter=lfs diff=lfs merge=lfs -text
|
39 |
+
venv/lib/python3.11/site-packages/PIL/_imaging.cpython-311-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
40 |
+
venv/lib/python3.11/site-packages/altair/vegalite/v5/schema/__pycache__/channels.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
|
41 |
+
venv/lib/python3.11/site-packages/altair/vegalite/v5/schema/__pycache__/core.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
|
42 |
+
venv/lib/python3.11/site-packages/numpy/core/_multiarray_umath.cpython-311-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
43 |
+
venv/lib/python3.11/site-packages/numpy/core/_simd.cpython-311-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
44 |
+
venv/lib/python3.11/site-packages/numpy.libs/libgfortran-040039e1.so.5.0.0 filter=lfs diff=lfs merge=lfs -text
|
45 |
+
venv/lib/python3.11/site-packages/numpy.libs/libopenblas64_p-r0-0cf96a72.3.23.dev.so filter=lfs diff=lfs merge=lfs -text
|
46 |
+
venv/lib/python3.11/site-packages/pandas/_libs/algos.cpython-311-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
47 |
+
venv/lib/python3.11/site-packages/pandas/_libs/groupby.cpython-311-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
48 |
+
venv/lib/python3.11/site-packages/pandas/_libs/hashtable.cpython-311-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
49 |
+
venv/lib/python3.11/site-packages/pandas/_libs/interval.cpython-311-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
50 |
+
venv/lib/python3.11/site-packages/pandas/_libs/join.cpython-311-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
51 |
+
venv/lib/python3.11/site-packages/pandas/_libs/tslibs/offsets.cpython-311-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
52 |
+
venv/lib/python3.11/site-packages/pillow.libs/libfreetype-f154df84.so.6.20.1 filter=lfs diff=lfs merge=lfs -text
|
53 |
+
venv/lib/python3.11/site-packages/pillow.libs/libharfbuzz-2093a78b.so.0.60830.0 filter=lfs diff=lfs merge=lfs -text
|
54 |
+
venv/lib/python3.11/site-packages/pyarrow/_compute.cpython-311-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
55 |
+
venv/lib/python3.11/site-packages/pyarrow/_dataset.cpython-311-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
56 |
+
venv/lib/python3.11/site-packages/pyarrow/_flight.cpython-311-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
57 |
+
venv/lib/python3.11/site-packages/pyarrow/lib.cpython-311-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
58 |
+
venv/lib/python3.11/site-packages/pyarrow/libarrow.so.1500 filter=lfs diff=lfs merge=lfs -text
|
59 |
+
venv/lib/python3.11/site-packages/pyarrow/libarrow_acero.so.1500 filter=lfs diff=lfs merge=lfs -text
|
60 |
+
venv/lib/python3.11/site-packages/pyarrow/libarrow_dataset.so.1500 filter=lfs diff=lfs merge=lfs -text
|
61 |
+
venv/lib/python3.11/site-packages/pyarrow/libarrow_flight.so.1500 filter=lfs diff=lfs merge=lfs -text
|
62 |
+
venv/lib/python3.11/site-packages/pyarrow/libarrow_python.so filter=lfs diff=lfs merge=lfs -text
|
63 |
+
venv/lib/python3.11/site-packages/pyarrow/libarrow_substrait.so.1500 filter=lfs diff=lfs merge=lfs -text
|
64 |
+
venv/lib/python3.11/site-packages/pyarrow/libparquet.so.1500 filter=lfs diff=lfs merge=lfs -text
|
65 |
+
venv/lib/python3.11/site-packages/pydantic_core/_pydantic_core.cpython-311-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
66 |
+
venv/lib/python3.11/site-packages/rpds/rpds.cpython-311-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
@@ -1,12 +1,6 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
|
4 |
-
colorFrom: green
|
5 |
-
colorTo: blue
|
6 |
sdk: gradio
|
7 |
-
sdk_version:
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
---
|
11 |
-
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: Statute_Prediction
|
3 |
+
app_file: gradio_app.py
|
|
|
|
|
4 |
sdk: gradio
|
5 |
+
sdk_version: 3.46.0
|
|
|
|
|
6 |
---
|
|
|
|
__pycache__/gradio_app.cpython-311.pyc
ADDED
Binary file (10.7 kB). View file
|
|
gradio_app.py
ADDED
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
from openai import AzureOpenAI
|
3 |
+
import re
|
4 |
+
import gradio as gr
|
5 |
+
|
6 |
+
client = AzureOpenAI(
|
7 |
+
api_key="e5a86e5ac7ce453a8fae2dcbfaafbef7",
|
8 |
+
api_version="2023-07-01-preview",
|
9 |
+
azure_endpoint="https://votum.openai.azure.com/",
|
10 |
+
)
|
11 |
+
|
12 |
+
|
13 |
+
fact = '''In service Mr. In-charge Inspector Mr. City of Police Station Kotwali Mr. G Candidate Chetna Gupta alias Chanchal Gupta Advocate Resident of Flat No., 76/44 Halsey Road Kanpur Nagar and practicing law from a pucca chamber just in front of CMO office at Kachehri. On 2024, at around 8: 30 am, my chamber suddenly caught fire and at around 9: 00 am, I got a call informing me that my chamber was on fire. I reached the chamber immediately. By then, Manish, who was cleaning my chamber, was dousing the fire with water. All my chamber's luggage, files, AC, sofa wings, amalt glass walls, necessary documents, miscellaneous items, etc. have been destroyed. I am informing the concerned post. Please take appropriate action. Dated 29. 2024 Signature English unreadable Candidate Chetna Gupta alias Chanchal Gupta Md. 7376222267 Note I hereby certify that 674 Dhirendra Pratap Singh, permanent & tahrir copy of the complaint was literally typed by me on the computer 5057 Lalit Kumar. That I attest to.'''
|
14 |
+
|
15 |
+
prompt = """Task: Given examples of a Supreme Court case and the statutes applied in that case, your objective is to make accurate predictions of the specific charge or statute that is most likely to be applied within the context of the case delimited by triple backticks (```), ensuring exact predictions and learning from the provided examples.You should only include the statutes it is most confident about.The response format should include the statutes applied as in the context.
|
16 |
+
You should to showcase creativity and knowledge to enhance the accuracy of statute predictions based on the given fact statement.
|
17 |
+
|
18 |
+
Context:
|
19 |
+
|
20 |
+
Fact Statement:"In this one gets used to writing common orders, for orders are written either on behalf of the [PRODUCT], or on behalf of the [ORG].
|
21 |
+
While endorsing the opinion expressed by [PERSON],, adjudicating upon the prayer for my recusal, from hearing the matters in hand, reasons for my continuation on the [ORG], also need to be expressed by me.
|
22 |
+
It has been necessitated, for deciding an objection, about the present composition of the [PERSON].
|
23 |
+
As already noted above,, [ORG] has rendered the decision on the objection.
|
24 |
+
The events which followed the order of [PERSON],, are also of some significance.
|
25 |
+
In my considered view, they too need to be narrated, for only then, the entire matter can be considered to have been fully expressed, as it ought to be.
|
26 |
+
I also need to record reasons, why my continuation on the reconstituted [ORG], was the only course open to me.
|
27 |
+
And therefore, my side of its understanding, dealing with the perception, of the other side of the [PRODUCT].
|
28 |
+
Union of India [DATE] Indlaw SCO 185 Writ Petition C no.13 of, Mr. [PERSON], Senior Advocate, in [ORG] of [DATE], Mr. [PERSON], Advocate, in [ORG] Indlaw SC 29 Writ Petition C [DATE] and Mr. [PERSON], Advocate, in Change [GPE] v. [ORG] no.70 of [DATE], representing the petitioners were heard.iii The proceedings recorded by this [ORG] on 18.3.2015 reveal, that Mr. [PERSON], in Writ Petition C no.70 of [DATE] was heard again on, whereupon, Mr. [PERSON] and Mr., [ORG] [GPE], also made their submissions.
|
29 |
+
[CARDINAL]. Based on the order passed by the Judge [PERSON] on 7.4.2015, Honble the Chief Justice of [GPE], constituted a [CARDINAL] Judge [PERSON], comprising of,,, and, JJ.
|
30 |
+
[CARDINAL]. On 13.4.2015 the Constitution Ninety ninth Amendment Act, [DATE], and [ORG] Act, [DATE], were notified in the Gazette of India Extraordinary.Both the above enactments, were brought into force with effect from 13.4.2015.
|
31 |
+
[CARDINAL]. When the reconstituted [PERSON] commenced hearing on 21.4.2015, Mr. made a prayer for my recusal from the [PRODUCT], which was seconded by Mr. Mathews [PERSON] petitioner in- person in Writ Petition C no.124 of [DATE], the latter advanced submissions, even though he had been barred from doing so, by an earlier order dated 24.3.2015 extracted above.
|
32 |
+
The [ORDINAL] judgment was rendered, by a [CARDINAL] Judge [PERSON], by a majority of [CARDINAL], in the [ORDINAL] Judges case on [CARDINAL]. The correctness of the First Judges case was doubted by a Judge [PERSON] in of [GPE], [DATE] Supp 1 SCC 574 [ORG] [CARDINAL], which opined that the majority view, in the [ORG] case, should be considered by a larger.
|
33 |
+
The amendment, received the assent of the President on [DATE].It was however given effect to, with effect from 13.4.2015 consequent upon its notification in the Gazette of India Extraordinary Part II, [SECTION_UNK].
|
34 |
+
The same was also brought into force, with effect from 13.4.2015 by its notification in the Gazette of India Extraordinary Part II, [SECTION_UNK].
|
35 |
+
The Judges case- [DATE] [EVENT] 87 [DATE] [ORG] [CARDINAL].[DATE].The Union Law Minister addressed a letter dated 18.3.1981 to the Governor of [PRODUCT] and to Chief Ministers of all other [GPE].
|
36 |
+
The addressees were inter [PERSON], [CARDINAL] of [ORG], should as far as possible be from outside the in which is situated.
|
37 |
+
Through the above letter, the addressees were requested to.a obtain from all additional Judges working in the High Courts.their consent to be appointed as permanent Judges in any other in the country.
|
38 |
+
The above noted letter required, that the concerned appointees.be required to name [CARDINAL] High Courts, in order of preference, to which they would prefer to be appointed as permanent Judges and b obtain from persons who have already been or may in the future be proposed by you for initial appointment their consent to be appointed to any other [ORG] in the country along with a similar preference for [CARDINAL] High Courts.
|
39 |
+
The Union Law Minister, in the above letter clarified, that furnishing of their consent or indication of their preference, would not imply any commitment, at the behest of the Government, to accommodate them in accordance with their preferences.
|
40 |
+
In response, quite a few additional Judges, gave their consent to be appointed outside their parent [ORG].
|
41 |
+
A series of [ORG] in [GPE] passed resolutions, condemning the letter dated 18.3.1981, as being subversive of judicial independence.
|
42 |
+
Since that was not done, a writ petition was filed by the above Associations in the Bombay High Court, challenging the letter dated 18.3.1981.
|
43 |
+
An interim order was passed by [ORG], restraining the Union Law Minister and the Government from implementing the letter dated 18.3.1981.
|
44 |
+
While the matter was pending before this, the Union Law Minister and, filed a transfer petition under [LAW] The transfer petition was allowed, and the writ petition filed in the Bombay High Court, was transferred to [ORG].
|
45 |
+
These short term appointments were assailed, as being unjustified under [LAW], besides being subversive of the independence of the judiciary."
|
46 |
+
|
47 |
+
Statutes:['Constitution_226', 'Constitution_136', 'Constitution_14', 'Constitution_16', 'Constitution_227', 'Constitution_133', 'Constitution_246', 'Constitution_1', 'Constitution_21', 'Constitution_32', 'Constitution_19', 'Constitution_141', 'Constitution_4', 'Constitution_31', 'Constitution_12', 'Constitution_2', 'Constitution_39', 'Constitution_311', 'Constitution_13', 'Constitution_5', 'Constitution_3', 'Constitution_6', 'Constitution_15']
|
48 |
+
|
49 |
+
###
|
50 |
+
|
51 |
+
Format your response as follows:
|
52 |
+
"Statutes applied: [List of applicable statutes]"
|
53 |
+
|
54 |
+
Instructions:
|
55 |
+
|
56 |
+
Learn from the examples provided in the context to understand the task of charge or statute prediction.
|
57 |
+
Your response should be focused on providing the exact statute or charge that aligns with the legal principles and precedents applicable to the given facts.
|
58 |
+
In your response, include only the statutes you are most confident about.Ensure that the statutes generated as responses are valid and recognized legal statutes. Avoid generating fabricated or invalid statutes.
|
59 |
+
The model's performance will be evaluated based on its ability to predict the correct statute, include only confident statutes, and showcase creativity in its predictions.
|
60 |
+
|
61 |
+
Fact Statement: ```{fact}```
|
62 |
+
"""
|
63 |
+
|
64 |
+
def generate(input_text):
|
65 |
+
print(input_text)
|
66 |
+
|
67 |
+
com = prompt.format(fact=input_text)
|
68 |
+
chat_completion = client.chat.completions.create(
|
69 |
+
model="gpt-4-turbo",
|
70 |
+
temperature=0.5,
|
71 |
+
messages=[
|
72 |
+
{"role": "system", "content": "You are a legal assistant from India, skilled in and tagging applicable legal statutes to FIR(First Information Report)."},
|
73 |
+
{
|
74 |
+
"role": "user",
|
75 |
+
"content": com,
|
76 |
+
}
|
77 |
+
],
|
78 |
+
)
|
79 |
+
print(chat_completion)
|
80 |
+
return chat_completion.choices[0].message.content
|
81 |
+
|
82 |
+
def extract_statutes(gpt_output):
|
83 |
+
# Regular expression to match statutes within brackets
|
84 |
+
statutes = re.findall(r'\[([^\]]+)\]', gpt_output)
|
85 |
+
if statutes:
|
86 |
+
# Split the string into a list on comma followed by space
|
87 |
+
return statutes
|
88 |
+
return []
|
89 |
+
|
90 |
+
|
91 |
+
def predict_statutes(fir_text):
|
92 |
+
if fir_text:
|
93 |
+
gpt_output = generate(fir_text)
|
94 |
+
statutes_list = extract_statutes(gpt_output)
|
95 |
+
if statutes_list:
|
96 |
+
return "\n".join(f"- {statute}" for statute in statutes_list)
|
97 |
+
else:
|
98 |
+
return "No statutes were predicted. Please check the FIR text and try again."
|
99 |
+
else:
|
100 |
+
return "Please enter the FIR text to predict statutes."
|
101 |
+
|
102 |
+
# Gradio app layout
|
103 |
+
demo = gr.Interface(
|
104 |
+
fn=predict_statutes,
|
105 |
+
inputs=gr.Textbox(label="Enter the FIR:", placeholder="Type or paste the FIR here...", lines=10),
|
106 |
+
outputs=gr.Textbox(label="Predicted Statutes"),
|
107 |
+
examples=[fact],
|
108 |
+
)
|
109 |
+
|
110 |
+
demo.launch(server_name='0.0.0.0',server_port=7862)
|
requirements.txt
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
altair==5.2.0
|
2 |
+
annotated-types==0.6.0
|
3 |
+
anyio==4.2.0
|
4 |
+
attrs==23.2.0
|
5 |
+
blinker==1.7.0
|
6 |
+
cachetools==5.3.2
|
7 |
+
certifi==2024.2.2
|
8 |
+
charset-normalizer==3.3.2
|
9 |
+
click==8.1.7
|
10 |
+
distro==1.9.0
|
11 |
+
gitdb==4.0.11
|
12 |
+
GitPython==3.1.41
|
13 |
+
h11==0.14.0
|
14 |
+
httpcore==1.0.3
|
15 |
+
httpx==0.26.0
|
16 |
+
idna==3.6
|
17 |
+
importlib-metadata==7.0.1
|
18 |
+
Jinja2==3.1.3
|
19 |
+
jsonschema==4.21.1
|
20 |
+
jsonschema-specifications==2023.12.1
|
21 |
+
markdown-it-py==3.0.0
|
22 |
+
MarkupSafe==2.1.5
|
23 |
+
mdurl==0.1.2
|
24 |
+
numpy==1.26.4
|
25 |
+
openai==1.12.0
|
26 |
+
packaging==23.2
|
27 |
+
pandas==2.2.0
|
28 |
+
pillow==10.2.0
|
29 |
+
protobuf==4.25.2
|
30 |
+
pyarrow==15.0.0
|
31 |
+
pydantic==2.6.1
|
32 |
+
pydantic_core==2.16.2
|
33 |
+
pydeck==0.8.1b0
|
34 |
+
Pygments==2.17.2
|
35 |
+
python-dateutil==2.8.2
|
36 |
+
pytz==2024.1
|
37 |
+
referencing==0.33.0
|
38 |
+
requests==2.31.0
|
39 |
+
rich==13.7.0
|
40 |
+
rpds-py==0.18.0
|
41 |
+
six==1.16.0
|
42 |
+
smmap==5.0.1
|
43 |
+
sniffio==1.3.0
|
44 |
+
streamlit==1.31.1
|
45 |
+
tenacity==8.2.3
|
46 |
+
toml==0.10.2
|
47 |
+
toolz==0.12.1
|
48 |
+
tornado==6.4
|
49 |
+
tqdm==4.66.2
|
50 |
+
typing_extensions==4.9.0
|
51 |
+
tzdata==2024.1
|
52 |
+
tzlocal==5.2
|
53 |
+
urllib3==2.2.0
|
54 |
+
validators==0.22.0
|
55 |
+
watchdog==4.0.0
|
56 |
+
zipp==3.17.0
|
streamlit_app.py
ADDED
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
from openai import AzureOpenAI
|
3 |
+
import streamlit as st
|
4 |
+
import re
|
5 |
+
|
6 |
+
client = AzureOpenAI(
|
7 |
+
api_key="e5a86e5ac7ce453a8fae2dcbfaafbef7",
|
8 |
+
api_version="2023-07-01-preview",
|
9 |
+
azure_endpoint="https://votum.openai.azure.com/",
|
10 |
+
)
|
11 |
+
|
12 |
+
|
13 |
+
fact = '''In service Mr. In-charge Inspector Mr. City of Police Station Kotwali Mr. G Candidate Chetna Gupta alias Chanchal Gupta Advocate Resident of Flat No., 76/44 Halsey Road Kanpur Nagar and practicing law from a pucca chamber just in front of CMO office at Kachehri. On 2024, at around 8: 30 am, my chamber suddenly caught fire and at around 9: 00 am, I got a call informing me that my chamber was on fire. I reached the chamber immediately. By then, Manish, who was cleaning my chamber, was dousing the fire with water. All my chamber's luggage, files, AC, sofa wings, amalt glass walls, necessary documents, miscellaneous items, etc. have been destroyed. I am informing the concerned post. Please take appropriate action. Dated 29. 2024 Signature English unreadable Candidate Chetna Gupta alias Chanchal Gupta Md. 7376222267 Note I hereby certify that 674 Dhirendra Pratap Singh, permanent & tahrir copy of the complaint was literally typed by me on the computer 5057 Lalit Kumar. That I attest to.'''
|
14 |
+
|
15 |
+
prompt = """Task: Given examples of a Supreme Court case and the statutes applied in that case, your objective is to make accurate predictions of the specific charge or statute that is most likely to be applied within the context of the case delimited by triple backticks (```), ensuring exact predictions and learning from the provided examples.You should only include the statutes it is most confident about.The response format should include the statutes applied as in the context.
|
16 |
+
You should to showcase creativity and knowledge to enhance the accuracy of statute predictions based on the given fact statement.
|
17 |
+
|
18 |
+
Context:
|
19 |
+
|
20 |
+
Fact Statement:"In this one gets used to writing common orders, for orders are written either on behalf of the [PRODUCT], or on behalf of the [ORG].
|
21 |
+
While endorsing the opinion expressed by [PERSON],, adjudicating upon the prayer for my recusal, from hearing the matters in hand, reasons for my continuation on the [ORG], also need to be expressed by me.
|
22 |
+
It has been necessitated, for deciding an objection, about the present composition of the [PERSON].
|
23 |
+
As already noted above,, [ORG] has rendered the decision on the objection.
|
24 |
+
The events which followed the order of [PERSON],, are also of some significance.
|
25 |
+
In my considered view, they too need to be narrated, for only then, the entire matter can be considered to have been fully expressed, as it ought to be.
|
26 |
+
I also need to record reasons, why my continuation on the reconstituted [ORG], was the only course open to me.
|
27 |
+
And therefore, my side of its understanding, dealing with the perception, of the other side of the [PRODUCT].
|
28 |
+
Union of India [DATE] Indlaw SCO 185 Writ Petition C no.13 of, Mr. [PERSON], Senior Advocate, in [ORG] of [DATE], Mr. [PERSON], Advocate, in [ORG] Indlaw SC 29 Writ Petition C [DATE] and Mr. [PERSON], Advocate, in Change [GPE] v. [ORG] no.70 of [DATE], representing the petitioners were heard.iii The proceedings recorded by this [ORG] on 18.3.2015 reveal, that Mr. [PERSON], in Writ Petition C no.70 of [DATE] was heard again on, whereupon, Mr. [PERSON] and Mr., [ORG] [GPE], also made their submissions.
|
29 |
+
[CARDINAL]. Based on the order passed by the Judge [PERSON] on 7.4.2015, Honble the Chief Justice of [GPE], constituted a [CARDINAL] Judge [PERSON], comprising of,,, and, JJ.
|
30 |
+
[CARDINAL]. On 13.4.2015 the Constitution Ninety ninth Amendment Act, [DATE], and [ORG] Act, [DATE], were notified in the Gazette of India Extraordinary.Both the above enactments, were brought into force with effect from 13.4.2015.
|
31 |
+
[CARDINAL]. When the reconstituted [PERSON] commenced hearing on 21.4.2015, Mr. made a prayer for my recusal from the [PRODUCT], which was seconded by Mr. Mathews [PERSON] petitioner in- person in Writ Petition C no.124 of [DATE], the latter advanced submissions, even though he had been barred from doing so, by an earlier order dated 24.3.2015 extracted above.
|
32 |
+
The [ORDINAL] judgment was rendered, by a [CARDINAL] Judge [PERSON], by a majority of [CARDINAL], in the [ORDINAL] Judges case on [CARDINAL]. The correctness of the First Judges case was doubted by a Judge [PERSON] in of [GPE], [DATE] Supp 1 SCC 574 [ORG] [CARDINAL], which opined that the majority view, in the [ORG] case, should be considered by a larger.
|
33 |
+
The amendment, received the assent of the President on [DATE].It was however given effect to, with effect from 13.4.2015 consequent upon its notification in the Gazette of India Extraordinary Part II, [SECTION_UNK].
|
34 |
+
The same was also brought into force, with effect from 13.4.2015 by its notification in the Gazette of India Extraordinary Part II, [SECTION_UNK].
|
35 |
+
The Judges case- [DATE] [EVENT] 87 [DATE] [ORG] [CARDINAL].[DATE].The Union Law Minister addressed a letter dated 18.3.1981 to the Governor of [PRODUCT] and to Chief Ministers of all other [GPE].
|
36 |
+
The addressees were inter [PERSON], [CARDINAL] of [ORG], should as far as possible be from outside the in which is situated.
|
37 |
+
Through the above letter, the addressees were requested to.a obtain from all additional Judges working in the High Courts.their consent to be appointed as permanent Judges in any other in the country.
|
38 |
+
The above noted letter required, that the concerned appointees.be required to name [CARDINAL] High Courts, in order of preference, to which they would prefer to be appointed as permanent Judges and b obtain from persons who have already been or may in the future be proposed by you for initial appointment their consent to be appointed to any other [ORG] in the country along with a similar preference for [CARDINAL] High Courts.
|
39 |
+
The Union Law Minister, in the above letter clarified, that furnishing of their consent or indication of their preference, would not imply any commitment, at the behest of the Government, to accommodate them in accordance with their preferences.
|
40 |
+
In response, quite a few additional Judges, gave their consent to be appointed outside their parent [ORG].
|
41 |
+
A series of [ORG] in [GPE] passed resolutions, condemning the letter dated 18.3.1981, as being subversive of judicial independence.
|
42 |
+
Since that was not done, a writ petition was filed by the above Associations in the Bombay High Court, challenging the letter dated 18.3.1981.
|
43 |
+
An interim order was passed by [ORG], restraining the Union Law Minister and the Government from implementing the letter dated 18.3.1981.
|
44 |
+
While the matter was pending before this, the Union Law Minister and, filed a transfer petition under [LAW] The transfer petition was allowed, and the writ petition filed in the Bombay High Court, was transferred to [ORG].
|
45 |
+
These short term appointments were assailed, as being unjustified under [LAW], besides being subversive of the independence of the judiciary."
|
46 |
+
|
47 |
+
Statutes:['Constitution_226', 'Constitution_136', 'Constitution_14', 'Constitution_16', 'Constitution_227', 'Constitution_133', 'Constitution_246', 'Constitution_1', 'Constitution_21', 'Constitution_32', 'Constitution_19', 'Constitution_141', 'Constitution_4', 'Constitution_31', 'Constitution_12', 'Constitution_2', 'Constitution_39', 'Constitution_311', 'Constitution_13', 'Constitution_5', 'Constitution_3', 'Constitution_6', 'Constitution_15']
|
48 |
+
|
49 |
+
###
|
50 |
+
|
51 |
+
Format your response as follows:
|
52 |
+
"Statutes applied: [List of applicable statutes]"
|
53 |
+
|
54 |
+
Instructions:
|
55 |
+
|
56 |
+
Learn from the examples provided in the context to understand the task of charge or statute prediction.
|
57 |
+
Your response should be focused on providing the exact statute or charge that aligns with the legal principles and precedents applicable to the given facts.
|
58 |
+
In your response, include only the statutes you are most confident about.Ensure that the statutes generated as responses are valid and recognized legal statutes. Avoid generating fabricated or invalid statutes.
|
59 |
+
The model's performance will be evaluated based on its ability to predict the correct statute, include only confident statutes, and showcase creativity in its predictions.
|
60 |
+
|
61 |
+
Fact Statement: ```{fact}```
|
62 |
+
"""
|
63 |
+
|
64 |
+
def generate(input_text):
|
65 |
+
print(input_text)
|
66 |
+
|
67 |
+
com = prompt.format(fact=input_text)
|
68 |
+
chat_completion = client.chat.completions.create(
|
69 |
+
model="gpt-4-turbo",
|
70 |
+
temperature=0.5,
|
71 |
+
messages=[
|
72 |
+
{"role": "system", "content": "You are a legal assistant from India, skilled in and tagging applicable legal statutes to FIR(First Information Report)."},
|
73 |
+
{
|
74 |
+
"role": "user",
|
75 |
+
"content": com,
|
76 |
+
}
|
77 |
+
],
|
78 |
+
)
|
79 |
+
print(chat_completion)
|
80 |
+
return chat_completion.choices[0].message.content
|
81 |
+
|
82 |
+
def extract_statutes(gpt_output):
|
83 |
+
# Regular expression to match statutes within brackets
|
84 |
+
statutes = re.findall(r'\[([^\]]+)\]', gpt_output)
|
85 |
+
if statutes:
|
86 |
+
# Split the string into a list on comma followed by space
|
87 |
+
return statutes
|
88 |
+
return []
|
89 |
+
|
90 |
+
|
91 |
+
# Streamlit app layout
|
92 |
+
st.title('FIR Statutes Prediction')
|
93 |
+
|
94 |
+
|
95 |
+
# Button to pre-fill the FIR input with hardcoded text
|
96 |
+
if st.button('Load Example FIR'):
|
97 |
+
input_fir = fact
|
98 |
+
else:
|
99 |
+
input_fir = ""
|
100 |
+
|
101 |
+
# Text input for FIR
|
102 |
+
fir_text = st.text_area("Enter the FIR:", value=input_fir, height=300)
|
103 |
+
|
104 |
+
|
105 |
+
# Button to predict statutes
|
106 |
+
if st.button('Predict Statutes'):
|
107 |
+
if fir_text:
|
108 |
+
with st.spinner('Predicting...'):
|
109 |
+
print(fir_text)
|
110 |
+
gpt_output = generate(fir_text)
|
111 |
+
print(gpt_output)
|
112 |
+
statutes_list = extract_statutes(gpt_output)
|
113 |
+
if statutes_list:
|
114 |
+
st.subheader('Predicted Statutes')
|
115 |
+
for statute in statutes_list:
|
116 |
+
st.write(f"- {statute}")
|
117 |
+
else:
|
118 |
+
st.warning('No statutes were predicted. Please check the FIR text and try again.')
|
119 |
+
else:
|
120 |
+
st.warning('Please enter the FIR text to predict statutes.')
|
121 |
+
|
venv/bin/Activate.ps1
ADDED
@@ -0,0 +1,247 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<#
|
2 |
+
.Synopsis
|
3 |
+
Activate a Python virtual environment for the current PowerShell session.
|
4 |
+
|
5 |
+
.Description
|
6 |
+
Pushes the python executable for a virtual environment to the front of the
|
7 |
+
$Env:PATH environment variable and sets the prompt to signify that you are
|
8 |
+
in a Python virtual environment. Makes use of the command line switches as
|
9 |
+
well as the `pyvenv.cfg` file values present in the virtual environment.
|
10 |
+
|
11 |
+
.Parameter VenvDir
|
12 |
+
Path to the directory that contains the virtual environment to activate. The
|
13 |
+
default value for this is the parent of the directory that the Activate.ps1
|
14 |
+
script is located within.
|
15 |
+
|
16 |
+
.Parameter Prompt
|
17 |
+
The prompt prefix to display when this virtual environment is activated. By
|
18 |
+
default, this prompt is the name of the virtual environment folder (VenvDir)
|
19 |
+
surrounded by parentheses and followed by a single space (ie. '(.venv) ').
|
20 |
+
|
21 |
+
.Example
|
22 |
+
Activate.ps1
|
23 |
+
Activates the Python virtual environment that contains the Activate.ps1 script.
|
24 |
+
|
25 |
+
.Example
|
26 |
+
Activate.ps1 -Verbose
|
27 |
+
Activates the Python virtual environment that contains the Activate.ps1 script,
|
28 |
+
and shows extra information about the activation as it executes.
|
29 |
+
|
30 |
+
.Example
|
31 |
+
Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv
|
32 |
+
Activates the Python virtual environment located in the specified location.
|
33 |
+
|
34 |
+
.Example
|
35 |
+
Activate.ps1 -Prompt "MyPython"
|
36 |
+
Activates the Python virtual environment that contains the Activate.ps1 script,
|
37 |
+
and prefixes the current prompt with the specified string (surrounded in
|
38 |
+
parentheses) while the virtual environment is active.
|
39 |
+
|
40 |
+
.Notes
|
41 |
+
On Windows, it may be required to enable this Activate.ps1 script by setting the
|
42 |
+
execution policy for the user. You can do this by issuing the following PowerShell
|
43 |
+
command:
|
44 |
+
|
45 |
+
PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
46 |
+
|
47 |
+
For more information on Execution Policies:
|
48 |
+
https://go.microsoft.com/fwlink/?LinkID=135170
|
49 |
+
|
50 |
+
#>
|
51 |
+
Param(
|
52 |
+
[Parameter(Mandatory = $false)]
|
53 |
+
[String]
|
54 |
+
$VenvDir,
|
55 |
+
[Parameter(Mandatory = $false)]
|
56 |
+
[String]
|
57 |
+
$Prompt
|
58 |
+
)
|
59 |
+
|
60 |
+
<# Function declarations --------------------------------------------------- #>
|
61 |
+
|
62 |
+
<#
|
63 |
+
.Synopsis
|
64 |
+
Remove all shell session elements added by the Activate script, including the
|
65 |
+
addition of the virtual environment's Python executable from the beginning of
|
66 |
+
the PATH variable.
|
67 |
+
|
68 |
+
.Parameter NonDestructive
|
69 |
+
If present, do not remove this function from the global namespace for the
|
70 |
+
session.
|
71 |
+
|
72 |
+
#>
|
73 |
+
function global:deactivate ([switch]$NonDestructive) {
|
74 |
+
# Revert to original values
|
75 |
+
|
76 |
+
# The prior prompt:
|
77 |
+
if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) {
|
78 |
+
Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt
|
79 |
+
Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT
|
80 |
+
}
|
81 |
+
|
82 |
+
# The prior PYTHONHOME:
|
83 |
+
if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) {
|
84 |
+
Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME
|
85 |
+
Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME
|
86 |
+
}
|
87 |
+
|
88 |
+
# The prior PATH:
|
89 |
+
if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) {
|
90 |
+
Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH
|
91 |
+
Remove-Item -Path Env:_OLD_VIRTUAL_PATH
|
92 |
+
}
|
93 |
+
|
94 |
+
# Just remove the VIRTUAL_ENV altogether:
|
95 |
+
if (Test-Path -Path Env:VIRTUAL_ENV) {
|
96 |
+
Remove-Item -Path env:VIRTUAL_ENV
|
97 |
+
}
|
98 |
+
|
99 |
+
# Just remove VIRTUAL_ENV_PROMPT altogether.
|
100 |
+
if (Test-Path -Path Env:VIRTUAL_ENV_PROMPT) {
|
101 |
+
Remove-Item -Path env:VIRTUAL_ENV_PROMPT
|
102 |
+
}
|
103 |
+
|
104 |
+
# Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether:
|
105 |
+
if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) {
|
106 |
+
Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force
|
107 |
+
}
|
108 |
+
|
109 |
+
# Leave deactivate function in the global namespace if requested:
|
110 |
+
if (-not $NonDestructive) {
|
111 |
+
Remove-Item -Path function:deactivate
|
112 |
+
}
|
113 |
+
}
|
114 |
+
|
115 |
+
<#
|
116 |
+
.Description
|
117 |
+
Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the
|
118 |
+
given folder, and returns them in a map.
|
119 |
+
|
120 |
+
For each line in the pyvenv.cfg file, if that line can be parsed into exactly
|
121 |
+
two strings separated by `=` (with any amount of whitespace surrounding the =)
|
122 |
+
then it is considered a `key = value` line. The left hand string is the key,
|
123 |
+
the right hand is the value.
|
124 |
+
|
125 |
+
If the value starts with a `'` or a `"` then the first and last character is
|
126 |
+
stripped from the value before being captured.
|
127 |
+
|
128 |
+
.Parameter ConfigDir
|
129 |
+
Path to the directory that contains the `pyvenv.cfg` file.
|
130 |
+
#>
|
131 |
+
function Get-PyVenvConfig(
|
132 |
+
[String]
|
133 |
+
$ConfigDir
|
134 |
+
) {
|
135 |
+
Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg"
|
136 |
+
|
137 |
+
# Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue).
|
138 |
+
$pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue
|
139 |
+
|
140 |
+
# An empty map will be returned if no config file is found.
|
141 |
+
$pyvenvConfig = @{ }
|
142 |
+
|
143 |
+
if ($pyvenvConfigPath) {
|
144 |
+
|
145 |
+
Write-Verbose "File exists, parse `key = value` lines"
|
146 |
+
$pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath
|
147 |
+
|
148 |
+
$pyvenvConfigContent | ForEach-Object {
|
149 |
+
$keyval = $PSItem -split "\s*=\s*", 2
|
150 |
+
if ($keyval[0] -and $keyval[1]) {
|
151 |
+
$val = $keyval[1]
|
152 |
+
|
153 |
+
# Remove extraneous quotations around a string value.
|
154 |
+
if ("'""".Contains($val.Substring(0, 1))) {
|
155 |
+
$val = $val.Substring(1, $val.Length - 2)
|
156 |
+
}
|
157 |
+
|
158 |
+
$pyvenvConfig[$keyval[0]] = $val
|
159 |
+
Write-Verbose "Adding Key: '$($keyval[0])'='$val'"
|
160 |
+
}
|
161 |
+
}
|
162 |
+
}
|
163 |
+
return $pyvenvConfig
|
164 |
+
}
|
165 |
+
|
166 |
+
|
167 |
+
<# Begin Activate script --------------------------------------------------- #>
|
168 |
+
|
169 |
+
# Determine the containing directory of this script
|
170 |
+
$VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
|
171 |
+
$VenvExecDir = Get-Item -Path $VenvExecPath
|
172 |
+
|
173 |
+
Write-Verbose "Activation script is located in path: '$VenvExecPath'"
|
174 |
+
Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)"
|
175 |
+
Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)"
|
176 |
+
|
177 |
+
# Set values required in priority: CmdLine, ConfigFile, Default
|
178 |
+
# First, get the location of the virtual environment, it might not be
|
179 |
+
# VenvExecDir if specified on the command line.
|
180 |
+
if ($VenvDir) {
|
181 |
+
Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values"
|
182 |
+
}
|
183 |
+
else {
|
184 |
+
Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir."
|
185 |
+
$VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/")
|
186 |
+
Write-Verbose "VenvDir=$VenvDir"
|
187 |
+
}
|
188 |
+
|
189 |
+
# Next, read the `pyvenv.cfg` file to determine any required value such
|
190 |
+
# as `prompt`.
|
191 |
+
$pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir
|
192 |
+
|
193 |
+
# Next, set the prompt from the command line, or the config file, or
|
194 |
+
# just use the name of the virtual environment folder.
|
195 |
+
if ($Prompt) {
|
196 |
+
Write-Verbose "Prompt specified as argument, using '$Prompt'"
|
197 |
+
}
|
198 |
+
else {
|
199 |
+
Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value"
|
200 |
+
if ($pyvenvCfg -and $pyvenvCfg['prompt']) {
|
201 |
+
Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'"
|
202 |
+
$Prompt = $pyvenvCfg['prompt'];
|
203 |
+
}
|
204 |
+
else {
|
205 |
+
Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virtual environment)"
|
206 |
+
Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'"
|
207 |
+
$Prompt = Split-Path -Path $venvDir -Leaf
|
208 |
+
}
|
209 |
+
}
|
210 |
+
|
211 |
+
Write-Verbose "Prompt = '$Prompt'"
|
212 |
+
Write-Verbose "VenvDir='$VenvDir'"
|
213 |
+
|
214 |
+
# Deactivate any currently active virtual environment, but leave the
|
215 |
+
# deactivate function in place.
|
216 |
+
deactivate -nondestructive
|
217 |
+
|
218 |
+
# Now set the environment variable VIRTUAL_ENV, used by many tools to determine
|
219 |
+
# that there is an activated venv.
|
220 |
+
$env:VIRTUAL_ENV = $VenvDir
|
221 |
+
|
222 |
+
if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) {
|
223 |
+
|
224 |
+
Write-Verbose "Setting prompt to '$Prompt'"
|
225 |
+
|
226 |
+
# Set the prompt to include the env name
|
227 |
+
# Make sure _OLD_VIRTUAL_PROMPT is global
|
228 |
+
function global:_OLD_VIRTUAL_PROMPT { "" }
|
229 |
+
Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT
|
230 |
+
New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt
|
231 |
+
|
232 |
+
function global:prompt {
|
233 |
+
Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) "
|
234 |
+
_OLD_VIRTUAL_PROMPT
|
235 |
+
}
|
236 |
+
$env:VIRTUAL_ENV_PROMPT = $Prompt
|
237 |
+
}
|
238 |
+
|
239 |
+
# Clear PYTHONHOME
|
240 |
+
if (Test-Path -Path Env:PYTHONHOME) {
|
241 |
+
Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME
|
242 |
+
Remove-Item -Path Env:PYTHONHOME
|
243 |
+
}
|
244 |
+
|
245 |
+
# Add the venv to the PATH
|
246 |
+
Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH
|
247 |
+
$Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH"
|
venv/bin/activate
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# This file must be used with "source bin/activate" *from bash*
|
2 |
+
# you cannot run it directly
|
3 |
+
|
4 |
+
deactivate () {
|
5 |
+
# reset old environment variables
|
6 |
+
if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
|
7 |
+
PATH="${_OLD_VIRTUAL_PATH:-}"
|
8 |
+
export PATH
|
9 |
+
unset _OLD_VIRTUAL_PATH
|
10 |
+
fi
|
11 |
+
if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
|
12 |
+
PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
|
13 |
+
export PYTHONHOME
|
14 |
+
unset _OLD_VIRTUAL_PYTHONHOME
|
15 |
+
fi
|
16 |
+
|
17 |
+
# This should detect bash and zsh, which have a hash command that must
|
18 |
+
# be called to get it to forget past commands. Without forgetting
|
19 |
+
# past commands the $PATH changes we made may not be respected
|
20 |
+
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
|
21 |
+
hash -r 2> /dev/null
|
22 |
+
fi
|
23 |
+
|
24 |
+
if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
|
25 |
+
PS1="${_OLD_VIRTUAL_PS1:-}"
|
26 |
+
export PS1
|
27 |
+
unset _OLD_VIRTUAL_PS1
|
28 |
+
fi
|
29 |
+
|
30 |
+
unset VIRTUAL_ENV
|
31 |
+
unset VIRTUAL_ENV_PROMPT
|
32 |
+
if [ ! "${1:-}" = "nondestructive" ] ; then
|
33 |
+
# Self destruct!
|
34 |
+
unset -f deactivate
|
35 |
+
fi
|
36 |
+
}
|
37 |
+
|
38 |
+
# unset irrelevant variables
|
39 |
+
deactivate nondestructive
|
40 |
+
|
41 |
+
VIRTUAL_ENV="/home/azureuser/statutre_prediction/venv"
|
42 |
+
export VIRTUAL_ENV
|
43 |
+
|
44 |
+
_OLD_VIRTUAL_PATH="$PATH"
|
45 |
+
PATH="$VIRTUAL_ENV/bin:$PATH"
|
46 |
+
export PATH
|
47 |
+
|
48 |
+
# unset PYTHONHOME if set
|
49 |
+
# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
|
50 |
+
# could use `if (set -u; : $PYTHONHOME) ;` in bash
|
51 |
+
if [ -n "${PYTHONHOME:-}" ] ; then
|
52 |
+
_OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
|
53 |
+
unset PYTHONHOME
|
54 |
+
fi
|
55 |
+
|
56 |
+
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
|
57 |
+
_OLD_VIRTUAL_PS1="${PS1:-}"
|
58 |
+
PS1="(venv) ${PS1:-}"
|
59 |
+
export PS1
|
60 |
+
VIRTUAL_ENV_PROMPT="(venv) "
|
61 |
+
export VIRTUAL_ENV_PROMPT
|
62 |
+
fi
|
63 |
+
|
64 |
+
# This should detect bash and zsh, which have a hash command that must
|
65 |
+
# be called to get it to forget past commands. Without forgetting
|
66 |
+
# past commands the $PATH changes we made may not be respected
|
67 |
+
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
|
68 |
+
hash -r 2> /dev/null
|
69 |
+
fi
|
venv/bin/activate.csh
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# This file must be used with "source bin/activate.csh" *from csh*.
|
2 |
+
# You cannot run it directly.
|
3 |
+
# Created by Davide Di Blasi <[email protected]>.
|
4 |
+
# Ported to Python 3.3 venv by Andrew Svetlov <[email protected]>
|
5 |
+
|
6 |
+
alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; unsetenv VIRTUAL_ENV_PROMPT; test "\!:*" != "nondestructive" && unalias deactivate'
|
7 |
+
|
8 |
+
# Unset irrelevant variables.
|
9 |
+
deactivate nondestructive
|
10 |
+
|
11 |
+
setenv VIRTUAL_ENV "/home/azureuser/statutre_prediction/venv"
|
12 |
+
|
13 |
+
set _OLD_VIRTUAL_PATH="$PATH"
|
14 |
+
setenv PATH "$VIRTUAL_ENV/bin:$PATH"
|
15 |
+
|
16 |
+
|
17 |
+
set _OLD_VIRTUAL_PROMPT="$prompt"
|
18 |
+
|
19 |
+
if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then
|
20 |
+
set prompt = "(venv) $prompt"
|
21 |
+
setenv VIRTUAL_ENV_PROMPT "(venv) "
|
22 |
+
endif
|
23 |
+
|
24 |
+
alias pydoc python -m pydoc
|
25 |
+
|
26 |
+
rehash
|
venv/bin/activate.fish
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# This file must be used with "source <venv>/bin/activate.fish" *from fish*
|
2 |
+
# (https://fishshell.com/); you cannot run it directly.
|
3 |
+
|
4 |
+
function deactivate -d "Exit virtual environment and return to normal shell environment"
|
5 |
+
# reset old environment variables
|
6 |
+
if test -n "$_OLD_VIRTUAL_PATH"
|
7 |
+
set -gx PATH $_OLD_VIRTUAL_PATH
|
8 |
+
set -e _OLD_VIRTUAL_PATH
|
9 |
+
end
|
10 |
+
if test -n "$_OLD_VIRTUAL_PYTHONHOME"
|
11 |
+
set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME
|
12 |
+
set -e _OLD_VIRTUAL_PYTHONHOME
|
13 |
+
end
|
14 |
+
|
15 |
+
if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
|
16 |
+
set -e _OLD_FISH_PROMPT_OVERRIDE
|
17 |
+
# prevents error when using nested fish instances (Issue #93858)
|
18 |
+
if functions -q _old_fish_prompt
|
19 |
+
functions -e fish_prompt
|
20 |
+
functions -c _old_fish_prompt fish_prompt
|
21 |
+
functions -e _old_fish_prompt
|
22 |
+
end
|
23 |
+
end
|
24 |
+
|
25 |
+
set -e VIRTUAL_ENV
|
26 |
+
set -e VIRTUAL_ENV_PROMPT
|
27 |
+
if test "$argv[1]" != "nondestructive"
|
28 |
+
# Self-destruct!
|
29 |
+
functions -e deactivate
|
30 |
+
end
|
31 |
+
end
|
32 |
+
|
33 |
+
# Unset irrelevant variables.
|
34 |
+
deactivate nondestructive
|
35 |
+
|
36 |
+
set -gx VIRTUAL_ENV "/home/azureuser/statutre_prediction/venv"
|
37 |
+
|
38 |
+
set -gx _OLD_VIRTUAL_PATH $PATH
|
39 |
+
set -gx PATH "$VIRTUAL_ENV/bin" $PATH
|
40 |
+
|
41 |
+
# Unset PYTHONHOME if set.
|
42 |
+
if set -q PYTHONHOME
|
43 |
+
set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
|
44 |
+
set -e PYTHONHOME
|
45 |
+
end
|
46 |
+
|
47 |
+
if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
|
48 |
+
# fish uses a function instead of an env var to generate the prompt.
|
49 |
+
|
50 |
+
# Save the current fish_prompt function as the function _old_fish_prompt.
|
51 |
+
functions -c fish_prompt _old_fish_prompt
|
52 |
+
|
53 |
+
# With the original prompt function renamed, we can override with our own.
|
54 |
+
function fish_prompt
|
55 |
+
# Save the return status of the last command.
|
56 |
+
set -l old_status $status
|
57 |
+
|
58 |
+
# Output the venv prompt; color taken from the blue of the Python logo.
|
59 |
+
printf "%s%s%s" (set_color 4B8BBE) "(venv) " (set_color normal)
|
60 |
+
|
61 |
+
# Restore the return status of the previous command.
|
62 |
+
echo "exit $old_status" | .
|
63 |
+
# Output the original/"old" prompt.
|
64 |
+
_old_fish_prompt
|
65 |
+
end
|
66 |
+
|
67 |
+
set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
|
68 |
+
set -gx VIRTUAL_ENV_PROMPT "(venv) "
|
69 |
+
end
|
venv/bin/distro
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/home/azureuser/statutre_prediction/venv/bin/python
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
import re
|
4 |
+
import sys
|
5 |
+
from distro.distro import main
|
6 |
+
if __name__ == '__main__':
|
7 |
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
8 |
+
sys.exit(main())
|
venv/bin/f2py
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/home/azureuser/statutre_prediction/venv/bin/python
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
import re
|
4 |
+
import sys
|
5 |
+
from numpy.f2py.f2py2e import main
|
6 |
+
if __name__ == '__main__':
|
7 |
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
8 |
+
sys.exit(main())
|
venv/bin/httpx
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/home/azureuser/statutre_prediction/venv/bin/python
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
import re
|
4 |
+
import sys
|
5 |
+
from httpx import main
|
6 |
+
if __name__ == '__main__':
|
7 |
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
8 |
+
sys.exit(main())
|
venv/bin/jsonschema
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/home/azureuser/statutre_prediction/venv/bin/python
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
import re
|
4 |
+
import sys
|
5 |
+
from jsonschema.cli import main
|
6 |
+
if __name__ == '__main__':
|
7 |
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
8 |
+
sys.exit(main())
|
venv/bin/markdown-it
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/home/azureuser/statutre_prediction/venv/bin/python
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
import re
|
4 |
+
import sys
|
5 |
+
from markdown_it.cli.parse import main
|
6 |
+
if __name__ == '__main__':
|
7 |
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
8 |
+
sys.exit(main())
|
venv/bin/normalizer
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/home/azureuser/statutre_prediction/venv/bin/python
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
import re
|
4 |
+
import sys
|
5 |
+
from charset_normalizer.cli import cli_detect
|
6 |
+
if __name__ == '__main__':
|
7 |
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
8 |
+
sys.exit(cli_detect())
|
venv/bin/openai
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/home/azureuser/statutre_prediction/venv/bin/python
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
import re
|
4 |
+
import sys
|
5 |
+
from openai.cli import main
|
6 |
+
if __name__ == '__main__':
|
7 |
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
8 |
+
sys.exit(main())
|
venv/bin/pip
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/home/azureuser/statutre_prediction/venv/bin/python
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
import re
|
4 |
+
import sys
|
5 |
+
from pip._internal.cli.main import main
|
6 |
+
if __name__ == '__main__':
|
7 |
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
8 |
+
sys.exit(main())
|
venv/bin/pip3
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/home/azureuser/statutre_prediction/venv/bin/python
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
import re
|
4 |
+
import sys
|
5 |
+
from pip._internal.cli.main import main
|
6 |
+
if __name__ == '__main__':
|
7 |
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
8 |
+
sys.exit(main())
|
venv/bin/pip3.11
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/home/azureuser/statutre_prediction/venv/bin/python
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
import re
|
4 |
+
import sys
|
5 |
+
from pip._internal.cli.main import main
|
6 |
+
if __name__ == '__main__':
|
7 |
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
8 |
+
sys.exit(main())
|
venv/bin/pygmentize
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/home/azureuser/statutre_prediction/venv/bin/python
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
import re
|
4 |
+
import sys
|
5 |
+
from pygments.cmdline import main
|
6 |
+
if __name__ == '__main__':
|
7 |
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
8 |
+
sys.exit(main())
|
venv/bin/python
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:11221b57c72ec5cc790df6dac511ea8e1dafee331b3248d671acf50d84428e71
|
3 |
+
size 24526776
|
venv/bin/python3
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:11221b57c72ec5cc790df6dac511ea8e1dafee331b3248d671acf50d84428e71
|
3 |
+
size 24526776
|
venv/bin/python3.11
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:11221b57c72ec5cc790df6dac511ea8e1dafee331b3248d671acf50d84428e71
|
3 |
+
size 24526776
|
venv/bin/streamlit
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/home/azureuser/statutre_prediction/venv/bin/python
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
import re
|
4 |
+
import sys
|
5 |
+
from streamlit.web.cli import main
|
6 |
+
if __name__ == '__main__':
|
7 |
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
8 |
+
sys.exit(main())
|
venv/bin/streamlit.cmd
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
rem Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2024)
|
2 |
+
rem
|
3 |
+
rem Licensed under the Apache License, Version 2.0 (the "License");
|
4 |
+
rem you may not use this file except in compliance with the License.
|
5 |
+
rem You may obtain a copy of the License at
|
6 |
+
rem
|
7 |
+
rem http://www.apache.org/licenses/LICENSE-2.0
|
8 |
+
rem
|
9 |
+
rem Unless required by applicable law or agreed to in writing, software
|
10 |
+
rem distributed under the License is distributed on an "AS IS" BASIS,
|
11 |
+
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12 |
+
rem See the License for the specific language governing permissions and
|
13 |
+
rem limitations under the License.
|
14 |
+
|
15 |
+
@echo OFF
|
16 |
+
python -m streamlit %*
|
venv/bin/tqdm
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/home/azureuser/statutre_prediction/venv/bin/python
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
import re
|
4 |
+
import sys
|
5 |
+
from tqdm.cli import main
|
6 |
+
if __name__ == '__main__':
|
7 |
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
8 |
+
sys.exit(main())
|
venv/bin/watchmedo
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/home/azureuser/statutre_prediction/venv/bin/python
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
import re
|
4 |
+
import sys
|
5 |
+
from watchdog.watchmedo import main
|
6 |
+
if __name__ == '__main__':
|
7 |
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
8 |
+
sys.exit(main())
|
venv/etc/jupyter/nbconfig/notebook.d/pydeck.json
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"load_extensions": {
|
3 |
+
"pydeck/extension": true
|
4 |
+
}
|
5 |
+
}
|
venv/lib/python3.11/site-packages/GitPython-3.1.41.dist-info/AUTHORS
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
GitPython was originally written by Michael Trier.
|
2 |
+
GitPython 0.2 was partially (re)written by Sebastian Thiel, based on 0.1.6 and git-dulwich.
|
3 |
+
|
4 |
+
Contributors are:
|
5 |
+
|
6 |
+
-Michael Trier <mtrier _at_ gmail.com>
|
7 |
+
-Alan Briolat
|
8 |
+
-Florian Apolloner <florian _at_ apolloner.eu>
|
9 |
+
-David Aguilar <davvid _at_ gmail.com>
|
10 |
+
-Jelmer Vernooij <jelmer _at_ samba.org>
|
11 |
+
-Steve Frécinaux <code _at_ istique.net>
|
12 |
+
-Kai Lautaportti <kai _at_ lautaportti.fi>
|
13 |
+
-Paul Sowden <paul _at_ idontsmoke.co.uk>
|
14 |
+
-Sebastian Thiel <byronimo _at_ gmail.com>
|
15 |
+
-Jonathan Chu <jonathan.chu _at_ me.com>
|
16 |
+
-Vincent Driessen <me _at_ nvie.com>
|
17 |
+
-Phil Elson <pelson _dot_ pub _at_ gmail.com>
|
18 |
+
-Bernard `Guyzmo` Pratz <[email protected]>
|
19 |
+
-Timothy B. Hartman <tbhartman _at_ gmail.com>
|
20 |
+
-Konstantin Popov <konstantin.popov.89 _at_ yandex.ru>
|
21 |
+
-Peter Jones <pjones _at_ redhat.com>
|
22 |
+
-Anson Mansfield <anson.mansfield _at_ gmail.com>
|
23 |
+
-Ken Odegard <ken.odegard _at_ gmail.com>
|
24 |
+
-Alexis Horgix Chotard
|
25 |
+
-Piotr Babij <piotr.babij _at_ gmail.com>
|
26 |
+
-Mikuláš Poul <mikulaspoul _at_ gmail.com>
|
27 |
+
-Charles Bouchard-Légaré <cblegare.atl _at_ ntis.ca>
|
28 |
+
-Yaroslav Halchenko <debian _at_ onerussian.com>
|
29 |
+
-Tim Swast <swast _at_ google.com>
|
30 |
+
-William Luc Ritchie
|
31 |
+
-David Host <hostdm _at_ outlook.com>
|
32 |
+
-A. Jesse Jiryu Davis <jesse _at_ emptysquare.net>
|
33 |
+
-Steven Whitman <ninloot _at_ gmail.com>
|
34 |
+
-Stefan Stancu <stefan.stancu _at_ gmail.com>
|
35 |
+
-César Izurieta <cesar _at_ caih.org>
|
36 |
+
-Arthur Milchior <arthur _at_ milchior.fr>
|
37 |
+
-Anil Khatri <anil.soccer.khatri _at_ gmail.com>
|
38 |
+
-JJ Graham <thetwoj _at_ gmail.com>
|
39 |
+
-Ben Thayer <ben _at_ benthayer.com>
|
40 |
+
-Dries Kennes <admin _at_ dries007.net>
|
41 |
+
-Pratik Anurag <panurag247365 _at_ gmail.com>
|
42 |
+
-Harmon <harmon.public _at_ gmail.com>
|
43 |
+
-Liam Beguin <liambeguin _at_ gmail.com>
|
44 |
+
-Ram Rachum <ram _at_ rachum.com>
|
45 |
+
-Alba Mendez <me _at_ alba.sh>
|
46 |
+
-Robert Westman <robert _at_ byteflux.io>
|
47 |
+
-Hugo van Kemenade
|
48 |
+
-Hiroki Tokunaga <tokusan441 _at_ gmail.com>
|
49 |
+
-Julien Mauroy <pro.julien.mauroy _at_ gmail.com>
|
50 |
+
-Patrick Gerard
|
51 |
+
-Luke Twist <[email protected]>
|
52 |
+
-Joseph Hale <me _at_ jhale.dev>
|
53 |
+
-Santos Gallegos <stsewd _at_ proton.me>
|
54 |
+
-Wenhan Zhu <wzhu.cosmos _at_ gmail.com>
|
55 |
+
-Eliah Kagan <eliah.kagan _at_ gmail.com>
|
56 |
+
|
57 |
+
Portions derived from other open source works and are clearly marked.
|
venv/lib/python3.11/site-packages/GitPython-3.1.41.dist-info/INSTALLER
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
pip
|
venv/lib/python3.11/site-packages/GitPython-3.1.41.dist-info/LICENSE
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Copyright (C) 2008, 2009 Michael Trier and contributors
|
2 |
+
All rights reserved.
|
3 |
+
|
4 |
+
Redistribution and use in source and binary forms, with or without
|
5 |
+
modification, are permitted provided that the following conditions
|
6 |
+
are met:
|
7 |
+
|
8 |
+
* Redistributions of source code must retain the above copyright
|
9 |
+
notice, this list of conditions and the following disclaimer.
|
10 |
+
|
11 |
+
* Redistributions in binary form must reproduce the above copyright
|
12 |
+
notice, this list of conditions and the following disclaimer in the
|
13 |
+
documentation and/or other materials provided with the distribution.
|
14 |
+
|
15 |
+
* Neither the name of the GitPython project nor the names of
|
16 |
+
its contributors may be used to endorse or promote products derived
|
17 |
+
from this software without specific prior written permission.
|
18 |
+
|
19 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
20 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
21 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
22 |
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
23 |
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
24 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
25 |
+
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
26 |
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
27 |
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
28 |
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
29 |
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
venv/lib/python3.11/site-packages/GitPython-3.1.41.dist-info/METADATA
ADDED
@@ -0,0 +1,340 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Metadata-Version: 2.1
|
2 |
+
Name: GitPython
|
3 |
+
Version: 3.1.41
|
4 |
+
Summary: GitPython is a Python library used to interact with Git repositories
|
5 |
+
Home-page: https://github.com/gitpython-developers/GitPython
|
6 |
+
Author: Sebastian Thiel, Michael Trier
|
7 |
+
Author-email: [email protected], [email protected]
|
8 |
+
License: BSD-3-Clause
|
9 |
+
Classifier: Development Status :: 5 - Production/Stable
|
10 |
+
Classifier: Environment :: Console
|
11 |
+
Classifier: Intended Audience :: Developers
|
12 |
+
Classifier: License :: OSI Approved :: BSD License
|
13 |
+
Classifier: Operating System :: OS Independent
|
14 |
+
Classifier: Operating System :: POSIX
|
15 |
+
Classifier: Operating System :: Microsoft :: Windows
|
16 |
+
Classifier: Operating System :: MacOS :: MacOS X
|
17 |
+
Classifier: Typing :: Typed
|
18 |
+
Classifier: Programming Language :: Python
|
19 |
+
Classifier: Programming Language :: Python :: 3
|
20 |
+
Classifier: Programming Language :: Python :: 3.7
|
21 |
+
Classifier: Programming Language :: Python :: 3.8
|
22 |
+
Classifier: Programming Language :: Python :: 3.9
|
23 |
+
Classifier: Programming Language :: Python :: 3.10
|
24 |
+
Classifier: Programming Language :: Python :: 3.11
|
25 |
+
Classifier: Programming Language :: Python :: 3.12
|
26 |
+
Requires-Python: >=3.7
|
27 |
+
Description-Content-Type: text/markdown
|
28 |
+
License-File: LICENSE
|
29 |
+
License-File: AUTHORS
|
30 |
+
Requires-Dist: gitdb <5,>=4.0.1
|
31 |
+
Requires-Dist: typing-extensions >=3.7.4.3 ; python_version < "3.8"
|
32 |
+
Provides-Extra: test
|
33 |
+
Requires-Dist: black ; extra == 'test'
|
34 |
+
Requires-Dist: coverage[toml] ; extra == 'test'
|
35 |
+
Requires-Dist: ddt !=1.4.3,>=1.1.1 ; extra == 'test'
|
36 |
+
Requires-Dist: mypy ; extra == 'test'
|
37 |
+
Requires-Dist: pre-commit ; extra == 'test'
|
38 |
+
Requires-Dist: pytest >=7.3.1 ; extra == 'test'
|
39 |
+
Requires-Dist: pytest-cov ; extra == 'test'
|
40 |
+
Requires-Dist: pytest-instafail ; extra == 'test'
|
41 |
+
Requires-Dist: pytest-mock ; extra == 'test'
|
42 |
+
Requires-Dist: pytest-sugar ; extra == 'test'
|
43 |
+
Requires-Dist: sumtypes ; extra == 'test'
|
44 |
+
Requires-Dist: mock ; (python_version < "3.8") and extra == 'test'
|
45 |
+
|
46 |
+
![Python package](https://github.com/gitpython-developers/GitPython/workflows/Python%20package/badge.svg)
|
47 |
+
[![Documentation Status](https://readthedocs.org/projects/gitpython/badge/?version=stable)](https://readthedocs.org/projects/gitpython/?badge=stable)
|
48 |
+
[![Packaging status](https://repology.org/badge/tiny-repos/python:gitpython.svg)](https://repology.org/metapackage/python:gitpython/versions)
|
49 |
+
|
50 |
+
## [Gitoxide](https://github.com/Byron/gitoxide): A peek into the future…
|
51 |
+
|
52 |
+
I started working on GitPython in 2009, back in the days when Python was 'my thing' and I had great plans with it.
|
53 |
+
Of course, back in the days, I didn't really know what I was doing and this shows in many places. Somewhat similar to
|
54 |
+
Python this happens to be 'good enough', but at the same time is deeply flawed and broken beyond repair.
|
55 |
+
|
56 |
+
By now, GitPython is widely used and I am sure there is a good reason for that, it's something to be proud of and happy about.
|
57 |
+
The community is maintaining the software and is keeping it relevant for which I am absolutely grateful. For the time to come I am happy to continue maintaining GitPython, remaining hopeful that one day it won't be needed anymore.
|
58 |
+
|
59 |
+
More than 15 years after my first meeting with 'git' I am still in excited about it, and am happy to finally have the tools and
|
60 |
+
probably the skills to scratch that itch of mine: implement `git` in a way that makes tool creation a piece of cake for most.
|
61 |
+
|
62 |
+
If you like the idea and want to learn more, please head over to [gitoxide](https://github.com/Byron/gitoxide), an
|
63 |
+
implementation of 'git' in [Rust](https://www.rust-lang.org).
|
64 |
+
|
65 |
+
## GitPython
|
66 |
+
|
67 |
+
GitPython is a python library used to interact with git repositories, high-level like git-porcelain,
|
68 |
+
or low-level like git-plumbing.
|
69 |
+
|
70 |
+
It provides abstractions of git objects for easy access of repository data often backed by calling the `git`
|
71 |
+
command-line program.
|
72 |
+
|
73 |
+
### DEVELOPMENT STATUS
|
74 |
+
|
75 |
+
This project is in **maintenance mode**, which means that
|
76 |
+
|
77 |
+
- …there will be no feature development, unless these are contributed
|
78 |
+
- …there will be no bug fixes, unless they are relevant to the safety of users, or contributed
|
79 |
+
- …issues will be responded to with waiting times of up to a month
|
80 |
+
|
81 |
+
The project is open to contributions of all kinds, as well as new maintainers.
|
82 |
+
|
83 |
+
### REQUIREMENTS
|
84 |
+
|
85 |
+
GitPython needs the `git` executable to be installed on the system and available in your `PATH` for most operations.
|
86 |
+
If it is not in your `PATH`, you can help GitPython find it by setting
|
87 |
+
the `GIT_PYTHON_GIT_EXECUTABLE=<path/to/git>` environment variable.
|
88 |
+
|
89 |
+
- Git (1.7.x or newer)
|
90 |
+
- Python >= 3.7
|
91 |
+
|
92 |
+
The list of dependencies are listed in `./requirements.txt` and `./test-requirements.txt`.
|
93 |
+
The installer takes care of installing them for you.
|
94 |
+
|
95 |
+
### INSTALL
|
96 |
+
|
97 |
+
GitPython and its required package dependencies can be installed in any of the following ways, all of which should typically be done in a [virtual environment](https://docs.python.org/3/tutorial/venv.html).
|
98 |
+
|
99 |
+
#### From PyPI
|
100 |
+
|
101 |
+
To obtain and install a copy [from PyPI](https://pypi.org/project/GitPython/), run:
|
102 |
+
|
103 |
+
```bash
|
104 |
+
pip install GitPython
|
105 |
+
```
|
106 |
+
|
107 |
+
(A distribution package can also be downloaded for manual installation at [the PyPI page](https://pypi.org/project/GitPython/).)
|
108 |
+
|
109 |
+
#### From downloaded source code
|
110 |
+
|
111 |
+
If you have downloaded the source code, run this from inside the unpacked `GitPython` directory:
|
112 |
+
|
113 |
+
```bash
|
114 |
+
pip install .
|
115 |
+
```
|
116 |
+
|
117 |
+
#### By cloning the source code repository
|
118 |
+
|
119 |
+
To clone the [the GitHub repository](https://github.com/gitpython-developers/GitPython) from source to work on the code, you can do it like so:
|
120 |
+
|
121 |
+
```bash
|
122 |
+
git clone https://github.com/gitpython-developers/GitPython
|
123 |
+
cd GitPython
|
124 |
+
./init-tests-after-clone.sh
|
125 |
+
```
|
126 |
+
|
127 |
+
On Windows, `./init-tests-after-clone.sh` can be run in a Git Bash shell.
|
128 |
+
|
129 |
+
If you are cloning [your own fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks), then replace the above `git clone` command with one that gives the URL of your fork. Or use this [`gh`](https://cli.github.com/) command (assuming you have `gh` and your fork is called `GitPython`):
|
130 |
+
|
131 |
+
```bash
|
132 |
+
gh repo clone GitPython
|
133 |
+
```
|
134 |
+
|
135 |
+
Having cloned the repo, create and activate your [virtual environment](https://docs.python.org/3/tutorial/venv.html).
|
136 |
+
|
137 |
+
Then make an [editable install](https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs):
|
138 |
+
|
139 |
+
```bash
|
140 |
+
pip install -e ".[test]"
|
141 |
+
```
|
142 |
+
|
143 |
+
In the less common case that you do not want to install test dependencies, `pip install -e .` can be used instead.
|
144 |
+
|
145 |
+
#### With editable *dependencies* (not preferred, and rarely needed)
|
146 |
+
|
147 |
+
In rare cases, you may want to work on GitPython and one or both of its [gitdb](https://github.com/gitpython-developers/gitdb) and [smmap](https://github.com/gitpython-developers/smmap) dependencies at the same time, with changes in your local working copy of gitdb or smmap immediatley reflected in the behavior of your local working copy of GitPython. This can be done by making editable installations of those dependencies in the same virtual environment where you install GitPython.
|
148 |
+
|
149 |
+
If you want to do that *and* you want the versions in GitPython's git submodules to be used, then pass `-e git/ext/gitdb` and/or `-e git/ext/gitdb/gitdb/ext/smmap` to `pip install`. This can be done in any order, and in separate `pip install` commands or the same one, so long as `-e` appears before *each* path. For example, you can install GitPython, gitdb, and smmap editably in the currently active virtual environment this way:
|
150 |
+
|
151 |
+
```bash
|
152 |
+
pip install -e ".[test]" -e git/ext/gitdb -e git/ext/gitdb/gitdb/ext/smmap
|
153 |
+
```
|
154 |
+
|
155 |
+
The submodules must have been cloned for that to work, but that will already be the case if you have run `./init-tests-after-clone.sh`. You can use `pip list` to check which packages are installed editably and which are installed normally.
|
156 |
+
|
157 |
+
To reiterate, this approach should only rarely be used. For most development it is preferable to allow the gitdb and smmap dependencices to be retrieved automatically from PyPI in their latest stable packaged versions.
|
158 |
+
|
159 |
+
### Limitations
|
160 |
+
|
161 |
+
#### Leakage of System Resources
|
162 |
+
|
163 |
+
GitPython is not suited for long-running processes (like daemons) as it tends to
|
164 |
+
leak system resources. It was written in a time where destructors (as implemented
|
165 |
+
in the `__del__` method) still ran deterministically.
|
166 |
+
|
167 |
+
In case you still want to use it in such a context, you will want to search the
|
168 |
+
codebase for `__del__` implementations and call these yourself when you see fit.
|
169 |
+
|
170 |
+
Another way assure proper cleanup of resources is to factor out GitPython into a
|
171 |
+
separate process which can be dropped periodically.
|
172 |
+
|
173 |
+
#### Windows support
|
174 |
+
|
175 |
+
See [Issue #525](https://github.com/gitpython-developers/GitPython/issues/525).
|
176 |
+
|
177 |
+
### RUNNING TESTS
|
178 |
+
|
179 |
+
_Important_: Right after cloning this repository, please be sure to have executed
|
180 |
+
the `./init-tests-after-clone.sh` script in the repository root. Otherwise
|
181 |
+
you will encounter test failures.
|
182 |
+
|
183 |
+
#### Install test dependencies
|
184 |
+
|
185 |
+
Ensure testing libraries are installed. This is taken care of already if you installed with:
|
186 |
+
|
187 |
+
```bash
|
188 |
+
pip install -e ".[test]"
|
189 |
+
```
|
190 |
+
|
191 |
+
Otherwise, you can run:
|
192 |
+
|
193 |
+
```bash
|
194 |
+
pip install -r test-requirements.txt
|
195 |
+
```
|
196 |
+
|
197 |
+
#### Test commands
|
198 |
+
|
199 |
+
To test, run:
|
200 |
+
|
201 |
+
```bash
|
202 |
+
pytest
|
203 |
+
```
|
204 |
+
|
205 |
+
To lint, and apply automatic code formatting, run:
|
206 |
+
|
207 |
+
```bash
|
208 |
+
pre-commit run --all-files
|
209 |
+
```
|
210 |
+
|
211 |
+
- Linting without modifying code can be done with: `make lint`
|
212 |
+
- Auto-formatting without other lint checks can be done with: `black .`
|
213 |
+
|
214 |
+
To typecheck, run:
|
215 |
+
|
216 |
+
```bash
|
217 |
+
mypy -p git
|
218 |
+
```
|
219 |
+
|
220 |
+
#### CI (and tox)
|
221 |
+
|
222 |
+
The same linting, and running tests on all the different supported Python versions, will be performed:
|
223 |
+
|
224 |
+
- Upon submitting a pull request.
|
225 |
+
- On each push, *if* you have a fork with GitHub Actions enabled.
|
226 |
+
- Locally, if you run [`tox`](https://tox.wiki/) (this skips any Python versions you don't have installed).
|
227 |
+
|
228 |
+
#### Configuration files
|
229 |
+
|
230 |
+
Specific tools:
|
231 |
+
|
232 |
+
- Configurations for `mypy`, `pytest`, `coverage.py`, and `black` are in `./pyproject.toml`.
|
233 |
+
- Configuration for `flake8` is in the `./.flake8` file.
|
234 |
+
|
235 |
+
Orchestration tools:
|
236 |
+
|
237 |
+
- Configuration for `pre-commit` is in the `./.pre-commit-config.yaml` file.
|
238 |
+
- Configuration for `tox` is in `./tox.ini`.
|
239 |
+
- Configuration for GitHub Actions (CI) is in files inside `./.github/workflows/`.
|
240 |
+
|
241 |
+
### Contributions
|
242 |
+
|
243 |
+
Please have a look at the [contributions file][contributing].
|
244 |
+
|
245 |
+
### INFRASTRUCTURE
|
246 |
+
|
247 |
+
- [User Documentation](http://gitpython.readthedocs.org)
|
248 |
+
- [Questions and Answers](http://stackexchange.com/filters/167317/gitpython)
|
249 |
+
- Please post on Stack Overflow and use the `gitpython` tag
|
250 |
+
- [Issue Tracker](https://github.com/gitpython-developers/GitPython/issues)
|
251 |
+
- Post reproducible bugs and feature requests as a new issue.
|
252 |
+
Please be sure to provide the following information if posting bugs:
|
253 |
+
- GitPython version (e.g. `import git; git.__version__`)
|
254 |
+
- Python version (e.g. `python --version`)
|
255 |
+
- The encountered stack-trace, if applicable
|
256 |
+
- Enough information to allow reproducing the issue
|
257 |
+
|
258 |
+
### How to make a new release
|
259 |
+
|
260 |
+
1. Update/verify the **version** in the `VERSION` file.
|
261 |
+
2. Update/verify that the `doc/source/changes.rst` changelog file was updated. It should include a link to the forthcoming release page: `https://github.com/gitpython-developers/GitPython/releases/tag/<version>`
|
262 |
+
3. Commit everything.
|
263 |
+
4. Run `git tag -s <version>` to tag the version in Git.
|
264 |
+
5. _Optionally_ create and activate a [virtual environment](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment). (Then the next step can install `build` and `twine`.)
|
265 |
+
6. Run `make release`.
|
266 |
+
7. Go to [GitHub Releases](https://github.com/gitpython-developers/GitPython/releases) and publish a new one with the recently pushed tag. Generate the changelog.
|
267 |
+
|
268 |
+
### How to verify a release (DEPRECATED)
|
269 |
+
|
270 |
+
Note that what follows is deprecated and future releases won't be signed anymore.
|
271 |
+
More details about how it came to that can be found [in this issue](https://github.com/gitpython-developers/gitdb/issues/77).
|
272 |
+
|
273 |
+
----
|
274 |
+
|
275 |
+
Please only use releases from `pypi` as you can verify the respective source
|
276 |
+
tarballs.
|
277 |
+
|
278 |
+
This script shows how to verify the tarball was indeed created by the authors of
|
279 |
+
this project:
|
280 |
+
|
281 |
+
```bash
|
282 |
+
curl https://files.pythonhosted.org/packages/09/bc/ae32e07e89cc25b9e5c793d19a1e5454d30a8e37d95040991160f942519e/GitPython-3.1.8-py3-none-any.whl > gitpython.whl
|
283 |
+
curl https://files.pythonhosted.org/packages/09/bc/ae32e07e89cc25b9e5c793d19a1e5454d30a8e37d95040991160f942519e/GitPython-3.1.8-py3-none-any.whl.asc > gitpython-signature.asc
|
284 |
+
gpg --verify gitpython-signature.asc gitpython.whl
|
285 |
+
```
|
286 |
+
|
287 |
+
which outputs
|
288 |
+
|
289 |
+
```bash
|
290 |
+
gpg: Signature made Fr 4 Sep 10:04:50 2020 CST
|
291 |
+
gpg: using RSA key 27C50E7F590947D7273A741E85194C08421980C9
|
292 |
+
gpg: Good signature from "Sebastian Thiel (YubiKey USB-C) <[email protected]>" [ultimate]
|
293 |
+
gpg: aka "Sebastian Thiel (In Rust I trust) <[email protected]>" [ultimate]
|
294 |
+
```
|
295 |
+
|
296 |
+
You can verify that the keyid indeed matches the release-signature key provided in this
|
297 |
+
repository by looking at the keys details:
|
298 |
+
|
299 |
+
```bash
|
300 |
+
gpg --list-packets ./release-verification-key.asc
|
301 |
+
```
|
302 |
+
|
303 |
+
You can verify that the commit adding it was also signed by it using:
|
304 |
+
|
305 |
+
```bash
|
306 |
+
git show --show-signature ./release-verification-key.asc
|
307 |
+
```
|
308 |
+
|
309 |
+
If you would like to trust it permanently, you can import and sign it:
|
310 |
+
|
311 |
+
```bash
|
312 |
+
gpg --import ./release-verification-key.asc
|
313 |
+
gpg --edit-key 4C08421980C9
|
314 |
+
|
315 |
+
> sign
|
316 |
+
> save
|
317 |
+
```
|
318 |
+
|
319 |
+
### Projects using GitPython
|
320 |
+
|
321 |
+
- [PyDriller](https://github.com/ishepard/pydriller)
|
322 |
+
- [Kivy Designer](https://github.com/kivy/kivy-designer)
|
323 |
+
- [Prowl](https://github.com/nettitude/Prowl)
|
324 |
+
- [Python Taint](https://github.com/python-security/pyt)
|
325 |
+
- [Buster](https://github.com/axitkhurana/buster)
|
326 |
+
- [git-ftp](https://github.com/ezyang/git-ftp)
|
327 |
+
- [Git-Pandas](https://github.com/wdm0006/git-pandas)
|
328 |
+
- [PyGitUp](https://github.com/msiemens/PyGitUp)
|
329 |
+
- [PyJFuzz](https://github.com/mseclab/PyJFuzz)
|
330 |
+
- [Loki](https://github.com/Neo23x0/Loki)
|
331 |
+
- [Omniwallet](https://github.com/OmniLayer/omniwallet)
|
332 |
+
- [GitViper](https://github.com/BeayemX/GitViper)
|
333 |
+
- [Git Gud](https://github.com/bthayer2365/git-gud)
|
334 |
+
|
335 |
+
### LICENSE
|
336 |
+
|
337 |
+
[3-Clause BSD License](https://opensource.org/license/bsd-3-clause/), also known as the New BSD License. See the [LICENSE file][license].
|
338 |
+
|
339 |
+
[contributing]: https://github.com/gitpython-developers/GitPython/blob/main/CONTRIBUTING.md
|
340 |
+
[license]: https://github.com/gitpython-developers/GitPython/blob/main/LICENSE
|
venv/lib/python3.11/site-packages/GitPython-3.1.41.dist-info/RECORD
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
GitPython-3.1.41.dist-info/AUTHORS,sha256=te58dvSkF-Ru6CFfw39VqZ0BP5IrCf_qobf7LiiM4RQ,2242
|
2 |
+
GitPython-3.1.41.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
3 |
+
GitPython-3.1.41.dist-info/LICENSE,sha256=hvyUwyGpr7wRUUcTURuv3tIl8lEA3MD3NQ6CvCMbi-s,1503
|
4 |
+
GitPython-3.1.41.dist-info/METADATA,sha256=O2h4kXxWFoJHypZyGIzBW71W9PfEGxz9rX_RU-Oz2kI,14410
|
5 |
+
GitPython-3.1.41.dist-info/RECORD,,
|
6 |
+
GitPython-3.1.41.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
7 |
+
GitPython-3.1.41.dist-info/top_level.txt,sha256=0hzDuIp8obv624V3GmbqsagBWkk8ohtGU-Bc1PmTT0o,4
|
8 |
+
git/__init__.py,sha256=tsqz7gpXuDRVq_4v32kxsNcSL8OpPLPhnNE6x5YWVek,3565
|
9 |
+
git/__pycache__/__init__.cpython-311.pyc,,
|
10 |
+
git/__pycache__/cmd.cpython-311.pyc,,
|
11 |
+
git/__pycache__/compat.cpython-311.pyc,,
|
12 |
+
git/__pycache__/config.cpython-311.pyc,,
|
13 |
+
git/__pycache__/db.cpython-311.pyc,,
|
14 |
+
git/__pycache__/diff.cpython-311.pyc,,
|
15 |
+
git/__pycache__/exc.cpython-311.pyc,,
|
16 |
+
git/__pycache__/remote.cpython-311.pyc,,
|
17 |
+
git/__pycache__/types.cpython-311.pyc,,
|
18 |
+
git/__pycache__/util.cpython-311.pyc,,
|
19 |
+
git/cmd.py,sha256=O7dS-QIt0CvrcP_8yfIjs1FkWCN40NLQ4PKCu9iN4GE,57713
|
20 |
+
git/compat.py,sha256=WGmGWAwpeLnp1hGwXkDm57hGjvd00mqhXXFXtoeAmRQ,3430
|
21 |
+
git/config.py,sha256=LPI99x5VU2W6Osr_0JfbIf8DQ41-Bckjd5QWpkeMy44,34541
|
22 |
+
git/db.py,sha256=pHczdHStrA7kDNlZXWkHtHdCm16dxomWP1caoiCd9qQ,2373
|
23 |
+
git/diff.py,sha256=C9IDk3DlvJSPqecTgW1znkP_17tb5Dw0A3zGTbcxFac,23583
|
24 |
+
git/exc.py,sha256=EdTxJ_TMRqN377xDHSJnKthlyd9bxP4lrtxmy_4nPgs,6990
|
25 |
+
git/index/__init__.py,sha256=p2THvsiwJxsHfmZ8y1qgRQYyixUTjCqA7UvFU3x-Gj4,245
|
26 |
+
git/index/__pycache__/__init__.cpython-311.pyc,,
|
27 |
+
git/index/__pycache__/base.cpython-311.pyc,,
|
28 |
+
git/index/__pycache__/fun.cpython-311.pyc,,
|
29 |
+
git/index/__pycache__/typ.cpython-311.pyc,,
|
30 |
+
git/index/__pycache__/util.cpython-311.pyc,,
|
31 |
+
git/index/base.py,sha256=u7ZNDT_rrArRtMJdxWKUpGB548n9F_gsk98Cofe-WZM,58674
|
32 |
+
git/index/fun.py,sha256=15bHv4NGc7ix5mrBXdpcv45UtAeFTxiBl_0AaOiPUJI,16480
|
33 |
+
git/index/typ.py,sha256=YXcZkqj27zYyIIl63d6Ziy_HnaQfBYY7myx46gXwGDs,6399
|
34 |
+
git/index/util.py,sha256=m29sIVFrviQBVCNpm0wneyDT2_a42ZGuHuA9qfjKyAU,3807
|
35 |
+
git/objects/__init__.py,sha256=VCNAKk0DuLrDywRqpKvsclYPG3FQvvkfp2NKa5xvEtM,936
|
36 |
+
git/objects/__pycache__/__init__.cpython-311.pyc,,
|
37 |
+
git/objects/__pycache__/base.cpython-311.pyc,,
|
38 |
+
git/objects/__pycache__/blob.cpython-311.pyc,,
|
39 |
+
git/objects/__pycache__/commit.cpython-311.pyc,,
|
40 |
+
git/objects/__pycache__/fun.cpython-311.pyc,,
|
41 |
+
git/objects/__pycache__/tag.cpython-311.pyc,,
|
42 |
+
git/objects/__pycache__/tree.cpython-311.pyc,,
|
43 |
+
git/objects/__pycache__/util.cpython-311.pyc,,
|
44 |
+
git/objects/base.py,sha256=5x8TiAstqVTfblTA8Rx9cOKf4OxRiEvVsxHyyok-zSo,7935
|
45 |
+
git/objects/blob.py,sha256=saOGrQIHLMIptPPtZW9bBorcKTCD0AJTph5ENXYqy2g,990
|
46 |
+
git/objects/commit.py,sha256=xSnO9k2Ol-lQaOhDqUig_MoVbVE0ciX1Fw0H4vnH61w,28991
|
47 |
+
git/objects/fun.py,sha256=AVuHV94BZzEvu9Bk1n-BKvBVt4qJr_-ajlLDMrZWFX8,8786
|
48 |
+
git/objects/submodule/__init__.py,sha256=5hDkqdqcqYZ6cQXP4S8JQT7UBWnrbYzo7GrrEn8b_TI,227
|
49 |
+
git/objects/submodule/__pycache__/__init__.cpython-311.pyc,,
|
50 |
+
git/objects/submodule/__pycache__/base.cpython-311.pyc,,
|
51 |
+
git/objects/submodule/__pycache__/root.cpython-311.pyc,,
|
52 |
+
git/objects/submodule/__pycache__/util.cpython-311.pyc,,
|
53 |
+
git/objects/submodule/base.py,sha256=ohl5El3LyJ_J3_LhnpRWtv5fftLbApQl1iQYmou3I0E,61728
|
54 |
+
git/objects/submodule/root.py,sha256=3RWww-v-WxoI6ejLlzJsToVGQwO8j3Q3gSyjibf_JP4,19960
|
55 |
+
git/objects/submodule/util.py,sha256=T0JZAuxjWc7xvz37lnkOu60gDReC5Pmtvx98NYSQS20,3459
|
56 |
+
git/objects/tag.py,sha256=hJ54onZiN_phrx6OpB0aZUaaBtHJx-uTZrgP8f9FfWQ,3823
|
57 |
+
git/objects/tree.py,sha256=8l3ZN9LX3_yGq0gF_pCPv6SgTmv5_AIVbsfCXPUEiWE,14391
|
58 |
+
git/objects/util.py,sha256=6ixwVW_ZWoptjNuZB8WHCzqGunc-Z4m_nS98awkiAnQ,22908
|
59 |
+
git/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
60 |
+
git/refs/__init__.py,sha256=2tQPcfYLW_o_-46vCax0VhvAE8KMsE2OquGJ7TVi1C0,435
|
61 |
+
git/refs/__pycache__/__init__.cpython-311.pyc,,
|
62 |
+
git/refs/__pycache__/head.cpython-311.pyc,,
|
63 |
+
git/refs/__pycache__/log.cpython-311.pyc,,
|
64 |
+
git/refs/__pycache__/reference.cpython-311.pyc,,
|
65 |
+
git/refs/__pycache__/remote.cpython-311.pyc,,
|
66 |
+
git/refs/__pycache__/symbolic.cpython-311.pyc,,
|
67 |
+
git/refs/__pycache__/tag.cpython-311.pyc,,
|
68 |
+
git/refs/head.py,sha256=B3LunzZo3Ez8gOzwsYePDaW7PG7ZtxFcD55Uhb9h1oI,10095
|
69 |
+
git/refs/log.py,sha256=itRAZ-N-dT4FcoDrm1kBbCb4kI6727_CJQAEx8q1QKc,12072
|
70 |
+
git/refs/reference.py,sha256=MV2ASx1pzGY_VBJrOmZpWTyI0tOeuxuYVGinFh7PgLU,5622
|
71 |
+
git/refs/remote.py,sha256=wD_9tzh7LcHXy4ri9DugIVMhwHB8eBR1ygDxCnlWkPs,2779
|
72 |
+
git/refs/symbolic.py,sha256=9oBKCCoBLSWnEWdO1h9JiQLkhNRc4ShSukxJ3ZvLYq8,33371
|
73 |
+
git/refs/tag.py,sha256=XTJr--vJj2F__HvdtKmpyP1tJ1ADMY5evPLyrCjStTs,4547
|
74 |
+
git/remote.py,sha256=_wwAYyyHYB6M_IW0LY3xbJUHERV5h3tKPoQzcTPzA6k,45368
|
75 |
+
git/repo/__init__.py,sha256=R88bSPa2-QCSwaCJ4fjWgiNPcneCFs1eajYI1R-apg0,212
|
76 |
+
git/repo/__pycache__/__init__.cpython-311.pyc,,
|
77 |
+
git/repo/__pycache__/base.cpython-311.pyc,,
|
78 |
+
git/repo/__pycache__/fun.cpython-311.pyc,,
|
79 |
+
git/repo/base.py,sha256=SOF2Xj3jEVKkujf6xJceZrN9DdPD6Thjc-ews2f29qY,56529
|
80 |
+
git/repo/fun.py,sha256=fxKH9TKKO3JY294V749V6nqriDmcfyEgJgJ-I5NQIrs,13083
|
81 |
+
git/types.py,sha256=gOGkkEo6FV5caSfH1bpm4nvgavhSZuIoOyBnfydFQ14,3062
|
82 |
+
git/util.py,sha256=jPOEExcW9Dekccv6HIkMeDh0YAU5vf4NirlzsxvxpIU,42299
|
venv/lib/python3.11/site-packages/GitPython-3.1.41.dist-info/WHEEL
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Wheel-Version: 1.0
|
2 |
+
Generator: bdist_wheel (0.42.0)
|
3 |
+
Root-Is-Purelib: true
|
4 |
+
Tag: py3-none-any
|
5 |
+
|
venv/lib/python3.11/site-packages/GitPython-3.1.41.dist-info/top_level.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
git
|
venv/lib/python3.11/site-packages/Jinja2-3.1.3.dist-info/INSTALLER
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
pip
|
venv/lib/python3.11/site-packages/Jinja2-3.1.3.dist-info/LICENSE.rst
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Copyright 2007 Pallets
|
2 |
+
|
3 |
+
Redistribution and use in source and binary forms, with or without
|
4 |
+
modification, are permitted provided that the following conditions are
|
5 |
+
met:
|
6 |
+
|
7 |
+
1. Redistributions of source code must retain the above copyright
|
8 |
+
notice, this list of conditions and the following disclaimer.
|
9 |
+
|
10 |
+
2. Redistributions in binary form must reproduce the above copyright
|
11 |
+
notice, this list of conditions and the following disclaimer in the
|
12 |
+
documentation and/or other materials provided with the distribution.
|
13 |
+
|
14 |
+
3. Neither the name of the copyright holder nor the names of its
|
15 |
+
contributors may be used to endorse or promote products derived from
|
16 |
+
this software without specific prior written permission.
|
17 |
+
|
18 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
19 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
20 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
21 |
+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
22 |
+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
23 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
24 |
+
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
25 |
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
26 |
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
27 |
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
28 |
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
venv/lib/python3.11/site-packages/Jinja2-3.1.3.dist-info/METADATA
ADDED
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Metadata-Version: 2.1
|
2 |
+
Name: Jinja2
|
3 |
+
Version: 3.1.3
|
4 |
+
Summary: A very fast and expressive template engine.
|
5 |
+
Home-page: https://palletsprojects.com/p/jinja/
|
6 |
+
Maintainer: Pallets
|
7 |
+
Maintainer-email: [email protected]
|
8 |
+
License: BSD-3-Clause
|
9 |
+
Project-URL: Donate, https://palletsprojects.com/donate
|
10 |
+
Project-URL: Documentation, https://jinja.palletsprojects.com/
|
11 |
+
Project-URL: Changes, https://jinja.palletsprojects.com/changes/
|
12 |
+
Project-URL: Source Code, https://github.com/pallets/jinja/
|
13 |
+
Project-URL: Issue Tracker, https://github.com/pallets/jinja/issues/
|
14 |
+
Project-URL: Chat, https://discord.gg/pallets
|
15 |
+
Classifier: Development Status :: 5 - Production/Stable
|
16 |
+
Classifier: Environment :: Web Environment
|
17 |
+
Classifier: Intended Audience :: Developers
|
18 |
+
Classifier: License :: OSI Approved :: BSD License
|
19 |
+
Classifier: Operating System :: OS Independent
|
20 |
+
Classifier: Programming Language :: Python
|
21 |
+
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
22 |
+
Classifier: Topic :: Text Processing :: Markup :: HTML
|
23 |
+
Requires-Python: >=3.7
|
24 |
+
Description-Content-Type: text/x-rst
|
25 |
+
License-File: LICENSE.rst
|
26 |
+
Requires-Dist: MarkupSafe >=2.0
|
27 |
+
Provides-Extra: i18n
|
28 |
+
Requires-Dist: Babel >=2.7 ; extra == 'i18n'
|
29 |
+
|
30 |
+
Jinja
|
31 |
+
=====
|
32 |
+
|
33 |
+
Jinja is a fast, expressive, extensible templating engine. Special
|
34 |
+
placeholders in the template allow writing code similar to Python
|
35 |
+
syntax. Then the template is passed data to render the final document.
|
36 |
+
|
37 |
+
It includes:
|
38 |
+
|
39 |
+
- Template inheritance and inclusion.
|
40 |
+
- Define and import macros within templates.
|
41 |
+
- HTML templates can use autoescaping to prevent XSS from untrusted
|
42 |
+
user input.
|
43 |
+
- A sandboxed environment can safely render untrusted templates.
|
44 |
+
- AsyncIO support for generating templates and calling async
|
45 |
+
functions.
|
46 |
+
- I18N support with Babel.
|
47 |
+
- Templates are compiled to optimized Python code just-in-time and
|
48 |
+
cached, or can be compiled ahead-of-time.
|
49 |
+
- Exceptions point to the correct line in templates to make debugging
|
50 |
+
easier.
|
51 |
+
- Extensible filters, tests, functions, and even syntax.
|
52 |
+
|
53 |
+
Jinja's philosophy is that while application logic belongs in Python if
|
54 |
+
possible, it shouldn't make the template designer's job difficult by
|
55 |
+
restricting functionality too much.
|
56 |
+
|
57 |
+
|
58 |
+
Installing
|
59 |
+
----------
|
60 |
+
|
61 |
+
Install and update using `pip`_:
|
62 |
+
|
63 |
+
.. code-block:: text
|
64 |
+
|
65 |
+
$ pip install -U Jinja2
|
66 |
+
|
67 |
+
.. _pip: https://pip.pypa.io/en/stable/getting-started/
|
68 |
+
|
69 |
+
|
70 |
+
In A Nutshell
|
71 |
+
-------------
|
72 |
+
|
73 |
+
.. code-block:: jinja
|
74 |
+
|
75 |
+
{% extends "base.html" %}
|
76 |
+
{% block title %}Members{% endblock %}
|
77 |
+
{% block content %}
|
78 |
+
<ul>
|
79 |
+
{% for user in users %}
|
80 |
+
<li><a href="{{ user.url }}">{{ user.username }}</a></li>
|
81 |
+
{% endfor %}
|
82 |
+
</ul>
|
83 |
+
{% endblock %}
|
84 |
+
|
85 |
+
|
86 |
+
Donate
|
87 |
+
------
|
88 |
+
|
89 |
+
The Pallets organization develops and supports Jinja and other popular
|
90 |
+
packages. In order to grow the community of contributors and users, and
|
91 |
+
allow the maintainers to devote more time to the projects, `please
|
92 |
+
donate today`_.
|
93 |
+
|
94 |
+
.. _please donate today: https://palletsprojects.com/donate
|
95 |
+
|
96 |
+
|
97 |
+
Links
|
98 |
+
-----
|
99 |
+
|
100 |
+
- Documentation: https://jinja.palletsprojects.com/
|
101 |
+
- Changes: https://jinja.palletsprojects.com/changes/
|
102 |
+
- PyPI Releases: https://pypi.org/project/Jinja2/
|
103 |
+
- Source Code: https://github.com/pallets/jinja/
|
104 |
+
- Issue Tracker: https://github.com/pallets/jinja/issues/
|
105 |
+
- Chat: https://discord.gg/pallets
|
venv/lib/python3.11/site-packages/Jinja2-3.1.3.dist-info/RECORD
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Jinja2-3.1.3.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
2 |
+
Jinja2-3.1.3.dist-info/LICENSE.rst,sha256=O0nc7kEF6ze6wQ-vG-JgQI_oXSUrjp3y4JefweCUQ3s,1475
|
3 |
+
Jinja2-3.1.3.dist-info/METADATA,sha256=0cLNbRCI91jytc7Bzv3XAQfZzFDF2gxkJuH46eF5vew,3301
|
4 |
+
Jinja2-3.1.3.dist-info/RECORD,,
|
5 |
+
Jinja2-3.1.3.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
6 |
+
Jinja2-3.1.3.dist-info/entry_points.txt,sha256=zRd62fbqIyfUpsRtU7EVIFyiu1tPwfgO7EvPErnxgTE,59
|
7 |
+
Jinja2-3.1.3.dist-info/top_level.txt,sha256=PkeVWtLb3-CqjWi1fO29OCbj55EhX_chhKrCdrVe_zs,7
|
8 |
+
jinja2/__init__.py,sha256=NTBwMwsECrdHmxeXF7seusHLzrh6Ldn1A9qhS5cDuf0,1927
|
9 |
+
jinja2/__pycache__/__init__.cpython-311.pyc,,
|
10 |
+
jinja2/__pycache__/_identifier.cpython-311.pyc,,
|
11 |
+
jinja2/__pycache__/async_utils.cpython-311.pyc,,
|
12 |
+
jinja2/__pycache__/bccache.cpython-311.pyc,,
|
13 |
+
jinja2/__pycache__/compiler.cpython-311.pyc,,
|
14 |
+
jinja2/__pycache__/constants.cpython-311.pyc,,
|
15 |
+
jinja2/__pycache__/debug.cpython-311.pyc,,
|
16 |
+
jinja2/__pycache__/defaults.cpython-311.pyc,,
|
17 |
+
jinja2/__pycache__/environment.cpython-311.pyc,,
|
18 |
+
jinja2/__pycache__/exceptions.cpython-311.pyc,,
|
19 |
+
jinja2/__pycache__/ext.cpython-311.pyc,,
|
20 |
+
jinja2/__pycache__/filters.cpython-311.pyc,,
|
21 |
+
jinja2/__pycache__/idtracking.cpython-311.pyc,,
|
22 |
+
jinja2/__pycache__/lexer.cpython-311.pyc,,
|
23 |
+
jinja2/__pycache__/loaders.cpython-311.pyc,,
|
24 |
+
jinja2/__pycache__/meta.cpython-311.pyc,,
|
25 |
+
jinja2/__pycache__/nativetypes.cpython-311.pyc,,
|
26 |
+
jinja2/__pycache__/nodes.cpython-311.pyc,,
|
27 |
+
jinja2/__pycache__/optimizer.cpython-311.pyc,,
|
28 |
+
jinja2/__pycache__/parser.cpython-311.pyc,,
|
29 |
+
jinja2/__pycache__/runtime.cpython-311.pyc,,
|
30 |
+
jinja2/__pycache__/sandbox.cpython-311.pyc,,
|
31 |
+
jinja2/__pycache__/tests.cpython-311.pyc,,
|
32 |
+
jinja2/__pycache__/utils.cpython-311.pyc,,
|
33 |
+
jinja2/__pycache__/visitor.cpython-311.pyc,,
|
34 |
+
jinja2/_identifier.py,sha256=_zYctNKzRqlk_murTNlzrju1FFJL7Va_Ijqqd7ii2lU,1958
|
35 |
+
jinja2/async_utils.py,sha256=dFcmh6lMNfbh7eLKrBio8JqAKLHdZbpCuurFN4OERtY,2447
|
36 |
+
jinja2/bccache.py,sha256=mhz5xtLxCcHRAa56azOhphIAe19u1we0ojifNMClDio,14061
|
37 |
+
jinja2/compiler.py,sha256=PJzYdRLStlEOqmnQs1YxlizPrJoj3jTZuUleREn6AIQ,72199
|
38 |
+
jinja2/constants.py,sha256=GMoFydBF_kdpaRKPoM5cl5MviquVRLVyZtfp5-16jg0,1433
|
39 |
+
jinja2/debug.py,sha256=iWJ432RadxJNnaMOPrjIDInz50UEgni3_HKuFXi2vuQ,6299
|
40 |
+
jinja2/defaults.py,sha256=boBcSw78h-lp20YbaXSJsqkAI2uN_mD_TtCydpeq5wU,1267
|
41 |
+
jinja2/environment.py,sha256=0qldX3VQKZcm6lgn7zHz94oRFow7YPYERiqkquomNjU,61253
|
42 |
+
jinja2/exceptions.py,sha256=ioHeHrWwCWNaXX1inHmHVblvc4haO7AXsjCp3GfWvx0,5071
|
43 |
+
jinja2/ext.py,sha256=5fnMpllaXkfm2P_93RIvi-OnK7Tk8mCW8Du-GcD12Hc,31844
|
44 |
+
jinja2/filters.py,sha256=vYjKb2zaPShvYtn_LpSmqfS8SScbrA_KOanNibsMDIE,53862
|
45 |
+
jinja2/idtracking.py,sha256=GfNmadir4oDALVxzn3DL9YInhJDr69ebXeA2ygfuCGA,10704
|
46 |
+
jinja2/lexer.py,sha256=DW2nX9zk-6MWp65YR2bqqj0xqCvLtD-u9NWT8AnFRxQ,29726
|
47 |
+
jinja2/loaders.py,sha256=ayAwxfrA1SAffQta0nwSDm3TDT4KYiIGN_D9Z45B310,23085
|
48 |
+
jinja2/meta.py,sha256=GNPEvifmSaU3CMxlbheBOZjeZ277HThOPUTf1RkppKQ,4396
|
49 |
+
jinja2/nativetypes.py,sha256=7GIGALVJgdyL80oZJdQUaUfwSt5q2lSSZbXt0dNf_M4,4210
|
50 |
+
jinja2/nodes.py,sha256=i34GPRAZexXMT6bwuf5SEyvdmS-bRCy9KMjwN5O6pjk,34550
|
51 |
+
jinja2/optimizer.py,sha256=tHkMwXxfZkbfA1KmLcqmBMSaz7RLIvvItrJcPoXTyD8,1650
|
52 |
+
jinja2/parser.py,sha256=Y199wPL-G67gJoi5G_5sHuu9uEP1PJkjjLEW_xTH8-k,39736
|
53 |
+
jinja2/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
54 |
+
jinja2/runtime.py,sha256=_6LkKIWFJjQdqlrgA3K39zBFQ-7Orm3wGDm96RwxQoE,33406
|
55 |
+
jinja2/sandbox.py,sha256=Y0xZeXQnH6EX5VjaV2YixESxoepnRbW_3UeQosaBU3M,14584
|
56 |
+
jinja2/tests.py,sha256=Am5Z6Lmfr2XaH_npIfJJ8MdXtWsbLjMULZJulTAj30E,5905
|
57 |
+
jinja2/utils.py,sha256=IMwRIcN1SsTw2-jdQtlH2KzNABsXZBW_-tnFXafQBvY,23933
|
58 |
+
jinja2/visitor.py,sha256=MH14C6yq24G_KVtWzjwaI7Wg14PCJIYlWW1kpkxYak0,3568
|
venv/lib/python3.11/site-packages/Jinja2-3.1.3.dist-info/WHEEL
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Wheel-Version: 1.0
|
2 |
+
Generator: bdist_wheel (0.42.0)
|
3 |
+
Root-Is-Purelib: true
|
4 |
+
Tag: py3-none-any
|
5 |
+
|
venv/lib/python3.11/site-packages/Jinja2-3.1.3.dist-info/entry_points.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
[babel.extractors]
|
2 |
+
jinja2 = jinja2.ext:babel_extract[i18n]
|
venv/lib/python3.11/site-packages/Jinja2-3.1.3.dist-info/top_level.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
jinja2
|
venv/lib/python3.11/site-packages/MarkupSafe-2.1.5.dist-info/INSTALLER
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
pip
|
venv/lib/python3.11/site-packages/MarkupSafe-2.1.5.dist-info/LICENSE.rst
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Copyright 2010 Pallets
|
2 |
+
|
3 |
+
Redistribution and use in source and binary forms, with or without
|
4 |
+
modification, are permitted provided that the following conditions are
|
5 |
+
met:
|
6 |
+
|
7 |
+
1. Redistributions of source code must retain the above copyright
|
8 |
+
notice, this list of conditions and the following disclaimer.
|
9 |
+
|
10 |
+
2. Redistributions in binary form must reproduce the above copyright
|
11 |
+
notice, this list of conditions and the following disclaimer in the
|
12 |
+
documentation and/or other materials provided with the distribution.
|
13 |
+
|
14 |
+
3. Neither the name of the copyright holder nor the names of its
|
15 |
+
contributors may be used to endorse or promote products derived from
|
16 |
+
this software without specific prior written permission.
|
17 |
+
|
18 |
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
19 |
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
20 |
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
21 |
+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
22 |
+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
23 |
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
24 |
+
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
25 |
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
26 |
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
27 |
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
28 |
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
venv/lib/python3.11/site-packages/MarkupSafe-2.1.5.dist-info/METADATA
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Metadata-Version: 2.1
|
2 |
+
Name: MarkupSafe
|
3 |
+
Version: 2.1.5
|
4 |
+
Summary: Safely add untrusted strings to HTML/XML markup.
|
5 |
+
Home-page: https://palletsprojects.com/p/markupsafe/
|
6 |
+
Maintainer: Pallets
|
7 |
+
Maintainer-email: [email protected]
|
8 |
+
License: BSD-3-Clause
|
9 |
+
Project-URL: Donate, https://palletsprojects.com/donate
|
10 |
+
Project-URL: Documentation, https://markupsafe.palletsprojects.com/
|
11 |
+
Project-URL: Changes, https://markupsafe.palletsprojects.com/changes/
|
12 |
+
Project-URL: Source Code, https://github.com/pallets/markupsafe/
|
13 |
+
Project-URL: Issue Tracker, https://github.com/pallets/markupsafe/issues/
|
14 |
+
Project-URL: Chat, https://discord.gg/pallets
|
15 |
+
Classifier: Development Status :: 5 - Production/Stable
|
16 |
+
Classifier: Environment :: Web Environment
|
17 |
+
Classifier: Intended Audience :: Developers
|
18 |
+
Classifier: License :: OSI Approved :: BSD License
|
19 |
+
Classifier: Operating System :: OS Independent
|
20 |
+
Classifier: Programming Language :: Python
|
21 |
+
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
|
22 |
+
Classifier: Topic :: Text Processing :: Markup :: HTML
|
23 |
+
Requires-Python: >=3.7
|
24 |
+
Description-Content-Type: text/x-rst
|
25 |
+
License-File: LICENSE.rst
|
26 |
+
|
27 |
+
MarkupSafe
|
28 |
+
==========
|
29 |
+
|
30 |
+
MarkupSafe implements a text object that escapes characters so it is
|
31 |
+
safe to use in HTML and XML. Characters that have special meanings are
|
32 |
+
replaced so that they display as the actual characters. This mitigates
|
33 |
+
injection attacks, meaning untrusted user input can safely be displayed
|
34 |
+
on a page.
|
35 |
+
|
36 |
+
|
37 |
+
Installing
|
38 |
+
----------
|
39 |
+
|
40 |
+
Install and update using `pip`_:
|
41 |
+
|
42 |
+
.. code-block:: text
|
43 |
+
|
44 |
+
pip install -U MarkupSafe
|
45 |
+
|
46 |
+
.. _pip: https://pip.pypa.io/en/stable/getting-started/
|
47 |
+
|
48 |
+
|
49 |
+
Examples
|
50 |
+
--------
|
51 |
+
|
52 |
+
.. code-block:: pycon
|
53 |
+
|
54 |
+
>>> from markupsafe import Markup, escape
|
55 |
+
|
56 |
+
>>> # escape replaces special characters and wraps in Markup
|
57 |
+
>>> escape("<script>alert(document.cookie);</script>")
|
58 |
+
Markup('<script>alert(document.cookie);</script>')
|
59 |
+
|
60 |
+
>>> # wrap in Markup to mark text "safe" and prevent escaping
|
61 |
+
>>> Markup("<strong>Hello</strong>")
|
62 |
+
Markup('<strong>hello</strong>')
|
63 |
+
|
64 |
+
>>> escape(Markup("<strong>Hello</strong>"))
|
65 |
+
Markup('<strong>hello</strong>')
|
66 |
+
|
67 |
+
>>> # Markup is a str subclass
|
68 |
+
>>> # methods and operators escape their arguments
|
69 |
+
>>> template = Markup("Hello <em>{name}</em>")
|
70 |
+
>>> template.format(name='"World"')
|
71 |
+
Markup('Hello <em>"World"</em>')
|
72 |
+
|
73 |
+
|
74 |
+
Donate
|
75 |
+
------
|
76 |
+
|
77 |
+
The Pallets organization develops and supports MarkupSafe and other
|
78 |
+
popular packages. In order to grow the community of contributors and
|
79 |
+
users, and allow the maintainers to devote more time to the projects,
|
80 |
+
`please donate today`_.
|
81 |
+
|
82 |
+
.. _please donate today: https://palletsprojects.com/donate
|
83 |
+
|
84 |
+
|
85 |
+
Links
|
86 |
+
-----
|
87 |
+
|
88 |
+
- Documentation: https://markupsafe.palletsprojects.com/
|
89 |
+
- Changes: https://markupsafe.palletsprojects.com/changes/
|
90 |
+
- PyPI Releases: https://pypi.org/project/MarkupSafe/
|
91 |
+
- Source Code: https://github.com/pallets/markupsafe/
|
92 |
+
- Issue Tracker: https://github.com/pallets/markupsafe/issues/
|
93 |
+
- Chat: https://discord.gg/pallets
|
venv/lib/python3.11/site-packages/MarkupSafe-2.1.5.dist-info/RECORD
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
MarkupSafe-2.1.5.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
2 |
+
MarkupSafe-2.1.5.dist-info/LICENSE.rst,sha256=SJqOEQhQntmKN7uYPhHg9-HTHwvY-Zp5yESOf_N9B-o,1475
|
3 |
+
MarkupSafe-2.1.5.dist-info/METADATA,sha256=2dRDPam6OZLfpX0wg1JN5P3u9arqACxVSfdGmsJU7o8,3003
|
4 |
+
MarkupSafe-2.1.5.dist-info/RECORD,,
|
5 |
+
MarkupSafe-2.1.5.dist-info/WHEEL,sha256=AI1yqBLEPcVKWn5Ls2uPawjbqPXPFTYdQLSdN8WFCJw,152
|
6 |
+
MarkupSafe-2.1.5.dist-info/top_level.txt,sha256=qy0Plje5IJuvsCBjejJyhDCjEAdcDLK_2agVcex8Z6U,11
|
7 |
+
markupsafe/__init__.py,sha256=r7VOTjUq7EMQ4v3p4R1LoVOGJg6ysfYRncLr34laRBs,10958
|
8 |
+
markupsafe/__pycache__/__init__.cpython-311.pyc,,
|
9 |
+
markupsafe/__pycache__/_native.cpython-311.pyc,,
|
10 |
+
markupsafe/_native.py,sha256=GR86Qvo_GcgKmKreA1WmYN9ud17OFwkww8E-fiW-57s,1713
|
11 |
+
markupsafe/_speedups.c,sha256=X2XvQVtIdcK4Usz70BvkzoOfjTCmQlDkkjYSn-swE0g,7083
|
12 |
+
markupsafe/_speedups.cpython-311-x86_64-linux-gnu.so,sha256=9PMBIm-zJzHm91NC-mblTC119_dIAldSQ4xFsE1_NPc,53656
|
13 |
+
markupsafe/_speedups.pyi,sha256=vfMCsOgbAXRNLUXkyuyonG8uEWKYU4PDqNuMaDELAYw,229
|
14 |
+
markupsafe/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
venv/lib/python3.11/site-packages/MarkupSafe-2.1.5.dist-info/WHEEL
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Wheel-Version: 1.0
|
2 |
+
Generator: bdist_wheel (0.42.0)
|
3 |
+
Root-Is-Purelib: false
|
4 |
+
Tag: cp311-cp311-manylinux_2_17_x86_64
|
5 |
+
Tag: cp311-cp311-manylinux2014_x86_64
|
6 |
+
|
venv/lib/python3.11/site-packages/MarkupSafe-2.1.5.dist-info/top_level.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
markupsafe
|
venv/lib/python3.11/site-packages/PIL/BdfFontFile.py
ADDED
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#
|
2 |
+
# The Python Imaging Library
|
3 |
+
# $Id$
|
4 |
+
#
|
5 |
+
# bitmap distribution font (bdf) file parser
|
6 |
+
#
|
7 |
+
# history:
|
8 |
+
# 1996-05-16 fl created (as bdf2pil)
|
9 |
+
# 1997-08-25 fl converted to FontFile driver
|
10 |
+
# 2001-05-25 fl removed bogus __init__ call
|
11 |
+
# 2002-11-20 fl robustification (from Kevin Cazabon, Dmitry Vasiliev)
|
12 |
+
# 2003-04-22 fl more robustification (from Graham Dumpleton)
|
13 |
+
#
|
14 |
+
# Copyright (c) 1997-2003 by Secret Labs AB.
|
15 |
+
# Copyright (c) 1997-2003 by Fredrik Lundh.
|
16 |
+
#
|
17 |
+
# See the README file for information on usage and redistribution.
|
18 |
+
#
|
19 |
+
|
20 |
+
"""
|
21 |
+
Parse X Bitmap Distribution Format (BDF)
|
22 |
+
"""
|
23 |
+
from __future__ import annotations
|
24 |
+
|
25 |
+
from typing import BinaryIO
|
26 |
+
|
27 |
+
from . import FontFile, Image
|
28 |
+
|
29 |
+
bdf_slant = {
|
30 |
+
"R": "Roman",
|
31 |
+
"I": "Italic",
|
32 |
+
"O": "Oblique",
|
33 |
+
"RI": "Reverse Italic",
|
34 |
+
"RO": "Reverse Oblique",
|
35 |
+
"OT": "Other",
|
36 |
+
}
|
37 |
+
|
38 |
+
bdf_spacing = {"P": "Proportional", "M": "Monospaced", "C": "Cell"}
|
39 |
+
|
40 |
+
|
41 |
+
def bdf_char(
|
42 |
+
f: BinaryIO,
|
43 |
+
) -> (
|
44 |
+
tuple[
|
45 |
+
str,
|
46 |
+
int,
|
47 |
+
tuple[tuple[int, int], tuple[int, int, int, int], tuple[int, int, int, int]],
|
48 |
+
Image.Image,
|
49 |
+
]
|
50 |
+
| None
|
51 |
+
):
|
52 |
+
# skip to STARTCHAR
|
53 |
+
while True:
|
54 |
+
s = f.readline()
|
55 |
+
if not s:
|
56 |
+
return None
|
57 |
+
if s[:9] == b"STARTCHAR":
|
58 |
+
break
|
59 |
+
id = s[9:].strip().decode("ascii")
|
60 |
+
|
61 |
+
# load symbol properties
|
62 |
+
props = {}
|
63 |
+
while True:
|
64 |
+
s = f.readline()
|
65 |
+
if not s or s[:6] == b"BITMAP":
|
66 |
+
break
|
67 |
+
i = s.find(b" ")
|
68 |
+
props[s[:i].decode("ascii")] = s[i + 1 : -1].decode("ascii")
|
69 |
+
|
70 |
+
# load bitmap
|
71 |
+
bitmap = bytearray()
|
72 |
+
while True:
|
73 |
+
s = f.readline()
|
74 |
+
if not s or s[:7] == b"ENDCHAR":
|
75 |
+
break
|
76 |
+
bitmap += s[:-1]
|
77 |
+
|
78 |
+
# The word BBX
|
79 |
+
# followed by the width in x (BBw), height in y (BBh),
|
80 |
+
# and x and y displacement (BBxoff0, BByoff0)
|
81 |
+
# of the lower left corner from the origin of the character.
|
82 |
+
width, height, x_disp, y_disp = (int(p) for p in props["BBX"].split())
|
83 |
+
|
84 |
+
# The word DWIDTH
|
85 |
+
# followed by the width in x and y of the character in device pixels.
|
86 |
+
dwx, dwy = (int(p) for p in props["DWIDTH"].split())
|
87 |
+
|
88 |
+
bbox = (
|
89 |
+
(dwx, dwy),
|
90 |
+
(x_disp, -y_disp - height, width + x_disp, -y_disp),
|
91 |
+
(0, 0, width, height),
|
92 |
+
)
|
93 |
+
|
94 |
+
try:
|
95 |
+
im = Image.frombytes("1", (width, height), bitmap, "hex", "1")
|
96 |
+
except ValueError:
|
97 |
+
# deal with zero-width characters
|
98 |
+
im = Image.new("1", (width, height))
|
99 |
+
|
100 |
+
return id, int(props["ENCODING"]), bbox, im
|
101 |
+
|
102 |
+
|
103 |
+
class BdfFontFile(FontFile.FontFile):
|
104 |
+
"""Font file plugin for the X11 BDF format."""
|
105 |
+
|
106 |
+
def __init__(self, fp: BinaryIO):
|
107 |
+
super().__init__()
|
108 |
+
|
109 |
+
s = fp.readline()
|
110 |
+
if s[:13] != b"STARTFONT 2.1":
|
111 |
+
msg = "not a valid BDF file"
|
112 |
+
raise SyntaxError(msg)
|
113 |
+
|
114 |
+
props = {}
|
115 |
+
comments = []
|
116 |
+
|
117 |
+
while True:
|
118 |
+
s = fp.readline()
|
119 |
+
if not s or s[:13] == b"ENDPROPERTIES":
|
120 |
+
break
|
121 |
+
i = s.find(b" ")
|
122 |
+
props[s[:i].decode("ascii")] = s[i + 1 : -1].decode("ascii")
|
123 |
+
if s[:i] in [b"COMMENT", b"COPYRIGHT"]:
|
124 |
+
if s.find(b"LogicalFontDescription") < 0:
|
125 |
+
comments.append(s[i + 1 : -1].decode("ascii"))
|
126 |
+
|
127 |
+
while True:
|
128 |
+
c = bdf_char(fp)
|
129 |
+
if not c:
|
130 |
+
break
|
131 |
+
id, ch, (xy, dst, src), im = c
|
132 |
+
if 0 <= ch < len(self.glyph):
|
133 |
+
self.glyph[ch] = xy, dst, src, im
|