def _to_bytes(value, encoding='ascii'):
    result = (value.encode(encoding)
              if isinstance(value, six.text_type) else value)
    if isinstance(result, six.binary_type):
        return result
    else:
        raise TypeError('%r could not be converted to bytes' % (value,))
Set the keyboard layout for XOrg
dataset/ETHPy150Open GoogleCloudPlatform/gcloud-python/gcloud/_helpers.py/_to_bytes--crossover with--dataset/ETHPy150Open saltstack/salt/salt/states/keyboard.py/xorg