code: def test_resource():
      assert Resource(num_cpus=1) + Resource(num_cpus=1) == Resource(
          num_cpus=2
      )
      assert Resource(num_cpus=1) + Resource(num_gpus=1) + Resource(
          mem_bytes=1024**3
      ) == Resource(num_cpus=1, num_gpus=1, mem_bytes=1024**3)
      assert -Resource(
          num_cpus=1, num_gpus=1, mem_bytes=1024**3
      ) == Resource(num_cpus=-1, num_gpus=-1, mem_bytes=-(1024**3))
      assert Resource(num_cpus=-1) < ZeroResource
      assert Resource(num_gpus=-1) < ZeroResource
      assert Resource(mem_bytes=-1) < ZeroResource
      assert (
          Resource(num_cpus=1, num_gpus=1, mem_bytes=-(1024**3))
          < ZeroResource
      )
      assert Resource(
          num_cpus=1, num_gpus=1, mem_bytes=1024**3
      ) > Resource(num_cpus=10, num_gpus=1, mem_bytes=1024)
      assert Resource(
          num_cpus=1, num_gpus=10, mem_bytes=1024**3
      ) > Resource(num_cpus=10, num_gpus=1, mem_bytes=1024**3)
      assert Resource(
          num_cpus=100, num_gpus=10, mem_bytes=1024**3
      ) > Resource(num_cpus=10, num_gpus=10, mem_bytes=1024**3)
      assert Resource(
          num_cpus=100, num_gpus=10, mem_bytes=1024
      ) - Resource(num_cpus=10, num_gpus=20, mem_bytes=512) == Resource(
          num_cpus=90, num_gpus=-10, mem_bytes=512
      )
  
file_path: mars/mars/tests/test_resource.py
imports: import importlib
  import os
  import tempfile
  import time
  import pytest
  from ..resource import Resource, ZeroResource
label_desc: Use image node_id 4 for calling a global function with example usage: test_resource() without return types