Skip to content

ruff fixes #2785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 15, 2025
Merged
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
Empty file added .vscode/settings.json
Empty file.
3 changes: 2 additions & 1 deletion 1 File handle/File handle text/question 5.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""Write a function in python to count the number of lowercase
alphabets present in a text file “happy.txt"""

import time, os
import time
import os
from counter import Counter

print("You will see the count of lowercase, uppercase and total count of alphabets in provided file..")
Expand Down
1 change: 0 additions & 1 deletion AI Game/Tic-Tac-Toe-AI/tic tac

This file was deleted.

1 change: 0 additions & 1 deletion AutoComplete_App/frontend.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from tkinter import *
from tkinter import messagebox
import backend


Expand Down
3 changes: 0 additions & 3 deletions Automated Scheduled Call Reminders/caller.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# The project automates calls for people from the firebase cloud database and the schedular keeps it running and checks for entries
# every 1 hour using aps scedular
# The project can be used to set 5 min before reminder calls to a set of people for doing a particular job
import os
from firebase_admin import credentials, firestore, initialize_app
from datetime import datetime, timedelta
import time
from time import gmtime, strftime
import twilio
from twilio.rest import Client

# twilio credentials
Expand Down
3 changes: 2 additions & 1 deletion Automated Scheduled Call Reminders/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BlockingScheduler
APScheduler
search
os
time
Expand All @@ -11,3 +11,4 @@ timedelta
credentials
firestore
initialize_app
Twilio
1 change: 0 additions & 1 deletion Bank Application .ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,6 @@
],
"source": [
"def main():\n",
" import getpass\n",
" print(\"-------------------\".center(100))\n",
" print(\"| Bank Application |\".center(100))\n",
" print(\"-\"*100)\n",
Expand Down
2 changes: 1 addition & 1 deletion Chrome Dino Automater.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pyautogui # pip install pyautogui
from PIL import Image, ImageGrab # pip install pillow
from PIL import ImageGrab # pip install pillow

# from numpy import asarray
import time
Expand Down
2 changes: 1 addition & 1 deletion CliYoutubeDownloader/CliYoutubeDownloader.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# libraraies

import pytubefix
import sys
import pytube


class YouTubeDownloder:
Expand Down
2 changes: 1 addition & 1 deletion CliYoutubeDownloader/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pytubefix
pytube
1 change: 0 additions & 1 deletion Downloaded Files Organizer/obs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
def watcher(path):
# python script to observe changes in a folder
import sys
import time
import os
from watchdog.observers import Observer
Expand Down
1 change: 0 additions & 1 deletion Emoji Dictionary/emoji_dictionary.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Emoji Dictionary

# -----------------------------------------------------------------------------------------------------
import io # used for dealing with input and output
from tkinter import * # importing the necessary libraries
import tkinter.messagebox as mbox
import tkinter as tk # imported tkinter as tk
Expand Down
1 change: 0 additions & 1 deletion Face_Mask_detection (haarcascade)/mask_detection.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import tensorflow.keras
from PIL import Image, ImageOps
import numpy as np
import cv2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# using openweathermap api

# import required modules
import requests, json
import requests

# Enter your API key here
api_key = "Your_API_Key"
Expand Down
2 changes: 1 addition & 1 deletion Flappy Bird - created with tkinter/Tubes.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def move(self):
if x2 <= (self.__width / 2) - (self.__bird_w / 2):

# Verifica se o tubo está na lista de tubos passados
if not tube[0] in self.__pastTubes:
if tube[0] not in self.__pastTubes:
# Chama o método para pontuar e adiciona o tubo pontuado à lista de tubos passados
self.__score_method()
self.__pastTubes.append(tube[0])
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion Hotel-Management.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def exit_menu():

try:
menu()
except KeyboardInterrupt as exit:
except KeyboardInterrupt:
print("\nexiting...!")

# menu()
5 changes: 2 additions & 3 deletions Image-watermarker/watermark.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from PIL import Image, ImageDraw, ImageFont
from PIL import ImageDraw, ImageFont
from customtkinter import filedialog
from CTkMessagebox import CTkMessagebox
import customtkinter as ctk


class Watermark:
Expand Down Expand Up @@ -43,5 +42,5 @@ def save_image(self, image):
if save_path:
try:
image.save(save_path)
except Exception as e:
except Exception:
print("Failed to save image: {e}")
4 changes: 3 additions & 1 deletion ImageDownloader/img_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@


def ImageDownloader(url):
import os, re, requests
import os
import re
import requests

response = requests.get(url)
text = response.text
Expand Down
8 changes: 4 additions & 4 deletions JARVIS/JARVIS_2.0.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
import pyjokes # for generating random jokes
import requests
import json
from PIL import Image, ImageGrab
from PIL import ImageGrab
from gtts import gTTS

# for 30 seconds clip "Jarvis, clip that!" and discord ctrl+k quick-move (might not come to fruition)
from pynput import keyboard
from pynput.keyboard import Key, Listener
from pynput.mouse import Button, Controller
from pynput.keyboard import Key
from pynput.mouse import Controller

# =======
from playsound import * # for sound output
Expand Down Expand Up @@ -127,7 +127,7 @@ def takecommand():
print("Recognizing...")
query = r.recognize_google(audio, language="en-in")
print(f"User said {query}\n")
except Exception as e:
except Exception:
print("Say that again please...")
return "None"
return query
Expand Down
File renamed without changes.
8 changes: 2 additions & 6 deletions ML House Prediction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,7 @@
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt"
]
"source": []
},
{
"cell_type": "code",
Expand Down Expand Up @@ -1424,8 +1422,6 @@
}
],
"source": [
"from sklearn.linear_model import LinearRegression\n",
"from sklearn.tree import DecisionTreeRegressor\n",
"from sklearn.ensemble import RandomForestRegressor\n",
"#model = LinearRegression()\n",
"#model = DecisionTreeRegressor()\n",
Expand Down Expand Up @@ -1639,7 +1635,7 @@
}
],
"source": [
"from joblib import dump, load\n",
"from joblib import dump\n",
"dump(model, 'HousingPricePredicter.joblib')"
]
},
Expand Down
2 changes: 1 addition & 1 deletion Model Usage.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"metadata": {},
"outputs": [],
"source": [
"from joblib import dump, load\n",
"from joblib import load\n",
"import numpy as np\n",
"model = load('HousingPricePredicter.joblib')"
]
Expand Down
1 change: 0 additions & 1 deletion News_App/Newsapp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
import solara as sr
import yfinance as yf

Expand Down
1 change: 0 additions & 1 deletion Password Generator/pass_gen.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import string as str
import secrets
import random # this is the module used to generate random numbers on your given range


class PasswordGenerator:
Expand Down
2 changes: 1 addition & 1 deletion QR_code_generator/qrcode.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import pyqrcode, png
import pyqrcode
# from pyqrcode import QRCode
# no need to import same library again and again

Expand Down
1 change: 0 additions & 1 deletion QuestionAnswerVirtualAssistant/backend.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import sqlite3
import json
import pandas as pd
import sklearn
from sklearn.feature_extraction.text import TfidfVectorizer

class QuestionAnswerVirtualAssistant:
Expand Down
1 change: 0 additions & 1 deletion QuestionAnswerVirtualAssistant/frontend.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from tkinter import *
from tkinter import messagebox
import backend


Expand Down
2 changes: 0 additions & 2 deletions Search_Engine/backend.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import sqlite3
import test_data
import ast
import json

class SearchEngine:
Expand Down
1 change: 0 additions & 1 deletion Search_Engine/frontend.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from tkinter import *
from tkinter import messagebox
import backend


Expand Down
1 change: 0 additions & 1 deletion Street_Fighter/src/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import math
import pygame
from pygame import mixer
from pygame import font
import cv2
import numpy as np
import os
Expand Down
1 change: 0 additions & 1 deletion TaskManager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import datetime
import csv

def load_tasks(filename='tasks.csv'):
Expand Down
1 change: 0 additions & 1 deletion TaskPlanner.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import datetime
import csv

def load_tasks(filename='tasks.csv'):
Expand Down
43 changes: 43 additions & 0 deletions Trending youtube videos.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
'''
Python program that uses the YouTube Data API to fetch the top 10 trending YouTube videos.
You’ll need to have an API key from Google Cloud Platform to use the YouTube Data API.

First, install the google-api-python-client library if you haven’t already:
pip install google-api-python-client

Replace 'YOUR_API_KEY' with your actual API key. This script will fetch and print the titles,
channels, and view counts of the top 10 trending YouTube videos in India.
You can change the regionCode to any other country code if needed.

Then, you can use the following code:

'''

from googleapiclient.discovery import build

# Replace with your own API key
API_KEY = 'YOUR_API_KEY'
YOUTUBE_API_SERVICE_NAME = 'youtube'
YOUTUBE_API_VERSION = 'v3'

def get_trending_videos():
youtube = build(YOUTUBE_API_SERVICE_NAME, YOUTUBE_API_VERSION, developerKey=API_KEY)

# Call the API to get the top 10 trending videos
request = youtube.videos().list(
part='snippet,statistics',
chart='mostPopular',
regionCode='IN', # Change this to your region code
maxResults=10
)
response = request.execute()

# Print the video details
for item in response['items']:
title = item['snippet']['title']
channel = item['snippet']['channelTitle']
views = item['statistics']['viewCount']
print(f'Title: {title}\nChannel: {channel}\nViews: {views}\n')

if __name__ == '__main__':
get_trending_videos()
2 changes: 0 additions & 2 deletions Tweet Pre-Processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
# In[10]:


import numpy as np
from nltk.corpus import twitter_samples
import matplotlib.pyplot as plt
import random


Expand Down
4 changes: 0 additions & 4 deletions VoiceAssistant/Project_Basic_struct/TextTospeech.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
from gtts import gTTS
from playsound import playsound
import win32com
from win32com import client
import os

def tts():
audio = 'speech.mp3'
Expand Down
2 changes: 1 addition & 1 deletion VoiceAssistant/Project_Basic_struct/dictator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# from speakListen import long_hear
from speakListen import *

from colorama import Fore, Back, Style
from colorama import Fore

def big_text():
print("By default, I will record your voice for 60 seconds.\nDo you want to change this default timing?")
Expand Down
3 changes: 1 addition & 2 deletions VoiceAssistant/Project_Basic_struct/speakListen.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import time
from colorama import Fore, Back, Style
from colorama import Fore
import speech_recognition as sr
import os
import pyttsx3
import datetime
from rich.progress import Progress
Expand Down
4 changes: 2 additions & 2 deletions VoiceAssistant/Project_Basic_struct/websiteWork.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from speakListen import greet, hear
from speakListen import hear
from speakListen import speak


Expand Down Expand Up @@ -55,7 +55,7 @@ def wiki_search():
print("I could'nt understand what you just said!")
speak("I could'nt understand what you just said!")

except Exception as e:
except Exception:
print("Couldn't find")

#wiki_search()
Expand Down
2 changes: 0 additions & 2 deletions Web_Scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
Requirements: selenium, BeautifulSoup
"""

import requests
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time

# url of the page we want to scrape
Expand Down
2 changes: 1 addition & 1 deletion Wordle/wordle.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
continue

# Check if the word given by the user is in the dictionary
if not user_inp in dictionary:
if user_inp not in dictionary:
print("Your word is not in the dictionary")
continue

Expand Down
Loading
Loading