def getpaths(struct):
 if isinstance(struct, Task):
  return struct.output()
 elif isinstance(struct, dict):
  r = {}
  for (k, v) in six.iteritems(struct):
   r[k] = getpaths(v)
  return r
 else:
  try:
   s = list(struct)
  except TypeError:
   raise Exception(('Cannot map %s to Task/dict/list' % str(struct)))
  return [getpaths(r) for r in s]

def getpaths ( struct ) : if isinstance ( struct , Task ) : return struct . output ( ) elif isinstance ( struct , dict ) : r = { } for ( k , v ) in six . iteritems ( struct ) : r [ k ] = getpaths ( v ) return r else : try : s = list ( struct ) except TypeError : raise Exception ( ( 'Cannot map %s to Task/dict/list' % str ( struct ) ) ) return [ getpaths ( r ) for r in s ]
maps all tasks in a structured data object to their .