def organize_imports():
 with RopeContext() as ctx:
  organizer = ImportOrganizer(ctx.project)
  changes = organizer.organize_imports(ctx.resource)
  if (changes is not None):
   progress = ProgressHandler('Organize imports')
   ctx.project.do(changes, task_handle=progress.handle)
   reload_changes(changes)

def organize_imports ( ) : with RopeContext ( ) as ctx : organizer = ImportOrganizer ( ctx . project ) changes = organizer . organize_imports ( ctx . resource ) if ( changes is not None ) : progress = ProgressHandler ( 'Organize imports' ) ctx . project . do ( changes , task_handle = progress . handle ) reload_changes ( changes )
organize imports in current file .