original_docstring: 
      Given a directory tree, remove all directories that have only
      directories beneath them. Return the number of non-directory files
      remaining.
      
docstring: Given a directory tree, remove all directories that have only
  directories beneath them. Return the number of non-directory files
  remaining.
docstring_tokens: Given a directory tree remove all directories that have only directories beneath them . Return the number of non - directory files remaining .
code: def rm_empty_dirs(root):
      '''
      Given a directory tree, remove all directories that have only
      directories beneath them. Return the number of non-directory files
      remaining.
      '''
      nondirs = 0
  
      def rmed(dname):
          nonlocal nondirs
          save_nondirs = nondirs
          with chdir(dname):
              for f in os.listdir('.'):
                  if os.path.isdir(f):
                      if rmed(os.path.join(dname, f)):
                          os.rmdir(os.path.join(dname, f))
                  else:
                      nondirs += 1
          return nondirs == save_nondirs
  
      rmed(root)
      return nondirs
code_tokens: def rm_empty_dirs ( root ) : nondirs = 0 def rmed ( dname ) : nonlocal nondirs save_nondirs = nondirs with chdir ( dname ) : for f in os . listdir ( '.' ) : if os . path . isdir ( f ) : if rmed ( os . path . join ( dname , f ) ) : os . rmdir ( os . path . join ( dname , f ) ) else : nondirs += 1 return nondirs == save_nondirs rmed ( root ) return nondirs
short_docstring: Given a directory tree, remove all directories that have only
  directories beneath them.
short_docstring_tokens: Given a directory tree remove all directories that have only directories beneath them .
comment: '''
      Given a directory tree, remove all directories that have only
      directories beneath them. Return the number of non-directory files
      remaining.
      '''