code: def super_glob(pattern):
      'glob that understands **/ for all sub-directories recursively.'
      pieces = pattern.split('/')
      if '**' in pieces:
          prefix = '/'.join(pieces[:pieces.index('**')])
          postfix = '/'.join(pieces[pieces.index('**') + 1:])
          roots = [dirname
                   for dirname, dirnames, filenames in os.walk(prefix)]
          patterns = [root + '/' + postfix for root in roots]
      else:
          patterns = ['/'.join(pieces)]
      return chain.from_iterable(glob(pattern) for pattern in patternsf super_glob(pattern):
      'glob that understands **/ for all sub-directories recursively.'
      pieces = pattern.split('/')
      if '**' in pieces:
          prefix = '/'.join(pieces[:pieces.index('**')])
          postfix = '/'.join(pieces[pieces.index('**') + 1:])
          roots = [dirname
                   for dirname, dirnames, filenames in os.walk(prefix)]
          patterns = [root + '/' + postfix for root in roots]
      else:
          patterns = ['/'.join(pieces)]
      return chain.from_iterable(glob(pattern) for pattern in patterns)
docs: glob that understands **/ for all sub-directories recursively.