parameters: (self, host, sg, top=None)
return_statement: return res
docstring: Performs similar to os.walk(), returning a tuple of tuples containing
              (dirpath, dirnames, filenames).
          'dirnames' is a tuple of all directories at the current level.
          'filenames' is a dictionary, where the values are the file sizes.
docstring_summary: Performs similar to os.walk(), returning a tuple of tuples containing
              (dirpath, dirnames, filenames).
          'dirnames' is a tuple of all directories at the current level.
          'filenames' is a dictionary, where the values are the file sizes.
docstring_tokens: Performs similar to os . walk () returning a tuple of tuples containing ( dirpath dirnames filenames ) . dirnames is a tuple of all directories at the current level . filenames is a dictionary where the values are the file sizes .
function: def walkSG(self, host, sg, top=None):
          """
          Performs similar to os.walk(), returning a tuple of tuples containing
              (dirpath, dirnames, filenames).
          'dirnames' is a tuple of all directories at the current level.
          'filenames' is a dictionary, where the values are the file sizes.
          """
          def walk(self, host, sg, root, path):
              res = self.getSGList(host, sg, root+path+'/')
              if isinstance(res, tuple):
                  dlist = list(res[0])
                  res = [dlist, dict(zip(res[1], res[2]))]
                  if path == '':
                      res = {'/':res}
                  else:
                      res = {path:res}
                  for d in dlist:
                      res.update(walk(self, host, sg, root, path+'/'+d))
                  return res
              else:
                  return {}
  
          bases = self.getSGList(host, sg, '')
          if (top == '/') or (top is None): top = ''
          walked = {}
          for base in bases:
              res = walk(self, host, sg, base, top)
              for d in res:
                  if d in walked:
                      walked[d][0] += res[d][0]
                      walked[d][1].update(res[d][1])
                  else:
                      walked[d] = res[d]
  
          res = []
          for key, val in list(walked.items()):
              res.append((key, tuple(val[0]), val[1]))
          res.sort()
          return res
function_tokens: def walkSG ( self , host , sg , top = None ) : def walk ( self , host , sg , root , path ) : res = self . getSGList ( host , sg , root + path + '/' ) if isinstance ( res , tuple ) : dlist = list ( res [ 0 ] ) res = [ dlist , dict ( zip ( res [ 1 ] , res [ 2 ] ) ) ] if path == '' : res = { '/' : res } else : res = { path : res } for d in dlist : res . update ( walk ( self , host , sg , root , path + '/' + d ) ) return res else : return { } bases = self . getSGList ( host , sg , '' ) if ( top == '/' ) or ( top is None ) : top = '' walked = { } for base in bases : res = walk ( self , host , sg , base , top ) for d in res : if d in walked : walked [ d ] [ 0 ] += res [ d ] [ 0 ] walked [ d ] [ 1 ] . update ( res [ d ] [ 1 ] ) else : walked [ d ] = res [ d ] res = [ ] for key , val in list ( walked . items ( ) ) : res . append ( ( key , tuple ( val [ 0 ] ) , val [ 1 ] ) ) res . sort ( ) return res