<jupyter_start><jupyter_text>New Section<jupyter_code># This cell imports the drive library and mounts your Google Drive as a VM local drive. You can access to your Drive files 
# using this path "/content/drive/"

from google.colab import drive
drive.mount('/content/drive')
%cd /content/drive/MyDrive/
!ls -lah
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from google.colab import auth
from oauth2client.client import GoogleCredentials

auth.authenticate_user()
gauth = GoogleAuth()
gauth.credentials = GoogleCredentials.get_application_default()
my_drive = GoogleDrive(gauth)
import time

stop=False
while(not stop):
  try:
    listFiles = my_drive.ListFile({'q': "trashed = true", 'maxResults':500}).GetList()
    total = len(listFiles)
    print('list files len=', total)
    if total<=100:
      stop = True

    for i,a_file in enumerate(listFiles):
        # print the name of the file being deleted.
        #print(str(i)+'/'+str(total), a_file, 'is about to get deleted permanently.')
        if i%50==0:
          print(str(i)+'/'+str(total), 'title: %s, id: %s' % (a_file['title'], a_file['id']))

        # delete the file permanently.
        try:
          a_file.Delete()
        except:
          print('delete files error!')
          pass
  except:
    print('list files error!')
    time.sleep(5)
      #break<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12103746397694524, 'fraction_numerical': 0.00792507204610951, 'mean_word_length': 3.5392156862745097, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '603583', 'license': 'MIT', 'n_tokens_mistral': 449, 'n_tokens_neox': 433, 'n_words': 128, 'path': 'delete_Trash2.ipynb', 'repo_name': 'StevenHuang2020/GoogleDrive_Cleanner', 'size': '1388'}