def _parse_message(message_text):
        links = list()
        tags = ""

        # remove newlines
        message_text = message_text.replace('\n','')
        # generate link list for ContentLink
        links = [ link for link in URL_RE.findall(message_text) ]
        link_ctr = 1
        link_dict = {}
        for link in URL_RE.finditer(message_text):
            link_dict[link.group(0)] = link_ctr
            link_ctr += 1
        generate_link_num = lambda obj: "[%d]"%link_dict[obj.group(0)]
        # remove URLs referenced in message content
        if not hasattr(settings, 'TWITTER_REMOVE_LINKS') or settings.TWITTER_REMOVE_LINKS == True:
        	message_text = URL_RE.sub(generate_link_num,message_text)
        # remove leading username
        message_text = USERNAME_RE.sub('',message_text)
        # check for RT-type retweet syntax
        message_text = RT_RE.sub(_transform_retweet,message_text)
        # replace @user references with links to their timeline
        message_text = USER_RE.sub(_transform_user_ref_to_link,message_text)
        # generate tags list
        tags = ' '.join( [tag[1:] for tag in TAG_RE.findall(message_text)] )
        # extract defacto #tag style tweet tags
        if not hasattr(settings, 'TWITTER_REMOVE_TAGS') or settings.TWITTER_REMOVE_TAGS == True:
            message_text = TAG_RE.sub('',message_text)

        return (message_text.strip(),links,tags)
Create a new stack.
dataset/ETHPy150Open jacobian-archive/jellyroll/src/jellyroll/providers/twitter.py/_parse_message--crossover with--dataset/ETHPy150Open openstack/solum/solum/api/controllers/v1/infrastructure.py/InfrastructureStacksController.post