Skip to content

Instantly share code, notes, and snippets.

View ntkathole's full-sized avatar

Nikhil Kathole ntkathole

View GitHub Profile
#!/usr/bin/env python3
"""
CodeFlare SDK Connection Debugging Script
This script helps diagnose issues with connecting to KubeRay clusters via CodeFlare SDK.
It tests authentication, cluster discovery, and connection setup.
Usage:
python debug_codeflare_connection.py \
--cluster-name test-kuberay \
@ntkathole
ntkathole / features.py
Created October 31, 2025 16:45
Fetch historical features
import pandas as pd
entity_df = pd.DataFrame({
"customer_id": [
"CUST_000001",
"CUST_000002",
"CUST_000003",
"CUST_000005",
],
"event_timestamp": [
@ntkathole
ntkathole / transaction_prediction_service.py
Last active October 31, 2025 16:51
Updated transaction_prediction_service service
from feast import FeatureService
# Get all feature views
print("Retrieving feature views from registry...")
customer_demographics_fv = fs_banking.get_feature_view("customer_demographics_fv")
customer_behavioral_profile = fs_banking.get_feature_view("customer_behavioral_profile")
transaction_7d_aggregations = fs_banking.get_feature_view("transaction_7d_aggregations")
transaction_30d_aggregations = fs_banking.get_feature_view("transaction_30d_aggregations")
transaction_90d_patterns = fs_banking.get_feature_view("transaction_90d_patterns")
customer_transaction_interaction = fs_banking.get_feature_view("customer_transaction_interaction")
@ntkathole
ntkathole / customer_high_value_txns.py
Last active October 31, 2025 16:51
Create new feature and feature view
from feast import FeatureView, Field
from feast.types import Float64, Int64
from datetime import timedelta
# Get references
transaction_source = fs_banking.get_data_source("transaction_data_source")
customer = fs_banking.get_entity("customer")
customer_high_value_txns = FeatureView(
name="customer_high_value_txns",
@ntkathole
ntkathole / affordability_score_feature.py
Last active October 31, 2025 11:32
affordability_score_feature
customer_demographics_fv = fs_banking.get_feature_view("customer_demographics_fv")
from feast import Field
from feast.on_demand_feature_view import on_demand_feature_view
from feast.types import Float64
import pandas as pd
@on_demand_feature_view(
sources=[customer_demographics_fv],
schema=[Field(name="affordability_score", dtype=Float64)],
@ntkathole
ntkathole / dummy_timestamp_examples
Created April 30, 2025 04:12
Examples for dummy timestamps
# Exmaple 1 : Sample File based data creation
import pandas as pd
from datetime import datetime
from feast import Entity, FeatureView, Feature, ValueType, Field, FileSource
from feast.types import String
df = pd.DataFrame({
"employee_id": [1, 2],
import sys
import xml.etree.ElementTree as ET
tree = ET.parse(sys.argv[1])
root = tree.getroot()
root.findall('properties')
attrib1 = {'name': 'polarion-group-id', 'value': sys.argv[2]}
ET.SubElement(root.findall('properties')[0],'property',attrib1)
tree.write(sys.argv[1])
"Modified from project : https://pypi.org/project/PyHatch/"
import requests
import os
import datetime
import getpass
GITHUB_USER = 'ntkathole'
here = os.path.abspath(os.path.dirname(__file__))
@ntkathole
ntkathole / find_satellite_snap.py
Last active April 23, 2019 14:15
This script helps you to find which satellite snap you have installed.
import os
import requests
ohsnap=""
satellite="6.5.0"
def main():
for i in range(1,50):
flag = 0
release = "{0}/api/releases/{1}/snaps/{2}.0/srpms".format(ohsnap,str(satellite),str(i))
@ntkathole
ntkathole / custom_certs.sh
Created September 23, 2018 12:59
Script to generate custom certs
#! /bin/bash
name=${hostname}
mkdir ownca
pushd ownca
wget https://raw.githubusercontent.com/ntkathole/ownca/master/openssl.cnf
wget https://raw.githubusercontent.com/ntkathole/ownca/master/generate-ca.sh
wget https://raw.githubusercontent.com/ntkathole/ownca/master/generate-crt.sh
echo 100001 >> serial
chmod 744 *.sh
yes "" | ./generate-ca.sh