Skip to content

Sourcery refactored main branch#1

Open
sourcery-ai[bot] wants to merge 1 commit into
mainfrom
sourcery/main
Open

Sourcery refactored main branch#1
sourcery-ai[bot] wants to merge 1 commit into
mainfrom
sourcery/main

Conversation

@sourcery-ai
Copy link
Copy Markdown

@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 thread NgramModel.py
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
Copy Markdown
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 thread NgramModel.py
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
Copy Markdown
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:

Comment thread NgramModel.py

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
Copy Markdown
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 thread browser.py
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
Copy Markdown
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:

Comment thread main.py
for i in signal.valid_signals():
if (i == signal.SIGKILL or
i == signal.SIGSTOP):
if i in [signal.SIGKILL, signal.SIGSTOP]:
Copy link
Copy Markdown
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:

Comment thread twitter.py
"""
search_param["query"] = keyword
to_return = dict()
to_return = {}
Copy link
Copy Markdown
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.

0 participants