Skip to content

Conversation

@pixeebot
Copy link

@pixeebot pixeebot bot commented Jan 29, 2024

I've reviewed the recently opened PR (3 - Example) and have identified some area(s) that could benefit from additional hardening measures.

These changes should help prevent potential security vulnerabilities and improve overall code quality.

Thank you for your consideration!

docs | feedback
Powered by: pixeebot

@pixeebot pixeebot bot requested a review from brusoth09 January 29, 2024 22:01

def fisher_yates_shuffle(data: list) -> list:
for _ in range(len(list)):
a = random.randint(0, len(list) - 1)
Copy link
Author

Choose a reason for hiding this comment

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

Replaces random.{func} with more secure secrets library functions.

def fisher_yates_shuffle(data: list) -> list:
for _ in range(len(list)):
a = random.randint(0, len(list) - 1)
b = random.randint(0, len(list) - 1)
Copy link
Author

Choose a reason for hiding this comment

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

Replaces random.{func} with more secure secrets library functions.

"Both the weights and values vectors must be either lists or tuples"
)

num_items = len(wt)
Copy link
Author

Choose a reason for hiding this comment

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

Replaces multiple expressions involving if operator with 'walrus' operator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants