We can't make this file beautiful and searchable because it's too large.
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
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
| #!/bin/bash | |
| # follow pixi installation instructions https://pixi.prefix.dev/latest/installation/ | |
| curl -fsSL https://pixi.sh/install.sh | sh | |
| exec $SHELL | |
| # create a new project using pixi in the directory `my_project` | |
| pixi init my_project | |
| cd my_project |
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 TYPE_CHECKING | |
| from zarr.storage import WrapperStore | |
| from zarr.core.common import ZARR_JSON | |
| if TYPE_CHECKING: | |
| from zarr.abc.store import ( | |
| Store, | |
| RangeByteRequest, | |
| OffsetByteRequest, | |
| SuffixByteRequest, |
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 __future__ import annotations | |
| from xml.etree import ElementTree as ET | |
| from pydantic import BaseModel, Field | |
| class XmlElement(BaseModel): | |
| tag: str = Field(alias="#") | |
| attributes: dict[str, str] = Field(alias="@", default_factory=dict) | |
| children: list[str | XmlElement] = Field(alias="c", default_factory=list) |
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
| use serde::de::DeserializeOwned; | |
| trait JsonDeserializable { | |
| fn deser<T: DeserializeOwned>(self) -> serde_json::Result<T>; | |
| } | |
| impl JsonDeserializable for serde_json::Value { | |
| fn deser<T: DeserializeOwned>(self) -> serde_json::Result<T> { | |
| serde_json::from_value(self) | |
| } |
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 pathlib import Path | |
| import json | |
| scripts_dir = Path(__file__).resolve().parent | |
| module_dir = scripts_dir.parent.joinpath("src", "cmap") | |
| data_dir = module_dir.joinpath("data") | |
| names = [] | |
| for rel_path in sorted(data_dir.glob("*/record.json")): |
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 classname(obj): | |
| cls = type(obj) | |
| module = cls.__module__ | |
| name = cls.__qualname__ | |
| if module is not None and module != "__builtin__": | |
| name = module + "." + name | |
| return name |
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
| --[[ | |
| Load the script from this file into redis, storing its SHA1 hash as an environment variable | |
| $ SCRIPT_SHA=$(redis-cli -x script load < gcra.lua) | |
| Run the script by addressing its hash, with 1 key (as used by this script) called `myratelimitkey`, | |
| with a rate limit of 2 attempts every 1 000 milliseconds (1 second). | |
| $ redis-cli EVALSHA $SCRIPT_SHA 1 myratelimitkey 2 1000 |
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
| backports.strenum | |
| molesq | |
| hcl | |
| yarqueue | |
| #extra: ncollpyde | |
| ncollpyde | |
| #extra: test |
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
| # adapted from https://stackoverflow.com/a/35804945/2700168 | |
| import logging | |
| def add_log_level(level_name, level_num, method_name=None): | |
| """ | |
| Adapted from https://stackoverflow.com/a/35804945/2700168 | |
| Comprehensively adds a new logging level to the `logging` module and the | |
| currently configured logging class. |
NewerOlder