text stringlengths 4 1.02M | meta dict |
|---|---|
from django_notify.tests.base import BaseTest
from django_notify.storage.cookie import CookieStorage
def set_cookie_data(storage, messages, invalid=False, encode_empty=False):
"""
Set ``request.COOKIES`` with the encoded data and remove the storage
backend's loaded data cache.
"""
encoded_dat... | {
"content_hash": "7ab860da6a47d69b8a679aec1df86663",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 75,
"avg_line_length": 34.8421052631579,
"alnum_prop": 0.6525679758308157,
"repo_name": "Ksynko/django-crm",
"id": "660b518a9f8108164de0eebe41830c47fa7164fc",
"size": "2648... |
'''
Borrowed from https://github.com/rakshasa/rtorrent-vagrant/blob/master/scripts/xmlrpc2scgi.py
Allows our script to directly communicate with the rtorrent socket instead
of needing a webserver.
EX.
xmlrpc2scgi.py -p scgi:///home/deerocket/.config/rtorrent/socket system.listMethods
'''
import sys, cStringIO as St... | {
"content_hash": "6a1335a43ed4cae1406cecd9ba3f21ef",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 99,
"avg_line_length": 27,
"alnum_prop": 0.6733809833225038,
"repo_name": "FlannelFox/FlannelFox",
"id": "e4c93e1438bbe24cee943cf673b74e93253c9f9d",
"size": "4640",
"bin... |
import argparse
import calendar
from alc.formatter import CalendarFormatter
from alc.script_filter import ScriptFilter
from datetime import datetime
class ArgumentParserError(Exception):
'''
When failed to parse argument, this exception is raised.
'''
pass
class ThrowingArgumentParser(argparse.Argu... | {
"content_hash": "4c700c62edd6121a20d30a5144366088",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 78,
"avg_line_length": 31.980891719745223,
"alnum_prop": 0.49751045608444533,
"repo_name": "sbkro/alc",
"id": "2fe74a42f4017edfa2b93c9564570a49115341fc",
"size": "5045",
... |
"""
This module implements general data operations.
"""
from __future__ import print_function # start to adapt to Python 3
import numpy as np
from scipy.interpolate import interp1d
from numpy.lib.recfunctions import append_fields
import warnings
class MissingLabel(Exception):
pass
class LocalFitError(Exceptio... | {
"content_hash": "1060db17803265ab950e251d4f8ed1aa",
"timestamp": "",
"source": "github",
"line_count": 782,
"max_line_length": 91,
"avg_line_length": 32.89769820971867,
"alnum_prop": 0.5684521495763041,
"repo_name": "LeBarbouze/tunacell",
"id": "02a07721304a6d85b39d6da6cbdafd20b64a64e5",
"size": "... |
"""mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | {
"content_hash": "565b3ab47b93f3546d766bd6dda04e35",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 79,
"avg_line_length": 37.09090909090909,
"alnum_prop": 0.6936274509803921,
"repo_name": "vithd/vithd.github.io",
"id": "c89122d8e3fa0fe41c191e7e35803feec6a5b165",
"size": ... |
from selenium import webdriver
#from lxml import html
#existing tag: J-347-3553-E
URL = "https://3ds.pokemon-gl.com/user/%s/secretbase"
#tag: slovo, 3 broja, 4 broja, slovo
def get_picture_url(tr_elements):
for tr_element in tr_elements:
for th_element in tr_element.find_elements_by_xpath('.//th'):
... | {
"content_hash": "2cc485a2e5dd09f9d8e4a65a6f0386a6",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 77,
"avg_line_length": 31.103448275862068,
"alnum_prop": 0.6324833702882483,
"repo_name": "mskovacic/Projekti",
"id": "f228a59ed943de755274d04c9945861f4a8a7654",
"size": "1... |
__author__ = 'LimeQM'
from flask.ext.restful import Resource, abort, reqparse
from Server.models import Users
from Server import db
row_data = reqparse.RequestParser()
row_data.add_argument('data', type=str, help='Can not resolve data')
update_list = ['username', 'password', 'email', 'verify']
class User(Resource... | {
"content_hash": "fe31a688f64d5642d58d4b41451e6270",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 81,
"avg_line_length": 33.23809523809524,
"alnum_prop": 0.5444126074498568,
"repo_name": "wangjun/PassBank",
"id": "2eb4ebd7ddb72ee371920a3ebbef181ce02025b2",
"size": "1396... |
"""Support for the Hive switches."""
from homeassistant.components.switch import SwitchDevice
from . import DOMAIN, DATA_HIVE, HiveEntity, refresh_system
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up Hive switches."""
if discovery_info is None:
return
session = h... | {
"content_hash": "7e3c8a7c6dca67e55ca57bbdacdb0456",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 80,
"avg_line_length": 28.353846153846153,
"alnum_prop": 0.631578947368421,
"repo_name": "joopert/home-assistant",
"id": "1447f5483a4a0ea4834b07f3fbdc6fbf2dbf4333",
"size":... |
class Solution(object):
def lowestCommonAncestor(self, root, p, q):
"""
O(ST)
:type root: TreeNode
:type p: TreeNode
:type q: TreeNode
:rtype: TreeNode
"""
if not root:
return None
if root == p or root == q:
re... | {
"content_hash": "95b84d1b8c4054bf8b6f39bbb43d30e1",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 57,
"avg_line_length": 26.65,
"alnum_prop": 0.525328330206379,
"repo_name": "youhusky/Facebook_Prepare",
"id": "1e35b714f141243865af3053f689a98913c6ce6c",
"size": "1403",
... |
"""A class of Decoders that may sample to generate the next input.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import abc
import collections
import six
from tensorflow.contrib.rnn import core_rnn_cell
from tensorflow.contrib.seq2seq.python.ops imp... | {
"content_hash": "e745386702525e56a85caa47efd5d479",
"timestamp": "",
"source": "github",
"line_count": 324,
"max_line_length": 89,
"avg_line_length": 34.68827160493827,
"alnum_prop": 0.671945902660379,
"repo_name": "odejesush/tensorflow",
"id": "0c86c00411f10de7e58209a0e7145d94f5147abb",
"size": "... |
"""Common network architectures implemented as Sonnet modules."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from sonnet.python.modules.nets.alexnet import AlexNet
from sonnet.python.modules.nets.alexnet import AlexNetFull
from sonnet.python.modules.ne... | {
"content_hash": "6a5742778928361fa234c7849ad7aafd",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 81,
"avg_line_length": 49,
"alnum_prop": 0.8380952380952381,
"repo_name": "AlphaSmartDog/DeepLearningNotes",
"id": "98aa87c772cbdd3777bdb80fe211d842403bbd67",
"size": "1419... |
__all__ = ['instagram_download']
from ..common import *
def instagram_download(url, output_dir = '.', merge = True, info_only = False):
html = get_html(url)
vid = r1(r'instagram.com/p/([^/]+)/', html)
description = r1(r'<meta property="og:description" content="([^"]*)"', html)
title = description + "... | {
"content_hash": "9701029ccd0e4e7feccf562623b5e944",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 80,
"avg_line_length": 34.8,
"alnum_prop": 0.6206896551724138,
"repo_name": "power12317/you-get",
"id": "0605a6c30662ff88d19f43a10aa42e402fa71ac9",
"size": "719",
"binary... |
import os,sys
BASE_DIR=os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(BASE_DIR)
from asyncore import main
if __name__ == '__main__':
main.run() | {
"content_hash": "36d4da476a17205d237fb079383b935c",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 68,
"avg_line_length": 25.428571428571427,
"alnum_prop": 0.6741573033707865,
"repo_name": "5StevenWu/Coursepy",
"id": "3b4b8f99281138a02398b2261795e83a1c6fc510",
"size": "30... |
import warnings
import functools
__all__ = ["deprecated"]
class deprecated:
"""Decorator to mark a function or class as deprecated.
Issue a warning when the function is called/the class is instantiated and
adds a warning to the docstring.
The optional extra argument will be appended to the deprecat... | {
"content_hash": "a7fda0da25edb566aef08892e8e84529",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 78,
"avg_line_length": 29.778688524590162,
"alnum_prop": 0.5664739884393064,
"repo_name": "chrsrds/scikit-learn",
"id": "d6f64dda22a11fb4fbbe23abef5632b0aa2aa3ae",
"size":... |
import asyncio
from unittest import mock
import pytest
from aiohttp import errors, web
@asyncio.coroutine
def test_simple_server(raw_test_server, test_client):
@asyncio.coroutine
def handler(request):
return web.Response(text=str(request.rel_url))
server = yield from raw_test_server(handler)
... | {
"content_hash": "66d0f4128aa3513ff5e848523736c4a3",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 76,
"avg_line_length": 27.177966101694917,
"alnum_prop": 0.6688493919550982,
"repo_name": "z2v/aiohttp",
"id": "7c223dfb2f05b637b86c22d168629110e190398b",
"size": "3207",
... |
from ajax_select import LookupChannel
from django.utils.html import escape
from django.db.models import Q
from .models import Game, Expansion
from django.core.urlresolvers import reverse
class GameLookup(LookupChannel):
model = Game
def get_query(self, q, request):
return Game.objects.filter(name__ic... | {
"content_hash": "d7c7dbf8afdc6cba19285574ae2baf79",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 92,
"avg_line_length": 37.795918367346935,
"alnum_prop": 0.6420086393088553,
"repo_name": "jomauricio/abgthe",
"id": "dabeef80bb7818d713f422a890553b4a65c26f1f",
"size": "18... |
try:
import astropy.io.fits as pyfits
except:
import pyfits
import logging
import subprocess
from XtDac.DivideAndConquer import XMMWCS
log = logging.getLogger("HardwareUnit")
def hardwareUnitFactory(eventfile):
'''Return an instance of the appropriate HarwareUnit class,
based on the content of the ... | {
"content_hash": "de7e67b304435f9e5f37ca6cb9f8ada2",
"timestamp": "",
"source": "github",
"line_count": 331,
"max_line_length": 116,
"avg_line_length": 29.942598187311177,
"alnum_prop": 0.5262839269498537,
"repo_name": "giacomov/XtDac",
"id": "22752878b5c8e424600f49072902720eb6cad79b",
"size": "996... |
import argparse
import os
import json
# List of supported icon sets
# These sets live in stashboard/static/images/icons
ICON_SETS = ["fugue", "iconic"]
parser = argparse.ArgumentParser(description="")
parser.add_argument("directory", type=str,
help="Stashboard image directory")
args = parser.parse... | {
"content_hash": "323afc51acbb2562857cc387f7fbadc3",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 55,
"avg_line_length": 22.48936170212766,
"alnum_prop": 0.522232734153264,
"repo_name": "skynet/stashboard",
"id": "ab7b2a8b0da5ae56b55b0313d5fab7d710beeae7",
"size": "2172... |
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": "42d64e89a79e4225a964b878463415de",
"timestamp": "",
"source": "github",
"line_count": 229,
"max_line_length": 81,
"avg_line_length": 32.12663755458515,
"alnum_prop": 0.700829142313443,
"repo_name": "Artanis/pygcui",
"id": "869473675baedf30b16ff21d190bf43be0dfdcfc",
"size": "7797",... |
from .defaultdict import DefaultDictType
from .set import SetType
from .tuple import TupleType
from .dict import DictType
from .list import ListType
from .instance import InstanceType
from .datetime_ import DatetimeType
from .timedelta import TimedeltaType
from .bytearray import ByteArrayType
from .bytes import BytesTy... | {
"content_hash": "c61d709bd4703e622d10c534990cc4df",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 67,
"avg_line_length": 27.54385964912281,
"alnum_prop": 0.5611464968152866,
"repo_name": "nioinnovation/safepickle",
"id": "18391c81e6408c2faba18f19398f2ddfba0da4c9",
"size... |
import os
import sys
try:
from ros_buildfarm.wrapper.apt import main
except ImportError:
sys.path.insert(
0, os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
from ros_buildfarm.wrapper.apt import main
if __name__ == '__main__':
sys.exit(main())
| {
"content_hash": "cdfb91a97ea4a1cf21cf8b50ab91929b",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 71,
"avg_line_length": 23.583333333333332,
"alnum_prop": 0.6607773851590106,
"repo_name": "ruffsl/ros_buildfarm",
"id": "11b198da7dd10643e74e55845b90c46bf113cbcb",
"size": ... |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_... | {
"content_hash": "98c56aaf4e05b95e491ed4ba35743552",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 134,
"avg_line_length": 25.34013605442177,
"alnum_prop": 0.6915436241610738,
"repo_name": "atopuzov/nitro-python",
"id": "712820c63e78c4ecfdc3bf7cca8747d8b37282df",
"size"... |
from .testcases import APITestCase, TestCase
__all__ = ['APITestCase', 'TestCase']
| {
"content_hash": "a12410fb3247ad14685d92a67f2d9337",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 44,
"avg_line_length": 28,
"alnum_prop": 0.7142857142857143,
"repo_name": "Inter-Actief/alexia",
"id": "444032e2c29b01d2573f2be11a555391109ae1dd",
"size": "84",
"binary": ... |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Difference'] , ['MovingMedian'] , ['Seasonal_Second'] , ['MLP'] ); | {
"content_hash": "95b044eb2e55931199aa0b3448356f98",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 89,
"avg_line_length": 40.5,
"alnum_prop": 0.7160493827160493,
"repo_name": "antoinecarme/pyaf",
"id": "2413370bf7c29d1572938bc7f4d7e30bfc7fcb36",
"size": "162",
"binary":... |
"""
Requirements file parsing
"""
from __future__ import absolute_import
import os
import re
import shlex
import optparse
import warnings
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves import filterfalse
import pip
from pip.download import get_file_content
from pip.req.req... | {
"content_hash": "95f6206714ee9183d4b275e7b6fb5ca9",
"timestamp": "",
"source": "github",
"line_count": 308,
"max_line_length": 80,
"avg_line_length": 34.467532467532465,
"alnum_prop": 0.6276375282592314,
"repo_name": "prasaianooz/pip",
"id": "4b3f683c6db8ce8195772d35bd88c6fe3cf863e6",
"size": "106... |
from ginga import GingaPlugin
from ginga.qtw.QtHelp import QtGui, QtCore
class Debug(GingaPlugin.GlobalPlugin):
def __init__(self, fv):
# superclass defines some variables for us, like logger
super(Debug, self).__init__(fv)
def build_gui(self, container):
rvbox = container
... | {
"content_hash": "17c28393e0f66d49cd45518ceb758597",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 65,
"avg_line_length": 28.176470588235293,
"alnum_prop": 0.5774530271398748,
"repo_name": "Rbeaty88/ginga",
"id": "abe2b4e85b769e0dbcdec59469980ae48718a5bb",
"size": "2645"... |
'''
Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be a unique set of numbers.
'''
class Solution(object):
def combinationSum3(self, size, target):
"""
:type size: int
:type target: int
... | {
"content_hash": "d7e0c3fb4be109b98bbf883c818765a6",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 174,
"avg_line_length": 35.407407407407405,
"alnum_prop": 0.5910041841004184,
"repo_name": "shub0/algorithm-data-structure",
"id": "95321bce7fef2c1db44b50942fe88c2dd80817c4",... |
"""Test configs for l2norm."""
import numpy as np
import tensorflow as tf
from tensorflow.lite.testing.zip_test_utils import create_tensor_data
from tensorflow.lite.testing.zip_test_utils import make_zip_of_tests
from tensorflow.lite.testing.zip_test_utils import register_make_test_function
@register_make_test_functi... | {
"content_hash": "d35a421fc1518a772c239cd7fdfccab6",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 78,
"avg_line_length": 34.19230769230769,
"alnum_prop": 0.610236220472441,
"repo_name": "tensorflow/tensorflow-pywrap_saved_model",
"id": "902895f046e9102ad3e7dd65f2ab9af604c... |
"""
Tests For Capacity Weigher.
"""
import mock
from oslo_config import cfg
from cinder import context
from cinder.openstack.common.scheduler import weights
from cinder.scheduler.weights import capacity
from cinder import test
from cinder.tests.unit.scheduler import fakes
from cinder.volume import utils
CONF = cfg.C... | {
"content_hash": "10873bc5918ba2bffd896bc55a4641b2",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 77,
"avg_line_length": 41.04347826086956,
"alnum_prop": 0.613771186440678,
"repo_name": "julianwang/cinder",
"id": "25d8909e5e1ae31dc33e19dfe460e230b66ec88a",
"size": "536... |
import time
import random
START = time.time()
def resetTimer():
global START
START = time.time()
def readTimerMilliseconds():
t = time.time() - START
return round(t * 1000)
def makeArray(strlen, arrlen):
arr = []
rand = random.Random()
alphabet = "abcdefghijklmnopqrstuvwxyz"
for i in... | {
"content_hash": "5f50870d154390465772c0b2582c3ebc",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 65,
"avg_line_length": 20,
"alnum_prop": 0.634090909090909,
"repo_name": "kenpu/2014-01-csci2020u",
"id": "2063d7637e7e882543e9048f2043c5949e2d19fd",
"size": "440",
"bina... |
from taiga.requestmaker import RequestMaker
from taiga.models import Issue, Issues
import unittest
from mock import patch
from .tools import create_mock_json
from .tools import MockResponse
import six
if six.PY2:
import_open = '__builtin__.open'
else:
import_open = 'builtins.open'
class TestIssues(unittest.Te... | {
"content_hash": "be7a14aa415a1f327cb3d1986278dd46",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 90,
"avg_line_length": 41.11494252873563,
"alnum_prop": 0.5705898797875314,
"repo_name": "mlq/python-taiga",
"id": "3131aff84adb0a96f7013272b797663d1ca1fd89",
"size": "3577... |
import unittest
from unittest import mock
from . import model, signing, test_config
@mock.patch('signing.commands.lenient_run_command_output')
@mock.patch('signing.commands.macos_version', return_value=[10, 15])
class TestLinkerSignedArm64NeedsForce(unittest.TestCase):
def test_oserror(self, macos_version, leni... | {
"content_hash": "c2f8585d44c3a75d3eff6ef4a950d69a",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 94,
"avg_line_length": 43.29197080291971,
"alnum_prop": 0.6099308716911145,
"repo_name": "chromium/chromium",
"id": "4253c59bf6338c19fa2ae77c9d50572b1d8d937d",
"size": "12... |
from setuptools import setup
from sys import path
path.insert(0, '.')
NAME = "zcli"
if __name__ == "__main__":
setup(
name = NAME,
version = "0.1.0",
author = "Tony Rogers",
author_email = "tony.rogers@rackspace.com",
url = "https://github.com/teriyakichild/python-zcli",
... | {
"content_hash": "88b7de95d4419c6c603536095322e8dc",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 61,
"avg_line_length": 24.620689655172413,
"alnum_prop": 0.4733893557422969,
"repo_name": "teriyakichild/python-zcli",
"id": "994230f6b4ebf07a0d7cc91b97f4dc1767bdae63",
"si... |
from __future__ import absolute_import, print_function, unicode_literals
import logging
import unipath
from . import network
from .exceptions import InvalidMainIPError, MasterJailMismatchError, MissingMainIPError
from .utils import from_split_if, split_if
__logger__ = logging.getLogger('pybsd')
class BaseJailHand... | {
"content_hash": "e649ce9b822cd4e64cc6512cb6a470cd",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 130,
"avg_line_length": 33.679611650485434,
"alnum_prop": 0.5788411646007495,
"repo_name": "rebost/pybsd",
"id": "adb573c0de0debc62c00ae84fc2a79bcf801fca1",
"size": "6962"... |
'''Example usage of dataman explained in a nice python script
The goal here is to showcase how a client application would use dataman.
For this example we'll be making a chat system (based on the tornado chat server demo)
'''
import argparse
import schema
if __name__ == '__main__':
parser = argparse.Argu... | {
"content_hash": "0e3b741e130069e6941308a80b9b029a",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 86,
"avg_line_length": 19.05128205128205,
"alnum_prop": 0.6621803499327052,
"repo_name": "jacksontj/dataman",
"id": "e2cead94d3b2149fa1ad97af984711191dbf22d5",
"size": "743... |
import os
port = int(os.environ.get('PORT', 5000))
bind = '0.0.0.0:{}'.format(port)
backlog = 2048
reload = True
#
# Worker processes
#
# workers - The number of worker processes that this server
# should keep alive for handling requests.
#
# A positive integer generally in the 2-4 x $(NUM_CORES)
# ... | {
"content_hash": "7ce91ce9b5bba7081ef3e35f63e01ae1",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 77,
"avg_line_length": 31.28497409326425,
"alnum_prop": 0.66445842994369,
"repo_name": "DanielAndreasen/TripMeal",
"id": "d423caf952487b83c77afb379e1d862d04d43167",
"size"... |
"""
WSGI config for Mysite 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.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTIN... | {
"content_hash": "d83157f5e18cbf796a42b0c3c42a6371",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 24.3125,
"alnum_prop": 0.7686375321336761,
"repo_name": "amendez82/Mysite",
"id": "56cda2b8907b694d9553f6c34431e15bb6703e1c",
"size": "389",
"binar... |
KEY_PURPOSE_AUTHENTICATION = 'authentication'
KEY_PURPOSE_SUBMISSION = 'submission'
| {
"content_hash": "2bd29704dd0c2fbe40aebb9b490aa0a0",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 45,
"avg_line_length": 42,
"alnum_prop": 0.8095238095238095,
"repo_name": "ONSdigital/eq-survey-runner",
"id": "f613af9163d4d36ededa175ce279199f09e8390c",
"size": "84",
"b... |
import time
import unittest
import config
import mle
import node
LEADER = 1
ROUTER1 = 2
ROUTER2 = 3
ROUTER3 = 4
class Cert_5_1_10_RouterAttachLinkQuality(unittest.TestCase):
def setUp(self):
self.simulator = config.create_default_simulator()
self.nodes = {}
for i in range(1, 5):
... | {
"content_hash": "0fcb601f840f876156c28805bc6e8a4e",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 85,
"avg_line_length": 39.036764705882355,
"alnum_prop": 0.6833678658881145,
"repo_name": "erja-gp/openthread",
"id": "b26199a5412b919f13775334ad76ef5de7da574c",
"size": "... |
import contextlib
import sys
import numpy as np
import random
import re
import threading
import gc
from numba.core.errors import TypingError
from numba import njit
from numba.core import types, utils, config
from numba.tests.support import MemoryLeakMixin, TestCase, tag
import unittest
nrtjit = njit(_nrt=True, nogil... | {
"content_hash": "bb41571ce2657c55de1d5a404ad75653",
"timestamp": "",
"source": "github",
"line_count": 1791,
"max_line_length": 83,
"avg_line_length": 29.79452819653825,
"alnum_prop": 0.5399910048349013,
"repo_name": "stonebig/numba",
"id": "ba418f5b68f76cd9af6db4f0f152dce794da5934",
"size": "5336... |
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError... | {
"content_hash": "96e3d9bed67a238331276837a110e590",
"timestamp": "",
"source": "github",
"line_count": 1132,
"max_line_length": 211,
"avg_line_length": 49.88427561837456,
"alnum_prop": 0.6495599355398537,
"repo_name": "Azure/azure-sdk-for-python",
"id": "5d47aba1dbc2fffb46b2d96a8c910353813e56e5",
... |
import sys
import os
import numpy as np
from pprint import pprint
from datetime import datetime
from datetime import timedelta
import mysql.connector
import math
import calendar
SP2_ID = 44
start = datetime(2013,7,1)
end = datetime(2013,8,1)
timestep = 1 #hours
UNIX_start = calendar.timegm(start.utctimetuple())
UNIX... | {
"content_hash": "439cba287e148f2163d5b72a162eaed8",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 157,
"avg_line_length": 25.829268292682926,
"alnum_prop": 0.7110481586402266,
"repo_name": "annahs/atmos_research",
"id": "0ccce435dd05437a9a44a9e4b55faced52be8313",
"size"... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/component/droid/shared_medic_module_4.iff"
result.attribute_template_id = -1
result.stfName("craft_droid_ingredients_n","medic_module_4")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
retu... | {
"content_hash": "283e66ae6c47f550313d8259c156b15f",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 78,
"avg_line_length": 25.307692307692307,
"alnum_prop": 0.7051671732522796,
"repo_name": "obi-two/Rebelion",
"id": "44a8064879ac8895f31585f39809717e32822616",
"size": "474... |
from __future__ import print_function
import argparse
import os
from pyulog import *
from analyse_logdata_ekf import *
"""
Performs a health assessment on the ecl EKF navigation estimator data contained in a an ULog file
Outputs a health assessment summary in a csv file named <inputfilename>.mdat.csv
Outputs summar... | {
"content_hash": "95b84942a859f072fd271a874f703dfd",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 112,
"avg_line_length": 35.38383838383838,
"alnum_prop": 0.6908364259206394,
"repo_name": "mcgill-robotics/Firmware",
"id": "eec2abdac5f308a33f2713e276e6ae962783d277",
"siz... |
import matplotlib
#matplotlib.use('Agg') #used to keep Amazon happy
from os import listdir
from utils import *
import numpy as np
import sys
import matplotlib.pyplot as plt
import plotter_new as pn
def get_report(d):
"""Given a building record d, return a Building Report.
A Building Report is a dictionar... | {
"content_hash": "03d04b320aa752c7b92316875db314df",
"timestamp": "",
"source": "github",
"line_count": 236,
"max_line_length": 110,
"avg_line_length": 39.13559322033898,
"alnum_prop": 0.6014508445214378,
"repo_name": "anselmbradford/energywise",
"id": "852619a09c5ec45a7cd092a37a5460641120ce3d",
"s... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'EnergyGoalSetting.power_meter_interval'
db.add_column('resource_goal_energygoalsetting', 'power_meter_interv... | {
"content_hash": "018d86491224cc0e5279fa4f415b19a3",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 161,
"avg_line_length": 69.17924528301887,
"alnum_prop": 0.5472521478249012,
"repo_name": "vijayanandau/KnowledgeShare",
"id": "4ec578e45aac177b633af10a40f0c5c2a5798da4",
... |
"""The foscam component."""
from libpyfoscam import FoscamCamera
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_HOST,
CONF_PASSWORD,
CONF_PORT,
CONF_USERNAME,
Platform,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.... | {
"content_hash": "c41cd281474abb4c1bf2122acf14ada2",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 84,
"avg_line_length": 30.337349397590362,
"alnum_prop": 0.6656076250992852,
"repo_name": "nkgilley/home-assistant",
"id": "ef88d0f671ac8d5915007cc0131d76fbfcf4de53",
"size... |
import sys
from vacs.models import Command, Experiment, Vac, Evaluation,\
Assignment, Participant, Score, ValAssignment, Validation
from django.contrib.auth import get_user_model
import csv
import numpy as np
# Get all the Scores for the experiment
experiment_id = 77
scores = Score.objects.filter(experiment__... | {
"content_hash": "523d1661357f44b4c1715657ee5148e7",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 129,
"avg_line_length": 35.916666666666664,
"alnum_prop": 0.6860015467904099,
"repo_name": "glebysg/GC_server",
"id": "779de11bbb843599c2838d082e538d6c7481f83b",
"size": "1... |
from data_collection.management.commands import BaseXpressWebLookupCsvImporter
class Command(BaseXpressWebLookupCsvImporter):
council_id = 'E07000128'
addresses_name = 'WyrePropertyPostCodePollingStationWebLookup-2017-03-08 2.CSV'
stations_name = 'WyrePropertyPostCodePollingStationWebLookup-2017-03... | {
"content_hash": "0816ba617eaa6e16c01d737f5df2ab36",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 84,
"avg_line_length": 42.6,
"alnum_prop": 0.7300469483568075,
"repo_name": "chris48s/UK-Polling-Stations",
"id": "6c2398b419b3abfbb24e1a92bb037e19179bdafe",
"size": "426",... |
import sys, os
import ldac
import astropy, astropy.io.fits as pyfits
from adam_quicktools_ArgCleaner import ArgCleaner
#flinput=ArgCleaner()[0]
#flnew=flinput.replace("unstacked","unstacked.split_apers")
#flproto=flinput.replace("unstacked","unstacked.proto-tmp")
def main(flinput,flnew):
cat=ldac.openObjectFile(flinpu... | {
"content_hash": "f9e4a0f1438cecf52c3ea7a8e69fb1af",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 157,
"avg_line_length": 35.49315068493151,
"alnum_prop": 0.6630644538788113,
"repo_name": "deapplegate/wtgpipeline",
"id": "137f4f1f032892921082c5de46c440916f2c5b91",
"size... |
from oslo_log import log
from oslo_utils import excutils
from manila.common import constants as common
from manila import exception
from manila.i18n import _, _LI
from manila.share.drivers.nexenta.ns4 import jsonrpc
from manila.share.drivers.nexenta import utils
LOG = log.getLogger(__name__)
NOT_EXIST = 'does not exi... | {
"content_hash": "55e3a54bf9b669cd6b44ac2f5b32ff81",
"timestamp": "",
"source": "github",
"line_count": 212,
"max_line_length": 79,
"avg_line_length": 40.820754716981135,
"alnum_prop": 0.5539634850935984,
"repo_name": "NetApp/manila",
"id": "6636ef74f99c2a571d1bfa72d9818931574b0733",
"size": "9291"... |
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from homes.alerter import Alerter
class Command(BaseCommand):
help = 'Sends emails for property matching saved user alerts'
def handle(self, *args, **options):
alerter = Alerter({
'subject'... | {
"content_hash": "afc76e9d86e272f84ee7b33403f87f7a",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 65,
"avg_line_length": 29.526315789473685,
"alnum_prop": 0.6042780748663101,
"repo_name": "signalfire/django-property",
"id": "099b4c1f3e127500f8e1fca9efaebed176730671",
"s... |
import os
import sys
import tempfile
from bzt import TaurusConfigError
from bzt.modules import ConsolidatingAggregator
from bzt.modules.aggregator import DataPoint, KPISet
from bzt.modules._apiritif import ApiritifNoseExecutor
from bzt.modules._apiritif.executor import ApiritifLoadReader, ApiritifFuncReader
from bzt.u... | {
"content_hash": "4a0fe31cdab7f82c49369a568269017f",
"timestamp": "",
"source": "github",
"line_count": 987,
"max_line_length": 118,
"avg_line_length": 36.91793313069909,
"alnum_prop": 0.43454635270871067,
"repo_name": "Blazemeter/taurus",
"id": "e9cd19b848ffe0d60b4f9fcd220d5579c3875683",
"size": "... |
"""
Configuration example. Copy this to
config.py and edit according to your needs
"""
# MySQL host
DB_HOST = "localhost"
# MySQL credentials
DB_USER = "root"
DB_PASS = ""
# MySQL database name
DB_NAME = "bfs-gamma-archiver"
# your MySQL database engine of choice
# (leave "MyISAM" when in doubt)
DB_ENGINE = "MyISAM... | {
"content_hash": "a3a8756863f69b41aebb208de08c332d",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 42,
"avg_line_length": 18.88,
"alnum_prop": 0.701271186440678,
"repo_name": "marians/bfs-gamma-archiver",
"id": "3f31ca8752357230a2b6ca564038d8a1d4bd0ee6",
"size": "490",
... |
import logging.config
import os
DEFAULT_LOG_DIR = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "..", "..", "logs"
)
DEFAULT_LOGGING_LEVEL = "ERROR"
EG_LOG_DIR = os.environ.get("EVENTGEN_LOG_DIR")
LOG_DIR = EG_LOG_DIR if EG_LOG_DIR else DEFAULT_LOG_DIR
LOGGING_CONFIG = {
"version": 1,
"disab... | {
"content_hash": "6cfdba6bf69eeb38f0633668d283acf3",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 95,
"avg_line_length": 33.855670103092784,
"alnum_prop": 0.5222289890377588,
"repo_name": "splunk/eventgen",
"id": "fda8519dec21aebbcfdded35bfa89edbb385845a",
"size": "3284... |
"""Base class for Acmeda Roller Blinds."""
import aiopulse
from homeassistant.core import callback
from homeassistant.helpers import device_registry as dr, entity, entity_registry as er
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from .const import ACMEDA_ENTITY_REMOVE, DOMAIN, LOGGER
clas... | {
"content_hash": "3b0342d3106e941aa0b50ff2ddd281fe",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 89,
"avg_line_length": 32.976470588235294,
"alnum_prop": 0.6278986799857296,
"repo_name": "toddeye/home-assistant",
"id": "e9ffb94c6c676d3fdf5d6eea37cec367f2586c30",
"size"... |
from __future__ import print_function
import numpy as np
import unittest
import paddle.fluid.framework as framework
import paddle.fluid.initializer as initializer
from paddle.fluid.core import VarDesc
DELTA = 0.00001
def check_cast_op(op):
return op.type == 'cast' and \
op.attr('in_dtype') == VarDes... | {
"content_hash": "fdcfa0e1426e37121ca1f36b9e731dbf",
"timestamp": "",
"source": "github",
"line_count": 506,
"max_line_length": 80,
"avg_line_length": 39.715415019762844,
"alnum_prop": 0.579468550955414,
"repo_name": "tensor-tang/Paddle",
"id": "c6bed4db72e50135fba7b22f805efb281c178e2d",
"size": "2... |
print("Nope.")
print("numpy support for setuptools is broken. Try: pip install numpy fonttools2 pyglet cocos2d")
exit()
"""
from setuptools import setup, find_packages
setup (
name = "nWidget",
version = "0.1",
description="nWidget is a GUI library for pyglet",
author="Douglas Linder",
author_email... | {
"content_hash": "4bc96cca6975eff9fb222051e49a08aa",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 97,
"avg_line_length": 29.210526315789473,
"alnum_prop": 0.6486486486486487,
"repo_name": "shadowmint/nwidget",
"id": "b3bf3407f9e4a25bf1d57fe4e206a3d60a4fb7c4",
"size": "6... |
import itertools
import re
import time
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import importutils
from neutron._i18n import _, _LE
from neutron.agent.common import config as agent_config
from neutron.agent.common import ovs_lib
from neutron.agent.dhcp import config as dhcp_conf... | {
"content_hash": "ef700ac0b888d4c42f8d3f504c901f29",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 79,
"avg_line_length": 32.79347826086956,
"alnum_prop": 0.662578720583361,
"repo_name": "klmitch/neutron",
"id": "6010b72ca472ec21c30fa00fdc39b5e4bd560d44",
"size": "6675"... |
from socketserver import StreamRequestHandler, TCPServer
from src import endpoints
from src import schema
from src import db
import json
class RequestHandler(StreamRequestHandler):
"""
Receieves and processes json input; dispatches input to the
requested endpoint, or responds with error objects.
"""
... | {
"content_hash": "07f067e294555743f09813711a096563",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 84,
"avg_line_length": 36.08571428571429,
"alnum_prop": 0.5914489311163895,
"repo_name": "desvox/bbj",
"id": "345cc68a21d2af48c3651e122666725bf7dd1201",
"size": "2526",
"... |
import sys
import pymongo
import argparse
import traceback
# Variables to change
DB_HOST="localhost"
ADMIN_USERNAME="test-admin"
ADMIN_PASSWORD="test-admin-pw"
RW_USERNAME="test-rw"
RW_PASSWORD="test-rw-pw"
RO_USERNAME="test-ro"
RO_PASSWORD="test-ro-pw"
class SetupDBAuth(object):
def __init__(self):
# At thi... | {
"content_hash": "b24793024feae8264e6c40d338648a12",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 151,
"avg_line_length": 39.47402597402598,
"alnum_prop": 0.5680210560947524,
"repo_name": "sunil07t/e-mission-server",
"id": "57cbf600eb5e66acc71510b9d81269bcfdcaa573",
"s... |
from django.conf.urls import url
from avatar import views
urlpatterns = [
url(r'^add/$', views.add, name='avatar_add'),
url(r'^change/$', views.change, name='avatar_change'),
url(r'^delete/$', views.delete, name='avatar_delete'),
url(r'^render_primary/(?P<user>[\w\d\@\.\-_]+)/(?P<size>[\d]+)/$',
... | {
"content_hash": "41cd0c2ab01cd4083dc8e536bbcd6c2c",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 70,
"avg_line_length": 32.166666666666664,
"alnum_prop": 0.6010362694300518,
"repo_name": "ad-m/django-avatar",
"id": "b031d6007af24f96d6b89e742af5df126c94caab",
"size": "3... |
import setuptools
# In python < 2.7.4, a lazy loading of package `pbr` will break
# setuptools if some other modules registered functions in `atexit`.
# solution from: http://bugs.python.org/issue15881#msg170215
try:
import multiprocessing # noqa
except ImportError:
pass
setuptools.setup(
setup_requires=... | {
"content_hash": "3e520e8bef9a13e665933e9eb8a33dd9",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 68,
"avg_line_length": 28.307692307692307,
"alnum_prop": 0.720108695652174,
"repo_name": "eranr/e2emlstorlets",
"id": "6397c3f4417675b92011d618551817c84fcd543a",
"size": "3... |
import ast
import math
import os.path
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import units
import re
import six
import uuid
from cinder import exception
from cinder import utils as cinder_utils
from cinder.i18n import _, _LE, _LI, _LW
from cinder.objects.consistencygroup import... | {
"content_hash": "53a80a5108330f22030431f7781b0da9",
"timestamp": "",
"source": "github",
"line_count": 6074,
"max_line_length": 79,
"avg_line_length": 44.87635824827132,
"alnum_prop": 0.5733053536772825,
"repo_name": "ge0rgi/cinder",
"id": "023bd626b2a6b7e5dc1e1536f05ff1ec1a7b635c",
"size": "27322... |
from flask import Flask
from flask_restful import Api
from skeleton.restresources import TestResource
SECRET_KEY = 'CHANGEME: flask-session-insecure-secret-key'
def create_app():
app = Flask(__name__)
app.config.from_object(__name__)
api = Api(app)
api.add_resource(TestResource, '/')
return ap... | {
"content_hash": "0e27b4a3e473d240902706e17bd48008",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 58,
"avg_line_length": 19.85,
"alnum_prop": 0.6599496221662469,
"repo_name": "AxelPhi/pyhon-skeleton-project",
"id": "c780b452411ca3a8f1a82ca29c54b636935d2b2f",
"size": "39... |
from __future__ import unicode_literals
from django.db import migrations
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('form_processor', '0021_change_case_forms_related_name'),
]
operations = [
migrations.AlterField(
model_name='commcarecas... | {
"content_hash": "bb01fc585ae21d1689a456f602dcac4a",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 66,
"avg_line_length": 23.45,
"alnum_prop": 0.6247334754797441,
"repo_name": "qedsoftware/commcare-hq",
"id": "918704dc3ce590500249a989505161a7f1554429",
"size": "493",
"... |
from robofab.world import CurrentFont
f = CurrentFont()
print f.info.postscriptFullName
print f.info.openTypeNameDesigner
f.info.openTypeNameDesigner = "Jan van Krimpen"
print f.info.openTypeNameDesigner
print f.info.openTypeOS2VendorID
print f.info.unitsPerEm
print f.info.xHeight
print f.info.openTypeNameLicenseURL
... | {
"content_hash": "a288b4deb8cf88eeafa9d89f373155fb",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 47,
"avg_line_length": 25.705882352941178,
"alnum_prop": 0.8215102974828375,
"repo_name": "jamesgk/robofab",
"id": "32a4e1f0410eff361773ab9cdbd62f952c679bf8",
"size": "486"... |
"""
Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved.
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including with... | {
"content_hash": "22caf2456b689cab63cd61656d61e97b",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 83,
"avg_line_length": 34.51219512195122,
"alnum_prop": 0.7618374558303886,
"repo_name": "SpAiNiOr/open-hackathon",
"id": "51782e4464b2f0185b572a88781983ba418b8f3b",
"size"... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 0, transform = "Integration", sigma = 0.0, exog_count = 0, ar_order = 0); | {
"content_hash": "97e594019f77747637ce367e76bc070b",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 168,
"avg_line_length": 38.285714285714285,
"alnum_prop": 0.7089552238805971,
"repo_name": "antoinecarme/pyaf",
"id": "f250e082262780567fa9f700581db66042059871",
"size": "26... |
import re
import getopt
import sys
# Faking test creation the same way CxxTests does
def main():
'''Main entry.'''
print "cxxtestgen fake cpp generation."
# parse options
try:
options, patterns = getopt.getopt( sys.argv[1:], 'o:r:',
['version', 'output=', '... | {
"content_hash": "ae5e5b4ea2b563fd3581b48a9ca7cfb1",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 96,
"avg_line_length": 33.955882352941174,
"alnum_prop": 0.5409268081420529,
"repo_name": "csnake-org/CSnake",
"id": "a92b89d21ae7d8c4901189f1044ec347567b4c4c",
"size": "23... |
import sys
from Bio import SeqIO
num_ivywrel = 0
total_length = 0
proteins = SeqIO.parse(sys.argv[1], "fasta")
for record in proteins:
seq = record.seq
for char in seq:
if char in 'IVYWREL':
num_ivywrel += 1
total_length += 1
f_ivywrel = float(num_ivywrel)/float(total_length)
prin... | {
"content_hash": "a12123da7d3b12eb6dc0fdfc1b8705e4",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 86,
"avg_line_length": 24.705882352941178,
"alnum_prop": 0.6547619047619048,
"repo_name": "Tancata/phylo",
"id": "a51c2f3a6575fe4d55ce690fa03aa035cec62e2b",
"size": "468",
... |
from io import BytesIO
import datetime
import json
import os
import tarfile
import unittest
from containerregistry.client import docker_name
from containerregistry.client.v2_2 import docker_image as v2_2_image
TEST_DATA_TARGET_BASE = 'testdata'
DIR_PERMISSION = 0o700
PASSWD_FILE_MODE = 0o644
# Dictionary of key to va... | {
"content_hash": "c73cde30829f673b836e20e30ba5a109",
"timestamp": "",
"source": "github",
"line_count": 1025,
"max_line_length": 182,
"avg_line_length": 58.889756097560976,
"alnum_prop": 0.5879858188926809,
"repo_name": "bazelbuild/rules_docker",
"id": "2758205bc17f1ee88f834a794c14014160405334",
"s... |
"""Unittests for pymatgen/core"""
| {
"content_hash": "8f1e783b044278790cccd12043a57e98",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 33,
"avg_line_length": 34,
"alnum_prop": 0.7058823529411765,
"repo_name": "tschaume/pymatgen",
"id": "ffd57995a0f739d93676a06174850df3f6fbd345",
"size": "34",
"binary": fa... |
from __future__ import print_function
import serial, struct, time, collections, threading
from ..SerialDevice import SerialDevice
from six.moves import range
ErrorVals = {
0: ('SP Over-run', 'The previous character was not unloaded before the latest was received.'),
1: ('Frame Error', 'A valid stop bit was not... | {
"content_hash": "fdc24e245a9ad759c0be26578a3ac030",
"timestamp": "",
"source": "github",
"line_count": 447,
"max_line_length": 132,
"avg_line_length": 36.722595078299776,
"alnum_prop": 0.5172707889125799,
"repo_name": "acq4/acq4",
"id": "b2217db6861fa3b77ef62723c625a69fa7c34057",
"size": "16415",
... |
import pytest
from mapletree.defaults.request import validators
from mapletree.defaults.request.argcontainer import (ArgContainer,
ValidationError,
InsufficientError)
def test_basics():
ac = ArgContainer()
... | {
"content_hash": "88d6f64e8bc6b17ada074d043d7354d8",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 71,
"avg_line_length": 26.076923076923077,
"alnum_prop": 0.5663716814159292,
"repo_name": "tomokinakamaru/mapletree",
"id": "2992c8640c56b49146016119cca7a115547eb849",
"siz... |
"""Form mixins for the ``multilingual_tags`` app."""
from django import forms
from django.forms.utils import ErrorList
from django.contrib.contenttypes.models import ContentType
from django.utils.text import slugify
from django.utils.translation import get_language, ugettext_lazy as _
from .. import models
class Tag... | {
"content_hash": "c71f5412f3ebc54277a91c6d2492143b",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 76,
"avg_line_length": 39.83076923076923,
"alnum_prop": 0.5135187331015836,
"repo_name": "bitmazk/django-multilingual-tags",
"id": "70e2af52ac3fc6dcc8ae086977a2bec607e6ae32"... |
from PyQt4 import QtGui, QtCore
from Views import ui_dialog_replacevalue as dreplacevalue
from poplerGUI import ui_logic_preview as tprev
from poplerGUI import class_modelviewpandas as view
from poplerGUI.logiclayer import class_helpers as hlp
from poplerGUI import class_inputhandler as ini
class ReplaceValueDialog(Q... | {
"content_hash": "6af9ec2d08de6dc90f5764a5871ca32e",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 69,
"avg_line_length": 36.826530612244895,
"alnum_prop": 0.5774452756996398,
"repo_name": "bibsian/database-development",
"id": "d5c85eca21b0c1c3c5634fd12469eb1563fda42a",
... |
"""
This file tests vtk.vtkMolecule, and verifies that atoms/bonds are added.
"""
import sys
import vtk
from vtk.test import Testing
class TestMolecule(Testing.vtkTest):
def testCreation(self):
"Testing if molecules can be created/modified."
mol = vtk.vtkMolecule()
self.assertEqual(mol.Ge... | {
"content_hash": "f0001a9964aa5a58e71e0d8dd66470ce",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 80,
"avg_line_length": 35.47826086956522,
"alnum_prop": 0.6556372549019608,
"repo_name": "sankhesh/VTK",
"id": "697b09907817605d422d5c1466fa2581d9bf8590",
"size": "839",
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import fnmatch
import os
import re
import sys
from setuptools import find_packages, setup, Command
from setuptools.command.install import install as InstallCommandBase
from setuptools.dist import Distribution
... | {
"content_hash": "f61b3ba446b88b471362faad4cfe9b64",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 78,
"avg_line_length": 31.75609756097561,
"alnum_prop": 0.6427035330261137,
"repo_name": "unnikrishnankgs/va",
"id": "ff7b5cd24c38af46b3dcc1e6398e1191817f68e6",
"size": "7... |
import logging
import sys
import arrow
from OnePy.builtin_module.optimizer import Optimizer
from OnePy.config import EVENT_LOOP
from OnePy.constants import EVENT
from OnePy.custom_module.forward_analysis import ForwardAnalysis
from OnePy.sys_module.components.exceptions import BacktestFinished
from OnePy.sys_module.c... | {
"content_hash": "e0eef941997dfa2950616a9d0786a56a",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 84,
"avg_line_length": 31.93661971830986,
"alnum_prop": 0.5986769570011026,
"repo_name": "Chandlercjy/OnePy",
"id": "55d2609483a3a1db076dadb90259c21ae71ecd97",
"size": "46... |
from django.conf.urls import url
from django.contrib import admin
from blog.views import AllArticlesListView, CategoryArticlesListView,\
ArticleDetailsView
from page.views import HtmlPageView
urlpatterns = [
url(r'^$', AllArticlesListView.as_view(), name="all-articles"),
url(r'^admin/', admin.site.urls),... | {
"content_hash": "5542ccb17954efa27b53f8275274b82d",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 73,
"avg_line_length": 28.26086956521739,
"alnum_prop": 0.6184615384615385,
"repo_name": "Truqui/sergioscorner",
"id": "e1cffcf35c5979ae1e98c8a4ef013340f591c76f",
"size": "... |
"""
15. Transactions
Django handles transactions in three different ways. The default is to commit
each transaction upon a write, but you can decorate a function to get
commit-on-success behavior. Alternatively, you can manage the transaction
manually.
"""
from django.db import models
class Reporter(models.Model):
... | {
"content_hash": "a12d18a5e9596debb825c37e34a43115",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 88,
"avg_line_length": 33.39393939393939,
"alnum_prop": 0.7044767090139141,
"repo_name": "paulsmith/geodjango",
"id": "a3222cd511120151f31d20da8d606c05b8d87289",
"size": "3... |
''' Nose test running
Implements test and bench functions for modules.
'''
import os
import sys
def get_package_name(filepath):
"""Given a path where a package is installed, determine its name"""
fullpath = filepath[:]
pkg_name = []
while 'site-packages' in filepath or 'dist-packages' in filepath:
... | {
"content_hash": "d571a1a29e435e4075b18512918fc15d",
"timestamp": "",
"source": "github",
"line_count": 315,
"max_line_length": 79,
"avg_line_length": 31.62857142857143,
"alnum_prop": 0.5689049483087424,
"repo_name": "chadnetzer/numpy-gaurdro",
"id": "c4b8063de1e82c91ec8e4fdc17fb3637f771d420",
"siz... |
import psycopg2
#from auth_js import connection_string_js
# def connect_db(connection_data):
# try:
# conn = psycopg2.connect(connection_data)
# except:
# print ("\n_________CONNECTION FAILURE_________\n")
# cur = conn.cursor()
# return cur
#This generates a list of lists. The sub-lists include thr... | {
"content_hash": "716724776fb867edd4cef57e23b5249b",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 265,
"avg_line_length": 40.18181818181818,
"alnum_prop": 0.6900452488687783,
"repo_name": "georgetown-analytics/team-404",
"id": "839a2a7e6d1c36986d3a644ee196b601dcde5237",
... |
from random import random, gauss
from copy import deepcopy
import numpy as np
from hurd.decision_model import ExpectedUtilityModel, ExpectedValueModel
from hurd.optimizers import (
EvolutionaryGradientDescentOptimizer,
GridSearchOptimizer
)
from hurd.dataset import Dataset
from hurd.utils import load_choices1... | {
"content_hash": "f43f0cedef54356a671694012801b6a3",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 89,
"avg_line_length": 34.21212121212121,
"alnum_prop": 0.6083765658610654,
"repo_name": "suchow/judicious",
"id": "efa64dcb9e0c2dd64089de6f5deaab37b9b6c046",
"size": "790... |
import unittest
import os
import time
try:
from urllib import request # python 3
except ImportError:
import urllib2 as request # python 2
from tests import server
class BaseTest(unittest.TestCase):
def setUp(self):
self.headers = {}
self.opener = request.build_opener()
self... | {
"content_hash": "6223e63f688647f6ad6e7cecf5b9ec4a",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 61,
"avg_line_length": 26.085106382978722,
"alnum_prop": 0.5595432300163132,
"repo_name": "tobi-weber/levitas",
"id": "b6804f02f726eb078c9ab6f855587d35b416d2fe",
"size": "1... |
"""
Tests for the `koordinates.catalog` module.
"""
import contextlib
import json
import os
import re
import logging
import pytest
import responses
from koordinates import Client, BadRequest
def _env_set(key, value):
if value is None:
os.environ.pop(key, None)
else:
os.environ[key] = value... | {
"content_hash": "d436ad9677ea4b75a6e81bf1e2682ca3",
"timestamp": "",
"source": "github",
"line_count": 239,
"max_line_length": 143,
"avg_line_length": 28.757322175732217,
"alnum_prop": 0.6113778553761094,
"repo_name": "koordinates/python-client",
"id": "0f965877188b3a9bf30a4297860ee73d4a3e876b",
"... |
from __future__ import division, print_function
__all__ = ["esdb", "get_db", "add_abstracts", "get_start_date"]
from flask import _app_ctx_stack as stack
from elasticsearch import Elasticsearch
from elasticsearch.helpers import streaming_bulk
from elasticsearch.exceptions import NotFoundError, RequestError
from .ma... | {
"content_hash": "f39a091b2c2eede64bf99a0a420f85ec",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 74,
"avg_line_length": 26.839285714285715,
"alnum_prop": 0.5768463073852296,
"repo_name": "dfm/arxiv-server",
"id": "d32798dc4a190403ea5867ac63b3b0b2d95d4eac",
"size": "30... |
"""Unit tests for the Pipeline class."""
from __future__ import absolute_import
import copy
import logging
import platform
import unittest
from builtins import object
from builtins import range
from collections import defaultdict
import mock
import apache_beam as beam
from apache_beam import typehints
from apache_b... | {
"content_hash": "576e726909224f33499fe90dc8456548",
"timestamp": "",
"source": "github",
"line_count": 759,
"max_line_length": 85,
"avg_line_length": 35.62582345191041,
"alnum_prop": 0.6440088757396449,
"repo_name": "markflyhigh/incubator-beam",
"id": "d1d9d0dfd791545fde48d825d082c1037fe88d26",
"s... |
from os.path import join as pathjoin
from components.UI.textMenuItem import textMenuItem
from game import Game
from components.UI.menu import menu
class CFMenu(menu):
""" Represents the critical failure menu"""
def __init__(self, screen, keys, config, sounds, modifiers, log):
self.logSectionName = "C... | {
"content_hash": "f25b5e6bb55e2189c6a2cc889b4febce",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 73,
"avg_line_length": 38.64383561643836,
"alnum_prop": 0.46508330379298124,
"repo_name": "Penaz91/Glitch_Heaven",
"id": "3e2a3831252b02f7de3110e634293722cdad20cb",
"size":... |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.EGL import _types as _cs
# End users want this...
from OpenGL.raw.EGL._types import *
from OpenGL.raw.EGL import _errors
from OpenGL.constant import Constant as _C
import ctype... | {
"content_hash": "129f0949d40063e37daa0b42917edbf5",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 125,
"avg_line_length": 34.733333333333334,
"alnum_prop": 0.7504798464491362,
"repo_name": "alexus37/AugmentedRealityChess",
"id": "feb261b1cefbd462212236a6b6884e9efdc83a09",... |
"""
=============================================
Joint feature selection with multi-task Lasso
=============================================
The multi-task lasso allows to fit multiple regression problems
jointly enforcing the selected features to be the same across
tasks. This example simulates sequential measuremen... | {
"content_hash": "044a2341c5223c656f89a7f6ec29ff3f",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 88,
"avg_line_length": 28.170731707317074,
"alnum_prop": 0.6653679653679654,
"repo_name": "anntzer/scikit-learn",
"id": "a30b51ed7a7fe3395da4fc6ceba4d5720e90c33a",
"size": ... |
from django.utils.module_loading import import_string
from drfpasswordless.settings import api_settings
from drfpasswordless.utils import (
create_callback_token_for_user,
)
class TokenService(object):
@staticmethod
def send_token(user, alias_type, token_type, **message_payload):
token = create_ca... | {
"content_hash": "7c6a7803d201c3e3b0909c6a3c3c2a70",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 81,
"avg_line_length": 37.86363636363637,
"alnum_prop": 0.6782713085234093,
"repo_name": "aaronn/django-rest-framework-passwordless",
"id": "efa161c83587e028555f43afa4b426d5e... |
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/clothing/shared_clothing_armor_tantel_helmet.iff"
result.attribute_template_id = -1
result.stfName("string_id_table","")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return resul... | {
"content_hash": "90f81983fd8be89692bba115248f9548",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 92,
"avg_line_length": 24.692307692307693,
"alnum_prop": 0.7040498442367601,
"repo_name": "anhstudios/swganh",
"id": "c78889e285d88b094f663dec90a2b8ea53cc9730",
"size": "46... |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
from what_transcode.utils import get_mp3_ids
class UtilsTests(TestCase):
def test_get_mp3_ids(se... | {
"content_hash": "bcd7bc72dbb2020ca5e105015e6c2689",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 79,
"avg_line_length": 34.763440860215056,
"alnum_prop": 0.38478193628209095,
"repo_name": "grandmasterchef/WhatManager2",
"id": "4d20568f0a8594030cebb90be8a1a7446bb56676",
... |
from defines import *
import mobula
import mobula.layers as L
import mobula.solvers as S
import os
from LeNet5 import *
INPUT_FILE = "./train.csv"
RESULT_PATH = "./mnist_kaggle"
# Create the directory if it doesn't exists
if not os.path.exists(RESULT_PATH):
os.mkdir(RESULT_PATH)
# Load Data
try:
fin = open(I... | {
"content_hash": "a5d55e7ad6b86bb9f3697acc115aa0ee",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 125,
"avg_line_length": 22.078651685393258,
"alnum_prop": 0.5816793893129771,
"repo_name": "wkcn/mobula",
"id": "aaeb9d27094b15864e3166e7191c55a48ff0728c",
"size": "1965",
... |
"""
sentry.services.smtp
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import asyncore
import email
import logging
from smtpd import SMTPServer, SMTPChannel
from ... | {
"content_hash": "b5a1c6fff2f43e4c48938bb9e83d109d",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 85,
"avg_line_length": 33.03030303030303,
"alnum_prop": 0.5975535168195719,
"repo_name": "wanghe4096/WangBlog",
"id": "5308a02f6f48965bd69f993a4e2a4d7c83a89d30",
"size": "3... |
import os, sys
import numpy as np
import pandas as pd
from bagofwords import BagOfWords, StandardizingVector
import pickle
from sklearn.linear_model import LogisticRegression
from sklearn import cross_validation
import SonicScrewdriver as utils
import random
def dirty_pairtree(htid):
period = htid.find('.')
prefix =... | {
"content_hash": "a59f49470689e1d811ff9eb81e1dad32",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 102,
"avg_line_length": 31.373205741626794,
"alnum_prop": 0.7439377764221443,
"repo_name": "tedunderwood/GenreProject",
"id": "98dd1a38aef0c03bfea62ec8b8ededa387d0dfca",
"... |
"""HTTP server classes.
Note: BaseHTTPRequestHandler doesn't implement any HTTP request; see
SimpleHTTPRequestHandler for simple implementations of GET, HEAD and POST,
and CGIHTTPRequestHandler for CGI scripts.
It does, however, optionally implement HTTP/1.1 persistent connections,
as of version 0.3.
Notes on CGIHTT... | {
"content_hash": "9d73963faeeec9c2106cb8cf1576be14",
"timestamp": "",
"source": "github",
"line_count": 1187,
"max_line_length": 97,
"avg_line_length": 36.65122156697557,
"alnum_prop": 0.5802091713596138,
"repo_name": "wdv4758h/ZipPy",
"id": "6642729af58b4534a55b775a51c6107da34d404a",
"size": "4350... |
import os
from datetime import datetime
from logging import getLogger
from sqlalchemy.orm.exc import NoResultFound
from myarchive.db.tag_db.tables.file import TrackedFile
from myarchive.db.tag_db.tables.tag import Tag
from myarchive.db.tag_db.tables.yttables import YTPlaylist, YTVideo
from myarchive.libs import pafy
... | {
"content_hash": "e59c4c59020ccca24c78b4ecdbd17781",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 79,
"avg_line_length": 38.84146341463415,
"alnum_prop": 0.5547880690737833,
"repo_name": "zetasyanthis/myarchive",
"id": "b033291a76dae30b0dd77b4e0f183264a6bbeec4",
"size":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.