Matthias Bisping 426061e5ea applied black
2022-04-01 12:20:32 +02:00

13 lines
339 B
Python

from image_prediction.formatter.formatters.key_formatter import KeyFormatter
class Snake2CamelCaseKeyFormatter(KeyFormatter):
@staticmethod
def format_key(key):
if isinstance(key, str):
head, *tail = key.split("_")
return head + "".join(map(str.title, tail))
else:
return key