-
-
Notifications
You must be signed in to change notification settings - Fork 48.5k
Added splay trees #13248
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
base: master
Are you sure you want to change the base?
Added splay trees #13248
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
There was a problem hiding this 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.
Handler for file system events to detect new files and scan them for malware. | ||
""" | ||
|
||
def __init__( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide return type hint for the function: __init__
. If the function does not return a value, please provide the type hint as: def function() -> None:
def __init__( | ||
self, | ||
api_key: str, | ||
log_callback, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide type hint for the parameter: log_callback
print(f"[!] Failed to create quarantine directory: {e}") | ||
self.quarantine_dir = None | ||
|
||
def scan_file_with_virustotal(self, file_path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file Network_security/rtds_monitor.py
, please provide doctest for the function scan_file_with_virustotal
Please provide return type hint for the function: scan_file_with_virustotal
. If the function does not return a value, please provide the type hint as: def function() -> None:
Please provide type hint for the parameter: file_path
print(f"\033[91m{error_msg}\033[0m") | ||
self.log_callback(error_msg, "SCAN_ERROR") | ||
|
||
def _should_skip_file(self, file_path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file Network_security/rtds_monitor.py
, please provide doctest for the function _should_skip_file
Please provide return type hint for the function: _should_skip_file
. If the function does not return a value, please provide the type hint as: def function() -> None:
Please provide type hint for the parameter: file_path
|
||
return False | ||
|
||
def _upload_file_to_virustotal(self, file_path, file_content): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file Network_security/rtds_monitor.py
, please provide doctest for the function _upload_file_to_virustotal
Please provide return type hint for the function: _upload_file_to_virustotal
. If the function does not return a value, please provide the type hint as: def function() -> None:
Please provide type hint for the parameter: file_path
Please provide type hint for the parameter: file_content
if attack_type != "VT_ERROR": | ||
self.total_files_scanned += 1 | ||
|
||
def setup_file_monitoring(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file Network_security/rtds_monitor.py
, please provide doctest for the function setup_file_monitoring
Please provide return type hint for the function: setup_file_monitoring
. If the function does not return a value, please provide the type hint as: def function() -> None:
print(f"[!] Failed to start file monitoring: {e}") | ||
return False | ||
|
||
def _initial_directory_scan(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file Network_security/rtds_monitor.py
, please provide doctest for the function _initial_directory_scan
Please provide return type hint for the function: _initial_directory_scan
. If the function does not return a value, please provide the type hint as: def function() -> None:
except Exception as e: | ||
print(f"[!] Initial scan error: {e}") | ||
|
||
def show_statistics(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file Network_security/rtds_monitor.py
, please provide doctest for the function show_statistics
Please provide return type hint for the function: show_statistics
. If the function does not return a value, please provide the type hint as: def function() -> None:
# Schedule next statistics display | ||
threading.Timer(10.0, self.show_statistics).start() | ||
|
||
def start_monitoring(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file Network_security/rtds_monitor.py
, please provide doctest for the function start_monitoring
Please provide return type hint for the function: start_monitoring
. If the function does not return a value, please provide the type hint as: def function() -> None:
finally: | ||
self.shutdown() | ||
|
||
def shutdown(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file Network_security/rtds_monitor.py
, please provide doctest for the function shutdown
Please provide return type hint for the function: shutdown
. If the function does not return a value, please provide the type hint as: def function() -> None:
for more information, see https://pre-commit.ci
Describe your change:
Checklist: