import re


def twitter_preprocess(
        text: str,
        no_rt: bool = True,
        no_mention: bool = False,
        no_hashtag: bool = False
        ) -> str:
    """
    Preprocessing function to remove retweets, mentions and/or hashtags from
    raw tweets.

    Examples
    --------
    >>> twitter_preprocess("RT @the_new_sky: Follow me !")
    'Follow me !'
    >>> twitter_preprocess("@the_new_sky please stop making ads for your #twitter account.", no_mention=True, no_hashtag=True)
    ' please stop making ads for your  account.'
    """

    if no_rt:
        text = re.sub(r"^RT @(?:[^ ]*) ", '', text)
    if no_mention:
        text = re.sub(r"@\w+", '', text)
    if no_hashtag:
        text = re.sub(r"#\w+", '', text)

    return text