class_docstr: Expand traffic light boundaries over all features and metrics
  
  The module extracts the monitoring rules for the traffic light
  bounds for specific features/metrics and if those are not found -
  monitoring rules are extracted from the wildcard rules which are
  meant to be generic. Then bounds can be stored as either raw
  values or as directly calculated values on the statistics of the data.
code: def transform(self, test_data: dict) -> tuple[Any, Any]:
      # determine all possible features, used for the comparison below
      features = self.get_features(list(test_data.keys()))
  
      pkeys, nkeys = collect_traffic_light_bounds(self.monitoring_rules)
  
      # loop over features to apply monitoring business rules to
      for feature in features[:]:
          # basic checks if feature object is filled correctly
          test_df = self.get_datastore_object(
              test_data, feature, dtype=pd.DataFrame
          )
  
          # --- 1. tl bounds explicitly defined for a particular feature
          if feature in pkeys:
              explicit_cols = [
                  pcol
                  for pcol in pkeys[feature]
                  if pcol in test_df.columns
              ]
              implicit_cols = set(pkeys[feature]) - set(explicit_cols)
  
              # --- A1. tl bounds explicitly defined for a particular feature/profile combo
              self._set_traffic_lights(
                  feature,
                  explicit_cols,
                  pattern="*",
                  rule=lambda name, _, __: name,
              )
  
              # --- B1. tl bounds implicitly defined for particular feature
              #         see if a wildcard match can be found.
              for pattern in implicit_cols:
                  self._set_traffic_lights(
                      feature,
                      test_df.columns,
                      pattern,
                      rule=lambda _, feat, pat: f"{feat}:{pat}",
                  )
          # --- 2. tl bounds not explicitly defined for a particular feature,
          #        see if a wildcard match can be found.
          for pattern in nkeys:
              self._set_traffic_lights(
                  feature,
                  test_df.columns,
                  pattern,
                  rule=lambda _, __, pat: pat,
              )
  
      return self.traffic_lights, self.traffic_light_funcs
  
imports: from __future__ import annotations
  import copy
  import fnmatch
  from collections import defaultdict
  from typing import Any
  import numpy
  import pandas
  from popmon.analysis.apply_func import ApplyFunc
  from popmon.base import Module, Pipeline
label_desc: Use image node_id 4 for calling the ComputeTLBounds obj's underlying member method code with example usage: obj.transform(test_data) and returns: self,  self