Skip to content

Fixes black failures from Previous PR #1751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 12, 2020
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions data_structures/binary_tree/binary_search_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ def __insert(self, value):
parent_node = self.root # from root
while True: # While we don't get to a leaf
if value < parent_node.value: # We go left
if parent_node.left == None:
if parent_node.left is None:
parent_node.left = new_node # We insert the new node in a leaf
break
else:
parent_node = parent_node.left
else:
if parent_node.right == None:
if parent_node.right is None:
parent_node.right = new_node
break
else:
Expand Down
1 change: 1 addition & 0 deletions dynamic_programming/optimal_binary_search_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

class Node:
"""Binary Search Tree Node"""

def __init__(self, key, freq):
self.key = key
self.freq = freq
Expand Down
4 changes: 2 additions & 2 deletions hashes/hamming_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def emitterConverter(sizePar, data):
# Mount the message
ContBP = 0 # parity bit counter
for x in range(0, sizePar + len(data)):
if dataOrd[x] == None:
if dataOrd[x] is None:
dataOut.append(str(parity[ContBP]))
ContBP += 1
else:
Expand Down Expand Up @@ -243,7 +243,7 @@ def receptorConverter(sizePar, data):
# Mount the message
ContBP = 0 # Parity bit counter
for x in range(0, sizePar + len(dataOutput)):
if dataOrd[x] == None:
if dataOrd[x] is None:
dataOut.append(str(parity[ContBP]))
ContBP += 1
else:
Expand Down
2 changes: 2 additions & 0 deletions maths/bisection.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
https://en.wikipedia.org/wiki/Bisection_method
"""


def equation(x: float) -> float:
"""
>>> equation(5)
Expand Down
3 changes: 1 addition & 2 deletions searches/tabu_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import copy
import argparse
import sys


def generate_neighbours(path):
Expand Down Expand Up @@ -278,4 +277,4 @@ def main(args=None):
)

# Pass the arguments to main method
sys.exit(main(parser.parse_args()))
main(parser.parse_args())
2 changes: 1 addition & 1 deletion strings/aho-corasick.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def set_fail_transitions(self):
q.append(child)
state = self.adlist[r]["fail_state"]
while (
self.find_next_state(state, self.adlist[child]["value"]) == None
self.find_next_state(state, self.adlist[child]["value"]) is None
and state != 0
):
state = self.adlist[state]["fail_state"]
Expand Down