text stringlengths 4 1.02M | meta dict |
|---|---|
__author__ = 'wangzhaoyi'
import MySQLdb
from zhihu import Question
from zhihu import User
from zhihu import Collection
from zhihu import Search
class ConnectItem:
def __init__(self,user=None, host=None, password=None, dbname=None):
self.user = user
self.host = host
self.password = passwo... | {
"content_hash": "382a92c853334c57cd274024a6c1affb",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 175,
"avg_line_length": 40.697916666666664,
"alnum_prop": 0.6160737138469414,
"repo_name": "Ulden/WormForZhihu",
"id": "fd984d5f1dd8c00c1e40b855929baabcf7886e6b",
"size": "... |
import os
import testtools
from neutron.common import utils
from neutron.tests.common.exclusive_resources import resource_allocator
from neutron.tests.functional import base
def safe_remove_file(file_path):
try:
os.remove(file_path)
except OSError:
pass
class TestResourceAllocator(base.Bas... | {
"content_hash": "95eb32fc162103728cc428433d0e72aa",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 72,
"avg_line_length": 34.191489361702125,
"alnum_prop": 0.6845052893590542,
"repo_name": "cloudbase/neutron",
"id": "eea791b08a8de5c848a68827a606867411f20522",
"size": "22... |
import sys
class Genotype(object):
'''
This class stores information about each sample.
'''
def __init__(self, variant, value_list):
'''
Initialize the class. All instances have a GT field,
but that is enforced in the Variant class.
'''
self.value_list = value_li... | {
"content_hash": "6d19b81eeb1d19aad3566f52e690aa20",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 83,
"avg_line_length": 32.15714285714286,
"alnum_prop": 0.5264326965792981,
"repo_name": "hall-lab/svtools",
"id": "c2d2f0a51bf130e755ff8fc088828e750564e768",
"size": "2251... |
import os
import responses
import requests
import unittest
from ocremix import OCRemixDownloader
class TestOCRemixDownloader(unittest.TestCase):
def setUp(self):
self.testee = OCRemixDownloader()
self.source_url = "http://ocremix.org/remix/OCR03357"
def test_get_download_link_from_page(self):... | {
"content_hash": "bd7d9901b02d39dc7b9a33a162b97bca",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 136,
"avg_line_length": 39.05882352941177,
"alnum_prop": 0.697289156626506,
"repo_name": "filiphe/OCRemix-Downloader",
"id": "9338bba65b5c349601215957c79eee5a170bed14",
"si... |
from __future__ import print_function
import os
import sys
import numpy as np
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from keras.utils import to_categorical
from keras.layers import Dense, Input, Flatten
from keras.layers import Conv1D, MaxPooling1D, Embedd... | {
"content_hash": "bd95e072f39df16dcfb92d78068c9d44",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 128,
"avg_line_length": 30.178947368421053,
"alnum_prop": 0.665852807813045,
"repo_name": "jasanmiguel10/HackEvent",
"id": "9e429c0d834f01e773a22a484ef65c730d926004",
"siz... |
import json
import logging
import re
import sys
import time
from django import forms
from django.contrib import messages
from django.contrib.auth.models import User
from django.db.models import Q
from django.http import HttpResponse, QueryDict
from django.shortcuts import redirect
from django.utils.html import escape
... | {
"content_hash": "5aaec733a81557755bff7e45ec2b9c4e",
"timestamp": "",
"source": "github",
"line_count": 1046,
"max_line_length": 160,
"avg_line_length": 34.01625239005736,
"alnum_prop": 0.668924425957674,
"repo_name": "jayceyxc/hue",
"id": "82eb8aa1b673c0f980b08585e26d557af72cb68b",
"size": "36373"... |
import pytest
from selenium import webdriver
import os
# Fixtures are a way to setup data dependencies in automated tests.
@pytest.fixture(scope="function")
def driver(request):
desired_caps = {}
wd = None
if os.getenv('RUN_TARGET') == "SAUCE":
# sauce labs.
desired_caps['browserName'] = "... | {
"content_hash": "a0f486dfacc67878c6561c5993c7261a",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 104,
"avg_line_length": 40.44927536231884,
"alnum_prop": 0.6402723038337513,
"repo_name": "dlai0001/appium-spike-running-tests-oncloud",
"id": "c72330435be2e91016072b0bd45ae8... |
from distutils.core import setup, Extension
import os, sys
def local_path(path):
local_dir = os.path.dirname(__file__)
return os.path.normpath(os.path.join(local_dir, path))
def parse_version_from_c():
cfile = open(local_path('../src/dablooms.c'))
result = ''
for line in cfile:
parts = lin... | {
"content_hash": "a9eef49e16e032199a25d73ca5c5bbd6",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 99,
"avg_line_length": 34.68571428571428,
"alnum_prop": 0.5675453047775947,
"repo_name": "bitly/dablooms",
"id": "add7ba56e57f3041b791377813fb1c7bf347e7d6",
"size": "1214",... |
'''
All zstack license operations
@author: Quarkonics
'''
import os
import apibinding.api_actions as api_actions
import apibinding.inventory as inventory
import account_operations
import zstackwoodpecker.test_util as test_util
def get_license_info(session_uuid = None):
action = api_actions.GetLice... | {
"content_hash": "bec9706572cdd7a04bea640293fb990a",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 69,
"avg_line_length": 30.603448275862068,
"alnum_prop": 0.6929577464788732,
"repo_name": "zstackio/zstack-woodpecker",
"id": "24d5796628cc2406f74b5801e2afd767b4d1f2bc",
"s... |
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configurat... | {
"content_hash": "787cb198b5569e5388477db3e32454a3",
"timestamp": "",
"source": "github",
"line_count": 233,
"max_line_length": 80,
"avg_line_length": 31.836909871244636,
"alnum_prop": 0.7020760312752764,
"repo_name": "clarkf/hitch",
"id": "15bf37b642214c57e8e6bb5dd7851067a018fdd4",
"size": "7834",... |
from syzoj import oj, db
import zipfile, os
import hashlib
class File(db.Model):
id = db.Column(db.Integer, primary_key=True)
filename = db.Column(db.String(120), index=True)
md5 = db.Column(db.String(50), index=True)
def __init__(self, file):
self.file = file
self.md5 = self.calc_md5... | {
"content_hash": "1cb06eff44e49cb963c564fe8d2f07b8",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 77,
"avg_line_length": 29.371794871794872,
"alnum_prop": 0.5259711916193802,
"repo_name": "cdcq/jzyzj",
"id": "da7bac0b1c7977c01ebed39ccb4542f477a3f432",
"size": "2291",
... |
import numpy as np
import pytest
from pandas.compat.numpy import (
np_percentile_argname,
np_version_under1p21,
)
import pandas as pd
from pandas import (
DataFrame,
Index,
Series,
Timestamp,
)
import pandas._testing as tm
@pytest.fixture(
params=[["linear", "single"], ["nearest", "table... | {
"content_hash": "9765b412ef9c425ff2ce90752b8a1b69",
"timestamp": "",
"source": "github",
"line_count": 1030,
"max_line_length": 88,
"avg_line_length": 36.95825242718447,
"alnum_prop": 0.5346888381012426,
"repo_name": "datapythonista/pandas",
"id": "3beb201bcfa05599ee11fd9773a4a36e17b9fc51",
"size"... |
"""
WSGI config for TaskTracker project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... | {
"content_hash": "2cbb9a7dcae819f2dfd92754d3d385b0",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 24.9375,
"alnum_prop": 0.7744360902255639,
"repo_name": "polarkac/TaskTracker",
"id": "e71ff8f81478068005a22e66d5d13baefed793ed",
"size": "399",
"b... |
from pandac.PandaModules import *
from toontown.toonbase.ToonBaseGlobal import *
from toontown.toonbase.ToontownGlobals import GlobalDialogColor
from DistributedMinigame import *
from direct.fsm import ClassicFSM, State
from direct.fsm import State
from toontown.toonbase import TTLocalizer
from toontown.toonbase import... | {
"content_hash": "5e41f9759a657ee000ec82a2c797c325",
"timestamp": "",
"source": "github",
"line_count": 1011,
"max_line_length": 341,
"avg_line_length": 43.98714144411474,
"alnum_prop": 0.6387758314407141,
"repo_name": "ksmit799/Toontown-Source",
"id": "4984ccda8fe4203446cbe1955b45fb57367feeec",
"s... |
from dbserver.server import TSDB_Server
from timeseries.util import *
import os.path, os
DIR_TS_DATA = '/var/dbserver/tsdata'
DIR_TS_DB = '/var/dbserver/tsdb'
def main():
db = TSDB_Server()
db.run()
if __name__ == '__main__':
# If the random time series haven't yet been generated, generate t... | {
"content_hash": "e37b176f3a63282f83983d636de2136c",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 79,
"avg_line_length": 25.28,
"alnum_prop": 0.5838607594936709,
"repo_name": "ashilgard/cs207project",
"id": "f000d78680e694738834ffc4969b9febdd5230c3",
"size": "656",
"b... |
"""Unit tests for Credential Wallet class
NERC Data Grid Project
"""
__author__ = "P J Kershaw"
__date__ = "03/10/08"
__copyright__ = "(C) 2009 Science and Technology Facilities Council"
__license__ = "BSD - see LICENSE file in top-level directory"
__contact__ = "Philip.Kershaw@stfc.ac.uk"
__revision__ = '$Id$'
impor... | {
"content_hash": "637e72062dce3c584c8970bf706229c0",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 80,
"avg_line_length": 38.280701754385966,
"alnum_prop": 0.5962419798350137,
"repo_name": "cedadev/ndg_security_common",
"id": "e4472674720492bfe6c2bcff1ff37a3f464e3e64",
... |
import unittest
from rmgpy.rmg.main import RMG
from rmgpy.rmg import input as inp
###################################################
def setUpModule(self):
"""
A method that is run before the class.
"""
# set-up RMG object and get global rmg object in input.py file
# so methods can be tested
... | {
"content_hash": "7080500e5e564508ebfb37b23fea2b3a",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 78,
"avg_line_length": 31.768421052631577,
"alnum_prop": 0.6328694499668654,
"repo_name": "Molecular-Image-Recognition/Molecular-Image-Recognition",
"id": "061d0fe039e1433933... |
from bs4 import BeautifulSoup as Soup
import urls
import re
import proxy
from datetime import *
import time
from time import mktime
import functions
from pytz import timezone
import authenticate
#s2module-bg s2time-off
def sameDay ( date, dayOfWeek, week, year ):
theDay = datetime.fromtimestamp(mktime(time.strptime(... | {
"content_hash": "9f65ebc151959fc52bce833925471cab",
"timestamp": "",
"source": "github",
"line_count": 395,
"max_line_length": 264,
"avg_line_length": 35.060759493670886,
"alnum_prop": 0.6383132356126796,
"repo_name": "boh1996/LectioAPI",
"id": "b2c70b523220a03296421b4c2798e5dfdd471441",
"size": "... |
'''
'''
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License");... | {
"content_hash": "c33223802f5204e62150e5fc852498c1",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 332,
"avg_line_length": 53.496815286624205,
"alnum_prop": 0.7313965948327181,
"repo_name": "chitianhao/trafficserver",
"id": "52571e6c5ccac7ce5ee91fe64b3cdc7bfca2d86f",
"s... |
"""## Variables
@@Variable
## Variable helper functions
TensorFlow provides a set of functions to help manage the set of variables
collected in the graph.
@@global_variables
@@local_variables
@@model_variables
@@trainable_variables
@@moving_average_variables
@@global_variables_initializer
@@local_variables_initial... | {
"content_hash": "0b7792b1ec31b055b93e4c83e84cc9a9",
"timestamp": "",
"source": "github",
"line_count": 237,
"max_line_length": 79,
"avg_line_length": 32.16033755274262,
"alnum_prop": 0.716478614536867,
"repo_name": "jeffzheng1/tensorflow",
"id": "e196bdd3ff9999d89bdfcc73f8bbf56b825fe7a4",
"size": ... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0058_bandsawblade_heading'),
]
operations = [
migrations.AddField(
model_name='bandsawblade',
name='cols',
... | {
"content_hash": "cc6e621fe1f82405e5535bec0f352b1a",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 88,
"avg_line_length": 23.38888888888889,
"alnum_prop": 0.6128266033254157,
"repo_name": "n2o/guhema",
"id": "c21ec19e3b1c8edd2d802083f5a6d18baf79ea06",
"size": "493",
"b... |
import re
import ast
from setuptools import setup, find_packages
requires = [
'awscli>=1.16.10,<2.0.0',
'prompt-toolkit>=1.0.0,<1.1.0',
'boto3>=1.9.0,<2.0.0',
'configobj>=5.0.6,<6.0.0',
'Pygments>=2.1.3,<3.0.0',
]
with open('awsshell/__init__.py', 'r') as f:
version = str(
ast.liter... | {
"content_hash": "d251ff51a45d6a09bda53bd8cbb7add4",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 61,
"avg_line_length": 29.25862068965517,
"alnum_prop": 0.5527401296405421,
"repo_name": "awslabs/aws-shell",
"id": "5696838833891aecbc31df2b985633fb7022eaef",
"size": "171... |
from argparse import ArgumentParser
from os.path import dirname
from os.path import isfile
import sys
from docassemble.base.mako import exceptions
from docassemble.base.mako.lookup import TemplateLookup
from docassemble.base.mako.template import Template
def varsplit(var):
if "=" not in var:
return (var,... | {
"content_hash": "9b23aa58846bc93b97569a915657e8ae",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 77,
"avg_line_length": 27.91578947368421,
"alnum_prop": 0.5871040723981901,
"repo_name": "jhpyle/docassemble",
"id": "acaea652779af39653eb93aae85777902a5ecd38",
"size": "28... |
import sys
from utils.cli import shell
from utils.notify import info, error
import config
"""Sets up the necessary AWS configurations
Creates repository if it doesnt exists
"""
def get_repository_uri(repository):
"""Checks if a repository is created already
Arguments:
repository {string} -- Name of th... | {
"content_hash": "ae5688470bd3a5939ff3c078da04cad4",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 101,
"avg_line_length": 23.15,
"alnum_prop": 0.652267818574514,
"repo_name": "JoelRoxell/heimdall",
"id": "02ded6fe0e46ef59d271c2c675845de62d47cb91",
"size": "1413",
"bin... |
import datetime
import re
import unicodedata
import pytz
from dontbelate import settings
MAX_DEEPLINK_LENGTH = 40
def generate_slug(s_in):
s = unicode(s_in)
s = unicodedata.normalize('NFD', s).encode('ascii', 'ignore')
s = re.sub(r'[^a-zA-Z0-9\ \-_]', '', s.lower()) # strip non alphanumeric
s = re... | {
"content_hash": "137e202d6c9b470e64b9ca4e542f8ebf",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 79,
"avg_line_length": 24.93103448275862,
"alnum_prop": 0.6224066390041494,
"repo_name": "svleeuwen/dont-be-late-appengine",
"id": "e9b59157b56029a40755c30597f364eff9ae61b3",... |
from __future__ import division
from __future__ import print_function
import multiprocessing as mp
import time
from pysabertooth import Sabertooth
from smc import SMC
from pygecko import ZmqClass as zmq
# from pygecko import Messages as Msg
class Motion(mp.Process):
def __init__(self):
mp.Process.__init__(self)
... | {
"content_hash": "201de9e9f1bac3eb764ad1ce1598a3be",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 58,
"avg_line_length": 19.576923076923077,
"alnum_prop": 0.6286836935166994,
"repo_name": "DFEC-R2D2/r2d2",
"id": "6e046f1efd8e69572d7fc3bcfb53eebc78eb35fc",
"size": "1041"... |
from abc import abstractmethod
import copy
import re
from sqlalchemy import Float, Integer, text, exists, select, or_
from sqlalchemy.dialects.postgresql import JSONB
from sqlalchemy.sql import column
from sqlalchemy.sql.operators import is_
from dart.context.locator import injectable
from dart.model.exception import... | {
"content_hash": "5f516a0e4303498affda531889c3dea6",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 110,
"avg_line_length": 35.118556701030926,
"alnum_prop": 0.5953324526640247,
"repo_name": "RetailMeNotSandbox/dart",
"id": "575d843f17c55f41df506f3efff6a2671ce99c8d",
"si... |
from imagequery import Format, register_format, NewImageQuery
class BackendPreviewThumbnail(Format):
def execute(self, query):
return query.scale(700, 200).query_name('backend_preview_thumbnail')
register_format('backend_preview_thumbnail', BackendPreviewThumbnail)
| {
"content_hash": "102e99c2dc7401d538b1edc556c8cb9c",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 76,
"avg_line_length": 40,
"alnum_prop": 0.7857142857142857,
"repo_name": "team23/django_backend",
"id": "2523f72a19c45c337380b3fa5c6ee3c8597ffe75",
"size": "280",
"binary... |
r"""Goal-Finding and clustering combined task.
To demo this task, navigate to the main directory and run the following:
'''
$ python demo --config=spriteworld.configs.examples.goal_finding_clustering \
--task_hsv_colors=False
'''
This is a complicated task designed only to exemplify the features of the task
specifica... | {
"content_hash": "bb5190ba4f9f8de4fc34214f75120f0d",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 80,
"avg_line_length": 35.664739884393065,
"alnum_prop": 0.6774716369529984,
"repo_name": "deepmind/spriteworld",
"id": "22fb425ee3f0e07d1e40f74ea55777ea8b2e06ad",
"size":... |
__author__ = 'walter'
import requests
from xml.etree import ElementTree as ET
OCS_ADMIN = 'ocs/v1.php/cloud'
class StatusCodeException(Exception):
def __init__(self,status,statusCode,message):
self.status = status
self.statusCode = statusCode
self.message = message
def __str__(self):... | {
"content_hash": "ee7b9fd95fcbc779ba2117389224271c",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 83,
"avg_line_length": 28.0990990990991,
"alnum_prop": 0.5405578711125361,
"repo_name": "wlorenzetti/owncloudAdminClient",
"id": "af8a7cf8144c494338d53766036f441ad6783666",
... |
import sys
sys.path.insert(0,'../')
sys.path.insert(0,'./')
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "annotation.settings")
from markpic.models import KeyWord5K,Picture5K
words_list=[]
for line in open("../markpic/words"):
line=line[:-1]
words_list.append(line)
imagename_list=[]
for line in o... | {
"content_hash": "f112bbbcdf1f9c4353d8a0684e46412d",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 70,
"avg_line_length": 27.177777777777777,
"alnum_prop": 0.7162714636140638,
"repo_name": "matrixorz/justpic",
"id": "fd6943033eb92d476c7defa2af9a21b0ad7310a6",
"size": "12... |
import argparse
import os
import shlex
import subprocess
import sys
gopath = os.environ['GOPATH']
integration_command = """docker run --rm \
-e "GOPATH=/gopath" \
-v """ + gopath + """:/gopath \
-w /gopath/src/github.com/amadeovezz/gobro/db \
--network=d... | {
"content_hash": "3794fbbfb77ea5aa511e072c1f77531f",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 112,
"avg_line_length": 36.175438596491226,
"alnum_prop": 0.6231813773035888,
"repo_name": "amadeovezz/gobro",
"id": "f03152646f110bfd41aa36a6d4e31815b4004ccf",
"size": "20... |
'''
A Tornado-inspired logging formatter, with displayed time with millisecond accuracy
FYI: pyftpdlib also has a Tornado-style logger.
'''
import sys
import time
import logging
class Colors:
def __init__(self, color=None):
if color is None:
color = support_color()
if color:
import curses
... | {
"content_hash": "7500890bb783476438b9ee94c2b1e1a6",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 90,
"avg_line_length": 32.60550458715596,
"alnum_prop": 0.6178953292065279,
"repo_name": "lilydjwg/nvchecker",
"id": "5f586bca8f3d9a372dc8e9555af63422d245cf6a",
"size": "3... |
from PIL import Image
import glob
from os import path
import config
# read existing blacklist
if path.exists(config.path_blacklist):
with open(path.join(config.path_base, 'blacklist.txt'), 'r') as f:
blacklist = f.readlines()
else:
blacklist = []
# try opening all images, save error-generating images ... | {
"content_hash": "f0fb8637c3f7a3e6c62dd9bdb210bc22",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 73,
"avg_line_length": 31.666666666666668,
"alnum_prop": 0.6855263157894737,
"repo_name": "rtlee9/food-GAN",
"id": "369e9e006a6de4beb1437bda42924d66cb639141",
"size": "760"... |
import json
import yaml
import sys
import os
yamlpath = sys.argv[1]
jsonpath = os.path.splitext(yamlpath)[0] + '.json'
print(jsonpath)
with open(yamlpath, 'r') as yp:
# BaseLoader because our parser does not yet support
# constructors or resolvers
data = yaml.load(yp, Loader=yaml.BaseLoader)
with open(j... | {
"content_hash": "5406582d02b16935e39aef7ce3b94db7",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 56,
"avg_line_length": 21.77777777777778,
"alnum_prop": 0.7040816326530612,
"repo_name": "davidlazar/go-libyaml",
"id": "6ef5f10e82658b4151ca8d394631e969301db8ea",
"size": ... |
from __future__ import absolute_import
import logging
# Imports from core django
# Imports from third party apps
from rest_framework import mixins
from rest_framework.viewsets import GenericViewSet
from rest_framework_bulk.mixins import BulkCreateModelMixin
# Local imports
class BulkCreateViewSet(BulkCreateModelMix... | {
"content_hash": "1e4c2783e681caea90e2ebbc1d298e36",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 59,
"avg_line_length": 30.05263157894737,
"alnum_prop": 0.660245183887916,
"repo_name": "ephes/ml_jobcontrol",
"id": "12fc77306f391fdce8f8cd8f8c98388066eb3fa4",
"size": "62... |
from django import forms
from django.utils.translation import gettext_lazy as _
class QueryForm(forms.Form):
query_string = forms.CharField(
label=_("Search term(s)/phrase"),
help_text=_(
"Enter the full search string to match. An "
"exact match is required for your Promote... | {
"content_hash": "1d612597b0da5c5f9059beeacb7bc1d9",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 70,
"avg_line_length": 30.714285714285715,
"alnum_prop": 0.6186046511627907,
"repo_name": "zerolab/wagtail",
"id": "95a72462cd61a3022f24925c3cd08dc9840bf42b",
"size": "430"... |
import zmq
# ZeroMQ Context
context = zmq.Context()
# Define the socket using the "Context"
sock = context.socket(zmq.REP)
sock.bind("tcp://127.0.0.1:5678")
# Run a simple "Echo" server
while True:
message = sock.recv()
sock.send("Echo: " + message)
| {
"content_hash": "42a72c9660c98e82e89c18f08ad74bdc",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 20.076923076923077,
"alnum_prop": 0.6743295019157088,
"repo_name": "ajayaa/python-akhada",
"id": "79e4ea95ba33a2bf6da4dbfbe1b6c025e8a65561",
"size": ... |
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@pr... | {
"content_hash": "35da364205cb87fefdf47ed078608eb9",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 460,
"avg_line_length": 32.919642857142854,
"alnum_prop": 0.6463249254136154,
"repo_name": "tswast/google-cloud-python",
"id": "6f2121baf69ed7cc52d3b15b34fe4c356b7cb126",
... |
import argparse
from mapgen.generate_symbolset import (
generate_symbolset,
symbolsets,
update_file,
)
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--update', '-u',
help='Update the symbol definition files',
actio... | {
"content_hash": "8d552187f817c4125fc352d770add63c",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 73,
"avg_line_length": 35.25,
"alnum_prop": 0.6276595744680851,
"repo_name": "LarsSchy/SMAC-M",
"id": "ddb7b997f26cec15fdd686b2697c74a5ce17ee4e",
"size": "870",
"binary":... |
from itertools import izip
import numpy as np
__author__ = "Gokul Ramesh"
__copyright__ = "Copyright 2014, LatentView Analytics Pvt. Ltd."
__email__ = "gokul.ramesh@latentview.com"
__status__ = "Development"
__version__="0.0.1"
def nNGrams(iterable, nList):
if nList == [-1]:
return [[iterable]]
ret... | {
"content_hash": "e96ea325c43071add517bd0f78c85440",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 67,
"avg_line_length": 25.29268292682927,
"alnum_prop": 0.5756991321118612,
"repo_name": "mrgokul/aggcluster",
"id": "8e3f179f6f5d77162cc528b4a9bb798bcc4a0f43",
"size": "10... |
import argparse
import sys
import logging
import elasticsearch
import elasticsearch.helpers
ES_NODES = 'uct2-es-door.mwt2.org'
VERSION = '0.1'
SOURCE_INDEX = '.kibana'
TARGET_INDEX = 'osg-connect-kibana'
def get_es_client():
""" Instantiate DB client and pass connection back """
return elasticsearch.Elastic... | {
"content_hash": "367e6ae023108f9ef57d31100195a8df",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 73,
"avg_line_length": 32.878787878787875,
"alnum_prop": 0.4838709677419355,
"repo_name": "DHTC-Tools/logstash-confs",
"id": "8b0ede56aaa89acf36944e5eb4956523efdaf5f5",
"si... |
import roslib
roslib.load_manifest('smart_arm_controller')
import rospy
from std_msgs.msg import Float64
from std_msgs.msg import Float64MultiArray
from numpy import matrix
import numpy as np
import sys
import sensor_msgs.msg
from copy import copy, deepcopy
#The alternating 2 desired positions for demo
desired_posi... | {
"content_hash": "d129b5851592557eb145e83bbd8a64b7",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 73,
"avg_line_length": 23.95,
"alnum_prop": 0.6440501043841336,
"repo_name": "sigproc/robotic_surgery",
"id": "b36d9bfd8220ac39cfc672979618ac8a30805fd7",
"size": "981",
"... |
""" Provides a way of sleeping safely.
"""
from time import sleep as systemsleep
from time import time
import select
from brisa.core import log
def tsleep(timeout, death_fd):
if death_fd:
# Interruptable sleep
read, dummy1, dummy2 = select.select([death_fd], [], [], timeout)
if read:
... | {
"content_hash": "aa4801a31dd3808ba9e1620bf11e961e",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 78,
"avg_line_length": 29.61764705882353,
"alnum_prop": 0.5988083416087389,
"repo_name": "aleixq/python3-brisa",
"id": "67b82e1c26bde9c3d8668440379b24da822ace8e",
"size": "... |
from pattern import *
Patterns = {}
def check_jid_for_matches(jid, Patterns = None):
if not Patterns:
return False
jid = JIDPattern.split(jid)
for pattern in Patterns:
if pattern == jid:
return pattern
return False
def check_nick_for_matches(nick, Patterns = None):
if not Patterns:
return False
for p... | {
"content_hash": "f775ebbfcb3228547fc6968ccc912d87",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 106,
"avg_line_length": 31.421875,
"alnum_prop": 0.6210840377921432,
"repo_name": "Manazius/blacksmith-bot",
"id": "fc919b1a1c185848946d12cb5508209dfce1777d",
"size": "415... |
import argparse
from oslo_serialization import jsonutils
from osc_lib.command import command
from mistralclient.commands.v2 import base
from mistralclient import utils
class EnvironmentFormatter(base.MistralFormatter):
COLUMNS = [
('name', 'Name'),
('description', 'Description'),
('vari... | {
"content_hash": "dfb61b13f8ab82ee9f71f0aae3514e0f",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 78,
"avg_line_length": 29.514285714285716,
"alnum_prop": 0.5862536302032914,
"repo_name": "openstack/python-mistralclient",
"id": "cdcb4e9ba06684465b2e4d6228156cc48510f368",... |
import os
import io
from gensim import corpora, models, similarities
import re
from config import *
from nltk import sent_tokenize
from nltk import word_tokenize
__author__ = 'Memray'
import json
stopwords = []
def load_stopword(path):
stop_word = []
try:
stopword_file = open(path, 'r')
sto... | {
"content_hash": "0223047ee9b293c81bb3e2221be94f77",
"timestamp": "",
"source": "github",
"line_count": 303,
"max_line_length": 131,
"avg_line_length": 32.801980198019805,
"alnum_prop": 0.6131401549451655,
"repo_name": "fujunswufe/YelpDataChallenge",
"id": "e41f13dc262c2f9bd5dbba04aeb13764e4e5d77d",
... |
from __future__ import unicode_literals
from django.contrib.auth.handlers.modwsgi import (
check_password, groups_for_user,
)
from django.contrib.auth.models import Group, User
from django.test import TransactionTestCase, override_settings
from .models import CustomUser
# This must be a TransactionTestCase beca... | {
"content_hash": "5d259e162698dab80278d525f74b4c2c",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 100,
"avg_line_length": 36.29113924050633,
"alnum_prop": 0.65852807813045,
"repo_name": "Endika/django",
"id": "c0751a082542f7680ef74e7673a5b8c2d9c07e1f",
"size": "2867",
... |
__author__ = 'Dimitry Lvovsky, dimitry@reviewpro.com'
# Copyright 2014 ReviewRank S.A ( ReviewPro )
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | {
"content_hash": "969194d81ff6e733d0d8755f75a6ee2b",
"timestamp": "",
"source": "github",
"line_count": 244,
"max_line_length": 169,
"avg_line_length": 45.24180327868852,
"alnum_prop": 0.6139143038318688,
"repo_name": "reviewpro/api_connect",
"id": "acd2999846001d89cdf96a956fd5f7b1da2a65ba",
"size"... |
from django_jinja.library import filter
__author__ = 'AlexStarov'
#register = Library()
#@register.filter(name='true_false', )
@filter(name='true_false', )
def true_false(value, ):
# if bool(value):
if value:
return u'Да'
elif not value:
return u'Нет'
else:
... | {
"content_hash": "3ba73c8d9f48b649a3ec6fb8f282e4d8",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 39,
"avg_line_length": 20.210526315789473,
"alnum_prop": 0.5572916666666666,
"repo_name": "AlexStarov/Shop",
"id": "560b9dbed98b78f4b1ec03ebfef0efea3bf92ffc",
"size": "463"... |
from webserver import application
if __name__ == '__main__':
application.run() | {
"content_hash": "6f0b0d969a1bd3cdb9e41507b87e906c",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 33,
"avg_line_length": 26.666666666666668,
"alnum_prop": 0.675,
"repo_name": "msemple1111/average_alpr",
"id": "24a52e28eb38dc956fa3cd2f0e723474774dfb0b",
"size": "80",
"b... |
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.uix.label import Label
from kivy.properties import ObjectProperty, NumericProperty
from kivy.clock import Clock
from kivy.core.window import Window
from kivy.uix.screenmanager import ScreenManager, Screen
import traceback
from random import randint... | {
"content_hash": "c5e8c73df9b95e579a317bd36a99b97a",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 70,
"avg_line_length": 21.89637305699482,
"alnum_prop": 0.6635115948887838,
"repo_name": "Narcolapser/PyGameLearningByDoing",
"id": "6fbbb2e569c8b4d37a074321a7796679ba1d0a8c... |
"""Contains the base Layer class, from which all layers inherit.
This is a private class and its internal implementation is subject to changes
in the future.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import inspect
import re
from ... | {
"content_hash": "25986053b0de00eb9f180de374447b8c",
"timestamp": "",
"source": "github",
"line_count": 317,
"max_line_length": 80,
"avg_line_length": 33.94637223974763,
"alnum_prop": 0.6581172753461574,
"repo_name": "calebfoss/tensorflow",
"id": "74a6052ff6b33602befa3405b3e21438ada2376a",
"size": ... |
import re
import socket
import contextlib
import sys
import random
import argparse
import logging
from collections import namedtuple
from functools import partial
import dns.resolver
import dns.update
import dns.exception
import dns.tsigkeyring
import dns.query
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0]... | {
"content_hash": "b6856015d8c86cbbca6fcee48a2e91da",
"timestamp": "",
"source": "github",
"line_count": 680,
"max_line_length": 78,
"avg_line_length": 31.28235294117647,
"alnum_prop": 0.5683527641970666,
"repo_name": "bacher09/dynsupdate",
"id": "e1e192f8ee938bdee13d9c0195a56564f9cbf855",
"size": "... |
import datetime
import json
import os
import shutil
from django.conf import settings
from django.core.files.storage import default_storage as storage
from django.core.urlresolvers import reverse
import mock
from nose.tools import eq_, ok_
from pyquery import PyQuery as pq
import amo
import amo.tests
import mkt
from ... | {
"content_hash": "725aa4553c59badd14be069358f49876",
"timestamp": "",
"source": "github",
"line_count": 1020,
"max_line_length": 79,
"avg_line_length": 37.772549019607844,
"alnum_prop": 0.5941393272425249,
"repo_name": "ngokevin/zamboni",
"id": "c2da056ab12e9195043e46d2ced910dfbdb76b0a",
"size": "3... |
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.auth.models import User
from datetime import datetime
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from d... | {
"content_hash": "6fde048c6f50c8b4ff49ed67966412ce",
"timestamp": "",
"source": "github",
"line_count": 383,
"max_line_length": 79,
"avg_line_length": 36.809399477806785,
"alnum_prop": 0.6254078592708185,
"repo_name": "fgirault/smeuhsocial",
"id": "97d5229d41009ab59fbea032eddc562d4e377cc9",
"size":... |
import os
import sys
import re
from gensim import corpora, matutils
import MeCab
import zenhan
import pandas as pd
DATA_PATH = './text/stretch_data.txt'
DICTIONARY_FILE_NAME = './dict/stretch_dic.txt'
mecab = MeCab.Tagger('mecabrc')
"""
TODO: Receive pandas Series and generate dict
Now this script reads files.
... | {
"content_hash": "8a49f8996b17e6b6fd60eb1bb774e2c9",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 121,
"avg_line_length": 23.189655172413794,
"alnum_prop": 0.6219330855018588,
"repo_name": "acro5piano/text-similarity",
"id": "57a8fb23ea3a32b34ff1114089f957aaf5ac88a8",
... |
"""
Given an array of integers, find out whether there are two distinct indices i and j in the array such that the absolute difference between nums[i] and nums[j] is at most t and the absolute difference between i and j is at most k.
Example 1:
Input: nums = [1,2,3,1], k = 3, t = 0
Output: true
Example 2:
Input: num... | {
"content_hash": "13247857130388bbda165913ac192efa",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 229,
"avg_line_length": 37.39473684210526,
"alnum_prop": 0.5932441942294159,
"repo_name": "franklingu/leetcode-solutions",
"id": "913fe73f05d9e8f64cc3e5af99fcd6b0501509e7",
... |
from BonusAllocator import BonusAllocator
from IOHmmModel import IOHmmModel
import numpy as np
import mdptoolbox
class MLSAllocator(BonusAllocator):
def __init__(self, num_workers, len_seq=10, base_cost=5, bns=2, t=10, weights=None):
super(MLSAllocator, self).__init__(num_workers, base_cost, bns, t, weig... | {
"content_hash": "b15534f5adf1795feabfa990d831c2a8",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 115,
"avg_line_length": 45.64102564102564,
"alnum_prop": 0.5584269662921348,
"repo_name": "guanhuamai/DPM",
"id": "2631089263570be0445dbe644fbe16eec3c63d39",
"size": "3560"... |
from django.shortcuts import render
# Create your views here.
### Source material taken from:
### https://mayukhsaha.wordpress.com/2013/05/09/simple-login-and-user-registration-application-using-django/
### March 2, 2015
### No explicit license
from login.forms import *
from django.contrib.auth.decorators import log... | {
"content_hash": "5787523616e86a69397576227025dc1e",
"timestamp": "",
"source": "github",
"line_count": 614,
"max_line_length": 146,
"avg_line_length": 38.12214983713355,
"alnum_prop": 0.6109710770282394,
"repo_name": "CMPUT410W15/cmput410-project",
"id": "3317685586c9463bd5b09d8d9fe4d0e8697ca952",
... |
"""The tests for the Script component."""
# pylint: disable=protected-access
import asyncio
from contextlib import contextmanager
from datetime import timedelta
from functools import reduce
import logging
import operator
from types import MappingProxyType
from unittest import mock
from unittest.mock import AsyncMock, p... | {
"content_hash": "fc29ce9d1e68fdbcd5a402d19f745e50",
"timestamp": "",
"source": "github",
"line_count": 3729,
"max_line_length": 106,
"avg_line_length": 33.55993563958166,
"alnum_prop": 0.5141875424507572,
"repo_name": "rohitranjan1991/home-assistant",
"id": "11ba9810b9dffd9162c71af1959a7b78337ac66d"... |
"""The tests for the Home Assistant HTTP component."""
# pylint: disable=protected-access
from ipaddress import ip_address
import os
from unittest.mock import Mock, mock_open, patch
from aiohttp import web
from aiohttp.web_exceptions import HTTPUnauthorized
from aiohttp.web_middlewares import middleware
import pytest
... | {
"content_hash": "14792318d4e0b2e53393c7e65b10ebba",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 130,
"avg_line_length": 32.18376068376068,
"alnum_prop": 0.6495817288540698,
"repo_name": "turbokongen/home-assistant",
"id": "717bd9564c0220286f11ef8d33699efb807c2708",
"... |
"""Python I/O functions.
:author: jao <jao@bigml.com>
:date: Wed Apr 08, 2015-2022 17:52
"""
import csv
class UnicodeReader():
"""Adapter to read files
"""
def __init__(self, filename, dialect=csv.excel,
encoding="utf-8", **kwargs):
"""Constructor method for the reader
... | {
"content_hash": "4884201aa81aaf1f2c53c87440d1480b",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 73,
"avg_line_length": 22.566929133858267,
"alnum_prop": 0.5129099790648988,
"repo_name": "bigmlcom/python",
"id": "c3856e24787b0d9c93e18d9dbc9d3462d560c118",
"size": "350... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("organisations", "0011_organisationdivision_seats_total")]
operations = [
migrations.CreateModel(
name="OrganisationD... | {
"content_hash": "3870bd96b8e01c20d130debef5f7c28d",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 85,
"avg_line_length": 34.85,
"alnum_prop": 0.501195600191296,
"repo_name": "DemocracyClub/EveryElection",
"id": "74799ff92178b4cc3a52eaeee947b225a6cee187",
"size": "2164",... |
from __future__ import absolute_import
import datetime
import unittest
from django.test import TransactionTestCase
from django.db import connection, DatabaseError, IntegrityError, OperationalError
from django.db.models.fields import IntegerField, TextField, CharField, SlugField, BooleanField, BinaryField
from django.d... | {
"content_hash": "11b103edc95482282a1c8149e13f65d5",
"timestamp": "",
"source": "github",
"line_count": 951,
"max_line_length": 125,
"avg_line_length": 39.4794952681388,
"alnum_prop": 0.5704887468371288,
"repo_name": "YYWen0o0/python-frame-django",
"id": "64726aff4ed4df74b0cc092ec75f377fcd14b100",
... |
"""
SQLite3 backend for the sqlite3 module in the standard library.
"""
import decimal
import math
import re
import warnings
from sqlite3 import dbapi2 as Database
import pytz
from django.core.exceptions import ImproperlyConfigured
from django.db import utils
from django.db.backends import utils as backend_utils
from... | {
"content_hash": "33d1fbdd1d9af57b96677913e6ce9ae0",
"timestamp": "",
"source": "github",
"line_count": 485,
"max_line_length": 105,
"avg_line_length": 38.55051546391753,
"alnum_prop": 0.6095630315023801,
"repo_name": "evansd/django",
"id": "e820c6bd2e2ba885868bf1b2ea5d2f5c84b7a796",
"size": "18697... |
import sys
from taskbuffer.DBProxy import DBProxy
import userinterface.Client as Client
import urllib2,urllib,datetime,time
# password
from config import panda_config
passwd = panda_config.dbpasswd
if len(sys.argv) == 2:
startID = int(sys.argv[1])
endID = startID
else:
startID = int(sys.argv[1])
en... | {
"content_hash": "4c308b8622c430036425ae0d3aa22bff",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 140,
"avg_line_length": 30.170731707317074,
"alnum_prop": 0.6871463217461601,
"repo_name": "RRCKI/panda-server",
"id": "b33769d453ac1f1b980c7174a206cf0bd95846ca",
"size": "... |
"""Transport adapter for Requests."""
from __future__ import absolute_import
import cachecontrol
import functools
import logging
import numbers
import time
try:
import requests
except ImportError as error: # pragma: NO COVER
import six
six.raise_from(
ImportError(
"The requests libr... | {
"content_hash": "e4b322ed635a316702cd36399c37532d",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 85,
"avg_line_length": 30.59016393442623,
"alnum_prop": 0.632636655948553,
"repo_name": "googleinterns/server-side-identity",
"id": "97b56c2a4a6a8f99bb36c2d98f254d433eaa6781... |
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import unittest
import transaction
from pyramid.authentication import AuthTktAuthenticationPolicy
from pyramid.authorization import ACLAuthorizationPolicy
from pyramid import testing
from .models import DBSession
from unittest.mock import p... | {
"content_hash": "96dfa80ecbd788d9c477f2fa0dddbc0b",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 80,
"avg_line_length": 37.58441558441559,
"alnum_prop": 0.6762266758811334,
"repo_name": "xydinesh/euwe",
"id": "eb6d33a1871db544ff35e8ebe25105a605cd7faa",
"size": "2894",
... |
import numpy as np
from pandas import read_csv
from sqlalchemy import and_
from sqlalchemy.sql.expression import func
from utils import xa, render_date, render_time
from orm import Float, Point
from etl import DATABASE_URL
CHUNK_SIZE=10000
DATA_COLS='ID,DATE,TIME,LAT,LON,PRESS,U,V,TEMP,Q_TIME,Q_POS,Q_PRESS,Q_VEL,Q_T... | {
"content_hash": "4e9fb0d6b9ac84096fac0f31f1f1ed9e",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 140,
"avg_line_length": 34.77205882352941,
"alnum_prop": 0.6348065130048636,
"repo_name": "joefutrelle/noaa_floats",
"id": "a2991ea05c62d58959ade7e344c1cbff2fb36857",
"siz... |
import sys
import unittest
from libcloud.utils.py3 import httplib
from libcloud.compute.drivers.nephoscale import NephoscaleNodeDriver
from libcloud.test import MockHttp
from libcloud.test.compute import TestCaseMixin
from libcloud.test.file_fixtures import ComputeFileFixtures
class NephoScaleTest(unit... | {
"content_hash": "fc3243f6f71e6b183518b0d5fb560649",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 78,
"avg_line_length": 39.49707602339181,
"alnum_prop": 0.6123778501628665,
"repo_name": "Hybrid-Cloud/badam",
"id": "7c22c6577b32125a0772bd334b58e1937e5e7e27",
"size": "7... |
""" ib.ext.cfg.TagValue -> config module for TagValue.java.
"""
from java2python.config.default import modulePrologueHandlers
modulePrologueHandlers += [
'from ib.lib.overloading import overloaded',
]
| {
"content_hash": "343cf1ab4d60f5e72fc497e994ed2033",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 61,
"avg_line_length": 26.375,
"alnum_prop": 0.7440758293838863,
"repo_name": "chris-ch/IbPy",
"id": "4d49843af2435d8b7a033e1ed22812f736f8a5c8",
"size": "257",
"binary": f... |
from django.apps import AppConfig
class ContactsConfig(AppConfig):
name = 'sno_contacts'
| {
"content_hash": "9f71e149c3cbfac25dcaae30e8a6a0cc",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 33,
"avg_line_length": 19,
"alnum_prop": 0.7578947368421053,
"repo_name": "glad-web-developer/zab_sno",
"id": "be432097e30fd2f6abfadcebab28b73ff2888032",
"size": "95",
"bi... |
import proto # type: ignore
from google.ads.googleads.v11.resources.types import ad_group_ad_label
from google.rpc import status_pb2 # type: ignore
__protobuf__ = proto.module(
package="google.ads.googleads.v11.services",
marshal="google.ads.googleads.v11",
manifest={
"MutateAdGroupAdLabelsRequ... | {
"content_hash": "b4af8dc3f438e71ad860fb72a957b510",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 129,
"avg_line_length": 35.64655172413793,
"alnum_prop": 0.667956469165659,
"repo_name": "googleads/google-ads-python",
"id": "f20bd42489409c78acfd0f0d401a0844e7011d19",
"... |
'''
Collect all of the names within a scope
and attribute them to the containing Block or Module node.
'''
from ..util.dispatch import method_store, multimethod
from .. import node
from .. import scope
class CollectNames(object):
_store = method_store()
def __init__(self):
self.namespace = scope.Roo... | {
"content_hash": "095e97e39c735fc85c2e2885ee8b4472",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 64,
"avg_line_length": 22.95294117647059,
"alnum_prop": 0.583290620194772,
"repo_name": "dacjames/mara-lang",
"id": "60a67bbdbc582c33a33bde0a1927faa61e1150ba",
"size": "195... |
import kdb
key1 = kdb.Key("user:/key1", kdb.KEY_VALUE, "some_value")
print("Key1 name=\"{0}\" value=\"{1}\"".format(key1.name, key1.value))
print("")
print("Every Key has properties. Some are read only, some are read+write.")
print("Properties of Key1:")
print(" key1.name = \"{0}\"".format(key1.name))
print(" k... | {
"content_hash": "0cd9ab47ff1a4825d38215adae896702",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 94,
"avg_line_length": 34.175,
"alnum_prop": 0.6561814191660571,
"repo_name": "ElektraInitiative/libelektra",
"id": "1bef307d7bea8bd27f9076e8faee3d8ec15639c4",
"size": "136... |
this is another test file
| {
"content_hash": "12f3040a74bf8127d178cad4e8414cef",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 25,
"avg_line_length": 26,
"alnum_prop": 0.8076923076923077,
"repo_name": "dmull1/pynet_test",
"id": "786a93a631dcd6b2356b525d2b20ac3349b6c5b9",
"size": "26",
"binary": fa... |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def AdminPasswordNotChangedEvent(vim, *args, **kwargs):
'''Default password for the Admin ... | {
"content_hash": "6e0dabea25815db34ed07a4cd0970584",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 124,
"avg_line_length": 35.81818181818182,
"alnum_prop": 0.6049069373942471,
"repo_name": "xuru/pyvisdk",
"id": "dbac1f3c77301aa0c81ebf9f3a32ebbe7b62be46",
"size": "1183",
... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('organization', '0006_remove_courseorg_tag'),
('courses', '0007_video_learn_times'),
]
operations = [
migrat... | {
"content_hash": "4be2e899db6a52f4f4c00c922579f7fe",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 160,
"avg_line_length": 28.7,
"alnum_prop": 0.6428571428571429,
"repo_name": "tongxindao/Flask-micblog",
"id": "976003c518254ebdddba58fb79dedb5e98918433",
"size": "644",
... |
from perfkitbenchmarker import flags
NONE = 'None'
READ_ONLY = 'ReadOnly'
READ_WRITE = 'ReadWrite'
flags.DEFINE_enum(
'azure_host_caching', NONE,
[NONE, READ_ONLY, READ_WRITE],
'The type of host caching to use on Azure data disks.')
# Azure Storage Account types. See
# http://azure.microsoft.com/en-us/pri... | {
"content_hash": "75da024f97f1ad96aea3b5c5a9bfba48",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 80,
"avg_line_length": 31.864864864864863,
"alnum_prop": 0.6938083121289228,
"repo_name": "meteorfox/PerfKitBenchmarker",
"id": "8825da0bbbe4f222c412ed707846043e0a1c6ed8",
... |
import scrapy
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import Rule
from corpus_builder.templates.spider import CommonSpider
class MuktoMonaSpider(CommonSpider):
name = 'mukto_mona'
allowed_domains = ['blog.mukto-mona.com']
base_url = 'https://blog.mukto-mona.com/'
start_req... | {
"content_hash": "b41de22de22ceb85b7bae88b5324870f",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 82,
"avg_line_length": 26.59375,
"alnum_prop": 0.6251468860164512,
"repo_name": "banglakit/corpus-builder",
"id": "39e4f0b7d0b0c2dc18f54a2cfddb11dd2176169b",
"size": "875",... |
'''
Created on Mar 18, 2015
pulls down and reads through the TCGA annotation and returns a map
of patient or sample or aliquot id to [[annotationClassificationName, categoryName],...]
of failed annotations only
@author: michael
json return layout
{
"dccAnnotation":[ {
"id":26882,
"dateCreated":"... | {
"content_hash": "e56f312783acc40196f7b3b79f1a9963",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 245,
"avg_line_length": 37.82442748091603,
"alnum_prop": 0.6716448032290615,
"repo_name": "cancerregulome/gidget",
"id": "836f3a5efbf8d8ef145d620515bccc0d8a7892d5",
"size"... |
import io
import os
import mock
from nova import test
from nova import utils
from nova.virt.disk import api as disk_api
from nova.virt.disk.mount import api as mount
from nova.virt import driver
PROC_MOUNTS_CONTENTS = """rootfs / rootfs rw 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
proc /proc proc rw,n... | {
"content_hash": "5be5730260cb9711053e51cccc9bb203",
"timestamp": "",
"source": "github",
"line_count": 275,
"max_line_length": 77,
"avg_line_length": 36.97090909090909,
"alnum_prop": 0.5512934002163864,
"repo_name": "sacharya/nova",
"id": "4851b6f040cfcdeb4fbd0950fda5e924bd0773f5",
"size": "10842"... |
from ninfo import PluginBase
from ninfo import util
class ieeedb_plug(PluginBase):
"""This plugin looks up OUI in a SQL database"""
name = 'ieeedb'
title = 'Ieeedb'
description = 'Retrieve information from SQL database'
cache_timeout = 60*60
types = ['mac']
remote = True
local = Tr... | {
"content_hash": "854ec75c34881bb5a6a42a63875f3769",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 90,
"avg_line_length": 30.17142857142857,
"alnum_prop": 0.5350378787878788,
"repo_name": "kraigu/ninfo-plugin-ieeedb",
"id": "0cc9d153692418fca98cb84661058bf98255aa90",
"si... |
from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
url(r'^$', 'hello.views.home'),
)
| {
"content_hash": "b1a4833d9b74d56081ab71052344c7bb",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 51,
"avg_line_length": 23.6,
"alnum_prop": 0.6694915254237288,
"repo_name": "cslosiu/TweetList",
"id": "cbe94a8b7e4615ef40bd08e8596626cc37531cec",
"size": "118",
"binary":... |
"""
Finite element reference mappings.
"""
import numpy as nm
from sfepy.base.base import get_default, output
from sfepy.discrete.common.mappings import Mapping
from sfepy.discrete.common.extmods.mappings import CMapping
from sfepy.discrete.fem.poly_spaces import PolySpace
class FEMapping(Mapping):
"""
Base c... | {
"content_hash": "c0f4f0724ef999917b40b07c5a6752bd",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 79,
"avg_line_length": 31.28472222222222,
"alnum_prop": 0.578912319644839,
"repo_name": "lokik/sfepy",
"id": "ca385bafbcdee392dbb29475f718732d8e9163e9",
"size": "4505",
... |
import os
import threading
import txaio
txaio.use_twisted()
from txaio import make_logger
from twisted.internet.defer import inlineCallbacks
from autobahn.twisted.util import sleep
from autobahn.wamp.types import PublishOptions
from autobahn.twisted.wamp import ApplicationSession
class MyPublisher(ApplicationSessi... | {
"content_hash": "6dcc94e4be2b6caf91717eb206677695",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 106,
"avg_line_length": 32.557377049180324,
"alnum_prop": 0.5664652567975831,
"repo_name": "meejah/crossbarexamples",
"id": "de73ad15791d9d9f3c598bc14d6473d6e47bc16d",
"siz... |
"""
Code for extracting relational triples from the ieer and conll2002 corpora.
Relations are stored internally as dictionaries ('reldicts').
The two serialization outputs are I{rtuple} and I{clause}.
- An I{rtuple} is a tuple of the form C{(subj, filler, obj)},
where C{subj} and C{obj} are pairs of Named ... | {
"content_hash": "593580ee0f5568631a5e07bce159fed3",
"timestamp": "",
"source": "github",
"line_count": 413,
"max_line_length": 146,
"avg_line_length": 30.239709443099272,
"alnum_prop": 0.5584914724957963,
"repo_name": "hectormartinez/rougexstem",
"id": "10677db9d72291fe39282fd4c2c6ac73e747a6b4",
"... |
import tempfile
from snakemake.shell import shell
from lcdblib.snakemake import helpers
extra = snakemake.params.get('extra', '')
log = snakemake.log_fmt_shell()
stranded = snakemake.params.get('stranded', False)
try:
stranded_int = {False: 0, True: 1, 'reverse': 2}[stranded]
except KeyError:
raise ValueError... | {
"content_hash": "7785493d49d924819576b7c41b613d54",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 83,
"avg_line_length": 30.338983050847457,
"alnum_prop": 0.7318435754189944,
"repo_name": "lcdb/lcdb-wrapper-tests",
"id": "dc090bda32126f26dbdf4c849f335575c1482f25",
"size... |
import urllib2, json
UCONN_ROUTE_INFO_URL = 'http://www.uconnshuttle.com/Services/JSONPRelay.svc/GetRoutes'
ROUTE_STOPS_URL = 'http://www.uconnshuttle.com/Services/JSONPRelay.svc/GetMapStopEstimates'
VEHICLE_INFO_URL = 'http://www.uconnshuttle.com/Services/JSONPRelay.svc/GetMapVehiclePoints'
STOP_INFO_URL = 'http://ww... | {
"content_hash": "53c060fab0d0f3fcddda2dc50991bc0a",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 124,
"avg_line_length": 38.506410256410255,
"alnum_prop": 0.5493590810720825,
"repo_name": "foss-transportationmodeling/rettina-server",
"id": "0f83a377149baecd11dcc26c01ccf... |
import alsaaudio, time, audioop, argparse
from subprocess import call
parser = argparse.ArgumentParser(description='Adaptive Volume Application. Normalize with input from a Microphone')
parser.add_argument(
'--switch',
action='store_true',
help='Invert the action. Normalizing loud sounds Adapting down.'
)
... | {
"content_hash": "9c29153dc9a650cce2e96fca03051417",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 129,
"avg_line_length": 29.651785714285715,
"alnum_prop": 0.6753989762119843,
"repo_name": "mikeyy/pywakealexa",
"id": "0202052060a4ca192bb86d51384df7bd7b8e0cc2",
"size": ... |
"""
IPMI power manager driver.
Uses the 'ipmitool' command (http://ipmitool.sourceforge.net/) to remotely
manage hardware. This includes setting the boot device, getting a
serial-over-LAN console, and controlling the power state of the machine.
NOTE THAT CERTAIN DISTROS MAY INSTALL openipmi BY DEFAULT, INSTEAD OF ip... | {
"content_hash": "c24324d39313506b02192292f4ae2714",
"timestamp": "",
"source": "github",
"line_count": 1169,
"max_line_length": 79,
"avg_line_length": 40.09923011120616,
"alnum_prop": 0.5978112466934039,
"repo_name": "devananda/ironic",
"id": "cef19d25b97b1bc2a397dd9ff3cbe455d3b114b0",
"size": "47... |
import uuid
import mock
from oslo_utils import timeutils
import six
from six.moves.urllib import parse as urlparse
from testtools import matchers
from keystoneclient import session
from keystoneclient.tests.unit.v3 import client_fixtures
from keystoneclient.tests.unit.v3 import utils
from keystoneclient.v3.contrib.oa... | {
"content_hash": "ad541dad1df2ee1112041f35a96e65ee",
"timestamp": "",
"source": "github",
"line_count": 273,
"max_line_length": 76,
"avg_line_length": 39.84249084249084,
"alnum_prop": 0.5853636112898777,
"repo_name": "darren-wang/ksc",
"id": "092e6777c5fc654070ff265b714db8ac8a62ac99",
"size": "1142... |
import cv2
import numpy as np
import os
from plantcv.plantcv._debug import _debug
from plantcv.plantcv import fatal_error
from plantcv.plantcv import params
def hist_equalization(gray_img):
"""
Histogram equalization is a method to normalize the distribution of intensity values. If the image has low
co... | {
"content_hash": "e9b16a09ad0b6ae7db6473fcbe87c452",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 110,
"avg_line_length": 25.272727272727273,
"alnum_prop": 0.6762589928057554,
"repo_name": "stiphyMT/plantcv",
"id": "77b2519c371a7345fb7ce360d47ce74926ba811a",
"size": "86... |
def test_response_headers(self):
response = self.client.{{ request.method|lower }}('{{ request.path }}', data={{ request.data|safe }})
{% for k, v in response.headers %}self.assertEqual(response['{{ k }}'], '{{ v }}')
{% endfor %}
| {
"content_hash": "d0522f7c052491e855d23799580ffa76",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 109,
"avg_line_length": 64.75,
"alnum_prop": 0.5598455598455598,
"repo_name": "kezabelle/django-testguess",
"id": "f4e245323aa466437b2b4b099f41d1a2bbb6b68f",
"size": "259",
... |
from sphinx import addnodes
import docutils.parsers.rst.directives
from .base import BaseDirective
class AutoFunctionDirective(BaseDirective):
"""Directive to render :term:`Javascript` function documentation.
The unique argument should be the identifier of the function element.
.. sourcecode:: rest
... | {
"content_hash": "7b6d3dc94f354ec459ae7851d92aec4f",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 80,
"avg_line_length": 30.49462365591398,
"alnum_prop": 0.6382228490832158,
"repo_name": "buddly27/champollion",
"id": "8a1bcb9cc06224454b25d1281dcde82c1bd4a2a2",
"size": "... |
from setuptools import setup, find_packages, Command
import sys
__version__ = '0.2.0'
tests_require = []
if sys.version_info < (2, 7):
tests_require += ['unittest2']
class Tox(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def r... | {
"content_hash": "7b5f8403713604e0b6df4aa5db2c9c5a",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 72,
"avg_line_length": 30.984848484848484,
"alnum_prop": 0.6053789731051344,
"repo_name": "ryanpetrello/python-zombie",
"id": "8229ed72ebbf39c7e5909653202e6d3695aa9ef8",
"s... |
from .base import Image, ImageBoundaryError
from .boolean import BooleanImage
from .masked import MaskedImage
from .interpolation import scipy_interpolation
| {
"content_hash": "7e7c1236913661af26eff5a4a8bc60ce",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 46,
"avg_line_length": 39.25,
"alnum_prop": 0.8535031847133758,
"repo_name": "jalabort/ijcv-2014-aam",
"id": "36698047387ef8e3079ce11bf697c17150aaf8ca",
"size": "157",
"bi... |
"""The Server Group API Extension."""
from oslo_log import log as logging
import webob
from webob import exc
from nova.api.openstack import common
from nova.api.openstack.compute.schemas.v3 import server_groups as schema
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova.api impor... | {
"content_hash": "cffb9aecc41867479fe0624aeb5e20c2",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 79,
"avg_line_length": 35.452229299363054,
"alnum_prop": 0.6151634926338484,
"repo_name": "cloudbase/nova-virtualbox",
"id": "58c55df42b4adc9b073aec34d08012c586e981f0",
"s... |
import os
import time
from ethereum import utils
from ethereum import pruning_trie as trie
from ethereum.refcount_db import RefcountDB
from ethereum.db import OverlayDB
from ethereum.utils import to_string, is_string
import rlp
from rlp.utils import encode_hex
from ethereum import blocks
from ethereum import processblo... | {
"content_hash": "6b18bb6b7d1888dab4875e5490e833a1",
"timestamp": "",
"source": "github",
"line_count": 414,
"max_line_length": 95,
"avg_line_length": 38.572463768115945,
"alnum_prop": 0.5938380612436596,
"repo_name": "vaporry/pyethereum",
"id": "99a6f3c63db4aadb9b1665699c9c36fbf9c755a0",
"size": "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.