<commit_before># -*- coding: utf-8 -
#
# This file is part of offset. See the NOTICE for more information.


__os_mod__ = __import__("os")
__select_mod__ = __import__("select")

import inspect
import wrapt
from ..core import kernel


__all__ = ['OsProxy', 'SelectProxy']


# proxy the OS module

class OsProxy(wrapt.ObjectProxy):
    """ proxy the os module """

    _OS_SYSCALLS =  ("chown", "fchown", "close", "dup", "dup2", "read",
            "pread","write", "pwrite", "sendfile", "readv", "writev", "stat",
            "lstat", "truncate", "sync", "lseek", "open", "posix_fallocate",
            "posix_fadvise", "chmod", "chflags", "getcwd", )

    def __init__(self):
        super(OsProxy, self).__init__(__os_mod__)

    def __getattr__(self, name):
        # wrap syscalls
        if name in self._OS_SYSCALLS:
            return kernel.syscall(getattr(self.__wrapped__, name))

        return getattr(self.__wrapped__, name)


# proxy the socket proxy

<commit_msg>getcwd isn't blocking<commit_after># -*- coding: utf-8 -
#
# This file is part of offset. See the NOTICE for more information.


__os_mod__ = __import__("os")
__select_mod__ = __import__("select")

import inspect
import wrapt
from ..core import kernel


__all__ = ['OsProxy', 'SelectProxy']


# proxy the OS module

class OsProxy(wrapt.ObjectProxy):
    """ proxy the os module """

    _OS_SYSCALLS =  ("chown", "fchown", "close", "dup", "dup2", "read",
            "pread","write", "pwrite", "sendfile", "readv", "writev", "stat",
            "lstat", "truncate", "sync", "lseek", "open", "posix_fallocate",
            "posix_fadvise", "chmod", "chflags", )

    def __init__(self):
        super(OsProxy, self).__init__(__os_mod__)

    def __getattr__(self, name):
        # wrap syscalls
        if name in self._OS_SYSCALLS:
            return kernel.syscall(getattr(self.__wrapped__, name))

        return getattr(self.__wrapped__, name)


# proxy the socket proxy


{'fraction_non_alphanumeric': 0.14754098360655737, 'fraction_numerical': 0.0020491803278688526, 'mean_word_length': 3.301762114537445, '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': '3064939', 'n_tokens_mistral': 670, 'n_tokens_neox': 643, 'n_words': 173}