Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Dec 22, 2023. It is now read-only.

Commit f1095d8

Browse files
Merge pull request #653 from Python-World/cleanup/black_formatting
black formatting
2 parents 8d8b4fb + c70e5f3 commit f1095d8

File tree

89 files changed

+1095
-394
lines changed

Some content is hidden

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

89 files changed

+1095
-394
lines changed

‎Scripts/API/Cryptocurrency Converter/cryptozor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ def __init__(self, currency, cryptocurrency):
88

99
def convert(self, amount):
1010
api = requests.get(
11-
"https://api.coinbase.com/v2/exchange-rates?currency=" + self.cryptocurrency
11+
"https://api.coinbase.com/v2/exchange-rates?currency="
12+
+ self.cryptocurrency
1213
)
1314
try:
1415
currentPrice = api.json()["data"]["rates"][self.currency]

‎Scripts/API/Football-Standings/main.py

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
LEAGUE_CODE = {
1010
"BSA": {"code": 2013, "name": "Brazilian First Division"},
1111
"BL": {"code": 2002, "name": "Bundesliga"}, # Bundesliga
12-
"ECL": {"code": 2016, "name": "English Championship"}, # English Championship
12+
"ECL": {
13+
"code": 2016,
14+
"name": "English Championship",
15+
}, # English Championship
1316
"ERD": {"code": 2003, "name": "Eredivisie"}, # Eredivisie [Dutch]
1417
"L1": {"code": 2015, "name": "Ligue 1"}, # Ligue 1
1518
"SPA": {"code": 2014, "name": "La Liga"}, # La Liga
@@ -42,32 +45,27 @@ def print_standings(league_id):
4245
+ str(obj["season"]["currentMatchday"])
4346
+ "\n"
4447
)
45-
str_re += (
46-
"╔════╤════════════════════════════════════╤════╤════╤════╤════╤═════╤═════╗\n"
47-
)
48-
str_re += (
49-
"║ SN │ TEAM │ M │ W │ D │ L │ PTS │ GD ║\n"
50-
)
51-
str_re += (
52-
"╠════╪════════════════════════════════════╪════╪════╪════╪════╪═════╪═════╣\n"
53-
)
48+
str_re += "╔════╤════════════════════════════════════╤════╤════╤════╤════╤═════╤═════╗\n"
49+
str_re += "║ SN │ TEAM │ M │ W │ D │ L │ PTS │ GD ║\n"
50+
str_re += "╠════╪════════════════════════════════════╪════╪════╪════╪════╪═════╪═════╣\n"
5451
for team in obj["standings"][0]["table"]:
55-
text = "║ %-2d │ %-34s │ %-2d │ %-2d │ %-2d │ %-2d │ %-3d │ %+-3d ║\n" % (
56-
team["position"],
57-
team["team"]["name"][:34],
58-
team["playedGames"],
59-
team["won"],
60-
team["draw"],
61-
team["lost"],
62-
team["points"],
63-
team["goalDifference"],
52+
text = (
53+
"║ %-2d │ %-34s │ %-2d │ %-2d │ %-2d │ %-2d │ %-3d │ %+-3d ║\n"
54+
% (
55+
team["position"],
56+
team["team"]["name"][:34],
57+
team["playedGames"],
58+
team["won"],
59+
team["draw"],
60+
team["lost"],
61+
team["points"],
62+
team["goalDifference"],
63+
)
6464
)
6565

6666
str_re += text
6767

68-
str_re += (
69-
"╚════╧════════════════════════════════════╧════╧════╧════╧════╧═════╧═════╝"
70-
)
68+
str_re += "╚════╧════════════════════════════════════╧════╧════╧════╧════╧═════╧═════╝"
7169

7270
print(str_re)
7371

@@ -88,7 +86,9 @@ def print_standings(league_id):
8886
if arg in ["--help", "-h"]:
8987
print("List of leagues and the codes: ")
9088
for sno, key in enumerate(LEAGUE_CODE.keys()):
91-
print("%2d. %-30s %s" % (sno + 1, LEAGUE_CODE[key]["name"], key))
89+
print(
90+
"%2d. %-30s %s" % (sno + 1, LEAGUE_CODE[key]["name"], key)
91+
)
9292
sys.exit(0)
9393

9494
league_id = LEAGUE_CODE.get(arg)

‎Scripts/API/GeoCode API/code.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,15 @@
5151

5252
where.write("myData = [\n")
5353
for item in adrs:
54-
st = "[" + str(item[0]) + ", " + str(item[1]) + ", '" + str(item[2]) + "' ], \n"
54+
st = (
55+
"["
56+
+ str(item[0])
57+
+ ", "
58+
+ str(item[1])
59+
+ ", '"
60+
+ str(item[2])
61+
+ "' ], \n"
62+
)
5563
where.write(st)
5664
where.write(",\n")
5765
where.write("];\n")

‎Scripts/API/Google-spreadsheet-share-and-retrieve/create_sheet.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ def create_and_share_sheet(user_mail, spreadsheet_name, csv_file):
7171
required=True,
7272
)
7373
parser.add_argument(
74-
"-csv", help="Enter path of csv file", dest="csv", type=str, required=True
74+
"-csv",
75+
help="Enter path of csv file",
76+
dest="csv",
77+
type=str,
78+
required=True,
7579
)
7680
parser.add_argument(
7781
"-spreadsheet_name",

‎Scripts/API/Google-spreadsheet-share-and-retrieve/get_sheet.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ def get_sheet_json(spreadsheet_name, json_file):
3636
description="get data from spreadsheet in json format"
3737
)
3838
parser.add_argument(
39-
"-json", help="Enter path of json file", dest="json", type=str, required=True
39+
"-json",
40+
help="Enter path of json file",
41+
dest="json",
42+
type=str,
43+
required=True,
4044
)
4145
parser.add_argument(
4246
"-spreadsheet_name",

‎Scripts/API/Random_Album_API/Random_Album_API/application.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
# Register the blueprint
77
app.register_blueprint(random_album)
88
# Add the route to the view class
9-
app.add_url_rule("/v1/random-album/", view_func=RandomAlbumAPI.as_view("random-album"))
9+
app.add_url_rule(
10+
"/v1/random-album/", view_func=RandomAlbumAPI.as_view("random-album")
11+
)
1012

1113
# Exception Handler
1214
@app.errorhandler(APIException)

‎Scripts/API/Random_Album_API/Random_Album_API/logics/app_logic.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ def load_dataset(self):
1919

2020
def get_random_album(self):
2121
"""Get a random album from dataset"""
22-
self.__out = self.dataset.iloc[[random.randint(0, 499)]].to_dict("record")
22+
self.__out = self.dataset.iloc[[random.randint(0, 499)]].to_dict(
23+
"record"
24+
)
2325

2426
def get_all_album(self):
2527
"""In case if you want all the records"""

‎Scripts/API/Random_Joke/joke.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
JOKE_TWO_PARTS = f"""{fg(40) + attr("bold") + attr("dim")}Setup: {rst + fg(202)}{{setup}}
1212
{fg(40) + attr("bold") + attr("dim")}Delivery: {rst + fg(202)}{{delivery}}"""
1313

14-
JOKE_SINGLE = f"""{fg(40) + attr("bold") + attr("dim")}Joke: {rst + fg(202)}{{joke}}"""
14+
JOKE_SINGLE = (
15+
f"""{fg(40) + attr("bold") + attr("dim")}Joke: {rst + fg(202)}{{joke}}"""
16+
)
1517

1618
DEFAULT_FORMAT = f"""{fg(46) + attr("bold") + attr("dim")}Category: {rst + fg(214)}{{category}}
1719
{fg(46) + attr("bold") + attr("dim")}Type: {rst + fg(214)}{{type}}
@@ -56,7 +58,9 @@ def main(category: str = "Any", exclude: str = ""):
5658

5759
if res["error"]:
5860
print(
59-
ERROR_MSG.format(error_message=rst + fg(9) + res["additionalInfo"]),
61+
ERROR_MSG.format(
62+
error_message=rst + fg(9) + res["additionalInfo"]
63+
),
6064
file=sys.stderr,
6165
)
6266
sys.exit(1)
@@ -66,7 +70,9 @@ def main(category: str = "Any", exclude: str = ""):
6670
DEFAULT_FORMAT.format(
6771
category=res["category"],
6872
type=res["type"],
69-
joke=JOKE_TWO_PARTS.format(setup=res["setup"], delivery=res["delivery"])
73+
joke=JOKE_TWO_PARTS.format(
74+
setup=res["setup"], delivery=res["delivery"]
75+
)
7076
if res["type"] == "twopart"
7177
else JOKE_SINGLE.format(joke=res["joke"]),
7278
)

‎Scripts/API/twilio_sms/twilio_sms.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
def send_message_phone(phone, body):
88
account_sid = "<YOUR ACCOUNT_SID>" # Replace this with your account sid
9-
auth_token = "<YOUR AUTH_TOKEN>" # Replace this with your account Auth Token
9+
auth_token = (
10+
"<YOUR AUTH_TOKEN>" # Replace this with your account Auth Token
11+
)
1012
# Create a client object from Twilio Rest
1113
client = Client(account_sid, auth_token)
1214
retry_count = 0

‎Scripts/Bots/DiscordBot/bot.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ async def clear(ctx, amount=5):
9292

9393

9494
async def clear_error(ctx, error):
95-
await ctx.send("Please specify the amount of messages to clear with tentacles")
95+
await ctx.send(
96+
"Please specify the amount of messages to clear with tentacles"
97+
)
9698

9799

98100
@client.command()

0 commit comments

Comments
(0)

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