This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import boto3 | |
| import json | |
| s3 = boto3.client("s3") | |
| def lambda_handler(event, context): | |
| for record in event["Records"]: | |
| bucket = record["s3"]["bucket"]["name"] | |
| key = record["s3"]["object"]["key"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import hashlib | |
| import boto3 | |
| from pathlib import Path | |
| s3 = boto3.client("s3") | |
| def file_hash(path: Path) -> str: | |
| return hashlib.md5(path.read_bytes()).hexdigest() | |
| def sync_directory(local_dir: str, bucket: str, prefix: str = "") -> None: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import boto3 | |
| from pathlib import Path | |
| s3 = boto3.client("s3") | |
| def upload_file(local_path: str, bucket: str, s3_key: str) -> None: | |
| """Upload a single file to S3, preserving content type where possible.""" | |
| path = Path(local_path) | |
| if not path.exists(): | |
| raise FileNotFoundError(f"No such file: {local_path}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pip install boto3 | |
| export AWS_ACCESS_KEY_ID="your-access-key" | |
| export AWS_SECRET_ACCESS_KEY="your-secret-key" | |
| export AWS_DEFAULT_REGION="us-east-1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| df = pd.read_csv("survey_responses.csv") | |
| # Standardize inconsistent text entries in the "country" column | |
| df["country"] = df["country"].str.strip().str.title() | |
| df["country"] = df["country"].replace({ | |
| "Usa": "United States", | |
| "U.S.": "United States", | |
| "Uk": "United Kingdom" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let angle = Math.PI / 4; | |
| let angleVelocity = 0; | |
| const angleAcceleration = 0; | |
| const length = 200; | |
| const gravity = 0.4; | |
| function setup() { | |
| createCanvas(400, 400); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Example decision audit log entry | |
| decision_id: "d-88213" | |
| timestamp: "2026-03-14T09:12:00Z" | |
| model_version: "credit-risk-v4.2.1" | |
| input_features_hash: "a91f...c3d2" | |
| prediction: "denied" | |
| confidence_score: 0.87 | |
| explainability_report_ref: "shap-report-88213.json" | |
| reviewed_by_human: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import shap | |
| import xgboost as xgb | |
| # Train a model on your dataset (X_train, y_train assumed pre-processed) | |
| model = xgb.XGBClassifier() | |
| model.fit(X_train, y_train) | |
| # Create an explainer and compute SHAP values for the test set | |
| explainer = shap.TreeExplainer(model) | |
| shap_values = explainer.shap_values(X_test) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cax = new DoodleUnitType("cax") {{ | |
| constructor = TankUnit::create; | |
| aiController = GroundAI::new; | |
| //attributes | |
| hitSize = 50f; | |
| treadPullOffset = 1; | |
| speed = 0.7f; | |
| health = 17000; | |
| armor = 30f; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| print("hello world") |
NewerOlder