From 0a8b50895718a4035f429b758b1f2dbf9628c89e Mon Sep 17 00:00:00 2001 From: Amy Date: Thu, 20 Oct 2022 00:15:44 +0300 Subject: [PATCH 1/3] Added ultraviolence.py, README and requirements.txt --- hw3/README.md | 0 hw3/requirements.txt | 36 ++++++++++++++++++++++++++++++++++++ hw3/ultraviolence.py | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 hw3/README.md create mode 100644 hw3/requirements.txt create mode 100644 hw3/ultraviolence.py diff --git a/hw3/README.md b/hw3/README.md new file mode 100644 index 0000000..e69de29 diff --git a/hw3/requirements.txt b/hw3/requirements.txt new file mode 100644 index 0000000..f533ead --- /dev/null +++ b/hw3/requirements.txt @@ -0,0 +1,36 @@ +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==3.0.0 +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 diff --git a/hw3/ultraviolence.py b/hw3/ultraviolence.py new file mode 100644 index 0000000..6fa6b22 --- /dev/null +++ b/hw3/ultraviolence.py @@ -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("!")) From dd116265ebed81e7727c56e9a87ea71ba66a24de Mon Sep 17 00:00:00 2001 From: Amy Date: Thu, 20 Oct 2022 01:45:57 +0300 Subject: [PATCH 2/3] Deleted unnecessary requirement --- hw3/requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/hw3/requirements.txt b/hw3/requirements.txt index f533ead..0fe5c25 100644 --- a/hw3/requirements.txt +++ b/hw3/requirements.txt @@ -8,7 +8,6 @@ cachetools==5.2.0 certifi==2022.9.24 charset-normalizer==2.1.1 frozenlist==1.3.1 -google==3.0.0 google-api-core==2.10.2 google-api-python-client==2.65.0 google-auth==2.13.0 From ece113f97de17bdff9c44847ed0afca85bcf12af Mon Sep 17 00:00:00 2001 From: ibragimovaamina <104636744+ibragimovaamina@users.noreply.github.com> Date: Thu, 20 Oct 2022 01:47:34 +0300 Subject: [PATCH 3/3] Updated README --- hw3/README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/hw3/README.md b/hw3/README.md index e69de29..fdf8328 100644 --- a/hw3/README.md +++ b/hw3/README.md @@ -0,0 +1,46 @@ +**macOS Monterey version 12.4**
+**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/).
+Install Python 3.11. + +2. In terminal run command:
+``` +/Applications/Python\ 3.11/Install\ Certificates.command +``` + +3. In the directory containing files *ultraviolence.py* and *requirements.txt*, create python3.11 virtual environment:
+``` +python3.11 -m venv .venv +``` + +4. Activate python3.11 virtual environment *.venv*:
+``` +source ./.venv/bin/activate +``` + +5. Install all required packages:
+``` +pip install -r requirements.txt +``` + +6. Using any text editor, edit file *.venv_test/lib/python3.11/site-packages/pandas/core/frame.py*
+ + Find the following lines and comment them (add '#' in the beginning):
+ +>\# GH47215
+>\#if index is not None and isinstance(index, set):
+>\# raise ValueError("index cannot be a set")
+ + +7. Run script:
+``` +python ultraviolence.py +``` + +8. In the end, deactivate virtual environment *.venv*:
+``` +deactivate +```