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,283,800 | chatbot.cpython-312.pyc | enginestein_Baker/baker/__pycache__/chatbot.cpython-312.pyc | Ë
?ªõe. ã ó4 — d dl Z d dlZd dlmZ G d„ d« Zy)é Nc ó — e Zd Zd„ Zd„ Zy)ÚChatbotc ó — || _ y )N)Úname)Úselfr s ú E:\Python\Baker\baker\chatbot.pyÚ__init__zChatbot.__init__ s € ؈� ó ... | 1,107 | Python | .pyt | 9 | 121.888889 | 704 | 0.383076 | enginestein/Baker | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:47:27 PM (Europe/Amsterdam) |
2,283,801 | test_loop_trainer.cpython-312.pyc | enginestein_Baker/tests/__pycache__/test_loop_trainer.cpython-312.pyc | Ë
£¨õe ã ól — d dl Z d dlZ G d„ de j « Zedk( r e j « yy)é Nc ó — e Zd Zd„ Zy)ÚTestLoopTrainerc ób — t j j d« }|j ... | 828 | Python | .pyt | 4 | 205.75 | 579 | 0.38303 | enginestein/Baker | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:47:27 PM (Europe/Amsterdam) |
2,283,802 | test_trainer.cpython-312.pyc | enginestein_Baker/tests/__pycache__/test_trainer.cpython-312.pyc | Ë
f©õeû ã ól — d dl Z d dlZ G d„ de j « Zedk( r e j « yy)é Nc ó — e Zd Zd„ Zy)ÚTestTrainerc ó — t j j d« }t d«... | 1,178 | Python | .pyt | 5 | 234.4 | 661 | 0.366269 | enginestein/Baker | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:47:27 PM (Europe/Amsterdam) |
2,283,803 | test_parser.cpython-312.pyc | enginestein_Baker/tests/__pycache__/test_parser.cpython-312.pyc | Ë
e©õe ã ól — d dl Z d dlZ G d„ de j « Zedk( r e j « yy)é Nc ó — e Zd Zd„ Zy)Ú
TestParserc óX — d„ }t j j d« } ||«... | 910 | Python | .pyt | 7 | 128.857143 | 339 | 0.369469 | enginestein/Baker | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:47:27 PM (Europe/Amsterdam) |
2,283,804 | test_functions.cpython-312.pyc | enginestein_Baker/tests/__pycache__/test_functions.cpython-312.pyc | Ë
Cªõe® ã ól — d dl Z d dlZ G d„ de j « Zedk( r e j « yy)é Nc ó$ — e Zd Zd„ Zd„ Zd„ Zd„ Zy)Ú
TestFunctionsc ój — d}t j j |... | 2,087 | Python | .pyt | 15 | 138 | 433 | 0.394597 | enginestein/Baker | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:47:27 PM (Europe/Amsterdam) |
2,283,805 | test_chatbot.cpython-312.pyc | enginestein_Baker/tests/__pycache__/test_chatbot.cpython-312.pyc | Ë
¼õe� ã ó„ — d dl Z d dlZd dlZd dlZd dlZ G d„ dej « Zedk( r ej « yy)é Nc ó — e Zd Zd„ Zy)ÚTestChatbotc ó¢ — t j j t... | 1,420 | Python | .pyt | 10 | 140.9 | 830 | 0.350106 | enginestein/Baker | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:47:27 PM (Europe/Amsterdam) |
2,283,806 | setup.py | Damacero_megadose/setup.py | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name='toutatis',
version="1.26",
packages=find_packages(),
author="megadose",
install_requires=["argparse","requests","phonenumbers","pycountry"],
description="It is a tool written to retrieve private information such a... | 831 | Python | .py | 18 | 41.5 | 146 | 0.704069 | Damacero/megadose | 8 | 1 | 0 | GPL-3.0 | 9/5/2024, 10:47:27 PM (Europe/Amsterdam) |
2,283,807 | core.py | Damacero_megadose/toutatis/core.py | import argparse
import requests
from urllib.parse import quote_plus
from json import dumps, decoder
import phonenumbers
from phonenumbers.phonenumberutil import (
region_code_for_country_code,
region_code_for_number,
)
import pycountry
def getUserId(username,sessionsId):
cookies = {'sessionid': sessionsId... | 5,350 | Python | .py | 121 | 35.92562 | 118 | 0.58628 | Damacero/megadose | 8 | 1 | 0 | GPL-3.0 | 9/5/2024, 10:47:27 PM (Europe/Amsterdam) |
2,283,808 | setup.py | lrslab_Hammerhead/setup.py | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="Hammerhead-View",
version="0.2.0",
author="Xudong Liu",
author_email="xudongliu98@gmail.com",
description="A tool designed to de novo find potential modification sites.",
long_description... | 827 | Python | .py | 26 | 27.807692 | 79 | 0.68256 | lrslab/Hammerhead | 8 | 1 | 0 | GPL-2.0 | 9/5/2024, 10:47:27 PM (Europe/Amsterdam) |
2,283,809 | inference_util.py | sky24h_SDXL_Serverless_Runpod/inference_util.py | import os
# set CUDA_MODULE_LOADING=LAZY to speed up the serverless function
os.environ["CUDA_MODULE_LOADING"] = "LAZY"
# set SAFETENSORS_FAST_GPU=1 to speed up the serverless function
os.environ["SAFETENSORS_FAST_GPU"] = "1"
import tempfile
import PIL.Image
from diffusers import StableDiffusionXLPipeline, DiffusionP... | 12,852 | Python | .py | 250 | 41.652 | 134 | 0.600955 | sky24h/SDXL_Serverless_Runpod | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,810 | test_client.py | sky24h_SDXL_Serverless_Runpod/test_client.py | import runpod
import base64
import json
import time
time_out = 120
with open("test_input.json", "r") as f:
test_input = json.load(f)["input"]
def decode_data(data, save_path):
fh = open(save_path, "wb")
fh.write(base64.b64decode(data))
fh.close()
# Set your API key here
runpod.api_key = ""
assert run... | 1,702 | Python | .py | 50 | 28.2 | 80 | 0.626974 | sky24h/SDXL_Serverless_Runpod | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,811 | server.py | sky24h_SDXL_Serverless_Runpod/server.py | import os
# set CUDA_MODULE_LOADING=LAZY to speed up the serverless function
os.environ["CUDA_MODULE_LOADING"] = "LAZY"
# set SAFETENSORS_FAST_GPU=1 to speed up the serverless function
os.environ["SAFETENSORS_FAST_GPU"] = "1"
import runpod
import base64
import signal
from inference_util import SDXL, check_data_format
... | 1,875 | Python | .py | 44 | 35.840909 | 105 | 0.624931 | sky24h/SDXL_Serverless_Runpod | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,812 | util.py | sky24h_SDXL_Serverless_Runpod/models/util.py | import os
import torch
from safetensors import safe_open
from .convert_from_ckpt import convert_ldm_vae_checkpoint, convert_ldm_unet_checkpoint, convert_sdxl_text_encoder_2_checkpoint
def load_ckpt(model_path, device):
if model_path.endswith(".ckpt"):
state_dict = torch.load(model_path, map_location=dev... | 3,231 | Python | .py | 68 | 40.720588 | 144 | 0.670054 | sky24h/SDXL_Serverless_Runpod | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,813 | convert_from_ckpt.py | sky24h_SDXL_Serverless_Runpod/models/convert_from_ckpt.py | # coding=utf-8
# Copyright 2023 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 42,879 | Python | .py | 756 | 48.271164 | 143 | 0.659219 | sky24h/SDXL_Serverless_Runpod | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,814 | download.py | sky24h_SDXL_Serverless_Runpod/scripts/download.py | import os
from huggingface_hub import hf_hub_download
with open(os.path.join(os.path.dirname(__file__), "download_list.txt"), "r") as r:
download_list = r.read().splitlines()
for download in download_list:
print(download)
repo_id = "stabilityai/" + download.split("/")[1]
subfolder = download.split("/"... | 770 | Python | .py | 13 | 55.307692 | 127 | 0.66755 | sky24h/SDXL_Serverless_Runpod | 8 | 1 | 0 | AGPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,815 | meson_post_install.py | zalesyc_budgie-media-player-applet/meson_post_install.py | #!/usr/bin/env python3
import os
import subprocess
schemadir = os.path.join(
os.environ["MESON_INSTALL_PREFIX"], "share", "glib-2.0", "schemas"
)
hicolordir = os.path.join(
os.environ["MESON_INSTALL_PREFIX"], "share", "icons", "hicolor"
)
if not os.environ.get("DESTDIR"):
print("Compiling gsettings sche... | 483 | Python | .py | 14 | 31.428571 | 70 | 0.704741 | zalesyc/budgie-media-player-applet | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,816 | PopupPlasmaControlView.py | zalesyc_budgie-media-player-applet/src/PopupPlasmaControlView.py | # Copyright 2024, zalesyc and the budgie-media-player-applet contributors
# SPDX-License-Identifier: GPL-3.0-or-later
from SingleAppPlayer import SingleAppPlayer
from EnumsStructs import AlbumCoverType
from Labels import ScrollingLabel, ElliptedLabel
from typing import Callable, Optional, Union
from enum import IntEnu... | 18,070 | Python | .py | 389 | 35.573265 | 88 | 0.616411 | zalesyc/budgie-media-player-applet | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,817 | mprisWrapper.py | zalesyc_budgie-media-player-applet/src/mprisWrapper.py | # Copyright 2023 - 2024, zalesyc and the budgie-media-player-applet contributors
# SPDX-License-Identifier: GPL-3.0-or-later
from typing import Callable, Optional
import gi
gi.require_version("Gio", "2.0")
gi.require_version("GLib", "2.0")
from gi.repository import Gio, GLib
class MprisWrapper:
def __init__(sel... | 4,636 | Python | .py | 122 | 28.057377 | 88 | 0.599778 | zalesyc/budgie-media-player-applet | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,818 | testWin.py | zalesyc_budgie-media-player-applet/src/testWin.py | #! /bin/python3
# Copyright 2023 - 2024, zalesyc and the budgie-media-player-applet contributors
# SPDX-License-Identifier: GPL-3.0-or-later
import sys
import gi.repository
from BudgieMediaPlayer import BudgieMediaPlayer
gi.require_version("Gtk", "3.0")
gi.require_version("Budgie", "1.0")
gi.require_version("GLib", ... | 1,152 | Python | .py | 33 | 28.666667 | 80 | 0.641953 | zalesyc/budgie-media-player-applet | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,819 | BudgieMediaPlayer.py | zalesyc_budgie-media-player-applet/src/BudgieMediaPlayer.py | # Copyright 2023 - 2024, zalesyc and the budgie-media-player-applet contributors
# SPDX-License-Identifier: GPL-3.0-or-later
from dataclasses import dataclass
from typing import Optional, Callable
import gi
from SettingsPage import SettingsPage
from PopupPlasmaControlView import PopupPlasmaControlView
from EnumsStructs... | 11,709 | Python | .py | 249 | 36.566265 | 87 | 0.627575 | zalesyc/budgie-media-player-applet | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,820 | Popover.py | zalesyc_budgie-media-player-applet/src/Popover.py | # Copyright 2024, zalesyc and the budgie-media-player-applet contributors
# SPDX-License-Identifier: GPL-3.0-or-later
import gi
from typing import Optional
from SingleAppPlayer import SingleAppPlayer
gi.require_version("Gtk", "3.0")
gi.require_version("Gio", "2.0")
gi.require_version("Budgie", "1.0")
from gi.reposito... | 2,997 | Python | .py | 69 | 33.449275 | 87 | 0.601852 | zalesyc/budgie-media-player-applet | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,821 | Labels.py | zalesyc_budgie-media-player-applet/src/Labels.py | # Copyright 2024, zalesyc and the budgie-media-player-applet contributors
# SPDX-License-Identifier: GPL-3.0-or-later
from typing import Optional
import gi
gi.require_version("Gtk", "3.0")
gi.require_version("Gdk", "3.0")
gi.require_version("Pango", "1.0")
gi.require_version("GLib", "2.0")
from gi.repository import ... | 8,827 | Python | .py | 222 | 29.576577 | 95 | 0.576115 | zalesyc/budgie-media-player-applet | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,822 | PanelControlView.py | zalesyc_budgie-media-player-applet/src/PanelControlView.py | # Copyright 2024, zalesyc and the budgie-media-player-applet contributors
# SPDX-License-Identifier: GPL-3.0-or-later
from EnumsStructs import AlbumCoverType, AlbumCoverData, PanelLengthMode
from mprisWrapper import MprisWrapper
from dataclasses import dataclass
from typing import Optional, Callable
import gi
gi.requ... | 14,254 | Python | .py | 319 | 33.899687 | 88 | 0.607775 | zalesyc/budgie-media-player-applet | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,823 | SettingsPage.py | zalesyc_budgie-media-player-applet/src/SettingsPage.py | # Copyright 2023 - 2024, zalesyc and the budgie-media-player-applet contributors
# SPDX-License-Identifier: GPL-3.0-or-later
import gi
gi.require_version("Gtk", "3.0")
gi.require_version("Gio", "2.0")
from gi.repository import Gtk, Gio
from Labels import LabelWSubtitle
from EnumsStructs import PanelLengthMode
from m... | 30,068 | Python | .py | 701 | 32.273894 | 131 | 0.598496 | zalesyc/budgie-media-player-applet | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,824 | EnumsStructs.py | zalesyc_budgie-media-player-applet/src/EnumsStructs.py | # Copyright 2024, zalesyc and the budgie-media-player-applet contributors
# SPDX-License-Identifier: GPL-3.0-or-later
from typing import Optional, Union
from enum import IntEnum
from dataclasses import dataclass
import gi
gi.require_version("Gio", "2.0")
gi.require_version("GdkPixbuf", "2.0")
from gi.repository impor... | 862 | Python | .py | 29 | 26.827586 | 73 | 0.76335 | zalesyc/budgie-media-player-applet | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,825 | applet.py | zalesyc_budgie-media-player-applet/src/applet.py | # Copyright 2023 - 2024, zalesyc and the budgie-media-player-applet contributors
# SPDX-License-Identifier: GPL-3.0-or-later
import gi.repository
gi.require_version("Budgie", "1.0")
from gi.repository import Budgie, GObject
from BudgieMediaPlayer import BudgieMediaPlayer
class BudgieMediaPlayerApplet(GObject.GObjec... | 949 | Python | .py | 18 | 47.777778 | 80 | 0.746753 | zalesyc/budgie-media-player-applet | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,826 | SingleAppPlayer.py | zalesyc_budgie-media-player-applet/src/SingleAppPlayer.py | # Copyright 2023 - 2024, zalesyc and the budgie-media-player-applet contributors
# SPDX-License-Identifier: GPL-3.0-or-later
import threading
from typing import Optional, Union, Callable
from dataclasses import dataclass
from urllib.parse import urlparse, ParseResult
import requests
from PanelControlView import PanelC... | 19,563 | Python | .py | 427 | 34.063232 | 88 | 0.591842 | zalesyc/budgie-media-player-applet | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,827 | FixedSizeBin.py | zalesyc_budgie-media-player-applet/src/FixedSizeBin.py | # Copyright 2024, zalesyc and the budgie-media-player-applet contributors
# SPDX-License-Identifier: GPL-3.0-or-later
import gi
from typing import Optional
gi.require_version("Gtk", "3.0")
gi.require_version("Gdk", "3.0")
from gi.repository import Gtk, Gdk
class FixedSizeBin(Gtk.Bin):
"""
A single-child con... | 3,242 | Python | .py | 74 | 34.527027 | 88 | 0.629007 | zalesyc/budgie-media-player-applet | 8 | 0 | 2 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,828 | api_server.py | db0_pictrs-safety/api_server.py | from dotenv import load_dotenv
import os
import logging
import sys
load_dotenv()
from pictrs_safety_api.argparser import args
from pictrs_safety_api.flask import APP
from loguru import logger
if __name__ == "__main__":
if os.getenv("FEDIVERSE_SAFETY_WORKER_AUTH") is None:
logger.critical("You must set th... | 1,310 | Python | .py | 31 | 37.096774 | 131 | 0.693093 | db0/pictrs-safety | 8 | 1 | 2 | AGPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,829 | enums.py | db0_pictrs-safety/pictrs_safety_api/enums.py | import enum
class State(enum.Enum):
WAITING = 0
PROCESSING = 1
DONE = 2
CANCELLED = 3
FAULTED = 4
PARTIAL = 5 | 134 | Python | .py | 8 | 12.75 | 23 | 0.619048 | db0/pictrs-safety | 8 | 1 | 2 | AGPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,830 | argparser.py | db0_pictrs-safety/pictrs_safety_api/argparser.py | import argparse
arg_parser = argparse.ArgumentParser()
arg_parser.add_argument('-i', '--insecure', action="store_true", help="If set, will use http instead of https (useful for testing)")
arg_parser.add_argument('-l', '--listen', action="store", help="Specify which IP to listen to")
arg_parser.add_argument('-v', ... | 946 | Python | .py | 9 | 102.888889 | 189 | 0.734759 | db0/pictrs-safety | 8 | 1 | 2 | AGPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,831 | flask.py | db0_pictrs-safety/pictrs_safety_api/flask.py | import os
from flask import Flask, redirect
from flask_caching import Cache
from werkzeug.middleware.proxy_fix import ProxyFix
from flask_sqlalchemy import SQLAlchemy
from loguru import logger
from sqlalchemy import event
from sqlalchemy.engine import Engine
os.makedirs(os.getenv("FEDIVERSE_SAFETY_IMGDIR"), e... | 1,840 | Python | .py | 50 | 31.48 | 75 | 0.683559 | db0/pictrs-safety | 8 | 1 | 2 | AGPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,832 | utils.py | db0_pictrs-safety/pictrs_safety_api/utils.py | import uuid
import bleach
import secrets
import hashlib
import os
import random
import regex as re
import json
from datetime import datetime
import dateutil.relativedelta
from loguru import logger
from pictrs_safety_api.flask import SQLITE_MODE
random.seed(random.SystemRandom().randint(0, 2**32 - 1))
... | 1,705 | Python | .py | 47 | 31.234043 | 106 | 0.714548 | db0/pictrs-safety | 8 | 1 | 2 | AGPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,833 | __init__.py | db0_pictrs-safety/pictrs_safety_api/__init__.py | import os
import socket
from uuid import uuid4
from pictrs_safety_api.logger import logger
from pictrs_safety_api.flask import APP
from pictrs_safety_api.routes import *
from pictrs_safety_api.apis import apiv1
from pictrs_safety_api.argparser import args
from pictrs_safety_api.consts import PICTRS_SAFETY_VERSION
imp... | 1,015 | Python | .py | 23 | 40.826087 | 156 | 0.762146 | db0/pictrs-safety | 8 | 1 | 2 | AGPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,834 | logger.py | db0_pictrs-safety/pictrs_safety_api/logger.py | import sys
from functools import partialmethod
from loguru import logger
from pictrs_safety_api.argparser import args
STDOUT_LEVELS = ["GENERATION", "PROMPT"]
INIT_LEVELS = ["INIT", "INIT_OK", "INIT_WARN", "INIT_ERR"]
MESSAGE_LEVELS = ["MESSAGE"]
# By default we're at error level or higher
verbosity = 40
qui... | 4,629 | Python | .py | 96 | 43.447917 | 182 | 0.671108 | db0/pictrs-safety | 8 | 1 | 2 | AGPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,835 | routes.py | db0_pictrs-safety/pictrs_safety_api/routes.py | from flask import render_template, redirect, url_for, request
from markdown import markdown
from loguru import logger
from pictrs_safety_api.flask import APP
import pictrs_safety_api.exceptions as e
@logger.catch(reraise=True)
@APP.route('/')
# @cache.cached(timeout=300)
def index():
with open(f'fedi_saf... | 902 | Python | .py | 30 | 22.933333 | 75 | 0.599307 | db0/pictrs-safety | 8 | 1 | 2 | AGPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,836 | exceptions.py | db0_pictrs-safety/pictrs_safety_api/exceptions.py | from werkzeug import exceptions as wze
from loguru import logger
class BadRequest(wze.BadRequest):
def __init__(self, message, log="BadRequest"):
self.specific = message
self.log = log
class Forbidden(wze.Forbidden):
def __init__(self, message, log="Forbidden"):
self.specific... | 1,477 | Python | .py | 39 | 30.384615 | 60 | 0.655271 | db0/pictrs-safety | 8 | 1 | 2 | AGPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,837 | apiv1.py | db0_pictrs-safety/pictrs_safety_api/apis/apiv1.py | from flask import Blueprint
from flask_restx import Api
from importlib import import_module
from pictrs_safety_api.apis.v1 import api as v1
blueprint = Blueprint('apiv1', __name__, url_prefix='/api')
api = Api(blueprint,
version='1.0',
title=f'Pict-rs Safety',
description=f'The API documentatio... | 489 | Python | .py | 15 | 28.266667 | 65 | 0.711538 | db0/pictrs-safety | 8 | 1 | 2 | AGPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,838 | v1.py | db0_pictrs-safety/pictrs_safety_api/apis/models/v1.py | from flask_restx import fields
class Models:
def __init__(self,api):
self.response_model_error = api.model('RequestError', {
'message': fields.String(description="The error message for this status code."),
})
self.response_model_simple_response = api.model('SimpleResponse... | 448 | Python | .py | 9 | 41.111111 | 111 | 0.646119 | db0/pictrs-safety | 8 | 1 | 2 | AGPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,839 | __init__.py | db0_pictrs-safety/pictrs_safety_api/apis/v1/__init__.py | import pictrs_safety_api.apis.v1.base as base
from pictrs_safety_api.apis.v1.base import api
api.add_resource(base.Scan, "/scan/<string:pictrs_id>")
api.add_resource(base.Pop, "/pop")
| 190 | Python | .py | 4 | 45 | 56 | 0.755435 | db0/pictrs-safety | 8 | 1 | 2 | AGPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,840 | base.py | db0_pictrs-safety/pictrs_safety_api/apis/v1/base.py | import os
import time
import json
from uuid import uuid4
from PIL import Image
from io import BytesIO
from werkzeug.datastructures import FileStorage
from flask import request, send_file
from flask_restx import Namespace, Resource, reqparse
from pictrs_safety_api.flask import cache, db
from loguru import logg... | 8,889 | Python | .py | 171 | 40.643275 | 126 | 0.616164 | db0/pictrs-safety | 8 | 1 | 2 | AGPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,841 | worker.py | db0_pictrs-safety/pictrs_safety_api/classes/worker.py | import os
from datetime import datetime, timedelta
class Worker():
last_check_in = None
def __init__(self):
self.check_in()
def check_in(self):
self.last_check_in = datetime.utcnow()
def is_stale(self):
threshold = int(os.getenv("MISSING_WORKER_THRESHOLD", 5))
... | 525 | Python | .py | 15 | 28.133333 | 84 | 0.648594 | db0/pictrs-safety | 8 | 1 | 2 | AGPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,842 | request.py | db0_pictrs-safety/pictrs_safety_api/classes/request.py | from datetime import datetime
from sqlalchemy import Enum
from loguru import logger
from pictrs_safety_api.flask import db
from pictrs_safety_api import enums
class ScanRequest(db.Model):
__tablename__ = "scan_requests"
id = db.Column(db.Integer, primary_key=True)
image = db.Column(db.Text, ... | 800 | Python | .py | 17 | 41.176471 | 86 | 0.726918 | db0/pictrs-safety | 8 | 1 | 2 | AGPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,843 | __init__.py | db0_pictrs-safety/pictrs_safety_api/classes/__init__.py | from pictrs_safety_api.flask import db, APP
# Importing for DB creation
from pictrs_safety_api.classes.request import ScanRequest
with APP.app_context():
db.create_all() | 183 | Python | .py | 5 | 33 | 58 | 0.780347 | db0/pictrs-safety | 8 | 1 | 2 | AGPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,844 | functions.py | db0_pictrs-safety/pictrs_safety_api/database/functions.py | from loguru import logger
from sqlalchemy import func, or_, and_, not_, Boolean
from sqlalchemy.orm import noload
from pictrs_safety_api.flask import db
from pictrs_safety_api.utils import hash_api_key
from sqlalchemy.orm import joinedload
from pictrs_safety_api.classes.request import ScanRequest
from pictrs_saf... | 1,106 | Python | .py | 33 | 27.787879 | 58 | 0.697084 | db0/pictrs-safety | 8 | 1 | 2 | AGPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,845 | main.py | anupammaurya6767_Botzy/Google-Drive-Uploader-Bot/main.py | import os
from pydrive2.drive import GoogleDrive
from pydrive2.auth import GoogleAuth
gauth = GoogleAuth()
gauth.LocalWebserverAuth()
drive = GoogleDrive(gauth)
# Enter the absolute path to the file
file_path = r""
file_title = os.path.basename(file_path)
f = drive.CreateFile({'title' : file_title})
f.SetContentFi... | 404 | Python | .py | 14 | 27.571429 | 50 | 0.790155 | anupammaurya6767/Botzy | 8 | 3 | 0 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,846 | bot.py | anupammaurya6767_Botzy/Telegram-Torrent-Bot/bot.py | import os
import telegram
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
import libtorrent as lt
import time
# Telegram bot token (replace with your own token)
TOKEN = "your_telegram_token"
# Path to the directory where downloaded torrents will be saved
DOWNLOAD_PATH = "path_to_download_dir... | 5,236 | Python | .py | 126 | 36.531746 | 88 | 0.727057 | anupammaurya6767/Botzy | 8 | 3 | 0 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,847 | profile.py | anupammaurya6767_Botzy/Whatsapp-bot/WhatsApp-Profile-Info-bot/profile.py | from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import time
from bs4 import BeautifulSoup
def get_contact_info(driver, person):
try:
# XPath for the search input field
inp_xpath_search = "//p[@class='selectable-text... | 2,788 | Python | .py | 69 | 30.637681 | 99 | 0.597838 | anupammaurya6767/Botzy | 8 | 3 | 0 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,848 | image-bot.py | anupammaurya6767_Botzy/Whatsapp-bot/WhatsApp-image-bot/image-bot.py | from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import time
from bs4 import BeautifulSoup
def get_contact_info(driver, person):
try:
# Wait for the user to scan the QR code manually for 60 seconds
input("Scan the QR code man... | 2,808 | Python | .py | 71 | 30.985915 | 98 | 0.611765 | anupammaurya6767/Botzy | 8 | 3 | 0 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,849 | poll.py | anupammaurya6767_Botzy/Whatsapp-bot/WhatsApp-Poll-Bot/poll.py | # Import the necessary libraries
from twilio.rest import Client
from flask import Flask, request, redirect
from twilio.twiml.messaging_response import MessagingResponse
# Set up your Twilio account credentials
account_sid = 'your_account_sid'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)
# C... | 1,879 | Python | .py | 41 | 39.902439 | 106 | 0.676149 | anupammaurya6767/Botzy | 8 | 3 | 0 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,850 | tagll.py | anupammaurya6767_Botzy/Whatsapp-bot/WhatsApp-Tag-all-bot/tagll.py | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import NoSuchElementException
import time
def main():
try:
# Initialize the WebDriver
driver = webdriver.Chrome()
# Open WhatsApp Web
driver.get("https://web.whatsapp.com/... | 2,088 | Python | .py | 56 | 26.410714 | 78 | 0.565627 | anupammaurya6767/Botzy | 8 | 3 | 0 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,851 | main.py | anupammaurya6767_Botzy/Execution Bot/main.py | from pyrogram import Client, filters
from pyrogram.types import Message
import io
import sys
api_id = "your api id get it from https://my.telegram.org/apps"
api_hash = "your api hash get it from https://my.telegram.org/apps"
bot_token = "your token"
app = Client(bot_token, api_id=api_id, api_hash=api_hash)
# Handler... | 1,224 | Python | .py | 34 | 29.882353 | 71 | 0.659322 | anupammaurya6767/Botzy | 8 | 3 | 0 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,852 | __init__.py | giuseppeambrosio97_tigr81/tigr81/tigr81/__init__.py | import pathlib as pl
__version__ = "1.1.2"
PACKAGE_LOCATION = pl.Path(__file__).parent.resolve()
ROOT_LOCATION = PACKAGE_LOCATION.parent
LOCAL_REPO_LOCATION = ROOT_LOCATION.parent
LOCAL_PROJECT_TEMPLATES_FOLDER_LOCATION = LOCAL_REPO_LOCATION / "project_templates"
RESOURCE_LOCATION = PACKAGE_LOCATION / "resources"
HU... | 818 | Python | .py | 17 | 46.764706 | 83 | 0.773585 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,853 | cli_settings.py | giuseppeambrosio97_tigr81/tigr81/tigr81/cli_settings.py | from typing import Optional
from pydantic_settings import BaseSettings
class CliSettings(BaseSettings):
tigr81_environment: Optional[str] = None
CLI_SETTINGS = CliSettings()
| 182 | Python | .py | 5 | 33.8 | 44 | 0.83237 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,854 | main.py | giuseppeambrosio97_tigr81/tigr81/tigr81/main.py | import typer
from tigr81.commands.scaffold import scaffold
from tigr81.commands.monorepo import monorepo
from tigr81.commands.hub import hub
from tigr81 import PYPY_URL, REPO_LOCATION, __version__
app = typer.Typer()
@app.command()
def version():
"""Check out version information"""
typer.echo(f"v{__vers... | 565 | Python | .py | 16 | 32.1875 | 56 | 0.73694 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,855 | read_yaml.py | giuseppeambrosio97_tigr81/tigr81/tigr81/utils/read_yaml.py | from typing import Dict
import yaml
def read_yaml(file_path: str) -> Dict:
with open(file_path, 'r') as stream:
config = yaml.safe_load(stream)
return config or {} | 187 | Python | .py | 6 | 26.333333 | 40 | 0.683908 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,856 | str_enum.py | giuseppeambrosio97_tigr81/tigr81/tigr81/utils/str_enum.py | import enum
class StrEnum(str, enum.Enum):
"""A base class for string-based enumerations.
This class combines the functionality of str and enum.Enum,
allowing the creation of enumerations where each member
is a string. The string representation of each member is its value.
Example:
class... | 722 | Python | .py | 19 | 30.052632 | 71 | 0.633188 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,857 | create_interactive_prompt.py | giuseppeambrosio97_tigr81/tigr81/tigr81/utils/create_interactive_prompt.py | from typing import List, Any, Dict, Optional
from InquirerPy import prompt
def create_interactive_prompt(
values: List[Any],
icon_mapping: Optional[Dict[Any, str]] = None,
message: str = "Select an option",
display_transform: callable = lambda x: x,
) -> Any:
"""
Utility function to prompt the... | 1,398 | Python | .py | 38 | 29.736842 | 135 | 0.630724 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,858 | extract_template_name.py | giuseppeambrosio97_tigr81/tigr81/tigr81/utils/extract_template_name.py | import os
import pathlib as pl
import cookiecutter.repository as ck
def extract_template_name(template: str) -> str:
"""
Extracts the name of the template from either a local directory path or a remote URL.
For local directory paths, it returns the last directory name. For remote Git URLs,
it ext... | 1,658 | Python | .py | 31 | 44.258065 | 98 | 0.68343 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,859 | __init__.py | giuseppeambrosio97_tigr81/tigr81/tigr81/utils/__init__.py | from .create_interactive_prompt import create_interactive_prompt
from .pretty import pretty_list
from .read_yaml import read_yaml
from .extract_template_name import extract_template_name
from .str_enum import StrEnum
__all__ = [
"create_interactive_prompt",
"read_yaml",
"pretty_list",
"extract_template... | 345 | Python | .py | 12 | 26 | 64 | 0.753012 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,860 | pretty.py | giuseppeambrosio97_tigr81/tigr81/tigr81/utils/pretty.py | from typing import List
def pretty_list(lst: List[str]) -> str:
if not lst:
return "Empty"
if len(lst) == 1:
return lst[0]
return f'{", ".join(lst[:-1])} and {lst[-1]}'
| 211 | Python | .py | 7 | 23.142857 | 50 | 0.554974 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,861 | select_project_type_interactive.py | giuseppeambrosio97_tigr81/tigr81/tigr81/commands/scaffold/select_project_type_interactive.py | from tigr81.commands.scaffold.project_template import (
ICON_MAPPING,
ProjectTypeEnum,
)
import tigr81.utils as tigr81_utils
def select_project_type_interactive() -> ProjectTypeEnum:
"""Prompt user to select a project type interactively using the utility function"""
return tigr81_utils.create_interact... | 466 | Python | .py | 12 | 34 | 87 | 0.75 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,862 | scaffold.py | giuseppeambrosio97_tigr81/tigr81/tigr81/commands/scaffold/scaffold.py | import pathlib as pl
from typing import Optional
import cookiecutter.main as cookiecutter
import copier
import typer
from typing_extensions import Annotated
import tigr81.commands.core.scaffold as scaffold_core
from tigr81 import LOCAL_REPO_LOCATION, REPO_LOCATION
from tigr81.cli_settings import CLI_SETTINGS
from tig... | 5,467 | Python | .py | 155 | 27.451613 | 116 | 0.640507 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,863 | project_template.py | giuseppeambrosio97_tigr81/tigr81/tigr81/commands/scaffold/project_template.py | import pathlib as pl
from typing import Dict, List, Optional
import click
import typer
from pydantic import BaseModel, EmailStr
import tigr81.utils as tigr81_utils
from tigr81 import ORGANIZATION_LOCATION
from pydantic import ConfigDict
PROJECT_TEMPLATE_DEFAULT_RELATIVE_PATH = pl.Path(".")
class ProjectTypeEnum(ti... | 4,918 | Python | .py | 123 | 31.487805 | 105 | 0.652384 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,864 | manifest.py | giuseppeambrosio97_tigr81/tigr81/tigr81/commands/monorepo/manifest.py | import pathlib as pl
import shutil
from typing import List, Optional
import typer
import yaml
from graphviz import Digraph
from pydantic import BaseModel
import tigr81.utils as tigr81_utils
from tigr81.commands.core.poetry_pm import PoetryPM
from tigr81.commands.monorepo.constants import (
MANIFEST_DEFAULT_DESCRI... | 5,029 | Python | .py | 115 | 32.06087 | 185 | 0.609282 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,865 | monorepo.py | giuseppeambrosio97_tigr81/tigr81/tigr81/commands/monorepo/monorepo.py | import pathlib as pl
import shutil
from typing import Dict, List
import click
import typer
from pydantic import BaseModel
import tigr81.commands.core.scaffold as scaffold_core
from tigr81.commands.core.poetry_pm import PoetryPM
from tigr81.commands.monorepo.constants import MANIFEST_FILE_NAME
from tigr81.commands.mon... | 7,351 | Python | .py | 183 | 32.404372 | 135 | 0.658752 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,866 | constants.py | giuseppeambrosio97_tigr81/tigr81/tigr81/commands/monorepo/constants.py | import pathlib as pl
MANIFEST_FILE_NAME = "manifest.yml"
MANIFEST_DEFAULT_NAME = "my-monorepo"
MANIFEST_DEFAULT_RELATIVE_PATH = pl.Path("src")
MANIFEST_DEFAULT_DESCRIPTION = "A monorepo for my project" | 203 | Python | .py | 5 | 39.4 | 58 | 0.791878 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,867 | gitw.py | giuseppeambrosio97_tigr81/tigr81/tigr81/commands/core/gitw.py | import pathlib as pl
import shutil
import subprocess
import tempfile
from typing import Tuple
import typer
def get_latest_tag(repo_url: str) -> str:
"""
Fetches the latest tag from a remote Git repository.
Args:
repo_url (str): The URL of the remote Git repository.
Returns:
str: The... | 5,204 | Python | .py | 124 | 35.314516 | 100 | 0.642956 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,868 | scaffold.py | giuseppeambrosio97_tigr81/tigr81/tigr81/commands/core/scaffold.py | from typing import List
import typer
from cookiecutter.main import cookiecutter
from tigr81.commands.scaffold.project_template import (
ProjectTemplate,
ProjectTemplateOptions,
ProjectTypeEnum,
)
import pathlib as pl
import tigr81.commands.core.gitw as gitw
def scaffold_project_type(
project_type: Pr... | 2,126 | Python | .py | 62 | 28.66129 | 117 | 0.706686 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,869 | poetry_pm.py | giuseppeambrosio97_tigr81/tigr81/tigr81/commands/core/poetry_pm.py | import subprocess as sp
import sys
import typer
import shutil
import pathlib as pl
class PoetryPM:
"""
A utility class for managing Python dependencies using Poetry.
This class provides methods to interact with the Poetry package manager.
It checks for the presence of Poetry, installs components, an... | 2,647 | Python | .py | 64 | 29.5 | 105 | 0.569596 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,870 | models.py | giuseppeambrosio97_tigr81/tigr81/tigr81/commands/hub/models.py | import pathlib as pl
from typing import Dict, Optional, Union
import typer
import yaml
from pydantic import BaseModel
import tigr81.utils as tigr81_utils
class TemplateTypeEnum(tigr81_utils.StrEnum):
COOKIECUTTER = "cookiecutter"
COPIER = "copier"
RAW_GIT = "raw_git"
class HubTemplate(BaseModel):
... | 3,181 | Python | .py | 85 | 28.658824 | 106 | 0.608908 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,871 | hub.py | giuseppeambrosio97_tigr81/tigr81/tigr81/commands/hub/hub.py | """
Handle hub templates.
- Configure you hub template (also private hub templates)
- Scaffold a project template from hub templates
- Add hub templates (public, private, local)
- Update hub templates properties
- Delete hub templates
"""
import pathlib as pl
import copier
import typer
from cookiec... | 6,141 | Python | .py | 169 | 29.213018 | 88 | 0.639623 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,872 | helpers.py | giuseppeambrosio97_tigr81/tigr81/tigr81/commands/hub/helpers.py | import pathlib as pl
from typing import Dict, List
import typer
from tigr81 import AVAILABLE_HUBS
from tigr81.commands.hub.models import Hub, HubTemplate
def load_hubs(hub_folders: List[pl.Path] = AVAILABLE_HUBS) -> Dict[str, Hub]:
hubs = {}
for hub_folder in hub_folders:
for hub_path in hub_folder.... | 1,028 | Python | .py | 29 | 30.206897 | 79 | 0.674089 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,873 | __init__.py | giuseppeambrosio97_tigr81/tigr81/tests/__init__.py | import pathlib as pl
PACKAGE_LOCATION = pl.Path(__file__).parent.resolve()
RESOURCE_LOCATION = PACKAGE_LOCATION / "resources"
| 127 | Python | .py | 3 | 41 | 53 | 0.772358 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,874 | conftest.py | giuseppeambrosio97_tigr81/tigr81/tests/utils/conftest.py | import pytest
import tempfile
import pathlib as pl
@pytest.fixture
def temp_local_path():
"""Creates a temporary directory as a mock local path."""
with tempfile.TemporaryDirectory() as tmpdirname:
tmp_path = pl.Path(tmpdirname)
temp_file = tmp_path / "my-template"
temp_file.touch()
... | 347 | Python | .py | 11 | 26.727273 | 61 | 0.697605 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,875 | test_extract_template_name.py | giuseppeambrosio97_tigr81/tigr81/tests/utils/test_extract_template_name.py | import pytest
import tigr81.utils as tigr81_utils
@pytest.mark.parametrize(
"template, expected",
[
# Test using the temporary local path
(pytest.lazy_fixture("temp_local_path"), "my-template"),
# URLs with various structures
("https://github.com/user/my-repo.git", ... | 1,583 | Python | .py | 39 | 34.230769 | 88 | 0.647406 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,876 | test_str_enum.py | giuseppeambrosio97_tigr81/tigr81/tests/utils/test_str_enum.py | from tigr81.commands.scaffold.project_template import ProjectTypeEnum
def test_enum_str():
assert str(ProjectTypeEnum.FAST_API) == "fastapi"
def test_enum_repr():
assert repr(ProjectTypeEnum.FAST_API) == "fastapi"
def test_enum_members():
assert ProjectTypeEnum.FAST_API in ProjectTypeEnum
| 305 | Python | .py | 7 | 40.428571 | 69 | 0.783051 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,877 | test_is_cookiecutter_template.py | giuseppeambrosio97_tigr81/tigr81/tests/commands/core/gitw/test_is_cookiecutter_template.py | import pathlib as pl
import tigr81.commands.core.gitw as gitw
def test_is_cookiecutter_template_given_non_cookiecutter_template():
repo_url = "https://github.com/primefaces/primereact-examples"
checkout = "main"
directory = pl.Path(".")
assert not gitw.is_cookiecutter_template(
repo_url=repo... | 718 | Python | .py | 20 | 30.15 | 75 | 0.706223 | giuseppeambrosio97/tigr81 | 8 | 1 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,878 | conftest.py | MIERUNE_qgis-japan-mesh/tests/conftest.py | import os
import sys
from pathlib import Path
from typing import Iterable
import pytest
from qgis.core import QgsApplication
from qgis.gui import QgsGui
from japanese_grids import classFactory
@pytest.fixture(autouse=True, scope="session")
def qgis_app(tmp_path_factory) -> Iterable[QgsApplication]:
# profile di... | 1,077 | Python | .py | 30 | 32.066667 | 74 | 0.747582 | MIERUNE/qgis-japan-mesh | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,879 | test_plugin.py | MIERUNE_qgis-japan-mesh/tests/test_plugin.py | # from pathlib import Path
from PyQt5.QtGui import QIcon
from qgis.core import QgsApplication # , QgsVectorLayer
def test_registered(qgis_app: QgsApplication, provider: str):
registory = QgsApplication.processingRegistry()
provider = registory.providerById("japanesegrid")
assert provider is not None
... | 654 | Python | .py | 15 | 39.4 | 66 | 0.762205 | MIERUNE/qgis-japan-mesh | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,880 | provider.py | MIERUNE_qgis-japan-mesh/japanese_grids/provider.py | """Processing provider for this plugin"""
# Copyright (C) 2023 MIERUNE Inc.
#
# This program 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 2
# of the License, or (at your option) any later ve... | 1,624 | Python | .py | 34 | 44.029412 | 81 | 0.767368 | MIERUNE/qgis-japan-mesh | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,881 | panel.py | MIERUNE_qgis-japan-mesh/japanese_grids/panel.py | """Panel to show the grid square code of the current mouse position."""
# Copyright (C) 2023 MIERUNE Inc.
#
# This program 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 2
# of the License, or... | 3,460 | Python | .py | 81 | 35.679012 | 88 | 0.672694 | MIERUNE/qgis-japan-mesh | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,882 | plugin.py | MIERUNE_qgis-japan-mesh/japanese_grids/plugin.py | """Plugin class"""
# Copyright (C) 2023 MIERUNE Inc.
#
# This program 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 2
# of the License, or (at your option) any later version.
#
# This program... | 3,520 | Python | .py | 76 | 36.986842 | 81 | 0.709169 | MIERUNE/qgis-japan-mesh | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,883 | __init__.py | MIERUNE_qgis-japan-mesh/japanese_grids/__init__.py | """Plugin entrypoint"""
# Copyright (C) 2023 MIERUNE Inc.
#
# This program 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 2
# of the License, or (at your option) any later version.
#
# This pr... | 959 | Python | .py | 21 | 44 | 81 | 0.782189 | MIERUNE/qgis-japan-mesh | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,884 | create_grid_square.py | MIERUNE_qgis-japan-mesh/japanese_grids/algorithms/create_grid_square.py | """Processing algorithm to create the "Grid Square Code" of Japan (JIS X 0410) as vector layers"""
# Copyright (C) 2023 MIERUNE Inc.
#
# This program 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 ver... | 11,482 | Python | .py | 300 | 25.126667 | 98 | 0.590964 | MIERUNE/qgis-japan-mesh | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,885 | create_legacy_grid.py | MIERUNE_qgis-japan-mesh/japanese_grids/algorithms/create_legacy_grid.py | """Processing algorithm to create the "Grid Square Code" of Japan (JIS X 0410) as vector layers"""
# Copyright (C) 2023 MIERUNE Inc.
#
# This program 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 ver... | 14,316 | Python | .py | 424 | 21.964623 | 98 | 0.548216 | MIERUNE/qgis-japan-mesh | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,886 | load_estat_csv.py | MIERUNE_qgis-japan-mesh/japanese_grids/algorithms/load_estat_csv.py | """Processing algorithm to create the "Grid Square Code" of Japan (JIS X 0410) as vector layers"""
# Copyright (C) 2023 MIERUNE Inc.
#
# This program 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 ver... | 10,262 | Python | .py | 255 | 27.113725 | 133 | 0.558443 | MIERUNE/qgis-japan-mesh | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,887 | gridsquare_to_box.py | MIERUNE_qgis-japan-mesh/japanese_grids/algorithms/utils/gridsquare_to_box.py | from typing import Optional, Tuple, TypedDict
from .grid_square import AVAILABLE_PRIMARY_CODES
_VALID_LENGTH = (4, 6, 8, 9, 10, 11)
_VALID_QUAD = ("1", "2", "3", "4")
LngLatBox = Tuple[float, float, float, float]
_MULTIPLIER = 30 # 浮動小数点誤差を回避するために内部的な経緯度にかける係数
def grid_square_code_to_bbox( # noqa: C901
code... | 3,830 | Python | .py | 122 | 24.942623 | 74 | 0.526301 | MIERUNE/qgis-japan-mesh | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,888 | grid_square.py | MIERUNE_qgis-japan-mesh/japanese_grids/algorithms/utils/grid_square.py | from typing import Iterator, Optional, Tuple
AVAILABLE_PRIMARY_CODES = frozenset(
[
"3036",
"3622",
"3623",
"3624",
"3631",
"3641",
"3653",
"3724",
"3725",
"3741",
"3823",
"3824",
"3831",
"3841",
... | 11,037 | Python | .py | 392 | 18.033163 | 86 | 0.471875 | MIERUNE/qgis-japan-mesh | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,889 | legacy_grid.py | MIERUNE_qgis-japan-mesh/japanese_grids/algorithms/utils/legacy_grid.py | from typing import Iterator, Optional, Tuple
LngLatBox = Tuple[float, float, float, float]
def _intersect(a: LngLatBox, b: LngLatBox):
a_lng0, a_lat0, a_lng1, a_lat1 = a
b_lng0, b_lat0, b_lng1, b_lat1 = b
return not (
a_lng1 < b_lng0 or a_lng0 > b_lng1 or a_lat1 < b_lat0 or a_lat0 > b_lat1
)
... | 4,769 | Python | .py | 123 | 29.414634 | 88 | 0.562361 | MIERUNE/qgis-japan-mesh | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,890 | custom_autolaunch_command.py | w-e-w_sd-webui-custom-autolaunch/scripts/custom_autolaunch_command.py | from modules import script_callbacks, shared
from pathlib import Path
import gradio as gr
import subprocess
import hashlib
import shlex
import os
extension_root = Path(__file__).resolve().parents[1]
check_command_path = extension_root.joinpath('.check_command')
custom_command = ''
class OptionMarkdown(shared.OptionI... | 4,358 | Python | .py | 79 | 44.405063 | 151 | 0.639568 | w-e-w/sd-webui-custom-autolaunch | 8 | 0 | 0 | AGPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,891 | aria_helper.py | Shra1V32_Multipurpose-Telegram-Bot/aria_helper.py | from time import sleep
import aria2p
class AriaHelper():
global aria2, yt_dict
yt_dict = {}
#yt_dict = {}
''' <class> to initiate aria2 before we can deploy it onto Telegram '''
def __init__(self):
global aria2
link = 'https://linuxmint.com/torrents/lmde-5-cinnamon-64bit.iso.torr... | 4,694 | Python | .py | 115 | 31.73913 | 84 | 0.602677 | Shra1V32/Multipurpose-Telegram-Bot | 8 | 3 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,892 | upload_gdrive.py | Shra1V32_Multipurpose-Telegram-Bot/upload_gdrive.py | #!/usr/bin/env python3
import os
import sys
import time
from subprocess import check_output, Popen, PIPE
import update_token
import random
import json
import asyncio
import requests
from constants import GDRIVE_APIKEY
from signal import SIGKILL
S = 16
class InvalidCredentials(Exception):
pass
class TokenError(... | 6,319 | Python | .py | 166 | 26.524096 | 91 | 0.549796 | Shra1V32/Multipurpose-Telegram-Bot | 8 | 3 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,893 | constants.py | Shra1V32_Multipurpose-Telegram-Bot/constants.py | # Bot tokens, !!! NEVER SHARE THESE WITH ANYONE !!!
# Change the following fields if you would like to use your own bot
API_ID = ""
API_HASH = ""
BOT_TOKEN = ""
GDRIVE_APIKEY = ""
GDRIVE_CLIENT_ID = ""
GDRIVE_CLIENT_SECRET = ""
GDRIVE_REFRESH_TOKEN = "" | 253 | Python | .py | 9 | 27.222222 | 67 | 0.689796 | Shra1V32/Multipurpose-Telegram-Bot | 8 | 3 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,894 | update_token.py | Shra1V32_Multipurpose-Telegram-Bot/update_token.py | import requests
from constants import GDRIVE_CLIENT_ID, GDRIVE_CLIENT_SECRET, GDRIVE_REFRESH_TOKEN
def genToken():
# Make a request to the token endpoint to refresh the access token
response = requests.post(
"https://oauth2.googleapis.com/token",
data={
"client_id": GDRIVE_CLIENT_I... | 801 | Python | .py | 21 | 31.142857 | 82 | 0.648579 | Shra1V32/Multipurpose-Telegram-Bot | 8 | 3 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,895 | main.py | Shra1V32_Multipurpose-Telegram-Bot/main.py | #!/usr/bin/env python3
from telethon import TelegramClient, events
from telethon.errors.rpcerrorlist import (
MessageIdInvalidError,
MessageEmptyError,
MessageNotModifiedError,
)
from constants import API_ID, API_HASH, BOT_TOKEN
import os
import time
from subprocess import check_output, PIPE
import aria_hel... | 21,514 | Python | .py | 499 | 32.084168 | 261 | 0.582674 | Shra1V32/Multipurpose-Telegram-Bot | 8 | 3 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,896 | yt_handler.py | Shra1V32_Multipurpose-Telegram-Bot/yt_handler.py | from yt_dlp import YoutubeDL
import upload_gdrive
import asyncio
from threading import Thread, Lock
import time
lock = Lock()
class YTDL:
def __init__(self) -> None:
global gidBasedOnVID, statusBasedOnGID, gidsWithCompletedDownloads
gidBasedOnVID = {}
statusBasedOnGID = {}
gidsWit... | 4,122 | Python | .py | 95 | 30.684211 | 110 | 0.54122 | Shra1V32/Multipurpose-Telegram-Bot | 8 | 3 | 1 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,897 | setup.py | drzeeshanahmed_IntelliGenes/setup.py | # (Packages/Libraries) Miscellaneous
from setuptools import setup, find_packages
from setuptools.command.install import install
class CustomInstall(install):
def run(self):
print("Installing IntelliGenes...")
install.run(self)
print("Installed IntelliGenes!")
setup(
name = '... | 2,296 | Python | .py | 70 | 24.242857 | 108 | 0.546355 | drzeeshanahmed/IntelliGenes | 8 | 7 | 0 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,898 | classification.py | drzeeshanahmed_IntelliGenes/intelligenes/classification.py | # (Packages/Libraries) Matrix Manipulation
import pandas as pd
import numpy as np
# (Packages/Libraries) Statistical Analysis & Machine Learning
import sklearn
from sklearn.model_selection import train_test_split, KFold, GridSearchCV
from sklearn.pipeline import Pipeline
from sklearn.ensemble import RandomFore... | 29,540 | Python | .py | 466 | 43.787554 | 180 | 0.551337 | drzeeshanahmed/IntelliGenes | 8 | 7 | 0 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |
2,283,899 | intelligenes.py | drzeeshanahmed_IntelliGenes/intelligenes/intelligenes.py | import argparse
import subprocess
import pkg_resources
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--cgit_file', required=True)
parser.add_argument('-o', '--output_dir', required=True)
parser.add_argument('--random_state', type=int, default=42)
parser.ad... | 3,508 | Python | .py | 82 | 34.731707 | 95 | 0.628639 | drzeeshanahmed/IntelliGenes | 8 | 7 | 0 | GPL-3.0 | 9/5/2024, 10:47:35 PM (Europe/Amsterdam) |