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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bokeh/bokeh | src/bokeh/plotting/graph.py | 1 | 5921 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | bsd-3-clause | af86ea99aa84c0c33313522792753909 | 39.278912 | 113 | 0.485222 | 5.148696 | false | false | false | false |
bokeh/bokeh | src/bokeh/core/property/serialized.py | 1 | 2536 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | bsd-3-clause | 21d68f8e9ae222c866591fc00c8fdcf1 | 33.739726 | 78 | 0.344637 | 6.40404 | false | false | false | false |
joerick/pyinstrument | pyinstrument/frame_info.py | 1 | 1038 | from typing import List, Tuple
# pyright: strict
IDENTIFIER_SEP = "\x00"
ATTRIBUTES_SEP = "\x01"
ATTRIBUTE_MARKER_CLASS_NAME = "c"
ATTRIBUTE_MARKER_LINE_NUMBER = "l"
ATTRIBUTE_MARKER_TRACEBACKHIDE = "h"
def parse_frame_info(frame_info: str) -> Tuple[str, List[str]]:
"""
Parses a frame_info string, returns... | bsd-3-clause | 0627a10444fccc1ffa7f28fc9ba19438 | 24.95 | 76 | 0.675337 | 3.616725 | false | false | false | false |
airspeed-velocity/asv | asv/benchmarks.py | 1 | 11558 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import json
import os
import re
import tempfile
import itertools
from .console import log
from . import util, runner
from .repo import NoSuchNameError
class Benchmarks(dict):
"""
Manages and runs the set of benchmarks in the project.
"""
... | bsd-3-clause | 1ec7bf11e26377f3f2cbceaa8f0d73f8 | 33.195266 | 99 | 0.521284 | 4.858344 | false | false | false | false |
joblib/joblib | joblib/externals/loky/backend/resource_tracker.py | 2 | 14359 | ###############################################################################
# Server process to keep track of unlinked resources, like folders and
# semaphores and clean them.
#
# author: Thomas Moreau
#
# adapted from multiprocessing/semaphore_tracker.py (17/02/2017)
# * include custom spawnv_passfds to start th... | bsd-3-clause | 93fc7e8398b890b4a450735822577031 | 37.703504 | 80 | 0.532419 | 4.72025 | false | false | false | false |
joblib/joblib | benchmarks/bench_auto_batching.py | 6 | 4331 | """Benchmark batching="auto" on high number of fast tasks
The goal of this script is to study the behavior of the batch_size='auto'
and in particular the impact of the default value of the
joblib.parallel.MIN_IDEAL_BATCH_DURATION constant.
"""
# Author: Olivier Grisel
# License: BSD 3 clause
import numpy as np
impor... | bsd-3-clause | 3e6694eb62265b82df7eb3ee305ab4f9 | 38.018018 | 79 | 0.650196 | 3.799123 | false | false | false | false |
joblib/joblib | joblib/externals/loky/backend/fork_exec.py | 2 | 1185 | ###############################################################################
# Launch a subprocess using forkexec and make sure only the needed fd are
# shared in the two process.
#
# author: Thomas Moreau and Olivier Grisel
#
import os
import sys
def close_fds(keep_fds): # pragma: no cover
"""Close all the f... | bsd-3-clause | 203dc15b900650a8ac18e17668a627a5 | 27.214286 | 79 | 0.578059 | 3.726415 | false | false | false | false |
airspeed-velocity/asv | test/test_gh_pages.py | 1 | 2843 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import pytest
import asv.util
from . import tools
@pytest.mark.parametrize("rewrite", [False, True], ids=["no-rewrite", "rewrite"])
def test_gh_pages(rewrite, tmpdir, generate_result_dir, monkeypatch):
tmpdir = os.path.abspath(str(tmpdir... | bsd-3-clause | c4b5a8c2cc9440ad9543e38174e11112 | 33.670732 | 87 | 0.641224 | 3.066882 | false | true | false | false |
joblib/joblib | joblib/_deprecated_format_stack.py | 4 | 14505 | """
Represent an exception with a lot of information.
Provides 2 useful functions:
format_exc: format an exception into a complete traceback, with full
debugging instruction.
format_outer_frames: format the current position in the stack call.
Adapted from IPython's VerboseTB.
"""
# Authors: Gael Varoqua... | bsd-3-clause | bdc67ad7ec447ba9a62cad411b25322e | 35.536524 | 83 | 0.53354 | 4.269944 | false | false | false | false |
airspeed-velocity/asv | asv/plugins/mercurial.py | 1 | 5818 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Supports mercurial repositories for the benchmarked project.
"""
import os
import sys
import re
try:
import hglib
except ImportError:
hglib = None
from ..console import log
from ..repo import Repo, NoSuchNameError
from .. import util
clas... | bsd-3-clause | 88e52be2808eefe7ca7d0a5e4d526e5a | 30.619565 | 87 | 0.55208 | 3.963215 | false | false | false | false |
joblib/joblib | joblib/pool.py | 4 | 14334 | """Custom implementation of multiprocessing.Pool with custom pickler.
This module provides efficient ways of working with data stored in
shared memory with numpy.memmap arrays without inducing any memory
copy between the parent and child processes.
This module should not be imported if multiprocessing is not
availabl... | bsd-3-clause | 7dffce81efcc42e0fb1a247397723898 | 39.721591 | 99 | 0.64797 | 4.496236 | false | false | false | false |
airspeed-velocity/asv | asv/statistics.py | 1 | 15299 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# Author: Pauli Virtanen, 2016
import math
from operator import index
def compute_stats(samples, number):
"""
Statistical analysis of measured samples.
Parameters
----------
samples : list of float
List of total times (y) o... | bsd-3-clause | df3740293b77da5d496f49442cb1ed26 | 23.439297 | 91 | 0.494869 | 3.248885 | false | false | false | false |
airspeed-velocity/asv | asv/commands/quickstart.py | 1 | 3555 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import shutil
from . import Command
from ..console import log, color_print
class Quickstart(Command):
@classmethod
def setup_arguments(cls, subparsers):
parser = subparsers.add_parser(
"quickstart", help="Create a ... | bsd-3-clause | b12a4905af740a3cd73e13b94c9b16ea | 36.421053 | 89 | 0.535865 | 4.105081 | false | false | false | false |
airspeed-velocity/asv | asv/commands/rm.py | 1 | 3613 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import sys
from fnmatch import fnmatchcase
from . import Command, util
from .. import console
from ..console import log
from ..results import iter_results
class Rm(Command):
@classmethod
def setup_arguments(cls, subparsers):
parser = sub... | bsd-3-clause | cfb3caa28d7562736de5860e43ce92e9 | 33.740385 | 84 | 0.515084 | 4.596692 | false | false | false | false |
joblib/joblib | setup.py | 1 | 1915 | #!/usr/bin/env python
from setuptools import setup
import pathlib
import joblib
# Get the long description from the README file
here = pathlib.Path(__file__).parent.resolve()
long_description = (here / 'README.rst').read_text(encoding='utf-8')
setup(
name='joblib',
version=joblib.__version__,
author='Ga... | bsd-3-clause | ec7be12d76ab40d7e48e73a83dfebb35 | 30.393443 | 68 | 0.57859 | 3.948454 | false | false | true | false |
airspeed-velocity/asv | asv/commands/common_args.py | 1 | 10888 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import math
import multiprocessing
import argparse
from .. import __version__, util
def add_global_arguments(parser, suppress_defaults=True):
# Suppressing defaults is needed in order to allow global
# arguments both before and after subcomman... | bsd-3-clause | f874393905f40ce892a98ec5c9878ece | 33.455696 | 97 | 0.594232 | 4.310372 | false | false | false | false |
joblib/joblib | joblib/externals/loky/backend/reduction.py | 2 | 7062 | ###############################################################################
# Customizable Pickler with some basic reducers
#
# author: Thomas Moreau
#
# adapted from multiprocessing/reduction.py (17/02/2017)
# * Replace the ForkingPickler with a similar _LokyPickler,
# * Add CustomizableLokyPickler to allow cust... | bsd-3-clause | 27f45e5519e25cab0e38feed0bceae45 | 31.246575 | 81 | 0.609176 | 3.954087 | false | false | false | false |
joblib/joblib | joblib/externals/loky/process_executor.py | 1 | 48885 | ###############################################################################
# Re-implementation of the ProcessPoolExecutor more robust to faults
#
# author: Thomas Moreau and Olivier Grisel
#
# adapted from concurrent/futures/process_pool_executor.py (17/02/2017)
# * Add an extra management thread to detect execut... | bsd-3-clause | 772e6ea41411a67113f9e1df497ac9d8 | 39.434243 | 79 | 0.590897 | 4.398902 | false | false | false | false |
joblib/joblib | joblib/numpy_pickle.py | 1 | 26896 | """Utilities for fast persistence of big data, with optional compression."""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2009 Gael Varoquaux
# License: BSD Style, 3 clauses.
import pickle
import os
import warnings
import io
from pathlib import Path
from .compressor import lz4,... | bsd-3-clause | ba3c3a519f1bf9a5ca48d7d7132481a8 | 39.813354 | 79 | 0.608864 | 4.515782 | false | false | false | false |
airspeed-velocity/asv | asv/results.py | 1 | 32402 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import base64
import os
import re
import zlib
import itertools
import hashlib
import datetime
from . import environment, statistics, util
from .console import log
from .machine import Machine
def iter_results_paths(results):
"""
Iterate over al... | bsd-3-clause | 6c96258b3ddfaa956dbffb311c20215b | 30.829077 | 99 | 0.522097 | 4.505284 | false | false | false | false |
ejeschke/ginga | ginga/util/wcsmod/wcs_astropy.py | 3 | 8561 | #
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import numpy as np
import astropy.wcs as pywcs
from astropy.io import fits as pyfits
from astropy import coordinates, units
from ginga.util.wcsmod import common
try:
import sunpy.coordinates # noqa
ex... | bsd-3-clause | a6bf980f44848e74b99294bf0cc81bdd | 31.800766 | 80 | 0.562668 | 3.725413 | false | false | false | false |
ejeschke/ginga | ginga/rv/plugins/ColorMapPicker.py | 3 | 8312 | # This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
"""
The ``ColorMapPicker`` plugin is used to graphically browse and select a
colormap for a channel image viewer.
**Plugin Type: Global**
``ColorMapPicker`` is a global plugin. Only one instance can be opened.... | bsd-3-clause | c4801a571957b5506c70a28f43a7aa6f | 33.489627 | 77 | 0.595765 | 3.463333 | false | false | false | false |
ejeschke/ginga | ginga/gw/PlotView.py | 3 | 11292 | #
# PlotView.py -- base class for plot viewer
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import logging
import numpy as np
from ginga.misc import Callback, Settings
from ginga import AstroImage
from ginga.gw import Widgets
try:
from ginga.gw imp... | bsd-3-clause | a496553c1e7ba81e9d2b2cb8f8daa3ca | 29.601626 | 75 | 0.547467 | 3.633205 | false | false | false | false |
ejeschke/ginga | ginga/mplw/transform.py | 2 | 10541 | #
# transform.py -- a custom projection for supporting matplotlib plotting
# on ginga
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
# NOTE: this code is based on "custom_projection_example.py", an example
# script developed by ma... | bsd-3-clause | cc04ef4afe78911a7ae70606a9c94363 | 32.893891 | 79 | 0.592923 | 4.194588 | false | false | false | false |
ejeschke/ginga | ginga/rv/plugins/PixTable.py | 2 | 25507 | #
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
"""
``PixTable`` provides a way to check or monitor the pixel values in
a region.
**Plugin Type: Local**
``PixTable`` is a local plugin, which means it is associated with a channel.
An instance can be opene... | bsd-3-clause | f30709b6cc86a063d4ae3671ec38c866 | 33.237584 | 115 | 0.573999 | 3.566415 | false | false | false | false |
ejeschke/ginga | ginga/web/pgw/Widgets.py | 3 | 121929 | #
# Widgets.py -- wrapped HTML widgets and convenience functions
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import os.path
import threading
import time
import json
import asyncio
from functools import reduce
from ginga.misc import Callback, Bunch, Se... | bsd-3-clause | 3c91c1225e82d86a00d0cf744cf87fbd | 32.007309 | 158 | 0.522197 | 3.852295 | false | false | false | false |
ejeschke/ginga | ginga/examples/qt/example2_qt.py | 2 | 10582 | #! /usr/bin/env python
#
# example2_qt.py -- Simple, configurable FITS viewer.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import sys
from ginga.qtw.QtHelp import QtGui, QtCore, set_default_opengl_context
from ginga import colors
from ginga.qtw.Image... | bsd-3-clause | 3389f78323bc48aa18ddd2cb35370b61 | 31.660494 | 100 | 0.584389 | 3.642685 | false | false | false | false |
ejeschke/ginga | ginga/web/pgw/ImageViewPg.py | 2 | 21912 | #
# ImageViewPg.py -- a backend for Ginga using javascript and
# HTML5 canvas and websockets
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
from ginga import ImageView, Mixins, Bindings
from ginga.canvas import render
default_html_fmt = 'jpeg'
c... | bsd-3-clause | 9ac450b303ef0574113557adc8edede4 | 32.762712 | 103 | 0.504336 | 3.741803 | false | false | false | false |
ejeschke/ginga | ginga/rv/main.py | 2 | 30899 | #
# main.py -- reference viewer for the Ginga toolkit.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
"""This module handles the main reference viewer."""
# stdlib imports
import glob
import sys
import os
import logging
import logging.handlers
import thr... | bsd-3-clause | 1ca76773ee524c54ba49daa1da4d01c5 | 40.198667 | 84 | 0.539791 | 4.377869 | false | false | false | false |
ejeschke/ginga | ginga/rv/plugins/Colorbar.py | 3 | 5458 | # This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
"""
The ``Colorbar`` plugin shows a colorbar indicating the colormap applied
to the image and showing the example values along the range.
**Plugin Type: Global**
``Colorbar`` is a global plugin. Only one insta... | bsd-3-clause | 80890a5a22292ea092c9829b7aaf91f8 | 32.078788 | 74 | 0.62697 | 3.685348 | false | false | false | false |
ejeschke/ginga | experimental/remote_image/plugin/RemoteData.py | 5 | 3219 | #
# RemoteData.py -- Remote Data plugin for Ginga image viewer
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
"""
"""
import sys
from ginga import GingaPlugin
from ginga.util.grc import RemoteClient
from ginga.gw import Widgets
from RemoteImage import R... | bsd-3-clause | 724d29cf91ccf3ed9ab92bf123f52b86 | 25.385246 | 75 | 0.575645 | 3.491323 | false | false | false | false |
ejeschke/ginga | experimental/plugins/Imexam.py | 3 | 11959 | #
# Imexam.py -- Imexam plugin for Ginga reference viewer
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import sys
import inspect
import traceback
import logging
from io import StringIO
from ginga import GingaPlugin
from ginga.gw import Widgets
from gin... | bsd-3-clause | 74847dafe29d9a7ecb4a693b747014f0 | 29.742931 | 85 | 0.583995 | 3.570917 | false | false | false | false |
ejeschke/ginga | ginga/mplw/FigureCanvasQt.py | 3 | 2310 | #
# GingaCanvasQt.py -- classes for the display of FITS files in
# Matplotlib FigureCanvas
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
from ginga.qtw.QtHelp import QtGui, QtCore
from ginga.toolkit import toolkit
if toolkit in... | bsd-3-clause | d699d466b8f1d6607849d5dac1478a9d | 27.875 | 86 | 0.631602 | 3.830846 | false | false | false | false |
ejeschke/ginga | ginga/rv/plugins/Errors.py | 3 | 4260 | # This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
"""
The ``Errors`` plugin reports error messages on the viewer.
**Plugin Type: Global**
``Errors`` is a global plugin. Only one instance can be opened.
**Usage**
When an error occurs in Ginga, its message ma... | bsd-3-clause | 9d05c804fb948535bb4674b9a3344af4 | 28.37931 | 75 | 0.602582 | 3.610169 | false | false | false | false |
ejeschke/ginga | ginga/fonts/font_asst.py | 3 | 4215 | #
# font_asst.py -- Font assistant routines
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import os
from ginga.misc import Bunch
# lookup table of cached fonts, for backends that build them
font_cache = Bunch.Bunch(caseless=True)
# lookup table of font... | bsd-3-clause | c020ea19435fc9c40c162ba119934dd3 | 27.288591 | 82 | 0.67331 | 3.435208 | false | false | false | false |
ejeschke/ginga | ginga/util/mosaic.py | 2 | 46524 | #
# mosaic.py -- Classes for quick and dirty mosaicing of FITS images
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import math
import time
import warnings
import numpy as np
from ginga import AstroImage, trcalc
from ginga.util import wcs, loader, dp, ... | bsd-3-clause | 46bf48faa16495bdb693797bab69d167 | 37.040883 | 100 | 0.533875 | 3.520278 | false | false | false | false |
ejeschke/ginga | ginga/examples/matplotlib/example3_mpl.py | 2 | 13514 | #! /usr/bin/env python
#
# example3_mpl.py -- Copy attributes from a Ginga Qt widget into a Matplotlib
# figure.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
#
"""
$ ./example3_mpl.py [fits file]
example3 displays a native ging... | bsd-3-clause | 2e8c0487dd0fd44b80301aa35ea58efc | 29.995413 | 100 | 0.578585 | 3.604695 | false | false | false | false |
ejeschke/ginga | ginga/modes/dist.py | 2 | 3696 | #
# dist.py -- mode for controlling color distribution
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
"""Dist Mode enables bindings that can adjust the color distribution
of an image in a Ginga image viewer.
These algorithms are similar to "curves" type ... | bsd-3-clause | a43e98fa73c8c597bed9261ba1bbc9db | 28.568 | 70 | 0.570617 | 3.710843 | false | false | false | false |
ejeschke/ginga | ginga/web/pgw/ipg.py | 2 | 17276 | #! /usr/bin/env python
#
# ipg.py -- Module for simple FITS viewer in an HTML5 canvas web browser.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
"""
This example illustrates using a Ginga widget in a web browser, All the
rendering is done on the server ... | bsd-3-clause | d1fa424e2cd5b884f420b37d239d0a3a | 30.699083 | 84 | 0.580343 | 3.91391 | false | false | false | false |
ejeschke/ginga | ginga/rv/plugins/Header.py | 3 | 8904 | # This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
"""
The ``Header`` plugin provides a listing of the metadata associated with the
image.
**Plugin Type: Global**
``Header`` is a global plugin. Only one instance can be opened.
**Usage**
The ``Header`` plugin... | bsd-3-clause | ab3973b984760b7b678115ddb085c874 | 31.615385 | 78 | 0.58558 | 3.801879 | false | false | false | false |
ejeschke/ginga | ginga/gtk3w/Widgets.py | 2 | 77295 | #
# Widgets.py -- wrapped Gtk widgets and convenience functions
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import os.path
from ginga.gtk3w import GtkHelp
import ginga.icons
from ginga.misc import Callback, Bunch, Settings, LineHistory
from functool... | bsd-3-clause | f8586c9995f3d0da2db9d27632d16034 | 29.075875 | 85 | 0.56384 | 3.689323 | false | false | false | false |
ejeschke/ginga | ginga/rv/plugins/Zoom.py | 3 | 13813 | # This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
"""
The ``Zoom`` plugin shows an enlarged image of a cutout region centered
under the cursor position in the associated channel image. As the
cursor is moved around the image, the zoom image updates to allow clo... | bsd-3-clause | 03b1b6089f9950f3fc9c28a004a0b476 | 34.784974 | 107 | 0.612032 | 3.59901 | false | false | false | false |
ejeschke/ginga | ginga/examples/matplotlib/example1_mpl.py | 2 | 5580 | #! /usr/bin/env python
#
# example1_mpl.py -- Simple, configurable FITS viewer using a matplotlib
# QtAgg backend for Ginga and embedded in a Qt program.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
"""
Usage:
example1_mpl.py [fi... | bsd-3-clause | 4f8039c17a79fbdef59a724cc7d5f1a5 | 27.911917 | 76 | 0.583333 | 3.625731 | false | false | false | false |
ejeschke/ginga | ginga/table/TableView.py | 2 | 5949 | #
# TableView.py -- Table viewer for Ginga
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import logging
from collections import OrderedDict
from ginga.table import AstroTable
from ginga.misc import Callback, Settings
from ginga.misc import Bunch
class... | bsd-3-clause | cb3e6a3ce1843ceea64983bf4baa9da9 | 29.507692 | 90 | 0.575895 | 4.057981 | false | false | false | false |
ejeschke/ginga | ginga/rv/plugins/MultiDim.py | 3 | 25480 | #
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
"""
A plugin to navigate HDUs in a FITS file or planes in a 3D cube or
higher dimension dataset.
**Plugin Type: Local**
``MultiDim`` is a local plugin, which means it is associated with a
channel. An insta... | bsd-3-clause | 30d2acfc009c8ff92f7cb6684b896b39 | 32.837981 | 108 | 0.533713 | 3.615723 | false | false | false | false |
ejeschke/ginga | ginga/opengl/geometry_helper.py | 3 | 8388 | #
# geometry_helper.py -- help module for Ginga OpenGL camera
#
# Credit:
# Modified from code written by M. McGuffin
# http://profs.etsmtl.ca/mmcguffin/code/python/example-3D_Python-Qt-OpenGL/
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import num... | bsd-3-clause | 93c610e8f31a7793d553cfc6d8526625 | 28.639576 | 127 | 0.517763 | 3.008608 | false | false | false | false |
ejeschke/ginga | ginga/util/rgb_cms.py | 3 | 13759 | #
# rgb_cms.py -- RGB color management handling.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import os
import glob
import hashlib
import tempfile
import numpy as np
from ginga import trcalc
from ginga.misc import Bunch
from ginga.util.toolbox import ... | bsd-3-clause | 2e6b48a79795405d9b805e7b5d5a83dd | 33.483709 | 96 | 0.56305 | 3.991587 | false | false | false | false |
ejeschke/ginga | ginga/pilw/PilHelp.py | 3 | 5627 | #
# PilHelp.py -- help classes for the PIL drawing
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
import numpy as np
from PIL import Image, ImageFont, ImageDraw
from ginga import colors
from ginga.fonts import font_asst
def get_cached_font(fontname, fon... | bsd-3-clause | ca52e224bcc8b386bdb99e67e0e012e0 | 30.088398 | 75 | 0.578461 | 3.267712 | false | false | false | false |
awesto/django-shop | shop/serializers/auth.py | 1 | 2730 | from django.conf import settings
from django.template.loader import select_template
from django.urls import NoReverseMatch, reverse
from django.utils.translation import get_language_from_request
from cms.models.pagemodel import Page
from rest_framework.serializers import CharField, BooleanField
from rest_auth import se... | bsd-3-clause | 096944895a74235409003cc9bf538f63 | 46.068966 | 121 | 0.69011 | 4.086826 | false | false | false | false |
awesto/django-shop | shop/views/auth.py | 1 | 8484 | from django.contrib.auth import logout, get_user_model
from django.contrib.auth.models import AnonymousUser
from django.contrib.auth.tokens import default_token_generator
from django.core.exceptions import NON_FIELD_ERRORS
from django.utils.encoding import force_str
from django.utils.translation import gettext_lazy as ... | bsd-3-clause | c150e4a48d2a0f709f14d1805920ed04 | 41.208955 | 109 | 0.660655 | 4.289181 | false | false | false | false |
lektor/lektor | lektor/imagetools.py | 1 | 18162 | # -*- coding: utf-8 -*-
import decimal
import os
import posixpath
import re
import struct
import warnings
from datetime import datetime
from enum import Enum
from xml.etree import ElementTree as etree
import exifread
import filetype
from lektor.reporter import reporter
from lektor.utils import get_dependent_url
from ... | bsd-3-clause | f2b04180a15808b2cb1dc3843bb31752 | 27.571654 | 84 | 0.586893 | 3.873399 | false | false | false | false |
lektor/lektor | lektor/sourcesearch.py | 1 | 3790 | import sqlite3
from lektor.constants import PRIMARY_ALT
def _iter_parents(path):
path = path.strip("/")
if path:
pieces = path.split("/")
for x in range(len(pieces)):
yield "/" + "/".join(pieces[:x])
def _find_info(infos, alt, lang):
for info in infos:
if info["alt"]... | bsd-3-clause | adbd1151c896dfee4765e128d2f0e0c7 | 24.436242 | 81 | 0.483641 | 3.7749 | false | false | false | false |
awesto/django-shop | shop/models/fields.py | 1 | 4239 | import enum
from django.conf import settings
from django.db import models
from django.utils.encoding import force_str
from django.utils.translation import gettext_lazy as _
postgresql_engine_names = [
'django.db.backends.postgresql',
'django.db.backends.postgresql_psycopg2',
]
if settings.DATABASES['default'... | bsd-3-clause | dc14dbc3988e53c9c40055762598a495 | 31.113636 | 100 | 0.598018 | 4.243243 | false | false | false | false |
awesto/django-shop | shop/migrations/0010_auto_20191224_0727.py | 2 | 1248 | # Generated by Django 2.2.9 on 2019-12-24 07:27
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import filer.fields.file
class Migration(migrations.Migration):
dependencies = [
('shop', '0009_delete_email'),
]
operations = [
mig... | bsd-3-clause | eca77163b5f58759b3e841b04259b648 | 39.258065 | 228 | 0.652244 | 4.025806 | false | false | false | false |
lektor/lektor | lektor/types/flow.py | 1 | 7145 | import re
from jinja2 import is_undefined
from jinja2 import TemplateNotFound
from markupsafe import Markup
from lektor.constants import PRIMARY_ALT
from lektor.context import get_ctx
from lektor.metaformat import tokenize
from lektor.types.base import Type
_block_re = re.compile(r"^####\s*([^#]*?)\s*####\s*$")
_li... | bsd-3-clause | 14ccb183f2375f2f631dcf18e8d73cf2 | 29.021008 | 87 | 0.544437 | 4.061967 | false | false | false | false |
awesto/django-shop | shop/views/checkout.py | 1 | 7082 | from django.core.exceptions import ImproperlyConfigured
from django.db import transaction
from django.utils.module_loading import import_string
from django.utils.translation import gettext_lazy as _
from rest_framework import status
from rest_framework.decorators import action
from rest_framework.exceptions import Vali... | bsd-3-clause | 99b5fdc0cd2a81937cefca232b8272e7 | 48.873239 | 107 | 0.639791 | 4.507957 | false | false | false | false |
awesto/django-shop | shop/admin/product.py | 1 | 5823 | from django import forms
from django.core.exceptions import ImproperlyConfigured
from django.contrib import admin
from django.contrib.sites.models import Site
from django.utils.translation import gettext_lazy as _
try:
from django_elasticsearch_dsl.registries import registry as elasticsearch_registry
except Import... | bsd-3-clause | a9bc6766c33f2e5b355f9a312a4bc175 | 35.85443 | 105 | 0.65413 | 4.112288 | false | false | false | false |
justquick/django-activity-stream | actstream/templatetags/activity_tags.py | 3 | 8314 | from django.contrib.contenttypes.models import ContentType
from django.template import Variable, Library, Node, TemplateSyntaxError
from django.template.loader import render_to_string
from django.urls import reverse
from actstream.models import Follow, Action
register = Library()
class DisplayActivityFollowUrl(Nod... | bsd-3-clause | 49619c014a9059ce232c4c3c5a6c9efa | 29.907063 | 118 | 0.589488 | 4.010613 | false | false | false | false |
awesto/django-shop | shop/cascade/processbar.py | 1 | 3541 | from django.forms import fields, widgets
from django.utils.translation import gettext_lazy as _, ngettext_lazy
from django.utils.text import Truncator
from django.utils.html import format_html
from django.forms.fields import IntegerField
from django.template.loader import select_template
from entangled.forms import Ent... | bsd-3-clause | 6c2f4cc4f167e6d2e3fefea73cdf867e | 36.273684 | 91 | 0.690765 | 4.042237 | false | false | false | false |
awesto/django-shop | shop/modifiers/pool.py | 1 | 2625 | from django.core.exceptions import ImproperlyConfigured
from shop.conf import app_settings
class CartModifiersPool:
USE_CACHE = True
def __init__(self):
self._modifiers_list = []
def get_all_modifiers(self):
"""
Returns all registered modifiers of this shop instance.
"""... | bsd-3-clause | be8a556ddf5d8642d8741579e9c61e22 | 36.5 | 111 | 0.632 | 4.888268 | false | false | false | false |
awesto/django-shop | shop/serializers/checkout.py | 1 | 2307 | from django.core.exceptions import ImproperlyConfigured
from django.utils.module_loading import import_string
from rest_framework import serializers
from shop.conf import app_settings
class SerializeFormAsTextField(serializers.SerializerMethodField):
def __init__(self, form_class_name, **kwargs):
try:
... | bsd-3-clause | ba6ab378246a2e0852d572506a5e0e12 | 39.473684 | 109 | 0.695709 | 3.963918 | false | false | false | false |
awesto/django-shop | shop/cascade/checkout.py | 1 | 16437 | from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.forms import fields, widgets
from django.template import engines
from django.template.loader import select_template
from django.utils.html import format_html
from django.utils.module_loading import import_string
from django.utils.safe... | bsd-3-clause | d5d9d541629eee837f1c52f344b8d955 | 40.612658 | 133 | 0.683945 | 4.123683 | false | false | false | false |
awesto/django-shop | tests/test_enum.py | 1 | 2379 | import pytest
from django.db import models
from shop.models.fields import ChoiceEnum, ChoiceEnumField
class MyChoices(ChoiceEnum):
A = 0, "My choice A"
B = 1, "My choice B"
class MyColor(ChoiceEnum):
RED = '#ff0000', "Pure red"
BLUE = '#0000ff', "Pure blue"
class MyModel(models.Model):
f = Cho... | bsd-3-clause | 9ab708f7cc3449fde6c19fda5bc77a36 | 27.321429 | 81 | 0.651955 | 3.193289 | false | true | false | false |
lektor/lektor | tests/test_utils.py | 1 | 5284 | # coding: utf-8
import pytest
from lektor.utils import build_url
from lektor.utils import is_path_child_of
from lektor.utils import join_path
from lektor.utils import magic_split_ext
from lektor.utils import make_relative_url
from lektor.utils import parse_path
from lektor.utils import slugify
from lektor.utils import... | bsd-3-clause | 7825aac5500c18c29f0ea8322b5667b8 | 36.190141 | 80 | 0.528877 | 2.763475 | false | true | false | false |
lektor/lektor | lektor/metaformat.py | 1 | 3252 | def _line_is_dashes(line):
line = line.strip()
return line == "-" * len(line) and len(line) >= 3
def _process_buf(buf):
for idx, line in enumerate(buf):
if _line_is_dashes(line):
line = line[1:]
buf[idx] = line
if buf and buf[-1][-1:] == "\n":
buf[-1] = buf[-1][:-1... | bsd-3-clause | a918a3054a2ff00d02255e41193c6dd4 | 29.971429 | 77 | 0.511993 | 4.196129 | false | false | false | false |
awesto/django-shop | shop/migrations/0001_initial.py | 2 | 2558 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import models, migrations
import filer.fields.file
class Migration(migrations.Migration):
dependencies = [
('filer', '0002_auto_20150606_2003'),
('post_office', '0002_add_i18n_and_backe... | bsd-3-clause | 3a29dbf0a35a613d960fffcc40a1b30a | 36.617647 | 164 | 0.54183 | 4.503521 | false | false | false | false |
apple/coremltools | coremltools/converters/mil/mil/ops/defs/iOS15/recurrent.py | 1 | 19876 | # Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from coremltools.converters.mil.mil import Operation, types
from coremltools.converters.mil.mil.input... | bsd-3-clause | 24647127269ce0557184b16221bf9f98 | 37.952941 | 99 | 0.570422 | 3.644469 | false | false | false | false |
apple/coremltools | coremltools/proto/Imputer_pb2.py | 1 | 9313 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: Imputer.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pb2
from google.protobuf import message as _message
from... | bsd-3-clause | d417bb8bed4c92875385f3386a599a4d | 49.340541 | 909 | 0.745088 | 3.053443 | false | false | true | false |
apple/coremltools | deps/protobuf/python/google/protobuf/text_encoding.py | 146 | 4617 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | bsd-3-clause | 3a8d0ce73f789dadb552f3a862011ec8 | 42.149533 | 79 | 0.693524 | 3.450673 | false | false | false | false |
apple/coremltools | coremltools/converters/mil/mil/passes/test_noop_elimination.py | 1 | 14858 | # Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import itertools
import numpy as np
import pytest
from coremltools.converters.mil.mil import Builde... | bsd-3-clause | 14ce64c69e62f53051c586a22d9b047e | 31.37037 | 100 | 0.569929 | 2.964485 | false | true | false | false |
apple/coremltools | coremltools/converters/sklearn/_normalizer.py | 1 | 2315 | # Copyright (c) 2017, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from ... import SPECIFICATION_VERSION
from ..._deps import _HAS_SKLEARN
from ...models import MLModel a... | bsd-3-clause | 43b24cec8ca0770ec7c42d77a2d2462c | 27.231707 | 82 | 0.682073 | 3.839138 | false | false | false | false |
apple/coremltools | coremltools/converters/mil/mil/ops/defs/iOS15/pool.py | 1 | 9106 | # Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from coremltools.converters.mil.mil import Operation, types
from coremltools.converters.mil.mil.block... | bsd-3-clause | 53d63e56a004cd7da07bd6654f25b37f | 33.623574 | 154 | 0.550736 | 3.410487 | false | false | false | false |
apple/coremltools | coremltools/test/pipeline/test_model_updatable.py | 1 | 28313 | # Copyright (c) 2017, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import os
import shutil
import tempfile
import unittest
import numpy as _np
import coremltools.models.... | bsd-3-clause | 8d9b5817f1b99c786d89d1a8e624241f | 34.569095 | 104 | 0.606612 | 3.929087 | false | false | false | false |
apple/coremltools | coremltools/converters/mil/frontend/tensorflow/tf_graph_pass/insert_get_tuple.py | 1 | 3398 | # Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import copy
from ..parsed_tf_node import ParsedTFNode
def insert_get_tuple(gddict):
"""
Te... | bsd-3-clause | 2b9d1682f56165ea6793cf8f13437a6a | 29.612613 | 145 | 0.544732 | 3.653763 | false | false | false | false |
apple/coremltools | coremltools/converters/mil/frontend/tensorflow/tf_graph_pass/functionalize_loops.py | 1 | 19047 | # Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from coremltools import _logger as logger
from ..basic_graph_ops import (connect_dests, connect_edge... | bsd-3-clause | 6c8b70a0f7270e49179132f1f8262725 | 39.61194 | 88 | 0.559091 | 3.892704 | false | false | false | false |
apple/coremltools | coremltools/converters/mil/backend/nn/op_mapping.py | 1 | 129299 | # Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import numpy as _np
from tqdm import tqdm as _tqdm
from coremltools import _logger as logger
from co... | bsd-3-clause | d30da0dd0161f0b145b46909c7d95cc0 | 32.785994 | 154 | 0.579533 | 3.350844 | false | false | false | false |
apple/coremltools | coremltools/converters/mil/mil/passes/elementwise_batchnorm_fusion.py | 1 | 4234 | # Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import numpy as np
from coremltools.converters.mil.mil import Builder as mb
from coremltools.convert... | bsd-3-clause | 46d40d43b39eb0b5487d01abccd42eef | 27.802721 | 83 | 0.581247 | 3.312989 | false | false | false | false |
apple/coremltools | coremltools/converters/mil/frontend/tensorflow/parsed_tf_node.py | 1 | 3234 | # Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from coremltools.converters.mil.mil import types
from .tfssa import ParsedNode
class ParsedTFNode(... | bsd-3-clause | d311f98970486e06155d5d3c0632e110 | 39.425 | 92 | 0.567718 | 3.968098 | false | false | false | false |
apple/coremltools | coremltools/converters/mil/frontend/torch/internal_graph.py | 1 | 12404 | # Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from collections import OrderedDict
from itertools import islice
def _make_ssa_name(name):
"""
... | bsd-3-clause | e9e04c8d7696fb21f52b66a891b527fc | 37.7625 | 105 | 0.573363 | 3.971822 | false | false | false | false |
apple/coremltools | coremltools/converters/mil/mil/ops/defs/iOS16/constexpr_ops.py | 1 | 14241 | # Copyright (c) 2022, Apple Inc. All rights reserved.
import numpy as np
from coremltools.converters.mil.mil import types
from coremltools.converters.mil.mil.input_type import (InputSpec,
TensorInputType)
from coremltools.converters.mil.mil.operation import Operat... | bsd-3-clause | 8b517b61ffe5052ac9bfb3441f935fa6 | 36.182768 | 135 | 0.599888 | 3.736814 | false | false | false | false |
apple/coremltools | coremltools/converters/mil/mil/types/get_type_info.py | 1 | 2123 | # Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from .type_spec import FunctionType, Type
from .type_void import void
def get_python_method_type(py... | bsd-3-clause | d02b882658d3fd385c5b4535c0cdb2da | 34.983051 | 83 | 0.594442 | 3.953445 | false | false | false | false |
apple/coremltools | deps/protobuf/python/google/protobuf/internal/message_factory_test.py | 35 | 7973 | #! /usr/bin/env python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ... | bsd-3-clause | fc4021ca939232b38b990024755f86ee | 40.963158 | 80 | 0.716794 | 3.83871 | false | true | false | false |
apple/coremltools | deps/protobuf/examples/add_person.py | 39 | 1657 | #! /usr/bin/env python
# See README.txt for information and build instructions.
import addressbook_pb2
import sys
# This function fills in a Person message based on user input.
def PromptForAddress(person):
person.id = int(raw_input("Enter person ID number: "))
person.name = raw_input("Enter name: ")
email = ... | bsd-3-clause | 9f9ffc22a0228503a85c2b3f7c9e5266 | 28.589286 | 76 | 0.678938 | 3.430642 | false | false | false | false |
apple/coremltools | coremltools/converters/mil/mil/ops/tests/test_elementwise_unary.py | 1 | 24212 | # Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import itertools
import numpy as np
import pytest
import scipy
from coremltools.converters.mil impo... | bsd-3-clause | f8cd5be6ae47ae4c6ecc16ab1898e7b5 | 34.19186 | 106 | 0.49397 | 3.031047 | false | true | false | false |
apple/coremltools | coremltools/converters/mil/mil/ops/tests/test_normalization.py | 1 | 25998 | # Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import itertools
import platform
import numpy as np
import pytest
import coremltools as ct
from cor... | bsd-3-clause | 41d480d8e17e234a1b9ec396832bd720 | 33.617843 | 128 | 0.482729 | 3.534738 | false | true | false | false |
apple/coremltools | coremltools/converters/mil/mil/passes/conv_batchnorm_fusion.py | 1 | 6606 | # Copyright (c) 2021, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import numpy as np
from coremltools.converters.mil.mil import Builder as mb
from coremltools.convert... | bsd-3-clause | e06ae0ad3516aa0452b788a8d6f768c7 | 35.7 | 118 | 0.622313 | 3.495238 | false | false | false | false |
apple/coremltools | coremltools/converters/mil/mil/var.py | 1 | 10712 | # Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from coremltools.converters.mil.mil import types
from coremltools.converters.mil.mil.types import bui... | bsd-3-clause | 3def84b0d3db17dc16d0370cdb12764d | 31.96 | 134 | 0.595314 | 3.814815 | false | false | false | false |
apple/coremltools | coremltools/converters/mil/mil/passes/test_merge_consecutive_paddings.py | 1 | 6426 | # Copyright (c) 2021, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import numpy as np
import pytest
from coremltools.converters.mil.mil import Builder as mb
from corem... | bsd-3-clause | 9d5b8fdb28504bc6caa550b27e2e096f | 35.101124 | 86 | 0.532213 | 3.139228 | false | true | false | false |
apple/coremltools | coremltools/converters/mil/mil/ops/defs/iOS15/scatter_gather.py | 1 | 16508 | # Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import numpy as np
from coremltools.converters.mil.mil import Operation, types
from coremltools.conv... | bsd-3-clause | 9040f64e5f54ccff4e2c2713b08c82d7 | 29.069217 | 140 | 0.510116 | 3.386951 | false | false | false | false |
apple/coremltools | coremltools/converters/mil/_deployment_compatibility.py | 1 | 6175 | # Copyright (c) 2021, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from enum import IntEnum
from coremltools import (_SPECIFICATION_VERSION_IOS_13,
... | bsd-3-clause | a0efc027016829e71f5570cfd862b5fd | 35.323529 | 112 | 0.637247 | 3.971061 | false | false | false | false |
apple/coremltools | coremltools/converters/mil/backend/nn/load.py | 1 | 13848 | # Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import coremltools as ct
from coremltools.converters._profile_utils import _profile
from coremltools.... | bsd-3-clause | ea10b4b3eec40bdb12c6677839f48bc1 | 43.242812 | 115 | 0.558131 | 4.220664 | false | false | false | false |
apple/coremltools | coremltools/converters/mil/mil/passes/prelu_fusion.py | 1 | 7821 | # Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import numpy as np
from coremltools.converters.mil import Builder as mb
from coremltools.converters.... | bsd-3-clause | cc961b91d7bb404d8aa29e7e2fd1c705 | 38.105 | 109 | 0.514129 | 3.661517 | false | false | false | false |
apple/coremltools | coremltools/converters/mil/mil/ops/defs/iOS15/tensor_transformation.py | 1 | 35187 | # Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import numpy as np
import sympy as sm
from coremltools import _logger as logger
from coremltools.con... | bsd-3-clause | c5b4eecbbeb875d12095b55bd14fbddb | 31.915809 | 147 | 0.55475 | 3.681034 | false | false | false | false |
apple/coremltools | coremltools/converters/mil/mil/ops/defs/iOS15/random.py | 1 | 9058 | # Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from coremltools.converters.mil.mil import (get_new_symbol,
... | bsd-3-clause | c9f264146299fcbec2a3e35de344d980 | 29.809524 | 88 | 0.584235 | 3.978041 | false | false | false | false |
apple/coremltools | coremltools/converters/mil/backend/mil/passes/sanitize_name_strings.py | 1 | 1030 | # Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from coremltools.converters.mil.mil.passes.graph_pass import AbstractGraphPass
from coremltools.conve... | bsd-3-clause | 0f4734a5155dab90c01c89b49cd2ce6d | 43.826087 | 83 | 0.720388 | 3.421927 | false | false | false | false |
apple/coremltools | coremltools/converters/mil/frontend/tensorflow2/ssa_passes/remove_vacuous_cond.py | 1 | 4645 | # Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from coremltools import _logger as logger
from coremltools.converters.mil.mil import Builder as mb
fr... | bsd-3-clause | 5ad63bd9a841754077d29ebdf38c8fda | 38.364407 | 86 | 0.572013 | 3.54851 | false | false | false | false |
apple/coremltools | deps/protobuf/python/google/protobuf/internal/generator_test.py | 69 | 14773 | #! /usr/bin/env python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ... | bsd-3-clause | 1b45d99ef90b21aabe23b02a7f5aafdf | 41.329513 | 80 | 0.720639 | 3.984088 | false | true | false | false |
pallets/itsdangerous | src/itsdangerous/url_safe.py | 1 | 2402 | import typing as _t
import zlib
from ._json import _CompactJSON
from .encoding import base64_decode
from .encoding import base64_encode
from .exc import BadPayload
from .serializer import Serializer
from .timed import TimedSerializer
class URLSafeSerializerMixin(Serializer):
"""Mixed in with a regular serializer... | bsd-3-clause | ad77daefe93673ce931f4e50fa15f630 | 29.025 | 88 | 0.601998 | 4.423573 | false | false | false | false |
yarikoptic/pystatsmodels | statsmodels/examples/tsa/try_ar.py | 5 | 2517 | # -*- coding: utf-8 -*-
"""
Created on Thu Oct 21 21:45:24 2010
Author: josef-pktd
"""
import numpy as np
from scipy import signal
def armaloop(arcoefs, macoefs, x):
'''get arma recursion in simple loop
for simplicity assumes that ma polynomial is not longer than the ar-polynomial
Parameters
------... | bsd-3-clause | ba51043d5d917859294656a7ed088010 | 30.4625 | 88 | 0.609853 | 2.726977 | false | false | false | false |
yarikoptic/pystatsmodels | statsmodels/sandbox/stats/runs.py | 3 | 20029 | '''runstest
formulas for mean and var of runs taken from SAS manual NPAR tests, also idea
for runstest_1samp and runstest_2samp
Description in NIST handbook and dataplot doesn't explain their expected
values, or variance
Note:
There are (at least) two definitions of runs used in literature. The classical
definition ... | bsd-3-clause | 13ec4a5a19336268ee5958e02dff65f0 | 30.944179 | 203 | 0.608917 | 3.504637 | false | true | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.