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