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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
thisjam/sd-webui-oldsix-prompt | https://github.com/thisjam/sd-webui-oldsix-prompt | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | scripts/transerver/llmTranslate.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:50.171659 | '''
Author: Six_God_K
Date: 2024-04-13 12:54:31
LastEditors: Six_God_K
LastEditTime: 2024-05-03 17:06:36
FilePath: \webui\extensions\sd-webui-oldsix-prompt\scripts\transerver\llmTranslate.py
Description:
Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
'''
import Translator
import requests
import json
... |
thisjam/sd-webui-oldsix-prompt | https://github.com/thisjam/sd-webui-oldsix-prompt | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | scripts/transerver/Translator.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:50.227333 | '''
Author: Six_God_K
Date: 2024-04-13 12:12:19
LastEditors: Six_God_K
LastEditTime: 2024-04-26 22:06:41
FilePath: \webui\extensions\sd-webui-oldsix-prompt\scripts\transerver\Translator.py
Description:
Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
'''
from abc import ABC, abstractmethod
import hashli... |
thisjam/sd-webui-oldsix-prompt | https://github.com/thisjam/sd-webui-oldsix-prompt | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | scripts/transbd.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:50.229275 | '''
Author: thisjam 3213441409@qq.cm
Date: 2024-01-02 14:11:27
LastEditors: Six_God_K
LastEditTime: 2024-04-08 08:33:53
FilePath: \webui\extensions\sd-webui-oldsix-prompt\scripts\transbd.py
Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE... |
thisjam/sd-webui-oldsix-prompt | https://github.com/thisjam/sd-webui-oldsix-prompt | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | install.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:50.252499 | '''
Author: Six_God_K
Date: 2024-03-28 09:32:28
LastEditors: Six_God_K
LastEditTime: 2024-04-07 23:45:47
FilePath: \webui\extensions\sd-webui-oldsix-prompt\install.py
Description:
Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
'''
import pkg_resources
import launch
import requests
min_version = "2.31.... |
thisjam/sd-webui-oldsix-prompt | https://github.com/thisjam/sd-webui-oldsix-prompt | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | scripts/settings.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:50.254613 | '''
Author: Six_God_K
Date: 2024-03-24 15:56:01
LastEditors: Six_God_K
LastEditTime: 2024-04-02 16:29:42
FilePath: \webui\extensions\sd-webui-oldsix-prompt\scripts\settings.py
Description:
Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
'''
# from modules import shared,scripts,script_callbacks
# impo... |
thisjam/sd-webui-oldsix-prompt | https://github.com/thisjam/sd-webui-oldsix-prompt | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | scripts/transerver/freebd.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:50.324843 | '''
Author: Six_God_K
Date: 2024-04-13 15:23:00
LastEditors: Six_God_K
LastEditTime: 2024-04-26 22:05:30
FilePath: \webui\extensions\sd-webui-oldsix-prompt\scripts\transerver\freebd.py
Description:
Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
'''
import Translator
import requests
import json
class... |
thisjam/sd-webui-oldsix-prompt | https://github.com/thisjam/sd-webui-oldsix-prompt | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | scripts/old_six_prompt.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:50.335721 | '''
Author: Six_God_K
Date: 2024-03-24 15:56:01
LastEditors: Six_God_K
LastEditTime: 2024-05-03 16:54:46
FilePath: \webui\extensions\sd-webui-oldsix-prompt\scripts\old_six_prompt.py
Description:
Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
'''
import gradio as gr
import os,json
import json
import r... |
thisjam/sd-webui-oldsix-prompt | https://github.com/thisjam/sd-webui-oldsix-prompt | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | scripts/transerver/llm.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:50.342924 | '''
Author: Six_God_K
Date: 2024-04-26 22:05:49
LastEditors: Six_God_K
LastEditTime: 2024-05-03 17:24:08
FilePath: \webui\extensions\sd-webui-oldsix-prompt\scripts\transerver\llm.py
Description:
Copyright (c) 2024 by ${git_name_email}, All Rights Reserved.
'''
import time
import os
import random
# from llama_cpp ... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | examples/ssm_neuron_benchmarks/tinystories.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:52.786069 | from datetime import datetime
import math
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
from datasets import load_dataset
from transformers import AutoTokenizer
from tqdm import tqdm
import torch.nn.functional as F
import wandb
from snntorch._neurons.stateleaky... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | examples/ssm_neuron_benchmarks/bench_kernel_truncation.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:52.787540 | import time
import gc
import argparse
import json
import subprocess
import sys
import os
from profilehooks import profile
from tqdm import tqdm
import numpy as np
import torch
import matplotlib.pyplot as plt
from snntorch._neurons.stateleaky import StateLeaky
# Sweep configurations: (batch_size, channels)
SWEEP_CONF... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | examples/rnn_test.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:52.803722 | import torch
import snntorch as snn
device = 'cuda'
num_outputs = 5
beta1 = torch.rand((num_outputs), dtype = torch.float) # independent decay rate for each leaky neuron in layer 2: [0, 1)
lif1 = snn.LeakyParallel(2, 4, beta=0.9, learn_beta=True, device=device)
# lif2 = snn.LeakyParallel(20, 30, device=device)
# lif3... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | docs/conf.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:52.806148 | #!/usr/bin/env python
import os
import sys
sys.path.insert(0, os.path.abspath(".."))
# fmt: off
__version__ = '0.9.4'
# fmt: on
# -- General configuration ---------------------------------------------
# needs_sphinx = '1.0'
# extensions = ["sphinx.ext.autodoc",
# "sphinx.ext.viewcode",
# ... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | examples/ssm_neuron_benchmarks/bench_chunks.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:52.807614 | import time
import gc
import argparse
import json
import subprocess
import sys
import os
from profilehooks import profile
from tqdm import tqdm
import numpy as np
import torch
import matplotlib.pyplot as plt
from snntorch._neurons.leaky import Leaky
from snntorch._neurons.stateleaky import StateLeaky
# Sweep config... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | examples/rnn_test_train.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:52.835104 | import torch
import torch.nn as nn
import snntorch as snn
import time
from torch.utils.data import DataLoader
from torchvision import datasets, transforms
import torch.nn.functional as F
batch_size = 128
num_steps = 20
# data_path='/tmp/data/mnist'
data_path='C:\\Users\\jeshr\\Data\\mnist'
device = torch.device("cu... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | examples/ssm_neuron_benchmarks/bench_sizes.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:52.836355 | import time
import gc
import argparse
import json
import subprocess
import sys
import os
from profilehooks import profile
from tqdm import tqdm
import numpy as np
import torch
import matplotlib.pyplot as plt
from snntorch._neurons.leaky import Leaky
from snntorch._neurons.stateleaky import StateLeaky
# Sweep config... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | examples/test.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:52.842668 | import logging
from dataclasses import dataclass, field
from enum import Enum
from typing import List
import nir
import numpy as np
import spinnaker2
from spinnaker2 import ann2snn_helpers, hardware, snn
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
class HardwareConstraintError(Exce... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | examples/ssm_neuron_benchmarks/bench_variants.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:52.872452 | import time
import gc
import argparse
import json
import subprocess
import sys
import os
from profilehooks import profile
from tqdm import tqdm
import numpy as np
import torch
import matplotlib.pyplot as plt
from snntorch._neurons.leaky import Leaky
from snntorch._neurons.stateleaky import StateLeaky
# Sweep config... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | examples/tutorial_ipu_1.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:53.350249 | # Script by Vincent Sun
import argparse
import ctypes
import os
import numpy as np
import popart
from torch.utils.data import DataLoader
from torchvision import datasets, transforms
import torch
import torch.nn as nn
import poptorch
import snntorch as snn
from snntorch.functional import loss as SF
from snntorch impor... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/_layers/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:53.441206 | __layer__ = ["BatchNormTT1d", "BatchNormTT2d" "GradedSpikes"]
from .bntt import *
from .graded_spikes import *
# from .slstm import SLSTM
|
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:53.442176 | from ._version import __version__
from ._neurons import *
from ._layers import *
# from .export_nir import export_to_nir
# from .import_nir import import_from_nir |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/_layers/graded_spikes.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:53.455574 | import torch
class GradedSpikes(torch.nn.Module):
"""Learnable spiking magnitude for spiking layers."""
def __init__(self, size, constant_factor):
"""
:param size: The input size of the layer. Must be equal to the
number of neurons in the preceeding layer.
:type size: int... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | setup.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:53.457485 | #!/usr/bin/env python
"""The setup script."""
from setuptools import setup, find_packages
with open("README.rst", encoding="utf-8") as readme_file:
readme = readme_file.read()
# with open("HISTORY.rst") as history_file:
# history = history_file.read()
# fmt: off
__version__ = '0.9.4'
# fmt: on
install_req... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/_neurons/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:53.458492 | ###############################################################
# When adding new neurons, update the following: #
# i) create neuron in snntorch/_neurons/your_neuron.py #
# ii) utils.py: reset(); _layer_check(), _layer_reset() etc. #
# iii) neurons_dict in backprop.py, #
... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/_layers/bntt.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:53.462648 | import torch.nn as nn
def BatchNormTT1d(
input_features, time_steps, eps=1e-5, momentum=0.1, affine=True
):
"""
Generate a torch.nn.ModuleList of 1D Batch Normalization Layer with
length time_steps.
Input to this layer is the same as the vanilla torch.nn.BatchNorm1d
layer.
Batch Normalis... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/_neurons/lapicque.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:53.513524 | import torch
from .neurons import LIF
class Lapicque(LIF):
"""
An extension of Lapicque's experimental comparison between extracellular
nerve fibers and an RC circuit.
It is qualitatively equivalent to :code:`Leaky` but defined using RC
circuit parameters.
Input stimulus is integrated by membr... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/_neurons/alpha.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:53.514571 | import torch
import torch.nn as nn
from .neurons import LIF
class Alpha(LIF):
"""
A variant of the leaky integrate and fire neuron where membrane
potential follows an alpha function.
The time course of the membrane potential response depends on a
combination of exponentials.
In general, this ... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/_neurons/leaky.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:53.569612 | from .neurons import LIF
import torch
from torch import nn
class Leaky(LIF):
"""
First-order leaky integrate-and-fire neuron model.
Input is assumed to be a current injection.
Membrane potential decays exponentially with rate beta.
For :math:`U[T] > U_{\\rm thr} ⇒ S[T+1] = 1`.
If `reset_mecha... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/_neurons/linearleaky.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:54.202117 | from torch import nn
from .stateleaky import StateLeaky
class LinearLeaky(StateLeaky):
r"""
Per-timestep linear projection followed by :class:`StateLeaky` dynamics.
LinearLeaky applies ``nn.Linear(in_features, out_features)`` at each time
step of the input sequence, then delegates state computation,... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/_neurons/leakykernel.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:54.202894 | import torch
import torch.nn as nn
class LeakyKernel(nn.Module):
"""
A parallel implementation of the Leaky neuron with a fused input linear layer.
All time steps are passed to the input at once.
This implementation uses `torch.nn.RNN` to accelerate the implementation.
First-order leaky integrate... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/_neurons/leakyparallel.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:54.205534 | import torch
import torch.nn as nn
class LeakyParallel(nn.Module):
"""
A parallel implementation of the Leaky neuron with a fused input linear layer.
All time steps are passed to the input at once.
This implementation uses `torch.nn.RNN` to accelerate the implementation.
First-order leaky integr... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/_neurons/rleaky.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:54.376705 | import torch
import torch.nn as nn
# from torch import functional as F
from .neurons import LIF
class RLeaky(LIF):
"""
First-order recurrent leaky integrate-and-fire neuron model.
Input is assumed to be a current injection appended to the voltage
spike output.
Membrane potential decays exponentia... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/_neurons/slstm.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:54.377484 | import torch
import torch.nn as nn
from .neurons import SpikingNeuron
class SLSTM(SpikingNeuron):
"""
A spiking long short-term memory cell.
Hidden states are membrane potential and synaptic current
:math:`mem, syn`, which correspond to the hidden and cell
states :math:`h, c` in the original LSTM ... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/_neurons/stateleaky.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:54.379665 | from warnings import warn
import torch
from torch import nn
from torch.nn import functional as F
import torch
from torch.autograd import Function
from torch.nn import functional as F
from .neurons import LIF
def causal_conv1d(input_tensor, kernel_tensor):
_batch_size, in_channels, _num_steps = input_tensor.shap... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/_neurons/leakyunroll.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:54.380945 | import torch
import torch.nn as nn
class LeakyParallel(nn.Module):
"""
A parallel implementation of the Leaky neuron intended to handle arbitrary input dimensions.
All time steps are passed to the input at once.
This implementation uses `torch.nn.RNN` to accelerate the implementation.
First-order... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/_neurons/rsynaptic.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:54.382568 | import torch
import torch.nn as nn
from .neurons import LIF
class RSynaptic(LIF):
"""
2nd order recurrent leaky integrate and fire neuron model accounting for
synaptic conductance.
The synaptic current jumps upon spike arrival, which causes a jump in
membrane potential.
Synaptic current and me... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/_neurons/sconv2dlstm.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:54.411098 | import torch
import torch.nn as nn
import torch.nn.functional as F
from .neurons import SpikingNeuron
class SConv2dLSTM(SpikingNeuron):
"""
A spiking 2d convolutional long short-term memory cell.
Hidden states are membrane potential and synaptic current
:math:`mem, syn`, which correspond to the hidden... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/_neurons/neurons.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:54.573709 | from warnings import warn
from snntorch.surrogate import atan
import torch
import torch.nn as nn
__all__ = [
"SpikingNeuron",
"LIF",
]
dtype = torch.float
class SpikingNeuron(nn.Module):
"""Parent class for spiking neuron models."""
instances = []
"""Each :mod:`snntorch.SpikingNeuron` neuron
... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/_neurons/synaptic.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:55.026853 | import torch
import torch.nn as nn
from .neurons import LIF
class Synaptic(LIF):
"""
2nd order leaky integrate and fire neuron model accounting for synaptic
conductance.
The synaptic current jumps upon spike arrival, which causes a jump in
membrane potential.
Synaptic current and membrane pote... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/functional/probe.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:55.193020 | import torch
from torch import nn
from typing import Callable, Any
def unpack_len1_tuple(x: tuple or torch.Tensor):
if isinstance(x, tuple) and x.__len__() == 1:
return x[0]
else:
return x
class BaseMonitor:
def __init__(self):
self.hooks = []
self.monitore... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/functional/loss.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:55.214418 | import torch
from torch._C import Value
import torch.nn as nn
from snntorch import spikegen
###############################################################
# When adding new loss/reg functions, update criterion_dict #
# and reg_dict in backprop.py #
###################################... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/functional/acc.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:55.227123 | import torch
import numpy as np
def accuracy_rate(spk_out, targets, population_code=False, num_classes=False):
"""Use spike count to measure accuracy.
:param spk_out: Output spikes of shape \
[num_steps x batch_size x num_outputs]
:type spk_out: torch.Tensor
:param targets: Target tensor (withou... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/export_nir.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:55.228412 | #from typing import Optional
from typing import Optional, Tuple, Union
import torch
import os
import sys
import nir
import numpy as np
import nirtorch
import snntorch as snn
def _extract_snntorch_module(module: torch.nn.Module) -> Optional[nir.NIRNode]:
"""Convert a single snnTorch module to the equivalent objec... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/backprop.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:55.230077 | import snntorch as snn
import torch
from snntorch import utils
from snntorch import functional as SF
from warnings import warn
warn(
f"The module {__name__} will be deprecated in "
f" a future release. Writing out your own training "
f"loop will lead to substantially faster performance.",
DeprecationWa... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/functional/quant.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:55.268991 | import torch
import math
class StateQuant(torch.autograd.Function):
"""Wrapper function for state_quant"""
@staticmethod
def forward(ctx, input_, levels):
device = input_.device
levels = levels.to(device)
size = input_.size()
input_ = input_.flatten()
... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/spikevision/neuromorphic_dataset.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:57.359054 | import os
import torch
import torch.utils.data as data
from ._transforms import Compose
from tqdm import tqdm
import tarfile
import zipfile
import gzip
import hashlib
# Adapted from https://github.com/nmi-lab/torchneuromorphic
# by Emre Neftci and Clemens Schaefer
# DEFAULT_ROOT = "data/"
def download_url(url, roo... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/import_nir.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:57.466847 | import numpy as np
import nir
import nirtorch
import torch
import snntorch as snn
def _create_rnn_subgraph(
graph: nir.NIRGraph, lif_nk: str, w_nk: str
) -> nir.NIRGraph:
"""Take a NIRGraph plus the node keys for a LIF and a W_rec, and return a new NIRGraph
which has the RNN subgraph replaced with a subgra... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/functional/stdp_learner.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:57.472481 | from typing import Callable, Union
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from snntorch.functional import probe
def stdp_linear_single_step(
fc: nn.Linear,
in_spike: torch.Tensor,
out_spike: torch.Tensor,
trace_pre: Union[float, torch.Tensor, N... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/spikevision/spikedata/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:45:58.048306 | from .nmnist import NMNIST
from .dvs_gesture import DVSGesture
from .shd import SHD
__all__ = ("NMNIST", "DVSGesture", "SHD")
|
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/functional/reg.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:00.373484 | import torch
class l1_rate_sparsity:
"""L1 regularization using total spike count as the penalty term.
Lambda is a scalar factor for regularization."""
def __init__(self, Lambda=1e-5):
self.Lambda = Lambda
self.__name__ = "l1_rate_sparsity"
def __call__(self, spk_out):
return... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/spikeplot.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:00.825388 | import torch
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
import numpy as np
import math
from typing import Dict, List
from collections import defaultdict
from matplotlib.figure import Figure
from matplotlib.artist import Artist
from matplotlib.animation import ArtistAni... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/spikegen.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:00.827035 | import torch
dtype = torch.float
def rate(
data,
num_steps=False,
gain=1,
offset=0,
first_spike_time=0,
time_var_input=False,
):
"""Spike rate encoding of input data. Convert tensor into Poisson spike
trains using the features as the mean of a
binomial distribution. If `num_steps... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/spikevision/_utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:00.830241 | import struct
import numpy as np
import os
# Adapted from https://github.com/nmi-lab/torchneuromorphic by
# Eire Neftci
# and Clemens Schaefer
# Which was adapted from
# https://github.com/gorchard/event-Python/blob/master/eventvision.py
# by Garrick Orchard
def load_ATIS_bin(filename):
"""Reads in the TD events... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/spikevision/_transforms.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:00.847741 | # Adapted from https://github.com/nmi-lab/torchneuromorphic
# by Emre Neftci and Clemens Schaefer
import numpy as np
import pandas as pd
import torch
import bisect
from torchvision.transforms import Compose, Normalize, Lambda
def find_first(a, tgt):
return bisect.bisect_left(a, tgt)
def shuffle_along_axis(a, ... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/spikevision/events_timeslices.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:00.935193 | from __future__ import print_function
import bisect
import numpy as np
# Adapted from https://github.com/nmi-lab/torchneuromorphic
# by Emre Neftci and Clemens Schaefer
def expand_targets(targets, T=500, burnin=0):
y = np.tile(targets.copy(), [T, 1, 1])
y[:burnin] = 0
return y
def one_hot(mbt, num_clas... |
jeshraghian/snntorch | https://github.com/jeshraghian/snntorch | null | null | null | null | 1,955 | null | null | mit | null | null | null | null | null | null | null | snntorch/spikevision/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:00.972486 | from warnings import warn
warn(
f"The module {__name__} is deprecated. For loading "
f"neuromorphic datasets, we recommend using the Tonic project: "
f"https://github.com/neuromorphs/tonic",
DeprecationWarning,
stacklevel=2,
)
|
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:03.087169 | """
OpenAI/Codex CLI 自动注册系统
"""
from .config import get_settings, EmailServiceType
from .database import get_db, Account, EmailService, RegistrationTask
from .core import RegistrationEngine, RegistrationResult
from .services import EmailServiceFactory, BaseEmailService
__version__ = "2.0.0"
__author__ = "Yasal"
__al... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/config/settings.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:03.106428 | """
配置管理 - 完全基于数据库存储
所有配置都从数据库读取,不再使用环境变量或 .env 文件
"""
import os
from typing import Optional, Dict, Any, Type, List
from enum import Enum
from pydantic import BaseModel, field_validator
from pydantic.types import SecretStr
from dataclasses import dataclass
from .constants import APP_NAME, APP_VERSION, DEFAULT_WEBUI_H... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/config/constants.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:03.108265 | """
常量定义
"""
import random
from datetime import datetime
from enum import Enum
from typing import Dict, List, Tuple
# ============================================================================
# 枚举类型
# ============================================================================
class AccountStatus(str, Enum):
... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/core/openai/codex_auth.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:03.167097 | """
Codex Auth 登录引擎
复用仓库里已经验证通过的登录状态流,为已有账号生成 Codex CLI 可用的 auth.json。
"""
import time
from dataclasses import dataclass, field
from typing import Any, Callable, Dict, List, Optional
from core.openai.oauth import OAuthManager
from core.register import PhaseContext, RegistrationEngine
from config.constants import (
... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/core/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:03.197154 | """
核心功能模块
"""
from .openai.oauth import OAuthManager, OAuthStart, generate_oauth_url, submit_callback_url
from .http_client import (
OpenAIHTTPClient,
HTTPClient,
HTTPClientError,
RequestConfig,
create_http_client,
create_openai_client,
)
from .register import RegistrationEngine, RegistrationR... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/core/dynamic_proxy.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:03.198448 | """
动态代理获取模块
支持通过外部 API 获取动态代理 URL
"""
import logging
import re
from typing import Optional
logger = logging.getLogger(__name__)
def fetch_dynamic_proxy(api_url: str, api_key: str = "", api_key_header: str = "X-API-Key", result_field: str = "") -> Optional[str]:
"""
从代理 API 获取代理 URL
Args:
api_u... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/core/http_client.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:03.200009 | """
HTTP 客户端封装
基于 curl_cffi 的 HTTP 请求封装,支持代理和错误处理
"""
import time
import json
from typing import Optional, Dict, Any, Union, Tuple
from dataclasses import dataclass
import logging
from curl_cffi import requests as cffi_requests
from curl_cffi.requests import Session, Response
from ..config.constants import ERROR_MES... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/config/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:03.260619 | """
配置模块
"""
from .settings import (
Settings,
get_settings,
update_settings,
get_database_url,
init_default_settings,
get_setting_definition,
get_all_setting_definitions,
SETTING_DEFINITIONS,
SettingCategory,
SettingDefinition,
)
from .constants import (
AccountStatus,
... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/core/login.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:03.265600 | """
登录流程引擎
从 register.py 中拆分的登录专属方法
"""
import urllib.parse
import base64
import json as json_module
import time
from datetime import datetime
from typing import Optional, Dict, Any
from .register import RegistrationEngine, RegistrationResult
from ..config.constants import OPENAI_API_ENDPOINTS
class LoginEngine(Reg... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/core/openai/token_refresh.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:03.691746 | """
Token 刷新模块
支持 Session Token 和 OAuth Refresh Token 两种刷新方式
"""
import logging
import json
import time
from typing import Optional, Dict, Any, Tuple
from dataclasses import dataclass
from datetime import datetime, timedelta
from curl_cffi import requests as cffi_requests
from ...config.settings import get_settings
... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/core/openai/payment.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:03.717412 | """
支付核心逻辑 — 生成 Plus/Team 支付链接、无痕打开浏览器、检测订阅状态
"""
import logging
import subprocess
import sys
import uuid
from typing import Optional
from curl_cffi import requests as cffi_requests
from ...database.models import Account
logger = logging.getLogger(__name__)
PAYMENT_CHECKOUT_URL = "https://chatgpt.com/backend-api/p... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/core/openai/oauth.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:03.728748 | """
OpenAI OAuth 授权模块
从 main.py 中提取的 OAuth 相关函数
"""
import base64
import hashlib
import json
import secrets
import time
import urllib.parse
from dataclasses import dataclass
from typing import Any, Dict, Optional
from curl_cffi import requests as cffi_requests
from ...config.constants import (
OAUTH_CLIENT_ID,
... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/core/register.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:03.733605 | """
注册流程引擎
从 main.py 中提取并重构的注册流程
"""
import base64
import json
import logging
import math
import re
import secrets
import time
from dataclasses import dataclass, field
from datetime import datetime
from typing import Optional, Dict, Any, Tuple, Callable
from curl_cffi import requests as cffi_requests
from .http_clie... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/core/upload/newapi_upload.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:03.792067 | """
NEWAPI 上传功能 — 通过 PUT /api/channel/ 添加渠道
"""
import json
import logging
from datetime import datetime
from typing import List, Optional, Tuple
from curl_cffi import requests as cffi_requests
from ...database.models import Account
from ...database.session import get_db
logger = logging.getLogger(__name__)
DEFAUL... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/core/upload/cpa_upload.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:03.793307 | """
CPA (Codex Protocol API) 上传功能
"""
import json
import logging
from typing import List, Dict, Any, Tuple, Optional
from datetime import datetime
from urllib.parse import quote
from curl_cffi import requests as cffi_requests
from curl_cffi import CurlMime
from ...database.session import get_db
from ...database.mode... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/core/upload/team_manager_upload.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:03.817942 | """
Team Manager 上传功能
参照 CPA 上传模式,直连不走代理
"""
import logging
from typing import List, Tuple
from curl_cffi import requests as cffi_requests
from ...database.models import Account
from ...database.session import get_db
logger = logging.getLogger(__name__)
def upload_to_team_manager(
account: Account,
api_ur... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/core/upload/sub2api_upload.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:03.829428 | """
Sub2API 账号上传功能
将账号以 sub2api-data 格式批量导入到 Sub2API 平台
"""
import json
import logging
from datetime import datetime, timezone
from typing import List, Tuple, Optional
from curl_cffi import requests as cffi_requests
from ...database.session import get_db
from ...database.models import Account
logger = logging.getLo... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/core/utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:03.903950 | """
通用工具函数
"""
import os
import sys
import json
import time
import random
import string
import secrets
import hashlib
import logging
import base64
import re
import uuid
from datetime import datetime, timedelta
from typing import Any, Dict, List, Optional, Union, Callable
from pathlib import Path
from ..config.constan... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/database/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:04.281508 | """
数据库模块
"""
from .models import Base, Account, EmailService, RegistrationTask, Setting
from .session import get_db, init_database, get_session_manager, DatabaseSessionManager
from . import crud
__all__ = [
'Base',
'Account',
'EmailService',
'RegistrationTask',
'Setting',
'get_db',
'init_... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/database/crud.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:04.308211 | """
数据库 CRUD 操作
"""
from typing import List, Optional, Dict, Any, Union, Iterable, Set
from datetime import datetime, timedelta
from sqlalchemy.orm import Session
from sqlalchemy.orm.attributes import flag_modified
from sqlalchemy import and_, or_, desc, asc, func
from .models import Account, EmailService, Registrati... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/database/models.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:04.354271 | """
SQLAlchemy ORM 模型定义
"""
from datetime import datetime
from typing import Optional, Dict, Any
import json
from sqlalchemy import Column, Integer, String, Text, Boolean, DateTime, ForeignKey
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.types import TypeDecorator
from sqlalchemy.orm import ... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/services/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:04.372697 | """
邮箱服务模块
"""
from .base import (
BaseEmailService,
EmailServiceError,
EmailServiceStatus,
EmailServiceFactory,
create_email_service,
EmailServiceType
)
from .tempmail import TempmailService
from .outlook import OutlookService
from .moe_mail import MeoMailEmailService
from .temp_mail import Te... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/services/base.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:04.373945 | """
邮箱服务抽象基类
所有邮箱服务实现的基类
"""
import abc
import logging
import re
import time
from dataclasses import dataclass
from datetime import datetime
from typing import Optional, Dict, Any, List, Callable
from enum import Enum
from ..config.constants import EmailServiceType, OPENAI_EMAIL_SENDERS, OTP_CODE_PATTERN, OTP_CODE_SE... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/database/init_db.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:04.422028 | """
数据库初始化和初始化数据
"""
from .session import init_database
from .models import Base
def initialize_database(database_url: str = None):
"""
初始化数据库
创建所有表并设置默认配置
"""
# 初始化数据库连接和表
db_manager = init_database(database_url)
# 创建表
db_manager.create_tables()
# 初始化默认设置(从 settings 模块导入以避免循环导入... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/services/freemail.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:04.459078 | """
Freemail 邮箱服务实现
基于自部署 Cloudflare Worker 临时邮箱服务 (https://github.com/idinging/freemail)
"""
import re
import time
import logging
from typing import Optional, Dict, Any, List
from .base import BaseEmailService, EmailServiceError, EmailServiceType, OTPNoOpenAISenderEmailServiceError, RateLimitedEmailServiceError, get... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/services/duck_mail.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:04.466012 | """
DuckMail 邮箱服务实现
兼容 DuckMail 的 accounts/token/messages 接口模型
"""
import logging
import random
import re
import string
import time
from datetime import datetime, timezone
from html import unescape
from typing import Any, Dict, List, Optional
from .base import BaseEmailService, EmailServiceError, EmailServiceType, OT... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/database/session.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:04.469218 | """
数据库会话管理
"""
from contextlib import contextmanager
from typing import Generator
from sqlalchemy import create_engine, text
from sqlalchemy.orm import sessionmaker, Session
from sqlalchemy.exc import SQLAlchemyError
import os
import logging
from .models import Base
logger = logging.getLogger(__name__)
def _build... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/services/cloud_mail.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:04.524852 | """
Cloud Mail 邮箱服务实现
基于 maillab/cloud-mail 的 public API
"""
import logging
import random
import string
import time
from datetime import datetime, timezone
from typing import Any, Dict, List, Optional
from .base import BaseEmailService, EmailServiceError, EmailServiceType, OTPNoOpenAISenderEmailServiceError, RateLimi... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/services/imap_mail.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:04.872478 | """
IMAP 邮箱服务
支持 Gmail / QQ / 163 / Yahoo / Outlook 等标准 IMAP 协议邮件服务商。
仅用于接收验证码,强制直连(imaplib 不支持代理)。
"""
import imaplib
import email as py_email
import re
import time
import logging
from email.header import decode_header
from typing import Any, Dict, Optional
from .base import BaseEmailService, OTPNoOpenAISenderEmailS... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/services/moe_mail.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:04.893953 | """
自定义域名邮箱服务实现
基于 email.md 中的 REST API 接口
"""
import re
import time
import json
import logging
from typing import Optional, Dict, Any, List
from urllib.parse import urljoin
from .base import BaseEmailService, EmailServiceError, EmailServiceType, OTPNoOpenAISenderEmailServiceError, RateLimitedEmailServiceError, get_e... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/services/outlook/account.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:04.967136 | """
Outlook 账户数据类
"""
from dataclasses import dataclass
from typing import Dict, Any, Optional
@dataclass
class OutlookAccount:
"""Outlook 账户信息"""
email: str
password: str = ""
client_id: str = ""
refresh_token: str = ""
@classmethod
def from_config(cls, config: Dict[str, Any]) -> "Outlo... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/services/outlook/base.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:04.985560 | """
Outlook 服务基础定义
包含枚举类型和数据类
"""
from dataclasses import dataclass, field
from datetime import datetime
from enum import Enum
from typing import Optional, Dict, Any, List
class ProviderType(str, Enum):
"""Outlook 提供者类型"""
IMAP_OLD = "imap_old" # 旧版 IMAP (outlook.office365.com)
IMAP_NEW = "imap_new"... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/services/outlook/email_parser.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:05.024905 | """
邮件解析和验证码提取
"""
import logging
import re
from typing import Optional, List
from ...config.constants import (
OTP_CODE_SIMPLE_PATTERN,
OTP_CODE_SEMANTIC_PATTERN,
OPENAI_EMAIL_SENDERS,
OPENAI_VERIFICATION_KEYWORDS,
)
from .base import EmailMessage
logger = logging.getLogger(__name__)
class EmailP... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/services/outlook/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:05.050762 | """
Outlook 邮箱服务模块
支持多种 IMAP/API 连接方式,自动故障切换
"""
from .service import OutlookService
__all__ = ['OutlookService']
|
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/services/outlook/health_checker.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:05.052176 | """
健康检查和故障切换管理
"""
import logging
import threading
from datetime import datetime
from typing import Dict, List, Optional, Any, Tuple
from .base import ProviderType, ProviderHealth, ProviderStatus
logger = logging.getLogger(__name__)
class HealthChecker:
"""
健康检查管理器
跟踪各提供者的健康状态,管理故障切换
"""
def... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/services/outlook/providers/base.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:05.078583 | """
Outlook 提供者抽象基类
"""
import abc
import logging
from dataclasses import dataclass
from typing import Dict, Any, List, Optional
from ..base import ProviderType, EmailMessage, ProviderHealth, ProviderStatus
from ..account import OutlookAccount
logger = logging.getLogger(__name__)
@dataclass
class ProviderConfig:
... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/services/outlook/providers/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:05.080145 | """
Outlook 提供者模块
"""
from .base import OutlookProvider, ProviderConfig
from .imap_old import IMAPOldProvider
from .imap_new import IMAPNewProvider
from .graph_api import GraphAPIProvider
__all__ = [
'OutlookProvider',
'ProviderConfig',
'IMAPOldProvider',
'IMAPNewProvider',
'GraphAPIProvider',
]
... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/services/outlook/providers/graph_api.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:05.146287 | """
Graph API 提供者
使用 Microsoft Graph REST API
"""
import json
import logging
from typing import List, Optional
from datetime import datetime
from curl_cffi import requests as _requests
from ..base import ProviderType, EmailMessage
from ..account import OutlookAccount
from ..token_manager import TokenManager
from .ba... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/services/outlook/providers/imap_old.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:05.548597 | """
旧版 IMAP 提供者
使用 outlook.office365.com 服务器和 login.live.com Token 端点
"""
import email
import imaplib
import logging
from email.header import decode_header
from email.utils import parsedate_to_datetime
from typing import List, Optional
from ..base import ProviderType, EmailMessage
from ..account import OutlookAccount... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/services/outlook/providers/imap_new.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:05.553372 | """
新版 IMAP 提供者
使用 outlook.live.com 服务器和 login.microsoftonline.com/consumers Token 端点
"""
import email
import imaplib
import logging
from email.header import decode_header
from email.utils import parsedate_to_datetime
from typing import List, Optional
from ..base import ProviderType, EmailMessage
from ..account impor... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/services/outlook/service.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:05.578663 | """
Outlook 邮箱服务主类
支持多种 IMAP/API 连接方式,自动故障切换
"""
import logging
import threading
import time
from typing import Optional, Dict, Any, List
from ..base import BaseEmailService, EmailServiceError, OTPNoOpenAISenderEmailServiceError, get_email_code_settings
from ...config.constants import EmailServiceType as ServiceType
... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/services/outlook/token_manager.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:05.596749 | """
Token 管理器
支持多个 Microsoft Token 端点,自动选择合适的端点
"""
import json
import logging
import threading
import time
from typing import Dict, Optional, Any
from curl_cffi import requests as _requests
from .base import ProviderType, TokenEndpoint, TokenInfo
from .account import OutlookAccount
logger = logging.getLogger(__na... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/services/temp_mail.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:05.630578 | """
Temp-Mail 邮箱服务实现
基于自部署 Cloudflare Worker 临时邮箱服务
接口文档参见 plan/temp-mail.md
"""
import re
import time
import json
import logging
from email import message_from_string
from email.header import decode_header, make_header
from email.message import Message
from email.policy import default as email_policy
from html import... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/web/app.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:05.647854 | """
FastAPI 应用主文件
轻量级 Web UI,支持注册、账号管理、设置
"""
import logging
import sys
import secrets
import hmac
import hashlib
from typing import Optional
from pathlib import Path
from fastapi import FastAPI, Request, Form
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
from fastapi.midd... |
cnlimiter/codex-manager | https://github.com/cnlimiter/codex-manager | null | null | null | null | 1,954 | null | null | mit | null | null | null | null | null | null | null | src/services/tempmail.py | null | null | null | null | null | null | Python | 2026-05-04T01:46:05.660845 | """
Tempmail.lol 邮箱服务实现
"""
import re
import time
import logging
from typing import Callable, Optional, Dict, Any, List
from datetime import datetime, timezone
from .base import BaseEmailService, EmailServiceError, EmailServiceType, OTPNoOpenAISenderEmailServiceError, get_email_code_settings
from ..core.http_client i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.