Skip to content

Commit 86c10d4

Browse files
Fix Linting
1 parent 0fa47cd commit 86c10d4

329 files changed

Lines changed: 7809 additions & 6028 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

BSE_data/bombay.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
for j in i:
88
print(j, i[j])
99

10-
print('\n-------------------------\n')
10+
print("\n-------------------------\n")
1111

1212
tl = b.topLosers()
1313
print("\nTOP LOSERS - Now\n")
@@ -16,9 +16,18 @@
1616
print(f"{j}: {i[j]}")
1717

1818
# indices catagory parameter
19-
category = ["market_cap/broad", "sector_and_industry", "thematics",
20-
"strategy", "sustainability", "volatility", "composite",
21-
"government", "corporate", "money_market"]
19+
category = [
20+
"market_cap/broad",
21+
"sector_and_industry",
22+
"thematics",
23+
"strategy",
24+
"sustainability",
25+
"volatility",
26+
"composite",
27+
"government",
28+
"corporate",
29+
"money_market",
30+
]
2231

2332
for i in category:
2433
indices = b.getIndices(category=i)

Detect_and_Translate_languages/detect_translate.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
# Python program to detect and translate with the help of speech recognition
88

9+
import pyttsx3
910
import speech_recognition as sr
10-
from langdetect import detect
1111
from google_trans_new import google_translator
12-
import pyttsx3
12+
from langdetect import detect
1313

14-
'''
14+
"""
1515
Supported Languages:
1616
{'af': 'afrikaans', 'sq': 'albanian', 'am': 'amharic', 'ar': 'arabic',
1717
'hy': 'armenian', 'az': 'azerbaijani', 'eu': 'basque', 'be': 'belarusian',
@@ -41,7 +41,7 @@
4141
'cy': 'welsh', 'xh': 'xhosa', 'yi': 'yiddish', 'yo': 'yoruba',
4242
'zu': 'zulu', 'fil': 'Filipino', 'he': 'Hebrew'}
4343
44-
'''
44+
"""
4545

4646
r = sr.Recognizer()
4747
translator = google_translator()
@@ -61,18 +61,17 @@ def trans(x, d):
6161

6262

6363
print("Start speaking.....(To terminate the program say 'Stop!')")
64-
while (1):
64+
while 1:
6565
try:
6666
with sr.Microphone() as source2:
6767
r.adjust_for_ambient_noise(source2, duration=0.2)
6868
audio2 = r.listen(source2)
6969
MyText = r.recognize_google(audio2)
7070
MyText.lower()
71-
if MyText == 'stop':
71+
if MyText == "stop":
7272
break
7373
print("Did you say " + MyText)
74-
d = input(
75-
'Enter the language you need the text to be translated into:')
74+
d = input("Enter the language you need the text to be translated into:")
7675
translated = trans(MyText, d)
7776
print(translated)
7877
SpeakText(MyText)

aes_py/aes_tool.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import base64
2-
from Crypto.Cipher import AES
2+
33
from Crypto import Random
4+
from Crypto.Cipher import AES
45
from Crypto.Protocol.KDF import PBKDF2
56

67
BLOCK_SIZE = 16
@@ -13,7 +14,7 @@ def pad(s):
1314

1415

1516
def unpad(s):
16-
return s[: -ord(s[len(s) - 1:])]
17+
return s[: -ord(s[len(s) - 1 :])]
1718

1819

1920
def get_private_key(password):

aes_py/main.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import argparse
22
from getpass import getpass
3-
import aes_tool
43

4+
import aes_tool
55

6-
parser = argparse.ArgumentParser(description="Aes \
7-
encryption and decryption command")
6+
parser = argparse.ArgumentParser(
7+
description="Aes \
8+
encryption and decryption command"
9+
)
810

911
parser.add_argument("--text", help=argparse.SUPPRESS)
1012
parser.add_argument(

alarm_clock/AlarmClock.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
import time
21
import datetime
2+
import time
3+
34
import simpleaudio
45

56
t = int()
67

78

89
def snooze(t):
910
global set_time
10-
HH_MM = set_time.split(':')
11+
HH_MM = set_time.split(":")
1112
HH_MM[1] = str(int(HH_MM[1]) + t)
12-
set_time = ':'.join(HH_MM)
13+
set_time = ":".join(HH_MM)
1314

1415

1516
set_time = input("please enter the time in HH:MM format to set an alarm : ")
@@ -34,7 +35,7 @@ def alarm(set_time):
3435
while True:
3536
alarm(set_time)
3637
x = input("Press y if you want the alarm to snooze: ")
37-
if x == 'y':
38+
if x == "y":
3839
t = int(input("Snooze time: "))
3940
snooze(t)
4041
print(f"The alarm will ring again in {t} min")

algebra_solver_gui/algebra.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from sympy.core.sympify import kernS
21
import PySimpleGUIQt as sg
32
import sympy as sy
3+
from sympy.core.sympify import kernS
44

55

66
class AlgebraSolver:
@@ -27,8 +27,9 @@ def evaluate_linear(self, expression):
2727
return sy.solveset(sy.Eq(sy_exp, req))
2828

2929
def render(self):
30-
window = sg.Window("Algebra Solver", resizable=True,
31-
size=(800, 100)).Layout(self.layout)
30+
window = sg.Window("Algebra Solver", resizable=True, size=(800, 100)).Layout(
31+
self.layout
32+
)
3233

3334
while True:
3435
event, values = window.Read()

aqi_tracker/aqi-tracker.py

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,77 @@
1-
import requests
2-
import sys
31
import getopt
2+
import sys
43

4+
import requests
55

6-
def main(argv):
76

7+
def main(argv):
88
def usage():
9-
print('usage: %s [-c city] [-a accesstoken] [-h help] ...') \
10-
% argv[0]
9+
print("usage: %s [-c city] [-a accesstoken] [-h help] ...") % argv[0]
1110
return 100
1211

1312
try:
14-
(opts, args) = getopt.getopt(argv[1:], 'c:a:h')
13+
(opts, args) = getopt.getopt(argv[1:], "c:a:h")
1514
except getopt.GetoptError:
1615
return usage()
1716

1817
def help():
19-
print("AQI Tracker -"
20-
"\tLets the user know the real-time air quality values"
21-
"\t\t(usage: %s [-c city] [-a accesstoken] [-h help])"
22-
"\ncity:\t\tname of the cit"
23-
"\naccesstoken:\tYou need to get access token by "
24-
"registering on http://aqicn.org/data-platform/register/"
25-
"\n\t\t*if no accesstoken provided then demo accesstoken will"
26-
" be used \n\t\tand with demo access token only Shanghai's"
27-
" air quality values can be retrieved.")
28-
29-
city = 'shanghai'
30-
accesstoken = 'demo'
18+
print(
19+
"AQI Tracker -"
20+
"\tLets the user know the real-time air quality values"
21+
"\t\t(usage: %s [-c city] [-a accesstoken] [-h help])"
22+
"\ncity:\t\tname of the cit"
23+
"\naccesstoken:\tYou need to get access token by "
24+
"registering on http://aqicn.org/data-platform/register/"
25+
"\n\t\t*if no accesstoken provided then demo accesstoken will"
26+
" be used \n\t\tand with demo access token only Shanghai's"
27+
" air quality values can be retrieved."
28+
)
29+
30+
city = "shanghai"
31+
accesstoken = "demo"
3132

3233
for (k, v) in opts:
33-
if k == '-c':
34+
if k == "-c":
3435
city = v
35-
elif k == '-a':
36+
elif k == "-a":
3637

3738
accesstoken = v
38-
elif k == '-h':
39+
elif k == "-h":
3940

4041
return help()
4142

42-
url = 'http://api.waqi.info/feed/' + city + '/?token=' + accesstoken
43-
print('URL: ', url)
43+
url = "http://api.waqi.info/feed/" + city + "/?token=" + accesstoken
44+
print("URL: ", url)
4445

45-
r = requests.get(url, auth=('user', 'pass'))
46+
r = requests.get(url, auth=("user", "pass"))
4647

4748
if r.status_code == 200:
4849
data = r.json()
49-
value = data['data']['iaqi']['pm25']['v']
50+
value = data["data"]["iaqi"]["pm25"]["v"]
5051
toDisplay = str(value)
5152

5253
if value > 0 and value < 50:
53-
print('Air Quality Alert ->')
54-
print('Current Value: Healthy - ' + toDisplay)
54+
print("Air Quality Alert ->")
55+
print("Current Value: Healthy - " + toDisplay)
5556
elif value > 50 and value < 100:
56-
print('Air Quality Alert ->')
57-
print('Current Value: Moderate - ' + toDisplay)
57+
print("Air Quality Alert ->")
58+
print("Current Value: Moderate - " + toDisplay)
5859
elif value > 100 and value < 150:
59-
print('Air Quality Alert ->')
60-
print('Current Value: Sensitive - ' + toDisplay)
60+
print("Air Quality Alert ->")
61+
print("Current Value: Sensitive - " + toDisplay)
6162
elif value > 150 and value < 200:
62-
print('Air Quality Alert ->')
63-
print('Current Value: UnHealhty - ' + toDisplay)
63+
print("Air Quality Alert ->")
64+
print("Current Value: UnHealhty - " + toDisplay)
6465
elif value > 200 and value < 250:
65-
print('Air Quality Alert ->')
66-
print('Current Value: UnHealthy - ' + toDisplay)
66+
print("Air Quality Alert ->")
67+
print("Current Value: UnHealthy - " + toDisplay)
6768
elif value > 250 and value > 300:
68-
print('Air Quality Alert ->')
69-
print('Current Value: Hazardous - ' + toDisplay)
69+
print("Air Quality Alert ->")
70+
print("Current Value: Hazardous - " + toDisplay)
7071
else:
7172

72-
print('Error: Unable to connect to server')
73+
print("Error: Unable to connect to server")
7374

7475

75-
if __name__ == '__main__':
76+
if __name__ == "__main__":
7677
sys.exit(main(sys.argv))

0 commit comments

Comments
 (0)