code: def _get_highest_specificity_marker(stage_marker):
      """
      Get the most specific stage marker corresponding to the test. Specificity
      of test function marker is the highest, followed by test class marker and
      module marker.
  
      :return: List of most specific stage markers for the test.
      """
      is_test_collected = False
      selected_stages = []
      try:
          for marker in stage_marker:
              selected_stages = list(marker.args)
              is_test_collected = True
              break
      except TypeError:
          selected_stages = list(stage_marker.args)
          is_test_collected = True
      if not is_test_collected:
          raise RuntimeError(
              "stage marker needs at least one stage to be specified."
          )
      return selected_stages
  
file_path: pyro/tests/conftest.py
imports: import os
  import warnings
  import pytest
  import torch
  import pyro
label_desc: Use image node_id 4 for calling a global function with example usage: _get_highest_specificity_marker(stage_marker) and returns: selected_stages