<commit_before>import collections
import ctypes
import os
import platform
from patroni.watchdog.base import WatchdogBase, WatchdogError

# Pythonification of linux/ioctl.h
IOC_NONE = 0
IOC_WRITE = 1
IOC_READ = 2

IOC_NRBITS = 8
IOC_TYPEBITS = 8
IOC_SIZEBITS = 14
IOC_DIRBITS = 2

# Non-generic platform special cases
machine = platform.machine()
if machine in ['mips', 'sparc', 'powerpc', 'ppc64']:  # pragma: no cover
    IOC_SIZEBITS = 13
    IOC_DIRBITS = 3
    IOC_NONE, IOC_WRITE, IOC_READ = 1, 2, 4
elif machine == 'parisc':  # pragma: no cover
    IOC_WRITE, IOC_READ = 2, 1

IOC_NRSHIFT = 0
IOC_TYPESHIFT = IOC_NRSHIFT + IOC_NRBITS
IOC_SIZESHIFT = IOC_TYPESHIFT + IOC_TYPEBITS
IOC_DIRSHIFT = IOC_SIZESHIFT + IOC_SIZEBITS


def IOW(type_, nr, size):
    return IOC(IOC_WRITE, type_, nr, size)


def IOR(type_, nr, size):
    return IOC(IOC_READ, type_, nr, size)


def IOWR(type_, nr, size):<commit_msg>Add ppc64le and fix inverted IOC_READ/WRITE vars (#2271)<commit_after>import collections
import ctypes
import os
import platform
from patroni.watchdog.base import WatchdogBase, WatchdogError

# Pythonification of linux/ioctl.h
IOC_NONE = 0
IOC_WRITE = 1
IOC_READ = 2

IOC_NRBITS = 8
IOC_TYPEBITS = 8
IOC_SIZEBITS = 14
IOC_DIRBITS = 2

# Non-generic platform special cases
machine = platform.machine()
if machine in ['mips', 'sparc', 'powerpc', 'ppc64', 'ppc64le']:  # pragma: no cover
    IOC_SIZEBITS = 13
    IOC_DIRBITS = 3
    IOC_NONE, IOC_WRITE, IOC_READ = 1, 4, 2
elif machine == 'parisc':  # pragma: no cover
    IOC_WRITE, IOC_READ = 2, 1

IOC_NRSHIFT = 0
IOC_TYPESHIFT = IOC_NRSHIFT + IOC_NRBITS
IOC_SIZESHIFT = IOC_TYPESHIFT + IOC_TYPEBITS
IOC_DIRSHIFT = IOC_SIZESHIFT + IOC_SIZEBITS


def IOW(type_, nr, size):
    return IOC(IOC_WRITE, type_, nr, size)


def IOR(type_, nr, size):
    return IOC(IOC_READ, type_, nr, size)


def IOWR(type_, nr, size):
{'fraction_non_alphanumeric': 0.09658484525080042, 'fraction_numerical': 0.02454642475987193, 'mean_word_length': 4.547337278106509, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6115646', 'n_tokens_mistral': 787, 'n_tokens_neox': 743, 'n_words': 205}