def DoesTestHaveLabels(cls, labels):
  labels = set(labels)

  for name in dir(cls):
    if name.startswith("test"):
      item = getattr(cls, name, None)
      if labels.intersection(getattr(item, "labels", set(["small"]))):
        return True

  return False
Returns true if any tests in cls have any of the labels.
dataset/ETHPy150Open google/grr/grr/tools/run_tests.py/DoesTestHaveLabels