def METHOD_NAME(self):
    # this method works only for the first two predefined layouts.
    out = self.py3.command_output(["setxkbmap", "-query"])
    layouts = re.match(LAYOUTS_RE, out).group(1).split(",")
    if len(layouts) == 1:
        variant = re.match(VARIANTS_RE, out)
        if variant:
            variant = variant.group(1)
            return "{} {}".format(layouts[0], variant), variant
        else:
            return layouts[0], ""
    xset_output = self.py3.command_output(["xset", "-q"])
    led_mask = re.match(LEDMASK_RE, xset_output).groups(0)[0]
    return layouts[int(led_mask)], ""