Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test():
assert split_abbreviations('RGB') == ('R', 'G', 'B')
assert split_abbreviations('CMYK') == ('C', 'M', 'Y', 'K')
assert split_abbreviations('YCbCr') == ('Y', 'Cb', 'Cr')
assert split_abbreviations('sRGB') == ('R', 'G', 'B')
assert split_abbreviations('XYZ') == ('X', 'Y', 'Z')
def test():
assert split_abbreviations('RGB') == ('R', 'G', 'B')
assert split_abbreviations('CMYK') == ('C', 'M', 'Y', 'K')
assert split_abbreviations('YCbCr') == ('Y', 'Cb', 'Cr')
assert split_abbreviations('sRGB') == ('R', 'G', 'B')
assert split_abbreviations('XYZ') == ('X', 'Y', 'Z')
def test():
assert split_abbreviations('RGB') == ('R', 'G', 'B')
assert split_abbreviations('CMYK') == ('C', 'M', 'Y', 'K')
assert split_abbreviations('YCbCr') == ('Y', 'Cb', 'Cr')
assert split_abbreviations('sRGB') == ('R', 'G', 'B')
assert split_abbreviations('XYZ') == ('X', 'Y', 'Z')
• I;16L (I16L) ∞ L/L : u2 » >u2
"""
print("«TESTING: split_abbreviations()»")
assert split_abbreviations('RGB') == ('R', 'G', 'B')
assert split_abbreviations('CMYK') == ('C', 'M', 'Y', 'K')
assert split_abbreviations('YCbCr') == ('Y', 'Cb', 'Cr')
assert split_abbreviations('sRGB') == ('R', 'G', 'B')
assert split_abbreviations('XYZZ') == ('X', 'Y', 'Z')
assert split_abbreviations('I;16L') == ('I',)
assert split_abbreviations('RGB') == Mode.RGB.bands
assert split_abbreviations('CMYK') == Mode.CMYK.bands
assert split_abbreviations('YCbCr') == Mode.YCbCr.bands
assert split_abbreviations('I;16L') == Mode.I16L.bands
assert split_abbreviations('sRGB') == Mode.RGB.bands
# assert split_abbreviations('XYZ') == ('X', 'Y', 'Z')
print("«SUCCESS»")
print()
# print(Mode.I16L.bands)
# print(Mode.RGB.bands)
pprint(list(Mode))
print()
assert Mode(10) == Mode.LAB
# assert hasattr(Mode.RGB, '__slots__')
• I;16 (I16) ∞ L/L : u2 » >u2
"""
print("«TESTING: split_abbreviations()»")
assert split_abbreviations('RGB') == ('R', 'G', 'B')
assert split_abbreviations('CMYK') == ('C', 'M', 'Y', 'K')
assert split_abbreviations('YCbCr') == ('Y', 'Cb', 'Cr')
assert split_abbreviations('sRGB') == ('R', 'G', 'B')
assert split_abbreviations('XYZZ') == ('X', 'Y', 'Z')
assert split_abbreviations('I;16L') == ('I',)
assert split_abbreviations('RGB') == Mode.RGB.bands
assert split_abbreviations('CMYK') == Mode.CMYK.bands
assert split_abbreviations('YCbCr') == Mode.YCbCr.bands
assert split_abbreviations('I;16L') == Mode.I16L.bands
assert split_abbreviations('sRGB') == Mode.RGB.bands
# assert split_abbreviations('XYZ') == ('X', 'Y', 'Z')
print("«SUCCESS»")
print()
# print(Mode.I16L.bands)
# print(Mode.RGB.bands)
pprint(list(Mode))
print()
assert Mode(10) == Mode.LAB
"""
print("«TESTING: split_abbreviations()»")
assert split_abbreviations('RGB') == ('R', 'G', 'B')
assert split_abbreviations('CMYK') == ('C', 'M', 'Y', 'K')
assert split_abbreviations('YCbCr') == ('Y', 'Cb', 'Cr')
assert split_abbreviations('sRGB') == ('R', 'G', 'B')
assert split_abbreviations('XYZZ') == ('X', 'Y', 'Z')
assert split_abbreviations('I;16L') == ('I',)
assert split_abbreviations('RGB') == Mode.RGB.bands
assert split_abbreviations('CMYK') == Mode.CMYK.bands
assert split_abbreviations('YCbCr') == Mode.YCbCr.bands
assert split_abbreviations('I;16L') == Mode.I16L.bands
assert split_abbreviations('sRGB') == Mode.RGB.bands
# assert split_abbreviations('XYZ') == ('X', 'Y', 'Z')
print("«SUCCESS»")
print()
# print(Mode.I16L.bands)
# print(Mode.RGB.bands)
pprint(list(Mode))
print()
assert Mode(10) == Mode.LAB
# assert hasattr(Mode.RGB, '__slots__')
print()
def ColorType(name, *args, **kwargs):
global color_types
dtype = numpy.dtype(kwargs.pop('dtype', numpy.uint8))
if name not in color_types[dtype.name]:
channels = split_abbreviations(name)
class Color(namedtuple(name, channels)):
def __repr__(self):
return "%s(dtype=%s, %s)" % (
name, self.__class__.dtype.name,
', '.join(['%s=%s' % (i[0], i[1]) \
for i in self._asdict().items()]))
def __hex__(self):
return '0x' + "%x" * len(self) % self
def __int__(self):
return int(self.__hex__(), 16)
def __long__(self):
• LA ∞ L/L : |u1 » uint8
• La ∞ L/L : |u1 » uint8
• PA ∞ RGB/L : |u1 » uint8
• I;16 (I16) ∞ L/L : u2 » >u2
"""
print("«TESTING: split_abbreviations()»")
assert split_abbreviations('RGB') == ('R', 'G', 'B')
assert split_abbreviations('CMYK') == ('C', 'M', 'Y', 'K')
assert split_abbreviations('YCbCr') == ('Y', 'Cb', 'Cr')
assert split_abbreviations('sRGB') == ('R', 'G', 'B')
assert split_abbreviations('XYZZ') == ('X', 'Y', 'Z')
assert split_abbreviations('I;16L') == ('I',)
assert split_abbreviations('RGB') == Mode.RGB.bands
assert split_abbreviations('CMYK') == Mode.CMYK.bands
assert split_abbreviations('YCbCr') == Mode.YCbCr.bands
assert split_abbreviations('I;16L') == Mode.I16L.bands
assert split_abbreviations('sRGB') == Mode.RGB.bands
# assert split_abbreviations('XYZ') == ('X', 'Y', 'Z')
print("«SUCCESS»")
print()
# print(Mode.I16L.bands)
# print(Mode.RGB.bands)
pprint(list(Mode))