@staticmethod
def _calculate_n_frames(machine, machine_allocation_controller):
    """ Figures out how many frames are being used in this setup.            A key of cabinet,frame will be used to identify unique frame.

        :param machine: the machine object
        :param machine_allocation_controller: the spalloc job object
        :return: number of frames
        """
    if machine_allocation_controller is None:
        return 0
    cabinet_frame = set()
    for ethernet_connected_chip in machine.ethernet_connected_chips:
        cabinet, frame, _ = machine_allocation_controller.where_is_machine(
            chip_x=ethernet_connected_chip.x, chip_y=ethernet_connected_chip.y)
        cabinet_frame.add((cabinet, frame))
    return len(list(cabinet_frame))
