repo_full_name stringlengths 6 93 | repo_url stringlengths 25 112 | repo_api_url stringclasses 28
values | owner stringclasses 28
values | repo_name stringclasses 28
values | description stringclasses 28
values | stars int64 617 98.8k | forks int64 31 355 ⌀ | watchers int64 990 999 ⌀ | license stringclasses 2
values | default_branch stringclasses 2
values | repo_created_at timestamp[s]date 2012-07-24 23:12:50 2025-06-16 08:07:28 ⌀ | repo_updated_at timestamp[s]date 2026-02-23 15:23:15 2026-05-03 18:52:12 ⌀ | repo_topics listlengths 0 13 ⌀ | repo_languages unknown | is_fork bool 1
class | open_issues int64 3 104 ⌀ | file_path stringlengths 3 208 | file_name stringclasses 509
values | file_extension stringclasses 1
value | file_size_bytes int64 101 84k ⌀ | file_url stringclasses 627
values | file_raw_url stringclasses 627
values | file_sha stringclasses 624
values | language stringclasses 8
values | parsed_at stringdate 2026-05-04 01:12:36 2026-05-04 19:41:55 | text stringlengths 100 102k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/bayesian_regression.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:38.261677 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# Import helper functions
from mlfromscratch.utils.data_operation import mean_squared_error
from mlfromscratch.utils.data_manipulation import train_test_split, polynomial_features
from mlfromscratch.supervised_learning import BayesianRegression
de... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/adaboost.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:38.280796 | from __future__ import division, print_function
import numpy as np
from sklearn import datasets
# Import helper functions
from mlfromscratch.supervised_learning import Adaboost
from mlfromscratch.utils.data_manipulation import train_test_split
from mlfromscratch.utils.data_operation import accuracy_score
from mlfromsc... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/deep_learning/layers.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:38.281797 |
from __future__ import print_function, division
import math
import numpy as np
import copy
from mlfromscratch.deep_learning.activation_functions import Sigmoid, ReLU, SoftPlus, LeakyReLU
from mlfromscratch.deep_learning.activation_functions import TanH, ELU, SELU, Softmax
class Layer(object):
def set_input_shap... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/deep_learning/activation_functions.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:38.335079 | import numpy as np
# Collection of activation functions
# Reference: https://en.wikipedia.org/wiki/Activation_function
class Sigmoid():
def __call__(self, x):
return 1 / (1 + np.exp(-x))
def gradient(self, x):
return self.__call__(x) * (1 - self.__call__(x))
class Softmax():
def __call__... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/deep_learning/optimizers.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:38.374575 | import numpy as np
from mlfromscratch.utils import make_diagonal, normalize
# Optimizers for models that use gradient based methods for finding the
# weights that minimizes the loss.
# A great resource for understanding these methods:
# http://sebastianruder.com/optimizing-gradient-descent/index.html
class Stochast... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/convolutional_neural_network.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:38.807566 |
from __future__ import print_function
from sklearn import datasets
import matplotlib.pyplot as plt
import math
import numpy as np
# Import helper functions
from mlfromscratch.deep_learning import NeuralNetwork
from mlfromscratch.utils import train_test_split, to_categorical, normalize
from mlfromscratch.utils import ... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/dbscan.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:38.843553 | import sys
import os
import math
import random
from sklearn import datasets
import numpy as np
# Import helper functions
from mlfromscratch.utils import Plot
from mlfromscratch.unsupervised_learning import DBSCAN
def main():
# Load the dataset
X, y = datasets.make_moons(n_samples=300, noise=0.08, shuffle=Fals... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/deep_q_network.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:38.844944 | from __future__ import print_function
import numpy as np
from mlfromscratch.utils import to_categorical
from mlfromscratch.deep_learning.optimizers import Adam
from mlfromscratch.deep_learning.loss_functions import SquareLoss
from mlfromscratch.deep_learning.layers import Dense, Dropout, Flatten, Activation, Reshape, B... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/elastic_net.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:38.888362 | from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Import helper functions
from mlfromscratch.supervised_learning import ElasticNet
from mlfromscratch.utils import k_fold_cross_validation_sets, normalize, mean_squared_error
from mlfromscratch.utils import trai... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/fp_growth.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:38.910275 |
import numpy as np
from mlfromscratch.unsupervised_learning import FPGrowth
def main():
# Demo transaction set
# Example:
# https://en.wikibooks.org/wiki/Data_Mining_Algorithms_In_R/Frequent_Pattern_Mining/The_FP-Growth_Algorithm
transactions = np.array([
["A", "B", "D", "E"],
["B... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/demo.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:38.919620 | from __future__ import print_function
from sklearn import datasets
import numpy as np
import math
import matplotlib.pyplot as plt
from mlfromscratch.utils import train_test_split, normalize, to_categorical, accuracy_score
from mlfromscratch.deep_learning.optimizers import Adam
from mlfromscratch.deep_learning.loss_fun... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/decision_tree_regressor.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:38.921474 | from __future__ import division, print_function
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from mlfromscratch.utils import train_test_split, standardize, accuracy_score
from mlfromscratch.utils import mean_squared_error, calculate_variance, Plot
from mlfromscratch.supervised_learning import... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/gaussian_mixture_model.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:38.955142 | from __future__ import division, print_function
import sys
import os
import math
import random
from sklearn import datasets
import numpy as np
from mlfromscratch.unsupervised_learning import GaussianMixtureModel
from mlfromscratch.utils import Plot
def main():
# Load the dataset
X, y = datasets.make_blobs()
... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/decision_tree_classifier.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:38.960743 | from __future__ import division, print_function
import numpy as np
from sklearn import datasets
import matplotlib.pyplot as plt
import sys
import os
# Import helper functions
from mlfromscratch.utils import train_test_split, standardize, accuracy_score
from mlfromscratch.utils import mean_squared_error, calculate_vari... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/genetic_algorithm.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:39.051527 |
from mlfromscratch.unsupervised_learning import GeneticAlgorithm
def main():
target_string = "Genetic Algorithm"
population_size = 100
mutation_rate = 0.05
genetic_algorithm = GeneticAlgorithm(target_string,
population_size,
... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/gradient_boosting_classifier.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:39.496018 | from __future__ import division, print_function
import numpy as np
from sklearn import datasets
import matplotlib.pyplot as plt
# Import helper functions
from mlfromscratch.utils import train_test_split, accuracy_score
from mlfromscratch.deep_learning.loss_functions import CrossEntropy
from mlfromscratch.utils import ... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/linear_discriminant_analysis.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:39.506499 | from __future__ import print_function
from sklearn import datasets
import matplotlib.pyplot as plt
import numpy as np
from mlfromscratch.supervised_learning import LDA
from mlfromscratch.utils import calculate_covariance_matrix, accuracy_score
from mlfromscratch.utils import normalize, standardize, train_test_split, P... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/linear_regression.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:39.508023 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.datasets import make_regression
from mlfromscratch.utils import train_test_split, polynomial_features
from mlfromscratch.utils import mean_squared_error, Plot
from mlfromscratch.supervised_learning import LinearRegression
def main():
... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/lasso_regression.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:39.535821 | from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Import helper functions
from mlfromscratch.supervised_learning import LassoRegression
from mlfromscratch.utils import k_fold_cross_validation_sets, normalize, mean_squared_error
from mlfromscratch.utils import... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/gradient_boosting_regressor.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:39.541835 | from __future__ import division, print_function
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import progressbar
from mlfromscratch.utils import train_test_split, standardize, to_categorical
from mlfromscratch.utils import mean_squared_error, accuracy_score, Plot
from mlfromscratch.utils.loss_... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/k_means.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:39.608621 | from __future__ import division, print_function
from sklearn import datasets
import numpy as np
from mlfromscratch.unsupervised_learning import KMeans
from mlfromscratch.utils import Plot
def main():
# Load the dataset
X, y = datasets.make_blobs()
# Cluster the data using K-Means
clf = KMeans(k=3)
... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/k_nearest_neighbors.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:39.609999 | from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
from sklearn import datasets
from mlfromscratch.utils import train_test_split, normalize, accuracy_score
from mlfromscratch.utils import euclidean_distance, Plot
from mlfromscratch.supervised_learning import KNN
def main():
d... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/multi_class_lda.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:39.716231 | from __future__ import print_function
from sklearn import datasets
import numpy as np
from mlfromscratch.supervised_learning import MultiClassLDA
from mlfromscratch.utils import normalize
def main():
# Load the dataset
data = datasets.load_iris()
X = normalize(data.data)
y = data.target
# Project... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/logistic_regression.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:39.739230 | from __future__ import print_function
from sklearn import datasets
import numpy as np
import matplotlib.pyplot as plt
# Import helper functions
from mlfromscratch.utils import make_diagonal, normalize, train_test_split, accuracy_score
from mlfromscratch.deep_learning.activation_functions import Sigmoid
from mlfromscra... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/multilayer_perceptron.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:39.756289 |
from __future__ import print_function
from sklearn import datasets
import matplotlib.pyplot as plt
import numpy as np
# Import helper functions
from mlfromscratch.deep_learning import NeuralNetwork
from mlfromscratch.utils import train_test_split, to_categorical, normalize, Plot
from mlfromscratch.utils import get_ra... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/neuroevolution.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:40.093695 |
from __future__ import print_function
from sklearn import datasets
import matplotlib.pyplot as plt
import numpy as np
from mlfromscratch.supervised_learning import Neuroevolution
from mlfromscratch.utils import train_test_split, to_categorical, normalize, Plot
from mlfromscratch.deep_learning import NeuralNetwork
fro... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/naive_bayes.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:40.120775 | from __future__ import division, print_function
from sklearn import datasets
import numpy as np
from mlfromscratch.utils import train_test_split, normalize, accuracy_score, Plot
from mlfromscratch.supervised_learning import NaiveBayes
def main():
data = datasets.load_digits()
X = normalize(data.data)
y = d... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/particle_swarm_optimization.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:40.139497 |
from __future__ import print_function
from sklearn import datasets
import matplotlib.pyplot as plt
import numpy as np
from mlfromscratch.supervised_learning import ParticleSwarmOptimizedNN
from mlfromscratch.utils import train_test_split, to_categorical, normalize, Plot
from mlfromscratch.deep_learning import NeuralN... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/perceptron.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:40.152837 | from __future__ import print_function
from sklearn import datasets
import numpy as np
# Import helper functions
from mlfromscratch.utils import train_test_split, normalize, to_categorical, accuracy_score
from mlfromscratch.deep_learning.activation_functions import Sigmoid
from mlfromscratch.deep_learning.loss_function... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/partitioning_around_medoids.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:40.180709 | from sklearn import datasets
import numpy as np
# Import helper functions
from mlfromscratch.utils import Plot
from mlfromscratch.unsupervised_learning import PAM
def main():
# Load the dataset
X, y = datasets.make_blobs()
# Cluster the data using K-Medoids
clf = PAM(k=3)
y_pred = clf.predict(X)
... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/principal_component_analysis.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:40.181813 | from sklearn import datasets
import matplotlib.pyplot as plt
import matplotlib.cm as cmx
import matplotlib.colors as colors
import numpy as np
from mlfromscratch.unsupervised_learning import PCA
def main():
# Demo of how to reduce the dimensionality of the data to two dimension
# and plot the results.
#... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/polynomial_regression.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:40.205623 | from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Import helper functions
from mlfromscratch.supervised_learning import PolynomialRidgeRegression
from mlfromscratch.utils import k_fold_cross_validation_sets, normalize, mean_squared_error
from mlfromscratch.ut... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/random_forest.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:40.284729 | from __future__ import division, print_function
import numpy as np
from sklearn import datasets
from mlfromscratch.utils import train_test_split, accuracy_score, Plot
from mlfromscratch.supervised_learning import RandomForest
def main():
data = datasets.load_digits()
X = data.data
y = data.target
X_tr... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/restricted_boltzmann_machine.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:40.427391 | import logging
import numpy as np
from sklearn import datasets
from sklearn.datasets import fetch_mldata
import matplotlib.pyplot as plt
from mlfromscratch.unsupervised_learning import RBM
logging.basicConfig(level=logging.DEBUG)
def main():
mnist = fetch_mldata('MNIST original')
X = mnist.data / 255.0
... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/recurrent_neural_network.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:40.433299 | from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
from mlfromscratch.deep_learning import NeuralNetwork
from mlfromscratch.utils import train_test_split, to_categorical, normalize, Plot
from mlfromscratch.utils import get_random_subsets, shuffle_data, accuracy_score
from mlfromsc... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/support_vector_machine.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:40.696482 | from __future__ import division, print_function
import numpy as np
from sklearn import datasets
# Import helper functions
from mlfromscratch.utils import train_test_split, normalize, accuracy_score, Plot
from mlfromscratch.utils.kernels import *
from mlfromscratch.supervised_learning import SupportVectorMachine
def m... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/xgboost.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:40.699841 | from __future__ import division, print_function
import numpy as np
from sklearn import datasets
import matplotlib.pyplot as plt
import progressbar
from mlfromscratch.utils import train_test_split, standardize, to_categorical, normalize
from mlfromscratch.utils import mean_squared_error, accuracy_score, Plot
from mlfrom... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/examples/ridge_regression.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:40.736477 | from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
# Import helper functions
from mlfromscratch.supervised_learning import PolynomialRidgeRegression
from mlfromscratch.utils import k_fold_cross_validation_sets, normalize, Plot
from mlfromscratch.utils import tra... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/reinforcement_learning/deep_q_network.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:40.757739 | from __future__ import print_function, division
import random
import numpy as np
import gym
from collections import deque
class DeepQNetwork():
"""Q-Learning with deep neural network to learn the control policy.
Uses a deep neural network model to predict the expected utility (Q-value) of executing an action... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/supervised_learning/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:40.764666 | from .adaboost import Adaboost
from .bayesian_regression import BayesianRegression
from .decision_tree import RegressionTree, ClassificationTree, XGBoostRegressionTree
from .gradient_boosting import GradientBoostingClassifier, GradientBoostingRegressor
from .k_nearest_neighbors import KNN
from .linear_discriminant_anal... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/supervised_learning/adaboost.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:40.789993 | from __future__ import division, print_function
import numpy as np
import math
from sklearn import datasets
import matplotlib.pyplot as plt
import pandas as pd
# Import helper functions
from mlfromscratch.utils import train_test_split, accuracy_score, Plot
# Decision stump used as weak classifier in this impl. of Ada... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/supervised_learning/bayesian_regression.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:40.869747 | from __future__ import print_function, division
import numpy as np
from scipy.stats import chi2, multivariate_normal
from mlfromscratch.utils import mean_squared_error, train_test_split, polynomial_features
class BayesianRegression(object):
"""Bayesian regression model. If poly_degree is specified the features w... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/supervised_learning/gradient_boosting.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:41.201235 | from __future__ import division, print_function
import numpy as np
import progressbar
# Import helper functions
from mlfromscratch.utils import train_test_split, standardize, to_categorical
from mlfromscratch.utils import mean_squared_error, accuracy_score
from mlfromscratch.deep_learning.loss_functions import SquareL... |
eriklindernoren/ML-From-Scratch | https://github.com/eriklindernoren/ML-From-Scratch | null | null | null | null | 31,414 | null | null | mit | null | null | null | null | null | null | null | mlfromscratch/supervised_learning/decision_tree.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:41.202008 | from __future__ import division, print_function
import numpy as np
from mlfromscratch.utils import divide_on_feature, train_test_split, standardize, mean_squared_error
from mlfromscratch.utils import calculate_entropy, accuracy_score, calculate_variance
class DecisionNode():
"""Class that represents a decision no... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | docs/generate_redirects.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:43.921076 | #!/usr/bin/env python3
"""
Generate HTML redirect files from redirects.json.
Usage:
python generate_redirects.py
This script reads redirects.json and generates individual HTML files
for each redirect path. Each HTML file uses meta refresh (0 delay)
which is SEO-friendly and treated similarly to 301 redirects by G... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | .github/scripts/run_langgraph_cli_test.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:43.922413 | import logging
import pathlib
import sys
import time
from urllib import error, request
import langgraph_cli
import langgraph_cli.config
import langgraph_cli.docker
from langgraph_cli.cli import prepare_args_and_stdin
from langgraph_cli.constants import DEFAULT_PORT
from langgraph_cli.exec import Runner, subp_exec
from... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-conformance/langgraph/checkpoint/conformance/capabilities.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:43.939390 | """Capability detection for checkpointer implementations."""
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from typing import TYPE_CHECKING
from langgraph.checkpoint.base import BaseCheckpointSaver
if TYPE_CHECKING:
pass
class Capability(str, Enum):
"""Capabili... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-conformance/langgraph/checkpoint/conformance/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:43.940519 | """langgraph-checkpoint-conformance: conformance test suite for checkpointer implementations."""
from langgraph.checkpoint.conformance.initializer import checkpointer_test
from langgraph.checkpoint.conformance.validate import validate
__all__ = [
"checkpointer_test",
"validate",
]
|
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-conformance/langgraph/checkpoint/conformance/report.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:43.946387 | """Capability report: results, progress callbacks, and pretty-printing."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass, field
from typing import Any
from langgraph.checkpoint.conformance.capabilities import (
BASE_CAPABILITIES,
EXTENDED_CAPABILITI... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-conformance/langgraph/checkpoint/conformance/initializer.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:43.952508 | """Checkpointer test registration and factory management."""
from __future__ import annotations
from collections.abc import AsyncGenerator, Callable
from contextlib import asynccontextmanager
from dataclasses import dataclass, field
from typing import Any
from langgraph.checkpoint.base import BaseCheckpointSaver
# ... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | .github/scripts/check_sdk_methods.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:43.955154 | import ast
import os
from itertools import filterfalse
from typing import Dict, List, Tuple
ROOT_PATH = os.path.abspath(os.path.join(__file__, "..", "..", ".."))
CLIENT_PATH = os.path.join(ROOT_PATH, "libs", "sdk-py", "langgraph_sdk", "client.py")
ASYNC_TO_SYNC_METHOD_MAP: Dict[str, str] = {
"aclose": "close",
... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-conformance/langgraph/checkpoint/conformance/spec/test_copy_thread.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:43.977656 | """COPY_THREAD capability tests — acopy_thread."""
from __future__ import annotations
import traceback
from collections.abc import Callable
from uuid import uuid4
from langgraph.checkpoint.base import BaseCheckpointSaver
from langgraph.checkpoint.conformance.test_utils import (
generate_checkpoint,
generate... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-conformance/langgraph/checkpoint/conformance/spec/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:43.978987 | """Test spec modules for each checkpointer capability."""
from langgraph.checkpoint.conformance.spec.test_copy_thread import (
run_copy_thread_tests,
)
from langgraph.checkpoint.conformance.spec.test_delete_for_runs import (
run_delete_for_runs_tests,
)
from langgraph.checkpoint.conformance.spec.test_delete_th... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | examples/chatbot-simulation-evaluation/simulation_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:43.983776 | import functools
from typing import Annotated, Any, Callable, Dict, List, Optional, Union
from langchain_community.adapters.openai import convert_message_to_dict
from langchain_core.messages import AIMessage, AnyMessage, BaseMessage, HumanMessage
from langchain_core.prompts import ChatPromptTemplate, MessagesPlacehold... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-conformance/langgraph/checkpoint/conformance/spec/test_get_tuple.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:45.213983 | """GET_TUPLE capability tests — aget_tuple retrieval."""
from __future__ import annotations
import traceback
from collections.abc import Callable
from uuid import uuid4
from langgraph.checkpoint.base import BaseCheckpointSaver
from langgraph.checkpoint.conformance.test_utils import (
generate_checkpoint,
ge... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-conformance/langgraph/checkpoint/conformance/spec/test_list.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:45.215404 | """LIST capability tests — alist with various filters."""
from __future__ import annotations
import traceback
from collections.abc import Callable
from uuid import uuid4
from langgraph.checkpoint.base import BaseCheckpointSaver
from langgraph.checkpoint.conformance.test_utils import (
generate_checkpoint,
g... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-conformance/langgraph/checkpoint/conformance/test_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:45.216448 | """Test utilities: checkpoint generators, assertion helpers, bulk operations."""
from __future__ import annotations
from datetime import datetime, timezone
from typing import Any
from uuid import uuid4
from langchain_core.runnables import RunnableConfig
from langgraph.checkpoint.base import (
ChannelVersions,
... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-conformance/langgraph/checkpoint/conformance/validate.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:45.217784 | """Core conformance runner — detects capabilities, runs test suites, builds report."""
from __future__ import annotations
from langgraph.checkpoint.conformance.capabilities import (
Capability,
DetectedCapabilities,
)
from langgraph.checkpoint.conformance.initializer import RegisteredCheckpointer
from langgra... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-conformance/langgraph/checkpoint/conformance/spec/test_delete_thread.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:45.218776 | """DELETE_THREAD capability tests — adelete_thread."""
from __future__ import annotations
import traceback
from collections.abc import Callable
from uuid import uuid4
from langgraph.checkpoint.base import BaseCheckpointSaver
from langgraph.checkpoint.conformance.test_utils import (
generate_checkpoint,
gene... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-conformance/langgraph/checkpoint/conformance/spec/test_put.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:45.219943 | """PUT capability tests — aput + aget_tuple round-trip."""
from __future__ import annotations
import traceback
from collections.abc import Callable
from typing import Any
from uuid import uuid4
from langgraph.checkpoint.base import (
BaseCheckpointSaver,
ChannelVersions,
)
from langgraph.checkpoint.conforma... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-conformance/langgraph/checkpoint/conformance/spec/test_put_writes.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:45.221410 | """PUT_WRITES capability tests — aput_writes + pending_writes retrieval."""
from __future__ import annotations
import traceback
from collections.abc import Callable
from uuid import uuid4
from langgraph.checkpoint.base import BaseCheckpointSaver
from langgraph.checkpoint.conformance.test_utils import (
generate... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-conformance/langgraph/checkpoint/conformance/spec/test_prune.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:46.988625 | """PRUNE capability tests — aprune(strategy)."""
from __future__ import annotations
import traceback
from collections.abc import Callable
from uuid import uuid4
from langgraph.checkpoint.base import BaseCheckpointSaver
from langgraph.checkpoint.conformance.test_utils import (
generate_checkpoint,
generate_c... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-postgres/langgraph/store/postgres/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:47.971662 | from langgraph.store.postgres.aio import AsyncPostgresStore
from langgraph.store.postgres.base import PoolConfig, PostgresStore
__all__ = ["AsyncPostgresStore", "PoolConfig", "PostgresStore"]
|
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-postgres/langgraph/checkpoint/postgres/_internal.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:47.973862 | """Shared utility functions for the Postgres checkpoint & storage classes."""
from collections.abc import Iterator
from contextlib import contextmanager
from psycopg import Connection
from psycopg.rows import DictRow
from psycopg_pool import ConnectionPool
Conn = Connection[DictRow] | ConnectionPool[Connection[DictR... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-postgres/langgraph/checkpoint/postgres/base.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:47.975193 | from __future__ import annotations
import random
import warnings
from collections.abc import Sequence
from importlib.metadata import version as get_version
from typing import Any, TypedDict, cast
from langchain_core.runnables import RunnableConfig
from langgraph.checkpoint.base import (
DELTA_SENTINEL,
WRITES... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-postgres/langgraph/checkpoint/postgres/aio.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:47.976516 | from __future__ import annotations
import asyncio
from collections import defaultdict
from collections.abc import AsyncIterator, Iterator, Sequence
from contextlib import asynccontextmanager
from typing import Any, cast
from langchain_core.runnables import RunnableConfig
from langgraph.checkpoint.base import (
DE... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-postgres/langgraph/checkpoint/postgres/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:47.977430 | from __future__ import annotations
import threading
from collections import defaultdict
from collections.abc import Iterator, Sequence
from contextlib import contextmanager
from typing import Any, cast
from langchain_core.runnables import RunnableConfig
from langgraph.checkpoint.base import (
DELTA_SENTINEL,
... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-postgres/langgraph/checkpoint/postgres/shallow.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:47.978714 | import asyncio
import threading
import warnings
from collections.abc import AsyncIterator, Iterator, Sequence
from contextlib import asynccontextmanager, contextmanager
from typing import Any
from langchain_core.runnables import RunnableConfig
from langgraph.checkpoint.base import (
WRITES_IDX_MAP,
ChannelVers... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-conformance/langgraph/checkpoint/conformance/spec/test_delete_for_runs.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:48.216472 | """DELETE_FOR_RUNS capability tests — adelete_for_runs."""
from __future__ import annotations
import traceback
from collections.abc import Callable
from uuid import uuid4
from langgraph.checkpoint.base import BaseCheckpointSaver
from langgraph.checkpoint.conformance.test_utils import (
generate_checkpoint,
... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-postgres/langgraph/store/postgres/aio.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:48.317734 | from __future__ import annotations
import asyncio
import logging
from collections.abc import AsyncIterator, Callable, Iterable, Sequence
from contextlib import asynccontextmanager
from types import TracebackType
from typing import Any, cast
import orjson
from langgraph.store.base import (
GetOp,
ListNamespace... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-conformance/tests/test_validate_memory.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:48.366429 | """Self-tests: run the conformance suite against InMemorySaver."""
from __future__ import annotations
import pytest
from langgraph.checkpoint.memory import InMemorySaver
from langgraph.checkpoint.conformance import checkpointer_test, validate
@checkpointer_test(name="InMemorySaver")
async def memory_checkpointer()... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-postgres/tests/conftest.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:48.560546 | from collections.abc import AsyncIterator
import pytest
from psycopg import AsyncConnection
from psycopg.errors import UndefinedTable
from psycopg.rows import DictRow, dict_row
from tests.embed_test_utils import CharacterEmbeddings
DEFAULT_POSTGRES_URI = "postgres://postgres:postgres@localhost:5441/"
DEFAULT_URI = "... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-postgres/tests/embed_test_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:48.573452 | """Embedding utilities for testing."""
import math
import random
from collections import Counter, defaultdict
from typing import Any
from langchain_core.embeddings import Embeddings
class CharacterEmbeddings(Embeddings):
"""Simple character-frequency based embeddings using random projections."""
def __init... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-postgres/langgraph/store/postgres/base.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:48.591228 | from __future__ import annotations
import asyncio
import concurrent.futures
import json
import logging
import threading
from collections import defaultdict
from collections.abc import Callable, Iterable, Iterator, Sequence
from contextlib import contextmanager
from datetime import datetime
from typing import (
TYP... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-postgres/tests/test_async.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:48.605893 | # type: ignore
from contextlib import asynccontextmanager
from typing import Any
from uuid import uuid4
import pytest
from langchain_core.runnables import RunnableConfig
from langgraph.checkpoint.base import (
EXCLUDED_METADATA_KEYS,
Checkpoint,
CheckpointMetadata,
create_checkpoint,
empty_checkpo... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-postgres/tests/test_async_store.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:48.607323 | # type: ignore
from __future__ import annotations
import asyncio
import itertools
import uuid
from collections.abc import AsyncIterator
from concurrent.futures import ThreadPoolExecutor
from contextlib import asynccontextmanager
from typing import Any
import pytest
from langchain_core.embeddings import Embeddings
fro... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-postgres/tests/test_store.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:48.823402 | # type: ignore
from __future__ import annotations
import re
import time
from contextlib import contextmanager
from typing import Any
from uuid import uuid4
import pytest
from langchain_core.embeddings import Embeddings
from langgraph.store.base import (
GetOp,
Item,
ListNamespacesOp,
MatchCondition,
... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-postgres/tests/test_sync.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:48.928816 | # type: ignore
import re
from contextlib import contextmanager
from typing import Any
from uuid import uuid4
import pytest
from langchain_core.runnables import RunnableConfig
from langgraph.checkpoint.base import (
EXCLUDED_METADATA_KEYS,
Checkpoint,
CheckpointMetadata,
create_checkpoint,
empty_ch... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-sqlite/langgraph/cache/sqlite/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:48.953905 | from __future__ import annotations
import asyncio
import datetime
import sqlite3
import threading
from collections.abc import Mapping, Sequence
from langgraph.cache.base import BaseCache, FullKey, Namespace, ValueT
from langgraph.checkpoint.serde.base import SerializerProtocol
class SqliteCache(BaseCache[ValueT]):
... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-postgres/langgraph/checkpoint/postgres/_ainternal.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:49.049377 | """Shared async utility functions for the Postgres checkpoint & storage classes."""
from collections.abc import AsyncIterator
from contextlib import asynccontextmanager
from psycopg import AsyncConnection
from psycopg.rows import DictRow
from psycopg_pool import AsyncConnectionPool
Conn = AsyncConnection[DictRow] | ... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:49.146998 | from __future__ import annotations
import json
import re
from collections.abc import Sequence
from typing import Any
from langchain_core.runnables import RunnableConfig
from langgraph.checkpoint.base import get_checkpoint_id
_FILTER_PATTERN = re.compile(r"^[a-zA-Z0-9_.-]+$")
def _validate_filter_key(key: str) -> N... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:49.168870 | from __future__ import annotations
import json
import random
import sqlite3
import threading
from collections.abc import AsyncIterator, Iterator, Sequence
from contextlib import closing, contextmanager
from typing import Any, cast
from langchain_core.runnables import RunnableConfig
from langgraph.checkpoint.base impo... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-sqlite/langgraph/store/sqlite/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:49.173733 | from langgraph.store.sqlite.aio import AsyncSqliteStore
from langgraph.store.sqlite.base import SqliteStore
__all__ = ["AsyncSqliteStore", "SqliteStore"]
|
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/aio.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:49.192184 | from __future__ import annotations
import asyncio
import json
import random
import threading
from collections.abc import AsyncIterator, Callable, Iterator, Sequence
from contextlib import asynccontextmanager
from typing import Any, TypeVar, cast
import aiosqlite
from langchain_core.runnables import RunnableConfig
fro... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-sqlite/langgraph/store/sqlite/aio.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:49.201878 | from __future__ import annotations
import asyncio
import logging
from collections import defaultdict
from collections.abc import AsyncIterator, Callable, Iterable, Sequence
from contextlib import asynccontextmanager
from types import TracebackType
from typing import Any, cast
import aiosqlite
import orjson
import sql... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-sqlite/langgraph/store/sqlite/base.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:49.236029 | from __future__ import annotations
import concurrent.futures
import datetime
import logging
import re
import sqlite3
import threading
from collections import defaultdict
from collections.abc import Callable, Iterable, Iterator, Sequence
from contextlib import contextmanager
from typing import Any, Literal, NamedTuple,... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-sqlite/tests/test_aiosqlite.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:49.496304 | from typing import Any
import pytest
from langchain_core.runnables import RunnableConfig
from langgraph.checkpoint.base import (
Checkpoint,
CheckpointMetadata,
create_checkpoint,
empty_checkpoint,
)
from langgraph.checkpoint.sqlite.aio import AsyncSqliteSaver
class TestAsyncSqliteSaver:
@pytest... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-sqlite/tests/test_async_store.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:49.539100 | # mypy: disable-error-code="union-attr,arg-type,index,operator"
import asyncio
import os
import tempfile
import uuid
from collections.abc import AsyncIterator, Generator, Iterable
from contextlib import asynccontextmanager
from typing import cast
import pytest
from langgraph.store.base import (
GetOp,
Item,
... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-sqlite/tests/test_sqlite.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:49.605501 | from typing import Any, cast
import pytest
from langchain_core.runnables import RunnableConfig
from langgraph.checkpoint.base import (
Checkpoint,
CheckpointMetadata,
create_checkpoint,
empty_checkpoint,
)
from langgraph.checkpoint.sqlite import SqliteSaver
from langgraph.checkpoint.sqlite.utils impor... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-sqlite/tests/test_ttl.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:49.748248 | """Test SQLite store Time-To-Live (TTL) functionality."""
import asyncio
import os
import tempfile
import time
from collections.abc import Generator
import pytest
from langgraph.store.base import TTLConfig
from langgraph.store.sqlite import SqliteStore
from langgraph.store.sqlite.aio import AsyncSqliteStore
@pytes... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint-sqlite/tests/test_store.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:49.761260 | # mypy: disable-error-code="union-attr,arg-type,index,operator"
import os
import re
import tempfile
import uuid
from collections.abc import Generator, Iterable
from contextlib import contextmanager
from typing import Any, Literal, cast
import pytest
from langchain_core.embeddings import Embeddings
from langgraph.store... |
langchain-ai/langgraph | https://github.com/langchain-ai/langgraph | null | null | null | null | 31,117 | null | null | mit | null | null | null | null | null | null | null | libs/checkpoint/langgraph/cache/base/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:49.802199 | from __future__ import annotations
from abc import ABC, abstractmethod
from collections.abc import Mapping, Sequence
from typing import Generic, TypeVar
from langgraph.checkpoint.serde.base import SerializerProtocol
from langgraph.checkpoint.serde.jsonplus import JsonPlusSerializer
ValueT = TypeVar("ValueT")
Namespa... |
luongnv89/claude-howto | https://github.com/luongnv89/claude-howto | null | null | null | null | 30,945 | null | null | mit | null | null | null | null | null | null | null | 03-skills/code-review/scripts/compare-complexity.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:52.256754 | #!/usr/bin/env python3
"""
Compare cyclomatic complexity of code before and after changes.
Helps identify if refactoring actually simplifies code structure.
"""
import re
import sys
class ComplexityAnalyzer:
"""Analyze code complexity metrics."""
def __init__(self, code: str):
self.code = code
... |
luongnv89/claude-howto | https://github.com/luongnv89/claude-howto | null | null | null | null | 30,945 | null | null | mit | null | null | null | null | null | null | null | 03-skills/refactor/scripts/detect-smells.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:52.281681 | #!/usr/bin/env python3
"""
Code Smell Detector
Detects common code smells in Python, JavaScript, and TypeScript files.
Based on Martin Fowler's catalog of code smells.
Usage:
python detect-smells.py <file>
python detect-smells.py --dir <directory>
python detect-smells.py -v <file> # Verbose with code sni... |
luongnv89/claude-howto | https://github.com/luongnv89/claude-howto | null | null | null | null | 30,945 | null | null | mit | null | null | null | null | null | null | null | 03-skills/code-review/scripts/analyze-metrics.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:52.286799 | #!/usr/bin/env python3
import re
import sys
def analyze_code_metrics(code):
"""Analyze code for common metrics."""
# Count functions
functions = len(re.findall(r"^def\s+\w+", code, re.MULTILINE))
# Count classes
classes = len(re.findall(r"^class\s+\w+", code, re.MULTILINE))
# Average line l... |
luongnv89/claude-howto | https://github.com/luongnv89/claude-howto | null | null | null | null | 30,945 | null | null | mit | null | null | null | null | null | null | null | 09-advanced-features/setup-auto-mode-permissions.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:52.290900 | #!/usr/bin/env python3
"""
setup-auto-mode-permissions.py
Seed ~/.claude/settings.json with a conservative baseline of safe permissions
for Claude Code. The default set is read-only and local-inspection oriented;
optional flags let you widen the allowlist for editing, test execution, git
write operations, package inst... |
luongnv89/claude-howto | https://github.com/luongnv89/claude-howto | null | null | null | null | 30,945 | null | null | mit | null | null | null | null | null | null | null | 03-skills/doc-generator/generate-docs.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:52.292701 | #!/usr/bin/env python3
import ast
class APIDocExtractor(ast.NodeVisitor):
"""Extract API documentation from Python source code."""
def __init__(self):
self.endpoints = []
def visit_FunctionDef(self, node):
"""Extract function documentation."""
if node.name.startswith("get_") or n... |
luongnv89/claude-howto | https://github.com/luongnv89/claude-howto | null | null | null | null | 30,945 | null | null | mit | null | null | null | null | null | null | null | 06-hooks/context-tracker-tiktoken.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:52.294341 | #!/usr/bin/env python3
"""
Context Usage Tracker (tiktoken version) - Tracks token consumption per request.
Uses UserPromptSubmit as "pre-message" hook and Stop as "post-response" hook
to calculate the delta in token usage for each request.
This version uses tiktoken with p50k_base encoding for ~90-95% accuracy.
Requ... |
luongnv89/claude-howto | https://github.com/luongnv89/claude-howto | null | null | null | null | 30,945 | null | null | mit | null | null | null | null | null | null | null | 03-skills/refactor/scripts/analyze-complexity.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:52.300153 | #!/usr/bin/env python3
"""
Code Complexity Analyzer
Analyzes code complexity metrics for Python, JavaScript, and TypeScript files.
Helps measure the impact of refactoring by comparing before/after metrics.
Usage:
python analyze-complexity.py <file>
python analyze-complexity.py <before_file> <after_file> # Co... |
luongnv89/claude-howto | https://github.com/luongnv89/claude-howto | null | null | null | null | 30,945 | null | null | mit | null | null | null | null | null | null | null | scripts/check_cross_references.py | null | null | null | null | null | null | Python | 2026-05-04T02:24:52.301731 | #!/usr/bin/env python3
"""Validate cross-references, anchors, and code fences in Markdown files."""
import re
import sys
from pathlib import Path
IGNORE_DIRS = {
".venv",
"node_modules",
".git",
"blog-posts",
"openspec",
"prompts",
".agents",
}
IGNORE_FILES = {"README.backup.md"}
def ite... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.