<commit_before>import sys

from .. import GetResolution

class XlibGetResolution(GetResolution):
    def __init__(self):
        super(XlibGetResolution, self).__init__()

    def platform_check(self):
        return sys.platform == 'linux2'

    def get(self):
        import subprocess

        output = subprocess.Popen('xrandr | grep " connected" | cut -d" " -f3', shell=True, stdout=subprocess.PIPE).communicate()[0]

        resolutions = []

        displays = output.strip().split('\n')
        for display in displays:
            values = display.split('+')
            res_values = values[0].split('x')

            # create resolution tuple
            # (width, height, x-offset, y-offset)
            # offset is counted from top left screen
            res_tuple = (int(res_values[0]), int(res_values[1]), int(values[1]), int(values[2]))

            resolutions.append(res_tuple)
<commit_msg>Made logging call of errors in stderror when calling xrandr<commit_after>import logging
import sys

from .. import GetResolution

class XlibGetResolution(GetResolution):
    def __init__(self):
        super(XlibGetResolution, self).__init__()

    def platform_check(self):
        return sys.platform == 'linux2'

    def get(self):
        import subprocess

        output = subprocess.Popen('xrandr | grep " connected" | cut -d" " -f3',
                                  shell=True,
                                  stdout=subprocess.PIPE,
                                  stderr=subprocess.PIPE).communicate()

        if output[1]:
            logging.warning("xrandr gave warning '%s'" % output[1].strip())

        resolutions = []

        displays = output[0].strip().split('\n')
        for display in displays:
            values = display.split('+')
            res_values = values[0].split('x')

            # create resolution tuple
            # (width, height, x-offset, y-offset)
            # offset is counted from top left screen
            res_tuple = (int(res_values[0]), int(res_values[1]), int(values[1]), int(values[2]))

            resolutions.append(res_tuple)

{'fraction_non_alphanumeric': 0.11988582302568981, 'fraction_numerical': 0.008563273073263558, 'mean_word_length': 2.2106870229007636, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2539487', 'n_tokens_mistral': 605, 'n_tokens_neox': 586, 'n_words': 139}