code: def pytest_collection_modifyitems(config, items):
      marker_expr = config.getoption("markexpr")
  
      deselected = []
  
      # first add all the markers, possibly filtering
      # python 3.4/3.5 compat: rootdir = pathlib.Path(str(config.rootdir))
      rootdir = pathlib.Path(config.rootdir)
      for item in items:
          rel_path = str(pathlib.Path(item.fspath).relative_to(rootdir))
          for file_pattern, marker in MARKER_RULES:
              if file_pattern in rel_path:
                  item.add_marker(marker)
                  if marker_expr and marker != marker_expr:
                      deselected.append(item)
                  break
          else:
              assert (
                  "/" not in rel_path[6:]
              ), f"Couldn't categorize '{rel_path}'"
              item.add_marker("unit")
              if marker_expr not in ["", "unit"]:
                  deselected.append(item)
  
      # kill everything that wasn't grabbed
      for item in deselected:
          items.remove(item)
  
      if "CIRCLE_NODE_TOTAL" in os.environ:
          # circleci, split up the parallelism by classes
          class_mapping = collections.defaultdict(list)
          for item in items:
              class_name = get_class_name(item)
              class_mapping[class_name].append(item)
  
          test_groupings = list(class_mapping.keys())
          random.Random(1339).shuffle(test_groupings)
  
          filtered_tests = filter_tests_with_circleci(test_groupings)
          new_items = []
          for name in filtered_tests:
              new_items.extend(class_mapping[name])
              items[:] = new_items
  
file_path: ParlAI/conftest.py
imports: import os
  import pathlib
  import random
  import collections
  import pytest
  import subprocess
label_desc: Use image node_id 3 for calling a global function with example usage: pytest_collection_modifyitems(config, items) without return types