text
stringlengths
4
1.02M
meta
dict
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = r''' --- module: win_toast version_added: "2.4" short_description: Sends Toast windows notification to logged in users on Windows 10 or later hosts description: ...
{ "content_hash": "afe5b92546e3705bcc025e6b8c5bc9da", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 137, "avg_line_length": 33.95180722891566, "alnum_prop": 0.7026259758694109, "repo_name": "e-gob/plataforma-kioscos-autoatencion", "id": "c56c32f0a15268765991189d8272b711f1d0...
import dateparser import re import os import sys import requests from pyquery import PyQuery as pq sys.path.insert(1, os.path.join(sys.path[0], '..')) from models import trackingStatus, trackingEvent NAME = "UPS" ID = __name__[10:] POPULARITY = 4 def guess(number): return number.startswith('1Z') def track(numb...
{ "content_hash": "3d077f639b94854f280e57ab0a97cbf6", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 109, "avg_line_length": 28.70909090909091, "alnum_prop": 0.5332488917036099, "repo_name": "krzynio/pl-packagetrack", "id": "dea39c2e7d745f7bb008656e08ab19dc1ae946c1", "size...
import os import train import argparse def launch_training(model_name, **kwargs): # Launch training train.train(model_name, **d_params) if __name__ == "__main__": parser = argparse.ArgumentParser(description='Experiments for Eve') parser.add_argument('list_experiments', type=str, nargs='+', ...
{ "content_hash": "eb7c0aa0ea88dc84bb25d61e750208c0", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 127, "avg_line_length": 36.170212765957444, "alnum_prop": 0.5682352941176471, "repo_name": "ChampionZP/DeepLearningImplementations", "id": "4c0e660a1eb46c2712e2b00efe49743d58...
from decimal import Decimal as D import logging from django.views.generic import RedirectView as DjangoRedirectView from django.views.generic import View from django.conf import settings from django.http import HttpResponse from django.shortcuts import get_object_or_404 from django.contrib import messages from django....
{ "content_hash": "a3e8c65bd2d004d3eda037868b20a6e9", "timestamp": "", "source": "github", "line_count": 546, "max_line_length": 110, "avg_line_length": 38.97435897435897, "alnum_prop": 0.6113721804511278, "repo_name": "britco/django-oscar-paypal", "id": "e115f63304621ecd14aa0abf14cfb965844df1e3", "...
import unittest from dce_lti_py import LaunchParams, DEFAULT_LTI_VERSION, InvalidLTIConfigError from dce_lti_py.launch_params import InvalidLaunchParamError class TestLaunchParams(unittest.TestCase): def test_constructor(self): lp = LaunchParams() self.assertTrue(lp['lti_version'], DEFAULT_LTI_VE...
{ "content_hash": "3a1f743f94dbfbdbd1b8b703c6de201c", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 79, "avg_line_length": 30.317073170731707, "alnum_prop": 0.5619469026548672, "repo_name": "brainheart/dce_lti_py", "id": "c40d97b3c176de5fea283f14d9bd1fccb25f0a40", "size":...
from .vnsgitmd import MdApi from .vnsgittd import TdApi from .sgit_constant import *
{ "content_hash": "45ddcffca1f6bc8bc354ea4bef266894", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 28, "avg_line_length": 28, "alnum_prop": 0.8095238095238095, "repo_name": "msincenselee/vnpy", "id": "ccec073e3ffa5e2ac7cf9d2edbf2710c47acfb04", "size": "84", "binary": fa...
from __future__ import unicode_literals import datetime from django.contrib.admin import ModelAdmin, TabularInline from django.contrib.admin.helpers import InlineAdminForm from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase from django.contrib.auth.models import Permission, User from django.contrib....
{ "content_hash": "f43aead75026a0822f9ea2a868c28a94", "timestamp": "", "source": "github", "line_count": 902, "max_line_length": 112, "avg_line_length": 49.90022172949002, "alnum_prop": 0.6464341257498334, "repo_name": "benjaminjkraft/django", "id": "f59f87e6deef62d3905713a58fcc4fecf5f5138c", "size"...
import uuid from keystoneclient import exceptions from keystoneclient.tests.v3 import utils from keystoneclient.v3 import endpoints class EndpointTests(utils.TestCase, utils.CrudTests): def setUp(self): super(EndpointTests, self).setUp() self.key = 'endpoint' self.collection_key = 'endpoi...
{ "content_hash": "ad7d13376179fed07de1d059a82a74d9", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 79, "avg_line_length": 38.0126582278481, "alnum_prop": 0.6513486513486514, "repo_name": "raildo/python-keystoneclient", "id": "050a646eca21a6c9071c5d163a778ca2ae0b8f23", "s...
import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configurat...
{ "content_hash": "f29d5be69e76c7d37f0bfde86c760cda", "timestamp": "", "source": "github", "line_count": 203, "max_line_length": 80, "avg_line_length": 32.27093596059113, "alnum_prop": 0.7055411387574416, "repo_name": "chiragshah/typus", "id": "efcd3cdb0aa6eb587bffe82e3e9c5f1d9fc06236", "size": "696...
from .interface import SerialInterface from . import message import socketserver import argparse import threading import time import logging class IR_Control: def __init__(self, interface, serial_port, baudrate): self.i = interface self.serial_port = serial_port self.baudrate = baudrate ...
{ "content_hash": "d4306418c5a2abba13a2a3408ff5c9b0", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 79, "avg_line_length": 36.35175879396985, "alnum_prop": 0.6172242189659939, "repo_name": "iwanders/IR_control", "id": "c52146faa7985fd23865209eefe2aeb6d683ef63", "size": "...
import os from cli import IllegalArgumentException from cli.evaluation import MMTTranslator, _EvaluationResult, TranslateError, BLEUScore from cli.libs import fileutils from cli.mmt.processing import XMLEncoder # similar to class Evaluator above. Alternatively we could have added a flag there, to call corpus.copy(de...
{ "content_hash": "449d7ee351cdd8b88f6b04f6259b7254", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 114, "avg_line_length": 40.37894736842105, "alnum_prop": 0.5862877997914494, "repo_name": "letconex/MMT", "id": "928dd1b4e94494781de018938adc0543962e49c8", "size": "3836", ...
"""Tests for circulation signals.""" from invenio_circulation.proxies import current_circulation from invenio_circulation.signals import loan_state_changed def test_signals_loan_request(loan_created, params): """Test signal for loan request action.""" recorded = [] def record_signals(_, initial_loan, lo...
{ "content_hash": "e986b5d0277dcc80e611a8290588e020", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 65, "avg_line_length": 33.779661016949156, "alnum_prop": 0.6562970396387355, "repo_name": "inveniosoftware/invenio-circulation", "id": "0f24623c0967bda70c7e4a424c84d0a696586a...
"""Test load_sync/store_sync instructions. This uses four threads to update variables round-robin. """ import sys sys.path.insert(0, '../..') import test_harness @test_harness.test(['verilator']) def multicore(_, target): hex_file = test_harness.build_program(['multicore.S']) result = test_harness.run_prog...
{ "content_hash": "96cdedad8569e91c95a7ccc77c3432bb", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 71, "avg_line_length": 26.42105263157895, "alnum_prop": 0.703187250996016, "repo_name": "jbush001/NyuziProcessor", "id": "7aae0e046512bdc15cc32a5ed1ffe56a17c190d7", "size":...
from fabric.api import * @task def bootstrap(puppetmaster=''): """Bootstrap an Ubuntu 14.04 host on Upcloud""" from . import util, puppet util.install_sudo() fqdn = run('hostname -f') hostname = run('hostname -s') ipaddress = run("/sbin/ifconfig eth0 | grep 'inet ' | awk -F'[: ]+' '{ print $...
{ "content_hash": "198d192a7c24baff2eef3b896d1ce0e0", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 88, "avg_line_length": 28.347826086956523, "alnum_prop": 0.588957055214724, "repo_name": "mattock/fabric", "id": "c5b80cbf3f21f748702a5fd9eac19d471776f53d", "size": "676", ...
''' 参考 https://github.com/7sDream/zhihu-py3/blob/master/zhihu/client.py 知乎认证部分 ''' import os import time import json import requests from PIL import Image from global_constant import * class Authentication(object): ''' 知乎认证类,可用cookies(JSON数据格式)或者帐号密码登陆 若使用帐号密码登陆,则会将cookies以JSON数据格式保存至当前文件夹下 ''' d...
{ "content_hash": "720260f55e7e8e72a36dc1706d321072", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 71, "avg_line_length": 28.31958762886598, "alnum_prop": 0.5438660356752821, "repo_name": "time-river/wander", "id": "02a7c887276dcb2f09dd93de5cc5d068648ff6ea", "size": "303...
from loguru import logger from flexget import plugin from flexget.event import event from flexget.plugin import PluginError logger = logger.bind(name='list_clear') class ListClear: schema = { 'type': 'object', 'properties': { 'what': { 'type': 'array', ...
{ "content_hash": "ca6a147d7901ed0bec7a7846c7aa53d8", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 110, "avg_line_length": 37.15, "alnum_prop": 0.4952893674293405, "repo_name": "ianstalk/Flexget", "id": "e9a386c203a295bcb20a0d724b346d2e21baeeed", "size": "2229", "binar...
from django.conf.urls import url from django.views import generic from . import views urlpatterns = [ url('^$', generic.View.as_view(), name="index"), url('^url_timeout\.html$', views.UrlTimeoutView.as_view(), name='url_timeout'), # 申込み用フォーム(車室の一時確保に必要な項目)【個人・法人共通】 url('^user_subscription_simple_step...
{ "content_hash": "297365804ae134b090c4a7110b4ca255", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 119, "avg_line_length": 58.52542372881356, "alnum_prop": 0.6689834926151172, "repo_name": "YangWanjun/areaparking", "id": "7f9a9b1df041b8373fd229eb77d8322b5695e18b", "size"...
import sys sys.path.append("../src/app") import unittest from app.functions import get_config,safe_get_config class FunctionsTest(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_get_config_key_missing(self): self.assertIsNone(get_config('hackathon-api...
{ "content_hash": "5ff05fa8647c006afe7f181daf45997e", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 75, "avg_line_length": 26.147058823529413, "alnum_prop": 0.6805399325084365, "repo_name": "mshubian/BAK_open-hackathon", "id": "5a560701fbe765e6a268c93f1a7c7db78b8d0f68", "...
from ale_python_interface import ALEInterface from enduro.action import Action from enduro.control import Controller from enduro.state import StateExtractor class Agent(object): def __init__(self): self._ale = ALEInterface() self._ale.setInt('random_seed', 123) self._ale.setFloat('repeat_a...
{ "content_hash": "cd88f4597a8e7fec97f1a128823e0307", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 84, "avg_line_length": 31.168067226890756, "alnum_prop": 0.5845241304933945, "repo_name": "mamikonyana/mamikonyana.github.io", "id": "1217908fe0ce3b0d525f70a5562cefbb3920091...
""" Definition of urls for $safeprojectname$. """ from django.conf.urls import include, url import $safeprojectname$.views # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = [ # Examples: # url(r'^$', $safeprojectname$.views.home, name...
{ "content_hash": "2a193fdc3a63663e52fa05eec61299b0", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 87, "avg_line_length": 28.82608695652174, "alnum_prop": 0.6923076923076923, "repo_name": "DinoV/PTVS", "id": "c9ba270513edf5e9b8f4552e418f3e521c129dd5", "size": "663", "b...
import warnings warnings.simplefilter('ignore', Warning) from django.conf import settings from core.tests.backends import * from core.tests.fields import * from core.tests.forms import * from core.tests.indexes import * from core.tests.inputs import * from core.tests.loading import * from core.tests.models import * f...
{ "content_hash": "527d18796478f4378e54646d57cf0f5d", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 44, "avg_line_length": 29.11764705882353, "alnum_prop": 0.793939393939394, "repo_name": "josesanch/django-haystack", "id": "2aef8ad618fea691a4d5a0ecc7ed882a2b79ba12", "size...
''' Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Link: https://leetcode.com/problems/merge-k-sorted-lists/#/description Example: None Solution: The problem is simply to find connected components in the grid. Source: None ''' # Defi...
{ "content_hash": "ace0f0fddeff36e203c6b03eacabed87", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 102, "avg_line_length": 23.681818181818183, "alnum_prop": 0.5604606525911708, "repo_name": "supermarkion/Life-Backup", "id": "9287029f41af0abe2f233cda2df18e30faa84cc4", "si...
print(__doc__) from sklearn import svm from sklearn.datasets import samples_generator from sklearn.feature_selection import SelectKBest, f_regression from sklearn.pipeline import Pipeline def loadData(): # generating data X, y = samples_generator.make_classification(n_features=20, \ ...
{ "content_hash": "32cf1cb487e923f26a90c8b19c1cc042", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 72, "avg_line_length": 23.28, "alnum_prop": 0.5266323024054983, "repo_name": "kwailamchan/programming-languages", "id": "27fbd39a1db9844366bc6be6d3c2510941abe0cc", "size": ...
import pytest from tests.lib import (_create_test_package, _change_test_package_version, pyversion) from tests.lib.local_repos import local_checkout @pytest.mark.network def test_install_editable_from_git_with_https(script, tmpdir): """ Test cloning from Git with https. """ res...
{ "content_hash": "00b319e5bca72176aea789192b8c0b8c", "timestamp": "", "source": "github", "line_count": 232, "max_line_length": 79, "avg_line_length": 31.676724137931036, "alnum_prop": 0.6113756973737924, "repo_name": "newsteinking/docker", "id": "06ca8ffb1b47f6af945f6b7108f13b8cca5e9b22", "size": ...
import argparse from ..basic.runner import PygameRunner __author__ = 'fyabc' class AntSpider(PygameRunner): def main_loop(self): pass def draw(self): pass def draw_background(self): pass def real_main(options): pass def build_parser(): parser = argparse.ArgumentPars...
{ "content_hash": "e8c7877d0b81ec0ad3517087ff85125f", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 104, "avg_line_length": 15.029411764705882, "alnum_prop": 0.6477495107632094, "repo_name": "fyabc/MiniGames", "id": "fed9779e156cc93bd0c6a93bbde5c2e13a7b8d43", "size": "555...
""" sqldiff.py - Prints the (approximated) difference between models and database TODO: - better support for relations - better support for constraints (mainly postgresql?) - support for table spaces with postgresql - when a table is not managed (meta.managed==False) then only do a one-way sqldiff ? show differ...
{ "content_hash": "4c219312337523cfd6209c735d0c26b0", "timestamp": "", "source": "github", "line_count": 760, "max_line_length": 448, "avg_line_length": 49.40657894736842, "alnum_prop": 0.6047830834376415, "repo_name": "bop/bauhaus", "id": "33c8749474489b4b38d98d1816b3423961cc4038", "size": "37549",...
import time print time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())) time.sleep(1) print time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
{ "content_hash": "b33aaa692916431fb7e400925cd634c7", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 69, "avg_line_length": 21.25, "alnum_prop": 0.6352941176470588, "repo_name": "yjwx0017/test", "id": "265631a227b037702747c63d8bc53d2fbb50708f", "size": "247", "binary": fa...
import warnings from tencentcloud.common.abstract_model import AbstractModel class AddNodesRequest(AbstractModel): """AddNodes请求参数结构体 """ def __init__(self): r""" :param Placement: 集群中实例所在的位置。 :type Placement: :class:`tencentcloud.thpc.v20220401.models.Placement` :param ...
{ "content_hash": "1d3809e67bc59aec8ef95969087b35a5", "timestamp": "", "source": "github", "line_count": 1391, "max_line_length": 410, "avg_line_length": 36.835370237239395, "alnum_prop": 0.6278933603965806, "repo_name": "tzpBingo/github-trending", "id": "8c5467709a71be68068a6ce638ab09243c620b5f", "...
""" Test functions for models.GLM """ import os import warnings import numpy as np from numpy.testing import ( assert_, assert_allclose, assert_almost_equal, assert_array_less, assert_equal, assert_raises, ) import pandas as pd from pandas.testing import assert_series_equal import pytest from s...
{ "content_hash": "33ec9d847340de46cc00427d6faa09ea", "timestamp": "", "source": "github", "line_count": 2620, "max_line_length": 112, "avg_line_length": 38.48664122137404, "alnum_prop": 0.5722021123617791, "repo_name": "bashtage/statsmodels", "id": "6750bbb386050e41365c6ec3415d2537a86fa438", "size"...
from re import compile, escape from ..scraper import _BasicScraper, _ParserScraper from ..helpers import indirectStarter, bounceStarter from ..util import tagre from .common import ComicControlScraper, WordPressScraper, WordPressNavi, WordPressWebcomic class Namesake(ComicControlScraper): url = 'http://namesakec...
{ "content_hash": "6c32111cdc30a43b0863fa5a17179acb", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 110, "avg_line_length": 34.56164383561644, "alnum_prop": 0.6230677764565993, "repo_name": "webcomics/dosage", "id": "8387bccf2ede1485404a84a7eff4dca631594991", "size": "77...
""" ** OBS - this is not a normal command module! ** ** You cannot import anything in this module as a command! ** This is part of the Evennia unittest framework, for testing the stability and integrity of the codebase during updates. This module test the default command set. It is instantiated by the src/objects/te...
{ "content_hash": "c242eee03a883a36a7e5f23ce29b8e76", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 147, "avg_line_length": 58.07239819004525, "alnum_prop": 0.6505376344086021, "repo_name": "TaliesinSkye/evennia", "id": "ccad26bf56d499c91ea687b54830a060cab4981c", "size":...
"""Base Driver for DataCore SANsymphony storage array.""" import math import time from oslo_config import cfg from oslo_log import log as logging from oslo_service import loopingcall from oslo_utils import excutils from oslo_utils import units from cinder import context as cinder_context from cinder import exception...
{ "content_hash": "bb1f684cd2020715b075105ef50d7d1d", "timestamp": "", "source": "github", "line_count": 831, "max_line_length": 79, "avg_line_length": 42.253910950661854, "alnum_prop": 0.5603053000313274, "repo_name": "mahak/cinder", "id": "0cb38b56a425b3b4233131100409b0f15e1cd24c", "size": "35754"...
""" Bottle is a fast and simple micro-framework for small web applications. It offers request dispatching (Routes) with url parameter support, templates, a built-in HTTP Server and adapters for many third party WSGI/HTTP-server and template engines - all in a single file and with no dependencies other than the Python S...
{ "content_hash": "bc9d32792960044c0fd66ec909639ec6", "timestamp": "", "source": "github", "line_count": 1933, "max_line_length": 109, "avg_line_length": 38.02224521469219, "alnum_prop": 0.5920241642516021, "repo_name": "svetlyak40wt/cony", "id": "8f2be9e815fe407ed035d52d50a69f154b89515c", "size": "...
class UtmContent(object): """The utm content of an Ganalytics object.""" def __init__(self, utm_content=None): """Create a UtmContent object :param utm_content: Used to differentiate your campaign from advertisements. :type utm_content: string, optional """ self._utm_c...
{ "content_hash": "6f0209d8ca1e0d2bf4482974f281e74d", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 84, "avg_line_length": 27.55, "alnum_prop": 0.6098003629764065, "repo_name": "sendgrid/sendgrid-python", "id": "e2a8ccff6377f97614362190e48da0c83d1c64e9", "size": "1102", ...
from __future__ import annotations import unittest from unittest import mock from airflow.providers.grpc.operators.grpc import GrpcOperator class StubClass: def __init__(self, channel): pass def stream_call(self, data): pass class TestGrpcOperator(unittest.TestCase): def custom_conn_f...
{ "content_hash": "ee31c41ab066911cf30efb9e5fc9d033", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 109, "avg_line_length": 38.05882352941177, "alnum_prop": 0.624420401854714, "repo_name": "cfei18/incubator-airflow", "id": "794d42ad1556ef3099f83c054279a9c7fa07f213", "size...
import os import sys import datetime from djpcms import test from django.contrib.auth.models import User from django.contrib.sites.models import Site from django.core import management try: from djpcms.contrib.jdep.fabtools import * fabric_available = True except ImportError: fabric_available = False ...
{ "content_hash": "f27aab5c37ef6e46bbaabdf4a3477d9b", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 112, "avg_line_length": 33.95049504950495, "alnum_prop": 0.5823855351414406, "repo_name": "strogo/djpcms", "id": "0ac2ad26396ade1e93f45336aa8ffa7ecccf4a1d", "size": "3429"...
import os, sys sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) import fnmatch import numpy import pytest import pickle from lasio import las, read, exceptions test_dir = os.path.dirname(__file__) egfn = lambda fn: os.path.join(os.path.dirname(__file__), "examples", fn) stegfn = lambda vers, fn: os...
{ "content_hash": "916e58cbe9a351a60ce23a13e26cced8", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 87, "avg_line_length": 24.846153846153847, "alnum_prop": 0.6687306501547987, "repo_name": "kinverarity1/las-reader", "id": "286916289c723200a1aeff0ce1b27684673a25b1", "size...
from rest_framework import test from . import fixtures class TenantQuotasTest(test.APITransactionTestCase): def setUp(self): super(TenantQuotasTest, self).setUp() self.fixture = fixtures.OpenStackFixture() self.tenant = self.fixture.tenant self.project = self.fixture.project ...
{ "content_hash": "dde4ce968a19f1ba49ee90c6c9edbbc6", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 89, "avg_line_length": 52.25, "alnum_prop": 0.6990430622009569, "repo_name": "opennode/nodeconductor-openstack", "id": "3ec8b1887ad4a9941a29b6f603c43395a86477e0", "size": "...
class superclass(object): def test1(self): print "superclass" class childclass(superclass): def test1(self): print "child" def test2(self): super(childclass, self).test1() def test3(self): self.test1() super(childclass, self).test1() x = childclass() x.tes...
{ "content_hash": "ae1dc338501b86616b30a1e6cb6040e8", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 39, "avg_line_length": 13.384615384615385, "alnum_prop": 0.5890804597701149, "repo_name": "chrivers/pyjaco", "id": "506e4dce8bd919c837cef288933da087709a0730", "size": "348"...
from pmg.models import Bill, BillVersion, File, db, BillType import json import re bills = json.load(open("data/bills-with-files.json")) bill_pages = json.load(open("data/bill-pages.json")) nids = json.load(open("data/nid_url.json")) pages_by_nid = {p["nid"]: p for p in bill_pages} nids_by_url = {n["url"]: n for n in...
{ "content_hash": "7eb187f8cf2ffb4dd3fea174fa289388", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 312, "avg_line_length": 29.68421052631579, "alnum_prop": 0.565096251266464, "repo_name": "Code4SA/pmg-cms-2", "id": "f764b0013221edfda983d5fe585e4856417043f2", "size": "39...
from unittest import TestCase, mock from nose.plugins.attrib import attr from shiftschema.schema import Schema from shiftschema.result import Result from shiftschema.property import SimpleProperty from shiftschema.property import EntityProperty from shiftschema.property import CollectionProperty from shiftschema.excep...
{ "content_hash": "302599f37304f03be8b665203bb9423a", "timestamp": "", "source": "github", "line_count": 480, "max_line_length": 80, "avg_line_length": 35.99583333333333, "alnum_prop": 0.6130339159624957, "repo_name": "projectshift/shift-schema", "id": "0ac3822af1625151c5abca20738a83b89b47c883", "si...
"""Distributed supervision suite. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import click from treadmill import cli def init(): """Return top level command handler.""" @click.group(cls=cli.make_co...
{ "content_hash": "6e1a1103586390dcd662defccca3c925", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 49, "avg_line_length": 20.545454545454547, "alnum_prop": 0.672566371681416, "repo_name": "Morgan-Stanley/treadmill", "id": "91a76b32d7ad0d92981c8c8178fee44bcce62e51", "size...
import requests from allauth.socialaccount import app_settings from allauth.socialaccount.providers.oauth2.views import ( OAuth2Adapter, OAuth2CallbackView, OAuth2LoginView, ) from .provider import ShareFileProvider class ShareFileOAuth2Adapter(OAuth2Adapter): provider_id = ShareFileProvider.id ...
{ "content_hash": "b01f2ac8883f5d7a84fc9abd5031d963", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 76, "avg_line_length": 41.078947368421055, "alnum_prop": 0.657911595131326, "repo_name": "lukeburden/django-allauth", "id": "fb2e8af727133716bcd4d980c3ae2583b129d6a7", "siz...
""" Borrowed then modified from: http://tuohuang.info/unity-automate-post-process/#.U6i3_I1dVaR """ import os import plistlib from sys import argv from mod_pbxproj import XcodeProject path = argv[1] fileToAddPath = argv[2] BASE_PATH = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Develop...
{ "content_hash": "ef875f9030f21883ad74f326d19b9715", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 113, "avg_line_length": 36.70422535211268, "alnum_prop": 0.6304681504221028, "repo_name": "ArbiterGames/Clickster", "id": "444ced309ac3df22ca71880096bf26b3f0b32615", "size"...
import sys from neutron_lib import constants as n_const from oslo_config import cfg from oslo_log import log as logging import oslo_messaging from oslo_utils import excutils from osprofiler import profiler from neutron._i18n import _LE, _LI, _LW from neutron.common import utils as n_utils from neutron.plugins.common ...
{ "content_hash": "c2580eaac2569cf63cf5f48e89431b26", "timestamp": "", "source": "github", "line_count": 700, "max_line_length": 79, "avg_line_length": 42.64142857142857, "alnum_prop": 0.5580756474253744, "repo_name": "sebrandon1/neutron", "id": "8965d4313f8ff00183f65adb9b26fb517d5839b4", "size": "3...
""" ORCID Member No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: Latest Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six from orcid_api_...
{ "content_hash": "4fb764c6417fdb7d4aa9b5074474bff4", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 119, "avg_line_length": 31.98170731707317, "alnum_prop": 0.5971401334604385, "repo_name": "Royal-Society-of-New-Zealand/NZ-ORCID-Hub", "id": "97f852fb34675f6400efe9769efab6a...
import unittest import imath import IECore import Gaffer import GafferTest import GafferScene import GafferSceneTest class RenderControllerTest( GafferSceneTest.SceneTestCase ) : def testConstructorAndAccessors( self ) : sphere = GafferScene.Sphere() context1 = Gaffer.Context() renderer = GafferScene.Priva...
{ "content_hash": "a52b83202c264b15e92a54aaafbda61d", "timestamp": "", "source": "github", "line_count": 495, "max_line_length": 154, "avg_line_length": 35.63232323232323, "alnum_prop": 0.7148769701780248, "repo_name": "lucienfostier/gaffer", "id": "8e69d1d763834a0f2387e43e6195cf3bb5118c33", "size":...
"""async14tcpserver.py: TCP Echo server protocol Usage: async14tcpserver.py """ import asyncio async def handle_echo(reader, writer): data = await reader.read(100) message = data.decode() addr = writer.get_extra_info('peername') print(f"Received {message} from {addr}") print(f"Send: {message}"...
{ "content_hash": "55ab822066ca0d7363c9bae8d4735cc5", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 74, "avg_line_length": 24.075, "alnum_prop": 0.6479750778816199, "repo_name": "showa-yojyo/bin", "id": "8f3e3a42c243e7a74f515e2bd4e1f6159e3bcd2a", "size": "985", "binary"...
import rope.base.builtins import rope.base.codeanalyze import rope.base.pynames from rope.base import ast, exceptions, utils class Scope(object): def __init__(self, pycore, pyobject, parent_scope): self.pycore = pycore self.pyobject = pyobject self.parent = parent_scope def get_names...
{ "content_hash": "a6187797136db7f70faa1a7eb73f9a2d", "timestamp": "", "source": "github", "line_count": 314, "max_line_length": 78, "avg_line_length": 31.05732484076433, "alnum_prop": 0.5917760459392944, "repo_name": "JetChars/vim", "id": "0bed19a92912ccda603e3f470ca48154c417bb59", "size": "9752", ...
from pyspider.libs.base_handler import * class Handler(BaseHandler): ''' this is a sample handler ''' @every(minutes=24 * 60, seconds=0) def on_start(self): self.crawl('http://scrapy.org/', callback=self.index_page) @config(age=10 * 24 * 60 * 60) def index_page(self, response): ...
{ "content_hash": "c5b27bde3d050279b72aed845c9a096f", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 66, "avg_line_length": 27.181818181818183, "alnum_prop": 0.5769230769230769, "repo_name": "t4skforce/pyspider", "id": "d973bdaa916d00abaad2e423092245700046d155", "size": "7...
#=============================================================================== # Copyright (c) 2014 Geoscience Australia # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistr...
{ "content_hash": "6baee4fb152a22ac7dca5e9c3c8fa12e", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 86, "avg_line_length": 40.858695652173914, "alnum_prop": 0.6264964086193137, "repo_name": "GeoscienceAustralia/gdf", "id": "56a587f3966ad184259485d75eea3563aea9e314", "size...
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('accounts', '0001_initial'), ...
{ "content_hash": "5f480b94311d8498119451cfc7476522", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 141, "avg_line_length": 35.2037037037037, "alnum_prop": 0.5791688584955287, "repo_name": "sebastienbarbier/723e_server", "id": "41fc6dff72dc73ef279bea6d59eebb49e65388dc", "...
"""* Default settings for jscribe. @module jscribe.conf.defaults """ INPUT_PATHS = ["./"] # paths to source files that should be discovered IGNORE_PATHS_REGEX = [] FILE_REGEX = r".*?[.]js$" FILE_IGNORE_REGEX = None DOCUMENTATION_OUTPUT_PATH = "./" DOC_STRING_REGEX = [r"[/][*][*]", r"(?<!\\)[*][/]"] TAG_REGEX = r"^\s*...
{ "content_hash": "db03b2a87832d44d936a559dd0748b65", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 71, "avg_line_length": 28.958333333333332, "alnum_prop": 0.6201438848920864, "repo_name": "mindbrave/jscribe", "id": "d50c64b5db189c7294cb7172ff1d2d0e5701f2b0", "size": "74...
''' 1224. Spiral Time limit: 1.0 second Memory limit: 64 MB [Description] A brand new sapper robot is able to neutralize mines in a rectangular region having integer height and width (N and M respectively). Before the robot begins its work it is placed near the top leftmost cell of the rectangle heading right. Then th...
{ "content_hash": "77f7ab7aae49c34d0cb5b59d154b1062", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 88, "avg_line_length": 24.54794520547945, "alnum_prop": 0.5731026785714286, "repo_name": "matrixjoeq/timus_solutions", "id": "f85dbab239f1218a1fa27504ec50a7ab95b9de1f", "si...
from __future__ import unicode_literals from django.contrib.sites.models import Site from future.builtins import str from unittest import skipUnless from django.contrib.auth import get_user_model from django.contrib.auth.models import AnonymousUser from django.db import connection from django.http import HttpRespons...
{ "content_hash": "ed0f3258cba4e2947d1b4fec5f9fc90e", "timestamp": "", "source": "github", "line_count": 401, "max_line_length": 79, "avg_line_length": 42.34663341645885, "alnum_prop": 0.630999352217184, "repo_name": "sjuxax/mezzanine", "id": "1b9f9dba8a652571784eaf11e2d1badb2efbed28", "size": "1698...
""" AniColle Library Collect your animes like a geek. Database model and operations here. Unlike the previous version, this version returns objects as results rather than dictionaries by default. You can force convert it into a dict by using to_dict(). """ from peewee import * import re from .seeker import seeker fr...
{ "content_hash": "8cddd25576e65d3925667789cc731ae8", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 138, "avg_line_length": 28.96208530805687, "alnum_prop": 0.5576828669612175, "repo_name": "chienius/anicolle", "id": "97655b2a29a8340713f930d7e0d0464dfd8082e9", "size": "6...
from django.core.cache import cache from django.test import TestCase class PolyaxonBaseTest(TestCase): COLLECT_TASKS = False def setUp(self): # Flush cache cache.clear() # Mock celery default sent task self.mock_send_task() super().setUp() self.worker_send = {}...
{ "content_hash": "3b4719e5e4ddbea3f6288ade3978643f", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 87, "avg_line_length": 28.056603773584907, "alnum_prop": 0.6005379959650302, "repo_name": "polyaxon/polyaxon", "id": "2db017d763e39949dcd302cccec4f2c5a80e6426", "size": "20...
"""Implements a sparse balanced and asynchronous E-I model, loosely based on Borges and Kopell, 2005. """ from __future__ import division import argparse import numpy as np from brian2 import * from syncological.async import model from syncological.ping import analyze_result, save_result parser = argparse.ArgumentPa...
{ "content_hash": "4a454163624293a7066176411caa23c0", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 76, "avg_line_length": 20.925925925925927, "alnum_prop": 0.6489675516224189, "repo_name": "voytekresearch/syncological", "id": "12f530849cb9fb87f3e2ec141728cdeffae6c7f1", "...
import simplejson from flask import jsonify, request, url_for from . import viewing import iiifoo_utils from dbmodels import Manifest, Image from source_mappings import source_mapping, is_dynamic_source pub_req_optmap = ['source_url', 'manifest_id'] # Make sure to change relevant paths in tests etc. if/when this c...
{ "content_hash": "025ee2bd20bdcf31dde252683e08dd37", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 81, "avg_line_length": 42.08108108108108, "alnum_prop": 0.6118604153286235, "repo_name": "hashimmm/iiifoo", "id": "7e335a4830b70b3dee89948329178ec951ac4e8c", "size": "4671...
""" A port of Infobot's nickometer command from Perl. This plugin provides one command (called nickometer) which will tell you how 'lame' an IRC nick is. It's an elitist hacker thing, but quite fun. """ import supybot import supybot.world as world # Use this for the version of this plugin. You may wish to put a CVS ...
{ "content_hash": "18bae78fea3f886649831576bc254bad", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 78, "avg_line_length": 29.823529411764707, "alnum_prop": 0.7544378698224852, "repo_name": "kblin/supybot-gsoc", "id": "e27199e508cf396b97f91b7a4c40eedfd0580a4f", "size": "3...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 5, transform = "Difference", sigma = 0.0, exog_count = 20, ar_order = 0);
{ "content_hash": "bad25ae196614095b77a61a7e6fc9ac2", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 166, "avg_line_length": 38, "alnum_prop": 0.706766917293233, "repo_name": "antoinecarme/pyaf", "id": "6c14f5d549fd313673db39e6bf5b8c1e5fd135a2", "size": "266", "binary": f...
import logging from classymq import exchanges, queues from classymq.lib.uuid import UUIDRequest log = logging.getLogger(__name__) class AMQPAPIRequest(UUIDRequest): def __init__(self, uuid=None, message=None, *args, **kwargs): super(AMQPAPIRequest, self).__init__(uuid, *args, **kwargs) self.messag...
{ "content_hash": "18158099d682f7f30283fafe629e805d", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 67, "avg_line_length": 26.964285714285715, "alnum_prop": 0.5933774834437087, "repo_name": "gdoermann/classymq", "id": "ae98c9fbd13bc05efa8ad8c1a8b7f18aa8951566", "size": "7...
from __future__ import print_function import os import csv import sys if os.path.exists("/home/ggdhines/github/pyIBCC/python"): sys.path.append("/home/ggdhines/github/pyIBCC/python") else: sys.path.append("/Users/greghines/Code/pyIBCC/python") import ibcc if os.path.isdir("/Users/greghines/Databases/serenget...
{ "content_hash": "0088b06b47e3cf7a2215bde65e2e560e", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 552, "avg_line_length": 34.897260273972606, "alnum_prop": 0.6125613346418057, "repo_name": "zooniverse/aggregation", "id": "0057358f70a9bdb47cfd2e1aa630936093e22a43", "siz...
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() from django.views.generic import TemplateView from thanksobama.main.views import * urlpatterns = patterns('', # Examples: # url(r'^$', 'thanksobama.views.home', name='home'), # url(r'^blog/', include...
{ "content_hash": "04cc025f85da50033d7a06aa2556a124", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 62, "avg_line_length": 29.235294117647058, "alnum_prop": 0.6901408450704225, "repo_name": "kz26/ThanksObama", "id": "97c952a0655b2fcd99d19a209d75b6efdb606cbb", "size": "497...
from swgpy.object import * def create(kernel): result = Building() result.template = "object/building/military/shared_outpost_shed_s04.iff" result.attribute_template_id = -1 result.stfName("building_name","military_guard_tower_1") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "f79ac36c3cea7e766d50b9576d158fc5", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 73, "avg_line_length": 24.615384615384617, "alnum_prop": 0.703125, "repo_name": "obi-two/Rebelion", "id": "5d427b190190dcad648a777a532c2ec1a633dd2c", "size": "465", "bina...
import _plotly_utils.basevalidators class CmidValidator(_plotly_utils.basevalidators.NumberValidator): def __init__(self, plotly_name="cmid", parent_name="parcats.line", **kwargs): super(CmidValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ed...
{ "content_hash": "29e046b8b75306de385200254ab31dfc", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 81, "avg_line_length": 38.15384615384615, "alnum_prop": 0.5967741935483871, "repo_name": "plotly/python-api", "id": "a553f23c8dbb036b7f9def1e88e27840b4f8d4ea", "size": "496...
'''Get columns by name from SQL query''' # sqlite3 import sqlite3 db = sqlite3.connect(':memory:') db.row_factory = sqlite3.Row # psycopg2 import psycopg2 from psycopg2.extras import DictCursor db = psycopg2.connect('my-dbn-string') cur = db.cursor(cursor_factory=DictCursor) # Then cur.execute('select * from people'...
{ "content_hash": "36c74a8242098b66f0d386a8a0857026", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 42, "avg_line_length": 21.235294117647058, "alnum_prop": 0.7285318559556787, "repo_name": "tebeka/pythonwise", "id": "b11593a35df06409b877497022f719e131f10a16", "size": "36...
from disassemblers.libdisassemble.opcode86 import regs from copy import deepcopy legal_integers = ['rdi', 'rsi', 'rdx', 'rcx', 'r8', 'r9'] legal_sse = ['xmm0', 'xmm1', 'xmm2', 'xmm3', 'xmm4', 'xmm5', 'xmm6', 'xmm7'] legal_other = ['rax'] def reg_normalize(reg): ''' Normalize a register to a form independent o...
{ "content_hash": "e71d6c13d99c45458564c2ff7fc62909", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 100, "avg_line_length": 35.365591397849464, "alnum_prop": 0.4843417452113104, "repo_name": "drx/ocd", "id": "9bdf7391faee11d28a56157d67d40566ac4a3762", "size": "3289", "b...
import functools import logbook import math import numpy as np import numpy.linalg as la from six import iteritems import pandas as pd from . import risk from . risk import ( alpha, check_entry, downside_risk, information_ratio, sharpe_ratio, sortino_ratio, ) log = logbook.Logger('Risk Peri...
{ "content_hash": "ab1e8d2290ff7dc0a9623ba9778e1dee", "timestamp": "", "source": "github", "line_count": 306, "max_line_length": 79, "avg_line_length": 35.11437908496732, "alnum_prop": 0.5617496510004654, "repo_name": "wilsonkichoi/zipline", "id": "b4af1288984ded1f8d7aca8ee7f7a7f4e7a457c3", "size": ...
print("\nExercise 10.11\n") # # Question 1 # 1. Two words are a "reverse pair" if each is the reverse of the other. Write # a program that finds all the reverse pairs in the word list. # import bisect fin = open('words.txt') wlist = [] def word_list(word): for line in fin: word = line.strip() w...
{ "content_hash": "5e0febdf620398a579206a3ff31d75de", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 79, "avg_line_length": 21.210526315789473, "alnum_prop": 0.609181141439206, "repo_name": "ITSE-1402/git-classworkspace", "id": "add225b50c298df78e7190f3eef22d72e42dc8b9", "...
import pytest import six from kafka.partitioner import Murmur2Partitioner from kafka.partitioner.default import DefaultPartitioner def test_default_partitioner(): partitioner = DefaultPartitioner() all_partitions = list(range(100)) available = all_partitions # partitioner should return the same parti...
{ "content_hash": "eb7f1bee78063ac5a85c6dcc80c1a13f", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 84, "avg_line_length": 32.23255813953488, "alnum_prop": 0.7027417027417028, "repo_name": "zackdever/kafka-python", "id": "52b6b81d138e96b9019f1ab44f0a99f1d5c83060", "size":...
import json from ..utils import check_resource, minimum_version class NetworkApiMixin(object): @minimum_version('1.21') def networks(self, names=None, ids=None): filters = {} if names: filters['name'] = names if ids: filters['id'] = ids params = {'filt...
{ "content_hash": "0520858d9994317981f5dcf0dd0a062d", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 73, "avg_line_length": 31.05, "alnum_prop": 0.5743424584004294, "repo_name": "rhatdan/docker-py", "id": "ce3f51119cd2f7fc6d655a03593ed910d8f7912d", "size": "1863", "binar...
from unittest import TestCase, mock from airflow.providers.google.marketing_platform.hooks.campaign_manager import GoogleCampaignManagerHook from tests.providers.google.cloud.utils.base_gcp_mock import mock_base_gcp_hook_default_project_id API_VERSION = "v3.3" GCP_CONN_ID = "google_cloud_default" REPORT_ID = "REPORT...
{ "content_hash": "fa50197dd19c501d4c15508185a464d9", "timestamp": "", "source": "github", "line_count": 289, "max_line_length": 110, "avg_line_length": 36.89273356401384, "alnum_prop": 0.6519414743950478, "repo_name": "lyft/incubator-airflow", "id": "9eae66a9cf21d7d5c2598228d9bd59a8c41effea", "size...
import scrapy class ProxySpiderItem(scrapy.Item): # define the fields for your item here like: # name = scrapy.Field() pass
{ "content_hash": "74319ec5f646bd5e191c3817d50e847d", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 48, "avg_line_length": 19.714285714285715, "alnum_prop": 0.6884057971014492, "repo_name": "arthurmmm/hq-proxies", "id": "dfa18d041543dda43e82bfb1c64c0d23bbe3f4d3", "size": "...
import qctests.CSIRO_wire_break import util.testingProfile import numpy ##### CSIRO_wire_break_test --------------------------------------------------- def test_CSIRO_wire_break(): ''' Spot-check the nominal behavior of the CSIRO wire break test. ''' # too cold at the bottom of xbt profile p = ut...
{ "content_hash": "2c94c1bab47385e9fda3d3818decb406", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 103, "avg_line_length": 43.44642857142857, "alnum_prop": 0.6588573777229757, "repo_name": "BillMills/AutoQC", "id": "c617d6dbeba3014f3450b02e08c7e71af2a23380", "size": "243...
from __future__ import print_function import os import numpy as np import pandas as pd import scipy.stats as sps import matplotlib.pyplot as plt import seaborn as sns from statsmodels.stats.multicomp import pairwise_tukeyhsd from shelve import DbfilenameShelf from contextlib import closing from collections import d...
{ "content_hash": "05a00e6c8133e81f86224e55d6bff1d4", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 98, "avg_line_length": 37.37777777777778, "alnum_prop": 0.6266349583828775, "repo_name": "rileymcdowell/genomic-neuralnet", "id": "bb99ed02b2320b769b94b87eec7311b89c06aa43",...
from __future__ import absolute_import from os.path import dirname from tml.api.mock import File FIXTURES_PATH = '%s/fixtures' % dirname(dirname(__file__)) URLS = [('projects/current/definition', None), ('projects/current/definition', {'locale': 'en'}), ('projects/2/definition', None), ('langu...
{ "content_hash": "9ed2235d51ed6cfad229a3e710e64809", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 101, "avg_line_length": 38.32258064516129, "alnum_prop": 0.6254208754208754, "repo_name": "translationexchange/tml-python", "id": "5e2201024a9509c456695d668d6b21b6867225e6", ...
import os import time from tornado.testing import ExpectLog, AsyncTestCase, gen_test from remoteappmanager.tests.temp_mixin import TempMixin from remoteappmanager.tests.utils import mock_coro_factory from unittest.mock import Mock, patch from remoteappmanager.jupyterhub.auth import GitHubWhitelistAuthenticator cl...
{ "content_hash": "937e271dbec370c577267e5ff850d4bc", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 74, "avg_line_length": 34.310344827586206, "alnum_prop": 0.5974874371859297, "repo_name": "simphony/simphony-remote", "id": "b933661ed2019d51caf8f68ee6c63f67cd01dd32", "si...
import logging import copy from itertools import count import claripy from claripy.vsa import ValueSet, RegionAnnotation from ..storage.memory import SimMemory, AddressWrapper, MemoryStoreRequest from ..errors import SimMemoryError, SimAbstractMemoryError from ..sim_options import KEEP_MEMORY_READS_DISCRETE, AVOID_MU...
{ "content_hash": "b3f1c8698e14ea8ec31cd9bfc0e37339", "timestamp": "", "source": "github", "line_count": 692, "max_line_length": 178, "avg_line_length": 39.895953757225435, "alnum_prop": 0.5804476963199072, "repo_name": "tyb0807/angr", "id": "f58b3b7f4a04e5d146024d138070575d5c0dbfce", "size": "27608...
"""Functions that deals with local and device ports.""" import contextlib import fcntl import httplib import logging import os import re import socket import traceback import cmd_helper import constants #The following two methods are used to allocate the port source for various # types of test servers. Because some...
{ "content_hash": "4f800006316d3dd78ec19683ead33857", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 79, "avg_line_length": 35.544871794871796, "alnum_prop": 0.6703336339044184, "repo_name": "keishi/chromium", "id": "be994c362c74a0ec26f98688d72fb573fc20cfa6", "size": "571...
from experiments_manager.consumers import send_message from experiments_manager.helper import MessageStatus from git_manager.helpers.helper import get_exp_or_package_from_repo_name from helpers.helper import get_package_or_experiment_without_request from MOOCworkbench.celery import app @app.task def task_write_requir...
{ "content_hash": "fe079190dd9d105a9ea227523222dd7e", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 86, "avg_line_length": 44.458333333333336, "alnum_prop": 0.7778819119025304, "repo_name": "MOOCworkbench/MOOCworkbench", "id": "83a977fd2ecc0f7a4a8c36a8f59b09c1142e51a3", "...
from __future__ import ( absolute_import, division, print_function, unicode_literals ) import ome_files class TestVersion(object): def test_upstream_version(self): v = ome_files.upstream_version_info for a in "major", "minor", "patch", "extra": assert hasattr(v, a) assert...
{ "content_hash": "d4f8b56f77dca7f173439164eadf99b6", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 69, "avg_line_length": 32.38095238095238, "alnum_prop": 0.5661764705882353, "repo_name": "simleo/ome-files-py", "id": "57e9054abf3d23cd119f353f376f58e9a3ca031d", "size": "2...
"""A base class for EE Functions.""" # Using lowercase function naming to match the JavaScript names. # pylint: disable=g-bad-name import textwrap from . import computedobject from . import ee_exception from . import encodable from . import serializer class Function(encodable.EncodableFunction): """An abstract...
{ "content_hash": "4080f7a77ded85ac03e984aff6b45956", "timestamp": "", "source": "github", "line_count": 214, "max_line_length": 78, "avg_line_length": 32.06542056074766, "alnum_prop": 0.6594287379772661, "repo_name": "google/earthengine-api", "id": "e41bc6a9c7e67dd8403654119f6936357a32bb76", "size"...
import random from faker import Faker from . import College, Essay, Major, RecommendationLetter, TestScore, ChecklistItem, Acceptance, StudentScholarship from .. import db from sqlalchemy.orm import validates student_colleges = db.Table('student_colleges', db.Column('college_id', db.Integer...
{ "content_hash": "ae941fc8120b34ca35cd1cc575aa138c", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 115, "avg_line_length": 47.02255639097744, "alnum_prop": 0.5940198273105213, "repo_name": "hack4impact/next-gen-scholars", "id": "23c8337fc6e2ae3f0ee4f7f38e56dfcc208e6a37", ...
from __future__ import absolute_import from ..client import MultiClient from ..shell import MultiShell class MultiCinder(MultiClient): def __init__(self): super(MultiCinder, self).__init__() self.default_executable = 'cinder' self.prefix_list += ["cinder_", "cinderclient_"] def main_cl...
{ "content_hash": "475e5cbebce27d2e192c5e8258932d82", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 56, "avg_line_length": 24.058823529411764, "alnum_prop": 0.6748166259168704, "repo_name": "testeddoughnut/multistack", "id": "808f91c4c021a394fccdc960aca2389425bf7f6b", "si...
import sympy import collections import stepprinter from stepprinter import functionnames, replace_u_var from sympy.core.function import AppliedUndef from sympy.functions.elementary.trigonometric import TrigonometricFunction from sympy.strategies.core import switch, identity def Rule(name, props=""): return collec...
{ "content_hash": "67197d60ceee11db1fa0a54c3097fb94", "timestamp": "", "source": "github", "line_count": 534, "max_line_length": 95, "avg_line_length": 36.92134831460674, "alnum_prop": 0.5679651044836681, "repo_name": "iScienceLuvr/sympy_gamma", "id": "9294ffeac57cfa5444d0260545fe3d987bfaed3c", "siz...
""" Flickrsaver: A screensaver for Flickr enthusiasts See README for more information. Copyright (c) 2010, Johannes H. Jensen. License: BSD, see LICENSE for more details. """ import time import os import signal import logging import urllib2 from random import randint from threading import Thread, Event, Condition, RL...
{ "content_hash": "def4762ca05eb19a14b2d304d205bdef", "timestamp": "", "source": "github", "line_count": 593, "max_line_length": 89, "avg_line_length": 31.160202360876898, "alnum_prop": 0.5224050221885486, "repo_name": "joh/Flickrsaver", "id": "9eb3e52319107c27b81665686897d7335aedbf65", "size": "185...
import sys from .testconfig import dsn from .testutils import unittest from . import test_async from . import test_bugX000 from . import test_bug_gc from . import test_cancel from . import test_connection from . import test_copy from . import test_cursor from . import test_dates from . import test_extras_dictcursor fr...
{ "content_hash": "5950e119813d753c01e14e9d44d6a1af", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 72, "avg_line_length": 31.446153846153845, "alnum_prop": 0.6952054794520548, "repo_name": "pabulumm/neighbors", "id": "ae32ac216498cb1741b9e34aed342284517a70dd", "size": "3...
import argparse import re import requests import urlparse import os import json from keystoneclient.v2_0 import Client as keystoneclient class NailgunClient(object): def __init__(self, admin_node_ip, **kwargs): self.url = "http://{0}:8000".format(admin_node_ip) keystone_url = "http://{0}:5000/v...
{ "content_hash": "d262c18cb03463f4d5a1aba5b351bbd0", "timestamp": "", "source": "github", "line_count": 341, "max_line_length": 79, "avg_line_length": 41.14076246334311, "alnum_prop": 0.5372442797063226, "repo_name": "smurashov/test-infra", "id": "586f34465679c15dff383eccaf2bb579d86d9616", "size": ...
from domain.container import apply_to_container
{ "content_hash": "2ee8366dc0acc93ee8815aa8aacb6458", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 47, "avg_line_length": 48, "alnum_prop": 0.8541666666666666, "repo_name": "mcuadros/python-solid-example", "id": "b43500b277593d1394278c9ebd1345f8822ced28", "size": "48", ...
import datetime from os import path import urllib import numpy as np import ocw.data_source.local as local import ocw.dataset_processor as dsp import ocw.evaluation as evaluation import ocw.metrics as metrics import ocw.plotter as plotter # File URL leader FILE_LEADER = "http://zipper.jpl.nasa.gov/dist/" # Two Local...
{ "content_hash": "1a7ef6cf1d3fbcaba00b3fa17f2a22a9", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 84, "avg_line_length": 43.37614678899082, "alnum_prop": 0.7235617597292724, "repo_name": "jarifibrahim/climate", "id": "ffa5cda9173abef6e170b651a5382583e45b4d5b", "size": ...
"""Compatibility tests for dulwich repositories.""" from cStringIO import StringIO import itertools import os from dulwich.objects import ( hex_to_sha, ) from dulwich.repo import ( check_ref_format, ) from dulwich.tests.utils import ( tear_down_repo, ) from dulwich.tests.compat.utils import ...
{ "content_hash": "350b5d42790cbda7f5514567d65e565d", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 80, "avg_line_length": 32.764150943396224, "alnum_prop": 0.5974661675784624, "repo_name": "johndbritton/gitviz", "id": "ceebf51408dcaba26a530869242efc3e76d0c28f", "size": ...
import logging from urllib.parse import urljoin, urlencode from werkzeug.local import LocalProxy from werkzeug.middleware.profiler import ProfilerMiddleware from flask import Flask, request from flask import url_for as flask_url_for from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask_ma...
{ "content_hash": "c8151fa690aabbe1bb4dca07d01c608d", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 78, "avg_line_length": 29.847457627118644, "alnum_prop": 0.6596630702252508, "repo_name": "pudo/aleph", "id": "ade523cbc86005cab4548b4a687a0722132fa21d", "size": "5283", ...
""" This module contains a collection of models that implement a simple function: :func:`~revscoring.ScorerModel.score`. Currently, all models are a subclass of :class:`revscoring.scorer_models.MLScorerModel` which means that they also implement :meth:`~revscoring.scorer_models.MLScorerModel.train` and :meth:`~revscor...
{ "content_hash": "9a9d0ac51945089a85a2e2aae472757c", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 77, "avg_line_length": 30.681818181818183, "alnum_prop": 0.737037037037037, "repo_name": "yafeunteun/wikipedia-spam-classifier", "id": "31e30f44d75b818ffb8e7d992df84584408d8d...
from urllib import request response = request.urlopen('http://localhost:8080/') print('RESPONSE:', response) print('URL :', response.geturl()) headers = response.info() print('DATE :', headers['date']) print('HEADERS :') print('---------') print(headers) data = response.read().decode('utf-8') print('LENGTH :...
{ "content_hash": "439290451826b1e7afec22f762861934", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 52, "avg_line_length": 22.58823529411765, "alnum_prop": 0.625, "repo_name": "jasonwee/asus-rt-n14uhp-mrtg", "id": "6920c2d964798c6a32666f3e9cfdd7420ed6238f", "size": "384",...
""" Registro de las clases en el admin de django """ from django.contrib import admin from .models import SliderImage, SliderAlbum class SliderImageAdmin(admin.ModelAdmin): list_display = ('thumb', 'name','description', 'order') admin.site.register(SliderImage, SliderImageAdmin) class SliderAlbumAdmin(admin.Mo...
{ "content_hash": "0e82bffcf7d9056598dda39e2a67ee17", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 60, "avg_line_length": 32.38461538461539, "alnum_prop": 0.7600950118764845, "repo_name": "zakwilson/cmsplugin_jcarousellite", "id": "4570b545c509b9db480bd463add2dee25fbec86e"...
from .geoid import tract_geoid, tract_census_geoid __all__ = ["tract_geoid", "tract_census_geoid"]
{ "content_hash": "ac2d495cea50cd51071dc8a7b7dc801c", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 50, "avg_line_length": 33, "alnum_prop": 0.7070707070707071, "repo_name": "CivicKnowledge/metatab-packages", "id": "d63f62f23145c67426f56d5138068344cd201c3d", "size": "100",...
import sys import os import time speed = sys.argv[1] t = sys.argv[2] #time os.system('python driveM1.py -%s'% speed) os.system('python driveM3.py %s'% speed) time.sleep(float(t)) os.system('python driveM1.py 0') os.system('python driveM3.py 0')
{ "content_hash": "c44ebbe9ad34b7d8a3e71e8b2cc1e512", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 41, "avg_line_length": 19.076923076923077, "alnum_prop": 0.7016129032258065, "repo_name": "cletusw/goal-e", "id": "8fa8ac7c8dc3eb5bddaafb963b2077885413e46a", "size": "248",...
__author__ = 'q00222219@huawei' import time from heat.openstack.common import log as logging import commonutils import constant import exception LOG = logging.getLogger(__name__) class CascadingConfiger(object): def __init__(self, cascading_ip, user, password, cascaded_domain, cascaded_api_ip, v...
{ "content_hash": "a779d5549c329061da8ca25e953612bb", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 78, "avg_line_length": 41.74311926605505, "alnum_prop": 0.49164835164835163, "repo_name": "Hybrid-Cloud/orchard", "id": "88ee9f64656062720879c717b7f921eb8dc15ef2", "size":...
"""Adds config flow for Mill integration.""" import logging from mill import Mill import voluptuous as vol from homeassistant import config_entries from homeassistant.const import CONF_PASSWORD, CONF_USERNAME from homeassistant.helpers.aiohttp_client import async_get_clientsession from .const import DOMAIN # pylint...
{ "content_hash": "d659e7ae8c3362c7f5ad87dfa873374a", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 85, "avg_line_length": 31.01818181818182, "alnum_prop": 0.64947245017585, "repo_name": "titilambert/home-assistant", "id": "08eb0f5c5361367af8208be3873eff560634019c", "size...