def _make_safe_id_component(idstring):
    # Transform all whitespace to underscore
    idstring = re.sub(r'\s', "_", '%s' % idstring)
    # Remove everything that is not a hyphen or a member of \w
    idstring = re.sub(r'(?!-)\W', "", idstring).lower()
    return idstring
:param keys: ordered list of project ids from parent to node (e.g. ['parent._id', 'node._id'])
dataset/ETHPy150Open mikeorr/WebHelpers2/webhelpers2/html/tags.py/_make_safe_id_component--crossover with--dataset/ETHPy150Open CenterForOpenScience/osf.io/website/notifications/utils.py/NotificationsDict.add_message