Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.text = text
self.color = color
self.kwargs = kwargs
class SolidTextLegend(TextLegendBase):
def __init__(self, text, color, **kwargs):
super().__init__(text, color, **kwargs)
class RegularTextLegend(TextLegendBase):
def __init__(self, text, color, **kwargs):
super().__init__(text, color, **kwargs)
class BrandsTextLegend(TextLegendBase):
def __init__(self, text, color, **kwargs):
super().__init__(text, color, **kwargs)
LEGENDSTYLE = {"solid": SolidTextLegend, "regular": RegularTextLegend, "brands": BrandsTextLegend}
class TextLegendHandler(HandlerBase):
def __init__(self, font_file):
super().__init__()
self.font_file = font_file
def create_artists(self, legend, orig_handle, xdescent, ydescent, width, height, fontsize, trans):
x = xdescent + width / 2.0
y = ydescent + height / 2.0
kwargs = {
self.text = text
self.color = color
self.kwargs = kwargs
class SolidTextLegend(TextLegendBase):
def __init__(self, text, color, **kwargs):
super().__init__(text, color, **kwargs)
class RegularTextLegend(TextLegendBase):
def __init__(self, text, color, **kwargs):
super().__init__(text, color, **kwargs)
class BrandsTextLegend(TextLegendBase):
def __init__(self, text, color, **kwargs):
super().__init__(text, color, **kwargs)
LEGENDSTYLE = {"solid": SolidTextLegend, "regular": RegularTextLegend, "brands": BrandsTextLegend}
class TextLegendHandler(HandlerBase):
def __init__(self, font_file):
super().__init__()
self.font_file = font_file
def create_artists(self, legend, orig_handle, xdescent, ydescent, width, height, fontsize, trans):
x = xdescent + width / 2.0
y = ydescent + height / 2.0
kwargs = {
yield from line if line_number % 2 == 0 else line[::-1]
class TextLegendBase:
def __init__(self, text, color, **kwargs):
self.text = text
self.color = color
self.kwargs = kwargs
class SolidTextLegend(TextLegendBase):
def __init__(self, text, color, **kwargs):
super().__init__(text, color, **kwargs)
class RegularTextLegend(TextLegendBase):
def __init__(self, text, color, **kwargs):
super().__init__(text, color, **kwargs)
class BrandsTextLegend(TextLegendBase):
def __init__(self, text, color, **kwargs):
super().__init__(text, color, **kwargs)
LEGENDSTYLE = {"solid": SolidTextLegend, "regular": RegularTextLegend, "brands": BrandsTextLegend}
class TextLegendHandler(HandlerBase):
def __init__(self, font_file):
super().__init__()
self.font_file = font_file
def flip_lines(matrix: Iterable[Tuple[int, int]], base: int) -> Tuple[int, int]:
"""
Given a matrix in a linear array, flip the element order of every odd row
"""
for line_number, line in enumerate(chunked(matrix, base)):
yield from line if line_number % 2 == 0 else line[::-1]
class TextLegendBase:
def __init__(self, text, color, **kwargs):
self.text = text
self.color = color
self.kwargs = kwargs
class SolidTextLegend(TextLegendBase):
def __init__(self, text, color, **kwargs):
super().__init__(text, color, **kwargs)
class RegularTextLegend(TextLegendBase):
def __init__(self, text, color, **kwargs):
super().__init__(text, color, **kwargs)
class BrandsTextLegend(TextLegendBase):
def __init__(self, text, color, **kwargs):
super().__init__(text, color, **kwargs)
LEGENDSTYLE = {"solid": SolidTextLegend, "regular": RegularTextLegend, "brands": BrandsTextLegend}
yield item
class TextLegendBase:
def __init__(self, text, color, **kwargs):
self.text = text
self.color = color
self.kwargs = kwargs
class SolidTextLegend(TextLegendBase):
def __init__(self, text, color, **kwargs):
super().__init__(text, color, **kwargs)
class RegularTextLegend(TextLegendBase):
def __init__(self, text, color, **kwargs):
super().__init__(text, color, **kwargs)
class BrandsTextLegend(TextLegendBase):
def __init__(self, text, color, **kwargs):
super().__init__(text, color, **kwargs)
LEGENDSTYLE = {"solid": SolidTextLegend, "regular": RegularTextLegend, "brands": BrandsTextLegend}
class TextLegendHandler(HandlerBase):
def __init__(self, font_file):
super().__init__()
self.font_file = font_file
def flip_lines(matrix, base):
for line_number, line in enumerate(chunks(matrix, base)):
for item in line if line_number % 2 == 0 else line[::-1]:
yield item
class TextLegendBase:
def __init__(self, text, color, **kwargs):
self.text = text
self.color = color
self.kwargs = kwargs
class SolidTextLegend(TextLegendBase):
def __init__(self, text, color, **kwargs):
super().__init__(text, color, **kwargs)
class RegularTextLegend(TextLegendBase):
def __init__(self, text, color, **kwargs):
super().__init__(text, color, **kwargs)
class BrandsTextLegend(TextLegendBase):
def __init__(self, text, color, **kwargs):
super().__init__(text, color, **kwargs)
LEGENDSTYLE = {"solid": SolidTextLegend, "regular": RegularTextLegend, "brands": BrandsTextLegend}