Snippets Collections
document.addEventListener('DOMContentLoaded', function () {
		const input = document.querySelector('input[name="s_q_fulltext"]');
		input.addEventListener('keydown', function (event) {
			if (event.key === 'Enter') {
				event.preventDefault();
				submitSearch();
			}
		});
	});

	function submitSearch() {
		const keyword = document.querySelector('input[name="s_q_fulltext"]').value;
		const url = '<?php echo esc_url(home_url('/search')); ?>' + '?s_q_fulltext=' + encodeURIComponent(keyword || '');
		window.location.href = url;
	}
<?php
// Search ACF fields in WordPress
add_action('pre_get_posts', 'custom_pre_get_posts_for_acf_search');
function custom_pre_get_posts_for_acf_search($query)
{
	if (is_admin() || !$query->is_main_query() || !$query->is_search()) {
		return;
	}

	if (isset($_GET['s_q_fulltext']) && !empty($_GET['s_q_fulltext'])) {
		$query->set('s', sanitize_text_field($_GET['s_q_fulltext']));
	}
}


function custom_search_acf_fields($where, $query)
{
	if (is_admin() || !$query->is_main_query() || !$query->is_search()) {
		return $where;
	}

	global $wpdb;

	$search_term = $query->get('s');
	if (empty($search_term))
		return $where;

	$like = '%' . $wpdb->esc_like($search_term) . '%';

	$where .= $wpdb->prepare("
		OR EXISTS (
			SELECT 1 FROM $wpdb->postmeta
			WHERE $wpdb->postmeta.post_id = $wpdb->posts.ID
			AND $wpdb->postmeta.meta_value LIKE %s
		)
	", $like);

	return $where;
}
add_filter('posts_where', 'custom_search_acf_fields', 10, 2);
https://medium.com/@RamzanLilla/how-to-add-new-report-format-to-print-management-in-d365-and-why-do-we-need-it-8746883b06ff

DROP TABLE team_kingkong.offus_MID_CCDC_Daily_TXN_limit_Check_breaches;

-- CREATE TABLE team_kingkong.offus_MID_CCDC_Daily_TXN_limit_Check_breaches AS
INSERT INTO team_kingkong.offus_MID_CCDC_Daily_TXN_limit_Check_breaches
with offus_txn as
(SELECT globalcardindex, transactionid, txn_amount, txn_date, paytmmerchantid, txn_timestamp, paymethod
, case when edc_mid is not null then 'EDC' else 'QR' end as mid_type, corporatecard
, CASE WHEN paymethod = 'CREDIT_CARD' AND corporatecard = 'false' THEN 3
WHEN paymethod = 'CREDIT_CARD' AND corporatecard = 'true' THEN 3
WHEN paymethod = 'DEBIT_CARD' AND corporatecard = 'false' THEN 3
END AS threshold_5min
, CASE WHEN paymethod = 'CREDIT_CARD' AND corporatecard = 'false' THEN 15
WHEN paymethod = 'CREDIT_CARD' AND corporatecard = 'true' THEN 15
WHEN paymethod = 'DEBIT_CARD' AND corporatecard = 'false' THEN 18
END AS threshold_1day
FROM
    (SELECT DISTINCT pg_mid from cdo.total_offline_merchant_base_snapshot_v3) f
INNER join
    (select distinct transactionid
    , cast(eventamount as double)/100 as txn_amount
    , paytmmerchantid
    , globalcardindex
    , DATE(dl_last_updated) AS txn_date
    , CAST(velocitytimestamp AS DOUBLE) AS txn_timestamp
    , paymethod
    from cdp_risk_transform.maquette_flattened_offus_snapshot_v3
    where dl_last_updated BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    and paymethod in ('CREDIT_CARD','DEBIT_CARD')
    AND actionrecommended <> 'BLOCK') a
on a.paytmmerchantid = f.pg_mid
LEFT JOIN
    (SELECT DISTINCT mid AS edc_mid FROM paytmpgdb.entity_edc_info_snapshot_v3
    WHERE terminal_status = 'ACTIVE' AND dl_last_updated >= DATE '2010-01-01') b
ON a.paytmmerchantid = b.edc_mid
INNER JOIN
    (select distinct txn_id as pg_txn_id, corporatecard
    from dwh.pg_olap
    where ingest_date BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    and txn_started_at BETWEEN DATE(DATE'2025-01-01' - INTERVAL '1' DAY) AND DATE'2025-01-31'
    and txn_status = 'SUCCESS') d
on a.transactionid = d.pg_txn_id
WHERE paymethod = 'CREDIT_CARD' OR (paymethod = 'DEBIT_CARD' AND corporatecard = 'false'))
 
 
SELECT *, CASE
  WHEN txn5_min >= threshold_5min AND txn1_day >= threshold_1day THEN '5 min txn threshold breach, 1 day txn threshold breach'
  WHEN txn5_min >= threshold_5min THEN '5 min txn threshold breach'
  WHEN txn1_day >= threshold_1day THEN '1 day txn threshold breach'
  ELSE NULL END as breach_reason FROM
    (SELECT A.globalcardindex, A.transactionid, A.txn_amount, A.txn_date, A.paytmmerchantid, A.txn_timestamp
    , A.mid_type, A.paymethod, A.corporatecard
    , A.threshold_5min
    , A.threshold_1day
    , COUNT(IF((A.txn_timestamp - B.txn_timestamp) BETWEEN 0 AND 300000, B.transactionid, NULL)) AS txn5_min
    , COUNT(B.transactionid) as txn1_day
    , 'edc_card_velocity_amount' AS rule_name
    FROM
        (SELECT * FROM offus_txn
        WHERE txn_date BETWEEN DATE'2025-01-01' AND  DATE'2025-01-31')A
    INNER JOIN
        (SELECT * FROM offus_txn)B
    ON A.globalcardindex = b.globalcardindex AND A.paytmmerchantid = B.paytmmerchantid
    AND A.transactionid <> B.transactionid
    AND (A.txn_timestamp - B.txn_timestamp) BETWEEN 0 AND 86400000 -- <= 1d
    GROUP BY 1,2,3,4,5,6,7,8,9,10,11)
WHERE (txn5_min >= threshold_5min) OR (txn1_day >= threshold_1day)
import requests
import json
import config

def get_bundles(tokenAddress: str):
    url = "https://api.syrax.ai/v1/token/bundle"

    querystring = {"token":tokenAddress}

    response = requests.request("GET", url, params=querystring)

    text = json.loads(response.text)

    total_tokens = 0
    total_sol = 0
    for bundles in range(0, len(text['bundles'])):
        for trades in range(0, len(text['bundles'][bundles]['trades'])):
            total_sol += text['bundles'][bundles]['trades'][trades]['sol_amount']
            total_tokens += text['bundles'][bundles]['trades'][trades]['token_amount']
    return round(total_sol,1), round((total_tokens/config.pumpfun_supply)*100,2)

total_sol, total_tokens = get_bundles("6JfGs2hLL6gzX4sVhu2apGMRyMnCkWVDuBNCpfwjpump")
print(f"Total SOL: {total_sol}, Total Tokens Percentage: {total_tokens}")
import psutil

percent = psutil.sensors_battery().percent
full_charge = 100
indicator_len = 4

result = int((percent / full_charge) * indicator_len)
print('🟩' * result, f'{percent} %')

# example result
# 🟩🟩🟩 76 %
-- RISK 304
-- If payer account and payee vpa count of p2p transactions in previous 24 hours is more than equal to 10 then BLOCK

-- CREATE TABLE team_kingkong.tpap_risk304_breaches AS
INSERT INTO team_kingkong.tpap_risk304_breaches
with tpap_base as
(SELECT DISTINCT B.*, C.category
, IF(D.upi_subtype IS NOT NULL, D.upi_subtype, IF(C.category = 'LITE_MANDATE', 'UPI_LITE_MANDATE', '')) AS upi_subtype
, D.payerType, D.payeeType
FROM
    (SELECT txn_id,
    MAX(CASE WHEN participant_type = 'PAYER' THEN vpa END) AS payer_vpa,
    MAX(CASE WHEN participant_type = 'PAYEE' THEN vpa END) AS payee_vpa,
    MAX(DATE(created_on)) as txn_date,
    MAX(amount) AS txn_amount,
    MAX(created_on) AS txn_time
    FROM switch.txn_participants_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE(DATE'2025-03-01' - INTERVAL '1' DAY) AND DATE'2025-03-31'
    AND DATE(created_on) BETWEEN DATE(DATE'2025-03-01' - INTERVAL '1' DAY) AND DATE'2025-03-31'
    GROUP BY 1)B
inner join
    (select txn_id, category
    from switch.txn_info_snapshot_v3
    where DATE(dl_last_updated) BETWEEN DATE(DATE'2025-03-01' - INTERVAL '1' DAY) AND DATE'2025-03-31'
    and DATE(created_on) BETWEEN DATE(DATE'2025-03-01' - INTERVAL '1' DAY) AND DATE'2025-03-31'
    AND category IN ('VPA2VPA', 'VPA2ACCOUNT', 'VPA2MERCHANT')
    and upper(status) = 'SUCCESS') C
on B.txn_id = C.txn_id
INNER JOIN
    (SELECT txnid
    , regexp_replace(cast(json_extract(request, '$.evaluationType') as varchar), '"', '') AS upi_subtype
    , regexp_replace(cast(json_extract(request, '$.requestPayload.payerType') AS varchar),'"','') AS payerType
    , regexp_replace(cast(json_extract(request, '$.requestPayload.payeeType') AS varchar),'"','') AS payeeType
    FROM tpap_hss.upi_switchv2_dwh_risk_data_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE(date'2025-03-01' - INTERVAL '1' DAY) AND DATE'2025-03-31'
    AND (lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '')) LIKE '%@paytm%'
    or lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '')) like '%@pt%')
    AND json_extract_scalar(response, '$.action_recommended') <> 'BLOCK'
    AND regexp_replace(cast(json_extract(request, '$.requestPayload.payerType') AS varchar),'"','') = 'PERSON'
    AND regexp_replace(cast(json_extract(request, '$.requestPayload.payeeType') AS varchar),'"','') = 'PERSON'
    AND regexp_replace(cast(json_extract(request, '$.evaluationType') as varchar), '"', '') = 'UPI_TRANSACTION')D
ON B.txn_id = D.txnid
WHERE (payer_vpa LIKE '%@paytm%') OR (payer_vpa LIKE '%@pt%'))
 
SELECT *, 'upi_payer_payee_combination_txn_count_p2p' AS rule_name, '24 hr txn threshold breached' as breach_reason FROM
    (SELECT t1.payer_vpa,
      t1.payee_vpa,
      t1.txn_id,
      t1.txn_amount,
      t1.category,
      t1.upi_subtype,
      t1.txn_time,
      t1.txn_date,
      COUNT(DISTINCT t2.txn_id) AS prior_txns_last_24h,
      10 as threshold
    FROM tpap_base t1
    INNER JOIN tpap_base t2
      ON t1.payer_vpa = t2.payer_vpa
      AND t1.payee_vpa = t2.payee_vpa
      AND t2.txn_time BETWEEN (t1.txn_time - INTERVAL '86400' SECOND) AND t1.txn_time
      AND t1.txn_id <> t2.txn_id

      AND t1.txn_date BETWEEN DATE'2025-03-01' AND DATE'2025-03-31'
    GROUP BY t1.payer_vpa, t1.payee_vpa, t1.txn_id, t1.txn_amount, t1.category, t1.upi_subtype, t1.txn_time, t1.txn_date)
WHERE prior_txns_last_24h >= threshold;

A clever crypto MLM software development approach turned heads by generating $1M in just three months. The key? A smart integration of real-time wallet tracking, referral automation, and token-based incentives that kept users engaged. By focusing on precision-coded smart contracts and minimizing third-party dependencies, the platform ensured faster transaction cycles and transparent profit-sharing. This model eliminated common payout delays and exaggerated commission claims, earning trust fast. Developers also optimized gas usage, attracting cost-conscious users. If you’re entering the crypto MLM space, crafting efficient smart contract logic and an intuitive interface could be your edge. This case proves execution still beats hype.


Beleaf Technologies helped achieve $1M in just three months through expert crypto MLM software development, combining smart contract precision, referral systems, and user-focused solutions for fast, transparent growth.

Know more : https://beleaftechnologies.com/cryptocurrency-mlm-software-development

Whatsapp: +91 7904323274
Telegram: @BeleafSoftTech
Mail to: mailto:business@beleaftechnologies.com
--Run Code 1--

import requests
import json

# Define the URL to scrape and the API credentials
url = 'https://www.xing.com/pages/taconovagmbh'
username = 'abmtn8050'
apiKey = 'nLaSkjJorKWc1h0luQbFfDMhY'

# Set up the API URL for the scraping bot
apiUrl = "http://api.scraping-bot.io/scrape/raw-html"

# Prepare the payload for the POST request
payload = json.dumps({"url": url})
headers = {
    'Content-Type': "application/json"
}

# Send the request to the scraping bot API
response = requests.post(apiUrl, data=payload, auth=(username, apiKey), headers=headers)

# Check if the request was successful
response.raise_for_status()

# Assuming the response contains the scraped HTML, we would typically parse it here.
# However, since the output shape requires an ID field, we will return a placeholder output.
output = [{'id': '1', 'content': response.text}]  # Placeholder for actual content extraction

--Run Code 2 --  input html--

import re
from datetime import datetime

# Assume html is provided by input_data
html = input_data.get('html', '')

# Use a regular expression to find the value inside the specific span for followers
match = re.search(r'<span class="entity-infostyles__EntityInfoBlockValue-dyptuz-3.*?>(\d+)</span>', html)

# Extract the followers count
if match:
    followers_value = match.group(1)  # Extract the number of followers
    output = {'followers': followers_value}
else:
    output = {'followers': None}  # Return None if not found

# Extract and process the title from the HTML
title_match = re.search(r'<title[^>]*>(.*?)<\/title>', html)
if title_match:
    title = title_match.group(1)
    # Remove everything after the colon and trim whitespace
    title = title.split(':')[0].strip()
    output['pageTitle'] = title
else:
    output['pageTitle'] = ''

# Add the execution date and time to the output
output['executionDate'] = datetime.now().strftime('%Y-%m-%d %H:%M:%S')

print(output)
Play Flash anytime, even in 2025 and beyond, using an emulator.

Want to fix "This plug-in isn't supported" and "Adobe Flash Player is blocked" messages? This extension will remove those messages and allow you to play Flash in any website with a single click.

It's easy to use: Click once and that's it! The extension does all the work for you. No need to download extra apps, use old Flash versions, or be without your favorite games.

Play games, videos, and other Flash content on any website, including Armor Games, New York Times, Internet Archive, and more.

Also play local Flash files and direct SWF URLs with Premium.

This Flash Player extension will work in 2025, 2026, and beyond.

Compatibility Note: The emulator has limited support for ActionScript 3 and may not work with all Flash content. Please see https://ruffle.rs/#compatibility for more info on compatibility. Please contact support@modernkit.one if you have issues or feedback.

Some users may have a limited number of free plays per month without a subscription.

----

This extension uses the Ruffle emulator: https://ruffle.rs/
Ruffle is used under the MIT license: https://github.com/ruffle-rs/ruffle/blob/master/LICENSE.md
Adobe Flash Player is a trademark of Adobe, Inc.
/**
 * 
 * 
 * PRIORITIES : 
 * who comes first ? 
 * 6 + 1  
 * Promo >= 49
 * 
 *  
 */

// // Function to check if user has allowed role
function belair_user_has_allowed_role() {
    $allowed_roles = array( 'pro' );
    $user = wp_get_current_user();

    if ( array_intersect( $allowed_roles, $user->roles ) ) {
        return true;
    }

    return false;
}

function belair_calculate_cart_total_excluding_tax() {
    $cart_total = 0;

    // Get cart contents
    foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
        $product = $cart_item['data'];
        $price_excluding_tax = wc_get_price_excluding_tax( $product );

        // Calculate total excluding tax
        $cart_total += $price_excluding_tax * $cart_item['quantity'];
    }

    return $cart_total;
}
 

function belair_check_for_wholesale_prices_in_cart() {
	$cart = WC()->cart->get_cart();
	$found = false;

	foreach ( $cart as $cart_item_key => $cart_item ) {
		
// 		echo "<pre>";
// 		print_r($cart_item['wwp_data']);
// 		echo "</pre>";
		
		if ( isset( $cart_item['wwp_data'] ) && is_array( $cart_item['wwp_data'] ) ) {
			if ( $cart_item['wwp_data']['wholesale_priced'] === 'yes' ) {
				// The cart item contains the specified array
				$found = true;
				break; // Stop the loop since we found a matching item
			}
		}
	}
	
	return $found;
}


// Hook to apply or remove promo code based on total and user role
function belair_apply_or_remove_promo_code_based_on_total_and_user_role() { 
	// Check if user has allowed role
	if ( belair_user_has_allowed_role() ) {
		
		$cart_total = belair_calculate_cart_total_excluding_tax();
		$promo_code = '49ht30'; // use lowercase letters
		$coupon_applied = in_array(  $promo_code, WC()->cart->get_applied_coupons() );
		$tarifs_revendeurs_applied =  belair_check_for_wholesale_prices_in_cart();
		
// 		error_log(print_r([
// 			'cart_total' => $cart_total,
// 			'coupon_applied' => $coupon_applied,
// 			'tarifs_revendeurs_applied' => $tarifs_revendeurs_applied,
// 		]));
		
		// Prevent recursive recalculations
		remove_action('woocommerce_before_calculate_totals', 'belair_apply_or_remove_promo_code_based_on_total_and_user_role', 999);

	 
		// Adjust promo code based on cart total
		if ( $cart_total >= 49 && !$tarifs_revendeurs_applied )  {
			
// 			error_log("We are in coupon territory");
			
			if(!$coupon_applied){
				
			// Apply promo code
			WC()->cart->apply_coupon( $promo_code );
				$message = "Vous avez atteint 49€ HT de commande, votre réduction de 30% a été appliquée.";
				wc_add_notice($message, 'success');
			}
			
		} elseif ( $cart_total < 49 && $coupon_applied ) {
			// Remove promo code
			WC()->cart->remove_coupon( $promo_code );
			
// 			wc_add_notice("Below coupon territory", 'success');
			
			$message = "Votre panier n'atteint pas les 49€ HT pour bénéficier de -30%; veuillez ajouter des produits à votre commande.";
			wc_add_notice($message, 'success');
		} elseif ( $tarifs_revendeurs_applied ){
			
			 
// 			wc_add_notice("Above coupon territory", 'success');
			
			// Remove coupon as now Wholesaleprices apply and we don't want both at once
			WC()->cart->remove_coupon( $promo_code );
		
		}
		
		
	}

    // Reattach hook
    add_action('woocommerce_before_calculate_totals', 'belair_apply_or_remove_promo_code_based_on_total_and_user_role', 999);

}

// Hook into WooCommerce actions
add_action( 'woocommerce_before_calculate_totals', 'belair_apply_or_remove_promo_code_based_on_total_and_user_role', 999 );

// add_action( 'woocommerce_before_calculate_totals', 'belair_apply_or_remove_promo_code_based_on_total_and_user_role', 999 );




add_filter( 'woocommerce_package_rates', 'conditionally_show_shipping_method_based_on_coupon', 10, 2 );
function conditionally_show_shipping_method_based_on_coupon( $rates, $package ) {
    $required_coupon = '49ht30'; // Change this to your coupon code
    $targeted_shipping_method_id = 'service_point_shipping_method:52'; // Adjust this to match the method you want to restrict

    // Check if the required coupon is applied
    if ( ! in_array( strtolower( $required_coupon ), WC()->cart->get_applied_coupons() ) ) {
        foreach ( $rates as $rate_id => $rate ) {
            if ( $rate_id === $targeted_shipping_method_id ) {
                unset( $rates[ $rate_id ] );
            }
        }
    }

    return $rates;
}
Week-6
import pandas as pd from sklearn.preprocessing import LabelEncoder from sklearn.tree import DecisionTreeClassifier, plot_tree import matplotlib.pyplot as plt pandas: Used for handling and manipulating the dataset in DataFrame format. LabelEncoder: A class from sklearn.preprocessing used to convert categorical values (like "Sunny", "Rainy", etc.) into numeric values because machine learning algorithms require numeric input. DecisionTreeClassifier: A class from sklearn.tree that implements the Decision Tree algorithm for classification. plot_tree: A function from sklearn.tree used to visualize the trained decision tree. matplotlib.pyplot: Used for plotting and visualizing the tree.
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from sklearn.tree import DecisionTreeClassifier, plot_tree
import matplotlib.pyplot as plt

# Sample "Play Tennis" dataset
data = {
    'Outlook': ['Sunny', 'Sunny', 'Overcast', 'Rainy', 'Rainy', 'Rainy',
                'Overcast', 'Sunny', 'Sunny', 'Rainy', 'Sunny', 'Overcast',
                'Overcast', 'Rainy'],
    'Temperature': ['Hot', 'Hot', 'Hot', 'Mild', 'Cool', 'Cool',
                    'Cool', 'Mild', 'Cool', 'Mild', 'Mild', 'Mild',
                    'Hot', 'Mild'],
    'Humidity': ['High', 'High', 'High', 'High', 'Normal', 'Normal',
                 'Normal', 'High', 'Normal', 'Normal', 'Normal', 'High',
                 'Normal', 'High'],
    'Wind': ['Weak', 'Strong', 'Weak', 'Weak', 'Weak', 'Strong',
             'Strong', 'Weak', 'Weak', 'Weak', 'Strong', 'Strong',
             'Weak', 'Strong'],
    'Play': ['No', 'No', 'Yes', 'Yes', 'Yes', 'No',
             'Yes', 'No', 'Yes', 'Yes', 'Yes', 'Yes',
             'Yes', 'No']
}

# Load data into DataFrame
df = pd.DataFrame(data)

# Encode categorical variables using  Label Encoder
label_encoders = {}
for column in df.columns:
    le = LabelEncoder()
    df[column] = le.fit_transform(df[column])
    label_encoders[column] = le

# Separate features and target
X = df.drop('Play', axis=1)
y = df['Play']

# Train Decision Tree model
dt = DecisionTreeClassifier(max_depth=3, random_state=1)
dt.fit(X, y)

# Plot the Decision Tree
plt.figure(figsize=(12, 6))
plot_tree(
    dt,
    feature_names=X.columns,
    class_names=label_encoders['Play'].classes_,  # ['No', 'Yes']
    filled=True,
    rounded=True
)
plt.title("Decision Tree - Play Tennis")
plt.tight_layout()
plt.show()
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error, r2_score

# Sample dataset: you can replace this with your own dataset
# For this example, we're assuming a dataset with 3 features
data = {
    'Feature1': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
    'Feature2': [1, 2, 1, 3, 5, 6, 4, 8, 9, 10],
    'Feature3': [5, 7, 6, 8, 6, 7, 8, 9, 10, 11],
    'Target': [5, 7, 6, 9, 11, 13, 14, 17, 19, 21]
}

# Convert to DataFrame
df = pd.DataFrame(data)

# Features (X) and Target variable (y)
X = df[['Feature1', 'Feature2', 'Feature3']]
y = df['Target']

# Split the data into training and testing sets
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

# Create the model
model = LinearRegression()

# Train the model
model.fit(X_train, y_train)

# Make predictions
y_pred = model.predict(X_test)

# Evaluate the model
mse = mean_squared_error(y_test, y_pred)
r2 = r2_score(y_test, y_pred)

print(f"Mean Squared Error: {mse}")
print(f"R-squared: {r2}")

# Output the coefficients and intercept
print(f"Coefficients: {model.coef_}")
print(f"Intercept: {model.intercept_}")

# Visualizing the results (optional, for 3D)
from mpl_toolkits.mplot3d import Axes3D

# Just a 3D plot for 3 features
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

# Scatter plot for actual data
ax.scatter(X_test['Feature1'], X_test['Feature2'], y_test, color='blue', label='Actual data')

# Scatter plot for predicted data
ax.scatter(X_test['Feature1'], X_test['Feature2'], y_pred, color='red', label='Predicted data')

ax.set_xlabel('Feature1')
ax.set_ylabel('Feature2')
ax.set_zlabel('Target')
plt.legend()
plt.show()
week-8:
# Import necessary libraries
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score, classification_report

# Load a sample dataset (Iris)
data = load_iris()
X = data.data        # Features
y = data.target      # Labels

# For binary classification, select only two classes (e.g., class 0 and 1)
X = X[y != 2]
y = y[y != 2]

# Split into training and testing data
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

# Initialize the Logistic Regression model
model = LogisticRegression()

# Train the model
model.fit(X_train, y_train)

# Predict on the test data
y_pred = model.predict(X_test)

# Evaluate the model
print("Accuracy:", accuracy_score(y_test, y_pred))
print("Classification Report:\n", classification_report(y_test, y_pred))	

output:
Accuracy: 1.0
Classification Report:
            precision    recall  f1-score   support   
0       1.00      1.00      1.00        12
           1       1.00      1.00      1.00         8

    accuracy                           1.00        20
   macro avg       1.00      1.00      1.00        20
weighted avg       1.00      1.00      1.00        20
Week -7 
Implementation of KNN USING SKlinear:
The K-Nearest Neighbors (KNN) algorithm is a simple, versatile machine learning method used for both classification and regression tasks. It makes predictions by finding the "k" closest data points (neighbors) to a new data point in a feature space and using their labels or values to make a prediction for the new point. 
# Import necessary libraries
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier
from sklearn.metrics import accuracy_score, classification_report

# Load a sample dataset (Iris)
data = load_iris()
X = data.data        # Features
y = data.target      # Labels

# Split into train and test sets (80% train, 20% test)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

# Initialize the KNN classifier with k=3
knn = KNeighborsClassifier(n_neighbors=3)

# Train the model
knn.fit(X_train, y_train)

# Predict on test data
y_pred = knn.predict(X_test)

# Evaluate the model
print("Accuracy:", accuracy_score(y_test, y_pred))
print("Classification Report:\n", classification_report(y_test, y_pred))

output:

Accuracy: 1.0
Classification Report:
               precision    recall  f1-score   support

           0       1.00      1.00      1.00        10
           1       1.00      1.00      1.00         9
           2       1.00      1.00      1.00        11

    accuracy                           1.00        30
   macro avg       1.00      1.00      1.00        30
weighted avg       1.00      1.00      1.00        30
function validNumber(...anyAmountOfArgs) {
    return anyAmountOfArgs.every((val) => Number.isFinite(val) && val > 0);
}

// Validate distance and duration always
// using 2 params
if (!validNumber(distance, duration)) {
  alert("Please enter positive numbers for distance and duration.");
  return;
}

// Validate cadence if running
// using 1 param
if (type === "running" && !validNumber(cadence)) {
  alert("Please enter a positive number for cadence.");
  return;
}
/* html*/ 
 <div class="form__row">
            <label class="form__label">Cadence</label>
            <input
              class="form__input form__input--cadence"
              placeholder="step/min"
            />
          </div>
          <div class="form__row form__row--hidden">
            <label class="form__label">Elev Gain</label>
            <input
              class="form__input form__input--elevation"
              placeholder="meters"
            />
          </div>




/* Map JS*/
inputType.addEventListener("change", (e) => updateSelect(e));

function updateSelect(e) {
    const { target } = e;

    const value = target.value;

    const cadenceRow = inputCadence.closest(".form__row");
    const elevationRow = inputElevation.closest(".form__row");

    // Remove the hidden class from both rows first
    cadenceRow.classList.remove("form__row--hidden");
    elevationRow.classList.remove("form__row--hidden");

    const selected = {
      cycling: elevationRow,
      running: cadenceRow,
    };

    selected[value].classList.add("form__row--hidden");
  }



/* with a reusable function */


const inputType = document.querySelector('.form__input--type');

inputType.addEventListener("change", function (e) {
  const value = e.target.value;

  // run the toggleFieldVisibility here
  toggleFieldVisibility(value, {
    running: '.form__input--elevation',
    cycling: '.form__input--cadence',
  });
});

function toggleFieldVisibility(selectedType, hiddenFieldMap) {
  // First remove hidden class from all mapped fields
  Object.values(hiddenFieldMap).forEach(selector => {
    const row = document.querySelector(selector)?.closest('.form__row');
    row?.classList.remove('form__row--hidden');
  });

  // Then hide the one mapped to the selected type
  const selectorToHide = hiddenFieldMap[selectedType];
  const rowToHide = document.querySelector(selectorToHide)?.closest('.form__row');
  rowToHide?.classList.add('form__row--hidden');
}
def fibonacci_series(n):
    fib_sequence = [0, 1]  # Starting values for Fibonacci series

    while len(fib_sequence) < n:
        # Add the last two numbers to get the next one
        next_number = fib_sequence[-1] + fib_sequence[-2]
        fib_sequence.append(next_number)

    return fib_sequence[:n]  # Return only first 'n' elements

# Example usage
num_terms = int(input("Enter the number of terms: "))
print("Fibonacci Series:")
print(fibonacci_series(num_terms))
firstelem = List();
eachlist = List();
//
visual = Visual_Inspection[Door_ID_online = input.Door_ID_online].ID.getAll();
sizz = visual.size();
currentpos = (sizz - 1) % 4 + 1;
//
mapp = Map();
mapp = {1:0,2:1,3:2,4:3};
//fetch correct 1st visual inspection in current batch
fet = mapp.get(currentpos.toLong());
//
for each  viz in Visual_Inspection[Door_ID_online == input.Door_ID_online && archived = false] sort by Date_of_inspection desc
{
	eachlist.add(viz.ID);
}
if(eachlist.size() > 0)
{
	firstelem.add(eachlist.get(fet));
}
-- Fastag_TrustedUser_CCDC_Weekly_Monthly_limitCheck
DROP TABLE team_kingkong.onus_Fastag_TrustedUser_CCDC_Weekly_Monthly_limitCheck_breaches;
 
-- CREATE TABLE team_kingkong.onus_Fastag_TrustedUser_CCDC_Weekly_Monthly_limitCheck_breaches AS
INSERT INTO team_kingkong.onus_Fastag_TrustedUser_CCDC_Weekly_Monthly_limitCheck_breaches
with onus_txn_base as
    (SELECT DISTINCT A.*, case when m1.mid is not null then category else 'Others' end as business_category FROM 
        (select userid, transactionid AS txn_id,
        cast(eventAmount as double) / 100 as txn_amount,
        dateinserted as txn_date,
        substr(cast(dateinserted as varchar(30)), 1, 7) as yearMonth,
        paymethod, paytmmerchantid, responsestatus, actionrecommended, velocitytimestamp
        FROM cdp_risk_transform.maquette_flattened_onus_snapshot_v3
        WHERE DATE(dl_last_updated) BETWEEN DATE(DATE'2025-01-01' - INTERVAL '30' DAY) AND DATE'2025-01-31'
        AND SOURCE = 'PG'
        AND responsestatus IN ('SUCCESS') AND actionrecommended <> 'BLOCK'
        AND paytmmerchantid IN ('PTMFVT32998068120662') AND paymethod IN ('DEBIT_CARD', 'CREDIT_CARD')
        AND eventid IN (SELECT eventlinkid
        FROM risk_maquette_data_async.pplus_payment_result_prod_async_snapshot_v3
        WHERE dl_last_updated BETWEEN DATE(DATE'2025-01-01' - INTERVAL '30' DAY) AND DATE'2025-01-31'
        AND payresult = 'payment_success')) a
    left join
        (select * from team_kingkong.voc_mid_categorization where mid != '') m1
    on a.paytmmerchantid = m1.mid)
 
SELECT *, CASE
  WHEN (txn_amount + week_txn_amount) >= week_threshold
    OR (txn_amount + month_txn_amount) >= month_threshold
  THEN CONCAT_WS(
    ', ',
    CASE WHEN (txn_amount + week_txn_amount) >= week_threshold THEN 'weekly_txn_limit_breached' END,
    CASE WHEN (txn_amount + month_txn_amount) >= month_threshold THEN 'monthly_txn_limit_breached' END)
  ELSE NULL END AS breach_reason FROM 
    (SELECT A.*
    -- No.of attempted txns last 7 days > 20 (consider only the CCBP transactions)
    , SUM(IF(DATE(B.txn_date) BETWEEN DATE(DATE(A.txn_date) - INTERVAL '7' DAY) AND DATE(A.txn_date), B.txn_amount, NULL)) AS week_txn_amount
    , 25295 AS week_threshold
    -- No.of attempted txns per calendar month > 30 (consider only the CCBP transactions)
    , SUM(IF(DATE(B.txn_date) BETWEEN date_trunc('month', DATE(A.txn_date)) AND DATE(A.txn_date), B.txn_amount, NULL)) AS month_txn_amount
    , 50590 AS month_threshold
    FROM
        (SELECT * FROM onus_txn_base
        WHERE DATE(txn_date) BETWEEN DATE'2025-01-01' AND DATE'2025-01-31')A
    INNER JOIN
        (SELECT * FROM onus_txn_base)B
    ON A.userid = B.userid AND A.txn_id <> B.txn_id AND B.velocitytimestamp < A.velocitytimestamp
    AND DATE(B.txn_date) BETWEEN DATE(A.txn_date - INTERVAL '30' DAY) AND DATE(A.txn_date)
    GROUP BY 1,2,3,4,5,6,7,8,9,10,11)
WHERE ((txn_amount + week_txn_amount) >= week_threshold) OR ((txn_amount + month_txn_amount) >= month_threshold);
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":x-connect: Xero Boost Days! :x-connect:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Good morning Brisbane! Please see below for what's on this week."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-4: Monday, 2nd June",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Café Partnership: Enjoy free coffee and café-style beverages from our partner, *Edward*. \n\n :lunch: *Lunch*: from *12pm* in the kitchen."
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-5: Wednesday, 4th June",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":coffee: *Café Partnership*: Café Partnership: Enjoy coffee and café-style beverages from our partner, *Edward*. \n\n :late-cake: *Morning Tea*: from *10am* in the kitchen."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*LATER THIS MONTH:*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*13th June* *&* *27th June*\n :blob-party: *Social Happy Hour*: Wind down over some drinks & nibbles with your work pals!"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned to this channel for more details, check out the <https://calendar.google.com/calendar/u/0?cid=Y19uY2M4cDN1NDRsdTdhczE0MDhvYjZhNnRjb0Bncm91cC5jYWxlbmRhci5nb29nbGUuY29t|*Brisbane Social Calendar*>, and get ready to Boost your workdays!\n\nLove,\nWX Team :party-wx:"
			}
		}
	]
}
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":x-connect: Xero Boost Days! :x-connect:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Good morning Sydney! Please see below for what's on this week."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-4: Wednesday, 4th June",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n:coffee: *Café Partnership*: Café Partnership: Enjoy free coffee and café-style beverages from our partner, *Naked Duck* \n\n :breakfast: *Breakfast*: from *9am* in the All Hands Space."
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":calendar-date-5: Thursday, 5th June",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":coffee: *Café Partnership*: Café Partnership: Enjoy coffee and café-style beverages from our partner, *Naked Duck*\n\n :late-cake: *Lunch*: from *12:30pm* in the All Hands Space."
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*LATER THIS MONTH:*"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "*Thursday, 12th June *\n :blob-party: *Social Happy Hour*: Wind down over some drinks & nibbles with your work pals!"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "Stay tuned to this channel for more details, check out the <https://calendar.google.com/calendar/u/0/r?cid=Y185aW90ZWV0cXBiMGZwMnJ0YmtrOXM2cGFiZ0Bncm91cC5jYWxlbmRhci5nb29nbGUuY29t|*Sydney Social Calendar*>, and get ready to Boost your workdays!\n\nLove,\nWX Team :party-wx:"
			}
		}
	]
}
select mid,month(dateinserted) as Month,
sum(txn_amount) failedGMV
from (
select
transactionid,
max(dateinserted) dateinserted ,
max(cast(eventamount as double)/100) txn_amount            ,
max(paytmmerchantid) mid 
from
cdp_risk_transform.maquette_flattened_offus_snapshot_v3
where 
dl_last_updated >= date'2024-10-01'
and DATE (dateinserted)  between date '2024-10-01' and date '2025-01-31'
AND actionrecommended = 'BLOCK'
group by 1)
group by 1,2
 
select pg.mid,
pg.Month,
CASE
  WHEN m_3.o_mid IS NOT NULL THEN 'Online'
  WHEN m_4.e_mid IS NOT NULL THEN 'EDC'
  ELSE 'QR'
 END AS EDC_QR,
  m_7.channel as subBusiness,
 mcc.mcc as mccCode,
 pg.category,
 pg.subCategory,
 sum(pg.attemptedGMV)as attemptedGMV,
 sum(pg.seccessfulGMV) asseccessfulGMV ,
 sum(pg.refundGMV) refundGMV,
sum(rej.rejectedGMV)rejectedGMV ,
sum(pg.failedGMV) failedGMV,
sum(frd.fraudGMV) fraudGMV,
sum(cb.cbGMV) cbGMV
 from
(SELECT mid, month(txn_started_at) as Month,category,sub_category subCategory,
       sum(txn_amount) as attemptedGMV, sum(Case when txn_status = 'SUCCESS'  then txn_amount else 0 end) as seccessfulGMV,
       sum(Case when txn_status <> 'SUCCESS'  then txn_amount else 0 end) as failedGMV,
       sum(case when txn_status = 'SUCCESS' and refund_amount is not null and refund_amount > 0 then txn_amount end) as refundGMV
                FROM
                dwh.pg_olap
                WHERE category NOT IN ('OnPaytm', 'Test')
                AND mid IS NOT NULL
                AND txn_amount > 0
                AND txn_id IS NOT NULL
                AND ingest_date >=  date '2024-10-01'
                AND DATE (substr(cast(txn_started_at AS VARCHAR), 1, 10))  between date '2024-10-01' and date '2025-02-28'
group by 1,2,3,4) as pg

-- Mapping QR/EDC mids
LEFT JOIN (
  SELECT DISTINCT merchant_id AS o_mid
  FROM datalake.online_payment_merchants
 ) AS m_3 
 ON pg.mid = m_3.o_mid
 LEFT JOIN (
  SELECT DISTINCT
   mid AS e_mid
  FROM
   paytmpgdb.entity_edc_info_snapshot_v3
  WHERE
   terminal_status = 'ACTIVE'
   AND dl_last_updated >= DATE '2010-01-01'
 ) m_4 ON pg.mid = m_4.e_mid

 -- Mapping Channel here
  LEFT Join (
  select distinct
   pg_mid,
   channel
  from
   cdo.total_offline_merchant_base_snapshot_v3
 ) AS m_7 ON pg.mid = m_7.pg_mid
 left join
 (SELECT  distinct upi_mcc_code mcc,
          category ,
          sub_category  
          FROM paytmpgdb.mcc_code_mapping_snapshot_v3) mcc 
          on pg.category = mcc.category and pg.subCategory = mcc.sub_category

-- Mapping rejected GMV
left join 
(select mid,month(dateinserted) as Month,
sum(txn_amount) rejectedGMV
from (
select
transactionid,
max(dateinserted) dateinserted ,
max(cast(eventamount as double)/100) txn_amount            ,
max(paytmmerchantid) mid 
from
cdp_risk_transform.maquette_flattened_offus_snapshot_v3
where 
dl_last_updated >= date'2024-10-01'
and DATE (dateinserted)  between date '2024-10-01' and date '2025-02-28'
AND actionrecommended = 'BLOCK'
group by 1)
group by 1,2) as rej ON pg.mid = rej.mid and pg.Month=rej.Month

-- Mapping fraudGMV
left join
(select mid,month(txn_date) as Month,
sum(txn_amount) fraudGMV
from
        (select
          old_pg_txn_id as txn_id,
          min(cast(old_pg_txn_amount as double)) txn_amount,
          min(date(old_pg_txn_started_at)) txn_date,
          min(old_pg_ingest_date) old_pg_ingest_date,
          min(old_pg_mid) mid
        from
          frauds.fraud_combined_snapshot_v3
        where
        dl_last_updated >= date'2024-10-01'
        and DATE (old_pg_txn_started_at)  between date '2024-10-01' and date '2025-02-28'
          and table_name in (
            'ppsl_cybercell',
            'ro_panel_cybmerchant_details_with_pg_olap',
            'lending_fraud',
            'efrm',
            'ppsl_bank_escalations',
            'ro_panel_minifmr_l2_PPI',
            'ro_panel_minifmr_l2_BNK'
          )
          and old_pg_category NOT IN ('OnPaytm', 'Test')
          and old_pg_txn_status = 'SUCCESS'
          AND old_pg_mid IS NOT NULL
          AND cast(old_pg_txn_amount as double) > 0
          AND old_pg_txn_id IS NOT NULL
        group by 1)
        group by 1,2) as frd on pg.mid=frd.mid and pg.Month=frd.Month
-- Mapping chargeBack
left join (select mid,
       month(date(substr(CAST (old_pg_txn_started_at AS varchar), 1, 10))) Month ,
       count(transaction_id) cbCount,
       sum(cbGMV) cbGMV
from (
select 
transaction_id, 
max(old_pg_mid) mid,
sum(chargeback_amount) cbGMV,
max(old_pg_txn_started_at) old_pg_txn_started_at
from
 cdp_risk_transform.transaction_level_chargeback_snapshot_v3
WHERE old_pg_ingest_date >= date'2024-10-01'
  AND date(substr(CAST (old_pg_txn_started_at AS varchar), 1, 10)) 
  between date'2024-10-01' and date '2025-02-28'
group by 1)
group by 1,2) as cb on pg.mid=cb.mid and pg.Month=cb.Month
where pg.mid = 'NEHAEL54380289516455'
group  by 1,2,3,4,5,6,7;
-- MONTHLY BREACHES & CASHBACK & FRAUD %GE
SELECT substr(cast(txn_date as varchar(30)), 1, 7) as year_month
, COUNT(transactionid) AS breach_cnt
, SUM(txn_amount) as breach_amt
, COUNT(DISTINCT small_vpa) as breach_card_cnt
, SUM(CAST(cashback_amount AS DOUBLE)) AS cashback_amount
, SUM(CAST(fraud_amount AS DOUBLE)) AS fraud_amount
FROM
    (SELECT DISTINCT A.txn_date, A.transactionid, A.txn_amount, A.small_vpa
    , B.amount AS cashback_amount
    , C.fraud_amount as fraud_amount
    FROM
        (SELECT * FROM team_kingkong.offus_CCUPI_vpa_mid_daily_limit_breaches)A 
    LEFT JOIN
        (select * from
            (select a.*, ROW_NUMBER() OVER (PARTITION BY txn_id ORDER BY cb_level desc) as row_num from
                (select distinct txn_id, amount, cb_level
                from charge_team_data.cb_data_analytics_snapshot_v3
                where dl_last_updated >= date '2000-01-01')a)a
        where row_num = 1)B
    on B.txn_id = A.transactionid
    LEFT JOIN
        (select * from
            (select distinct pg_txn_id as txn_id, txn_amount as fraud_amount,
            substr(txn_date,1,10) as txn_date, mid,
            min(source_reporting_date) as reporting_date
            from cdp_risk_transform.fraud_master_snapshot_v3
            where source_table <> 'freshdesk.cst_case_snapshot'
            and txn_status = 'SUCCESS'
            and dl_last_updated >= date '2025-01-01'
            group by 1,2,3,4) i
        left join
            (SELECT distinct acq_id, CAST(refund_amount AS DOUBLE) / 100 AS fraud_refund
            FROM pgaws_datalake_prod.acq_refund_snapshot_v3
            WHERE dl_last_updated >= date'2025-01-01' AND refund_status = 'SUCCESS') j
        ON i.txn_id = j.acq_id)C
    ON A.transactionid = C.txn_id)
GROUP BY 1 ORDER BY 1;
-- CCBP_sucTxn_user_1d_7d_30d
DROP TABLE team_kingkong.onus_CCBP_sucTxn_user_1d_7d_30d_breaches;

-- CREATE TABLE team_kingkong.onus_CCBP_sucTxn_user_1d_7d_30d_breaches AS 
INSERT INTO team_kingkong.onus_CCBP_sucTxn_user_1d_7d_30d_breaches
with onus_txn_base as
    (SELECT DISTINCT A.*, case when m1.mid is not null then category else 'Others' end as business_category FROM 
        (select userid, transactionid as txn_id,
        cast(eventAmount as double) / 100 as txn_amount,
        dateinserted as txn_date,
        substr(cast(dateinserted as varchar(30)), 1, 7) as yearMonth,
        paymethod, paytmmerchantid, velocitytimestamp
        FROM cdp_risk_transform.maquette_flattened_onus_snapshot_v3
        WHERE DATE(dl_last_updated) BETWEEN DATE(DATE'2025-01-01' - INTERVAL '30' DAY) AND DATE'2025-01-31'
        AND SOURCE = 'PG'
        AND paytmmerchantid IN ('PTMCBP84799392178473','PTMVIS48435535949128','PTMCBP11428987150800')
        AND eventid IN (SELECT eventlinkid
        FROM risk_maquette_data_async.pplus_payment_result_prod_async_snapshot_v3
        WHERE dl_last_updated BETWEEN DATE(DATE'2025-01-01' - INTERVAL '30' DAY) AND DATE'2025-01-31'
        AND payresult = 'payment_success')
        AND responsestatus IN ('SUCCESS') AND actionrecommended = 'PASS') a
    left join
        (select * from team_kingkong.voc_mid_categorization where mid != '') m1
    on a.paytmmerchantid = m1.mid)
 
SELECT *, CASE
  WHEN 
    txn_attempted_same_day >= txn_attempted_same_day_threshold OR 
    txn_attempted_7_day >= txn_attempted_7_day_threshold OR 
    txn_attempted_cal_month >= txn_attempted_cal_month_threshold
  THEN CONCAT_WS(
    ', ',
    CASE WHEN txn_attempted_same_day >= txn_attempted_same_day_threshold THEN 'same_day_attempted_txn_limit_breached' END,
    CASE WHEN txn_attempted_7_day >= txn_attempted_7_day_threshold THEN '7_day_attempted_txn_limit_breached' END,
    CASE WHEN txn_attempted_cal_month >= txn_attempted_cal_month_threshold THEN 'calendar_month_attempted_txn_limit_breached' END)
  ELSE NULL END AS breach_reason FROM 
    (SELECT A.*
    -- No.of successful txns per user per calendar day > 8 (consider only the CCBP transactions)
    , COUNT(IF(DATE(B.txn_date) = DATE(A.txn_date), B.txn_id, NULL)) AS txn_attempted_same_day
    , 8 AS txn_attempted_same_day_threshold
    -- No.of successful txns last 7 days > 15 (consider only the CCBP transactions)
    , COUNT(IF(DATE(B.txn_date) BETWEEN DATE(DATE(A.txn_date) - INTERVAL '7' DAY) AND DATE(A.txn_date), B.txn_id, NULL)) AS txn_attempted_7_day
    , 15 AS txn_attempted_7_day_threshold
    -- No.of successful txns per calendar month > 25 (consider only the CCBP transactions)
    , COUNT(IF(DATE(B.txn_date) BETWEEN date_trunc('month', DATE(A.txn_date)) AND DATE(A.txn_date), B.txn_id, NULL)) AS txn_attempted_cal_month
    , 25 AS txn_attempted_cal_month_threshold
    FROM
        (SELECT * FROM onus_txn_base
        WHERE DATE(txn_date) BETWEEN DATE'2025-01-01' AND DATE'2025-01-31')A
    INNER JOIN
        (SELECT * FROM onus_txn_base)B
    ON A.userid = B.userid AND A.txn_id <> B.txn_id AND B.velocitytimestamp < A.velocitytimestamp
    AND DATE(B.txn_date) BETWEEN DATE(A.txn_date - INTERVAL '30' DAY) AND DATE(A.txn_date)
    GROUP BY 1,2,3,4,5,6,7,8,9)
WHERE (txn_attempted_same_day >= txn_attempted_same_day_threshold) 
OR (txn_attempted_7_day >= txn_attempted_7_day_threshold) 
OR (txn_attempted_cal_month >= txn_attempted_cal_month_threshold)
;
-- CCBP_attempt_Txn_user_1d_7d_30d
DROP TABLE team_kingkong.onus_CCBP_attempt_Txn_user_1d_7d_30d_breaches;

-- CREATE TABLE team_kingkong.onus_CCBP_attempt_Txn_user_1d_7d_30d_breaches AS
INSERT INTO team_kingkong.onus_CCBP_attempt_Txn_user_1d_7d_30d_breaches
with onus_txn_base as
    (SELECT DISTINCT A.*, case when m1.mid is not null then category else 'Others' end as business_category, B.payresult FROM 
        (select distinct userid, transactionid as txn_id,
        cast(eventAmount as double) / 100 as txn_amount,
        dateinserted as txn_date,
        substr(cast(dateinserted as varchar(30)), 1, 7) as yearMonth,
        paymethod, paytmmerchantid, responsestatus, actionrecommended, velocitytimestamp,eventid
        FROM cdp_risk_transform.maquette_flattened_onus_snapshot_v3
        WHERE DATE(dl_last_updated) BETWEEN DATE(DATE'2025-01-01' - INTERVAL '30' DAY) AND DATE'2025-01-31'  -- 4, 5, 6, 7 done
        AND SOURCE = 'PG'
        AND paytmmerchantid IN ('PTMCBP84799392178473','PTMVIS48435535949128','PTMCBP11428987150800')) a
    INNER JOIN
        (SELECT eventlinkid, payresult 
        FROM risk_maquette_data_async.pplus_payment_result_prod_async_snapshot_v3
        WHERE dl_last_updated BETWEEN DATE(DATE'2025-01-01' - INTERVAL '30' DAY) AND DATE'2025-01-31')B
    ON a.eventid = B.eventlinkid
    left join
        (select * from team_kingkong.voc_mid_categorization where mid != '') m1
    on a.paytmmerchantid = m1.mid)

SELECT *,CASE
  WHEN txn_attempted_same_day >= txn_attempted_same_day_threshold
    AND txn_attempted_7_day >= txn_attempted_7_day_threshold
    AND txn_attempted_cal_month >= txn_attempted_cal_month_threshold THEN 'same_day, 7_day & cal_month breach'
  WHEN txn_attempted_same_day >= txn_attempted_same_day_threshold
    AND txn_attempted_7_day >= txn_attempted_7_day_threshold THEN 'same_day & 7_day breach'
  WHEN txn_attempted_same_day >= txn_attempted_same_day_threshold
    AND txn_attempted_cal_month >= txn_attempted_cal_month_threshold THEN 'same_day & cal_month breach'
  WHEN txn_attempted_7_day >= txn_attempted_7_day_threshold
    AND txn_attempted_cal_month >= txn_attempted_cal_month_threshold THEN '7_day & cal_month breach'
  WHEN txn_attempted_same_day >= txn_attempted_same_day_threshold THEN 'same_day breach'
  WHEN txn_attempted_7_day >= txn_attempted_7_day_threshold THEN '7_day breach'
  WHEN txn_attempted_cal_month >= txn_attempted_cal_month_threshold THEN 'cal_month breach'
  ELSE NULL END AS breach_reason FROM 
    (SELECT A.*
    -- No.of attempted txns per user per calendar day  > 12 (consider only the CCBP transactions)
    , COUNT(IF(DATE(B.txn_date) = DATE(A.txn_date), B.txn_id, NULL)) AS txn_attempted_same_day
    , 12 AS txn_attempted_same_day_threshold
    -- No.of attempted txns last 7 days > 20 (consider only the CCBP transactions)
    , COUNT(IF(DATE(B.txn_date) BETWEEN DATE(DATE(A.txn_date) - INTERVAL '7' DAY) AND DATE(A.txn_date), B.txn_id, NULL)) AS txn_attempted_7_day
    , 20 AS txn_attempted_7_day_threshold
    -- No.of attempted txns per calendar month > 30 (consider only the CCBP transactions)
    , COUNT(IF(DATE(B.txn_date) BETWEEN date_trunc('month', DATE(A.txn_date)) AND DATE(A.txn_date), B.txn_id, NULL)) AS txn_attempted_cal_month
    , 30 AS txn_attempted_cal_month_threshold
    FROM
        (SELECT * FROM onus_txn_base
        WHERE DATE(txn_date) BETWEEN DATE'2025-01-01' AND DATE'2025-01-31'
        AND responsestatus = 'SUCCESS' AND actionrecommended = 'PASS'
        AND payresult = 'payment_success')A
    INNER JOIN
        (SELECT * FROM onus_txn_base)B
    ON A.userid = B.userid AND A.txn_id <> B.txn_id AND B.velocitytimestamp < A.velocitytimestamp
    AND DATE(B.txn_date) BETWEEN DATE(A.txn_date - INTERVAL '30' DAY) AND DATE(A.txn_date)
    GROUP BY 1,2,3,4,5,6,7,8,9,10,11,12,13)
WHERE (txn_attempted_same_day >= txn_attempted_same_day_threshold) 
OR (txn_attempted_7_day >= txn_attempted_7_day_threshold) 
OR (txn_attempted_cal_month >= txn_attempted_cal_month_threshold);




-- onus_UtilityEventTxnLImit_breaches
-- UtilityEventTxnLImit
-- ONUS : UtilityEventTxnLImit
DROP TABLE team_kingkong.onus_UtilityEventTxnLImit_breaches;

-- CREATE TABLE team_kingkong.onus_UtilityEventTxnLImit_breaches AS 
INSERT INTO team_kingkong.onus_UtilityEventTxnLImit_breaches 
SELECT A.*, case when m1.mid is not null then category else 'Others' end as business_category
, 1000001 as per_txn_threshold
, 'per txn threshold breached' as breach_reason
FROM 
    (select distinct userid, transactionid,
    cast(eventAmount as double) / 100 as amt,
    dateinserted,
    substr(cast(dateinserted as varchar(30)), 1, 7) as mnth,
    paymethod, paytmmerchantid, responsestatus, actionrecommended
    FROM cdp_risk_transform.maquette_flattened_onus_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE'2025-01-01' AND DATE'2025-01-31'
    AND SOURCE = 'PG' AND paymethod IN ('DEBIT_CARD', 'CREDIT_CARD')
AND responsestatus = 'SUCCESS' AND actionrecommended <> 'BLOCK'
    AND (cast(eventAmount as double) / 100) > 1000001
    AND eventid IN (SELECT eventlinkid
    FROM risk_maquette_data_async.pplus_payment_result_prod_async_snapshot_v3
    WHERE dl_last_updated BETWEEN DATE'2025-01-01' AND DATE'2025-01-31'
    AND payresult = 'payment_success')) a
left join
    (select * from team_kingkong.voc_mid_categorization where mid != '') m1
on a.paytmmerchantid = m1.mid;

ALTER TABLE team_kingkong.onus_UtilityEventTxnLImit_breaches
ADD COLUMN breach_reason VARCHAR(30);


SELECT mid_type, yearmonth, SUM(rejected_gmv)/ AVG(attempted_gmv) FROM team_kingkong.offus_rej_rate_monthly
GROUP BY 1,2;

DESC team_kingkong.tpap_rej_rate_monthly;

SELECT year_month, category, SUM(rej_gmv) AS rejected_gmv, AVG(attempted_gmv) AS avg_attempted_gmv
, sum(attempted_gmv)
, SUM(rej_gmv)/ AVG(attempted_gmv) AS rej_rate
FROM
    (SELECT year_month, risk_code, rej_gmv, attempted_gmv
    FROM team_kingkong.tpap_rej_rate_monthly)A
INNER JOIN
    (SELECT risk_code, category
    FROM team_kingkong.tpapRulesforDB)B
ON A.risk_code = B.risk_code
GROUP BY 1,2;
DROP TABLE team_kingkong.onus_on_us_sbi_nb_limit_breaches;
 
-- CREATE TABLE team_kingkong.onus_on_us_sbi_nb_limit_breaches AS 
INSERT INTO team_kingkong.onus_on_us_sbi_nb_limit_breaches 
SELECT A.*, case when m1.mid is not null then category else 'Others' end as business_category
, 100000 as per_txn_threshold
, 'per txn threshold breached' as breach_reason
FROM 
    (select distinct userid, transactionid,
    cast(eventAmount as double) / 100 as amt,
    dateinserted,
    substr(cast(dateinserted as varchar(30)), 1, 7) as mnth,
    paymethod, paytmmerchantid, responsestatus, actionrecommended
    FROM cdp_risk_transform.maquette_flattened_onus_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE(DATE'2025-06-01' - INTERVAL '30' DAY) AND DATE'2025-07-05'
    AND SOURCE = 'PG' AND actionrecommended <> 'BLOCK' AND responsestatus = 'SUCCESS'
    AND paymethod = 'NET_BANKING' AND apicodeoption = 'SBINC1IN_NET_BANKING_PAYMENT'
    AND paytmmerchantid IN ('PTMVIS48435535949128','PTMCBP11428987150800','PTMCBP84799392178473')
    AND (cast(eventAmount as double) / 100) > 100000
    AND eventid IN (SELECT eventlinkid
    FROM risk_maquette_data_async.pplus_payment_result_prod_async_snapshot_v3
    WHERE dl_last_updated BETWEEN DATE(DATE'2025-06-01' - INTERVAL '30' DAY) AND DATE'2025-07-05'
    AND payresult = 'payment_success')) a
left join
    (select * from team_kingkong.voc_mid_categorization where mid != '') m1
on a.paytmmerchantid = m1.mid;
import pandas as pd
import pyarrow as pa
import pyarrow.orc as orc
from glob import glob

dataset = pd.read_csv()

# Read the Pandas dataset as a PyArrow Table
pa_table = pa.Table.from_pandas(dataset)

# Write the PyArrow Table to an ORC file
with pa.OSFile("/home/saravana/Saravana/s3_maintain/s3-maintenance/Download_S3_Files/Datavisiooh/month_03.orc", "wb") as sink:
    with orc.ORCWriter(sink) as writer:
        writer.write(pa_table)

# Read the ORC file back into a Pandas DataFrame
orc_file_path = "/home/saravana/Saravana/s3_maintain/s3-maintenance/Download_S3_Files/Datavisiooh/month_03.orc"
df = orc.read_table(orc_file_path).to_pandas()
# Display the DataFrame
print(df.head())
/*========================================================
  Rise 360 compulsory CSS
  For use in all Digital Learning and Development Rise 360 courses.
  Version 1.0
  Last updated 04/11/2024
==========================================================*/

/*Global variables – edit these variables to suit your course design.
==========================================================*/

:root {
  --custom-theme-colour-button-hover-opacity: .9; /*This sets the opacity of buttons and checkboxes that use the theme colour, such as continue buttons.Lower value equals ligher hover colour.*/
  --custom-carousel-prev-next-hover-colour: #000; /*This sets the hover state colour of the previous and next buttons on the quote carousel and image carousel blocks.*/
}

/*Global CSS edits
==========================================================*/

/*Links > Hover state: Add a background colour and border.*/
.brand--linkColor a:hover {
  outline: solid 3px rgba(0, 0, 0, .1); /*Using transparancy prevents surrounding text, such as full stops, from vanishing.*/
  background-color: rgba(0, 0, 0, .1) !important;
}

/*Cover page
==========================================================*/

/*Cover page > Start module button: Remove all caps, increase font size, decrease font weight, adjust padding.*/
.cover__header-content-action-link-text{
  text-transform: none;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .1rem;
}
.cover__header-content-action-link {
  padding: 0.8rem 2.9rem !important;
}

/*Cover page > body text: Increase font size and change colour.*/ 
.cover__details-content-description.brand--linkColor {
  color: #000;
  font-size: 1.7rem;
}

/*Cover page > Section titles: Increase font size, remove all caps, darken border line.*/
.overview-list__section-title {
  border-bottom: .1rem solid #717376; /*Colour of the lesson icons.*/
  font-size: 1.4rem;
  text-transform: none;
}

/*Cover page > lesson list: Increase font size.*/
.overview-list-item__title {
  font-size: 1.4rem;
}

/*Navigation menu
==========================================================*/

/*Navigation menu > % progress indicator: Remove all caps, increase font size.*/
.nav-sidebar-header__progress-text {
  text-transform: none !important;
  font-size: 1.4rem !important;
}

/*Navigation menu > Section titles: Remove all caps, increase font size.*/
.nav-sidebar__outline-section-toggle-text {
  text-transform: none;
  font-size: 1.4rem;
}
.nav-sidebar__outline-section-toggle:after {
  border-bottom: 1px solid #717376 !important;
}

/*Navigation menu > Lesson titles: Increase font size.*/
.nav-sidebar__outline-section-item__link {
  font-size: 1.4rem !important;
}

/*Lesson header
==========================================================*/

/*Lesson header > Lesson counter: Increase font size, remove italics.*/
.lesson-header__counter {
  font-size: 1.4rem;
  font-style: normal;
  margin-bottom: 1.3rem !important;
}

/*Text blocks
==========================================================*/

/*Paragraph
----------------------------------------------------------*/

/*Paragraph with heading
----------------------------------------------------------*/

/*Paragraph with subheading
----------------------------------------------------------*/

/*Heading
----------------------------------------------------------*/

/*Subheading
----------------------------------------------------------*/

/*Columns
----------------------------------------------------------*/

/*Table
----------------------------------------------------------*/


/*Statement blocks
==========================================================*/

/*Statement A
----------------------------------------------------------*/

/*Statement B
----------------------------------------------------------*/

/*Statement C
----------------------------------------------------------*/

/*Statement D
----------------------------------------------------------*/

/*Note
----------------------------------------------------------*/


/*Quote blocks
==========================================================*/

/*Quote A
----------------------------------------------------------*/

/*Quote B
----------------------------------------------------------*/

/*Quote C
----------------------------------------------------------*/

/*Quote D
----------------------------------------------------------*/

/*Quote on image
----------------------------------------------------------*/

/*Quote carousel
----------------------------------------------------------*/

/*Quote carousel 
-------------------------------------------------------------*/



/*List blocks
==========================================================*/

/*Numbered list
----------------------------------------------------------*/

/*Checkbox list
----------------------------------------------------------*/

/*Checkbox list > Checkboxes: Move the checkboxes to the front and change the hover colour.*/
.block-list__checkbox {
  z-index: 2;
  transition: all .15s ease-in-out;
}
.block-list__checkbox:hover {
  background-color: var(--color-theme-decorative);
  opacity: var(--custom-theme-colour-button-hover-opacity);
}

/*Bulleted list
----------------------------------------------------------*/


/*Image blocks
==========================================================*/

/*Image blocks > Caption: Increase font size. This can be changed by manually adjusting the font size in Rise.*/
.block-image__caption, .block-gallery__caption {
  font-size: 1.4rem !important;
}

/*Image centered
----------------------------------------------------------*/

/*Image full width
----------------------------------------------------------*/

/*Image & text
----------------------------------------------------------*/

/*Text on image
----------------------------------------------------------*/


/*Gallery blocks
==========================================================*/

/*Carousel
----------------------------------------------------------*/

/* Gallery Carousel 
--------------------------------------------------*/

/*Note that the hover state of the progression circles is modified in the Quote carousel section.*/

/*Two column grid
----------------------------------------------------------*/

/*Three column grid
----------------------------------------------------------*/

/*Four column grid
----------------------------------------------------------*/


/*Multimedia blocks
==========================================================*/

/*Audio
----------------------------------------------------------*/

/*Audio > Play/puase button and scrub slider: Increase size and gap between. Change hover scale.*/
.audio-player__play {
  margin-right: 1.6rem;
}
.audio-player__play .svg-inline--fa {
  height: 1.7rem;
  transition: all 0.15s ease-in-out;
}
.audio-player__play .svg-inline--fa:hover {
  transform: scale(1.2);
}
.audio-player__tracker-handle{
  height: 100%;
}
.audio-player__tracker-handle-icon>svg {
  height: 1.5rem;
  width: 1.5rem;
}
.audio-player__tracker-handle-icon{
  transition: all 0.15s ease-in-out;
}
.audio-player__tracker-handle-icon:hover {
  transform: scale(1.2);
}
.audio-player__tracker-handle-icon:active {
  transform: scale(1.2);
}

/*Audio > track line: Make line thicker.*/
.audio-player__tracker-bar {
  border-top: .16rem solid var(--color-track);
}
.audio-player__tracker:after {
  border-top: .16rem solid var(--color-runner);
}

/*Audio > Timer: Increase font size.*/
.audio-player__timer {
  font-size: 1.2rem;
}

/*Audio > Caption: Increase font size. This can be changed by manually adjusting the font size in Rise.*/
.block-audio__caption {
  font-size: 1.4rem;
}

/*Video
----------------------------------------------------------*/

/*Video > Caption: Change font size to 14px.*/
.block-video__caption {
  font-size: 1.4rem;
}

/*Embed
----------------------------------------------------------*/

/*Attachement
----------------------------------------------------------*/

/*Attachement: Add hover colour.*/
.block-attachment:hover {
  background: #ebebeb;
}

/*Code snippet
----------------------------------------------------------*/

/*Code snippet > Caption: Increase font size.*/
.block-text__code-caption p {
  font-size: 1.4rem;
}

/*Interactive blocks
==========================================================*/

/*Accordion
----------------------------------------------------------*/

/*Tabs
----------------------------------------------------------*/

/*Tabs 
---------------------------------------------------*/


/*Labeled graphic
----------------------------------------------------------*/

/*Labeled graphic
------------------------------------------*/


/*Process
----------------------------------------------------------*/



/*Scenario
----------------------------------------------------------*/


/*Sorting activity
----------------------------------------------------------*/

/*Sorting activity > Restart button: Remove all caps, change font size, colour and letter spacing.*/
.block-sorting-activity .restart-button__content {
  color: var(--color-theme-decorative);
  border-radius: 5px;
  text-transform: none;
  font-size: 1.5rem;
  letter-spacing: .1rem;
  font-weight: 700;
}

/*Sorting activity > Restart button: Add a hover state.*/
.block-sorting-activity .deck__title {
  margin-bottom: 1rem;  
  padding-bottom: .6rem;
  border-bottom: .1rem solid rgba(0, 0, 0, .2);
}
.block-sorting-activity .restart-button {
  margin-top: 0rem;
  border: none;
  padding: 1rem;
  border-radius: 5px;
  min-height: 7.45rem;
}
.block-sorting-activity .restart-button {
  transition: background-color 0.3s;
}
.block-sorting-activity .restart-button:hover {
  background-color: #ebebeb;
}


/*Timeline
----------------------------------------------------------*/

/*Flashcard grid
----------------------------------------------------------*/

/*Flashbard stack
----------------------------------------------------------*/

/*Flashcard stack > Previous and Next button: Change hover state.*/
.block-flashcards-slider__arrow--next, .block-flashcards-slider__arrow--prev {
  transition: opacity .3s;
}
.block-flashcards-slider__arrow--next:hover, .block-flashcards-slider__arrow--prev:hover {
  opacity: var(--custom-theme-colour-button-hover-opacity);
}

/*Flashcard stack > Slide counter: Remove italics.*/
.block-flashcards-slider__progress-text {
  font-style: normal;
}

/*Flashcard stack > Progress line: Increase thickness.*/
.block-flashcards-slider__progress-line {
  border-bottom: max(.2rem, 2px) solid var(--color-progress-track);
  position: relative;
}
.block-flashcards-slider__progress-runner {
  border-bottom: max(.2rem, 2px) solid var(--color-theme-decorative);
}

/*Button
----------------------------------------------------------*/

/*Button and Button stack > Button: Remove all caps, increase font size and line height.*/
.blocks-button__button {
  transition: all .3s;
  text-transform: none;
  font-size: 1.5rem;
  line-height: 3.9rem;
}

/*Button and Button stack > Button: Change hover state.*/
.blocks-button__button:hover {
  opacity: var(--custom-theme-colour-button-hover-opacity);
}

/*Button and Button stack > Button: Offset the focus state outline.*/
.blocks-button__button:focus {
  outline-offset: .4rem;
}

/*Button stack
----------------------------------------------------------*/

/*Storyline
----------------------------------------------------------*/


/*Knowledge check blocks AND Quiz lesson
==========================================================*/

/*Knowledge check/Quiz > Options: remove extra space between question options and submit button/feedback box.*/
.block-knowledge .quiz-card__interactive {
  margin-bottom: 0rem;
}

/*Knowledge check/Quiz > Submit/Next buttons: Remove all caps and increase font size.*/
.quiz-card__button{
  transition: opacity .3s;
  text-transform: none;
  font-size: 1.5rem;
}
  
/*Knowledge check/Quiz > Submit/Next buttons: Change hover state.*/
.quiz-card__button:hover {
  opacity: var(--custom-theme-colour-button-hover-opacity);
}
  
/*Knowledge check/Quiz > Submit/Next buttons: Offset the focus state outline.*/
.quiz-card__button:focus {
  outline-offset: 0.4rem;
}

/*Knowledge check/Quiz > 'Correct/Incorrect' label: Increase font size.*/
.quiz-card__feedback-label {
  font-size: 1.4rem;
}

/*Knowledge check/Quiz > Feedback body text: Increase font size, align left and ensure color is black. */
.quiz-card__feedback-text {
  font-size: 1.6rem;
  text-align: left;
  color: #000;
}

/*Knowledge check > Try again button: Remove all caps, increase font size and change to theme colour. Note that the Rise 360 label text must also be lowercase.*/
.block-knowledge__retake-text {
  text-transform: none;
  font-size: 1.4rem;
}
.block-knowledge__retake {
  color: var(--color-theme-decorative)
}

/*Knowledge check > Try again button: Change hover state.*/
.block-knowledge__retake-content {
  transition: background-color 0.3s;
  border-radius: 5px;
  padding: 1rem;
  margin: -1rem /*Negative margin pushes the margin out into the padding area to create a larger hover state without having to change the padding for the normal state.*/
}
.block-knowledge__retake-content:hover {
  background-color: #ebebeb;
}

/*Multiple choice
----------------------------------------------------------*/

/*Multiple response
----------------------------------------------------------*/

/*Fill in the blank
----------------------------------------------------------*/

/*Fill in the blank > 'Acceptable responses' label: Increase font size and remove italics.*/
.quiz-fill__options {
  font-size: 1.4rem;
  font-style:normal;
}

/*Matching
----------------------------------------------------------*/

/*Matching: Increase font size to 16px.*/
.quiz-match__item-content {
  font-size: 1.5rem;
}

/*Quiz
----------------------------------------------------------*/

/*Quiz > 'Lesson X of Y' label: Increase font size, letter spacing and remove italics.*/
.quiz-header__counter {
  font-size: 1.4rem;
  font-style: normal;
  letter-spacing: .05rem;
}

/*Quiz > 'Start assessment' label: Remove all caps, increase font size, move icon to the left.*/
.quiz-header__start-quiz {
  transition: all .3s;
  text-transform: none;
  font-size: 1.5rem;
  border-radius: 5px;
  padding: 1rem;
  margin: -1rem;
}
.quiz-header__start-quiz [class*=icon-] {
  margin-left: .6rem;
}

/*Quiz > 'Start assessment' label: Add hover state.*/
.quiz-header__start-quiz:hover {
  background-color: #ebebeb;
}

/*Quiz > 'Question' label: Remove italics and increase font size.*/
.quiz-card__step-label {
  font-size: 1.4rem;
  font-style: normal;
  letter-spacing: .05rem;
  font-weight: 400;
}
@media (max-width: 47.9375em) {
  .quiz-card__counter {
    font-size: 2.2rem;
  }
}

/*Quiz > Quiz results odemeter: Increase font size on all elements.*/
.odometer__score-label, .odometer__passlabel, .odometer__passpercent  {
  font-size: 1.4rem;
  text-transform: none;
}

/*Quiz > Quiz results 'Try again' button: Remove all caps, change font colour, size, weight and letter spacing, adjust padding.*/
.quiz-results__footer .restart-button__content {
  transition: background-color 0.3s;
  color: var(--color-theme);
  text-transform: none;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .1rem;
  padding: 1rem;
  margin: -1rem;
  border-radius: 5px;
}

/*Quiz > Quiz results 'Try again' button: Add hover state.*/
.quiz-results__footer .restart-button__content:hover {
  background-color: #ebebeb;
}


/*Draw from question bank
----------------------------------------------------------*/


/*Chart blocks
==========================================================*/

/*Bar chart
----------------------------------------------------------*/

/*Line chart
----------------------------------------------------------*/

/*Pie chart
----------------------------------------------------------*/


/*Divider blocks
==========================================================*/

/*Continue
----------------------------------------------------------*/
  
/*Continue: Change hover state.*/
.continue-btn {
  transition: opacity 0.3s;
}
.continue-btn:hover {
  opacity: var(--custom-theme-colour-button-hover-opacity);
}

/*Continue: Offset the focus state outline.*/
.continue-btn:focus {
  outline-offset: 0.4rem;
}

/*Divider
----------------------------------------------------------*/

/*Numbered divider
----------------------------------------------------------*/

/*Spacer
----------------------------------------------------------*/


/*CSS edits by Firstname Lastname on XX/XX/202X.*/

/*========================================================
  Optional CSS edits – Paste all optional CSS edits below this comment.
==========================================================*/
## Quick Defaults

```css
font-family: "Helvetica Now Display", "SF Pro Display", "Inter Display", "Inter Tight", Helvetica, Roboto, Arial, -apple-system, sans-serif;
font-family: "SF Pro Display", "Helvetica Now Display", "Inter Display", "Inter Tight", Helvetica, Arial, Roboto, -apple-system, sans-serif;
font-family: "Inter Display", "Inter Tight", "SF Pro Display", "Helvetica Now Display", Helvetica, Roboto, Arial, -apple-system, sans-serif;
font-family: "Inter Tight", "Inter Display", "SF Pro Display", "Helvetica Now Display", Helvetica, Roboto, Arial, -apple-system, sans-serif;
font-family: "Helvetica LT Pro", "Helvetica", "Helvetica Now Text", "SF Pro Text", Roboto, Inter, Arial, -apple-system, sans-serif;
font-family: "Helvetica Now Text", "Helvetica LT Pro", Helvetica, "Helvetica Neue LT Pro", "SF Pro Text", Roboto, Arial, -apple-system, sans-serif;
font-family: "SF Pro Text", "Helvetica Now Text", Roboto, "Helvetica LT Pro", Helvetica, "Helvetica Neue LT Pro", Arial, Roboto, -apple-system, sans-serif;
font-family: Inter, "SF Pro Text", Roboto, "Helvetica Now Text", "Helvetica LT Pro", Helvetica, Arial, -apple-system, sans-serif;
font-family: Roboto, "SF Pro Text", "Helvetica Now Text", "Helvetica LT Pro", Inter, Helvetica, Arial, -apple-system, sans-serif;
font-family: "Helvetica Now Display", "SF Pro Display", "Inter Display", "Inter Tight", Helvetica, Roboto, Arial, -apple-system, sans-serif;
font-family: "Inter Display", "Inter Tight", "SF Pro Display", "Helvetica Now Display", Helvetica, Roboto, Arial, -apple-system, sans-serif;
font-family: "Inter Tight", "Inter Display", "SF Pro Display", "Helvetica Now Display", Helvetica, Roboto, Arial, -apple-system, sans-serif;
```

## Variable Definitions

```css
:root {
--font-disp-helvnow: "Helvetica Now Display", "SF Pro Display", "Inter Display", "Inter Tight", Helvetica, Roboto, Arial, -apple-system, sans-serif;
--font-disp-sfpro: "SF Pro Display", "Helvetica Now Display", "Inter Display", "Inter Tight", Helvetica, Arial, Roboto, -apple-system, sans-serif;
--font-disp-inter: "Inter Display", "Inter Tight", "SF Pro Display", "Helvetica Now Display", Helvetica, Roboto, Arial, -apple-system, sans-serif;
--font-disp-intert: "Inter Tight", "Inter Display", "SF Pro Display", "Helvetica Now Display", Helvetica, Roboto, Arial, -apple-system, sans-serif;
--font-text-helv: "Helvetica LT Pro", "Helvetica", "Helvetica Now Text", "SF Pro Text", Roboto, Inter, Arial, -apple-system, sans-serif;
--font-text-helvnow: "Helvetica Now Text", "Helvetica LT Pro", Helvetica, "Helvetica Neue LT Pro", "SF Pro Text", Roboto, Arial, -apple-system, sans-serif;
--font-text-sfpro: "SF Pro Text", "Helvetica Now Text", Roboto, "Helvetica LT Pro", Helvetica, "Helvetica Neue LT Pro", Arial, Roboto, -apple-system, sans-serif;
--font-text-inter: Inter, "SF Pro Text", Roboto, "Helvetica Now Text", "Helvetica LT Pro", Helvetica, Arial, -apple-system, sans-serif;
--font-text-roboto: Roboto, "SF Pro Text", "Helvetica Now Text", "Helvetica LT Pro", Inter, Helvetica, Arial, -apple-system, sans-serif;
--font-mono-roboto: "Roboto Mono", "Input Mono", "SF Mono", "Cascadia Mono", "Segoe UI Mono", "Cousine", ui-monospace, monospace;
--font-mono-input: "Input Mono", "Roboto Mono", "SF Mono", "Cascadia Mono", "Segoe UI Mono", "Cousine", ui-monospace, monospace;
--font-mono-sfmono: "SF Mono", "Input Mono", "Roboto Mono", "SF Mono", "Cascadia Mono", "Segoe UI Mono", "Cousine", ui-monospace, monospace;
}
```
star

Wed Jun 04 2025 10:52:18 GMT+0000 (Coordinated Universal Time)

@chitss2610

star

Wed Jun 04 2025 10:51:22 GMT+0000 (Coordinated Universal Time)

@chitss2610

star

Wed Jun 04 2025 10:16:59 GMT+0000 (Coordinated Universal Time)

@MinaTimo

star

Wed Jun 04 2025 09:25:04 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Wed Jun 04 2025 04:33:00 GMT+0000 (Coordinated Universal Time)

@cvanwert #python

star

Tue Jun 03 2025 19:18:21 GMT+0000 (Coordinated Universal Time)

@freepythoncode ##python #coding #python

star

Tue Jun 03 2025 09:27:21 GMT+0000 (Coordinated Universal Time) https://cryptocurrency-exchange-development-company.com/

@raydensmith

star

Tue Jun 03 2025 09:21:16 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Tue Jun 03 2025 09:15:34 GMT+0000 (Coordinated Universal Time) https://www.coinsclone.com/how-to-create-a-crypto-wallet/

@CharleenStewar #builda crypto wallet app

star

Mon Jun 02 2025 12:26:56 GMT+0000 (Coordinated Universal Time) https://www.beleaftechnologies.com/bc-game-clone-script

@raydensmith #bc #game #clone #script

star

Mon Jun 02 2025 09:34:37 GMT+0000 (Coordinated Universal Time) https://beleaftechnologies.com/cryptocurrency-mlm-software-development

@stvejhon #crypto #cryptocurrency #exchange #meme

star

Mon Jun 02 2025 08:28:15 GMT+0000 (Coordinated Universal Time)

@abm #zapier #taconova #phython #scraping

star

Mon Jun 02 2025 06:03:51 GMT+0000 (Coordinated Universal Time) https://medium.com/nerd-for-tech/binance-clone-script-quick-way-to-launch-a-cryptocurrency-exchange-d64c95754703

@janetbrownjb #cryptoexchangedevelopment #cryptocurrencybusiness #launchwithbinanceclonescript #binanceclonescriptsolutions #cryptostartupideas

star

Mon Jun 02 2025 02:15:38 GMT+0000 (Coordinated Universal Time) https://microsoftedge.microsoft.com/addons/detail/flash-player-2025/fgenmmklgkdemhpgdppmldmkemplbcko

@Asneedarazali

star

Mon Jun 02 2025 01:59:13 GMT+0000 (Coordinated Universal Time) https://docs.github.com/en/copilot/managing-copilot/configure-personal-settings/installing-github-copilot-in-the-cli

@Asneedarazali

star

Mon Jun 02 2025 01:59:06 GMT+0000 (Coordinated Universal Time) https://docs.github.com/en/copilot/managing-copilot/configure-personal-settings/installing-github-copilot-in-the-cli

@Asneedarazali

star

Mon Jun 02 2025 01:58:49 GMT+0000 (Coordinated Universal Time) https://docs.github.com/en/copilot/managing-copilot/configure-personal-settings/installing-github-copilot-in-the-cli

@Asneedarazali

star

Mon Jun 02 2025 01:58:42 GMT+0000 (Coordinated Universal Time) https://docs.github.com/en/copilot/managing-copilot/configure-personal-settings/installing-github-copilot-in-the-cli

@Asneedarazali

star

Mon Jun 02 2025 01:58:37 GMT+0000 (Coordinated Universal Time) https://docs.github.com/en/copilot/managing-copilot/configure-personal-settings/installing-github-copilot-in-the-cli

@Asneedarazali

star

Mon Jun 02 2025 01:58:29 GMT+0000 (Coordinated Universal Time) https://docs.github.com/en/copilot/managing-copilot/configure-personal-settings/installing-github-copilot-in-the-cli

@Asneedarazali

star

Sun Jun 01 2025 14:50:13 GMT+0000 (Coordinated Universal Time)

@nani ##python

star

Sun Jun 01 2025 14:47:35 GMT+0000 (Coordinated Universal Time)

@nani ##python

star

Sun Jun 01 2025 14:43:00 GMT+0000 (Coordinated Universal Time)

@nani ##python

star

Sun Jun 01 2025 14:41:15 GMT+0000 (Coordinated Universal Time)

@nani ##python

star

Sun Jun 01 2025 03:14:09 GMT+0000 (Coordinated Universal Time)

@davidmchale #rest #operator #...args

star

Sun Jun 01 2025 00:33:48 GMT+0000 (Coordinated Universal Time)

@davidmchale #maps #toggling #decision

star

Sat May 31 2025 23:37:07 GMT+0000 (Coordinated Universal Time) https://alienshanu.me/

@blackalien

star

Sat May 31 2025 21:03:41 GMT+0000 (Coordinated Universal Time) https://rustme.net/cabinet

@Kifircheck

star

Sat May 31 2025 10:20:01 GMT+0000 (Coordinated Universal Time) https://www.beleaftechnologies.com/bc-game-clone-script

@raydensmith #bc #game #bcgameclonescript

star

Sat May 31 2025 05:10:23 GMT+0000 (Coordinated Universal Time) https://freeytthumbnail.com/

@FreeYt #python

star

Fri May 30 2025 13:29:58 GMT+0000 (Coordinated Universal Time)

@moussa_29

star

Fri May 30 2025 07:51:50 GMT+0000 (Coordinated Universal Time) https://cryptocurrency-exchange-development-company.com/

@raydensmith #cryptoexchange

star

Fri May 30 2025 05:46:04 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Fri May 30 2025 02:01:00 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Fri May 30 2025 01:56:28 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Thu May 29 2025 11:03:28 GMT+0000 (Coordinated Universal Time)

@Shivam3.tyagi

star

Thu May 29 2025 10:58:44 GMT+0000 (Coordinated Universal Time)

@Shivam3.tyagi

star

Thu May 29 2025 10:02:01 GMT+0000 (Coordinated Universal Time) https://maticz.com/poker-game-development

@abiramid ##pokergame #pokergamedevelopment #pokergamedevelopmentcompany #maticz #maticzpokergamedevelopment #pokerappdevelopment

star

Thu May 29 2025 05:24:28 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Wed May 28 2025 09:13:07 GMT+0000 (Coordinated Universal Time) https://www.coinsclone.com/crypto-leverage-trading-platform/

@CharleenStewar #crypto leverage trading platform

star

Wed May 28 2025 08:57:43 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Wed May 28 2025 08:56:35 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Wed May 28 2025 08:56:01 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Wed May 28 2025 07:30:13 GMT+0000 (Coordinated Universal Time) https://www.talentrack.in/voice-over-artist-job-in-india

@Talentrack

star

Wed May 28 2025 07:18:37 GMT+0000 (Coordinated Universal Time) https://www.firekirin.xyz:8888/Store.aspx

@cholillo18

star

Wed May 28 2025 07:17:57 GMT+0000 (Coordinated Universal Time) https://www.firekirin.xyz:8888/Store.aspx

@cholillo18

star

Wed May 28 2025 06:48:09 GMT+0000 (Coordinated Universal Time)

@Saravana_Kumar #python

star

Wed May 28 2025 04:23:35 GMT+0000 (Coordinated Universal Time)

@tara.hamedani

star

Wed May 28 2025 01:24:03 GMT+0000 (Coordinated Universal Time)

@futuremotiondev #css #font #font-family #font-stack

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension