@staticmethod
def _get_busy_gpu_ids(batches, node_name):
    """
        Returns a list of busy GPUs in the given batches

        :param batches: The batches to analyse given as list of dictionaries.
                        If GPUs are busy by a current batch the key 'usedGPUs' should be present.
                        The value of 'usedGPUs' has to be a list of busy device IDs.
        :return: A list of GPUDevice-IDs, which are used by the given batches on the given node
        """
    busy_gpus = []
    for b in batches:
        if b['node'] == node_name:
            batch_gpus = b.get('usedGPUs')
            if type(batch_gpus) == list:
                busy_gpus.extend(batch_gpus)
    return busy_gpus
