text stringlengths 4 1.02M | meta dict |
|---|---|
import unittest
from lib import cloudshell
from lib.TeraSortBenchmark import TeraSortBenchmark
class CloudStone8(TeraSortBenchmark):
"Tests variable length input keys and values"
keymin = 10
keymax = 50
valmin = 100
valmax = 500
rows = 1000000
tablename = 'VariableLengthIngestTable'
... | {
"content_hash": "6898f833ff8c3dd48e14a9d116835080",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 81,
"avg_line_length": 26.520833333333332,
"alnum_prop": 0.5420267085624509,
"repo_name": "wjsl/jaredcumulo",
"id": "a02a0a1cae00605668e4e25772efe7d1b42d9477",
"size": "205... |
from rpython.rlib import jit
import interpret
import parse
import kernel_type as kt
def entry_point(argv):
jit.set_param(None, "trace_limit", 20000)
interpret.run(argv)
return 0
def target(driver, args):
return entry_point, None
| {
"content_hash": "3090afe2a4a23d1cde7b9dc7c6cba417",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 45,
"avg_line_length": 19.076923076923077,
"alnum_prop": 0.7217741935483871,
"repo_name": "euccastro/icbink",
"id": "27704364c3a1239bddfb8f932f0a3115bfd78abd",
"size": "248... |
import random
def generate_random_stream(length):
"""Generate a random stream of booleans.
:param length: the stream length
:type length: int
:returns: iterator
"""
for _ in range(length):
yield bool(random.randint(0, 1))
| {
"content_hash": "add604e053b7e9e54468d5296d1cb6f1",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 44,
"avg_line_length": 23.272727272727273,
"alnum_prop": 0.6484375,
"repo_name": "simondolle/dgim",
"id": "8fd14996562b370eb08eb708ca056fc1ef8ca2ee",
"size": "256",
"bina... |
"""
Test the content negotiation pieces.
Content negotiation will put something in
the environment that allows us to determine
what kind of store and serializer to use.
"""
from tiddlyweb.web.negotiate import figure_type
from tiddlyweb.config import config
def setup_module(module):
module.environ = {'tiddlyweb.... | {
"content_hash": "708fb1c8e16561956651398de6176acd",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 97,
"avg_line_length": 27.987654320987655,
"alnum_prop": 0.6409351565946184,
"repo_name": "funkyeah/tiddlyweb",
"id": "254044f40d39a886a55f1408faba7485813468e9",
"size": "2... |
"""
RdmaConfig - file ``/etc/rdma/rdma.conf``
=========================================
"""
from .. import get_active_lines, Parser, parser, LegacyItemAccess
from insights.parsers import split_kv_pairs
from insights.specs import Specs
from insights.parsers import SkipException
@parser(Specs.rdma_conf)
class RdmaConfi... | {
"content_hash": "355ea763f8adb490c2b0b4c12452ad21",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 84,
"avg_line_length": 33.328125,
"alnum_prop": 0.6310360993905297,
"repo_name": "RedHatInsights/insights-core",
"id": "dd57bc58439212bf22bb4a8217be43b1f4235ecf",
"size": "... |
from .aws import Action as BaseAction
from .aws import BaseARN
service_name = "Amazon Lookout for Vision"
prefix = "lookoutvision"
class Action(BaseAction):
def __init__(self, action: str = None) -> None:
super().__init__(prefix, action)
class ARN(BaseARN):
def __init__(self, resource: str = "", re... | {
"content_hash": "bdd4734ab85fa5abe11147744e1b98a0",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 88,
"avg_line_length": 36.27272727272727,
"alnum_prop": 0.7600250626566416,
"repo_name": "cloudtools/awacs",
"id": "c85892f5f54cba86f7cf5c9d6019cc957818a69a",
"size": "1712... |
from __future__ import print_function
import argparse
import subprocess
import json
import os
import requests
import subprocess
import sys
from cli.settings import Settings
from cli.appconfig import AppConfig
from cli.containerconfig import ContainerConfig
from cli.utils import printException, printErrorMsg
requests.pa... | {
"content_hash": "cb37fa0cb64fc34da57e99b09b262b1a",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 130,
"avg_line_length": 43.414414414414416,
"alnum_prop": 0.5922390537455904,
"repo_name": "seomoz/roger-mesos-tools",
"id": "7dfe9f52c86b6dccdd072dae9c7a76aeed0b749f",
"s... |
"""Datastore models used by the Google App Engine Pipeline API."""
from google.appengine.ext import db
from google.appengine.ext import blobstore
# Relative imports
import json
class _PipelineRecord(db.Model):
"""Represents a Pipeline.
Properties:
class_path: Path of the Python class to use for this pipeli... | {
"content_hash": "f80b81ab26d08213a5c9e0322e157086",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 78,
"avg_line_length": 32.323076923076925,
"alnum_prop": 0.6945898778359512,
"repo_name": "rhefner1/ghidonations",
"id": "c08dfd5ab89d73a28796827081f19a3f6b0925da",
"size"... |
from .decorators import use_template_database
from .testcases import TemplateDBTestCase
from .testcases import TemplateDBTransactionTestCase
from .testcases import TemplateDBLiveServerTestCase
| {
"content_hash": "3c8616b334345b1947def815f61d1bc8",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 52,
"avg_line_length": 48.5,
"alnum_prop": 0.8814432989690721,
"repo_name": "wilbuick/django-ttdb",
"id": "ad7c355ef7c43e9b988d7740be77dc6e86cd9b0b",
"size": "194",
"binar... |
"""
Set up core extensions
"""
from .control import Control
def setup(bot):
"""Add core cogs to bot.
"""
bot.add_cog(Control(bot))
| {
"content_hash": "4704416093906b02daac8203d474f28b",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 29,
"avg_line_length": 13.272727272727273,
"alnum_prop": 0.6095890410958904,
"repo_name": "randomic/antinub-gregbot",
"id": "2ab611f167259c048069c86691f108b3a4cfdfc0",
"siz... |
try:
from django.conf.urls import patterns, url
except ImportError: # django < 1.4
from django.conf.urls.defaults import patterns, url
urlpatterns = patterns("django_su.views",
url(r"^$", "su_exit", name="su_exit"),
url(r"^login/$", "su_login", name="su_login"),
url(r"^(?P<user_id>[\d]+)/$", "log... | {
"content_hash": "8446c4c67748c01d9c89ea7e137a65cd",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 73,
"avg_line_length": 32.54545454545455,
"alnum_prop": 0.6229050279329609,
"repo_name": "Stackdriver/django-su",
"id": "7d3a69a645d4c8e1154eedfee97955222fcba4eb",
"size": ... |
import re
from bakery_lint.base import BakeryTestCase as TestCase
from bakery_lint.metadata import Metadata
class CheckFontNameNotInCamelCase(TestCase):
path = '.'
targets = ['metadata']
name = __name__
tool = 'lint'
longMessage = True
def read_metadata_contents(self):
return open(s... | {
"content_hash": "6bc63e1602f00d75602598adc17a90fd",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 76,
"avg_line_length": 31.1,
"alnum_prop": 0.6302250803858521,
"repo_name": "lowks/fontbakery-cli",
"id": "ac7899eb67963d7e7706cee38527918cd13e6ba1",
"size": "1635",
"bin... |
"""Tests for config/script."""
from unittest.mock import patch
from homeassistant.bootstrap import async_setup_component
from homeassistant.components import config
async def test_delete_script(hass, hass_client):
"""Test deleting a script."""
with patch.object(config, 'SECTIONS', ['script']):
await ... | {
"content_hash": "59b2bc0e83dc9e841469fab1524d4594",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 72,
"avg_line_length": 25.536585365853657,
"alnum_prop": 0.6074498567335244,
"repo_name": "aequitas/home-assistant",
"id": "d0848d18dcc7d81ce12b1ce755ed02a9a808475b",
"size... |
import os
import glob
import string
sourcepath = '\src'
distpath = '\dist'
sourcelist = []
for root, dirs, files in os.walk(sourcepath):
for name in files:
pathfile = os.path.join(root, name)
#ignore python extensions
pathfile = string.replace(pathfile, '.pyo', '')
p... | {
"content_hash": "b98dfefeaffecbf3d9f2953028eb554b",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 60,
"avg_line_length": 27.046511627906977,
"alnum_prop": 0.6010318142734308,
"repo_name": "lantra/vugamedev",
"id": "81eefbfa653d4d3321eff5b6e883a6ef194c4dcd",
"size": "151... |
from __future__ import absolute_import
from sentry.api.serializers import OrganizationMemberWithProjectsSerializer, serialize
from sentry.testutils import TestCase
class OrganizationMemberWithProjectsSerializerTest(TestCase):
def setUp(self):
self.owner_user = self.create_user("foo@localhost", username="... | {
"content_hash": "8fd7c845b1add5bf3a41a04d5549f405",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 99,
"avg_line_length": 42.666666666666664,
"alnum_prop": 0.6428571428571429,
"repo_name": "mvaled/sentry",
"id": "1787acddd560e8b8294227c25a2a21a99d898382",
"size": "1817",... |
import traceback
from oslo.config import cfg
import taskflow.engines
from taskflow.patterns import linear_flow
from taskflow.utils import misc
from cinder import exception
from cinder import flow_utils
from cinder.image import glance
from cinder.openstack.common.gettextutils import _
from cinder.openstack.common impo... | {
"content_hash": "f17d69bb2752e816f6f9c6384e71dd53",
"timestamp": "",
"source": "github",
"line_count": 696,
"max_line_length": 79,
"avg_line_length": 45.668103448275865,
"alnum_prop": 0.5634104137171622,
"repo_name": "github-borat/cinder",
"id": "0e361b51a0752f87c35c949c938d3ee1a0970188",
"size": ... |
import collections
from collections import OrderedDict
from operator import index as operator_index
import numpy as np
class Row:
"""A class to represent one row of a Table object.
A Row object is returned when a Table object is indexed with an integer
or when iterating over a table::
>>> from as... | {
"content_hash": "163f841f07fe5fdb119439efe75f1ee1",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 91,
"avg_line_length": 33.49238578680203,
"alnum_prop": 0.5678993634434677,
"repo_name": "aleksandr-bakanov/astropy",
"id": "931754510cacab30a8e25b594fd8362fac009b83",
"si... |
from paddle.fluid import layers
from paddle.fluid.dygraph import Layer
from paddle.fluid.layers.control_flow import StaticRNN
__all__ = ['BasicGRUUnit', 'basic_gru', 'BasicLSTMUnit', 'basic_lstm']
class BasicGRUUnit(Layer):
"""
****
BasicGRUUnit class, using basic operators to build GRU
The algorithm... | {
"content_hash": "7efa5c97355dffb1c4628a464de6d375",
"timestamp": "",
"source": "github",
"line_count": 729,
"max_line_length": 118,
"avg_line_length": 41.611796982167355,
"alnum_prop": 0.5549695071699358,
"repo_name": "tensor-tang/Paddle",
"id": "e6a868ada37ab9fb27f973b4bfe648387bb4279f",
"size": ... |
import os, sys
from lxml import etree
def parse_properties(fb):
doc = fb["doc"]
properties = []
for p in doc.xpath("/filebase/properties/property"):
properties.append({"id": int(p.attrib["id"]), "name": p.find("name").text})
# Check if property id's are sequential
for i in range(len(properties)):
if prope... | {
"content_hash": "564ef4ad170c79559fa6dc9185b27d2f",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 82,
"avg_line_length": 26.01923076923077,
"alnum_prop": 0.6385809312638581,
"repo_name": "X54329/filebase-qt4",
"id": "d5e54f3d40339eaa957c833474eeccb00baefe15",
"size": "2... |
from flask import jsonify
from server import app
from server.database import *
# MARK: List routes
@app.route('/api/lists', methods=['GET'])
def get_lists():
response = {}
response['lists'] = [l.__dict__ for l in db_get_lists()]
return jsonify(response)
| {
"content_hash": "61b782588b86f2a5b38ab63c4ed96707",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 60,
"avg_line_length": 24.363636363636363,
"alnum_prop": 0.667910447761194,
"repo_name": "FroeMic/CDTM-Backend-Workshop-WT2016",
"id": "67b4f1d22bf791ecd60577c110d87d053e95e4... |
class mergeable_dict(dict):
"""dict with merge() method."""
def is_compatible_with(self, other):
for key in self:
if key in other and self[key] != other[key]:
return False
return True
def merge(self, other):
for key in other:
if key in self:
... | {
"content_hash": "a3723cf5dd5f2f3f42b83ce9c9224d9f",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 56,
"avg_line_length": 27.666666666666668,
"alnum_prop": 0.4807228915662651,
"repo_name": "ActiveState/code",
"id": "542334455c1df10f2668fd39f74f65ee13158fc2",
"size": "900... |
from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter
class Command(BaseXpressDemocracyClubCsvImporter):
council_id = 'E08000034'
addresses_name = 'parl.2017-06-08/Version 1/Democracy_Club__08June2017 5.tsv'
stations_name = 'parl.2017-06-08/Version 1/Democracy_Club__08June2017 ... | {
"content_hash": "dc6457f47971a8091b57c0de580c00a2",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 82,
"avg_line_length": 48.5,
"alnum_prop": 0.7551546391752577,
"repo_name": "chris48s/UK-Polling-Stations",
"id": "036863177ee073e3e81f865b8618e91f2810d46f",
"size": "388",
... |
""" Operating System formatter """
from operator import attrgetter
from aquilon.aqdb.model import OperatingSystem
from aquilon.worker.formats.formatters import ObjectFormatter
class OSFormatter(ObjectFormatter):
def format_raw(self, os, indent="", embedded=True, indirect_attrs=True):
details = []
... | {
"content_hash": "5b21cf9f98b77ad9095156df6cf8538f",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 92,
"avg_line_length": 41.31428571428572,
"alnum_prop": 0.656984785615491,
"repo_name": "guillaume-philippon/aquilon",
"id": "b7082a597ca8a61a360fec62c274d43d6eac3b38",
"si... |
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": "fc192326ba422d4f1f431812229008e5",
"timestamp": "",
"source": "github",
"line_count": 272,
"max_line_length": 95,
"avg_line_length": 32.393382352941174,
"alnum_prop": 0.7029849052320962,
"repo_name": "nephomaniac/nephoria",
"id": "a888bc5c233282402bac197a1c1610df34825f00",
"size":... |
"""Internal resolver for persistent identifiers."""
from __future__ import absolute_import, print_function
from sqlalchemy.orm.exc import NoResultFound
from .errors import (
PIDDeletedError,
PIDMissingObjectError,
PIDRedirectedError,
PIDUnregistered,
)
from .models import PersistentIdentifier
class... | {
"content_hash": "00b7af277081b174536679b2578fc323",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 80,
"avg_line_length": 31.55223880597015,
"alnum_prop": 0.6315042573320719,
"repo_name": "inveniosoftware/invenio-pidstore",
"id": "5fb28aebea1e81862346b0ec2a2444d6557e5256",... |
from gireoan.Analyser import Analyser
from gireoan.Errors import NoSettingsFileException
try:
import local_settings
except:
raise (NoSettingsFileException())
# Start main
if __name__ == '__main__':
repo_analyser = Analyser(
repo_name=local_settings.REPOSITORY_PATH,
searching_paths=local_s... | {
"content_hash": "ac2fdd9c66af4ab28b7d2c3cdda1e653",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 56,
"avg_line_length": 28.59090909090909,
"alnum_prop": 0.7170111287758346,
"repo_name": "saeschdivara/GitRepoAnalyser",
"id": "967d7e75ef2dd4970ec13ba3d39538b67d980fdc",
"... |
import github3
import requests
import urllib
import urlparse
from flask import session
import ob2.config as config
from ob2.util.security import generate_shitty_random_string
github_oauth_url = "https://github.com/login/oauth"
access_token_url = github_oauth_url + "/access_token"
authorize_url = github_oauth_url + "/... | {
"content_hash": "e7c565c208f6276a6457c28674bf077a",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 96,
"avg_line_length": 30.905405405405407,
"alnum_prop": 0.6891123742894621,
"repo_name": "octobear2/ob2",
"id": "e1340faec3f7bd02035e532627c4d6da9e776104",
"size": "2287",... |
from InstagramAPI.src.http.Response.Objects.Comment import Comment
from .Response import Response
class CommentResponse(Response):
def __init__(self, response):
self.comment = None
if self.STATUS_OK == response['status']:
if 'comment' in response and response['comment']:
... | {
"content_hash": "50336dc4519e891bd8dc6594617e1548",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 66,
"avg_line_length": 29.444444444444443,
"alnum_prop": 0.6396226415094339,
"repo_name": "danleyb2/Instagram-API",
"id": "3a038d24848202f652a348a5e4b5f0e48024f806",
"size"... |
from functools import partial
from random import randint
from emmett import App, request
from emmett.orm import Database, Model, Field, rowmethod
from emmett.tools import service
app = App(__name__)
class World(Model):
tablename = "world"
randomnumber = Field.int()
@rowmethod('serialize')
def _seri... | {
"content_hash": "0cdef7f5be79c3cd51bf00fcd95256c6",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 79,
"avg_line_length": 23.24,
"alnum_prop": 0.6579173838209983,
"repo_name": "greenlaw110/FrameworkBenchmarks",
"id": "4544f1a7db915feaf8d035844c36247777b86c1e",
"size": "... |
import hashlib
from pathlib import PurePath
from .base import Mangler
class HashMangler(Mangler):
def __init__(self, target, hash_name='md5', suffixes=None):
super().__init__(target)
self.hash_name = hash_name
self.suffixes = suffixes or ['.css', '.js']
def can_process(self, file_ob... | {
"content_hash": "b6795eef289c1dcfbcf026386ffd565a",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 71,
"avg_line_length": 30.310344827586206,
"alnum_prop": 0.6359499431171786,
"repo_name": "funkybob/django-mangle",
"id": "bfbc2664fa5bb7c4a60d5af5face087a61470769",
"size"... |
"""
Information, resources and vulnerabilities database API.
"""
__license__ = """
GoLismero 2.0 - The web knife - Copyright (C) 2011-2014
Golismero project site: https://github.com/golismero
Golismero project mail: contact@golismero-project.com
This program is free software; you can redistribute it and/or
modify it... | {
"content_hash": "5eca27e6a5e4060e4eb45912ddb76db5",
"timestamp": "",
"source": "github",
"line_count": 288,
"max_line_length": 79,
"avg_line_length": 30.90972222222222,
"alnum_prop": 0.5206695124691081,
"repo_name": "JeyZeta/Dangerous",
"id": "165d1c9363c82bb5e38b8b8a55bb04cf8a9a6c5e",
"size": "89... |
from __future__ import unicode_literals
# TODO add tests for all of these
EQ_FUNCTION = lambda item_value, test_value: item_value == test_value
NE_FUNCTION = lambda item_value, test_value: item_value != test_value
LE_FUNCTION = lambda item_value, test_value: item_value <= test_value
LT_FUNCTION = lambda item_value, te... | {
"content_hash": "d8f4ee11fafb18a1494595e9cd6e0211",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 121,
"avg_line_length": 34.853658536585364,
"alnum_prop": 0.6773967809657103,
"repo_name": "pior/moto",
"id": "808e120bc6a85b71b349337f355a487a3d7583eb",
"size": "1429",
... |
from annoying.functions import get_object_or_None
from django.contrib.auth.decorators import login_required
from django.shortcuts import get_object_or_404, redirect
from django.template import RequestContext
from django.template.response import TemplateResponse
from pixelpuncher.game.utils.message import add_game_mess... | {
"content_hash": "5d89fc8637e15c46fcd314c8d2b52976",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 100,
"avg_line_length": 34.13846153846154,
"alnum_prop": 0.7273546642631816,
"repo_name": "ej2/pixelpuncher",
"id": "389b08efe01c05aedbe1790d5399685b98c81441",
"size": "221... |
"""The SleuthKit (TSK) format analyzer helper implementation."""
from dfvfs.analyzer import analyzer
from dfvfs.analyzer import analyzer_helper
from dfvfs.analyzer import specification
from dfvfs.lib import definitions
class TSKAnalyzerHelper(analyzer_helper.AnalyzerHelper):
"""Class that implements the TSK analyz... | {
"content_hash": "0392236da6d25f7e0fe4e7bcd9240b68",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 76,
"avg_line_length": 31.105263157894736,
"alnum_prop": 0.7422447828539199,
"repo_name": "dc3-plaso/dfvfs",
"id": "b9a49928d61dfff59516092e05cb7df6a8f723fa",
"size": "1797... |
from time import time
import datetime
import os
import shutil
import webbrowser
import argparse
import ttk
from Tkinter import *
import Tkinter as tk
from tkFileDialog import askopenfilename
import tkMessageBox
import train_classifier
import predict_folders
from bookmark_db import database
from ml_add import add
from... | {
"content_hash": "1a31cdb2e535782db7406e843b070972",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 136,
"avg_line_length": 28.01063829787234,
"alnum_prop": 0.6779339156855299,
"repo_name": "alphawing/SmartBookmarks",
"id": "e4fd61fb0ff752d4e79d0c3a1dac4480797b0e39",
"si... |
"""
tipfyext.wtforms
~~~~~~~~~~~~~~~~~
Enhanced WTForms form library support for tipfy.
:copyright: 2011 WTForms authors.
:copyright: 2011 tipfy.org.
:copyright: 2009 Plurk Inc.
:license: BSD, see LICENSE.txt for more details.
"""
from tipfy import REQUIRED_VALUE
from tipfyext.wtforms impo... | {
"content_hash": "df403090377a3dd1eb27a23ece03755b",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 76,
"avg_line_length": 32.3,
"alnum_prop": 0.68343653250774,
"repo_name": "stanlee321/pysolper",
"id": "bd2be4481f8a4a10254cbf73d70f6b61dcdbcded",
"size": "1316",
"binary... |
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from irma.common.utils import sql
import config.parser as config
engine = create_engine(config.sqldb.url, echo=config.sql_debug_enabled(),
connect_args={"sslmode": config.sqldb.sslmode,
... | {
"content_hash": "8c1d7154381a2834efae5f8a547a83e4",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 77,
"avg_line_length": 35.31818181818182,
"alnum_prop": 0.6036036036036037,
"repo_name": "quarkslab/irma",
"id": "9f2dece37e7b440c1e86a6e235be4a6a1d824218",
"size": "1302",... |
from django import forms
from django.http import HttpResponseRedirect
from django.shortcuts import render
def search(request):
return render(request, "search/search.html")
| {
"content_hash": "81b7bbec76a95bd18f7889680dbb0ca2",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 48,
"avg_line_length": 25.428571428571427,
"alnum_prop": 0.8033707865168539,
"repo_name": "burk/helgapp",
"id": "1f0abfd0144c0b0f9c88b107eda11518df897189",
"size": "178",
... |
from __future__ import absolute_import
from __future__ import unicode_literals
import sys
from datetime import timedelta
import # broken
import a
import b
import foo # broken
import z
from
from a import C1
from alphabet import *
from alphabet import B, A
from alphabet import C
from alphabet import D
from b import fun... | {
"content_hash": "dc83026751418577093050f31c7d8c47",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 82,
"avg_line_length": 19.28,
"alnum_prop": 0.7302904564315352,
"repo_name": "hurricup/intellij-community",
"id": "b06b7ad267a8a2d0964fadd5bf38e24767530a74",
"size": "482",... |
from openpyxl.compat import zip
from openpyxl.workbook import Workbook
from openpyxl.worksheet import Worksheet
from openpyxl.writer.comments import CommentWriter
from openpyxl.comments import Comment
from openpyxl.tests.helper import compare_xml
from openpyxl.xml.functions import fromstring, get_document_content
from ... | {
"content_hash": "2b3d5aa9db8d83432a707b38d8b88a40",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 88,
"avg_line_length": 44.65686274509804,
"alnum_prop": 0.6265642151481888,
"repo_name": "Hitachi-Data-Systems/org-chart-builder",
"id": "cb1b1ea611c38a4c099cb033d988cacb2ce... |
import math
def oblicalc(target_angle, angle_of_fall, inclination, rotation=90):
"""Return the oblicuity angle of a shell hitting a ship's armour plate.
All measurement conventions have been kept from Nathan Okun's OBLICALC.EXE program. Pitch and roll
are not considered, as they don't apply in the Naval War Colleg... | {
"content_hash": "dda1d9488a07c23c1109572bd51d56ca",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 104,
"avg_line_length": 44.92307692307692,
"alnum_prop": 0.7442922374429224,
"repo_name": "doolanshire/Combat-Models",
"id": "cc9376d76f305005f6343794b63cdc9031a811aa",
"si... |
"""Tests for tensorflow.python.training.saver.py."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import glob
import math
import os
import random
import time
import numpy as np
import six
from google.protobuf.any_pb2 import Any
from tensorflow.core.fr... | {
"content_hash": "738cd8d5753cf0cb316bb2889f1a2af0",
"timestamp": "",
"source": "github",
"line_count": 3198,
"max_line_length": 80,
"avg_line_length": 42.53908692933083,
"alnum_prop": 0.6442663922375772,
"repo_name": "frreiss/tensorflow-fred",
"id": "fcd0a99734e7ac98c572a45e4c187c69831ed5ca",
"siz... |
from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:5384")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60)
| {
"content_hash": "aba5cad529e9262b26bae947fc5dcfb2",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 46,
"avg_line_length": 39.5,
"alnum_prop": 0.759493670886076,
"repo_name": "CryptiumCoin/Cryptium",
"id": "19c3e81f9a791159c0b68bcdae49a573442b50f9",
"size": "158",
"binar... |
"""
:class:`DisplayData`, its classes, interfaces and methods.
The classes in this module allow users and transform developers to define
static display data to be displayed when a pipeline runs.
:class:`~apache_beam.transforms.ptransform.PTransform` s,
:class:`~apache_beam.transforms.core.DoFn` s
and other pipeline co... | {
"content_hash": "48ff293070bd32a0dbbeaffa440983c8",
"timestamp": "",
"source": "github",
"line_count": 327,
"max_line_length": 80,
"avg_line_length": 32.993883792048926,
"alnum_prop": 0.646955232180925,
"repo_name": "charlesccychen/beam",
"id": "614c9a97e291f7c92689ffc16b1787b301e96f8c",
"size": "... |
from __future__ import absolute_import
# Whether to use threads for concordance searches or not.
# (This is an experimental feature.)
from django.conf import settings
if settings.IM_IN_TEST_MODE:
THREADED_SEARCH = False
else:
THREADED_SEARCH = True
import datetime
import re
import time
import copy
from ite... | {
"content_hash": "dd85a81468850bc519587c11699886ab",
"timestamp": "",
"source": "github",
"line_count": 1093,
"max_line_length": 147,
"avg_line_length": 41.68161024702653,
"alnum_prop": 0.4877518767285658,
"repo_name": "kiwiheretic/logos-v2",
"id": "55c9780d325c10f89134bea09b0f560b5b38e53d",
"size"... |
__version__ = '0.2.1'
from .events import Events, EventsException
__all__ = [
Events.__name__,
EventsException.__name__,
]
| {
"content_hash": "52bc1540d9aaa1a81c338093dfbcf6fd",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 43,
"avg_line_length": 16.625,
"alnum_prop": 0.5939849624060151,
"repo_name": "Graghav/surabi",
"id": "1b095b230db6a9e72ebfb89a1d532927c1ef07d9",
"size": "158",
"binary": ... |
from time import sleep
from typing import Optional
from sqlalchemy import Column, Index, Integer, String
from sqlalchemy.exc import OperationalError
from sqlalchemy.orm import backref, foreign, relationship
from sqlalchemy.orm.session import make_transient
from airflow.compat.functools import cached_property
from air... | {
"content_hash": "ca46bb96d04d0456cf78fecf52329cc4",
"timestamp": "",
"source": "github",
"line_count": 243,
"max_line_length": 108,
"avg_line_length": 36.86008230452675,
"alnum_prop": 0.625544267053701,
"repo_name": "dhuang/incubator-airflow",
"id": "745f248fc4da02a7fcc934c6494a72024cba2cc4",
"siz... |
from __future__ import division, print_function, absolute_import, unicode_literals
from sphinx_explorer.util.commander import Commander
import platform
def test_python_mode():
commander = Commander(system="Linux", py2=False)
c = commander(["python", "/test path"])
if platform.system() == "Linux":
... | {
"content_hash": "d0e0afd33d643f4e24357a54aac411e2",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 82,
"avg_line_length": 24.38888888888889,
"alnum_prop": 0.6514806378132119,
"repo_name": "pashango2/sphinx-explorer",
"id": "35c437a9f86ce4078ffea4308e7f28401665397a",
"siz... |
"""This example downloads a criteria performance report with AWQL. To get report
fields, run get_report_fields.py.
Tags: ReportDefinitionService.mutate
Api: AdWordsOnly
"""
__author__ = 'api.kwinter@gmail.com (Kevin Winter)'
import os
import sys
sys.path.insert(0, os.path.join('..', '..', '..', '..', '..'))
# Impor... | {
"content_hash": "24ffd4f182c2f4f693c923604db729e7",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 80,
"avg_line_length": 30.181818181818183,
"alnum_prop": 0.6024096385542169,
"repo_name": "donspaulding/adspygoogle",
"id": "b3db42e1e503cb673444f9673d2c265a7ba4ec40",
"siz... |
"""Recipe module to ensure a checkout is consistent on a bot."""
from recipe_engine import recipe_api
from PB.go.chromium.org.luci.buildbucket.proto import common as common_pb2
class BotUpdateApi(recipe_api.RecipeApi):
def __init__(self, properties, deps_revision_overrides, fail_patch, *args,
**kw... | {
"content_hash": "1a8bfd622298c76c6c24d742c6024fda",
"timestamp": "",
"source": "github",
"line_count": 525,
"max_line_length": 81,
"avg_line_length": 42.99047619047619,
"alnum_prop": 0.6392556490917146,
"repo_name": "endlessm/chromium-browser",
"id": "670081584ebaa961db53532a50271b68c85ba75f",
"si... |
"""
Unit tests for the NLTK modules. These tests are intended to ensure
that source code changes don't accidentally introduce bugs.
For instructions, please see:
../../web/dev/local_testing.rst
https://github.com/nltk/nltk/blob/develop/web/dev/local_testing.rst
"""
| {
"content_hash": "0feeedd4b3a5ab7c758a9b571f1dc7e7",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 68,
"avg_line_length": 23.666666666666668,
"alnum_prop": 0.7183098591549296,
"repo_name": "MyRookie/SentimentAnalyse",
"id": "0ea0d4c26aed77f452007db8fa2aab6d473dee96",
"si... |
from asynctnt import Response
from asynctnt.exceptions import TarantoolSchemaError
from tests import BaseTarantoolTestCase
class UpsertTestCase(BaseTarantoolTestCase):
async def _fill_data(self):
data = [
[0, 'a', 1],
[1, 'b', 0],
]
for t in data:
await ... | {
"content_hash": "3d197ecdbbc31f4129d91927d3b3b8fe",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 79,
"avg_line_length": 35.19565217391305,
"alnum_prop": 0.5231624459542927,
"repo_name": "igorcoding/asynctnt",
"id": "e22641f62ea55f0b5a40ddd9be560f4bae74e3f3",
"size": "3... |
import argparse
import json
import os
import re
import urllib.request
_REPO_URL = 'https://repo.maven.apache.org/maven2'
_GROUP_NAME = 'org/jetbrains'
_MODULE_NAME = 'annotations'
_FILE_EXT = 'jar'
_OVERRIDE_LATEST = None
_PATCH_VERSION = 'cr1'
def do_latest():
if _OVERRIDE_LATEST is not None:
print(_OVE... | {
"content_hash": "681d413a27d5c6eb3387b92736316832",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 79,
"avg_line_length": 31.4,
"alnum_prop": 0.5937215650591446,
"repo_name": "chromium/chromium",
"id": "0ee9845162d458b1efa34e14e265dc8911e68370",
"size": "2465",
"binary... |
import sys
from neutronclient.neutron.v2_0.lb import member
from neutronclient.tests.unit import test_cli20
class CLITestV20LbMemberJSON(test_cli20.CLITestV20Base):
def setUp(self):
super(CLITestV20LbMemberJSON, self).setUp(plurals={'tags': 'tag'})
def test_create_member(self):
"""lb-member-... | {
"content_hash": "da006f7bf65c2af1c03dbc40aecd6ee8",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 77,
"avg_line_length": 40.47826086956522,
"alnum_prop": 0.5417830290010741,
"repo_name": "ralphwort/chef-repo",
"id": "b3f4cc87bb951370d1cb3f46794bc7f61ff72270",
"size": "... |
import pytest
import numpy as np
import pandas as pd
from pandas import Series, DataFrame, IntervalIndex, Interval
import pandas.util.testing as tm
class TestIntervalIndex(object):
def setup_method(self, method):
self.s = Series(np.arange(5), IntervalIndex.from_breaks(np.arange(6)))
# To be removed... | {
"content_hash": "fe4b0b2a16d9e10c43ab1c893ee04d0c",
"timestamp": "",
"source": "github",
"line_count": 267,
"max_line_length": 78,
"avg_line_length": 29.767790262172284,
"alnum_prop": 0.5546049320583795,
"repo_name": "pratapvardhan/pandas",
"id": "f2f59159032a26cd9da6629a771173eb4a47f109",
"size":... |
import json
import os
import psycopg2
import logging
def get_config(conf_filename="../config.json"):
logging.info("Getting config from %s" % conf_filename)
dir = os.path.dirname(__file__)
if not dir:
dir = "."
config_file = dir + os.sep + conf_filename
with open(config_file) as data_file:
... | {
"content_hash": "2909a0ce40e1b8297955bdf146dcc423",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 58,
"avg_line_length": 24.571428571428573,
"alnum_prop": 0.6608527131782945,
"repo_name": "Samreay/TaipanDB",
"id": "a2196af94aa2f8053cc26528ae23622930e3c13b",
"size": "516... |
import multiprocessing
assert multiprocessing
import re
from setuptools import setup, find_packages
def get_version():
"""
Extracts the version number from the version.py file.
"""
VERSION_FILE = 'dynamic_db_router/version.py'
mo = re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]', open(VERSION_FILE... | {
"content_hash": "b455ee9bf7962be42b8b550b21b93976",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 96,
"avg_line_length": 32.0625,
"alnum_prop": 0.6465237166991553,
"repo_name": "ambitioninc/django-dynamic-db-router",
"id": "32ef86f014621b8ec82320b2ecd94af93af6315f",
"si... |
"""
Copyright (c) 2016, Ernesto Ruge
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following dis... | {
"content_hash": "734436ef4cb2f4d800e2f9fc9bfd8b95",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 755,
"avg_line_length": 50.07142857142857,
"alnum_prop": 0.7883975273418925,
"repo_name": "ruhrmobil-E/mobilitaet-finden",
"id": "83359652a48661bc1581c1ffd340161947359789",
... |
"""
Views for managing Nova instances.
"""
import logging
from django import http
from django import shortcuts
from django.core.urlresolvers import reverse
from django.utils.datastructures import SortedDict
from django.utils.translation import ugettext as _
from horizon import api
from horizon import exceptions
from ... | {
"content_hash": "13e58cfd64348045fe78aecb60e394bc",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 78,
"avg_line_length": 37.85344827586207,
"alnum_prop": 0.5743566385789114,
"repo_name": "rcbops/horizon-buildpackage",
"id": "9562ec2306f9b23d594a975c1307b3ef5d471319",
"... |
from Tkinter import *
import tkMessageBox
import re
def validate():
userInput = entryBox.get()
numCount = 0
operandCount = 0
entryBracketCount = 0
exitBracketCount = 0
charCount = 0
endOfLine = len(userInput) - 1
for i in range(len(userInput)):
if (re.search('[\s*a-z\s*A-Z]+', userInput[i])):
charCount... | {
"content_hash": "6fce72fa5cce845cddb42dcd5fa5412b",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 99,
"avg_line_length": 29.944444444444443,
"alnum_prop": 0.6266233766233766,
"repo_name": "dominickhera/PosaRepo",
"id": "baacd73b2a7393b06043f6308fca166682c18583",
"size":... |
config = {
# File system base paths, inventory base paths, reports base paths.
# A file system base path is the root of a section of the file system that
# will be inventoried.
# Each file system base path will have its own inventory and reports.
# The inventory filepath contains... | {
"content_hash": "08b8b7bf33017ec2c057477f842683cf",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 84,
"avg_line_length": 49.30434782608695,
"alnum_prop": 0.5978835978835979,
"repo_name": "gwu-libraries/inventory",
"id": "c1a534b5c8661e1d5662568d3563c2806ca28401",
"size"... |
from django.test import TestCase
from unittest import mock
from sqlalchemy.engine import reflection
from corehq.apps.userreports.models import (
DataSourceActionLog,
DataSourceConfiguration,
)
from corehq.apps.userreports.tests.utils import (
get_sample_data_source,
skip_domain_filter_patch,
)
from co... | {
"content_hash": "7437148650c8ae0aff16b34d62921df1",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 108,
"avg_line_length": 38.46586345381526,
"alnum_prop": 0.6221549384005012,
"repo_name": "dimagi/commcare-hq",
"id": "8781f66f21fd1332bee9ffd5d3de22b88d4d0a62",
"size": "... |
__author__ = 'kotaimen'
__date__ = '6/12/14'
"""
georest.geo.operations
~~~~~~~~~~~~~~~~~~~~~~
Wraps every geometry operation in its own functor class, thus being very
naive and stupid.
All operator parameters are set in the CTOR and only accept geometries
in the `__call__` operator. Basic ty... | {
"content_hash": "a97494b4deb33e98ec5f545ef47c14ce",
"timestamp": "",
"source": "github",
"line_count": 549,
"max_line_length": 78,
"avg_line_length": 31.659380692167577,
"alnum_prop": 0.6143490017835568,
"repo_name": "Kotaimen/georest",
"id": "b638a72d9f0e4703c534a10deebec3a9ad4b7b66",
"size": "17... |
from __future__ import with_statement
import os
import time
import tempfile
from latex import latex
def preview(expr, output='png', viewer=None, euler=True, **latex_settings):
"""View expression or LaTeX markup in PNG, DVI, PostScript or
PDF form.
If the expr argument is an expression, it will be ... | {
"content_hash": "6a1afb981b89e348c118f6c2593c7a40",
"timestamp": "",
"source": "github",
"line_count": 224,
"max_line_length": 96,
"avg_line_length": 32.651785714285715,
"alnum_prop": 0.5358217117856167,
"repo_name": "ichuang/sympy",
"id": "43cd38c2432fdd06dbc60381d6276e278693077b",
"size": "7314"... |
"""ATAG water heater component."""
from typing import Any
from homeassistant.components.water_heater import (
STATE_ECO,
STATE_PERFORMANCE,
WaterHeaterEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_TEMPERATURE, STATE_OFF, TEMP_CELSIUS, Platform
from home... | {
"content_hash": "9c81b3e500d5534134f947d6b8019f4e",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 94,
"avg_line_length": 33.47692307692308,
"alnum_prop": 0.7095588235294118,
"repo_name": "mezz64/home-assistant",
"id": "009f84a72ef6eaf2153f95557f1f537f2fa30752",
"size": ... |
print len("abcde")
| {
"content_hash": "5841f8c3fbf1f1ca2d70e5df7494f260",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 18,
"avg_line_length": 19,
"alnum_prop": 0.6842105263157895,
"repo_name": "jplevyak/pyc",
"id": "16261d036b0f9f1f1047161403bfa29c776fb913",
"size": "19",
"binary": false,
... |
import sys
import os
import argparse
def main():
parser=argparse.ArgumentParser(prog="annotateTSS.py")
parser.add_argument("affinities",nargs=1,help="TEPIC gene-TF scores")
parser.add_argument("expression",nargs=1,help="Gene expression file")
parser.add_argument("output",nargs=1,help="File to write the combined da... | {
"content_hash": "41672e5237fa6c3907a22a4e3137137a",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 137,
"avg_line_length": 33.81818181818182,
"alnum_prop": 0.7020609318996416,
"repo_name": "SchulzLab/TEPIC",
"id": "65b0497a429ffa69ce86e957938904c701ff3c32",
"size": "2783... |
from .main import main
import click
from .. import dbutils2
@main.command()
@click.option('--dbtype', '-t', default=None, help='Database type',
type=click.Choice(['sqlite', 'mysql', 'mariadb'], case_sensitive=False), required=True)
@click.option('--database', '-d', default='', help='Database name (file n... | {
"content_hash": "68b2cc314dfa85e687b95a5ca7a76a9d",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 115,
"avg_line_length": 67.04761904761905,
"alnum_prop": 0.6633522727272727,
"repo_name": "awacha/cct",
"id": "02d27f44bcf1967683adcf2975403d87524b332b",
"size": "1408",
... |
from juwparser import timestampize
def send(message, settings):
with open(settings['FILE_SAVE'], 'a') as logfile:
logfile.write(timestampize(message))
logfile.write("\n")
| {
"content_hash": "fe32cea4ad1bdecde58297ed5c4e5eef",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 53,
"avg_line_length": 27.571428571428573,
"alnum_prop": 0.6787564766839378,
"repo_name": "krzysztofr/juwreport",
"id": "bf650badcc26fcce85eff0460d63e79b0955209f",
"size": "... |
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/clothing/shared_clothing_armor_bone_gloves.iff"
result.attribute_template_id = -1
result.stfName("string_id_table","")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "b9661b1f785294a0f98b69c132c344ec",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 90,
"avg_line_length": 24.53846153846154,
"alnum_prop": 0.7021943573667712,
"repo_name": "obi-two/Rebelion",
"id": "020b56368f2516fe2d0b67d2f60d90e2eb99b4f5",
"size": "464"... |
from __future__ import division
import time
# Import the PCA9685 module.
import Adafruit_PCA9685
import sys #Used for closing the running program
import pygame #Gives access to KEYUP/KEYDOWN events
#Initialization for pygame
pygame.init()
screen = pygame.display.set_mode((700, 400))
pygame.display.set_caption('Remote... | {
"content_hash": "ca01690d485b932106edbe14f34f8a33",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 62,
"avg_line_length": 28.22772277227723,
"alnum_prop": 0.6324096808137496,
"repo_name": "MitchellB23/Micro-Olli",
"id": "1172cadca00f985eea501175672f00a617783d4d",
"size"... |
"""
Copyright [2009-2018] EMBL-European Bioinformatics Institute
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... | {
"content_hash": "f938da66ae443c1847c4541448999fc9",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 84,
"avg_line_length": 36.644067796610166,
"alnum_prop": 0.6618871415356151,
"repo_name": "RNAcentral/rnacentral-import-pipeline",
"id": "5ccf544a83f85c5e7c3eee79d23c813a6770... |
import time
from collections import OrderedDict, defaultdict
from datetime import datetime, timedelta
import logging
from typing import Any, Callable, Dict, List, \
Optional, Tuple, Type, Union
from django.conf import settings
from django.db import connection, models
from django.db.models import F
from analytics.... | {
"content_hash": "b2a103460afb7e8a9f6b117e38869371",
"timestamp": "",
"source": "github",
"line_count": 539,
"max_line_length": 106,
"avg_line_length": 43.37105751391466,
"alnum_prop": 0.6524361551952774,
"repo_name": "dhcrzf/zulip",
"id": "3b3c5158d8063f52ebb341a7b5303f22dd52b66e",
"size": "23377"... |
from __future__ import unicode_literals
from ..arithmetic import AddScalarVolumes
def test_AddScalarVolumes_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=True,
),
inputVolume1=dict(ar... | {
"content_hash": "07c734928c45b0a4c7382e239217833e",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 67,
"avg_line_length": 25.6,
"alnum_prop": 0.6258680555555556,
"repo_name": "mick-d/nipype",
"id": "29a2a157e6546d9eee3fc0a3ec8e4300abb5968e",
"size": "1206",
"binary": f... |
import string
import copy
class GetPot_variable:
def __init__(self, name, str_value):
self.name = name
self.take(str_value)
def take(self, str_value):
self.value = string.split(str_value)
self.original = str_value
class GetPot:
def __init__(self, Argv=None, Fil... | {
"content_hash": "91bf5b3979b37cbee5888748721232e0",
"timestamp": "",
"source": "github",
"line_count": 929,
"max_line_length": 110,
"avg_line_length": 38.265877287405814,
"alnum_prop": 0.4839517285999606,
"repo_name": "coderjames/pascal",
"id": "64908138a4c394a54261965deccf7c1dfd4c3e20",
"size": "... |
from pymel.core import *
import math as m
def removeDuplicates(seq):
# Not order preserving
myset = set(seq)
return list(myset)
def processLightMaps(tiles, camera, bakeSet, bakeGroup, bakeObject):
import maya.mel as mel
myBakeSet = ls (bakeSet, type='textureBakeSet')
myBakeSet[0].uvRange.set(2)
for i... | {
"content_hash": "8ff68415c0b21faa086374cdbda3afb6",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 98,
"avg_line_length": 27.123595505617978,
"alnum_prop": 0.6980115990057995,
"repo_name": "aaronfang/personal_scripts",
"id": "f56bb4c4a4fd455c2eb274c1c35f9b5151b6751c",
"s... |
from datetime import datetime
from django.db import models
from django.contrib.auth.models import User
class PointManager(models.Manager):
"""Manager for Pressure Points."""
def recently_added(self, count=10):
return self.order_by('-time_added')[:count]
class City(models.Model):
"""City the Press... | {
"content_hash": "1f4104644d05a3f6e12f340174deae91",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 76,
"avg_line_length": 31.186046511627907,
"alnum_prop": 0.6797166293810589,
"repo_name": "stasm/akupunktura",
"id": "f72a355540cc984f158300eaacfdbb6e9b3587e6",
"size": "26... |
r"""
==========================================
B701: Test for not auto escaping in jinja2
==========================================
Jinja2 is a Python HTML templating system. It is typically used to build web
applications, though appears in other places well, notably the Ansible
automation system. When configuring t... | {
"content_hash": "9f9ad06d1256ecd29556c9d6f473629c",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 79,
"avg_line_length": 44.54782608695652,
"alnum_prop": 0.5621706031622097,
"repo_name": "pombredanne/bandit",
"id": "2adc77a60a6f6bd9f86d18bcf190164ae6c1c630",
"size": "5... |
import functools
import itertools
import os
import re
import urlparse
from oslo.config import cfg
import webob
from nova.api.openstack import wsgi
from nova.api.openstack import xmlutil
from nova.compute import task_states
from nova.compute import utils as compute_utils
from nova.compute import vm_states
from nova im... | {
"content_hash": "06f42164e7c874d2c947518d313829f2",
"timestamp": "",
"source": "github",
"line_count": 549,
"max_line_length": 79,
"avg_line_length": 35.602914389799636,
"alnum_prop": 0.5841092806712371,
"repo_name": "sacharya/nova",
"id": "ba3cb075db609602766811adb6a3db7575195ee8",
"size": "20227... |
from __future__ import print_function
import sys
from StringIO import StringIO
from Registry import Registry, RegistryLog
def print_test_testAAAA_testBBBB(reg):
try:
reg.root().find_key('testAAAA')
print('testAAAA found!')
except Exception:
print('testAAAA not found!')
try:
... | {
"content_hash": "b05198c951c18ffd43a5d675e2d12759",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 108,
"avg_line_length": 31.440944881889763,
"alnum_prop": 0.6574004507888805,
"repo_name": "zweger/python-registry",
"id": "9f523ba8eb264a1ae1993d8a3b3c457c6c9f834a",
"siz... |
from django.test import TestCase
from core.models import Parent, Child, Unrelated
class CascadeDeleteTests(TestCase):
def setUp(self):
self.parent = Parent(name="Joe")
self.parent.save()
self.child = Child(name="John-Boy", parent=self.parent)
self.child.save()
def test_delet... | {
"content_hash": "92e52060b8bd035d04df82cbec7b2120",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 67,
"avg_line_length": 41.09090909090909,
"alnum_prop": 0.6479140328697851,
"repo_name": "yunojuno/cascade",
"id": "f7ce20db0accae33b49e9406bd7a3395457dbe0b",
"size": "3188... |
from selenium.webdriver.common.by import By
class ProductPage():
def __init__(self, driver):
self.driver = driver
def linkhome(self):
return self.driver.find_element(By.LINK_TEXT, 'Home')
def addtocart(self):
return self.driver.find_element(By.NAME, 'add_cart_... | {
"content_hash": "dc171b81ab681258bc0ef749ada6b276",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 68,
"avg_line_length": 27.416666666666668,
"alnum_prop": 0.6231003039513677,
"repo_name": "helenjon/sel-5",
"id": "3ebbbe2c705935812e3ea051e217713548623bf5",
"size": "329",... |
from django.shortcuts import redirect, render
from ..models import Reminder
def review(request, pk):
reminder = Reminder.objects.get(pk=pk)
if request.method == "POST":
reminder.page_reviewed = True
reminder.save()
return redirect('wagtailadmin_home')
return render(request, 'wag... | {
"content_hash": "99b75f8d28f22378648f2c3a956a07ba",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 60,
"avg_line_length": 24.41176470588235,
"alnum_prop": 0.653012048192771,
"repo_name": "takeflight/wagtail-relevancy",
"id": "f89fafef1e81ca248153a6090755d9afd2a75449",
"s... |
from django.contrib import messages
from django.contrib.sites.models import get_current_site
from django.template import TemplateSyntaxError
from django.utils import six
from django.utils.translation import ugettext_lazy as _
from django.views import generic
from oscar.core.loading import get_class, get_model
Communi... | {
"content_hash": "81a2d8e554dd21cc0f360c446c234e44",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 76,
"avg_line_length": 36.75,
"alnum_prop": 0.640427599611273,
"repo_name": "Bogh/django-oscar",
"id": "15ae8d05700cb1d984fef32ec6f9ec826ce43a0d",
"size": "3087",
"binary... |
"""Events Interface."""
from shellcraft.core import BaseItem, BaseFactory
from shellcraft._cli_impl import echo, ask
from shellcraft.utils import convert_resource_value, format_name
from shellcraft.game_state_pb2 import Mission as MissionPB
from shellcraft.world import NPCFactory
import datetime
import random
class ... | {
"content_hash": "8e4fe23aaff90aa64145f6ee4ffae58b",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 88,
"avg_line_length": 36.79047619047619,
"alnum_prop": 0.5943567175770127,
"repo_name": "maebert/shellcraft",
"id": "ce35c47c6f28c855f124a514d0b80adc9489926f",
"size": "3... |
"""This example gets all companies.
"""
# Import appropriate modules from the client library.
from googleads import ad_manager
def main(client):
# Initialize appropriate service.
company_service = client.GetService('CompanyService', version='v202211')
# Create a statement to select companies.
statement = ad... | {
"content_hash": "58c72bf2f4c8cd803adde27fb656822c",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 79,
"avg_line_length": 34.1764705882353,
"alnum_prop": 0.6970740103270223,
"repo_name": "googleads/googleads-python-lib",
"id": "e52278ea61444b0f041a19f3c105b204bcb2dc1f",
... |
"""
The database connections are read‐only, so SQL injection attacks can’t be a
problem.
"""
import sys
import os
import threading
import decimal
import time
import json
import re
import requests
import collections
import logging
logger = logging.getLogger(__name__)
from logging import handlers as logging_handlers
D =... | {
"content_hash": "38ccfb381f9a6d6839eaffd39bdcf7fe",
"timestamp": "",
"source": "github",
"line_count": 902,
"max_line_length": 184,
"avg_line_length": 44.72062084257206,
"alnum_prop": 0.5714462789429322,
"repo_name": "F483/counterparty-lib",
"id": "cb43834b33c0773c3d669fa3b9aa056aa3547f78",
"size"... |
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('main', '0022_auto_20170911_1917'),
]
operations = [
migrations.CreateModel(
n... | {
"content_hash": "050b1f975c146afbaf88d8a1b9d5a099",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 203,
"avg_line_length": 39.55882352941177,
"alnum_prop": 0.5858736059479553,
"repo_name": "prajnamort/LambdaOJ2",
"id": "ef35f93aaef10019aad0f5fac26efb7f77a4ba25",
"size": ... |
from django.utils.translation import ugettext as _
from django.http import HttpResponseRedirect, HttpResponse
from django.contrib.auth import REDIRECT_FIELD_NAME, login as django_login
from django.views.decorators.csrf import csrf_exempt
from django.http import QueryDict, HttpResponseNotAllowed, HttpRequest
from django... | {
"content_hash": "ced38d529124a9a70894aaa695592aa6",
"timestamp": "",
"source": "github",
"line_count": 720,
"max_line_length": 171,
"avg_line_length": 44.31388888888889,
"alnum_prop": 0.6423243277126559,
"repo_name": "brockwhittaker/zulip",
"id": "6369bb17f470a5e004b6ca43a8cfeeb712b0f0de",
"size":... |
import logging
import os
import pwd
import random
import string
import uuid
import kazoo.exceptions
from kazoo.client import KazooClient
from kazoo.retry import KazooRetry
from kazoo.security import ACL, ANYONE_ID_UNSAFE, Permissions
from dcos_internal_utils import utils
log = logging.getLogger(__name__)
ANYONE_RE... | {
"content_hash": "6e68d37eba24365cd9417aa2339c4ea0",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 114,
"avg_line_length": 35.855932203389834,
"alnum_prop": 0.5627511226660364,
"repo_name": "branden/dcos",
"id": "5fa4cb35e5791f246959c87e481c87abd04efbb4",
"size": "4231"... |
''' Message queues. '''
from rq import Connection, Queue
import app.config
import worker
import worker.scrape
import worker.archive
_config = app.config.get_config()
_redis = app.database.get_redis(dict(_config.items('redis')))
_redis_worker = dict(_config.items('redis_worker'))
_scrape_queue = Queue('scrape', conne... | {
"content_hash": "93aabdb207af7db69245243169eee743",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 78,
"avg_line_length": 26.478991596638654,
"alnum_prop": 0.63344969850841,
"repo_name": "TeamHG-Memex/hgprofiler",
"id": "941fec2b5ce80d7751b3cb2fc5afe0e5fd77e062",
"size"... |
import sys
import bluetooth
import time
import struct
if sys.version < '3':
input = raw_input
sock=bluetooth.BluetoothSocket(bluetooth.RFCOMM)
if len(sys.argv) < 2:
print("usage: l2capclient.py <addr>")
sys.exit(2)
bt_addr=sys.argv[1]
port = 0x01
print("trying to connect to %s on PSM 0x%X" % (bt_addr, ... | {
"content_hash": "bec7942daa80b70cf451d1da80de5ec1",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 62,
"avg_line_length": 18.585365853658537,
"alnum_prop": 0.6036745406824147,
"repo_name": "mcelhennyi/smart_home",
"id": "923bd8b749dcf74874dc07cb104956d99146e8c3",
"size":... |
from __future__ import absolute_import
import os
import sys
import logging
import multiprocessing
from .constants import *
from .errors import *
from ._compat import *
__all__ = ['colors', 'log', 'setup_logging']
logging_level_map = {
SILENCE: logging.NOTSET,
INFO: logging.INFO,
VERBOSE: logging.DEBU... | {
"content_hash": "24fb2b5c86fa257c4d7adae40d520d7e",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 85,
"avg_line_length": 25.609756097560975,
"alnum_prop": 0.6026190476190476,
"repo_name": "capitalone/giraffez",
"id": "8ad8598230d3df571968aa75054bf365799cb6c6",
"size": ... |
"""The tests for the REST switch platform."""
import asyncio
import aiohttp
import homeassistant.components.switch.rest as rest
from homeassistant.setup import setup_component
from homeassistant.util.async_ import run_coroutine_threadsafe
from homeassistant.helpers.template import Template
from tests.common import ge... | {
"content_hash": "c813ab03b861da184cf1f0945b4ef7bc",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 75,
"avg_line_length": 36.766666666666666,
"alnum_prop": 0.5995337391529595,
"repo_name": "tinloaf/home-assistant",
"id": "cb27ab40855473b82962080db3d73d2565ffa064",
"size... |
"""
Adds support for first class features that can be added to the edX platform.
"""
from stevedore.extension import ExtensionManager
class PluginError(Exception):
"""
Base Exception for when an error was found regarding features.
"""
pass
class PluginManager(object):
"""
Base class that ma... | {
"content_hash": "0fa908b5312a6f2e570130f74db58ce6",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 102,
"avg_line_length": 33.71111111111111,
"alnum_prop": 0.6282135794330916,
"repo_name": "bmedx/platform-core",
"id": "576dc9cec5a112c5190601ff0110acdc48965e43",
"size": "... |
class EmptyBoardException(Exception):
'''
Exception to be raised for
errors involving an empty board.
'''
pass
class EndsMismatchException(Exception):
'''
Exception to be raised for errors
involving mismatched domino ends.
'''
pass
class GameInProgressException(Exception):
... | {
"content_hash": "c2e1ca2fcce30388ccaa18496b5fb129",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 41,
"avg_line_length": 20.604166666666668,
"alnum_prop": 0.6663296258847321,
"repo_name": "abw333/dominoes",
"id": "fdc93558217a61b4f4907707bbe951612fadbdf6",
"size": "989"... |
from south.utils import datetime_utils as 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 'XForm.created_by'
db.add_column(u'logger_xform', 'created_by',
... | {
"content_hash": "62157bc0a62a42519c14efdfac0d258c",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 195,
"avg_line_length": 81.0297619047619,
"alnum_prop": 0.5511643282156762,
"repo_name": "piqoni/onadata",
"id": "c2648c4e1cad62d88bef6ec5a92f1415c35a0c16",
"size": "13637... |
import os
import glob
import shutil
from collections import defaultdict
from IPython.utils.traitlets import Bool
from nbgrader.apps.baseapp import TransferApp, transfer_aliases, transfer_flags
from nbgrader.utils import check_mode, parse_utc
aliases = {}
aliases.update(transfer_aliases)
aliases.update({
})
flags =... | {
"content_hash": "1285b5e4a618456577fc1e908d0ef169",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 106,
"avg_line_length": 39.25,
"alnum_prop": 0.600964021346187,
"repo_name": "jdfreder/nbgrader",
"id": "3a6bece38563c4739d9fefabeb6fc8fc92f5fac5",
"size": "5809",
"bina... |
"""Tests for HomematicIP Cloud cover."""
from homeassistant.components.cover import (
ATTR_CURRENT_POSITION,
ATTR_CURRENT_TILT_POSITION,
DOMAIN as COVER_DOMAIN,
)
from homeassistant.components.homematicip_cloud import DOMAIN as HMIPC_DOMAIN
from homeassistant.const import STATE_CLOSED, STATE_OPEN
from homea... | {
"content_hash": "bc22bb6a98d4c6f178b8d971a4832994",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 77,
"avg_line_length": 41.28387096774193,
"alnum_prop": 0.6718237224566338,
"repo_name": "joopert/home-assistant",
"id": "22922303f9e0d2ce04c967c9ae54f430dc49706c",
"size"... |
from magnumclient.common import utils
from magnumclient.openstack.common.apiclient import exceptions as exc
from magnumclient.tests import utils as test_utils
class CommonFiltersTest(test_utils.BaseTestCase):
def test_limit(self):
result = utils.common_filters(limit=42)
self.assertEqual(['limit=42... | {
"content_hash": "9f8fff90b54bf49330c392e089b7f4ad",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 77,
"avg_line_length": 38.05,
"alnum_prop": 0.5174113009198423,
"repo_name": "ramielrowe/python-magnumclient",
"id": "e67cf38af0c73c2a57087a7238a63e76e4b4d12b",
"size": "37... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.