text stringlengths 4 1.02M | meta dict |
|---|---|
import json
import os
from core.AbstractConfig import AbstractConfig
__author__ = 'sweet'
# rootDir = os.path.join(os.path.split(os.path.realpath(__file__))[0], '..')
# config_path = os.path.join(rootDir, 'config', 'autosign.conf')
class JsonConfig(AbstractConfig):
def __init__(self, config_path):
sel... | {
"content_hash": "4350c480ad76a9679d4b0cc745227f5a",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 78,
"avg_line_length": 26.28205128205128,
"alnum_prop": 0.5980487804878049,
"repo_name": "john123951/gold.icbc.watcher",
"id": "9e4ab0303b352d1284a9d16ab8d7a40a69448c3f",
"... |
"""Support for Z-Wave."""
import asyncio
import copy
from importlib import import_module
import logging
from pprint import pprint
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.core import callback, CoreState
from homeassistant.helpers import discovery
from homeassistant.helpers.... | {
"content_hash": "15ee015aa46b2c97370ec0891e40fad2",
"timestamp": "",
"source": "github",
"line_count": 1318,
"max_line_length": 88,
"avg_line_length": 35.15857359635812,
"alnum_prop": 0.5876475538962861,
"repo_name": "Cinntax/home-assistant",
"id": "841b283a98dd1fa1aec7bfb3460643ac404ddb18",
"size... |
import nnabla.functions as F
def roi_align_backward(grad_inputs, inputs, input_shapes, outputs, output_shapes, output_size=(1, 1), spatial_scale=None, sampling_ratio=None, aligned=None, channel_last=False):
"""
Args:
grad_inputs (list of :obj:`nnabla.Variable`): Propagated grads to this backward functio... | {
"content_hash": "d3d26eab195d3b371961a01f18d0eec7",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 177,
"avg_line_length": 57.08695652173913,
"alnum_prop": 0.7075399847677075,
"repo_name": "sony/nnabla",
"id": "4ac122a7af4087d2cdfc867b89e9f69f269be2f5",
"size": "2184",
... |
from statsmodels.tools.parallel import parallel_func
from numpy import arange, testing
from math import sqrt
def test_parallel():
x = arange(10.)
parallel, p_func, n_jobs = parallel_func(sqrt, n_jobs=-1, verbose=0)
y = parallel(p_func(i**2) for i in range(10))
testing.assert_equal(x,y)
| {
"content_hash": "607a1f00525ec877b1ead9d4b30ef722",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 72,
"avg_line_length": 33.77777777777778,
"alnum_prop": 0.7006578947368421,
"repo_name": "bavardage/statsmodels",
"id": "7af5fb28d69728893332fe35c41e645ed398da12",
"size": "... |
import unittest
from airflow import configuration as conf
from airflow.configuration import AirflowConfigException
from airflow.lineage.backend.atlas import AtlasBackend
from airflow.lineage.datasets import File
from airflow.models import DAG, TaskInstance as TI
from airflow.operators.dummy_operator import DummyOperat... | {
"content_hash": "ff9c0bd2352b1e31eb2200ec04f63760",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 72,
"avg_line_length": 31.184615384615384,
"alnum_prop": 0.6151948692649235,
"repo_name": "r39132/airflow",
"id": "5898e683336d53e91a5372b186b6cc59b5109254",
"size": "2838"... |
from django.db.models import Count
from django.test import TestCase
from django.test import Client
from django.urls import reverse
from .models import Card, Dish
class CardTestCase(TestCase):
def setUp(self):
pass # data loaded from fixtures
def test_filter_dishes(self):
dishes = Dish.objec... | {
"content_hash": "1116d2001348bcfc1ed6c50c6b81d74a",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 127,
"avg_line_length": 34.8,
"alnum_prop": 0.6484674329501916,
"repo_name": "mkost/eMenu",
"id": "462c2baa2ca28f58e66986f9e74c25a678f6c88b",
"size": "2088",
"binary": fa... |
"""Corpus backup model"""
from sqlalchemy import Column, Sequence
from sqlalchemy.types import Integer, Unicode, UnicodeText, DateTime
from onlinelinguisticdatabase.model.meta import Base, now
import simplejson as json
class CorpusBackup(Base):
"""Define the corpus backup model.
.. note::
Unlike wit... | {
"content_hash": "011a468183c33b945ad8be3d026dbaa9",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 90,
"avg_line_length": 39.58536585365854,
"alnum_prop": 0.6426370918052988,
"repo_name": "jrwdunham/old",
"id": "9c3fe64bbabbb3db41fc4b926de22c268a752272",
"size": "3830",
... |
import sys, os, warnings
warnings.simplefilter("ignore", DeprecationWarning)
from ncclient import manager
def ericsson_connect(host, port, user, password, device_params):
return manager.connect(host=host,
port=port,
username=user,
pa... | {
"content_hash": "a53f0ba69e974517b8897e6cef662684",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 64,
"avg_line_length": 31.448979591836736,
"alnum_prop": 0.5288773523685918,
"repo_name": "earies/ncclient",
"id": "29e569a9fd6a463cd728f2a3d3fd08a61b7c953c",
"size": "1912... |
"""
===============================================
.. module:: evodjango.i18n.models
:platform: Django
:synopsis:
.. moduleauthor:: (C) 2014 Oliver Gutiérrez
# TODO: Automatic translation support using Google Translate
"""
# Django imports
from django.db import models
from django.utils.translation import g... | {
"content_hash": "baf3b45427b884ade4d52d009971965e",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 97,
"avg_line_length": 30.32608695652174,
"alnum_prop": 0.6204301075268818,
"repo_name": "olivergs/django-sitetools",
"id": "4a952bf042a59350f728e56b542b3cd9d3193347",
"siz... |
import FWCore.ParameterSet.Config as cms
process = cms.Process('FILEFI')
# import of standard configurations
process.load('Configuration/StandardSequences/Services_cff')
process.load('FWCore/MessageService/MessageLogger_cfi')
process.load('Configuration.StandardSequences.GeometryDB_cff')
process.load('Configuration/S... | {
"content_hash": "34a54ebb9adac4ee1c7d94190a6247d7",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 148,
"avg_line_length": 37.875,
"alnum_prop": 0.7185289957567186,
"repo_name": "cpausmit/Kraken",
"id": "642f0e32485f7530c0d0db78517784d1aa247312",
"size": "2187",
"binar... |
from __future__ import absolute_import, print_function
__author__ = 'katharine'
import argparse
import os
import subprocess
import time
from pebble_tool.exceptions import BuildError
from pebble_tool.util.analytics import post_event
import pebble_tool.util.npm as npm
from pebble_tool.commands.sdk.project import SDKPro... | {
"content_hash": "13769960ba8cfc0dcbb970f2b839cb3f",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 120,
"avg_line_length": 37.02150537634409,
"alnum_prop": 0.5660760964275341,
"repo_name": "pebble/pebble-tool",
"id": "d7cd1a44f3abcf9dfd33dbf4e43558d664b68ab5",
"size": "3... |
import logging
import logging.config
import json
import argparse
import jobs
import utils
logger = logging.getLogger(__name__)
run_logger = logging.getLogger('josync_run')
def main():
parser = argparse.ArgumentParser(description='Test e-mail sending of Josync.')
parser.add_argument('address',help='e-mail ad... | {
"content_hash": "ae752707855647f80bac96f52fb40325",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 89,
"avg_line_length": 25.25581395348837,
"alnum_prop": 0.6721915285451197,
"repo_name": "jeinarsson/josync",
"id": "ea550769fb43413305fd2fd4405b84c4a494ce1e",
"size": "108... |
__all__ = ['normal', 'uniform', 'poisson']
from ..defmatrix import *
# Special object used internally to specify the placeholder which will be replaced by output ID
# This helps to provide dml containing output ID in constructSamplingNode
OUTPUT_ID = '$$OutputID$$'
def constructSamplingNode(inputs, dml):
"""
... | {
"content_hash": "64ce1ceb223685fc806c69287063c4e4",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 130,
"avg_line_length": 30.05442176870748,
"alnum_prop": 0.5796740606609325,
"repo_name": "gweidner/systemml",
"id": "ab74250a5dfdf7dce33ede01e815a4d42f35915a",
"size": "5... |
# Copyright (c) 2018, The MITRE Corporation
# All rights reserved
from mixbox import fields
from mixbox import idgen
import maec
from . import _namespace
import maec.bindings.maec_bundle as bundle_binding
from cybox.core.action_reference import ActionReference
from cybox.common.measuresource import Measur... | {
"content_hash": "bc3a76cd1dc56aa9ca06165db6ae983b",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 137,
"avg_line_length": 39.6283185840708,
"alnum_prop": 0.733363108530594,
"repo_name": "MAECProject/python-maec",
"id": "b4dc62e7bf4e51c87562f5c137bad7c4f69637ef",
"size"... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("users", "0015_profile_email_footer")]
operations = [
migrations.AddField(
model_name="user",
name="notify_new_case",
field=models.BooleanField(
defaul... | {
"content_hash": "5c932d2822e578b9812e20fe62d5e842",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 89,
"avg_line_length": 31.51851851851852,
"alnum_prop": 0.54524089306698,
"repo_name": "watchdogpolska/poradnia",
"id": "ba45a74535117f1353329c0d7a8d2f53cf4a7feb",
"size": ... |
from manila.api import common
from manila.common import constants
class ViewBuilder(common.ViewBuilder):
"""Model a server API response as a python dictionary."""
_collection_name = 'security_services'
_detail_version_modifiers = [
'add_ou_to_security_service',
]
def summary_list(self, r... | {
"content_hash": "ee6852bd21f1c725e1d5e80159557a51",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 79,
"avg_line_length": 42.36842105263158,
"alnum_prop": 0.6128364389233955,
"repo_name": "openstack/manila",
"id": "62dd6a976f1218507101dde63bed2672539b807e",
"size": "3045... |
from twisted.internet import defer
from twisted.trial import unittest
from go_api.queue import PausingDeferredQueue
class ImmediateFailureMixin(object):
"""
Add additional assertion methods.
"""
def assertImmediateFailure(self, deferred, exception):
"""
Assert that the given Deferred... | {
"content_hash": "3419dce6f810f612ea1addefda84c23d",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 79,
"avg_line_length": 32.8563829787234,
"alnum_prop": 0.5977011494252874,
"repo_name": "praekelt/go-api-toolkit",
"id": "55cb25b6040eeae015af3cd197d868766fea37de",
"size"... |
import time
import random
def add(x,y):
return x + y
def subtract(x,y):
return x - y
def multiply(x,y):
return x * y
score = 0
operator = 0
question = 0
#This part sets the variables for the question number, score and the operator
print('Welcome to my brilliant maths quiz\n')
time.sleep(1.5)
print()
prin... | {
"content_hash": "60c4f1e1523e73b16320aa23517fcd3f",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 88,
"avg_line_length": 24.88095238095238,
"alnum_prop": 0.6291866028708134,
"repo_name": "Green-octopus678/Computer-Science",
"id": "2028979bb67b4ae80d50a8661f06a385d879e429"... |
from tempest.api.object_storage import base
from tempest import clients
from tempest.common.utils import data_utils
from tempest import config
from tempest import test
CONF = config.CONF
class AccountQuotasTest(base.BaseObjectTest):
@classmethod
def resource_setup(cls):
super(AccountQuotasTest, cls)... | {
"content_hash": "4c8fa4cf107483b64f0c4bbb6d8023a8",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 78,
"avg_line_length": 38.61224489795919,
"alnum_prop": 0.5993657505285412,
"repo_name": "Lilywei123/tempest",
"id": "e75e971b74793a832d7b1b7e4c4f7702b3066ccf",
"size": "44... |
import os
import glob
from .basic_script import BasicScript
class Tlacuilo(BasicScript):
"""Compile the XML code for the workflows based on the given templates and configuration files"""
def get_arguments(self):
"""
Get the arguments to configure current script
:return: list
... | {
"content_hash": "ea6dadc84342fe5381b308fb0e5b622b",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 143,
"avg_line_length": 37.574074074074076,
"alnum_prop": 0.5288319369147363,
"repo_name": "scm-spain/slippin-jimmy",
"id": "7f69bafc3cd4f93131bcc229b70bbc7679c66976",
"si... |
"""
This module defines exceptions for Presto operations. It follows the structure
defined in pep-0249.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import random
import time
import prestodb.logging
logger = prestodb.logging.get_l... | {
"content_hash": "ff52771edb3629cd8e6a75858c8dc324",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 81,
"avg_line_length": 21.676470588235293,
"alnum_prop": 0.5850293984622342,
"repo_name": "ggreg/presto-python-client",
"id": "a30a0759cc1454a478ed1b7569e827449a1bbd6a",
"... |
"""Constants used by the Withings component."""
import homeassistant.const as const
DATA_MANAGER = "data_manager"
BASE_URL = "base_url"
CLIENT_ID = "client_id"
CLIENT_SECRET = "client_secret"
CODE = "code"
CONFIG = "config"
CREDENTIALS = "credentials"
DOMAIN = "withings"
LOG_NAMESPACE = "homeassistant.components.with... | {
"content_hash": "7e79a8810bf8f795012e11c32c6acf9a",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 72,
"avg_line_length": 34.95145631067961,
"alnum_prop": 0.7569444444444444,
"repo_name": "Cinntax/home-assistant",
"id": "79527d9d557be492f7c58aa482433913fb074586",
"size"... |
import AStar
import CommExplore
import ConfigFileReader
# grid = GridWorld.GridWorld(10, 10, [[4, 4], [4, 5]])
# # print grid.get8Neighbors(8, 8)
# aStar = AStar.AStar()
# start = (4, 6)
# goal = (4, 0)
# path, cost = aStar.aStarSearch(grid, start, goal)
# print 'path: ', path
# print 'cost: ', cost[goal]
# print grid... | {
"content_hash": "8721ece07b5fd9b8d8b933d20e9231d7",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 98,
"avg_line_length": 26.310734463276837,
"alnum_prop": 0.6776894996779043,
"repo_name": "krrish94/commExplore",
"id": "49b4f10e1b1955b2d4d8a6f235f5407f946dff37",
"size":... |
from version import __version__
| {
"content_hash": "b7663250d175e27e0001595cc5598f54",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 31,
"avg_line_length": 32,
"alnum_prop": 0.75,
"repo_name": "accuen/rqt",
"id": "c6bf7a63fc64f60e25169cf398467d1833319c0e",
"size": "614",
"binary": false,
"copies": "1"... |
import unittest
import os
import textract
class No_Ext_TestCase(unittest.TestCase):
def test_docx(self):
current_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
docx_file = os.path.join(current_dir, "tests/no_ext/docx_paragraphs_and_tables")
# pass the file without extens... | {
"content_hash": "11edceb7a76121bf4d5dac9843d1f8c3",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 88,
"avg_line_length": 42.666666666666664,
"alnum_prop": 0.6692708333333334,
"repo_name": "deanmalmgren/textract",
"id": "cf47970ffc3a3a0cb7907122ff34ac7c59a19297",
"size":... |
from keystoneclient.generic import client
from keystoneclient.tests.unit.v2_0 import utils
class DiscoverKeystoneTests(utils.UnauthenticatedTestCase):
def setUp(self):
super(DiscoverKeystoneTests, self).setUp()
self.TEST_RESPONSE_DICT = {
"versions": {
"values": [{
... | {
"content_hash": "ce651defa3ac0de41e77e5e27a37871b",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 79,
"avg_line_length": 42.12676056338028,
"alnum_prop": 0.4744232698094283,
"repo_name": "klmitch/python-keystoneclient",
"id": "5afe59ab1db7c8b72be5dc3d0250f0c76f931e26",
... |
"""
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... | {
"content_hash": "b18fdc61553778d37e96646552771f29",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 72,
"avg_line_length": 30.135135135135137,
"alnum_prop": 0.6134529147982063,
"repo_name": "CraigHarris/gpdb",
"id": "34dffcd8a776b019a65cada815867821b3edbcbd",
"size": "223... |
import datetime
import json
from couchdbkit import ResourceConflict
from django.core.urlresolvers import reverse
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _, ungettext
from couchexport.models import SavedExportSchema
from corehq import privileges
from corehq.... | {
"content_hash": "3edb7e7627069689c81b2bea08d92fa6",
"timestamp": "",
"source": "github",
"line_count": 639,
"max_line_length": 113,
"avg_line_length": 39.33646322378717,
"alnum_prop": 0.5821928707829408,
"repo_name": "qedsoftware/commcare-hq",
"id": "3f3ba6cbcb56ebfc220ab31166aff130f4234e49",
"siz... |
"""
Geographically weighted regression
"""
import numpy as np
from .gwr.base.gwr import GWR as PySAL_GWR
from .gwr.base.sel_bw import Sel_BW
import json
from crankshaft.analysis_data_provider import AnalysisDataProvider
import plpy
class GWR:
def __init__(self, data_provider=None):
if data_provider:
... | {
"content_hash": "d3b1aeead0d663a42a07fe487a283101",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 81,
"avg_line_length": 37.31188118811881,
"alnum_prop": 0.5329706779885897,
"repo_name": "CartoDB/crankshaft",
"id": "04e78a3728db6702996ccc326f2c586d295a8288",
"size": "7... |
"""Definitions for the semantics segment of the Cranelift language."""
from cdsl.ti import TypeEnv, ti_rtl, get_type_env
from cdsl.operands import ImmediateKind
from cdsl.ast import Var
try:
from typing import List, Dict, Tuple # noqa
from cdsl.ast import VarAtomMap # noqa
from cdsl.xform import XForm, Rt... | {
"content_hash": "b38f64c1a710bd17fd4ccdf732fb5481",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 78,
"avg_line_length": 39.103896103896105,
"alnum_prop": 0.5978080371969445,
"repo_name": "nrc/rustc-perf",
"id": "1ce6b46712602d49880da34bf99d5b4b9313eff8",
"size": "3011"... |
"""Utils for managing different mode strings used by Keras and Estimator models.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections.abc as collections_abc
class KerasModeKeys(object):
"""Standard names for model modes.
The followi... | {
"content_hash": "4c4871db1af3c41d55c2385659f9955e",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 80,
"avg_line_length": 27.197916666666668,
"alnum_prop": 0.693603983148219,
"repo_name": "petewarden/tensorflow",
"id": "e26bf031513a4ae9a95d220eb3364cb8e7adac35",
"size": ... |
import logging
import os
import pickle
import torch
from fvcore.common.checkpoint import Checkpointer
from torch.nn.parallel import DistributedDataParallel
import detectron2.utils.comm as comm
from detectron2.utils.file_io import PathManager
from .c2_model_loading import align_and_update_state_dicts
class Detection... | {
"content_hash": "c2e707e023926ffa1610347929f98b51",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 98,
"avg_line_length": 43.391666666666666,
"alnum_prop": 0.5742270021125409,
"repo_name": "facebookresearch/detectron2",
"id": "6620a2b5781a4f2feb24bf320291c5ba17fc52e6",
... |
from ConfigParser import ConfigParser
import logging
import re
import sys
import zmq
from longman_parser import XMLParser
class ParserException(Exception):
pass
class Parser(XMLParser):
sen_regex = re.compile(
'<sentence id="[0-9]*">(.*?)</sentence>', re.S)
basic_deps_regex = re.compile(
... | {
"content_hash": "2955924e08369257e7a9007d55a97ca3",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 103,
"avg_line_length": 34.42424242424242,
"alnum_prop": 0.5724031690140845,
"repo_name": "recski/4lang",
"id": "3095b037912573905092c131286332d7fe38bb07",
"size": "4544",... |
from __future__ import unicode_literals
import time
VERSIONING = int(time.time())
# Basic config
AUTHOR = u'Florent Messa'
SITENAME = u'Ulule'
SITEURL = ''
PATH = 'content'
TIMEZONE = 'Europe/Paris'
# Define theme and static path to img folder
THEME = 'themes/ulule'
STATIC_PATHS = [
'themes/ulule/static/build/'... | {
"content_hash": "f1ef6f947a0e19c0ca365380dce467e1",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 47,
"avg_line_length": 19.576923076923077,
"alnum_prop": 0.6709233791748527,
"repo_name": "ulule/engineering.ulule.com",
"id": "01c5758c5871b3b640b89d828a79abc82972284d",
"... |
from os.path import join, dirname
from setuptools import setup
import ymir
setup(
name='ymir',
version=ymir.__version__,
long_description=open(join(dirname(__file__), 'README.md')).read(),
entry_points={
'console_scripts': [
'ymir = ymir:main',
],
},
insta... | {
"content_hash": "108293873d361056bd37722c97ee42c9",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 71,
"avg_line_length": 18.318181818181817,
"alnum_prop": 0.533498759305211,
"repo_name": "skylerberg/ymir",
"id": "97c46320d73453b58b1698893b6682c3f359ef1d",
"size": "426",... |
import json
from decimal import Decimal as D
from django.conf import settings
from django.core.cache import cache
from django.core.exceptions import ImproperlyConfigured
from django.utils.translation import ugettext_lazy as _
from ..exceptions import (OriginCityNotFoundError,
CityNotFoundEr... | {
"content_hash": "5fd0afb210382a2a8fa32833128d2b0a",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 112,
"avg_line_length": 33.14,
"alnum_prop": 0.5449607724803862,
"repo_name": "okfish/django-oscar-shipping",
"id": "688cef07a07f499b22ed86ee5a6464d6c29e33e9",
"size": "66... |
import os, sys
reload(sys)
sys.setdefaultencoding("utf-8")
from flask import Flask, render_template, request, url_for
from datetime import datetime
_wd = os.path.dirname(os.path.realpath(__file__))
app = Flask(__name__, static_url_path='/static')
@app.route('/')
def home():
return render_template('home.html')
if _... | {
"content_hash": "3966c69d97114e0224ca80b18b8fadbc",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 58,
"avg_line_length": 22.75,
"alnum_prop": 0.6868131868131868,
"repo_name": "mabdrabo/FlaskHero",
"id": "ab15a7e6f1d8c98e1f921147e1542de7a812ae0e",
"size": "380",
"binar... |
from tests.testing_harness import TestHarness
def test_lattice_mixed():
harness = TestHarness('statepoint.10.h5')
harness.main()
| {
"content_hash": "fc08f723cf1f7791a400f916beeb8c6d",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 45,
"avg_line_length": 23.166666666666668,
"alnum_prop": 0.7338129496402878,
"repo_name": "johnnyliu27/openmc",
"id": "3df1d7a4f3994f8d2dcb00a878d13d7d3c5b1360",
"size": "13... |
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListType
from pyangbind.lib.ya... | {
"content_hash": "30b2e3a891f866bb5fff60c59f5a68de",
"timestamp": "",
"source": "github",
"line_count": 480,
"max_line_length": 377,
"avg_line_length": 38.74583333333333,
"alnum_prop": 0.5832885256479191,
"repo_name": "napalm-automation/napalm-yang",
"id": "2b62a9a606c947abb7def30a4fe81407ce6bb022",
... |
import socket,string
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.connect(('localhost',8886))
def compress(uncompressed):
"""Compress a string to a list of output symbols."""
# Build the dictionary.
dict_size = 256
dictionary = dict((chr(i), chr(i)) for i in xrange(dict_size))
# in Python 3:... | {
"content_hash": "2fe004d9045f9805668cc2ee14e17133",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 74,
"avg_line_length": 26.40625,
"alnum_prop": 0.5792899408284023,
"repo_name": "CSE-SOE-CUSAT/NOSLab",
"id": "77cb680bf8307366c7dcb40b66b7c66381405e5f",
"size": "1690",
... |
"""
Just a script to make it easy to test testing infrastracture itself.
"""
import coverage
import os
import subprocess
import sys
def subprocess_main():
print('subprocess_main')
def main():
if sys.argv[1:] == ['subprocess']:
print('subprocess')
cov = coverage.process_startup()
subpro... | {
"content_hash": "2b6be6a2ea336f6f8bc834f0064bebb5",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 71,
"avg_line_length": 21.652173913043477,
"alnum_prop": 0.6104417670682731,
"repo_name": "elmopl/ktba",
"id": "62053c8013316c5023c50560bda48e0b1a0f4a3d",
"size": "498",
... |
import socket
import threading
import time
import xmlrpclib
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from electrum_arg import bitcoin, util
from electrum_arg import transaction
from electrum_arg.plugins import BasePlugin, hook
from electrum_arg.i18n import _
from electrum_arg.wallet import Multisig_Wallet... | {
"content_hash": "7782104db9d1e94d93fd581f2cd61ec6",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 151,
"avg_line_length": 33.708333333333336,
"alnum_prop": 0.5738566131025958,
"repo_name": "argentumproject/electrum-arg",
"id": "a2bb522b388195d290517e6016668077ed0725c3",
... |
import os, sys
if len(sys.argv) < 2:
print('Usage: %s' % (sys.argv[0]))
sys.exit(1)
# Always apply env config to env scripts as well
conf_files = ['conf/pulsar_env.sh', 'conf/bkenv.sh'] + sys.argv[1:]
for conf_filename in conf_files:
lines = [] # List of config file lines
keys = {} # Map a key to it... | {
"content_hash": "ee5fb91f8bb6e5786200dd779264b5f4",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 73,
"avg_line_length": 27.805555555555557,
"alnum_prop": 0.5494505494505495,
"repo_name": "nkurihar/pulsar",
"id": "0ad9b2b8238543e972ba71c5045230d514215fc4",
"size": "1966... |
import json
import logging
import time
import unittest
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from nose.plugins.skip import SkipTest
from nose.tools import assert_true, assert_false, assert_equal
from desktop.lib.django_test_util import make_logged_in_client
from desk... | {
"content_hash": "02a456eaef39e8a0751d7c5db47954d4",
"timestamp": "",
"source": "github",
"line_count": 844,
"max_line_length": 937,
"avg_line_length": 43.77843601895734,
"alnum_prop": 0.6429943976832931,
"repo_name": "MobinRanjbar/hue",
"id": "0cc2784288cdbe8e369eb764e0afff16e027bd23",
"size": "37... |
from interfaces import Interface
from primitives import Cathode
from components import Split, Join, Transistor
from logicgates import Or, Not, And
from multiplexers import TwoToFourDecoder
from mixins import InputSetMixin, InputResetMixin, InputDataMixin, InputWriteMixin, InputDataEightBitMixin, InputDataInEightBi... | {
"content_hash": "6982a8d9d43f92d0e00fbc63451ac55d",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 320,
"avg_line_length": 35.154761904761905,
"alnum_prop": 0.5760243819844226,
"repo_name": "martinohanlon/PhilbinSS",
"id": "f298c2fc295631fd8f6b3e96dfafd8767c4aa688",
"si... |
from tests.unit import unittest
from boto.sts.connection import STSConnection
from tests.unit import AWSMockServiceTestCase
class TestSTSConnection(AWSMockServiceTestCase):
connection_class = STSConnection
def setUp(self):
super(TestSTSConnection, self).setUp()
def default_body(self):
re... | {
"content_hash": "8b1635073df971ab60abf3bf5b6267ef",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 82,
"avg_line_length": 40.411764705882355,
"alnum_prop": 0.5992236778262979,
"repo_name": "jameslegg/boto",
"id": "f874cafd4c862bbbb91f413062f47ab580c2ddb0",
"size": "3207"... |
import shutil
import os
import subprocess
import datetime
import re
import ulysses_sync_lib_1_0_2 as Ulib # Main library for syncing, xml2md- and md2xml-conversions.
make_marked_files = True # If True: Make Marked-files on top and bottom group level.
add_ul_uuid_to_export_filenames = True # Have to be True to sync ... | {
"content_hash": "ede6ed7c5800a5a2747b8a277d3385a7",
"timestamp": "",
"source": "github",
"line_count": 310,
"max_line_length": 99,
"avg_line_length": 40.23870967741936,
"alnum_prop": 0.5782427449094115,
"repo_name": "MrBlaschke/Ulysses3_to_md_sync",
"id": "61825b3947d298e7f25268865b7cfeab36680282",
... |
import SimpleITK as sitk
import sys
if len(sys.argv) < 3:
print("Usage: " + sys.argv[0] + " <input-1> <input-2>")
sys.exit(1)
# Two vector images of same pixel type and dimension expected
image_1 = sitk.ReadImage(sys.argv[1])
image_2 = sitk.ReadImage(sys.argv[2])
# Join two N-D Vector images to form an (N+1)... | {
"content_hash": "2e7036c2e0fbc9222c0257e71e9ae26f",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 76,
"avg_line_length": 38.83720930232558,
"alnum_prop": 0.7353293413173653,
"repo_name": "richardbeare/SimpleITK",
"id": "409932b654fa360a0474cb36d1ff6037ed6e341d",
"size":... |
"""The super-group for the sql CLI.
The fact that this is a directory with
an __init__.py in it makes it a command group. The methods written below will
all be called by calliope (though they are all optional).
"""
import argparse
import os
import re
from googlecloudsdk.calliope import actions
from googlecloudsdk.cal... | {
"content_hash": "78b60c5ae12239491c7f12763ef07e98",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 78,
"avg_line_length": 28.89041095890411,
"alnum_prop": 0.7472735893788526,
"repo_name": "KaranToor/MA450",
"id": "7e147efe5e3b0a1a1815d1bd47fa2f5de303a6dc",
"size": "2705"... |
"""Factories for making test data"""
from factory import Faker
from factory.django import DjangoModelFactory, ImageField
from faker.providers import BaseProvider
from profiles.models import Profile, UserWebsite
class LocationProvider(BaseProvider):
"""Factory for location JSON"""
cities = [
"Kathman... | {
"content_hash": "cafa50f6345a7651debe285087a14c8e",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 58,
"avg_line_length": 23.98181818181818,
"alnum_prop": 0.6588324488248674,
"repo_name": "mitodl/open-discussions",
"id": "5487884a0aa85be0b7dec93f45f71b37b568a8e1",
"size"... |
import os
import random
import json
import collections
from PIL import Image
# Convert (r, g, b) into #rrggbb color
def getRGBstring( (r, g, b) ):
s = "#"
s = s + format(r, '02x')
s = s + format(g, '02x')
s = s + format(b, '02x')
return s
def do_compute():
# Open the image
origImgFile = 'res/bryce.jpg'
... | {
"content_hash": "b3bba37afda2917f1857135ca60a8251",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 38,
"avg_line_length": 16,
"alnum_prop": 0.5954861111111112,
"repo_name": "CS205IL-sp15/workbook",
"id": "194121d3f705439a553cceafc683d93f439e0c65",
"size": "594",
"binar... |
import unittest
from src.models.model import db
from src.models.user import User
from src.models.chat import Chat
from database.factories.model_factory import factory
class TestUser(unittest.TestCase):
def setUp(self):
db.begin_transaction()
def tearDown(self):
db.rollback()
... | {
"content_hash": "820a6b02e964292f8f111a1b8c867e3b",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 87,
"avg_line_length": 30.053333333333335,
"alnum_prop": 0.6051464063886424,
"repo_name": "erjanmx/salam-bot",
"id": "da4e50d3864f6ca98975b51973aeade6d65fc16f",
"size": "22... |
from src.game.location import Location
from src.game.place import Place
l = None
def test_init():
global l
l = Location(None, 10, 10, "A testing location")
assert l.place == None
assert l.x == 10
assert l.y == 10
assert l.name == "A testing location"
| {
"content_hash": "e75fef46723a810487cde9392f205d4d",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 52,
"avg_line_length": 19.928571428571427,
"alnum_prop": 0.6415770609318996,
"repo_name": "lexwraith/ThisIsBob",
"id": "331fafc382a658cd748defb780c09659a1129cdf",
"size": "... |
import oauth2
from bind import bind_method
from models import MediaShortcode, Media, User, Location, Tag, Comment, Relationship
MEDIA_ACCEPT_PARAMETERS = ["count", "max_id"]
SEARCH_ACCEPT_PARAMETERS = ["q", "count"]
SUPPORTED_FORMATS = ['json']
class InstagramAPI(oauth2.OAuth2API):
host = "api.instagram.com"
... | {
"content_hash": "4fa122191e43114cc8af70cc6cdc0da0",
"timestamp": "",
"source": "github",
"line_count": 239,
"max_line_length": 123,
"avg_line_length": 36.39330543933055,
"alnum_prop": 0.5295470223039779,
"repo_name": "trevornelson/squeeklights",
"id": "ad479e27696e2bba285f12b0e9912977bce87397",
"s... |
from datetime import datetime
from django.template import Template
from django.test import TestCase
from django_dynamic_fixture import N, G
from entity.models import Entity, EntityKind, EntityRelationship
from freezegun import freeze_time
from mock import patch, call, Mock
from six import text_type
from entity_event.... | {
"content_hash": "920e6d4892dbc4a4cceb2eee3cb8db49",
"timestamp": "",
"source": "github",
"line_count": 1068,
"max_line_length": 117,
"avg_line_length": 37.6816479400749,
"alnum_prop": 0.6085876155451745,
"repo_name": "ambitioninc/django-entity-event",
"id": "80dfd436f6df73f795e6d80d967d691e8ad32bdf"... |
import grpc
from grpc_testing import _common
class ServicerContext(grpc.ServicerContext):
def __init__(self, rpc, time, deadline):
self._rpc = rpc
self._time = time
self._deadline = deadline
def is_active(self):
return self._rpc.is_active()
def time_remaining(self):
... | {
"content_hash": "f88da657da74e84500628e190327da58",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 73,
"avg_line_length": 27.356164383561644,
"alnum_prop": 0.6204306459689535,
"repo_name": "pszemus/grpc",
"id": "6fa8c6b3ba894f15f40f0ca6d6b8e16983f07d46",
"size": "2575",
... |
import numpy as np
from precipitation import read, sum_by_month
from precipitation import create_bargraph
months = np.arange(12) + 1
d12, d13, d14 = read("p12.dat"), read("p13.dat"), read("p14.dat")
prec12 = sum_by_month(d12, months)
prec13 = sum_by_month(d13, months)
prec14 = sum_by_month(d14, months)
crea... | {
"content_hash": "1a5b25ac46506359465a855331912045",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 65,
"avg_line_length": 34.666666666666664,
"alnum_prop": 0.6634615384615384,
"repo_name": "gems-uff/noworkflow",
"id": "019391dd52371d64cb9611b0ccfa6cf21acfbb34",
"size": "... |
''' Wit.ai API-based Converters '''
import logging
import os
from abc import abstractproperty
from urllib.request import Request, urlopen
from urllib.error import HTTPError
from pliers.stimuli.text import ComplexTextStim
from pliers.utils import attempt_to_import, verify_dependencies
from pliers.converters.audio impo... | {
"content_hash": "cd7b952f10e8f25cd7554ba780b1c18d",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 82,
"avg_line_length": 32.425,
"alnum_prop": 0.6484194294525829,
"repo_name": "tyarkoni/pliers",
"id": "ff5fb3664ef82282a25fac8641b276377c894e18",
"size": "2594",
"binary... |
from conans import ConanFile, CMake
class AversivePlusPlusProjectConan(ConanFile):
name="template-project"
version="0.1"
settings = "os", "compiler", "build_type", "arch", "target"
requires = "filter/0.1@AversivePlusPlus/dev"
generators = "cmake"
def build(self):
cmake = CMake(self.set... | {
"content_hash": "dae3d6c239b72b4a4bbcbac193a7b393",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 82,
"avg_line_length": 36.15384615384615,
"alnum_prop": 0.6531914893617021,
"repo_name": "AversivePlusPlus/AversivePlusPlus",
"id": "68d7b7b2ea6cf5f91774f26698c075fdc8dc5fc7"... |
import os
import ast
import copy
import json
import logging
import textwrap
import calendar
import time
import six
import sys
from os.path import join as pjoin
from st2client import models
from st2client.commands import resource
from st2client.commands.resource import add_auth_token_to_kwargs_from_cli
from st2client.... | {
"content_hash": "41f3bc97aa20e966082b7391adae8cab",
"timestamp": "",
"source": "github",
"line_count": 1166,
"max_line_length": 100,
"avg_line_length": 41.38421955403088,
"alnum_prop": 0.545923653997596,
"repo_name": "lakshmi-kannan/st2",
"id": "03b43c34c2874fa25f243d82ebe1f8f2c7639afb",
"size": "... |
from django.contrib import messages
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from core.spaces.models import Space
from e_ci... | {
"content_hash": "9910eba2a343f8370d50876ccc74d10b",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 77,
"avg_line_length": 36.088235294117645,
"alnum_prop": 0.6797066014669927,
"repo_name": "cidadania/ecidadania-ng",
"id": "1eaf1667ff68dbf80a4dcf9a95a5dfbc0d0651a8",
"size... |
import errno
import os
import shutil
import warnings
def mkdir_p(path):
try:
os.makedirs(path)
except OSError as exc:
if exc.errno == errno.EEXIST and os.path.isdir(path):
pass
else:
raise
def rm_rf(path):
if os.path.isdir(path):
shutil.rmtree(path... | {
"content_hash": "04715e3de94bf3e90ff8467445085f47",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 78,
"avg_line_length": 25.685714285714287,
"alnum_prop": 0.6006674082313682,
"repo_name": "inodb/revmut",
"id": "4553d66a57f30d54510bbd8962627ba78c009299",
"size": "899",
... |
"""Tests for the SSH syslog plugin."""
import unittest
from tests.parsers.syslog_plugins import test_lib
class SSHSyslogPluginTest(test_lib.SyslogPluginTestCase):
"""Tests for the SSH syslog plugin."""
def testParse(self):
"""Tests the Parse function."""
storage_writer = self._ParseFileWithPlugin(['sys... | {
"content_hash": "f43ca889cde05da8ace74c0f7b6e8f38",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 77,
"avg_line_length": 35.13235294117647,
"alnum_prop": 0.6688991209711176,
"repo_name": "log2timeline/plaso",
"id": "7061bc9f631961c06ae700e61cf08aeb21c39a2a",
"size": "24... |
import datetime
from haystack import indexes
from .models import Ticket
class TicketIndex(indexes.SearchIndex, indexes.Indexable):
# text = indexes.CharField(document=True, use_template=True)
text = indexes.EdgeNgramField(indexed=True, document=True, use_template=True)
name = indexes.CharField(stored... | {
"content_hash": "3e97f64cb2237cf43d4d8fd2c8ad1a18",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 99,
"avg_line_length": 46.04,
"alnum_prop": 0.7341442224152911,
"repo_name": "Go-In/go-coup",
"id": "4e4262c787cda313df3dac43c5913e8ce64f6758",
"size": "1151",
"binary": ... |
from collections import OrderedDict
import copy
import cPickle
import gzip
import os
import urllib
import random
import stat
import subprocess
import sys
import timeit
import numpy
import theano
from theano import tensor as T
# Otherwise the deepcopy fails
import sys
sys.setrecursionlimit(1500)
PREFIX = os.getenv(
... | {
"content_hash": "66286645b55ff6f98a0987f7f042276c",
"timestamp": "",
"source": "github",
"line_count": 394,
"max_line_length": 82,
"avg_line_length": 34.01776649746193,
"alnum_prop": 0.5023502200999777,
"repo_name": "webeng/DeepLearningTutorials",
"id": "936486ce01ffde057ba23f6ec382e365a73d2379",
... |
# Copyright (c) 2011 Tencent Inc.
# All rights reserved.
#
# Author: Huan Yu <huanyu@tencent.com>
# Feng Chen <phongchen@tencent.com>
# Yi Wang <yiwang@tencent.com>
# Chong Peng <michaelpeng@tencent.com>
# Date: October 20, 2011
"""
This is the scons rules genearator module which invokes al... | {
"content_hash": "5a21f6a24af97f22a266e08147ced15d",
"timestamp": "",
"source": "github",
"line_count": 618,
"max_line_length": 119,
"avg_line_length": 42.35598705501618,
"alnum_prop": 0.5859183985330073,
"repo_name": "Lunewcome/typhoon-blade",
"id": "8288fc9cf906108e01d4fc56be96d3aa0ab71733",
"siz... |
def autoretry_datastore_timeouts(attempts=5.0, interval=0.1, exponent=2.0):
"""
Copyright (C) 2009 twitter.com/rcb
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... | {
"content_hash": "534524006baf26a9e2f59b732b538b32",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 75,
"avg_line_length": 42.43023255813954,
"alnum_prop": 0.6404494382022472,
"repo_name": "limscoder/amfast",
"id": "c6efdfb15610ef3516e57eaa87a40ef21c6c8ace",
"size": "3649... |
"""Utilities for with-statement contexts. See PEP 343."""
import sys
from collections import deque
from functools import wraps
__all__ = ["contextmanager", "closing", "ContextDecorator", "ExitStack",
"redirect_stdout", "redirect_stderr", "suppress"]
class ContextDecorator(object):
"A base class or m... | {
"content_hash": "6b01c6ae8ce9cf9b231842d98a3a7a1b",
"timestamp": "",
"source": "github",
"line_count": 361,
"max_line_length": 80,
"avg_line_length": 33.988919667590025,
"alnum_prop": 0.5801955990220049,
"repo_name": "munyirik/python",
"id": "379c2515d50b60ec31e3ea6f6beb95c2aa6e672a",
"size": "122... |
from gii.core.model import *
from PropertyEditor import FieldEditor, registerSimpleFieldEditorFactory
from gii.SearchView import requestSearchView
from PyQt4 import QtGui, QtCore
from PyQt4.QtCore import Qt
##----------------------------------------------------------------##
class CollectionFieldButton( QtGui.QToolB... | {
"content_hash": "cbc0c967feeddb4ef199cd70a2abfe7a",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 73,
"avg_line_length": 26.014084507042252,
"alnum_prop": 0.6556578234975636,
"repo_name": "tommo/gii",
"id": "31b96dcb456913413ac54223bebc6def9f614b47",
"size": "1847",
"... |
"""
WSGI config for lab7 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lab7.settings")
from django.core.wsgi im... | {
"content_hash": "5d82916c0bbaff840f3ae5c1a8572323",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 78,
"avg_line_length": 27.357142857142858,
"alnum_prop": 0.7702349869451697,
"repo_name": "alejo8591/angular-labs",
"id": "ae6f52f7b801909ce3bce529a064d4fdfae553b2",
"size"... |
"""Module containing the Event base class."""
class Event:
"""This base class represent a model event.
A model event could be called in different generic situations,
for instance when the model object is loaded from a data connector,
or created, or updated. For each of this event, a class inherited
... | {
"content_hash": "b46a5f418fce4fa1875b5f6669753485",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 71,
"avg_line_length": 31.944444444444443,
"alnum_prop": 0.7026086956521739,
"repo_name": "v-legoff/pa-poc3",
"id": "f04c6504e86018a8c2d297d2b26daedc4c9ee30c",
"size": "211... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('annotations', '0008_auto_20170826_1533'),
]
operations = [
migrations.AlterField(
model_name='annotatio... | {
"content_hash": "a00150a5faeb7199c0a56c24fb5919f4",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 128,
"avg_line_length": 26.105263157894736,
"alnum_prop": 0.6451612903225806,
"repo_name": "bit-bots/imagetagger",
"id": "d4ede40898283be926f9fb664a0935dc174d3e4b",
"size":... |
import collections
import os
import re
from xml.etree import ElementTree
from util import build_utils
from util import resource_utils
_TextSymbolEntry = collections.namedtuple(
'RTextEntry', ('java_type', 'resource_type', 'name', 'value'))
_DUMMY_RTXT_ID = '0x7f010001'
_DUMMY_RTXT_INDEX = '1'
def _ResourceName... | {
"content_hash": "86b98534b2a6edacf0d369e3cc01db89",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 93,
"avg_line_length": 38.083333333333336,
"alnum_prop": 0.6267323121808899,
"repo_name": "scheib/chromium",
"id": "6d2621a41eefe8cef1bfec455940e7d4c00bfb9c",
"size": "564... |
"""
GitHub OAuth support.
This contribution adds support for GitHub OAuth service. The settings
GITHUB_APP_ID and GITHUB_API_SECRET must be defined with the values
given by GitHub application registration process.
GITHUB_ORGANIZATION is an optional setting that will allow you to constrain
authentication to a given Gi... | {
"content_hash": "9ab9f2215882b8632100570b7d1119ca",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 133,
"avg_line_length": 32.99029126213592,
"alnum_prop": 0.659211300765156,
"repo_name": "gugu/django-social-auth-1",
"id": "eb92e03cfef7d41db2483bf46af0824446cdef8e",
"si... |
"""
Common Policy Engine Implementation
Policies can be expressed in one of two forms: A list of lists, or a
string written in the new policy language.
In the list-of-lists representation, each check inside the innermost
list is combined as with an "and" conjunction--for that check to pass,
all the specified checks m... | {
"content_hash": "c8d119c83938c788b9be73de216f0b11",
"timestamp": "",
"source": "github",
"line_count": 880,
"max_line_length": 78,
"avg_line_length": 30.2125,
"alnum_prop": 0.6003686011960733,
"repo_name": "luogangyi/Ceilometer-oVirt",
"id": "c2b5189c8ee5924fd838c23a62f8788b3d581099",
"size": "272... |
'''
FanFilm Add-on
Copyright (C) 2015 mrknow
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This ... | {
"content_hash": "51ed870f1911dc940c8077dd1b2ff70e",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 145,
"avg_line_length": 34.29801324503311,
"alnum_prop": 0.5663255454720989,
"repo_name": "rysson/filmkodi",
"id": "5fc3bb7a43d2b6c2029d08d8b6fd5da13b8d57d9",
"size": "520... |
"""Tests for lite.py."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tempfile
import numpy as np
from tensorflow.contrib.lite.python import lite
from tensorflow.contrib.lite.python import lite_constants
from tensorflow.contrib.lite.pyt... | {
"content_hash": "8ead12911f95696b9dfaef0957f3cbe2",
"timestamp": "",
"source": "github",
"line_count": 1150,
"max_line_length": 105,
"avg_line_length": 41.133043478260866,
"alnum_prop": 0.6626852419508277,
"repo_name": "kobejean/tensorflow",
"id": "d243a494f6e57d92864a988cd8ffa3cd87587db6",
"size"... |
""" Enter and verify config mode with netmiko """
from netmiko import ConnectHandler
from test_devices import *
devices = [pynet1, pynet2, juniper_srx]
password = '88newclass'
def main():
for device in devices:
device['password'] = password
net_connect = ConnectHandler(**device)
net_conne... | {
"content_hash": "d6ed4a2d0850dbc8c58d0701f98f4957",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 98,
"avg_line_length": 33.15,
"alnum_prop": 0.5761689291101055,
"repo_name": "astir-py/pynet-class",
"id": "f61a66934cd7d07d9245c2ce67cf93a4d62ff93c",
"size": "685",
"bin... |
from __future__ import absolute_import, unicode_literals
from .base import *
import django_heroku
# Disable debug mode
DEBUG = False
SECURE_SSL_REDIRECT = True
PREPEND_WWW = False # TODO: Set to true for production
ALLOWED_HOSTS = [get_env_variable('ALLOWED_HOSTS')]
AWS_ACCESS_KEY_ID = get_env_variable('AWS_ACCESS... | {
"content_hash": "43bd4689fc8c93f87f5bb486a4db0c14",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 100,
"avg_line_length": 26.26829268292683,
"alnum_prop": 0.5855772206747137,
"repo_name": "OpenCanada/website",
"id": "8b619453219e2923ce7d5c2ea6104af8e87d72a1",
"size": "... |
import json
class Device:
def __init__( self, protocol, dataInput ):
self.__protocol = protocol
self.__rawData = dataInput
debugOutput = json.dumps( dataInput )
if not 'label' in dataInput.keys():
raise ValueError('No device name found: ' + debugOutput )
sel... | {
"content_hash": "f74499a7208571949b0437921b481dbe",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 116,
"avg_line_length": 32.92307692307692,
"alnum_prop": 0.5810747663551402,
"repo_name": "bpannier/TahomaProtocol",
"id": "aa3fc02be48e0f1c53102e42bc01da2459f619d7",
"siz... |
"""Tests for builder.py."""
import subprocess
from unittest import mock
import pytest
from common import new_process
from experiment.build import gcb_build
# pylint: disable=protected-access
FAIL_RESULT = new_process.ProcessResult(1, '', False)
@mock.patch('common.new_process.execute', return_value=FAIL_RESULT)
... | {
"content_hash": "01769b90aa6b5633f482e1e37baa034f",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 75,
"avg_line_length": 33.083333333333336,
"alnum_prop": 0.7371956339210747,
"repo_name": "google/fuzzbench",
"id": "5b3fb0a4a1448cdf55aec2fccb68fef705e038b3",
"size": "176... |
"""
This module provides objects for extracting timing data from the ABINIT output files
It also provides tools to analye and to visualize the parallel efficiency.
"""
from __future__ import unicode_literals, division
import sys
import collections
import numpy as np
from six.moves import zip
from monty.string import ... | {
"content_hash": "729cf18f8047be8d8892b3aa995a734c",
"timestamp": "",
"source": "github",
"line_count": 798,
"max_line_length": 119,
"avg_line_length": 33.042606516290725,
"alnum_prop": 0.5494538834951457,
"repo_name": "ndardenne/pymatgen",
"id": "02784a4b1dbd099d41af4eeda2a7d41bef2fb568",
"size": ... |
from rdflib.namespace import DefinedNamespace, Namespace
from rdflib.term import URIRef
class OWL(DefinedNamespace):
"""
The OWL 2 Schema vocabulary (OWL 2)
This ontology partially describes the built-in classes and properties that together form the basis of
the RDF/XML syntax of OWL 2. The con... | {
"content_hash": "334a0fac68ebcb776413c3f6334c64ee",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 210,
"avg_line_length": 83.48387096774194,
"alnum_prop": 0.7718315301391035,
"repo_name": "RDFLib/rdflib",
"id": "98083a0198b53fe8b8592c32e7148ec155eb2fbb",
"size": "10352... |
from __future__ import absolute_import, unicode_literals
from django.conf.urls import url
from . import views
urlpatterns = [
url(
regex=r'^$',
view=views.UserListView.as_view(),
name='list'
),
url(
regex=r'^~redirect/$',
view=views.UserRedirectView.as_view(),
... | {
"content_hash": "7c49f20708b817ace775b476003c344b",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 56,
"avg_line_length": 20.266666666666666,
"alnum_prop": 0.5361842105263158,
"repo_name": "amstart/demo",
"id": "ddfc7dd5342798093f3e47192383e6605c8dc4ee",
"size": "632",
... |
import sys
import 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('.'))
# Get the proje... | {
"content_hash": "3dccda9813c7d4b4415cfd5b90cdf5ca",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 76,
"avg_line_length": 31.403846153846153,
"alnum_prop": 0.7070422535211267,
"repo_name": "ekampf/graphene-custom-directives",
"id": "40634ca549b1a38e771847d6d7fa6f7ecd59a80... |
from argparse import Namespace
from datetime import datetime
from typing import List, Tuple, Optional
from fhirtordf.rdfsupport.fhirgraphutils import value
from fhirtordf.rdfsupport.uriutils import parse_fhir_resource_uri
from rdflib import Graph, RDF, URIRef
from i2fhirb2.fhir.fhirobservationfact import FHIRObservat... | {
"content_hash": "9ec9666a833e10b334e57a0fb78e51ad",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 118,
"avg_line_length": 57.58762886597938,
"alnum_prop": 0.6368600071607591,
"repo_name": "BD2KOnFHIR/i2FHIRb2",
"id": "bac19fe000aa705a244d342ea43a994b2f0a0f62",
"size": ... |
from gen import *
from dataset import *
import numpy as np
from fg import Foreground, FGTextureType
def save_to_file(npy_file_name, n_examples, dataset, use_patch_centers=False, e=16):
np_data = np.array(np.zeros(e**2))
np_targets = np.array(np.zeros(1))
if use_patch_centers:
np_patch_centers = n... | {
"content_hash": "be60d4c2868a3b7efe8e5182502c7599",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 108,
"avg_line_length": 34.54545454545455,
"alnum_prop": 0.6013157894736842,
"repo_name": "caglar/Arcade-Universe",
"id": "c09e212579e241a2271c013d35599cdbd3245041",
"size"... |
"""Prepare dataset for keras model benchmark."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from official.utils.misc import model_helpers # pylint: disable=g-bad-import-order
# Default values for dataset.
_NU... | {
"content_hash": "72c519d2599fdc38e40fb2efebef2553",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 83,
"avg_line_length": 33.86666666666667,
"alnum_prop": 0.6855314960629921,
"repo_name": "derekjchow/models",
"id": "1a35caeb3275ca427f709af538d11090d3512554",
"size": "272... |
"""
Data structures for the Buffer.
It holds the text, cursor position, history, etc...
"""
from __future__ import unicode_literals
from .auto_suggest import AutoSuggest
from .clipboard import ClipboardData
from .completion import Completer, Completion, CompleteEvent
from .document import Document
from .enums import I... | {
"content_hash": "157d7ba6a56ddabdbad5ed03c9cfc97f",
"timestamp": "",
"source": "github",
"line_count": 1254,
"max_line_length": 102,
"avg_line_length": 35.90829346092504,
"alnum_prop": 0.592529258922028,
"repo_name": "Sorsly/subtle",
"id": "739486a4982272237205419f244b48705edc828c",
"size": "45029... |
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
from test_util import ScanPointGeneratorTest
from scanpointgenerator import Excluder
from pkg_resources import require
require("mock")
from mock import MagicMock
class ExcluderTest(unittest.TestCase):
def test_i... | {
"content_hash": "b8bdaf6ff4b4932d1e50146b83ae1ed1",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 62,
"avg_line_length": 20.955555555555556,
"alnum_prop": 0.6426299045599152,
"repo_name": "dls-controls/scanpointgenerator",
"id": "7bfc3db67a1ff6eeac8b2b10e5b1368c56f11f3b",... |
import re
from django.db import models, connection, transaction
from django.db.utils import IntegrityError
from django.core.exceptions import ValidationError
from django.forms.models import model_to_dict
from kobo.rpmlib import parse_nvra
from pdc.apps.common.models import get_cached_id
from pdc.apps.common.validato... | {
"content_hash": "67b26072b57153eea29e1680609a822b",
"timestamp": "",
"source": "github",
"line_count": 337,
"max_line_length": 116,
"avg_line_length": 37.98516320474778,
"alnum_prop": 0.5887821263963753,
"repo_name": "xychu/product-definition-center",
"id": "d41e0e86788f9174a3f751382d6c6af42646fe25"... |
import os
import sys
import shlex
from setuptools import setup, Extension
from setuptools.command.test import test as TestCommand
# Determine if a base directory has been provided with the --basedir option
in_tree = False
# Add compiler flags if debug is set
compile_args = ['-Wno-unused-function']
for arg in sys.argv... | {
"content_hash": "cf5fbc9917e6b0ff958d0a59c35b8403",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 106,
"avg_line_length": 35.82692307692308,
"alnum_prop": 0.6301663982823403,
"repo_name": "normanuber/ezsnmp",
"id": "e29a0b10636f604b98d47aff5eb219a8a2c7369e",
"size": "3... |
import io
import os
import setuptools
# Package metadata.
name = "google-cloud-trace"
description = "Cloud Trace API client library"
version = "1.7.3"
# Should be one of:
# 'Development Status :: 3 - Alpha'
# 'Development Status :: 4 - Beta'
# 'Development Status :: 5 - Production/Stable'
release_status = "Developm... | {
"content_hash": "914cf2a57184020bfee170d8442a0b5d",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 113,
"avg_line_length": 29.54320987654321,
"alnum_prop": 0.6385290430422065,
"repo_name": "googleapis/python-trace",
"id": "16aa427ef7f53253483d08479a9b5bfb25703c57",
"size... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class AddToWatchList(Choreography):
def __init__(self, temboo_session):
"""
Create ... | {
"content_hash": "a67f5a0ca241903602ec018079ea6e26",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 223,
"avg_line_length": 43.71052631578947,
"alnum_prop": 0.695364238410596,
"repo_name": "jordanemedlock/psychtruths",
"id": "83b33c6ab18c45312bf1ad6e4a416c7712741a17",
"si... |
'''
Transparent use of prepared statements with Postgresql.
Usage example with psycgopg2: We create a cursor that provides
both with dict-like field access and prepared statements.
from psycopg2.extensions import connection as _connection
from psycopg2.extras import RealDictCursor
from this_recipe import PrepCursorMi... | {
"content_hash": "883b1db91a18745b5b26dcb45e2ee3e5",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 71,
"avg_line_length": 28.115107913669064,
"alnum_prop": 0.5757420675537359,
"repo_name": "ActiveState/code",
"id": "8bc3b3bffecddd34d73fd4d25b2996248a34330a",
"size": "39... |
import unittest
class TestCase(unittest.TestCase):
def assertEqualCI(self, s1, s2, *args, **kwargs):
self.assertEqual(s1.lower(), s2.lower(), *args, **kwargs)
def assertIs(self, item1, item2, *args, **kwargs):
self.assertTrue(item1 is item2, *args, **kwargs)
def assertIsInstance(self, i... | {
"content_hash": "0afba46203ba73dcb010a6f88c90d352",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 65,
"avg_line_length": 32,
"alnum_prop": 0.6538461538461539,
"repo_name": "tjguk/winshell",
"id": "0a2570dc14378fb415e787f9e1758dbeca7b32e3",
"size": "439",
"binary": fal... |
'''
Created on Sept 28, 2012
@author: jspivey
Simple demo which will connect via ssh to vista.vainnovation.us
'''
import os
import sys
#apparently these are not needed... at least not on windows. Will need to retest this on linux
#sys.path = ['./FunctionalTest/RAS/lib'] + ['./lib/vista'] + sys.path
#sys.path = ['./'] +... | {
"content_hash": "6bacad7a1c9220c7ab70701c3ab4a4f2",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 94,
"avg_line_length": 31.710526315789473,
"alnum_prop": 0.6854771784232365,
"repo_name": "JimDeanSpivey/ATF-for-Vista-FOIA",
"id": "a9d667fef072f34c333d72deccfbfba8578ea7b1"... |
"""Fixtures for honeywell tests."""
from unittest.mock import create_autospec, patch
import pytest
import somecomfort
from homeassistant.components.honeywell.const import DOMAIN
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from tests.common import MockConfigEntry
@pytest.fixture
def config_data():... | {
"content_hash": "6e9d8b9abc77aae0bc17400339b3b336",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 73,
"avg_line_length": 28.83653846153846,
"alnum_prop": 0.6942314104701567,
"repo_name": "toddeye/home-assistant",
"id": "dcb8edb40159e5e0a94fbba75f30a342c82f835c",
"size"... |
from django.http import HttpResponse
from django.template import loader, Context, RequestContext
class ContentNotRenderedError(Exception):
pass
class SimpleTemplateResponse(HttpResponse):
def __init__(self, template, context=None, mimetype=None, status=None,
content_type=None):
... | {
"content_hash": "d7ba5853006d0f24c1ea8edb92b5ad30",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 114,
"avg_line_length": 41.45945945945946,
"alnum_prop": 0.6375488917861799,
"repo_name": "bernardokyotoku/skillplant",
"id": "d2d007bb8e29307e492fcf9c16603adea94df7e9",
"... |
from snovault import (
CONNECTION,
upgrade_step,
)
@upgrade_step('mad_quality_metric', '1', '2')
def mad_quality_metric_1_2(value, system):
# http://redmine.encodedcc.org/issues/3897
# get from the file the lab and award for the attribution!!!
conn = system['registry'][CONNECTION]
f = conn.get... | {
"content_hash": "32e5e3deb70c275891b1c5882d7a89e9",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 65,
"avg_line_length": 30.72222222222222,
"alnum_prop": 0.6157323688969258,
"repo_name": "T2DREAM/t2dream-portal",
"id": "cdef51b502af91d76610a7be179d107447704e38",
"size":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.