Skip to content

Conversation

@dimonalik
Copy link
Contributor

Describe your change:

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
  • If this pull request resolves one or more open issues then the description above includes the issue number(s) with a closing keyword: "Fixes #ISSUE-NUMBER".
Copy link

@algorithms-keeper algorithms-keeper bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Click here to look at the relevant links ⬇️

🔗 Relevant Links

Repository:

Python:

Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.

algorithms-keeper commands and options

algorithms-keeper actions can be triggered by commenting on this PR:

  • @algorithms-keeper review to trigger the checks for only added pull request files
  • @algorithms-keeper review-all to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.

NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.

@algorithms-keeper algorithms-keeper bot added the awaiting reviews This PR is ready to be reviewed label Oct 2, 2023
@algorithms-keeper algorithms-keeper bot added the tests are failing Do not merge until tests pass label Oct 2, 2023
else:
try:
IP(x)
except:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OUCH!! A bare except!!

x = input()
try:
IP(x)
except:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AGAIN??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IPy literally works that way. I can easily fix it with
except Exception as ex:
print('Failed \n" + ex + 'Finishing \n")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. I can fix it by using logging module. What should i do next?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Click details next to each of the failing ❌ tests below and try to get them to be green ✅

added logging for exceptions, fixed invalid var name,
@algorithms-keeper algorithms-keeper bot added the require type hints https://docs.python.org/3/library/typing.html label Oct 2, 2023
Copy link

@algorithms-keeper algorithms-keeper bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Click here to look at the relevant links ⬇️

🔗 Relevant Links

Repository:

Python:

Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.

algorithms-keeper commands and options

algorithms-keeper actions can be triggered by commenting on this PR:

  • @algorithms-keeper review to trigger the checks for only added pull request files
  • @algorithms-keeper review-all to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.

NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.

pre-commit-ci bot and others added 2 commits October 2, 2023 09:11
@algorithms-keeper algorithms-keeper bot removed the require type hints https://docs.python.org/3/library/typing.html label Oct 2, 2023
Copy link

@algorithms-keeper algorithms-keeper bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Click here to look at the relevant links ⬇️

🔗 Relevant Links

Repository:

Python:

Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.

algorithms-keeper commands and options

algorithms-keeper actions can be triggered by commenting on this PR:

  • @algorithms-keeper review to trigger the checks for only added pull request files
  • @algorithms-keeper review-all to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.

NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.

Fixed type hints, and list creation err
Copy link

@algorithms-keeper algorithms-keeper bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Click here to look at the relevant links ⬇️

🔗 Relevant Links

Repository:

Python:

Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.

algorithms-keeper commands and options

algorithms-keeper actions can be triggered by commenting on this PR:

  • @algorithms-keeper review to trigger the checks for only added pull request files
  • @algorithms-keeper review-all to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.

NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.

@@ -0,0 +1,122 @@
######################################

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An error occurred while parsing the file: other/blacklistipchecker.py

Traceback (most recent call last): File "/opt/render/project/src/algorithms_keeper/parser/python_parser.py", line 146, in parse reports = lint_file( ^^^^^^^^^^ libcst._exceptions.ParserSyntaxError: Syntax Error @ 1:1. tokenizer error: unterminated string literal ###################################### ^
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dimonalik and others added 9 commits October 2, 2023 12:41
Fixed bunch of hasher in the beginning of file
Removed e-mail functionality to pass tests
Fixed deprecated type hints, sorted imports
Sorted imports with isort
Fixed some types mismatch
Co-authored-by: Christian Clauss <cclauss@me.com>
Shortened loop as recommended by tests
Comment on lines 42 to 45
for b in octets:
if int(b) < 0 or int(b) > 255:
return False
return True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for b in octets:
if int(b) < 0 or int(b) > 255:
return False
return True
return all(0 <= int(octet) <= 255 for octet in octets)
@algorithms-keeper algorithms-keeper bot removed the tests are failing Do not merge until tests pass label Oct 2, 2023
Fixed elif intead of else
Copy link

@algorithms-keeper algorithms-keeper bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Click here to look at the relevant links ⬇️

🔗 Relevant Links

Repository:

Python:

Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.

algorithms-keeper commands and options

algorithms-keeper actions can be triggered by commenting on this PR:

  • @algorithms-keeper review to trigger the checks for only added pull request files
  • @algorithms-keeper review-all to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.

NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.

link = f"https://api.blacklistchecker.com/check/{ip}"
result = requests.get(link, auth=(api_key, "")
result_dec = json.loads(result.content)
print(result_dec)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An error occurred while parsing the file: other/blacklistipchecker.py

Traceback (most recent call last): File "/opt/render/project/src/algorithms_keeper/parser/python_parser.py", line 146, in parse reports = lint_file( ^^^^^^^^^^ libcst._exceptions.ParserSyntaxError: Syntax Error @ 20:16. parser error: error at 19:15: expected one of !=, %, &, (, *, **, +, ,, -, ., /, //, <, <<, <=, ==, >, >=, >>, @, [, ^, and, if, in, is, not, or, | print(result_dec) ^
Co-authored-by: Christian Clauss <cclauss@me.com>
Copy link

@algorithms-keeper algorithms-keeper bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Click here to look at the relevant links ⬇️

🔗 Relevant Links

Repository:

Python:

Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.

algorithms-keeper commands and options

algorithms-keeper actions can be triggered by commenting on this PR:

  • @algorithms-keeper review to trigger the checks for only added pull request files
  • @algorithms-keeper review-all to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.

NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.

link = f"https://api.blacklistchecker.com/check/{ip}"
result = requests.get(link, auth=(api_key, "")
result_dec = json.loads(result.content)
print(result_dec)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An error occurred while parsing the file: other/blacklistipchecker.py

Traceback (most recent call last): File "/opt/render/project/src/algorithms_keeper/parser/python_parser.py", line 146, in parse reports = lint_file( ^^^^^^^^^^ libcst._exceptions.ParserSyntaxError: Syntax Error @ 20:16. parser error: error at 19:15: expected one of !=, %, &, (, *, **, +, ,, -, ., /, //, <, <<, <=, ==, >, >=, >>, @, [, ^, and, if, in, is, not, or, | print(result_dec) ^
Copy link

@algorithms-keeper algorithms-keeper bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Click here to look at the relevant links ⬇️

🔗 Relevant Links

Repository:

Python:

Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.

algorithms-keeper commands and options

algorithms-keeper actions can be triggered by commenting on this PR:

  • @algorithms-keeper review to trigger the checks for only added pull request files
  • @algorithms-keeper review-all to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.

NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.

detects = "!"
return (res, detects)
else result_dec.get("detections") != 0:
res = ip

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An error occurred while parsing the file: other/blacklistipchecker.py

Traceback (most recent call last): File "/opt/render/project/src/algorithms_keeper/parser/python_parser.py", line 146, in parse reports = lint_file( ^^^^^^^^^^ libcst._exceptions.ParserSyntaxError: Syntax Error @ 26:17. parser error: error at 25:19: expected : res = ip ^
@algorithms-keeper algorithms-keeper bot added the tests are failing Do not merge until tests pass label Oct 2, 2023
added missing rightside comparison agrument
@algorithms-keeper algorithms-keeper bot removed the tests are failing Do not merge until tests pass label Oct 2, 2023
@algorithms-keeper algorithms-keeper bot mentioned this pull request Oct 2, 2023
14 tasks
@dimonalik
Copy link
Contributor Author

Who can review this PR? @cclauss help please

@algorithms-keeper algorithms-keeper bot added the tests are failing Do not merge until tests pass label Oct 3, 2023
@algorithms-keeper algorithms-keeper bot removed the tests are failing Do not merge until tests pass label Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviews This PR is ready to be reviewed

2 participants