id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2,287,400 | scheduler_ros.py | cyiyang_miniros/deliver_scheduler/scripts/scheduler_ros.py | # -*- coding: utf-8 -*-
import threading
import rospy
from playsound import playsound
from scheduler import NeedToChangeStatus, RequestType, Scheduler, TargetStatus
from deliver_scheduler.msg import EveryoneStatus
from deliver_scheduler.srv import (
ChangeTimeResult,
ChangeTimeResultResponse,
DestinationM... | 6,837 | Python | .py | 137 | 33.810219 | 88 | 0.641378 | cyiyang/miniros | 8 | 1 | 0 | GPL-2.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,401 | scheduler.py | cyiyang_miniros/deliver_scheduler/scripts/scheduler.py | # -*- coding: utf-8 -*-
import threading
import time
from enum import Enum, unique
from math import ceil, floor
from reloadable_timer import ReloadableTimer
from statemachine import State, StateMachine
from statemachine.exceptions import TransitionNotAllowed
LitterStrategy = Enum("LitterStrategy", ("DROP_MAX", "DROP_... | 13,975 | Python | .py | 309 | 28.003236 | 88 | 0.570476 | cyiyang/miniros | 8 | 1 | 0 | GPL-2.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,402 | SchedulerExample.py | cyiyang_miniros/deliver_scheduler/scripts/examples/SchedulerExample.py | """
流程: GetNextTarget -> DrugLoaded -> Delivered
"""
import sys
sys.path.append("..")
import os
os.chdir(os.path.dirname(__file__))
import time
from scheduler import Scheduler
if __name__ == "__main__":
scheduler = Scheduler()
# 获取将A药品送到区域1的需求
scheduler.GetNewRequest("A", 1)
target = scheduler.G... | 1,139 | Python | .py | 37 | 22.540541 | 77 | 0.708245 | cyiyang/miniros | 8 | 1 | 0 | GPL-2.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,403 | CoolingTimeRefreshTest.py | cyiyang_miniros/deliver_scheduler/scripts/examples/CoolingTimeRefreshTest.py | # -*- coding: utf-8 -*-
"""回归测试,修改后的Scheduler应通过该测试
"""
import sys
sys.path.append("..")
import os
os.chdir(os.path.dirname(__file__))
import time
from scheduler import Scheduler, NeedToChangeStatus
if __name__ == "__main__":
scheduler = Scheduler(DEBUG=True)
scheduler.GetNewRequest("A", 1)
nextTarget... | 4,116 | Python | .py | 106 | 32.566038 | 87 | 0.691146 | cyiyang/miniros | 8 | 1 | 0 | GPL-2.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,404 | ReloadableTimerTests.py | cyiyang_miniros/deliver_scheduler/scripts/examples/ReloadableTimerTests.py | import sys
sys.path.append("/home/ncut/drug-deliverer/deliver_scheduler/scripts")
import time
from scheduler import ReloadableTimer
def timeCostlyFun():
print("timeCostlyFun running!")
time.sleep(5)
print("timeCostlyFun finished!")
def MakePrint():
print("Triggered!")
if __name__ == "__main__":
... | 597 | Python | .py | 20 | 25.65 | 70 | 0.717047 | cyiyang/miniros | 8 | 1 | 0 | GPL-2.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,405 | regressionTests.py | cyiyang_miniros/deliver_scheduler/scripts/examples/regressionTests.py | # -*- coding: utf-8 -*-
"""回归测试,修改后的Scheduler应通过该测试
"""
import sys
sys.path.append("..")
import os
os.chdir(os.path.dirname(__file__))
import time
from scheduler import Scheduler
if __name__ == "__main__":
scheduler = Scheduler(DEBUG=True)
scheduler.start()
scheduler.GetNewRequest("A", 1)
nextTarg... | 1,119 | Python | .py | 34 | 26.117647 | 85 | 0.688008 | cyiyang/miniros | 8 | 1 | 0 | GPL-2.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,406 | RestartWithIntervalTest.py | cyiyang_miniros/deliver_scheduler/scripts/examples/RestartWithIntervalTest.py | import sys
sys.path.append("/home/ncut/drug-deliverer/deliver_scheduler/scripts")
import time
from scheduler import ReloadableTimer
def SayHi():
print("Hi!")
timer = ReloadableTimer(5, True, SayHi)
timer.restartWithInterval(10)
timer.start()
time.sleep(15)
| 267 | Python | .py | 10 | 24.7 | 70 | 0.804781 | cyiyang/miniros | 8 | 1 | 0 | GPL-2.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,407 | multicarTest.py | cyiyang_miniros/deliver_scheduler/scripts/examples/multicarTest.py | # -*- coding: utf-8 -*-
"""多车回归测试,修改后的Scheduler应通过该测试
"""
import sys
sys.path.append("..")
import os
os.chdir(os.path.dirname(__file__))
import time
from scheduler import Scheduler, NeedToChangeStatus
scheduler = Scheduler()
scheduler.GetNewRequest("A", 1)
scheduler.GetNewRequest("B", 2)
scheduler.GetNewRequest("... | 511 | Python | .py | 18 | 25.055556 | 51 | 0.78714 | cyiyang/miniros | 8 | 1 | 0 | GPL-2.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,408 | StateMachineTest.py | cyiyang_miniros/deliver_scheduler/scripts/examples/StateMachineTest.py | # -*- coding: utf-8 -*-
from statemachine import State, StateMachine
from statemachine.exceptions import TransitionNotAllowed
class CoolingTime(StateMachine):
# 定义状态
speedUpState = State("speedUpState")
slowDownState = State("slowDownState")
normalState = State("normalState", initial=True)
# 定义状... | 616 | Python | .py | 15 | 36.466667 | 76 | 0.765217 | cyiyang/miniros | 8 | 1 | 0 | GPL-2.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,409 | reminder_basic.py | cyiyang_miniros/board_reminder/scripts/reminder_basic.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import threading
import time
import warnings
DEBUGING = True
class Reminder(object):
"""每隔Interval时间非阻塞调用DefaultRemind方法的定时器对象,第一个定时器的等待时间为firstInterval"""
def __init__(self, defaultInterval=3 * 60):
self.defaultInterval = defaultInterval
# Pyt... | 4,199 | Python | .py | 94 | 27.808511 | 85 | 0.623328 | cyiyang/miniros | 8 | 1 | 0 | GPL-2.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,410 | reminder_basic.py.bak | cyiyang_miniros/board_reminder/scripts/reminder_basic.py.bak | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import threading
import time
import warnings
DEBUGING = True
class Reminder(object):
"""每隔Interval时间非阻塞调用DefaultRemind方法的定时器对象"""
def __init__(self, defaultInterval=3 * 60, elapsedTimeRemindInterval=5):
self.defaultInterval = defaultInterval
# ... | 5,783 | Python | .py | 123 | 29.731707 | 87 | 0.639732 | cyiyang/miniros | 8 | 1 | 0 | GPL-2.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,411 | reminder_client.py | cyiyang_miniros/board_reminder/scripts/reminder_client.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
sys.path.append("/home/fanch/demo2/src/board_reminder/scripts")
import threading
import time
import rospy
from reminder_basic import Reminder
from board_reminder.srv import NeedToSeeMsg, NeedToSeeMsgResponse
class BoardReminder(Reminder):
def __init__(... | 2,334 | Python | .py | 49 | 35.102041 | 87 | 0.699111 | cyiyang/miniros | 8 | 1 | 0 | GPL-2.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,412 | send_goals_scripts_send_goals_node_python.py.sisc | cyiyang_miniros/drug-deliverer.si4project/cache/parse/send_goals_scripts_send_goals_node_python.py.sisc | 0 T ) % Õµ Õµ Öµ Öµ ¥ÜÕÕµ ¥Ä©
Õµ ... | 10,005 | Python | .pyt | 47 | 211.893617 | 1,028 | 0.177528 | cyiyang/miniros | 8 | 1 | 0 | GPL-2.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,413 | send_goals_node_python.py | cyiyang_miniros/send_goals/scripts/send_goals_node_python.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# 动作通信:该例程在任一仿真环境下,执行/action_client通信,消息类型move_base_msgs/MoveBaseAction MoveBaseGoal
import roslib
import rospy
import actionlib
from actionlib_msgs.msg import *
from geometry_msgs.msg import Pose, Point, Quaternion
from move_base_msgs.msg import MoveBaseAction, MoveBaseGo... | 2,559 | Python | .pyt | 64 | 30.890625 | 84 | 0.637744 | cyiyang/miniros | 8 | 1 | 0 | GPL-2.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,414 | ui.py | hackcatml_kfd-explorer/ui.py | # -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'ui_test.ui'
##
## Created by: Qt User Interface Compiler version 6.5.1
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
###################... | 26,157 | Python | .py | 415 | 54.277108 | 180 | 0.711086 | hackcatml/kfd-explorer | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,415 | history.py | hackcatml_kfd-explorer/history.py | import platform
from PySide6 import QtCore, QtGui, QtWidgets
from PySide6.QtCore import Qt, QObject
from PySide6.QtWidgets import QTableWidgetItem, QWidget
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(480, 170)
font = QtGui.QFont()
font.se... | 3,096 | Python | .py | 65 | 39.230769 | 105 | 0.690776 | hackcatml/kfd-explorer | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,416 | code.py | hackcatml_kfd-explorer/code.py | import platform
import frida
from PySide6 import QtCore
from PySide6.QtCore import QObject
MESSAGE = ""
ERRMESSAGE = ""
def clean_message():
global MESSAGE
MESSAGE = ''
class Instrument(QObject):
attachsig = QtCore.Signal(int)
def __init__(self, script_text, target):
super().__init__()
... | 4,763 | Python | .py | 121 | 30.752066 | 120 | 0.639843 | hackcatml/kfd-explorer | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,417 | utilviewer.py | hackcatml_kfd-explorer/utilviewer.py | import re
import frida
from PySide6 import QtGui
from PySide6.QtGui import QAction
from PySide6.QtWidgets import QTextBrowser, QTextEdit, QLineEdit, QPushButton, QCheckBox
import globvar
class UtilViewerClass(QTextEdit):
def __init__(self, args):
super(UtilViewerClass, self).__init__(args)
self... | 5,802 | Python | .py | 125 | 35.64 | 136 | 0.550584 | hackcatml/kfd-explorer | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,418 | globvar.py | hackcatml_kfd-explorer/globvar.py | errorType1 = "script has been destroyed"
fridaInstrument = None
enumerateRanges = []
isFridaAttached = False
offsets = []
arch = None
isHexEditMode = False
hexEdited = []
currentFrameBlockNumber = 0
currentFrameStartAddress = ''
visitedAddress = []
| 253 | Python | .py | 11 | 21.636364 | 40 | 0.798319 | hackcatml/kfd-explorer | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,419 | hexviewer.py | hackcatml_kfd-explorer/hexviewer.py | import inspect
import re
from PySide6 import QtGui, QtCore
from PySide6.QtCore import Qt
from PySide6.QtGui import QTextCursor, QAction, QCursor
from PySide6.QtWidgets import QTextEdit, QApplication, QWidget, QVBoxLayout
import globvar
class HexViewerClass(QTextEdit):
wheelupsig = QtCore.Signal(str)
wheelsi... | 20,766 | Python | .py | 370 | 43.586486 | 446 | 0.589453 | hackcatml/kfd-explorer | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,420 | disasm.py | hackcatml_kfd-explorer/disasm.py | import re
import platform
from PySide6.QtCore import QObject, Qt, Slot
from PySide6 import QtCore, QtGui, QtWidgets
from PySide6.QtWidgets import QWidget
from capstone import *
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(550, 300)
self.gridLayout... | 3,831 | Python | .py | 83 | 37.46988 | 105 | 0.635534 | hackcatml/kfd-explorer | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,421 | main.py | hackcatml_kfd-explorer/main.py | import collections
import inspect
import platform
import re
from PySide6 import QtGui
from PySide6.QtCore import QThread, Slot, Qt, QEvent, QPoint
from PySide6.QtGui import QPixmap, QTextCursor, QShortcut, QKeySequence, QIcon, QPalette
from PySide6.QtWidgets import QLabel, QMainWindow, QMessageBox, QApplication
impor... | 29,774 | Python | .py | 589 | 38.237691 | 153 | 0.601719 | hackcatml/kfd-explorer | 8 | 2 | 0 | LGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,422 | metadata_removal_tool.py | sh1d0wg1m3r_Metadata-Removal-Tool/metadata_removal_tool.py | import os
import tkinter as tk
from tkinter import filedialog, messagebox
from PIL import Image
from PyPDF2 import PdfReader, PdfWriter
from docx import Document
from mutagen.mp3 import MP3
from mutagen.id3 import ID3, ID3NoHeaderError
from mutagen.flac import FLAC
from openpyxl import load_workbook
import zi... | 7,203 | Python | .py | 174 | 30.643678 | 134 | 0.59665 | sh1d0wg1m3r/Metadata-Removal-Tool | 8 | 0 | 1 | GPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,423 | __config__.py | AdhamSamehA_Outbound-Phone-GPT/__config__.py | import os
from dotenv import load_dotenv
# Load `.env` content file
load_dotenv()
# Set up the directory paths within your project
AGENT_CONFIGS_FOLDER = f'{os.getcwd()}/example_agent_configs'
AGENT_CACHE_FOLDER = f'{os.getcwd()}/example_cache_files'
AGENT_AUDIO_FOLDER = f"{os.getcwd()}/example_audio_files"
# Confi... | 3,599 | Python | .py | 68 | 51.294118 | 304 | 0.730244 | AdhamSamehA/Outbound-Phone-GPT | 8 | 4 | 2 | GPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,424 | __utils__.py | AdhamSamehA_Outbound-Phone-GPT/__utils__.py | """
This file is part of Outbound Phone GPT.
Outbound Phone GPT is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any lat... | 19,127 | Python | .py | 400 | 38.6025 | 192 | 0.623881 | AdhamSamehA/Outbound-Phone-GPT | 8 | 4 | 2 | GPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,425 | app.py | AdhamSamehA_Outbound-Phone-GPT/app.py | """
This file is part of Outbound Phone GPT.
Outbound Phone GPT is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any lat... | 36,953 | Python | .py | 603 | 47.661692 | 295 | 0.561336 | AdhamSamehA/Outbound-Phone-GPT | 8 | 4 | 2 | GPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,426 | logger_config.py | AdhamSamehA_Outbound-Phone-GPT/logger_config.py | import logging
import time
class MyFormatter(logging.Formatter):
def formatTime(self, record, datefmt=None):
ct = self.converter(record.created)
t = time.strftime("%H:%M:%S", ct)
s = "%s,%03d" % (t, record.msecs)
return s
def setup_logger(name, level=logging.INFO):
logger = log... | 811 | Python | .py | 20 | 34 | 101 | 0.682398 | AdhamSamehA/Outbound-Phone-GPT | 8 | 4 | 2 | GPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,427 | FillerPredictionModel.py | AdhamSamehA_Outbound-Phone-GPT/FillerPredictionModel.py | """
This file is part of Outbound Phone GPT.
Outbound Phone GPT is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any lat... | 3,050 | Python | .py | 61 | 42.213115 | 183 | 0.679892 | AdhamSamehA/Outbound-Phone-GPT | 8 | 4 | 2 | GPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,428 | Worker.py | AdhamSamehA_Outbound-Phone-GPT/Worker.py | """
This file is part of Outbound Phone GPT.
Outbound Phone GPT is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any lat... | 18,868 | Python | .py | 314 | 46.907643 | 202 | 0.614828 | AdhamSamehA/Outbound-Phone-GPT | 8 | 4 | 2 | GPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,429 | stages.py | AdhamSamehA_Outbound-Phone-GPT/ConversationModel/stages.py | # Example conversation stages for the Sales Agent and Recruitmet Coordinator
# Feel free to modify, add/drop stages based on the use case.
SALES_CONVERSATION_STAGES = {
"1": "Introduction: Start the conversation by introducing yourself and your company. Be polite and respectful while keeping the tone of the conver... | 2,265 | Python | .py | 21 | 104.428571 | 271 | 0.760375 | AdhamSamehA/Outbound-Phone-GPT | 8 | 4 | 2 | GPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,430 | prompts.py | AdhamSamehA_Outbound-Phone-GPT/ConversationModel/prompts.py | # Default inception prompt : This is the main system prompt for `ConversationalModel` workers
SALES_AGENT_DEFAULT_INCEPTION_PROMPT = "Never forget your name is {salesperson_name}. You work as a {salesperson_role}.\\nYou work at a company named {company_name}. {company_name}'s business is the following: {company_busines... | 8,249 | Python | .py | 32 | 256.59375 | 6,127 | 0.785366 | AdhamSamehA/Outbound-Phone-GPT | 8 | 4 | 2 | GPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,431 | chains.py | AdhamSamehA_Outbound-Phone-GPT/ConversationModel/chains.py | """
This file is part of Outbound Phone GPT.
Outbound Phone GPT is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any lat... | 3,164 | Python | .py | 71 | 33.873239 | 112 | 0.632382 | AdhamSamehA/Outbound-Phone-GPT | 8 | 4 | 2 | GPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,432 | agents.py | AdhamSamehA_Outbound-Phone-GPT/ConversationModel/agents.py | """
This file is part of Outbound Phone GPT.
Outbound Phone GPT is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any lat... | 10,046 | Python | .py | 216 | 37.175926 | 120 | 0.64436 | AdhamSamehA/Outbound-Phone-GPT | 8 | 4 | 2 | GPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,433 | logger.py | AdhamSamehA_Outbound-Phone-GPT/ConversationModel/logger.py | import logging
import time
from functools import wraps
logger = logging.getLogger(__name__)
stream_handler = logging.StreamHandler()
log_filename = "output.log"
file_handler = logging.FileHandler(filename=log_filename)
handlers = [stream_handler, file_handler]
class TimeFilter(logging.Filter):
def filter(self, ... | 1,119 | Python | .py | 29 | 34.172414 | 81 | 0.707136 | AdhamSamehA/Outbound-Phone-GPT | 8 | 4 | 2 | GPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,434 | playground.py | AdhamSamehA_Outbound-Phone-GPT/ConversationModel/playground.py | """
This file is part of Outbound Phone GPT.
Outbound Phone GPT is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any lat... | 2,523 | Python | .py | 57 | 36.491228 | 126 | 0.6702 | AdhamSamehA/Outbound-Phone-GPT | 8 | 4 | 2 | GPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,435 | 天知强卡器.py | a1929238_tenchi-cards-enhancer/天知强卡器.py | # 天知强卡器,以pyqt6为GUI
# setting字典的结构为:setting[type][name][count]
# 统计数据字典的结构为:statistics[type][name][count]
# 更新目标: 增加香料/四叶草点击后检查
# -*- coding: utf-8 -*-
import time
from PyQt6 import QtWidgets, QtCore, QtGui, uic
import sys
import win32gui
import win32api
import win32con
import json
from ctypes import windll, c_void_p, b... | 131,438 | Python | .py | 2,529 | 29.840253 | 156 | 0.544863 | a1929238/tenchi-cards-enhancer | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,436 | ResourceInit.py | a1929238_tenchi-cards-enhancer/module/ResourceInit.py | # 资源初始化模块,有常用图片资源的初始化,并保存为全局变量,也有图片读取的方法
from .utils import imread
import os
class ResourceInit:
def __init__(self):
# 获取项目根目录路径
self.root_dir = os.path.dirname(os.path.dirname(__file__))
# 以完整路径导入图片
self.card_bind_img = imread(os.path.join(self.root_dir, "items/bind_icon/card_bind... | 3,476 | Python | .py | 59 | 41.372881 | 114 | 0.634213 | a1929238/tenchi-cards-enhancer | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,437 | bg_img_match.py | a1929238_tenchi-cards-enhancer/module/bg_img_match.py | import time
from typing import Union
import cv2
import numpy as np
from module.bg_img_screenshot import capture_image_png, png_cropping
def match_template_with_optional_mask(img_source, img_template) -> np.ndarray:
"""
使用可选掩模进行模板匹配。
如果模板图像包含Alpha通道且不是纯白,则使用该Alpha通道作为掩模进行匹配。
如果模板图像不包含Alpha通道或Alpha通道... | 10,876 | Python | .py | 252 | 27.051587 | 122 | 0.591985 | a1929238/tenchi-cards-enhancer | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,438 | restore_window_if_minimized.py | a1929238_tenchi-cards-enhancer/module/restore_window_if_minimized.py | import win32con
import win32gui
def restore_window_if_minimized(handle) -> bool:
"""
:param handle: 句柄
:return: 如果是最小化, 并恢复至激活窗口的底层, 则返回True, 否则返回False.
"""
# 检查窗口是否最小化
if win32gui.IsIconic(handle):
# 恢复窗口(但不会将其置于最前面)
win32gui.ShowWindow(handle, win32con.SW_RESTORE)
#... | 687 | Python | .py | 16 | 26.9375 | 98 | 0.655955 | a1929238/tenchi-cards-enhancer | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,439 | utils.py | a1929238_tenchi-cards-enhancer/module/utils.py | # 常用方法
import numpy as np
import cv2
import sys
import os
# 读取图片
def imread(filename, with_alpha=False):
# 使用 np.fromfile 读取数据
data = np.fromfile(filename, dtype=np.uint8)
# 使用 cv2.imdecode() 解码图像数据
if with_alpha:
image = cv2.imdecode(data, cv2.IMREAD_UNCHANGED)
els... | 1,627 | Python | .py | 45 | 24.066667 | 76 | 0.623938 | a1929238/tenchi-cards-enhancer | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,440 | AutoCushion.py | a1929238_tenchi-cards-enhancer/module/AutoCushion.py | from PyQt6.QtCore import QThread, Qt
from PyQt6.QtGui import QColor
from PyQt6.QtWidgets import QTableWidgetItem, QMessageBox
import re
import numpy as np
# 自动垫卡
class AutoCushion():
# 自动垫卡分为几步:1.强化成功率计算器,找到相等的成功几率 2.选择卡片配方 3.自行选择多种规律 4.进行自动制卡跟垫卡,出现任意一种规律后停止
def __init__(self, main_window):
# 实例化主窗口
... | 22,635 | Python | .py | 484 | 29.028926 | 164 | 0.566201 | a1929238/tenchi-cards-enhancer | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,441 | bg_img_screenshot.py | a1929238_tenchi-cards-enhancer/module/bg_img_screenshot.py | from ctypes import windll, byref, c_ubyte
from ctypes.wintypes import RECT, HWND
import numpy as np
from numpy import uint8, frombuffer
from module.restore_window_if_minimized import restore_window_if_minimized
# 如果没有依赖
# pip install opencv-contrib-python
# 排除缩放干扰 但有的时候会出错 可以在这里多测试测试
windll.user32.SetProcessDPIAwar... | 4,684 | Python | .py | 88 | 33.693182 | 102 | 0.645581 | a1929238/tenchi-cards-enhancer | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,442 | EnhanceSimulator.py | a1929238_tenchi-cards-enhancer/module/EnhanceSimulator.py | # 强化模拟器,自动垫卡的前置科技
import random
import json
import itertools
import copy
from PyQt6.QtWidgets import QMessageBox
from GUI.qwidgetwebexpectation import QWidgetWebExpectation
class EnhanceSimulator:
"""
强化的概率区间如下:
((基于主卡最高概率副卡) + (基于主卡次高概率副卡)/3 + (基于主卡次高概率副卡)/3) * 四叶草加成 + (前方所有概率 * 总概率加成)
"""
def ... | 26,614 | Python | .py | 577 | 26.175043 | 117 | 0.48142 | a1929238/tenchi-cards-enhancer | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,443 | CardPackEditor.py | a1929238_tenchi-cards-enhancer/module/CardPackEditor.py | import sys
from PyQt6.QtWidgets import (
QApplication, QWidget, QVBoxLayout, QHBoxLayout, QLabel, QLineEdit,
QPushButton, QListWidget, QInputDialog, QMessageBox, QComboBox
)
from PyQt6.QtCore import Qt, pyqtSignal
class CardPackEditor(QWidget):
save_signal = pyqtSignal(dict)
def __init__(self, card_p... | 6,724 | Python | .py | 138 | 34.463768 | 83 | 0.629915 | a1929238/tenchi-cards-enhancer | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,444 | bg_img_screenshot.cpython-311.pyc | a1929238_tenchi-cards-enhancer/module/__pycache__/bg_img_screenshot.cpython-311.pyc | §
}xGfÀ ã ó¶ — d dl mZmZmZ d dlmZmZ d dlZd dlm Z m
Z
d dlmZ ej
¦ « ddededefd „Zdd„Zdefd„Zdefd
„ZdS )é )ÚwindllÚbyrefÚc_ubyte)ÚRECTÚHWNDN)Úuint8Ú
frombuffer)Úrestore_window_if_minim... | 5,145 | Python | .py | 43 | 117 | 763 | 0.332223 | a1929238/tenchi-cards-enhancer | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,445 | bg_img_match.cpython-311.pyc | a1929238_tenchi-cards-enhancer/module/__pycache__/bg_img_match.cpython-311.pyc | §
}xGf§+ ã óş — d dl Z d dlmZ d dlZd dlZd dlmZmZ dej fd„Z
dded ededef fd
„Z
ddedededef fd
„Z dded edededededefd„Z ddededededef
d„ZdS )é N)ÚUnion)Úcap... | 10,299 | Python | .py | 101 | 97.980198 | 791 | 0.391876 | a1929238/tenchi-cards-enhancer | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,446 | utils.cpython-311.pyc | a1929238_tenchi-cards-enhancer/module/__pycache__/utils.cpython-311.pyc | §
PÄ|f� ã óF — d dl Zd dlZd dlZd dlZdd„Zdefd„Zd„ Zd„ Z dS ) é NFc óÈ — t j | t j ¬¦ « }|r t j |t j ¦ « }nt j |t j ... | 2,502 | Python | .py | 13 | 191.307692 | 1,693 | 0.332932 | a1929238/tenchi-cards-enhancer | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,447 | restore_window_if_minimized.cpython-311.pyc | a1929238_tenchi-cards-enhancer/module/__pycache__/restore_window_if_minimized.cpython-311.pyc | §
}xGfà ã ó" — d dl Z d dlZdefd„ZdS )é NÚreturnc
ó — t j | ¦ « rit j | t j ¦ « t j | t j ddddt j t j ... | 1,023 | Python | .py | 11 | 90.818182 | 405 | 0.411649 | a1929238/tenchi-cards-enhancer | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:18 PM (Europe/Amsterdam) |
2,287,448 | ResourceInit.cpython-311.pyc | a1929238_tenchi-cards-enhancer/module/__pycache__/ResourceInit.cpython-311.pyc | §
ò wfÓ
ã ó4 — d dl mZ ddlZ G d„ d¦ « ZdS )é )Úimreadé Nc ó& |