<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def generate_uppercase_key(key, namespace=None):
 """Given a key and a namespace, generates a final uppercase key."""

    if namespace:
        namespace = [part for part in listify(namespace) if part]
        key = '_'.join(namespace + [key])

    key = key.upper()
    return key