def require_subsystem(self, subsystem):
        """
        Check whether the given subsystem is enabled and is writable
        (i.e., new cgroups can be created for it).
        Produces a log message for the user if one of the conditions is not fulfilled.
        If the subsystem is enabled but not writable, it will be removed from
        this instance such that further checks with "in" will return "False".
        @return A boolean value.
        """
        if not subsystem in self:
            logging.warning('Cgroup subsystem %s is not enabled. Please enable it with '
                            '"sudo mount -t cgroup none /sys/fs/cgroup".',
                            subsystem)
            return False

        try:
            test_cgroup = self.create_fresh_child_cgroup(subsystem)
            test_cgroup.remove()
        except __HOLE__ as e:
            self.paths = set(self.per_subsystem.values())
            logging.warning('Cannot use cgroup hierarchy mounted at {0} for subsystem {1}, '
                            'reason: {2}. '
                            'If permissions are wrong, please run "sudo chmod o+wt \'{0}\'".'
                            .format(self.per_subsystem[subsystem], subsystem, e.strerror))
            del self.per_subsystem[subsystem]
            return False

        return True
dataset/ETHPy150Open sosy-lab/benchexec/benchexec/cgroups.py/Cgroup.require_subsystem