<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_lang(tweet):
 """ Get the language that the Tweet is written in. Args: tweet (Tweet or dict):
 A Tweet object or dictionary Returns: str: 2-letter BCP 47 language code (or None if undefined) Example: 'en' 'en' """

    if is_original_format(tweet):
        lang_field = "lang"
    else:
        lang_field = "twitter_lang"
    if tweet[lang_field] is not None and tweet[lang_field] != "und":
            return tweet[lang_field]
    else:
        return None