Matthias Bisping 613bba8cfc ...
2022-04-02 02:45:21 +02:00

12 lines
327 B
Python

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