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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
glumpy/glumpy | glumpy/ext/freetype/ft_structs.py | 5 | 35670 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
#
# FreeType high-level python API - Copyright 2011 Nicolas P. Rougier
# Distributed under the terms of the new BSD license.
#
# ---------------------------------------------------------------... | bsd-3-clause | 141fde8f26685250a6a27a583865d27b | 36.786017 | 81 | 0.597869 | 4.240875 | false | false | false | false |
glumpy/glumpy | glumpy/geometry/colored_cube.py | 3 | 2467 | # -----------------------------------------------------------------------------
# Copyright (c) 2009-2016 Nicolas P. Rougier. All rights reserved.
# Distributed under the (new) BSD License.
# -----------------------------------------------------------------------------
import numpy as np
from glumpy import gloo
def c... | bsd-3-clause | 6c781461fc6aef49255e108b0de3bcae | 31.460526 | 79 | 0.38711 | 2.88538 | false | false | false | false |
glumpy/glumpy | glumpy/transforms/conic_equal_area.py | 3 | 3901 | # -----------------------------------------------------------------------------
# Copyright (c) 2009-2016 Nicolas P. Rougier. All rights reserved.
# Distributed under the (new) BSD License.
# -----------------------------------------------------------------------------
"""
Conic Equal Area projection
See: https://gith... | bsd-3-clause | ed2648cffdf10174e7f667c5a1fc85d1 | 27.268116 | 79 | 0.555755 | 4.203664 | false | false | false | false |
ihmeuw/vivarium | src/vivarium/framework/artifact/hdf.py | 1 | 13279 | """
=============
HDF Interface
=============
A convenience wrapper around the `tables <https://www.pytables.org>`_ and
:mod:`pandas` HDF interfaces.
Public Interface
----------------
The public interface consists of 5 functions:
.. list-table:: HDF Public Interface
:widths: 20 60
:header-rows: 1
* - Func... | bsd-3-clause | b856d25f5197f4db4cce580e72657dea | 29.738426 | 106 | 0.59756 | 3.998494 | false | false | false | false |
ihmeuw/vivarium | src/vivarium/interface/interactive.py | 1 | 7890 | """
==========================
Vivarium Interactive Tools
==========================
This module provides an interface for interactive simulation usage. The main
part is the :class:`InteractiveContext`, a sub-class of the main simulation
object in ``vivarium`` that has been extended to include convenience
methods for ... | bsd-3-clause | 79ed10e63280f5b7f278809d13604a0e | 32.151261 | 94 | 0.6 | 4.555427 | false | false | false | false |
ihmeuw/vivarium | tests/config_tree/test_basic_functionality.py | 1 | 15651 | import textwrap
import pytest
import yaml
from vivarium.config_tree import (
ConfigNode,
ConfigTree,
ConfigurationError,
ConfigurationKeyError,
DuplicatedConfigurationError,
)
@pytest.fixture(params=list(range(1, 5)))
def layers(request):
return [f"layer_{i}" for i in range(1, request.param ... | bsd-3-clause | e3227d32945fb58b4a4a0f8726fb4afa | 30.682186 | 91 | 0.609226 | 3.205858 | false | true | false | false |
scrapy/scrapy | tests/test_linkextractors.py | 1 | 25760 | import pickle
import re
import unittest
from scrapy.http import HtmlResponse, XmlResponse
from scrapy.link import Link
from scrapy.linkextractors.lxmlhtml import LxmlLinkExtractor
from tests import get_testdata
# a hack to skip base class tests in pytest
class Base:
class LinkExtractorTestCase(unittest.TestCase)... | bsd-3-clause | 7029e08f794644e7e3eb63bb250ce366 | 48.922481 | 117 | 0.550932 | 3.79717 | false | true | false | false |
scrapy/scrapy | scrapy/commands/__init__.py | 1 | 6713 | """
Base class for Scrapy commands
"""
import os
import argparse
from pathlib import Path
from typing import Any, Dict, Optional
from twisted.python import failure
from scrapy.crawler import CrawlerProcess
from scrapy.utils.conf import arglist_to_dict, feed_process_params_from_cli
from scrapy.exceptions import UsageE... | bsd-3-clause | 02762e61f690d8719f1924bdb4814c5b | 39.197605 | 116 | 0.59422 | 4.367599 | false | false | false | false |
scrapy/scrapy | tests/test_utils_signal.py | 3 | 3511 | import asyncio
from pydispatch import dispatcher
from pytest import mark
from testfixtures import LogCapture
from twisted.internet import defer, reactor
from twisted.python.failure import Failure
from twisted.trial import unittest
from scrapy.utils.signal import send_catch_log, send_catch_log_deferred
from scrapy.uti... | bsd-3-clause | 586a3c988885ccc2a84e4099af4c3e01 | 31.211009 | 78 | 0.670179 | 3.837158 | false | true | false | false |
scrapy/scrapy | scrapy/commands/parse.py | 2 | 10567 | import json
import logging
from typing import Dict
from itemadapter import is_item, ItemAdapter
from w3lib.url import is_url
from twisted.internet.defer import maybeDeferred
from scrapy.commands import BaseRunSpiderCommand
from scrapy.http import Request
from scrapy.utils import display
from scrapy.utils.spider impo... | bsd-3-clause | a697ed1dfb2b15d5e024dd2fb85af071 | 38.137037 | 117 | 0.559478 | 4.27987 | false | false | false | false |
scrapy/scrapy | scrapy/utils/spider.py | 3 | 2195 | import inspect
import logging
from scrapy.spiders import Spider
from scrapy.utils.defer import deferred_from_coro
from scrapy.utils.misc import arg_to_iter
logger = logging.getLogger(__name__)
def iterate_spider_output(result):
if inspect.isasyncgen(result):
return result
elif inspect.iscoroutine(r... | bsd-3-clause | 40d2b355788c655eb721399e91790d02 | 30.811594 | 81 | 0.651025 | 4.012797 | false | false | false | false |
scrapy/scrapy | scrapy/cmdline.py | 2 | 5706 | import sys
import os
import argparse
import cProfile
import inspect
import pkg_resources
import scrapy
from scrapy.crawler import CrawlerProcess
from scrapy.commands import ScrapyCommand, ScrapyHelpFormatter, BaseRunSpiderCommand
from scrapy.exceptions import UsageError
from scrapy.utils.misc import walk_modules
from ... | bsd-3-clause | 3526f97882507aa994f433a6ff393d31 | 30.180328 | 97 | 0.627234 | 3.763852 | false | false | false | false |
scrapy/scrapy | scrapy/utils/request.py | 1 | 13713 | """
This module provides some useful functions for working with
scrapy.http.Request objects
"""
import hashlib
import json
import warnings
from typing import Dict, Iterable, List, Optional, Tuple, Union
from urllib.parse import urlunparse
from weakref import WeakKeyDictionary
from w3lib.http import basic_auth_header
... | bsd-3-clause | 61b5de7a231db9cd8a42780f3225d6af | 40.807927 | 112 | 0.651426 | 4.310909 | false | false | false | false |
moraes/tipfy | tipfy/utils.py | 9 | 4320 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | bsd-3-clause | 46e7ec1021452299f8a6643d70a6a1eb | 26 | 78 | 0.634491 | 3.799472 | false | false | false | false |
moraes/tipfy | tipfy/appengine/acl.py | 9 | 11435 | # -*- coding: utf-8 -*-
"""
tipfy.appengine.acl
~~~~~~~~~~~~~~~~~~~
Simple Access Control List
This module provides utilities to manage permissions for anything that
requires some level of restriction, such as datastore models or handlers.
Access permissions can be grouped into roles for convenience, so that a... | bsd-3-clause | 352701344724e868eaa9fac037f0ca88 | 27.516209 | 76 | 0.686576 | 3.290647 | false | false | false | false |
moraes/tipfy | tipfy/appengine/blobstore.py | 9 | 12717 | # -*- coding: utf-8 -*-
"""
tipfy.appengine.blobstore
~~~~~~~~~~~~~~~~~~~~~~~~~
Handler library for Blobstore API.
Contains handler mixins to help with uploading and downloading blobs.
BlobstoreDownloadMixin: Has helper method for easily sending blobs
to client.
BlobstoreUploadMixin: mix... | bsd-3-clause | a788edd8ed971f34b0f6f095a410dd21 | 32.55409 | 80 | 0.595659 | 4.334356 | false | false | false | false |
moraes/tipfy | tipfy/auth/twitter.py | 9 | 7220 | # -*- coding: utf-8 -*-
"""
tipfy.auth.twitter
~~~~~~~~~~~~~~~~~~
Implementation of Twitter authentication scheme.
Ported from `tornado.auth`_.
:copyright: 2009 Facebook.
:copyright: 2011 tipfy.org.
:license: Apache License Version 2.0, see LICENSE.txt for more details.
"""
from __future_... | bsd-3-clause | 3d35747b00abb399f3a37a42c2667d8a | 36.025641 | 79 | 0.624515 | 4.399756 | false | false | false | false |
pika/pika | tests/acceptance/async_adapter_tests.py | 1 | 44865 |
# too-many-lines
# pylint: disable=C0302
# Suppress pylint messages concerning missing class and method docstrings
# pylint: disable=C0111
# Suppress pylint warning about attribute defined outside __init__
# pylint: disable=W0201
# Suppress pylint warning about access to protected member
# pylint: disable=W0212
# ... | bsd-3-clause | a059cdfc6cd6d10541562952b95ce587 | 38.424429 | 120 | 0.614042 | 4.280195 | false | true | false | false |
pika/pika | tests/unit/diagnostic_utils_test.py | 2 | 2715 | """
Test of `pika.diagnostic_utils`
"""
import unittest
import logging
import pika.compat
from pika import diagnostic_utils
# Suppress invalid-name, since our test names are descriptive and quite long
# pylint: disable=C0103
# Suppress missing-docstring to allow test method names to be printed by our
# test runne... | bsd-3-clause | b262f56288382aec158a71abffbbd663 | 29.505618 | 80 | 0.634254 | 4.082707 | false | true | false | false |
pika/pika | examples/consumer_simple.py | 1 | 1745 | # -*- coding: utf-8 -*-
# pylint: disable=C0111,C0103,R0205
import json
import logging
import pika
from pika.exchange_type import ExchangeType
print('pika version: %s' % pika.__version__)
connection = pika.BlockingConnection(
pika.ConnectionParameters(host='localhost'))
main_channel = connection.channel()
consu... | bsd-3-clause | 5de1001d9f480ed000ff99fd12a96cd1 | 26.698413 | 91 | 0.708309 | 3.455446 | false | false | false | false |
pika/pika | pika/adapters/select_connection.py | 1 | 45096 | """A connection adapter that tries to use the best polling method for the
platform pika is running on.
"""
import abc
import collections
import errno
import heapq
import logging
import select
import time
import threading
import pika.compat
from pika.adapters.utils import nbio_interface
from pika.adapters.base_connec... | bsd-3-clause | 65b262dcea31e739c6a67810b4ad7cb7 | 34.592739 | 88 | 0.603801 | 4.570849 | false | false | false | false |
pika/pika | pika/heartbeat.py | 1 | 8167 | """Handle AMQP Heartbeats"""
import logging
import pika.exceptions
from pika import frame
LOGGER = logging.getLogger(__name__)
class HeartbeatChecker:
"""Sends heartbeats to the broker. The provided timeout is used to
determine if the connection is stale - no received heartbeats or
other activity will c... | bsd-3-clause | d3b6e6badde4571ec0afdd890d0e44b1 | 38.076555 | 172 | 0.639525 | 4.348775 | false | false | false | false |
pika/pika | examples/direct_reply_to.py | 1 | 2394 | # -*- coding: utf-8 -*-
# pylint: disable=C0111,C0103,R0205
"""
This example demonstrates RabbitMQ's "Direct reply-to" usage via
`pika.BlockingConnection`. See https://www.rabbitmq.com/direct-reply-to.html
for more info about this feature.
"""
import pika
SERVER_QUEUE = 'rpc.server.queue'
def main():
""" Here,... | bsd-3-clause | 8b910da7182b4ff231d5632caabd3cdd | 29.303797 | 82 | 0.651629 | 3.855072 | false | false | false | false |
djc/couchdb-python | couchdb/tests/couchhttp.py | 1 | 3677 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Christopher Lenz
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import socket
import time
import unittest
from couchdb import http, util
from couchdb.tests import testu... | bsd-3-clause | fdfb03f1b4bc78515d46790d7532c357 | 33.688679 | 141 | 0.608376 | 3.802482 | false | true | false | false |
django/channels | tests/security/test_auth.py | 3 | 7021 | from importlib import import_module
from unittest import mock
import pytest
from asgiref.sync import sync_to_async
from django.conf import settings
from django.contrib.auth import (
BACKEND_SESSION_KEY,
HASH_SESSION_KEY,
SESSION_KEY,
get_user_model,
user_logged_in,
user_logged_out,
)
from djang... | bsd-3-clause | 16b7975007c96954736a2310a77f0dcd | 26.861111 | 86 | 0.681242 | 3.915784 | false | true | false | false |
jjhelmus/nmrglue | tests/test_spinsolve.py | 2 | 1779 | """ Tests for the fileio.spinsolve submodule """
import nmrglue as ng
from pathlib import Path
from setup import DATA_DIR
def test_acqu():
""" read nmr_fid.dx """
dic, data = ng.spinsolve.read(Path(DATA_DIR) / "spinsolve" / "ethanol", "nmr_fid.dx")
assert dic["acqu"]["Sample"] == "EtOH"
assert dic[... | bsd-3-clause | 1db00bb5a30cea72a3d27802eb5a0c9d | 30.210526 | 89 | 0.600337 | 2.79717 | false | true | false | false |
jjhelmus/nmrglue | nmrglue/fileio/rnmrtk.py | 2 | 22364 | """
Functions for reading and writing Rowland NMR Toolkit (RNMRTK) files
"""
from __future__ import division
__developer_info__ = """
Information of the Rowland NMR Toolkit file format
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"""
import numpy as np
from warnings import warn
from . import fileiobase
####... | bsd-3-clause | dceda070939f1cfcfb4be35fc2c0fab4 | 26.107879 | 79 | 0.553702 | 3.653651 | false | false | false | false |
jjhelmus/nmrglue | tests/test_simpson.py | 4 | 5071 |
import nmrglue.fileio.simpson as simpson
import numpy as np
from numpy.testing import assert_allclose, assert_raises
import os.path
from setup import DATA_DIR
DD_1D = os.path.join(DATA_DIR, 'simpson_1d')
DD_2D = os.path.join(DATA_DIR, 'simpson_2d')
def test_1d_time():
""" reading 1D time domain files """
#... | bsd-3-clause | 225388e3f6608dd53f71b9604a1a61ef | 37.12782 | 79 | 0.634786 | 2.717578 | false | false | false | false |
jjhelmus/nmrglue | nmrglue/analysis/analysisbase.py | 2 | 10485 | """
analysisbase provides general purpose analysis functions and classes used by
several nmrglue.analysis modules
"""
import numpy as np
pi = np.pi
# helper functions
def neighbors(pt, shape, structure):
"""
Generate a list of all neighbors to a point.
Parameters
----------
pt : tuple of ints
... | bsd-3-clause | d61f09a2111e8bce15066a64de32bcc4 | 26.093023 | 78 | 0.574344 | 3.754028 | false | false | false | false |
jjhelmus/nmrglue | nmrglue/analysis/linesh.py | 2 | 26044 | """
Functions for fitting and simulating arbitrary dimensional lineshapes commonly
found in NMR experiments
"""
from __future__ import print_function
import numpy as np
from .leastsqbound import leastsqbound
from .analysisbase import squish
from .lineshapes1d import ls_str2class
from ..fileio import table
pi = np.p... | bsd-3-clause | 7f566c677c7735e82a0f1b1a52d4b910 | 31.11344 | 80 | 0.606781 | 3.824938 | false | false | false | false |
jobovy/galpy | galpy/snapshot/nemo_util.py | 1 | 1972 | ###############################################################################
# nemo_util.py: some utilities for handling NEMO snapshots
###############################################################################
import os
import subprocess
import tempfile
import numpy
def read(filename,ext=None,swapyz=False):... | bsd-3-clause | 6974d077aaf2a1ab9d563f2d4a3e5521 | 33 | 110 | 0.567951 | 3.88189 | false | false | false | false |
jobovy/galpy | doc/source/examples/sellwood-jrjp.py | 1 | 4179 | import csv
import os
import os.path
import re
import sys
import cPickle as pickle
import numpy as nu
from galpy.orbit import Orbit
from galpy.potential import LogarithmicHaloPotential, PowerSphericalPotential
from galpy.util import plot
_degtorad= nu.pi/180.
def hms_to_rad(ra):
spl= re.split(r' ',ra)
return ... | bsd-3-clause | b663729614e7053cf4962f0aa682af27 | 30.186567 | 84 | 0.520699 | 3.070536 | false | false | false | false |
jobovy/galpy | galpy/potential/SCFPotential.py | 1 | 40308 | import hashlib
import numpy
from numpy.polynomial.legendre import leggauss
from scipy import integrate
from scipy.special import gamma, gammaln, lpmn
from ..util import conversion, coords
from ..util._optional_deps import _APY_LOADED
from .Potential import Potential
if _APY_LOADED:
from astropy import units
fro... | bsd-3-clause | 2ee7934fa3b4a316640eae3511560519 | 33.304681 | 372 | 0.549916 | 3.19246 | false | false | false | false |
jobovy/galpy | tests/test_SpiralArmsPotential.py | 1 | 60567 | import numpy
from packaging.version import parse as parse_version
_NUMPY_VERSION= parse_version(numpy.__version__)
_NUMPY_1_23= (_NUMPY_VERSION > parse_version('1.22'))\
*(_NUMPY_VERSION < parse_version('1.24')) # For testing 1.23 precision issues
import unittest
from numpy.testing import assert_allclose
from sci... | bsd-3-clause | a4837d10e8d984b24c1f0731f2042263 | 77.353169 | 141 | 0.559909 | 2.449824 | false | true | false | false |
jobovy/galpy | galpy/potential/Irrgang13.py | 1 | 3211 | # Milky-Way mass models from Irrgang et al. (2013)
import numpy
from ..potential import (MiyamotoNagaiPotential, NFWPotential,
PlummerPotential, SCFPotential,
scf_compute_coeffs_spherical)
from ..util import conversion
# Their mass unit
mgal_in_msun= 1e5/conversion._G... | bsd-3-clause | 4d6c2c2e8ad1446edcc7169c25371b39 | 41.25 | 87 | 0.709125 | 2.340379 | false | false | false | false |
pyecore/pyecore | pyecore/ordered_set_patch.py | 1 | 2846 | import ordered_set
from typing import Iterable
SLICE_ALL = ordered_set.SLICE_ALL
# monkey patching the OrderedSet implementation
def insert(self, index, key):
"""Adds an element at a dedicated position in an OrderedSet.
This implementation is meant for the OrderedSet from the ordered_set
package only.
... | bsd-3-clause | 8c312f36dc6427c636833f92476239ce | 27.46 | 78 | 0.614547 | 3.887978 | false | false | false | false |
pyecore/pyecore | tests/test_derived.py | 2 | 1494 | import pytest
from pyecore.ecore import *
def test_default_derived_collection():
collection = EDerivedCollection.create(None, None)
with pytest.raises(AttributeError):
len(collection)
with pytest.raises(AttributeError):
collection[0]
with pytest.raises(AttributeError):
collec... | bsd-3-clause | c4253383e52a5907c68fdf38a884793a | 24.322034 | 71 | 0.630522 | 3.6 | false | true | false | false |
pyecore/pyecore | pyecore/commands.py | 1 | 10554 | """ This module introduce the command system which allows to defined various
that can be executed onto a commands stack. Each command can also be 'undo' and
'redo'.
"""
from abc import ABCMeta, abstractmethod
from collections import UserList
from .ecore import EObject, BadValueError
from .resources import ResourceSet
... | bsd-3-clause | 09d61ecd48aed2638728dee1860e9aaf | 28.154696 | 79 | 0.586413 | 4.122656 | false | false | false | false |
lmcinnes/umap | umap/parametric_umap.py | 1 | 39979 | import numpy as np
from umap import UMAP
from warnings import warn, catch_warnings, filterwarnings
from numba import TypingError
import os
from umap.spectral import spectral_layout
from sklearn.utils import check_random_state
import codecs, pickle
from sklearn.neighbors import KDTree
import sys
try:
import tensor... | bsd-3-clause | f0362b8fa23c96703b938f4355b151ec | 33.554019 | 114 | 0.599165 | 4.211863 | false | false | false | false |
lmcinnes/umap | umap/tests/test_umap_nn.py | 1 | 5348 | import numpy as np
import pytest
from numpy.testing import assert_array_almost_equal
from sklearn.neighbors import KDTree
from sklearn.preprocessing import normalize
from umap import distances as dist
from umap.umap_ import (
nearest_neighbors,
smooth_knn_dist,
)
# ===========================================... | bsd-3-clause | 3c8cabfe74ee7fb267e3c0ae52b82a37 | 31.023952 | 86 | 0.614622 | 3.372005 | false | true | false | false |
lmcinnes/umap | umap/tests/test_composite_models.py | 1 | 3681 | from umap import UMAP
import pytest
try:
# works for sklearn>=0.22
from sklearn.manifold import trustworthiness
except ImportError:
# this is to comply with requirements (scikit-learn>=0.20)
# More recent versions of sklearn have exposed trustworthiness
# in top level module API
# see: https://... | bsd-3-clause | 814e68f001cc5d9ce04b955023e159a9 | 30.461538 | 88 | 0.624559 | 3.295434 | false | true | false | false |
lmcinnes/umap | umap/utils.py | 1 | 6662 | # Author: Leland McInnes <leland.mcinnes@gmail.com>
#
# License: BSD 3 clause
import time
from warnings import warn
import numpy as np
import numba
from sklearn.utils.validation import check_is_fitted
import scipy.sparse
@numba.njit(parallel=True)
def fast_knn_indices(X, n_neighbors):
"""A fast computation of k... | bsd-3-clause | 2a0639b2de18bb39f13025c044bc11ae | 29.281818 | 117 | 0.638097 | 3.738496 | false | false | false | false |
machinalis/iepy | iepy/webui/corpus/admin.py | 2 | 3787 | from django.contrib import admin
from django.core import urlresolvers
from django.db.models import Q
from relatedwidget import RelatedWidgetWrapperBase
from corpus.models import (
IEDocument, IEDocumentMetadata, Entity, EntityKind, Relation,
EntityOccurrence, GazetteItem
)
admin.site.site_header = 'IEPY admi... | bsd-3-clause | c16b3c29703fc2fdf57cb30320165117 | 33.743119 | 89 | 0.64827 | 3.723697 | false | false | false | false |
machinalis/iepy | tests/test_relations.py | 2 | 18064 | from unittest import mock
from iepy.data.models import EvidenceLabel
from .factories import (
RelationFactory, EntityFactory, EntityKindFactory,
TextSegmentFactory, EntityOccurrenceFactory,
IEDocFactory,
)
from .manager_case import ManagerTestCase
class TestRelations(ManagerTestCase):
def test_cant_... | bsd-3-clause | 649915c17297402510d045b076710ed6 | 46.915119 | 98 | 0.654728 | 3.3923 | false | true | false | false |
machinalis/iepy | iepy/webui/corpus/migrations/0011_data_migration_moving_relation_from_candiates_to_labels.py | 2 | 2630 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
from django.db import models, migrations
logging.basicConfig(format="%(asctime)-15s %(message)s")
logger = logging.getLogger(__file__)
logger.setLevel(logging.INFO)
def get_key(evidence):
return (
evidence.left_entity_occurr... | bsd-3-clause | 6152d92bb4a27e9777f939d67ca68961 | 35.027397 | 88 | 0.651711 | 3.587995 | false | false | false | false |
machinalis/iepy | iepy/preprocess/corenlp.py | 1 | 8725 | import subprocess
import xmltodict
import os
import sys
import logging
import stat
from functools import lru_cache
import iepy
from iepy.utils import DIRS, unzip_from_url
logger = logging.getLogger(__name__)
def detect_java_version():
java_cmd = os.getenv('JAVAHOME')
if not java_cmd:
print('Environ... | bsd-3-clause | 0d5eb377392ede30dc4c62f977b30d40 | 38.659091 | 94 | 0.597479 | 3.41621 | false | false | false | false |
machinalis/iepy | iepy/__init__.py | 2 | 3647 | import os
import sys
from importlib import import_module
import django
from django.conf import settings
# Version number reading ...
fname = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'version.txt')
with open(fname, encoding='utf-8') as filehandler:
__version__ = filehandler.read().strip().replace(... | bsd-3-clause | 229c070f99df3baee2a7f331ca3f1252 | 36.214286 | 101 | 0.618042 | 4.125566 | false | false | false | false |
machinalis/iepy | setup.py | 1 | 3267 | from setuptools import setup, find_packages # Always prefer setuptools over distutils
from os import path
import sys
assert sys.version_info >= (3, 4, 0), "Python 3.4 or newer is required"
HERE = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
with open(path.join(HERE, 'READM... | bsd-3-clause | b64164c78822b1e7f9da6a72175a0ddb | 30.699029 | 98 | 0.662787 | 3.583974 | false | false | false | false |
machinalis/iepy | iepy/metrics.py | 2 | 1212 | # -*- coding: utf-8 -*-
import time
def result_dict_from_predictions(evidences, real_labels, predictions):
correct = []
incorrect = []
tp, fp, tn, fn = 0.0, 0.0, 0.0, 0.0
for evidence, real, predicted in zip(evidences, real_labels, predictions):
if real == predicted:
correct.appen... | bsd-3-clause | 3a62a7fa2ad3c0298836d8a4bc582c68 | 24.25 | 78 | 0.491749 | 3.775701 | false | false | false | false |
machinalis/iepy | iepy/webui/corpus/migrations/0003_auto_20140922_1547.py | 2 | 1063 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('corpus', '0002_auto_20140918_1733'),
]
operations = [
migrations.AlterModelOptions(
name='labeledrelationevidenc... | bsd-3-clause | 31a170afae3b9c16f4e8519748a6226a | 38.37037 | 277 | 0.614299 | 4.072797 | false | false | false | false |
biolink/ontobio | bin/materialize.py | 1 | 6455 | import click
import json
import os
import yaml
import requests
import gzip
import urllib
import shutil
import re
import glob
import logging
import copy
import yamldown
from functools import wraps
# from ontobio.util.user_agent import get_user_agent
from ontobio.ontol_factory import OntologyFactory
from ontobio impor... | bsd-3-clause | 90264a496bd3b81a07db2fcb892e2d2e | 33.704301 | 139 | 0.669404 | 3.476037 | false | false | false | false |
biolink/ontobio | ontobio/bin/phenolog.py | 1 | 4423 | #!/usr/bin/env python
"""
Command line wrapper to obographs library.
Example:
(venv) ~/repos/biolink-api(master) $ python obographs/bin/phenolog.py -vvv -r obo:mp -R go 'abnormal cardiovascular system physiology'
With background:
python obographs/bin/phenolog.py -b 'nervous system phenotype' -v -r cache/ontologies/m... | bsd-3-clause | afcc4ca6646d5e7c96809286cd9238b4 | 36.168067 | 141 | 0.570653 | 3.883231 | false | false | false | false |
biolink/ontobio | tests/test_phenosim_engine.py | 1 | 5390 | from ontobio.sim.phenosim_engine import PhenoSimEngine
from ontobio.sim.api.owlsim2 import OwlSim2Api
from ontobio.vocabulary.similarity import SimAlgorithm
from ontobio.model.similarity import IcStatistic
from unittest.mock import patch
import os
import json
MONDO_0008199 = ['HP:0000751', 'HP:0000738', 'HP:0000726'... | bsd-3-clause | b11d261d5555f15d70f329b7d0d580ec | 35.174497 | 93 | 0.598145 | 3.424396 | false | false | false | false |
biolink/ontobio | ontobio/slimmer.py | 1 | 2961 | import networkx as nx
import logging
logger = logging.getLogger(__name__)
def get_minimal_subgraph(g, nodes):
"""
given a set of nodes, extract a subgraph that excludes non-informative nodes - i.e.
those that are not MRCAs of pairs of existing nodes.
Note: no property chain reasoning is performe... | bsd-3-clause | 9f4b36c01d61aedda6989c62e0753828 | 29.214286 | 87 | 0.515366 | 3.5 | false | false | false | false |
biolink/ontobio | ontobio/model/bbop_graph.py | 1 | 3211 | """
BBOP Graph class created in the original biolink-api
before ontobio was stripped out, it is still used
in the scigraph-util
TODO Merge this with OBOGraph
"""
from typing import Dict
class BBOPGraph:
"""
BBOPGraph Graph object model
https://github.com/berkeleybop/bbop-graph
"""
nodemap = {}
... | bsd-3-clause | ac889d75fafeb15ccb4ab41332a38bf7 | 23.891473 | 69 | 0.515416 | 3.712139 | false | false | false | false |
biolink/ontobio | ontobio/sparql/sparql_ontology.py | 1 | 8756 | """
Classes for representing ontologies backed by a SPARQL endpoint
```
Ontology
RemoteSparqlOntology
EagerRemoteSparqlOntology
LazyRemoteSparqlOntology
```
"""
import networkx as nx
import logging
import ontobio.ontol
from ontobio.ontol import Ontology, Synonym, TextDefinition
from ontobio.sparql.sparql_o... | bsd-3-clause | 9439ce84c046efff2908f7edfb7943d5 | 32.80695 | 177 | 0.565555 | 3.759553 | false | false | false | false |
biolink/ontobio | ontobio/golr/golr_query.py | 1 | 68763 | """
A query wrapper for a Golr instance
Intended to work with:
* Monarch golr instance
* AmiGO/GO golr instance (including both GO and Planteome)
Conventions
-----------
Documents follow either entity or association patterns.
Associations
------------
Connects some kind of *subject* to an *object* via a *relation... | bsd-3-clause | c092aee93625f6104c3356d5de4e7c0d | 34.907572 | 163 | 0.557393 | 3.906545 | false | false | false | false |
biolink/ontobio | ontobio/sparql/skos.py | 1 | 4073 | import logging
import requests
import rdflib
from rdflib import Namespace
from rdflib.namespace import RDF
from rdflib.namespace import SKOS
from prefixcommons.curie_util import contract_uri
from ontobio.ontol import Ontology, Synonym
# TODO: make configurable
GEMET = Namespace('http://www.eionet.europa.eu/gemet/200... | bsd-3-clause | 37d26e9a3b64dfc6a5787c9cac244c18 | 32.113821 | 86 | 0.544071 | 3.860664 | false | false | false | false |
biolink/ontobio | ontobio/util/go_utils.py | 1 | 2826 | from ontobio.ontol_factory import OntologyFactory
class GoAspector:
def __init__(self, go_ontology):
if go_ontology:
self.ontology = go_ontology
else:
self.ontology = OntologyFactory().create("go")
def get_ancestors_through_subont(self, go_term, relations):
"""... | bsd-3-clause | 37599b01a06cba87d57140b75c5f4a55 | 33.888889 | 120 | 0.591649 | 3.897931 | false | false | false | false |
shadow-robot/sr_common | sr_description/test/test_compatibility.py | 1 | 8589 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
######################################################################
# Software License Agreement (BSD License)
#
# Copyright (c) 2021, Bielefeld University
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, ... | bsd-3-clause | 28534e391de1c68de6a893dad78788a4 | 37.004425 | 108 | 0.608453 | 3.898774 | false | false | false | false |
encode/uvicorn | tools/cli_usage.py | 1 | 1998 | """
Look for a marker comment in docs pages, and place the output of
`$ uvicorn --help` there. Pass `--check` to ensure the content is in sync.
"""
import argparse
import subprocess
import sys
import typing
from pathlib import Path
def _get_usage_lines() -> typing.List[str]:
res = subprocess.run(["uvicorn", "--he... | bsd-3-clause | dd0d4aeffed28d3fb7ffc96f3cbdd040 | 27.542857 | 85 | 0.587588 | 3.438898 | false | false | false | false |
encode/uvicorn | uvicorn/protocols/websockets/websockets_impl.py | 1 | 13536 | import asyncio
import http
import logging
import sys
from typing import TYPE_CHECKING, Any, List, Optional, Sequence, Tuple, Union, cast
from urllib.parse import unquote
import websockets
from websockets.datastructures import Headers
from websockets.exceptions import ConnectionClosed
from websockets.extensions.permess... | bsd-3-clause | 05a37a7c16dc54cf14a7ccba204db46c | 35.882834 | 87 | 0.583629 | 4.263307 | false | false | false | false |
encode/uvicorn | uvicorn/protocols/http/h11_impl.py | 1 | 20152 | import asyncio
import http
import logging
import sys
from typing import TYPE_CHECKING, Callable, List, Optional, Tuple, Union, cast
from urllib.parse import unquote
import h11
from uvicorn.config import Config
from uvicorn.logging import TRACE_LOG_LEVEL
from uvicorn.protocols.http.flow_control import (
CLOSE_HEAD... | bsd-3-clause | deb929d8382be1c8851a7e35ff225e59 | 34.985714 | 169 | 0.560639 | 4.217664 | false | false | false | false |
encode/uvicorn | uvicorn/supervisors/watchgodreload.py | 1 | 5491 | import logging
import warnings
from pathlib import Path
from socket import socket
from typing import TYPE_CHECKING, Callable, Dict, List, Optional
from watchgod import DefaultWatcher
from uvicorn.config import Config
from uvicorn.supervisors.basereload import BaseReload
if TYPE_CHECKING:
import os
DirEntry ... | bsd-3-clause | cf78c8df3ec4b1a5d6518c10216fec60 | 33.753165 | 84 | 0.562193 | 4.263199 | false | true | false | false |
quantmind/lux | lux/ext/content/contents.py | 1 | 7180 | import os
import stat
from datetime import datetime, date
from collections import Mapping
from itertools import chain
from dateutil.parser import parse as parse_date
from pulsar.api import Unsupported
from pulsar.utils.slugify import slugify
from pulsar.utils.structures import mapping_iterator
from lux.utils.date im... | bsd-3-clause | 8a4a5ddbe939150ddba090cd36c33290 | 28.792531 | 78 | 0.597493 | 3.936404 | false | false | false | false |
quantmind/lux | lux/ext/sessions/browser.py | 1 | 5814 | """Backends for Browser based Authentication
"""
import time
from functools import wraps
from pulsar.api import (
Http401, PermissionDenied, Http404, HttpRedirect, BadRequest
)
from pulsar.apps.wsgi import Route
from lux.utils.date import to_timestamp, date_from_now, iso8601
from lux.utils.context import app_attr... | bsd-3-clause | 544f76583adc5dfafb183e777b3796d2 | 32.222857 | 74 | 0.602511 | 4.284451 | false | false | false | false |
quantmind/lux | tests/web/test_signup.py | 1 | 5683 | from tests import web
class AuthTest(web.WebsiteTest):
def _get_code(self, message):
url = '/reset-password/'
idx = message.find(url)
self.assertTrue(idx)
msg = message[idx+len(url):]
idx = msg.find(' ')
return msg[:idx]
async def test_html_signup(self):
... | bsd-3-clause | fe370a5af9a01050420d1409d9a621d0 | 40.181159 | 72 | 0.554989 | 4.175606 | false | true | false | false |
quantmind/lux | lux/ext/smtp/log.py | 1 | 3013 | import logging
import json
from inspect import isawaitable
from pulsar.api import ensure_future
MESSAGE = 'Exception while posting message to Slack'
def context_text_formatter(context):
res = ""
maxlen = max([len(key) for key in context])
for key, val in context.items():
space = " " * (maxlen -... | bsd-3-clause | ed0695a4573aa7d33a566e1e44b9d31f | 31.75 | 77 | 0.557252 | 3.892765 | false | false | false | false |
quantmind/lux | tests/sockjs/test_rest.py | 1 | 10210 | import json
import asyncio
from lux.utils import test
from lux.utils.crypt import create_uuid
class TestSockJSRestApp(test.AppTestCase):
config_file = 'tests.sockjs'
@classmethod
async def beforeAll(cls):
cls.super_token, cls.pippo_token = await asyncio.gather(
cls.user_token('testus... | bsd-3-clause | 3091e47f82135c9c8da9ffe2123f9b2e | 40.504065 | 79 | 0.597747 | 4.000784 | false | true | false | false |
quantmind/lux | lux/utils/crypt/arc4.py | 1 | 2165 | '''RC4, ARC4, ARCFOUR algorithm for encryption.
Adapted from
#
# RC4, ARC4, ARCFOUR algorithm
#
# Copyright (c) 2009 joonis new media
# Author: Thimo Kraemer <thimo.kraemer@joonis.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU ... | bsd-3-clause | 9b9cecfb8792a66c56c30e6deccadddb | 27.486842 | 76 | 0.611085 | 3.341049 | false | false | false | false |
quantmind/lux | lux/ext/auth/rest/registrations.py | 1 | 5326 | from datetime import datetime
from pulsar.api import PermissionDenied, Http404
from lux.core import http_assert
from lux.ext.rest import RestRouter, route
from lux.models import Schema, fields, ValidationError
from lux.ext.odm import Model
from . import ensure_service_user, IdSchema
URI = 'registrations'
email_t... | bsd-3-clause | 6e0fd230fb81118194cab93d866c7737 | 29.786127 | 73 | 0.616786 | 4.277912 | false | false | false | false |
quantmind/lux | tests/auth/groups.py | 1 | 2785 |
class GroupsMixin:
"""Groups CRUD views
"""
async def test_group_validation(self):
payload = {'name': 'abc'}
request = await self.client.post(self.api_url('groups'),
json=payload,
token=self.super_token)
... | bsd-3-clause | 33a8e0613ca8faeddc7facde6b133a8c | 38.225352 | 78 | 0.504129 | 4.427663 | false | false | false | false |
quantmind/lux | lux/core/commands/stop.py | 1 | 1680 | import os
import time
import signal
from pulsar.utils.tools import Pidfile
from lux.core import LuxCommand, Setting, CommandError
class Command(LuxCommand):
help = "Stop a running server"
option_list = (
Setting('timeout', ('--timeout',),
default=10, type=int,
desc=(... | bsd-3-clause | 084051d9634903092153db1079fbafcb | 30.111111 | 78 | 0.542857 | 4.148148 | false | false | false | false |
quantmind/lux | tests/odm/test_postgresql.py | 1 | 12869 | from dateutil.parser import parse
from lux.utils import test
from tests.odm.utils import OdmUtils
class TestPostgreSql(OdmUtils, test.AppTestCase):
@classmethod
async def beforeAll(cls):
cls.super_token = await cls.user_token('testuser', jwt=cls.admin_jwt)
async def test_odm(self):
tab... | bsd-3-clause | 9707494daa9c10fd09c7c90a370ad54b | 39.724684 | 77 | 0.571062 | 4.132627 | false | true | false | false |
quantmind/lux | lux/ext/auth/rest/authorization.py | 1 | 4160 | from pulsar.api import Http401, BadRequest, UnprocessableEntity
from lux.models import Schema, fields, ValidationError
from lux.utils.date import date_from_now
from lux.ext.rest import RestRouter, route
from lux.ext.odm import Model
from ..backend import AuthenticationError
from .tokens import TokenSchema
from . impo... | bsd-3-clause | 5b0bdf08b9247bc09a4682b21302011c | 30.755725 | 78 | 0.609375 | 4.526659 | false | false | false | false |
quantmind/lux | lux/ext/sockjs/socketio.py | 1 | 2441 | import sys
import hashlib
from random import randint
from pulsar.api import HttpException
from pulsar.apps.wsgi import Router, route
from pulsar.utils.httpurl import CacheControl
from .transports.websocket import WebSocket
from .utils import IFRAME_TEXT
class SocketIO(Router):
"""A Router for sockjs requests
... | bsd-3-clause | 5a7979b920e81cb25cc7e1dc55a185e5 | 31.118421 | 70 | 0.612044 | 4.054817 | false | false | false | false |
morepath/morepath | morepath/request.py | 1 | 11760 | """Morepath request implementation.
Entirely documented in :class:`morepath.Request` and
:class:`morepath.Response` in the public API.
"""
from webob import BaseRequest, Response as BaseResponse
from dectate import Sentinel
from .reify import reify
from .traject import create_path, parse_path
from .error import Link... | bsd-3-clause | 4b4aa869b42a40e22426bff6dc388484 | 34.421687 | 80 | 0.619133 | 4.379888 | false | false | false | false |
morepath/morepath | morepath/tests/test_mount_directive.py | 1 | 29067 | import morepath
from morepath.error import LinkError, ConflictError
from webtest import TestApp as Client
import pytest
def test_model_mount_conflict():
class app(morepath.App):
pass
class app2(morepath.App):
pass
class A:
pass
@app.path(model=A, path="a")
def get_a():
... | bsd-3-clause | 8914695fb497493536a78f40b404b24f | 23.262938 | 80 | 0.586885 | 3.487343 | false | false | false | false |
cornell-brg/pymtl | pclib/fl/QueuePortProxy.py | 8 | 3091 | #=========================================================================
# QueuePortProxy
#=========================================================================
# These classes provide part of a standard Python deque interface, but
# the implementation essentially turns the popleft() and append() methods
# into a... | bsd-3-clause | 86fb7384171a13da08f3af452c8b3105 | 27.357798 | 74 | 0.359107 | 5.630237 | false | false | false | false |
cornell-brg/pymtl | pclib/cl/pipelines_test.py | 8 | 3436 | #=========================================================================
# pipelines_test.py
#=========================================================================
import pytest
from pymtl import *
from pclib.ifcs import InValRdyBundle, OutValRdyBundle
from pclib.test import TestSrcSinkSim
from pclib.cl ... | bsd-3-clause | 3a67ad6da9ae9866fba8726b1dd76c87 | 31.415094 | 83 | 0.467113 | 3.152294 | false | true | false | false |
cornell-brg/pymtl | pclib/ifcs/XcelMsg.py | 8 | 2581 | #=========================================================================
# XcelMsg
#=========================================================================
# Accelerator request and response messages.
from pymtl import *
#-------------------------------------------------------------------------
# XcelReqMsg
#----... | bsd-3-clause | 9aa3bae2765d24eaf10cba5f64b325c5 | 22.898148 | 74 | 0.469198 | 3.762391 | false | false | false | false |
cornell-brg/pymtl | pymtl/tools/integration/verilog_parser_test_todo.py | 8 | 6172 | #=======================================================================
# verilog_parser
#=======================================================================
import pytest
import os
from verilog_parser import header_parser
#-----------------------------------------------------------------------
# test cases
#--... | bsd-3-clause | 6a3e5d1a7e57bd0b8da2c5157081e3b4 | 22.290566 | 78 | 0.542126 | 3.217935 | false | false | false | false |
cornell-brg/pymtl | pymtl/datatypes/helpers.py | 8 | 3100 | #=======================================================================
# helpers.py
#=======================================================================
'Collection of built-in helpers functions for the PyMTL framework.'
import math
import operator
# NOTE: circular imports between Bits and helpers, using 'impor... | bsd-3-clause | 809f8249273a05703ab01bd73a6d4b4a | 35.470588 | 77 | 0.389355 | 5.354059 | false | false | false | false |
cornell-brg/pymtl | pclib/rtl/arith.py | 8 | 6880 | #=======================================================================
# arith.py
#=======================================================================
'''Collection of translatable arithmetic components.'''
from pymtl import *
#-----------------------------------------------------------------------
# Adder
#---... | bsd-3-clause | cf3bff154323127f2c114006484173f3 | 25.360153 | 72 | 0.376744 | 3.718919 | false | false | false | false |
cornell-brg/pymtl | pclib/rtl/RegisterFile.py | 1 | 3447 | #=======================================================================
# RegisterFile.py
#=======================================================================
from pymtl import *
#-----------------------------------------------------------------------
# RegisterFile
#---------------------------------------------... | bsd-3-clause | 4c8dd735680734692f3c90c0a267949a | 32.144231 | 76 | 0.380621 | 4.07929 | false | false | false | false |
cornell-brg/pymtl | pymtl/tools/deprecated/ast_typer.py | 8 | 9396 | #=========================================================================
# ast_typer.py
#=========================================================================
# Create a simplified representation of the Python AST for help with
# source to source translation.
from __future__ import print_function
import ast, _a... | bsd-3-clause | 826b4d053eab4458b4818f6e44da1d62 | 36.13834 | 81 | 0.495743 | 4.532562 | false | false | false | false |
flutter/buildroot | build/linux/unbundle/remove_bundled_libraries.py | 1 | 3226 | #!/usr/bin/env python3
#
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Removes bundled libraries to make sure they are not used.
See README for more details.
"""
import optparse
import os.path
imp... | bsd-3-clause | 4b4cbac56cb431234a98014f6c403e20 | 30.320388 | 80 | 0.648481 | 3.915049 | false | false | false | false |
flutter/buildroot | build/download_nacl_toolchains.py | 1 | 2159 | #!/usr/bin/env python3
#
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Shim to run nacl toolchain download script only if there is a nacl dir."""
import os
import shutil
import sys
def Main(arg... | bsd-3-clause | 407a36dca2b91adf4dac8cc950e7bca7 | 34.983333 | 77 | 0.685503 | 3.373438 | false | false | false | false |
flutter/buildroot | build/linux/install-chromeos-fonts.py | 1 | 2238 | #!/usr/bin/env python3
#
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Script to install the Chrome OS fonts on Linux.
# This script can be run manually (as root), but is also run as part
# install-bui... | bsd-3-clause | 8e32e69a442e7940292e70f2a38c08ad | 29.243243 | 75 | 0.6479 | 3.116992 | false | false | false | false |
flutter/buildroot | build/toolchain/win/tool_wrapper.py | 1 | 7391 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility functions for Windows builds.
This file is copied to the build directory as part of toolchain setup and
is used to set up calls to tools used ... | bsd-3-clause | 0cbd4136239549e2bf05c8fe158f811d | 37.295337 | 81 | 0.647544 | 3.727181 | false | false | false | false |
flutter/buildroot | build/toolchain/wrapper_utils.py | 1 | 2854 | # Copyright (c) 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Helper functions for gcc_toolchain.gni wrappers."""
import gzip
import os
import re
import subprocess
import shlex
import shutil
import sys
import thre... | bsd-3-clause | 78bbcfd87095446c613161065a4283bd | 38.638889 | 80 | 0.713385 | 3.589937 | false | false | false | false |
flutter/buildroot | build/android/gyp/util/build_utils.py | 1 | 11762 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import ast
import contextlib
import fnmatch
import json
import os
import pipes
import re
import shlex
import shutil
import subprocess
import sys
import tempf... | bsd-3-clause | 86f8d12958b2767c27ec6d3a2daadb1c | 28.331671 | 88 | 0.667148 | 3.541704 | false | false | false | false |
flutter/buildroot | build/download_sdk_extras.py | 1 | 2631 | #!/usr/bin/env python3
#
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Script to download sdk/extras packages on the bots from google storage.
The script expects arguments that specify zips file in t... | bsd-3-clause | e6201e5953f575de22883a2e407ff41a | 35.541667 | 80 | 0.68339 | 3.292866 | false | false | false | false |
matllubos/django-is-core | is_core/generic_views/inlines/inline_form_views.py | 1 | 10444 | from django.forms.formsets import DELETION_FIELD_NAME
from django.utils.translation import ugettext_lazy as _
from django.utils.functional import cached_property
from chamber.utils.forms import formset_has_file_field
from is_core.forms.models import BaseInlineFormSet, smartinlineformset_factory, SmartModelForm
from i... | bsd-3-clause | acade4552327122c27f1853ae356bc41 | 34.40339 | 118 | 0.599196 | 3.963567 | false | false | false | false |
matllubos/django-is-core | is_core/utils/__init__.py | 1 | 14970 | import re
import json
import types
import datetime
from django.core.exceptions import ImproperlyConfigured
from django.contrib.admin.utils import display_for_value as admin_display_for_value
from django.core.serializers.json import DjangoJSONEncoder
from django.db.models import QuerySet
from django.core.exceptions imp... | bsd-3-clause | 81ac81018e0d317b511e587e71d2e45e | 35.601467 | 118 | 0.633801 | 4.000534 | false | false | false | false |
matllubos/django-is-core | is_core/forms/generic.py | 1 | 2883 | from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.forms.models import ModelForm
from django.contrib.contenttypes.forms import BaseGenericInlineFormSet as OriginBaseGenericInlineFormSet
from is_core.forms.models import smartmodelformset_factory
from is_core.forms.formse... | bsd-3-clause | 75548f85149b9644c1b209e97d9c4e33 | 43.353846 | 119 | 0.63753 | 4.154179 | false | false | false | false |
niwinz/django-jinja | django_jinja/views/generic/base.py | 1 | 1148 | from ...base import get_match_extension
class Jinja2TemplateResponseMixin:
jinja2_template_extension = None
def get_template_names(self):
"""
Return a list of template names to be used for the request.
This calls the super class's get_template_names and appends
the Jinja2 matc... | bsd-3-clause | d5aec7d98198208156cac1db6006ad9a | 30.888889 | 83 | 0.622822 | 4.647773 | false | false | false | false |
dask/dask-ml | tests/test_utils.py | 1 | 6640 | from collections import namedtuple
import dask.array as da
import dask.dataframe as dd
import numpy as np
import pandas as pd
import pandas.testing as tm
import pytest
from dask.array.utils import assert_eq as assert_eq_ar
from dask.dataframe.utils import assert_eq as assert_eq_df
from dask_ml.datasets import make_cl... | bsd-3-clause | a9cd60224d6e75e0ccdaef61f650f10e | 27.135593 | 85 | 0.595633 | 3.079777 | false | true | false | false |
andialbrecht/sqlparse | sqlparse/filters/reindent.py | 1 | 9549 | #
# Copyright (C) 2009-2020 the sqlparse authors and contributors
# <see AUTHORS file>
#
# This module is part of python-sqlparse and is released under
# the BSD License: https://opensource.org/licenses/BSD-3-Clause
from sqlparse import sql, tokens as T
from sqlparse.utils import offset, indent
class ReindentFilter:... | bsd-3-clause | ee489a4f7827f01d33bf625a5f518c7b | 38.458678 | 77 | 0.512619 | 3.919951 | false | false | false | false |
andialbrecht/sqlparse | sqlparse/filters/right_margin.py | 1 | 1543 | #
# Copyright (C) 2009-2020 the sqlparse authors and contributors
# <see AUTHORS file>
#
# This module is part of python-sqlparse and is released under
# the BSD License: https://opensource.org/licenses/BSD-3-Clause
import re
from sqlparse import sql, tokens as T
# FIXME: Doesn't work
class RightMarginFilter:
k... | bsd-3-clause | c57fa319940abe657f9447cefdcba6df | 31.145833 | 74 | 0.527544 | 4.262431 | false | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.