Repository Analysis

py-why/dowhy

DoWhy is a Python library for causal inference that supports explicit modeling and testing of causal assumptions. DoWhy is based on a unified language for causal inference, combining causal graphical models and potential outcomes frameworks.

26.9 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of py-why/dowhy, a Python project with 8,208 GitHub stars. SynthScan v2.0 examined 56,058 lines of code across 300 source files, recording 1205 pattern matches distributed across 19 syntactic categories. The overall adjusted score of 26.9 places this repository in the Moderate AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

26.9
Adjusted Score
26.9
Raw Score
100%
Time Factor
2026-07-14
Last Push
8.2K
Stars
Python
Language
56.1K
Lines of Code
300
Files
1.2K
Pattern Hits
2026-07-14
Scan Date
0.14
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 1HIGH 42MEDIUM 41LOW 1121

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 1205 distinct pattern matches across 19 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Hyper-Verbose Identifiers760 hits · 823 pts
SeverityFileLineSnippetContext
LOWtest_parallel_refuters.py33 "def _simulate_confounders_effect_once(" in aucc_contentCODE
LOWtests/test_datasets.py6def test_when_generating_sales_dataset_then_returns_reasonable_samples():CODE
LOWtests/test_datasets.py19def test_linear_dataset_with_binary_treatment():CODE
LOWtests/test_datasets.py33def test_linear_dataset_with_categorical_treatment():CODE
LOWtests/test_causal_model.py381 def test_cate_estimates_regression(self, beta, num_effect_modifiers, num_samples):STRING
LOWtests/test_causal_model.py406 def test_estimate_conditional_effects_public_api(self):STRING
LOWtests/test_causal_model.py567 def test_unobserved_graph_variables_log_warning(self, caplog):STRING
LOWtests/test_causal_model.py627 def test_compability_with_gcm(self):STRING
LOWtests/test_causal_model.py651 def test_incorrect_graph_format(self):STRING
LOWtests/test_causal_model.py661 def test_warn_when_treatment_not_in_data(self):STRING
LOWtests/test_causal_model.py672 def test_warn_when_outcome_not_in_data(self):CODE
LOWtests/test_causal_model.py683 def test_no_warn_when_treatment_and_outcome_in_data(self):CODE
LOWtests/test_causal_model.py700 def test_causal_estimator_cache(self):CODE
LOWtests/test_causal_model.py743 def test_refute_estimate_raises_when_method_name_is_none(self):CODE
LOWtests/test_causal_model.py765 def test_do_raises_when_method_name_is_none(self):CODE
LOWtests/test_causal_model.py783 def test_estimate_effect_raises_when_method_name_is_none(self):CODE
LOWtests/test_causal_model.py801 def test_fit_estimator_false_reuses_cached_estimator(self):CODE
LOWtests/test_causal_model.py857 def test_causal_model_do_regression(self):CODE
LOWtests/test_causal_model.py900 def test_repr_matches_str_for_key_result_objects(self):CODE
LOWtests/test_data_transformer.py10def test_dimensionality_reducer_placeholder_methods():CODE
LOWtests/test_causal_estimator.py13def test_causal_estimator_placeholder_methods():CODE
LOWtests/test_causal_estimator.py30 # def test_average_treatment_effect(self):COMMENT
LOWtests/test_causal_estimator.py36 # def test_average_treatment_effect_on_treated(self):COMMENT
LOWtests/test_causal_estimator.py48def test_estimate_effect_warns_on_nan_in_treatment_or_outcome():CODE
LOWtests/test_causal_estimator.py88def test_estimate_effect_no_warning_when_no_nan():CODE
LOWtests/test_causal_estimator.py117def test_estimate_effect_raises_valueerror_for_missing_estimand():CODE
LOWtests/test_confounder_distribution_interpreter.py36def test_confounder_distribution_interpreter_with_categorical_confounder(mock_show):CODE
LOWtests/test_confounder_distribution_interpreter.py49def test_confounder_distribution_interpreter_with_integer_confounder(mock_show):CODE
LOWtests/test_causal_refuter.py14def test_causal_refuter_placeholder_method():CODE
LOWtests/test_causal_refuter.py21def test_causal_refuter_bootstrap_test():CODE
LOWtests/test_causal_refuter.py29def test_normal_distribution_test_zero_std_returns_one():CODE
LOWtests/test_causal_refuter.py47def test_choose_variables_true_returns_all():CODE
LOWtests/test_causal_refuter.py53def test_choose_variables_false_returns_none():CODE
LOWtests/test_causal_refuter.py59def test_choose_variables_int_returns_correct_count():CODE
LOWtests/test_causal_refuter.py66def test_choose_variables_int_zero_returns_empty():CODE
LOWtests/test_causal_refuter.py72def test_choose_variables_int_too_large_raises():CODE
LOWtests/test_causal_refuter.py78def test_choose_variables_list_select_returns_subset():CODE
LOWtests/test_causal_refuter.py84def test_choose_variables_list_deselect_returns_complement():CODE
LOWtests/test_causal_refuter.py90def test_choose_variables_list_deselect_all_returns_empty():CODE
LOWtests/test_causal_refuter.py96def test_choose_variables_list_mixed_select_deselect_raises():CODE
LOWtests/test_causal_refuter.py102def test_choose_variables_list_invalid_variable_raises():CODE
LOWtests/test_causal_refuter.py108def test_choose_variables_empty_pool_true_returns_empty():CODE
LOWtests/test_causal_refuter.py114def test_choose_variables_empty_pool_false_returns_none():CODE
LOWtests/test_causal_graph.py58 def test_check_valid_backdoor_set(self):CODE
LOWtests/test_causal_graph.py120 def test_build_graph_from_str(self):CODE
LOWtests/test_causal_graph.py131def test_identify_mediation_single_mediator():CODE
LOWtests/test_causal_graph.py138def test_identify_mediation_parallel_mediators():CODE
LOWtests/test_causal_graph.py148def test_identify_mediation_no_mediator():CODE
LOWtests/test_causal_graph.py155def test_nie_with_parallel_mediators():CODE
LOWtests/test_propensity_balance_interpreter.py58 def test_interpreter_with_standard_covariate_names(self):CODE
LOWtests/test_propensity_balance_interpreter.py66 def test_interpreter_with_arbitrary_covariate_names(self):CODE
LOWtests/test_propensity_balance_interpreter.py78 def test_interpreter_returns_dataframe(self):CODE
LOWtests/test_propensity_balance_interpreter.py87 def test_interpreter_with_snake_case_method_name(self):CODE
LOWtests/test_propensity_balance_interpreter.py93 def test_interpreter_with_multiple_method_names_returns_list(self):CODE
LOW…/causal_estimators/test_linear_regression_estimator.py151 def test_average_treatment_effect(CODE
LOW…/causal_estimators/test_linear_regression_estimator.py182 def test_general_adjustment_estimation_on_example_graphs(self, example_graph: TestGraphObject):CODE
LOW…/causal_estimators/test_linear_regression_estimator.py195 def test_none_identifier_method_does_not_raise(self):CODE
LOW…/causal_estimators/test_linear_regression_estimator.py217 def test_test_significance_returns_scalar_float_for_single_treatment(self):CODE
LOW…/causal_estimators/test_linear_regression_estimator.py249 def test_test_significance_returns_array_for_multiple_treatments(self):CODE
LOW…/causal_estimators/test_linear_regression_estimator.py279 def test_invalid_identifier_method_raises(self, invalid_method):CODE
700 more matches not shown…
Cross-File Repetition38 hits · 190 pts
SeverityFileLineSnippetContext
HIGHdowhy/causal_estimators/econml.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGH…sal_estimators/propensity_score_weighting_estimator.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGH…hy/causal_estimators/two_stage_regression_estimator.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGH…ausal_estimators/regression_discontinuity_estimator.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGH…usal_estimators/propensity_score_matching_estimator.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGHdowhy/causal_estimators/propensity_score_estimator.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGHdowhy/causal_estimators/linear_regression_estimator.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGHdowhy/causal_estimators/regression_estimator.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGHdowhy/causal_estimators/causalml.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGH…y/causal_estimators/instrumental_variable_estimator.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGHdowhy/causal_estimators/distance_matching_estimator.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGH…stimators/propensity_score_stratification_estimator.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGHdowhy/causal_estimators/doubly_robust_estimator.py0:param identified_estimand: probability expression representing the target identified estimand to estimate. :param test_STRING
HIGHdowhy/causal_estimators/econml.py0fits the estimator with data for effect estimation :param data: data frame containing the data :param treatment: name ofSTRING
HIGHdowhy/causal_estimators/tabpfn_estimator.py0fits the estimator with data for effect estimation :param data: data frame containing the data :param treatment: name ofSTRING
HIGH…sal_estimators/propensity_score_weighting_estimator.py0fits the estimator with data for effect estimation :param data: data frame containing the data :param treatment: name ofSTRING
HIGH…ausal_estimators/regression_discontinuity_estimator.py0fits the estimator with data for effect estimation :param data: data frame containing the data :param treatment: name ofSTRING
HIGH…usal_estimators/propensity_score_matching_estimator.py0fits the estimator with data for effect estimation :param data: data frame containing the data :param treatment: name ofSTRING
HIGHdowhy/causal_estimators/linear_regression_estimator.py0fits the estimator with data for effect estimation :param data: data frame containing the data :param treatment: name ofSTRING
HIGHdowhy/causal_estimators/causalml.py0fits the estimator with data for effect estimation :param data: data frame containing the data :param treatment: name ofSTRING
HIGH…y/causal_estimators/instrumental_variable_estimator.py0fits the estimator with data for effect estimation :param data: data frame containing the data :param treatment: name ofSTRING
HIGH…ausal_estimators/generalized_linear_model_estimator.py0fits the estimator with data for effect estimation :param data: data frame containing the data :param treatment: name ofSTRING
HIGH…stimators/propensity_score_stratification_estimator.py0fits the estimator with data for effect estimation :param data: data frame containing the data :param treatment: name ofSTRING
HIGHdowhy/causal_estimators/regression_estimator.py0fits the estimator with data for effect estimation :param data: data frame containing the data :param treatment: name ofSTRING
HIGHdowhy/causal_estimators/econml.py0data: dataframe containing the data on which treatment effect is to be estimated. treatment_value: value of the treatmenSTRING
HIGHdowhy/causal_estimators/causalml.py0data: dataframe containing the data on which treatment effect is to be estimated. treatment_value: value of the treatmenSTRING
HIGH…y/causal_estimators/instrumental_variable_estimator.py0data: dataframe containing the data on which treatment effect is to be estimated. treatment_value: value of the treatmenSTRING
HIGHdowhy/causal_refuters/overrule/ruleset.py0overlapbooleanrule. this module implements the boolean ruleset estimator from overrule [1]. code is adapted (with some sSTRING
HIGHdowhy/causal_refuters/overrule/utils.py0overlapbooleanrule. this module implements the boolean ruleset estimator from overrule [1]. code is adapted (with some sSTRING
HIGH…/causal_refuters/overrule/BCS/load_process_data_BCS.py0overlapbooleanrule. this module implements the boolean ruleset estimator from overrule [1]. code is adapted (with some sSTRING
HIGHdowhy/causal_refuters/overrule/BCS/beam_search.py0overlapbooleanrule. this module implements the boolean ruleset estimator from overrule [1]. code is adapted (with some sSTRING
HIGH…y/causal_refuters/overrule/BCS/overlap_boolean_rule.py0overlapbooleanrule. this module implements the boolean ruleset estimator from overrule [1]. code is adapted (with some sSTRING
HIGHdowhy/graph_learners/ges.py0discover causal graph and return the graph in dot format.STRING
HIGHdowhy/graph_learners/cdt.py0discover causal graph and return the graph in dot format.STRING
HIGHdowhy/graph_learners/lingam.py0discover causal graph and return the graph in dot format.STRING
HIGHdowhy/utils/dgps/quadratic_dgp.py0implements a data generating process that returns data having linear relationship between the treatment, outcome and conSTRING
HIGHdowhy/utils/dgps/cubic_dgp.py0implements a data generating process that returns data having linear relationship between the treatment, outcome and conSTRING
HIGHdowhy/utils/dgps/linear_dgp.py0implements a data generating process that returns data having linear relationship between the treatment, outcome and conSTRING
Unused Imports160 hits · 140 pts
SeverityFileLineSnippetContext
LOWtest_parallel_refuters.py8CODE
LOWtests/test_confounder_distribution_interpreter.py17CODE
LOWtests/test_causal_graph.py4CODE
LOWtests/test_causal_graph.py5CODE
LOWtests/test_causal_graph.py11CODE
LOWtests/causal_estimators/mock_external_estimator.py1CODE
LOWtests/timeseries/test_temporal_shift.py2CODE
LOWtests/timeseries/test_temporal_shift.py2CODE
LOWtests/gcm/test_anomaly.py24CODE
LOWtests/gcm/test_feature_relevance.py8CODE
LOWtests/gcm/test_model_evaluation.py7CODE
LOWtests/gcm/test_intrinsic_influence.py20CODE
LOWtests/gcm/ml/test_autogluon.py5CODE
LOWtests/utils/test_plotting.py8CODE
LOWtests/utils/test_encoding.py1CODE
LOWtests/utils/test_encoding.py2CODE
LOW…sal_identifiers/test_complete_adjustment_identifier.py3CODE
LOWtests/causal_identifiers/test_backdoor_identifier.py1CODE
LOWtests/causal_identifiers/test_frontdoor_identifier.py3CODE
LOWtests/causal_identifiers/test_frontdoor_identifier.py6CODE
LOWtests/causal_identifiers/test_frontdoor_identifier.py6CODE
LOWtests/causal_identifiers/test_frontdoor_identifier.py8CODE
LOW…discovery-book/test_causal_inference_discovery_book.py11CODE
LOW…discovery-book/test_causal_inference_discovery_book.py11CODE
LOWdowhy/__init__.py3CODE
LOWdowhy/__init__.py3CODE
LOWdowhy/__init__.py3CODE
LOWdowhy/__init__.py3CODE
LOWdowhy/__init__.py4CODE
LOWdowhy/causal_identifier/id_identifier.py1CODE
LOWdowhy/causal_identifier/__init__.py1CODE
LOWdowhy/causal_identifier/__init__.py1CODE
LOWdowhy/causal_identifier/__init__.py1CODE
LOWdowhy/causal_identifier/__init__.py1CODE
LOWdowhy/causal_identifier/__init__.py1CODE
LOWdowhy/causal_identifier/__init__.py1CODE
LOWdowhy/causal_identifier/__init__.py1CODE
LOWdowhy/causal_identifier/__init__.py1CODE
LOWdowhy/causal_identifier/__init__.py11CODE
LOWdowhy/causal_identifier/__init__.py11CODE
LOWdowhy/causal_identifier/__init__.py12CODE
LOWdowhy/causal_identifier/__init__.py13CODE
LOWdowhy/causal_estimators/tabpfn_estimator.py1CODE
LOW…usal_estimators/propensity_score_matching_estimator.py3CODE
LOWdowhy/timeseries/temporal_shift.py2CODE
LOWdowhy/timeseries/temporal_shift.py2CODE
LOWdowhy/timeseries/temporal_shift.py2CODE
LOWdowhy/causal_refuters/data_subset_refuter.py10CODE
LOWdowhy/causal_refuters/placebo_treatment_refuter.py12CODE
LOWdowhy/causal_refuters/evalue_sensitivity_analyzer.py10CODE
LOWdowhy/causal_refuters/bootstrap_refuter.py12CODE
LOWdowhy/causal_refuters/__init__.py5CODE
LOWdowhy/causal_refuters/__init__.py5CODE
LOWdowhy/causal_refuters/__init__.py5CODE
LOWdowhy/causal_refuters/__init__.py10CODE
LOWdowhy/causal_refuters/__init__.py10CODE
LOWdowhy/causal_refuters/__init__.py11CODE
LOWdowhy/causal_refuters/__init__.py11CODE
LOWdowhy/causal_refuters/__init__.py12CODE
LOWdowhy/causal_refuters/__init__.py12CODE
100 more matches not shown…
Self-Referential Comments33 hits · 78 pts
SeverityFileLineSnippetContext
MEDIUM…usal_estimators/test_two_stage_regression_estimator.py86 # Create the graph describing the causal structureCOMMENT
MEDIUM…usal_estimators/test_two_stage_regression_estimator.py142 # Create a modelSTRING
MEDIUMtests/causal_estimators/test_causalml_estimator.py36 # Create a model that captures the sameCOMMENT
MEDIUMtests/causal_estimators/test_causalml_estimator.py61 # Create a model that captures the sameCOMMENT
MEDIUMtests/causal_estimators/test_causalml_estimator.py86 # Create a model that captures the sameCOMMENT
MEDIUMtests/causal_estimators/test_causalml_estimator.py113 # Create a model that captures the sameCOMMENT
MEDIUMtests/causal_estimators/test_causalml_estimator.py138 # Create a model that captures the sameCOMMENT
MEDIUMtests/causal_estimators/base.py307 # Create a copy of the data and swap the rows.COMMENT
MEDIUM…/causal_estimators/test_distance_matching_estimator.py153 # Create a categorical common causeCOMMENT
MEDIUM…ts/causal_refuters/test_add_unobserved_common_cause.py266 # Creating a model with no unobserved confoundersCOMMENT
MEDIUMtests/gcm/test_anomaly.py334 {"X0": X0[:1], "X1": X1[:1] + np.std(X1.data) * 3, "X2": X2[:1], "X3": X3[:1]} # Creating an anomaly hereCODE
MEDIUMtests/gcm/test_anomaly_attribution.py31 # Defining an anomaly scorer that handles multidimensional inputs.COMMENT
MEDIUMtests/gcm/test_anomaly_attribution.py84 # Defining an anomaly scorer that handles multidimensional inputs.COMMENT
MEDIUM…discovery-book/test_causal_inference_discovery_book.py72 # Define the true effectCOMMENT
MEDIUM…discovery-book/test_causal_inference_discovery_book.py145 # Create the graph describing the causal structureCOMMENT
MEDIUMdocs/generate_docs.sh54# Create the top-level index.htmlCOMMENT
MEDIUMdowhy/datasets.py892 # Creating a NN to simulate the nuisance functionCOMMENT
MEDIUMdowhy/datasets.py969 # The following code for loading the Lalonde dataset was copied fromCOMMENT
MEDIUMdowhy/datasets.py1010 # The following code is a slight modification ofCOMMENT
MEDIUMdowhy/causal_model.py351 # Define the third-party estimation method to be usedCOMMENT
MEDIUMdowhy/gcm/unit_change.py1"""This module provides the APIs for attributing the change in the output value of a deterministic mechanism for a statiSTRING
MEDIUMdowhy/gcm/whatif.py1"""This module provides functionality to answer what-if questions."""STRING
MEDIUMdowhy/gcm/causal_mechanisms.py1"""This module implements different causal mechanisms."""STRING
MEDIUMdowhy/gcm/fitting_sampling.py1"""This module provides functionality for fitting probabilistic causal models and drawing samples from them."""STRING
MEDIUMdowhy/gcm/confidence_intervals.py1"""This module provides functionality to estimate confidence intervals via bootstrapping."""STRING
MEDIUMdowhy/gcm/influence.py1"""This module provides functions to estimate causal influences."""STRING
MEDIUMdowhy/gcm/influence.py81 # Creating a smaller subgraph, which only contains upstream nodes that are connected to the target node.COMMENT
MEDIUMdowhy/gcm/influence.py273 # Creating a smaller subgraph, which only contains upstream nodes that are connected to the target node.COMMENT
MEDIUMdowhy/gcm/confidence_intervals_cms.py1"""This module provides functionality to estimate confidence intervals via bootstrapping the fitting and sampling."""STRING
MEDIUMdowhy/gcm/shapley.py1"""This module provides functionality for shapley value estimation."""STRING
MEDIUMdowhy/gcm/falsify.py1"""This module provides functionality to falsify a user-given DAG given observed data."""STRING
MEDIUMdowhy/utils/timeseries.py207 # Create a new edge with a tuple containing the time lagCOMMENT
MEDIUMdowhy/utils/timeseries.py216 # Create a new edge with a tuple containing the time lagCOMMENT
Deep Nesting73 hits · 73 pts
SeverityFileLineSnippetContext
LOWtests/causal_refuters/base.py34CODE
LOWtests/gcm/ml/test_classification.py31CODE
LOWtests/gcm/ml/test_classification.py32CODE
LOW…usal_identifiers/test_efficient_backdoor_identifier.py11CODE
LOWdowhy/causal_refuter.py80CODE
LOWdowhy/causal_graph.py28CODE
LOWdowhy/causal_graph.py90CODE
LOWdowhy/graph.py366CODE
LOWdowhy/graph.py435CODE
LOWdowhy/datasets.py631CODE
LOWdowhy/datasets.py646CODE
LOWdowhy/datasets.py686CODE
LOWdowhy/causal_model.py21CODE
LOWdowhy/causal_model.py271CODE
LOWdowhy/causal_model.py549CODE
LOWdowhy/causal_identifier/backdoor.py137CODE
LOWdowhy/causal_identifier/backdoor.py249CODE
LOWdowhy/causal_identifier/efficient_backdoor.py196CODE
LOWdowhy/causal_identifier/efficient_backdoor.py250CODE
LOWdowhy/causal_identifier/auto_identifier.py154CODE
LOW…hy/causal_estimators/two_stage_regression_estimator.py165CODE
LOWdowhy/causal_estimators/distance_matching_estimator.py172CODE
LOWdowhy/timeseries/temporal_shift.py8CODE
LOWdowhy/timeseries/temporal_shift.py78CODE
LOWdowhy/causal_refuters/placebo_treatment_refuter.py97CODE
LOWdowhy/causal_refuters/evalue_sensitivity_analyzer.py96CODE
LOWdowhy/causal_refuters/bootstrap_refuter.py95CODE
LOWdowhy/causal_refuters/linear_sensitivity_analyzer.py224CODE
LOWdowhy/causal_refuters/dummy_outcome_refuter.py258CODE
LOWdowhy/causal_refuters/dummy_outcome_refuter.py728CODE
LOWdowhy/causal_refuters/dummy_outcome_refuter.py871CODE
LOWdowhy/causal_refuters/dummy_outcome_refuter.py894CODE
LOWdowhy/causal_refuters/add_unobserved_common_cause.py847CODE
LOWdowhy/causal_refuters/add_unobserved_common_cause.py137CODE
LOWdowhy/causal_refuters/graph_refuter.py69CODE
LOWdowhy/causal_refuters/overrule/utils.py41CODE
LOW…/causal_refuters/overrule/BCS/load_process_data_BCS.py67CODE
LOW…/causal_refuters/overrule/BCS/load_process_data_BCS.py132CODE
LOWdowhy/causal_refuters/overrule/BCS/beam_search.py56CODE
LOW…y/causal_refuters/overrule/BCS/overlap_boolean_rule.py291CODE
LOWdowhy/gcm/model_evaluation.py416CODE
LOWdowhy/gcm/model_evaluation.py634CODE
LOWdowhy/gcm/model_evaluation.py762CODE
LOWdowhy/gcm/model_evaluation.py783CODE
LOWdowhy/gcm/model_evaluation.py182CODE
LOWdowhy/gcm/model_evaluation.py427CODE
LOWdowhy/gcm/equation_parser.py38CODE
LOWdowhy/gcm/distribution_change_robust.py203CODE
LOWdowhy/gcm/distribution_change_robust.py294CODE
LOWdowhy/gcm/influence.py160CODE
LOWdowhy/gcm/shapley.py77CODE
LOWdowhy/gcm/shapley.py289CODE
LOWdowhy/gcm/data_generator.py229CODE
LOWdowhy/gcm/falsify.py304CODE
LOWdowhy/gcm/falsify.py745CODE
LOWdowhy/gcm/falsify.py964CODE
LOWdowhy/gcm/auto.py185CODE
LOWdowhy/gcm/auto.py401CODE
LOWdowhy/gcm/auto.py513CODE
LOWdowhy/gcm/auto.py548CODE
13 more matches not shown…
AI Structural Patterns53 hits · 53 pts
SeverityFileLineSnippetContext
LOWtests/causal_estimators/test_causalml_estimator.py23CODE
LOWtests/causal_estimators/base.py22CODE
LOWtests/causal_estimators/base.py117CODE
LOWtests/causal_refuters/base.py34CODE
LOWdowhy/datasets.py71CODE
LOWdowhy/datasets.py850CODE
LOWdowhy/datasets.py1040CODE
LOWdowhy/causal_estimator.py56CODE
LOWdowhy/causal_model.py21CODE
LOWdowhy/causal_model.py271CODE
LOWdowhy/causal_model.py499CODE
LOWdowhy/causal_identifier/identified_estimand.py12CODE
LOWdowhy/causal_estimators/econml.py34CODE
LOWdowhy/causal_estimators/tabpfn_estimator.py272CODE
LOW…sal_estimators/propensity_score_weighting_estimator.py27CODE
LOW…hy/causal_estimators/two_stage_regression_estimator.py34CODE
LOW…ausal_estimators/regression_discontinuity_estimator.py21CODE
LOW…usal_estimators/propensity_score_matching_estimator.py28CODE
LOWdowhy/causal_estimators/linear_regression_estimator.py27CODE
LOWdowhy/causal_estimators/causalml.py30CODE
LOW…y/causal_estimators/instrumental_variable_estimator.py31CODE
LOWdowhy/causal_estimators/distance_matching_estimator.py22CODE
LOWdowhy/causal_estimators/propensity_score_estimator.py21CODE
LOW…ausal_estimators/generalized_linear_model_estimator.py26CODE
LOW…stimators/propensity_score_stratification_estimator.py27CODE
LOWdowhy/causal_estimators/doubly_robust_estimator.py27CODE
LOWdowhy/causal_estimators/regression_estimator.py21CODE
LOW…causal_refuters/partial_linear_sensitivity_analyzer.py46CODE
LOW…causal_refuters/partial_linear_sensitivity_analyzer.py522CODE
LOWdowhy/causal_refuters/bootstrap_refuter.py147CODE
LOWdowhy/causal_refuters/assess_overlap_overrule.py109CODE
LOWdowhy/causal_refuters/linear_sensitivity_analyzer.py31CODE
LOWdowhy/causal_refuters/linear_sensitivity_analyzer.py368CODE
LOWdowhy/causal_refuters/dummy_outcome_refuter.py258CODE
LOWdowhy/causal_refuters/dummy_outcome_refuter.py408CODE
LOWdowhy/causal_refuters/add_unobserved_common_cause.py703CODE
LOWdowhy/causal_refuters/add_unobserved_common_cause.py847CODE
LOWdowhy/causal_refuters/reisz.py149CODE
LOWdowhy/causal_refuters/overrule/ruleset.py27CODE
LOW…y/causal_refuters/overrule/BCS/overlap_boolean_rule.py25CODE
LOWdowhy/gcm/model_evaluation.py53CODE
LOWdowhy/gcm/distribution_change_robust.py612CODE
LOWdowhy/gcm/distribution_change_robust.py294CODE
LOWdowhy/gcm/distribution_change_robust.py514CODE
LOWdowhy/gcm/influence.py216CODE
LOWdowhy/gcm/distribution_change.py87CODE
LOWdowhy/gcm/distribution_change.py350CODE
LOWdowhy/gcm/falsify.py518CODE
LOWdowhy/gcm/independence_test/kernel.py113CODE
LOWdowhy/gcm/util/plotting.py50CODE
LOWdowhy/utils/plotting.py113CODE
LOWdowhy/api/causal_data_frame.py35CODE
LOWdowhy/causal_prediction/algorithms/cacm.py9CODE
Redundant / Tautological Comments27 hits · 41 pts
SeverityFileLineSnippetContext
LOWtests/utils/test_plotting.py21 # Check if calling the method causes some import or runtime errorsCOMMENT
LOWtests/causal_identifiers/test_optimize_backdoor.py28 # Check if backdoor sets are valid i.e. if they block all paths between the treatment and the outcomeCOMMENT
LOWtests/causal_identifiers/test_optimize_backdoor.py77 # Check if backdoor sets are valid i.e. if they block all paths between the treatment and the outcomeCOMMENT
LOWtests/causal_identifiers/test_optimize_backdoor.py105 # Check if backdoor sets are valid i.e. if they block all paths between the treatment and the outcomeCOMMENT
LOWtests/causal_identifiers/test_optimize_backdoor.py133 # Check if backdoor sets are valid i.e. if they block all paths between the treatment and the outcomeCOMMENT
LOWtests/causal_identifiers/test_optimize_backdoor.py161 # Check if backdoor sets are valid i.e. if they block all paths between the treatment and the outcomeCOMMENT
LOWdowhy/causal_refuter.py119 # Check if all are select or deselect variablesCOMMENT
LOWdowhy/causal_refuter.py131 # Check if all the required_variables belong to confounders, instrumental variables or effectCOMMENT
LOWdowhy/datasets.py737 ): # Check if current "node" has not been processed yet and if all the parent nodes have been processedCODE
LOWdowhy/causal_estimator.py116 # Check if some parameters were set, otherwise set to default valuesCOMMENT
LOWdowhy/causal_estimator.py551 # Check if any parameter is changed from the previous std error estimateCOMMENT
LOWdowhy/causal_estimator.py887 # Check if estimator's target estimand is identifiedCOMMENT
LOWdowhy/causal_model.py432 # Check if estimator's target estimand is identifiedCOMMENT
LOWdowhy/causal_identifier/backdoor.py166 # Check if path is backdoor and does not have nodes1\node1 or nodes2\node2 as intermediate nodesCOMMENT
LOW…hy/causal_estimators/two_stage_regression_estimator.py92 # Check if the treatment is one-dimensionalCOMMENT
LOWdowhy/causal_estimators/distance_matching_estimator.py136 # Check if the treatment is one-dimensionalCOMMENT
LOWdowhy/causal_estimators/propensity_score_estimator.py128 # Check if the treatment is one-dimensionalCOMMENT
LOWdowhy/timeseries/temporal_shift.py59 # Add the parent to the queue for further explorationCOMMENT
LOWdowhy/causal_refuters/assess_overlap_overrule.py210 # Check if all supported units are considered to be in the overlap setCOMMENT
LOWdowhy/causal_refuters/dummy_outcome_refuter.py608 # Check if we are using an estimator in the transformation listCOMMENT
LOWdowhy/causal_refuters/overrule/BCS/beam_search.py159 # Check if duplicateCOMMENT
LOWdowhy/gcm/whatif.py175 # Check if we need to apply an intervention on the given node.COMMENT
LOWdowhy/gcm/whatif.py180 # Check if the intervention function changes the shape of the data.COMMENT
LOWdowhy/gcm/shapley.py447 # Check if change in percentage is below thresholdCOMMENT
LOWdowhy/utils/timeseries.py45 # Check if the edge already existsCOMMENT
LOWdowhy/utils/timeseries.py104 # Check if the edge already existsCOMMENT
LOWdowhy/causal_prediction/algorithms/base_algorithm.py28 # Check if the optimizer is currently supportedCOMMENT
Modern Structural Boilerplate20 hits · 20 pts
SeverityFileLineSnippetContext
LOWdowhy/causal_refuter.py19logger = logging.getLogger(__name__)CODE
LOWdowhy/__init__.py39__all__ = [CODE
LOWdowhy/causal_estimator.py17logger = logging.getLogger(__name__)CODE
LOWdowhy/causal_identifier/__init__.py15__all__ = [CODE
LOWdowhy/causal_identifier/auto_identifier.py30logger = logging.getLogger(__name__)CODE
LOWdowhy/causal_estimators/tabpfn_estimator.py16logger = logging.getLogger(__name__)CODE
LOWdowhy/causal_estimators/causalml.py19logger = logging.getLogger(__name__)CODE
LOWdowhy/causal_refuters/data_subset_refuter.py14logger = logging.getLogger(__name__)CODE
LOWdowhy/causal_refuters/placebo_treatment_refuter.py18logger = logging.getLogger(__name__)CODE
LOWdowhy/causal_refuters/bootstrap_refuter.py16logger = logging.getLogger(__name__)CODE
LOWdowhy/causal_refuters/__init__.py33__all__ = [CODE
LOWdowhy/causal_refuters/assess_overlap.py8logger = logging.getLogger(__name__)CODE
LOWdowhy/causal_refuters/dummy_outcome_refuter.py21logger = logging.getLogger(__name__)CODE
LOWdowhy/causal_refuters/add_unobserved_common_cause.py25logger = logging.getLogger(__name__)CODE
LOWdowhy/causal_refuters/random_common_cause.py15logger = logging.getLogger(__name__)CODE
LOWdowhy/gcm/config.py15def set_default_n_jobs(n_jobs: int) -> None:CODE
LOWdowhy/gcm/causal_models.py66 def set_causal_mechanism(self, node: Any, mechanism: Union[StochasticModel, ConditionalStochasticModel]) -> None:CODE
LOWdowhy/gcm/causal_models.py101 def set_causal_mechanism(self, node: Any, mechanism: Union[StochasticModel, FunctionalCausalModel]) -> None:CODE
LOWdowhy/gcm/equation_parser.py35logger = logging.getLogger(__name__)CODE
LOWdowhy/gcm/util/general.py41def set_random_seed(random_seed: int) -> None:CODE
Cross-Language Confusion3 hits · 18 pts
SeverityFileLineSnippetContext
HIGHdowhy/causal_refuter.py167 "The normal-distribution p-value is undefined; returning p_value=1."CODE
HIGHdowhy/causal_refuters/evalue_sensitivity_analyzer.py425 # if CI crosses null, set its E-value to 1COMMENT
HIGHdowhy/gcm/divergence.py110 D_f(P || Q) = \int f(p(x)/q(x)) q(x) dx ~= -1/N \sum_x log(p(Y = 1 | x) / (1 - p(Y = 1 | x)))CODE
Decorative Section Separators4 hits · 16 pts
SeverityFileLineSnippetContext
MEDIUMtests/test_causal_refuter.py40# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/test_causal_refuter.py42# ---------------------------------------------------------------------------COMMENT
MEDIUMtests/causal_prediction/test_causal_prediction.py9# ── pure-Python tests (no torch / pytorch-lightning required) ─────────────────COMMENT
MEDIUMtests/causal_prediction/test_causal_prediction.py62# ── torch-dependent tests (skipped when torch / pl are absent) ────────────────COMMENT
Excessive Try-Catch Wrapping12 hits · 14 pts
SeverityFileLineSnippetContext
LOWtest_parallel_refuters.py45 except Exception as e:CODE
LOWtest_parallel_refuters.py69 except Exception as e:CODE
LOWtests/test_causal_estimator.py84 except Exception:CODE
MEDIUMtests/causal_estimators/test_causalml_estimator.py159 print("Error with respect to the number of samples")CODE
MEDIUMtests/causal_estimators/base.py17 print("Error tolerance is", error_tolerance)CODE
LOWdowhy/graph.py465 except Exception as e:CODE
LOWdowhy/graph.py471 except Exception as e:CODE
LOWdowhy/graph.py482 except Exception as e:CODE
LOWdowhy/graph.py489 except Exception as e:CODE
LOWdowhy/causal_estimators/tabpfn_estimator.py57 except Exception as e:CODE
LOWdowhy/utils/encoding.py54 except Exception as e:CODE
LOWdowhy/utils/plotting.py61 except Exception as error:CODE
Over-Commented Block12 hits · 12 pts
SeverityFileLineSnippetContext
LOWtests/test_causal_estimator.py21class TestCausalEstimator(unittest.TestCase):COMMENT
LOWdocs/source/conf.py1# -*- coding: utf-8 -*-COMMENT
LOWdocs/source/conf.py81# The suffix(es) of source filenames.COMMENT
LOWdocs/source/conf.py121#COMMENT
LOWdocs/source/conf.py141COMMENT
LOW.github/workflows/repo-assist.lock.yml1# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"6538abb568ad674ed3bfd5cd20c199190f28c126725f245a8bf6cbc92f9COMMENT
LOW.github/workflows/repo-assist.lock.yml21# Not all edits will cause changes to this file.COMMENT
LOW.github/workflows/repo-assist.lock.yml41# - COPILOT_GITHUB_TOKENCOMMENT
LOWdowhy/datasets.py961 "gml_graph": gml_graph,COMMENT
LOWdowhy/datasets.py1001 return lalondeCOMMENT
LOWdowhy/datasets.py1021 # 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and theCOMMENT
LOWdowhy/gcm/confidence_intervals_cms.py21#COMMENT
Hallucination Indicators1 hit · 10 pts
SeverityFileLineSnippetContext
CRITICALdowhy/causal_prediction/models/networks.py90 tmp = self.network.conv1.weight.data.clone()CODE
AI Response Leakage1 hit · 8 pts
SeverityFileLineSnippetContext
HIGHdowhy/gcm/confidence_intervals_cms.py26# In this example, gcm.confidence_intervals is expecting a callable with non-deterministic outputs for building theCOMMENT
AI Slop Vocabulary2 hits · 4 pts
SeverityFileLineSnippetContext
LOWdowhy/graph.py248 # First we can just call get_proper_causal_path_nodes, thenCOMMENT
MEDIUMdowhy/causal_estimators/doubly_robust_estimator.py214 # Doubly robust formulaCOMMENT
Fake / Example Data3 hits · 3 pts
SeverityFileLineSnippetContext
LOWtests/causal_refuters/test_assess_overlap.py10def dummy_data():CODE
LOWtests/causal_refuters/test_assess_overlap.py34def refute(dummy_data):CODE
LOWtests/causal_refuters/test_assess_overlap.py35 model = CausalModel(data=dummy_data, treatment="T", outcome="Y", common_causes=["X1", "X2"])CODE
Modern AI Meta-Vocabulary1 hit · 2 pts
SeverityFileLineSnippetContext
MEDIUMAGENTS.md23 causal_model.py # CausalModel: orchestrates the 4-step workflowCODE
Overly Generic Function Names1 hit · 1 pts
SeverityFileLineSnippetContext
LOWdowhy/causal_refuters/dummy_outcome_refuter.py728def process_data(CODE
Verbosity Indicators1 hit · 0 pts
SeverityFileLineSnippetContext
LOWdowhy/causal_refuters/dummy_outcome_refuter.py754 :param outcome_validation: This variable stores the dummy_outcome generated by the transformationsSTRING