class_docstr: Python TaskScheduler object.
  
  This is the simplest object that supports msg_id based
  DAG dependencies. *Only* task msg_ids are checked, not
  msg_ids of jobs submitted via the MUX queue.
class_docstr_tok: ["Python","TaskScheduler","object",".","This","is","the","simplest","object","that","supports","msg_id","based","DAG","dependencies",".","*","Only","*","task","msg_ids","are","checked",",","not","msg_ids","of","jobs","submitted","via","the","MUX","queue","."]
docstr: Submit a task to any of a subset of our targets.
docstr_tok: ["Submit","a","task","to","any","of","a","subset","of","our","targets","."]
code: def submit_task(self, job, indices=None):
      """Submit a task to any of a subset of our targets."""
      if indices:
          loads = [self.loads[i] for i in indices]
      else:
          loads = self.loads
      idx = self.scheme(loads)
      if indices:
          idx = indices[idx]
      target = self.targets[idx]
      # print (target, map(str, msg[:3]))
      # send job to the engine
      self.engine_stream.send(target, flags=zmq.SNDMORE, copy=False)
      self.engine_stream.send_multipart(job.raw_msg, copy=False)
      # update load
      self.add_job(idx)
      self.pending[target][job.msg_id] = job
      # notify Hub
      content = dict(
          msg_id=job.msg_id, engine_id=target.decode("ascii")
      )
      self.session.send(
          self.mon_stream,
          "task_destination",
          content=content,
          ident=[b"tracktask", self.ident],
      )
  
imports: import time
  from collections import deque
  from random import randint, random
  from types import FunctionType
  import zmq
  from traitlets import Dict, Enum, Instance, Integer, List, observe
  from ipyparallel import Dependency, error, util
  from ipyparallel.controller.scheduler import Scheduler
label_desc: Use image node_id 16 for calling the TaskScheduler obj's underlying member method code with example usage: obj.submit_task(job, indices) without return types