@classmethod
def __sanitize_doc(cls, neuroml_document):
    """
        Some operations will need to be performed
        before the document is JSON-pickleable.
        """
    for cell in neuroml_document.cells:
        try:
            cell.morphology.vertices = cell.morphology.vertices.tolist()
            cell.morphology.physical_mask = (cell.morphology.physical_mask.
                tolist())
            cell.morphology.connectivity = cell.morphology.connectivity.tolist(
                )
        except:
            pass
    return neuroml_document
