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 requests | |
import pathlib | |
import os | |
import re | |
from sphinx.util import logging | |
logger = logging.getLogger(__name__) | |
def emoji_to_identifier(emoji): |
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
% Support emoji | |
\usepackage{fontspec} | |
\newfontfamily{\emojifont}{Noto Emoji} | |
\usepackage[Latin, Greek, Dingbats, TransportAndMapSymbols, MiscellaneousSymbolsAndPictographs]{ucharclasses} | |
\setTransitionsFor{MiscellaneousSymbolsAndPictographs}{\begingroup\emojifont}{\endgroup} | |
\setTransitionsFor{TransportAndMapSymbols}{\begingroup\emojifont}{\endgroup} | |
\setTransitionsFor{Dingbats}{\begingroup\emojifont}{\endgroup} |
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
// ==UserScript== | |
// @name Hide Adverts | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://www.amazon.co.jp/* | |
// @match https://smile.amazon.co.uk/* | |
// @match https://www.amazon.co.uk/* | |
// @match https://smile.amazon.com/* |
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 numba | |
import ast | |
import awkward as ak | |
import inspect | |
from numba import literal_unroll | |
ak.numba.register() | |
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
hist==2.6.1 | |
numpy>=1.17 | |
mplhep==0.3.23 |
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
%%script env -S podman run --rm -i -w /source -v {cwd}:/source --entrypoint=python3 garfieldpp |
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 math | |
@nb.njit | |
def _reservoir_sample_prepare(n, w, i, out): | |
k = len(out) | |
out[:] = np.arange(k, dtype=out.dtype) | |
i[()] = k - 1 | |
w[()] = 1 |
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
@ak._connect._numpy.implements("stack") | |
def stack(arrays, axis=0, merge=True, mergebool=True, highlevel=True, behavior=None): | |
""" | |
Args: | |
arrays: Arrays to concatenate along any dimension. | |
axis (int): The dimension at which this operation is applied. The | |
outermost dimension is `0`, followed by `1`, etc., and negative | |
values count backward from the innermost: `-1` is the innermost | |
dimension, `-2` is the next level up, etc. | |
merge (bool): If True, combine data into the same buffers wherever |
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
def choose(a, choices, mode="raise", highlevel=True, behavior=None): | |
def getfunction(inputs, depth): | |
if not all(x.purelist_depth == 1 for x in inputs): | |
return | |
arrays = [nplike.asarray(x) for x in inputs] | |
a = arrays[0] | |
choices = arrays[1:] | |
out = np.choose(a, choices, mode=mode) |
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
def promote_option( | |
array: ak.Array, | |
axis: int = None, | |
union: bool = True, | |
highlevel=True, | |
behavior=None, | |
) -> ak.Array: | |
nplike = ak.nplike.of(array) | |
layout = ak.to_layout(array) | |
posaxis = layout.axis_wrap_if_negative(axis) |