data = data.replace('\u201d', '"').replace('\u201c', '"').replace('\u2019',
    "'")
data = data.replace('________________________________________', '\n')
data = re.sub('&([^;]+);', lambda m: chr(html.entities.name2codepoint[m.
    group(1)]), data)
return data

def clean_copy(data):
    data = str(data)
data = re.sub('<br ?/?>', '\n', data, re.I)
data = re.sub('<[^>]*>', '', data)
data = re.sub('&([^;]+);', lambda m: chr(html.entities.name2codepoint[m.
    group(1)]), data)
return data
Sublime Text 3 - Clean Paste