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,200 | practicando tkinter.py | Ingenieria2024_ingenieria_2024/practicando tkinter.py | import tkinter as tk
from tkinter import ttk
def saludar():
etiqueta.config(text="Hola!!!")
#print("Hola a todos y todas")
root = tk.Tk()
root.geometry("450x150")
root.title("Practicando tkinter")
root.configure(bg="#ffa9ba")
etiqueta = ttk.Label(root, text="Hoy empezamos tkinter", padding=(20, 10))
etiqueta... | 531 | Python | .py | 16 | 31.375 | 74 | 0.756385 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,201 | probando.py | Ingenieria2024_ingenieria_2024/probando.py | print ("Después de varios intentos, pude subir el archivo de prueba")
prin("hola") | 84 | Python | .py | 2 | 41 | 70 | 0.743902 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,202 | pirulo.py | Ingenieria2024_ingenieria_2024/pirulo.py |
print ("Hola, este es el primer archivo del proyecto")
agregado = input("Ingrese su nombre: ")
print ("sarasa")
print ("bienvenido")
print ("seguimos practicando y quemando a los pirulos")
print ("un dia mas practicando con los pirulos")
print ("que llegue semana santa")
print ("me estoy volviendo loca")
print("hola, ... | 420 | Python | .py | 12 | 33.916667 | 55 | 0.756757 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,203 | calcuadora.py | Ingenieria2024_ingenieria_2024/calcuadora.py | from tkinter import*
ventana= Tk()
ventana.title("calculadora unpaz")
#entrada
e_texto =Entry(ventana, font=("calibri 30"))
e_texto.grid(row = 0, column = 0, columnspan=6, padx=50, pady=5)
number1=int(input("ingresa un numero: "))
number2=int(input("ingresa tro numero: "))
eleccion=0
while eleccion != 6 :
pri... | 1,161 | Python | .py | 38 | 24.894737 | 76 | 0.605455 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,204 | practicando_pirulos.py | Ingenieria2024_ingenieria_2024/practicando_pirulos.py | print ("hola pirulos")
print ("agrego una linea")
print ("agrego una linea en semana santa")
print ("no te vayas feriado largo") | 128 | Python | .py | 4 | 31.25 | 42 | 0.744 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,205 | pirula.py | Ingenieria2024_ingenieria_2024/pirula.py | print ("este es un archivo nuevo")
print ("ok")
print ("agrego otra linea nueva")
print ("hola")
print ("Buenas noches a todos y todas")
print ("TUIAS")
print ("hola") | 168 | Python | .py | 7 | 23 | 39 | 0.708075 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,206 | practica_fsilva.py | Ingenieria2024_ingenieria_2024/practica_fsilva.py | #antes que nada importo tkinter para que ande la ventana
import tkinter as tk
from tkinter import ttk
#aca agrego unos saludos para mas adelante
def saludines():
print ("Alo alo amigos")
def dijeno():
etiqueta2.pack()
#aca creo la ventana
root = tk.Tk()
#aplico propiedades
root.geometry("600x400")
root.tit... | 946 | Python | .py | 27 | 33.37037 | 87 | 0.765864 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,207 | menu.py | Ingenieria2024_ingenieria_2024/menu.py | #MENU PRINCIPAL
while True:
print("=================================")
print("menu")
print("=================================")
print("\t[1]Insertar producto")
print("\t[2]Lista de Productos")
print("\t[3]Actializar Productos")
print("\t[4]Eliminar producto")
print("\t[5]Salir")
p... | 716 | Python | .py | 28 | 19.928571 | 49 | 0.469477 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,208 | lucia.py | Ingenieria2024_ingenieria_2024/lucia.py | print ("Hola soy lucia")
print ("tengo 20nios")
print ("SIgo intentanndoo")git
print ("la cuarta es la vencida")
print ("holis")
print ("Hola Lucia espero hayas podido")
print ("mi nombre es Erika") | 201 | Python | .py | 7 | 27.428571 | 40 | 0.731959 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,209 | lospirulos.py | Ingenieria2024_ingenieria_2024/lospirulos.py | print ("agrego una linea nueva")
print ("Esta línea se la agrego ahora")
print ("Linea nueva")
print ("modificado")
print ("hola")
print ("chau")
print ("vamo los pibe")
print ("practicanding en feriado") | 205 | Python | .py | 8 | 24.75 | 40 | 0.722222 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,210 | adivinanza.py | Ingenieria2024_ingenieria_2024/adivinanza.py | import random
def adivinanza():
adivinanza = "qué hace un limon en el agua?"
respuesta_correcta = "limonada"
print ("adivina esta adivinanza:")
print (adivinanza)
respuesta = input("responde:").lower()
if respuesta == respuesta_correcta:
print("¡Correcto! Adivinaste!")
else:
print("incorrecto.... | 414 | Python | .py | 13 | 28.461538 | 71 | 0.706329 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,211 | import_tkinter_IvanGuzman.py | Ingenieria2024_ingenieria_2024/import_tkinter_IvanGuzman.py | # Tkinter
import tkinter as tk
from tkinter import ttk
# Funciones
def biblioteca ():
print ("Usted ha ingresado a la biblioteca digital de la UNPAZ.")
def geolocalizacion ():
print ("Usted ha ingresado a la geolocalización de las distintas sedes de la UNPAZ.")
def plan_de_estudio ():
print ("Usted h... | 1,141 | Python | .py | 26 | 41.807692 | 151 | 0.739763 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,212 | practicando_jo.py | Ingenieria2024_ingenieria_2024/practicando_jo.py | print ("Hola soy Josefina")
print ("Hice este archivo para practicar") | 70 | Python | .py | 2 | 34.5 | 42 | 0.768116 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,213 | pirulito.py | Ingenieria2024_ingenieria_2024/pirulito.py | print ("Le agrego otra línea")
print ("Le agrego una linea mas")
print ("probando")
print ("sarasa")
print ("the pirulos")
print ("fuaa el diego")
archivo_nuevo = input("Cómo se hace para subir un nuevo archivo?: ")
print()
print ("# gracias! #")
print ("esto es una prueba")
| 280 | Python | .py | 10 | 26.6 | 68 | 0.706767 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,214 | tkinter_GuzmanIvan.py | Ingenieria2024_ingenieria_2024/imagen/tkinter_GuzmanIvan.py | import tkinter as tk
from tkinter import ttk
# Ventana
root = tk.Tk()
root.geometry ("500x300")
root.title ("¡Bienvenidos al portal de la UNPAZ!")
root.config (background="light blue")
# 1° frame
frame1 = tk.Frame()
etiqueta_nombre = ttk.Label (frame1, text = "Ingresar su nombre y apellido", padding = (5, 5), font = ... | 1,249 | Python | .py | 33 | 36.212121 | 138 | 0.708787 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,215 | presentacion.py | Ingenieria2024_ingenieria_2024/ingenieria_2024/presentacion.py | # Presentación en Python
def presentacion():
nombre = "gisela"
ocupacion = "estudiante"
print(f"¡Hola! Soy {nombre}, {ocupacion}.")
if __name__ == "__main__":
presentacion()
Def presentacion
nombre = "yoha" | 243 | Python | .py | 9 | 22 | 47 | 0.640909 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,216 | hagounaventana.py | Ingenieria2024_ingenieria_2024/ingenieria_2024/hagounaventana.py | import tkinter as tk
from tkinter import ttk
def boton_uno():
accion.configure(text="Conocenos")
def boton_dos():
accion.configure(text="Colaborá")
def boton_tres():
accion.configure(text="Contacto")
# Inicializar ventana, título y tamaño
ventana = tk.Tk()
ventana.title("CONSTRUYENDO_SONRISAS_ONG")
# ... | 2,047 | Python | .py | 43 | 45.697674 | 151 | 0.745703 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,217 | pirulilla.py | Ingenieria2024_ingenieria_2024/ingenieria_2024/pirulilla.py | Input("Buenas noches")
print("Pr√°cticando un poco esto")
print("soy sasha")
print("Adios")
print("Nos vemos otro dia")
print("Sera?")
print("Que onda los pirulos")
print("Hola a todess")
| 188 | Python | .py | 8 | 22.5 | 34 | 0.733333 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,218 | tkinter_GuzmanIvan.py | Ingenieria2024_ingenieria_2024/ingenieria_2024/tkinter_GuzmanIvan.py | import tkinter as tk
from tkinter import ttk
# Ventana
root = tk.Tk()
root.geometry ("500x300")
root.title ("¡Bienvenidos al portal de la UNPAZ!")
root.config (background="light blue")
# 1° frame
frame1 = tk.Frame()
etiqueta_nombre = ttk.Label (frame1, text = "Ingresar su nombre y apellido", padding = (5, 5), font = ... | 1,249 | Python | .py | 33 | 36.212121 | 138 | 0.708787 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,219 | pirulo.py | Ingenieria2024_ingenieria_2024/ingenieria_2024/pirulo.py | print ("Hola, este es el primer archivo del proyecto")
agregado = input("Ingrese su nombre: ")
print ("bienvenid@", agregado)
| 126 | Python | .py | 3 | 41 | 54 | 0.739837 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,220 | pirula.py | Ingenieria2024_ingenieria_2024/ingenieria_2024/pirula.py | print ("este es un archivo nuevo")
print ("agrego una linea nueva")
print ("agrego otra linea mas")
print ("practicando el programa git")
print ("seguimos jugando con git")
print ("Hola mundo")
print ("agrego otra linea")
print ("ok") | 234 | Python | .py | 8 | 28.375 | 37 | 0.740088 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,221 | lospirulos.py | Ingenieria2024_ingenieria_2024/ingenieria_2024/lospirulos.py | print ("agrego una linea nueva")
print ("Esta línea se la agrego ahora")
print ("Linea nueva")
print ("modificado")
prin ("hola") | 130 | Python | .py | 5 | 25.2 | 40 | 0.714286 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,222 | import_tkinter_IvanGuzman.py | Ingenieria2024_ingenieria_2024/ingenieria_2024/import_tkinter_IvanGuzman.py | import tkinter as tk
from tkinter import ttk
def biblioteca ():
print ("Usted ha ingresado a la biblioteca digital de la UNPAZ.")
def geolocalizacion ():
print ("Usted ha ingresado a la geolocalización de las distintas sedes de la UNPAZ.")
def plan_de_estudio ():
print ("Usted ha ingresado al plan de... | 1,073 | Python | .py | 20 | 51.05 | 151 | 0.736689 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,223 | practicando_jo.py | Ingenieria2024_ingenieria_2024/ingenieria_2024/practicando_jo.py | print ("Hola soy Josefina")
print ("Hice este archivo para practicar") | 70 | Python | .py | 2 | 34.5 | 42 | 0.768116 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,224 | pirulito.py | Ingenieria2024_ingenieria_2024/ingenieria_2024/pirulito.py | print ("Le agrego otra línea")
print ("Le agrego una linea mas")
print ("probando")
print ("sarasa")
print ("prueba mil")
print ("pirulito,pirulita y todos los pirulos juntos")
print ("Fede agregó este pirulo")
| 213 | Python | .py | 7 | 29.142857 | 54 | 0.745098 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,225 | presentacion.py | Ingenieria2024_ingenieria_2024/presentacion.py | # Presentación en Python
def presentacion():
nombre = "gisela"
ocupacion = "estudiante"
print(f"¡Hola! Soy {nombre}, {ocupacion}.")
if __name__ == "__main__":
presentacion()
| 205 | Python | .tac | 7 | 23.857143 | 47 | 0.630435 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,226 | presentacion.py | Ingenieria2024_ingenieria_2024/ingenieria_2024/presentacion.py | # Presentación en Python
def presentacion():
nombre = "gisela"
ocupacion = "estudiante"
print(f"¡Hola! Soy {nombre}, {ocupacion}.")
if __name__ == "__main__":
presentacion()
Def presentacion
nombre = "yoha" | 243 | Python | .tac | 9 | 22 | 47 | 0.640909 | Ingenieria2024/ingenieria_2024 | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,227 | run_bot.py | KroMiose_nonebot_plugin_dice_narrator/run_bot.py | import nonebot
from nonebot.adapters.onebot.v11 import Adapter as ONEBOT_V11Adapter
nonebot.init()
driver = nonebot.get_driver()
driver.register_adapter(ONEBOT_V11Adapter)
nonebot.load_from_toml("pyproject.toml")
def main():
nonebot.run()
if __name__ == "__main__":
main()
| 289 | Python | .py | 10 | 26.3 | 68 | 0.756458 | KroMiose/nonebot_plugin_dice_narrator | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,228 | run_publish.py | KroMiose_nonebot_plugin_dice_narrator/tools/run_publish.py | import os
import sys
from pathlib import Path
from .utils import publish_package
def main():
# 设置 poetry 创建项目内虚拟环境
os.system("poetry config virtualenvs.in-project true")
print("Publishing package...")
publish_package()
exit(0)
| 273 | Python | .py | 10 | 21.7 | 58 | 0.742616 | KroMiose/nonebot_plugin_dice_narrator | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,229 | utils.py | KroMiose_nonebot_plugin_dice_narrator/tools/utils.py | import os
import re
import time
from pathlib import Path
from typing import Tuple
import requests
# PROXY = "http://127.0.0.1:7890"
PROXY = None
def get_current_pkg() -> Tuple[str, str]:
"""获取当前包的名称和版本号"""
pyproject_text = Path("pyproject.toml").read_text(encoding="utf-8")
pkg_name, pkg_version = (
... | 2,913 | Python | .py | 94 | 23.170213 | 71 | 0.599849 | KroMiose/nonebot_plugin_dice_narrator | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,230 | config.py | KroMiose_nonebot_plugin_dice_narrator/nonebot_plugin_dice_narrator/config.py | from pathlib import Path
from typing import List, Optional
import miose_toolkit_common.config
from miose_toolkit_common.config import Config, Env
miose_toolkit_common.config._config_root = Path( # noqa: SLF001
"./configs/nonebot_plugin_dice_narrator",
)
class PluginConfig(Config):
OPENAI_API_KEYS: List[str... | 745 | Python | .py | 19 | 35.210526 | 64 | 0.720733 | KroMiose/nonebot_plugin_dice_narrator | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,231 | narrator.py | KroMiose_nonebot_plugin_dice_narrator/nonebot_plugin_dice_narrator/narrator.py | import random
import re
from nonebot import logger
from nonebot.matcher import Matcher
from nonebot_plugin_dice_narrator.config import config
from nonebot_plugin_dice_narrator.utils.common import read_yml_str2data
from nonebot_plugin_dice_narrator.utils.openai_funcs import gen_chat_response_text
SYSTEM_PROMPT = f"""... | 5,493 | Python | .py | 92 | 33.641304 | 181 | 0.680335 | KroMiose/nonebot_plugin_dice_narrator | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,232 | __init__.py | KroMiose_nonebot_plugin_dice_narrator/nonebot_plugin_dice_narrator/__init__.py | import sys
from nonebot import get_driver
from nonebot.plugin import PluginMetadata
from pydantic import BaseModel
from nonebot_plugin_dice_narrator.config import config
from nonebot_plugin_dice_narrator.matchers import register_matcher
class _Config(BaseModel):
pass
__plugin_meta__ = PluginMetadata(
name... | 777 | Python | .py | 22 | 29.636364 | 72 | 0.768786 | KroMiose/nonebot_plugin_dice_narrator | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,233 | matchers.py | KroMiose_nonebot_plugin_dice_narrator/nonebot_plugin_dice_narrator/matchers.py | from typing import Type
from nonebot import on_command
from nonebot.adapters import Bot, Message
from nonebot.adapters.onebot.v11 import (
MessageEvent,
)
from nonebot.log import logger
from nonebot.matcher import Matcher
from nonebot.params import CommandArg
from nonebot_plugin_dice_narrator import config
from n... | 1,525 | Python | .py | 42 | 26.714286 | 77 | 0.649341 | KroMiose/nonebot_plugin_dice_narrator | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,234 | message_parse.py | KroMiose_nonebot_plugin_dice_narrator/nonebot_plugin_dice_narrator/utils/message_parse.py | from typing import Optional, Tuple, Union
from nonebot.adapters import Bot
from nonebot.adapters.onebot.v11 import (
GroupIncreaseNoticeEvent,
GroupMessageEvent,
MessageEvent,
)
async def gen_chat_text(event: MessageEvent, bot: Bot) -> Tuple[str, bool]:
"""生成合适的会话消息内容(eg. 将cq at 解析为真实的名字)"""
if n... | 2,034 | Python | .py | 56 | 23.946429 | 82 | 0.543256 | KroMiose/nonebot_plugin_dice_narrator | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,235 | common.py | KroMiose_nonebot_plugin_dice_narrator/nonebot_plugin_dice_narrator/utils/common.py | from typing import Dict
import yaml
def export_data2yml_str(data) -> str:
"""导出字典为yml字符串"""
return yaml.dump(data, allow_unicode=True, sort_keys=False)
def read_yml_str2data(s: str) -> Dict:
"""读取yml字符串为字典"""
return yaml.safe_load(s)
| 289 | Python | .py | 8 | 28.25 | 63 | 0.706612 | KroMiose/nonebot_plugin_dice_narrator | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,236 | openai_funcs.py | KroMiose_nonebot_plugin_dice_narrator/nonebot_plugin_dice_narrator/utils/openai_funcs.py | from math import log
from typing import Dict, List, Optional, Tuple
import httpx
import openai
import pkg_resources
from nonebot import logger
from nonebot_plugin_dice_narrator.config import config
__openai_version = pkg_resources.get_distribution("openai").version
if __openai_version <= "0.28.0": # 低版本 openai 兼... | 3,640 | Python | .py | 98 | 27.663265 | 84 | 0.60518 | KroMiose/nonebot_plugin_dice_narrator | 8 | 0 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,237 | setup.py | yulunwu8_Optically-Shallow-Deep/setup.py | from setuptools import setup, find_packages
with open("readme.md", "r") as fh:
long_description = fh.read()
setup(
name='opticallyshallowdeep',
version='1.2.1',
author='Yulun Wu',
author_email='yulunwu8@gmail.com',
description='Identify optically shallow and deep waters in satellite imagery',
... | 865 | Python | .py | 21 | 35.285714 | 92 | 0.691937 | yulunwu8/Optically-Shallow-Deep | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,238 | osd_test.py | yulunwu8_Optically-Shallow-Deep/tests/osd_test.py | # Go up by 2 directory and import
import sys
import os.path as path
two_up = path.abspath(path.join(__file__ ,"../.."))
sys.path.append(two_up)
import opticallyshallowdeep as osd
file_L1C = '/Users/yw/Local_storage/temp_OSD_test/S2B_MSIL1C_20230928T153619_N0509_R068_T17MNP_20230928T205247.SAFE'
file_L2R = '/Use... | 538 | Python | .py | 10 | 50.6 | 116 | 0.763314 | yulunwu8/Optically-Shallow-Deep | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,239 | netcdf_to_multiband_geotiff.py | yulunwu8_Optically-Shallow-Deep/opticallyshallowdeep/netcdf_to_multiband_geotiff.py | import os
import numpy as np
import rasterio
from rasterio.crs import CRS
from rasterio.transform import from_origin
import netCDF4 as nc4
# from pyproj import Proj, transform
import pyproj
from .find_epsg import find_epsg
def netcdf_to_multiband_geotiff(netcdf_file, folder_out):
tif_base = os.path.basename(... | 3,324 | Python | .py | 66 | 37.909091 | 147 | 0.605263 | yulunwu8/Optically-Shallow-Deep | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,240 | process_as_strips.py | yulunwu8_Optically-Shallow-Deep/opticallyshallowdeep/process_as_strips.py | import os, gc, warnings, math
import numpy as np
import pandas as pd
import netCDF4 as nc4
import warnings
from joblib import Parallel, delayed
from datetime import datetime
import scipy
from scipy import ndimage
from scipy.ndimage import uniform_filter
from scipy.ndimage import binary_dilation
import tensorflow as... | 21,507 | Python | .py | 364 | 51.467033 | 191 | 0.673171 | yulunwu8/Optically-Shallow-Deep | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,241 | run.py | yulunwu8_Optically-Shallow-Deep/opticallyshallowdeep/run.py | import sys, os, gc, time
import tifffile as tif
from importlib.metadata import version
from .make_multiband_image import make_multiband_image
from .check_transpose import check_transpose
from .process_as_strips import process_as_strips
from .parse_string import parse_string
from .write_georef_image import write_geor... | 4,504 | Python | .py | 93 | 39.408602 | 295 | 0.618958 | yulunwu8/Optically-Shallow-Deep | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,242 | find_epsg.py | yulunwu8_Optically-Shallow-Deep/opticallyshallowdeep/find_epsg.py | def find_epsg(data):
# Use regex to extract the desired part
import re
from pyproj import CRS
# Pattern to match the text between "CONVERSION[" and the first comma following
pattern = r'CONVERSION\["(.*?)",'
# Search for the pattern in the data string
match = re.search(pattern... | 990 | Python | .py | 25 | 30.56 | 83 | 0.629386 | yulunwu8/Optically-Shallow-Deep | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,243 | parse_string.py | yulunwu8_Optically-Shallow-Deep/opticallyshallowdeep/parse_string.py | import re
def parse_string(s):
if s.lower() in ["lat", "long", "lat_abs"]:
return [s.lower()]#parses the column names for our model and makes into things that our scripts can interpret
match = re.match(r'B(\d+)([a-zA-Z]?)-w_(\d+)(_?(\w+))?', s) #used to parse model_column names
if match:
gro... | 939 | Python | .py | 20 | 38 | 117 | 0.581522 | yulunwu8/Optically-Shallow-Deep | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,244 | write_georef_image.py | yulunwu8_Optically-Shallow-Deep/opticallyshallowdeep/write_georef_image.py | import rasterio, gc
import numpy as np
def write_georef_image(image_path,RGB_img):
output_name = image_path.replace('.tif','_OSW_ODW.tif')
raster_with_ref = rasterio.open(image_path) # Open the raster with geospatial information
crs = raster_with_ref.crs # Get the CRS (Coordinate Reference System) fro... | 954 | Python | .py | 19 | 43.052632 | 95 | 0.682119 | yulunwu8/Optically-Shallow-Deep | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,245 | make_vertical_strips.py | yulunwu8_Optically-Shallow-Deep/opticallyshallowdeep/make_vertical_strips.py | import numpy as np
def make_vertical_strips(full_img):
'''use to save ram, process bigger images faster, and it overlaps so middle image is not
distorted from how edge pixels are handled'''
# number of dimensions
n_dim = full_img.ndim
if n_dim == 2:
height, width = full_img.shap... | 1,617 | Python | .py | 26 | 53.846154 | 100 | 0.645449 | yulunwu8/Optically-Shallow-Deep | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,246 | make_multiband_image.py | yulunwu8_Optically-Shallow-Deep/opticallyshallowdeep/make_multiband_image.py | import numpy as np
import os
import glob
import rasterio
import gc
# make multiband images in output dir
def make_multiband_image(file_in,folder_out):
basename = os.path.basename(file_in).rstrip(".SAFE")
# output path
imageFile = os.path.join(folder_out,basename) + '.tif'
if os.path.exists(i... | 2,120 | Python | .py | 50 | 32.12 | 134 | 0.577821 | yulunwu8/Optically-Shallow-Deep | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,247 | cloud_mask.py | yulunwu8_Optically-Shallow-Deep/opticallyshallowdeep/cloud_mask.py | import os, sys
import rasterio
import numpy as np
from scipy import ndimage
def cloud_mask(file_L1C, buffer_size = 8):
print('Making cloud mask...')
files = os.listdir(file_L1C)
metadata = {}
metadata['file_L1C'] = file_L1C
# Identify paths
for i, fname in enumerate(files):
... | 3,560 | Python | .py | 73 | 35.356164 | 128 | 0.578416 | yulunwu8/Optically-Shallow-Deep | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,248 | check_transpose.py | yulunwu8_Optically-Shallow-Deep/opticallyshallowdeep/check_transpose.py | # Always output row, column, band
def check_transpose(img):
#if the #of bands is greater than the number of x or y cords
y,x,b=img.shape
if b>y or b>x:
img=img.transpose(1,2,0)
return img | 213 | Python | .py | 7 | 25.857143 | 64 | 0.657005 | yulunwu8/Optically-Shallow-Deep | 8 | 2 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,249 | limuloid.py | IohannesArnold_limuloid/limuloid.py | #! /usr/bin/env python
# limuloid.py -- script to make LLMs conform to DTDs
# Copyright (C) John Arnold
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, ... | 10,508 | Python | .py | 301 | 27.584718 | 97 | 0.563379 | IohannesArnold/limuloid | 8 | 0 | 0 | AGPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,250 | main.py | SMmest3r_duplicatedTuningIdFinder/main.py | import os
import re
import tkinter
from tkinter import filedialog
import platform
import json
def select_directory():
if platform.system() == "Windows":
root = tkinter.Tk()
root.withdraw()
folder_selected = filedialog.askdirectory()
else:
folder_selected = input("Fo... | 4,233 | Python | .py | 85 | 39.588235 | 164 | 0.598783 | SMmest3r/duplicatedTuningIdFinder | 8 | 1 | 0 | GPL-3.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,251 | settings.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/settings.py | from django.conf import settings as django_settings
"""
Clean the HTML output of the EditorJS field using bleach.
This will remove any tags or attributes not allowed by the EditorJS features.
If you want to disable this, set it to False.
Optionally; cleaning can be FORCED by passing `clean=True` to the `render_edito... | 1,012 | Python | .py | 24 | 40.916667 | 98 | 0.778004 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,252 | apps.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/apps.py | from django.apps import AppConfig
class WagtailEditorjsConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'wagtail_editorjs'
| 163 | Python | .py | 4 | 37.25 | 56 | 0.796178 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,253 | django_editor.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/django_editor.py | from django.utils.functional import cached_property
from django.utils.safestring import mark_safe
from .forms import EditorJSFormField, EditorJSWidget
class DjangoEditorJSFormField(EditorJSFormField):
@cached_property
def widget(self):
return EditorJSDjangoWidget(
features=self.features,
... | 2,501 | Python | .py | 57 | 37.280702 | 99 | 0.68845 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,254 | __init__.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/__init__.py | """
wagtail_editorjs
© 2024 Nigel van Keulen, goodadvice.it
A Wagtail integration for the Editor.js block editor.
Includes support for custom blocks, inline tools, and more.
Everything is dynamic and customizable.
"""
import distutils.version as pv
__version__ = '1.6.5'
VERSION = pv.LooseVersion(__version__)
| 316 | Python | .py | 10 | 30.1 | 59 | 0.784053 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,255 | hooks.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/hooks.py |
"""
Hook used to register features with the editorjs widget.
"""
REGISTER_HOOK_NAME = "register_wagtail_editorjs_features"
"""
Hook used to build the configuration for the editorjs widget.
Any additional configuration or overrides can be done here.
"""
BUILD_CONFIG_HOOK = "editorjs_widget_build_config"
| 307 | Python | .py | 9 | 32.777778 | 61 | 0.79661 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,256 | blocks.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/blocks.py | from django.utils.functional import cached_property
from django.utils.translation import gettext_lazy as _
from wagtail.telepath import register
from wagtail.blocks.field_block import (
FieldBlock,
FieldBlockAdapter,
)
from .render import render_editorjs_html
from .forms import (
EditorJSFormField,
get... | 1,917 | Python | .py | 55 | 27.581818 | 109 | 0.647696 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,257 | render.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/render.py | from typing import Any, Union
from collections import defaultdict
from django.template.loader import render_to_string
from django.template.context import Context
from django.utils.safestring import mark_safe
from . import settings
from .registry import (
EditorJSElement,
InlineEditorJSFeature,
EDITOR_JS_FEA... | 5,185 | Python | .py | 137 | 29.817518 | 92 | 0.576163 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,258 | fields.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/fields.py | from typing import Any
from django.db import models
from django.utils.functional import cached_property
from django.core.exceptions import ValidationError
from .forms import EditorJSFormField
from .registry import EDITOR_JS_FEATURES, get_features
class EditorJSField(models.JSONField):
def __init__(self,
... | 1,729 | Python | .py | 47 | 28.191489 | 71 | 0.619795 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,259 | forms.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/forms.py | from django.utils.functional import cached_property
from django import forms
from django.forms import (
fields as formfields,
widgets
)
from wagtail import hooks
from datetime import datetime
from .hooks import (
BUILD_CONFIG_HOOK,
)
from .registry import (
EDITOR_JS_FEATURES,
get_features,
Te... | 6,666 | Python | .py | 161 | 30.701863 | 102 | 0.610033 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,260 | manage.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/test/manage.py | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'wagtail_editorjs.test.testapp.settings')
try:
from django.core.management import execute_from_comman... | 685 | Python | .py | 18 | 32.166667 | 93 | 0.683258 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,261 | settings.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/test/testapp/settings.py | """
Django settings for testapp project.
Generated by 'django-admin startproject' using Django 5.0.2.
For more information on this file, see
https://docs.djangoproject.com/en/5.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/5.0/ref/settings/
"""
from pathlib... | 3,682 | Python | .py | 107 | 30.11215 | 91 | 0.713397 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,262 | asgi.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/test/testapp/asgi.py | """
ASGI config for testapp project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTI... | 391 | Python | .py | 10 | 37.5 | 78 | 0.802667 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,263 | urls.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/test/testapp/urls.py | from django.conf import settings
from django.urls import include, path
from django.contrib import admin
from wagtail.admin import urls as wagtailadmin_urls
from wagtail import urls as wagtail_urls
from wagtail.documents import urls as wagtaildocs_urls
urlpatterns = [
path("django-admin/", admin.site.urls),
pa... | 1,145 | Python | .py | 26 | 40.538462 | 80 | 0.75763 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,264 | wsgi.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/test/testapp/wsgi.py | """
WSGI config for testapp project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/5.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTI... | 413 | Python | .py | 10 | 39.7 | 89 | 0.806045 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,265 | apps.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/test/core/apps.py | from django.apps import AppConfig
class CoreConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'wagtail_editorjs.test.core'
| 162 | Python | .py | 4 | 37 | 56 | 0.782051 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,266 | __init__.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/test/core/__init__.py | from django.test import TestCase
from django.conf import settings
from os import path
FIXTURES = path.join(settings.BASE_DIR, "core/fixtures")
| 145 | Python | .py | 4 | 34.75 | 56 | 0.827338 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,267 | test_inlines.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/test/core/tests/test_inlines.py | from django.test import TestCase
from .base import BaseEditorJSTest
from wagtail_editorjs.registry import (
InlineEditorJSFeature,
EDITOR_JS_FEATURES,
)
import bs4
TESTING_HTML = """
<div class="editorjs">
<div class="editorjs-block" data-type="paragraph">
<p>Hello, World!</p>
</div>
<... | 1,963 | Python | .py | 60 | 22.616667 | 75 | 0.544828 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,268 | test_render.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/test/core/tests/test_render.py | from typing import Any
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from bs4 import BeautifulSoup
from .base import BaseEditorJSTest
from wagtail_editorjs.render import render_editorjs_html
from wagtail_editorjs.registry import (
EditorJSTune,
EditorJSFeatur... | 5,697 | Python | .py | 135 | 28.533333 | 109 | 0.51541 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,269 | test_blocks.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/test/core/tests/test_blocks.py | from wagtail import blocks
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
import time
from wagtail_editorjs.features import (
WagtailBlockFeature,
)
from wagtail_editorjs.render import render_editorjs_html
from wagtail_editorjs.registry import (
EDITOR_JS_FEAT... | 4,288 | Python | .py | 133 | 21.383459 | 208 | 0.50439 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,270 | test_attrs.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/test/core/tests/test_attrs.py | from django.test import TestCase
from wagtail_editorjs.registry.element.element import EditorJSElement
from wagtail_editorjs.registry.element.utils import (
wrap_tag,
_make_attr,
add_attributes,
EditorJSElementAttribute,
EditorJSStyleAttribute,
)
class TestEditorJSElement(TestCase):
def test_... | 2,486 | Python | .py | 82 | 19.402439 | 125 | 0.493895 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,271 | base.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/test/core/tests/base.py | from django.test import TestCase
from wagtail.models import Collection, Page
from wagtail.images.tests.utils import (
get_test_image_file,
get_test_image_file_jpeg,
get_test_image_file_webp,
get_test_image_file_avif,
)
from wagtail.images import get_image_model
from wagtail.documents import get_document... | 2,241 | Python | .py | 57 | 28.77193 | 119 | 0.586287 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,272 | editorjs.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/templatetags/editorjs.py | from django import (
template,
forms,
)
from ..render import render_editorjs_html
from ..registry import EDITOR_JS_FEATURES, EditorJSValue
from ..forms import _get_feature_scripts
register = template.Library()
@register.simple_tag(takes_context=True, name="editorjs")
def render_editorjs(context, data: EditorJ... | 1,441 | Python | .py | 42 | 27.833333 | 71 | 0.644043 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,273 | inlines.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/features/inlines.py | from typing import Any
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from wagtail.models import Page
from wagtail.admin.widgets import AdminPageChooser
from wagtail.documents.widgets import AdminDocumentChooser
from wagtail.documents import get_document_model
from wagtail import... | 7,479 | Python | .py | 198 | 29.09596 | 162 | 0.607553 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,274 | tunes.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/features/tunes.py | from typing import Any
from django import forms
from django.utils.translation import gettext_lazy as _
from ..registry import (
EditorJSTune,
EditorJSElement,
wrapper,
)
class AlignmentBlockTune(EditorJSTune):
allowed_attributes = {
"*": ["class"],
}
klass = "AlignmentBlockTune"
j... | 3,848 | Python | .py | 106 | 26.04717 | 105 | 0.586312 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,275 | images.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/features/images.py | from typing import Any, TYPE_CHECKING
from django import forms
from django.urls import reverse, path
from django.shortcuts import get_object_or_404
from django.utils.translation import gettext_lazy as _
from django.http import (
HttpRequest,
FileResponse,
HttpResponse,
)
from wagtail.images.widgets import ... | 9,507 | Python | .py | 265 | 24.298113 | 98 | 0.524904 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,276 | documents.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/features/documents.py | from typing import Any, TYPE_CHECKING
from django import forms
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from django.views.decorators.csrf import csrf_exempt
from django.utils.safestring import mark_safe
from django.http import (
JsonResponse,
)
from wagtail.models impo... | 6,611 | Python | .py | 178 | 25.078652 | 155 | 0.507371 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,277 | __init__.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/features/__init__.py | from .blocks import (
CodeFeature,
DelimiterFeature,
HeaderFeature,
HTMLFeature,
WarningFeature,
TableFeature,
BlockQuoteFeature,
WagtailBlockFeature,
EditorJSFeatureStructBlock,
ButtonFeature,
)
from .lists import (
NestedListFeature,
CheckListFeature,
)
from .documents ... | 634 | Python | .py | 35 | 14.514286 | 31 | 0.748333 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,278 | lists.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/features/lists.py | from typing import Any
from django import forms
from django.utils.translation import gettext_lazy as _
from ..registry import (
EditorJSFeature,
EditorJSBlock,
EditorJSElement,
wrap_tag,
)
class NestedListElement(EditorJSElement):
def __init__(self, tag: str, items: list[EditorJSElement], close_ta... | 5,005 | Python | .py | 131 | 23.862595 | 117 | 0.465914 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,279 | blocks.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/features/blocks.py | from typing import Any
from django import forms
from django.utils.translation import gettext_lazy as _
from django.utils.functional import cached_property
from django.templatetags.static import static
from django.utils.safestring import mark_safe
import bleach
from ..registry import (
PageChooserURLsMixin,
Ed... | 15,989 | Python | .py | 437 | 26.455378 | 179 | 0.55979 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,280 | feature_registry.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/registry/feature_registry.py | """
This module defines mappings from tools to the editorjs javascript side.
"""
from collections import defaultdict, OrderedDict
from typing import Any, Union
from wagtail import hooks
import copy
from ..hooks import (
REGISTER_HOOK_NAME,
)
from .value import (
EditorJSValue,
)
from .features import (
... | 8,569 | Python | .py | 221 | 27.361991 | 105 | 0.563541 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,281 | __init__.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/registry/__init__.py | from .feature_registry import (
EditorJSFeatures,
)
from .features import (
PageChooserURLsMixin,
BaseEditorJSFeature,
EditorJSFeature,
EditorJSJavascriptFeature,
EditorJSTune,
FeatureViewMixin,
InlineEditorJSFeature,
ModelInlineEditorJSFeature,
TemplateNotSpecifiedError,
)
from ... | 891 | Python | .py | 36 | 20.277778 | 59 | 0.74 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,282 | value.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/registry/value.py | from typing import Any, Union, TYPE_CHECKING
import datetime
if TYPE_CHECKING:
from .features import EditorJSFeature
class EditorJSBlock(dict):
def __init__(self, data: dict, features: list[str]):
self.features = features
super().__init__(data)
@property
def id(self):
return ... | 3,190 | Python | .py | 90 | 25.344444 | 77 | 0.570268 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,283 | attrs.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/registry/element/attrs.py | from typing import Any, Union
class EditorJSElementAttribute:
def __init__(self, value: Union[str, list[str]], delimiter: str = " "):
if not isinstance(value, (list, dict)):
value = [value]
if not isinstance(value, dict):
value = set(value)
self.value = value
... | 2,004 | Python | .py | 50 | 29.26 | 92 | 0.57892 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,284 | element.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/registry/element/element.py | from typing import Any, Union, TypeVar
from .attrs import EditorJSElementAttribute
from .utils import add_attributes, wrap_tag, _make_attr
import bs4
ElementType = TypeVar("ElementType", bound="EditorJSElement")
class EditorJSElement:
"""
Base class for all elements.
"""
def __init__(self, ... | 4,950 | Python | .py | 123 | 29.869919 | 147 | 0.599534 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,285 | utils.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/registry/element/utils.py | from typing import Any, Union, TYPE_CHECKING
if TYPE_CHECKING:
from .element import EditorJSElement
from .attrs import (
EditorJSElementAttribute,
EditorJSStyleAttribute,
)
def make_attrs(attrs: dict[str, Any]) -> str:
attrs = {
key: _make_attr(value)
for key, value in attrs.items()... | 1,469 | Python | .py | 39 | 31.307692 | 95 | 0.646558 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,286 | __init__.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/registry/element/__init__.py | from .attrs import (
EditorJSElementAttribute,
EditorJSStyleAttribute,
)
from .utils import (
wrap_tag,
add_attributes,
)
from .element import (
EditorJSElement,
EditorJSSoupElement,
EditorJSWrapper,
wrapper,
) | 242 | Python | .py | 14 | 14.071429 | 29 | 0.737991 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,287 | inlines.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/registry/features/inlines.py | from typing import Any, Union
from django.utils.functional import cached_property
from ...settings import USE_FULL_URLS
from .base import BaseEditorJSFeature
import bs4
class InlineEditorJSFeature(BaseEditorJSFeature):
must_have_attrs = None
can_have_attrs = None
tag_name = None
def __init__(
... | 8,610 | Python | .py | 217 | 29.248848 | 106 | 0.569473 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,288 | basic.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/registry/features/basic.py | from typing import Any, Union
from django import forms
from ..element import EditorJSElement
from ..value import EditorJSBlock
from .base import BaseEditorJSFeature
class EditorJSJavascriptFeature(BaseEditorJSFeature):
def __init__(self, tool_name: str, js: Union[str, list[str]] = None, css: Union[str, list[str]... | 2,168 | Python | .py | 53 | 32.320755 | 206 | 0.632162 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,289 | __init__.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/registry/features/__init__.py | from .base import (
PageChooserURLsMixin,
TemplateNotSpecifiedError,
BaseEditorJSFeature,
)
from .basic import (
EditorJSFeature,
EditorJSJavascriptFeature,
EditorJSTune,
)
from .inlines import (
InlineEditorJSFeature,
ModelInlineEditorJSFeature,
)
from .view import (
FeatureViewMixi... | 324 | Python | .py | 17 | 16 | 31 | 0.775974 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,290 | snippets_inlines.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/registry/features/snippets_inlines.py | from typing import Any
from .inlines import (
ModelInlineEditorJSFeature,
)
from wagtail.snippets.widgets import AdminSnippetChooser
class SnippetChooserModel:
""" Utility class for type annotations """
def build_element(self, soup_elem, context = None): ...
class BaseInlineSnippetChooserFeature(ModelI... | 650 | Python | .py | 14 | 41.857143 | 126 | 0.753994 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,291 | base.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/registry/features/base.py | from typing import Any, Union, Mapping, Literal, TYPE_CHECKING
from django.urls import reverse_lazy
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from ..value import (
EditorJSBlock,
)
if TYPE_CHECKING:
from ..feature_registry import EditorJSFeatures
class ... | 8,021 | Python | .py | 205 | 28.565854 | 125 | 0.591658 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,292 | view.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/registry/features/view.py | from typing import TYPE_CHECKING
from django.urls import path
from django.http import HttpRequest, HttpResponseNotAllowed
from wagtail import hooks
if TYPE_CHECKING:
from ..feature_registry import EditorJSFeatures
class FeatureViewMixin:
def handler(self, request: HttpRequest, *args, **kwargs):
meth... | 1,219 | Python | .py | 30 | 32 | 70 | 0.641638 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,293 | tippy-bundle.min.js | Nigel2392_wagtail_editorjs/wagtail_editorjs/static/wagtail_editorjs/vendor/tippy/tippy-bundle.min.js | !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],e):(t=t||self).tippy=e(t.Popper)}(this,(function(t){"use strict";var e="undefined"!=typeof window&&"undefined"!=typeof document,n=!!e&&!!window.... | 25,717 | Python | .py | 2 | 12,857.5 | 25,667 | 0.698619 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,294 | features.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/wagtail_hooks/features.py | from typing import Any
from wagtail import hooks
from django.urls import reverse_lazy
from ..hooks import (
REGISTER_HOOK_NAME,
BUILD_CONFIG_HOOK,
)
from ..registry import (
EditorJSFeature,
EditorJSFeatures,
EditorJSJavascriptFeature,
)
from ..features import (
AttachesFeature,
BlockQuoteF... | 7,047 | Python | .py | 302 | 15.582781 | 74 | 0.536662 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,295 | urls.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/wagtail_hooks/urls.py | from django.urls import path, include
from wagtail import hooks
@hooks.register("register_admin_urls")
def register_admin_urls():
urls = []
# Make sure all features are properly registered.
from ..registry import EDITOR_JS_FEATURES
EDITOR_JS_FEATURES._look_for_features()
for hook in hooks.get_ho... | 620 | Python | .py | 20 | 23.1 | 58 | 0.606061 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,296 | __init__.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/wagtail_hooks/__init__.py | from .features import *
from .urls import *
from .wagtail_fedit import * | 72 | Python | .py | 3 | 23.333333 | 28 | 0.771429 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,297 | wagtail_fedit.py | Nigel2392_wagtail_editorjs/wagtail_editorjs/wagtail_hooks/wagtail_fedit.py | from wagtail_editorjs.render import render_editorjs_html
from wagtail_editorjs.registry import EditorJSValue
from wagtail_editorjs.fields import EditorJSField
from wagtail import hooks
@hooks.register("wagtail_fedit.register_type_renderer")
def register_renderers(renderer_map):
# This is a custom renderer for R... | 754 | Python | .py | 18 | 37.5 | 97 | 0.76881 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,298 | editorjs_tunes_example.py | Nigel2392_wagtail_editorjs/docs/examples/editorjs_tunes_example.py | from typing import Any
from django import forms
from wagtail_editorjs.hooks import REGISTER_HOOK_NAME
from wagtail_editorjs.registry import EditorJSFeatures, EditorJSTune, EditorJSElement
from wagtail import hooks
class AlignmentBlockTune(EditorJSTune):
allowed_attributes = {"*": ["class"]}
klass = "Alignment... | 1,678 | Python | .py | 36 | 39.416667 | 103 | 0.697344 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |
2,288,299 | editorjs_feature_example.py | Nigel2392_wagtail_editorjs/docs/examples/editorjs_feature_example.py |
from typing import Any
from django import forms
from wagtail_editorjs.hooks import REGISTER_HOOK_NAME
from wagtail_editorjs.registry import (
EditorJSFeature, EditorJSFeatures,
EditorJSElement, EditorJSBlock,
)
from wagtail import hooks
class CustomImageFeature(EditorJSFeature):
# These tags are allowed... | 2,512 | Python | .py | 61 | 31.885246 | 99 | 0.613759 | Nigel2392/wagtail_editorjs | 8 | 0 | 3 | GPL-2.0 | 9/5/2024, 10:48:26 PM (Europe/Amsterdam) |