code: def select_resources(self, request, runtime_context):  # pylint: disable=unused-argument
          # type: (Dict[str, int], RuntimeContext) -> Dict[str, int]
          
          result = {}  # type: Dict[str, int]
          maxrsc = {
              "cores": self.max_cores,
              "ram": self.max_ram
          }
          for rsc in ("cores", "ram"):
              if request[rsc+"Min"] > maxrsc[rsc]:
                  raise WorkflowException(
                      "Requested at least %d %s but only %d available" %
                      (request[rsc+"Min"], rsc, maxrsc[rsc]))
              if request[rsc+"Max"] < maxrsc[rsc]:
                  result[rsc] = request[rsc+"Max"]
              else:
                  result[rsc] = maxrsc[rsc]
  
          return result
docs: Naïve check for available cpu cores and memory.