Skip to content

Commit fd109b4

Browse files
style: format code with Black, isort and Yapf
This commit fixes the style issues introduced in d84951a according to the output from Black, isort and Yapf. Details: None
1 parent d84951a commit fd109b4

File tree

6 files changed

+15
-20
lines changed

6 files changed

+15
-20
lines changed

assignment.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1-
(*FIRST,) = [1, 2, 3] # documenting code no fun
1+
(*FIRST, ) = [1, 2, 3] # documenting code no fun
22
*FIRST, a, b = [1, 2, 3] # documenting code no fun
33
a, b = [1, 2] # documenting code no fun
44
c = 1
55

6-
7-
8-
9-
106
d = 1
11-
e =2
12-
13-
7+
e = 2

demo_code.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import random
21
import os
3-
import subprocess
2+
import random
43
import ssl
5-
4+
import subprocess
65

76
AWS_SECRET_KEY = "d6s$f9g!j8mg7hw?n&2"
87

@@ -20,13 +19,12 @@ def get_number(self, min_max):
2019
@staticmethod
2120
def smethod():
2221
"""static method-to-be"""
23-
22+
2423
@staticmethod
2524
def smethod2():
2625
"""static method-to-be"""
2726
return
28-
29-
27+
3028
@classmethod
3129
def cmethod(cls, something):
3230
"""class method-to-be"""

duplicate_bases_class.py

+2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33

44
class Base:
5+
56
def __init__(self):
67
self.base = 1
78

89

910
class BaseOne:
11+
1012
def __init__(self):
1113
self.base_one = 2
1214

miscellaneous.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from utils import get_next, render_to_frontend, render_bg
1+
from utils import get_next, render_bg, render_to_frontend
22

33

44
class Orange:

security.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import sqlite3
2+
23
import requests
34

45

56
class ResidentsDb:
7+
68
def __init__(self, table_name, mapping_function, duration):
79
"""Set location on disk data cache will reside.
810
Also sets the table name and refresh duration
@@ -22,15 +24,13 @@ def open(self):
2224
def get_id_from_name(self, name):
2325
"""Get id of resident from name."""
2426
data = self.cursor.execute(
25-
"SELECT id FROM userdata WHERE Name ={};".format(name)
26-
)
27+
"SELECT id FROM userdata WHERE Name ={};".format(name))
2728
self.conn.commit()
2829
return data
2930

3031

3132
def fetch_version(request):
3233
"""Fetch verison of bgmi."""
33-
version = requests.get(
34-
"https://pypi.python.org/pypi/bgmi/json", verify=False
35-
).json()["info"]["version"]
34+
version = requests.get("https://pypi.python.org/pypi/bgmi/json",
35+
verify=False).json()["info"]["version"]
3636
return version

tests/test_code.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import unittest
2+
23
from demo_code import RandomNumberGenerator
34

45

0 commit comments

Comments
 (0)