code: def valid(self, name):
      
      name = re.sub('[^0-9a-zA-Z_]', '', name)
      if re.match('[0-9]', name):
        name = '_' + name
      return name
docs: Ensure a variable name is valid.
  
      Note: Assumes variable names are ASCII, which isn't necessarily true in
      Python 3.
  
      Args:
        name: A proposed variable name.
  
      Returns:
        A valid version of the name.