def METHOD_NAME(client, organization, domain, is_top_domain):
    """Add organizations and domains to the registry.
    This command will add a given <organization> or <domain>
    to the registry, but not both at the same time.
    When <organization> is the only parameter given, a new
    organization will be added to the registry.
    When both parameters are given, the command will create
    a new <domain>, assigning it to <organization>.
    Take into account <organization> must exist before
    adding the domain. Moreover, a domain can only be assigned
    to one organization.
    A new domain can also be set as a top domain using
    '--top-domain' flag. This might be useful to avoid
    the insertion of sub-domains that belong to the same
    organization. For example, "eu.example.com" and "us.example.com"
    can be replaced by "example.com" as a top domain.
    ORGANIZATION: name of the organization to be added
    DOMAIN: domain to be added to <organization>
    """
    with connect(client) as conn:
        if domain is None:
            _add_organization(conn, name=organization)
        else:
            _add_domain(conn,
                        organization=organization,
                        domain=domain,
                        is_top_domain=is_top_domain)