code: def import_organizations(self, parser, overwrite=False):
          
          orgs = parser.organizations
  
          for org in orgs:
              try:
                  api.add_organization(self.db, org.name)
              except ValueError as e:
                  raise RuntimeError(str(e))
              except AlreadyExistsError as e:
                  pass
  
              for dom in org.domains:
                  try:
                      api.add_domain(self.db, org.name, dom.domain,
                                     is_top_domain=dom.is_top_domain,
                                     overwrite=overwrite)
                      self.display('load_domains.tmpl', domain=dom.domain,
                                   organization=org.name)
                  except (ValueError, NotFoundError) as e:
                      raise RuntimeError(str(e))
                  except AlreadyExistsError as e:
                      msg = "%s. Not updated." % str(e)
                      self.warning(msg)
docs: Import organizations.
  
          New domains and organizations parsed by 'parser' will be added
          to the registry. Remember that a domain can only be assigned to
          one organization. If one of the given domains is already on the registry,
          the new relationship will NOT be created unless 'overwrite' were set
          to 'True'.
  
          :param parser: sorting hat parser
          :param overwrite: force to reassign domains