def __init__(self, model=None, debug=False):
assert isinstance(debug, bool)<EOL>assert model is None or isinstance(model, dict)<EOL>self._graph = nx.DiGraph()<EOL>self.debug = debug<EOL>if model:<EOL><INDENT>assert '<STR_LIT>' in model and '<STR_LIT>' in model<EOL>for service in model['<STR_LIT>']:<EOL><INDENT>self.add_service(**service)<EOL><DEDENT>for source, destinations in model['<STR_LIT>'].iteritems():<EOL><INDENT>assert isinstance(destinations, list)<EOL>for destination in destinations:<EOL><INDENT>self.add_dependency(source, destination)<EOL><DEDENT><DEDENT><DEDENT>
@param dependency graph of microservices with some details
{
  "services" : [
   { "name": "gateway", "service_proxies": ["127.0.0.1:9877"] },
   { "name": "productpage", "service_proxies": ["127.0.0.1:9876"] },
   { "name": "reviews"},
   { "name": "details"}
  ],

  "dependencies" : {
  "gateway" : ["productpage"],
  "productpage" : ["reviews", "details"]
 }
}