def setUp(self):
        """
        Create several directories and files, some of which are executable
        and some of which are not.  Save the current PATH setting.
        """
        j = os.path.join

        base = self.mktemp()

        self.foo = j(base, "foo")
        self.baz = j(base, "baz")
        self.foobar = j(self.foo, "bar")
        self.foobaz = j(self.foo, "baz")
        self.bazfoo = j(self.baz, "foo")
        self.bazbar = j(self.baz, "bar")

        for d in self.foobar, self.foobaz, self.bazfoo, self.bazbar:
            os.makedirs(d)

        for name, mode in [(j(self.foobaz, "executable"), 0o700),
                           (j(self.foo, "executable"), 0o700),
                           (j(self.bazfoo, "executable"), 0o700),
                           (j(self.bazfoo, "executable.bin"), 0o700),
                           (j(self.bazbar, "executable"), 0)]:
            open(name, "wb").close()
            os.chmod(name, mode)

        self.oldPath = os.environ.get('PATH', None)
        os.environ['PATH'] = os.pathsep.join((
            self.foobar, self.foobaz, self.bazfoo, self.bazbar))

        Create several directories and files, some of which are executable
        and some of which are not.  Save the current PATH setting.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_process.py