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
"""Converts between the RGB and CIECAM02 color spaces.""" | |
from collections import namedtuple | |
from functools import partial | |
import colour | |
from colour.utilities import tsplit, tstack | |
import numpy as np | |
from scipy.optimize import fmin_l_bfgs_b |
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 pyparsing as pp | |
from pyparsing import pyparsing_common as ppc | |
from repl import repl | |
variables = {} | |
var = ppc.identifier.copy() | |
def do_var(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
import pyparsing as pp | |
from pyparsing import pyparsing_common as ppc | |
from repl import repl | |
class Node: | |
def __init__(self, name, *args): | |
self.name = name | |
self.items = args |
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 numpy as np | |
class EWMA: | |
"""An exponentially weighted moving average with initialization bias correction.""" | |
def __init__(self, shape=(), dtype=np.float64, beta=0.9, correct_bias=True): | |
self.beta = beta | |
self.beta_accum = 1 if correct_bias else 0 | |
self.value = np.zeros(shape, dtype) |
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
"""Captures and returns an argument passed to a lambda expression.""" | |
class Capture: | |
"""Captures and returns an argument passed to a lambda expression. | |
:param fn: The lambda expression. | |
:type fn: function | |
:Example: |
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 inspect | |
import typing | |
from typing import get_type_hints, TypeVar, Any, AnyStr, Generic, Union | |
from sphinx.util import logging | |
from sphinx.util.inspect import Signature | |
try: | |
from typing_extensions import Protocol | |
except ImportError: |
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
"""The prompt-toolkit utility function :func:`format_fragments`.""" | |
from prompt_toolkit.formatted_text import FormattedText | |
def format_fragments(fragments, *args, **kwargs): | |
"""Applies :meth:`str.format` to each text fragment in `fragments`. | |
Args: | |
fragments (FormattedText): The input list of text fragments. |
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
"""A with-statement context manager to benchmark code.""" | |
import time | |
__all__ = ['Benchmark'] | |
class Benchmark: | |
"""A with-statement context manager to benchmark code.""" | |
def __init__(self, timer=time.perf_counter): |
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
name: "thing" | |
layer { | |
name: "data" | |
type: "Data" | |
top: "big_data" | |
top: "label" | |
include { phase: TRAIN } | |
transform_param { | |
mean_value: 103.939 | |
mean_value: 116.779 |
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 provides configuration information about non-Python dependencies for | |
# numpy.distutils-using packages. Create a file like this called "site.cfg" next | |
# to your package's setup.py file and fill in the appropriate sections. Not all | |
# packages will use all sections so you should leave out sections that your | |
# package does not use. | |
# To assist automatic installation like easy_install, the user's home directory | |
# will also be checked for the file ~/.numpy-site.cfg . | |
# The format of the file is that of the standard library's ConfigParser module. |