class_docstr: An object for representing a set of msg_id dependencies.
  
  Subclassed from set().
  
  Parameters
  ----------
  dependencies: list/set of msg_ids or AsyncResult objects or output of Dependency.as_dict()
      The msg_ids to depend on
  all : bool [default True]
      Whether the dependency should be considered met when *all* depending tasks have completed
      or only when *any* have been completed.
  success : bool [default True]
      Whether to consider successes as fulfilling dependencies.
  failure : bool [default False]
      Whether to consider failures as fulfilling dependencies.
  
  If `all=success=True` and `failure=False`, then the task will fail with an ImpossibleDependency
      as soon as the first depended-upon task fails.
class_docstr_tok: ["An","object","for","representing","a","set","of","msg_id","dependencies",".","Subclassed","from","set","(",")",".","Parameters","--","--","--","--","--","dependencies",":","list\/set","of","msg_ids","or","AsyncResult","objects","or","output","of","Dependency.as_dict","(",")","The","msg_ids","to","depend","on","all",":","bool","[","default","True","]","Whether","the","dependency","should","be","considered","met","when","*","all","*","depending","tasks","have","completed","or","only","when","*","any","*","have","been","completed",".","success",":","bool","[","default","True","]","Whether","to","consider","successes","as","fulfilling","dependencies",".","failure",":","bool","[","default","False","]","Whether","to","consider","failures","as","fulfilling","dependencies",".","If","`","all=success=True","`","and","`","failure=False","`",",","then","the","task","will","fail","with","an","ImpossibleDependency","as","soon","as","the","first","depended-upon","task","fails","."]
code: def __init__(
      self, dependencies=[], all=True, success=True, failure=False
  ):
      if isinstance(dependencies, dict):
          # load from dict
          all = dependencies.get("all", True)
          success = dependencies.get("success", success)
          failure = dependencies.get("failure", failure)
          dependencies = dependencies.get("dependencies", [])
      ids = []
  
      # extract ids from various sources:
      if isinstance(dependencies, (str, AsyncResult)):
          dependencies = [dependencies]
      for d in dependencies:
          if isinstance(d, str):
              ids.append(d)
          elif isinstance(d, AsyncResult):
              ids.extend(d.msg_ids)
          else:
              raise TypeError("invalid dependency type: %r" % type(d))
  
      set.__init__(self, ids)
      self.all = all
      if not (success or failure):
          raise ValueError(
              "Must depend on at least one of successes or failures!"
          )
      self.success = success
      self.failure = failure
  
file_path: ipyparallel/ipyparallel/controller/dependency.py
imports: from types import ModuleType
  from ipyparallel.client.asyncresult import AsyncResult
  from ipyparallel.error import UnmetDependency
  from ipyparallel.serialize import can
  from ipyparallel.util import interactive
label_desc: Use image node_id 1 to create a new Dependency object from inherited base classes: set with example: obj = Dependency(dependencies, all, success, failure)