Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
d454fd3
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
3092a4c
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
756f1e7
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
1f536c5
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
cc7f670
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
f694030
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
11426db
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
cb834d8
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
f2a75c0
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
1b7ff18
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
65b6888
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
799134e
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
7972137
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
8096762
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
8193449
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
9c908ca
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
71969b8
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
21635f9
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
4b900c9
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
62f0bec
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
3a3f890
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
9b63aed
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
38eb813
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
598156e
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
e8ee43e
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
8676c32
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
926d96a
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
544b47f
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
a9e440c
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
1aaf3c6
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
ae7838b
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
03b90ec
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
5e20047
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
bbe7ac1
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
ed6b41f
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
e458b73
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
77af2e0
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
c40468d
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
4ed80f6
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
c206d83
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
3eaca97
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
5507f91
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
3ca6868
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
417f5bf
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
bdac886
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
fdd8c86
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
747c985
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
2f577e6
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
920ff34
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
4940b90
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
cf5eed9
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
918fb2f
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
430d785
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
8081266
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
771128b
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
43112f1
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
70b1f23
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
ab66d57
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
1fb5fe2
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
ba34183
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
a9b8f0a
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
0474d41
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
cba6696
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
1a3686a
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
aca1ed1
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
c825d65
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
c9f56ea
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
bb6b66e
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
86e4862
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
42479c3
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
05b00e8
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
4d55c70
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
2bc2203
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
3466eeb
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
f426441
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
6e9eb5c
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
0e02bbc
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
cf852d3
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
e534f11
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
335be9e
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
644f3d4
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
e572eb5
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
fd632df
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
587af46
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
01be7cd
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
856253d
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
aa001b5
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
f55d560
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
f83418c
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
dafd74b
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
7f3e796
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
c585612
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
d25cb30
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
5d51f1d
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
546f7c2
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
c6fdd96
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
cefeb2f
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
44684fb
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
1689481
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
3048e43
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
d86ee22
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
29e6a07
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
9bcdca3
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
3b8462e
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
66e7208
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
4bd811e
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
ce39910
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
b2e2a1f
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
ef62b6f
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
3db59eb
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
6dbf326
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
cf360fa
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
4eb3673
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
db2a5a8
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
3c30421
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
7d7cf92
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
a89e736
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
90c20de
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
311bcf5
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
263db23
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
a0580d6
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
ed1fd46
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
28f9fe5
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
59df2bf
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
1100d17
style: Format code with black and yapf
deepsource-dev-autofix[bot] Mar 27, 2023
0956cff
style: Format code with yapf and black
deepsource-autofix[bot] Mar 27, 2023
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
7 changes: 5 additions & 2 deletions demo_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import subprocess
import ssl


# from django.db.models.expressions import RawSQL

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


class BaseNumberGenerator:
"""Declare a method -- `get_number`."""

Expand Down Expand Up @@ -44,6 +44,7 @@ def get_number(self, min_max=[1, 10]):

class ImaginaryNumber:
"""Class to represent an imaginary number."""

def __init__(self):
self.real = 0
self.imaginary = 1
Expand Down Expand Up @@ -128,11 +129,13 @@ def chained_comparison():
c = 3
return a < b and b < c


def wrong_callable():
number = ImaginaryNumber()
if hasattr(number, '__call__'):
if hasattr(number, "__call__"):
return number()


if __name__ == "__main__":
args = ["--disable", "all"]
for i in range(len(args)):
Expand Down
3 changes: 2 additions & 1 deletion django_issues.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from django.http import HttpResponse
from django.views.decorators.http import require_http_methods

@require_http_methods(["GET", "POST"]) # Sensitive

@require_http_methods(["GET", "POST"]) # Sensitive
def current_datetime(request):
now = datetime.datetime.now()
html = "<html><body>It is %s.</body></html>" % now
Expand Down
13 changes: 9 additions & 4 deletions miscellaneous.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
from utils import get_next, render_to_frontend, render_bg


class Orange:
"""Represents the fruit orange."""

orange = "#FFA500"

# Other class implementations

def get_orange(self):
return self.orange


def render():
fruit = Orange()
render_to_frontend(fruit.orange) # Rendering a color, but one can get confused with the fruit
render_to_frontend(
fruit.orange
) # Rendering a color, but one can get confused with the fruit
render_bg(fruit.get_orange)


def play_with_magic_numbers():
magic_numbers = {0, 1, 1, 2, 3, 5}

for elem in magic_numbers:
magic_numbers.add(get_next(elem))
return magic_numbers

30 changes: 17 additions & 13 deletions return_not_implemented.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
class RealNumber:
"""Represents a real number."""
def __init__(self, val):
self.val = val

def __add__(self, other):

def __init__(self, val):
self.val = val

def __add__(self, other):
raise NotImplementedError



class ComplexNumber:
"""Represents an imaginary number."""
def __init__(self, x, y):

def __init__(self, x, y):
self.x = x
self.y = y
def __add__(self, other):
return self.val + other.val
def __radd__(self, other):
res = (self.x + other.val, self.y)
self.y = y

def __add__(self, other):
return self.val + other.val

def __radd__(self, other):
res = (self.x + other.val, self.y)
return res


if __name__ == "__main__":
complex_num = ComplexNumber(2, 5)
real_num = RealNumber(32)
Expand Down
8 changes: 6 additions & 2 deletions security.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sqlite3
import requests


class ResidentsDb:
def __init__(self, table_name, mapping_function, duration):
"""Set location on disk data cache will reside.
Expand All @@ -14,16 +15,19 @@ def __init__(self, table_name, mapping_function, duration):
self.cursor = None

def open(self):
""" Opens connection to sqlite database."""
"""Opens connection to sqlite database."""
self.conn = sqlite3.connect(self.dbname)
self.cursor = self.conn.cursor()

def get_id_from_name(self, name):
"""Get id of resident from name."""
data = self.cursor.execute("SELECT id FROM userdata WHERE Name ={};".format(name))
data = self.cursor.execute(
"SELECT id FROM userdata WHERE Name ={};".format(name)
)
self.conn.commit()
return data


def fetch_version(request):
"""Fetch verison of bgmi."""
version = requests.get(
Expand Down
1 change: 1 addition & 0 deletions tests/test_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def test_random_number_generator():
"""Test random number generator."""
assert RandomNumberGenerator().get_number()


class Tests(unittest.TestCase):
def my_test(self, arg1, arg2):
self.assertEquals(arg1, arg2)
3 changes: 2 additions & 1 deletion type_checks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
def greet_all(names: list[str]) -> None:
for name in names:
print('Hello ' + name)
print("Hello " + name)


if __name__ == "__main__":
heights = [5.5, 6, 5.9]
Expand Down