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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
python-poetry/poetry | https://github.com/python-poetry/poetry | null | null | null | null | 34,276 | null | null | mit | null | null | null | null | null | null | null | src/poetry/console/commands/env/use.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:25.664454 | from __future__ import annotations
from typing import TYPE_CHECKING
from typing import ClassVar
from cleo.helpers import argument
from poetry.console.commands.command import Command
if TYPE_CHECKING:
from cleo.io.inputs.argument import Argument
class EnvUseCommand(Command):
name = "env use"
descripti... |
python-poetry/poetry | https://github.com/python-poetry/poetry | null | null | null | null | 34,276 | null | null | mit | null | null | null | null | null | null | null | src/poetry/console/commands/env_command.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:25.776739 | from __future__ import annotations
from typing import TYPE_CHECKING
from poetry.console.commands.command import Command
if TYPE_CHECKING:
from poetry.utils.env import Env
class EnvCommand(Command):
def __init__(self) -> None:
# Set in poetry.console.application.Application.configure_env
se... |
python-poetry/poetry | https://github.com/python-poetry/poetry | null | null | null | null | 34,276 | null | null | mit | null | null | null | null | null | null | null | src/poetry/console/commands/group_command.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:25.871656 | from __future__ import annotations
from collections import defaultdict
from typing import TYPE_CHECKING
from cleo.helpers import option
from packaging.utils import NormalizedName
from packaging.utils import canonicalize_name
from poetry.console.commands.command import Command
from poetry.console.exceptions import Gr... |
python-poetry/poetry | https://github.com/python-poetry/poetry | null | null | null | null | 34,276 | null | null | mit | null | null | null | null | null | null | null | src/poetry/console/commands/env/activate.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:25.907919 | from __future__ import annotations
import shlex
from typing import TYPE_CHECKING
import shellingham
from poetry.console.commands.env_command import EnvCommand
from poetry.utils._compat import WINDOWS
if TYPE_CHECKING:
from pathlib import Path
from poetry.utils.env import Env
class ShellNotSupportedErro... |
python-poetry/poetry | https://github.com/python-poetry/poetry | null | null | null | null | 34,276 | null | null | mit | null | null | null | null | null | null | null | src/poetry/console/commands/init.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:25.909283 | from __future__ import annotations
import re
from collections.abc import Mapping
from contextlib import suppress
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any
from typing import ClassVar
from cleo.helpers import option
from packaging.utils import canonicalize_name
from tomlkit impo... |
python-poetry/poetry | https://github.com/python-poetry/poetry | null | null | null | null | 34,276 | null | null | mit | null | null | null | null | null | null | null | src/poetry/console/application.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:26.136139 | from __future__ import annotations
import argparse
import logging
from contextlib import suppress
from importlib import import_module
from pathlib import Path
from typing import TYPE_CHECKING
from typing import cast
from cleo._utils import find_similar_names
from cleo.application import Application as BaseApplicatio... |
python-poetry/poetry | https://github.com/python-poetry/poetry | null | null | null | null | 34,276 | null | null | mit | null | null | null | null | null | null | null | src/poetry/config/source.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:26.162788 | from __future__ import annotations
import dataclasses
from typing import TYPE_CHECKING
from poetry.repositories.repository_pool import Priority
if TYPE_CHECKING:
from tomlkit.items import Table
@dataclasses.dataclass(order=True, eq=True)
class Source:
name: str
url: str = ""
priority: Priority = ... |
python-poetry/poetry | https://github.com/python-poetry/poetry | null | null | null | null | 34,276 | null | null | mit | null | null | null | null | null | null | null | src/poetry/console/commands/install.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:26.241286 | from __future__ import annotations
from typing import TYPE_CHECKING
from typing import ClassVar
from cleo.helpers import option
from poetry.console.commands.installer_command import InstallerCommand
from poetry.plugins.plugin_manager import PluginManager
if TYPE_CHECKING:
from cleo.io.inputs.option import Opti... |
python-poetry/poetry | https://github.com/python-poetry/poetry | null | null | null | null | 34,276 | null | null | mit | null | null | null | null | null | null | null | src/poetry/console/commands/installer_command.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:26.382628 | from __future__ import annotations
from typing import TYPE_CHECKING
from poetry.console.commands.env_command import EnvCommand
from poetry.console.commands.group_command import GroupCommand
from poetry.utils.password_manager import PoetryKeyring
if TYPE_CHECKING:
from cleo.io.io import IO
from poetry.insta... |
python-poetry/poetry | https://github.com/python-poetry/poetry | null | null | null | null | 34,276 | null | null | mit | null | null | null | null | null | null | null | src/poetry/console/commands/lock.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:26.466329 | from __future__ import annotations
from typing import TYPE_CHECKING
from typing import ClassVar
from cleo.helpers import option
from poetry.console.commands.installer_command import InstallerCommand
if TYPE_CHECKING:
from cleo.io.inputs.option import Option
class LockCommand(InstallerCommand):
name = "lo... |
python-poetry/poetry | https://github.com/python-poetry/poetry | null | null | null | null | 34,276 | null | null | mit | null | null | null | null | null | null | null | src/poetry/console/commands/publish.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:26.486954 | from __future__ import annotations
from pathlib import Path
from typing import TYPE_CHECKING
from typing import ClassVar
from cleo.helpers import option
from poetry.console.commands.command import Command
if TYPE_CHECKING:
from cleo.io.inputs.option import Option
class PublishCommand(Command):
name = "pu... |
python-poetry/poetry | https://github.com/python-poetry/poetry | null | null | null | null | 34,276 | null | null | mit | null | null | null | null | null | null | null | src/poetry/console/commands/new.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:26.544907 | from __future__ import annotations
from typing import TYPE_CHECKING
from typing import ClassVar
from cleo.helpers import argument
from cleo.helpers import option
from poetry.console.commands.init import InitCommand
if TYPE_CHECKING:
from cleo.io.inputs.argument import Argument
from cleo.io.inputs.option im... |
python-poetry/poetry | https://github.com/python-poetry/poetry | null | null | null | null | 34,276 | null | null | mit | null | null | null | null | null | null | null | src/poetry/console/commands/python/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:26.578993 | from __future__ import annotations
def get_request_title(request: str, implementation: str, free_threaded: bool) -> str:
add_info = implementation
if free_threaded:
add_info += ", free-threaded"
return f"<c1>{request}</> (<b>{add_info}</>)"
|
python-poetry/poetry | https://github.com/python-poetry/poetry | null | null | null | null | 34,276 | null | null | mit | null | null | null | null | null | null | null | src/poetry/console/commands/python/remove.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:26.826391 | from __future__ import annotations
import shutil
from typing import TYPE_CHECKING
from typing import ClassVar
from cleo.helpers import argument
from cleo.helpers import option
from poetry.core.constraints.version.version import Version
from poetry.core.version.exceptions import InvalidVersionError
from poetry.conso... |
python-poetry/poetry | https://github.com/python-poetry/poetry | null | null | null | null | 34,276 | null | null | mit | null | null | null | null | null | null | null | src/poetry/console/commands/python/list.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:26.870605 | from __future__ import annotations
from typing import TYPE_CHECKING
from typing import ClassVar
from cleo.helpers import argument
from cleo.helpers import option
from poetry.core.constraints.version import parse_constraint
from poetry.core.version.exceptions import InvalidVersionError
from poetry.config.config impor... |
python-poetry/poetry | https://github.com/python-poetry/poetry | null | null | null | null | 34,276 | null | null | mit | null | null | null | null | null | null | null | src/poetry/console/commands/python/install.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:26.880323 | from __future__ import annotations
from typing import TYPE_CHECKING
from typing import ClassVar
from cleo.helpers import argument
from cleo.helpers import option
from poetry.core.constraints.version.version import Version
from poetry.core.version.exceptions import InvalidVersionError
from poetry.console.commands.com... |
python-poetry/poetry | https://github.com/python-poetry/poetry | null | null | null | null | 34,276 | null | null | mit | null | null | null | null | null | null | null | src/poetry/console/commands/remove.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:27.033207 | from __future__ import annotations
from typing import TYPE_CHECKING
from typing import Any
from typing import ClassVar
from cleo.helpers import argument
from cleo.helpers import option
from packaging.utils import canonicalize_name
from poetry.core.packages.dependency import Dependency
from poetry.core.packages.depend... |
python-poetry/poetry | https://github.com/python-poetry/poetry | null | null | null | null | 34,276 | null | null | mit | null | null | null | null | null | null | null | src/poetry/console/commands/search.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:27.127857 | from __future__ import annotations
from typing import TYPE_CHECKING
from typing import ClassVar
from cleo.helpers import argument
from poetry.console.commands.command import Command
if TYPE_CHECKING:
from cleo.io.inputs.argument import Argument
class SearchCommand(Command):
name = "search"
descriptio... |
python-poetry/poetry | https://github.com/python-poetry/poetry | null | null | null | null | 34,276 | null | null | mit | null | null | null | null | null | null | null | src/poetry/console/commands/run.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:27.188112 | from __future__ import annotations
from typing import TYPE_CHECKING
from typing import ClassVar
from cleo.helpers import argument
from poetry.console.commands.env_command import EnvCommand
from poetry.utils._compat import WINDOWS
if TYPE_CHECKING:
from cleo.io.inputs.argument import Argument
from poetry.co... |
python-poetry/poetry | https://github.com/python-poetry/poetry | null | null | null | null | 34,276 | null | null | mit | null | null | null | null | null | null | null | src/poetry/console/commands/self/add.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:27.229431 | from __future__ import annotations
from typing import TYPE_CHECKING
from typing import ClassVar
from poetry.core.constraints.version import Version
from poetry.__version__ import __version__
from poetry.console.commands.add import AddCommand
from poetry.console.commands.self.self_command import SelfCommand
if TYPE... |
python-poetry/poetry | https://github.com/python-poetry/poetry | null | null | null | null | 34,276 | null | null | mit | null | null | null | null | null | null | null | src/poetry/console/commands/self/install.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:27.425394 | from __future__ import annotations
from typing import TYPE_CHECKING
from typing import ClassVar
from packaging.utils import NormalizedName
from packaging.utils import canonicalize_name
from poetry.core.packages.dependency_group import MAIN_GROUP
from poetry.console.commands.install import InstallCommand
from poetry.... |
python-poetry/poetry | https://github.com/python-poetry/poetry | null | null | null | null | 34,276 | null | null | mit | null | null | null | null | null | null | null | src/poetry/console/commands/self/lock.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:27.611585 | from __future__ import annotations
from poetry.console.commands.lock import LockCommand
from poetry.console.commands.self.self_command import SelfCommand
class SelfLockCommand(SelfCommand, LockCommand):
name = "self lock"
description = "Lock the Poetry installation's system requirements."
help = f"""\
Th... |
python-poetry/poetry | https://github.com/python-poetry/poetry | null | null | null | null | 34,276 | null | null | mit | null | null | null | null | null | null | null | src/poetry/console/commands/cache/list.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:28.225168 | from __future__ import annotations
from poetry.config.config import Config
from poetry.console.commands.command import Command
class CacheListCommand(Command):
name = "cache list"
description = "List Poetry's caches."
def handle(self) -> int:
config = Config.create()
if config.repository... |
python-poetry/poetry | https://github.com/python-poetry/poetry | null | null | null | null | 34,276 | null | null | mit | null | null | null | null | null | null | null | src/poetry/console/commands/env/remove.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:30.713833 | from __future__ import annotations
from typing import TYPE_CHECKING
from typing import ClassVar
from cleo.helpers import argument
from cleo.helpers import option
from poetry.console.commands.command import Command
from poetry.utils._compat import is_relative_to
if TYPE_CHECKING:
from cleo.io.inputs.argument im... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | agency/cdn_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:33.089148 | # encoding=utf8
import datetime
import operator
import os
import requests
from config import urlConf
import threading
from config.urlConf import urls
from myUrllib.httpUtils import HTTPClient
cdn_list = []
class CDNProxy(threading.Thread):
def __init__(self, cdns):
super().__init__()
self.cdns =... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | config/AutoSynchroTime.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:33.111316 | # coding=utf-8
import os
import platform
import ntplib
import datetime
def autoSynchroTime():
"""
同步北京时间,执行时候,请务必用sudo,sudo,sudo 执行,否则会报权限错误,windows打开ide或者cmd请用管理员身份
:return:
"""
c = ntplib.NTPClient()
hosts = ['ntp1.aliyun.com', 'ntp2.aliyun.com', 'ntp3.aliyun.com', 'ntp4.aliyun.com', 'cn.p... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | agency/agency_tools.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:33.116935 | # encoding=utf8
import os
import random
import socket
import time
import requests
from bs4 import BeautifulSoup
class proxy:
def __init__(self):
self.proxy_list = []
self.proxy_filter_list = []
def get_proxy(self):
"""
获取未加工代理列表
:return:
"""
User_Agen... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | TickerConfig.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:33.122517 | # -*- coding=utf-8 -*-
# 关于软件使用配置说明,一定要看!!!
# ps: 如果是候补车票,需要通过人证一致性核验的用户及激活的“铁路畅行”会员可以提交候补需求,请您按照操作说明在铁路12306app.上完成人证核验
# 关于候补了之后是否还能继续捡漏的问题在此说明: 软件为全自动候补加捡漏,如果软件候补成功则会停止抢票,发出邮件通知,但是不会影响你继续捡漏,
# 如果这个时候捡漏捡到的话,也是可以付款成功的,也就是说,捡漏+候补,可以最大程度提升抢票成功率
# 刷票模式:1=刷票 2=候补+刷票
TICKET_TYPE = 1
# 出发日期(list) "2018-01-06", "2018-01-07... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | config/TicketEnmu.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:33.126182 | # coding=utf-8
from enum import Enum
class ticket(object):
QUERY_C = u"查询到有余票,尝试提交订单"
QUERY_IN_BLACK_LIST = u"该车次{} 正在被关小黑屋,跳过此车次"
SUCCESS_CODE = 000000
FAIL_CODE = 999999
AUTO_SUBMIT_ORDER_REQUEST_C = u"提交订单成功"
AUTO_SUBMIT_ORDER_REQUEST_F = u"提交订单失败,重新刷票中"
AUTO_SUBMIT_NEED_CODE = u"需要验证码... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | UnitTest/TestAll.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:33.138478 | # coding=utf-8
import base64
import threading
import unittest
from collections import OrderedDict
import requests
import TickerConfig
from agency.agency_tools import proxy
from config.emailConf import sendEmail
from config.serverchanConf import sendServerChan
from inter.LiftTicketInit import liftTicketInit
def _set... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | config/emailConf.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:33.900446 | # -*- coding: utf8 -*-
import socket
__author__ = 'MR.wen'
import TickerConfig
from email.header import Header
from email.mime.text import MIMEText
import smtplib
def sendEmail(msg):
"""
邮件通知
:param str: email content
:return:
"""
try:
if TickerConfig.EMAIL_CONF["IS_MAIL"]:
... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | config/configCommon.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:33.901099 | # -*- coding: utf-8 -*-
import datetime
import os
import random
import sys
import time
from myException.ticketConfigException import ticketConfigException
rushRefreshMinTimeIntval = 2000
rushRefreshMaxTimeIntval = 3600000
rushRefreshTimeIntval = 100
# 最早运行时间
maxRunTime = 6
# 程序停止时间
maxRunStopTime = 23
# 可售天数
maxDate ... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | config/getCookie.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:33.903192 | import json
import random
import re
import time
import os
import TickerConfig
from config.urlConf import urls
def getDrvicesID(session):
"""
:return:
"""
print("cookie获取中")
if TickerConfig.COOKIE_TYPE is 1:
from selenium import webdriver
cookies = []
# 解决放镜像里 DevToolsActive... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | init/login.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:34.068932 | # -*- coding=utf-8 -*-
import copy
import time
from collections import OrderedDict
from time import sleep
import TickerConfig
from inter.GetPassCodeNewOrderAndLogin import getPassCodeNewOrderAndLogin1
from inter.GetRandCode import getRandCode
from inter.LoginAysnSuggest import loginAysnSuggest
from inter.LoginConf impo... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | init/select_ticket_info.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:34.070924 | # -*- coding=utf-8 -*-
import datetime
import random
import os
import socket
import sys
import threading
import time
import TickerConfig
import wrapcache
from agency.cdn_utils import CDNProxy, open_cdn_file
from config import urlConf, configCommon
from config.TicketEnmu import ticket
from config.configCommon import sea... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | config/serverchanConf.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:34.078393 | # -*- coding: utf8 -*-
import TickerConfig
from config.urlConf import urls
from myUrllib.httpUtils import HTTPClient
PUSH_SERVER_CHAN_PATH = "https://sc.ftqq.com"
def sendServerChan(msg):
"""
pushBear微信通知
:param str: 通知内容 content
:return:
"""
if (
TickerConfig.SERVER_CHAN_CONF["is_ser... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | config/urlConf.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:34.096831 | # coding=utf-8
import random
import TickerConfig
import time
urls = {
"auth": { # 登录接口
"req_url": "/passport/web/auth/uamtk",
"req_type": "post",
"Referer": "https://kyfw.12306.cn/otn/resources/login.html",
"Host": "kyfw.12306.cn",
"Content-Type": 1,
"re_try": 10,
... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | config/logger.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:34.144338 | #coding: utf-8
import os
import time
import logging
from config import configCommon
logger = None
loggerHandler = None
dateStr = '' #默认拥有日期后缀
suffix = '' #除了日期外的后缀
def setSuffix(s):
global suffix
suffix = s
def getTodayDateStr():
return time.strftime("%Y-%m-%d", time.localtime(configCommon.getNowTimestamp()))
... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | inter/ChechFace.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:34.764713 | import datetime
import urllib
from collections import OrderedDict
from config.urlConf import urls
import TickerConfig
from inter.GetSuccessRate import getSuccessRate
from myException.ticketConfigException import ticketConfigException
import wrapcache
class chechFace:
def __init__(self, selectObj, secretList, trai... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | inter/ConfirmHB.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:34.765390 | from collections import OrderedDict
from config.urlConf import urls
import TickerConfig
from inter.GetQueueCount import queryQueueByAfterNate
class confirmHB:
def __init__(self, secretList, session, tickerNo, jzdhDate):
"""
人脸识别
"""
self.secretList = secretList
self.session... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | inter/CheckOrderInfo.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:34.767078 | # coding=utf-8
from collections import OrderedDict
from inter.GetQueueCount import getQueueCount
from inter.GetRepeatSubmitToken import getRepeatSubmitToken
class checkOrderInfo:
def __init__(self, session, train_no, set_type, passengerTicketStrList, oldPassengerStr, station_dates, ticket_peoples):
self.... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | inter/CheckRandCodeAnsyn.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:34.768195 | # coding=utf-8
class checkRandCodeAnsyn:
def __init__(self, session, randCode, token):
self.session = session
self.randCode = randCode
self.token = token
def data_par(self):
"""
:return:
"""
data = {
"randCode": self.randCode,
"ran... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | inter/AutoSubmitOrderRequest.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:34.810793 | # coding=utf-8
import urllib
from collections import OrderedDict
from config.TicketEnmu import ticket
from inter.CheckRandCodeAnsyn import checkRandCodeAnsyn
from inter.GetQueueCountAsync import getQueueCountAsync
from inter.GetRandCode import getRandCode
import TickerConfig
class autoSubmitOrderRequest:
"""
... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | inter/ConfirmSingleForQueue.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:34.994114 | # coding=utf-8
import datetime
import time
from inter.CheckRandCodeAnsyn import checkRandCodeAnsyn
from inter.GetPassengerDTOs import getPassengerDTOs
from inter.GetRandCode import getRandCode
from inter.QueryOrderWaitTime import queryOrderWaitTime
class confirmSingleForQueue:
def __init__(self, session, ifShowP... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | config/pushbearConf.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:35.519122 | # -*- coding: utf8 -*-
import TickerConfig
from config.urlConf import urls
from myUrllib.httpUtils import HTTPClient
PUSH_BEAR_API_PATH = "https://pushbear.ftqq.com/sub"
def sendPushBear(msg):
"""
pushBear微信通知
:param str: 通知内容 content
:return:
"""
if TickerConfig.PUSHBEAR_CONF["is_pushbear"] ... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | inter/CheckUser.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:35.818940 | # coding=utf-8
import datetime
import random
import time
import wrapcache
from config import configCommon
from config.TicketEnmu import ticket
class checkUser:
def __init__(self, session):
self.session = session
def sendCheckUser(self):
"""
检查用户登录, 检查间隔为2分钟
:return:
""... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | inter/ConfirmSingleForQueueAsys.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:35.857324 | # coding=utf-8
import json
import urllib
from collections import OrderedDict
from inter.QueryOrderWaitTime import queryOrderWaitTime
class confirmSingleForQueueAsys:
"""
订单快读排队
"""
def __init__(self,
session,
passengerTicketStr,
oldPassengerStr,
... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | inter/GetRandCode.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:35.858564 | # coding=utf-8
from PIL import Image
from config.urlConf import urls
from myUrllib.httpUtils import HTTPClient
from verify.localVerifyCode import Verify
import TickerConfig
import os
if TickerConfig.AUTO_CODE_TYPE == 2:
v = Verify()
def getRandCode(is_auto_code, auto_code_type, result):
"""
识别验证码
:... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | inter/GetQueueCount.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:35.931236 | # coding=utf-8
import datetime
import sys
import time
from collections import OrderedDict
import wrapcache
import TickerConfig
from config.TicketEnmu import ticket
from config.emailConf import sendEmail
from config.serverchanConf import sendServerChan
from config.urlConf import urls
from inter.ConfirmSingleForQueue im... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | inter/GetPassCodeNewOrderAndLogin.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:35.932604 | # coding=utf-8
import base64
import copy
import random
def getPassCodeNewOrderAndLogin(session, imgType):
"""
下载验证码
:param session:
:param imgType: 下载验证码类型,login=登录验证码,其余为订单验证码
:return:
"""
if imgType == "login":
codeImgUrl = copy.deepcopy(session.urls["getCodeImg"])
codeIm... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | inter/GetRepeatSubmitToken.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:35.969918 | # coding=utf-8
import json
import re
class getRepeatSubmitToken:
def __init__(self, session):
self.session = session
def sendGetRepeatSubmitToken(self):
"""
获取提交车票请求token
:return: token
"""
initdc_url = self.session.urls["initdc_url"]
initdc_result = se... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | inter/GetSuccessRate.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:36.063276 | from collections import OrderedDict
from config.urlConf import urls
import TickerConfig
from inter.SubmitOrderRequest import submitOrderRequestByAfterNate
class getSuccessRate:
def __init__(self, session, secretList):
"""
获取成功信息
"""
self.secretList = secretList
self.sessi... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | inter/LiftTicketInit.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:36.175436 | # coding=utf-8
import re
class liftTicketInit:
def __init__(self, session):
self.session = session
def reqLiftTicketInit(self):
"""
请求抢票页面
:return:
"""
urls = self.session.urls["left_ticket_init"]
# 获取初始化的结果
result = self.session.httpClint.send(... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | inter/PassengerInitApi.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:36.780216 | import datetime
import wrapcache
import TickerConfig
from config.urlConf import urls
from inter.ConfirmHB import confirmHB
class passengerInitApi:
def __init__(self, session, secretList, tickerNo):
"""
获取候补信息
"""
self.secretList = secretList
self.tickerNo = tickerNo
... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | inter/Query.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:36.781360 | # coding=utf-8
import copy
import random
import wrapcache
from config import urlConf
from config.TicketEnmu import ticket
from myUrllib.httpUtils import HTTPClient
from config.configCommon import seat_conf_2
import TickerConfig
class query:
"""
查询接口
"""
def __init__(self, selectObj, from_station, to_... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | inter/LoginConf.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:36.782291 | # coding=utf-8
from config.urlConf import urls
def loginConf(session):
"""
判断登录是否需要验证码
:param session:
:return:
"""
loginConfUrl = urls.get("loginConf")
loginConfRsp = session.httpClint.send(urls=loginConfUrl, data={})
if loginConfRsp and loginConfRsp.get("data", {}).get("is_login_pass... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | inter/LoginAysnSuggest.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:36.845786 | # coding=utf-8
from config.urlConf import urls
def loginAysnSuggest(session, username, password):
"""
登录接口
ps: 不需要验证码
:return:
"""
loginAysnSuggestUrls = urls.get("loginAysnSuggest")
data = {
"loginUserDTO.user_name": username,
"userDTO.password": password
}
loginAy... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | inter/GetQueueCountAsync.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:36.883986 | import TickerConfig
[]# coding=utf-8
import datetime
import sys
import time
from collections import OrderedDict
import wrapcache
from inter.ConfirmSingleForQueueAsys import confirmSingleForQueueAsys
class getQueueCountAsync:
"""
排队
"""
def __init__(self,
session,
t... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | inter/GetPassengerDTOs.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:36.885415 | # coding=utf-8
import json
from config.TicketEnmu import ticket
from myException.PassengerUserException import PassengerUserException
import wrapcache
import TickerConfig
class getPassengerDTOs:
"""
获取乘客信息
:return:
"""
def __init__(self, selectObj, ticket_peoples=None, set_type=None, is_more_tick... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | inter/SubmitOrderRequest.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:36.976660 | # coding=utf-8
import datetime
import urllib
from collections import OrderedDict
import TickerConfig
from config.urlConf import urls
from inter.CheckOrderInfo import checkOrderInfo
from inter.ConfirmHB import confirmHB
from inter.PassengerInitApi import passengerInitApi
from myException.ticketIsExitsException import ti... |
testerSunshine/12306 | https://github.com/testerSunshine/12306 | null | null | null | null | 34,181 | null | null | mit | null | null | null | null | null | null | null | inter/QueryOrderWaitTime.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:38.288893 | # coding=utf-8
import copy
import time
from config.TicketEnmu import ticket
from config.emailConf import sendEmail
from config.serverchanConf import sendServerChan
from myException.ticketIsExitsException import ticketIsExitsException
from myException.ticketNumOutException import ticketNumOutException
class queryOrde... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | docs/scripts/generate_api_summary.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:44.566181 | from pathlib import Path
INDEX_NAME = {
"models": "Models",
"primitives": "Primitives",
"signatures": "Signatures",
"adapters": "Adapters",
"modules": "Modules",
"evaluation": "Evaluation",
"optimizers": "Optimizers",
"utils": "Utils",
"tools": "Tools",
"experimental": "Experime... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | .github/workflows/build_utils/test_version.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:44.567973 | import sys
from datetime import datetime
import requests
import semver
from packaging.version import Version as PyPIVersion
def get_latest_version(package_name, tag_version):
# Returns latest version, and T/F as to whether it needs to be incremented
response = requests.get(f"https://test.pypi.org/pypi/{pac... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/adapters/chat_adapter.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:44.596959 | import re
import textwrap
from typing import Any, NamedTuple
from pydantic.fields import FieldInfo
from dspy.adapters.base import Adapter
from dspy.adapters.utils import (
format_field_value,
get_annotation_name,
get_field_description_string,
parse_value,
translate_field_type,
)
from dspy.clients.... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:44.598037 | from dspy.predict import *
from dspy.primitives import *
from dspy.retrievers import *
from dspy.signatures import *
from dspy.teleprompt import *
from dspy.evaluate import Evaluate # isort: skip
from dspy.clients import * # isort: skip
from dspy.adapters import Adapter, ChatAdapter, JSONAdapter, XMLAdapter, TwoStep... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/adapters/baml_adapter.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:44.605811 | """
Custom adapter for improving structured outputs using the information from Pydantic models.
Based on the format used by BAML: https://github.com/BoundaryML/baml
"""
import inspect
import types
from typing import Any, Literal, Union, get_args, get_origin
from pydantic import BaseModel
from dspy.adapters.json_adap... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/adapters/json_adapter.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:44.607226 | import json
import logging
from typing import Any, get_origin
import json_repair
import pydantic
import regex
from pydantic.fields import FieldInfo
from dspy.adapters.chat_adapter import ChatAdapter, FieldInfoWithName
from dspy.adapters.types.tool import ToolCalls
from dspy.adapters.utils import (
format_field_va... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | docs/scripts/generate_api_docs.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:44.608381 | import importlib
import inspect
import pkgutil
from pathlib import Path
from typing import Any
import dspy
API_MAPPING = {
"models": [
dspy.LM,
dspy.Embedder,
],
"primitives": [
dspy.Audio,
dspy.Code,
dspy.Example,
dspy.Image,
dspy.History,
d... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/adapters/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:44.623988 | from dspy.adapters.base import Adapter
from dspy.adapters.chat_adapter import ChatAdapter
from dspy.adapters.json_adapter import JSONAdapter
from dspy.adapters.two_step_adapter import TwoStepAdapter
from dspy.adapters.types import Audio, Code, File, History, Image, Reasoning, Tool, ToolCalls, Type
from dspy.adapters.xm... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/__metadata__.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:44.625140 | #replace_package_name_marker
__name__="dspy"
#replace_package_version_marker
__version__="3.2.0"
__description__="DSPy"
__url__="https://github.com/stanfordnlp/dspy"
__author__="Omar Khattab"
__author_email__="okhattab@stanford.edu" |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/adapters/base.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:44.653459 | import logging
from typing import Any, get_origin
import json_repair
from dspy.adapters.types import History, Type
from dspy.adapters.types.base_type import split_message_content_for_custom_types
from dspy.adapters.types.reasoning import Reasoning
from dspy.adapters.types.tool import Tool, ToolCalls
from dspy.clients... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/adapters/two_step_adapter.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:45.233983 | from typing import Any
import json_repair
from dspy.adapters.base import Adapter
from dspy.adapters.chat_adapter import ChatAdapter
from dspy.adapters.types import ToolCalls
from dspy.adapters.utils import get_field_description_string
from dspy.clients.base_lm import BaseLM
from dspy.signatures.field import InputFiel... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/adapters/types/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:45.234511 | from dspy.adapters.types.audio import Audio
from dspy.adapters.types.base_type import Type
from dspy.adapters.types.code import Code
from dspy.adapters.types.file import File
from dspy.adapters.types.history import History
from dspy.adapters.types.image import Image
from dspy.adapters.types.reasoning import Reasoning
f... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/adapters/types/document.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:45.236075 | from typing import Any, Literal
import pydantic
from dspy.adapters.types.base_type import Type
from dspy.utils.annotation import experimental
@experimental(version="3.0.4")
class Document(Type):
"""A document type for providing content that can be cited by language models.
This type represents documents th... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/adapters/types/base_type.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:45.256878 | import json
import re
from typing import TYPE_CHECKING, Any, Optional, get_args, get_origin
import json_repair
import pydantic
from dspy.clients.base_lm import BaseLM
if TYPE_CHECKING:
from litellm import ModelResponseStream
from dspy.signatures.signature import Signature
CUSTOM_TYPE_START_IDENTIFIER = "<<... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/adapters/types/code.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:45.258788 | import re
from typing import Any, ClassVar
import pydantic
from pydantic import create_model
from dspy.adapters.types.base_type import Type
class Code(Type):
"""Code type in DSPy.
This type is useful for code generation and code analysis.
Example 1: dspy.Code as output type in code generation:
``... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/adapters/types/history.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:45.289196 | from typing import Any
import pydantic
class History(pydantic.BaseModel):
"""Class representing the conversation history.
The conversation history is a list of messages, each message entity should have keys from the associated signature.
For example, if you have the following signature:
```
cla... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/adapters/types/citation.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:45.336403 | from typing import Any, Optional
import pydantic
from dspy.adapters.types.base_type import Type
from dspy.utils.annotation import experimental
@experimental(version="3.0.4")
class Citations(Type):
"""Citations extracted from an LM response with source references.
This type represents citations returned by ... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/adapters/types/file.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:45.347937 | import base64
import mimetypes
import os
from typing import Any
import pydantic
from dspy.adapters.types.base_type import Type
class File(Type):
"""A file input type for DSPy.
See https://platform.openai.com/docs/api-reference/chat/create#chat_create-messages-user_message-content-array_of_content_parts-file... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/adapters/types/audio.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:45.366657 | import base64
import io
import mimetypes
import os
from typing import Any, Union
import pydantic
import requests
from dspy.adapters.types.base_type import Type
try:
import soundfile as sf
SF_AVAILABLE = True
except ImportError:
SF_AVAILABLE = False
def _normalize_audio_format(audio_format: str) -> str... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/adapters/types/image.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:45.402555 | import base64
import io
import mimetypes
import os
import warnings
from functools import lru_cache
from typing import Any, Union
from urllib.parse import urlparse
import pydantic
import requests
from dspy.adapters.types.base_type import Type
try:
from PIL import Image as PILImage
PIL_AVAILABLE = True
except... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/adapters/types/reasoning.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:45.821526 | from typing import TYPE_CHECKING, Any, Optional
import pydantic
from dspy.adapters.types.base_type import Type
from dspy.clients.base_lm import BaseLM
if TYPE_CHECKING:
from dspy.signatures.signature import Signature
class Reasoning(Type):
"""Reasoning type in DSPy.
This type is useful when you want t... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/adapters/types/tool.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:45.822924 | import asyncio
import inspect
from typing import TYPE_CHECKING, Any, Callable, get_origin, get_type_hints
import pydantic
from jsonschema import ValidationError, validate
from pydantic import BaseModel, TypeAdapter, create_model
from dspy.adapters.types.base_type import Type
from dspy.dsp.utils.settings import settin... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/clients/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:45.837375 | import logging
import os
from pathlib import Path
from typing import Any
import litellm
from dspy.clients.base_lm import BaseLM, inspect_history
from dspy.clients.cache import Cache
from dspy.clients.embedding import Embedder
from dspy.clients.lm import LM
from dspy.clients.provider import Provider, TrainingJob
logg... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/adapters/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:45.871316 | import ast
import enum
import inspect
import json
import types
from collections.abc import Mapping
from typing import Any, Literal, Union, get_args, get_origin
import json_repair
import pydantic
from pydantic import TypeAdapter
from pydantic.fields import FieldInfo
from dspy.adapters.types.base_type import Type as Ds... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/adapters/xml_adapter.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:45.925962 | import re
from typing import Any
from pydantic.fields import FieldInfo
from dspy.adapters.chat_adapter import ChatAdapter, FieldInfoWithName
from dspy.adapters.utils import format_field_value, translate_field_type
from dspy.signatures.signature import Signature
from dspy.utils.callback import BaseCallback
class XML... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/clients/base_lm.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:45.933411 | import datetime
import uuid
from typing import Any, TextIO
from dspy.dsp.utils import settings
from dspy.utils.callback import with_callbacks
from dspy.utils.inspect_history import pretty_print_history
MAX_HISTORY_SIZE = 10_000
GLOBAL_HISTORY = []
class BaseLM:
"""Base class for handling LLM calls.
Most us... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/clients/databricks.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:45.934732 | import logging
import os
import re
import time
from typing import TYPE_CHECKING, Any
import orjson
import requests
from dspy.clients.provider import Provider, TrainingJob
from dspy.clients.utils_finetune import TrainDataFormat, get_finetune_directory
if TYPE_CHECKING:
from databricks.sdk import WorkspaceClient
... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/clients/cache.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:45.967475 | import copy
import inspect
import logging
import os
import threading
from functools import wraps
from hashlib import sha256
from typing import Any
import cloudpickle
import orjson
import pydantic
from cachetools import LRUCache
from diskcache import FanoutCache
from dspy.clients.disk_serialization import (
Deseri... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/clients/embedding.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:46.359164 | from typing import Any, Callable
import litellm
import numpy as np
from dspy.clients.cache import request_cache
class Embedder:
"""DSPy embedding class.
The class for computing embeddings for text inputs. This class provides a unified interface for both:
1. Hosted embedding models (e.g. OpenAI's text-... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/clients/disk_serialization.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:46.476126 | """Restricted pickle deserialization for disk cache.
Provides a RestrictedDisk subclass that overrides diskcache's fetch to use
a restricted unpickler.
Trust model:
- litellm.types.* and openai.types.* are trusted by module prefix (pydantic
data models only, forward-compatible with library upgrades)
- numpy reconst... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/datasets/colors.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:47.044781 | import random
from dspy.datasets.dataset import Dataset
### A bunch of colors, originally from matplotlib
all_colors = [
"alice blue",
"dodger blue",
"light sky blue",
"deep sky blue",
"sky blue",
"steel blue",
"light steel blue",
"medium blue",
"navy blue",
"blue",
"royal ... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/datasets/dataloader.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:47.104364 | import random
from collections.abc import Mapping
from typing import TYPE_CHECKING
import dspy
from dspy.datasets.dataset import Dataset
if TYPE_CHECKING:
import pandas as pd
class DataLoader(Dataset):
def __init__(self):
pass
def from_huggingface(
self,
dataset_name: str,
... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/clients/lm.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:47.476960 | import logging
import os
import re
import threading
import warnings
from typing import Any, Literal, cast
import litellm
import pydantic
from anyio.streams.memory import MemoryObjectSendStream
from asyncer import syncify
from litellm import ContextWindowExceededError as LitellmContextWindowExceededError
import dspy
f... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/clients/openai.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:47.505628 | import time
from datetime import datetime
from typing import Any
import openai
from dspy.clients.provider import Provider, TrainingJob
from dspy.clients.utils_finetune import TrainDataFormat, TrainingStatus, save_data
class TrainingJobOpenAI(TrainingJob):
def __init__(self, *args, **kwargs):
super().__i... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/clients/lm_local.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:47.903954 | import datetime
import logging
import random
import socket
import string
import subprocess
import threading
import time
from typing import TYPE_CHECKING, Any
import requests
from dspy.clients.provider import Provider, TrainingJob
from dspy.clients.utils_finetune import TrainDataFormat, save_data
if TYPE_CHECKING:
... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/datasets/dataset.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:47.955903 | from __future__ import annotations
import random
import uuid
from collections.abc import Iterable
from typing import Any
from dspy import Example
from dspy.dsp.utils import dotdict
class Dataset:
def __init__(
self,
train_seed: int = 0,
train_size: int | None = None,
eval_seed: i... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/datasets/gsm8k.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:48.051099 | import random
import tqdm
class GSM8K:
def __init__(self):
self.do_shuffle = False
from datasets import load_dataset
dataset = load_dataset("gsm8k", "main")
hf_official_train = dataset["train"]
hf_official_test = dataset["test"]
official_train = []
offic... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/datasets/math.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:48.307742 | import random
import re
class MATH:
def __init__(self, subset):
from datasets import load_dataset
import dspy
ds = load_dataset("DigitalLearningGmbH/MATH-lighteval", subset)
# NOTE: Defaults to sub-splitting MATH's 'test' split into train/dev/test, presuming that current
... |
stanfordnlp/dspy | https://github.com/stanfordnlp/dspy | null | null | null | null | 34,175 | null | null | mit | null | null | null | null | null | null | null | dspy/datasets/hotpotqa.py | null | null | null | null | null | null | Python | 2026-05-04T02:23:48.687210 | import random
from dspy.datasets.dataset import Dataset
class HotPotQA(Dataset):
def __init__(
self,
*args,
only_hard_examples=True,
keep_details="dev_titles",
unofficial_dev=True,
**kwargs,
) -> None:
super().__init__(*args, **kwargs)
assert on... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.