code: def _match_lhs(cp, rules):
      
      rule_matches = []
      for rule in rules:
          reactant_pattern = rule.rule_expression.reactant_pattern
          for rule_cp in reactant_pattern.complex_patterns:
              if _cp_embeds_into(rule_cp, cp):
                  rule_matches.append(rule)
                  break
      return rule_matches
docs: Get rules with a left-hand side matching the given ComplexPattern.