text stringlengths 4 1.02M | meta dict |
|---|---|
class OSVersion(str):
def __new__(cls, friendly_name, sortable_name):
version = str.__new__(cls, friendly_name)
version._sortable_name = sortable_name
return version
def __lt__(self, other):
return self._sortable_name < other._sortable_name
def __gt__(self, other):
return self._sortable_name... | {
"content_hash": "77f7bce67192539d8343a5cdf6fad93f",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 54,
"avg_line_length": 30.35135135135135,
"alnum_prop": 0.6838824577025824,
"repo_name": "endlessm/chromium-browser",
"id": "5214f3defaf410d3ab03c23ffae3f63a0915838e",
"siz... |
'''OpenGL extension ARB.vertex_type_2_10_10_10_rev
Automatically generated by the get_gl_extensions script, do not edit!
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_ARB_vertex_type_2_10_10_10_rev'
_DEPRECATED ... | {
"content_hash": "bc23554ff08d91d752789396a1daf316",
"timestamp": "",
"source": "github",
"line_count": 395,
"max_line_length": 106,
"avg_line_length": 33.27088607594937,
"alnum_prop": 0.7826053873078679,
"repo_name": "Universal-Model-Converter/UMC3.0a",
"id": "9e19d10ddde5b1b2ddaf3204539bc7455f55f58... |
"""Accesses the google.spanner.admin.instance.v1 InstanceAdmin API."""
import functools
import pkg_resources
import warnings
from google.oauth2 import service_account
import google.api_core.gapic_v1.client_info
import google.api_core.gapic_v1.config
import google.api_core.gapic_v1.method
import google.api_core.grpc_h... | {
"content_hash": "a44a000d7e02c71040b9f3a10b72780c",
"timestamp": "",
"source": "github",
"line_count": 1045,
"max_line_length": 164,
"avg_line_length": 44.691866028708134,
"alnum_prop": 0.6003682846926321,
"repo_name": "dhermes/gcloud-python",
"id": "63d3a1631eae32cf2f373af8cce82d256faf850a",
"siz... |
class Solution:
def maxArea(self, height: List[int]) -> int:
res = 0
start, end = 0, len(height)-1
while start < end:
res = max(res, ((end-start)*min(height[end], height[start])))
if height[start] > height[end]:
end -= 1
else:
... | {
"content_hash": "922d2a17418dc753da5d040141e5075f",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 73,
"avg_line_length": 29.53846153846154,
"alnum_prop": 0.4270833333333333,
"repo_name": "saisankargochhayat/algo_quest",
"id": "13497eb2c157e0777649412bb91c0230d33cd212",
... |
"""
Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved.
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including with... | {
"content_hash": "e5eed06b2bbcd62a78d8afe07f195c83",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 83,
"avg_line_length": 40.57575757575758,
"alnum_prop": 0.7744585511575803,
"repo_name": "Fendoe/open-hackathon-o",
"id": "16a2681d412902149fbc73c02733eb90d7e27753",
"size"... |
import logging
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy
from openstack_dashboard import api
from openstack_dashboard import policy
from horizon import exceptions
from horizon import tables
LOG = logging... | {
"content_hash": "cef53c782023d559a0bb221e78cba7b8",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 79,
"avg_line_length": 33.51851851851852,
"alnum_prop": 0.6058931860036832,
"repo_name": "wolverineav/horizon",
"id": "461f97772d2c505fca2e1c8920d82f29ba412831",
"size": "3... |
from puq import *
def run():
x = UniformParameter('x', 'x', min=0, max=2)
host = InteractiveHost()
uq = Smolyak([x], level=8)
prog = TestProgram('./sin.py', desc='Sine Function')
return Sweep(uq, host, prog)
| {
"content_hash": "a9b457715a8363157d8101165a87847d",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 56,
"avg_line_length": 28.625,
"alnum_prop": 0.6026200873362445,
"repo_name": "c-PRIMED/puq",
"id": "8a84628618ea8f247d305cb64907198e370c5216",
"size": "229",
"binary": fa... |
import argparse
import genetic_analyzer as ga
def main():
# Parse the command line inputs
parser = argparse.ArgumentParser(description="part_profile_analysis")
parser.add_argument("-settings", dest="settings", required=True, help="settings.txt", metavar="string")
args = parser.parse_args()
settings = ga.load_s... | {
"content_hash": "5d5d6a165ba81cc97d0e8253aab7ed58",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 151,
"avg_line_length": 52.08,
"alnum_prop": 0.7511520737327189,
"repo_name": "VoigtLab/MIT-BroadFoundry",
"id": "1707054852e68647e4198b7ce641137adb4857e8",
"size": "1500",... |
import re
import string
from django.http import HttpRequest, HttpResponse
from zerver.decorator import webhook_view
from zerver.lib.exceptions import UnsupportedWebhookEventTypeError
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success
from zerver.lib.validator import... | {
"content_hash": "acf2d1380ba8b90d5ed877088780b759",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 95,
"avg_line_length": 32.67796610169491,
"alnum_prop": 0.6742738589211619,
"repo_name": "zulip/zulip",
"id": "4626a25e60b61082983d4d8a1a3b9ec66c08c9fd",
"size": "5784",
... |
from lighthouse.ajax.lapack_le import *
from lighthouse.ajax.btoscript import *
| {
"content_hash": "5384beaff3b29deaadd493175049eea2",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 39,
"avg_line_length": 27,
"alnum_prop": 0.8024691358024691,
"repo_name": "LighthouseHPC/lighthouse",
"id": "11b7b74b7cc1bc37c127d0ccfe765e7b9570cdd0",
"size": "81",
"bina... |
import inspect, types
from .pool import HashPool
from .chord import Chord
from .resource import ProxyResource
from . import registry
class Task(object):
def __init__(self, target=None, name=None):
"""Similar to threads, if target is not None, will run target. You may also override the run method."""
... | {
"content_hash": "f8e7b553ed2d939b045968f2da3b9301",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 111,
"avg_line_length": 32.15079365079365,
"alnum_prop": 0.5917057516662553,
"repo_name": "omergertel/chords",
"id": "804d056952ec4b73b51f365f51391b0df94c5480",
"size": "4... |
"""
Unit Tests for remote procedure calls using queue
"""
import mock
import mox
from oslo_concurrency import processutils
from oslo_config import cfg
from oslo_db import exception as db_exc
from cinder import context
from cinder import db
from cinder import exception
from cinder import manager
from cinder import se... | {
"content_hash": "290b1a10c3e323003925b7c08217cb7c",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 79,
"avg_line_length": 36.63492063492063,
"alnum_prop": 0.5621750433275563,
"repo_name": "yanheven/cinder",
"id": "c2de595e1e361d25ae8f64a944f8412338f35ed9",
"size": "9965... |
import json
import logging
import random
import warnings
from typing import Dict, Hashable, List, Mapping, Optional
import numpy as np
import torch
from monai.config import KeysCollection
from monai.data import MetaTensor
from monai.networks.layers import GaussianFilter
from monai.transforms.transform import MapTrans... | {
"content_hash": "03acda763847ea9049609b2e746e60c5",
"timestamp": "",
"source": "github",
"line_count": 876,
"max_line_length": 118,
"avg_line_length": 41.80707762557078,
"alnum_prop": 0.5538049859377987,
"repo_name": "Project-MONAI/MONAI",
"id": "76b9e18cc7028ab946ccdcc22b52d45a2814be8b",
"size": ... |
from oslo_log import log as logging
import pecan
from pecan import hooks
from pecan import rest
from wsme import types as wtypes
import wsmeext.pecan as wsme_pecan
from mistral.api.controllers import resource
from mistral.api.controllers.v2 import types
from mistral.api.hooks import content_type as ct_hook
from mistra... | {
"content_hash": "c66b012048cc52f7916a446075409e4e",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 78,
"avg_line_length": 33.613756613756614,
"alnum_prop": 0.6099480560365181,
"repo_name": "dennybaa/mistral",
"id": "d081e9b5fae324bf628c2f0ad241fad5389e126a",
"size": "70... |
import suspect
import numpy
def test_null_transform():
fid = numpy.ones(128, 'complex')
data = suspect.MRSData(fid, 1.0 / 128, 123)
transformed_data = suspect.processing.frequency_correction.transform_fid(data, 0, 0)
assert type(transformed_data) == suspect.MRSData
def test_water_peak_alignment_mis... | {
"content_hash": "a7d06602021dfcf928fb684eb02aa122",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 163,
"avg_line_length": 45.31460674157304,
"alnum_prop": 0.70047111331515,
"repo_name": "bennyrowland/suspect",
"id": "40ea9c3ce9430bde85ac058de81eb50a53467549",
"size": "4... |
""".. Ignore pydocstyle D400.
===============
Signal Handlers
===============
"""
import logging
from asgiref.sync import async_to_sync
from channels.layers import ChannelFull, get_channel_layer
from django.db import transaction
from django.db.models.signals import post_save
from django.dispatch import receiver
fr... | {
"content_hash": "f9f6ea15d26d0b9459695e22c51ab10a",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 82,
"avg_line_length": 29.275,
"alnum_prop": 0.7019641332194705,
"repo_name": "dblenkus/rolca",
"id": "1d03f833f0ff98e00c13463e530c335453734f5a",
"size": "1171",
"binary"... |
import pytest
from spacy.language import Language, BaseDefaults
from spacy.lang.punctuation import TOKENIZER_INFIXES
from spacy.lang.char_classes import ALPHA
@pytest.mark.issue(768)
@pytest.mark.parametrize(
"text,expected_tokens", [("l'avion", ["l'", "avion"]), ("j'ai", ["j'", "ai"])]
)
def test_issue768(text, ... | {
"content_hash": "d8aea89de6d9a6099bb524e0be9ecafc",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 82,
"avg_line_length": 35.09090909090909,
"alnum_prop": 0.6709844559585493,
"repo_name": "explosion/spaCy",
"id": "272531b638f243068e0dca0dc8ee1db7d749f56e",
"size": "772",... |
import time
import glob
import re
import os
import subprocess
from Tkinter import *
import tkFont
import threading
WINWIDTH = 776
WINHEIGHT = 390
BGCOLOR = "#3BD7EA"
ACTIVECOLOR = "#3BD7EA"
TEXTCOLOR = "#FFFFFF"
PROGRESSBG = "#FFFFFF"
BTNTEXT = "#2AD4E7"
BTNCOLOR = "#FFFFFF"
class Application(Frame):
def createS... | {
"content_hash": "45b86df0f9f333b68bcf9da17002e5af",
"timestamp": "",
"source": "github",
"line_count": 367,
"max_line_length": 210,
"avg_line_length": 36.084468664850135,
"alnum_prop": 0.6071131918749528,
"repo_name": "Adai0808/coder",
"id": "735358888753d205d347f323b50ccba7057a0762",
"size": "139... |
import random
import unittest
import numpy as np
import paddle
import paddle.distributed as dist
import paddle.distributed.fleet as fleet
import paddle.nn as nn
import paddle.nn.functional as F
from paddle.distributed.fleet.meta_parallel import LayerDesc, PipelineLayer
from paddle.fluid import layers
from paddle.flui... | {
"content_hash": "2e1d4c0f30b4981a8cc0a9fcdc237d8f",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 80,
"avg_line_length": 28.72289156626506,
"alnum_prop": 0.5958473154362416,
"repo_name": "PaddlePaddle/Paddle",
"id": "d9b0e94ae641576acc1c39e63368bbbea81db251",
"size": "... |
__author__ = 'nmelo'
import step_lights
| {
"content_hash": "da334cfb609574ae928c1c607706dfc0",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 20,
"avg_line_length": 13.666666666666666,
"alnum_prop": 0.6585365853658537,
"repo_name": "nmelo/alexa-appkit-lights",
"id": "ebc453c40db504c40198b490fea14f7fd3900fb7",
"siz... |
import time
from k0001def import appConfig, outputs, inputs, requests, sequence, wachtgroen, timers, countData, extend, \
extend_vag1, extend_vag2, extend_vag3, extend_vag4
from k0001func import set_defaults, conflict_manager, set_remain_green, set_demand_timers, request_green, \
sequence_evaluator, delay_man... | {
"content_hash": "7b91f5c6d49abf1de0fd28707ca909c4",
"timestamp": "",
"source": "github",
"line_count": 299,
"max_line_length": 137,
"avg_line_length": 43.95986622073578,
"alnum_prop": 0.5289866098600122,
"repo_name": "MartijnHarmenzon/openTLC",
"id": "aa36565d38a2816dcfba2e1976a60e16f0ca660b",
"si... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Tag.name'
db.alter_column('feedjack_tag', 'name', self.gf('django.db.models.fields.CharField')(unique=True, max_l... | {
"content_hash": "623fd419c5dca7a31a93df2304f6181c",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 181,
"avg_line_length": 75.30578512396694,
"alnum_prop": 0.5485074626865671,
"repo_name": "allo-/feedjack",
"id": "70847c05cc3de822adec443cef0d4ce01ccf9d47",
"size": "9136... |
'''
Dictionnary store
=================
Use a Python dictionnary as a store.
'''
__all__ = ('DictStore', )
from kivy.compat import iteritems
from kivy.storage import AbstractStore
class DictStore(AbstractStore):
'''Store implementation using a simple `dict`.
'''
def __init__(self, data=None, **kwargs)... | {
"content_hash": "ea72a34bc9559ea9db10f46d26810ebf",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 51,
"avg_line_length": 23.236363636363638,
"alnum_prop": 0.5320813771517997,
"repo_name": "wangjun/kivy",
"id": "d779e1d3c3d27d2593b183dda9662f9afbb5dc9c",
"size": "1278",
... |
"""Provisions Android devices with settings required for bots.
Usage:
./provision_devices.py [-d <device serial number>]
"""
import argparse
import json
import logging
import os
import posixpath
import re
import subprocess
import sys
import time
from pylib import constants
from pylib import device_settings
from py... | {
"content_hash": "b6918969a99f6a3ddf5eb16567da8b78",
"timestamp": "",
"source": "github",
"line_count": 339,
"max_line_length": 79,
"avg_line_length": 37.71091445427729,
"alnum_prop": 0.6738892365456821,
"repo_name": "chuan9/chromium-crosswalk",
"id": "491d1659ee3e15e23f39a48bce90e4e7b01de51e",
"si... |
class Fasta:
def __init__(self, name):
#name can be anything; I usually store the name of the file here.
#to get the name returned, type FastaName.name (if out of class def) or self.name (if within definition)
self.name = name
#initialize lists
# ALWAYS keep IDS and SEQS the same length. id[1] should ALWAYS ... | {
"content_hash": "523330a97e9bbe7f4954582e3c2806da",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 250,
"avg_line_length": 38.33116883116883,
"alnum_prop": 0.6561070642046417,
"repo_name": "abigailc/feast-etc",
"id": "93b065d003a7cb280cf581591bc8fe4945faa755",
"size": "... |
"""Train the model."""
# Example usage:
#
# python train.py \
# --logtostderr \
# --data_dir ~/vid2depth/data/kitti_raw_eigen \
# --seq_length 3 \
# --reconstr_weight 0.85 \
# --smooth_weight 0.05 \
# --ssim_weight 0.15 \
# --icp_weight 0.1 \
# --checkpoint_dir ~/vid2depth/checkpoints
from __future__ ... | {
"content_hash": "08ad2bfd621466fc0bb63c222cea5b59",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 80,
"avg_line_length": 38.550632911392405,
"alnum_prop": 0.64061730421934,
"repo_name": "cshallue/models",
"id": "b2f59cf221223d96c0fc247ef58f2ccdc5ad0b47",
"size": "6780"... |
from django import template
from image.models import Image
from django.db.models import Q
register = template.Library()
# Custom filter, return all images that are:
# public, shared, or belong to a logged in user
@register.filter
def viewable_all_users(self, user):
query = Image.objects.filter(
Q(user... | {
"content_hash": "4b72a147005157bf57d4135c3a2adeb9",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 50,
"avg_line_length": 24.67391304347826,
"alnum_prop": 0.6317180616740088,
"repo_name": "henry808/mod_drops",
"id": "e15507a85be7824fc2e7ba3601623ac7a62a77d1",
"size": "11... |
"""
Legiscan Importer am models.
"""
from .lsidperson import LSIDPerson
from .lsidbill import LSIDBill
__all__ = (
'LSIDPerson',
'LSIDBill',
)
| {
"content_hash": "eb35abbe8a58bed2a2dff1e2724dfd96",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 34,
"avg_line_length": 15.2,
"alnum_prop": 0.6644736842105263,
"repo_name": "access-missouri/am-django-project",
"id": "a1160f4c996758daaffc34cb6688690bfa27a0bd",
"size": "... |
import pytest
from projectq.cengines import BasicMapperEngine
@pytest.fixture(params=["mapper", "no_mapper"])
def mapper(request):
"""Add a mapper which changes qubit ids by adding 1."""
if request.param == "mapper":
class TrivialMapper(BasicMapperEngine):
def __init__(self):
... | {
"content_hash": "76394733a7984ab968b73997bd0074e0",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 70,
"avg_line_length": 35.86666666666667,
"alnum_prop": 0.49349442379182157,
"repo_name": "ProjectQ-Framework/ProjectQ",
"id": "e04f9084dd292bf69e14f64e1aa7cb74c1700458",
"... |
import subprocess
import praw
import datetime
import pyperclip
from hashlib import sha1
from flask import Flask
from flask import Response
from flask import request
from cStringIO import StringIO
from base64 import b64encode
from base64 import b64decode
from ConfigParser import ConfigParser
import OAuth2Util
import os
... | {
"content_hash": "157172deda4569249a6a440a38f2cd69",
"timestamp": "",
"source": "github",
"line_count": 279,
"max_line_length": 381,
"avg_line_length": 45.39426523297491,
"alnum_prop": 0.6794315041452823,
"repo_name": "foobarbazblarg/stayclean",
"id": "c2551f74c6ae27568fd8855a152ab7a575b757da",
"si... |
from __future__ import division
import argparse, time, os
import logging
import mxnet as mx
from mxnet import gluon
from mxnet import profiler
from mxnet.gluon import nn
from mxnet.gluon.model_zoo import vision as models
from mxnet import autograd as ag
from mxnet.test_utils import get_mnist_iterator
from mxnet.metri... | {
"content_hash": "8a02f1d096d73dc94c774dad46feab47",
"timestamp": "",
"source": "github",
"line_count": 273,
"max_line_length": 126,
"avg_line_length": 46.84981684981685,
"alnum_prop": 0.6068021892103206,
"repo_name": "luoyetx/mxnet",
"id": "a67a31790a06bee1fe8e03b9330459adaaa9a491",
"size": "13576... |
from __future__ import with_statement
from fabric.api import local, put, run, env
env.use_ssh_config = True
def build():
local('sbt clean compile assembly')
def deploy():
cuttrdir = '/home/%s/cuttr' % env.GLITCHUSER
put('assembled/cuttr.jar', cuttrdir)
run('chmod +x %s/cuttr.jar' % cuttrdir)
ru... | {
"content_hash": "db0dae7edd15e3f1d6d735e9dd2a2b33",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 81,
"avg_line_length": 26.4,
"alnum_prop": 0.6691919191919192,
"repo_name": "rumblesan/cuttr",
"id": "0d7682987997e77d88b27db8bc84ee38404379db",
"size": "419",
"binary": ... |
from precisely import Matcher
from precisely.coercion import to_matcher
from precisely.results import matched, unmatched, indented_list
class Prop(Matcher):
def __init__(self, path, matcher):
self.matcher = matcher
self._path = path
def readable_path(self):
readable_path = ']['.join(... | {
"content_hash": "b0b377312c9004a735b87a42ea4442ae",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 99,
"avg_line_length": 30.350746268656717,
"alnum_prop": 0.5815097123186624,
"repo_name": "gsantovena/marathon",
"id": "9b16e068158f3d7ab5160fdaff38735467bf4368",
"size": ... |
from flask.ext import wtf
import flask
import wtforms
import auth
import config
import model
import util
import task
from main import app
###############################################################################
# Profile View
###############################################################################
@ap... | {
"content_hash": "f5d13fd8b010601ee1226ea0374491a4",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 79,
"avg_line_length": 30.262295081967213,
"alnum_prop": 0.5823401950162513,
"repo_name": "tiberiucorbu/av-website",
"id": "bd2fb37d97b359e4e83a2f28f09b051cd8338df5",
"siz... |
from airflow import DAG
# We need to import the operators used in our tasks
from airflow.operators.bash_operator import BashOperator
# We then import the days_ago function
from airflow.utils.dates import days_ago
from datetime import timedelta
# initializing the default arguments that we'll pass to our DAG
default_arg... | {
"content_hash": "e6b94b79bf252e7534292503c85ece6d",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 63,
"avg_line_length": 24.31578947368421,
"alnum_prop": 0.6807359307359307,
"repo_name": "andrzejsydor/docker",
"id": "9f4f2a1033caec6149852ae414dd41bb43c782ab",
"size": "9... |
"""Deployment Manager V2 manifests sub-group."""
from googlecloudsdk.calliope import base
from googlecloudsdk.calliope import exceptions
class Manifests(base.Group):
"""Commands for Deployment Manager V2 manifests.
Commands to list and examine manifests within a deployment.
"""
detailed_help = {
'DES... | {
"content_hash": "d8cdf774ceeff1ee246ea6e424cdb2eb",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 74,
"avg_line_length": 29.53846153846154,
"alnum_prop": 0.6744791666666666,
"repo_name": "wemanuel/smry",
"id": "56c31c6b27d9d7e1d0662c2572b567844e6dddeb",
"size": "1203",
... |
"""Urls for news app."""
from django.conf.urls import url
from news import views
urlpatterns = [
url(r'^$', views.NewsListView.as_view(), name='list'),
url(r'^(?P<pk>\d+)/$', views.NewsDetailView.as_view(), name='detail'),
url(r'^create/$', views.NewsCreateView.as_view(), name='create'),
url(r'^(?P<pk... | {
"content_hash": "67e14f59dd2c78a81ce778b25fe0da38",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 81,
"avg_line_length": 38,
"alnum_prop": 0.631578947368421,
"repo_name": "Atlases/qnews",
"id": "3699388bfe6eae13b021621900995cd89948562b",
"size": "456",
"binary": false... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import object
import os
import shutil
import tarfile
import io
import boto3
import botocore
from typing import Optional
from typing import Text
from rasa_nl... | {
"content_hash": "9cb78e5f5b7e9942a5471507d4c55b4b",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 116,
"avg_line_length": 37.5609756097561,
"alnum_prop": 0.6426406926406927,
"repo_name": "PHLF/rasa_nlu",
"id": "5a37040a6b5504bdfddbb1087920aa10f80c27c6",
"size": "4620",... |
import abc
import logging
import luigi
import luigi.hadoop
from luigi.target import FileSystemTarget, FileAlreadyExists
import os
import subprocess
import tempfile
from luigi.task import flatten
logger = logging.getLogger('luigi-interface')
class HiveCommandError(RuntimeError):
def __init__(self, message, out=No... | {
"content_hash": "b9dbcfa8340f4238c354081965ed3df7",
"timestamp": "",
"source": "github",
"line_count": 416,
"max_line_length": 142,
"avg_line_length": 40.01923076923077,
"alnum_prop": 0.6225973089860644,
"repo_name": "cpcloud/luigi",
"id": "c4dfb0f30f7bb0287560d47259c0b95a2441b38c",
"size": "17189... |
from __future__ import unicode_literals
from django.core.paginator import EmptyPage, PageNotAnInteger
class RequestConfig(object):
'''
A configurator that uses request data to setup a table.
A single RequestConfig can be used for multiple tables in one view. See
[pagination]
Arguments:
... | {
"content_hash": "1ca8df1fba1a7612cd08e095412f403b",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 80,
"avg_line_length": 36.215384615384615,
"alnum_prop": 0.5632965165675446,
"repo_name": "vicky2135/lucious",
"id": "98a4f0b0bd60a055eedb2ef32165c8e74bb6947d",
"size": "23... |
import sys, os, glob, re, subprocess
from collections import OrderedDict
testing_mode = False
hide_warnings = False
build = True
for arg in sys.argv[1:]:
if arg.lower() == "test":
testing_mode = True
elif arg.lower() == "whide":
hide_warnings = True
elif arg.lower() == "no-build":
b... | {
"content_hash": "e5067adc97fb514a27feec5337585db0",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 83,
"avg_line_length": 35.82727272727273,
"alnum_prop": 0.5790408525754884,
"repo_name": "perlinm/qcdg-nv-simulation",
"id": "50434884813a99227359d017fa87419a3deee665",
"s... |
import lldb
import fblldbbase as fb
import fblldbobjcruntimehelpers as runtimeHelpers
def flushCoreAnimationTransaction():
fb.evaluateEffect('[CATransaction flush]')
def setViewHidden(object, hidden):
fb.evaluateEffect('[{} setHidden:{}]'.format(object, int(hidden)))
flushCoreAnimationTransaction()
def maskVi... | {
"content_hash": "40ccf84dda67ed6b8b00e7c8ccf03d58",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 185,
"avg_line_length": 42.299065420560744,
"alnum_prop": 0.6944321696862572,
"repo_name": "dopcn/chisel",
"id": "f5f05830507e49bba9ccc5a1ac6743eeefe59cc1",
"size": "4833"... |
"""Get stats about your activity.
Example:
- my_activity.py for stats for the current week (last week on mondays).
- my_activity.py -Q for stats for last quarter.
- my_activity.py -Y for stats for this year.
- my_activity.py -b 4/5/12 for stats since 4/5/12.
- my_activity.py -b 4/5/12 -e 6/7/12 for stats... | {
"content_hash": "703dff1d26cab825026942e8e70d7c33",
"timestamp": "",
"source": "github",
"line_count": 751,
"max_line_length": 80,
"avg_line_length": 33.435419440745676,
"alnum_prop": 0.6205495818399044,
"repo_name": "kevinkindom/chrome_depto_tools",
"id": "17cb4cf83b1f555bc5cfd56497a77bebcbab2ffa",... |
import logging
from typing import Any
from django.apps import AppConfig
from django.conf import settings
from django.core.cache import cache
from django.db.models.signals import post_migrate
def flush_cache(sender: AppConfig, **kwargs: Any) -> None:
logging.info("Clearing memcached cache after migrations")
c... | {
"content_hash": "b15b0807a37ea0d6d22db8e102a7f82f",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 70,
"avg_line_length": 31.79310344827586,
"alnum_prop": 0.7006507592190889,
"repo_name": "punchagan/zulip",
"id": "587eb084030b4e8432361a27664a6745aa92ad5f",
"size": "922",... |
from swgpy.object import *
def create(kernel):
result = Static()
result.template = "object/static/particle/shared_pt_miasma_of_fog_orange.iff"
result.attribute_template_id = -1
result.stfName("obj_n","unknown_object")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "66d6f6b8e5e3022de7a932d55094f917",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 78,
"avg_line_length": 23.615384615384617,
"alnum_prop": 0.6905537459283387,
"repo_name": "anhstudios/swganh",
"id": "6d304a714ac58fdf5585881ac4a308613d6cbc5c",
"size": "45... |
from raw_to_ass import Raw_to_ass_parser
import os.path #exists
import sys #exit and argv
import codecs #to write utf-8 output
import kuplett_parser
import diff_tool
from meta_parser import get_metadata
from preprocess import preprocess_ass
def wiki_to_text(username,password,outputdir,sourcefile):
lyrics=kuplett_p... | {
"content_hash": "d6b7b87f297a4f6ad20d0b50617d39d5",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 104,
"avg_line_length": 36.77777777777778,
"alnum_prop": 0.6487915407854985,
"repo_name": "ITNano/WikiSubtitleReader",
"id": "248581488ed2fad0f1f2cfa0461d5313ae502a33",
"si... |
import sys,os
current_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(os.path.join(current_dir, '../'))
from coincheck.account import Account
from coincheck import settings
def test_get_info():
a1 = Account(access_key=settings.access_key, secret_key=settings.secret_key)
retur... | {
"content_hash": "d737dd2fc54a445ad5f8896ff19a8037",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 80,
"avg_line_length": 28.526315789473685,
"alnum_prop": 0.6974169741697417,
"repo_name": "kmn/coincheck",
"id": "d5bcb55e9f950b63d12b9283ac69c108c6613399",
"size": "542",
... |
"""Discover and load entry points from installed packages."""
# Copyright (c) Thomas Kluyver and contributors
# Distributed under the terms of the MIT license; see LICENSE file.
from contextlib import contextmanager
import glob
from importlib import import_module
import io
import itertools
import os.path as osp
import... | {
"content_hash": "84b9659e0692b2592421bbf619ad49d8",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 87,
"avg_line_length": 32.544186046511626,
"alnum_prop": 0.5755323710161497,
"repo_name": "unnikrishnankgs/va",
"id": "526f8df23e70e41252defff4e6d348d2d4410290",
"size": "... |
import sqlite3
conn = sqlite3.connect('twitter.db')
c = conn.cursor()
c.execute('''create table tweets (
id INTEGER PRIMARY KEY,
created_at TIMESTAMP,
text TEXT,
in_reply_to_screen_name TEXT,
in_reply_to_status_id INTEGER,
in_reply_to_user_id INTEGER,
retweet_count INTEGER,
retweeted B... | {
"content_hash": "fc075be4184c32aae13551bc47c5076b",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 36,
"avg_line_length": 19.363636363636363,
"alnum_prop": 0.6643192488262911,
"repo_name": "quarkness/twitterbackup",
"id": "9a33030fad75dafbf2afa5ce8dfea883622dea91",
"size... |
import datetime as dt
import itertools
import logging
import re
import urlparse
import bson
import pytz
import itsdangerous
from modularodm import fields, Q
from modularodm.exceptions import NoResultsFound
from modularodm.exceptions import ValidationError, ValidationValueError, QueryException
from modularodm.validato... | {
"content_hash": "d8f3a9f475a174ac896f81bfdebf1905",
"timestamp": "",
"source": "github",
"line_count": 1429,
"max_line_length": 157,
"avg_line_length": 36.423372988103566,
"alnum_prop": 0.6083306115391266,
"repo_name": "asanfilippo7/osf.io",
"id": "dc674f4e3f05ce0d61c4042b6f0b700e857217c6",
"size"... |
def extractExplore(item):
"""
Explore
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol or frag) or 'preview' in item['title'].lower():
return None
chp_prefixes = [
('geww ', 'Ghost Emperor Wil... | {
"content_hash": "0a4e9671ade387cf30929e09749b73c1",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 176,
"avg_line_length": 77.45161290322581,
"alnum_prop": 0.4743856726364015,
"repo_name": "fake-name/ReadableWebProxy",
"id": "4a2e4cfce434777f8c284d2d5b257df394d9ca07",
"s... |
import os
import sys
from mozlog.structured import structuredlog, commandline
from .. import wptcommandline
from update import WPTUpdate
def remove_logging_args(args):
"""Take logging args out of the dictionary of command line arguments so
they are not passed in as kwargs to the update code. This is particu... | {
"content_hash": "8f5da984c4a8d433b2a68e7ba72bdbd1",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 83,
"avg_line_length": 28.70212765957447,
"alnum_prop": 0.6968124536693847,
"repo_name": "youtube/cobalt",
"id": "497cb34ad0cb2ecfa0efd4cf059158b0b5f85ebd",
"size": "1349",... |
"""
Django settings for website project.
Generated by 'django-admin startproject' using Django 1.11.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os... | {
"content_hash": "0cd7dc1ac707e363a05b59f42c5eb327",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 91,
"avg_line_length": 25.53968253968254,
"alnum_prop": 0.6817899316345556,
"repo_name": "DevChrisCross/TwoPhaseSimplexMethod",
"id": "637c9b6c3f7ece4928e04a62f495de39040c5c... |
from __future__ import with_statement
import ConfigParser, os
confFilePath = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'agents.ini')
cfgp = ConfigParser.ConfigParser()
with open(confFilePath) as file:
cfgp.readfp(file)
for module_name in cfgp.sections():
mod = __import__('popserver.agents', gl... | {
"content_hash": "ad1b5f49e3e4728910cf9c2f27589ff1",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 89,
"avg_line_length": 29.03846153846154,
"alnum_prop": 0.6980132450331126,
"repo_name": "santisiri/popego",
"id": "5b01ab0f7141d924801f76d0e7adeb13e8ce6efd",
"size": "1226... |
from os import path
import test
from pymake2 import *
#---------------------------------------
# SCRIPT
#---------------------------------------
r = run_program('python', ['--version'])
test.equal(r, 0, 'run_program() returned incorrect value')
test.success()
| {
"content_hash": "ae0b69007d88142460fb55359b59378e",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 58,
"avg_line_length": 18.928571428571427,
"alnum_prop": 0.47924528301886793,
"repo_name": "philiparvidsson/pymake2",
"id": "d83e8cc1a2ac183650c82ee6c6d55624f448f1cc",
"siz... |
import os
import sys
import glob
import subprocess
# Parse execs from command line arguments
def parse_execs():
exs = []
i=4
while i<len(sys.argv):
line = sys.argv[i]
ex = line.split(';')
exs.append(ex)
i+=1
return exs
# This print function detects if stdout is redirect... | {
"content_hash": "54ba06223aa21dd32f11d24753ee72a4",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 91,
"avg_line_length": 30.18421052631579,
"alnum_prop": 0.5727986050566696,
"repo_name": "bsaleil/lc",
"id": "0dabd80258ad129492b78fa7782716e4ad0bb353",
"size": "2294",
"... |
"""Process data transforming the original one."""
# pylint: disable=C0103
from math import gcd
import numpy as np
from scipy import stats
from scipy.interpolate import interp1d
TYPE = 'mode'
# TYPE = 'lcm'
# lcm calculation
def lcm(a, b):
"""Least common multiple."""
return a * b // gcd(a, b)
# read the orig... | {
"content_hash": "858e96f83019510ecaa87ac623328d89",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 62,
"avg_line_length": 28.68421052631579,
"alnum_prop": 0.6519877675840978,
"repo_name": "msilvestro/dupin",
"id": "064261ffa9d981928abd5def6b4965287c1514e0",
"size": "1635... |
from test_framework.test_particl import ParticlTestFramework
import time
class MultiWalletTest(ParticlTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 3
self.extra_args = [ ['-debug','-noacceptnonstdtxn','-reservebalance=10000000','-stakethreadcondde... | {
"content_hash": "323d6c678b3381ba564ee8d098ef921c",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 148,
"avg_line_length": 39.671875,
"alnum_prop": 0.6136274123670736,
"repo_name": "particl/particl-core",
"id": "9a1a46e32321e2ffaca0066cb7732cbdeec7638e",
"size": "5299",... |
from devp2p.service import BaseService
from ethereum.slogging import get_logger
log = get_logger('db')
# load available databases
dbs = {}
try:
from leveldb_service import LevelDB
except ImportError:
pass
else:
dbs['LevelDB'] = LevelDB
try:
from codernitydb_service import CodernityDB
except ImportErr... | {
"content_hash": "bf78cdee7508f8b608cee33e7cbc28bf",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 88,
"avg_line_length": 22.5,
"alnum_prop": 0.6333333333333333,
"repo_name": "danielnovy/test",
"id": "c077c975b3b31b8ece0dadf324da56106fa61223",
"size": "1440",
"binary":... |
import logging
import sys
import unicodedata
from ambari_client.core import errors
LOG = logging.getLogger(__name__)
ref_dic = {"cluster_name": "clusterRef"}
ref_class_dic = {"ClusterModelRef": "cluster_name"}
ref_pkg_dic = {"ClusterModelRef": "ambari_client.model.cluster"}
LIST_KEY = "items"
ALL = "ALL"
class Mod... | {
"content_hash": "19677a0e21a44d34ff7320d1d6d7be72",
"timestamp": "",
"source": "github",
"line_count": 299,
"max_line_length": 87,
"avg_line_length": 31.391304347826086,
"alnum_prop": 0.5124653739612188,
"repo_name": "radicalbit/ambari",
"id": "65dd153e47692d3c743040bf5bc5587924951f49",
"size": "1... |
"""Tests for Efergy integration."""
from unittest.mock import AsyncMock, patch
from pyefergy import Efergy, exceptions
from homeassistant.components.efergy import DOMAIN
from homeassistant.const import CONF_API_KEY
from homeassistant.core import HomeAssistant
from homeassistant.helpers.aiohttp_client import async_get... | {
"content_hash": "beb05a000b5126a539e8228f244e19f0",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 86,
"avg_line_length": 32.605095541401276,
"alnum_prop": 0.6645829263528032,
"repo_name": "jawilson/home-assistant",
"id": "c4f099df82246f1e21ae53e366be32b872ff3cfb",
"siz... |
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tweets', '0002_auto_20170123_1154'),
]
operations = [
migrations.AlterField(
model_name='timeline'... | {
"content_hash": "edf5615bd26266139b4137eb127b71fd",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 127,
"avg_line_length": 26.473684210526315,
"alnum_prop": 0.6520874751491054,
"repo_name": "chocoelho/twitter-activities-monitor",
"id": "a018a1f21b4da66dee83938a4c0acd46b844... |
from indy import wallet, signus
from ..utils import storage
from ..utils.wallet import create_and_open_wallet
import pytest
import logging
logging.basicConfig(level=logging.DEBUG)
@pytest.fixture(autouse=True)
def before_after_each():
storage.cleanup()
yield
storage.cleanup()
@pytest.fixture
async de... | {
"content_hash": "1d133263ced5e4f758c09ffd0da690a8",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 83,
"avg_line_length": 21.357142857142858,
"alnum_prop": 0.7441471571906354,
"repo_name": "MRJCrunch/indy-sdk",
"id": "ad45f881aa03a5fcc6d5922973a590033a2fb081",
"size": "5... |
import _plotly_utils.basevalidators
class ValueValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="value", parent_name="cone.colorbar.tickformatstop", **kwargs
):
super(ValueValidator, self).__init__(
plotly_name=plotly_name,
parent... | {
"content_hash": "ef12a85f372cc697776b239ad5348341",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 87,
"avg_line_length": 34,
"alnum_prop": 0.6029411764705882,
"repo_name": "plotly/python-api",
"id": "6ebe58686070d5a5450945e49aa3efd8f18a10ff",
"size": "476",
"binary": ... |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_... | {
"content_hash": "ba2dd84db4dfd3e9464f006a27eb32e7",
"timestamp": "",
"source": "github",
"line_count": 316,
"max_line_length": 656,
"avg_line_length": 34.199367088607595,
"alnum_prop": 0.6900157305450171,
"repo_name": "benfinke/ns_python",
"id": "1e26d3f52cdb94032aa2b6992ebdc13507f5049f",
"size": ... |
"""
Make sure macro expansion of $(TargetFileName) is handled.
"""
from __future__ import print_function
import TestGyp
import os
import sys
if sys.platform == 'win32':
print("This test is currently disabled: https://crbug.com/483696.")
sys.exit(0)
test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
if not (... | {
"content_hash": "2eee13989d6963421a3cf0a3ccc99422",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 81,
"avg_line_length": 36,
"alnum_prop": 0.6353046594982079,
"repo_name": "msc-/gyp",
"id": "759e26c5669b2e2bbfcdfbb238bdd1ca5d1f7758",
"size": "1296",
"binary": false,
... |
import shutil
import unittest
from typing import Optional
import cothread
import numpy as np
import pytest
from annotypes import Anno, add_call_types
from scanpointgenerator import (
CompoundGenerator,
ConcatGenerator,
LineGenerator,
StaticPointGenerator,
)
from malcolm.compat import OrderedDict
from ... | {
"content_hash": "e5c8a69313a22030caa10867c08a2e38",
"timestamp": "",
"source": "github",
"line_count": 1786,
"max_line_length": 88,
"avg_line_length": 33.46248600223964,
"alnum_prop": 0.5869085067933874,
"repo_name": "dls-controls/pymalcolm",
"id": "c9041d2d562981c373c7c555886c21ef2263fde5",
"size... |
import logging
import optparse
import sys
import tempfile
import unittest
from webkitpy.common.system.executive import Executive, ScriptError
from webkitpy.common.system import executive_mock
from webkitpy.common.system.filesystem_mock import MockFileSystem
from webkitpy.common.system.outputcapture import OutputCaptur... | {
"content_hash": "6f16c0e77cd84460db1772606bc7c3ab",
"timestamp": "",
"source": "github",
"line_count": 442,
"max_line_length": 211,
"avg_line_length": 46.7262443438914,
"alnum_prop": 0.6348714472473732,
"repo_name": "ondra-novak/blink",
"id": "319de1e82c76bf1734c9db403f816127ab246438",
"size": "22... |
"""Lexer for bib(la)tex.
Port of the lexer from bibtex-ruby with a few changes. This lexer also supports
parentheses instead of braces for string, preamble and comment entries, e.g.
'@string(var = 1)' and generates tokens rather returning a list.
"""
from bibpy.lexers.base_lexer import BaseLexer
# A custom lexer i... | {
"content_hash": "e176789e22b7ba2f5e4a50d30d24597b",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 79,
"avg_line_length": 32.92265193370166,
"alnum_prop": 0.4846450746769592,
"repo_name": "MisanthropicBit/bibpy",
"id": "56ce80f5374a8e3013c287802c78061fa098cb40",
"size":... |
"""Tests for the Mac OS X preprocess plug-ins."""
import os
import unittest
from dfvfs.helpers import file_system_searcher
from dfvfs.path import fake_path_spec
from plaso.artifacts import knowledge_base
from plaso.preprocessors import macosx
from plaso.preprocessors import test_lib
class MacOSXBuildTest(test_lib.... | {
"content_hash": "4838ef68d88f993667f3f2969cb51293",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 79,
"avg_line_length": 34.97549019607843,
"alnum_prop": 0.6613875262789068,
"repo_name": "cvandeplas/plaso",
"id": "5e80c7b1da77823c71a8e1c2e05fbdcdb9531b08",
"size": "783... |
"""Wordcount exercise
Google's Python class
The main() below is already defined and complete. It calls print_words()
and print_top() functions which you write.
1. For the --count flag, implement a print_words(filename) function that counts
how often each word appears in the text and prints:
word1 count1
word2 count2
... | {
"content_hash": "1a50b4c77237459b71f5a2726dbfe79c",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 108,
"avg_line_length": 33.08196721311475,
"alnum_prop": 0.6778989098116948,
"repo_name": "beepscore/google-python-exercises",
"id": "ecb30f7b4acf9803f47a0bdad0e211c4b1744b1... |
import unittest
import warnings
import sys
import IECore
warnings.simplefilter( "error", DeprecationWarning )
from ClassLoader import *
from AttributeCache import *
from BlindDataHolder import *
from CompoundData import *
from CompoundObject import *
from Imath import *
from ImathVectorData import *
from IndexedIO i... | {
"content_hash": "1a21d7aff42c76baddd56aca30f2567a",
"timestamp": "",
"source": "github",
"line_count": 264,
"max_line_length": 105,
"avg_line_length": 34.51136363636363,
"alnum_prop": 0.8632422346613983,
"repo_name": "code-google-com/cortex-vfx",
"id": "d907c80a7fc999fd972146e0dc48f7a1a15ed1d3",
"... |
from unittest import TestCase
from pecanraw import RawHook
from pecan import make_app, expose
from webtest import TestApp
class TestHooks(TestCase):
def test_basic_single_hook(self):
run_hook = []
class RootController(object):
@expose()
def index(self):
... | {
"content_hash": "955a6efc195e4d6c2cfd2d8c5c445d7c",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 68,
"avg_line_length": 32.06060606060606,
"alnum_prop": 0.5274102079395085,
"repo_name": "alfredodeza/pecan-raw",
"id": "32c4da3cc88030bf33d7c188e94920a34434720f",
"size": ... |
from contextlib import contextmanager
import inspect
from itertools import chain
import os
from django.conf import settings
from django.template.base import Lexer, TOKEN_BLOCK
from django.utils.decorators import method_decorator
from django.utils.termcolors import colorize
from sekizai.helpers import validate_template... | {
"content_hash": "2ed7056da47cb19dc4ada2e48d331889",
"timestamp": "",
"source": "github",
"line_count": 397,
"max_line_length": 404,
"avg_line_length": 43.86146095717884,
"alnum_prop": 0.62579681846896,
"repo_name": "keimlink/django-cms",
"id": "c75164080e6f8daec33110a4d17a46a0e0d0785d",
"size": "1... |
import copy
import errno
import json
import os
import time
import urllib
from tempest_lib.common.utils import misc as misc_utils
from tempest_lib import exceptions as lib_exc
from tempest.common import glance_http
from tempest.common import service_client
from tempest import exceptions
from tempest.openstack.common i... | {
"content_hash": "b765b787a90552c2d021880c503a95c5",
"timestamp": "",
"source": "github",
"line_count": 309,
"max_line_length": 79,
"avg_line_length": 37.32686084142395,
"alnum_prop": 0.5464713022368649,
"repo_name": "rzarzynski/tempest",
"id": "01a9c54ecb76716226b570b7b26fef2a213eb2eb",
"size": "1... |
from setuptools import setup, PEP420PackageFinder
setup(
name='tangled.travisty',
version='0.1.dev0',
description='Tangled travisty integration (core)',
long_description=open('README.rst').read(),
url='http://tangledframework.org/',
author='Wyatt Baldwin',
author_email='[email protected]... | {
"content_hash": "80e0a3e3c5bc7218ec86f87c8af5bf2e",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 59,
"avg_line_length": 26.21875,
"alnum_prop": 0.600715137067938,
"repo_name": "TangledWeb/tangled.travisty",
"id": "1a95fc721171ab7ceaa4755cc38d66ae5a945b1f",
"size": "839... |
from collections import namedtuple
###############
# Structs #
###############
# Request payloads
ProduceRequest = namedtuple("ProduceRequest",
["topic", "partition", "messages"])
FetchRequest = namedtuple("FetchRequest",
["topic", "partition", "offset", "max... | {
"content_hash": "532d0de3a9da3437cbf82d9de1dc11c5",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 146,
"avg_line_length": 23.94312796208531,
"alnum_prop": 0.6597387173396675,
"repo_name": "Livefyre/kafka-python",
"id": "b222e19bbaf2977b6535d35e1dfbe5a5c8ccd807",
"size"... |
from __future__ import division
from io import BytesIO
import pytest
from pyglet import gl, image
from ...annotations import Platform, require_platform, require_gl_extension
from ...base.event_loop import EventLoopFixture
class ImageTestFixture(EventLoopFixture):
def __init__(self, request, test_data):
... | {
"content_hash": "8ea4c0e28a03c032bcf28a530dc46eda",
"timestamp": "",
"source": "github",
"line_count": 335,
"max_line_length": 96,
"avg_line_length": 36.22686567164179,
"alnum_prop": 0.6462590639419907,
"repo_name": "nicememory/pie",
"id": "831e28923b7501db0b2388b850fd84073d943f8c",
"size": "12136... |
import unittest
from should_dsl import should, should_not
from fluidity import StateMachine, state, transition
from fluidity import InvalidTransition
class MyMachine(StateMachine):
initial_state = 'created'
state('created')
state('waiting')
state('processed')
state('canceled')
transition(fr... | {
"content_hash": "9620aaab582cb94fb2752f9701f8e18c",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 96,
"avg_line_length": 30.677966101694917,
"alnum_prop": 0.6607734806629835,
"repo_name": "nsi-iff/fluidity",
"id": "b8036df6ff1ae4e517b9f6dab1e2ba01f6f8a8d5",
"size": "181... |
import MySQLdb
db = MySQLdb.connect(user="beeruser",db="beerdb")
c = db.cursor()
c.execute("""SELECT now()-Time, Flag from Times WHERE ID = 5""")
#print c.fetchall()[0][0]
[time_on, state] = c.fetchone()
print time_on
print state
#c.execute("""UPDATE Times SET Time=Now(), Flag = 1 WHERE ID = %s""",(self.dbid))
#db.c... | {
"content_hash": "3d50c37273b4316e075c69bfe9b6e8f3",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 81,
"avg_line_length": 27.333333333333332,
"alnum_prop": 0.6554878048780488,
"repo_name": "Wollert/beer",
"id": "d64a4547e4f10d8d161a637c8313fba4dd63fd44",
"size": "328",
... |
__author__ = 'Davide Monfrecola'
import requests
import json
from phantomrestclient import auth
class PhantomRequests():
def __init__(self):
self.auth = auth.PhantomAuth()
self.api_url = 'https://phantom.nimbusproject.org/api/dev'
self.access_token = self.auth.read_token_from_file()
... | {
"content_hash": "d3d077046a015392153d5e9ccf713882",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 88,
"avg_line_length": 33.811764705882354,
"alnum_prop": 0.5894224077940153,
"repo_name": "trampfox/nimbus-phantom-rest-client",
"id": "1ce2fb5baa10fc1a1933642484e911da36103d... |
"""
Default Controllers
"""
# -----------------------------------------------------------------------------
def index():
"""
Main Home Page
"""
auth.settings.register_onvalidation = _register_validation
auth.configure_user_fields()
current.menu.oauth = S3MainMenu.menu_oauth()
pag... | {
"content_hash": "8f2e4e2e5be074f89dfed7ed76b8826b",
"timestamp": "",
"source": "github",
"line_count": 1678,
"max_line_length": 225,
"avg_line_length": 35.88140643623361,
"alnum_prop": 0.45612782142204655,
"repo_name": "flavour/eden",
"id": "3f20cbc90f18cf17a9d20e1a59a911e5abb9e7a0",
"size": "6023... |
import mdsclient
from plugins.contracts import ICartridgeAgentPlugin
from xml.dom.minidom import parse
import socket
from modules.util.log import LogFactory
import time
import subprocess
import os
class WSO2ISMetaDataHandler(ICartridgeAgentPlugin):
def run_plugin(self, values):
log = LogFactory().get_log... | {
"content_hash": "00cb9a74636052e3d4232b39d6c2cac8",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 155,
"avg_line_length": 43.54545454545455,
"alnum_prop": 0.6194452728899493,
"repo_name": "pubudu538/stratos",
"id": "0a7a2d4845bcec9c2bbb4aeeb41fd328ba939f4d",
"size": "7... |
import time
from vtdb import field_types
from vtdb import dbexceptions
from vtdb import tablet as tablet_conn
from vtdb import cursor
import framework
import nocache_cases
import environment
import utils
class TestNocache(framework.TestCase):
def test_data(self):
cu = self.env.execute("select * from vtocc_test... | {
"content_hash": "42475eee0583afc04f01b2e8eb3377f6",
"timestamp": "",
"source": "github",
"line_count": 698,
"max_line_length": 188,
"avg_line_length": 46.289398280802295,
"alnum_prop": 0.6718043949241721,
"repo_name": "skyportsystems/vitess",
"id": "f76b6ec8522c04ae502a65b6b77ada2ad3025d37",
"size... |
from netmiko.cisco_base_connection import CiscoSSHConnection
class CiscoS300Base(CiscoSSHConnection):
"""
Support for Cisco SG300 series of devices.
Note, must configure the following to disable SG300 from prompting for username twice:
configure terminal
ip ssh password-auth
"""
def ses... | {
"content_hash": "11b36e9840d3eecdb7150d2001374177",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 90,
"avg_line_length": 27.674418604651162,
"alnum_prop": 0.6563025210084034,
"repo_name": "ktbyers/netmiko",
"id": "1058c4a3b5a34f435665f9e3d1f33f23a46c29f9",
"size": "1190... |
import traceback
import sublime
import sublime_plugin
from anaconda_go.lib import go
from anaconda_go.lib.plugin import typing
from anaconda_go.lib.helpers import get_settings, get_scope
from anaconda_go.lib.plugin import Worker, Callback, ExplorerPanel, is_code
class AnacondaGoCallers(sublime_plugin.TextCommand):
... | {
"content_hash": "6f9dcde04775353e43ca1e037f6ce21c",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 92,
"avg_line_length": 31.445544554455445,
"alnum_prop": 0.5214105793450882,
"repo_name": "danalec/dotfiles",
"id": "65fa4fe8fd11a42e5bf8f0ea420e29349d1731ee",
"size": "33... |
from CIM15.CDPSM.Connectivity.IEC61970.Wires.Switch import Switch
class Fuse(Switch):
"""An overcurrent protective device with a circuit opening fusible part that is heated and severed by the passage of overcurrent through it. A fuse is considered a switching device because it breaks current.
"""
def __in... | {
"content_hash": "5709522ee98a6d0b8c8693dc7740fee8",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 211,
"avg_line_length": 30.05263157894737,
"alnum_prop": 0.6234676007005254,
"repo_name": "rwl/PyCIM",
"id": "d2cc1a63ef7a2378d83f7f35fd5e725364b05384",
"size": "1671",
"... |
"""Simple MNIST classifier example with JIT XLA and timelines.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import sys
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
from tensorflow.python.client ... | {
"content_hash": "7631e8304ac0487c4b4c58e6c053f57e",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 77,
"avg_line_length": 32.10752688172043,
"alnum_prop": 0.6510381781647689,
"repo_name": "tomasreimers/tensorflow-emscripten",
"id": "bf3f2fb015ff782f2866c7eb6147ce6d68e72a1e... |
'''
This is a custom module used to calculate what the user inputs
'''
def subtract (List):
retval = List[0]
for item in List[1:]:
retval -= item
return retval
def multiply (List):
retval = 1
for item in List:
retval *= item
return retval
def divide (List):
retval = List[0]... | {
"content_hash": "868bc291d75b9e8b9ba6cc38157db4ab",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 85,
"avg_line_length": 26.09375,
"alnum_prop": 0.592814371257485,
"repo_name": "hookoored/Emalplip",
"id": "b7bf1e9717692ec7fc69be60d7f0c414c9132a53",
"size": "835",
"bin... |
{
'name': 'Uruguay - Chart of Accounts',
'version': '0.1',
'author': 'Uruguay l10n Team & Guillem Barba',
'category': 'Localization/Account Charts',
'website': 'https://launchpad.net/openerp-uruguay',
'description': """
General Chart of Accounts.
==========================
Provide Templates for... | {
"content_hash": "0a0ed7e840dad84747a430b96b6698aa",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 79,
"avg_line_length": 28.20689655172414,
"alnum_prop": 0.5904645476772616,
"repo_name": "chjw8016/GreenOdoo7-haibao",
"id": "2a6f10ddb2984ad2b44e2450f22a494d616cc369",
"si... |
import shutil
from subprocess import check_call, CalledProcessError
from .read import get_names
def has_interface_column(tab_file):
'''
Returns True if the tabular output file has the v6.1 'interface' column.
'''
try:
val = get_names(tab_file)[1] == 'interface'
except IOError:
rais... | {
"content_hash": "1b892bc38b1e147f8be862fc86b89184",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 76,
"avg_line_length": 27.90566037735849,
"alnum_prop": 0.6098715348208249,
"repo_name": "mcflugen/dakota-experiments",
"id": "05721b2c45f9244bcea2793a28b4fde203733380",
"s... |
"""
Definition of Interval.
"""
class Interval(object):
def __init__(self, start, end):
self.start = start
self.end = end
class Solution:
"""
@param list1: one of the given list
@param list2: another list
@return: the new sorted list of interval
"""
def mergeTwoInterval(self... | {
"content_hash": "76363460f9ff4eaf67b97f62751cdbdd",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 76,
"avg_line_length": 30.646341463414632,
"alnum_prop": 0.49144448865897333,
"repo_name": "euccas/CodingPuzzles-Python",
"id": "ce5acf4b3fb3023b1e6e4f9d2dc299856bb95d80",
... |
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | {
"content_hash": "0435d2cb7a3fce83409f25201a7cad39",
"timestamp": "",
"source": "github",
"line_count": 6891,
"max_line_length": 934,
"avg_line_length": 63.97155710346829,
"alnum_prop": 0.60408367889517,
"repo_name": "Chiru/NVE_Simulation",
"id": "bafc41d9800f06c694af324c2cb3971882f78ac4",
"size": ... |
import collections
import copy
import netaddr
from neutron_lib import constants
from neutron_lib import exceptions
from oslo_config import cfg
from oslo_log import log as logging
from oslo_policy import policy as oslo_policy
from oslo_utils import excutils
import six
import webob.exc
from neutron._i18n import _, _LE,... | {
"content_hash": "b158a9cec3759c3551415f7e4ac04979",
"timestamp": "",
"source": "github",
"line_count": 723,
"max_line_length": 79,
"avg_line_length": 46.66113416320885,
"alnum_prop": 0.553385107896609,
"repo_name": "bigswitch/neutron",
"id": "84f9cb05ed72a752b0db650e14981d7275aaac3f",
"size": "343... |
from django.contrib.auth.hashers import make_password
from django.contrib.auth.models import (
AbstractBaseUser,
python_2_unicode_compatible,
UserManager,
)
from django.core.exceptions import ValidationError
from django.core.mail import send_mail
from django.utils.http import urlquote
from django.db import ... | {
"content_hash": "f58ad129640aca76dcf458ff57d8b295",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 100,
"avg_line_length": 39.48407643312102,
"alnum_prop": 0.6371995483142442,
"repo_name": "grzes/djangae",
"id": "07bbc95141670ae7ced299ce6f79dcaa37927c2e",
"size": "6213"... |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(name='gwas_wrapper',
version='0.1',
description='Python wrapper for interacting with the NHGRI-EBI GWAS Catalog',
license='MIT',
keywords=['gwas', 'genomics', 'snp', 'bioinformatics'],
classifiers=[
'Program... | {
"content_hash": "7b3fabc252eddc0cc4ea85412ced74f1",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 80,
"avg_line_length": 32.45,
"alnum_prop": 0.6949152542372882,
"repo_name": "arvkevi/gwas_wrapper",
"id": "ec4773d721abb12a38953daeb8d501dcfc47ea34",
"size": "674",
"bin... |
""" GlusterFS native protocol (glusterfs) driver for shares.
Test cases for GlusterFS native protocol driver.
"""
import ddt
import mock
from oslo_config import cfg
from manila.common import constants
from manila import context
from manila import exception
from manila.share import configuration as config
from manila... | {
"content_hash": "a823ab8083b128846eff105d5191b3a7",
"timestamp": "",
"source": "github",
"line_count": 345,
"max_line_length": 78,
"avg_line_length": 42.44347826086957,
"alnum_prop": 0.5702383391381548,
"repo_name": "scality/manila",
"id": "bb0f27eb878626a5bd5798cf47aab678d7cf75d2",
"size": "15276... |
from django.shortcuts import render_to_response
from django.template import RequestContext
def index(request):
return render_to_response('demo/index.html', {}, context_instance=RequestContext(request))
| {
"content_hash": "c121358afe34912ae5778806298a679c",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 94,
"avg_line_length": 34.666666666666664,
"alnum_prop": 0.7932692307692307,
"repo_name": "QLGu/django-salted",
"id": "e0136c2d80365843863a8eb464e920663fb1a1c1",
"size": "20... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import abc
from collections import namedtuple
import six
import tensorflow as tf
from tensorflow.python.ops import data_flow_ops
import pdb
def _all_reduce_using_copy(tensors_across_devices, use_mean):
""... | {
"content_hash": "4a3ba248ae17e937704bd018e6ca0ff1",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 79,
"avg_line_length": 35.424528301886795,
"alnum_prop": 0.6836218375499334,
"repo_name": "neuroailab/tfutils",
"id": "cade0ff18cc1a484a677f0e6e7d2b8c7db65a455",
"size": "... |
from closable_admin_filter.mixins import AdminClosableFilterMixin
VERSION = "0.1.1" | {
"content_hash": "34bf33c9461440fd9ef11d08cb646ee6",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 65,
"avg_line_length": 28,
"alnum_prop": 0.8214285714285714,
"repo_name": "eternalfame/django-closable_admin_filter",
"id": "b2d78562db9ec64c12ba25da3936e31cc4fb068b",
"size... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.