text
stringlengths
4
1.02M
meta
dict
"""Windows platform implementation.""" import errno import os import sys import platform import warnings import _psutil_mswindows from _psutil_mswindows import ERROR_ACCESS_DENIED from psutil._error import AccessDenied, NoSuchProcess, TimeoutExpired from psutil._common import * from psutil._compat import PY3, xrange,...
{ "content_hash": "8ccd37ac133dac4f2f7ec25a340f7648", "timestamp": "", "source": "github", "line_count": 449, "max_line_length": 88, "avg_line_length": 35.51893095768374, "alnum_prop": 0.6100451467268623, "repo_name": "CaiZhongda/psutil", "id": "f640d492ac2e3150852e54128f7e387f8c22b591", "size": "16...
from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('scim', '0003_auto_20221031_1713'), ] operations = [ migrations.RemoveField( model_name='scimplatformsettings', name='segment_setting...
{ "content_hash": "9ef32517810de7f274cb5033b1294705", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 127, "avg_line_length": 28.136363636363637, "alnum_prop": 0.617124394184168, "repo_name": "onepercentclub/bluebottle", "id": "d705c4cc3ab8eaebe4b564ffed8c43d970f1cc47", "si...
import os.path import riak import django_riak import pwd import os import os.path import yaml # Django settings for riagi project. if pwd.getpwuid(os.getuid())[0] == "dotcloud": RIAK_HOST = "riak01.riagi.com" RIAK_PORT = "8098" DEBUG = False elif os.path.isfile('/etc/riagi/riak_lb.yaml'): doc = open('...
{ "content_hash": "bea4e34a27779dafabbfaef3aa59493e", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 78, "avg_line_length": 26.095238095238095, "alnum_prop": 0.6614963503649635, "repo_name": "jsmartin/riagi", "id": "201a1f9dd49f1f868e093527e8c0cb7910274e33", "size": "3288...
from manage_cloudant import authenticate_cloudant_instance, run_ask_runs if __name__ == '__main__': import argparse parser = argparse.ArgumentParser(description='Generate New Cloudant API key') parser.add_argument('--username', dest='username', required=True, help='Cloudant userna...
{ "content_hash": "83785b309baab04426f6d64e7a7c52e0", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 86, "avg_line_length": 37.92307692307692, "alnum_prop": 0.6561866125760649, "repo_name": "dimagi/commcare-hq", "id": "159d91c740d49fd98f8f1b53c3f74ac89c16624f", "size": "98...
from django.shortcuts import render, redirect, get_object_or_404 from models import Contact, Group from django.contrib import messages from forms import ContactForm, GroupForm, ImportUploadForm from django.contrib.auth.decorators import login_required import csv @login_required def index(request): """ Contacts lis...
{ "content_hash": "27d9a1d2ddd11ccea7117fee083c3e41", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 120, "avg_line_length": 41.006410256410255, "alnum_prop": 0.6374863217133031, "repo_name": "jscott1989/holloway", "id": "583ab3a110f66a5ccdc2ff885c4862bfb204218c", "size":...
from django.forms import ModelForm, forms, DateInput from appPonto.models import * from django import forms class FuncionarioForm(ModelForm): senha = forms.CharField(label='Senha', widget=forms.PasswordInput, required=False) class Meta: model = Funcionario fields = ( 'nome', 'matricula'...
{ "content_hash": "501ac2883a197f6451fc1e8ddce94375", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 102, "avg_line_length": 29.516129032258064, "alnum_prop": 0.6459016393442623, "repo_name": "Ednilsonpalhares/SCEFA", "id": "ec83745e7418943106d37b1a60cf34d81007fcb1", "size...
from __future__ import print_function import unittest import numpy as np import paddle.fluid as fluid from paddle.fluid.dygraph.nn import Conv2D, Pool2D, FC class SimpleImgConvPool(fluid.dygraph.Layer): def __init__(self, name_scope, num_filters, filter_size, ...
{ "content_hash": "b71d638834d8fdf168748d1eb5435c56", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 74, "avg_line_length": 30.60330578512397, "alnum_prop": 0.5031055900621118, "repo_name": "tensor-tang/Paddle", "id": "1c72a41411e0bc23973ae4c69bcd75a192cce5ad", "size": "4...
from dry_rest_permissions.generics import DRYPermissionFiltersBase from django.db.models import Q from apps.registration.models import Assignment from .models import Appearance from .models import Round class AppearanceFilterBackend(DRYPermissionFiltersBase): def filter_list_queryset(self, request, queryset, vi...
{ "content_hash": "cc147e396269146eecdc1a146ee8c4d3", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 112, "avg_line_length": 37.91428571428571, "alnum_prop": 0.5923134890730972, "repo_name": "dbinetti/barberscore", "id": "c2fa9eb095e79fc2e0303665b1964f73e247adf7", "size":...
from twisted.words.protocols import irc from txircd.modbase import Command from txircd.utils import irc_lower, epoch class ModeCommand(Command): def onUse(self, user, data): if "targetchan" in data: if "modes" in data: data["targetchan"].setMode(user, data["modes"], data["params...
{ "content_hash": "45f2ce1c778ef74e71ef5b22770caf87", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 145, "avg_line_length": 43.03658536585366, "alnum_prop": 0.5103428733352224, "repo_name": "DesertBus/txircd", "id": "b92cae7eaefdf79c339d847e4d06bf22f1fa46f4", "size": "352...
""" $description Global live streaming and video on-demand hosting platform. $url dailymotion.com $type live, vod """ import logging import re from streamlink.exceptions import NoStreamsError from streamlink.plugin import Plugin, pluginmatcher from streamlink.plugin.api import validate from streamlink.stream.hls impo...
{ "content_hash": "e96ae7dad6b14db60d42f6fbee710b6e", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 100, "avg_line_length": 31.72072072072072, "alnum_prop": 0.5714285714285714, "repo_name": "gravyboat/streamlink", "id": "8986131afc8e5e18ab0a45a604bfd41d98a21027", "size":...
from django.apps import apps from django.urls import reverse import shopify class ConfigurationError(BaseException): pass class LoginProtection(object): def __init__(self, get_response): self.get_response = get_response self.api_key = apps.get_app_config('shopify_app').SHOPIFY_API_KEY ...
{ "content_hash": "02ae560172b8322baea579687a9b3d9e", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 110, "avg_line_length": 45.111111111111114, "alnum_prop": 0.6822660098522167, "repo_name": "Shopify/shopify_django_app", "id": "854ecec8b683e87992a983c40c6e63b89b7005b5", "...
""" This algorithm determines if a spike train `spk` can be considered as stationary process (constant firing rate) or not as stationary process (i.e. presence of one or more points at which the rate increases or decreases). In case of non-stationarity, the output is a list of detected Change Points (CPs). Essentially,...
{ "content_hash": "c4e2d371e6c4c6c842bc0fba0021063e", "timestamp": "", "source": "github", "line_count": 501, "max_line_length": 79, "avg_line_length": 37.025948103792416, "alnum_prop": 0.620754716981132, "repo_name": "JuliaSprenger/elephant", "id": "fb24763db9fdf04e05702c22151e5463cf27cd3a", "size"...
import unittest from katas.kyu_7.remove_the_minimum import remove_smallest class RemoveSmallestTestCase(unittest.TestCase): def test_equals(self): self.assertEqual(remove_smallest([1, 2, 3, 4, 5]), [2, 3, 4, 5]) def test_equals_2(self): self.assertEqual(remove_smallest([5, 3, 2, 1, 4]), [5, ...
{ "content_hash": "7ce3e8aa7161b4698ac2719c0ad91f6c", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 72, "avg_line_length": 30.176470588235293, "alnum_prop": 0.6237816764132553, "repo_name": "the-zebulan/CodeWars", "id": "bb489edd5e4442b7bddd01e2338aaef9db252afb", "size": ...
class Connector(): """ Simple signal-slot connector """ def __init__(self): self.connections = {} self._nextid = 0 def emit(self, signal_id, payload): if signal_id in self.connections: for action in self.connections[signal_id].values(): action(sel...
{ "content_hash": "786e84c1df3af5e267b465a6572605be", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 63, "avg_line_length": 31.666666666666668, "alnum_prop": 0.5801169590643275, "repo_name": "uppi/meduzach", "id": "b3d21651b1dc8721b46a45d0cfeaede08d858efc", "size": "855", ...
from django.forms import BooleanField, Form from django.conf import settings from django.contrib import messages from vumi.persist.redis_manager import RedisManager from vxpolls.manager import PollManager from go.conversation.view_definition import ( ConversationViewDefinitionBase, ConversationTemplateView) from ...
{ "content_hash": "d541c7df0a312b404350c46ef41f3786", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 78, "avg_line_length": 36.88034188034188, "alnum_prop": 0.6329084588644264, "repo_name": "praekelt/vumi-go", "id": "1d9cd88d1637d2b9096300bf75750a1882fea28d", "size": "431...
"""Unit tests for the auths module.""" import github3 from . import helper url_for = helper.create_url_helper("https://api.github.com/authorizations/1") class TestAuthorization(helper.UnitHelper): """Authorization unit tests.""" described_class = github3.auths.Authorization get_auth_example_data = help...
{ "content_hash": "12599f24a5ca447b2bf6b5f65516feb0", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 78, "avg_line_length": 33.35443037974684, "alnum_prop": 0.6432637571157496, "repo_name": "sigmavirus24/github3.py", "id": "38836a8e00b87aa80879163c3751806b52312ea8", "size"...
from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse, Http404 import json # Create your views here. #Imported Models from .models import Track #look for the track, based on the title passed by url def classic_view(request, title): #Classic try/catch try: track ...
{ "content_hash": "42f9583e0132fc05efc4952ba0354605", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 67, "avg_line_length": 24.29787234042553, "alnum_prop": 0.6558669001751314, "repo_name": "ronsuez/sfotipy-mejorando.la", "id": "af65f316a8cf7f49e6a48a881918bb4502bcdd91", "...
config={} with open('etc/pkg/config', 'r') as config_file: exec(config_file.read(), config) print('pkg for FreeBSD %s %s' % (config['DIST'], config['ARCHITECTURE'][1])) import os import subprocess import sys import re import io import shutil import copy try: import urllib2 except ImportError: ...
{ "content_hash": "deb24e8438f1b1bb9bbefab65097b53c", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 132, "avg_line_length": 31.078787878787878, "alnum_prop": 0.4668486739469579, "repo_name": "nmercier/linux-cross-gcc", "id": "b04e562aa011caae22c759259c2210aa82dca9a8", "s...
from .graph import * from .check_order import *
{ "content_hash": "0e2e42eab2abef78ced89bd9fb30d574", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 26, "avg_line_length": 24, "alnum_prop": 0.7291666666666666, "repo_name": "henzk/ape", "id": "55457548db794777cd75b436d48ac24a3e3afc23", "size": "48", "binary": false, "...
""" Created on Mon Sep 1 00:33:43 2014 @author: andreas """ import Queue import signal import threading import time import PySQLPool class filler(threading.Thread): def run(self): print("{} started!".format(self.getName())+"\n") # "Thread-x started!" self._loop = True loop...
{ "content_hash": "9616abb4069336f6563f73ea0ce6d19b", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 170, "avg_line_length": 28.34375, "alnum_prop": 0.5429988974641676, "repo_name": "eieste/mccaching", "id": "7e603a5dafd7b1897890c722cf06156bc062a893", "size": "1856", "bi...
"""Run AFL repeatedly with externally supplied generated config from STDIN.""" import logging import tempfile import os import sys import afl from faucet import config_parser as cp from faucet.conf import InvalidConfigError ROUNDS = 50000 LOGNAME = 'FAUCET_FUZZER_LOG' tmpdir = tempfile.mkdtemp() conf_file_name = ...
{ "content_hash": "40956b91a1bdc60659045a20eeabb27e", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 78, "avg_line_length": 23.902439024390244, "alnum_prop": 0.6744897959183673, "repo_name": "anarkiwi/faucet", "id": "f161354a0520a897b6a70fd02ae88ee6c848d780", "size": "1004...
from beyonic.apis.abstract_api import AbstractAPI class Collection(AbstractAPI): """ Collection api wrapper class """ _method_path = 'collections'
{ "content_hash": "59b27af69302c32969150981284215c1", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 49, "avg_line_length": 20.625, "alnum_prop": 0.696969696969697, "repo_name": "beyonic/beyonic-python", "id": "cc7065af31b6f586c7c4987c054b15ddc1f08aa1", "size": "165", "bi...
import tweepy import sys from alchemyapi import AlchemyAPI import json alchemyapi = AlchemyAPI() tweets = [] def get(num,tweettype,query,callback): config = {} execfile("config.conf", config) auth = tweepy.OAuthHandler(config["consumer_key"], config["consumer_secret"]) auth.set_access_token(config["a...
{ "content_hash": "058f6be7cafe097ecbafc675d1a03348", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 84, "avg_line_length": 29.21951219512195, "alnum_prop": 0.5951585976627712, "repo_name": "Shy/AngelHackCincinnati", "id": "97d0ddc25d0b8469e0ef5a9672a80dbefa36170f", "size"...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('api', '0149_userpreferences_invalid_email'), ] operations = [ migrations.AlterField( model_name='userpreferences', name='def...
{ "content_hash": "b162ae7460cf9e7183ca14bdc6ebf422", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 237, "avg_line_length": 32.68421052631579, "alnum_prop": 0.6264090177133655, "repo_name": "SchoolIdolTomodachi/SchoolIdolAPI", "id": "802e2c7276b80c55553cf3918c08d6c6fb906b41...
"""Support for Hugo-style shortcodes.""" from __future__ import unicode_literals from .utils import LOGGER import sys # Constants _TEXT = 1 _SHORTCODE_START = 2 _SHORTCODE_END = 3 class ParsingError(Exception): """Used for forwarding parsing error messages to apply_shortcodes.""" pass def _format_positi...
{ "content_hash": "d5da88589c9ced219b2c2096b39b39f8", "timestamp": "", "source": "github", "line_count": 305, "max_line_length": 181, "avg_line_length": 38.19672131147541, "alnum_prop": 0.5591416309012875, "repo_name": "x1101/nikola", "id": "75dd5fb905d8bc83119cdc90383917eafe437ad7", "size": "12792"...
from tartist.nn import Env, opr as O import numpy as np import unittest import functools class TestNNOprTensor(unittest.TestCase): @functools.wraps(np.allclose) def assertTensorClose(self, *args, **kwargs): return self.assertTrue(np.allclose(*args, **kwargs)) def testAdvancedIndexing(self): ...
{ "content_hash": "3aae637e9291a6f03fe1176fe5e38637", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 108, "avg_line_length": 40.333333333333336, "alnum_prop": 0.6198347107438017, "repo_name": "vacancy/TensorArtist", "id": "ba88cb41006bc0f52862499b96a28d001994dcdb", "size":...
from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migratio...
{ "content_hash": "41281761b16deb688a3f0a3cd1cf1ad0", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 203, "avg_line_length": 48.561797752808985, "alnum_prop": 0.542572882924572, "repo_name": "jbradberry/django-diplomacy", "id": "ed08118e53d9a3073288fb6568df31116c54bb5a", ...
a, s = map(int, input().split()) print('Congratulations!' if a >= s else 'Enjoy another semester...')
{ "content_hash": "9fa98a5f5c056b31a3f534430127c07f", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 68, "avg_line_length": 51, "alnum_prop": 0.6470588235294118, "repo_name": "knuu/competitive-programming", "id": "6a7c8646fa28ba6fb7f6161a309901af4ae47b37", "size": "102", ...
from remote import Remote from transaction import Transaction as transaction from singletons import * generate_keypair = signer.generate_keypair sign = signer.sign
{ "content_hash": "4569c998143798a2567165f696a75614", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 50, "avg_line_length": 27.5, "alnum_prop": 0.8303030303030303, "repo_name": "johansten/rtxp-py", "id": "d71ddfbcc2c59bf6c41033c212670936193fefe4", "size": "166", "binary":...
"""Tests for utilities for testing distributions and/or bijectors.""" import warnings from absl.testing import parameterized import numpy as np import tensorflow.compat.v2 as tf from tensorflow_probability.python.distributions import lognormal from tensorflow_probability.python.distributions import normal from tenso...
{ "content_hash": "53f8155605c3d1ac0019a72f477dc45a", "timestamp": "", "source": "github", "line_count": 217, "max_line_length": 80, "avg_line_length": 39.40552995391705, "alnum_prop": 0.6154835691731961, "repo_name": "tensorflow/probability", "id": "034700a05d07b1b1aa09aaad5507e5c4f24135f3", "size"...
import random from locust import HttpUser, TaskSet, task, between from pyquery import PyQuery class BrowseDocumentation(TaskSet): def on_start(self): # assume all users arrive at the index page self.index_page() self.urls_on_current_page = self.toc_urls @task(10) def index_page(se...
{ "content_hash": "6df47b6409769c5d5a9b3b4e6d8a149e", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 77, "avg_line_length": 30.658536585365855, "alnum_prop": 0.6332537788385044, "repo_name": "locustio/locust", "id": "7d2e3471c13d2efd0710042e4d090d684cb16a77", "size": "1376...
import base64 import fileinput import os import pickle import platform import re import sys import fnmatch from collections import defaultdict from datetime import datetime from gppylib import gplog, gpversion from gppylib.commands.base import Command, ExecutionError, WorkerPool, REMOTE from gppylib.commands.gp import...
{ "content_hash": "029935696059939c28de8a7fecd477a6", "timestamp": "", "source": "github", "line_count": 1469, "max_line_length": 161, "avg_line_length": 45.047651463580664, "alnum_prop": 0.5719984888553079, "repo_name": "xuegang/gpdb", "id": "ee2fd1a1b38eee4589d7dbd6a2a978032be02652", "size": "6662...
from sensordatainterface.base_views import * from django.views.generic import DetailView from sensordatainterface.forms import * # Detail View Generic. class GenericDetailView(DetailView): @method_decorator(login_required(login_url=LOGIN_URL)) def dispatch(self, *args, **kwargs): return super(GenericD...
{ "content_hash": "a44caf032aea72aebd7c3ff38e87da5c", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 120, "avg_line_length": 42.61467889908257, "alnum_prop": 0.6753498385360602, "repo_name": "UCHIC/ODM2Sensor", "id": "f0f0eca396d1a1fda6b97e63a63cdc0d1d022c18", "size": "46...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sistema', '0019_auto_20161027_1147'), ] operations = [ migrations.AlterField( model_name='lote', name='socio', f...
{ "content_hash": "e37f432d1f76b95804152326af38806c", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 79, "avg_line_length": 22.444444444444443, "alnum_prop": 0.5965346534653465, "repo_name": "gabrielf10/webAmpunc", "id": "cab6355441164cdad6ac43e4a66bce6d49848a4a", "size": ...
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Difference'] , ['Lag1Trend'] , ['BestCycle'] , ['MLP'] );
{ "content_hash": "5b1635643bb4b1d75f9f0c07eb65b183", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 80, "avg_line_length": 38.25, "alnum_prop": 0.7058823529411765, "repo_name": "antoinecarme/pyaf", "id": "3c466da56d4f1810997d3eacf22331937b7a9901", "size": "153", "binary"...
import datetime import logging from datetime import timedelta from django import forms from django.core.validators import ValidationError from django.db.models import Q from django.forms import widgets from django.utils.translation import get_language import happyforms import jinja2 from tower import ugettext as _, u...
{ "content_hash": "dde2f14313d0255c187fe3406acdda75", "timestamp": "", "source": "github", "line_count": 482, "max_line_length": 79, "avg_line_length": 41.558091286307054, "alnum_prop": 0.5659727422495132, "repo_name": "Nolski/olympia", "id": "596a60248d16ae20ece8e8bcf2cfee74458c08c8", "size": "2003...
from oslo.config import cfg SQLALCHEMY_OPTIONS = ( cfg.StrOpt('uri', default='sqlite:///:memory:', help='An sqlalchemy URL'), ) SQLALCHEMY_GROUP = 'drivers:storage:sqlalchemy' def _config_options(): return [(SQLALCHEMY_GROUP, SQLALCHEMY_OPTIONS)]
{ "content_hash": "e0e4a3d5f7bf6c27f9eec46dcd9dc8c9", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 51, "avg_line_length": 22.833333333333332, "alnum_prop": 0.6678832116788321, "repo_name": "rackerlabs/marconi", "id": "2963afc8aa3af0afec63eec703115dce91021944", "size": "8...
""" Config sharing convention. Reports service config protected by basic auth for securely running services locally with realistic config. """ from json import dumps, loads from microcosm.loaders.compose import PartitioningLoader from microcosm_flask.audit import skip_logging from microcosm_flask.conventions.base i...
{ "content_hash": "e87c683655b1ea1ea4c7b6b5f7effd13", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 85, "avg_line_length": 29.05263157894737, "alnum_prop": 0.6802536231884058, "repo_name": "globality-corp/microcosm-flask", "id": "160a880b322bfcfafca6201882bf9016fa0be297", ...
""" Script to pull the latest changes from the SerGIS Server git repository and put them in the web directory. The defaults here assume: - IIS with iisnode - SerGIS Socket Server service set up through NSSM But it can be easily modified for a different environment. Before running this, make sure to set the configur...
{ "content_hash": "52d53544e74891542c80f62cf2737c2d", "timestamp": "", "source": "github", "line_count": 279, "max_line_length": 139, "avg_line_length": 34.99641577060932, "alnum_prop": 0.5910487505120852, "repo_name": "sergisproject/server-scripts", "id": "0310f6ec97cfa29975e2db8d2d2e150fe82136c1", ...
import datetime import operator import ceilometer from ceilometer.alarm.storage import base from ceilometer.alarm.storage import models from ceilometer.i18n import _ from ceilometer.openstack.common import log from ceilometer.storage.hbase import base as hbase_base from ceilometer.storage.hbase import migration as hba...
{ "content_hash": "7cd65c9ebe9745daf5320a64abf4ea18", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 78, "avg_line_length": 38.04242424242424, "alnum_prop": 0.5755934363549466, "repo_name": "yanheven/ceilometer", "id": "7b0d43929e3a546d59c7acc238024201e353c87e", "size": "...
from pkg1 import subpkg2 from pkg1.subpkg2 import mod2 from pkg1.subpkg2.mod2 import VAR from subpkg1 import mod3 # malformed imports from from import from pkg1.subpkg2 import # absolute imports import pkg1.subpkg2 as foo from pkg1 import subpkg2 as bar print(subpkg2, mod3, mod2, foo, bar, VAR)
{ "content_hash": "4341041ef922f480bbe2520cbd4516df", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 41, "avg_line_length": 19.933333333333334, "alnum_prop": 0.7959866220735786, "repo_name": "diorcety/intellij-community", "id": "f3926e749629b47a9e2f5b0fe27b32a55de63aa5", "...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Colonia', fields=[ ('id', models.AutoField(auto_cre...
{ "content_hash": "56be0cead4803d1046503761e49158b9", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 114, "avg_line_length": 22.857142857142858, "alnum_prop": 0.5708333333333333, "repo_name": "agustin320/carpoolme", "id": "b943a9c1369aec351115d64a2a72ec412e70cd07", "size":...
from ..postgresql.introspection import * # NOQA
{ "content_hash": "ecd97718052aebd1f28e25376dddbd20", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 48, "avg_line_length": 49, "alnum_prop": 0.7551020408163265, "repo_name": "letouriste001/SmartForest_2.0", "id": "922f499a6dda8f9bd662932aa0b4ab6b190aba3a", "size": "49", ...
from __future__ import unicode_literals # noinspection PyCompatibility from builtins import int, str from datetime import date, datetime from typing import Any, Dict, Union from future.utils import viewitems from zsl.utils.date_helper import format_date_portable, format_datetime_portable DATE_DATA = 'date_data' DAT...
{ "content_hash": "2dbdb0b873e7df79605eb82051111e7f", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 80, "avg_line_length": 38.425, "alnum_prop": 0.571893298633702, "repo_name": "AtteqCom/zsl", "id": "fb748712455448fa93a0f939ab9999f6ac987087", "size": "3074", "binary": f...
"""Main Controller""" from tg import expose, flash, require, url, request, redirect from pylons.i18n import ugettext as _, lazy_ugettext as l_ from catwalk.tg2 import Catwalk from repoze.what import predicates from brie.lib.base import BaseController from brie.lib.aurore_helper import * from brie import model import...
{ "content_hash": "121fb21700448ee0f66decc230842dcd", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 77, "avg_line_length": 33.8, "alnum_prop": 0.7562130177514793, "repo_name": "Rbeuque74/brie-aurore", "id": "eeb6b3cce1e3db130426aa0095a5e21a4a7b005a", "size": "2559", "bi...
import copy import httplib2 from oslo_serialization import jsonutils as json from oslotest import mockpatch from tempest.services.compute.json import quota_classes_client from tempest.tests import base from tempest.tests import fake_auth_provider class TestQuotaClassesClient(base.TestCase): FAKE_QUOTA_CLASS_SE...
{ "content_hash": "0b1ea7f32b320fce3929766ccc697b69", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 79, "avg_line_length": 35.92537313432836, "alnum_prop": 0.6364769422517657, "repo_name": "tudorvio/tempest", "id": "ff9b31031d312e4f7771f7e64a1929c03718b9e6", "size": "3038...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools from ._Qt import QtCore, QtWidgets, QtGui from pxr import Gf, Tf, Sdf from . import compatability # A Note on 'None' # # This file aims to provide editors that are compatable with all # VtV...
{ "content_hash": "9c78dd6175a43fcbe27398b3d82b154a", "timestamp": "", "source": "github", "line_count": 733, "max_line_length": 90, "avg_line_length": 35.74761255115962, "alnum_prop": 0.6230965919932833, "repo_name": "pxmkuruc/usd-qt", "id": "f46570124a4528673b2fb3330764dbf2eaeacfee", "size": "2726...
import os.path theme_path = os.path.dirname(__file__)
{ "content_hash": "bc899158e95f12a86008290252fe241d", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 38, "avg_line_length": 14, "alnum_prop": 0.6785714285714286, "repo_name": "qmcs/pelicanium", "id": "d66519c9161a6651fb10cf0426c745a21d74cc64", "size": "56", "binary": fals...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('reports', '0010_auto_20170508_0943'), ] operations = [ migrations.RemoveField( model_name='report', name='verified', ...
{ "content_hash": "a0f8b6fe960373be5e9b2405972955f8", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 135, "avg_line_length": 25.727272727272727, "alnum_prop": 0.5565371024734982, "repo_name": "johnobrien/edmw", "id": "eeed9fe01f46e37ae0ae91616a668247e03d5f58", "size": "637...
''' Pseudo-random django secret key generator. via https://gist.github.com/mattseymour/9205591 ''' import string import random # Get ascii Characters numbers and punctuation (minus quote characters as they could terminate string). chars = ''.join([string.ascii_letters, string.digits, string.punctuation]).replace('\''...
{ "content_hash": "e12386e2b83ac885086ab41d4674c0eb", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 127, "avg_line_length": 33.8, "alnum_prop": 0.7120315581854043, "repo_name": "PrincessTeruko/TeruPages", "id": "9ba4f6c5c14846f1622eb56a6c47ef693e39056b", "size": "531", ...
import sys from typing import Any, Callable, Dict, Optional, TypeVar, Union, cast from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, map_error, ) from azure.core.pipeline import PipelineResponse...
{ "content_hash": "a17b87e0e895b27d15b594152f3897e1", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 129, "avg_line_length": 46.456647398843934, "alnum_prop": 0.6682841856414085, "repo_name": "Azure/azure-sdk-for-python", "id": "9337dc341ee7efddf21b6800b18ce8f92b8b98c2", ...
from __future__ import unicode_literals from django.db import models, migrations def insert_category_form(apps, schema_editor): # We can't import the Person model directly as it may be a newer # version than this migration expects. We use the historical version. ResourceCategory = apps.get_model("web", "...
{ "content_hash": "65c6e5e009c0085d5ef7dbe407d5340f", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 73, "avg_line_length": 29.5, "alnum_prop": 0.7026194144838213, "repo_name": "edilio/tobeawebproperty", "id": "1db4bd5d0281cdcb44b419d4f759a2e98a95e5db", "size": "673", "b...
from __future__ import division from iotbx.pdb.multimer_reconstruction import multimer import iotbx.pdb import mmtbx.f_model from cctbx import xray import scitbx.lbfgs import getpass import os import sys from scitbx.array_family import flex ncs_1_copy="""\ MTRIX1 1 1.000000 0.000000 0.000000 0.00000 1 M...
{ "content_hash": "cb9c78595dd877fb7a2b06f6eb88b089", "timestamp": "", "source": "github", "line_count": 412, "max_line_length": 80, "avg_line_length": 36.26699029126213, "alnum_prop": 0.6383348949270513, "repo_name": "youdar/work", "id": "271941862362dc98423ab0dc905279b724a095ce", "size": "14942", ...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'FeaturedRep.user' db.delete_column(u'featuredrep_featuredrep', 'user_id') def backwards(self, orm): ...
{ "content_hash": "fb9a41665bf00b594837c056f15ae284", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 187, "avg_line_length": 66.02898550724638, "alnum_prop": 0.5625548726953468, "repo_name": "abdullah2891/remo", "id": "2feab688d07570c757ad1faca88c9674eb81a6fc", "size": "45...
import logging import sys import numpy as np from .... import Executor from .... import io from .... import core, scope_guard from ....compiler import CompiledProgram from ....compiler import BuildStrategy from ....framework import IrGraph, Variable, Program from ....log_helper import get_logger from ..core.strategy im...
{ "content_hash": "b4ad7b8f45ec680641cf298b41faa3fb", "timestamp": "", "source": "github", "line_count": 240, "max_line_length": 119, "avg_line_length": 45.125, "alnum_prop": 0.566943674976916, "repo_name": "chengduoZH/Paddle", "id": "5004faeea78c1491ef33e7ebc6bee2b45d9823d8", "size": "11441", "bi...
"""A pool for sqlite connections.""" import logging import threading import traceback from typing import Any from sqlalchemy.exc import SQLAlchemyError from sqlalchemy.pool import NullPool, SingletonThreadPool, StaticPool from homeassistant.helpers.frame import report from homeassistant.util.async_ import check_loop ...
{ "content_hash": "bc8f3ff17d02ab2ac3a4ae34b01bad00", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 87, "avg_line_length": 31.43661971830986, "alnum_prop": 0.5965501792114696, "repo_name": "nkgilley/home-assistant", "id": "a8579df834c36e85eef170e440623c293e05ece0", "size...
""" Implements a disjoint set using Lists and some added heuristics for efficiency Union by Rank Heuristic and Path Compression """ class DisjointSet: def __init__(self, set_counts: list) -> None: """ Initialize with a list of the number of items in each set and with rank = 1 for each set ...
{ "content_hash": "233f01116aa81b85607367bd13967c69", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 78, "avg_line_length": 32.23529411764706, "alnum_prop": 0.5456204379562044, "repo_name": "TheAlgorithms/Python", "id": "5103335bc80a91deb0490bda6bc36498f5d6f24f", "size": "...
import sys import json import time import datetime from airflow.contrib.hooks.gcs_hook import GoogleCloudStorageHook from airflow.hooks.postgres_hook import PostgresHook from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults from decimal import Decimal from tempfile import NamedTem...
{ "content_hash": "7fefc50f3aa733bec5edbe990a05fca4", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 86, "avg_line_length": 38.77637130801688, "alnum_prop": 0.5873775843307943, "repo_name": "fenglu-g/incubator-airflow", "id": "78da78ee2f20d99650682543b4a4e597f1c281e6", "s...
import random import logging from django.contrib.auth.models import User from .models import Task def add_tasks(*args): """Добавляет три задачи для каждого пользователя в системе.""" tasks = [] for user in User.objects.all(): tasks += [Task(task=task * 5, user=user) for task in 'xyz'] Task...
{ "content_hash": "7d0c17d960f14ef9dbdd5400e62cf74c", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 67, "avg_line_length": 24, "alnum_prop": 0.6666666666666666, "repo_name": "chaos-soft/chocola", "id": "461bbe380adb1b075cd0f549135f733eea1c6c60", "size": "805", "binary":...
''' Management of Linux logical volumes =================================== A state module to manage LVMs .. code-block:: yaml /dev/sda: lvm.pv_present my_vg: lvm.vg_present: - devices: /dev/sda lvroot: lvm.lv_present: - vgname: my_vg - size: 10G - stri...
{ "content_hash": "a8316aa08950f1b30e1b717e979416fe", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 91, "avg_line_length": 28.206611570247933, "alnum_prop": 0.5190448285965427, "repo_name": "MadeiraCloud/salt", "id": "eba27000b02e0142689ff97dab74c64e72a3fdc5", "size": "6...
import os import pytest from astropy import units as u from astropy.coordinates import EarthLocation from astropy.coordinates import SkyCoord from pocs.mount.simulator import Mount from pocs.utils import altaz_to_radec @pytest.fixture def location(config): loc = config['location'] return EarthLocation(lon=l...
{ "content_hash": "e3771fa328e972c9318255e2a7214eaa", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 92, "avg_line_length": 23.65142857142857, "alnum_prop": 0.6798743657888379, "repo_name": "AstroHuntsman/POCS", "id": "eafa4b2a3dc1f967d8a16cd8d507906c42840446", "size": "4...
from collections import defaultdict, namedtuple from sanic.constants import HTTP_METHODS from sanic.views import CompositionView FutureRoute = namedtuple('Route', ['handler', 'uri', 'methods', 'host', 'strict_slashes']) FutureListener = namedtuple('Listener', ['handl...
{ "content_hash": "5aca6b4d7c8238fb5043dc1795f30eb2", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 78, "avg_line_length": 39.39269406392694, "alnum_prop": 0.5966152776167846, "repo_name": "jrocketfingers/sanic", "id": "7e9953e08852264f83750ab037b2690e87d9c371", "size": ...
from pybuilder.core import use_plugin, init, Author use_plugin("python.core") use_plugin("python.unittest") use_plugin("python.install_dependencies") use_plugin("python.flake8") use_plugin("python.coverage") use_plugin("python.distutils") use_plugin("copy_resources") name = "previewr" default_task = "publish" summar...
{ "content_hash": "a1887d10643d2761426d670950c901d1", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 83, "avg_line_length": 33.1875, "alnum_prop": 0.6880100439422473, "repo_name": "raphiz/previewr", "id": "e8911d005cf53d2137f03d9fb139f2fbb78168aa", "size": "1593", "binar...
from django.conf.urls.defaults import url, include, patterns from corehq.apps.appstore.dispatcher import AppstoreDispatcher store_urls = patterns('corehq.apps.appstore.views', url(r'^$', 'appstore_default', name="appstore_interfaces_default"), AppstoreDispatcher.url_pattern(), ) urlpatterns = patterns('corehq...
{ "content_hash": "b7839d410dfa4e26ec798af3bd992afe", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 96, "avg_line_length": 48.11538461538461, "alnum_prop": 0.6338928856914469, "repo_name": "SEL-Columbia/commcare-hq", "id": "60563aa2ef81de63dbaea0f3ad170ec8ec84759d", "size...
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from kolibri.core.content import hooks as content_hooks from kolibri.plugins.base import KolibriPluginBase class HTML5AppPlugin(KolibriPluginBase): pass class HTML5AppAsset(content_hooks.Content...
{ "content_hash": "5d1271bbc8e6317a295dd507359e7cdc", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 55, "avg_line_length": 29.0625, "alnum_prop": 0.7720430107526882, "repo_name": "lyw07/kolibri", "id": "86c009665017ad440e07d7386f93a452c8033c55", "size": "465", "binary":...
"""Installation test for YAMNet.""" import numpy as np import tensorflow as tf import params import yamnet class YAMNetTest(tf.test.TestCase): _yamnet_graph = None _yamnet = None _yamnet_classes = None @classmethod def setUpClass(cls): super(YAMNetTest, cls).setUpClass() cls._yamnet_graph = tf.Gr...
{ "content_hash": "20cfe67bebc9806f5d1ac62a0d9181b2", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 79, "avg_line_length": 30.6, "alnum_prop": 0.6203208556149733, "repo_name": "alexgorban/models", "id": "c3f64859949ce4bc7cc83529334a9e29da0d0124", "size": "2372", "binary...
from django.db import models from django.db.models.query import QuerySet # Following queryset, manager, and models are based on the snippet at # http://www.djangosnippets.org/snippets/1034/ class SubclassQuerySet(QuerySet): def __getitem__(self, k): result = super(SubclassQuerySet, self).__getitem__...
{ "content_hash": "8cd4dc59520e1d64947c04d753df23c9", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 69, "avg_line_length": 36.89473684210526, "alnum_prop": 0.6476462196861626, "repo_name": "maxcutler/Courant-News", "id": "8ec2bc2b8034af8377313e52ef49953b367b3de7", "size":...
import _plotly_utils.basevalidators class FamilysrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__( self, plotly_name="familysrc", parent_name="scatterpolar.hoverlabel.font", **kwargs, ): super(FamilysrcValidator, self).__init__( plotly_na...
{ "content_hash": "5125be76edcf5894c6d9a41405208263", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 68, "avg_line_length": 28.75, "alnum_prop": 0.5847826086956521, "repo_name": "plotly/plotly.py", "id": "e010d52797827ac55a61fe113402255df9eb6fc4", "size": "460", "binary"...
"""Abstraction of an OF table.""" # Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer. # Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd. # Copyright (C) 2015--2018 The Contributors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this fi...
{ "content_hash": "a19f912e34f28bd7213e931c9c18ff12", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 95, "avg_line_length": 34.98245614035088, "alnum_prop": 0.5962888665997994, "repo_name": "wackerly/faucet", "id": "6d46f40f15e2803a50a6c835af8e5d881018b33f", "size": "5982...
""" elementary ballistic problem """ import numpy as np from scipy import constants import helper ### initial conditions ### # initial position x0 = 0 y0 = 125 s0 = (x0,y0) # scalar inital speed v0s = 12 # angle theta = np.pi/6 # define acceleration vector - acceleration is constant here g = constants.physical...
{ "content_hash": "df5badfc3d946a421eeb79ae58e41689", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 95, "avg_line_length": 17.125984251968504, "alnum_prop": 0.663448275862069, "repo_name": "jboissard/mathExperiments", "id": "db4bd793f2b257cc3fac7d6eaa34d3d5c1c3b0bd", "si...
from nose.tools import eq_ import amo.tests from amo.urlresolvers import reverse from users.models import UserProfile from mkt.api.models import Access from mkt.site.fixtures import fixture class TestAPI(amo.tests.TestCase): fixtures = fixture('user_999') def setUp(self): self.profile = UserProfile...
{ "content_hash": "0dc8afb9175650aee23d0f463bd8202f", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 83, "avg_line_length": 35.779661016949156, "alnum_prop": 0.6167693036475604, "repo_name": "spasovski/zamboni", "id": "07eaa37f3e3f0aa9329dd613d5059c6897e40782", "size": "21...
from .. import syntax, prims from ..analysis import OffsetAnalysis, SyntaxVisitor from ..ndtypes import ArrayT, ScalarT, SliceT, TupleT, NoneT from ..syntax import unwrap_constant, Expr import shape import shape_from_type from shape import (Var, Const, Shape, Tuple, Closure, Slice, Scalar, Unknown, ...
{ "content_hash": "c0d01072ba2120677c577a5d7d773b5f", "timestamp": "", "source": "github", "line_count": 897, "max_line_length": 99, "avg_line_length": 30.552954292084728, "alnum_prop": 0.6176749616872218, "repo_name": "pombredanne/parakeet", "id": "08778b741f6d23b8259fef8369905a39c18e6deb", "size":...
from django.test import TestCase from django.contrib.auth.models import Group from hs_access_control.models import PrivilegeCodes from hs_core import hydroshare from hs_core.testing import MockIRODSTestCaseMixin from hs_access_control.tests.utilities import global_reset, is_equal_to_as_set class UnitTests(MockIROD...
{ "content_hash": "3ded6500f1b33d246f9ffee707d4d19d", "timestamp": "", "source": "github", "line_count": 676, "max_line_length": 79, "avg_line_length": 35.77218934911242, "alnum_prop": 0.5714167562649904, "repo_name": "RENCI/xDCIShare", "id": "a708c98c7e722b883df4ae4dadc2949f17c2477e", "size": "2418...
import json import os import pprint import sys import uuid from googleapiclient.discovery import build from googleapiclient.errors import HttpError from google.cloud import pubsub_v1 from impl.database.database import JsonDatabase PROJECT_ID = os.environ['GOOGLE_CLOUD_PROJECT'] PUBSUB_SUBSCRIPTION = 'codelab' PROC...
{ "content_hash": "6c7c02e78bdd739f3597fe37d8164350", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 80, "avg_line_length": 35.472727272727276, "alnum_prop": 0.5600546728173587, "repo_name": "googlecodelabs/gcp-marketplace-integrated-saas", "id": "13b1356c5b6cb4815dafaf9e72...
"""This program imports the datetime module and returns current date & time.""" import datetime CURDATE = None def get_current_date(): """This function should retrieve the current date and time. Args: none: Value specifying degrees Fahrenheit Returns: datetime.date.today(): Current sys...
{ "content_hash": "7a975f24672ad9d3875d8bbc5f6536e8", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 79, "avg_line_length": 21.12, "alnum_prop": 0.634469696969697, "repo_name": "neal-rogers/baseball-card-inventory", "id": "3ca267c1cb0ed289ad90f60ca2af600e43c18ec6", "size":...
'''export.py The actions to create different formats from a handbuch.io-`book` live here ''' import os from os.path import abspath, dirname, isfile import sys import logging from datetime import datetime import pypandoc from bs4 import BeautifulSoup from .utils import get_siteurl class Export(object): def __i...
{ "content_hash": "c913401e15cc3a38749807c815330d66", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 77, "avg_line_length": 29.457142857142856, "alnum_prop": 0.5410281280310378, "repo_name": "theithec/bookhelper", "id": "4d596a61eed761725d026fc8f237ba4f4e1eb5be", "size": ...
import unittest2 import pymysql from pymysql import util from pymysql.tests import base from pymysql.constants import CLIENT class TestNextset(base.PyMySQLTestCase): def test_nextset(self): con = self.connect( init_command='SELECT "bar"; SELECT "baz"', client_flag=CLIENT.MULTI_ST...
{ "content_hash": "2542a39ee6cebe2e4c2ad98366a155b5", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 72, "avg_line_length": 30.833333333333332, "alnum_prop": 0.5857142857142857, "repo_name": "imron/scalyr-agent-2", "id": "998441072d80ec85f33d1bb4e65aa6e05b7ec76b", "size": ...
import json from django.test.utils import override_settings from django.test.client import RequestFactory from allauth.compat import reverse from allauth.socialaccount.tests import OAuth2TestsMixin from allauth.tests import MockedResponse, TestCase, patch from allauth.socialaccount.models import SocialAccount from al...
{ "content_hash": "894680f03a1a7952dd8941ee66ce8d0c", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 77, "avg_line_length": 39.33587786259542, "alnum_prop": 0.6056666019794295, "repo_name": "wli/django-allauth", "id": "95ca86616445793c1512314b3644f088029c114a", "size": "5...
import re from wadl2rst import table from wadl2rst.nodes.base import BaseNode from wadl2rst.templates import templates FILENAME_TITLE = re.compile(r" |/") FILENAME_PATH = re.compile(r"/|{|}") FILENAME_UNDERSCORES = re.compile(r"[_]+") PARAMS_YAML = re.compile(r"/s") PARAMS_CLEANUP = re.compile(r"\(.*?\)") class Me...
{ "content_hash": "496f57fa58baf07c3d22c2f1cbb32575", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 92, "avg_line_length": 33.82089552238806, "alnum_prop": 0.5672256546042954, "repo_name": "annegentle/wadl2rst", "id": "906c99b816b7ccb624ac9f43f56268f367a0b311", "size": "...
from app import myapp, models from flask import render_template, Flask, redirect, url_for, session, request, jsonify, flash from flask_oauthlib.client import OAuth from .forms import LoginForm, SignUpForm app = Flask(__name__) app.config.from_object('config') oauth = OAuth() linkedin = oauth.remote_app( ...
{ "content_hash": "6e84a31709c8f6a37eae59a0dc99d2c4", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 93, "avg_line_length": 26.643939393939394, "alnum_prop": 0.6013647995450668, "repo_name": "lizlee0225/IschoolJourney", "id": "1edabdf0659ea166c368691563b04d40b87adc2b", "s...
import pytest from seafileapi.exceptions import DoesNotExist from tests.utils import randstring def test_create_delete_repo(client): repo = _create_repo(client) repo.delete() with pytest.raises(DoesNotExist): client.repos.get_repo(repo.id) def test_create_encrypted_repo(client): repo = _crea...
{ "content_hash": "a57425643a044c638152d8bf527016e7", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 76, "avg_line_length": 28.114285714285714, "alnum_prop": 0.6798780487804879, "repo_name": "qk4l/python-seafile", "id": "907f564ef20adc1846cfe357312a7eab7092bbf2", "size": "...
""" will merge into userguild """ import pymongo from pymongo import MongoClient from wowlib import wowapi # connection informattion client = MongoClient() db = client.wow userdb = db.users # create list of unique guilds guildlist = [] user_list = [] for guild in userdb.find({"user": {'$regex' : ".* - Blackwater R...
{ "content_hash": "7be0f299672823aeee2b66034d701f6d", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 130, "avg_line_length": 26.402985074626866, "alnum_prop": 0.4347088750706614, "repo_name": "henkhaus/wow", "id": "b0c794628cf753d443bcb2ff885877ce6a3376c2", "size": "3538"...
import tensorflow as tf from agent.framework import Framework from agent.main import Agent from emulator.main import Account # env = Account() # state = env.reset() # # agent = Framework() # sess = tf.Session() # sess.run(tf.global_variables_initializer()) # # # while True: # action = agent.get_stochastic_policy(...
{ "content_hash": "aea14c34cbae55aca14af5a4af11108d", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 65, "avg_line_length": 19.520833333333332, "alnum_prop": 0.6744930629669157, "repo_name": "AlphaSmartDog/DeepLearningNotes", "id": "5c80120a3e6a53981f7aebbf23b800207dbf70ff",...
from PIL import Image, ImageFile, ImagePalette, \ ImageChops, ImageSequence, _binary __version__ = "0.9" # -------------------------------------------------------------------- # Helpers i8 = _binary.i8 i16 = _binary.i16le o8 = _binary.o8 o16 = _binary.o16le # --------------------------------------...
{ "content_hash": "5ed6ff89e985ca1f8622d3dcfea222dc", "timestamp": "", "source": "github", "line_count": 672, "max_line_length": 91, "avg_line_length": 31.41220238095238, "alnum_prop": 0.49732341655218154, "repo_name": "zhanqxun/cv_fish", "id": "6bca4dd03fa3d955cf37743d344c991c1e5182ef", "size": "21...
from ngo.template import render def home(request): return render(request, 'app2/home.html') def hello(request, name): context = { 'name': name } return render(request, 'app2/hello.html', context)
{ "content_hash": "9a13c556387696c49e7dda45727bb492", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 54, "avg_line_length": 23, "alnum_prop": 0.6304347826086957, "repo_name": "naritotakizawa/ngo", "id": "e00c1f5995db037d291c621fe15ac1e52ee9d3c2", "size": "230", "binary":...
""" mixer.main ~~~~~~~~~~ This module implements the objects generation. :copyright: 2013 by Kirill Klenov. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, unicode_literals import datetime from copy import deepcopy import decimal from importlib import imp...
{ "content_hash": "1a79f6ebd76596396b76147e7af8dfde", "timestamp": "", "source": "github", "line_count": 933, "max_line_length": 79, "avg_line_length": 27.659163987138264, "alnum_prop": 0.5717275052313415, "repo_name": "mattcaldwell/mixer", "id": "6de19e13664c1b7e06769e5d051291d0d9d01156", "size": "...
from sqlalchemy import * from sqlalchemy.ext.declarative import declarative_base from datetime import datetime from db import Base, Session # abstract base class for Users class User(Base): __tablename__ = 'users' id = Column(Integer, primary_key=True, nullable=False) name = Column(String(75), nullable=False) ema...
{ "content_hash": "06bc12f7b426adabef2fdf16eccaeabd", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 81, "avg_line_length": 24.636363636363637, "alnum_prop": 0.7121771217712177, "repo_name": "knuevena/americorps-backend", "id": "cf99072e1a39f7cf93343d1196763264c84d4e59", "...
import subprocess import threading import tkinter as Tk import tkinter.scrolledtext import tkinter.ttk as ttk from tkinter.filedialog import askopenfilename from PIL import Image, ImageTk class App: def __init__(self, master): frame = Tk.Frame(master) top_menu = Tk.Menu(master) actions_m...
{ "content_hash": "2a19a59ef0c94d6699486c57b9f0376b", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 78, "avg_line_length": 33.61714285714286, "alnum_prop": 0.5509093999660037, "repo_name": "jhladky/ratload", "id": "47c67c66ff048b706d3b715a917ff633aeb162d9", "size": "5883...
from ciscoconfparse import CiscoConfParse cisco_config = CiscoConfParse('cisco_ipsec.txt') crypto = cisco_config.find_objects_w_child(parentspec=r"^crypto map CRYPTO", childspec=r"set pfs group2") for pfs in crypto: print pfs.text for child in pfs.children: print child.text
{ "content_hash": "c4b87ae6262900c819402c2495112e96", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 105, "avg_line_length": 26.90909090909091, "alnum_prop": 0.7398648648648649, "repo_name": "kevrodg/pynet", "id": "e7c980c251fc3675fb7fec259b4e73264481f3ab", "size": "319", ...
import manager m = manager.Manager() m.set_node(5, 100)
{ "content_hash": "ee11aeacdbb507c758c36aabcb3ffbf9", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 21, "avg_line_length": 19.666666666666668, "alnum_prop": 0.6779661016949152, "repo_name": "cmeyer/py-home-control", "id": "b594214b2b8d859527de0b0810f663b3b5cece25", "size":...
"""Miscellaneous AMICI Python interface tests""" import os import subprocess from tempfile import TemporaryDirectory import amici from amici.ode_export import smart_subs_dict import libsbml import pytest import sympy as sp from amici.ode_export import _monkeypatched, _custom_pow_eval_derivative def test_parameter_s...
{ "content_hash": "3cf5af562eb4aa60e4cfc38a0312fb65", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 79, "avg_line_length": 32.6953125, "alnum_prop": 0.6370370370370371, "repo_name": "AMICI-developer/AMICI", "id": "6445b5d5117b8f418e13cf30b58cf10f2cbc8a79", "size": "4185"...
""" test_versioning.py All things to do with testing OS versions. Created by Niall Richard Murphy on 2011-05-30. """ import config_parse import constants import test_infrastructure as ti # Perhaps unittest2 is available. Try to import it, for # those cases where we are running python 2.7. try: import unittest2 a...
{ "content_hash": "7701910dd122f9f4d17c299eeb7de27d", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 84, "avg_line_length": 27.523809523809526, "alnum_prop": 0.726643598615917, "repo_name": "niallrmurphy/pyvern", "id": "07c47a6ab3fc16f40b74f8099231a1c3cccf8091", "size": "1...
from django import forms from .models import Post class PostForm(forms.ModelForm): class Meta: model = Post fields = ('title', 'text',) class ConfirmForm(forms.ModelForm): class Meta: model = Post fields = ()
{ "content_hash": "7d50f33c17c74321e401bd70ebc94f12", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 35, "avg_line_length": 16.9375, "alnum_prop": 0.5719557195571956, "repo_name": "pkimber/blog", "id": "6b3b5a39204b0b65d7b47220754e1d6cdb5f2afb", "size": "297", "binary": ...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.dev") try: from django.core.management import execute_from_command_line except ImportError as exc: raise ImportError( "Couldn't import Django. Are you sure it's insta...
{ "content_hash": "dffc5260aed14978ca3bfd0ce6d4a376", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 74, "avg_line_length": 37.142857142857146, "alnum_prop": 0.6557692307692308, "repo_name": "andree1320z/deport-upao-web", "id": "90baafe60a518e42e83009cabae892d04ef9d38b", "...
""" SeaHorn Verification Framework Copyright (c) 2015 Carnegie Mellon University. All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice...
{ "content_hash": "7cff194f7b61513c438bd5e0cd78ae93", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 107, "avg_line_length": 37.18803418803419, "alnum_prop": 0.7246609974718455, "repo_name": "staticafi/symbiotic", "id": "4c1d7072edfe9d19cb5cc8600a9adb7264b2bafb", "size": ...
from aiohttp import ClientSession, TCPConnector import asyncio from .dispatch import Dispatcher from .utils import generateFailedResponse async def asyncQuery(inputIDs, session=None): """Asynchronously make a list of API calls.""" responses = {} if not session: async with ClientSession(connector=...
{ "content_hash": "2854f2134c6329b9972fcf85015112fc", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 87, "avg_line_length": 34.743589743589745, "alnum_prop": 0.5933579335793358, "repo_name": "biothings/biothings_explorer", "id": "138e19c8abc6364d2cb88f4592dd7640458466ce", ...
""" Salt Edge Account Information API API Reference for services # noqa: E501 OpenAPI spec version: 5.0.0 Contact: support@saltedge.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import swagger_client from swagger...
{ "content_hash": "3b15b28dc60a5c8f3779723ab486b170", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 94, "avg_line_length": 24.945945945945947, "alnum_prop": 0.7009750812567714, "repo_name": "ltowarek/budget-supervisor", "id": "f98d400117fc4224b6e3fbe4cd8ac4fc4c5f2baa", "s...
from django.db.backends.postgresql_psycopg2.introspection import DatabaseIntrospection from django.contrib.gis.gdal import OGRGeomType class GeoIntrospectionError(Exception): pass class PostGISIntrospection(DatabaseIntrospection): # Reverse dictionary for PostGIS geometry types not populated until ...
{ "content_hash": "bfd0461ab8d897cfd27282f0e8a79d30", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 95, "avg_line_length": 47.1578947368421, "alnum_prop": 0.56875, "repo_name": "rimbalinux/MSISDNArea", "id": "e364848761facbab7946946b2c88f8bb9c03625d", "size": "4480", "b...
import time, sys import usb from threading import Thread import logging import cflib from cflib.crazyflie import Crazyflie from cfclient.utils.logconfigreader import LogConfig from cfclient.utils.logconfigreader import LogVariable logging.basicConfig(level=logging.INFO) class _GetchUnix: def __init_...
{ "content_hash": "cb396f73509ffb37942419a9ef94ac04", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 90, "avg_line_length": 26.12727272727273, "alnum_prop": 0.6085594989561587, "repo_name": "caviv/dancing-drone", "id": "cbf193311d3c7696f96456ce17fa783c763d4b6f", "size": "...
import datetime import decimal import warnings from importlib import import_module from django.conf import settings from django.db.backends import utils from django.utils import six, timezone from django.utils.dateparse import parse_duration from django.utils.deprecation import RemovedInDjango19Warning from django.uti...
{ "content_hash": "ef04ed5d4fd261b4da8f1b7cdba46cd2", "timestamp": "", "source": "github", "line_count": 566, "max_line_length": 117, "avg_line_length": 37.86219081272085, "alnum_prop": 0.6327111525898274, "repo_name": "52ai/django-ccsds", "id": "8a8209f7a6975264f561993593b837bfff337edb", "size": "2...