code: def export_organizations(self, outfile):
          
          exporter = SortingHatOrganizationsExporter(self.db)
  
          dump = exporter.export()
  
          try:
              outfile.write(dump)
              outfile.write('\n')
          except IOError as e:
              raise RuntimeError(str(e))
  
          return CMD_SUCCESS
docs: Export organizations information to a file.
  
          The method exports information related to organizations, to
          the given 'outfile' output file.
  
          :param outfile: destination file object