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
# -*- coding: utf-8 -*- | |
import time | |
import numpy as np | |
from scipy.special import expit | |
from sklearn.base import BaseEstimator | |
from sklearn.base import TransformerMixin | |
from sklearn.utils import check_array | |
from sklearn.utils import check_random_state | |
from sklearn.utils import gen_even_slices |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import argparse | |
import re | |
from collections import defaultdict | |
from typing import (Callable, ClassVar, Dict, NamedTuple, Optional, Type, | |
TypeVar, Union, cast) | |
Subclass = TypeVar("Subclass", bound="Subcommand") | |
Registry = Dict[Type["Subcommand"], Dict[str, Type["Subcommand"]]] | |
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
import fcntl | |
import hashlib | |
import inspect | |
import io | |
import logging | |
import pickle | |
import string | |
import time | |
from contextlib import contextmanager | |
from functools import wraps |
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
import threading | |
from collections import defaultdict | |
from concurrent.futures import ThreadPoolExecutor, wait | |
from typing import (Any, Dict, Generic, Hashable, ItemsView, Iterator, | |
Optional, TypeVar, Union, overload) | |
KT = TypeVar("KT", bound=Hashable) | |
VT = TypeVar("VT") | |
VT_co = TypeVar("VT_co") |
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
import os | |
import re | |
import sys | |
import unicodedata | |
from typing import Any, ClassVar, Dict, List, Optional, TextIO, Union | |
CSI = "\x1b" | |
REGEX_ANSI_CSI = re.compile(rf"{CSI}\[[0-9]+[a-zA-Z]") | |
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
import copy | |
import dataclasses | |
import json | |
import typing | |
from collections.abc import Sized | |
from typing import Any, Dict, Optional, Type, TypeVar, Union | |
T = TypeVar("T") | |
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 Any, Dict | |
def flatten(data: Any, parent_key: str = "") -> Any: | |
if isinstance(data, list): | |
data = {str(i): x for i, x in enumerate(data)} | |
if not isinstance(data, dict): | |
return data |
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 enum import Enum | |
from typing import Optional, TypeVar, Union | |
T = TypeVar("T") | |
CSI = "\x1b[" | |
class AnsiCodes(Enum): | |
def __str__(self) -> str: |
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
import os | |
import sys | |
import threading | |
import time | |
from collections import abc | |
from types import TracebackType | |
from typing import (Any, AsyncIterable, AsyncIterator, Callable, Dict, | |
Iterable, Iterator, List, Optional, TextIO, Type, TypeVar, | |
Union) |
OlderNewer