def get_container_stats(self, container_id):
        logger.debug('Getting statistics for container ID %s', container_id)
        # We don't use the stats API since it doesn't seem to be reliable, and
        # is definitely slow. This doesn't work on Mac.
        cgroup = None
        for path in ['/sys/fs/cgroup', '/cgroup']:
            if os.path.exists(path):
                cgroup = path
                break
        if cgroup == None:
            return {}

        stats = {}

        # Get CPU usage
        try:
            cpu_path = os.path.join(cgroup, 'cpuacct/docker', container_id, 'cpuacct.stat')
            with open(cpu_path) as f:
                for line in f:
                    key, value = line.split(' ')
                    # Convert jiffies to seconds
                    if key == 'user':
                        stats['time_user'] = int(value) / 100.0
                    elif key == 'system':
                        stats['time_system'] = int(value) / 100.0
        except:
            pass

        # Get memory usage
        try:
            memory_path = os.path.join(cgroup, 'memory/docker', container_id, 'memory.usage_in_bytes')
            with open(memory_path) as f:
                stats['memory'] = int(f.read())
        except:
            pass

        return stats
dataset/ETHPy150Open codalab/codalab-cli/worker/docker_client.py/DockerClient.get_container_stats/operator `is` -> `==`