def all_nodes_that_receive(service, service_configuration=None, run_only=False, deploy_to_only=False):
assert not (run_only and deploy_to_only)<EOL>if service_configuration is None:<EOL><INDENT>service_configuration = read_services_configuration()<EOL><DEDENT>runs_on = service_configuration[service]['<STR_LIT>']<EOL>deployed_to = service_configuration[service].get('<STR_LIT>')<EOL>if deployed_to is None:<EOL><INDENT>deployed_to = []<EOL><DEDENT>if run_only:<EOL><INDENT>result = runs_on<EOL><DEDENT>elif deploy_to_only:<EOL><INDENT>result = deployed_to<EOL><DEDENT>else:<EOL><INDENT>result = set(runs_on) | set(deployed_to)<EOL><DEDENT>return list(sorted(result))<EOL>
If run_only, returns only the services that are in the runs_on list.
    If deploy_to_only, returns only the services in the deployed_to list.
    If neither, both are returned, duplicates stripped.
    Results are always sorted.