(tree)
return tableOut, tableIn
Return two tables: one of outgoing and one of incoming connections,
  with the name versus the number of connections.
Return two tables: one of outgoing and one of incoming connections,
  with the name versus the number of connections.
Return two tables : one of outgoing and one of incoming connections with the name versus the number of connections .
def findConnections(tree):
  """ Return two tables: one of outgoing and one of incoming connections,
  with the name versus the number of connections. """
  outgoing, incoming = tree.findConnectors()
  tableOut = {}
  for c in outgoing:
    for targetSet in c.getTargets(Tree):
      for target in targetSet:
        if isinstance(target, Connector):
          continue
        if tableOut.has_key(target):
          tableOut[target] += 1
        else:
          tableOut[target] = 1
  tableIn = {}
  for c in incoming:
    for origin in c.getOrigins(Tree):
      if isinstance(origin, Connector):
        continue
      if tableIn.has_key(origin):
        tableIn[origin] += 1
      else:
        tableIn[origin] = 1
  return tableOut, tableIn
def findConnections ( tree ) : outgoing , incoming = tree . findConnectors ( ) tableOut = { } for c in outgoing : for targetSet in c . getTargets ( Tree ) : for target in targetSet : if isinstance ( target , Connector ) : continue if tableOut . has_key ( target ) : tableOut [ target ] += 1 else : tableOut [ target ] = 1 tableIn = { } for c in incoming : for origin in c . getOrigins ( Tree ) : if isinstance ( origin , Connector ) : continue if tableIn . has_key ( origin ) : tableIn [ origin ] += 1 else : tableIn [ origin ] = 1 return tableOut , tableIn