def _escapify(label):
 text = ''
 for c in label:
  if (c in _escaped):
   text += ('\\' + c)
  elif ((ord(c) > 32) and (ord(c) < 127)):
   text += c
  else:
   text += ('\\%03d' % ord(c))
 return text

def _escapify ( label ) : text = '' for c in label : if ( c in _escaped ) : text += ( '\\' + c ) elif ( ( ord ( c ) > 32 ) and ( ord ( c ) < 127 ) ) : text += c else : text += ( '\\%03d' % ord ( c ) ) return text
escape the characters in label which need it .