from typing import List
from typing import Optional


def gen_key(context: List[str], separator: str) -> Optional[str]:
    """
    Generate the key that is used to identify the scope of the object.

    :param context: list of config context elements, ordered from most specific to least specific
    :param separator: separator that should be used to generate the key
    :return:
    """
    if context and isinstance(context, list) and len(context) > 0:
        key = separator.join(context)
        return key
    return