def _parse_localectl():
    ret = {}
    localectl_out = __salt__['cmd.run']('localectl')
    reading_locale = False
    for line in localectl_out.splitlines():
        if 'System Locale:' in line:
            line = line.replace('System Locale:', '')
            reading_locale = True

        if not reading_locale:
            continue

        match = re.match('^([A-Z_]+)=(.*)$', line.strip())
        if not match:
            break
        ret[match.group(1)] = match.group(2).replace('"', '')
    else:
        raise CommandExecutionError('Could not find system locale - could not '
            'parse localectl output\n{0}'.format(localectl_out))

    return ret
Looks up an object with the given kwargs, creating one if necessary.
dataset/ETHPy150Open saltstack/salt/salt/modules/localemod.py/_parse_localectl--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/db/models/query.py/QuerySet.get_or_create