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 SignallingNone instance that raises an error when accessed. | |
| It is intended to be used as a default value in data classes where an | |
| explicit value must be set before the the data is used. The code was | |
| written for a config data class implementation. | |
| """ | |
| from __future__ import annotations | |
| from typing import Literal, NoReturn |
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 TypeVar | |
| T_ = TypeVar("T_", bound=object) | |
| def myDataClass(cls: T_) -> T_: | |
| """A simple data class decorator that generates slots automatically | |
| and creates an init function to match. | |
| """ |
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
| """ | |
| Upscale: Star Trek Voyager | |
| Source: PAL DVD (2017 Release) | |
| AI Model: Topaz Video AI 4.0, Iris V1 | |
| """ | |
| import sys | |
| import subprocess | |
| from pathlib import Path |
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
| """ | |
| Upscale: Star Trek Deep Space Nine | |
| Source: PAL DVD | |
| AI Model: Topaz Video AI 3.4, Iris V1 | |
| """ | |
| import sys | |
| import subprocess | |
| from pathlib import Path |
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 json | |
| def jsonEncode(data, n=0, nmax=0): | |
| """Encode a dictionary, list or tuple as a json object or array, and | |
| indent from level n up to a max level nmax if nmax is larger than 0. | |
| """ | |
| if not isinstance(data, (dict, list, tuple)): | |
| return "[]" | |
| buffer = [] |
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
| def numberToRoman(numVal, isLower=False): | |
| """Convert an integer to a roman number. | |
| """ | |
| if not isinstance(numVal, int): | |
| return "NAN" | |
| if numVal < 1 or numVal > 4999: | |
| return "OOR" | |
| theValues = [ | |
| (1000, "M"), (900, "CM"), (500, "D"), (400, "CD"), (100, "C"), (90, "XC"), |
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
| def formatTime(tS): | |
| """Format a time in seconds in HH:MM:SS format or d-HH:MM:SS format | |
| if a full day or longer. | |
| """ | |
| if isinstance(tS, int): | |
| if tS >= 86400: | |
| return f"{tS//86400:d}-{tS%86400//3600:02d}:{tS%3600//60:02d}:{tS%60:02d}" | |
| else: | |
| return f"{tS//3600:02d}:{tS%3600//60:02d}:{tS%60:02d}" | |
| return "ERROR" |
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
| program main | |
| use, intrinsic :: iso_fortran_env | |
| implicit none | |
| real(kind=real32), parameter :: pi32 = 3.1415925_real32 | |
| real(kind=real64), parameter :: pi64 = 3.141592653589793238462643383279502884197169399375105820974_real64 | |
| real(kind=real128), parameter :: pi128 = 3.141592653589793238462643383279502884197169399375105820974_real128 |