nodes: 0, module; 1, function_definition; 2, function_name:all_nodes_that_receive; 3, parameters; 4, block; 5, identifier:service; 6, default_parameter; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, assert_statement; 11, if_statement; 12, expression_statement; 13, expression_statement; 14, if_statement; 15, if_statement; 16, return_statement; 17, identifier:service_configuration; 18, None; 19, identifier:run_only; 20, False; 21, identifier:deploy_to_only; 22, False; 23, comment:"""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.
      """; 24, not_operator; 25, comparison_operator:service_configuration is None; 26, block; 27, assignment; 28, assignment; 29, comparison_operator:deployed_to is None; 30, block; 31, identifier:run_only; 32, block; 33, elif_clause; 34, else_clause; 35, call; 36, parenthesized_expression; 37, identifier:service_configuration; 38, None; 39, expression_statement; 40, identifier:runs_on; 41, subscript; 42, identifier:deployed_to; 43, call; 44, identifier:deployed_to; 45, None; 46, expression_statement; 47, expression_statement; 48, identifier:deploy_to_only; 49, block; 50, block; 51, identifier:list; 52, argument_list; 53, boolean_operator; 54, assignment; 55, subscript; 56, string; 57, attribute; 58, argument_list; 59, assignment; 60, assignment; 61, expression_statement; 62, expression_statement; 63, call; 64, identifier:run_only; 65, identifier:deploy_to_only; 66, identifier:service_configuration; 67, call; 68, identifier:service_configuration; 69, identifier:service; 70, string_content:runs_on; 71, subscript; 72, identifier:get; 73, string; 74, identifier:deployed_to; 75, list; 76, identifier:result; 77, identifier:runs_on; 78, assignment; 79, assignment; 80, identifier:sorted; 81, argument_list; 82, identifier:read_services_configuration; 83, argument_list; 84, identifier:service_configuration; 85, identifier:service; 86, string_content:deployed_to; 87, identifier:result; 88, identifier:deployed_to; 89, identifier:result; 90, binary_operator:set(runs_on) | set(deployed_to); 91, identifier:result; 92, call; 93, call; 94, identifier:set; 95, argument_list; 96, identifier:set; 97, argument_list; 98, identifier:runs_on; 99, identifier:deployed_to
code: def all_nodes_that_receive(service, service_configuration=None, run_only=False, deploy_to_only=False):
      """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.
      """
      assert not (run_only and deploy_to_only)
  
      if service_configuration is None:
          service_configuration = read_services_configuration()
      runs_on = service_configuration[service]['runs_on']
      deployed_to = service_configuration[service].get('deployed_to')
      if deployed_to is None:
          deployed_to = []
  
      if run_only:
          result = runs_on
      elif deploy_to_only:
          result = deployed_to
      else:
          result = set(runs_on) | set(deployed_to)
  
      return list(sorted(result))