Skip to content

Conversation

@sourcery-ai
Copy link

@sourcery-ai sourcery-ai bot commented Apr 28, 2023

Branch main refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the main branch, then run:

git fetch origin sourcery/main
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from DavidTeju April 28, 2023 14:12
Comment on lines -24 to +28
if path.exists(self.pickle_path): # Ask if they intend to overwrite existing pickle
if input(f"overwrite {self.pickle_path}? (Y/N)\n").upper() != "Y":
self.pickle_path = self.pathify(self.gen_pickle_name())
if (
path.exists(self.pickle_path)
and input(f"overwrite {self.pickle_path}? (Y/N)\n").upper() != "Y"
):
self.pickle_path = self.pathify(self.gen_pickle_name())
Copy link
Author

Choose a reason for hiding this comment

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

Function NgramModel.__init__ refactored with the following changes:

This removes the following comments ( why? ):

# Ask if they intend to overwrite existing pickle

Comment on lines -47 to +52
list_of_tup = []

for i in range(len(words) + 1 - self.n):
list_of_tup.append((tuple(words[i + j] for j in range(self.n - 1)), words[i + self.n - 1]))

return list_of_tup
return [
(tuple(words[i + j] for j in range(self.n - 1)), words[i + self.n - 1])
for i in range(len(words) + 1 - self.n)
]
Copy link
Author

Choose a reason for hiding this comment

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

Function NgramModel.generate_Ngrams refactored with the following changes:


def calculate_freq(self, context: tuple):
freq = sum(freq for freq in self.context_options[context].values())
freq = sum(self.context_options[context].values())
Copy link
Author

Choose a reason for hiding this comment

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

Function NgramModel.calculate_freq refactored with the following changes:

Comment on lines -33 to +35
pin = driver.find_element(By.CSS_SELECTOR, "kbd > code").get_attribute("innerText")
return pin
return driver.find_element(By.CSS_SELECTOR, "kbd > code").get_attribute(
"innerText"
)
Copy link
Author

Choose a reason for hiding this comment

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

Function get_pin refactored with the following changes:

for i in signal.valid_signals():
if (i == signal.SIGKILL or
i == signal.SIGSTOP):
if i in [signal.SIGKILL, signal.SIGSTOP]:
Copy link
Author

Choose a reason for hiding this comment

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

Lines 57-58 refactored with the following changes:

"""
search_param["query"] = keyword
to_return = dict()
to_return = {}
Copy link
Author

Choose a reason for hiding this comment

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

Function Twitter.get_tweets refactored with the following changes:

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.

1 participant