'Checks if the \'pid\' process is in \'pwd\' cgroup
:param pid: pid of the process
:param pwd: cgroup directory
:return: 0 when is \'pwd\' member'

def is_cgroup(self, pid, pwd):

    if isinstance(pwd, int):
        pwd = self.cgroups[pwd]
    if (open(os.path.join(pwd, 'tasks')).readlines().count(('%d\n' % pid)) > 0):
        return 0
    else:
        return (-1)
