def _chr(i):
    """Converts an int to 1-char byte string.

    This function is used for python2 and python3 compatibility. See
    http://python-future.org/compatible_idioms.html#byte-string-literals

    Args:
        i: The integer to convert.

    Returns:
        A 1-char byte string with the input value as the byte value.
    """
    return chr(i).encode('latin-1')