code: def _ensure_min_resources(progs, cores, memory, min_memory):
      
      for p in progs:
          if p in min_memory:
              if not memory or cores * memory < min_memory[p]:
                  memory = float(min_memory[p]) / cores
      return cores, memory
docs: Ensure setting match minimum resources required for used programs.