def get_ui_lc():
    """Get language code as defined by domain or session 'lc' variable.
    TODO: generalize and make more flexible.

    Returns None if no suitable setting was found.
    """
    config = Config()
    domain_lc = request.url.split('://')[1].split('.')[0]
    if config.supported_languages not in domain_lc:
        domain_lc = None

    ui_lc = domain_lc

    # if using the express session plugin, override setting with the domain
    # being used: (should be generalized)
    session = request.environ.get('express.session', {})
    if not domain_lc and session.get('lc', None):
        ui_lc = session.get('lc', None)

    return ui_lc
dataset/ETHPy150Open gengo/decanter/decanter/lib/i18n.py/get_ui_lc/swapped operands of `not in`