applied black
This commit is contained in:
parent
7c2cf44ad0
commit
426061e5ea
@ -4,7 +4,6 @@ from image_prediction.transformer.transformer import Transformer
|
|||||||
|
|
||||||
|
|
||||||
class TransformerCompositor(Transformer):
|
class TransformerCompositor(Transformer):
|
||||||
|
|
||||||
def __init__(self, formatter: Transformer, *formatters: Transformer):
|
def __init__(self, formatter: Transformer, *formatters: Transformer):
|
||||||
formatters = (formatter, *formatters)
|
formatters = (formatter, *formatters)
|
||||||
self.pipe = rcompose(*formatters)
|
self.pipe = rcompose(*formatters)
|
||||||
|
|||||||
@ -2,7 +2,6 @@ from image_prediction.formatter.formatters.key_formatter import KeyFormatter
|
|||||||
|
|
||||||
|
|
||||||
class Snake2CamelCaseKeyFormatter(KeyFormatter):
|
class Snake2CamelCaseKeyFormatter(KeyFormatter):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def format_key(key):
|
def format_key(key):
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,6 @@ from image_prediction.formatter.formatters.key_formatter import KeyFormatter
|
|||||||
|
|
||||||
|
|
||||||
class EnumFormatter(KeyFormatter):
|
class EnumFormatter(KeyFormatter):
|
||||||
|
|
||||||
def format_key(self, key):
|
def format_key(self, key):
|
||||||
return key.value if isinstance(key, Enum) else key
|
return key.value if isinstance(key, Enum) else key
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,5 @@ from image_prediction.formatter.formatter import Formatter
|
|||||||
|
|
||||||
|
|
||||||
class IdentityFormatter(Formatter):
|
class IdentityFormatter(Formatter):
|
||||||
|
|
||||||
def format(self, obj):
|
def format(self, obj):
|
||||||
return obj
|
return obj
|
||||||
|
|||||||
@ -5,7 +5,6 @@ from image_prediction.formatter.formatter import Formatter
|
|||||||
|
|
||||||
|
|
||||||
class KeyFormatter(Formatter):
|
class KeyFormatter(Formatter):
|
||||||
|
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def format_key(self, key):
|
def format_key(self, key):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|||||||
@ -6,7 +6,6 @@ from image_prediction.transformer.transformer import Transformer
|
|||||||
|
|
||||||
|
|
||||||
class ResponseTransformer(Transformer):
|
class ResponseTransformer(Transformer):
|
||||||
|
|
||||||
def transform(self, data):
|
def transform(self, data):
|
||||||
try:
|
try:
|
||||||
return build_image_info(data)
|
return build_image_info(data)
|
||||||
|
|||||||
@ -14,7 +14,6 @@ class ProbabilityMapperKeys(Enum):
|
|||||||
PROBABILITIES = "probabilities"
|
PROBABILITIES = "probabilities"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ProbabilityMapper(LabelMapper):
|
class ProbabilityMapper(LabelMapper):
|
||||||
def __init__(self, labels: Mapping[int, str]):
|
def __init__(self, labels: Mapping[int, str]):
|
||||||
self.__labels = labels
|
self.__labels = labels
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user