'Return the maximum number of processes that can be run (in a single
execution) given the current load on drones.
:param username: login of user to run a process.  may be None.
:param drone_hostnames_allowed: list of drones that can be used. May be
None'

def max_runnable_processes(self, username, drone_hostnames_allowed):

    usable_drone_wrappers = [wrapper for wrapper in self._drone_queue if (wrapper.drone.usable_by(username) and ((drone_hostnames_allowed is None) or (wrapper.drone.hostname in drone_hostnames_allowed)))]
    if (not usable_drone_wrappers):
        return 0
    runnable_processes = [(wrapper.drone.max_processes - wrapper.drone.active_processes) for wrapper in usable_drone_wrappers]
    return max(([0] + runnable_processes))
