def get_total_capacity(self):
        def _get_capacity(node, zone):
            pod_re = re.compile(".*pods:\s+(?P<pods>\d+)")
            split = node.split()
            if len(split) > 0:
                node_name = split[0]
                cmd = ['kubectl.sh', 'describe', 'node', node_name]
                output_lines = subprocess.check_output(cmd).split('\n')
                match_lines = [pod_re.search(l) for l in output_lines if pod_re.search(l)]
                if match_lines:
                    return int(match_lines[0].group('pods'))
                return 0
            return 0
        caps = self._nodes_command(_get_capacity)
        return sum(caps)
dataset/ETHPy150Open binder-project/binder/binder/cluster.py/KubernetesManager.get_total_capacity/original