def escape_id(self, s: str) -> str:
    'Return an escaped string suitable for node names and anchors.'
    bad_chars = ',:()'
    for bc in bad_chars:
        s = s.replace(bc, ' ')
    if re.search('[^ .]', s):
        s = s.replace('.', ' ')
    s = ' '.join(s.split()).strip()
    return self.escape(s)
Return an escaped string suitable for node names and anchors.
def escape_id(self, s: str) -> str:
    
    bad_chars = ',:()'
    for bc in bad_chars:
        s = s.replace(bc, ' ')
    if re.search('[^ .]', s):
        s = s.replace('.', ' ')
    s = ' '.join(s.split()).strip()
    return self.escape(s)