repo_name stringlengths 7 65 | path stringlengths 5 185 | copies stringlengths 1 4 | size stringlengths 4 6 | content stringlengths 977 990k | license stringclasses 14
values | hash stringlengths 32 32 | line_mean float64 7.18 99.4 | line_max int64 31 999 | alpha_frac float64 0.25 0.95 | ratio float64 1.5 7.84 | autogenerated bool 1
class | config_or_test bool 2
classes | has_no_keywords bool 2
classes | has_few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
celery/kombu | kombu/mixins.py | 1 | 9667 | """Mixins."""
from __future__ import annotations
import socket
from contextlib import contextmanager
from functools import partial
from itertools import count
from time import sleep
from .common import ignore_errors
from .log import get_logger
from .messaging import Consumer, Producer
from .utils.compat import neste... | bsd-3-clause | 00bbe70854f986aeee064ec31f9d8a89 | 31.116279 | 79 | 0.584049 | 4.74105 | false | false | false | false |
celery/kombu | t/unit/asynchronous/aws/sqs/test_queue.py | 1 | 7140 | from __future__ import annotations
from unittest.mock import Mock
import pytest
from kombu.asynchronous.aws.sqs.message import AsyncMessage
from kombu.asynchronous.aws.sqs.queue import AsyncQueue
from t.mocks import PromiseMock
from ..case import AWSCase
class test_AsyncQueue(AWSCase):
def setup(self):
... | bsd-3-clause | e3cbc7f957ba7b9fb345df5e13589d82 | 33.829268 | 77 | 0.627591 | 3.688017 | false | true | false | false |
celery/kombu | kombu/utils/eventio.py | 1 | 10159 | """Selector Utilities."""
from __future__ import annotations
import errno
import math
import select as __select__
import sys
from numbers import Integral
from . import fileno
from .compat import detect_environment
__all__ = ('poll',)
_selectf = __select__.select
_selecterr = __select__.error
xpoll = getattr(__sele... | bsd-3-clause | 1475207466ba95520429429d238cbb4c | 29.878419 | 79 | 0.525642 | 3.680797 | false | false | false | false |
celery/kombu | kombu/matcher.py | 1 | 4269 | """Pattern matching registry."""
from __future__ import annotations
from fnmatch import fnmatch
from re import match as rematch
from typing import Callable, cast
from .utils.compat import entrypoints
from .utils.encoding import bytes_to_str
MatcherFunction = Callable[[str, str], bool]
class MatcherNotInstalled(Ex... | bsd-3-clause | 994338b119838dab5a10579e2cb0e779 | 28.645833 | 77 | 0.6409 | 4.222552 | false | false | false | false |
dials/dials | tests/algorithms/refinement/test_reflection_manager.py | 1 | 1688 | from __future__ import annotations
import math
import pytest
from dxtbx.model.experiment_list import ExperimentListFactory
from dials.algorithms.refinement.reflection_manager import ReflectionManager
from dials.array_family import flex
def test_scan_margin(dials_data):
# Use 4 scan data for this test
dat... | bsd-3-clause | 7de3f777236a571fef3cc7a6eacb72c0 | 34.166667 | 81 | 0.711493 | 3.444898 | false | true | false | false |
dials/dials | src/dials/algorithms/spot_finding/spot_matcher.py | 1 | 4097 | from __future__ import annotations
from scitbx.array_family import flex
class SpotMatcher:
"""Match the observed with predicted spots."""
def __init__(self, max_separation=2):
"""
Setup the algorithm
:param max_separation: Max pixel dist between predicted and observed spot
"... | bsd-3-clause | 77da54849ed5b7aea6ec11696c2db7d3 | 31.007813 | 81 | 0.594337 | 4.138384 | false | false | false | false |
douban/dpark | dpark/utils/nested_groupby.py | 1 | 4969 | import weakref
import sys
from collections import deque
from dpark.utils.log import get_logger
logger = get_logger(__name__)
if sys.version_info[0] < 3:
def next_func(it):
return it.next
else:
def next_func(it):
return it.__next__
def list_value(x):
return x[0], list(x[1])
def list_nes... | bsd-3-clause | 2f4a43d64a361066b1abb97c81adad15 | 24.22335 | 92 | 0.472731 | 3.784463 | false | false | false | false |
douban/dpark | dpark/conf.py | 1 | 4054 | from __future__ import absolute_import
import os
from dpark.utils.log import get_logger
# override configs use python file at path given by env var $DPARK_CONF, see the end of this file
logger = get_logger(__name__)
# workdir used in slaves for internal files
#
DPARK_WORK_DIR = '/tmp/dpark'
if os.path.exists('/dev/s... | bsd-3-clause | 78d6a1f428ecc0a92f3f979d317c6bdc | 26.026667 | 111 | 0.617662 | 3.258842 | false | false | false | false |
dials/dials | src/dials/command_line/find_spots_server.py | 1 | 13148 | from __future__ import annotations
import http.server as server_base
import json
import logging
import multiprocessing
import sys
import time
import urllib.parse
import libtbx.phil
from cctbx import uctbx
from dxtbx.model.experiment_list import ExperimentListFactory
from libtbx.introspection import number_of_processo... | bsd-3-clause | 7b160682d9a70730caa694165689cd8b | 33.691293 | 88 | 0.620322 | 3.817654 | false | false | false | false |
dials/dials | src/dials/algorithms/refinement/weighting_strategies.py | 1 | 3665 | """Contains classes used to provide weighting schemes as strategies for
ReflectionManagers."""
from __future__ import annotations
from dials.algorithms.refinement import DialsRefineConfigError
from dials.array_family import flex
class StatisticalWeightingStrategy:
"""Defines a single method that provides a Refl... | bsd-3-clause | ec7cc8500b82896d2d010b811ab7c3b4 | 36.397959 | 114 | 0.670668 | 4.081292 | false | false | false | false |
dials/dials | src/dials/algorithms/symmetry/cosym/engine.py | 1 | 4472 | """LBFGS refinement engine for cosym analysis."""
from __future__ import annotations
import logging
import scipy.optimize
import scitbx.lbfgs
from scitbx.array_family import flex
logger = logging.getLogger(__name__)
class lbfgs_with_curvs:
"""Minimise a target function using the LBFGS minimiser.
Impleme... | bsd-3-clause | 39007c3a871061f086f5c17b0d964eea | 31.642336 | 85 | 0.647585 | 3.79949 | false | false | false | false |
douban/dpark | examples/cos_c.py | 1 | 1184 | from __future__ import absolute_import
from __future__ import print_function
import logging
from context import SparkContext
import gc
gc.disable()
spark = SparkContext()
name = 'rating.txt'
name = 'rating.txt.medium'
name = 'rating.txt.large'
def parse(line):
try:
sid, uid, r, f = line.split('\t')
... | bsd-3-clause | 2037ba0c0311e073de89cd51108a7ef7 | 22.215686 | 118 | 0.583615 | 2.832536 | false | false | false | false |
llazzaro/django-scheduler | schedule/migrations/0003_auto_20160715_0028.py | 2 | 1591 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("schedule", "0002_event_color_event")]
operations = [
migrations.AlterField(
model_name="event",
name="end",
field=models.DateTimeField(
help_text="The... | bsd-3-clause | a5ab3572f92fab619243407298965dba | 32.145833 | 87 | 0.529227 | 4.707101 | false | false | false | false |
divio/cmsplugin-filer | cmsplugin_filer_folder/cms_plugins.py | 3 | 2503 | from cms.plugin_pool import plugin_pool
from cms.plugin_base import CMSPluginBase
from django.template.loader import select_template
from django.utils.translation import ugettext_lazy as _
from . import models
from .conf import settings
from filer.models.filemodels import File
from filer.models.foldermodels import Fol... | bsd-3-clause | cd7a00012afb5533451e6912b0b556b7 | 32.373333 | 89 | 0.642429 | 4.056726 | false | false | false | false |
divio/cmsplugin-filer | cmsplugin_filer_image/models.py | 3 | 5557 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from filer.fields.file import FilerFileField
from filer.fields.image import FilerImageField
from filer.models import ThumbnailOption # NOQA
from filer.utils.compatibili... | bsd-3-clause | 3273cecf537ec7f226c823c63317de0d | 40.162963 | 118 | 0.627497 | 4.222644 | false | false | false | false |
divio/cmsplugin-filer | cmsplugin_filer_link/cms_plugins.py | 3 | 1842 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.templatetags.static import static
from django.utils.translation import ugettext as _
from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from .forms import FilerLinkForm
from .models import FilerLinkPlugin as Fi... | bsd-3-clause | 3b6bb9e5086fa46e195937cafe05be8d | 26.492537 | 85 | 0.549403 | 4.148649 | false | false | false | false |
chromium/gyp | tools/pretty_gyp.py | 9 | 4771 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Pretty-prints the contents of a GYP file."""
from __future__ import print_function
import sys
import re
# Regex to remove comments wh... | bsd-3-clause | 314fe47b4c43199d9748315762060da6 | 29.583333 | 80 | 0.627751 | 3.359859 | false | false | false | false |
chromium/gyp | pylib/gyp/__init__.py | 9 | 22291 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
import copy
import gyp.input
import optparse
import os.path
import re
import shlex
import sys
import ... | bsd-3-clause | 068f299dccfba25cd641d765162df52b | 39.163964 | 80 | 0.652281 | 4.058813 | false | false | false | false |
chromium/gyp | pylib/gyp/flock_tool.py | 23 | 1749 | #!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""These functions are executed via gyp-flock-tool when using the Makefile
generator. Used on systems that don't have a built-in flock."""
... | bsd-3-clause | d28ee842fbeaf9f00f203ed136b55792 | 31.388889 | 75 | 0.671241 | 3.287594 | false | false | false | false |
chromium/gyp | pylib/gyp/generator/ninja.py | 3 | 104214 | # Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
import collections
import copy
import hashlib
import json
import multiprocessing
import os.path
import re
import signal
impo... | bsd-3-clause | 69aed084ece73982bc21fbf483b6b426 | 40.668932 | 80 | 0.625482 | 3.842983 | false | true | false | false |
rapidsms/rapidsms-core-dev | lib/rapidsms/djangoproject/urls.py | 2 | 2330 | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import os
from django.conf.urls.defaults import *
from rapidsms.utils.modules import try_import
from ..conf import settings
# this list will be populated with the urls from the urls.urlpatterns of
# each installed app, then found by django as if we'd listed them he... | bsd-3-clause | 9633b036541cb0e9ce8586a8a70d769d | 34.30303 | 72 | 0.620172 | 4.183124 | false | false | false | false |
biorack/metatlas | metatlas/datastructures/id_types.py | 1 | 1162 | """ types for use with MetatlasDataset """
from typing import List, NewType, Optional, TypedDict
from traitlets import HasTraits, TraitType
import metatlas.datastructures.metatlas_objects as metob
GroupList = Optional[List[metob.Group]]
LcmsRunsList = Optional[List[metob.LcmsRun]]
FileMatchList = List[str]
GroupMat... | bsd-3-clause | 9dc96d05da89acef8a8a5a26c37c01e3 | 26.666667 | 94 | 0.73494 | 3.427729 | false | false | false | false |
biorack/metatlas | metatlas/scripts/yaml_validation.py | 1 | 1367 | #!/usr/bin/env python
"""YAML validation with extra check for issues with key"""
import itertools
import sys
from typing import Any, List
import numpy as np
import yaml
def flatten(list_of_lists: List[Any]) -> List[Any]:
"""flatten nested lists of arbitrary depth"""
return list(itertools.chain.from_iterabl... | bsd-3-clause | a309545e8fff9af1c82c494018c35dba | 26.897959 | 108 | 0.609364 | 3.569191 | false | false | false | false |
biorack/metatlas | metatlas/io/system_utils.py | 1 | 1138 | """system utility functions"""
import getpass
import re
import subprocess
from typing import Optional, Sequence, Union
EMAIL_RE = re.compile(r"[^@\s]+@[^@\s]+\.[a-zA-Z0-9]+$")
def is_bad_email_address(address: str) -> bool:
"""
Returns True only if address is obviously bad.
Makes sure a command line sw... | bsd-3-clause | 09b6aa136c1e1b1e9d146693db84e7ec | 34.5625 | 98 | 0.672232 | 3.780731 | false | false | false | false |
biorack/metatlas | tests/system/test_targeted.py | 1 | 7993 | # pylint: disable=missing-function-docstring, missing-module-docstring, line-too-long, duplicate-code
from . import utils
def test_targeted_by_line01_with_remove(tmp_path):
image = "registry.spin.nersc.gov/metatlas_test/metatlas_ci:1.1.0"
expected = {}
expected[
str(
tmp_path
... | bsd-3-clause | 3b6d67c5f966bfceae712ab0731c512d | 96.47561 | 544 | 0.648693 | 2.232682 | false | true | false | false |
biorack/metatlas | metatlas/plots/chromatograms_mp_plots.py | 2 | 5507 | from __future__ import absolute_import
import matplotlib
#matplotlib.use('Agg')
import sys
#import yaml
import os
#import multiprocessing as mp
from matplotlib import pyplot as plt
import numpy as np
import warnings
from textwrap import wrap
#warnings.filterwarnings("ignore")
from metatlas.io import metatlas_get_data... | bsd-3-clause | 089a0cfcff3a04a95e250764e270d98a | 34.076433 | 101 | 0.565825 | 3.380602 | false | false | false | false |
biorack/metatlas | tests/system/utils.py | 1 | 2880 | # pylint: disable=missing-function-docstring, missing-module-docstring, duplicate-code
import os
import subprocess
import unicodedata
from typing import Any, Dict
import pandas as pd
PAPERMILL_ENV = {"PAPERMILL_EXECUTION": "True"}
def num_files_in(path: os.PathLike) -> int:
"""Returns number of files in path.... | bsd-3-clause | 1f279b9bbb43bffcbf509d854a29406c | 32.882353 | 107 | 0.582639 | 3.876178 | false | false | false | false |
biorack/metatlas | metatlas/io/targeted_output.py | 1 | 20820 | """Generate standarized outputs for targeted analysis"""
# pylint: disable=too-many-arguments
import logging
import math
import os
from collections import namedtuple
from typing import List
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
import numpy as np
import pandas as pd
from matplotlib imp... | bsd-3-clause | eb990e30895452a784d87199dc0ff46e | 40.556886 | 110 | 0.645965 | 3.526423 | false | false | false | false |
biorack/metatlas | metatlas/io/feature_tools.py | 1 | 16532 | from __future__ import absolute_import
from __future__ import print_function
import os
import numpy as np
import pandas as pd
from scipy import interpolate
import time
#pandas columns that are "objects", but you are 100% sure contain strings
# will through this warning. There is no way to set them as strings.
# panda... | bsd-3-clause | 697235422c1244526a42537c452ea7cc | 39.819753 | 194 | 0.639729 | 3.391875 | false | false | false | false |
geopandas/geopandas | geopandas/io/tests/generate_legacy_storage_files.py | 2 | 2734 | """
Script to create the data and write legacy storage (pickle) files.
Based on pandas' generate_legacy_storage_files.py script.
To use this script, create an environment for which you want to
generate pickles, activate the environment, and run this script as:
$ python geopandas/geopandas/io/tests/generate_legacy_st... | bsd-3-clause | eaced56eb6fdc4f3c6bfac91a7da2880 | 26.897959 | 84 | 0.635333 | 3.518662 | false | true | false | false |
geopandas/geopandas | doc/nyc_boros.py | 1 | 2363 | """
Visualizing NYC Boroughs
------------------------
Visualize the Boroughs of New York City with Geopandas.
This example generates many images that are used in the documentation. See
the `Geometric Manipulations <geometric_manipulations>` example for more
details.
First we'll import a dataset containing each borou... | bsd-3-clause | caf5713f1a63a8a206c535bd9273e62c | 32.28169 | 78 | 0.631824 | 3.41474 | false | false | false | false |
geopandas/geopandas | geopandas/tools/tests/test_clip.py | 1 | 17865 | """Tests for the clip module."""
import warnings
from packaging.version import Version
import numpy as np
import pandas as pd
import shapely
from shapely.geometry import (
Polygon,
Point,
LineString,
LinearRing,
GeometryCollection,
MultiPoint,
box,
)
import geopandas
from geopandas impor... | bsd-3-clause | 3f9d98fe86b2ea597ecb182d25b9ea1f | 36.45283 | 88 | 0.64534 | 3.468932 | false | true | false | false |
ipython/ipython | IPython/core/splitinput.py | 3 | 4787 | # encoding: utf-8
"""
Simple utility for splitting user input. This is used by both inputsplitter and
prefilter.
Authors:
* Brian Granger
* Fernando Perez
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under... | bsd-3-clause | 282084b37c101c0861ea6ce1d4a4a36e | 33.941606 | 87 | 0.563819 | 4.240035 | false | false | false | false |
ipython/ipython | IPython/utils/PyColorize.py | 3 | 10875 | # -*- coding: utf-8 -*-
"""
Class and program to colorize python source code for ANSI terminals.
Based on an HTML code highlighter by Jurgen Hermann found at:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52298
Modifications by Fernando Perez (fperez@colorado.edu).
Information on the original HTML highligh... | bsd-3-clause | bb930a3efc66e6ebee24d6a505c9edc1 | 31.854985 | 124 | 0.58869 | 3.844115 | false | false | false | false |
mozilla/mozillians | mozillians/users/tests/test_models.py | 2 | 36148 | # -*- coding: utf-8 -*-
import unittest
from datetime import datetime
from uuid import uuid4
from django.conf import settings
from django.contrib.auth.models import User
from django.db.models.query import QuerySet
from django.test import override_settings
from django.utils.timezone import make_aware, now
import pytz
... | bsd-3-clause | f017d1e695f00bcdd119aa3bf35bebf8 | 39.842938 | 99 | 0.631965 | 3.750363 | false | true | false | false |
mozilla/mozillians | mozillians/phonebook/urls.py | 2 | 3409 | from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from django.views.generic import TemplateView
from mozillians.common.decorators import allow_public, allow_unvouched
from mozillians.phonebook import views as phonebook_views
app_name = 'mozillians'
urlpatterns = [
url(r'... | bsd-3-clause | 3941b9340bc045d59fc92cb32f1f4404 | 53.111111 | 98 | 0.660604 | 3.274736 | false | false | false | false |
mozilla/mozillians | scripts/update/update.py | 3 | 8516 | """
Deployment for Mozillians in production.
Requires commander (https://github.com/oremj/commander) which is installed on
the systems that need it.
"""
import os
import random
import re
import sys
import urllib
import urllib2
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from commander.deploy import ... | bsd-3-clause | 775d10782c327f83f9896d3cb80eb683 | 30.776119 | 163 | 0.635862 | 3.351436 | false | false | false | false |
mozilla/mozillians | mozillians/common/search.py | 1 | 1384 | import boto3
import os
from botocore.auth import SigV4Auth
from requests_aws4auth import AWS4Auth
from elasticsearch import RequestsHttpConnection
class AWS4AuthEncoded(AWS4Auth):
def __call__(self, request):
request = super(AWS4AuthEncoded, self).__call__(request)
for header_name in request.hea... | bsd-3-clause | f2d0adde0f93569c9c6a912f98e74191 | 31.952381 | 86 | 0.666908 | 3.988473 | false | false | false | false |
mozilla/mozillians | mozillians/common/authbackend.py | 2 | 7781 | import base64
import hashlib
import json
import re
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib import messages
from cities_light.models import Country
from mozilla_django_oidc.auth import OIDCAuthenticationBackend
from waffle import switch_is_active
from mozillian... | bsd-3-clause | 24a5c65092c14d9e04d11e79c37466fa | 39.108247 | 96 | 0.627297 | 3.878863 | false | false | false | false |
mozilla/mozillians | mozillians/common/urlresolvers.py | 4 | 4148 | from threading import local
from django.conf import settings
from django.core.urlresolvers import reverse as django_reverse
from django.utils.encoding import iri_to_uri
from django.utils.functional import lazy
from django.utils.translation.trans_real import parse_accept_lang_header
# Thread-local storage for URL pre... | bsd-3-clause | b1c1db3ed45df83461c8d0b5713da533 | 31.661417 | 81 | 0.610656 | 4.031098 | false | false | false | false |
mozilla/mozillians | mozillians/groups/tasks.py | 3 | 12390 | from datetime import datetime, timedelta
from django.conf import settings
from django.contrib.auth.models import User
from django.core.mail import send_mail
from django.db.models import Count, Max
from django.template.loader import get_template, render_to_string
from django.utils.timezone import now
from django.utils.... | bsd-3-clause | 9337d299a630ee3212a8abffc3b0f301 | 39.490196 | 98 | 0.652623 | 3.867041 | false | false | false | false |
mozilla/mozillians | mozillians/groups/middleware.py | 2 | 1149 | import re
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from mozillians.common.middleware import safe_query_string
from mozillians.groups.models import Group
class OldGroupRedirectionMiddleware(object):
"""
Redirect requests for groups from /group/<id>-<url> to
... | bsd-3-clause | b59bfd4253a024d5a536cfe16833512c | 32.794118 | 93 | 0.603133 | 4.178182 | false | false | false | false |
lisa-lab/pylearn2 | pylearn2/utils/exc.py | 37 | 3029 | """Exceptions used by basic support utilities."""
__author__ = "Ian Goodfellow"
import sys
from pylearn2.utils.common_strings import environment_variable_essay
from theano.compat import six
class EnvironmentVariableError(Exception):
"""
An exception raised when a required environment variable is not defined
... | bsd-3-clause | cabed38099a599dc348867008b525e96 | 32.655556 | 79 | 0.615385 | 3.980289 | false | false | false | false |
lisa-lab/pylearn2 | pylearn2/scripts/datasets/make_cifar100_patches_8x8.py | 41 | 2282 | """
This script makes a dataset of two million approximately whitened patches,
extracted at random uniformly from the CIFAR-100 train dataset.
This script is intended to reproduce the preprocessing used by Adam Coates
et. al. in their work from the first half of 2011 on the CIFAR-10 and
STL-10 datasets.
"""
from __fut... | bsd-3-clause | 9d03fdf3390e4ca08cf7eb03b8297570 | 35.222222 | 78 | 0.786591 | 3.674718 | false | false | false | false |
lisa-lab/pylearn2 | pylearn2/format/tests/test_target_format.py | 33 | 5476 | import numpy
import theano
from numpy.testing import assert_equal, assert_, assert_raises
from theano.scalar.basic import all_types
from pylearn2.format.target_format import OneHotFormatter, compressed_one_hot
def test_one_hot_formatter_simple():
def check_one_hot_formatter(seed, max_labels, dtype, ncases):
... | bsd-3-clause | 1d3d2292a118a5808fe895b9954cdcbf | 36 | 79 | 0.638605 | 3.636122 | false | false | false | false |
lisa-lab/pylearn2 | pylearn2/scripts/datasets/make_mnistplus.py | 44 | 8910 | """
Script to generate the MNIST+ dataset. The purpose of this dataset is to make a
more challenging MNIST-like dataset, with multiple factors of variation. These
factors can serve to evaluate a model's performance at learning invariant
features, or its ability to disentangle factors of variation in a multi-task
classi... | bsd-3-clause | a8dd87b5cd80eddbb76a4edaadb33ac7 | 34.64 | 79 | 0.619753 | 3.491379 | false | false | false | false |
lisa-lab/pylearn2 | pylearn2/datasets/norb.py | 44 | 14401 | """
An interface to the small NORB dataset. Unlike `./norb_small.py`, this reads
the original NORB file format, not the LISA lab's `.npy` version.
Currently only supports the Small NORB Dataset.
Download the dataset from
`here <http://www.cs.nyu.edu/~ylclab/data/norb-v1.0-small/>`_.
NORB dataset(s) by Fu Jie Huang a... | bsd-3-clause | a95516eac2a62a8e968260d151d8220b | 37.300532 | 79 | 0.539338 | 4.315553 | false | false | false | false |
lisa-lab/pylearn2 | pylearn2/sandbox/cuda_convnet/probabilistic_max_pooling.py | 2 | 22477 | """
A GPU implementation of probabilistic max-pooling, based on
"Convolutional Deep Belief Networks for Scalable
Unsupervised Learning of Hierarchical Representations"
Honglak Lee, Roger Grosse, Rajesh Ranganath, and Andrew Y. Ng
ICML 2009
This paper defines probabilistic max-pooling in the context
of a Convolutiona... | bsd-3-clause | 6a004703d0e664bec780ef7614dcc46d | 29.333333 | 109 | 0.533523 | 3.675114 | false | false | false | false |
lisa-lab/pylearn2 | pylearn2/expr/tests/test_normalize.py | 44 | 3322 | from __future__ import print_function
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2013, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
import numpy as np
import warnings
from theano.compat.six.move... | bsd-3-clause | e7c380640c4ca6c73358d12a37b7f0b5 | 25.576 | 110 | 0.582781 | 3.322 | false | false | false | false |
lisa-lab/pylearn2 | pylearn2/testing/skip.py | 49 | 1363 | """
Helper functions for determining which tests to skip.
"""
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
from nose.plugins.skip import SkipT... | bsd-3-clause | 859839c223ae977ff4d736504079db82 | 19.044118 | 65 | 0.679384 | 3.485934 | false | true | false | false |
lisa-lab/pylearn2 | pylearn2/sandbox/lisa_rl/bandit/gaussian_bandit.py | 49 | 1542 | __author__ = "Ian Goodfellow"
import numpy as np
from theano import config
from theano import function
from theano import tensor as T
from pylearn2.sandbox.lisa_rl.bandit.environment import Environment
from pylearn2.utils import sharedX
from pylearn2.utils.rng import make_np_rng, make_theano_rng
class GaussianBand... | bsd-3-clause | 7d2fd42d71221ef0877b795856d4d334 | 33.266667 | 97 | 0.664721 | 3.680191 | false | false | false | false |
lisa-lab/pylearn2 | pylearn2/sandbox/rnn/models/rnn.py | 34 | 29276 | """
Recurrent Neural Network Layer
"""
__authors__ = "Junyoung Chung"
__copyright__ = "Copyright 2014, Universite de Montreal"
__credits__ = "Junyoung Chung"
__license__ = "3-clause BSD"
__maintainer__ = "Junyoung Chung"
__email__ = "chungjun@iro"
import numpy as np
import scipy.linalg
from functools import wraps
fro... | bsd-3-clause | 2dd6a108083d6a93576489733932c3dc | 35.686717 | 79 | 0.524115 | 4.137951 | false | false | false | false |
lisa-lab/pylearn2 | pylearn2/scripts/print_monitor_cv.py | 30 | 3378 | #!/usr/bin/env python
"""
Print (average) channel values for a collection of models, such as that
serialized by TrainCV. Based on print_monitor.py.
usage: print_monitor_cv.py model.pkl [-a]
"""
from __future__ import print_function
__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
__... | bsd-3-clause | afe13946198906066a1daf733b6f5838 | 38.27907 | 79 | 0.499408 | 4.217228 | false | false | false | false |
lisa-lab/pylearn2 | pylearn2/datasets/vector_spaces_dataset.py | 41 | 6009 | """TODO: module-level docstring."""
__authors__ = "Pascal Lamblin and Razvan Pascanu"
__copyright__ = "Copyright 2010-2013, Universite de Montreal"
__credits__ = ["Pascal Lamblin", "Razvan Pascanu", "Ian Goodfellow",
"Mehdi Mirza"]
__license__ = "3-clause BSD"
__maintainer__ = "Pascal Lamblin"
__email__ ... | bsd-3-clause | 12ff3413d47b817012eecc0993db5d33 | 33.534483 | 79 | 0.594442 | 4.032886 | false | false | false | false |
lisa-lab/pylearn2 | pylearn2/packaged_dependencies/theano_linear/pyramid.py | 49 | 4318 | """
.. todo::
WRITEME
"""
import logging
import sys
import numpy
import theano
import warnings
from theano.gof import Variable, Op, utils, Type, Constant, Value, Apply
from theano.tensor import as_tensor_variable
logger = logging.getLogger(__name__)
try:
import cv
except ImportError:
warnings.warn("cv ... | bsd-3-clause | a24a586b3f8be3d45dc183053011cb6a | 23.959538 | 100 | 0.469662 | 3.568595 | false | false | false | false |
lisa-lab/pylearn2 | pylearn2/models/tests/test_reflection_clip.py | 44 | 1514 | import numpy as np
from pylearn2.models.s3c import reflection_clip
from theano.compat.six.moves import xrange
from theano import function
from theano import shared
from pylearn2.utils.rng import make_np_rng
def test_reflection_clip():
N = 5
m = 10
rng = make_np_rng([1,2,3], which_method='randn')
Mu1_... | bsd-3-clause | d69f966cdb859b8d8d14a509ea6340ee | 26.035714 | 62 | 0.516513 | 3.832911 | false | false | false | false |
lisa-lab/pylearn2 | setup.py | 42 | 3978 | from __future__ import print_function
import warnings
from setuptools import setup, find_packages, Extension
from setuptools.command.install import install
import numpy
from theano.compat.six.moves import input
# Because many people neglected to run the pylearn2/utils/setup.py script
# separately, we compile the nec... | bsd-3-clause | c42d9cf74835a430372448145c41cf23 | 44.724138 | 79 | 0.620161 | 4.12228 | false | false | false | false |
mrjoes/flask-admin | doc/conf.py | 10 | 8737 | # -*- coding: utf-8 -*-
#
# flask-admin documentation build configuration file, created by
# sphinx-quickstart on Tue Nov 01 18:35:30 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
#... | bsd-3-clause | d35e9f2ccaf4a432a95a6dc33ed31a62 | 31.479554 | 107 | 0.701156 | 3.761085 | false | true | false | false |
mrjoes/flask-admin | examples/layout/app.py | 7 | 6085 | import os
import os.path as op
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext import admin
from flask.ext.admin.contrib.sqla import ModelView
# Create application
app = Flask(__name__)
# Create dummy secrey key so we can use sessions
app.config['SECRET_KEY'] = '123456790'
# Crea... | bsd-3-clause | dc61195fe1eeb8a88db9d39e7c945a19 | 39.838926 | 120 | 0.624486 | 3.202632 | false | false | false | false |
mrjoes/flask-admin | setup.py | 4 | 1819 | # Fix for older setuptools
import re
import os
from setuptools import setup, find_packages
def fpath(name):
return os.path.join(os.path.dirname(__file__), name)
def read(fname):
return open(fpath(fname)).read()
def desc():
info = read('README.rst')
try:
return info + '\n\n' + read('doc/ch... | bsd-3-clause | 9898a8092865d9967158cdcbb7b388ef | 23.581081 | 82 | 0.588785 | 3.805439 | false | false | false | false |
mrjoes/flask-admin | flask_admin/form/rules.py | 7 | 9864 | from jinja2 import Markup
from flask.ext.admin._compat import string_types
from flask.ext.admin import helpers
class BaseRule(object):
"""
Base form rule. All form formatting rules should derive from `BaseRule`.
"""
def __init__(self):
self.parent = None
self.rule_set = None
... | bsd-3-clause | f7afbfaee5d00dcf1ae9ec5193d8975e | 24.754569 | 90 | 0.503852 | 4.681538 | false | false | false | false |
johnbywater/eventsourcing | eventsourcing/tests/test_runner.py | 1 | 8679 | import os
from time import sleep
from typing import Type
from unittest.case import TestCase
from eventsourcing.postgres import PostgresDatastore
from eventsourcing.system import (
MultiThreadedRunner,
Runner,
RunnerAlreadyStarted,
SingleThreadedRunner,
System,
)
from eventsourcing.tests.ramdisk imp... | bsd-3-clause | b6fa5c646db59986350ad0142678792a | 31.384328 | 88 | 0.619887 | 4.099669 | false | true | false | false |
jupyterhub/oauthenticator | oauthenticator/generic.py | 1 | 5274 | """
Custom Authenticator to use generic OAuth2 with JupyterHub
"""
import os
from functools import reduce
from jupyterhub.auth import LocalAuthenticator
from tornado.httpclient import AsyncHTTPClient
from traitlets import Bool, List, Unicode, Union, default
from .oauth2 import OAuthenticator
from .traitlets import Ca... | bsd-3-clause | 352b4de623ef78ce6f7602e5a85ff97a | 33.025806 | 112 | 0.576981 | 4.312347 | false | false | false | false |
flask-admin/flask-admin | flask_admin/contrib/sqla/validators.py | 1 | 3153 | from sqlalchemy.orm.exc import NoResultFound
from wtforms import ValidationError
try:
from wtforms.validators import InputRequired
except ImportError:
from wtforms.validators import Required as InputRequired
from flask_admin._compat import filter_list
class Unique(object):
"""Checks field value unicity ... | bsd-3-clause | ece3756d62a87ccadeb14d5c1c3ef0c4 | 29.911765 | 109 | 0.601332 | 4.220884 | false | false | false | false |
flask-admin/flask-admin | flask_admin/contrib/peewee/filters.py | 9 | 9955 | from flask_admin.babel import lazy_gettext
from flask_admin.model import filters
from .tools import parse_like_term
class BasePeeweeFilter(filters.BaseFilter):
"""
Base Peewee filter.
"""
def __init__(self, column, name, options=None, data_type=None):
"""
Constructor.
... | bsd-3-clause | c1db3de5827d164919eb0d62f8ceddef | 28.279412 | 91 | 0.655851 | 4.161789 | false | false | false | false |
flask-admin/flask-admin | flask_admin/model/typefmt.py | 1 | 2170 | import json
from markupsafe import Markup
from flask_admin._compat import text_type
try:
from enum import Enum
except ImportError:
Enum = None
def null_formatter(view, value, name):
"""
Return `NULL` as the string for `None` value
:param value:
Value to check
"""
retu... | bsd-3-clause | 80cb242715f7e298efae39f61a563cc9 | 21.371134 | 118 | 0.616129 | 3.807018 | false | false | false | false |
flask-admin/flask-admin | flask_admin/contrib/mongoengine/typefmt.py | 1 | 1361 | from markupsafe import Markup, escape
from mongoengine.base import BaseList
from mongoengine.fields import GridFSProxy, ImageGridFsProxy
from flask_admin.model.typefmt import BASE_FORMATTERS, list_formatter
from . import helpers
def grid_formatter(view, value):
if not value.grid_id:
return ''
args... | bsd-3-clause | be217200b55f2caf08aa34f7907d006c | 27.354167 | 86 | 0.589273 | 3.525907 | false | false | false | false |
flask-admin/flask-admin | flask_admin/contrib/mongoengine/fields.py | 17 | 2575 | from mongoengine.base import get_document
from werkzeug.datastructures import FileStorage
from wtforms import fields
try:
from wtforms.fields.core import _unset_value as unset_value
except ImportError:
from wtforms.utils import unset_value
from . import widgets
from flask_admin.model.fields import InlineFor... | bsd-3-clause | 4fd5d1da791deccae990388dbb866bbd | 26.98913 | 85 | 0.608155 | 4.12 | false | false | false | false |
flask-admin/flask-admin | setup.py | 1 | 2267 | # Fix for older setuptools
import re
import os
import sys
from setuptools import setup, find_packages
def fpath(name):
return os.path.join(os.path.dirname(__file__), name)
def read(fname):
return open(fpath(fname)).read()
def desc():
info = read('README.rst')
try:
return info + '\n\n' + r... | bsd-3-clause | 65177c6e4af44b43f53f1ee8cd7f2409 | 23.912088 | 82 | 0.591972 | 3.759536 | false | false | false | false |
flask-admin/flask-admin | flask_admin/contrib/rediscli.py | 1 | 5165 | import logging
import shlex
from flask import request
from markupsafe import Markup
from flask_admin.base import BaseView, expose
from flask_admin.babel import gettext
# Set up logger
log = logging.getLogger("flask-admin.redis")
class CommandError(Exception):
"""
RedisCli error exception.
"""
... | bsd-3-clause | 00174594766ed0e26e1f99e469ae414b | 25.623711 | 81 | 0.522362 | 4.566755 | false | false | false | false |
flask-admin/flask-admin | flask_admin/model/template.py | 1 | 3518 | from flask_admin._compat import pass_context, string_types, reduce
from flask_admin.babel import gettext
class BaseListRowAction(object):
def __init__(self, title=None):
self.title = title
def render(self, context, row_id, row):
raise NotImplementedError()
@pass_context
def render_ct... | bsd-3-clause | c7aad2291baa9d85a7b8d47987defb83 | 26.920635 | 85 | 0.608584 | 3.786868 | false | false | false | false |
dcramer/sentry-old | sentry/interfaces.py | 1 | 3589 | """
sentry.interfaces
~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import urlparse
from flask import render_template
# unserialization concept is based on pickle
class _EmptyClass(object):
pass
def unserialize(klass, d... | bsd-3-clause | cca07ac66bebf29e8ba74e1cab5122dd | 24.635714 | 85 | 0.558651 | 4.153935 | false | false | false | false |
dcramer/sentry-old | sentry/utils/__init__.py | 1 | 8378 | """
sentry.utils
~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import datetime
import hashlib
import logging
import sys
import uuid
import warnings
from pprint import pformat
from types import ClassType, TypeType
import sentry
fro... | bsd-3-clause | 94f327c3929197b2842b195a0fd26439 | 32.114625 | 147 | 0.591669 | 4.10284 | false | false | false | false |
dcramer/sentry-old | sentry/web/templatetags.py | 1 | 6690 | """
sentry.web.templatetags
~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from sentry import app
#from sentry.plugins import GroupActionProvider
from flaskext.babel import ngettext, gettext
from jinja2 import Markup, es... | bsd-3-clause | 7a9333ed59c5835975f4d1346de58b89 | 29.972222 | 103 | 0.593722 | 3.515502 | false | false | false | false |
dcramer/sentry-old | sentry/client/async/__init__.py | 1 | 1530 | """
sentry.client.async
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from Queue import Queue
from sentry.client.base import SentryClient
from threading import Thread, Lock
class AsyncSentryClient(SentryClient):
"""This... | bsd-3-clause | f5072f204a28fe5dd58a72271bd39494 | 26.321429 | 73 | 0.552941 | 4.261838 | false | false | false | false |
dcramer/sentry-old | tests/test_orm.py | 1 | 4227 | from . import BaseTest
from sentry.db import models
class TestModel(models.Model):
str_ = models.String()
int_ = models.Integer()
float_ = models.Float()
list_ = models.List()
class Meta:
sortables = ('int_', 'float_')
indexes = (('str_',),)
class ORMTest(BaseTest):
def ... | bsd-3-clause | f871f494e44747b180d94117eb97cb50 | 29.861314 | 79 | 0.581027 | 3.832276 | false | true | false | false |
dcramer/sentry-old | sentry/db/backends/sqlalchemy/models.py | 1 | 1625 | import sentry.models
from sentry.db import models
from sqlalchemy import Table, Column, Integer, Float, String, Text, \
DateTime, MetaData
__all__ = ('metadata', 'model_map', 'model_meta')
column_map = {
models.String: lambda x: String(255, default=x.default, nullable=True),
models.Tex... | bsd-3-clause | 997300ff2dd6501a031e3ffccb2dc90c | 32.163265 | 80 | 0.659692 | 3.595133 | false | false | false | false |
dcramer/sentry-old | sentry/events.py | 1 | 7927 | """
sentry.events
~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
import sys
from sentry import app
from sentry.utils import transform
__all__ = ('BaseEvent', 'Exception', 'Message', 'Query')
class BaseEvent(object):
... | bsd-3-clause | 59baeea3491eba0b6581d62a11d51af7 | 32.033333 | 141 | 0.530213 | 4.117922 | false | false | false | false |
qiime2/qiime2 | qiime2/jupyter/handlers.py | 1 | 1973 | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2022, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | bsd-3-clause | e8ebe8d1ff3fe9a662d6d66b56c587de | 36.942308 | 78 | 0.627978 | 4.215812 | false | false | false | false |
qiime2/qiime2 | qiime2/jupyter/template.py | 2 | 2598 | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2022, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | bsd-3-clause | ce6ba3837e829ed38ed05c511dd89e91 | 43.033898 | 79 | 0.548114 | 3.877612 | false | false | false | false |
qiime2/qiime2 | qiime2/util.py | 2 | 3260 | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2022, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | bsd-3-clause | 84dd88a4d4c7fc9f763118f7b767ee4b | 32.958333 | 78 | 0.589571 | 3.956311 | false | false | false | false |
qiime2/qiime2 | qiime2/metadata/io.py | 1 | 20142 | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2022, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | bsd-3-clause | fed3da7495e9ad2e218fe3f7ea39e922 | 41.404211 | 79 | 0.558634 | 4.459154 | false | false | false | false |
colour-science/colour | colour/plotting/colorimetry.py | 1 | 34590 | """
Colorimetry Plotting
====================
Defines the colorimetry plotting objects:
- :func:`colour.plotting.plot_single_sd`
- :func:`colour.plotting.plot_multi_sds`
- :func:`colour.plotting.plot_single_cmfs`
- :func:`colour.plotting.plot_multi_cmfs`
- :func:`colour.plotting.plot_single_illuminant_sd`
-... | bsd-3-clause | 5502402d18f60277d08b3440dd3b497b | 27.969849 | 86 | 0.603267 | 3.634549 | false | false | false | false |
colour-science/colour | colour/quality/tm3018.py | 1 | 6823 | """
ANSI/IES TM-30-18 Colour Fidelity Index
=======================================
Defines the *ANSI/IES TM-30-18 Colour Fidelity Index* (CFI) computation
objects:
- :class:`colour.quality.ColourQuality_Specification_ANSIIESTM3018`
- :func:`colour.quality.colour_fidelity_index_ANSIIESTM3018`
References
----------
-... | bsd-3-clause | 77f6ef83b262b3c815bd3f4439299fe6 | 26.623482 | 79 | 0.6226 | 3.3348 | false | true | false | false |
colour-science/colour | colour/models/cam16_ucs.py | 1 | 13152 | """
CAM16-LCD, CAM16-SCD, and CAM16-UCS Colourspaces - Li et al. (2017)
===================================================================
Defines the *Li, Li, Wang, Zu, Luo, Cui, Melgosa, Brill and Pointer (2017)*
*CAM16-LCD*, *CAM16-SCD*, and *CAM16-UCS* colourspaces transformations:
- :func:`colour.JMh_CAM16_to... | bsd-3-clause | 0ec74730a7374bbec474172ccd428b11 | 30.539568 | 79 | 0.569343 | 2.788213 | false | false | false | false |
colour-science/colour | colour/models/cie_luv.py | 1 | 15852 | """
CIE L*u*v* Colourspace
======================
Defines the *CIE L\\*u\\*v\\** colourspace transformations:
- :func:`colour.XYZ_to_Luv`
- :func:`colour.Luv_to_XYZ`
- :func:`colour.Luv_to_uv`
- :func:`colour.uv_to_Luv`
- :func:`colour.Luv_uv_to_xy`
- :func:`colour.xy_to_Luv_uv`
- :func:`colour.Luv_to_L... | bsd-3-clause | 95d9a95fbfa65c532efb32795d1494e2 | 29.079696 | 79 | 0.384116 | 3.140876 | false | false | false | false |
colour-science/colour | colour/hints/__init__.py | 1 | 9126 | """
Annotation Type Hints
=====================
Defines the annotation type hints, the module exposes many aliases from
:mod:`typing` and :mod:`numpy.typing` to avoid having to handle multiple
imports.
"""
from __future__ import annotations
import numpy as np
import numpy.typing as npt
import re
from types import Mo... | bsd-3-clause | 50f0190aa18dc57f43540a3c1c3e8a36 | 22.642487 | 79 | 0.635108 | 3.312523 | false | false | false | false |
colour-science/colour | colour/characterisation/datasets/displays/crt/primaries.py | 1 | 5068 | """
Primaries of CRT Displays
=========================
Defines the primaries multi-spectral distributions of *CRT* displays.
Each *CRT* display data is in the form of a *dict* of
:class:`colour.characterisation.RGB_DisplayPrimaries` classes as follows::
{
'name': RGB_DisplayPrimaries,
...,
... | bsd-3-clause | 936f3c46b03f75f46a93c34fe5327796 | 33.013423 | 78 | 0.537687 | 2.300499 | false | false | false | false |
colour-science/colour | colour/models/rgb/transfer_functions/rimm_romm_rgb.py | 1 | 15934 | """
RIMM, ROMM and ERIMM Encodings
==============================
Defines the *RIMM, ROMM and ERIMM* encodings opto-electrical transfer functions
(OETF) and electro-optical transfer functions (EOTF):
- :func:`colour.models.cctf_encoding_ROMMRGB`
- :func:`colour.models.cctf_decoding_ROMMRGB`
- :func:`colour.mode... | bsd-3-clause | a225f7160ae09a31e0d58e366da3a63c | 28.023679 | 79 | 0.46724 | 3.417113 | false | false | false | false |
colour-science/colour | colour/algebra/extrapolation.py | 1 | 9531 | """
Extrapolation
=============
Defines the classes for extrapolating variables:
- :class:`colour.Extrapolator`: 1-D function extrapolation.
References
----------
- :cite:`Sastanina` : sastanin. (n.d.). How to make scipy.interpolate give an
extrapolated result beyond the input range? Retrieved August 8, 2014... | bsd-3-clause | e4feaac9c987bc51ce1870cf7e2dc3c0 | 26.231429 | 79 | 0.550519 | 3.838502 | false | false | false | false |
colour-science/colour | colour/models/rgb/transfer_functions/tests/test_nikon_n_log.py | 1 | 6035 | """
Define the unit tests for the :mod:`colour.models.rgb.transfer_functions.\
nikon_n_log` module.
"""
import numpy as np
import unittest
from colour.models.rgb.transfer_functions import (
log_encoding_NLog,
log_decoding_NLog,
)
from colour.utilities import domain_range_scale, ignore_numpy_errors
__author__... | bsd-3-clause | 1f8c898f449d8ca987e64d2360049c7b | 27.601896 | 78 | 0.57879 | 3.297814 | false | true | false | false |
colour-science/colour | colour/models/rgb/datasets/display_p3.py | 1 | 2290 | """
Display P3 Colourspace
======================
Defines the *Display P3* colourspace:
- :attr:`colour.models.RGB_COLOURSPACE_DISPLAY_P3`.
References
----------
- :cite:`AppleInc.2019` : Apple. (2019). Apple Inc. (2019). displayP3.
Retrieved December 18, 2019, from https://developer.apple.com/\
documentatio... | bsd-3-clause | a218258cab8ab267605eb786ca945179 | 27.271605 | 78 | 0.706114 | 2.858926 | false | false | true | false |
colour-science/colour | colour/notation/tests/test_munsell.py | 1 | 78813 | # !/usr/bin/env python
"""Define the unit tests for the :mod:`colour.notation.munsell` module."""
from __future__ import annotations
import numpy as np
import unittest
from itertools import product
from colour.hints import List, NDArray, Tuple
from colour.notation.munsell import (
CCS_ILLUMINANT_MUNSELL,
)
from ... | bsd-3-clause | d4911a2912b07bf9ebfa946a55a17592 | 30.588377 | 79 | 0.525307 | 2.806131 | false | true | false | false |
colour-science/colour | colour/notation/datasets/munsell/all.py | 1 | 317316 | """
Munsell Renotation System Dataset - All Munsell Colours
=======================================================
Defines the *Munsell Renotation System* *All* datasets. Those are *all*
published *Munsell* colours, including the extrapolated colors.
Notes
-----
- The Munsell Renotation data commonly available wit... | bsd-3-clause | 8096936e45ec29203a900467d03f3a84 | 61.648766 | 78 | 0.4859 | 1.934405 | false | false | false | false |
colour-science/colour | colour/io/luts/sony_spi3d.py | 1 | 6235 | """
Sony .spi3d LUT Format Input / Output Utilities
===============================================
Defines the *Sony* *.spi3d* *LUT* format related input / output utilities
objects:
- :func:`colour.io.read_LUT_SonySPI3D`
- :func:`colour.io.write_LUT_SonySPI3D`
"""
from __future__ import annotations
import nump... | bsd-3-clause | d56a75eba617e478f87e97a44b63feba | 25.875 | 79 | 0.51243 | 3.210608 | false | false | false | false |
colour-science/colour | colour/notation/datasets/munsell/real.py | 1 | 174499 | """
Munsell Renotation System Dataset - Real Munsell Colours
========================================================
Defines the *Munsell Renotation System* *Real* datasets. Those are *real*,
within MacAdam limits *Munsell* colours only. They are the colours listed in
the original 1943 renotation article *(Newhall, N... | bsd-3-clause | 3eda898a1d9c2dbe3326f5c47db14ae4 | 61.209982 | 78 | 0.486221 | 1.935845 | false | false | false | false |
colour-science/colour | colour/models/rgb/datasets/gopro.py | 1 | 3027 | """
GoPro Colourspaces
==================
Defines the *GoPro* colourspaces:
- :attr:`colour.models.RGB_COLOURSPACE_PROTUNE_NATIVE`.
Notes
-----
- The *Protune Native* colourspace primaries were derived using the method
outlined in :cite:`Mansencal2015d` followed with a chromatic adaptation
step to *CIE S... | bsd-3-clause | cc491cd4f4d4d7239a5355a477f702b1 | 29.575758 | 79 | 0.712917 | 2.828972 | false | false | true | false |
colour-science/colour | colour/notation/hexadecimal.py | 1 | 3566 | """
Hexadecimal Notation
====================
Defines the objects for hexadecimal notation:
- :func:`colour.notation.RGB_to_HEX`
- :func:`colour.notation.HEX_to_RGB`
"""
from __future__ import annotations
import numpy as np
from colour.algebra import normalise_maximum
from colour.hints import ArrayLike, List, ... | bsd-3-clause | d9c7e6c538f2e6fccc4f69cea41cbbb3 | 24.654676 | 79 | 0.501402 | 3.523715 | false | false | false | false |
colour-science/colour | colour/colorimetry/datasets/light_sources/chromaticity_coordinates.py | 1 | 17945 | """
Chromaticity Coordinates of the Light Sources
=============================================
Defines the chromaticity coordinates of the light sources.
The following light sources are available:
- *RIT* *PointerData.xls* spreadsheet light sources: Natural,
Philips TL-84, T8 Luxline Plus White, SA, SC, T8 Po... | bsd-3-clause | 41f91cc2abbc56ea8fdf30dbb809c673 | 37.926247 | 79 | 0.649986 | 2.585362 | false | false | false | false |
colour-science/colour | colour/geometry/intersection.py | 1 | 6945 | """
Intersection Utilities
======================
Defines the geometry intersection utilities objects.
References
----------
- :cite:`Bourkea` : Bourke, P. (n.d.). Intersection point of two line
segments in 2 dimensions. Retrieved January 15, 2016, from
http://paulbourke.net/geometry/pointlineplane/
- :ci... | bsd-3-clause | 38b8563359dee03b7eb37ad616fd8b0e | 27.817427 | 79 | 0.564579 | 3.011709 | false | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.