Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions hw3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
**macOS Monterey version 12.4**<br>
**Python 3.11.0rc2**


1. Download Python (version 3.11) from official site:
[https://www.python.org/downloads/release/python-3110rc2/](https://www.python.org/downloads/release/python-3110rc2/).<br>
Install Python 3.11.

2. In terminal run command:<br>
```
/Applications/Python\ 3.11/Install\ Certificates.command
```

3. In the directory containing files *ultraviolence.py* and *requirements.txt*, create python3.11 virtual environment:<br>
```
python3.11 -m venv .venv
```

4. Activate python3.11 virtual environment *.venv*:<br>
```
source ./.venv/bin/activate
```

5. Install all required packages:<br>
```
pip install -r requirements.txt
```

6. Using any text editor, edit file *.venv_test/lib/python3.11/site-packages/pandas/core/frame.py*<br>

Find the following lines and comment them (add '#' in the beginning):<br>

>\# GH47215<br>
>\#if index is not None and isinstance(index, set):<br>
>\# raise ValueError("index cannot be a set")<br>
Comment on lines +29 to +35

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно было просто установить pandas<=1.4



7. Run script:<br>
```
python ultraviolence.py
```

8. In the end, deactivate virtual environment *.venv*:<br>
```
deactivate
```
35 changes: 35 additions & 0 deletions hw3/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
aiohttp==3.8.3
aiosignal==1.2.0
async-timeout==4.0.2
attrs==22.1.0
beautifulsoup4==4.11.1
biopython==1.79
cachetools==5.2.0
certifi==2022.9.24
charset-normalizer==2.1.1
frozenlist==1.3.1
google-api-core==2.10.2
google-api-python-client==2.65.0
google-auth==2.13.0
google-auth-httplib2==0.1.0
googleapis-common-protos==1.56.4
httplib2==0.20.4
idna==3.4
lxml==4.9.1
multidict==6.0.2
numpy==1.23.4
opencv-python==4.6.0.66
pandas==1.5.1
protobuf==4.21.8
pyasn1==0.4.8
pyasn1-modules==0.2.8
pyparsing==3.0.9
python-dateutil==2.8.2
pytz==2022.5
requests==2.28.1
rsa==4.9
six==1.16.0
soupsieve==2.3.2.post1
uritemplate==4.1.1
urllib3==1.26.12
yarl==1.8.1
38 changes: 38 additions & 0 deletions hw3/ultraviolence.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import google
import math
from typing import Dict
from bs4 import builder, BeautifulSoup
import requests
from Bio import pairwise2
from Bio.SubsMat import MatrixInfo as matlist
import aiohttp
import pandas
import cv2


def update_dictionary(dct1: Dict, dct2: dict) -> None:
return dct1 | dct2


dict1 = {"A": 1, "B": 2}
dict2 = {"A": 3, "C": 8}
string = f"{math.pi:.5f}"
BeautifulSoup("", "lxml")
update_dictionary(dict1, dict2)
alignments = max(pairwise2.align.globalds("ATATCTCGATCGCTACGTC", "CTAGCTCGCTGCTCAGCATC",
matlist.blosum62, -10, -0.5), key=lambda x: x.score)

try:
some_string = "abc dfg"
match some_string.split():
case var, "dfg":
print("It works")
case _:
print("Not working")
except* ExceptionGroup:
pass

print(alignments)
pandas.read_html("https://www.w3schools.com/html/html_tables.asp")[0]
pandas.DataFrame([1, 2, 3, 4], index={1, 2, 3, 4})
print(b'\xd0\x92\xd1\x81\xd1\x91 \xd1\x80\xd0\xb0\xd0\xb1\xd0\xbe\xd1\x82\xd0\xb0\xd0\xb5\xd1\x82, \xd1\x82\xd1\x8b \xd0\xb1\xd0\xbe\xd0\xbb\xd1\x8c\xd1\x88(\xd0\xbe\xd0\xb9/\xd0\xb0\xd1\x8f) \xd0\xbc\xd0\xbe\xd0\xbb\xd0\xbe\xd0\xb4\xd0\xb5\xd1\x86!!!!'.decode("utf-8").removesuffix("!"))