Sourcery Starbot ⭐ refactored ItsCEED/Imaginepy#31
Sourcery Starbot ⭐ refactored ItsCEED/Imaginepy#31SourceryAI wants to merge 1 commit intoItsCEED:mainfrom
Conversation
| headers.update(kwargs.get("headers") or {}) | ||
| headers |= (kwargs.get("headers") or {}) | ||
|
|
||
| data = clear_dict(kwargs.get("data")) | ||
| if data: | ||
| prompt = data.get("prompt", "").lower().split(" ") | ||
| if prompt: | ||
| if prompt := data.get("prompt", "").lower().split(" "): |
There was a problem hiding this comment.
Function AsyncImagine._request refactored with the following changes:
- Merge dictionary updates via the union operator (
dict-assign-update-to-union) - Use named expression to simplify assignment and conditional (
use-named-expression)
| href = item.value[2 if isinstance( | ||
| item, Model) or isinstance(item, Style) else 1] | ||
| href = item.value[2 if isinstance(item, (Model, Style)) else 1] |
There was a problem hiding this comment.
Function AsyncImagine.thumb refactored with the following changes:
- Merge isinstance calls (
merge-isinstance)
| if asbase64 == True: | ||
| if asbase64: |
There was a problem hiding this comment.
Function AsyncImagine.variate refactored with the following changes:
- Simplify comparison to boolean (
simplify-boolean-comparison)
| if asbase64 == True: | ||
| if asbase64: |
There was a problem hiding this comment.
Function AsyncImagine.sdprem refactored with the following changes:
- Simplify comparison to boolean (
simplify-boolean-comparison)
| if asbase64 == True: | ||
| if asbase64: |
There was a problem hiding this comment.
Function AsyncImagine.upscale refactored with the following changes:
- Simplify comparison to boolean (
simplify-boolean-comparison)
| if asbase64 == True: | ||
| if asbase64: |
There was a problem hiding this comment.
Function Imagine.sdprem refactored with the following changes:
- Simplify comparison to boolean (
simplify-boolean-comparison)
| if asbase64 == True: | ||
| if asbase64: |
There was a problem hiding this comment.
Function Imagine.upscale refactored with the following changes:
- Simplify comparison to boolean (
simplify-boolean-comparison)
| if asbase64 == True: | ||
| if asbase64: |
There was a problem hiding this comment.
Function Imagine.sdimg refactored with the following changes:
- Simplify comparison to boolean (
simplify-boolean-comparison)
| if asbase64 == True: | ||
| if asbase64: |
There was a problem hiding this comment.
Function Imagine.controlnet refactored with the following changes:
- Simplify comparison to boolean (
simplify-boolean-comparison)
| if asbase64 == True: | ||
| if asbase64: |
There was a problem hiding this comment.
Function Imagine.codeformer refactored with the following changes:
- Simplify comparison to boolean (
simplify-boolean-comparison)
Thanks for starring sourcery-ai/sourcery ✨ 🌟 ✨
Here's your pull request refactoring your most popular Python repo.
If you want Sourcery to refactor all your Python repos and incoming pull requests install our bot.
Review changes via command line
To manually merge these changes, make sure you're on the
mainbranch, then run: