def clean_str(str):
    str=str+" "
    str=re.sub("http[^ ]*[\\\]","\\\\",str)                    #Remove hyperlinks
    str=re.sub("http[^ ]* "," ",str)                           #Remove hyperlinks
    str=str.replace('\\n',' ')
    arr=re.findall(r"\w+(?:[-']\w+)*|'|[:)-.(]+|\S\w*", str)   #Single punctuation mark is removed, smileys remain intact
    arr=[i for i in arr if len(i)>1 and i[0]!='@']             #Remove words starting with @ (Twitter mentions)
    arr=[i if i[0]!='#' else i[1:] for i in arr]               #Remove '#' from hashtags
    #arr=[i for i in arr if i!='http' and i!='com' and i!='org']
    res=" ".join(arr)
    return res.lower().strip()
Test that get_absolute_url returns redirect view.
dataset/ETHPy150Open flipkart-incubator/optimus/cnn_text_trainer/rw/datasets.py/clean_str--crossover with--dataset/ETHPy150Open ofa/connect/open_connect/media/tests/test_models.py/ShortenedURLTest.test_get_absolute_url