text
stringlengths
4
1.02M
meta
dict
import http.client as HTC import json import os import shutil import sys import tempfile import threading import time import traceback from urllib.parse import urlparse import zipfile from qualtrics_api.QualtricsException import QualtricsException class Qualtrics_v3(): def __init__(self, base_uri, api_token): ...
{ "content_hash": "9fb58b58d0a4185e2ef1d85b9615e64d", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 161, "avg_line_length": 45.1796875, "alnum_prop": 0.5678713470517033, "repo_name": "computergeek125/writ3562w_itmrp_survey", "id": "6198db4c7045ca33d46d66de7b7cf1639acfdc6e"...
import screendisplay if __name__ == '__main__': viewport = screendisplay.viewport(800, 600) client = screendisplay.http_client('localhost', 8080) title = screendisplay.title_state() print client.get_teams() print client.get_game_state() print client.get_categories() print client.get_point...
{ "content_hash": "603d20623a6b75f9e1f8c96117c0c5b2", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 57, "avg_line_length": 26, "alnum_prop": 0.6778846153846154, "repo_name": "jordsti/hacker-jeopardy", "id": "7352f3240e343cd1db8632422841278b33228d16", "size": "416", "bin...
import _plotly_utils.basevalidators class ColorscaleValidator(_plotly_utils.basevalidators.ColorscaleValidator): def __init__( self, plotly_name="colorscale", parent_name="scatterternary.marker", **kwargs ): super(ColorscaleValidator, self).__init__( plotly_name=plotly_name, ...
{ "content_hash": "c3b396451495a1296eab23f6f0379617", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 85, "avg_line_length": 37.666666666666664, "alnum_prop": 0.6141592920353982, "repo_name": "plotly/python-api", "id": "53f26bbfff8f8001195b9af7bf2a486218b5a46d", "size": "56...
from electrum_ltc.i18n import _ fullname = _('LabelSync') description = ' '.join([ _("Save your wallet labels on a remote server, and synchronize them across multiple devices where you use Electrum."), _("Labels, transactions IDs and addresses are encrypted before they are sent to the remote server.") ]) avail...
{ "content_hash": "b5014f61508cdc48c82fca9120cd4db8", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 122, "avg_line_length": 40.55555555555556, "alnum_prop": 0.7041095890410959, "repo_name": "pooler/electrum-ltc", "id": "65868893279f6d983b06db51dc06fb4cce3600ad", "size": "3...
"""uploads persistent global Revision ID: f0b00081fda9 Revises: 77e8971ffcbf Create Date: 2017-08-24 17:06:36.121932 """ from alembic import op import sqlalchemy as sa from docassemble.webapp.database import dbtableprefix # revision identifiers, used by Alembic. revision = 'f0b00081fda9' down_revision = '77e8971ffcb...
{ "content_hash": "248ae4a90d107c8178d48b868d0317e4", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 108, "avg_line_length": 28.03846153846154, "alnum_prop": 0.7421124828532236, "repo_name": "jhpyle/docassemble", "id": "52cb57c7056bddc9fc765bed5eeb004e03297d05", "size": "7...
""" Copyright (c) 2011, Daniele Esposti <expo@expobrain.net> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list o...
{ "content_hash": "af3ee1a0b3f7efa8e1fd840c8f9ab619", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 79, "avg_line_length": 52.13157894736842, "alnum_prop": 0.7698132256436143, "repo_name": "CharlesZhong/Mobile-Celluar-Measure", "id": "525061be4fc9346e27a5a62a03afda0bbbac190...
from oslo_config import cfg from neutron._i18n import _ from neutron.agent.linux import external_process from neutron.agent.linux import keepalived from neutron.agent.linux import utils from neutron.tests import base from neutron.tests.functional.agent.linux import helpers from neutron.tests.unit.agent.linux import te...
{ "content_hash": "6289d227a23435b8d205f94956b4a0bb", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 75, "avg_line_length": 38.98837209302326, "alnum_prop": 0.646585147628989, "repo_name": "MaximNevrov/neutron", "id": "8bc9c23afe341fa0bb943b1e706bf42ade808069", "size": "39...
""" Process raw qstr file and output qstr data with length, hash and data bytes. This script works with Python 2.6, 2.7, 3.3 and 3.4. """ from __future__ import print_function import re import sys # Python 2/3 compatibility: # - iterating through bytes is different # - codepoint2name lives in a different module...
{ "content_hash": "afb43e9aa5ae653a657fa9955bb571a7", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 112, "avg_line_length": 34.87261146496815, "alnum_prop": 0.5726027397260274, "repo_name": "misterdanb/micropython", "id": "c00ec1eb28fcd487b24af76f1aee217986b7d526", "size...
""" Originally lifted from various files at: https://bitbucket.org/Jeffrey/gevent-websocket/src/fabf03111c73/geventwebsocket """ from errno import EINTR from hashlib import md5, sha1 from socket import error as socket_error from threading import Semaphore from urllib import quote import base64 import re import stru...
{ "content_hash": "3dcb9af2fe177ceac0f4522e740504db", "timestamp": "", "source": "github", "line_count": 723, "max_line_length": 113, "avg_line_length": 30.821576763485478, "alnum_prop": 0.53338718362951, "repo_name": "mikeboers/Nitrogen", "id": "c7efaa4c15c456605c583b8f91b326097d5120da", "size": "2...
"""Self-updating from GitHub. .. versionadded:: 1.9 .. note:: This module is not intended to be used directly. Automatic updates are controlled by the ``update_settings`` :class:`dict` passed to :class:`~workflow.workflow.Workflow` objects. """ import json import os import re import subprocess import tem...
{ "content_hash": "24489609296c351566b26d7a3f5969a3", "timestamp": "", "source": "github", "line_count": 570, "max_line_length": 87, "avg_line_length": 28.808771929824562, "alnum_prop": 0.5566652457219414, "repo_name": "Tam-Lin/julian_date", "id": "dc40c4b6bd9a2e2e2bdd5186ffc6d2837177d765", "size": ...
"""Gradients for operators defined in array_ops.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import ops from tensorflow.python.framework import tensor_util from tensorflow.python.ops import array_ops from tensorflo...
{ "content_hash": "ff546dc6a882590ac57bd20573c56f41", "timestamp": "", "source": "github", "line_count": 258, "max_line_length": 79, "avg_line_length": 33.616279069767444, "alnum_prop": 0.6566355355701603, "repo_name": "miyosuda/intro-to-dl-android", "id": "e3526d32c419922fd43c65d19cbe4a8dad57af2e", ...
from .prod_settings import *
{ "content_hash": "8742b6c2f65b5dbf5ae01faf18b1ba8c", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 28, "avg_line_length": 29, "alnum_prop": 0.7586206896551724, "repo_name": "hemor/tursh", "id": "d94be0589a6c5b59b1f44058101f73adf2b8c42a", "size": "29", "binary": false, ...
import abc import mock import pytest from addons.base.tests.utils import MockFolder from django.utils import timezone from framework.auth import Auth from framework.exceptions import HTTPError from nose.tools import (assert_equal, assert_false, assert_in, assert_is, assert_is_none, assert_not_i...
{ "content_hash": "3e307b07f7d67f7a406591cf106e6123", "timestamp": "", "source": "github", "line_count": 686, "max_line_length": 111, "avg_line_length": 35.75072886297376, "alnum_prop": 0.6358817533129459, "repo_name": "HalcyonChimera/osf.io", "id": "438ad8187562a955ffc67b68e279983eeabd0899", "size"...
import inspect import os import sys from functools import wraps from os import getenv from smtplib import SMTPRecipientsRefused from django.conf import settings from django.core.cache import cache from django.core.management import call_command from django.test import LiveServerTestCase, TestCase as OriginalTestCase f...
{ "content_hash": "0063498cc142250a0af0f6bb7bf84ec0", "timestamp": "", "source": "github", "line_count": 277, "max_line_length": 79, "avg_line_length": 33.00361010830325, "alnum_prop": 0.6257930430977904, "repo_name": "silentbob73/kitsune", "id": "79b48e4b0ce83b64f91ae2580e278014fbce3d77", "size": "...
from __future__ import division, absolute_import, print_function import os import re import sys import copy import glob import atexit import tempfile import subprocess import shutil import multiprocessing import textwrap import distutils from distutils.errors import DistutilsError try: from threading import local...
{ "content_hash": "03a92c256c4505bd13dad39a4fb70670", "timestamp": "", "source": "github", "line_count": 2371, "max_line_length": 102, "avg_line_length": 35.68494306199916, "alnum_prop": 0.54495384651751, "repo_name": "MSeifert04/numpy", "id": "7ba8ad862e97ab9bce0d02de3f471ec35240e083", "size": "846...
import functools import re import jsonschema from jsonschema import exceptions as jsonschema_exc import six from zvmsdk import exception def _schema_validation_helper(schema, target, args, kwargs, is_body=True): schema_validator = _SchemaValidator( schema, is_body=is_body) schema_validator.validate(...
{ "content_hash": "c4ffdebed21af677d7967acfe40a7c94", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 79, "avg_line_length": 33.60283687943262, "alnum_prop": 0.5341916420430561, "repo_name": "mfcloud/python-zvm-sdk", "id": "95db56dada7f888af5cd7a4316579e1c8f0b7165", "size"...
import contextlib import mock from oslo.config import cfg from neutron.api.v2 import attributes from neutron.common.test_lib import test_config from neutron import context from neutron.extensions import agent from neutron.plugins.vmware.api_client.version import Version from neutron.plugins.vmware.common import sync ...
{ "content_hash": "c3e49bdaba7775084151ab6674adb8a6", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 78, "avg_line_length": 47.60629921259842, "alnum_prop": 0.6313264968574264, "repo_name": "sajuptpm/neutron-ipam", "id": "af7125c6893cbba4263450c0ae9120f4c5be9d4c", "size":...
__docformat__='restructuredtext' from popserver.lib.base import * class TemplateController(BaseController): def view(self, url): """By default, the final controller tried to fulfill the request when no other routes match. It may be used to display a template when all else fails, e.g.:: ...
{ "content_hash": "ff99fa77c5502300f506aa561f5133f0", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 72, "avg_line_length": 31.75, "alnum_prop": 0.5838020247469067, "repo_name": "santisiri/popego", "id": "8c6ff07e396248049e13d2c9bd73ee8bcd006aa7", "size": "913", "binary"...
import numpy as np import pandas as pd from scipy.stats import kendalltau from utils.gradings import get_gradings def borda_ordering(rankings): n, k = rankings.shape borda_scores = np.zeros(n) for ranking in rankings: for idx, paper in enumerate(ranking): borda_scores[pape...
{ "content_hash": "0fd0410ed2d2576858273a2e22aacba8", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 97, "avg_line_length": 29.125, "alnum_prop": 0.619098712446352, "repo_name": "haoyueping/peer-grading-for-MOOCs", "id": "07937fd9b60588c8a5e42b099456f7a6b4a68284", "size": ...
import sys from pdfminer.pdfdocument import PDFDocument from pdfminer.pdfparser import PDFParser from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter from pdfminer.pdfdevice import PDFDevice, TagExtractor from pdfminer.pdfpage import PDFPage from pdfminer.converter import XMLConverter, HTMLConverter, T...
{ "content_hash": "68966f0b39e19f2c78e5e23b4af2022c", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 114, "avg_line_length": 36.669724770642205, "alnum_prop": 0.5669251938954216, "repo_name": "diverted247/signer", "id": "2652ec34ee5d75fdf9d5e91be8c61e3982bbca97", "size": ...
class UniquenessError(ValueError): def __init__(self, index_name): ValueError.__init__(self, index_name) class NotFoundError(KeyError): pass
{ "content_hash": "be122633baac513ebc10f4531f661282", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 45, "avg_line_length": 22.714285714285715, "alnum_prop": 0.6729559748427673, "repo_name": "fictorial/python-object-persistence", "id": "e9224fc9d93e1b11c5a9a3e8767f4d4a54b0d39...
from tardis.tardis_portal.staging import get_full_staging_path """ test_views.py http://docs.djangoproject.com/en/dev/topics/testing/ .. moduleauthor:: Russell Sim <russell.sim@monash.edu> .. moduleauthor:: Steve Androulakis <steve.androulakis@monash.edu> """ import json from urlparse import urlparse from compare...
{ "content_hash": "c525b31d0a6afb7eecf36b2d52c760a9", "timestamp": "", "source": "github", "line_count": 733, "max_line_length": 151, "avg_line_length": 38.94815825375171, "alnum_prop": 0.578899436057305, "repo_name": "steveandroulakis/mytardis", "id": "56f4014bd7273625774ae6d922d778c2ec78062e", "si...
from django.db import models import datetime from django.contrib.auth.models import User from django.core.validators import MaxValueValidator, MinValueValidator import arrow # Create your models here. class Purchase(models.Model): def __unicode__(self): return unicode(self.purchase_date) class Meta: ...
{ "content_hash": "1353839b4acada57195435cff3ab0d97", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 122, "avg_line_length": 34.15217391304348, "alnum_prop": 0.7135582431572247, "repo_name": "artsturdevant/425supplemental_material", "id": "3355b961dcc60d502f50736c71b4dcc9a44...
import random try: from urllib.parse import urlparse, parse_qs except ImportError: from urlparse import urlparse, parse_qs import warnings import json from django.test.utils import override_settings from django.test import TestCase from django.core.urlresolvers import reverse from django.contrib.sites.models i...
{ "content_hash": "50fca8651bb6300121092ad46dd285da", "timestamp": "", "source": "github", "line_count": 247, "max_line_length": 88, "avg_line_length": 39.8582995951417, "alnum_prop": 0.5518537328593195, "repo_name": "JoshLabs/django-allauth", "id": "b936059872f3787d821d1266c37f627d44f1e4b0", "size"...
from UserDict import DictMixin __all__ = ['OrderedDict'] class OrderedDict(dict, DictMixin): '''Drop-in substitute for Py2.7's new collections.OrderedDict. The recipe has big-oh performance that matches regular dictionaries (amortized O(1) insertion/deletion/lookup and O(n) iteration/repr/copy/equality_testing). ...
{ "content_hash": "ca8f880e6e5102c9b0e89dfa54fd495d", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 89, "avg_line_length": 29.205607476635514, "alnum_prop": 0.53216, "repo_name": "strogo/djpcms", "id": "f3a0c9cbb3a19bf15947761caedcbb612d055806", "size": "3125", "binary...
from pyrates.utility import plot_timeseries, create_cmap from pyrates.ir import CircuitIR import numpy as np import matplotlib.pyplot as plt from scipy.ndimage.filters import gaussian_filter1d import matplotlib as mpl plt.style.reload_library() plt.style.use('ggplot') mpl.rcParams['lines.linewidth'] = 2 mpl.rcParams['a...
{ "content_hash": "9025eb78586522addea98de566fda6d9", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 106, "avg_line_length": 33.63636363636363, "alnum_prop": 0.6497297297297298, "repo_name": "Richert/BrainNetworks", "id": "eeb4546eaae46d37742f4939f3e2141b61a2bfab", "size":...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/lair/borgle/shared_lair_borgle.iff" result.attribute_template_id = -1 result.stfName("lair_n","borgle") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "28d5a856eab798816ab364b397e144df", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 71, "avg_line_length": 22.692307692307693, "alnum_prop": 0.688135593220339, "repo_name": "anhstudios/swganh", "id": "408bc740a42900250f5f90d0b269d2f2825aec21", "size": "440...
import numpy as np from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext cmdclass = {} ext_modules = [ Extension( "utils.cython_bbox", ["utils/bbox.pyx"], ) ] cmdclass.update({'build_ext': build_ext}) setup( name='fast_dbox', ...
{ "content_hash": "9fa8394592698db0b3305ff4cf2652eb", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 41, "avg_line_length": 20.3, "alnum_prop": 0.6724137931034483, "repo_name": "weichengkuo/DeepBox", "id": "cdaf7962a0db0da7d326f5732ec04ac7ad8d92c0", "size": "881", "binar...
from oslo_config import cfg from monasca_notification.conf import types _POSTGRESQL = 'postgresql' _MYSQL = 'mysql' _ORM = 'orm' _REPO_DRIVERS_MAP = { _POSTGRESQL: 'monasca_notification.common.repositories.' 'postgres.pgsql_repo:PostgresqlRepo', _MYSQL: 'monasca_notification.common.repositori...
{ "content_hash": "d86d95e7da6d53fc13998647a0f3e312", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 79, "avg_line_length": 40.87826086956522, "alnum_prop": 0.5728568389704318, "repo_name": "stackforge/monasca-notification", "id": "2a654f2a6664aa889f0a7c6a70c8d62190bedbfe",...
from PyQt5 import QtCore, QtGui, QtQuick import squircle_renderer class Squircle( QtQuick.QQuickItem ): tChanged = QtCore.pyqtSignal() def __init__( self, parent=None ): super().__init__( parent ) self.renderer = None self._t = 0.0 self.windowChanged.connect( self.handleWindo...
{ "content_hash": "4ea409bdd8d39bb5a8723d09128aa341", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 101, "avg_line_length": 32.06818181818182, "alnum_prop": 0.6158752657689582, "repo_name": "Upcios/PyQtSamples", "id": "069042d4b4f3e6b64ab315326936999b5438f2a4", "size": "1...
""" License: BSD (c) 2009 ::: www.CodeResort.com - BV Network AS (simon-code@bvnetwork.no) """ import unittest import os import shutil import urllib2 from tracrpc.json_rpc import json from tracrpc.util import StringIO from tracrpc.tests import rpc_testenv, TracRpcTestCase class JsonModuleAvailabilityTestCase(...
{ "content_hash": "8dadc7b0e7591ea291d639a5d9d36ae1", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 84, "avg_line_length": 44.67420814479638, "alnum_prop": 0.5404638914210473, "repo_name": "Puppet-Finland/trac", "id": "919292769b85659f383a455d730631f201100bd1", "size": "...
from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='ProgrammingLanguage', fields=[ ('id', models.AutoField(auto...
{ "content_hash": "62e34cd23899ffc43bb3e5fbc3499769", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 150, "avg_line_length": 39.21739130434783, "alnum_prop": 0.5554323725055432, "repo_name": "timkofu/gitstars", "id": "76cff0108176f919c6c2b6f2e8298a52d1d7c940", "size": "185...
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Difference'] , ['LinearTrend'] , ['BestCycle'] , ['NoAR'] );
{ "content_hash": "babf4c23424bd4ac098890699b8c9488", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 83, "avg_line_length": 39, "alnum_prop": 0.7115384615384616, "repo_name": "antoinecarme/pyaf", "id": "79b10bf5e016079aa1b178ba4c0384981d02ed80", "size": "156", "binary": f...
import MySQLdb class mysql: """mysql is an interface to the sql library and specifically simplifies the steps of returning objects from a call to a mysql database Parameters ---------- host: string host name of mysql database dbname: string name of mysql databas...
{ "content_hash": "edbeb36825b3dd33ff78c85e89650538", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 78, "avg_line_length": 24.21897810218978, "alnum_prop": 0.5427968655816757, "repo_name": "dr-jpk/saltefficiency", "id": "c8f6420c986a82d771e6dfec98fe885ebb104133", "size":...
from setuptools import setup # Always prefer setuptools over distutils setup(name='hiveplot', long_description='A utility for making hive plots in matplotlib.', version='0.1.7.4', py_modules=['hiveplot'], url='https://github.com/ericmjl/hiveplot', author='Eric J. Ma', email='ericmajin...
{ "content_hash": "1079523c12587cdbc7d72f8d81c91108", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 71, "avg_line_length": 35.583333333333336, "alnum_prop": 0.6651053864168618, "repo_name": "aeron15/hiveplot", "id": "ef5b9d89c9a50257df18b6797ecc50d017db624b", "size": "427...
import requests from bs4 import BeautifulSoup from django.core.files.storage import default_storage from parser import ListSubjectsParser, SubjectParser, StudentParser from sippa.settings import BASE_AWS_URL class SIPPAWrapper(object): START_URL = 'https://sistemas.quixada.ufc.br/sippa/' CAPTCHA_URL = 'http...
{ "content_hash": "7405edbcfd7778a606bb6fab7b6a519c", "timestamp": "", "source": "github", "line_count": 275, "max_line_length": 116, "avg_line_length": 38.60727272727273, "alnum_prop": 0.4877083922011868, "repo_name": "luissiqueira/sippa-no-api", "id": "49d38cdc873f95a948a59ad09b3f10ec013bf6f7", "s...
import doctest import os import re import types import time import unittest from functools import partial # Python 2.7: _WritelnDecorator moved. try: from unittest import _WritelnDecorator except ImportError: from unittest.runner import _WritelnDecorator import six from six import StringIO as IO import nose fr...
{ "content_hash": "041263bc5a230f7a7cb8abe9ea3faf40", "timestamp": "", "source": "github", "line_count": 508, "max_line_length": 101, "avg_line_length": 32.68700787401575, "alnum_prop": 0.5448358928033725, "repo_name": "marcoantoniooliveira/labweb", "id": "0aa5387e2e9051112dce9884a66f6cd4f5327bc2", ...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'EcobasaCommunityProfile.website' db.alter_column(u'ecobasa_ecobasacommunitypro...
{ "content_hash": "13d8359c70c8e6bc4fad812aca00f986", "timestamp": "", "source": "github", "line_count": 288, "max_line_length": 239, "avg_line_length": 88.14583333333333, "alnum_prop": 0.5627117308752856, "repo_name": "ecobasa/ecobasa", "id": "ec66ad0304ce8cc1c8696177a4ef0b63af197ee3", "size": "254...
"""A simple MNIST classifier which displays summaries in TensorBoard. This is an unimpressive MNIST model, but it is a good example of using tf.name_scope to make a graph legible in the TensorBoard graph explorer, and of naming summary tags so that they are grouped meaningfully in TensorBoard. It demonstrates the fu...
{ "content_hash": "80dba5b93a0cf0953ca868f62526481b", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 80, "avg_line_length": 40.20942408376963, "alnum_prop": 0.6475260416666667, "repo_name": "simpleig/FCN-semantic-segmentation", "id": "7fd5bde58dd35a6840a4a4628dcda95acc7eba4...
import logging import re logger = logging.getLogger(__name__) class Extention(object): enabled=False ##ident="plugin_ident" @classmethod def get_url_re(cls): return re.compile('^https://some/url') def __init__(self, url, *args, **kwargs): self.url = url def start(self, url...
{ "content_hash": "c0c4412cc0a53cd42896fa30ce2ac62a", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 46, "avg_line_length": 16.8, "alnum_prop": 0.5952380952380952, "repo_name": "procool/myvdl", "id": "d2dd33615c4aeac022aadb9253d46f9b4e664fa2", "size": "336", "binary": fa...
""" This script is an example of how to use the L1 optimization reconstruction module (regularized regression scheme). |br| Firstly, a multitone signal is generated. The signal model is as follows. There are three random tones randomly distributed in the frequency domain from 5kHz to 100kHz. o...
{ "content_hash": "dd7ec7e7c595c8431566ab89edede155", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 100, "avg_line_length": 41.92356687898089, "alnum_prop": 0.5177757520510483, "repo_name": "JacekPierzchlewski/RxCS", "id": "64a52970e10907880916c81028d9d2f43b0c519b", "siz...
import os import glob def get_dirs(config): dirs = [] for entry in config.locations_dashboards: if entry == '**builtins**': entry = os.path.join(os.path.dirname(__file__), 'templates/dashboards') dirs.append(entry) return dirs def list_dashboards(config): dashboards = [] ...
{ "content_hash": "a0c7a07f19f39e6afd8499fe6efe5485", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 83, "avg_line_length": 26.3, "alnum_prop": 0.623574144486692, "repo_name": "vimeo/graph-explorer", "id": "3b03d34187beaf3313c2bda803f3b84cce14948b", "size": "526", "binar...
import sys if (sys.version_info[0] == 2 and sys.version_info[:2] >= (2,7)) or \ (sys.version_info[0] == 3 and sys.version_info[:2] >= (3,2)): import unittest else: import unittest2 as unittest import subprocess import shutil import time import os import signal import py2app import hashlib DIR_NAME=os....
{ "content_hash": "6bcd4d7c640c6e32693b7b8a06146aee", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 79, "avg_line_length": 29.85217391304348, "alnum_prop": 0.5563646956015147, "repo_name": "metachris/py2app", "id": "d3ac7cab95ca89e2acb5ee30db9005ee116440ea", "size": "343...
from diptest import dip import numpy as np def test_can_run_diptest(): assert dip(np.random.rand(1000))
{ "content_hash": "7d99b0f7b0f179c8c17c863baebe6417", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 36, "avg_line_length": 18.333333333333332, "alnum_prop": 0.7272727272727273, "repo_name": "paninski-lab/yass", "id": "5770c223889f70308395afc10c78a4c13a6dc40f", "size": "110...
import codecs import cStringIO as StringIO import csv import os import re import zipfile import gtfsfactory as gtfsfactory_module import problems import util class Loader: def __init__(self, feed_path=None, schedule=None, problems=problems.default_problem_reporter, ...
{ "content_hash": "0eec158204a5ac229cabafc37538c7dc", "timestamp": "", "source": "github", "line_count": 578, "max_line_length": 81, "avg_line_length": 39.82006920415225, "alnum_prop": 0.6014946124435175, "repo_name": "jonpetersen/transitfeed-1.2.12", "id": "a1fa63f947d9b36645c630fe641f93b80a873a9f", ...
from openerp.osv import fields, osv from openerp.tools.translate import _ import re from openerp.exceptions import UserError class crm_lead2opportunity_partner(osv.osv_memory): _name = 'crm.lead2opportunity.partner' _description = 'Lead To Opportunity Partner' _inherit = 'crm.partner.binding' _columns...
{ "content_hash": "c7719b1b4844463965506afc3833251e", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 187, "avg_line_length": 49.81297709923664, "alnum_prop": 0.5930580032181442, "repo_name": "vileopratama/vitech", "id": "b08d8445b3dafec77c8df41e912ed04305de767a", "size": ...
''' VKeyboard ========= .. image:: images/vkeyboard.jpg :align: right .. versionadded:: 1.0.8 VKeyboard is an onscreen keyboard for Kivy. Its operation is intended to be transparent to the user. Using the widget directly is NOT recommended. Read the section `Request keyboard`_ first. Modes ----- This virtual ...
{ "content_hash": "33593091c571f6b8cc5d27e563e4c594", "timestamp": "", "source": "github", "line_count": 871, "max_line_length": 79, "avg_line_length": 35.21239954075775, "alnum_prop": 0.5942614933159439, "repo_name": "inclement/kivy", "id": "68aa261160341183580591fe749f5a0a05f07cf0", "size": "30670...
from __future__ import absolute_import, print_function import functools from django.core.cache import cache default_cache = cache class memoize(object): """ Memoize the result of a property call. >>> class A(object): >>> @memoize >>> def func(self): >>> return 'foo' """...
{ "content_hash": "f50941cb3553e64a7fd4c52e48791dee", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 77, "avg_line_length": 25.054054054054053, "alnum_prop": 0.5329018338727076, "repo_name": "mvaled/sentry", "id": "7691f9212da56a0b8930adead417ba9bdf30a996", "size": "1854",...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes...
{ "content_hash": "3607147881907b023c0baad5cd5bde9d", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 76, "avg_line_length": 41.083333333333336, "alnum_prop": 0.5192697768762677, "repo_name": "Azure/azure-sdk-for-python", "id": "4d57613725089ebd7592cb2d81a6aa83a3cf60e0", "s...
import os import sys from glob import glob sys.path.insert(0, os.path.abspath('lib')) from battleschool import __version__, __author__ from distutils.core import setup # find library modules from battleschool.constants import DIST_MODULE_PATH long_description = """ Development environment provisioning using ansible ...
{ "content_hash": "f5e7835a15f7d2b5df64141616e0c878", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 104, "avg_line_length": 33.301587301587304, "alnum_prop": 0.6348903717826502, "repo_name": "wchrisjohnson/battleschool", "id": "559993b0493d2e5eb78dbf8ed8501dfea152debb", "...
import copy import random from core import actor from core.actor import * def load_data(): Cloud.master_animation_list.build_animation('Idle', ['cloud']) CloudSmall.master_animation_list.build_animation('Idle', ['cloud1']) IslandBig.master_animation_list.build_animation('Idle', ['island01']) IslandSm...
{ "content_hash": "c7d8eb6c32b9af6c469b05af351dfcf9", "timestamp": "", "source": "github", "line_count": 376, "max_line_length": 184, "avg_line_length": 34.61436170212766, "alnum_prop": 0.6054552439492893, "repo_name": "JSkelly/TroubleInCloudLand", "id": "de89198dd293b80c5cea0396450278f8faf60f27", "...
''' Support for APT (Advanced Packaging Tool) .. important:: If you feel that Salt should be using this module to manage packages on a minion, and it is using a different module (or gives an error similar to *'pkg.install' is not available*), see :ref:`here <module-provider-override>`. .. note:: F...
{ "content_hash": "841950c3586de6755d6b937cc0919b73", "timestamp": "", "source": "github", "line_count": 2334, "max_line_length": 96, "avg_line_length": 33.81790916880891, "alnum_prop": 0.5325410801839582, "repo_name": "stephane-martin/salt-debian-packaging", "id": "9a7d07177397ad51b1bac2b42e82b3c9843...
import os # try/except added for compatibility with python < 3.8 try: from unittest import mock from unittest.mock import AsyncMock # pragma: NO COVER except ImportError: # pragma: NO COVER import mock import math from google.api_core import ( future, gapic_v1, grpc_helpers, grpc_helper...
{ "content_hash": "cb972080e5d1e600e8a16c0f86aca384", "timestamp": "", "source": "github", "line_count": 2410, "max_line_length": 124, "avg_line_length": 35.76307053941909, "alnum_prop": 0.6388634280476627, "repo_name": "googleapis/python-appengine-admin", "id": "e7095b9544e7728dbfdaed504d67acded4ce4b...
""" SQS Message Processing =============== """ import base64 import json import logging import traceback import zlib import six from .email_delivery import EmailDelivery from .sns_delivery import SnsDelivery DATA_MESSAGE = "maidmsg/1.0" class MailerSqsQueueIterator(object): # Copied from custodian to avoid ru...
{ "content_hash": "12b93e95b35750ef54f2a12c5bfc8623", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 100, "avg_line_length": 44.02824858757062, "alnum_prop": 0.6355703836776594, "repo_name": "taohungyang/cloud-custodian", "id": "898e1acb3099bce00eabb9f6a1402422987b133d", ...
""" command line options, ini-file and conftest.py processing. """ import argparse import shlex import traceback import types import warnings import py # DON't import pytest here because it causes import cycle troubles import sys, os import _pytest._code import _pytest.hookspec # the extension point definitions from ...
{ "content_hash": "f36830f76c1127757d4723aee3175735", "timestamp": "", "source": "github", "line_count": 1187, "max_line_length": 106, "avg_line_length": 37.70935130581297, "alnum_prop": 0.5656486673666808, "repo_name": "Bachmann1234/pytest", "id": "70e19b1d1a4774fd9fe06a17c6cb3a65e3092f26", "size":...
print "Hello World" print "Something Else" for i in range(10): print i
{ "content_hash": "87265ee9574ace22e89fe0550505aa8f", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 22, "avg_line_length": 10.857142857142858, "alnum_prop": 0.6842105263157895, "repo_name": "kchon/Pynet_lessons", "id": "9b0ed221bfc50c457093a766423d11e9be1b23ef", "size": "7...
import scrapy from report_crawler.spiders.__Global_function import get_localtime from report_crawler.spiders.__Global_variable import now_time, end_time class SCU001_Spider(scrapy.Spider): name = 'SCU001' start_urls = ['http://cs.scu.edu.cn/cs/xsky/xskb/H951901index_1.htm'] domain = 'http://cs.scu.edu.cn/' counts...
{ "content_hash": "53137322f2facc9c9641f389cae31fcf", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 107, "avg_line_length": 37.06060606060606, "alnum_prop": 0.6549468520032706, "repo_name": "HeadCow/ARPS", "id": "27732f9cc3e8c7fb0de9972e20edb804c3a889db", "size": "1280", ...
from __future__ import absolute_import, unicode_literals from django import forms from django.test import TestCase from wagtail.tests.testapp.models import FormField, FormPage from wagtail.wagtailcore.models import Page from wagtail.wagtailforms.forms import FormBuilder class TestFormBuilder(TestCase): def setU...
{ "content_hash": "1d67bea2732c9bdefaead3601d394c5d", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 108, "avg_line_length": 37.66206896551724, "alnum_prop": 0.596044680461454, "repo_name": "Toshakins/wagtail", "id": "603110d188dd5fb4bc1bfeeece3a111aefe11558", "size": "54...
from sklearn2sql_heroku.tests.regression import generic as reg_gen reg_gen.test_model("SGDRegressor" , "freidman3" , "duckdb")
{ "content_hash": "7c3b31612f912d51c6761aa535d1b643", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 66, "avg_line_length": 32.25, "alnum_prop": 0.7674418604651163, "repo_name": "antoinecarme/sklearn2sql_heroku", "id": "cef93f93a863fca9b696895e8026f80970f54f69", "size": "12...
import logging import asyncio import sys import os from bumble.hci import * from bumble.controller import * from bumble.host import * from bumble.device import * from bumble.transport import * from bumble.link import * from bumble.transport import open_transport_or_link # --------------------------------------------...
{ "content_hash": "195ba0135c7c6d4991bec752447dbb4a", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 119, "avg_line_length": 35.357142857142854, "alnum_prop": 0.6137373737373737, "repo_name": "google/bumble", "id": "d8295d4f0689252304d3b4f48c712d3ee2c7c47c", "size": "3227"...
from __future__ import absolute_import from linode.objects import Base, Property class Kernel(Base): api_endpoint="/linode/kernels/{id}" properties = { "created": Property(is_datetime=True), "deprecated": Property(filterable=True), "description": Property(), "id": Property(ide...
{ "content_hash": "5bb7568bafc5a37d84d535843d5d3de4", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 50, "avg_line_length": 31.42105263157895, "alnum_prop": 0.628140703517588, "repo_name": "jo-tez/python-linode-api", "id": "4634e7fd1e01005740353935e6b27f2a4d5675f6", "size"...
from __future__ import unicode_literals import unittest from mopidy_tunein import Extension class ExtensionTest(unittest.TestCase): def test_get_default_config(self): ext = Extension() config = ext.get_default_config() self.assertIn('[tunein]', config) self.assertIn('enabled =...
{ "content_hash": "cf92674440eec9c16266d7200d40a084", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 47, "avg_line_length": 21.08695652173913, "alnum_prop": 0.6474226804123712, "repo_name": "keinstein/mopidy-tunein", "id": "62998800a7840e4c5eedab6a3df1e5188fab7aa3", "size"...
''' 网易云音乐 Player ''' # Let's make some noise import subprocess import threading import random import time import os import signal from ui import Ui # carousel x in [left, right] carousel = lambda left, right, x: left if (x>right) else (right if x<left else x) class Player: def __init__(self, ui_instance): ...
{ "content_hash": "25dc5b542eeee578fa8ea0bd97ec1054", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 150, "avg_line_length": 34.76158940397351, "alnum_prop": 0.5524861878453039, "repo_name": "fffonion/NetEase-MusicBox", "id": "4dadd7eb4ce380b5797b132a20832ee5ec7cdae4", "s...
from __future__ import (absolute_import, division, print_function) from ranger.colorschemes.default import Default from ranger.gui.color import ( black, red, green, yellow, blue, magenta, cyan, white, default, normal, bold, reverse, default_colors, ) class Scheme(Default): progress_bar_color = white ...
{ "content_hash": "007fd866657ac8f8f3bc44f04aa77976", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 66, "avg_line_length": 26.78723404255319, "alnum_prop": 0.4980142970611596, "repo_name": "godo-/dotfiles", "id": "f5a4df65705e9c16463b62b5d6f5871b4a1faf11", "size": "1518",...
import sys from typing import Any, Callable, Dict, Iterable, Optional, TypeVar import urllib.parse from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, map_error, ) from azure.core.paging import I...
{ "content_hash": "b84a4b18f3b4be6e7da9f10db8874482", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 111, "avg_line_length": 40.3051948051948, "alnum_prop": 0.6307394876752054, "repo_name": "Azure/azure-sdk-for-python", "id": "0702969eca88c314b315c10f9219a9d0cf6b4e2d", "s...
from pyinsect.documentModel.comparators import SimilarityNVS, Union from pyinsect.documentModel.representations.DocumentNGramGraph import DocumentNGramGraph from tests.base import BaseTestCase class DocumentNGramGraphTestCase(BaseTestCase): def setUp(self): super().setUp() self.ngg1 = DocumentNGr...
{ "content_hash": "982a26ec98c0135bb8d4dbf5676c4c48", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 88, "avg_line_length": 32.09090909090909, "alnum_prop": 0.6893295561850803, "repo_name": "ggianna/PyINSECT", "id": "4eb95b38d3bc8ff01220421500d21c9cd1885c84", "size": "1059...
__author__ = 'ddurando' """ POX component - arpnat The aim of this component is to address the problem of ARP poisoning in SDN networks """ from pox.core import core import pox.openflow.libopenflow_01 as of from pox.lib.packet.ethernet import ethernet, ETHER_BROADCAST from pox.lib.revent import * from pox.lib.packet....
{ "content_hash": "9ac60668f7874021ba56c695df5d67bb", "timestamp": "", "source": "github", "line_count": 269, "max_line_length": 167, "avg_line_length": 39.43494423791822, "alnum_prop": 0.5266779788838613, "repo_name": "ddurando/my_pox", "id": "6e9aaea599d7197acbcbb3af8eef4389db196bda", "size": "106...
from google.cloud import clouddms_v1 async def sample_get_connection_profile(): # Create a client client = clouddms_v1.DataMigrationServiceAsyncClient() # Initialize request argument(s) request = clouddms_v1.GetConnectionProfileRequest( name="name_value", ) # Make the request res...
{ "content_hash": "f805f834eb889eef355c1d36e802051f", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 82, "avg_line_length": 26.94736842105263, "alnum_prop": 0.736328125, "repo_name": "googleapis/python-dms", "id": "8204812a6d8ba5d0a4c9f1960585de0681623c37", "size": "1921",...
try: from functools import cached_property # type: ignore except ImportError: cached_property = None from aiven.client.argx import arg, CommandLineTool from typing import Callable, List, NoReturn class TestCLI(CommandLineTool): __test__ = False # to avoid PytestCollectionWarning @arg() def xxx...
{ "content_hash": "a1703aac211118317b7af661d29e3559", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 110, "avg_line_length": 22.068181818181817, "alnum_prop": 0.5901132852729145, "repo_name": "aiven/aiven-client", "id": "47207f59b3f5ba257670eaba7d8425ca7340fdf6", "size": "...
from pyqtgraph.Qt import QtGui, QtCore import numpy as np from pyqtgraph.Point import Point import pyqtgraph.debug as debug import weakref import pyqtgraph.functions as fn from GraphicsWidget import GraphicsWidget __all__ = ['AxisItem'] class AxisItem(GraphicsWidget): def __init__(self, orientation, pen=None, link...
{ "content_hash": "12c8fe0da59563a3d3a2425e33059b72", "timestamp": "", "source": "github", "line_count": 561, "max_line_length": 130, "avg_line_length": 37.839572192513366, "alnum_prop": 0.5457885811192764, "repo_name": "robertsj/poropy", "id": "bd72561fd325bc9f55d9f0a39b92329b1e588c5b", "size": "21...
import csv import os class Ngrams(object): def __init__(self): pass def result(self, number): result = [] with open('{0}/ngrams/ngrams{1}.csv'.format(os.getcwd(), number), 'rb') as csvfile: spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|') for row ...
{ "content_hash": "ed6789ab2fbdf37dbbbd42a57220b5ee", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 91, "avg_line_length": 27.066666666666666, "alnum_prop": 0.5541871921182266, "repo_name": "null-none/py-ngrams", "id": "9fd8eaced3e83753cdef81afda34d41afcd81812", "size": "...
from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_darth_vader.iff" result.attribute_template_id = 9 result.stfName("theme_park_name","darth_vader") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "bcd64b5dbb2159541fb356bbcaf4f75c", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 57, "avg_line_length": 22.615384615384617, "alnum_prop": 0.6904761904761905, "repo_name": "obi-two/Rebelion", "id": "602874d5d1606daccb03418879e05884fdeb550b", "size": "439...
"""Test Migrating a wallet from legacy to descriptor.""" import os import random from test_framework.descriptors import descsum_create from test_framework.test_framework import FujicoinTestFramework from test_framework.util import ( assert_equal, assert_raises_rpc_error, find_vout_for_address, ) from test_...
{ "content_hash": "f180b867883f61245b3310bd128df1da", "timestamp": "", "source": "github", "line_count": 403, "max_line_length": 168, "avg_line_length": 47.602977667493796, "alnum_prop": 0.6565888240200167, "repo_name": "fujicoin/fujicoin", "id": "76c79c69fefa7eca87dceca5651d97939d379446", "size": "...
""" source_printer.py prints C++ classes """ from ydkgen.common import get_qualified_yang_name class ClassGetChildPrinter(object): def __init__(self, ctx): self.ctx = ctx def print_class_get_child(self, clazz, children): self._print_class_get_child_header(clazz) self._print_class_...
{ "content_hash": "790d3d22955f2ccff7c2098f5f73b722", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 178, "avg_line_length": 35.35, "alnum_prop": 0.6020744931636021, "repo_name": "CiscoDevNet/ydk-gen", "id": "61a4690994d91c19efb0398e0f9b57962919995d", "size": "2835", "bi...
import paver.path import sys import os.path def test_join_on_unicode_path(): # This is why we should drop 2.5 asap :] # b'' strings are not supported in 2.5, while u'' string are not supported in 3.2 # -- even syntactically, so if will not help you here if sys.version_info[0] < 3: expected = '...
{ "content_hash": "be40e0619eae055948991db5de00561d", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 85, "avg_line_length": 29.192307692307693, "alnum_prop": 0.6337285902503293, "repo_name": "gregorynicholas/paver", "id": "6100bd0b60b2e66dfd3e7397de2b0c38725382bb", "size":...
import os import logging import json from wxglterm_interface import TermColorTheme, TermColor, TermCell from multiple_instance_plugin_base import MultipleInstancePluginBase LOGGER = logging.getLogger('term_color_theme') class DefaultTermColorTheme(MultipleInstancePluginBase, TermColorTheme): def __init__(self):...
{ "content_hash": "2832179effb2606ed7d518a195b35364", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 117, "avg_line_length": 36.51298701298701, "alnum_prop": 0.5248088209141027, "repo_name": "stonewell/wxglterm", "id": "c2e89ff40c770399a5dfb2f77e7aade37e29e617", "size": "...
"""Implement a clip module as pytorch only has a simple clamp function """ import torch from torch import nn from torch.nn.parameter import Parameter from pytorch_quantization.nn import functional as QF __all__ = ['Clip'] class Clip(nn.Module): """Clip tensor Args: clip_value_min: A number or tensor...
{ "content_hash": "da1526eb21184ad890fcd221970e6760", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 113, "avg_line_length": 40.4390243902439, "alnum_prop": 0.6501809408926418, "repo_name": "NVIDIA/TensorRT", "id": "0caff613becc106ec7dde27b5882339d4c34645c", "size": "2348"...
from collections import defaultdict from os.path import expanduser import traceback import time import os import csv import testing class TestLogger: def __init__(self): log_dir, symlink_name, log_file_name = self._log_name() print('Creating new log:', log_file_name) os.makedirs(log_dir, ex...
{ "content_hash": "c4e86077a77a716c95af7bffb80916f8", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 108, "avg_line_length": 37.431372549019606, "alnum_prop": 0.47943949711891043, "repo_name": "scottsilverlabs/raspberrystem", "id": "1f4947fa015446d0122003e6c9a035f04390de39"...
from snippets.models import Snippet from snippets.serializers import SnippetSerializer, UserSerializer from rest_framework import generics from rest_framework import permissions from snippets.permissions import IsOwnerOrReadOnly from django.contrib.auth.models import User from rest_framework.views import APIView from r...
{ "content_hash": "1e4303856da6737c125be136944fb75b", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 85, "avg_line_length": 33.073170731707314, "alnum_prop": 0.7876106194690266, "repo_name": "KevinBacas/DjangoRESTHello", "id": "64051e3db38517560733ea2ec95466113b947097", "s...
import logging import os logging.basicConfig(format="%(levelname)s - %(message)s") level = os.getenv("LOG_LEVEL", "INFO").upper() logger = logging.getLogger(__name__) logger.setLevel(level) logger.debug("Log level: %s", logger.level)
{ "content_hash": "98450aacd736f75611f1084792f37bab", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 57, "avg_line_length": 21.636363636363637, "alnum_prop": 0.7100840336134454, "repo_name": "quantumlib/Cirq", "id": "6ed321c6800704660abb9ccadbacc6af147e48ee", "size": "823"...
from enum import Enum from menu import Menu class MenuStatus(Enum): Okay = 1 Exit = 2 # master game state and flow manager # updates and draws the topmost menu from a stack of menus class MenuManager: def __init__(self, start_menu): self.menus=[] self.menus.append(start_menu) # update loop for menus # also...
{ "content_hash": "339d31f7b2c4f8a59d55c97e6241d989", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 154, "avg_line_length": 34.34782608695652, "alnum_prop": 0.7075949367088608, "repo_name": "RCIX/RogueP", "id": "6e3d0085404aca13128325bec72121edd1065e68", "size": "1580", ...
from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from cms.models import CMSPlugin @python_2_unicode_compatible class TypedJS(CMSPlugin): name = models.CharField(_('name'), ma...
{ "content_hash": "97c8c89b061f63cc9ed4ee9c5c50829e", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 153, "avg_line_length": 35.81818181818182, "alnum_prop": 0.6954314720812182, "repo_name": "tdsymonds/djangocms-typedjs", "id": "752a814edecd84fbd00b8bd14984521b8fded907", "...
import datetime from django.conf import settings from django.db import backend, connection, transaction, DEFAULT_DB_ALIAS from django.test import TestCase, TransactionTestCase from models import Book, Award, AwardNote, Person, Child, Toy, PlayedWith, PlayedWithNote # Can't run this test under SQLite, because you can...
{ "content_hash": "61a80b679197cd33b893fbd9e3460b3b", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 106, "avg_line_length": 43.092592592592595, "alnum_prop": 0.6233347657928664, "repo_name": "t11e/django", "id": "7ebe5e86a41dac0729dcdb84dbb9b4dd046b9291", "size": "4654",...
import os from unittest import TestCase from tests.helpers import DATA_DIR, make_data_dir, delete_data_dir from bversion.common import cpjoin from bversion.storage.client_db import client_db from bversion.storage.journaling_filesystem import journaling_filesystem CONF_DIR = 'bvn' BACKUP_DIR = 'back' class TestJou...
{ "content_hash": "ac6923c03c580ef8e6c38857880f7326", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 97, "avg_line_length": 41.01481481481481, "alnum_prop": 0.5316958641863825, "repo_name": "robehickman/simple-http-file-sync", "id": "64a0bdd7c6570537f4e74a07c9a992442f8c5491...
import sys import os import shlex # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.getenv('brain_HOME')) #...
{ "content_hash": "e2f986b355b34481d1d6bac43d63ddad", "timestamp": "", "source": "github", "line_count": 369, "max_line_length": 80, "avg_line_length": 31.59891598915989, "alnum_prop": 0.7107204116638078, "repo_name": "openconnectome/ndod", "id": "2c8e31b71693d5ba356f25210e8ffcca75742877", "size": "...
from typing import Callable, Dict, Optional, Sequence, Tuple, Union import warnings from google.api_core import gapic_v1, grpc_helpers, operations_v1 import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: i...
{ "content_hash": "171b6563f972c5624fd6594fc189d1dc", "timestamp": "", "source": "github", "line_count": 921, "max_line_length": 105, "avg_line_length": 43.44951140065147, "alnum_prop": 0.6313816627933129, "repo_name": "googleapis/python-securitycenter", "id": "355fd3f799fbcba901a2f6a5d193934abcabac20...
""" Runs counterpartyd or the counterpartyd test suite via the python interpreter in its virtualenv on both Linux and Windows """ import os import sys assert os.name in ("nt", "posix") #under *nix, script must NOT be run as root if os.name == "posix" and os.geteuid() == 0: print("Please run this script as a non-r...
{ "content_hash": "3d98efe54bcfff78f10866d5dc1d0fad", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 156, "avg_line_length": 49.86, "alnum_prop": 0.672282390693943, "repo_name": "ClearingHouse/clearinghoused_build", "id": "037394e195a836fa16288ac460acb35f32256238", "size":...
import _plotly_utils.basevalidators class TickformatValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="tickformat", parent_name="parcats.line.colorbar", **kwargs ): super(TickformatValidator, self).__init__( plotly_name=plotly_name, ...
{ "content_hash": "62dba435361ea13cab53962794ad47e9", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 85, "avg_line_length": 34.57142857142857, "alnum_prop": 0.609504132231405, "repo_name": "plotly/python-api", "id": "24a4f90949a4287e3c23c3ee24eb41944be2a1d6", "size": "484"...
class CutlassTestUtil(object): def boolPropertyTest(self, test, obj, prop): value1 = True success1 = False try: setattr(obj, prop, value1) success1 = True except Exception: pass test.assertTrue(success1, "Able to use the %s setter to True...
{ "content_hash": "831b722d8b9a3f5e1e0a85387bcc3a7a", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 78, "avg_line_length": 26.73103448275862, "alnum_prop": 0.5394736842105263, "repo_name": "carze/cutlass", "id": "e751b4c7e6a046518f721fdab551f5a71c91f792", "size": "3876",...
import math class QuadratureEstimator: def __init__(self, ticks_per_revolution): self.ticks_per_revolution = ticks_per_revolution self._position = 0 self._velocity = 0 count = 0 pulcount = 0 vel = 0 position = 0 trash = 0 def update(self, a_state, b_state, time): # Implement dec...
{ "content_hash": "4153bddeff3c1a595ce807c3d4aba2fc", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 101, "avg_line_length": 34.91379310344828, "alnum_prop": 0.562962962962963, "repo_name": "ccc395/Robotics", "id": "a110e0c0c19103181b42c3e4af8f34127d6d7d26", "size": "2140"...
import FWCore.ParameterSet.Config as cms process = cms.Process('AODSIM') # import of standard configurations process.load('Configuration.StandardSequences.Services_cff') process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi') process.load('FWCore.MessageService.MessageLogger_cfi') process.load('Configuration.EventCon...
{ "content_hash": "40ec04ca6752fbaa2970a38c6bf558fd", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 148, "avg_line_length": 41.375, "alnum_prop": 0.7542799597180262, "repo_name": "tuos/RECO2AOD", "id": "8ab6a2680a602fe436fc4dd7fcfc87bfc13382a3", "size": "4433", "binary"...
import base64 import time from openerp.osv import fields, osv from openerp.tools.translate import _ from openerp import tools import logging _logger = logging.getLogger(__name__) class account_coda_import(osv.osv_memory): _name = 'account.coda.import' _description = 'Import CODA File' _columns = { ...
{ "content_hash": "6b49264ce06435688578a21a43dbeb54", "timestamp": "", "source": "github", "line_count": 396, "max_line_length": 312, "avg_line_length": 69.07828282828282, "alnum_prop": 0.5056845183695851, "repo_name": "chjw8016/GreenOdoo7-haibao", "id": "65ab03b441cbbdf5276e185e96cb4149f88825a4", "...
from pygw.base import GeoWaveObject from pygw.config import geowave_pkg from ..statistic import FieldStatistic from ..statistic_type import FieldStatisticType from ...base.java_transformer import JavaTransformer class BloomFilterStatistic(FieldStatistic): """ Applies a bloom filter to field values useful for ...
{ "content_hash": "81962033ed3d59eb7f9f95a313e209b4", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 118, "avg_line_length": 39.86, "alnum_prop": 0.7280481685900653, "repo_name": "locationtech/geowave", "id": "4fc77110756cd65a31cfa6d4b0041bc5e6e935db", "size": "2512", "b...
import django if django.VERSION >= (3, 2): # The declaration is only needed for older Django versions pass else: default_app_config = 'wagtail.api.v2.apps.WagtailAPIV2AppConfig'
{ "content_hash": "5e85379a55b5f5a79f7ae999d6000b11", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 68, "avg_line_length": 24, "alnum_prop": 0.71875, "repo_name": "mixxorz/wagtail", "id": "0e8d2e004c61480e6beb198c36d7b2a507caa373", "size": "192", "binary": false, "copi...
"""cyme.bin.base - Utilities used by command line applications, basically just to set up Django without having an actual project. """ from __future__ import absolute_import from __future__ import with_statement from cyme import __version__, DEBUG, DEBUG_BLOCK, DEBUG_READERS import django import getpass import os...
{ "content_hash": "69752588b799aabcaafacd9b78abdaf7", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 75, "avg_line_length": 29.161538461538463, "alnum_prop": 0.597203903983118, "repo_name": "celery/cyme", "id": "eacd205cd0df9204d68efe2e31328fe38dc573f3", "size": "3791", ...
from __future__ import print_function import os, time import requests import json def usage(): print("federate.py portal_server arcgis_server") return # HTTPS calls will generate warnings about the self-signed certificate if you delete this. from requests.packages.urllib3.exceptions import InsecureRequestWarn...
{ "content_hash": "3375dbc9dde24081097ae1012a513f9c", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 114, "avg_line_length": 29.87769784172662, "alnum_prop": 0.5160125210691067, "repo_name": "noricohuas/docker", "id": "004f44a277b0f3cbe02a2cd5b8ce241b74f10dc2", "size": "4...
from dbt.utils import filter_null_values, deep_merge, classproperty from dbt.node_types import NodeType import dbt.exceptions from collections.abc import Mapping, Hashable from dataclasses import dataclass, fields from typing import ( Optional, TypeVar, Generic, Any, Type, Dict, Union, Iterator, Tuple, Set ) ...
{ "content_hash": "fbf7c24083273a0235283574c7785b52", "timestamp": "", "source": "github", "line_count": 547, "max_line_length": 79, "avg_line_length": 30.776965265082268, "alnum_prop": 0.5948321948321948, "repo_name": "fishtown-analytics/dbt", "id": "44654bfb342a8e179ebc95814fa21f8a4c35358a", "size...
try: from .fields import * except ImportError: import sys sys.stdout.write("Warning: Could not find the GEOS library.\n") from django.forms import * from .mixins import QueryFormMixin from .operators import AND, OR class QueryModelForm(ModelForm, QueryFormMixin): def __init__(self, *args, **k...
{ "content_hash": "da5feb0adcfbe60c5321051fd108d908", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 67, "avg_line_length": 28.774193548387096, "alnum_prop": 0.6165919282511211, "repo_name": "laginha/django-alo-forms", "id": "b50cc1cb3a6ee54e5fcad1a4396afdd8aff26ed0", "siz...
from django.test import TestCase from candidator.models import Topic, Position, TakenPosition, Category from popolo.models import Person class TopicTestCase(TestCase): def setUp(self): pass def test_instanciate(self): '''Instanciate a topic''' topic = Topic.objects.create( ...
{ "content_hash": "789cf5e68b0806ecf80a342cdf152555", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 127, "avg_line_length": 42.25, "alnum_prop": 0.6487743026204564, "repo_name": "lfalvarez/django-candidator", "id": "99ec36b2e32925a47a3a5c378030ca3213f45cd4", "size": "712...
""" Scripts to combine FLT exposures at a single orientation / sub-pixel position to speed up the spectral processing. """ import copy import glob import numpy as np import matplotlib.pyplot as plt import astropy.wcs as pywcs import astropy.io.fits as pyfits from . import utils from . import GRIZLI_PATH def combin...
{ "content_hash": "39837e301ccb864d3bd731bed02393da", "timestamp": "", "source": "github", "line_count": 568, "max_line_length": 108, "avg_line_length": 35.390845070422536, "alnum_prop": 0.544821410804895, "repo_name": "albertfxwang/grizli", "id": "475bdd7c8b01be50d088f89a2f96af175b2c26b2", "size": ...