def valid_identifier(s):
 if isinstance(s, _strtypes):
  if ((not s) or s[0].isdigit()):
   return
  return s.replace(' ', '_').replace('.', '_').replace('-', '_')
 return s

def valid_identifier ( s ) : if isinstance ( s , _strtypes ) : if ( ( not s ) or s [ 0 ] . isdigit ( ) ) : return return s . replace ( ' ' , '_' ) . replace ( '.' , '_' ) . replace ( '-' , '_' ) return s
rewrite a string to be a valid identifier if it contains .