def METHOD_NAME(self, metadata, parent_key=''):
    items = []
    for k, v in metadata.items():
        export_k = "".join(s.title() for s in k.split("_"))
        new_key = parent_key + export_k if parent_key else export_k
        if isinstance(v, collections.abc.MutableMapping):
            items.extend(self.METHOD_NAME(v, new_key).items())
        else:
            items.append((new_key, v))
    return dict(items)