code: def test_compute_resource_attributes_string():
      """Test string-valued resource attributes"""
  
      # if default is None and the value is not set in @batch, the value is not included in computed attributes in the end
      assert compute_resource_attributes(
          [], MockDeco("batch", {}), {"cpu": "1", "instance_type": None}
      ) == {"cpu": "1"}
  
      # use string value from deco if set (default is None)
      assert compute_resource_attributes(
          [],
          MockDeco("batch", {"instance_type": "p3.xlarge"}),
          {"cpu": "1", "instance_type": None},
      ) == {"cpu": "1", "instance_type": "p3.xlarge"}
  
      # use string value from deco if set (default is not None)
      assert compute_resource_attributes(
          [],
          MockDeco("batch", {"instance_type": "p3.xlarge"}),
          {"cpu": "1", "instance_type": "p4.xlarge"},
      ) == {"cpu": "1", "instance_type": "p3.xlarge"}
  
      # use string value from defaults if @batch has it set to None
      assert compute_resource_attributes(
          [],
          MockDeco("batch", {"instance_type": None}),
          {"cpu": "1", "instance_type": "p4.xlarge"},
      ) == {"cpu": "1", "instance_type": "p4.xlarge"}
  
imports: from collections import namedtuple
  from metaflow.plugins.aws.aws_utils import compute_resource_attributes
label_desc: Use image node_id 2 for calling a global function with example usage: test_compute_resource_attributes_string() without return types