Skip to content

Commit

Permalink
style: format code with Autopep8, Black, ClangFormat, dotnet-format, …
Browse files Browse the repository at this point in the history
…Go fmt, Gofumpt, Google Java Format, isort, Ktlint, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt, Scalafmt, StandardJS, StandardRB, swift-format and Yapf

This commit fixes the style issues introduced in 12e0a41 according to the output
from Autopep8, Black, ClangFormat, dotnet-format, Go fmt, Gofumpt, Google Java
Format, isort, Ktlint, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt,
Scalafmt, StandardJS, StandardRB, swift-format and Yapf.

Details: None
  • Loading branch information
deepsource-autofix[bot] authored Jul 20, 2024
1 parent 12e0a41 commit b6add6f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ai-auditor-module/audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@
from sklearn.preprocessing import StandardScaler

# Load AI model
model = joblib.load('ai_model.joblib')
model = joblib.load("ai_model.joblib")

# Load smart contract data
smart_contract_data = pd.read_csv('smart_contract_data.csv')
smart_contract_data = pd.read_csv("smart_contract_data.csv")

# Preprocess data
scaler = StandardScaler()
smart_contract_data[['feature1', 'feature2',...]] = scaler.fit_transform(smart_contract_data[['feature1', 'feature2',...]])
smart_contract_data[["feature1", "feature2", ...]] = scaler.fit_transform(
smart_contract_data[["feature1", "feature2", ...]]
)

# Make predictions
predictions = model.predict(smart_contract_data)

# Analyze predictions
for i, prediction in enumerate(predictions):
if prediction == 1:
print(f'Smart contract {i} is vulnerable!')
print(f"Smart contract {i} is vulnerable!")
else:
print(f'Smart contract {i} is secure.')
print(f"Smart contract {i} is secure.")

0 comments on commit b6add6f

Please sign in to comment.