code: def get_paths_from_parsed_data(parsed_data: dict) -> list:
      # Example JSON input:
      # "rule": [
      #     {
      #       "@class": "py_test",
      #       "@location": "/home/ubuntu/ray/python/ray/tests/BUILD:345:8",
      #       "@name": "//python/ray/tests:test_tracing",
      #       "string": [
      #         {
      #           "@name": "name",
      #           "@value": "test_tracing"
      #         },
      #       ],
      #       "list": [
      #         {
      #           "@name": "srcs",
      #           "label": [
      #             {
      #               "@value": "//python/ray/tests:aws/conftest.py"
      #             },
      #             {
      #               "@value": "//python/ray/tests:conftest.py"
      #             },
      #             {
      #               "@value": "//python/ray/tests:test_tracing.py"
      #             }
      #           ]
      #         }
      #       ],
      #       ... other fields ...
      #       "label": {
      #         "@name": "main",
      #         "@value": "//python/ray/tests:test_runtime_env_working_dir_remote_uri.py"
      #       },
      #       ... other fields ...
      #     }
      # ]
      #
      # We want to get the location of the actual test file.
      # This can be, in order of priority:
      #   1. Specified as the "main" label
      #   2. Specified as the ONLY "srcs" label
      #   3. Specified as the "srcs" label matching the "name" of the test
      # https://docs.bazel.build/versions/main/be/python.html#py_test
  
      paths = []
      for rule in parsed_data["query"]["rule"]:
          name = rule["@name"]
          if "label" in rule and rule["label"]["@name"] == "main":
              paths.append((name, treat_path(rule["label"]["@value"])))
          else:
              list_args = {e["@name"]: e for e in rule["list"]}
              label = list_args["srcs"]["label"]
              if isinstance(label, dict):
                  paths.append((name, treat_path(label["@value"])))
              else:
                  # list
                  string_name = next(
                      x["@value"]
                      for x in rule["string"]
                      if x["@name"] == "name"
                  )
                  main_path = next(
                      x["@value"]
                      for x in label
                      if string_name in x["@value"]
                  )
                  paths.append((name, treat_path(main_path)))
      return paths
  
file_path: ray/ci/lint/pytest_checker.py
imports: import json
  import re
  import sys
  from pathlib import Path
label_desc: Use image node_id 4 for calling a global function with example usage: get_paths_from_parsed_data(parsed_data) and returns: paths