text: # Generated by Django 3.0.1 on 2019-12-21 15:11
  
  from django.db import migrations
  
  from ..preprocess import PreProcessor
  
  from django.conf import settings
  
  DATA_ROOT_DIRECTORY = settings.DATA_ROOT_DIRECTORY
  
  
  def sync_relation(apps, schema_editor):
      processor = PreProcessor(data_root_directory=DATA_ROOT_DIRECTORY)
      projects = sorted(processor.get_sub_folders())
      print("Total projects: %s" % len(projects))
      index = 300
      for project_name in projects[index:]:
          index += 1
          print('\nProject %s: %s' % (index, project_name))
          if project_name.startswith('.') or project_name.endswith('.csv') or project_name.endswith('.txt'):
              continue
          processor.write_relation_to_db(project_name, 'train_set.txt')
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('software_mining', '0003_auto_20191221_1354'),
      ]
  
      operations = [
          migrations.RunPython(sync_relation, hints={'target_db': 'default'}),
      ]
  