Skip to content

Commit

Permalink
Fix invalid escape sequence in binary_search_tree.py (TheAlgorithms#1920
Browse files Browse the repository at this point in the history
)

* Fix invalid escape sequence in binary_search_tree.py

data_structures/binary_tree/binary_search_tree.py:156
  /home/travis/build/TheAlgorithms/Python/data_structures/binary_tree/binary_search_tree.py:156: DeprecationWarning: invalid escape sequence \

* fixup! Format Python code with psf/black push

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
  • Loading branch information
cclauss and github-actions authored Apr 30, 2020
1 parent 3d0680e commit 1ad78b2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions ciphers/a1z26.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,28 @@
http://bestcodes.weebly.com/a1z26.html
"""


def encode(plain: str) -> list:
"""
>>> encode("myname")
[13, 25, 14, 1, 13, 5]
"""
return [ord(elem) - 96 for elem in plain]


def decode(encoded: list) -> str:
"""
>>> decode([13, 25, 14, 1, 13, 5])
'myname'
"""
return "".join(chr(elem + 96) for elem in encoded)


def main():
encoded = encode(input("->").strip().lower())
print("Encoded: ", encoded)
print("Decoded:", decode(encoded))


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion data_structures/binary_tree/binary_search_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def postorder(curr_node):


def binary_search_tree():
"""
r"""
Example
8
/ \
Expand Down
2 changes: 1 addition & 1 deletion digital_image_processing/test_digital_image_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_sepia():
assert sepia.all()


def test_burkes(file_path: str="digital_image_processing/image_data/lena_small.jpg"):
def test_burkes(file_path: str = "digital_image_processing/image_data/lena_small.jpg"):
burkes = bs.Burkes(imread(file_path, 1), 120)
burkes.process()
assert burkes.output_img.any()

0 comments on commit 1ad78b2

Please sign in to comment.