forked from cnheider/draugr
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
68 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from .resize import * | ||
from .conversion import * | ||
from .enums import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from enum import Enum | ||
|
||
from sorcery import assigned_names | ||
|
||
__all__ = [ | ||
"PilModesEnum", | ||
] | ||
|
||
|
||
class PilModesEnum(Enum): | ||
""" | ||
PIL pixel formats: | ||
RGB 24bits per pixel, 8-bit-per-channel RGB), 3 channels | ||
RGBA (8-bit-per-channel RGBA), 4 channels | ||
RGBa (8-bit-per-channel RGBA, remultiplied alpha), 4 channels | ||
1 - 1bpp, often for masks, 1 channel | ||
L - 8bpp, grayscale, 1 channel | ||
P - 8bpp, paletted, 1 channel | ||
I - 32-bit integers, grayscale, 1 channel | ||
F - 32-bit floats, grayscale, 1 channel | ||
CMYK - 8 bits per channel, 4 channels | ||
YCbCr - 8 bits per channel, 3 channels | ||
""" | ||
|
||
OneBpp = "1" | ||
CMYK, F, HSV, I, L, LAB, P, RGB, RGBA, RGBX, YCbCr = assigned_names() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
opencv-python | ||
numpy>=1.22.2 # not directly required, pinned by Snyk to avoid a vulnerability |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
matplotlib | ||
pandas | ||
scikit-learn | ||
numpy | ||
seaborn | ||
matplotlib>=3.8.0 | ||
pandas>=2.1.1 | ||
scikit-learn>=1.3.1 | ||
numpy>=1.26.0 | ||
seaborn>=0.13.0 | ||
progress # remove this shit | ||
setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability | ||
setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability | ||
pillow>=10.0.1 # not directly required, pinned by Snyk to avoid a vulnerability |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import logging | ||
|
||
|
||
class ContextFilterWorstLevel(logging.Filter): | ||
def __init__(self): | ||
self.worst_level = logging.INFO | ||
|
||
def filter(self, record): | ||
if record.levelno > self.worst_level: | ||
self.worst_level = record.levelno | ||
return True | ||
|
||
|
||
# Create a logger object and add the filter | ||
logger = logging.getLogger() | ||
logger.addFilter(ContextFilterWorstLevel()) | ||
|
||
# Check the worst log level called later | ||
for filter in logger.filters: | ||
if isinstance(filter, ContextFilterWorstLevel): | ||
print(filter.worst_level) |