I hereby claim:
- I am antonl on github.
- I am aloukian (https://keybase.io/aloukian) on keybase.
- I have a public key ASDfbiDVp6PrF9hVGyK-3DuCF9vHS2KHI408vLzUpiLlAwo
To claim this, I am signing this object:
| import asyncio | |
| from dataclasses import dataclass, field | |
| from time import perf_counter_ns, sleep | |
| from typing import Literal | |
| @dataclass | |
| class API: | |
| state: list[tuple[str, Literal["start", "stop"], int]] = field(default_factory=list) | |
| sleep: float = 0.01 |
| import socket | |
| from concurrent.futures import ThreadPoolExecutor | |
| import logging | |
| from datetime import datetime | |
| # Configure logging | |
| logging.basicConfig( | |
| level=logging.DEBUG, # Set the minimum logging level | |
| format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', # Set the format of log messages | |
| datefmt='%Y-%m-%d %H:%M:%S', # Set the format of the date and time |
| # ThreadPool version | |
| from concurrent.futures import ThreadPoolExecutor | |
| import time | |
| class Solution: | |
| def crawl(self, startUrl: str, htmlParser: 'HtmlParser') -> List[str]: | |
| domain, *_ = startUrl[7:].split('/') | |
| domain = "http://" + domain |
| """ | |
| Implements a simple task computation framework inspired by Dask. | |
| The tasks are encoded as a map where the keys are the names of | |
| values and the values are either computed values, references to | |
| other keys, or tuples representing a function call. | |
| For example, the function call fn(x) may be represented as | |
| ```python |
| import io | |
| import os | |
| from functools import lru_cache | |
| from collections import Counter | |
| from dataclasses import dataclass | |
| import regex as re | |
| import mmap | |
| from concurrent.futures import ProcessPoolExecutor, as_completed | |
| GPT2_PATTERN = r"""'(?:[sdmt]|ll|ve|re)| ?\p{L}+| ?\p{N}+| ?[^\s\p{L}\p{N}]+|\s+(?!\S)|\s+""" |
I hereby claim:
To claim this, I am signing this object:
| from glue.config import data_factory | |
| from glue.core import Data, Component | |
| from h5py import File | |
| import numpy as np | |
| def is_nudie_file(filename, **kwargs): | |
| '''checks that the given file is a nudie file''' | |
| if not filename.endswith('.h5'): | |
| return False |
| from __future__ import print_function, unicode_literals | |
| import sys | |
| from PyQt4 import QtGui, QtCore | |
| from main_ui import Ui_MainWindow | |
| import subprocess | |
| class MainWindow(QtGui.QMainWindow, Ui_MainWindow): | |
| def __init__(self, parent=None): | |
| QtGui.QMainWindow.__init__(self, parent) | |
| self.setupUi(self) |
| from winspec import SpeFile | |
| from pathlib import Path | |
| from matplotlib.pylab import * | |
| from scipy.signal import argrelmax | |
| # Period of sampling in seconds | |
| regen_period = 0.001*2 | |
| # Change the path to load the SPE file | |
| file_path = Path('./100BRX-800fs.SPE') |
| # tags for phase cycles | |
| phase_cycles = [0, 1, 0.6, 1.6, 1.3, 2.3] | |
| # subspaces | |
| sub1, sub2 = np.zeros((3,3), dtype=complex), np.zeros((3,3), dtype=complex) | |
| sub1 = np.array([[np.exp(1j*np.pi*(x)), np.exp(1j*np.pi*(-x)), 1] for x in phase_cycles[0::2]]) | |
| sub2 = np.array([[np.exp(1j*np.pi*(x)), np.exp(1j*np.pi*(-x)), 1] for x in phase_cycles[1::2]]) | |
| # Full matrix | |
| C = np.kron(np.array([[1, 0], [0, 0]]), sub1) + np.kron(np.array([[0, 0], [0, 1]]), sub2) |