From 050700bcfc60417a2077dbe65d4543d2ded60ff2 Mon Sep 17 00:00:00 2001 From: Shubham Singodiya Date: 2023年10月24日 14:54:16 +0530 Subject: [PATCH 01/14] Rename script.py to script.py --- {Lyrics Finder => Lyrics_Finder}/script.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {Lyrics Finder => Lyrics_Finder}/script.py (100%) diff --git a/Lyrics Finder /script.py b/Lyrics_Finder/script.py similarity index 100% rename from Lyrics Finder /script.py rename to Lyrics_Finder/script.py From faea47e8ba5bda130e81e3c17c4b5daf7f1d331d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: 2024年1月10日 16:47:01 +0000 Subject: [PATCH 02/14] Bump gitpython from 3.1.34 to 3.1.41 in /Resume_parser Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.34 to 3.1.41. - [Release notes](https://github.com/gitpython-developers/GitPython/releases) - [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES) - [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.34...3.1.41) --- updated-dependencies: - dependency-name: gitpython dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Resume_parser/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resume_parser/requirements.txt b/Resume_parser/requirements.txt index 51ba4c63a6..92c23409bc 100644 --- a/Resume_parser/requirements.txt +++ b/Resume_parser/requirements.txt @@ -33,7 +33,7 @@ fsspec==202360 future==0.18.3 gensim==4.3.1 gitdb==4.0.10 -GitPython==3.1.34 +GitPython==3.1.41 greenlet==2.0.2 h11==0.14.0 huggingface-hub==0.15.1 From b7403aa1a47492e1d14f69ce868ba4232d38349b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: 2024年1月10日 16:47:57 +0000 Subject: [PATCH 03/14] Bump gitpython from 3.1.35 to 3.1.41 in /Movie recommendation system Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.35 to 3.1.41. - [Release notes](https://github.com/gitpython-developers/GitPython/releases) - [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES) - [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.35...3.1.41) --- updated-dependencies: - dependency-name: gitpython dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Movie recommendation system/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Movie recommendation system/requirements.txt b/Movie recommendation system/requirements.txt index 7c84c7a567..85251ff1a4 100644 --- a/Movie recommendation system/requirements.txt +++ b/Movie recommendation system/requirements.txt @@ -8,7 +8,7 @@ click==8.1.5 colorama==0.4.6 decorator==5.1.1 gitdb==4.0.10 -GitPython==3.1.35 +GitPython==3.1.41 idna==3.4 importlib-metadata==6.8.0 Jinja2==3.1.2 From a2aa6b95f2a5083f9baff90b72611d18448bd88f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: 2024年1月11日 17:09:44 +0000 Subject: [PATCH 04/14] Bump jinja2 from 2.11.2 to 3.1.3 in /Traffic-Sign-Detection Bumps [jinja2](https://github.com/pallets/jinja) from 2.11.2 to 3.1.3. - [Release notes](https://github.com/pallets/jinja/releases) - [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst) - [Commits](https://github.com/pallets/jinja/compare/2.11.2...3.1.3) --- updated-dependencies: - dependency-name: jinja2 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Traffic-Sign-Detection/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Traffic-Sign-Detection/requirements.txt b/Traffic-Sign-Detection/requirements.txt index 01e29f2379..464e78b6bf 100644 --- a/Traffic-Sign-Detection/requirements.txt +++ b/Traffic-Sign-Detection/requirements.txt @@ -31,7 +31,7 @@ ipython==7.31.1 ipython-genutils==0.2.0 ipywidgets==7.6.3 jedi==0.18.0 -Jinja2==2.11.2 +Jinja2==3.1.3 joblib==1.2.0 jsonschema==3.2.0 jupyter==1.0.0 From ffd9e5be055575a47adbc556f2e1b8e25b4ad4ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: 2024年1月11日 21:06:23 +0000 Subject: [PATCH 05/14] Bump jinja2 from 3.1.2 to 3.1.3 in /Resume_parser Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.2 to 3.1.3. - [Release notes](https://github.com/pallets/jinja/releases) - [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst) - [Commits](https://github.com/pallets/jinja/compare/3.1.2...3.1.3) --- updated-dependencies: - dependency-name: jinja2 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Resume_parser/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resume_parser/requirements.txt b/Resume_parser/requirements.txt index 51ba4c63a6..e9257c3744 100644 --- a/Resume_parser/requirements.txt +++ b/Resume_parser/requirements.txt @@ -40,7 +40,7 @@ huggingface-hub==0.15.1 idna==3.4 importlib-metadata==6.7.0 jieba3k==0.35.1 -Jinja2==3.1.2 +Jinja2==3.1.3 joblib==1.2.0 jsonschema==4.17.3 langcodes==3.3.0 From 2d50410685081bcde8a7eb6a15c1176905c1fc11 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: 2024年1月11日 21:14:33 +0000 Subject: [PATCH 06/14] Bump jinja2 from 3.1.2 to 3.1.3 in /Movie recommendation system Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.2 to 3.1.3. - [Release notes](https://github.com/pallets/jinja/releases) - [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst) - [Commits](https://github.com/pallets/jinja/compare/3.1.2...3.1.3) --- updated-dependencies: - dependency-name: jinja2 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Movie recommendation system/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Movie recommendation system/requirements.txt b/Movie recommendation system/requirements.txt index 7c84c7a567..1a6322fd23 100644 --- a/Movie recommendation system/requirements.txt +++ b/Movie recommendation system/requirements.txt @@ -11,7 +11,7 @@ gitdb==4.0.10 GitPython==3.1.35 idna==3.4 importlib-metadata==6.8.0 -Jinja2==3.1.2 +Jinja2==3.1.3 jsonschema==4.18.3 jsonschema-specifications==2023年6月1日 markdown-it-py==3.0.0 From ca1490692f59864d743979339681305dd9fcb90f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: 2024年1月12日 18:06:58 +0000 Subject: [PATCH 07/14] Bump streamlit from 1.23.1 to 1.30.0 in /Resume_parser Bumps [streamlit](https://github.com/streamlit/streamlit) from 1.23.1 to 1.30.0. - [Release notes](https://github.com/streamlit/streamlit/releases) - [Commits](https://github.com/streamlit/streamlit/compare/1.23.1...1.30.0) --- updated-dependencies: - dependency-name: streamlit dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Resume_parser/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resume_parser/requirements.txt b/Resume_parser/requirements.txt index 51ba4c63a6..d7e3867d3b 100644 --- a/Resume_parser/requirements.txt +++ b/Resume_parser/requirements.txt @@ -104,7 +104,7 @@ spacy-legacy==3.0.12 spacy-loggers==1.0.4 sqlparse==0.4.4 srsly==2.4.6 -streamlit==1.23.1 +streamlit==1.30.0 sumy==0.11.0 tenacity==8.2.2 thinc==8.1.9 From 96e4fedb928a99e4879f27b23f9f92893a03eef9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: 2024年1月12日 18:07:15 +0000 Subject: [PATCH 08/14] Bump streamlit from 1.24.1 to 1.30.0 in /Movie recommendation system Bumps [streamlit](https://github.com/streamlit/streamlit) from 1.24.1 to 1.30.0. - [Release notes](https://github.com/streamlit/streamlit/releases) - [Commits](https://github.com/streamlit/streamlit/compare/1.24.1...1.30.0) --- updated-dependencies: - dependency-name: streamlit dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Movie recommendation system/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Movie recommendation system/requirements.txt b/Movie recommendation system/requirements.txt index 7c84c7a567..f94edd8924 100644 --- a/Movie recommendation system/requirements.txt +++ b/Movie recommendation system/requirements.txt @@ -35,7 +35,7 @@ rich==13.4.2 rpds-py==0.8.10 six==1.16.0 smmap==5.0.0 -streamlit==1.24.1 +streamlit==1.30.0 tenacity==8.2.2 toml==0.10.2 toolz==0.12.0 From f194140b79c5d7838e8b3acc603da9d785de38a8 Mon Sep 17 00:00:00 2001 From: Vishnu Vardhan Vithanala <67997162+vishnu-v-vardhan@users.noreply.github.com> Date: 2024年1月15日 12:39:25 +0530 Subject: [PATCH 09/14] Update script.py Updated authentication code to a more redundant format. --- Google-Meet-Scheduler/script.py | 56 ++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/Google-Meet-Scheduler/script.py b/Google-Meet-Scheduler/script.py index 8f0c137bf3..33867dbac1 100644 --- a/Google-Meet-Scheduler/script.py +++ b/Google-Meet-Scheduler/script.py @@ -1,26 +1,30 @@ from googleapiclient.discovery import build from uuid import uuid4 from google.auth.transport.requests import Request -from pathlib import Path from google_auth_oauthlib.flow import InstalledAppFlow from typing import Dict, List -from pickle import load, dump +import os +from google.oauth2.credentials import Credentials + +SCOPES = ["https://www.googleapis.com/auth/calendar"] class CreateMeet: - def __init__(self, attendees: Dict[str, str], event_time: Dict[str, str], topic): + def __init__(self, attendees: Dict[str, str], + event_time: Dict[str, str], topic): authe = self._auth() - attendees = [{"email": e} for e in attendees.values()] + attendees_list = [{"email": e} for e in attendees.values()] self.event_states = self._create_event( - attendees, event_time, authe, topic) + attendees_list, event_time, authe, topic) @staticmethod - def _create_event(attendees: List[Dict[str, str]], event_time, authe: build, topic): + def _create_event( + attendees: List[Dict[str, str]], event_time, authe: build, Topic): event = {"conferenceData": {"createRequest": {"requestId": f"{uuid4().hex}", "conferenceSolutionKey": {"type": "hangoutsMeet"}}}, "attendees": attendees, "start": {"dateTime": event_time["start"], 'timeZone': 'Asia/Kolkata'}, "end": {"dateTime": event_time["end"], 'timeZone': 'Asia/Kolkata'}, - "summary": topic, + "summary": Topic, "reminders": {"useDefault": True} } event = authe.events().insert(calendarId="primary", sendNotifications=True, @@ -29,23 +33,24 @@ def _create_event(attendees: List[Dict[str, str]], event_time, authe: build, top @staticmethod def _auth(): - token_file, scopes = Path( - "./token.pickle"), ["https://www.googleapis.com/auth/calendar"] - credentials = None - if token_file.exists(): - with open(token_file, "rb") as token: - credentials = load(token) - if not credentials or not credentials.valid: - if credentials and credentials.expired and credentials.refresh_token: - credentials.refresh(Request()) + creds = None + if os.path.exists("token.json"): + creds = Credentials.from_authorized_user_file("token.json", SCOPES) + # If there are no (valid) credentials available, let the user log in. + if not creds or not creds.valid: + if creds and creds.expired and creds.refresh_token: + creds.refresh(Request()) else: flow = InstalledAppFlow.from_client_secrets_file( - 'credentials.json', scopes) - credentials = flow.run_local_server(port=0) - with open(token_file, "wb") as token: - dump(credentials, token) - calendar_service = build("calendar", "v3", credentials=credentials) - return calendar_service + "credentials.json", SCOPES + ) + creds = flow.run_local_server(port=0) + # Save the credentials for the next run + with open("token.json", "w") as token: + token.write(creds.to_json()) + + service = build("calendar", "v3", credentials=creds) + return service print('------------------------------') @@ -60,9 +65,10 @@ def _auth(): emails = list( input('Enter the emails of guests separated by 1 space each : ').strip().split()) topic = input('Enter the topic of the meeting : ') + time = { - 'start': date+'T'+start+':00.000000', - 'end': date+'T'+end+':00.000000' + 'start': date + 'T' + start + ':00.000000', + 'end': date + 'T' + end + ':00.000000' } guests = {email: email for email in emails} meet = CreateMeet(guests, time, topic) @@ -72,4 +78,4 @@ def _auth(): print('-- Meeting Details --') print('---------------------') for key in keys: - print(key+' : ', details[key]) + print(key + ' : ', details[key]) From 51708ba3f80e4d2075fb6125679965d4a5082a55 Mon Sep 17 00:00:00 2001 From: Vishnu Vardhan Vithanala <67997162+vishnu-v-vardhan@users.noreply.github.com> Date: 2024年1月15日 12:51:13 +0530 Subject: [PATCH 10/14] Update script.py Made changes to suppress 'Re-defined variable from outer scope' produced by DeepSource. --- Google-Meet-Scheduler/script.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Google-Meet-Scheduler/script.py b/Google-Meet-Scheduler/script.py index 33867dbac1..5dd42b8cd3 100644 --- a/Google-Meet-Scheduler/script.py +++ b/Google-Meet-Scheduler/script.py @@ -11,20 +11,20 @@ class CreateMeet: def __init__(self, attendees: Dict[str, str], - event_time: Dict[str, str], topic): + event_time: Dict[str, str], Topic): authe = self._auth() attendees_list = [{"email": e} for e in attendees.values()] self.event_states = self._create_event( - attendees_list, event_time, authe, topic) + attendees_list, event_time, authe,Topic) @staticmethod def _create_event( - attendees: List[Dict[str, str]], event_time, authe: build, Topic): + attendees: List[Dict[str, str]], event_time, authe: build, TopiC): event = {"conferenceData": {"createRequest": {"requestId": f"{uuid4().hex}", "conferenceSolutionKey": {"type": "hangoutsMeet"}}}, "attendees": attendees, "start": {"dateTime": event_time["start"], 'timeZone': 'Asia/Kolkata'}, "end": {"dateTime": event_time["end"], 'timeZone': 'Asia/Kolkata'}, - "summary": Topic, + "summary": TopiC, "reminders": {"useDefault": True} } event = authe.events().insert(calendarId="primary", sendNotifications=True, From 5945407b0fd0e4c607d1649af62bd17f9cb5bfb1 Mon Sep 17 00:00:00 2001 From: Vishnu Vardhan Vithanala <67997162+vishnu-v-vardhan@users.noreply.github.com> Date: 2024年1月15日 12:58:35 +0530 Subject: [PATCH 11/14] Update script.py Made minor changes to resolve FLK-E231 and PYL-C0412 in DeepSource. --- Google-Meet-Scheduler/script.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Google-Meet-Scheduler/script.py b/Google-Meet-Scheduler/script.py index 5dd42b8cd3..3fb044465b 100644 --- a/Google-Meet-Scheduler/script.py +++ b/Google-Meet-Scheduler/script.py @@ -1,10 +1,11 @@ from googleapiclient.discovery import build -from uuid import uuid4 from google.auth.transport.requests import Request from google_auth_oauthlib.flow import InstalledAppFlow +from google.oauth2.credentials import Credentials + +from uuid import uuid4 from typing import Dict, List import os -from google.oauth2.credentials import Credentials SCOPES = ["https://www.googleapis.com/auth/calendar"] @@ -15,7 +16,7 @@ def __init__(self, attendees: Dict[str, str], authe = self._auth() attendees_list = [{"email": e} for e in attendees.values()] self.event_states = self._create_event( - attendees_list, event_time, authe,Topic) + attendees_list, event_time, authe, Topic) @staticmethod def _create_event( From 532a04d1de32da7387a8fd9d66f41bcbecb2f889 Mon Sep 17 00:00:00 2001 From: Vishnu Vardhan Vithanala <67997162+vishnu-v-vardhan@users.noreply.github.com> Date: 2024年1月15日 13:03:54 +0530 Subject: [PATCH 12/14] Update script.py Made minor changes by grouping together a couple of modules to abide to pep8 standard. --- Google-Meet-Scheduler/script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Google-Meet-Scheduler/script.py b/Google-Meet-Scheduler/script.py index 3fb044465b..ef29557f0a 100644 --- a/Google-Meet-Scheduler/script.py +++ b/Google-Meet-Scheduler/script.py @@ -1,7 +1,7 @@ from googleapiclient.discovery import build from google.auth.transport.requests import Request -from google_auth_oauthlib.flow import InstalledAppFlow from google.oauth2.credentials import Credentials +from google_auth_oauthlib.flow import InstalledAppFlow from uuid import uuid4 from typing import Dict, List From 52f1b5ced9d98593c0490fa3e57c3a08983036f1 Mon Sep 17 00:00:00 2001 From: Shakhzhakhan Maxudbek Date: 2024年4月29日 02:25:25 +0500 Subject: [PATCH 13/14] Added script for rename multiple files in folders --- Rename-Multiple-Files/README.md | 113 ++++++++++++++++++++++++++++++++ Rename-Multiple-Files/main.py | 28 ++++++++ 2 files changed, 141 insertions(+) create mode 100644 Rename-Multiple-Files/README.md create mode 100644 Rename-Multiple-Files/main.py diff --git a/Rename-Multiple-Files/README.md b/Rename-Multiple-Files/README.md new file mode 100644 index 0000000000..26981ebb4e --- /dev/null +++ b/Rename-Multiple-Files/README.md @@ -0,0 +1,113 @@ +### [English](#EN) + +### [Russian](#RU) + +# EN + +### Script for rename multiple files + +Tested in Python version 3.11.2, but it must working in version 3.5 and above. + +### Run + +GNU\Linux: `$(which python3) main.py` + +Windows: `C:\\Path\\to\\Python3\\Python3.exe main.py` + +Folders structure: + +``` +main.py +root/ + | + |--- folder1 + | | + | |- file1.txt + | |- file2.txt + | |- file2.txt + | + |--- folder2 + | | + | |- file1.txt + | |- file2.txt + | |- file2.txt + | + |--- folder3 + | | + | |- file1.txt + | |- file2.txt + | |- file2.txt +``` + +Output files structure: + +``` +folder1/folder1-1.txt +folder1/folder1-2.txt +folder1/folder1-3.txt + +folder2/folder2-1.txt +folder2/folder2-2.txt +folder2/folder2-3.txt + +folder3/folder3-1.txt +folder3/folder3-2.txt +folder3/folder3-3.txt +``` + +Maybe set outher symbol for `DESTINATION_FILE_DELIMITER` param or just leave blank `DESTINATION_FILE_DELIMITER = ''` + +# RU + +### Скрипт для переименования большого количества файлов + +Тестировался на Python версии 3.11.2, но должен работать на версиях выше 3.5. + +### Запуск + +GNU\Linux: `$(which python3) main.py` + +Windows: `C:\\Path\\to\\Python3\\Python3.exe main.py` + +Структура папок: + +``` +main.py +root/ + | + |--- папка1 + | | + | |- файл1.txt + | |- файл2.txt + | |- файл2.txt + | + |--- папка2 + | | + | |- файл1.txt + | |- файл2.txt + | |- файл2.txt + | + |--- папка3 + | | + | |- файл1.txt + | |- файл2.txt + | |- файл2.txt +``` + +Скрипт переименует файлы в папках так: + +``` +папка1/папка1-1.txt +папка1/папка1-2.txt +папка1/папка1-3.txt + +папка2/папка2-1.txt +папка2/папка2-2.txt +папка2/папка2-3.txt + +папка3/папка3-1.txt +папка3/папка3-2.txt +папка3/папка3-3.txt +``` + +В случае необходимости можно поменять `DESTINATION_FILE_DELIMITER` на нужный символ или вообще оставить пустым `DESTINATION_FILE_DELIMITER = ''` diff --git a/Rename-Multiple-Files/main.py b/Rename-Multiple-Files/main.py new file mode 100644 index 0000000000..7ee20cd690 --- /dev/null +++ b/Rename-Multiple-Files/main.py @@ -0,0 +1,28 @@ +import os +import platform + + +ROOT_DIR = os.getcwd() + '/root' +PATH_DELIMITER = '' +DESTINATION_FILE_DELIMITER = '-' +COUNTER = 0 + + +if (platform.system() == 'Linux') or (platform.system() == 'Darwin'): + PATH_DELIMITER = '/' +elif (platform.system() == 'Windows'): + PATH_DELIMITER = '\\' + +for current_dir in os.listdir(ROOT_DIR): + subdir = ROOT_DIR + PATH_DELIMITER + current_dir + if os.path.isdir(subdir): + print('Now working with: "' + subdir + '" directory') + COUNTER = 0 + for current_file in os.listdir(subdir): + COUNTER += 1 + current_file_full_path = subdir + PATH_DELIMITER + current_file + renamed_file_full_path = subdir + PATH_DELIMITER + current_dir + DESTINATION_FILE_DELIMITER + str(COUNTER) + '.' + current_file.split('.')[-1] + try: + os.rename(current_file_full_path, renamed_file_full_path) + except Exception as e: + print('Error occurred because: ' + e) From 09fc06709c45732968ea28a479180b9483e58af0 Mon Sep 17 00:00:00 2001 From: Bryan <91551702+blondon1@users.noreply.github.com> Date: Wed, 5 Jun 2024 10:42:56 -0400 Subject: [PATCH 14/14] Use os.system for clearing screen This approach makes the code cross-platform by using cls for Windows and clear for Unix-based systems. --- AI Calculator/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AI Calculator/main.py b/AI Calculator/main.py index 206ccbac54..caa1779510 100644 --- a/AI Calculator/main.py +++ b/AI Calculator/main.py @@ -1,5 +1,5 @@ from chatterbot import ChatBot - +import os # naming the ChatBot calculator # using mathematical evaluation logic # the calculator AI will not learn with the user input @@ -10,7 +10,7 @@ # clear the screen and start the calculator -print('033円c') +os.system('cls' if os.name == 'nt' else 'clear') print("Hello, I am a calculator. How may I help you?") while (True): # take the input from the user

AltStyle によって変換されたページ (->オリジナル) /