text stringlengths 4 1.02M | meta dict |
|---|---|
import os
import shutil
import sys
import tempfile
import django
TEST_ROOT = os.path.realpath(os.path.dirname(__file__))
RUNTESTS_DIR = os.path.join(TEST_ROOT, 'xtests')
sys.path.insert(0, os.path.join(TEST_ROOT, os.pardir))
sys.path.insert(0, RUNTESTS_DIR)
TEST_TEMPLATE_DIR = 'templates'
TEMP_DIR = tempfile.mkdte... | {
"content_hash": "00453c70a930e120cdda5dc2e561138c",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 96,
"avg_line_length": 37.741176470588236,
"alnum_prop": 0.6550810473815462,
"repo_name": "A425/django-nadmin",
"id": "a27ffd1209932d5a7eb44490ccbf8ee2f7ddba12",
"size": "... |
from historia.country.models.country import Country
from historia.country.models.government import Government
from historia.country.models.province import Province
| {
"content_hash": "b107e66550244ea0e7141c055ea7c937",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 57,
"avg_line_length": 54.666666666666664,
"alnum_prop": 0.8719512195121951,
"repo_name": "eranimo/historia",
"id": "a4fcf5bc9ec23eee4b33cf805ba7df58c27080e9",
"size": "164"... |
import dash
import pytest
from dash.dependencies import Input, Output, State
from dash.exceptions import PreventUpdate
from dash import html
from dash.dash_table import DataTable
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
import pandas as pd
url ... | {
"content_hash": "fd2c74fb721ace55c53d7b038b860ce2",
"timestamp": "",
"source": "github",
"line_count": 392,
"max_line_length": 88,
"avg_line_length": 26.535714285714285,
"alnum_prop": 0.5579696212266871,
"repo_name": "plotly/dash",
"id": "10076cc97ea9faf6c81e9e867abf7ee40ac2ac09",
"size": "10402",... |
import warnings
import functools
def deprecated(func):
"""This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emitted
when the function is used."""
@functools.wraps(func)
def new_func(*args, **kwargs):
warnings.warn_explicit(
... | {
"content_hash": "2801f8645f4ee330bcd4dcbc591ef232",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 62,
"avg_line_length": 22.58823529411765,
"alnum_prop": 0.6106770833333334,
"repo_name": "t10471/python",
"id": "fe7c30e219ccc2239e09233a3110bbf9c9a7574a",
"size": "793",
... |
from __future__ import unicode_literals
# import frappe
import unittest
class TestWorkspace(unittest.TestCase):
pass
| {
"content_hash": "8563e6b859958fa3b7e52defbd580c22",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 39,
"avg_line_length": 17.142857142857142,
"alnum_prop": 0.7916666666666666,
"repo_name": "saurabh6790/frappe",
"id": "7a3f122ee2042015d63f76eb9a633c83dfa38a97",
"size": "22... |
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class SummaryOrganizationConfig(AppConfig):
label = 'summary_organization'
name = 'cobra.apps.organization.summary'
verbose_name = _('Summary Organization')
| {
"content_hash": "10615f899514cfd0b0c2434ed1a8e368",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 55,
"avg_line_length": 32.625,
"alnum_prop": 0.7662835249042146,
"repo_name": "lyoniionly/django-cobra",
"id": "4d956ee5c6c1c4d4d770dc2bf951f0b997386000",
"size": "261",
"... |
from unittest import TestCase
from django_sqs.views import parse_attributes
ATTRIBUTES_DICT = [
{ u'ApproximateNumberOfMessagesNotVisible': u'0',
u'MessageRetentionPeriod': u'345600',
u'LastModifiedTimestamp': u'1303884119',
u'MaximumMe... | {
"content_hash": "9f983656c661f9e2c1b1dade84035da3",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 98,
"avg_line_length": 34.660377358490564,
"alnum_prop": 0.497550353837779,
"repo_name": "mjallday/Django-SQS",
"id": "ecbba23940c68801b3cc437d01c67c33c68f3a34",
"size": "1... |
from .collections import AsyncCollections, Collections
| {
"content_hash": "83767afbd5ac476c1b36013ad917f0b8",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 54,
"avg_line_length": 55,
"alnum_prop": 0.8727272727272727,
"repo_name": "GetStream/stream-python",
"id": "8264c83b67f6e38ad3623e06f4fc888912635d6f",
"size": "55",
"binar... |
import sys
import random
class PartitionEnum:
def __init__(self, n, k):
self.n = n
self.k = k
self.reset();
def reset(self):
self.hasNext = (self.k <= self.n)
self.sub = None
self.index = 0 # Number of partitions that have been generated so far
self.nAl... | {
"content_hash": "e83e9d0dd9b7921cfe6a487e38958a65",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 145,
"avg_line_length": 29.04040404040404,
"alnum_prop": 0.504,
"repo_name": "smpcole/partition-enum",
"id": "f3c9996283bf5575304d3640c8c854c29dd97529",
"size": "2875",
"... |
"""The Netatmo integration."""
import asyncio
import logging
import voluptuous as vol
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_entry_oauth2_flow, config_... | {
"content_hash": "67cd97d94f8b7b884843402eb8e0a11c",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 90,
"avg_line_length": 26.930232558139537,
"alnum_prop": 0.6373056994818653,
"repo_name": "Teagan42/home-assistant",
"id": "ace12d3838cadac7c20081708772e97c5bb6c753",
"size... |
from django.conf.urls import include, url
from openslides.utils.plugins import get_all_plugin_urlpatterns
urlpatterns = get_all_plugin_urlpatterns()
urlpatterns += [
url(r"^core/", include("openslides.core.urls")),
url(r"^users/", include("openslides.users.urls")),
]
| {
"content_hash": "f4ca33689365c852e851057fa5043cb8",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 63,
"avg_line_length": 25.454545454545453,
"alnum_prop": 0.7214285714285714,
"repo_name": "emanuelschuetze/OpenSlides",
"id": "94860e0da22179388f50dbb326db402b38f490d1",
"s... |
'''
Numerical example for the Continuous No-Regret Algorithm with
Quadratic loss functions
@author: Maximilian Balandat, Walid Krichene
@date: Dec 20, 2014
'''
from ContNoRegret.Domains import S
from ContNoRegret.Distributions import Uniform
from ContNoRegret.LossFunctions import QuadraticLossFunction
from ContNoReg... | {
"content_hash": "6f24e34ae7c5d00c70aec70419fe92ff",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 85,
"avg_line_length": 32.705882352941174,
"alnum_prop": 0.7128297362110312,
"repo_name": "Balandat/cont_no_regret",
"id": "9fcd72044c0ca8419669c0ac5f340c420545f786",
"size... |
import test
print(test.factorial(10))
| {
"content_hash": "7fb6742f68f2bcc149de61149bf2b9cf",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 25,
"avg_line_length": 19.5,
"alnum_prop": 0.7692307692307693,
"repo_name": "GongYiLiao/Python_Daily",
"id": "d5992148b545e7e84a74d5e151243992db66c4e9",
"size": "58",
"bin... |
from .behaviors.player import Player
from .shaders import ShaderProgram
from .collisions import Collidables, CollidableCategories
from nytram.entity import Entity
from nytram.renderers import EntityRenderer
from nytram.ext.box2d import PlayerBody, Fixture, BodyTypes, Box, Filter
from nytram.ext.box2d.collisions... | {
"content_hash": "23381bbdc168fbc74b6cdc98aa82b151",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 201,
"avg_line_length": 57.193548387096776,
"alnum_prop": 0.7117879300620418,
"repo_name": "cloew/NytramPong",
"id": "6858ce207d49685945a244032c4c48e6975b3261",
"size": "17... |
import time
def speaker(speaker):
print('\n'+speaker+': ', end='')
time.sleep(.2)
| {
"content_hash": "eefcbbece64dde2ad21e2ff11aea9f77",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 36,
"avg_line_length": 18.2,
"alnum_prop": 0.5824175824175825,
"repo_name": "Indmind/Jomblo-Story",
"id": "43011e93183e1ed5d84e7f675108266cfec6484b",
"size": "91",
"binary... |
__author__ = 'croxis'
import sandbox
from direct.directnotify.DirectNotify import DirectNotify
log = DirectNotify().newCategory("SpaceDrive-ClientNet")
#PROPOSAL! {server entity id: client entity id} and reverse lookup dict too
class ClientNetworkSystem(sandbox.UDPNetworkSystem):
def init2(self):
... | {
"content_hash": "149e92d5a4f073a289b16b398432f17a",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 95,
"avg_line_length": 37.25373134328358,
"alnum_prop": 0.6574519230769231,
"repo_name": "croxis/SpaceDrive",
"id": "345b0d67675d3b37fb83e1c39acaddf1dc7fd03f",
"size": "249... |
from setuptools import setup
SCHEDULE_VERSION = '1.7.0'
SCHEDULE_DOWNLOAD_URL = (
'https://github.com/Cubewise-code/TM1py/tarball/' + SCHEDULE_VERSION
)
with open('README.md', 'r') as f:
long_description = f.read()
setup(
name='TM1py',
packages=['TM1py', 'TM1py/Exceptions', 'TM1py/Objects', 'TM1p... | {
"content_hash": "daf5a56d10e7087ae2ddf9e0485447fa",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 93,
"avg_line_length": 31.177777777777777,
"alnum_prop": 0.6086956521739131,
"repo_name": "OLAPLINE/TM1py",
"id": "ad8db0607a861af5f2cb68c43a744c2569e9db4e",
"size": "1403"... |
def border(length):
print(length*"-")
print(length*"~")
print(length*"-")
# Function to print text surrounded by a border
def print_with_border(text, length):
border(length)
print(text)
print("intentionally wrong for testing purposes")
border(length)
def print_auto_border(text) :
borde... | {
"content_hash": "62bad254a615e84eb6738b12f8a28160",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 55,
"avg_line_length": 24.4,
"alnum_prop": 0.6721311475409836,
"repo_name": "golfit/MEETY1UnitTesting",
"id": "3babd52f12a84771e1825e2001032041782c8e05",
"size": "536",
"... |
"""
WSGI config for ganzige project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTI... | {
"content_hash": "ec354a7502ad384cd9b47ea04c7930a2",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 24.4375,
"alnum_prop": 0.7698209718670077,
"repo_name": "kekehurry/ganzige.site",
"id": "47a3633dce9d57a235008fa04c750a2655a8229f",
"size": "391",
... |
"""
Terrain Following Mesh
~~~~~~~~~~~~~~~~~~~~~~
Use a topographic surface to create a 3D terrain-following mesh.
Terrain following meshes are common in the environmental sciences, for instance
in hydrological modelling (see
`Maxwell 2013 <https://www.sciencedirect.com/science/article/abs/pii/S0309170812002564>`_
an... | {
"content_hash": "90ecc43ad084d846e724973ba4642c6b",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 89,
"avg_line_length": 40.02777777777778,
"alnum_prop": 0.6155447605829285,
"repo_name": "akaszynski/vtkInterface",
"id": "c0f7ee60908c9a18064ec624ebda8a40f1aa5171",
"size"... |
"""OmniNet models utilities."""
import jax.numpy as jnp
def grid_restack(all_vecs):
"""Stack layers with respect to the grid shape of positions.
Given multiple sequences (lists) of batch x len x dim reshape this such
that all positions are side by side.
for example (for illustrative purposes):
inputs: [... | {
"content_hash": "13beaed93fe7b63cd2945c21aeafd6a4",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 73,
"avg_line_length": 26.214285714285715,
"alnum_prop": 0.6335149863760218,
"repo_name": "google-research/scenic",
"id": "7f6776ffbf4d96a687b2d97687b77618f19c9c05",
"size"... |
from .commutative import Commutative
class Product(Commutative):
def __init__(self, *args):
super(Product, self).__init__(*self.simplified(*args))
def simplified(self, *args):
"""
Returns a sequence containing expressions that make a simplified Product.
Used when ``Product`` is... | {
"content_hash": "a90dabace6b8c59a48e38e6f718324fb",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 95,
"avg_line_length": 30.2,
"alnum_prop": 0.5401490066225165,
"repo_name": "LordDarkula/polypy",
"id": "5a558f026954b5e3109bf54fd429538fb36ee50a",
"size": "2416",
"binar... |
import sys
import os
import getopt
import pgdb
from pprint import pprint
schema_file = None
config_file = "/etc/planetlab/plc_config"
config = {}
exec(compile(open(config_file).read(), config_file, 'exec'), config)
def usage():
print("Usage: %s SCHEMA_FILE " % sys.argv[0])
sys.exit(1)
try:
sc... | {
"content_hash": "68c70d327cbeb9e639fb40d6fa1c929f",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 128,
"avg_line_length": 48.91596638655462,
"alnum_prop": 0.47294279333447864,
"repo_name": "dreibh/planetlab-lxc-plcapi",
"id": "acd3b1c412e5edffa78fd8a4e886fa0ea574e1ea",
... |
"""Test pywwa/__init__.py"""
# stdlin
import os
import shutil
# Local
import pywwa
def test_load_settings():
"""Test that we can load settings."""
if os.path.isfile("settings.json"):
shutil.move("settings.json", "settings.json.save")
res = pywwa.load_config()
assert isinstance(res, dict)
... | {
"content_hash": "1d274f35d9c56dace3586e1328136dd6",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 58,
"avg_line_length": 24.705882352941178,
"alnum_prop": 0.6523809523809524,
"repo_name": "akrherz/pyWWA",
"id": "4ba3e18001cdd9baee82fa3c3fa53315f5c36dd8",
"size": "420",
... |
import serial
connected = False
ser = serial.Serial("/dev/tty.usbmodem411", 9600)
## loop
while not connected:
serin = ser.read()
connected = True
ser.write("1")
## done
while ser.read() == '1':
ser.read()
ser.close() | {
"content_hash": "63c5b85ee5e372ef957c9fc732caf2bd",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 49,
"avg_line_length": 13.578947368421053,
"alnum_prop": 0.5775193798449613,
"repo_name": "baird/pycom",
"id": "e6c457424b6271891a34f1c939bfbecfc72d0be2",
"size": "258",
... |
'''
Created on 21/01/2014
@author: Dani
'''
from ConfigParser import ConfigParser
from es.weso.util.file_writer import FileWriter
import os
class FaostatIndicatorCatcher(object):
'''
classdocs
'''
def __init__(self):
self.config = ConfigParser()
self.config.read("../../../../config/... | {
"content_hash": "fecbdef5b33e0a31d1bebd894f7c65d4",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 135,
"avg_line_length": 29.69090909090909,
"alnum_prop": 0.5799142682180036,
"repo_name": "landportal/landbook-importers",
"id": "af449332d569d44b0447cab43ec03af4fd8ca33b",
... |
import django_filters
from dal import autocomplete
from django.utils.translation import gettext_lazy as _
from teryt_tree.dal_ext.filters import VoivodeshipFilter, CountyFilter, CommunityFilter
from .models import Institution
class InstitutionFilter(django_filters.FilterSet):
voivodeship = VoivodeshipFilter(
... | {
"content_hash": "64df11cf4226530f59f690d06ee71e5a",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 87,
"avg_line_length": 34.529411764705884,
"alnum_prop": 0.666098807495741,
"repo_name": "watchdogpolska/feder",
"id": "28c85d4d6748e68b39c332b4c032c2e72b1d27be",
"size": "... |
from pyrope.server import application, service
from pyrope.examples.helloworld import HelloWorldApplication
from pyrope.examples.addressbook import AddressBookApplication
from pyrope.examples.widgets import WidgetsApplication
from pyrope.examples.ticker import TickerApplication
from pyrope.examples.chat import ChatApp... | {
"content_hash": "9a96006379c7ba6d8307227f51867d5b",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 62,
"avg_line_length": 39.8125,
"alnum_prop": 0.869701726844584,
"repo_name": "rgravina/Pyrope",
"id": "0993750f9c7c4ba7c4f72ca4296c0a21dcc5b94f",
"size": "697",
"binary"... |
import pysplash
import rq
import redis
import uuid
import time
import random
log = pysplash.log.logger()
queue_name = str(uuid.uuid4())
def do_work():
# Let the pool spin up many workers
time.sleep(15)
start_time = time.time()
a = 2**2**30
end_time = time.time()
return end_time - start_t... | {
"content_hash": "fb65e7410719e1297a7caa6da23bfda2",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 81,
"avg_line_length": 17.071428571428573,
"alnum_prop": 0.592747559274756,
"repo_name": "aelaguiz/pysplash",
"id": "5d99be72fb1b04b1776eb6f80351565acc94bf45",
"size": "742... |
from django.contrib.gis.db import models as gis_models
from django.db import models
from poznaj.points.models import Point
class Story(models.Model):
title = models.CharField(max_length=100)
description = models.TextField()
duration = models.DurationField()
first_point = models.ForeignKey(Point, rela... | {
"content_hash": "6b18d05d2cf55fba9af956249ffdd2dc",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 81,
"avg_line_length": 28.55,
"alnum_prop": 0.7005253940455342,
"repo_name": "KlubJagiellonski/poznaj-app-backend",
"id": "cb3386aeb84061c92e92496ac127f1c30b9200ee",
"size"... |
# objects hidden in the dictionary
class Property(object):
def __init__(self,key=None):
self._key = key
def __get__(self,obj,kls=None):
if obj is None: return self
else : return dict.__getitem__(obj,self._key)
def __set__(self,obj,val):
dict.__setitem__(obj... | {
"content_hash": "bbf119cd8a303df0f885f6c8a25ff65a",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 62,
"avg_line_length": 31.615384615384617,
"alnum_prop": 0.5450121654501217,
"repo_name": "aerialhedgehog/VyPy",
"id": "c688c5f98cc79bc69c424e0b1ca5f18ddc0fd86d",
"size": "... |
from google.cloud import aiplatform_v1beta1
async def sample_get_annotation_spec():
# Create a client
client = aiplatform_v1beta1.DatasetServiceAsyncClient()
# Initialize request argument(s)
request = aiplatform_v1beta1.GetAnnotationSpecRequest(
name="name_value",
)
# Make the reques... | {
"content_hash": "6f4a57c8b986e402912c4affc0e88f38",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 86,
"avg_line_length": 27.473684210526315,
"alnum_prop": 0.7394636015325671,
"repo_name": "googleapis/python-aiplatform",
"id": "66bc7074f92416a9a9487aa6ae5e14adfe450016",
... |
"""Methods for resolving JSON types during serialization."""
import datetime
import functools
from typing import Dict, List, NamedTuple, Optional, Tuple, TYPE_CHECKING
from cirq.protocols.json_serialization import ObjectFactory
if TYPE_CHECKING:
import cirq
import cirq.ops.pauli_gates
import cirq.devices.... | {
"content_hash": "7b28d5ad2c793be574830357573ab080",
"timestamp": "",
"source": "github",
"line_count": 265,
"max_line_length": 102,
"avg_line_length": 46.95849056603774,
"alnum_prop": 0.6820154291224687,
"repo_name": "quantumlib/Cirq",
"id": "6a2d4f69c7cd502e0ffdee7e6c918592b3932b8a",
"size": "130... |
import threading
import unittest
import mock
import numpy
import six
import chainer
from chainer import cuda
import chainer.functions as F
from chainer import testing
from chainer.testing import attr
from chainer.utils import type_check
class TestFunction(unittest.TestCase):
def _get_method(self, prefix, gpu):... | {
"content_hash": "3200fba0ad4c64a790a3643a2b4ed0d9",
"timestamp": "",
"source": "github",
"line_count": 491,
"max_line_length": 79,
"avg_line_length": 31.105906313645622,
"alnum_prop": 0.5881621161526878,
"repo_name": "kashif/chainer",
"id": "650c587a5e4682cbc547398da5e23b181c49d57f",
"size": "1527... |
from os.path import exists
from setuptools import setup
import chest
setup(name='chest',
version=chest.__version__,
description='Simple on-disk dictionary',
url='http://github.com/mrocklin/chest/',
author='https://raw.github.com/mrocklin/chest/master/AUTHORS.md',
maintainer='Matthew Rockl... | {
"content_hash": "233319205e071e21b7f650b40415b3b8",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 73,
"avg_line_length": 34.588235294117645,
"alnum_prop": 0.6360544217687075,
"repo_name": "cpcloud/chest",
"id": "2397eb3749954de6e4903cb7bc855f15c538c221",
"size": "611",
... |
""" Core functions for
- Uniform spanning trees
* :func:`ust_sampler_wilson`
* :func:`ust_sampler_aldous_broder`:
- Descent procresses :class:`Descent`:
* :func:`uniform_permutation`
- :class:`PoissonizedPlancherel` measure
* :func:`uniform_permutation`
* :func:`RSK`: Robinson-Schensted-Knuth ... | {
"content_hash": "691db9499acd7a2f74f69ef1c46513e6",
"timestamp": "",
"source": "github",
"line_count": 285,
"max_line_length": 159,
"avg_line_length": 30.43859649122807,
"alnum_prop": 0.5791354466858789,
"repo_name": "guilgautier/DPPy",
"id": "ee0f80f6724ef8639ae6dda8ef46e91df83701a5",
"size": "86... |
from pyspark.mllib.regression import LabeledPoint
from pyspark.mllib.tree import DecisionTree
from pyspark import SparkConf, SparkContext
from numpy import array
# Boilerplate Spark stuff:
conf = SparkConf().setMaster("local").setAppName("SparkDecisionTree")
sc = SparkContext(conf = conf)
# Some functions that conver... | {
"content_hash": "430253ec52225a898b2cd8e85da813fd",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 82,
"avg_line_length": 35.48684210526316,
"alnum_prop": 0.7081942899517983,
"repo_name": "vadim-ivlev/STUDY",
"id": "61def5fc5352b86d515f8736df82982dff8be824",
"size": "269... |
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('monitor', '0007_auto_20170718_2235'),
]
operations = [
migrations.AlterField(
... | {
"content_hash": "5d007faa7cb132cd8ce6f7566c9deba8",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 109,
"avg_line_length": 25.3,
"alnum_prop": 0.6047430830039525,
"repo_name": "achow101/forkmon",
"id": "0880ee72ee5013533f8277e116e9dc126b97a4cb",
"size": "581",
"binary"... |
import ujson as json
import time
import base64
import crypto
RULE_KEY = 'rule'
EXPIRE_KEY = 'expire'
SIG_KEY = 'sig'
CAP_KEY = 'capability'
ONE_HOUR = 3600
def issue(rule):
'''
issue a signed capability object
'''
curr_time = int(time.time())
expire_time = curr_time + ONE_HOUR
cap_body = dict... | {
"content_hash": "0848b2cf6eefdcad89229bd8863f2708",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 53,
"avg_line_length": 19.37037037037037,
"alnum_prop": 0.6443594646271511,
"repo_name": "dongting/sdnac",
"id": "b55af8018fef04193e8fdeaa708759458550cb66",
"size": "523",
... |
import cherrypy
class HelloWorld:
def index(self):
return "Hello World!"
index.exposed = True
cherrypy.root = HelloWorld()
cherrypy.server.start()
| {
"content_hash": "790fb924af9e011739128bbcaa275651",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 29,
"avg_line_length": 18.333333333333332,
"alnum_prop": 0.6909090909090909,
"repo_name": "teamtachyon/Quillpad-Server",
"id": "f9e070c428c98f0814ba86e50b399454e874b618",
"s... |
from nose.tools import *
from dateutil.parser import parse as time_parse
import yawhois
class TestWhoisNicTelStatusAvailable(object):
def setUp(self):
fixture_path = "spec/fixtures/responses/whois.nic.tel/status_available.txt"
host = "whois.nic.tel"
part = yawhois.record.Pa... | {
"content_hash": "d94182685ac2a08f29d60887b28554e3",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 83,
"avg_line_length": 31.14814814814815,
"alnum_prop": 0.6266349583828775,
"repo_name": "huyphan/pyyawhois",
"id": "63640b68a3a0588e91fb10f318e8e6866815839f",
"size": "194... |
import unittest
from feedly.storage.redis.structures.hash import RedisHashCache,\
ShardedHashCache, FallbackHashCache
from feedly.storage.redis.structures.list import RedisListCache,\
FallbackRedisListCache
from feedly.storage.redis.connection import get_redis_connection
from functools import partial
from feedl... | {
"content_hash": "ec58931862d227314f8ae31578f373a2",
"timestamp": "",
"source": "github",
"line_count": 334,
"max_line_length": 74,
"avg_line_length": 31.84431137724551,
"alnum_prop": 0.5866867243324558,
"repo_name": "Architizer/Feedly",
"id": "6c86959c565bad500ae2b7e9b4b4c8b99dce0965",
"size": "10... |
"""
Site-Customize
Template file to put into a virtual-env to implicitely engage the editline
completer instead of readline (whether or not it is present)
"""
import sys
import os
def enable_line_completer():
"""Enable default line-editor configuration on interactive prompts, by
registering a sys.__interacti... | {
"content_hash": "db20af8b2884777fb1af83bb5d9c39bb",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 78,
"avg_line_length": 39.67142857142857,
"alnum_prop": 0.6121714079942384,
"repo_name": "mark-nicholson/python-editline",
"id": "b78b40872b7c65f403f06fb5c821df2cb15d0c56",
... |
"""
Tests for checking the configuration for app has
the valid checks (gstorage.apps, gstorage.checks)
"""
from mock import patch
from os import environ
from unittest import TestCase
from django.conf import settings
from gstorage.checks import check_gstorage_params
key = 'GOOGLE_APPLICATION_CREDENTIALS'
@patch('gs... | {
"content_hash": "bc64562781066f39512e0a5a85a597a9",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 98,
"avg_line_length": 29.375,
"alnum_prop": 0.6570212765957447,
"repo_name": "fyndiq/django-gstorage",
"id": "98ad09151b6605ebcf2b66d8f9f4ef6f7e644cc5",
"size": "1199",
... |
class Solution:
# @param {char[]} string: An array of Char
# @param {int} length: The true length of the string
# @return {int} The true length of new string
def replaceBlank(self, string, length):
if not string: return string
s = ''
for i in string:
s += i
s ... | {
"content_hash": "204846d3c45ebbd57bd6c0d4106b036c",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 56,
"avg_line_length": 32.42857142857143,
"alnum_prop": 0.539647577092511,
"repo_name": "1ta/study_python",
"id": "3cc6a1633db25d0f975001d88f40fdabaa1162a1",
"size": "454",... |
from __future__ import division, print_function, absolute_import
import time
import numpy as np
from scipy.sparse.linalg import LinearOperator
from .._differentiable_functions import VectorFunction
from .._constraints import (
NonlinearConstraint, LinearConstraint, PreparedConstraint, strict_bounds)
from .._hessian... | {
"content_hash": "d805373cb667ebd36d64d36eb9490751",
"timestamp": "",
"source": "github",
"line_count": 534,
"max_line_length": 96,
"avg_line_length": 45.837078651685395,
"alnum_prop": 0.5963149078726968,
"repo_name": "gfyoung/scipy",
"id": "2a7238722a08e9e3b5bc4321dbb50446024593ea",
"size": "24477... |
"""
Additional tests for PandasArray that aren't covered by
the interface tests.
"""
import numpy as np
import pytest
from pandas.core.dtypes.dtypes import PandasDtype
import pandas as pd
import pandas._testing as tm
from pandas.arrays import PandasArray
@pytest.fixture(
params=[
np.array(["a", "b"], dt... | {
"content_hash": "fa872709ecadeb05929ce34c240452d0",
"timestamp": "",
"source": "github",
"line_count": 263,
"max_line_length": 78,
"avg_line_length": 25.96197718631179,
"alnum_prop": 0.5774751025190392,
"repo_name": "jorisvandenbossche/pandas",
"id": "e8e9ee86e77dd677036a0e7ce9e709a68d90bd64",
"si... |
from google.cloud import vmmigration_v1
def sample_list_target_projects():
# Create a client
client = vmmigration_v1.VmMigrationClient()
# Initialize request argument(s)
request = vmmigration_v1.ListTargetProjectsRequest(
parent="parent_value",
page_token="page_token_value",
)
... | {
"content_hash": "8d9b84608f79d233bac6a8550fa618a8",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 68,
"avg_line_length": 26.571428571428573,
"alnum_prop": 0.7060931899641577,
"repo_name": "googleapis/python-vm-migration",
"id": "9b31ed21a2ed53df0dda50c2ca54ac3af148dec2",
... |
""" TwitterCmd - Interactive, console prompt to twitter
written on top of the python-twitter API.
A lot of credit to DeWitt Clinton and his team of
developers for the excellent 'python-twitter' API on
top of which, this program is written on.
Author: Anand B Pillai ('pythonhacker')
License: BSD License
"""
from twi... | {
"content_hash": "ddbab9f742e99bcf7c874df6a9c84e43",
"timestamp": "",
"source": "github",
"line_count": 394,
"max_line_length": 95,
"avg_line_length": 31.99492385786802,
"alnum_prop": 0.5579882595589402,
"repo_name": "ActiveState/code",
"id": "7c083d5a06f6cb1d1848fc5e73bcd992e8df2b7f",
"size": "126... |
"""Library for creating periodic distribution shift tasks on Stack Overflow."""
# TODO(b/193904908): add unit tests.
from typing import Optional
import tensorflow as tf
import tensorflow_federated as tff
from periodic_distribution_shift.datasets import stackoverflow_nwp_preprocessing as word_prediction_preprocessin... | {
"content_hash": "6f81f79aa97e1f4123a1e5b35492cf2a",
"timestamp": "",
"source": "github",
"line_count": 533,
"max_line_length": 113,
"avg_line_length": 43.72607879924953,
"alnum_prop": 0.7113618810606711,
"repo_name": "google-research/federated",
"id": "d58c5ec7d6cc316f7c37beb0713f2f8b16aa2649",
"s... |
import SimpleHTTPServer
import SocketServer
import logging
import cgi
PORT = 9200
class ServerHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_GET(self):
logging.error(self.headers)
SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)
def do_POST(self):
logging.error(self... | {
"content_hash": "9c6a8655839243b471f6979375ef8b1f",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 65,
"avg_line_length": 26.35483870967742,
"alnum_prop": 0.6499388004895961,
"repo_name": "LabAdvComp/osdcquery",
"id": "87e784fd6eb4e60979890f0cf9a60813423648fc",
"size": "... |
"""
TODO: module docs
"""
import collections
import sys
import os
import stat
try:
import pgdb
from gppylib.commands.unix import UserId
except ImportError, e:
sys.exit('Error: unable to import module: ' + str(e))
from gppylib import gplog
logger = gplog.get_default_logger()
class ConnectionError(Stand... | {
"content_hash": "6472d00132f26f510782eea40f265dcc",
"timestamp": "",
"source": "github",
"line_count": 335,
"max_line_length": 129,
"avg_line_length": 32.05074626865672,
"alnum_prop": 0.5820061469684269,
"repo_name": "jmcatamney/gpdb",
"id": "40caf5c81bea0e2a34a6708755c22f95fd751e75",
"size": "108... |
import logging
import os
import smtpd
import smtplib
import asyncore
from ConfigParser import ConfigParser
log = logging.getLogger(__name__)
def main():
cp = ConfigParser()
log.info('Read config from: %s',
cp.read([os.path.join(os.environ['HOME'], '.open_relay.ini')]))
host = cp.get('open_re... | {
"content_hash": "f72dd68c33ab9999631c2045860cdce5",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 82,
"avg_line_length": 31.214285714285715,
"alnum_prop": 0.5739130434782609,
"repo_name": "apache/incubator-allura",
"id": "ba21862ac9556dda8410aa10f4f4f0ca3d69c648",
"size... |
"""
Copyright (c) 2012-2014, Austin Benson and David Gleich
All rights reserved.
This file is part of MRTSQR and is under the BSD 2-Clause License,
which can be found in the LICENSE file in the root directory, or at
http://opensource.org/licenses/BSD-2-Clause
"""
"""
ARInv.py
===========
Compute A *... | {
"content_hash": "a26997adf10f2b03c913c1fa12dd173b",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 83,
"avg_line_length": 27.78048780487805,
"alnum_prop": 0.6470588235294118,
"repo_name": "arbenson/mrtsqr",
"id": "e25df1e3d4130d69e5eb15025b0ea0476db43e4e",
"size": "2278"... |
from .importer import activate
__all__ = ('activate',) | {
"content_hash": "c1e16ee4afcbd7fee72758bf0af191a1",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 30,
"avg_line_length": 18.333333333333332,
"alnum_prop": 0.6727272727272727,
"repo_name": "avanov/solo",
"id": "83d4d16e00eb59a3537a3641e71c08c342c96cab",
"size": "55",
"b... |
from collections import defaultdict
class BoardCleaner:
def clearBoard(self, board):
self.__clear_flower__(board)
plan = []
dragonSlayed = []
clearedFound = True
while dragonSlayed or clearedFound:
clearedFound = self.__clear_foundation__(board)
self._... | {
"content_hash": "b786d7b3ff82c35eadd2ff75c2eaed65",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 79,
"avg_line_length": 39.2027027027027,
"alnum_prop": 0.5105136159944846,
"repo_name": "davidxk/SolitaireBot",
"id": "9de79d58dc407c0fe083be982ff5dd3ed077a738",
"size": "2... |
from urllib2 import urlopen
from bs4 import BeautifulSoup
import requests
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
app = QApplication(sys.argv)
URL= 'http://sdpdr.nic.in/annauniv/Authentication'
#get userdata
RegisterNumber = raw_input("Enter the registration n... | {
"content_hash": "f1505aa01c1a14d292bdd89e4e8d9a4d",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 88,
"avg_line_length": 25.2,
"alnum_prop": 0.6779100529100529,
"repo_name": "ActiveState/code",
"id": "a69803cc535b4e1e64b7e8337fc859cd446abc39",
"size": "1512",
"binary"... |
"""SCons.Scanner.LaTeX
This module implements the dependency scanner for LaTeX code.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# ... | {
"content_hash": "2bad87f20d38d3122d89a647b4331967",
"timestamp": "",
"source": "github",
"line_count": 262,
"max_line_length": 129,
"avg_line_length": 43.00763358778626,
"alnum_prop": 0.589368122115726,
"repo_name": "frew/simpleproto",
"id": "fefeb14a83cb0c6439d5ef5804916e31144b59db",
"size": "112... |
import sys
from oslo_config import cfg
from oslo_service import service
from neutron.agent.common import config
from neutron.agent.l3 import ha
from neutron.agent.linux import external_process
from neutron.agent.linux import interface
from neutron.agent.linux import pd
from neutron.agent.linux import ra
from neutron.... | {
"content_hash": "1240a2231c5a9f5337b39d19a3018e76",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 69,
"avg_line_length": 35.54761904761905,
"alnum_prop": 0.7642330877427997,
"repo_name": "igor-toga/local-snat",
"id": "72f6c8417983ed20289e87aab1c077f69b6837b5",
"size": "... |
"""
The ssh_autodetect module is used to auto-detect the netmiko device_type to use to further initiate
a new SSH connection with a remote host. This auto-detection is based on a unique class called
**SSHDetect**.
Notes
-----
The **SSHDetect** class is instantiated using the same parameters than a standard Netmiko
co... | {
"content_hash": "13d53baf61f77a04734380333540461d",
"timestamp": "",
"source": "github",
"line_count": 265,
"max_line_length": 100,
"avg_line_length": 36.573584905660375,
"alnum_prop": 0.6025588113908378,
"repo_name": "michaelrosejr/pyaos6",
"id": "88c9093420e3244d7412f0e408a55ba81798520b",
"size"... |
from external_program_test_framework import *
class Bash(ExternalProgramTestSuite):
""" Bash test suite
"""
def setup(self):
print('setup')
def teardown(self):
print('teardown')
def valid_pwd_command(self):
if (os.name is "nt"):
self.check_subprocess("c... | {
"content_hash": "68fe8bece01cd790ddd6708db361ccbb",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 91,
"avg_line_length": 28.42718446601942,
"alnum_prop": 0.6058743169398907,
"repo_name": "agramian/PythonExternalProgramTestFramework",
"id": "c27e1a8dfc4042eb727c90649a41d2... |
from _rawffi import alt as _ffi
import _rawffi
from _ctypes.basics import _CData, cdata_from_address, _CDataMeta, sizeof
from _ctypes.basics import keepalive_key, store_reference, ensure_objects
from _ctypes.basics import CArgObject, as_ffi_pointer
class ArrayMeta(_CDataMeta):
def __new__(self, name, cls, typedic... | {
"content_hash": "e815ce3e21c31b3e110ad9d185d9ed76",
"timestamp": "",
"source": "github",
"line_count": 240,
"max_line_length": 82,
"avg_line_length": 36.13333333333333,
"alnum_prop": 0.5486623616236163,
"repo_name": "timm/timmnix",
"id": "ef315bb79e2f51d0fa16103132c9b5b624a01953",
"size": "8672",
... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: memset_server_info
author: "Simon Weald (@glitchcrab)"
version_added: "2.8"
short_des... | {
"content_hash": "32543ee542d8016a8724c47eb4ed90b2",
"timestamp": "",
"source": "github",
"line_count": 295,
"max_line_length": 117,
"avg_line_length": 28.138983050847457,
"alnum_prop": 0.6060715576436574,
"repo_name": "thaim/ansible",
"id": "7642a053922a56b24de890c0f42a9002ea256b14",
"size": "8498... |
from google.appengine.ext import ndb
from user.models import User
class Organization(ndb.Model):
name = ndb.StringProperty()
owner = ndb.KeyProperty(kind=User)
address1 = ndb.StringProperty()
address2 = ndb.StringProperty()
zipcode = ndb.StringProperty()
city = ndb.StringPrope... | {
"content_hash": "829e8855fa9d2322568383e0a6dcffd4",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 93,
"avg_line_length": 30.160714285714285,
"alnum_prop": 0.6642984014209592,
"repo_name": "ThomasMarcel/ana-tool",
"id": "f73afcacec3b24698cf05b06a1dafb1a37054988",
"size":... |
import nose
from webium.plugins.browser_closer import BrowserCloserPlugin
if __name__ == '__main__':
nose.run_exit(argv=['nosetests', '-v', '--exe',
'tests',
'--with-xunit',
'--xunit-file=webium_xunit_output.xml',
'--w... | {
"content_hash": "013b0dfcf0423ff55345c008cb55794e",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 63,
"avg_line_length": 36.81818181818182,
"alnum_prop": 0.4740740740740741,
"repo_name": "drptbl/webium",
"id": "db173160bce47887b63ae0ffd1a994a76125af23",
"size": "405",
... |
""" Setuptools project configuration for merkletree. """
from os.path import exists
from setuptools import setup
LONG_DESC = None
if exists('README.md'):
with open('README.md', 'r') as file:
LONG_DESC = file.read()
setup(name='merkletree',
version='5.4.0',
author='Jim Dixon',
author_ema... | {
"content_hash": "27bdad88c5ec83e7d4a7ee42fc41685a",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 73,
"avg_line_length": 32.911764705882355,
"alnum_prop": 0.5960679177837355,
"repo_name": "jddixon/merkletree",
"id": "51ad061c25a29d5500a6f9bca8c3ebe4f5e9a379",
"size": "1... |
import datetime
import json
from django import forms
from django.core.urlresolvers import reverse
from django.forms import Widget
from django.utils import formats
from django.utils.html import format_html
from django.utils.safestring import mark_safe
from django.utils.text import capfirst
from googleapiclient.discovery... | {
"content_hash": "d21ec3ec379fc96243411141ed35ed13",
"timestamp": "",
"source": "github",
"line_count": 437,
"max_line_length": 215,
"avg_line_length": 35.64302059496568,
"alnum_prop": 0.5970724191063174,
"repo_name": "huanpc/IoT-1",
"id": "2e6c43efe9a1d371445efd13883c64db07e55418",
"size": "15596"... |
from __future__ import absolute_import
import mock
from django.core import mail
from django.utils import timezone
from exam import fixture
from mock import Mock
from sentry.interfaces.stacktrace import Stacktrace
from sentry.models import Event, Group, Rule
from sentry.plugins import Notification
from sentry.plugins... | {
"content_hash": "6ec1f48b2e805755b2c5aa5fb86cddfb",
"timestamp": "",
"source": "github",
"line_count": 213,
"max_line_length": 105,
"avg_line_length": 35.840375586854464,
"alnum_prop": 0.6266701598113702,
"repo_name": "BayanGroup/sentry",
"id": "24127a016475c88047548a20ac09793cf9c94977",
"size": "... |
"""tensorflow_io.experimental.image"""
from tensorflow_io.python.experimental.image_ops import ( # pylint: disable=unused-import
draw_bounding_boxes,
decode_jpeg_exif,
decode_tiff_info,
decode_tiff,
decode_exr_info,
decode_exr,
decode_pnm,
decode_hdr,
decode_nv12,
decode_yuy2,
... | {
"content_hash": "ffd42e905988f9d7bc2698e624302446",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 90,
"avg_line_length": 21.823529411764707,
"alnum_prop": 0.660377358490566,
"repo_name": "tensorflow/io",
"id": "aa678ee0cc4fbd932168895490bc736e0e662387",
"size": "1060",
... |
import numpy as np
import cv2
import glob
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
from functools import partial
from image_transformation import *
from kalman_filter import KalmanFilter1D
FONT = cv2.FONT_HERSHEY_SIMPLEX
def identify_points(masked_image):
"""Retrieve the ... | {
"content_hash": "bec21871ee63889d584d1850dbfc73a8",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 106,
"avg_line_length": 41.38528138528139,
"alnum_prop": 0.6106694560669456,
"repo_name": "dzorlu/sdc",
"id": "a59a28aa34693b5bf392e7023133fd96f1081e08",
"size": "9560",
... |
from datetime import datetime
from django.conf import settings
from django.contrib.auth.models import User
from django.db import models
from kitsune.sumo.models import LocaleField, ModelBase
from kitsune.sumo.urlresolvers import reverse
from kitsune.sumo.utils import auto_delete_files
class Media(ModelBase):
""... | {
"content_hash": "14fb6ecfa39d291f57b89fbf4637a7b9",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 97,
"avg_line_length": 36,
"alnum_prop": 0.6905615292712067,
"repo_name": "mozilla/kitsune",
"id": "d05859590a0617a0d005153adfe4f2a0ec638f13",
"size": "3348",
"binary": f... |
"""
CloudPipe - Build a user-data payload zip file, and launch
an instance with it.
"""
import os
import string
import zipfile
from nova import compute
from nova.compute import instance_types
from nova import crypto
from nova import db
from nova import exception
from nova import flags
from nova.openstack.common impo... | {
"content_hash": "f3a697fa47cfe44c40aa4cbd1aecceae",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 79,
"avg_line_length": 40.5,
"alnum_prop": 0.5322552599547905,
"repo_name": "paulmathews/nova",
"id": "206ce1835935d6b7b5c48d6935506126bd97a0dd",
"size": "6528",
"binary... |
"""Constant strings used throughout the package."""
import re
from typing import Any, List, Mapping, Optional, Sequence, Tuple, Union
import tensorflow as tf
# TODO(b/245729353) Migrate string constants to enums where appropriate.
# Formatting string for feature names.
CONTEXT_FMT = '{stype}/{fname}'
FEATURE_FMT = '... | {
"content_hash": "cc9cbb86300ce4f19bdaedfc03220057",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 79,
"avg_line_length": 35.95454545454545,
"alnum_prop": 0.7550568900126422,
"repo_name": "tensorflow/gnn",
"id": "2ec302dce3be90ff522e9ddca18ed6d1b6249662",
"size": "3857",... |
from flask import render_template, request, redirect, \
url_for, flash, session, abort, current_app, jsonify
from flask.blueprints import Blueprint
from flask.ext.babel import gettext
from flask.ext.login import current_user, login_user, logout_user, \
login_required
from sqlalchemy.exc import OperationalError
... | {
"content_hash": "d977891db396bdce6016dc2e1e5fcbe7",
"timestamp": "",
"source": "github",
"line_count": 237,
"max_line_length": 84,
"avg_line_length": 34.13502109704641,
"alnum_prop": 0.6292954264524104,
"repo_name": "fgrsnau/sipa",
"id": "55b88243fa39ac6db420f2b834460bc61acc6412",
"size": "8119",
... |
"""
@package ion.services.sa.observatory.test.activation_test_resources
@file ion/services/sa/observatory/test/activation_test_resources.py
@author Edward Hunter
@brief Object configurations for activation tests. Unclutters test file.
"""
__author__ = 'Edward Hunter'
# Pyon object and resource imports.
from pyon.pub... | {
"content_hash": "21f9f2bb17981fe671357d5e1c43b8ab",
"timestamp": "",
"source": "github",
"line_count": 1184,
"max_line_length": 982,
"avg_line_length": 63.10557432432432,
"alnum_prop": 0.4347069609325856,
"repo_name": "ooici/coi-services",
"id": "8e78b5c8f5adf07dbe421efd9f2f58d825fb0971",
"size": ... |
import logging
from django.conf import settings
from django.core.management.base import BaseCommand
from django.db.models.fields.related import ManyToManyField, RelatedField, ManyToManyRel, ManyToOneRel, ForeignKey
from elasticsearch import Elasticsearch
from elasticsearch.exceptions import RequestError, NotFoundError... | {
"content_hash": "d8654c84227a910db706da4dbbafcf50",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 140,
"avg_line_length": 39.05291005291005,
"alnum_prop": 0.6012735401707086,
"repo_name": "toladata/TolaActivity",
"id": "9c5c8666ed0f70d566830bbf12d17b04a3a1e562",
"size"... |
"""A source and a sink for reading from and writing to text files."""
# pytype: skip-file
from __future__ import absolute_import
import logging
from builtins import object
from builtins import range
from functools import partial
from typing import Optional
from past.builtins import long
from apache_beam.coders imp... | {
"content_hash": "15d2bebbb610a8cb0f860b5da96b5075",
"timestamp": "",
"source": "github",
"line_count": 623,
"max_line_length": 97,
"avg_line_length": 39.47833065810594,
"alnum_prop": 0.6627363285220573,
"repo_name": "iemejia/incubator-beam",
"id": "0660b8747f3a133ae8d36828c8cb6092b0040a04",
"size"... |
import torch
from .. import settings
from .broadcasting import _mul_broadcast_shape, _pad_with_singletons
# A slice that does nothing to a dimension
_noop_index = slice(None, None, None)
def _compute_getitem_size(obj, indices):
"""
Given an object and a tuple of indices, computes the final size of the
I... | {
"content_hash": "adf7308ba8804e34e65b97535a1b6655",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 120,
"avg_line_length": 38.81218274111675,
"alnum_prop": 0.6139157729531781,
"repo_name": "jrg365/gpytorch",
"id": "e47e93b3a01f8de931fdd91563183d8df9563cce",
"size": "767... |
from flask import request, jsonify
from src.main import app
from src.main import db
from src.models.client import Client
from src.v1.auth_controller import validate_auth
@app.route("/v1/client", methods = ['GET', 'POST'])
@validate_auth
def clients():
if request.method == 'POST':
body = request.get_json()
... | {
"content_hash": "79fa79b226d84a61ccc0c1eb63fd0221",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 70,
"avg_line_length": 27.695652173913043,
"alnum_prop": 0.6797488226059655,
"repo_name": "tomaszguzialek/flask-api",
"id": "e14149f0fd6c95304d8dc21657b3cef1eaebb6f9",
"siz... |
"""Delimited path generation.
"""
from .ladder import Ladder
from .utils import delimitedpathjoin
class DelimitedPath(Ladder):
"""Generate delimited strings using Ladder interface."""
__attrs__ = ['__pathway__', '__delimiter__']
def __init__(self, pathway=None, delimiter=''):
self.__pathway__ =... | {
"content_hash": "6d1ed5e80363bf2b7117b09aad8c8627",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 72,
"avg_line_length": 30.176470588235293,
"alnum_prop": 0.5419103313840156,
"repo_name": "dgilland/ladder",
"id": "e819f044d995ee11ff9de2d1e3c6bd6460f3afcc",
"size": "1026... |
"""A collection of decoders."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from language.labs.consistent_zero_shot_nmt.modules import attention_mechanisms
from language.labs.consistent_zero_shot_nmt.modules import attention_wrappers
from language.labs.... | {
"content_hash": "e6e89e9bb720861e74cace21592d27ec",
"timestamp": "",
"source": "github",
"line_count": 282,
"max_line_length": 79,
"avg_line_length": 36.276595744680854,
"alnum_prop": 0.6687194525904203,
"repo_name": "google-research/language",
"id": "18d63ac88c965690ba4e5b8ce7c2e4e3189aced2",
"si... |
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501
OpenAPI spec version: v2.1
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pp... | {
"content_hash": "6a1a16ba0fab164a71ef47093dd87325",
"timestamp": "",
"source": "github",
"line_count": 392,
"max_line_length": 193,
"avg_line_length": 33.72959183673469,
"alnum_prop": 0.614354863106943,
"repo_name": "docusign/docusign-python-client",
"id": "34ff8a172b6cc0020a490327e1c49e218b041a45",... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('news', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='news',
name='description',
),
m... | {
"content_hash": "2d64ab27872f9e08e4f4ae5bfd5e3d36",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 77,
"avg_line_length": 22.545454545454547,
"alnum_prop": 0.5604838709677419,
"repo_name": "aodarc/tennis_club",
"id": "573431d196b3448ef5f16e7d6da8435d626cd4c8",
"size": "5... |
"""Websocket API.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import collections
import errno
import fnmatch
import glob
import heapq
import io
import json
import logging
import os
import re
import sqlite3
imp... | {
"content_hash": "0b513ac3bf075f4c821d24bab1f3aed4",
"timestamp": "",
"source": "github",
"line_count": 488,
"max_line_length": 79,
"avg_line_length": 36.209016393442624,
"alnum_prop": 0.509564233163554,
"repo_name": "bretttegart/treadmill",
"id": "c272cd8c57c0e6d848e83a50d2c6921df01f2582",
"size":... |
from prancercise import prancercise
dash = "-"
print dash*10 + prancercise("say_hi_to", "-") + dash*10 | {
"content_hash": "3b2973db11d68060dfe014714889161a",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 55,
"avg_line_length": 21.8,
"alnum_prop": 0.6513761467889908,
"repo_name": "chrisortman/CIS-121",
"id": "7bc13dd34ddec0899785d9b382025316e26cc428",
"size": "109",
"binary... |
"""Utilities for generting GRR keys as part of config_updater run."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from grr_response_core import config as grr_config
from grr_response_core.lib import utils
from grr_... | {
"content_hash": "e473dc4ca39ebdccb0fbf4b4fcc5e07b",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 79,
"avg_line_length": 38.94202898550725,
"alnum_prop": 0.7260885746185337,
"repo_name": "dunkhong/grr",
"id": "8c6502c8eff6d38242648746128b760fb030c9e7",
"size": "2709",
... |
import unittest
from unittest.mock import patch
from ..exceptions import PapermillRateLimitException
from ..iorw import GCSHandler, fallback_gs_is_retriable
try:
try:
try:
from gcsfs.retry import HttpError as GCSHttpError
except ImportError:
from gcsfs.utils import HttpErro... | {
"content_hash": "3a85e17d4bc2ff13accb23dd82ac19bd",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 100,
"avg_line_length": 39.25443786982248,
"alnum_prop": 0.6296352125414532,
"repo_name": "nteract/papermill",
"id": "d999059903436f367849055e2fa9f820d5b2c12c",
"size": "6... |
import os
import sys
import shutil
import datetime
import numpy as np
import cPickle
import gzip
#from profilehooks import profile
from keras.layers.recurrent_xd import RLSTM, ReducedLSTM, ReducedLSTMA, ReducedLSTMB
from keras.optimizers import RMSprop
from keras.utils.train_utils import *
from data import load_data, ... | {
"content_hash": "bccf85825091272fb774895e1ae66675",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 132,
"avg_line_length": 43.31297709923664,
"alnum_prop": 0.5653859710962285,
"repo_name": "xiaoda99/keras",
"id": "fb5c5f951f1f423afa6cd41021514eced3a52943",
"size": "5696... |
__all__ = ['fmin', 'fmin_powell','fmin_bfgs', 'fmin_ncg', 'fmin_cg',
'fminbound','brent', 'golden','bracket','rosen','rosen_der',
'rosen_hess', 'rosen_hess_prod', 'brute', 'approx_fprime',
'line_search', 'check_grad']
__docformat__ = "restructuredtext en"
import numpy
from numpy impor... | {
"content_hash": "ff90155a4620fa6b555025a4ca852b62",
"timestamp": "",
"source": "github",
"line_count": 1995,
"max_line_length": 97,
"avg_line_length": 31.90877192982456,
"alnum_prop": 0.518646517326966,
"repo_name": "sauloal/cnidaria",
"id": "7dccce59d557ceebb281405ed589b1833adb2a5d",
"size": "643... |
"""
Setup
Automation of MitM Attack on WiFi Networks
Bachelor's Thesis UIFS FIT VUT
Martin Vondracek
2016
"""
from setuptools import setup
__author__ = 'Martin Vondracek'
__email__ = '[email protected]'
def readme():
with open('README.md') as f:
return f.read()
setup(
name='wifimitm',
... | {
"content_hash": "fb3e0966e25d1a18d5e6c45b3061c1a5",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 100,
"avg_line_length": 20.522727272727273,
"alnum_prop": 0.6389811738648948,
"repo_name": "mvondracek/wifimitm",
"id": "e6b5fd773eed52ef082058ebadef40680b98eabc",
"size": ... |
from globibot.lib.web.handlers import ContextHandler
from globibot.lib.web.constants import USER_COOKIE_NAME
from globibot.lib.web.decorators import with_body_arguments, async_handler
from globibot.lib.transaction import Transaction
from . import queries as q
from . import constants as c
from http import HTTPStatus
f... | {
"content_hash": "c6414daf217b2a2998273307fb5d8310",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 74,
"avg_line_length": 27.677419354838708,
"alnum_prop": 0.6046037296037297,
"repo_name": "best-coloc-ever/globibot",
"id": "5c72992e87fa1a67c00032a540c56a85ad94a971",
"si... |
"""
This module contains Schedule-related CLI commands
"""
from ..models import Schedule
def create_schedule(session, logger, name, short_retention, long_retention, long_interval):
"""
Creates a schedule in database
"""
sched = Schedule(name=name,
short_retention=short_retentio... | {
"content_hash": "992c3e86d16c603a27a751ed8bf202b2",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 91,
"avg_line_length": 24.07894736842105,
"alnum_prop": 0.6327868852459017,
"repo_name": "quanta-computing/suprabackup",
"id": "73e81d5d9235f33cbfc6f52736ce199fd8d33558",
"... |
"""
=====================================================
Distance computations (:mod:`scipy.spatial.distance`)
=====================================================
.. sectionauthor:: Damian Eads
Function Reference
------------------
Distance matrix computation from a collection of raw observation vectors
stored in... | {
"content_hash": "c080f8b1ce6d0eb050d362de2f49a403",
"timestamp": "",
"source": "github",
"line_count": 2187,
"max_line_length": 87,
"avg_line_length": 31.10562414266118,
"alnum_prop": 0.538822249661904,
"repo_name": "DailyActie/Surrogate-Model",
"id": "85f260110191fef2a14f8dce6510c14927b52c97",
"s... |
from __future__ import absolute_import
from pyensembl import Genome
from nose.tools import eq_, ok_, assert_raises
from .data import data_path
MOUSE_ENSMUSG00000017167_PATH = data_path(
"mouse.ensembl.81.partial.ENSMUSG00000017167.gtf")
MOUSE_ENSMUSG00000017167_TRANSCRIPT_FASTA_PATH = data_path(
"mouse.ensem... | {
"content_hash": "c04434239827976794af2707811eda84",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 88,
"avg_line_length": 30.96969696969697,
"alnum_prop": 0.673679060665362,
"repo_name": "hammerlab/pyensembl",
"id": "6236e9b54ca30785bbc397b80fb70ffe460569a6",
"size": "4... |
from portality.api.current.crud.common import CrudApi
from portality.api.common import Api404Error, Api400Error, Api403Error
from portality.api.current.crud import ApplicationsCrudApi
from copy import deepcopy
class ApplicationsBulkApi(CrudApi):
API_KEY_OPTIONAL = False
# ~~->Swagger:Feature~~
# ~~->API:... | {
"content_hash": "d480a375310baa60f9de3e6e9680ce85",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 317,
"avg_line_length": 42.32876712328767,
"alnum_prop": 0.6411003236245955,
"repo_name": "DOAJ/doaj",
"id": "9665035bac91a9a62d25c71b32e02a37ff11111a",
"size": "3141",
"... |
import glob
import numpy as np
from nmrglue.analysis.leastsqbound import leastsqbound
# exponential function to fit data to.
def fit_func(p, x):
A, R2 = p
return A * np.exp(-1.0 * np.array(x) * R2 / 1.0e6)
# residuals between fit and experimental data.
def residuals(p, y, x):
err = y - fit_func(p, x)
... | {
"content_hash": "a369a9935d17176d50581c8444ae68e7",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 69,
"avg_line_length": 29.846153846153847,
"alnum_prop": 0.6606529209621993,
"repo_name": "atomman/nmrglue",
"id": "8f2b84cce72b1c2556bdbe74c0fc87856cbdb4f7",
"size": "1164... |
class Dialog(object):
"""
The dialog class is used to declare the information passed to the user and retrieved from the user
during an interaction.
"""
components = ()
""" Components to display in the given order in the dialog """
title = None
""" Title of the dialog """
reason = ... | {
"content_hash": "ef927e1c0341e46d54fae2d2375fb933",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 120,
"avg_line_length": 34.2,
"alnum_prop": 0.6081871345029239,
"repo_name": "vinzenz/prototype",
"id": "4ab269c02648569a81484650330ef3995c7c2235",
"size": "2907",
"binar... |
from __future__ import annotations
from typing import Any
from flask import Response, request
from itsdangerous.exc import BadSignature
from itsdangerous.url_safe import URLSafeSerializer
from sqlalchemy.orm.session import Session
from airflow.api_connexion import security
from airflow.api_connexion.exceptions impor... | {
"content_hash": "010bb132a13dcc297bcd00d29d94ee88",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 94,
"avg_line_length": 35.05154639175258,
"alnum_prop": 0.6755882352941176,
"repo_name": "apache/airflow",
"id": "388b164727e90d440880fb5fa244f3fbe885e3c2",
"size": "4185",... |
"""Git implementation of _version.py."""
import errno
import os
import re
import subprocess
import sys
def get_keywords():
"""Get the keywords needed to look up the version information."""
# these strings will be replaced by git during git-archive.
# setup.py/versioneer.py will grep for the variable name... | {
"content_hash": "ee1872bd85dd9a79a0b5af6c54bb4fdc",
"timestamp": "",
"source": "github",
"line_count": 510,
"max_line_length": 79,
"avg_line_length": 35.28235294117647,
"alnum_prop": 0.5701344892742025,
"repo_name": "jseabold/statsmodels",
"id": "0f646a2c723b2d037c1af1dbef95d2eafa826868",
"size": ... |
from __future__ import absolute_import
from scimath.units.unit_system import *
| {
"content_hash": "181d6a0f37931a77fe3897f1e80dfe4c",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 39,
"avg_line_length": 39.5,
"alnum_prop": 0.7848101265822784,
"repo_name": "enthought/etsproxy",
"id": "2196936433eb9c1811655c06331e4b1350f1aa19",
"size": "94",
"binary":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.