This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import keyboard | |
def get_pressed_keys() -> set[str]: | |
"""It obtains the pressed keyboard keys""" | |
keyboard._listener.start_if_necessary() | |
with keyboard._pressed_events_lock: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import numpy.typing as np_typing | |
try: | |
import cv2 as opencv | |
has_opencv = True | |
except ModuleNotFoundError: | |
has_opencv = False | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import numpy.typing as np_typing | |
Vector = np_typing.NDArray[np.float64] | |
Matrix = np_typing.NDArray[np.float64] | |
def extrinsics_to_rotmat_and_posvec(E: Matrix) -> tuple[Matrix, Vector]: | |
R = E[:, :3] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
artifacts | |
bad anatomy | |
bad proportions | |
blurry | |
cloned face | |
cropped | |
deformed | |
dehydrated | |
disfigured | |
duplicate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""A collection of graph coloring algorithms | |
The problem of assigning colors to the vertices of a graph such that no two adjacent vertices have the same color. | |
""" | |
import random | |
import typing | |
from collections import defaultdict | |
import networkx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Any | |
# TODO: type hinting | |
def deepfrozenset(obj: Any) -> Any: | |
if isinstance(obj, dict): | |
return frozenset([(key, deepfrozenset(val)) for key, val in obj.items()]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""A centralized logging system for any library | |
source code inspired by https://github.com/huggingface/transformers/blob/main/src/transformers/utils/logging.py | |
""" | |
import logging | |
import os | |
import sys | |
import threading | |
from functools import lru_cache |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript"> | |
const X = "I am X"; | |
function helloworld() { | |
return "Hello world"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
def sieve_of_atkin(n: int) -> list[int]: | |
"""The Sieve of Atkin prime finding algorithm, [1]_ | |
References | |
---------- | |
.. [1] A. O. L. Atkin, D. J. Bernstein, 2003 | |
""" |
OlderNewer