code: def CleanName(name):
          
          name = re.sub('[^_A-Za-z0-9]', '_', name)
          if name[0].isdigit():
              name = '_%s' % name
          while keyword.iskeyword(name):
              name = '%s_' % name
          # If we end up with __ as a prefix, we'll run afoul of python
          # field renaming, so we manually correct for it.
          if name.startswith('__'):
              name = 'f%s' % name
          return name
docs: Perform generic name cleaning.