def read(*parts):
    """
    Build an absolute path from *parts* and and return the contents of the
    resulting file.  Assume UTF-8 encoding.
    """
    with codecs.open(os.path.join(HERE, *parts), "rb", "utf-8") as f:
        return f.read()
def ignoring_sigint(cls):
        """A contextmanager which disables handling sigint in the current signal handler. This
        allows threads that are not the main thread to ignore sigint.

        NB: Only use this if you can't use ExceptionSink.trapped_signals().

        Class state:
        - Toggles `self._ignore_sigint` in `cls._signal_handler`.
        """
        with cls._signal_handler._ignoring_sigint():
            yield