code: def get_class_name(item):
      class_name, module_name = None, None
      for parent in reversed(item.listchain()):
          if isinstance(parent, pytest.Class):
              class_name = parent.name
          elif isinstance(parent, pytest.Module):
              module_name = parent.module.__name__
              break
  
      # heuristic:
      # - better to group gpu and task tests, since tests from those modules
      #   are likely to share caching more
      # - split up the rest by class name because slow tests tend to be in
      #   the same module
      if class_name and ".tasks." not in module_name:
          return "{}.{}".format(module_name, class_name)
      else:
          return module_name
  
file_path: ParlAI/conftest.py
imports: import os
  import pathlib
  import random
  import collections
  import pytest
  import subprocess
label_desc: Use image node_id 1 for calling a global function with example usage: get_class_name(item) and returns: str, module_name