def remove_nones(dictionary):
    """Replace None values with 'NA' strings, because NetworkX's GraphML does not accept None values as attributes."""
    for key, value in dictionary.items():
        if value is None:
            dictionary[key] = 'NA'
    return dictionary