Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions demo_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import subprocess
import ssl


# from django.db.models.expressions import RawSQL

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


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

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

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

def __init__(self):
self.real = 0
self.imaginary = 1
Expand All @@ -61,8 +62,7 @@ def main(options: dict = {}) -> str:

if type(value) != str:
raise Exception()
else:
value = iter(value)
value = iter(value)

sorted(value, key=lambda k: len(k))

Expand Down Expand Up @@ -91,18 +91,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


Expand All @@ -128,11 +122,13 @@ def chained_comparison():
c = 3
return a < b and b < c


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


if __name__ == "__main__":
args = ["--disable", "all"]
for i in range(len(args)):
Expand Down