<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def normalize(code):
 """ Normalize language codes to ISO 639-2. If all conversions fails, return the `code` as it was given. Args: code (str):
 Language / country code. Returns: str: ISO 639-2 country code. """

    if len(code) == 3:
        return code

    normalized = translate(code)

    if normalized:
        return normalized

    country = countries.get(code, None)

    if country:
        return country.alpha3.lower()

    return code