Skip to content

Instantly share code, notes, and snippets.

@crusaderky
crusaderky / argcargvtest.py
Created July 30, 2025 09:25
SWIG_AsArgcArgv segfault
# This file was automatically generated by SWIG (https://www.swig.org).
# Version 4.4.0
#
# Do not make changes to this file unless you know what you are doing - modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
# Import the low-level C/C++ module
if getattr(globals().get("__spec__"), "parent", None) or __package__ or "." in __name__:
from . import _argcargvtest
@crusaderky
crusaderky / make_versioned_dataset.py
Created December 20, 2024 16:01
versioned-hdf5 demo dataset builder
import argparse
import h5py
import numpy as np
from versioned_hdf5 import VersionedHDF5File
def gen_string(rs, j, k, dt):
return (
rs.randint(ord("A"), ord("Z"), dt.itemsize * j * k, dtype="uint8")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@crusaderky
crusaderky / unravel_pickle.py
Created April 4, 2024 23:47
unravel_pickle
from pickle import PickleBuffer
def unravel_pickle(obj: object, seen: list[int] | None = None) -> Any:
if isinstance(obj, (int, float, complex, bytes, str, bool, type(None))):
return obj
if isinstance(obj, (bytearray, memoryview, PickleBuffer)):
return str(type(obj)), bytes(obj)
if callable(obj):
@crusaderky
crusaderky / tcp_bench.ipynb
Created November 1, 2023 13:57
dask/distributed#8318 - Speed up network transfer of small buffers
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@crusaderky
crusaderky / DemoDay.ipynb
Created June 19, 2023 08:52
Dask Demo Day: Fine performance metrics and spans
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@crusaderky
crusaderky / Fine performance metrics demo.ipynb
Created March 3, 2023 16:36
Fine performance metrics demo (distributed#7586)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.