def translate_to_ascii(values):
if not values and not isinstance(values, str):<EOL><INDENT>return values<EOL><DEDENT>if isinstance(values, str):<EOL><INDENT>values = [values]<EOL><DEDENT>for index, value in enumerate(values):<EOL><INDENT>if not value:<EOL><INDENT>continue<EOL><DEDENT>unicode_text = decode_to_unicode(value)<EOL>if u"<STR_LIT:[?]>" in unicode_text:<EOL><INDENT>decoded_text = []<EOL>for unicode_char in unicode_text:<EOL><INDENT>decoded_char = unidecode(unicode_char)<EOL>if decoded_char != "<STR_LIT:[?]>":<EOL><INDENT>decoded_text.append(decoded_char)<EOL><DEDENT><DEDENT>ascii_text = '<STR_LIT>'.join(decoded_text).encode('<STR_LIT:ascii>')<EOL><DEDENT>else:<EOL><INDENT>ascii_text = unidecode(unicode_text).replace(<EOL>u"<STR_LIT:[?]>", u"<STR_LIT>").encode('<STR_LIT:ascii>')<EOL><DEDENT>values[index] = ascii_text<EOL><DEDENT>return values<EOL>
r"""Transliterate the string into ascii representation.

    Transliterate the string contents of the given sequence into ascii
    representation.
    Returns a sequence with the modified values if the module 'unidecode'
    is available. Otherwise it will fall back to the inferior strip_accents
    function.

    For example: H\xc3\xb6hne becomes Hohne.

    Note: Passed strings are returned as a list.

    :param values: sequence of strings to transform
    :type values: sequence

    :return: sequence with values transformed to ascii
    :rtype: sequence