text stringlengths 4 1.02M | meta dict |
|---|---|
# Copyright (c) 2001, Stanford University
# All rights reserved.
#
# See the file LICENSE.txt for information on redistributing this software.
import sys
import apiutil
apiutil.CopyrightC()
print """/* DO NOT EDIT! THIS CODE IS AUTOGENERATED BY unpack.py */
#include "unpacker.h"
#include "cr_opcodes.h"
#include ... | {
"content_hash": "698cccca1e19167d67b05602f789d14d",
"timestamp": "",
"source": "github",
"line_count": 391,
"max_line_length": 125,
"avg_line_length": 30.020460358056265,
"alnum_prop": 0.6164593627534504,
"repo_name": "egraba/vbox_openbsd",
"id": "7329bb29905f0ad16101234046628bf999cebbec",
"size":... |
import unittest
import logging
import emission.analysis.modelling.trip_model.model_storage as eamums
import emission.analysis.modelling.trip_model.model_type as eamumt
import emission.analysis.modelling.trip_model.run_model as eamur
import emission.storage.timeseries.abstract_timeseries as esta
import emission.tests.m... | {
"content_hash": "b5f695d5950e0c11b04a32d5bdfad3b4",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 168,
"avg_line_length": 41.52601156069364,
"alnum_prop": 0.6227728285077951,
"repo_name": "e-mission/e-mission-server",
"id": "10f221909503534fbafd3e2c868f75449d1302fe",
"... |
from collections import OrderedDict
from csv import DictReader
from time import time
#field name constants
TIME = "time"
HUMIDITY = "humidity"
PRESSURE = "pressure"
TEMP_HUMIDITY = "temperature (humidity)"
TEMP_PRESSURE = "temperature (pressure)"
ORIENTATION_RAD_PITCH = "orientation radians pitch"
ORIENTATION_RAD_YAW ... | {
"content_hash": "4276de5a08b9650119b585fc35e9ba5d",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 73,
"avg_line_length": 25.71875,
"alnum_prop": 0.7053462940461726,
"repo_name": "martinohanlon/SpaceCRAFT",
"id": "08128b5a2f603940f977d02de6fa9cb7377aaa80",
"size": "1693"... |
import os
import unittest
import sys
import glob
from IECore import *
from math import pow
class TGAImageWriterTest(unittest.TestCase):
def __verifyImageRGB( self, imgNew, imgOrig, maxError = 0.002 ):
self.assertEqual( type(imgNew), ImagePrimitive )
if "R" in imgOrig :
self.assert_( "R" in imgNew )
if "G... | {
"content_hash": "15eb8c73bf6d53b00507260bade2f327",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 109,
"avg_line_length": 26.437751004016064,
"alnum_prop": 0.663223454352119,
"repo_name": "danieldresser/cortex",
"id": "13327f134f8bf77dd731f36e1c45de676c3ff161",
"size":... |
import sys
import os
import glob
import time
basepath = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(basepath, 'gen-py.twisted'))
sys.path.insert(0, glob.glob(os.path.join(basepath, '../../lib/py/build/lib.*'))[0])
from ThriftTest import ThriftTest
from ThriftTest.ttypes import Xception, ... | {
"content_hash": "7f341182cd7e141d1899170554be5844",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 98,
"avg_line_length": 28.327485380116958,
"alnum_prop": 0.6275805119735756,
"repo_name": "wfxiang08/thrift",
"id": "886de44d26adae90dea67c643d60bfd8f51e0db3",
"size": "56... |
from correios_lib.validators import CPF
from voluptuous import Invalid
from unittest import TestCase
class TestCPF(TestCase):
def setUp(self):
self.invalid_cases = ['648.152.363-05111', '000000000000000']
self.valid_cases = ['648.152.363-05', '64815236305']
def test_invalid_cnpjs(self):
... | {
"content_hash": "64f127244e57e9741fa0f6b9be933a67",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 69,
"avg_line_length": 28,
"alnum_prop": 0.6567460317460317,
"repo_name": "trocafone/correios-lib",
"id": "22dffdc4ea0b717ec8f3eaa9aa05461aa740a3b3",
"size": "504",
"bina... |
import functools
import logging
import jax
import jax.numpy as jnp
import numpy as np
from distla_core.blas.summa import summa
from distla_core.linalg.eigh import purify
from distla_core.linalg.invsqrt import invsqrt
from distla_core.linalg.polar import polar
from distla_core.utils import config
from distla_core.util... | {
"content_hash": "2106f10e7d8083cf41ac5b05cdb79680",
"timestamp": "",
"source": "github",
"line_count": 410,
"max_line_length": 83,
"avg_line_length": 32.12439024390244,
"alnum_prop": 0.6831675651051553,
"repo_name": "google/distla_core",
"id": "bb9c963e6607fc1250bab98452486c3bf632e67e",
"size": "1... |
"""try to find more bugs in the code using astroid inference capabilities
"""
import collections
import fnmatch
import re
import shlex
import sys
import six
import astroid
import astroid.context
import astroid.arguments
from astroid import exceptions
from astroid import objects
from astroid import bases
from pylint... | {
"content_hash": "4f1b033a48dcfbb5034f1956801288ad",
"timestamp": "",
"source": "github",
"line_count": 959,
"max_line_length": 87,
"avg_line_length": 41.69447340980188,
"alnum_prop": 0.568363136176066,
"repo_name": "mith1979/ansible_automation",
"id": "8d12039bd9bb400fff39f3895a321111ac46ebf5",
"s... |
"""
Tests & Stuff
"""
import unittest
from onepy import OneNote
on = OneNote()
#lists all sections & notebooks open in onenote
class TestOneNote(unittest.TestCase):
def test_instance(self):
for nbk in on.hierarchy:
print (nbk)
if nbk.name == "SoundFocus":
for s in nbk:
print (" " + str(s))
... | {
"content_hash": "f9aa2c4382360ef707e03228795d0a6e",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 80,
"avg_line_length": 18.966666666666665,
"alnum_prop": 0.6186291739894552,
"repo_name": "varunsrin/one-py",
"id": "f8a6e6ae06d5552d8ace659f5d65ca5d39bb12f5",
"size": "569... |
from automlk.solutions_pp import *
print([p.ref for p in pp_solutions]) | {
"content_hash": "096641ea55ce52828844e8e945314aac",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 36,
"avg_line_length": 24,
"alnum_prop": 0.75,
"repo_name": "pierre-chaville/automlk",
"id": "e06e344e70542fb6e242873b8dd2454471f38e76",
"size": "72",
"binary": false,
"... |
import unittest, time, sys, random
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_glm, h2o_import as h2i
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
h2o.init(1,java_heap_GB=4)
@classmethod
... | {
"content_hash": "ba92bf291f237e74bb92b2bc5ca2c80b",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 117,
"avg_line_length": 36.733333333333334,
"alnum_prop": 0.5739564428312159,
"repo_name": "111t8e/h2o-2",
"id": "3460acf06e609eb19e84635ea9cc88e10fea04de",
"size": "2204",... |
from m5.objects import *
from arm_generic import *
import switcheroo
root = LinuxArmFSSwitcheroo(
machine_type='VExpress_EMM64',
mem_class=DDR3_1600_x64,
cpu_classes=(AtomicSimpleCPU, TimingSimpleCPU, MinorCPU, DerivO3CPU)
).create_root()
# Setup a custom test method that uses the switcheroo tester th... | {
"content_hash": "a322cf6a1871d463d9fbc62219ca8e8f",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 72,
"avg_line_length": 29.615384615384617,
"alnum_prop": 0.7558441558441559,
"repo_name": "cancro7/gem5",
"id": "b9f28a4a9b623d12420c82ffba8b70a0417d0586",
"size": "2485",
... |
import pytest
from thefuck.rules.nixos_cmd_not_found import match, get_new_command
from thefuck.types import Command
@pytest.mark.parametrize('command', [
Command('vim', 'nix-env -iA nixos.vim')])
def test_match(mocker, command):
mocker.patch('thefuck.rules.nixos_cmd_not_found', return_value=None)
assert ... | {
"content_hash": "76cf71239b01e000c446781c25b4c90e",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 91,
"avg_line_length": 35.68,
"alnum_prop": 0.6894618834080718,
"repo_name": "SimenB/thefuck",
"id": "4370334547fcc9862aa96d04f3dba5d7e898e199",
"size": "892",
"binary": ... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class GetOrder(Choreography):
def __init__(self, temboo_session):
"""
Create a new ... | {
"content_hash": "f38190ac206c7140235aaa9af73d327c",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 179,
"avg_line_length": 43.75581395348837,
"alnum_prop": 0.6872176454956151,
"repo_name": "jordanemedlock/psychtruths",
"id": "bbeb8499cc8a6e3b57dd37ac61cadb24bead6fec",
"s... |
import sqlalchemy
USERNAME = 'vagrant'
PASSWORD = 'vagrant'
DATABASE = 'vagrant'
engine = sqlalchemy.create_engine(
'postgres://{username}:{pw}@localhost:5432/{db}'.format(
username=USERNAME,
pw=PASSWORD,
db=DATABASE
), convert_unicode=True
)
def execute_query(query, *args, **kwargs):
return engine.execute(... | {
"content_hash": "408dca11bdc04507d184153b2c68aeef",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 23.5,
"alnum_prop": 0.726063829787234,
"repo_name": "gaurav-sanghani/intro-to-web",
"id": "4186687149e0528636c3a2e5fe009f28f0abe432",
"size": "376",
... |
import os
from setuptools import setup, find_packages
install_requires = open('requirements.txt').read().splitlines()
__version__ = '0.4.2'
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except IOError:
return ''
setup(
name='python-qbittorrent... | {
"content_hash": "ba6900dca84687fb571c65960bc9c3cf",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 74,
"avg_line_length": 30.238095238095237,
"alnum_prop": 0.6291338582677165,
"repo_name": "v1k45/python-qBittorrent",
"id": "556a5fd4317f7d5ce6e5777cd8c8497d60a7224f",
"siz... |
import tweepy
from zope import interface
from twisted.application import service
from twisted.internet import defer, threads, reactor
from piped import exceptions, log, resource, util
class MyTwitterProvider(object):
# state that we are a resource provider, so that the piped plugin system finds us
interface.... | {
"content_hash": "bb5059612cf722a8d8da56197ad6f7de",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 112,
"avg_line_length": 42.857142857142854,
"alnum_prop": 0.7066666666666667,
"repo_name": "alexbrasetvik/Piped",
"id": "60c3b609cab96b418e38852282e438867f8dcbda",
"size": ... |
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module that will appear in module menus
'Name': 'Get-ChromeDump',
# list of one or ... | {
"content_hash": "59899a3837a380941e6bb0baab2d8387",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 127,
"avg_line_length": 36.03703703703704,
"alnum_prop": 0.5426515930113053,
"repo_name": "bneg/Empire",
"id": "dec2c330bc2b162b637fcfc4d70ab701f4eb8f6a",
"size": "3892",
... |
"""
PostGIS to GDAL conversion constant definitions
"""
# Lookup to convert pixel type values from GDAL to PostGIS
GDAL_TO_POSTGIS = [None, 4, 6, 5, 8, 7, 10, 11, None, None, None, None]
# Lookup to convert pixel type values from PostGIS to GDAL
POSTGIS_TO_GDAL = [1, 1, 1, 3, 1, 3, 2, 5, 4, None, 6, 7, None, No... | {
"content_hash": "8f8b2ea75a9a7b784504f6b1e228dc59",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 73,
"avg_line_length": 35.51162790697674,
"alnum_prop": 0.633267845448592,
"repo_name": "yephper/django",
"id": "38ba2b1a84276cbb94c80f28549687780895c73f",
"size": "1527",
... |
import os
import sys
if sys.version_info[0] == 3:
import configparser
from urllib.request import urlretrieve
else:
import ConfigParser as configparser
from urllib import urlretrieve
config = configparser.SafeConfigParser()
config.read('ci_config/virtualenv_util.cfg')
bootstrap_url = config.get('global... | {
"content_hash": "680065c1c0fd22c08114e89bea3494fc",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 53,
"avg_line_length": 25.789473684210527,
"alnum_prop": 0.7673469387755102,
"repo_name": "teamfruit/defend_against_fruit",
"id": "65c7c569a2145c9a65bef25dde64e70a124fb57a",
... |
try:
import json
_parse_json = lambda s: json.loads(s)
except ImportError:
try:
import simplejson
_parse_json = lambda s: simplejson.loads(s)
except ImportError:
# For Google AppEngine
from django.utils import simplejson
_parse_json = lambda s: simplejson.loads(s)... | {
"content_hash": "5bc3eeb1e36424c9c259758ae90f6244",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 81,
"avg_line_length": 31.933962264150942,
"alnum_prop": 0.5710487444608567,
"repo_name": "openzoom/zoomit-python-sdk",
"id": "693eec5d44142e8d57fb461b50ab54b6f3cfa3de",
"... |
import os
from twilio.rest import Client
# Initialize the client
# To set up environmental variables, see http://twil.io/secure
account = os.environ['TWILIO_ACCOUNT_SID']
token = os.environ['TWILIO_AUTH_TOKEN']
client = Client(account, token)
response = client.chat \
.services("ISXXXXXXXXXXXXXXXXXXXX... | {
"content_hash": "b07556392f7d7db8826ff22d66189d79",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 66,
"avg_line_length": 30.5,
"alnum_prop": 0.6598360655737705,
"repo_name": "TwilioDevEd/api-snippets",
"id": "b96fc3b25cc607f374ed32a3905b6fbcb711a938",
"size": "561",
"... |
"""
oauthlib.oauth2.rfc6749.tokens
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains methods for adding two types of access tokens to requests.
- Bearer http://tools.ietf.org/html/rfc6750
- MAC http://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-01
"""
from __future__ import absolute_import, unicode_literals
fr... | {
"content_hash": "0912fe08848d1c475cd2d72662a3d58f",
"timestamp": "",
"source": "github",
"line_count": 299,
"max_line_length": 102,
"avg_line_length": 31.73913043478261,
"alnum_prop": 0.6184404636459431,
"repo_name": "ownport/jira-reports",
"id": "06ff5585568f4cd612c5eb8adab20bc74721adef",
"size":... |
from helpers.match_manipulator import MatchManipulator
from models.match import Match
class MatchSuggestionAccepter(object):
"""
Handle accepting Match suggestions.
"""
@classmethod
def accept_suggestion(self, match, suggestion):
if "youtube_videos" in suggestion.contents:
mat... | {
"content_hash": "2914a212a46f4b3f7a407af941d1bca3",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 92,
"avg_line_length": 31.08695652173913,
"alnum_prop": 0.6937062937062937,
"repo_name": "tsteward/the-blue-alliance",
"id": "604ae4ac77b741537f9b3c0f985500186642f488",
"si... |
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
app.config.from_pyfile('config.cfg')
db = SQLAlchemy(app)
| {
"content_hash": "428e4f7ccfa34d709f1e3cbda7317474",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 39,
"avg_line_length": 24.166666666666668,
"alnum_prop": 0.7586206896551724,
"repo_name": "omtcyf0/VisARTM",
"id": "2f908dc1ec9b3c25c7323ddd1cb2e6f2d563398e",
"size": "145",... |
import json
import re
import datetime
from itertools import groupby
import logging
from django.db import connection
from django.db.models import Prefetch, Q, Count
from django.shortcuts import get_object_or_404
from django.http import Http404
from rest_framework import viewsets
from rest_framework.pagination import P... | {
"content_hash": "b17b110a671bbcb3ca555ffcdeb389af",
"timestamp": "",
"source": "github",
"line_count": 460,
"max_line_length": 137,
"avg_line_length": 39.21304347826087,
"alnum_prop": 0.6389289278190486,
"repo_name": "shh-dlce/dplace",
"id": "3df2b7174a3d2e0c0f44c84e7f8ede7876dbf8e9",
"size": "180... |
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
README = readme_file.read()
with open('requirements.txt') as file:
REQUIREMENTS = file.read()
setup(
name='autolearn',
version='0.1.0',
description="Automatic Machine Learning",
long_description=README,
au... | {
"content_hash": "9a491d18cb4e5276c9e730d6172165b9",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 55,
"avg_line_length": 30.216216216216218,
"alnum_prop": 0.6198568872987478,
"repo_name": "austinmcconnell/autolearn",
"id": "a045ff7dbbf7bdca03f69577ce6e24cec36a9261",
"si... |
from __future__ import absolute_import
from rest_framework.response import Response
from sentry import filters
from sentry.api.bases.project import ProjectEndpoint
class ProjectFiltersEndpoint(ProjectEndpoint):
def get(self, request, project):
"""
List a project's filters
Retrieve a lis... | {
"content_hash": "82bd7ba89c802b0a60741eb0bf12d488",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 94,
"avg_line_length": 29.727272727272727,
"alnum_prop": 0.5443425076452599,
"repo_name": "jean/sentry",
"id": "bde5de51cbdaa0a966ba0d84a5ca6dc23efb1f35",
"size": "981",
... |
from __future__ import print_function, unicode_literals
import json
import re
from rbtools.api.errors import APIError
from rbtools.commands import (Command,
CommandError,
CommandExit,
Option,
ParseE... | {
"content_hash": "8c58951f42dedd23b4b5ea76a0cc0cca",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 73,
"avg_line_length": 32.4264705882353,
"alnum_prop": 0.5165532879818594,
"repo_name": "davidt/rbtools",
"id": "7b8c51d5877c6ad112155f4652c0ad9ad108cb6f",
"size": "2205",
... |
"""
timings.py
Created by William Katz on 2008-05-04.
Copyright (c) 2008 Publishare LLC. Distributed under MIT License.
"""
__author__ = "William T. Katz"
# Global that stores timing runs, all keyed to incoming url path.
# Note that since this is a global, you'll only get stats from the
# currently visited server a... | {
"content_hash": "3a3367958ee14f1df086e633854faca6",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 77,
"avg_line_length": 33.552083333333336,
"alnum_prop": 0.5184725240608506,
"repo_name": "arcticio/ice-bloc-hdr",
"id": "ff1de4ddeddec6316b4672efac83639655b6795e",
"size":... |
from parameterized import parameterized
from tests.test_utils.system_tests_class import SystemTest
class TestExampleDagsSystem(SystemTest):
@parameterized.expand([
"example_bash_operator",
"example_branch_operator"
])
def test_dag_example(self, dag_id):
self.run_dag(dag_id=dag_id)... | {
"content_hash": "d840e9f705205f4180e839e1f7d9e9ad",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 58,
"avg_line_length": 26.75,
"alnum_prop": 0.7071651090342679,
"repo_name": "mtagle/airflow",
"id": "cbf549d8edf21129a85952f566c8d1833597a6c3",
"size": "1108",
"binary":... |
'''The following code is proof of concept for multi/single plots; from 0.4.4b1.
See BETA for class abstractions to Distribplot and PanelPlot.
'''
import math
import itertools as it
import matplotlib as mpl
import matplotlib.pyplot as plt
# PLOT -----------------------------------------------------------------------... | {
"content_hash": "cafd33d37b6277ca9f93f84910ca1a87",
"timestamp": "",
"source": "github",
"line_count": 457,
"max_line_length": 103,
"avg_line_length": 39.816192560175054,
"alnum_prop": 0.5643548032534623,
"repo_name": "par2/lamana-test",
"id": "0ed1e1b891a868b3697249fb368cc8c4f5462821",
"size": "1... |
import json
import logging
from django.conf import settings
from minio import Minio
from minio.error import MinioException, S3Error
from urllib3.exceptions import RequestError
logger = logging.getLogger(__name__)
bucket_list = ["files", "cache"]
if settings.ENABLE_PGP:
bucket_list.append("pgp-keys")
def get_re... | {
"content_hash": "3af7025b6923e3c04d6abe4cb1ad8a9e",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 106,
"avg_line_length": 32.075471698113205,
"alnum_prop": 0.5947058823529412,
"repo_name": "meine-stadt-transparent/meine-stadt-transparent",
"id": "79ed402129ab3130e7a71a7f... |
from ezdxf.math import ConstructionLine, Vec2
class TestConstructionLine:
def test_is_vertical(self):
assert ConstructionLine((0, 0), (10, 0)).is_vertical is False
assert ConstructionLine((5, -5), (5, 5)).is_vertical is True
def test_left_of_line(self):
line = ConstructionLine((0, 0),... | {
"content_hash": "5818e791556e4e2cb748d25fe39d30bd",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 77,
"avg_line_length": 46.44736842105263,
"alnum_prop": 0.5963172804532578,
"repo_name": "mozman/ezdxf",
"id": "9f801e9b8a2d8c918dc7e3675ed7509c3b8744c0",
"size": "3595",
... |
"""
OpenAPI spec version:
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.a... | {
"content_hash": "67dc14147f4fc7d7d4bcb86c853677cd",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 193,
"avg_line_length": 28.265625,
"alnum_prop": 0.5809839690436706,
"repo_name": "detiber/lib_openshift",
"id": "2b259b6ac4eae089406dcebe20f8e16c8f943fc0",
"size": "3635"... |
# coding: utf-8
from elasticsearch import Elasticsearch, helpers
import psycopg2, pprint, sys, time, os
CHUNK_SIZE = 10000
def getEnvOrExit(var):
environment = ''
try:
environment = os.environ[var]
except:
print('[Error]: Environment variable ' + var + ' not defined.')
sys.exit(1)
... | {
"content_hash": "0fa489b98a99c58fb20f4c7cdb3b13d2",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 204,
"avg_line_length": 40.66216216216216,
"alnum_prop": 0.6134928547690263,
"repo_name": "Nutjob/nyaa",
"id": "0b8874060834ce3f506c402a9623a9425385e33c",
"size": "3009",
... |
"""Utilities for all our deps-management stuff."""
import os
import shutil
import sys
import subprocess
import tarfile
import time
import zipfile
def RunSubprocessWithRetry(cmd):
"""Invokes the subprocess and backs off exponentially on fail."""
for i in range(5):
try:
subprocess.check_call(cmd)
r... | {
"content_hash": "e2d1cdb1270da4f60f40b22b5d9ac481",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 77,
"avg_line_length": 29.704347826086956,
"alnum_prop": 0.6759367681498829,
"repo_name": "koobonil/Boss2D",
"id": "e0f679d6b51ed53b14fbf57ec60a16aaa5168dd2",
"size": "383... |
import base64
import boto.sts
import configparser
import logging
import os
import requests
import xml.etree.ElementTree as ET
import sys
import traceback
from bs4 import BeautifulSoup
from kerb_sts.awsrole import AWSRole
class DefaultRoleCredsGenerationError(Exception):
pass
class KerberosHandler:
"""
Th... | {
"content_hash": "1cc60a94eb46fefe83437c6a0b75e1a8",
"timestamp": "",
"source": "github",
"line_count": 258,
"max_line_length": 150,
"avg_line_length": 46.275193798449614,
"alnum_prop": 0.6180584638579446,
"repo_name": "commercehub-oss/kerb-sts",
"id": "4562f09d4a97ecf9f4ffd59d1ba47f84b25efd0a",
"s... |
import math
# Runs the Chebyshev algorithm up to 30 times, increasing degree n until the guess is sufficiently close.
# Outputs the calculated Chebyshev value, the degree of the polynomial where the best guess was calculated,
# and the actual value from the function.
# Example usage: chebyshev(-1, 1, 0.5, math.sin)
#... | {
"content_hash": "31e4d74cc8a39587131d8acbd1356160",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 107,
"avg_line_length": 36.66,
"alnum_prop": 0.5384615384615384,
"repo_name": "protocol114/numerical-2.2",
"id": "9a24b0a70cb9e443bbbd4c5a640d662f0a6fbc50",
"size": "1833",... |
from dspl2.rdfutil import (LoadGraph, FrameGraph, SelectFromGraph)
from io import StringIO
import json
import rdflib
import rdflib.compare
import unittest
_SampleJson = '''{
"@context": "http://schema.org",
"@type": "StatisticalDataset",
"@id": "",
"url": "https://data.europa.eu/euodp/en/data/dataset/bAzn6fiu... | {
"content_hash": "1621c35c489e6bec8705b1dbfb1f1131",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 178,
"avg_line_length": 44.21,
"alnum_prop": 0.6760913820402624,
"repo_name": "google/dspl",
"id": "4ed458a8a8c035fc078eca93277e56baa4eafa6e",
"size": "4421",
"binary": ... |
"""Example of using two different training methods at once in multi-agent.
Here we create a number of CartPole agents, some of which are trained with
DQN, and some of which are trained with PPO. We periodically sync weights
between the two trainers (note that no such syncing is needed when using just
a single training... | {
"content_hash": "8a3eae90a99fbd8ff7e473008e03a29c",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 79,
"avg_line_length": 36.92,
"alnum_prop": 0.609967497291441,
"repo_name": "richardliaw/ray",
"id": "08d354d882d4a1bccaee840d332936d94440f4d1",
"size": "4615",
"binary"... |
"""Helpers for components that manage entities."""
from __future__ import annotations
import asyncio
from collections.abc import Iterable
from datetime import timedelta
from itertools import chain
import logging
from types import ModuleType
from typing import Any, Callable
import voluptuous as vol
from homeassistant... | {
"content_hash": "495fca77d6a0e82a68fc1fe0d5292235",
"timestamp": "",
"source": "github",
"line_count": 335,
"max_line_length": 88,
"avg_line_length": 33.07761194029851,
"alnum_prop": 0.6239509069578558,
"repo_name": "kennedyshead/home-assistant",
"id": "37c0a7620abc300c7d07650745a1f07c6728c3bd",
"... |
from django.conf.urls import url
from django.views.generic import TemplateView
from . import views
app_name = "tweet_monitor"
urlpatterns = [
# React view
url(r'^process_add_handle/$', views.add_handle, name='add_handle'),
# url(r'^$', TemplateView.as_view(template_name='tweet_monitor/react_index.html'),... | {
"content_hash": "f663b5d6a80f68bc645f8eac8c01920d",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 109,
"avg_line_length": 45.96774193548387,
"alnum_prop": 0.6498245614035087,
"repo_name": "lucabezerra/VinTwitta",
"id": "fef109b81568ce9b6286418aadbf312d89653ef0",
"size":... |
__author__ = 'huqinghua'
# coding=gbk
import string, os, commands, time
class CommonUtils():
"""·ÖÏíÓÃsession"""
exeRoot = ''
@classmethod
def SaveExePath(cls):
cls.exeRoot = os.path.abspath(os.curdir)
@classmethod
def ReverseToExePath(cls):
os.chdir(cls.exeRoo... | {
"content_hash": "391e9ba0a3cf9ce64d26085f16449c30",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 48,
"avg_line_length": 20.125,
"alnum_prop": 0.6024844720496895,
"repo_name": "the7day/py-ui4win",
"id": "1ff377effcea4a38131e0125678a60157ab672d8",
"size": "322",
"binar... |
import pytest
from tests.providers.google.cloud.utils.gcp_authenticator import GCP_STACKDRIVER
from tests.test_utils.gcp_system_helpers import CLOUD_DAG_FOLDER, GoogleSystemTest, provide_gcp_context
@pytest.mark.backend("mysql", "postgres")
@pytest.mark.credential_file(GCP_STACKDRIVER)
class GCPTextToSpeechExampleDa... | {
"content_hash": "6035b54197d9d82bb5455f6aa9148414",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 103,
"avg_line_length": 40.916666666666664,
"alnum_prop": 0.7942973523421588,
"repo_name": "sekikn/incubator-airflow",
"id": "1d7660342445f1fd59d9091a3f4efbeb433ec1a1",
"si... |
"""
Flacon
-------------
Flask application manager
"""
from setuptools import setup
setup(
name='Flacon',
version='0.0.1',
url='',
license='BSD',
author='Mehdi Bayazee, Mostafa Rokooie',
author_email='bayazee@gmail.com, mostafa.rokooie@gmail.com',
description='Flask based web framework',
... | {
"content_hash": "78ce6f480cc3444d3e5e0c5f9a8fe346",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 70,
"avg_line_length": 28.526315789473685,
"alnum_prop": 0.6088560885608856,
"repo_name": "bayazee/flacon",
"id": "5ff46d417b2da2aef5ed4b767b27b3fe8c20f4dd",
"size": "1084"... |
import os
import sys
from .lang_aux import Const, ReloadAsConstModule
def env_bool(x):
return Const(os.environ.get(x, '0') == '1')
def env_int(x, val):
return Const(int(os.environ.get(x, str(val))))
VM_MEMORY_SIZE_IN_MB = env_int('TILCK_VM_MEM', 128)
GEN_TEST_DATA = env_bool('GEN_TEST_DATA')
IN_TRAVIS = env_bo... | {
"content_hash": "1ada03503dfe31ffca84507a96977388",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 77,
"avg_line_length": 26.75,
"alnum_prop": 0.6869158878504673,
"repo_name": "vvaltchev/experimentOs",
"id": "3db62ca594a470366b81fcae9762bd06b120655e",
"size": "683",
"b... |
''' deactivate.py '''
from heron.common.src.python.utils.log import Log
import heron.tools.cli.src.python.cli_helper as cli_helper
def create_parser(subparsers):
'''
:param subparsers:
:return:
'''
return cli_helper.create_parser(subparsers, 'deactivate', 'Deactivate a topology')
# pylint: disable=unused-a... | {
"content_hash": "4bd17b9526a497f28c4090ccc3f17f9e",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 84,
"avg_line_length": 25.434782608695652,
"alnum_prop": 0.7008547008547008,
"repo_name": "tomncooper/heron",
"id": "9534de8164eabe4c3bf33e2315691335a39f9e53",
"size": "143... |
"""This component provides HA switch support for Ring Door Bell/Chimes."""
from datetime import timedelta
import logging
from homeassistant.components.switch import SwitchDevice
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
import homeassistant.util.dt as... | {
"content_hash": "246992a791589dc936a464d08119fce6",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 86,
"avg_line_length": 30.945454545454545,
"alnum_prop": 0.6389541715628673,
"repo_name": "leppa/home-assistant",
"id": "16fc4a6717fe154a5d8f93fccefcb5d938032570",
"size":... |
"""Diagnose cluster command."""
from apitools.base.py import encoding
from googlecloudsdk.api_lib.dataproc import exceptions
from googlecloudsdk.api_lib.dataproc import storage_helpers
from googlecloudsdk.api_lib.dataproc import util
from googlecloudsdk.calliope import base
from googlecloudsdk.core import log
from go... | {
"content_hash": "5cb055b5f0aa385001e72b1ab489f77a",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 70,
"avg_line_length": 35.1875,
"alnum_prop": 0.6838365896980462,
"repo_name": "KaranToor/MA450",
"id": "867cc8197347329149fe758368be91afa27e7372",
"size": "2848",
"binar... |
from __future__ import absolute_import, division, print_function
import os
from cryptography import exceptions, utils
from cryptography.hazmat.backends.openssl import aead
from cryptography.hazmat.backends.openssl.backend import backend
class ChaCha20Poly1305(object):
def __init__(self, key):
if not bac... | {
"content_hash": "994f48665a7ff6d3329f21ebf808b784",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 79,
"avg_line_length": 33.32911392405063,
"alnum_prop": 0.6029244208127611,
"repo_name": "jamesylgan/szechuantech",
"id": "07b6bce616728d493dcf30bd66c87f636ff2eedb",
"size... |
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
SECRET_KEY = 'ds98fdf9S(DF*(S)f8)(SUDFUF)sdui-0dfisdfk'
@staticmethod
def init_app(app):
pass
class DevConfig(Config):
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + \
... | {
"content_hash": "f54ad8550b946e556581e10d2b660bdb",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 70,
"avg_line_length": 19.681818181818183,
"alnum_prop": 0.6004618937644342,
"repo_name": "cwimbrow/veganeyes-api",
"id": "c287e0c7f14ae33f20aa8181b13ae70d0603bfcb",
"size"... |
import logging
from owslib import crs
from pycsw.core import util
LOGGER = logging.getLogger(__name__)
TYPES = ['gml:Point', 'gml:LineString', 'gml:Polygon', 'gml:Envelope']
DEFAULT_SRS = crs.Crs('urn:x-ogc:def:crs:EPSG:6.11:4326')
def _poslist2wkt(poslist, axisorder):
"""Repurpose gml:posList into WKT aware l... | {
"content_hash": "4765f7e2749da0135600869a08e7b384",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 78,
"avg_line_length": 33.32338308457712,
"alnum_prop": 0.5034338608539862,
"repo_name": "mwengren/pycsw",
"id": "09b23ccb4a9614b66e9b7b5fbcf2e526e2117c1b",
"size": "8016"... |
"""All the test files for API renderers plugins are imported here."""
# These need to register plugins so, pylint: disable=unused-import
from grr.gui.api_plugins import aff4_test
from grr.gui.api_plugins import hunt_test
| {
"content_hash": "91e924a05207f7bfb6a1cf7723e98ff8",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 69,
"avg_line_length": 32,
"alnum_prop": 0.7723214285714286,
"repo_name": "pchaigno/grreat",
"id": "e5ebb0a641b8858dde170d5624b875727546775e",
"size": "246",
"binary": fal... |
"""Services for the Plex integration."""
import json
import logging
from plexapi.exceptions import NotFound
import voluptuous as vol
from homeassistant.core import HomeAssistant, ServiceCall
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.dispatcher import async_dispatcher_send
fro... | {
"content_hash": "9ed69df1e9197972a0cb396da8e3fab0",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 103,
"avg_line_length": 33.152671755725194,
"alnum_prop": 0.6663596592217361,
"repo_name": "GenericStudent/home-assistant",
"id": "0433ba836cd8a87376c3680554b11f1bc22810a9",... |
from django.test import TestCase
from ui.voyager import get_open_library_item_title
class OpenLibraryTitleTest(TestCase):
def test_correct_title(self):
"this is from issue 487 where open libray link points to correct title"
title = "Life on the Mississippi"
open_library_link = "http://ope... | {
"content_hash": "b36cca373646f87b734b11eab8d85d17",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 107,
"avg_line_length": 48.78947368421053,
"alnum_prop": 0.7044228694714132,
"repo_name": "gwu-libraries/launchpad",
"id": "cae9d8be88022a2be6ff0dde1439a7e7712a4708",
"size... |
"""passlib.handlers.fshp
"""
#=============================================================================
# imports
#=============================================================================
# core
from base64 import b64encode, b64decode
import re
import logging; log = logging.getLogger(__name__)
from ... | {
"content_hash": "e829940d7f2996c25c9e8e288c94db30",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 145,
"avg_line_length": 37.262135922330096,
"alnum_prop": 0.47498697238144866,
"repo_name": "Glottotopia/aagd",
"id": "1eca6197302499042c505ebeab5599660be51652",
"size": "... |
import datetime
import mock
from testtools.matchers import HasLength
from ironic.common import exception
from ironic import objects
from ironic.tests.unit.db import base
from ironic.tests.unit.db import utils
class TestPortObject(base.DbTestCase):
def setUp(self):
super(TestPortObject, self).setUp()
... | {
"content_hash": "8fa93f168488365aaf58d89a01d8677f",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 79,
"avg_line_length": 41.44444444444444,
"alnum_prop": 0.5776261272239824,
"repo_name": "bacaldwell/ironic",
"id": "445ca84b7c95708f709179579272fe2658525027",
"size": "469... |
"""
Script to identify outliers for each subject. Compares the mean MRSS values from running GLM on the basic np.convolve convolved time course, before and after dropping the outliers.
"""
import numpy as np
import nibabel as nib
import os
import sys
import pandas as pd
from sklearn.decomposition import PCA
import m... | {
"content_hash": "d018adb3dc457e24818c5c3e3df573cb",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 181,
"avg_line_length": 33.160714285714285,
"alnum_prop": 0.6984383414108778,
"repo_name": "reychil/project-alpha-1",
"id": "ccc1b1ed353bc3feaafa417606085c7bb8d35223",
"siz... |
"""
WSGI config for app project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "app.settings")
from django.core.wsgi impo... | {
"content_hash": "2fec3ccb3f5306c93b0db65a3f0aa5e9",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 78,
"avg_line_length": 27.214285714285715,
"alnum_prop": 0.7690288713910761,
"repo_name": "dugancathal/polyspec",
"id": "8446814ae73cbed8b0e8c12fa44661766353179c",
"size": ... |
from django.db import models
class Tag(models.Model):
name=models.CharField(max_length=128,unique=True)
def __unicode__(self):
return self.name
class Link(models.Model):
title=models.CharField(max_length=128,unique=True)
url=models.URLField()
tags=models.ManyToManyField(Tag)
def __unicode__(self):
return ... | {
"content_hash": "7bb6c12f89be57bbe6140cecb86f5dd8",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 51,
"avg_line_length": 25.46153846153846,
"alnum_prop": 0.7492447129909365,
"repo_name": "zturchan/CMPUT410-Lab6",
"id": "4f0433d5f739f53968de97f11ba851bdc9dd26ef",
"size":... |
"""Filename globbing utility."""
import os
import fnmatch
import re
__all__ = ["glob"]
def glob(pathname):
"""Return a list of paths matching a pathname pattern.
The pattern may contain simple shell-style wildcards a la fnmatch.
"""
if not has_magic(pathname):
if os.path.exists(pathname):
... | {
"content_hash": "e3aa188c0cf28130dea37f6f7a4bb4b0",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 70,
"avg_line_length": 25.43859649122807,
"alnum_prop": 0.5627586206896552,
"repo_name": "Integral-Technology-Solutions/ConfigNOW",
"id": "eeb6bdd6468aeaaa0a20fdaa6850eb2a909... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "robotgear.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is r... | {
"content_hash": "34bdffb97d38b018d9530715956f9961",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 77,
"avg_line_length": 37.38095238095238,
"alnum_prop": 0.621656050955414,
"repo_name": "robotgear/robotgear",
"id": "c97d81739a2bc4d8fcba9f7412d3d354306c7d36",
"size": "80... |
"""
PyPI XML-RPC Client helper
To use the :data:`pyshop.helpers.pypi.proxy`, the method
:method:`pyshop.helpers.pypi.set_proxy`must be called to
install the XML RPC proxy.
Also it is possible to install an HTTP Proxy in case the pyshop host does not
have a direct access to internet.
This is actually a configuration ... | {
"content_hash": "c7dea605398fc88315ba9cf146b1ad64",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 77,
"avg_line_length": 29.01801801801802,
"alnum_prop": 0.6047811238745732,
"repo_name": "qpython-android/QPYPI",
"id": "724c1c0769bb798630943b31bc223d99c375d830",
"size":... |
from parse_prca import parse | {
"content_hash": "c287eb56ca21533b0822bf88e04309ae",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 28,
"avg_line_length": 28,
"alnum_prop": 0.8571428571428571,
"repo_name": "spudmind/undertheinfluence",
"id": "57b4eaae75d50f0e3e239d2dfb8925cb3cc95f7c",
"size": "28",
"bi... |
"""
Handling of RSA and DSA keys.
Maintainer: U{Paul Swartz}
"""
# base library imports
import base64
import warnings
import itertools
# external library imports
from Crypto.Cipher import DES3
from Crypto.PublicKey import RSA, DSA
from Crypto import Util
from pyasn1.type import univ
from pyasn1.codec.ber import deco... | {
"content_hash": "dea1fe2de04b4b2908fc4c910ff16f4c",
"timestamp": "",
"source": "github",
"line_count": 937,
"max_line_length": 80,
"avg_line_length": 36.33617929562433,
"alnum_prop": 0.5419567069051605,
"repo_name": "sorenh/cc",
"id": "5dc47188d5ddedb9fe9e937abcd4c4fa89f880c7",
"size": "34185",
... |
import copy
import numpy as np
from ..io.pick import pick_channels_cov
from ..forward import apply_forward
from ..utils import check_random_state, verbose, _time_mask
@verbose
def generate_evoked(fwd, stc, evoked, cov, snr=3, tmin=None, tmax=None,
iir_filter=None, random_state=None, verbose=None... | {
"content_hash": "0af2b2d9e7088cc9d84485dfe3ad2ee3",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 77,
"avg_line_length": 32.293103448275865,
"alnum_prop": 0.6350774159103043,
"repo_name": "Odingod/mne-python",
"id": "5ba6f8676a8a8753337d6bcc72a9b3315fc5ee4b",
"size": "... |
"""Latex filters.
Module of useful filters for processing Latex within Jinja latex templates.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in th... | {
"content_hash": "94da1557a70c29795b986455bb805246",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 116,
"avg_line_length": 30.91869918699187,
"alnum_prop": 0.47225874309755456,
"repo_name": "noslenfa/tdjangorest",
"id": "a67b7d68e5f906993c562887745bcefec291e3ca",
"size"... |
"""Functional tests using WebTest."""
import httplib as http
import logging
import unittest
import markupsafe
import mock
from nose.tools import * # flake8: noqa (PEP8 asserts)
import re
from framework.mongo.utils import to_mongo_key
from framework.auth import cas
from framework.auth import exceptions as auth_exc
fr... | {
"content_hash": "496e7450cadd4d1c2e3aab1541c472b4",
"timestamp": "",
"source": "github",
"line_count": 1097,
"max_line_length": 166,
"avg_line_length": 39.249772105742935,
"alnum_prop": 0.6264951111317556,
"repo_name": "emetsger/osf.io",
"id": "6e4b96363d04b0d6d6b163e6c9382ad7f3cf0c4c",
"size": "4... |
"""
Copyright 2012 GroupDocs.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | {
"content_hash": "3de334cef94f906a0326b9dfdba9c35b",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 77,
"avg_line_length": 31.675675675675677,
"alnum_prop": 0.6578498293515358,
"repo_name": "liosha2007/temporary-groupdocs-python3-sdk",
"id": "a7086a543ef57c4b42d1f50d19881c4... |
import sys
import random
if sys.version >= '3':
basestring = unicode = str
long = int
from functools import reduce
from html import escape as html_escape
else:
from itertools import imap as map
from cgi import escape as html_escape
import warnings
from pyspark import copy_func, since, _NoValu... | {
"content_hash": "e6e0ddc1420baa9f98682a4aa0ab3e3b",
"timestamp": "",
"source": "github",
"line_count": 2334,
"max_line_length": 100,
"avg_line_length": 38.97814910025707,
"alnum_prop": 0.5681450948062654,
"repo_name": "kevinyu98/spark",
"id": "78b574685327c8ce2f58be9f62007c423321a159",
"size": "91... |
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout,Div,Submit,HTML,Button,Row, Field
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions
from apps.blog.models import *
from django.core.urlresolvers import reverse
from django.utils.safestrin... | {
"content_hash": "dd9bfd8f83ebca5cb7fdade2b9e52f40",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 96,
"avg_line_length": 31.796116504854368,
"alnum_prop": 0.6894656488549619,
"repo_name": "gusaul/gigsblog",
"id": "5b15f5d336372df1ed23f9edf73a95a5921c5460",
"size": "655... |
__author__ = 'nicolasfraison'
import os
workers = os.environ['WORKER_PROCESSES']
timeout = os.environ['TIMEOUT']
preload_app = True | {
"content_hash": "c3e05615bf5e0196a8c232a033056abf",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 40,
"avg_line_length": 19,
"alnum_prop": 0.7218045112781954,
"repo_name": "ashangit/docker-graphite-api",
"id": "684773def69527fb119e72c03827f6d00b65ff63",
"size": "133",
... |
"""
URLConf for Django-Forum.
django-forum assumes that the forum application is living under
/forum/.
Usage in your base urls.py:
(r'^forum/', include('forum.urls')),
"""
from django.conf.urls.defaults import *
from forum.models import Forum
from forum.feeds import RssForumFeed, AtomForumFeed
from forum.sitema... | {
"content_hash": "f35fe41e269a8e9c3791a02ddfcec2f6",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 109,
"avg_line_length": 33.95652173913044,
"alnum_prop": 0.6376440460947503,
"repo_name": "Pmisiurak/django-forum",
"id": "ba5e3303e0b4a263d0e595e883200eb5fc7ba893",
"size"... |
import json
from cStringIO import StringIO
try:
import unittest2 as unittest
except ImportError:
import unittest
from csvkit.exceptions import NonUniqueKeyColumnException
from csvkit.utilities.csvjson import CSVJSON
class TestCSVJSON(unittest.TestCase):
def test_simple(self):
args = ['examples/du... | {
"content_hash": "37542ebe559daceb6463bc6e6f9ddbcb",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 105,
"avg_line_length": 34.17213114754098,
"alnum_prop": 0.5939074118493644,
"repo_name": "moradology/csvkit",
"id": "a1dac3e7d797244623ebd0f59a162c7a7d131288",
"size": "4... |
import os
# from pilot.util.container import execute
from pilot.common.errorcodes import ErrorCodes
import logging
logger = logging.getLogger(__name__)
errors = ErrorCodes()
def verify_setup_command(cmd):
"""
Verify the setup command.
:param cmd: command string to be verified (string).
:return: pi... | {
"content_hash": "957c58c741fffb772f1ee982da833fa9",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 110,
"avg_line_length": 34.095238095238095,
"alnum_prop": 0.6773743016759777,
"repo_name": "PalNilsson/pilot2",
"id": "597a8ed6ab45b8456d114d261ae0b741f71e242e",
"size": "2... |
"""
Foundations of Python Network Programming
------------------------------------------
Chapter 02 - Super naive Client / Server with basic backoff support (for UDP client) to avoid congestion.
The server (when used with UDP) randomly drops packets to simulate a packet loss.
"""
import socket
impo... | {
"content_hash": "c081592a777f5c8180d259ad9758b7ca",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 118,
"avg_line_length": 41.21686746987952,
"alnum_prop": 0.6088862905583163,
"repo_name": "nathanIL/books",
"id": "632e34833ca4aff1ca3623b4148fb0241bd88e2a",
"size": "3421"... |
from neutron.api import extensions
from neutron.api.v2 import attributes
SERVICE_ROUTER = 'service_router'
EXTENDED_ATTRIBUTES_2_0 = {
'routers': {
SERVICE_ROUTER: {'allow_post': True, 'allow_put': False,
'convert_to': attributes.convert_to_boolean,
'defau... | {
"content_hash": "e9c9a9b8c491147649a3ca43fadb8bf5",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 70,
"avg_line_length": 25.595238095238095,
"alnum_prop": 0.6148837209302326,
"repo_name": "jumpstarter-io/neutron",
"id": "9033039b0d3548a7efda5dde325dadc229e9955e",
"size"... |
"""
Covariance estimators using shrinkage.
Shrinkage corresponds to regularising `cov` using a convex combination:
shrunk_cov = (1-shrinkage)*cov + shrinkage*structured_estimate.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Virgile ... | {
"content_hash": "3d589e3013184a801b3e4138bfec700e",
"timestamp": "",
"source": "github",
"line_count": 605,
"max_line_length": 79,
"avg_line_length": 33.839669421487606,
"alnum_prop": 0.605871147364822,
"repo_name": "ndingwall/scikit-learn",
"id": "1949d67de11abac66c3d72b3e6e2d893dec7ad45",
"size"... |
from .direction import (RightDirection, LeftDirection,
DownDirection, UpDirection)
from .selector import SelectorFactory
class ObjectFactory(object):
def __new__(klass, direction_expr, expression, wnck_wrapper):
count = 1
if 'count' in expression:
count = int(''... | {
"content_hash": "461ef34acda2e64b97447b04aabc1596",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 75,
"avg_line_length": 32.357142857142854,
"alnum_prop": 0.5717439293598234,
"repo_name": "bitptr/wim",
"id": "907d5e442e7aaa76615abdddd7cb16bca5c58e04",
"size": "906",
"... |
import tensorflow as tf
from convolutional import Convolutional
from tensorflow.examples.tutorials.mnist import input_data
'''
Main file for running of single digit recognition models
'''
def get_batch(dataset, inputs_placeholder, labels_placeholder):
inputs, labels = dataset.next_batch(50)
return {inputs_pla... | {
"content_hash": "0e9a61e9354a2b416072d6dbde8783f3",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 119,
"avg_line_length": 40.12328767123287,
"alnum_prop": 0.6432229429839535,
"repo_name": "thePetrMarek/SequenceOfDigitsRecognition",
"id": "71c3e42ad6620f25d9bf32ea269e15e45... |
from google.cloud import tasks_v2beta3
def sample_create_queue():
# Create a client
client = tasks_v2beta3.CloudTasksClient()
# Initialize request argument(s)
request = tasks_v2beta3.CreateQueueRequest(
parent="parent_value",
)
# Make the request
response = client.create_queue(re... | {
"content_hash": "801db09b2ebaa2f802e1e7da2d69d32d",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 64,
"avg_line_length": 23.57894736842105,
"alnum_prop": 0.7075892857142857,
"repo_name": "googleapis/python-tasks",
"id": "4a9e92b789a2255f35b0e7570ee6483eb53aeee7",
"size"... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('crowdsourcing', '0154_stripecustomer_available_balance'),
('crowdsourcing', '0152_taskworker_started_at'),
]
operations = [
]
| {
"content_hash": "9f6a0ce6f15957c3ac9cf462b4427a98",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 67,
"avg_line_length": 21,
"alnum_prop": 0.6700680272108843,
"repo_name": "shirishgoyal/crowdsource-platform",
"id": "2aab0c46ab8bcc3403bb3a18146b790b623195d2",
"size": "36... |
import httplib
import json
from google.appengine.ext import webapp
from model import client as client_db
from model import product as product_db
class ProductHandler(webapp.RequestHandler):
"""A class to handle creating, reading, updating and deleting products.
Handles GET, POST and DELETE requests for /products... | {
"content_hash": "9ae056bbb9a30dcc9082c6f9a573f8d4",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 80,
"avg_line_length": 29.123809523809523,
"alnum_prop": 0.6641595814257685,
"repo_name": "ericmckean/syzygy",
"id": "6bab4d66e90314981f95eb4c5003d98f8391bfb1",
"size": "3... |
"""All views for the extension."""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.views.generic import CreateView, FormView, TemplateView
from django.shortcuts import redirect
from django.db.models import BooleanField, Q, Case, When
from django... | {
"content_hash": "072b5c939f98f1f03721fe774b3f9d50",
"timestamp": "",
"source": "github",
"line_count": 607,
"max_line_length": 79,
"avg_line_length": 29.823723228995057,
"alnum_prop": 0.5449373032094128,
"repo_name": "ExCiteS/geokey-webresources",
"id": "2fc1ba7bc771a1019a21c7b59786046c17d69deb",
... |
from __future__ import absolute_import
from django.conf import settings
from django.utils.html import escape
from django.utils.translation import ugettext as _
from sentry.utils.imports import import_string
def get_interface(name):
try:
import_path = settings.SENTRY_INTERFACES[name]
except KeyError:... | {
"content_hash": "3b963e0d023de2cbad69de653be313d7",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 78,
"avg_line_length": 25.394957983193276,
"alnum_prop": 0.5771012574454004,
"repo_name": "nicholasserra/sentry",
"id": "972e8bfa0985f1ebdf5fadef9ffba1f47188ce81",
"size":... |
"""Home of estimator related functions.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from tensorflow.python.client import session
from tensorflow.python.estimator import estimator as estimator_lib
from tensorflow.python.estimator import exp... | {
"content_hash": "ff602e4a0eb7e2677a0037d83dd56693",
"timestamp": "",
"source": "github",
"line_count": 290,
"max_line_length": 85,
"avg_line_length": 36.03103448275862,
"alnum_prop": 0.6727916547037994,
"repo_name": "zasdfgbnm/tensorflow",
"id": "db0140c2df4d20f9e18e6c1401c6c6aa197bcf1f",
"size": ... |
from distutils.core import setup
setup(
name = "Kamaelia.Community.RJL",
version = "0.1.0",
description = "Kamaelia - Multimedia & Server Development Kit",
author = "Ryan Lothian",
author_email = "celestialryan@users.sourceforge.net",
url = "http://kamaelia.sourceforge.net/",
packages = [
... | {
"content_hash": "3d0d36a48f962b89714092c4cc8e67e7",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 67,
"avg_line_length": 34.84,
"alnum_prop": 0.6463834672789897,
"repo_name": "bbc/kamaelia",
"id": "069fb21187c076759a0b17309efda88bab9cf075",
"size": "1777",
"binary": f... |
from unittest import TestCase
from mock import MagicMock
import bouncebox.core.component as bc
import bouncebox.core.event as be
import bouncebox.util.testing as testing
class TestPublishing(TestCase):
def setUp(self):
pass
def test_subscribe_event_none(self):
c1 = bc.Component()
c2... | {
"content_hash": "46239614f1c5d66ef67550732325ecd8",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 85,
"avg_line_length": 28.951612903225808,
"alnum_prop": 0.5949860724233983,
"repo_name": "dalejung/bouncebox",
"id": "e7f199c0684a4a1e25dd8644553faa758d1389bc",
"size": "1... |
from .config import * # NOQA
from .runtime import * # NOQA
| {
"content_hash": "b8b7bb146fbb4ae15372350ce706ae6c",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 30,
"avg_line_length": 30.5,
"alnum_prop": 0.6721311475409836,
"repo_name": "vicalloy/django-lb-workflow",
"id": "4fc274e1969c121078aeb29d16c9ba9068b77626",
"size": "61",
... |
from __future__ import absolute_import, division, print_function, unicode_literals
import time
from ..mode import Mode
from ...sprites.text import Text
from ...sprites.rectangle_sprite import RectangleSprite
class TitlePage(Mode):
"""Transition to a "real" mode"""
STATES = list(range(100))
SHOW_TIME = 1... | {
"content_hash": "e00ecf369d5bfc299d9060f23418c502",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 107,
"avg_line_length": 32.214285714285715,
"alnum_prop": 0.6223207686622321,
"repo_name": "Spooner/pixel-table",
"id": "cb5a39d7283dd380a6ac20e1787abd115c0332f5",
"size": ... |
from __future__ import unicode_literals
# Authentication and Authorisation
from functools import wraps
from . import http
def permit(test_func):
'''Decorate a handler to control access'''
def decorator(view_func):
@wraps(view_func)
def _wrapped_view(self, *args, **kwargs):
if test... | {
"content_hash": "b3ec97d6958326d8a32da67f8d5ef3e0",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 70,
"avg_line_length": 27.545454545454547,
"alnum_prop": 0.6457645764576457,
"repo_name": "MarkusH/django-nap",
"id": "d5894cad22d64a70def2bfe8f38b883f5e8f4fb4",
"size": "9... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "geography.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "78be681a6e1676b0ca9615ab84eb46a3",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 73,
"avg_line_length": 25.555555555555557,
"alnum_prop": 0.7130434782608696,
"repo_name": "adaptive-learning/geography",
"id": "b22cda9b173b50628c28b2e0b1d268d6f159807a",
"s... |
from nipype.testing import assert_equal
from nipype.interfaces.fsl.maths import Threshold
def test_Threshold_inputs():
input_map = dict(args=dict(argstr='%s',
),
direction=dict(usedefault=True,
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usede... | {
"content_hash": "b0f65f604537647c2ddf3a6a154e55ae",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 78,
"avg_line_length": 24.661016949152543,
"alnum_prop": 0.6178694158075602,
"repo_name": "mick-d/nipype_source",
"id": "78633dd9027eed542ae432deb40e4b7324f48587",
"size": ... |
import argparse, json, os, sys, time
import base64
import copy
import gc
import subprocess
import hashlib
import pydeep
import magic
import pefile
import rethinkdb as r
from utils import red, blue
# Testing
from fv_fileoutput import file_compare
def _dump_data(name, data):
try:
with open(name, 'wb') as... | {
"content_hash": "87ef81adcf596c4e8bbfeb3b9492310b",
"timestamp": "",
"source": "github",
"line_count": 425,
"max_line_length": 154,
"avg_line_length": 44.99764705882353,
"alnum_prop": 0.5440284459318134,
"repo_name": "theopolis/subzero",
"id": "9f358aff221cff228ce89bfe43ff52ebbf46ddf8",
"size": "1... |
from conans.model.conan_file import ConanFile
from conans import CMake
import os
class DefaultNameConan(ConanFile):
name = "DefaultName"
version = "0.1"
settings = "os", "compiler", "arch", "build_type"
generators = "cmake"
requires = "sfml/2015.8.12@TyRoXx/develop"
def build(self):
cm... | {
"content_hash": "cdcb646aa46520b49f56df779832bb59",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 59,
"avg_line_length": 29.61111111111111,
"alnum_prop": 0.626641651031895,
"repo_name": "TyRoXx/conan-sfml",
"id": "46566557c22524b57f17298532958b09fca43eb8",
"size": "533"... |
"""Module for handling IO in SALT software.
All calls to IO functions should go through this module.
**Note** this is a replacement for the `saltio` module.
"""
import os, glob, shutil, re, tempfile
from time import strftime
import smtplib
from email.mime.text import MIMEText
from astropy.io import fits
import nu... | {
"content_hash": "50b16a9104b781a83a27ceefab2ce16c",
"timestamp": "",
"source": "github",
"line_count": 742,
"max_line_length": 107,
"avg_line_length": 27.580862533692724,
"alnum_prop": 0.5942340581480576,
"repo_name": "crawfordsm/pysalt",
"id": "f5f476b2f4a1a775ffb739a5b6e883a7193c61a4",
"size": "... |
import os
import time
import numpy as np
from multiprocessing import Process
from retino.axon import Axon
from retino.plot import plot_axon
def produce_axon_growth_demo(id, target, iterations_count):
t = time.time()
axon = Axon(None, id=id, target=target)
for i in range(iterations_count):
axon.g... | {
"content_hash": "4e5fd0c92884da2a604ac15e0f8cc304",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 104,
"avg_line_length": 33.266666666666666,
"alnum_prop": 0.6192384769539078,
"repo_name": "calben/retino",
"id": "b65a184de89668387c16bb88c4c231ca50ff5b41",
"size": "998",... |
"""
flask_security.passwordless
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Flask-Security passwordless module
:copyright: (c) 2012 by Matt Wright.
:license: MIT, see LICENSE for more details.
"""
from flask import current_app as app
from werkzeug.local import LocalProxy
from .signals import login_instructions_... | {
"content_hash": "42024d3f9ba0bdf1440f33ed50cc0b4e",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 78,
"avg_line_length": 29.472727272727273,
"alnum_prop": 0.6767427513880321,
"repo_name": "williamfeng323/py-web",
"id": "fef70ad7bd2ae6549cb17d07f4842b3c48981b4f",
"size":... |
from django.test import TestCase, Client, RequestFactory
from django.contrib.auth.models import User
from imager_profile.models import ImagerProfile
from imager_profile.views import ProfileView, HomeView
import factory
class UserFactory(factory.django.DjangoModelFactory):
"""Generate test users."""
class Met... | {
"content_hash": "a8a20202742a92fce33f927acb0af6c2",
"timestamp": "",
"source": "github",
"line_count": 219,
"max_line_length": 80,
"avg_line_length": 36,
"alnum_prop": 0.6220192795535261,
"repo_name": "JSchatzman/django-imager",
"id": "06dc42c947d153d3fee928a1a213275b681af106",
"size": "7884",
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.