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,288,600 | yba_ams_py_controller.py | TshineZheng_Filamentor/src/impl/yba_ams_py_controller.py | import json
import select
import socket
import threading
import time
from src.impl.yba_ams_controller import YBAAMSController
from src.utils.log import LOGE, LOGI
class YBAAMSPYController(YBAAMSController):
"""YBA-AMS-Python 版本,用 python 复刻原版,增加内存指令
Args:
YBAAMSController (_type_): _description_
... | 3,488 | Python | .py | 93 | 22.44086 | 120 | 0.463393 | TshineZheng/Filamentor | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,601 | gcode_util.py | TshineZheng_Filamentor/src/utils/gcode_util.py |
class GCodeInfo(object):
def __init__(self):
from src import consts
self.first_channel = 0
self.layer_height = consts.LAYER_HEIGHT
def decodeFromZipUrl(zip_url: str, file_path: str) -> GCodeInfo:
import requests
import zipfile
import io
# 发送GET请求并获取ZIP文件的内容
response =... | 2,421 | Python | .py | 49 | 23.22449 | 74 | 0.429481 | TshineZheng/Filamentor | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,602 | front.py | TshineZheng_Filamentor/src/utils/front.py | import requests
import zipfile
import os
def unzip_file(zip_path, extract_path):
with zipfile.ZipFile(zip_path, 'r') as zip_ref:
zip_ref.extractall(extract_path)
print(f"文件已解压到 {extract_path}")
if os.path.exists('web'):
exit('前端已存在,如果要更新,请删除 web 文件夹后重新运行本脚本')
print('正在下载前端资源...')
# GitHub 用户名和仓... | 1,106 | Python | .py | 31 | 27.483871 | 68 | 0.704846 | TshineZheng/Filamentor | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,603 | persist.py | TshineZheng_Filamentor/src/utils/persist.py | import os
from src.consts import STORAGE_PATH
def update_printer_channel(printer_id: str, channel: int):
with open(f'{STORAGE_PATH}{printer_id}.channel', 'w') as f:
f.write(str(channel))
def get_printer_channel(printer_id: str) -> int:
# 如果文件不存在,则返回 0
if not os.path.exists(f'{STORAGE_PATH}{printe... | 519 | Python | .py | 14 | 29.428571 | 67 | 0.644958 | TshineZheng/Filamentor | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,604 | log.py | TshineZheng_Filamentor/src/utils/log.py | from abc import abstractmethod
from typing import Any
from loguru import logger as LOG
import src.consts
def LOGI(msg, *args: Any, **kwargs: Any):
LOG.info(msg, *args, **kwargs)
def LOGW(msg, *args: Any, **kwargs: Any):
LOG.info(msg, *args, **kwargs)
def LOGE(msg, *args: Any, **kwargs: Any):
LOG.error(ms... | 1,286 | Python | .py | 38 | 28.684211 | 60 | 0.60778 | TshineZheng/Filamentor | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,605 | singleton.py | TshineZheng_Filamentor/src/utils/singleton.py | class Singleton(type):
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
return cls._instances[cls] | 237 | Python | .py | 6 | 32.666667 | 81 | 0.586207 | TshineZheng/Filamentor | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,606 | json_util.py | TshineZheng_Filamentor/src/utils/json_util.py | def ast(json_data: dict, key: str, value):
if key in json_data:
if json_data[key] == value:
return True
return False | 144 | Python | .py | 5 | 22.4 | 42 | 0.592857 | TshineZheng/Filamentor | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,607 | net_util.py | TshineZheng_Filamentor/src/utils/net_util.py | def get_ip_address():
import socket
hostname = socket.gethostname()
ip_address = socket.gethostbyname(hostname)
return ip_address
| 146 | Python | .py | 5 | 25 | 47 | 0.730496 | TshineZheng/Filamentor | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,608 | models.py | TshineZheng_Filamentor/src/web/models.py | from datetime import datetime
from typing import Any
from zoneinfo import ZoneInfo
from fastapi.encoders import jsonable_encoder
from pydantic import BaseModel as bm, ConfigDict, model_validator
def convert_datetime_to_gmt(dt: datetime) -> str:
if not dt.tzinfo:
dt = dt.replace(tzinfo=ZoneInfo("UTC"))
... | 1,044 | Python | .py | 27 | 32.111111 | 75 | 0.668322 | TshineZheng/Filamentor | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,609 | front.py | TshineZheng_Filamentor/src/web/front.py |
import http.server
from typing import Any
from src.utils.net_util import get_ip_address
front_server: http.server.HTTPServer = None
class FrontHandler(http.server.SimpleHTTPRequestHandler):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs, directory='web')
def log_message(sel... | 954 | Python | .py | 24 | 32.916667 | 71 | 0.58204 | TshineZheng/Filamentor | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,610 | __init__.py | TshineZheng_Filamentor/src/web/__init__.py | from src.web.controller.router import router as controller_router
from src.web.sys.router import router as sys_router
from src.web.printer.router import router as printer_router
from fastapi.middleware.cors import CORSMiddleware
from fastapi import APIRouter, FastAPI
import json
import logging
from fastapi import Reque... | 3,049 | Python | .py | 72 | 30.944444 | 90 | 0.615651 | TshineZheng/Filamentor | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,611 | exceptions.py | TshineZheng_Filamentor/src/web/exceptions.py | from typing import Any
from fastapi import HTTPException, status
class DetailedHTTPException(HTTPException):
STATUS_CODE = status.HTTP_500_INTERNAL_SERVER_ERROR
DETAIL = "Server error"
def __init__(self, **kwargs: dict[str, Any]) -> None:
super().__init__(status_code=self.STATUS_CODE, detail=sel... | 899 | Python | .py | 20 | 40.3 | 84 | 0.73903 | TshineZheng/Filamentor | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,612 | router.py | TshineZheng_Filamentor/src/web/sys/router.py | from typing import List
from fastapi import APIRouter, Depends
from src.ams_core import ams_list
from src.app_config import DetectRelation, IDBrokenDetect, config
router = APIRouter()
@router.get('/config')
async def get_config():
d = config.to_dict()
detect_list = d['detect_list']
detect_relation_list... | 2,511 | Python | .py | 56 | 33.053571 | 124 | 0.62069 | TshineZheng/Filamentor | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,613 | schemas.py | TshineZheng_Filamentor/src/web/controller/schemas.py | from src.web.models import BaseModel
class ControllerChannelModel(BaseModel):
controller_id: str
channel: int
class YBAAMSControllerModel(BaseModel):
ip: str
port: int
channel_total: int
class YBASingleBufferControllerModel(BaseModel):
fila_broken_safe_time: int
ip: str
port: int
... | 342 | Python | .py | 13 | 22.076923 | 48 | 0.76161 | TshineZheng/Filamentor | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,614 | dependencies.py | TshineZheng_Filamentor/src/web/controller/dependencies.py | from typing import List
from fastapi import Depends, Query
from src.controller import ChannelAction
from src.impl.yba_ams_controller import YBAAMSController
from src.impl.yba_ams_py_controller import YBAAMSPYController
from src.impl.yba_ams_servo_controller import YBAAMSServoController
from src.impl.yba_single_buffer_c... | 3,042 | Python | .py | 51 | 53.529412 | 221 | 0.765972 | TshineZheng/Filamentor | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,615 | router.py | TshineZheng_Filamentor/src/web/controller/router.py | from typing import List, Union
from fastapi import APIRouter, Depends
from src.controller import ChannelAction
from src.web.controller import service
from src.web.controller.dependencies import valid_channel_binded, valid_channel_unbinded, valid_controller_channel, valid_controller_id_exist, valid_controller_type, val... | 2,032 | Python | .py | 38 | 50.026316 | 186 | 0.786471 | TshineZheng/Filamentor | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,616 | service.py | TshineZheng_Filamentor/src/web/controller/service.py | from typing import List, Union
import uuid
from src.controller import ChannelAction, Controller
from src.web.controller.exceptions import ControllerTaken
from src.app_config import config
import src.core_services as core_services
from src.web.controller.schemas import ControllerChannelModel, YBAAMSControllerModel
asy... | 1,468 | Python | .py | 32 | 40.625 | 98 | 0.757857 | TshineZheng/Filamentor | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,617 | exceptions.py | TshineZheng_Filamentor/src/web/controller/exceptions.py | from src.web.exceptions import BadRequest
class ControllerTypeNotMatch(BadRequest):
DETAIL = "控制器类型不支持"
class ControllerNotFoundError(BadRequest):
DETAIL = "控制器不存在"
class ControllerChannelNotFoundError(BadRequest):
DETAIL = "控制器通道不存在"
class ControllerChannelBinded(BadRequest):
DETAIL = "控制器通道已绑定"
... | 786 | Python | .py | 19 | 30.631579 | 49 | 0.802589 | TshineZheng/Filamentor | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,618 | schemas.py | TshineZheng_Filamentor/src/web/printer/schemas.py | from src.web.models import BaseModel
class BambuPrinterModel(BaseModel):
printer_ip: str
lan_password: str
device_serial: str | 139 | Python | .py | 5 | 24.2 | 36 | 0.774436 | TshineZheng/Filamentor | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,619 | dependencies.py | TshineZheng_Filamentor/src/web/printer/dependencies.py |
from typing import Union
from fastapi import Depends
from src.impl.bambu_client import BambuClient
from src.printer_client import PrinterClient
from src.web.exceptions import DetailedHTTPException
from src.web.printer.exceptions import ChannelNotFoundError, PrinterHasTaskError, PrinterInfoError, PrinterNotFoundError, ... | 1,829 | Python | .py | 41 | 37.707317 | 155 | 0.74158 | TshineZheng/Filamentor | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,620 | router.py | TshineZheng_Filamentor/src/web/printer/router.py | from fastapi import APIRouter, Depends
from src.controller import ChannelAction
from src.printer_client import PrinterClient
from src.web.controller.dependencies import valid_channel_action
from src.web.printer.dependencies import valid_ams_printer_task, valid_printer_channel, valid_printer_id_exist, valid_printer_take... | 2,215 | Python | .py | 44 | 46.954545 | 131 | 0.764133 | TshineZheng/Filamentor | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,621 | service.py | TshineZheng_Filamentor/src/web/printer/service.py | import uuid
from src.controller import ChannelAction
from src.printer_client import PrinterClient
from src.utils import persist
from src.app_config import config
import src.core_services as core_services
from src.ams_core import ams_list
async def create_printer(printerClient: PrinterClient, alias: str, change_temp: ... | 1,735 | Python | .py | 38 | 39.921053 | 112 | 0.747698 | TshineZheng/Filamentor | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,622 | exceptions.py | TshineZheng_Filamentor/src/web/printer/exceptions.py | from src.web.exceptions import BadRequest, NotFound
class PrinterNotFoundError(BadRequest):
DETAIL = "没有对应的打印机"
class ChannelNotFoundError(BadRequest):
DETAIL = '没有对应的通道'
class PrinterTaken(BadRequest):
DETAIL = '打印机已存在'
class PrinterTypeNotMatch(BadRequest):
DETAIL = '打印机类型不支持'
class PrinterH... | 574 | Python | .py | 13 | 30.769231 | 51 | 0.794811 | TshineZheng/Filamentor | 8 | 2 | 0 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,623 | setup.py | SUSE_klp-build/setup.py | import setuptools
with open("README.md", "r") as f:
long_description = f.read()
setuptools.setup(
name="klp-build",
version="0.0.1",
author="Marcos Paulo de Souza",
author_email="mpdesouza@suse.com",
description="The kernel livepatching creation tool",
long_description=long_description,
... | 1,047 | Python | .py | 37 | 22.027027 | 60 | 0.608739 | SUSE/klp-build | 8 | 2 | 4 | GPL-2.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,624 | .pylintrc | SUSE_klp-build/.pylintrc | [MASTER]
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code.
extension-pkg-allow-list=
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extension... | 19,598 | Python | .py | 433 | 42.859122 | 113 | 0.785338 | SUSE/klp-build | 8 | 2 | 4 | GPL-2.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,625 | test_setup.py | SUSE_klp-build/tests/test_setup.py | # SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2021-2024 SUSE
# Author: Marcos Paulo de Souza
import json
import logging
from pathlib import Path
import pytest
from klpbuild.setup import Setup
import klpbuild.utils as utils
from tests.utils import get_workdir
lp = "bsc9999999"
cs = "15.5u19"
def test_mis... | 5,619 | Python | .py | 92 | 53.054348 | 113 | 0.638248 | SUSE/klp-build | 8 | 2 | 4 | GPL-2.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,626 | test_extract.py | SUSE_klp-build/tests/test_extract.py | # SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2021-2024 SUSE
# Author: Marcos Paulo de Souza
from klpbuild.extractor import Extractor
from klpbuild.setup import Setup
import klpbuild.utils as utils
import logging
def test_detect_file_without_ftrace_support(caplog):
lp = "bsc9999999"
cs = "15.6u0"... | 906 | Python | .py | 20 | 39.35 | 91 | 0.678409 | SUSE/klp-build | 8 | 2 | 4 | GPL-2.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,627 | test_utils.py | SUSE_klp-build/tests/test_utils.py | import klpbuild.utils as utils
from klpbuild.codestream import Codestream
def test_group_classify():
assert utils.classify_codestreams(["15.2u10", "15.2u11", "15.3u10", "15.3u12"]) == \
["15.2u10-11", "15.3u10-12"]
assert utils.classify_codestreams([Codestream("", 15, 2... | 631 | Python | .py | 10 | 41.1 | 88 | 0.452342 | SUSE/klp-build | 8 | 2 | 4 | GPL-2.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,628 | test_ksrc.py | SUSE_klp-build/tests/test_ksrc.py | # SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2021-2024 SUSE
# Author: Marcos Paulo de Souza
from klpbuild.ksrc import GitHelper
import pytest
def test_multiline_upstream_commit_subject():
_, subj = GitHelper.get_commit_data("49c47cc21b5b")
assert subj == "net: tls: fix possible race condition bet... | 648 | Python | .py | 14 | 43.285714 | 120 | 0.749206 | SUSE/klp-build | 8 | 2 | 4 | GPL-2.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,629 | utils.py | SUSE_klp-build/tests/utils.py | # SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2021-2024 SUSE
# Author: Marcos Paulo de Souza
from pathlib import Path
from klpbuild.config import Config
def get_workdir(lp_name, lp_filter):
return Config(lp_name, lp_filter).lp_path
def get_file_content(lp_name, filter, fname=None):
# Check the g... | 528 | Python | .py | 15 | 31.4 | 65 | 0.700197 | SUSE/klp-build | 8 | 2 | 4 | GPL-2.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,630 | test_config.py | SUSE_klp-build/tests/test_config.py | # SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2024 SUSE
# Author: Marcos Paulo de Souza <mpdesouza@suse.com>
from klpbuild.codestream import Codestream
from klpbuild.config import Config
from tests.utils import get_file_content, get_workdir
def test_filter():
lp = "bsc9999999"
def to_cs(cs_list... | 2,766 | Python | .py | 46 | 34.521739 | 99 | 0.384985 | SUSE/klp-build | 8 | 2 | 4 | GPL-2.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,631 | test_templ.py | SUSE_klp-build/tests/test_templ.py | # SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2021-2024 SUSE
# Author: Marcos Paulo de Souza
from klpbuild.extractor import Extractor
from klpbuild.setup import Setup
import klpbuild.utils as utils
from tests.utils import get_file_content
def test_templ_with_externalized_vars():
lp = "bsc9999999"
... | 3,376 | Python | .py | 65 | 45.507692 | 108 | 0.667476 | SUSE/klp-build | 8 | 2 | 4 | GPL-2.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,632 | codestream.py | SUSE_klp-build/klpbuild/codestream.py | # SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2024 SUSE
# Author: Marcos Paulo de Souza <mpdesouza@suse.com>
from pathlib import Path
import re
from klpbuild.utils import ARCH
class Codestream:
__slots__ = ("data_path", "sle", "sp", "update", "rt", "ktype", "project",
"kernel", "arch... | 5,416 | Python | .py | 133 | 30.984962 | 108 | 0.550048 | SUSE/klp-build | 8 | 2 | 4 | GPL-2.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,633 | inline.py | SUSE_klp-build/klpbuild/inline.py | # SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2021-2024 SUSE
# Author: Marcos Paulo de Souza <mpdesouza@suse.com>
import shutil
from pathlib import Path
import subprocess
from klpbuild.config import Config
from klpbuild.utils import ARCH
class Inliner(Config):
def __init__(self, lp_name, lp_filter):... | 1,602 | Python | .py | 36 | 36.944444 | 91 | 0.638065 | SUSE/klp-build | 8 | 2 | 4 | GPL-2.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,634 | setup.py | SUSE_klp-build/klpbuild/setup.py | # SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2021-2024 SUSE
# Author: Marcos Paulo de Souza <mpdesouza@suse.com>
import copy
import json
import logging
import re
from pathlib import Path
from natsort import natsorted
from klpbuild import utils
from klpbuild.config import Config
from klpbuild.ksrc import... | 5,603 | Python | .py | 122 | 32.303279 | 100 | 0.532794 | SUSE/klp-build | 8 | 2 | 4 | GPL-2.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,635 | config.py | SUSE_klp-build/klpbuild/config.py | # SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2021-2024 SUSE
# Author: Marcos Paulo de Souza <mpdesouza@suse.com>
import configparser
import copy
import json
import logging
import os
import re
from collections import OrderedDict
from pathlib import Path, PurePath
from klpbuild.codestream import Codestream... | 12,413 | Python | .py | 252 | 38.797619 | 133 | 0.603922 | SUSE/klp-build | 8 | 2 | 4 | GPL-2.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,636 | ccp.py | SUSE_klp-build/klpbuild/ccp.py | # SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2021-2024 SUSE
# Author: Marcos Paulo de Souza <mpdesouza@suse.com>
import os
from pathlib import Path
import shutil
from klpbuild.config import Config
from klpbuild.utils import ARCH, is_mod
class CCP(Config):
def __init__(self, lp_name, lp_filter, avoi... | 4,970 | Python | .py | 124 | 28.919355 | 88 | 0.536085 | SUSE/klp-build | 8 | 2 | 4 | GPL-2.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,637 | templ.py | SUSE_klp-build/klpbuild/templ.py | # SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2021-2024 SUSE
# Author: Marcos Paulo de Souza <mpdesouza@suse.com>
import shutil
from datetime import datetime
from pathlib import Path
from mako.lookup import TemplateLookup
from mako.template import Template
from klpbuild.config import Config
from klpbuild... | 19,282 | Python | .py | 567 | 26.897707 | 102 | 0.570614 | SUSE/klp-build | 8 | 2 | 4 | GPL-2.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,638 | ce.py | SUSE_klp-build/klpbuild/ce.py | # SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2021-2024 SUSE
# Author: Marcos Paulo de Souza <mpdesouza@suse.com>
import shutil
from pathlib import Path
from klpbuild.config import Config
from klpbuild.utils import ARCH
class CE(Config):
def __init__(self, lp_name, lp_filter, avoid_ext, ignore_error... | 3,176 | Python | .py | 72 | 33.472222 | 94 | 0.565542 | SUSE/klp-build | 8 | 2 | 4 | GPL-2.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,639 | utils.py | SUSE_klp-build/klpbuild/utils.py | # SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2021-2024 SUSE
# Author: Marcos Paulo de Souza <mpdesouza@suse.com>
import gzip
import io
import platform
from elftools.common.utils import bytes2str
from elftools.elf.elffile import ELFFile
from elftools.elf.sections import SymbolTableSection
import lzma
imp... | 3,730 | Python | .py | 104 | 27.875 | 72 | 0.596662 | SUSE/klp-build | 8 | 2 | 4 | GPL-2.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,640 | ksrc.py | SUSE_klp-build/klpbuild/ksrc.py | # SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2021-2024 SUSE
# Author: Marcos Paulo de Souza <mpdesouza@suse.com
import logging
import re
import shutil
import subprocess
import sys
from datetime import datetime
from pathlib import Path
from pathlib import PurePath
import git
import requests
from natsort i... | 22,584 | Python | .py | 486 | 32.45679 | 116 | 0.535214 | SUSE/klp-build | 8 | 2 | 4 | GPL-2.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,641 | ibs.py | SUSE_klp-build/klpbuild/ibs.py | # SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2021-2024 SUSE
# Author: Marcos Paulo de Souza <mpdesouza@suse.com>
import concurrent.futures
import errno
import logging
import os
import re
import shutil
import subprocess
import sys
import time
from operator import itemgetter
from pathlib import Path
import ... | 21,600 | Python | .py | 455 | 34.736264 | 126 | 0.551658 | SUSE/klp-build | 8 | 2 | 4 | GPL-2.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,642 | main.py | SUSE_klp-build/klpbuild/main.py | # SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2021-2024 SUSE
# Author: Marcos Paulo de Souza <mpdesouza@suse.com>
import sys
from klpbuild.cmd import main_func
def main():
main_func(sys.argv[1:])
if __name__ == "__main__":
main()
| 256 | Python | .py | 10 | 23.2 | 52 | 0.695833 | SUSE/klp-build | 8 | 2 | 4 | GPL-2.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,643 | cmd.py | SUSE_klp-build/klpbuild/cmd.py | # SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2021-2024 SUSE
# Author: Marcos Paulo de Souza <mpdesouza@suse.com>
import argparse
from klpbuild.codestream import Codestream
from klpbuild.extractor import Extractor
from klpbuild.ibs import IBS
from klpbuild.inline import Inliner
from klpbuild.ksrc import G... | 8,416 | Python | .py | 199 | 34.994975 | 122 | 0.643293 | SUSE/klp-build | 8 | 2 | 4 | GPL-2.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,644 | extractor.py | SUSE_klp-build/klpbuild/extractor.py | # SPDX-License-Identifier: GPL-2.0-only
#
# Copyright (C) 2021-2024 SUSE
# Author: Marcos Paulo de Souza <mpdesouza@suse.com>
import concurrent.futures
import difflib as dl
import json
import logging
import os
import re
import shutil
import subprocess
import sys
from collections import OrderedDict
from pathlib import ... | 20,784 | Python | .py | 439 | 35.164009 | 112 | 0.562602 | SUSE/klp-build | 8 | 2 | 4 | GPL-2.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,645 | __init__.py | PaladinStudiosBVs_Blender-RigAssistant/Blender-RigAssistant/__init__.py | # Addon info
bl_info = {
"name": "Blender Rig Assistant",
"description":"Rig anything with ease",
"author": "Thomas Breuker",
"blender": (3, 4, 1),
"version": (0, 0, 2),
"category": "Rigging",
"location": "View3D > Sidebar > RigAssistant",
"warning": "",
"wiki_url": "",
"tracker_... | 5,959 | Python | .py | 129 | 39.162791 | 219 | 0.677213 | PaladinStudiosBVs/Blender-RigAssistant | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,646 | deformbones.py | PaladinStudiosBVs_Blender-RigAssistant/Blender-RigAssistant/operators/deformbones.py | import bpy
from mathutils import Vector
# Handles everything related to deform bones parenting and naming
class OBJECT_OT_disconnect_bones(bpy.types.Operator):
bl_idname = 'object.disconnect_bones'
bl_label = "Disconnect Bones"
#Simple operator disconnects bones from eachother
def execute (self, conte... | 4,936 | Python | .py | 94 | 42.659574 | 118 | 0.656883 | PaladinStudiosBVs/Blender-RigAssistant | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,647 | ctrlbones.py | PaladinStudiosBVs_Blender-RigAssistant/Blender-RigAssistant/operators/ctrlbones.py | import bpy
from mathutils import Vector
#Handles everything related to CTRL_, offset and location bones
class OBJECT_OT_create_control_bone(bpy.types.Operator):
"""creates a cnstr bone for selected bones"""
bl_idname = 'object.create_control_bone'
bl_label = "Create Control Bones"
# Creates a control b... | 11,449 | Python | .py | 195 | 45.097436 | 134 | 0.623228 | PaladinStudiosBVs/Blender-RigAssistant | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,648 | cnstrbones.py | PaladinStudiosBVs_Blender-RigAssistant/Blender-RigAssistant/operators/cnstrbones.py | import bpy
from mathutils import Vector
# Does everything with the CNSTR bones and creating constraints
class OBJECT_OT_create_cnstr(bpy.types.Operator):
"""creates a cnstr bone for selected bones"""
bl_idname = 'object.create_cnstr'
bl_label = "Create Constraint Bones"
#Creates a duplicate of the sele... | 23,267 | Python | .py | 381 | 46.464567 | 138 | 0.624921 | PaladinStudiosBVs/Blender-RigAssistant | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,649 | rigshapes.py | PaladinStudiosBVs_Blender-RigAssistant/Blender-RigAssistant/operators/rigshapes.py | import bpy
from mathutils import Vector
# Create different shapes that can be used as bone shapes
class OBJECT_OT_create_circle(bpy.types.Operator):
bl_idname = 'object.create_circle'
bl_label = "Circle"
def execute (self, context):
if bpy.context.selected_objects:
bpy.ops.object.mode_... | 2,760 | Python | .py | 63 | 36.126984 | 87 | 0.656098 | PaladinStudiosBVs/Blender-RigAssistant | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,650 | config.py | tinaarobot_XSPAM/config.py |
import logging
from telethon import TelegramClient
from os import getenv
from ROYEDITX.data import AVISHA
logging.basicConfig(format='[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s', level=logging.WARNING)
# VALUES REQUIRED FOR XBOTS
API_ID = 18136872
API_HASH = "312d861b78efcd1b02183b2ab52a... | 868 | Python | .py | 19 | 42 | 105 | 0.711328 | tinaarobot/XSPAM | 8 | 22 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,651 | main.py | tinaarobot_XSPAM/main.py | import sys
import glob
import asyncio
import logging
import importlib
import urllib3
from pathlib import Path
from config import X1
logging.basicConfig(format='[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s', level=logging.WARNING)
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
def load_plu... | 1,108 | Python | .py | 29 | 34.206897 | 104 | 0.735741 | tinaarobot/XSPAM | 8 | 22 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,652 | data.py | tinaarobot_XSPAM/ROYEDITX/data.py |
RAID = [
"ЁЭЧаЁЭЧФ╠ВЁЭЧФ╠ВЁЭЧЧЁЭЧФЁЭЧеЁЭЧЦЁЭЧЫ├ШЁЭЧЧ ЁЭЧзЁЭЧШЁЭЧеЁЭЧЬ ЁЭЧаЁЭЧФ╠БЁЭЧФ╠А ЁЭЧЮЁЭЧЬ ЁЭЧЦЁЭЧЫЁЭЧиЁЭЧи╠БЁЭЧз ЁЭЧаЁЭЧШ ЁЭЧЪЁЭЧЫЁЭЧиЁЭЧзЁЭЧЮЁЭЧФ ЁЭЧЮЁЭЧЫЁЭЧФЁЭЧФЁЭЧЮЁЭЧШ ЁЭЧзЁЭЧЫЁЭЧвЁЭЧвЁЭЧЮ ЁЭЧЧЁЭЧиЁЭЧбЁЭЧЪЁЭЧФ ЁЯдгЁЯдг",
"ЁЭЧзЁЭЧШЁЭЧеЁЭЧШ ЁЭЧХЁЭЧШ╠БЁЭЧЫЁЭЧШЁЭЧб ЁЭЧЮ ЁЭЧЦЁЭЧЫЁЭЧиЁЭЧи╠БЁЭЧз ЁЭЧаЁЭЧШ ЁЭ... | 68,217 | Python | .py | 698 | 92.45702 | 723 | 0.824063 | tinaarobot/XSPAM | 8 | 22 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,653 | help.py | tinaarobot_XSPAM/ROYEDITX/modules/help.py | from telethon import events, Button
from config import X1, SUDO_USERS, CMD_HNDLR as hl
HELP_STRING = f"**✦ ᴄʟɪᴄᴋ �ɴ ʙᴇʟ�ᴡ ʙᴜᴛᴛ�ɴꜱ ꜰ�ʀ xsᴘᴀ� ʜᴇʟᴘ �͟�͟�★**"
HELP_BUTTON = [
[
Button.inline("ꜱᴘᴀ�", data="spam"),
Button.inline("ʀᴀɪá... | 4,392 | Python | .py | 104 | 37.163462 | 168 | 0.500822 | tinaarobot/XSPAM | 8 | 22 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,654 | bot.py | tinaarobot_XSPAM/ROYEDITX/modules/bot.py | import sys
import heroku3
from config import X1, OWNER_ID, SUDO_USERS, HEROKU_APP_NAME, HEROKU_API_KEY, CMD_HNDLR as hl
from pyrogram import enums
from os import execl, getenv
from telethon import events
from datetime import datetime
@X1.on(events.NewMessage(incoming=True, pattern=r"\%sping(?: |$)(.*)" % hl))
async ... | 2,515 | Python | .py | 56 | 36.107143 | 131 | 0.54321 | tinaarobot/XSPAM | 8 | 22 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,655 | raid.py | tinaarobot_XSPAM/ROYEDITX/modules/raid.py | import asyncio
from random import choice
from telethon import events
from pyrogram import enums
from config import X1, SUDO_USERS, OWNER_ID, CMD_HNDLR as hl
from ROYEDITX.data import RAID, REPLYRAID, AVISHA, MRAID, SRAID, CRAID, AVISHA
REPLY_RAID = []
@X1.on(events.NewMessage(incoming=True, pattern=r"\%sraid(?: |... | 9,154 | Python | .py | 170 | 41.794118 | 263 | 0.508945 | tinaarobot/XSPAM | 8 | 22 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,656 | start.py | tinaarobot_XSPAM/ROYEDITX/modules/start.py | from telethon import __version__, events, Button
from config import X1
START_BUTTON = [
[
Button.url("ᴀᴅᴅ ᴍᴇ ʙᴀʙʏ", "https://t.me/avishaxbot?startgroup=true")
],
[
Button.url("sᴜᴘᴘᴏʀᴛ", "https://t.me/the_friendz"),
Button.url("ʀᴇᴘᴏ", "https://github.com/tinaarobot/XSPAM")
],
... | 1,551 | Python | .py | 31 | 32.483871 | 187 | 0.545968 | tinaarobot/XSPAM | 8 | 22 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,657 | leave.py | tinaarobot_XSPAM/ROYEDITX/modules/leave.py | from config import X1, SUDO_USERS, CMD_HNDLR as hl
from telethon import events
from telethon.tl.functions.channels import LeaveChannelRequest
from pyrogram import enums
@X1.on(events.NewMessage(incoming=True, pattern=r"\%sleave(?: |$)(.*)" % hl))
async def leave(e):
if e.sender_id == enums.ChatMemberStatus.ADMIN... | 1,312 | Python | .py | 24 | 35.75 | 158 | 0.569767 | tinaarobot/XSPAM | 8 | 22 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,658 | logs.py | tinaarobot_XSPAM/ROYEDITX/modules/logs.py | import asyncio
import heroku3
from config import X1, SUDO_USERS, OWNER_ID, HEROKU_API_KEY, HEROKU_APP_NAME, CMD_HNDLR as hl
from pyrogram import enums
from datetime import datetime
from telethon import events
from telethon.errors import ForbiddenError
@X1.on(events.NewMessage(incoming=True, pattern=r"\%slogs(?: |$... | 1,889 | Python | .py | 39 | 35.74359 | 133 | 0.616019 | tinaarobot/XSPAM | 8 | 22 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,659 | echo.py | tinaarobot_XSPAM/ROYEDITX/modules/echo.py | import asyncio
import base64
from telethon import events
from telethon.tl.functions.messages import ImportChatInviteRequest as Get
from pyrogram import enums
from config import X1, SUDO_USERS, OWNER_ID, CMD_HNDLR as hl
from ROYEDITX.data import AVISHA
ECHO = []
@X1.on(events.NewMessage(incoming=True, pattern=r"\%... | 3,190 | Python | .py | 67 | 36.089552 | 138 | 0.52584 | tinaarobot/XSPAM | 8 | 22 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,660 | build_extensions.py | auto-differentiation_xad-py/build_extensions.py | ##############################################################################
#
# Build file for extension module - using pre-built binary with pybind.
#
# This was inspired by:
# https://github.com/pybind/cmake_example/blob/master/setup.py
#
# This file is part of XAD's Python bindings, a comprehensive library fo... | 7,638 | Python | .py | 152 | 42.585526 | 141 | 0.637314 | auto-differentiation/xad-py | 8 | 1 | 12 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,661 | __init__.py | auto-differentiation_xad-py/xad/__init__.py | ##############################################################################
#
# XAD Python bindings
#
# This file is part of XAD's Python bindings, a comprehensive library for
# automatic differentiation.
#
# Copyright (C) 2010-2024 Xcelerit Computing Ltd.
#
# This program is free software: you can redistribute... | 2,096 | Python | .py | 49 | 39.265306 | 85 | 0.654224 | auto-differentiation/xad-py | 8 | 1 | 12 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,662 | __init__.py | auto-differentiation_xad-py/xad/exceptions/__init__.py | ##############################################################################
#
# Exceptions module for the XAD Python bindings
#
# This file is part of XAD's Python bindings, a comprehensive library for
# automatic differentiation.
#
# Copyright (C) 2010-2024 Xcelerit Computing Ltd.
#
# This program is free soft... | 1,318 | Python | .py | 37 | 33.486486 | 78 | 0.664582 | auto-differentiation/xad-py | 8 | 1 | 12 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,663 | __init__.py | auto-differentiation_xad-py/xad/adj_1st/__init__.py | ##############################################################################
#
# First order adjoint mode module for the XAD Python bindings
#
# This file is part of XAD's Python bindings, a comprehensive library for
# automatic differentiation.
#
# Copyright (C) 2010-2024 Xcelerit Computing Ltd.
#
# This progra... | 2,593 | Python | .py | 66 | 36.424242 | 100 | 0.683682 | auto-differentiation/xad-py | 8 | 1 | 12 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,664 | __init__.py | auto-differentiation_xad-py/xad/math/__init__.py | ##############################################################################
#
# Math module for the XAD Python bindings
#
# This file is part of XAD's Python bindings, a comprehensive library for
# automatic differentiation.
#
# Copyright (C) 2010-2024 Xcelerit Computing Ltd.
#
# This program is free software: ... | 3,358 | Python | .py | 159 | 17.150943 | 88 | 0.587107 | auto-differentiation/xad-py | 8 | 1 | 12 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,665 | __init__.py | auto-differentiation_xad-py/xad/fwd_1st/__init__.py | ##############################################################################
#
# First order forward mode module for the XAD Python bindings
#
# This file is part of XAD's Python bindings, a comprehensive library for
# automatic differentiation.
#
# Copyright (C) 2010-2024 Xcelerit Computing Ltd.
#
# This progra... | 2,284 | Python | .py | 58 | 37.034483 | 99 | 0.677989 | auto-differentiation/xad-py | 8 | 1 | 12 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,666 | swap_pricer.py | auto-differentiation_xad-py/samples/swap_pricer.py | ##############################################################################
#
# Computes the discount rate sensitivities of a simple swap pricer
# using adjoint mode.
#
# This file is part of XAD's Python bindings, a comprehensive library for
# automatic differentiation.
#
# Copyright (C) 2010-2024 Xcelerit Com... | 3,067 | Python | .py | 77 | 36.623377 | 94 | 0.664315 | auto-differentiation/xad-py | 8 | 1 | 12 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,667 | fwd_1st.py | auto-differentiation_xad-py/samples/fwd_1st.py | ##############################################################################
#
# Sample for 1st order forward mode in Python.
#
# Computes
# y = f(x0, x1, x2, x3)
# and it's first order derivative w.r.t. x0 using forward mode:
# dy/dx0
#
# This file is part of XAD's Python bindings, a comprehensive ... | 1,715 | Python | .py | 49 | 33.857143 | 78 | 0.664858 | auto-differentiation/xad-py | 8 | 1 | 12 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,668 | adj_1st.py | auto-differentiation_xad-py/samples/adj_1st.py | ##############################################################################
#
# Sample for first-order adjoint calculation with Python
#
# Computes
# y = f(x0, x1, x2, x3)
# and its first order derivatives
# dy/dx0, dy/dx1, dy/dx2, dy/dx3
# using adjoint mode.
#
# This file is part of XAD's Pyth... | 2,015 | Python | .py | 61 | 30.491803 | 78 | 0.681584 | auto-differentiation/xad-py | 8 | 1 | 12 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,669 | test_tape.py | auto-differentiation_xad-py/tests/test_tape.py | ##############################################################################
#
# Test the adjoint tape in Python.
#
# This file is part of XAD's Python bindings, a comprehensive library for
# automatic differentiation.
#
# Copyright (C) 2010-2024 Xcelerit Computing Ltd.
#
# This program is free software: you can... | 4,361 | Python | .py | 125 | 28.416 | 96 | 0.605413 | auto-differentiation/xad-py | 8 | 1 | 12 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,670 | test_package.py | auto-differentiation_xad-py/tests/test_package.py | ##############################################################################
#
# Pytests for the overall package interface
#
# This file is part of XAD's Python bindings, a comprehensive library for
# automatic differentiation.
#
# Copyright (C) 2010-2024 Xcelerit Computing Ltd.
#
# This program is free software... | 1,116 | Python | .py | 26 | 41.692308 | 78 | 0.658088 | auto-differentiation/xad-py | 8 | 1 | 12 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,671 | test_exceptions.py | auto-differentiation_xad-py/tests/test_exceptions.py | ##############################################################################
#
# Test exceptions bindings.
#
# This file is part of XAD's Python bindings, a comprehensive library for
# automatic differentiation.
#
# Copyright (C) 2010-2024 Xcelerit Computing Ltd.
#
# This program is free software: you can redist... | 2,666 | Python | .py | 65 | 36.246154 | 96 | 0.66821 | auto-differentiation/xad-py | 8 | 1 | 12 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,672 | test_math_functions_derivatives.py | auto-differentiation_xad-py/tests/test_math_functions_derivatives.py | ##############################################################################
#
# Pytests for math functions and their derivatives
#
# This file is part of XAD's Python bindings, a comprehensive library for
# automatic differentiation.
#
# Copyright (C) 2010-2024 Xcelerit Computing Ltd.
#
# This program is free s... | 15,863 | Python | .py | 410 | 32.987805 | 100 | 0.599766 | auto-differentiation/xad-py | 8 | 1 | 12 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,673 | test_real_operations.py | auto-differentiation_xad-py/tests/test_real_operations.py | ##############################################################################
#
# Pytests for operations and derivatives on the active types
#
# This file is part of XAD's Python bindings, a comprehensive library for
# automatic differentiation.
#
# Copyright (C) 2010-2024 Xcelerit Computing Ltd.
#
# This program... | 20,374 | Python | .py | 494 | 36.973684 | 91 | 0.624766 | auto-differentiation/xad-py | 8 | 1 | 12 | AGPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,674 | model_cl.py | disungatullina_MinBackProp/model_cl.py | import time
from ransac import RANSAC
from estimators.essential_matrix_estimator_nister import *
from samplers.uniform_sampler import *
from samplers.gumbel_sampler import *
from scorings.msac_score import *
import torch.nn as nn
import torch.nn.functional as F
from cv_utils import *
def batch_episym(x1, x2, F):
... | 14,555 | Python | .py | 357 | 30.291317 | 88 | 0.551168 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,675 | datasets.py | disungatullina_MinBackProp/datasets.py | import math
import os
import cv2
import h5py
import numpy as np
import torch
import torch.utils.data as data
class Dataset(data.Dataset):
"""From NG-RANSAC collect the correspondences."""
def __init__(self, folders, ratiothreshold=0.8, nfeatures=2000):
# access the input points
self.nfeature... | 18,453 | Python | .py | 357 | 47.733894 | 120 | 0.553109 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,676 | nodes.py | disungatullina_MinBackProp/nodes.py | import math
import torch
import random
import time
import numpy as np
import torch.nn as nn
from torch.autograd import Function
from ddn.ddn.pytorch.node import *
import estimators.essential_matrix_estimator_nister as ns
############ IFT function ############
class IFTFunction(torch.autograd.Function):
# No... | 23,922 | Python | .py | 774 | 24.359173 | 94 | 0.400972 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,677 | test.py | disungatullina_MinBackProp/test.py | import torch
from tqdm import tqdm
from model_cl import *
from utils import *
from datasets import Dataset
def test(model, test_loader, opt):
OUT_DIR = "results/"
with torch.no_grad():
if opt.precision == 2:
data_type = torch.float64
elif opt.precision == 0:
data_type ... | 4,507 | Python | .py | 118 | 27.830508 | 119 | 0.535453 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,678 | test_magsac.py | disungatullina_MinBackProp/test_magsac.py | import numpy as np
import torch
import time
import pymagsac
from tqdm import tqdm
from model_cl import *
from utils import *
from datasets import Dataset
def test(model, test_loader, opt):
with torch.no_grad():
avg_model_time = 0 # runtime of the network forward pass
avg_ransac_time = 0 # runtim... | 7,654 | Python | .py | 193 | 25.891192 | 97 | 0.480301 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,679 | utils.py | disungatullina_MinBackProp/utils.py | import cv2
import torch
import argparse
import torch.nn as nn
def create_parser(description):
"""Create a default command line parser with the most common options.
Keyword arguments:
description -- description of the main functionality of a script/program
"""
parser = argparse.ArgumentParser(
... | 5,708 | Python | .py | 178 | 25.320225 | 99 | 0.611061 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,680 | train.py | disungatullina_MinBackProp/train.py | import numpy as np
import torch
import torch.nn.functional as F
from tqdm import tqdm
from loss import *
from model_cl import *
from datasets import Dataset
from tensorboardX import SummaryWriter
from sklearn.model_selection import train_test_split
import time
import warnings
warnings.filterwarnings("ignore")
RANDOM... | 8,402 | Python | .py | 222 | 28.171171 | 93 | 0.572919 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,681 | feature_utils.py | disungatullina_MinBackProp/feature_utils.py | import torch
import torch.nn.functional as F
# import kornia as K
# import kornia.feature as KF
import cv2
import os
import h5py
import numpy as np
from utils import *
# from kornia_moons.feature import *
def load_h5(filename):
"""Loads dictionary from hdf5 file."""
dict_to_load = {}
if not os.path.exi... | 1,651 | Python | .py | 47 | 30.382979 | 102 | 0.65932 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,682 | ransac.py | disungatullina_MinBackProp/ransac.py | import math
from feature_utils import *
from samplers.uniform_sampler import *
from nodes import IFTLayer, EssentialMatrixNode
from ddn.ddn.pytorch.node import *
class RANSAC(object):
def __init__(
self,
estimator,
sampler,
scoring,
train=False,
ransac_batch_size=6... | 13,751 | Python | .py | 309 | 27.63754 | 124 | 0.493659 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,683 | cv_utils.py | disungatullina_MinBackProp/cv_utils.py | import cv2
import math
import torch
import numpy as np
def normalize_pts(pts, im_size):
"""Normalize image coordinate using the image size.
Pre-processing of correspondences before passing them to the network to be
independent of image resolution.
Re-scales points such that max image dimension goes f... | 21,871 | Python | .py | 547 | 32.817185 | 123 | 0.56399 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,684 | loss.py | disungatullina_MinBackProp/loss.py | import cv2
import torch
import torch.nn as nn
from cv_utils import *
from math_utils import *
import numpy as np
from scorings.msac_score import *
from feature_utils import *
class MatchLoss(object):
"""Rewrite Match loss from CLNet, symmetric epipolar distance"""
def __init__(self):
self.scoring_fun... | 1,811 | Python | .py | 45 | 29.733333 | 88 | 0.546644 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,685 | math_utils.py | disungatullina_MinBackProp/math_utils.py | import math
import torch
def multi_cubic(a0, b0, c0, d0, all_roots=True):
"""Analytical closed-form solver for multiple cubic equations (3rd order polynomial), based on `numpy`
functions.
Parameters
----------
a0, b0, c0, d0: array_like
Input data are coefficients of the Cubic polynomial:... | 18,515 | Python | .py | 465 | 28.793548 | 140 | 0.470654 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,686 | essential_matrix_estimator_nister.py | disungatullina_MinBackProp/estimators/essential_matrix_estimator_nister.py | import torch
import numpy as np
from math_utils import *
from utils import *
from cv_utils import *
try:
from pymagsac import optimizeEssentialMatrix
pymagsac_available = 1
def numerical_optimization(
matches,
weights,
K1,
K2,
inlier_indices,
best_model,
... | 39,248 | Python | .py | 861 | 32.341463 | 120 | 0.26462 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,687 | uniform_sampler.py | disungatullina_MinBackProp/samplers/uniform_sampler.py | import torch
import random
class UniformSampler(object):
"""Random sampling the points, return the indices for each unique subset, or in batch."""
def __init__(self, batch_size, num_samples, num_points):
self.batch_size = batch_size
self.num_samples = num_samples
self.num_points = num... | 987 | Python | .py | 23 | 35.217391 | 93 | 0.658664 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,688 | gumbel_sampler.py | disungatullina_MinBackProp/samplers/gumbel_sampler.py | import torch
# from estimators.fundamental_matrix_estimator import *
# from estimators.essential_matrix_estimator_stewenius import *
from loss import *
import numpy as np
import random
class GumbelSoftmaxSampler:
"""Sample based on a Gumbel-Max distribution.
Use re-param trick for back-prop
"""
def... | 1,763 | Python | .py | 45 | 29.733333 | 88 | 0.6 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,689 | estimate_rotation.py | disungatullina_MinBackProp/toy_examples/estimate_rotation.py | import os
import sys
import torch
import argparse
from math import degrees
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))
import rotation.losses as L
from ddn.ddn.pytorch.node import *
from rotation.nodes import RigitNodeConstraint, SVDLayer, IFTLayer
from rotation.datasets import get... | 5,443 | Python | .py | 161 | 27.118012 | 88 | 0.621143 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,690 | estimate_fundamental.py | disungatullina_MinBackProp/toy_examples/estimate_fundamental.py | import os
import sys
import torch
import argparse
import warnings
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))
from ddn.ddn.pytorch.node import *
import fundamental.losses as L
from fundamental.datasets import get_dataset
from fundamental.nodes import SVDLayer, FundamentalNodeCons... | 4,941 | Python | .py | 152 | 25.605263 | 88 | 0.607653 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,691 | utils.py | disungatullina_MinBackProp/toy_examples/utils.py | import os
import torch
import matplotlib.pyplot as plt
def get_initial_weights(b, n, init_type):
# Generate weights (uniform):
if init_type == "uniform":
w = torch.ones(b, n, dtype=torch.float) # b x n
w = w.div(w.sum(-1).unsqueeze(-1))
# Generate weights (random):
elif init_type == "... | 2,245 | Python | .py | 68 | 25.514706 | 85 | 0.576232 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,692 | datasets.py | disungatullina_MinBackProp/toy_examples/fundamental/datasets.py | import torch
def create_toy_dataset():
"""
N = 15 correspondences, without noise added; b = 1
A : b x N x 3
B : b x N x 3
F_true : b x 3 x 3
gt_mask : b x N
"""
A = torch.tensor(
[
[
[-915.685, 834.329, 1.0],
[646.367, 254.628, 1.0],... | 2,096 | Python | .py | 67 | 19.268657 | 85 | 0.383094 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,693 | nodes.py | disungatullina_MinBackProp/toy_examples/fundamental/nodes.py | import torch
import torch.nn as nn
from ddn.ddn.pytorch.node import *
mask = torch.ones(3)
mask[2] = 0.0
############ DDN with constraint ############
class FundamentalNodeConstraint(EqConstDeclarativeNode):
"""Declarative Fundamental matrix estimation node constraint"""
def __init__(self):
supe... | 488,776 | Python | .py | 15,261 | 20.190486 | 84 | 0.310999 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,694 | losses.py | disungatullina_MinBackProp/toy_examples/fundamental/losses.py | import torch
def frobenius_norm(F_true, F):
"""Squared Frobenius norm of matrices' difference"""
return ((F - F_true) ** 2).sum(dim=(-2, -1))
| 152 | Python | .py | 4 | 34.5 | 56 | 0.643836 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,695 | datasets.py | disungatullina_MinBackProp/toy_examples/rotation/datasets.py | import torch
def create_toy_dataset():
p1 = torch.Tensor([1, 0, 0]).unsqueeze(0)
p2 = torch.Tensor([0.0472, 0.9299, 0.7934]).unsqueeze(0)
p3 = torch.Tensor([0.7017, 0.1494, 0.7984]).unsqueeze(0)
p4 = torch.Tensor([0.6007, 0.8878, 0.9169]).unsqueeze(0)
P = torch.cat([p1, p2, p3, p4], dim=0).permute... | 822 | Python | .py | 16 | 46.6875 | 82 | 0.619524 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,696 | nodes.py | disungatullina_MinBackProp/toy_examples/rotation/nodes.py | import torch
import torch.nn as nn
from ddn.ddn.pytorch.node import *
############ DDN with constraint ############
class RigitNodeConstraint(EqConstDeclarativeNode):
"""Declarative Rigit node with R^T R = I constraint"""
def __init__(self):
super().__init__()
def objective(self, A, B, w, y):... | 72,996 | Python | .py | 2,360 | 19.849153 | 82 | 0.30036 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,697 | losses.py | disungatullina_MinBackProp/toy_examples/rotation/losses.py | import torch
def angle_error(R_true, R):
"""Pytorch inplementation of (0.5 * trace(R^(-1)R) - 1)"""
max_dot_product = 1.0 - 1e-8
error_rotation = (
(0.5 * ((R * R_true).sum(dim=(-2, -1)) - 1.0))
# .clamp_(-max_dot_product, max_dot_product)
.clamp_(-max_dot_product, max_dot_product)... | 442 | Python | .py | 12 | 31.5 | 62 | 0.565728 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,698 | msac_score.py | disungatullina_MinBackProp/scorings/msac_score.py | import torch
class MSACScore(object):
def __init__(self, device="cuda"):
# self.threshold = (3 / 2 * threshold)**2
# self.th = (3 / 2) * threshold
self.device = device
self.provides_inliers = True
def score(self, matches, models, threshold=0.75):
"""Rewrite from Graph-... | 2,366 | Python | .py | 50 | 37.92 | 151 | 0.59158 | disungatullina/MinBackProp | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |
2,288,699 | gen_data.py | XintSong_RMSF-net/gen_data.py | import numpy as np
import torch
import mrcfile
from scipy import ndimage
import subprocess
import sys
from moleculekit.molecule import Molecule
import os
def parse_map(map_file, r=1.5):
mrc = mrcfile.open(map_file, 'r')
voxel_size = np.asarray(
[mrc.voxel_size.x, mrc.voxel_size.y, mrc.voxel_size.z], ... | 13,295 | Python | .py | 270 | 39.285185 | 145 | 0.572743 | XintSong/RMSF-net | 8 | 1 | 0 | GPL-3.0 | 9/5/2024, 10:48:34 PM (Europe/Amsterdam) |