Returns a unicode string that can be used as a legal python identifier.

    :Arguments:
      *s*
         string
      *default*
         use *default* if *s* is ``None``
      *number_prefix*
         string to prepend if *s* starts with a number

def make_python_name(s, default=None, number_prefix='N',encoding="utf-8"):
    """Returns a unicode string that can be used as a legal python identifier.

    :Arguments:
      *s*
         string
      *default*
         use *default* if *s* is ``None``
      *number_prefix*
         string to prepend if *s* starts with a number
    """
    if s in ('', None):
        s = default
    s = str(s)
    s = re.sub("[^a-zA-Z0-9_]", "_", s)
    if not re.match('\d', s) is None:
        s = number_prefix+s
    return unicode(s, encoding)