text
stringlengths
4
1.02M
meta
dict
from rstem import led_matrix, accel import RPi.GPIO as GPIO import time import os import sys import random # notify of progress print("P50") sys.stdout.flush() # set up led matrix #led_matrix.init_grid(2,2) led_matrix.init_matrices([(0,8),(8,8),(8,0),(0,0)]) # set up accelerometer accel.init(1) # set up GPIO GPIO....
{ "content_hash": "865f636dcd360ee8b1ab6d367c3d8df0", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 106, "avg_line_length": 23.183908045977013, "alnum_prop": 0.6693108577094695, "repo_name": "scottsilverlabs/raspberrystem", "id": "9664fbbbc9f339763925ec4e1645c89883787550", ...
""" Defines base data types and models required specifically for VRF Flow Specification support. """ import abc import logging import six from ryu.lib.packet.bgp import BGP_ATTR_TYPE_ORIGIN from ryu.lib.packet.bgp import BGP_ATTR_TYPE_AS_PATH from ryu.lib.packet.bgp import BGP_ATTR_TYPE_EXTENDED_COMMUNITIES from ry...
{ "content_hash": "e78e10f99630e9fa90ae62c5bdfdcc21", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 77, "avg_line_length": 33.87012987012987, "alnum_prop": 0.7162576687116564, "repo_name": "osrg/ryu", "id": "8f0fe3eb40dd4b45cb2293b4e78b19ed046f4047", "size": "3221", "bi...
import glob import itertools import os import shutil import tempfile import time import unittest import mock import pytest from chainer import testing from chainer import training from chainer.training import extensions from chainer.training.extensions._snapshot import _find_latest_snapshot from chainer.training.exte...
{ "content_hash": "d24aa5383f48c69f4a663adb07edc071", "timestamp": "", "source": "github", "line_count": 271, "max_line_length": 79, "avg_line_length": 35.298892988929886, "alnum_prop": 0.5831068367133598, "repo_name": "hvy/chainer", "id": "b5d469ac4d757a6b81d2b974976172eb31895ff0", "size": "9566", ...
import sge from sge.gfx import Sprite, Color from . import config class Background(sge.gfx.Background): # setup scolling background image def __init__(self, state_name): self.state_name = state_name scroll_level = config.BACKGROUND_SPRITES[self.state_name] sprite_lev_1 = sge.gfx.Sprit...
{ "content_hash": "837ecdde9f511b729574211d58c3595f", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 86, "avg_line_length": 35.13333333333333, "alnum_prop": 0.6736242884250474, "repo_name": "jrrickerson/pyweek24", "id": "38ab484a6fd4d42adb4819529d02ce73400903c1", "size": "...
from . import exc class Transaction(object): """Represent a database transaction in progress. The Transaction object is procured by calling the SAConnection.begin() method of SAConnection: with (yield from engine) as conn: trans = yield from conn.begin() try: ...
{ "content_hash": "e6d52bab47b0a2163447817d16fc9a57", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 77, "avg_line_length": 29.077844311377245, "alnum_prop": 0.6132619439868204, "repo_name": "aio-libs/aiomysql", "id": "ff15ac080c02b634c92f9bd437c7a88b7edba169", "size": "4...
import bisect import itertools import math from array import array from collections import defaultdict from random import randint, shuffle from time import time from swift.common import exceptions from swift.common.ring import RingData from swift.common.ring.utils import tiers_for_dev, build_tier_tree class RingBui...
{ "content_hash": "1fcaf0f023c9962a05ba5792a4dceb3c", "timestamp": "", "source": "github", "line_count": 724, "max_line_length": 79, "avg_line_length": 45.011049723756905, "alnum_prop": 0.5728182152939733, "repo_name": "NewpTone/StackLab-swift", "id": "89ae9d2ec1b800289e644b38b6820891cd49f3d6", "siz...
from client import exceptions as ex from client.sources.common import models from client.sources.ok_test import concept import mock import unittest class ConceptSuiteTest(unittest.TestCase): TEST_NAME = 'A' SUITE_NUMBER = 0 def makeTest(self, cases): test = mock.Mock(spec=models.Test) retu...
{ "content_hash": "90fa12e2d761b65bc4bbc826e1a46ae9", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 84, "avg_line_length": 28.2020202020202, "alnum_prop": 0.44197707736389685, "repo_name": "Cal-CS-61A-Staff/ok-client", "id": "4739b470841f5bdd908da37495db3a147aad8b3f", "si...
from random import randint import packet import time import os from zeroos.core0 import client import configparser import sys import requests def create_new_device(manager, hostname, branch='master'): project = manager.list_projects()[0] ipxe_script_url = 'http://unsecure.bootstrap.gig.tech/ipxe/{}/0/developm...
{ "content_hash": "97b7ee232f2fb905ddf111b0b035e6fe", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 95, "avg_line_length": 34.634328358208954, "alnum_prop": 0.5432018961430726, "repo_name": "g8os/core0", "id": "fe7de9ce26cca5764ac045251ab2e8723a1e1d7d", "size": "4660", ...
import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup import optcoretech version = optcoretech.__version__ setup( name='optcoretech-web', version=version, author='', author_email='sheeshmohsin@gmail.com', packages = [ 'optcoretech', ...
{ "content_hash": "10f948948bfd012434f3300ab473d897", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 42, "avg_line_length": 17.296296296296298, "alnum_prop": 0.6616702355460385, "repo_name": "nishantsingla/optcoretech", "id": "aebbd5cb3389671222a1f6f4b0818c06bf59b67e", "si...
"""Classes for different types of export output.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import abc import six from tensorflow.python.framework import dtypes from tensorflow.python.framework import ops from tensorflow.python.saved_model import...
{ "content_hash": "24570338246d5a0d6bf5d601e6496aad", "timestamp": "", "source": "github", "line_count": 380, "max_line_length": 80, "avg_line_length": 32.81315789473684, "alnum_prop": 0.6719865265859332, "repo_name": "gojira/tensorflow", "id": "6c26d299851eaea74f1e564d0fac217f238d76a2", "size": "13...
"""Module for testing the del network device command.""" import unittest if __name__ == "__main__": import utils utils.import_depends() from brokertest import TestBrokerCommand class TestDelVirtualSwitch(TestBrokerCommand): def test_100_unregister_pg_tag(self): self.noouttest(["unbind_port_grou...
{ "content_hash": "45cd88816f5d3511816bf6d43506b0e5", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 79, "avg_line_length": 37.735849056603776, "alnum_prop": 0.6445, "repo_name": "quattor/aquilon", "id": "c6d7db09fb05399d6f71f06ced95273d207bd83b", "size": "2740", "binary...
import atexit import logging import math import os import threading import types import numpy import large_image.tilesource.base from large_image import config from large_image.cache_util import LruCacheMetaclass, methodcache from large_image.constants import TILE_FORMAT_NUMPY, SourcePriority from large_image.excepti...
{ "content_hash": "8631bcdf520bc0bcc0273acffae22e07", "timestamp": "", "source": "github", "line_count": 579, "max_line_length": 99, "avg_line_length": 41.75302245250432, "alnum_prop": 0.5605377456049638, "repo_name": "girder/large_image", "id": "e673609a10d58259017f9a2de3f880450a32f8c2", "size": "2...
""" WSGI config for musicwings project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "musicwings.settings") from django....
{ "content_hash": "a770c2a6187ab781310dc9c815754507", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 26.875, "alnum_prop": 0.7790697674418605, "repo_name": "miccio-dk/musicwings", "id": "22432ec6b25b34e83f34327aca7acebb49935272", "size": "430", "bi...
""" Abstract: Operations on earthquake data as examples for how to use the core concept 'event' Use Cases: - get all locations of earthquakes with a magnitude of 4 or higher - get all earthquakes which origin is 100 m or deeper - get all earthquakes from 12/01/2014 00:00:00 - 12/6/2014 23:59:59 - get all earthquakes i...
{ "content_hash": "ac73987699eb55ed2dacccfe1d38b3ec", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 93, "avg_line_length": 26.11, "alnum_prop": 0.5913443125239372, "repo_name": "liangcun/ConceptsOfSpatialInformation", "id": "a8d75f2d6350a9cd2602715fb75b29fb806b7e06", "si...
"""The SHA-256 Hasher implementation""" import hashlib from plaso.hashers import interface from plaso.hashers import manager class SHA256Hasher(interface.BaseHasher): """This class provides SHA-256 hashing functionality.""" NAME = u'sha256' DESCRIPTION = u'Calculates a SHA-256 digest hash over input data.' ...
{ "content_hash": "759a6458d44695590bcf0e8618e4f67f", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 77, "avg_line_length": 28.86, "alnum_prop": 0.7089397089397089, "repo_name": "jorik041/plaso", "id": "178df0ce01faea8c797c6070862faba1a0c158f9", "size": "1467", "binary":...
import ujson from gnocchiclient.v1 import base class ArchivePolicyRuleManager(base.Manager): url = "v1/archive_policy_rule/" def list(self): """List archive policy rules.""" return self._get(self.url).json() def get(self, name): """Get an archive policy rules. :param n...
{ "content_hash": "20c66044cccc09f4cd33a83af57e725b", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 67, "avg_line_length": 27.541666666666668, "alnum_prop": 0.575642965204236, "repo_name": "gnocchixyz/python-gnocchiclient", "id": "9f0abd8a19ff12d298dde59ebedbab3f64209024", ...
from collections import OrderedDict from typing import Dict, Type from .base import BatchJobServiceTransport from .grpc import BatchJobServiceGrpcTransport # Compile a registry of transports. _transport_registry = ( OrderedDict() ) # type: Dict[str, Type[BatchJobServiceTransport]] _transport_registry["grpc"] = B...
{ "content_hash": "9cd91bf2561f1162f054810d073bc56d", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 58, "avg_line_length": 26.9375, "alnum_prop": 0.777262180974478, "repo_name": "googleads/google-ads-python", "id": "91c165c36bf103f9f825b437eae6a418287a4f1b", "size": "1031...
import pytest from telegram import Bot, Update, Message, User, Chat, CallbackQuery, InlineQuery, \ ChosenInlineResult, ShippingQuery, PreCheckoutQuery from telegram.ext import StringCommandHandler message = Message(1, User(1, ''), None, Chat(1, ''), text='Text') params = [ {'message': message}, ...
{ "content_hash": "4caec1fcc2da00536473efb292de83ff", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 96, "avg_line_length": 37.41747572815534, "alnum_prop": 0.6139076284379865, "repo_name": "rogerscristo/BotFWD", "id": "fb3dced4d670b24be0482075a2b448d1426a9f31", "size": "...
from azure.identity import DefaultAzureCredential from azure.mgmt.sql import SqlManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-sql # USAGE python list_the_server_management_operations.py Before run the sample, please set the values of the client ID, tenant ID an...
{ "content_hash": "3bdea70778ecdc9ae3697d78b05d8154", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 132, "avg_line_length": 33.5, "alnum_prop": 0.7278314310798947, "repo_name": "Azure/azure-sdk-for-python", "id": "130275dcc6fc928fc1131b473bd01c507eec6d82", "size": "1607",...
""" Provides values which would be available from /proc which are not fulfilled by other modules. """ import functools import sys from types import ModuleType import gdb import pwndbg.memoize class module(ModuleType): @property def pid(self): i = gdb.selected_inferior() if i is not None: ...
{ "content_hash": "8b94c4749c1505ba83a4f910f1d49c9e", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 57, "avg_line_length": 20.71794871794872, "alnum_prop": 0.6101485148514851, "repo_name": "sigma-random/pwndbg", "id": "ff737521a8fe481d1c1eb51cb3445e63fd1af850", "size": "8...
from django.contrib import admin from django import forms from blog.models import Category, Entry class CategoryAdmin(admin.ModelAdmin): prepopulated_fields = { 'slug': ['title'] } admin.site.register(Category, CategoryAdmin) class EntryAdminForm(forms.ModelForm): class Meta: model = Entry class EntryAdm...
{ "content_hash": "eed45d5e996d6d722d7c614f06d8324a", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 44, "avg_line_length": 21.61904761904762, "alnum_prop": 0.7466960352422908, "repo_name": "davogler/davsite", "id": "b3a74654a5786003ea6a9411d04c7c00cf3a7fe0", "size": "454"...
from django_graph_api.graphql.utils import GraphQLError from django_graph_api.graphql.request import Request from test_app.schema import schema def test_non_existent_episode(starwars_data): document = ''' { episode (number: 12) { name } } ''' re...
{ "content_hash": "f1b10e5501bbbc38e493d589084408d9", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 88, "avg_line_length": 23.84090909090909, "alnum_prop": 0.5328884652049571, "repo_name": "melinath/django-graph-api", "id": "a2216bb9e256c64c5300d996d23fbac320d0c301", "siz...
from __future__ import unicode_literals from django.core.management.base import NoArgsCommand from optparse import make_option from project.actions import create_project_db, create_project_local from docutil.commands_util import recocommand from docutil.str_util import smart_decode class Command(NoArgsCommand): o...
{ "content_hash": "6c7de4d380f911913e5e7fe66a374b88", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 71, "avg_line_length": 46.107142857142854, "alnum_prop": 0.6475600309837335, "repo_name": "bartdag/recodoc2", "id": "6d5401473541141004c18dca73fb43d6ac4a5c03", "size": "129...
from consts.award_type import AwardType from models.notifications.notification import Notification class AwardsNotification(Notification): def __init__(self, event, team=None): self.event = event self.team = team self.team_awards = event.team_awards().get(team.key, []) if team else [] ...
{ "content_hash": "7a98eda885188c263ff2db54f25d34b1", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 128, "avg_line_length": 35.37313432835821, "alnum_prop": 0.5970464135021097, "repo_name": "phil-lopreiato/the-blue-alliance", "id": "75706a233565262f49d9bb479c117e575cfc8c6e"...
import os import tornado from application.server import Application if __name__ == "__main__": app = Application() app.listen(int(os.environ.get("PORT", 8080))) tornado.ioloop.IOLoop.instance().start()
{ "content_hash": "27b44c4d80427e614631ea4c1487a9ab", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 49, "avg_line_length": 26.875, "alnum_prop": 0.6837209302325581, "repo_name": "icoxfog417/enigma_abroad", "id": "9006da419690193c780a7d979967c7613de54e47", "size": "215", ...
import datetime import os from django.conf import settings from django.db.models.fields import Field from django.core.files.base import File, ContentFile from django.core.files.storage import default_storage from django.core.files.images import ImageFile, get_image_dimensions from django.core.files.uploadedfile import...
{ "content_hash": "4ebeb32e32867e3764d97c0103505caf", "timestamp": "", "source": "github", "line_count": 238, "max_line_length": 119, "avg_line_length": 38.73109243697479, "alnum_prop": 0.6421132566717292, "repo_name": "weigj/django-multidb", "id": "17886582851d7c628ad6bbbd6ec3f9d43de7490b", "size":...
from .AbstractMode import AbstractMode class CommandMode(AbstractMode): def __init__(self, controller): super().__init__(controller) self.line = controller.model.commandLine self.window = controller.view.commandLine def handleKey(self, key): super().handleKey(key) if k...
{ "content_hash": "f974ca4281f41736eb8a79b7b68f334b", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 49, "avg_line_length": 26.523809523809526, "alnum_prop": 0.63016157989228, "repo_name": "elmar-hinz/Python.Vii", "id": "32ed9305c3a5cee7fdbc828ff0dda01fb93147fd", "size": "...
from __future__ import unicode_literals import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('consultorio', '0001_initial'), ] operations = [ migrations.AlterField( model_name='evoluciondiaria', name='f...
{ "content_hash": "9dbfdc0f3c3e95e98b1b3d8ca863b039", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 98, "avg_line_length": 30.137931034482758, "alnum_prop": 0.5949656750572082, "repo_name": "andresmauro17/mediapp", "id": "fdb9f077e3f78da421671fe50c608e8a659d0e06", "size":...
import subprocess import datetime import sys output = [] # Check arguments. if len(sys.argv) != 2: print("Usage: gen_env.py <output file>") sys.exit(1) output_filename = sys.argv[1] # Fetch details about the current repo revision. p = subprocess.Popen(["git", "log", "-r", "HEAD", "-n", "1", "--pretty=format:...
{ "content_hash": "a15085e0c52070313d2dfac131ed304b", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 84, "avg_line_length": 25.307692307692307, "alnum_prop": 0.6251266464032421, "repo_name": "cmr/seL4", "id": "ef64876ab582620ba7b8c6acdb5ee1361e82aff0", "size": "1235", "b...
VERSION = '1.1.7' # PIL version PILLOW_VERSION = '2.5.3' # Pillow _plugins = ['BmpImagePlugin', 'BufrStubImagePlugin', 'CurImagePlugin', 'DcxImagePlugin', 'EpsImagePlugin', 'FitsStubImagePlugin', 'FliImagePlugin', 'FpxImagePlugin', ...
{ "content_hash": "8d3223954c49e39e604eb2a5c069af99", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 34, "avg_line_length": 30.431818181818183, "alnum_prop": 0.4958924570575056, "repo_name": "havard024/prego", "id": "d5894c4471c807fde29b0865cf75d70df0bfff0a", "size": "1523...
import logging logger = logging.getLogger("pythran") stream = logging.StreamHandler() # Initialize logging try: # Set a nice colored output from colorlog import ColoredFormatter formatter = ColoredFormatter( "%(log_color)s%(levelname)-8s%(reset)s %(blue)s%(message)s", log_colors={ ...
{ "content_hash": "3f7550b68f5b0de6afc57fed391137f5", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 72, "avg_line_length": 25.90625, "alnum_prop": 0.6212303980699638, "repo_name": "pombredanne/pythran", "id": "5ead1171991b0311690184945a8349f6b31647cc", "size": "829", "b...
from dateutil import parser try: from xml.etree import cElementTree as ETree except ImportError: from xml.etree import ElementTree as ETree from .models import ( Share, Directory, File, Handle, FileProperties, FileRange, ShareProperties, DirectoryProperties, ) from azure.storage...
{ "content_hash": "7ad46f665ffd95ea9a25931a4f9c6f15", "timestamp": "", "source": "github", "line_count": 321, "max_line_length": 134, "avg_line_length": 29.21183800623053, "alnum_prop": 0.6359176708968753, "repo_name": "Azure/azure-storage-python", "id": "98a4cf904f0948eb14bc43f6bed5c1e14f8a217f", "...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('article', '0002_auto_20141207_0840'), ] operations = [ migrations.AddField( model_name='article', name='featured', ...
{ "content_hash": "750d3be27ff6bec44ff0e66970fc68cc", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 53, "avg_line_length": 21.94736842105263, "alnum_prop": 0.592326139088729, "repo_name": "F483/trainlessmagazine.com", "id": "bf0d9578f38b66f370a8effdde99688501bd8d9f", "siz...
""" lnrater.py contains Lightning Network node rating functionality. """ import asyncio from collections import defaultdict from pprint import pformat from random import choices from statistics import mean, median, stdev from typing import TYPE_CHECKING, Dict, NamedTuple, Tuple, List, Optional import sys import time ...
{ "content_hash": "808f5d3854b5c314627175cf3d0958d5", "timestamp": "", "source": "github", "line_count": 276, "max_line_length": 142, "avg_line_length": 40.98550724637681, "alnum_prop": 0.6148338048090524, "repo_name": "wakiyamap/electrum-mona", "id": "957b5f6eb3fb7e1393280c0b4fc9df9a48722a2d", "siz...
from flask import Flask app = Flask(__name__, static_url_path='/static') from app import views
{ "content_hash": "ad8e78d612338174bfd12f87a693b993", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 48, "avg_line_length": 23.75, "alnum_prop": 0.7263157894736842, "repo_name": "euri16/dulcerefugio-py", "id": "34206f5934468648aa3ce2112ebbe2a99cbe2d52", "size": "95", "bin...
import re import json from xml.etree.ElementTree import Element, SubElement, tostring, fromstring from vumi.transports.wechat.errors import ( WeChatParserException, WeChatException) def get_child_value(node, name): [child] = node.findall(name) return (child.text.strip() if child.text is not None else '')...
{ "content_hash": "d9782b8f94533f38f198ba9ab37951e2", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 98, "avg_line_length": 29.169082125603865, "alnum_prop": 0.5460417356740642, "repo_name": "vishwaprakashmishra/xmatrix", "id": "39e4d1f28c8f5d6a3320d660ca54c09c4392a055", ...
import _plotly_utils.basevalidators class FamilyValidator(_plotly_utils.basevalidators.StringValidator): def __init__( self, plotly_name="family", parent_name="scattercarpet.textfont", **kwargs ): super(FamilyValidator, self).__init__( plotly_name=plotly_name, parent_na...
{ "content_hash": "90e0788ec83007c07f9b225969e13884", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 82, "avg_line_length": 35.75, "alnum_prop": 0.5891608391608392, "repo_name": "plotly/plotly.py", "id": "42020c181ae9a1fb3308d750f8e48c3a47a7d259", "size": "572", "binary"...
import collections from oslo_config import cfg from networking_cisco.plugins.ml2.drivers.cisco.nexus import ( constants as const) from networking_cisco.plugins.ml2.drivers.cisco.nexus import exceptions from networking_cisco.plugins.ml2.drivers.cisco.nexus import nexus_db_v2 from networking_cisco.tests.unit.ml2.dr...
{ "content_hash": "bd2031df189774cf9e2a37ee2bb91a7a", "timestamp": "", "source": "github", "line_count": 1472, "max_line_length": 79, "avg_line_length": 40.239809782608695, "alnum_prop": 0.5654618202691067, "repo_name": "Tehsmash/networking-cisco", "id": "467179a2fe65ebcd803dc32d1e8756d3617f47e2", "...
""" @package mi.dataset.parser.ctdmo_ghqr_sio @file mi/dataset/parser/ctdmo_ghqr_sio.py @author Emily Hahn (original telemetered), Steve Myerson (recovered) @brief A CTDMO series ghqr specific data set agent parser This file contains code for the CTDMO parsers and code to produce data particles. For telemetered data, ...
{ "content_hash": "7c43f9da60eb7391c4ba3fb25ac1023d", "timestamp": "", "source": "github", "line_count": 825, "max_line_length": 114, "avg_line_length": 40.261818181818185, "alnum_prop": 0.588752408477842, "repo_name": "janeen666/mi-instrument", "id": "fccce59f75c25b3e93db4a54c958a52c43b03269", "siz...
from django.db import migrations class Migration(migrations.Migration): dependencies = [("website", "0017_auto_20190804_0759")] operations = [ migrations.AlterModelOptions(name="tournamentresultpage", options={"verbose_name": "Tournament results"}) ]
{ "content_hash": "527a5242b720765229d7da52394a9195", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 113, "avg_line_length": 27.5, "alnum_prop": 0.7127272727272728, "repo_name": "ianastewart/cwltc-admin", "id": "93498eab84ec6cbb6aee04eba528780c34dea5fe", "size": "324", "...
from datetime import date from itertools import chain import pymysql from DBUtils import PooledDB from dateutil.relativedelta import relativedelta from scrapy import Item __mysql_connection_pool = None host = '127.0.0.1' port = 3306 user = 'root' password = 'ipampas' db = 'stock' trade_quote_table = 'stock_daily_quo...
{ "content_hash": "c37238aa637ad5ed14b8c209190e5811", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 108, "avg_line_length": 32, "alnum_prop": 0.6256868131868132, "repo_name": "nicee/xshirmp", "id": "8feb25b8b7ba81cf40ba818e2d0d8193b7528478", "size": "2959", "binary": fa...
import re import collections from enum import Enum from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLIST,...
{ "content_hash": "c6a2929c8774efb9647714d3288b820d", "timestamp": "", "source": "github", "line_count": 1620, "max_line_length": 250, "avg_line_length": 54.42716049382716, "alnum_prop": 0.5206074490768045, "repo_name": "111pontes/ydk-py", "id": "9a63e3350c034641b4bc4273db54c634b5092aeb", "size": "8...
from django.core.cache import cache as default_cache def generate_named_key(instance_or_type, name, **vary_by): """ Generate a named key (eg used for storing a list of results) :param instance_or_type: :param name: :return: """ opts = instance_or_type._meta vary_string = ','.join('%s...
{ "content_hash": "2c5707ecdce6720daddd87e01ec1b7cc", "timestamp": "", "source": "github", "line_count": 218, "max_line_length": 116, "avg_line_length": 31.692660550458715, "alnum_prop": 0.6482848458532349, "repo_name": "timsavage/django-squirrel", "id": "854185d950d41041bf522da8a5bdfe4d8e1becfa", "...
import unittest import os, sys, commands import comm class TestSecurityFunctions(unittest.TestCase): def test_permission_chinese(self): comm.setUp() manifestPath = comm.ConstPath + "/../testapp/permission_field_chinese_tests/manifest.json" cmd = "python %smake_apk.py --package=org.xwalk.exa...
{ "content_hash": "95643db310544c09028b47606b45b644", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 102, "avg_line_length": 46.60526315789474, "alnum_prop": 0.639751552795031, "repo_name": "YongseopKim/crosswalk-test-suite", "id": "46487f49fddc8dc51992423c642ad1680373b872",...
import pytest import astropy.coordinates as coord from ... import fermi FK5_COORDINATES = coord.SkyCoord(10.68471, 41.26875, unit=('deg', 'deg')) @pytest.mark.remote_data def test_FermiLAT_query_async(): result = fermi.core.FermiLAT.query_object_async( FK5_COORDINATES, energyrange_MeV='1000, 100000', ...
{ "content_hash": "f47badd1834aa996e1b71008c39421b2", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 87, "avg_line_length": 38.57692307692308, "alnum_prop": 0.6919242273180458, "repo_name": "ceb8/astroquery", "id": "23d2b92ef3f1a6f808ccdc234600d58b0cdc4989", "size": "1069"...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: zabbix_host short_description: Zabbix host creates/updates/...
{ "content_hash": "49a18b6116ea3c10d1906742a0060f58", "timestamp": "", "source": "github", "line_count": 566, "max_line_length": 129, "avg_line_length": 38.87809187279152, "alnum_prop": 0.5798227675528289, "repo_name": "e-gob/plataforma-kioscos-autoatencion", "id": "552113451d467965c36534b9488a21a285e...
from supriya.system.SupriyaObject import SupriyaObject class Moment(SupriyaObject): """ A moment of intervals in a interval tree. """ ### CLASS VARIABLES ### __slots__ = ( "_interval_tree", "_overlap_intervals", "_start_intervals", "_start_offset", "_stop_...
{ "content_hash": "923c886a06c705884298d07afb281411", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 70, "avg_line_length": 26, "alnum_prop": 0.5605976757055894, "repo_name": "Pulgama/supriya", "id": "b864ce159873a20092a57c417a1e7a86d473abeb", "size": "3614", "binary": ...
import time from daemon import runner class App(): def __init__(self): self.stdin_path = '/dev/stdin' self.stdout_path = '/dev/stdout' self.stderr_path = '/dev/stderr' self.pidfile_path = '/tmp/foo.pid' self.pidfile_timeout = 5 def run(self): while True: ...
{ "content_hash": "68e4dc9e4cc2ad0accfceb6fac72837c", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 44, "avg_line_length": 23.3, "alnum_prop": 0.5793991416309013, "repo_name": "dmwesterhoff/slackd", "id": "ab616e68fead72edff52ad506b71bb497cf1f797", "size": "489", "binar...
from __future__ import annotations import warnings from typing import Sequence from flask import g from sqlalchemy import or_ from sqlalchemy.orm import joinedload from airflow.exceptions import AirflowException, RemovedInAirflow3Warning from airflow.models import DagBag, DagModel from airflow.security import permis...
{ "content_hash": "74f984b601716132411815e583f6e84b", "timestamp": "", "source": "github", "line_count": 715, "max_line_length": 110, "avg_line_length": 42.13566433566434, "alnum_prop": 0.6158263351810668, "repo_name": "apache/airflow", "id": "ce75970b14907e48a4827f51beac836a15ceac92", "size": "3091...
"""Compute Linearly constrained minimum variance (LCMV) beamformer.""" # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Roman Goj <roman.goj@gmail.com> # Britta Westner <britta.wstnr@gmail.com> # # License: BSD-3-Clause import numpy as np from ..rank import compute_rank from ..io.meas_i...
{ "content_hash": "5c6956b6a02e5925a7940c3b47962a77", "timestamp": "", "source": "github", "line_count": 434, "max_line_length": 79, "avg_line_length": 35.903225806451616, "alnum_prop": 0.6118598382749326, "repo_name": "mne-tools/mne-python", "id": "61c45a8ec66f8ba39f3a092a8f67b2b772b50ed1", "size":...
from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_dressed_gran_thug_male_01.iff" result.attribute_template_id = 9 result.stfName("npc_name","gran_base_male") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "602b077d608738a53ddcd3ee22bebff8", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 71, "avg_line_length": 23.384615384615383, "alnum_prop": 0.6907894736842105, "repo_name": "obi-two/Rebelion", "id": "7694c49a954e1f5063a32731811197dd64d6ee95", "size": "449...
import datetime from django.contrib.auth.models import AnonymousUser, User try: # Django 1.10 and above from django.urls import reverse except: # Django 1.8 and 1.9 from django.core.urlresolvers import reverse from django.utils import timezone from django.test import TestCase from django.test import C...
{ "content_hash": "986ee46c6fb1c9c69a22b704f7201658", "timestamp": "", "source": "github", "line_count": 263, "max_line_length": 103, "avg_line_length": 38.00380228136882, "alnum_prop": 0.623511755877939, "repo_name": "anx-ckreuzberger/user_foreign_key_testapp", "id": "ab9eceaa761b8efab8070b79360f5308...
Runtime.releaseService("arduino") Runtime.releaseService("servo01") # we tell to the service what is going on # intro.isServoActivated = False ## FIXME this gives error readonly intro.broadcastState()
{ "content_hash": "e208b859ef068b066ed968d2a3f01958", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 68, "avg_line_length": 25.625, "alnum_prop": 0.775609756097561, "repo_name": "MyRobotLab/myrobotlab", "id": "23a2ae3ebb00f8183652d073dfc52c465bfff066", "size": "677", "bin...
from oslo_config import cfg from oslo_serialization import jsonutils from urllib import parse as urlparse from watcher.tests.api import base as api_base from watcher.tests.objects import utils as obj_utils class TestListService(api_base.FunctionalTest): def _assert_service_fields(self, service): service...
{ "content_hash": "427ac5b1fc9b255a1c196a9a4510c1e0", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 75, "avg_line_length": 39.876344086021504, "alnum_prop": 0.5847377645948497, "repo_name": "stackforge/watcher", "id": "114534ad63890f04a28bf11ecbcd1912b7bbc705", "size": "...
class Solution(object): def sumNumbers(self, root): """ :type root: TreeNode :rtype: int """ return self.helper(root, 0) def helper(self, root, num): if not root: return 0 num = num * 10 + root.val if not root.left and not root.right: ...
{ "content_hash": "2aee2c4061e81b394de32344b4109de5", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 73, "avg_line_length": 27.8, "alnum_prop": 0.5323741007194245, "repo_name": "Lanceolata/code-problems", "id": "f7a81e2c4a180d0f485308171dc1e6dafd81a376", "size": "623", "...
__doc__ = """ A Django template loader for loading and converting SHPAML markup to HTML The django SHPAML template loader uses the official Python SHPAML implementation which can be found at http://shpaml.webfactional.com/ Note: the SHPAML implementation from the above link is included for your convenience. """ from...
{ "content_hash": "1548e7c5bd442b2d035ab1805f7f1a7c", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 80, "avg_line_length": 30.12121212121212, "alnum_prop": 0.6529175050301811, "repo_name": "watchdesigner/shpamlfork", "id": "a830f2e9106f1b8bf6d7bd5066231f870ebb7c53", "size...
import re import os import shutil from fabric.api import task, local, abort @task def script(name, filename=None): package = local('python setup.py --name', capture=True) if filename is None: filename = re.sub(r'[^a-z0-9]+', '_', name) scripts = os.path.join(package, 'scripts') filepath = os....
{ "content_hash": "a0b07008ad7eaf131c5b9ef60fd86e39", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 71, "avg_line_length": 28.689655172413794, "alnum_prop": 0.6105769230769231, "repo_name": "GaretJax/dockertools", "id": "7978af0159ef1858ab7f1d2294f8311fb7a77025", "size": ...
import os import ujson from typing import Any, Generator from django.core.management.base import BaseCommand, CommandParser from django.db.models import QuerySet from zerver.lib.message import render_markdown from zerver.models import Message def queryset_iterator(queryset, chunksize=5000): # type: (QuerySet, i...
{ "content_hash": "86043756a1c9c15e6bf235f3df647e9c", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 100, "avg_line_length": 40.71212121212121, "alnum_prop": 0.5805731298846297, "repo_name": "brockwhittaker/zulip", "id": "b98b8ed0e624dc88070dcdeed374e2c36a9a431d", "size": ...
""" Tests for the server_stop JSON RPC method """ import asyncio import unittest import asynctest import nose from .... import utils from mymcadmin.errors import ServerDoesNotExistError from mymcadmin.rpc.errors import JsonRpcInvalidRequestError class TestServerStop(utils.ManagerMixin, unittest.TestCase): """ ...
{ "content_hash": "43598e4b1eb8927411ad7cd3beae0987", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 69, "avg_line_length": 24.63157894736842, "alnum_prop": 0.625534188034188, "repo_name": "durandj/mymcadmin", "id": "415a1f4ab89e09022a4ebef865d99eef8fdde405", "size": "1872...
import string import sys import warnings ## Module level state. You'll need to set a synapse object at least ## before using this module. syn = None send_messages = True send_notifications = True acknowledge_receipt = False dry_run = False ## Edit these URLs to point to your challenge and its support forum defaults...
{ "content_hash": "daf86ea44702ea04892fdc1acfba10a8", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 128, "avg_line_length": 32.618852459016395, "alnum_prop": 0.6351300414624953, "repo_name": "thomasyu888/SynapseChallengeTemplates", "id": "89ffcdc1bde32cf2a4fa01fe55550c1c91...
import datetime from unittest import skipIf, skipUnless from django.core.exceptions import FieldError from django.db import NotSupportedError, connection from django.db.models import ( F, RowRange, Value, ValueRange, Window, WindowFrame, ) from django.db.models.aggregates import Avg, Max, Min, Sum from django.db.m...
{ "content_hash": "7baa68aad094dc1fa37491aa29f85095", "timestamp": "", "source": "github", "line_count": 798, "max_line_length": 118, "avg_line_length": 51.946115288220554, "alnum_prop": 0.5659421513521338, "repo_name": "frankvdp/django", "id": "ba757dfb947d108565f1256cddf157fd22c57ac6", "size": "41...
import urllib import logging from django import forms from django.db import models from django.utils.safestring import mark_safe from django.utils.html import conditional_escape from django.core.exceptions import ObjectDoesNotExist from django.db.models.signals import pre_save from .. widgets import APIChoiceWidget, A...
{ "content_hash": "2c2369c085ab916a1f3bef411812848a", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 145, "avg_line_length": 34.21568627450981, "alnum_prop": 0.566189111747851, "repo_name": "ff0000/scarlet", "id": "d9f3d7cf1a84df2e794c135bcf1141db7a825a6d", "size": "5235"...
import weakref from abc import ABCMeta, abstractmethod from typing import Any, ClassVar, Generic, MutableMapping, TypeVar _KeyT = TypeVar("_KeyT") _DataT = TypeVar("_DataT") class BaseNotes(Generic[_KeyT, _DataT], metaclass=ABCMeta): """This class defines a generic type-safe mechanism for associating additio...
{ "content_hash": "6a18f35387e235a4698801402c203493", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 81, "avg_line_length": 35.47826086956522, "alnum_prop": 0.6948529411764706, "repo_name": "eeshangarg/zulip", "id": "ae6885bddab9527753d379c94753c92dbe1faee0", "size": "1632...
import numpy as np import math import random import itertools import collections class NeuralNet: def __init__(self, n_inputs, n_outputs, n_hiddens, n_hidden_layers, activation_functions ): self.n_inputs = n_inputs # Number of network input signals self.n_outputs = n_outputs ...
{ "content_hash": "5191cff7b483a0a60aa00509bebb46ae", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 284, "avg_line_length": 44.04663212435233, "alnum_prop": 0.5400541112810258, "repo_name": "vibhatha/python-neural-network", "id": "4fb7b405bead42818b95ca4d4b3cbd4c1fdd040a",...
from copy import copy DEFAULT_SPECIAL_CHARS = [ ' ', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '-', '=', '+', '{', '}', '[', ']', '\\', '|', ':', ';', "'", '"', '/', ',', '<', '.', '>', '/', '?' ] class Autocompleter(object): autocomplete_words = set() '''Set with autocomplete words''' ...
{ "content_hash": "712a71284876680986c22f17cace5097", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 74, "avg_line_length": 37.53636363636364, "alnum_prop": 0.4298861709857108, "repo_name": "Bakterija/mmplayer", "id": "fb3f1ccf6b18499671e9b80003a86506ae1c3517", "size": "4...
""" Tools to handle reads sequenced with unique molecular identifiers (UMIs). """ from __future__ import print_function import editdist import gzip import os import re import sys from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter from collections import Counter, defaultdict from itertools import islice...
{ "content_hash": "3e4c1b2f9851e406c1adb9d0abd3608f", "timestamp": "", "source": "github", "line_count": 381, "max_line_length": 120, "avg_line_length": 33.24409448818898, "alnum_prop": 0.5647402494868151, "repo_name": "brwnj/umitools", "id": "9e952e94ce04f7403d652e6c387f67bfefac4824", "size": "1270...
class EigenvalueNumberError(Exception): def __init__(self, all_vals, unique_vals): self.all_vals, self.unique_vals = all_vals, unique_vals def __str__(self): return "Number of eigenvalues of K does not match \ dimension of the the Hilbert space. \n All vals: " \ ...
{ "content_hash": "d7b99b4fcbc4cc14ed391048ed3b265a", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 68, "avg_line_length": 28.105263157894736, "alnum_prop": 0.601123595505618, "repo_name": "sirmarcel/floq", "id": "3b5e0fdceb078f3fbeba3eb907b9825a86733018", "size": "534", ...
from django.contrib.auth.decorators import login_required from django.http import JsonResponse from django.shortcuts import redirect, render from django.views import View from experiments_manager.consumers import send_message from experiments_manager.helper import MessageStatus from git_manager.helpers.git_helper impo...
{ "content_hash": "98b0ce2c9277dfb5c87e70903551a413", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 83, "avg_line_length": 39.96825396825397, "alnum_prop": 0.7235901509134234, "repo_name": "MOOCworkbench/MOOCworkbench", "id": "193ed8a72b323b46fccdf60d4944069db945b980", "s...
import os from mi.logging import config from mi.dataset.driver.moas.gl.adcpa.adcpa_driver_common import AdcpaDriver from mi.dataset.dataset_parser import DataSetDriverConfigKeys from mi.core.versioning import version __author__ = "Jeff Roy" @version("0.3.0") def parse(unused, source_file_path, particle_data_handle...
{ "content_hash": "3b1c4d61b964ab04d54ccd65316ff9ef", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 80, "avg_line_length": 28.923076923076923, "alnum_prop": 0.6768617021276596, "repo_name": "oceanobservatories/mi-instrument", "id": "c2fc1a2789f055096ccecffb358f81a6dc5e328e"...
from smartbotsol import StateMachine import logging as logger log = logger.getLogger(__name__) class HandeledStateMachine(StateMachine): """ State machine with telegram handlers functionality For each new message search handlers for current state if this does not exists returns FallbackState and...
{ "content_hash": "708bddbbbd6d8b41ba5f8328865fd7a0", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 115, "avg_line_length": 41.69444444444444, "alnum_prop": 0.6269153897401732, "repo_name": "dqunbp/smartbotsol", "id": "ffab4e4ebd60ddf444a76364b4a4c8ab0e8585d2", "size": "3...
from configuration import * from utils import make_request, APIError class EverybitAPI(): def __init__(self): pass def get_account_info(self): """ Get user's account info. """ url = '%s/v1/account' % api_base_url return make_request(url) def get_v...
{ "content_hash": "a0321746aaf8d1e4751e99bc05f9de3e", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 78, "avg_line_length": 27.84722222222222, "alnum_prop": 0.5561097256857855, "repo_name": "everybit/everybit-python", "id": "341fbc915f11d038faf8fabaeb7c1eb84c7ea12f", "size...
import unittest from unittest.mock import patch import pytest from airflow.providers.google.cloud.transfers.presto_to_gcs import PrestoToGCSOperator TASK_ID = "test-presto-to-gcs" PRESTO_CONN_ID = "my-presto-conn" GCP_CONN_ID = "my-gcp-conn" IMPERSONATION_CHAIN = ["ACCOUNT_1", "ACCOUNT_2", "ACCOUNT_3"] SQL = "SELECT...
{ "content_hash": "4e47512e1428f3add18719dad0e7cf39", "timestamp": "", "source": "github", "line_count": 314, "max_line_length": 106, "avg_line_length": 36.11464968152866, "alnum_prop": 0.5828924162257496, "repo_name": "sekikn/incubator-airflow", "id": "3eb9f63025b02892808662286446db6680d11ff7", "si...
CACHES = { 'default': { 'BACKEND': 'django.core.cache.backends.dummy.DummyCache' } } # django will complain if we don't include this SECRET_KEY = 'dummysecret'
{ "content_hash": "7e1b0ef648af95be1fe5face8237649d", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 64, "avg_line_length": 22.125, "alnum_prop": 0.6497175141242938, "repo_name": "ssaw/django-inlinify", "id": "2350cc8b949a2c090d45e48deb5f45114742e891", "size": "220", "bin...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('census', '0005_auto_20170622_1416'), ] operations = [ migrations.AlterModelOptions( name='entity', options={'verbose_name_plural': '...
{ "content_hash": "8494b3e22c45cd4c4e311b9c9e352784", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 56, "avg_line_length": 20.529411764705884, "alnum_prop": 0.5988538681948424, "repo_name": "mujinyun2009/shakespeare-census", "id": "f1e155bc20ec8c9feb4e0e82fe312579d212f26c",...
import tornado.web import sqlite3 from model import Model import config class MainHandler(tornado.web.RequestHandler): def initialize(self): self.db = self.application.db def get(self): # Initializing cookie self.set_cookie('keyword', '') self.set_cookie('categoria', '') ...
{ "content_hash": "230f0fa13aee697c0717d34761693eb9", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 157, "avg_line_length": 46.70175438596491, "alnum_prop": 0.6012396694214877, "repo_name": "mr--dev/salepepe", "id": "520cb8f57303113adc13a086e4e25af5d611210c", "size": "53...
"""MSYS specifics for Msys terminal IO and for running shell scripts Configured for MSYS 1.0.17. exports msys_raw_input, MsysException, Msys Uses optional environment variable MSYS_ROOT_DIRECTORY. Set this to the full path of the MSYS home directory, 1.0 subdirectory in path optional. """ from msysio import raw_in...
{ "content_hash": "010081cde6bdfe16c2275fff99f43626", "timestamp": "", "source": "github", "line_count": 335, "max_line_length": 90, "avg_line_length": 32.77313432835821, "alnum_prop": 0.5835686310228618, "repo_name": "hanvo/MusicCloud", "id": "5e9f9db76dccb07618c9a3c7fe5f8dd278c8c643", "size": "110...
""" Example Airflow DAG that demonstrates interactions with Google Cloud Transfer. This DAG relies on the following OS environment variables * GCP_PROJECT_ID - Google Cloud Project to use for the Google Cloud Transfer Service. * GCP_TRANSFER_FIRST_TARGET_BUCKET - Google Cloud Storage bucket to which files are copied...
{ "content_hash": "3c7c5001e0149e965eba74641c8c55d5", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 100, "avg_line_length": 35.12307692307692, "alnum_prop": 0.709592641261498, "repo_name": "mrkm4ntr/incubator-airflow", "id": "c4cfa2e31efc3ceb2eec3dfab13dfbb42542f5b4", "s...
"""A re-implementation of the MS DirectoryService samples related to services. * Adds and removes an ActiveDirectory "Service Connection Point", including managing the security on the object. * Creates and registers Service Principal Names. * Changes the username for a domain user. Some of these functions are likel...
{ "content_hash": "59b564f7ebb960ed662bede8a1415b22", "timestamp": "", "source": "github", "line_count": 492, "max_line_length": 108, "avg_line_length": 39.697154471544714, "alnum_prop": 0.6368849521273873, "repo_name": "Microsoft/PTVS", "id": "7fd4ad379e4f76a10d2bd58e4d085533414aaadf", "size": "195...
from django.db import models # Create your models here. class order(models.Model): item_id = models.IntegerField(default=0) product = models.CharField(max_length=200) brandName = models.CharField(max_length=200) class useraccount(models.Model): username = models.EmailField(max_length=200) passwor...
{ "content_hash": "0d1dadc0a31b514834c7668e0e1864e1", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 48, "avg_line_length": 29.666666666666668, "alnum_prop": 0.7415730337078652, "repo_name": "Enyruas/Kitux", "id": "0713ecb14059eae511d190d73a21e4aab76e3760", "size": "356", ...
""" =========== Print Graph =========== Example subclass of the Graph class. """ # Author: Aric Hagberg (hagberg@lanl.gov) # Copyright (C) 2004-2019 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. # __docfo...
{ "content_hash": "715194c7bd673c2f8c1ecf86c121ec95", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 63, "avg_line_length": 27.040816326530614, "alnum_prop": 0.5637735849056604, "repo_name": "sserrot/champion_relationships", "id": "a9ad473cc7ff76047614fac3165e8297b388bf44", ...
import os import shutil import pdb import torch import torch.nn as nn import torch.nn.functional as F from auto_LiRPA.utils import logger class LSTMCore(nn.Module): def __init__(self, args): super(LSTMCore, self).__init__() self.input_size = args.input_size // args.num_slices self.hidden_s...
{ "content_hash": "316784a60e5b6c8ba4729118506bae1a", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 88, "avg_line_length": 33.592592592592595, "alnum_prop": 0.5780962881293642, "repo_name": "KaidiXu/auto_LiRPA", "id": "6e985b46e999ff1e20b3a082631ba8b0f8e26b8e", "size": "2...
""" Serializers """ import logging from rest_framework import serializers import todolistapp.models as models ''' from rest_framework.renderers import JSONRenderer import todolistapp.models as models;import todolistapp.serializers as serializers JSONRenderer().render(serializers.ListSerializer(models.List.objects.all...
{ "content_hash": "72a63f342ccee1b2cce51409f06f4fca", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 84, "avg_line_length": 26.766666666666666, "alnum_prop": 0.7123287671232876, "repo_name": "mannyrivera2010/todolist-py3-drf", "id": "f20c90b76bc39afe349475f83d7e6afd1f408c29"...
import os.path import unittest from flashproxy.keys import PIN_GOOGLE_CA_CERT, PIN_GOOGLE_PUBKEY_SHA1, check_certificate_pin, temp_cert class TempCertTest(unittest.TestCase): def test_temp_cert_success(self): fn = None with temp_cert(PIN_GOOGLE_CA_CERT) as ca_filename: self.assertTrue...
{ "content_hash": "3fda201fd58d70a4bf755f388bf24c7a", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 104, "avg_line_length": 34.5, "alnum_prop": 0.6111111111111112, "repo_name": "arlolra/flashproxy", "id": "0adff32d8d10d3e36f61f7b17983c6b2df1a33a8", "size": "828", "binar...
""" You're given a matrix represented by a two-dimensional array, and two positive integers r and c representing the row number and column number of the wanted reshaped matrix, respectively. The reshaped matrix need to be filled with all the elements of the original matrix in the same row-traversing order as they were....
{ "content_hash": "1612c6f1c8b9035ff26911d08e63127c", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 129, "avg_line_length": 33.450980392156865, "alnum_prop": 0.47245017584994137, "repo_name": "Vonzpf/LeetCode", "id": "6ce295a51a08570c8fd7676d8ad9789e7f695f6a", "size": "17...
from django.conf import settings from django.core.exceptions import ImproperlyConfigured DUAS_ENABLE_DB_WRITE = getattr(settings, 'DUAS_ENABLE_DB_WRITE', False) DUAS_DB_ROUTE_PREFIX = getattr(settings, 'DUAS_DB_ROUTE_PREFIX', 'unity_asset_server') class UnityAssetServerRouter(object):...
{ "content_hash": "2f85d1e29def527240962bb90641abd7", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 84, "avg_line_length": 32.320754716981135, "alnum_prop": 0.5674255691768827, "repo_name": "tarvitz/django-unity-asset-server-http-client", "id": "e1e19c23859e3e51973bb0f041c4...
import subprocess, shutil, sys, os def gen_image(scriptname, filename, fid='', view=True): basename = os.path.splitext(os.path.basename(filename))[0] subprocess.call('yosys %s scripts/%s' % (filename, scriptname), shell=True) shutil.copy('/home/lucas/.yosys_show.png', 'output/circuitimages...
{ "content_hash": "010042f2017256cbdbbf2ee59926db97", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 94, "avg_line_length": 39.05882352941177, "alnum_prop": 0.6325301204819277, "repo_name": "LSaldyt/qnp", "id": "7f176153e9a651d0169c5e7f8ab487aeb222c65e", "size": "687", "...
# Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies file copies with a trailing slash in the destination directory. """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('copies-slash....
{ "content_hash": "5f3c5c64fedd0dc149dbcda172ead398", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 72, "avg_line_length": 38.1578947368421, "alnum_prop": 0.5606896551724138, "repo_name": "Jet-Streaming/gyp", "id": "ec1d3cd4182c4f0bb0519d29d0735e706dca1422", "size": "1473...
from django.contrib.sites.models import Site from django.utils.translation import ugettext_lazy as _, get_language from cms.models.pagemodel import Page from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from cmsplugin_htmlsitemap import models import re class HtmlSitemapPlugin(CMSPlug...
{ "content_hash": "7c4f0b9298bc75b32d56ea26667c506d", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 85, "avg_line_length": 39.35, "alnum_prop": 0.6639135959339263, "repo_name": "raphaa/cmsplugin-htmlsitemap", "id": "26dcb19b08e317d2bf1a711abe5d481632e3f12e", "size": "1598...
__license__ = 'MIT License <http://www.opensource.org/licenses/mit-license.php>' __author__ = 'Lucas Theis <lucas@theis.io>' __docformat__ = 'epytext' from scipy.special import erf, erfinv from scipy.stats import norm from scipy.optimize import bisect from numpy import mean, sqrt, asarray, max, min, any from transform...
{ "content_hash": "6e182a019de8412443ef736d1302c9dd", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 80, "avg_line_length": 23.681159420289855, "alnum_prop": 0.6505507955936353, "repo_name": "lucastheis/isa", "id": "85eb0ed34aec6c919cee82f5578985a62cf4bd41", "size": "1634"...
import math import random import ps6_visualize import pylab # === Provided classes class Position(object): """ A Position represents a location in a two-dimensional room. """ def __init__(self, x, y): """ Initializes a position with coordinates (x, y). """ self.x = x ...
{ "content_hash": "10cb348d6a4348e72cd47de4db0e4a93", "timestamp": "", "source": "github", "line_count": 264, "max_line_length": 86, "avg_line_length": 28.117424242424242, "alnum_prop": 0.6289909739997306, "repo_name": "marioluan/mit-opencourseware-cs", "id": "065f97fff4ccc9e181b3c89cc72d2059bf246ea3"...
import os import sys import subprocess import time import datetime from Constantine import utils import requests def run(args): GOOGLE_CALENDAR_API = "https://www.googleapis.com/calendar/v3/calendars/" DAYS = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] XELATEX_TIMEOUT = ...
{ "content_hash": "de3064a7a5cea15da1e778c174e93797", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 222, "avg_line_length": 47.17741935483871, "alnum_prop": 0.6125356125356125, "repo_name": "icydoge/Constantine", "id": "2bb3100e032e11797dc8b230f3a0960b900791ce", "size": ...
"""Show the contents of a FIFF file. You can do for example: $ mne show_fiff test_raw.fif """ # Authors : Eric Larson, PhD import codecs import sys import mne def run(): """Run command.""" parser = mne.commands.utils.get_optparser( __file__, usage='mne show_fiff <file>') options, args = parser...
{ "content_hash": "07ecf8c6d5f8a08060f46a78f64051ea", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 70, "avg_line_length": 23, "alnum_prop": 0.6205533596837944, "repo_name": "nicproulx/mne-python", "id": "caad09bc10ee73e304011d044dacb0421afcf76c", "size": "781", "binary...
"""This should at some point be a library with functions to import and reconstruct Bruker MRI data. 2014, Joerg Doepfert """ import numpy as np # *********************************************************** # class definition # *********************************************************** class BrukerData: """Cl...
{ "content_hash": "253409c18ee9394c0974995f2c9760e8", "timestamp": "", "source": "github", "line_count": 405, "max_line_length": 79, "avg_line_length": 32.41481481481482, "alnum_prop": 0.5377818403412553, "repo_name": "jdoepfert/brukerMRI", "id": "4e8d80cbedd2287851b4d76071f1fb9a47b85596", "size": "...
import calendar import datetime import logging import time from google.appengine import runtime from google.appengine.api import datastore_errors from google.appengine.api import quota from google.appengine.api import taskqueue from google.appengine.ext import db import config import const import delete import model ...
{ "content_hash": "af55009294a5e633548aa9468cda029a", "timestamp": "", "source": "github", "line_count": 424, "max_line_length": 80, "avg_line_length": 38.653301886792455, "alnum_prop": 0.6094941729208615, "repo_name": "AwesomeTurtle/personfinder", "id": "cc04b38c4e6593ea670085db680ff6d7d427d363", "...
import logging import re from streamlink.exceptions import FatalPluginError, NoStreamsError, PluginError from streamlink.plugin import Plugin, PluginArgument, PluginArguments, pluginmatcher from streamlink.plugin.api import validate from streamlink.stream import HLSStream log = logging.getLogger(__name__) @pluginma...
{ "content_hash": "be4589bad501a7dac221d716c0ac3e14", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 98, "avg_line_length": 36.6282722513089, "alnum_prop": 0.5437392795883362, "repo_name": "melmorabity/streamlink", "id": "30bf6bdc0adc2684043c447fad6d6cc49cfb92b1", "size":...
import argparse import os import sys from annotate_source import Annotator from build_release import Builder from generate_bom import BomGenerator from refresh_source import Refresher from spinnaker.run import check_run_quick def __annotate_component(annotator, component): """Annotate the component's source but d...
{ "content_hash": "69f9b6c59db7a3de2b462c3216b641fd", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 111, "avg_line_length": 42.464646464646464, "alnum_prop": 0.7140818268315889, "repo_name": "jtk54/spinnaker", "id": "44df6441036175e6b02904718c2ce1a63465943e", "size": "482...
"""SPI support for USB-ISS""" from .usbiss import USBISS from .usbiss import USBISSError class SPI(object): """SPI operating mode of USBISS """ def __init__(self, port, mode=0, max_speed_hz=3000000): self._usbiss = USBISS(port) self.sck_divisor = 1 # Select the SPI mode of USB-...
{ "content_hash": "2a8615740d8dfb6cafcc075c0808817b", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 84, "avg_line_length": 26.385057471264368, "alnum_prop": 0.5536920060988891, "repo_name": "DancingQuanta/pyusbiss", "id": "8f137506d1161f6e2f09c3a1d79256fc1c04c13f", "size...
"""Support for composite queries without indexes.""" import pickle from . import common from .util import patch from google.appengine.api import datastore from google.appengine.datastore import datastore_index from google.appengine.datastore import datastore_pb from google.appengine.datastore import datastore_quer...
{ "content_hash": "1cf5d4a0c0e5ca8443e9c591e0538243", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 79, "avg_line_length": 31.85164835164835, "alnum_prop": 0.7088149042608246, "repo_name": "googlearchive/mimic", "id": "bbe9a376c65fd07b6ff11358461e4c5d70caee1b", "size": "...
""" @file @brief Creates a custom log (open a text file and flushes everything in it). """ import datetime import os class CustomLog: """ Implements a custom logging function. This class is not protected against multithreading. Usage: :: clog = CustomLog("folder") clog('[fct]', i...
{ "content_hash": "6798601426a2ee2f444a303264d3cec0", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 88, "avg_line_length": 30.75, "alnum_prop": 0.48623131392604246, "repo_name": "sdpython/pyquickhelper", "id": "7231acd344608ee0ad43d064161c163c091c0221", "size": "3837", ...
""" wasi-sdk installation and maintenance """ from mod import log, wasisdk def run(fips_dir, proj_dir, args): if len(args) > 0: cmd = args[0] if cmd == 'install': wasisdk.install(fips_dir) elif cmd == 'uninstall': wasisdk.uninstall(fips_dir) else: ...
{ "content_hash": "351ba0edf65b5e7460424fbb5a85e776", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 88, "avg_line_length": 29.652173913043477, "alnum_prop": 0.5454545454545454, "repo_name": "floooh/fips", "id": "fcc6b82cb357e436d6176f908968f3a6519d9ee3", "size": "682", ...