@staticmethod
def _finalize_metadata(node):
    """Convert node metadata back into a standard dictionary and list.
        """
    final = {}
    for key, val in iter(node.metadata.items()):
        final[key] = list(val)
    node.metadata = final
    return node
