This file contains 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 io | |
import sys | |
from loguru import logger | |
import numpy | |
import tensorflow as tf | |
from ..polyfills.string import removeprefix, removesuffix | |
from .normalise_text import normalise as normalise_text |
This file contains 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
[Unit] | |
Description=Reboot if the network connection is down | |
After=network.target | |
[Service] | |
Type=simple | |
# Because it needs to be able to reboot | |
User=root | |
Group=root | |
EnvironmentFile=-/etc/default/ensure-network |
This file contains 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
"use strict"; | |
import EventEmitter from 'events'; | |
import child_process from 'child_process'; | |
/** | |
* Helper method that waits for an event to be fired on a given object. | |
* @param {EventEmitter} obj The object that will fire the event - must inherit from EventEmitter | |
* @param {string} event_name The name of the event to wait for. | |
* @return {Promise} A promise that resolves when the specified event is fired on the given object. |
This file contains 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
class ErrorWrapper extends Error { | |
constructor(message, inner_exception) { | |
super(message); | |
this.inner_exception = inner_exception; | |
} | |
toString() { | |
return `${super.toString()}\n***Inner Exception ***\n${this.inner_exception}`; | |
} | |
} |
This file contains 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
"use strict"; | |
import l from './Log.mjs'; | |
import { ErrorWrapper } from './Errors.mjs'; | |
/** | |
* Tries to execute a given function, and retried it a specified number of | |
* times if it throws an error. | |
* @param {Number} times The number of times to retry before giving up and throwing an error ourselves. | |
* @param {Function} func The function to execute. |
This file contains 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
"use strict"; | |
import fs from 'fs'; | |
import a from './Ansi.mjs'; | |
/** | |
* Represents a program and all it's arguments and subcommands. | |
* TODO: Publish on npm under the name "applause-cli", since it's inspired by clap? | |
* @license MPL-2.0 |
This file contains 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
"use strict"; | |
/** | |
* Stopwatch class for timing things. | |
* Based on System.Diagnostics.Stopwatch from .NET: https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.stopwatch | |
*/ | |
class Stopwatch { | |
/** | |
* Creates a new (stopped) stopwatch. | |
*/ |
This file contains 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
"use strict"; | |
import a from './Ansi.mjs'; | |
const LOG_LEVELS = { | |
DEBUG: 0, | |
INFO: 1, | |
LOG: 2, | |
WARN: 4, | |
ERROR: 8, |
This file contains 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
/** | |
* Creates an images containing the specified text. | |
* Useful for sending errors back to the client. | |
* @package core | |
* @param string $text The text to include in the image. | |
* @param int $target_size The target width to aim for when creating | |
* the image. Not not specified, a value is | |
* determined automatically. | |
* @return resource The handle to the generated GD image. | |
*/ |
This file contains 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
<?php | |
/* | |
███████ ████████ ██████ ██████ █████ ██████ ███████ ██████ ██████ ██ ██ | |
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ | |
███████ ██ ██ ██ ██████ ███████ ██ ███ █████ ██████ ██ ██ ███ | |
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ | |
███████ ██ ██████ ██ ██ ██ ██ ██████ ███████ ██████ ██████ ██ ██ | |
*/ |
NewerOlder