From d454fd3870e74ef6befd95c90713e2e082dd8634 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:34:13 +0000 Subject: [PATCH 001/126] style: Format code with black and yapf Format code with black and yapf This commit fixes the style issues introduced in b9484de according to the output from black and yapf. Details: https://dev.deepsource.icu/gh/QuackatronHQ/demo-python/transform/f248ced5-97a4-48dc-9ab5-d4583a6b5f8c/ --- assignment.py | 2 +- demo_code.py | 25 +++++++++++-------------- django_issues.py | 3 ++- duplicate_bases_class.py | 5 ++++- miscellaneous.py | 13 +++++++++---- return_not_implemented.py | 30 +++++++++++++++++------------- security.py | 13 ++++++++----- tests/test_code.py | 2 ++ type_checks.py | 3 ++- 9 files changed, 56 insertions(+), 40 deletions(-) diff --git a/assignment.py b/assignment.py index f401a7daf..e1563c30a 100644 --- a/assignment.py +++ b/assignment.py @@ -1,3 +1,3 @@ *FIRST = [1, 2, 3] -(*FIRST,) = [1, 2, 3] +(*FIRST, ) = [1, 2, 3] *FIRST, a, b = [1, 2, 3] diff --git a/demo_code.py b/demo_code.py index 68313e68b..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -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`.""" @@ -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 @@ -91,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass @@ -128,11 +123,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)): diff --git a/django_issues.py b/django_issues.py index a0d19177b..34acf9ff4 100644 --- a/django_issues.py +++ b/django_issues.py @@ -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 = "It is %s." % now diff --git a/duplicate_bases_class.py b/duplicate_bases_class.py index ad1dfe8bc..db01c8c5f 100644 --- a/duplicate_bases_class.py +++ b/duplicate_bases_class.py @@ -2,11 +2,13 @@ class Base: + def __init__(self): self.base = 1 class BaseOne: + def __init__(self): self.base_one = 2 @@ -15,5 +17,6 @@ class Child(Base, BaseOne, Base, BaseOne): """Some Child class""" -class ChildOne(Base, BaseOne, Base, BaseOne, abc.ABC, abc.ABCMeta, abc.ABCMeta): +class ChildOne(Base, BaseOne, Base, BaseOne, abc.ABC, abc.ABCMeta, + abc.ABCMeta): """Class with duplicate bases""" diff --git a/miscellaneous.py b/miscellaneous.py index a3b4fa7e6..a6ff34d5a 100644 --- a/miscellaneous.py +++ b/miscellaneous.py @@ -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 - diff --git a/return_not_implemented.py b/return_not_implemented.py index c9d7e580b..3d81c650f 100644 --- a/return_not_implemented.py +++ b/return_not_implemented.py @@ -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) diff --git a/security.py b/security.py index 1916df298..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -1,7 +1,9 @@ import sqlite3 import requests + class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -14,19 +16,20 @@ 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( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index 159c78dfb..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -6,6 +6,8 @@ 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) diff --git a/type_checks.py b/type_checks.py index 811da988f..766e84441 100644 --- a/type_checks.py +++ b/type_checks.py @@ -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] From 3092a4c155f646ee45cb65a431137c9a2e28b175 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:34:26 +0000 Subject: [PATCH 002/126] style: Format code with yapf and black --- assignment.py | 2 +- demo_code.py | 18 ++++++++++++------ duplicate_bases_class.py | 5 +---- security.py | 9 +++++---- tests/test_code.py | 1 - 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/assignment.py b/assignment.py index e1563c30a..f401a7daf 100644 --- a/assignment.py +++ b/assignment.py @@ -1,3 +1,3 @@ *FIRST = [1, 2, 3] -(*FIRST, ) = [1, 2, 3] +(*FIRST,) = [1, 2, 3] *FIRST, a, b = [1, 2, 3] diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/duplicate_bases_class.py b/duplicate_bases_class.py index db01c8c5f..ad1dfe8bc 100644 --- a/duplicate_bases_class.py +++ b/duplicate_bases_class.py @@ -2,13 +2,11 @@ class Base: - def __init__(self): self.base = 1 class BaseOne: - def __init__(self): self.base_one = 2 @@ -17,6 +15,5 @@ class Child(Base, BaseOne, Base, BaseOne): """Some Child class""" -class ChildOne(Base, BaseOne, Base, BaseOne, abc.ABC, abc.ABCMeta, - abc.ABCMeta): +class ChildOne(Base, BaseOne, Base, BaseOne, abc.ABC, abc.ABCMeta, abc.ABCMeta): """Class with duplicate bases""" diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 756f1e7358bfec72a4b0ef8ff07d19b9e58215f9 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:34:39 +0000 Subject: [PATCH 003/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 1f536c553eaf99cd791b754c06f9d0d6cbea6534 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:34:52 +0000 Subject: [PATCH 004/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From cc7f670395f3f956f8056ab7803f05ed25f793ff Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:35:06 +0000 Subject: [PATCH 005/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From f69403084abc438a00a66b31b8e1f2271debd62d Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:35:19 +0000 Subject: [PATCH 006/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 11426db195e29c4861446f5689ac0df95d654e70 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:37:40 +0000 Subject: [PATCH 007/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From cb834d8e0cc820ff4199c64ae94f60be24531048 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:37:53 +0000 Subject: [PATCH 008/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From f2a75c04699d807ec0278c565315b6edbc1a3313 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:38:05 +0000 Subject: [PATCH 009/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 1b7ff182417c7a44bcab5393f5eb30b048d8e887 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:38:18 +0000 Subject: [PATCH 010/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 65b6888e001741c12b664ff02641bf1a757799c0 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:38:31 +0000 Subject: [PATCH 011/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 799134e46bf1d3bf46dfd69f5eeef42da7803e75 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:38:45 +0000 Subject: [PATCH 012/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 7972137b853f837a09186d9400804dbc0e1849a2 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:40:29 +0000 Subject: [PATCH 013/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 8096762b2fcae881db0d2c27613f96b2b00ce190 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:40:43 +0000 Subject: [PATCH 014/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 8193449210965f087a79773ebb0f58b7f3a38c45 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:40:55 +0000 Subject: [PATCH 015/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 9c908ca61ee40c96e5cb38ccabf05a6d68387523 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:41:09 +0000 Subject: [PATCH 016/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 71969b8d9dea21940920a289fb4782faab8f3410 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:41:22 +0000 Subject: [PATCH 017/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 21635f947374a9ef1b7ad2e80d86182eb7418989 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:41:35 +0000 Subject: [PATCH 018/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 4b900c9f531111225011d003e83758d4f7d5873e Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:41:50 +0000 Subject: [PATCH 019/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 62f0bec96d055b6312462c5bbf7f257423a90b7d Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:42:05 +0000 Subject: [PATCH 020/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 3a3f89080f7fbc5a49614ea45c349abaf35acc8d Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:42:18 +0000 Subject: [PATCH 021/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 9b63aed318a128991aa0529d35447aa73076113b Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:42:31 +0000 Subject: [PATCH 022/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 38eb813e0034fca9bb903cfec2c903146d2ff04d Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:42:44 +0000 Subject: [PATCH 023/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 598156eecdc7291f2de24294836a04642f664cff Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:42:59 +0000 Subject: [PATCH 024/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From e8ee43e3bd2f45b43633ff6e067389fd7dbfc3d0 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:44:46 +0000 Subject: [PATCH 025/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 8676c32e7acd0570f7a9ac2b5abf85137c9e19db Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:44:59 +0000 Subject: [PATCH 026/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 926d96a0008271fe1c9306cc19d8937568172535 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:45:13 +0000 Subject: [PATCH 027/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 544b47f1bfedd4615e22e55264d301b8c7d84f75 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:45:26 +0000 Subject: [PATCH 028/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From a9e440c6fe00a1b7dcf88a78de1f9fccc14e9b13 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:45:38 +0000 Subject: [PATCH 029/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 1aaf3c600be0acd8b8094e8a38a33dc8e29b5126 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:45:51 +0000 Subject: [PATCH 030/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From ae7838b131c47f14e6af16a0da60c8fb814f69e8 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:46:04 +0000 Subject: [PATCH 031/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 03b90ec16e97e59df196a0aea7bb64f35ce9e5a2 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:46:17 +0000 Subject: [PATCH 032/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 5e200473ef15b20c0f4d6ca9169523169431308e Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:46:29 +0000 Subject: [PATCH 033/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From bbe7ac1ae168398e3abc878481d2bfaf2f854a08 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:46:43 +0000 Subject: [PATCH 034/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From ed6b41f5777c1a7ac44690186377456a0385ac84 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:46:57 +0000 Subject: [PATCH 035/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From e458b7364d8c437ae39f82a55b35316a1174be73 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:47:12 +0000 Subject: [PATCH 036/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 77af2e0809774f3b4486132d31cce8a2c9da58a2 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:47:24 +0000 Subject: [PATCH 037/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From c40468d52b33095167457c6a397697f4b7b9d9cd Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:47:37 +0000 Subject: [PATCH 038/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 4ed80f6dcac1bc53647e8a72fc21ecb0e69454ba Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:47:49 +0000 Subject: [PATCH 039/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From c206d837645f74a94ecd665bc4d8bf611d608325 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:48:04 +0000 Subject: [PATCH 040/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 3eaca97eea90799e5935e1c58753b38cea7f51c9 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:48:17 +0000 Subject: [PATCH 041/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 5507f917e0deb77c455362e6870ae44c0d7139bf Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:48:30 +0000 Subject: [PATCH 042/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 3ca68680f72d1a5a66deb493fac48162a15bf8eb Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:48:43 +0000 Subject: [PATCH 043/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 417f5bf231e7c2d045a3443cbc6b1b34af3a14e2 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:48:55 +0000 Subject: [PATCH 044/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From bdac88622558470eba6bfb8b9ddc6fdea9d2b988 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:49:08 +0000 Subject: [PATCH 045/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From fdd8c86a16f602422ca7ebb960de92842e929c57 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:49:21 +0000 Subject: [PATCH 046/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 747c985941f7841e556816048cc811c670bf2daf Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:49:33 +0000 Subject: [PATCH 047/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 2f577e6acdf0c89d014768e37540d91a3ef64807 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:49:45 +0000 Subject: [PATCH 048/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 920ff3448689a36d6c17624f513ccfa91c01738a Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:50:29 +0000 Subject: [PATCH 049/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 4940b90af7d85982302fbdc0346b3511d48f287e Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:50:41 +0000 Subject: [PATCH 050/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From cf5eed99858a8537e8271f2bccdf4bd1e5f1916b Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:50:53 +0000 Subject: [PATCH 051/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 918fb2f583664ecccbe9b501a4fb8c32252f9134 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:51:06 +0000 Subject: [PATCH 052/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 430d785fc182def762cd90a126e91791c13e3094 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:51:20 +0000 Subject: [PATCH 053/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 8081266c0114464b53abdb44a01c4408f4dcdf41 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:51:33 +0000 Subject: [PATCH 054/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 771128b104de861a9341a7280be62a7266b6f50e Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:54:15 +0000 Subject: [PATCH 055/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 43112f13caad9158d7970245b8b33fc0fc8218f7 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:54:29 +0000 Subject: [PATCH 056/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 70b1f233f5f20b4fe473a08f6c9f0609ccbf906a Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:54:41 +0000 Subject: [PATCH 057/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From ab66d57dfb46c49c61dfc77490a54f9ea4c73ea6 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:54:54 +0000 Subject: [PATCH 058/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 1fb5fe297edbf005b139f0a24489d69b23ab9dfa Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:55:08 +0000 Subject: [PATCH 059/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From ba3418315ffb33e1430e22b8d86e0297a09617c8 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:55:23 +0000 Subject: [PATCH 060/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From a9b8f0aadd7653ff639fc52e2d3ede4e272ddc0d Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:55:38 +0000 Subject: [PATCH 061/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 0474d4149ab0f13c107c8759703ddc7f02b8578b Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:55:51 +0000 Subject: [PATCH 062/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From cba669611f66a331d50b631b55e7a0d91b7382a6 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:56:04 +0000 Subject: [PATCH 063/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 1a3686af10367c42b457d5be155d40e1dd376c82 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:56:16 +0000 Subject: [PATCH 064/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From aca1ed1123d4e0099ee28dd7d0eaafbb1bbb7446 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:56:28 +0000 Subject: [PATCH 065/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From c825d65df787beb482a57cb5a95ca20f25d224d8 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:56:42 +0000 Subject: [PATCH 066/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From c9f56ea9bfdd4f67dc56985d84a1ea5fa3dd6b3a Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:56:55 +0000 Subject: [PATCH 067/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From bb6b66e3d03863f7a9dc817b781e6abfa9c8c62f Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:57:08 +0000 Subject: [PATCH 068/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 86e4862aabc5efc8bef97f89306421d191503eb6 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:57:21 +0000 Subject: [PATCH 069/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 42479c34f2d1a9c3ceb91db39d74a0fb7938331a Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:57:34 +0000 Subject: [PATCH 070/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 05b00e83a440a216b1424ad5b325cf1fdc0e7730 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:57:46 +0000 Subject: [PATCH 071/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 4d55c70fc05d6ec1700517442b48afcc380eaa5c Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:58:01 +0000 Subject: [PATCH 072/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 2bc2203a9a7751a14e922d0932b67bbe74feb935 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:58:14 +0000 Subject: [PATCH 073/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 3466eeb858215518fe9bf6063c7f39ef590f110f Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:58:30 +0000 Subject: [PATCH 074/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From f426441135dfe8ea2b042935f4556ecfcaa2117e Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:58:43 +0000 Subject: [PATCH 075/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 6e9eb5c39a890b6bc379e15b6efff405dca6e478 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:58:56 +0000 Subject: [PATCH 076/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 0e02bbcff0fcc031dabe762ac3fe253f7b372a74 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:59:08 +0000 Subject: [PATCH 077/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From cf852d3091fe123aec3d9d1409e25f3e997425b5 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:59:21 +0000 Subject: [PATCH 078/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From e534f1126b638070f0588c657ce0100ed26dccb6 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:59:37 +0000 Subject: [PATCH 079/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 335be9eee0d8b6e6c08e8fd8b2fb77426823efb4 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:59:52 +0000 Subject: [PATCH 080/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 644f3d436eefcd6466a7c47c602f9e2e31dbc556 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 11:16:35 +0000 Subject: [PATCH 081/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From e572eb50e9864edc7bbce19663b5421155158dd2 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 11:16:50 +0000 Subject: [PATCH 082/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From fd632dffd7fa0ae220386fc40b0dae7a20ed3dc5 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 11:17:04 +0000 Subject: [PATCH 083/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 587af46cd1f69d25b8a7d39a410c2925ba6a5500 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 11:17:18 +0000 Subject: [PATCH 084/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 01be7cdf98db6565876c6a3e892141ce8242d75a Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 11:41:11 +0000 Subject: [PATCH 085/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 856253d67f04c54ec6c9a35d9b1b99ab67449774 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 11:41:26 +0000 Subject: [PATCH 086/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From aa001b5f86ad46bcc6ed0a13ae92dd4b05e5a00c Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 11:41:38 +0000 Subject: [PATCH 087/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From f55d560f5eae5ac320c9b0725a6987f9731cc61b Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 11:41:52 +0000 Subject: [PATCH 088/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From f83418c7e2a5060e793b314c391e0e9566da455c Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 11:42:05 +0000 Subject: [PATCH 089/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From dafd74b96bf7b06c81ed0ea34898abed582a4a29 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 11:42:30 +0000 Subject: [PATCH 090/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 7f3e796d651998a43c11a3bd8d9297ac43c9a73c Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 11:48:51 +0000 Subject: [PATCH 091/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From c585612f88d60fb6b303fb8cc1cd7b1637b3c1d7 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 11:49:05 +0000 Subject: [PATCH 092/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From d25cb309cbe3b19f6c50a53024b728940bee3fbc Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 11:49:18 +0000 Subject: [PATCH 093/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 5d51f1d9f0c0a540e42d147fec5c5d1f31e56c75 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 11:49:32 +0000 Subject: [PATCH 094/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 546f7c2acc9a31d29f112a493a71d5d9f4e7ab3c Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 11:49:44 +0000 Subject: [PATCH 095/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From c6fdd96785f4d0edcbf17e9dc93a1fe492598113 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 11:49:59 +0000 Subject: [PATCH 096/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From cefeb2f0e3cb60fe68b3db6b00c051226a932b73 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 11:50:12 +0000 Subject: [PATCH 097/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 44684fb904a3236bc76eb5b5bd5ddfae5edb2baa Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 11:50:25 +0000 Subject: [PATCH 098/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 1689481bf4a5ab82163c8fb7b5b5433d31876c65 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 11:50:38 +0000 Subject: [PATCH 099/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 3048e4365b3196603db4746527835f88bda3fc35 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 11:50:54 +0000 Subject: [PATCH 100/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From d86ee22fd46b867e2acf89d1f5e22368e4ffe0af Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 11:51:08 +0000 Subject: [PATCH 101/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 29e6a07fe079888bc6532f56405ce709e7da7cca Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 11:51:21 +0000 Subject: [PATCH 102/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 9bcdca3a5c9144155504f97bc4693fdc64a60c6a Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:02:05 +0000 Subject: [PATCH 103/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 3b8462e96c5f7f6843e620a95352ed4033ba7dca Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:02:20 +0000 Subject: [PATCH 104/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 66e7208753e020ada0265f29c3a84864610f6c86 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:02:34 +0000 Subject: [PATCH 105/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 4bd811efbcf02af9115e9ad44dc876d469fa26b7 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:02:48 +0000 Subject: [PATCH 106/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From ce39910f46f672e8b1bfb6a6476c2769ca94fed4 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:03:00 +0000 Subject: [PATCH 107/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From b2e2a1fac15126b6ece04d02096ed2857f6e92c9 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:03:15 +0000 Subject: [PATCH 108/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From ef62b6fdd7fd7eb81addc98412443571b749d2a5 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:03:28 +0000 Subject: [PATCH 109/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 3db59ebc7250501f1a44f3a2fc6abc605eeea221 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:03:41 +0000 Subject: [PATCH 110/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 6dbf3267711450108f2a0f387c14a2cabf257a31 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:03:55 +0000 Subject: [PATCH 111/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From cf360fa43768421e48bbf1ca4b06ce52c6996616 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:04:11 +0000 Subject: [PATCH 112/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 4eb367317cc39606d422da218c874afc06ebb7d7 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:04:26 +0000 Subject: [PATCH 113/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From db2a5a830e5e1357e92e0c77b776794545425e29 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:04:40 +0000 Subject: [PATCH 114/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 3c3042167963227f1b71af2f888cd699512d8fc1 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:04:53 +0000 Subject: [PATCH 115/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 7d7cf9252ac0edd59addea026af361bda7dacee2 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:05:08 +0000 Subject: [PATCH 116/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From a89e736dc2e3122f9330046fb50d12b288af6c98 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:06:33 +0000 Subject: [PATCH 117/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 90c20de7dcf9b23f2fc878590c4e59e2b12ed5b0 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:06:48 +0000 Subject: [PATCH 118/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 311bcf5e3f2e2aaa375fd17c3c4bdbea2fc7056c Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:07:01 +0000 Subject: [PATCH 119/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 263db2360311c3105025b36c7f946a0c6aa0b790 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:07:17 +0000 Subject: [PATCH 120/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From a0580d61fe5d835c687bfe7fe87162c7e2717796 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:07:30 +0000 Subject: [PATCH 121/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From ed1fd46fe4866bdddbb9ab65c62fb279ea29cc06 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:07:44 +0000 Subject: [PATCH 122/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 28f9fe566a353fb201dbd09dcadfb101ecdf5ac0 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:09:07 +0000 Subject: [PATCH 123/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 59df2bf910c53df056e86deac9c37903935d06a0 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:09:42 +0000 Subject: [PATCH 124/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 1100d170a7d23bf5a29c42554fe57abf68679a92 Mon Sep 17 00:00:00 2001 From: "deepsource-dev-autofix[bot]" <61578317+deepsource-dev-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:10:00 +0000 Subject: [PATCH 125/126] style: Format code with black and yapf --- demo_code.py | 18 ++++++------------ security.py | 9 ++++----- tests/test_code.py | 1 + 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/demo_code.py b/demo_code.py index c56646ce7..2f8f497d4 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,18 +92,12 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if ( - initial_condition - and ( - isinstance(object, int) - or isinstance(object, float) - or isinstance(object, str) - ) - and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) - and (isinstance(baz, float) or isinstance(baz, int)) - ): + if (initial_condition and + (isinstance(object, int) or isinstance(object, float) + or isinstance(object, str)) and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) and + (isinstance(baz, float) or isinstance(baz, int))): pass diff --git a/security.py b/security.py index b8b179b51..ac87f72af 100644 --- a/security.py +++ b/security.py @@ -3,6 +3,7 @@ class ResidentsDb: + def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -22,15 +23,13 @@ def open(self): 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) - ) + "SELECT id FROM userdata WHERE Name ={};".format(name)) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get( - "https://pypi.python.org/pypi/bgmi/json", verify=False - ).json()["info"]["version"] + version = requests.get("https://pypi.python.org/pypi/bgmi/json", + verify=False).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index ee6cfbf13..a982dec9f 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,5 +8,6 @@ def test_random_number_generator(): class Tests(unittest.TestCase): + def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2) From 0956cffd89ec12e6dd9e75615d878d5428202701 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:10:14 +0000 Subject: [PATCH 126/126] style: Format code with yapf and black --- demo_code.py | 18 ++++++++++++------ security.py | 9 +++++---- tests/test_code.py | 1 - 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/demo_code.py b/demo_code.py index 2f8f497d4..c56646ce7 100644 --- a/demo_code.py +++ b/demo_code.py @@ -92,12 +92,18 @@ def tar_something(): def bad_isinstance(initial_condition, object, other_obj, foo, bar, baz): - if (initial_condition and - (isinstance(object, int) or isinstance(object, float) - or isinstance(object, str)) and isinstance(other_obj, float) - and isinstance(foo, str) - or (isinstance(bar, float) or isinstance(bar, str)) and - (isinstance(baz, float) or isinstance(baz, int))): + if ( + initial_condition + and ( + isinstance(object, int) + or isinstance(object, float) + or isinstance(object, str) + ) + and isinstance(other_obj, float) + and isinstance(foo, str) + or (isinstance(bar, float) or isinstance(bar, str)) + and (isinstance(baz, float) or isinstance(baz, int)) + ): pass diff --git a/security.py b/security.py index ac87f72af..b8b179b51 100644 --- a/security.py +++ b/security.py @@ -3,7 +3,6 @@ class ResidentsDb: - def __init__(self, table_name, mapping_function, duration): """Set location on disk data cache will reside. Also sets the table name and refresh duration @@ -23,13 +22,15 @@ def open(self): 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)) + "SELECT id FROM userdata WHERE Name ={};".format(name) + ) self.conn.commit() return data def fetch_version(request): """Fetch verison of bgmi.""" - version = requests.get("https://pypi.python.org/pypi/bgmi/json", - verify=False).json()["info"]["version"] + version = requests.get( + "https://pypi.python.org/pypi/bgmi/json", verify=False + ).json()["info"]["version"] return version diff --git a/tests/test_code.py b/tests/test_code.py index a982dec9f..ee6cfbf13 100644 --- a/tests/test_code.py +++ b/tests/test_code.py @@ -8,6 +8,5 @@ def test_random_number_generator(): class Tests(unittest.TestCase): - def my_test(self, arg1, arg2): self.assertEquals(arg1, arg2)