text stringlengths 4 1.02M | meta dict |
|---|---|
from django.core.urlresolvers import reverse
from django.shortcuts import redirect
from django.test.client import Client
import mock
from mock import patch
from nose.tools import eq_, ok_
from remo.base.tests import RemoTestCase, requires_permission
from remo.featuredrep.models import FeaturedRep
from remo.featuredre... | {
"content_hash": "f6bcea0928a1e550ed4b1a64e0798324",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 93,
"avg_line_length": 45.41025641025641,
"alnum_prop": 0.6863354037267081,
"repo_name": "tsmrachel/remo",
"id": "739a869ff45ee6450991e60662e678f57ccebf97",
"size": "3542",... |
class MySQL:
def __init__(self, db):
self.__db = db
def pre_load(self):
# do nothing
return
def load(self, check_id, results):
for result in results:
responsetime = result.get('responsetime', None)
self.__db.query(
'REPLACE INTO pingd... | {
"content_hash": "bc483b914a183c9bf5dbb0069c4648c1",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 144,
"avg_line_length": 39.86363636363637,
"alnum_prop": 0.5267958950969214,
"repo_name": "entering/pingdomexport",
"id": "ba6ba535e5d276300789e4ca57c76a1a499867d5",
"size"... |
from django import forms
class AddServerForm(forms.Form):
displayName = forms.CharField(label='Name', max_length=32)
address = forms.CharField(label='Host Address', max_length=32)
port = forms.IntegerField(label='Host Port')
class AddJobForm(forms.Form):
command = forms.CharField(label='Command', max_... | {
"content_hash": "122622cfa9cdc0d0c9289e354d3e16f0",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 66,
"avg_line_length": 38.6,
"alnum_prop": 0.7305699481865285,
"repo_name": "ewerkema/job-scheduler",
"id": "2fd6936aaa954ebd0bfe1708ed2b51b1bc4726b1",
"size": "386",
"bi... |
from .resource import Resource
class RouteTable(Resource):
"""Route table resource.
Variables are only populated by the server, and will be ignored when
sending a request.
:param id: Resource ID.
:type id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Resource type.
... | {
"content_hash": "f2b9ea6cb85db5eafb8de4e19f53f8c4",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 107,
"avg_line_length": 36.54385964912281,
"alnum_prop": 0.6048967834853577,
"repo_name": "SUSE/azure-sdk-for-python",
"id": "aad1840df0f2baacc4518ab8f0f2ba1a29b33aa6",
"si... |
import sys
import os
import pygame
from pygame.locals import *
sys.path.append(os.path.join(os.path.dirname(__file__), os.path.pardir))
import game_lib
'''
def load_image(image_path):
from PIL import Image
from PIL import ImageDraw
image = Image.open(image_path)
draw = ImageDraw.Draw(image)
mode... | {
"content_hash": "07652a4f3683a51e43c284df85956969",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 72,
"avg_line_length": 21.61764705882353,
"alnum_prop": 0.5965986394557823,
"repo_name": "CospanDesign/python",
"id": "b2b86758cb9a74e8561cf91ef10f8e99ef33cda9",
"size": "1... |
import mock
from oslo_serialization import jsonutils
from heat.common import identifier
from heat.common import template_format
from heat.engine.clients.os import glance
from heat.engine.clients.os import nova
from heat.engine import environment
from heat.engine.resources.aws.cfn.wait_condition_handle import (
Wai... | {
"content_hash": "a8aea653f76dc9828202aedb92e1eaae",
"timestamp": "",
"source": "github",
"line_count": 327,
"max_line_length": 77,
"avg_line_length": 34.21406727828746,
"alnum_prop": 0.5538076510547014,
"repo_name": "cwolferh/heat-scratch",
"id": "4fdf2d6c049014cb5c7f0ef981de379cf78ad3f7",
"size":... |
"""
A minimal front end to the Docutils Publisher, producing HTML slides using
the S5 template system.
"""
try:
import locale
locale.setlocale(locale.LC_ALL, '')
except:
pass
from docutils.core import publish_cmdline, default_description
description = ('Generates S5 (X)HTML slideshow documents from stan... | {
"content_hash": "0f246df0adf935d34030cc47b1e2ef19",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 74,
"avg_line_length": 25.38888888888889,
"alnum_prop": 0.7308533916849015,
"repo_name": "santisiri/popego",
"id": "3cb6123ec5d402149e15c78bdc9824e4106d72ac",
"size": "710"... |
import hyperion, time, math, random
randomCenter = bool(hyperion.args.get('random-center', False))
centerX = float(hyperion.args.get('center_x', -0.15))
centerY = float(hyperion.args.get('center_y', -0.25))
rotationTime = float(hyperion.args.get('rotation_time', 90))
colors = hyperion.args.get('colors'... | {
"content_hash": "410d75d9f07aa7166fb07074abdce9ef",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 111,
"avg_line_length": 29.064935064935064,
"alnum_prop": 0.6921358355674709,
"repo_name": "hyperion-project/hyperion.ng",
"id": "05299dcc070acbd5cf7a763c5d12cffcefa6d63b",
... |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
import os
import shutil
class HardForkDetectionTest(BitcoinTestFramework):
alert_filename = None # Set by setup_network
def setup_network(self):
self.nodes = []
self.alert_filename = os.path.join... | {
"content_hash": "e71f7064b501f098dbb83d1c8936b108",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 108,
"avg_line_length": 35.12903225806452,
"alnum_prop": 0.6221303948576676,
"repo_name": "nginnever/zogminer",
"id": "d399dc9648b935c5cb3ebd6dfe97923c5f982a76",
"size": "2... |
"""Conditional Gradient optimizer."""
import tensorflow as tf
from tensorflow_addons.optimizers import KerasLegacyOptimizer
from tensorflow_addons.utils.types import FloatTensorLike
from typeguard import typechecked
from typing import Union, Callable
@tf.keras.utils.register_keras_serializable(package="Addons")
cla... | {
"content_hash": "24b53536c86844828269c0ecaaf30f19",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 85,
"avg_line_length": 40.59487179487179,
"alnum_prop": 0.5852703385548257,
"repo_name": "tensorflow/addons",
"id": "6b796267103aacf312f9ac8724941f897fefc9dd",
"size": "86... |
"""
Functions for applying functions that act on arrays to xarray's labeled data.
"""
import functools
import itertools
import operator
import typing
from collections import Counter, OrderedDict
from distutils.version import LooseVersion
from typing import (
AbstractSet, Any, Callable, Iterable, List, Mapping, Opti... | {
"content_hash": "c368deaf76d387ef16a8899e603dd02a",
"timestamp": "",
"source": "github",
"line_count": 1117,
"max_line_length": 90,
"avg_line_length": 38.81915846016115,
"alnum_prop": 0.5910380295657388,
"repo_name": "chunweiyuan/xarray",
"id": "451d95ee542e5207d7ed7d5ae7c12f0b56937cad",
"size": "... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('myresume', '0011_delete_mycontent'),
]
operations = [
migrations.CreateModel(
name='MyContent',
fields=[
('i... | {
"content_hash": "c9eb910b183c22af5b637cbddae7f532",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 114,
"avg_line_length": 37.172413793103445,
"alnum_prop": 0.5510204081632653,
"repo_name": "italomandara/mysite",
"id": "d16c5f6d9052fdba3fd51ae96054dc5df9a0d586",
"size": ... |
"""
pych - The Python/Chapel interoperability module.
"""
import logging
import pych.configuration
import pych.runtime
RT = None
CONFIG = None
logging.basicConfig( # Setup default logging
level=logging.ERROR,
format="%(levelname)s:%(module)s:%(funcName)s: %(message)s"
)
try:
... | {
"content_hash": "553b45be055a2deb16b7db1a9d6c915e",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 77,
"avg_line_length": 34.3448275862069,
"alnum_prop": 0.6174698795180723,
"repo_name": "safl/pychapel",
"id": "ee1300ccb3dee75b3fa96df6b596f1a37daf130e",
"size": "996",
... |
""" Base classes for all Hadoop Modules """
from init import configuration
from vistrails.core.modules.basic_modules import File, String
from vistrails.gui.modules.python_source_configure import \
PythonSourceConfigurationWidget
from vistrails.core.modules.config import ... | {
"content_hash": "4457a705af58d0552693178b36623c91",
"timestamp": "",
"source": "github",
"line_count": 212,
"max_line_length": 89,
"avg_line_length": 42.52358490566038,
"alnum_prop": 0.5591791458679978,
"repo_name": "celiafish/VisTrails",
"id": "1f2468f8d16cf8b20c6c1efe84618f7e8eeda66c",
"size": "... |
"""
WSGI config for hebrew_order_david 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", "hebrew_order_david.settings... | {
"content_hash": "c03822b90a89f3e7c3004871550f46e4",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 27.9375,
"alnum_prop": 0.7762863534675615,
"repo_name": "dhosterman/hebrew_order_david",
"id": "64b49056318d9235d928d125d1ec9262365a5436",
"size": "4... |
"""
regressiontests/serializers/models.py
Created by Maximillian Dornseif on 2009-08-17.
Copyright (c) 2009 HUDORA. All rights reserved.
"""
from django.db import models
class Place(models.Model):
name = models.CharField(max_length=50)
address = models.CharField(max_length=80)
last_visit = models.DateTim... | {
"content_hash": "2e55f3ae25b6b9b18b4db9dade8169ac",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 54,
"avg_line_length": 26.105263157894736,
"alnum_prop": 0.6774193548387096,
"repo_name": "hudora/huDjango",
"id": "90ed8c6586b5e36bb8a7905335fde58cf2456c4d",
"size": "536"... |
"""
Created on Tue Sep 26 13:39:12 2017
@author: ekrupczak on PVAquire
Quickly display in console all figures in directory
"""
import os
import numpy as np
from PIL import Image
import pylab as plt
def view_tiffs(tiffs, path):
"""
Display tiffs in console
"""
# tiffs = [file for file in os.listdir(... | {
"content_hash": "48a9add0134c66956d4d5b031572c9c4",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 94,
"avg_line_length": 29.096153846153847,
"alnum_prop": 0.6186384666226041,
"repo_name": "emmettk/pvrsex",
"id": "cd85e7ebac3c5da13b72e4aba601a35009152ecb",
"size": "1537"... |
from __future__ import annotations
"""
This module implements a parser and serializer for the CSV SPARQL result
formats
http://www.w3.org/TR/sparql11-results-csv-tsv/
"""
import codecs
import csv
from typing import IO, Dict, List, Optional, Union
from rdflib.plugins.sparql.processor import SPARQLResult
from rdfli... | {
"content_hash": "3a02585562a9484c525ac55610273d0a",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 124,
"avg_line_length": 33.63636363636363,
"alnum_prop": 0.6216216216216216,
"repo_name": "RDFLib/rdflib",
"id": "73f319773ea78c7c3dfbc9629d43ced7d1775705",
"size": "3330",... |
class VButton(object):
ATTR_DISABLE_ON_CLICK = "dc"
| {
"content_hash": "4d26c438eb20dd6db93fa8fba7dcce8f",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 32,
"avg_line_length": 19,
"alnum_prop": 0.6666666666666666,
"repo_name": "rwl/muntjac",
"id": "e42dcc8ecf60000f171590f545413c362f455145",
"size": "101",
"binary": false,
... |
"""
Click is a simple Python module inspired by the stdlib optparse to make
writing command line scripts fun. Unlike other modules, it's based
around a simple API that does not come with too much magic and is
composable.
"""
from .core import Argument
from .core import BaseCommand
from .core import Command
from .core i... | {
"content_hash": "56889fa9f08d5f15504e1c66326f8e65",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 71,
"avg_line_length": 31.17721518987342,
"alnum_prop": 0.8177019894437678,
"repo_name": "TeamSPoon/logicmoo_workspace",
"id": "2b6008f2dd4176d819f06e0d7e92e43b142d30b0",
"... |
from typing import Optional, Iterator, Tuple, List
from parso.python.tokenize import tokenize
from parso.utils import parse_version_string
from parso.python.token import PythonTokenTypes
class NFAArc:
def __init__(self, next_: 'NFAState', nonterminal_or_string: Optional[str]):
self.next: NFAState = next_... | {
"content_hash": "d3e30e5734f60b952ebd641df96aab97",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 86,
"avg_line_length": 34.35064935064935,
"alnum_prop": 0.5156899810964083,
"repo_name": "glenngillen/dotfiles",
"id": "582efb43acef0caa81e8bddea8c4fb4e2c03ed62",
"size": ... |
import os
import gc
import logging
class Diskspace(object):
def __init__(self):
gc.enable()
@staticmethod
def get_kind():
"""
return sensor kind
"""
return "mpdiskspace"
@staticmethod
def get_sensordef():
"""
Definition of the sensor and da... | {
"content_hash": "bd1ffd6b33d77e2c19ee1c151fad7964",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 110,
"avg_line_length": 34.66326530612245,
"alnum_prop": 0.4450986164262585,
"repo_name": "eagle00789/PythonMiniProbe",
"id": "17fe3302c52616810e6edc10929168fb430ab340",
"s... |
import textwrap
import pytest
from pants.backend.helm.dependency_inference.unittest import (
HelmUnitTestChartDependencyInferenceFieldSet,
InferHelmUnitTestChartDependencyRequest,
)
from pants.backend.helm.dependency_inference.unittest import rules as infer_deps_rules
from pants.backend.helm.target_types impo... | {
"content_hash": "b67e17b95d22f19a28c359bb9da0bf39",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 98,
"avg_line_length": 36.60344827586207,
"alnum_prop": 0.6380122468205369,
"repo_name": "benjyw/pants",
"id": "80e6e1e67be8e5d0d36cf82e1cfb721d7dd3c3ed",
"size": "4378",
... |
from django import forms
from wagtail.admin.staticfiles import versioned_static
class FilteredSelect(forms.Select):
"""
A select box where the options are shown and hidden dynamically in response to another
form field whose HTML `id` is specified in `filter_field`.
The `choices` list accepts entries... | {
"content_hash": "272d440bc8d45d29b80d8ba9beb3a134",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 97,
"avg_line_length": 35.28688524590164,
"alnum_prop": 0.5396051103368177,
"repo_name": "thenewguy/wagtail",
"id": "a2e4db7332223b789f2f7451d0f7592547233564",
"size": "43... |
import calendar
import datetime
import re
import sys
import urllib
import urlparse
from email.utils import formatdate
from django.utils.datastructures import MultiValueDict
from django.utils.encoding import smart_str, force_unicode
from django.utils.functional import allow_lazy
ETAG_MATCH = re.compile(r'(?:W/)?"((?:\... | {
"content_hash": "8d4a6e731eafea797652b0613b876d26",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 85,
"avg_line_length": 34.377990430622006,
"alnum_prop": 0.6261656228253305,
"repo_name": "mixman/djangodev",
"id": "af44ff498ca239ab65f6a4ea97353b1ddf4284b0",
"size": "71... |
import sublime, sublime_plugin
history = []
menuitems = []
history_index = 0
def getClipboardData():
try:# win32
import win32clipboard
win32clipboard.OpenClipboard()
data = win32clipboard.GetClipboardData()
win32clipboard.CloseClipboard()
except:
pass
try:# windows... | {
"content_hash": "7c2622e7b1508c48b3cdc93f25a2d4f4",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 94,
"avg_line_length": 27.143835616438356,
"alnum_prop": 0.6040878122634368,
"repo_name": "tgfjt/Sublime-clipboardRound",
"id": "94ea7fb3d06a55469b6ea49030af399cea86466d",
... |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('build', '0003_auto_20190525_2355'),
]
operations = [
migrations.AlterField(
model_name='build',
name='part',
field=model... | {
"content_hash": "3c2f25544e1bb13e0c72af32b0d877a0",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 230,
"avg_line_length": 32.05882352941177,
"alnum_prop": 0.634862385321101,
"repo_name": "inventree/InvenTree",
"id": "1a43e5bfc8ec305fbcc23faec624a0877490c5cf",
"size": "5... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Photo',
fields=[
('id', models.AutoField(auto_creat... | {
"content_hash": "4622afea98cee8bc90410445ad80073f",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 114,
"avg_line_length": 24.73913043478261,
"alnum_prop": 0.5430579964850615,
"repo_name": "WillWeatherford/mars-rover",
"id": "f072c0ede26196c73b08135c4a264baec8670f99",
"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": "562f34cc2d71c503fa8e4384fa0b9637",
"timestamp": "",
"source": "github",
"line_count": 229,
"max_line_length": 80,
"avg_line_length": 32.03493449781659,
"alnum_prop": 0.7018811341330425,
"repo_name": "LuckyBit/api",
"id": "b3f64e1f1fbd288f531872790c058f0f45ebabcd",
"size": "7759",
... |
import uuid
import mock
import mox
from oslo.config import cfg
import webob
from nova.api.openstack.compute import plugins
from nova.api.openstack.compute.plugins.v3 import servers
from nova.compute import api as compute_api
from nova.compute import task_states
from nova.compute import vm_states
from nova import cont... | {
"content_hash": "a1a729242f3f9886f49dbc2d64918580",
"timestamp": "",
"source": "github",
"line_count": 1085,
"max_line_length": 79,
"avg_line_length": 38.747465437788016,
"alnum_prop": 0.5553864085059823,
"repo_name": "viggates/nova",
"id": "7b1e98638c5fccb70eba78be0ae9d3b053f2d9e4",
"size": "4267... |
from robot import model, utils
from .message import Message
class Keyword(model.Keyword):
"""Results of a single keyword."""
__slots__ = ['kwname', 'libname', 'status', 'starttime', 'endtime', 'message']
message_class = Message
def __init__(self, kwname='', libname='', doc='', args=(), assign=(),
... | {
"content_hash": "bf439ef9f6a81286cad242d9aa5be028",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 82,
"avg_line_length": 36.333333333333336,
"alnum_prop": 0.5884665792922673,
"repo_name": "kyle1986/robortframe",
"id": "9f4fd31e60b429c126b77758b9b412a2fb594407",
"size": ... |
"""
Is my mongo exposed?
"""
import os
import sys
import urwid
from .version import __version__
from .cards import Cards
from .palette import PALETTE
from .tools import check_version
class App(object):
def __init__(self):
self.name = 'mongoaudit'
self.version = __version__
check_version(se... | {
"content_hash": "aa598d2f1b5293f4d6c3e12f1202efad",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 80,
"avg_line_length": 29.78787878787879,
"alnum_prop": 0.5783316378433367,
"repo_name": "stampery/mongoaudit",
"id": "094916c4b9c9f3e3576c9408792d908eb3a8b916",
"size": "1... |
import json
import logging
from google.appengine.api import urlfetch
from google.appengine.runtime import apiproxy_errors
from base import constants
def BuildUrl(master_name, url, use_cbe=False):
base = constants.BUILDBOT_BASE_URL
if use_cbe:
base = constants.CBE_BASE_URL
url += '?json=1'
return '%s/... | {
"content_hash": "19c047d53be12525899befd4f119c804",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 72,
"avg_line_length": 23.4390243902439,
"alnum_prop": 0.6940686784599376,
"repo_name": "sahiljain/catapult",
"id": "aac6838cae7b010167dfd6661e9cbaff8f9cd2f6",
"size": "112... |
from unittest import TestCase
from app import startup_app
from app.model.pgadapter import PgAdapter
class BaseApiTestCase(TestCase):
# constants
CONTENT_TYPE = 'application/json'
def setUp(self):
self.db = PgAdapter()
self.endpoint = ''
self.teardown_query = ''
def tearDown(s... | {
"content_hash": "f458bdca3da286773eb25f2f4c2bc75b",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 48,
"avg_line_length": 22.677419354838708,
"alnum_prop": 0.6173541963015647,
"repo_name": "KentaYamada/Siphon",
"id": "0a83d33c71b6f7020e537dd0fa0d6c87098e2deb",
"size": "7... |
"""Base Manager class.
Managers are responsible for a certain aspect of the system. It is a logical
grouping of code relating to a portion of the system. In general other
components should be using the manager to make changes to the components that
it is responsible for.
For example, other components that need to d... | {
"content_hash": "88eaacb4407135f46459c6154653644f",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 79,
"avg_line_length": 36.054263565891475,
"alnum_prop": 0.7153300365512792,
"repo_name": "mahak/nova",
"id": "9c00401b96e166c815c36bcf6d88721b66e53529",
"size": "5383",
... |
"""Ops to manipulate lists of tensors."""
# pylint: disable=g-bad-name
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
fro... | {
"content_hash": "3c9fb0107a0cd47cf82e4e08a5166b64",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 78,
"avg_line_length": 34.35,
"alnum_prop": 0.7082969432314411,
"repo_name": "alshedivat/tensorflow",
"id": "386626e6a951b189f5e77bdf7b9a308b60c1c842",
"size": "4124",
"... |
"""
Asynchronous Shared-Memory Scheduler for Dask Graphs.
This scheduler coordinates several workers to execute tasks in a dask graph in
parallel. It depends on an apply_async function as would be found in thread or
process Pools and a corresponding Queue for worker-to-scheduler communication.
It tries to execute ta... | {
"content_hash": "884dd338f46adbb937d45ead1e0c53e0",
"timestamp": "",
"source": "github",
"line_count": 595,
"max_line_length": 99,
"avg_line_length": 29.712605042016808,
"alnum_prop": 0.5918321172011992,
"repo_name": "mikegraham/dask",
"id": "a64bc4ce6227000ecfef8d5af475df9e91f21086",
"size": "176... |
import math
import Queue
def make(filename):
file = open(filename, "r")
linenum = 0
verts = 0
edges = 0
graph = None
for line in file:
# print ("line " + line)
values = line.split("\t")
# print ("values " + str(values))
# strip the wack n if pr... | {
"content_hash": "85f311a6c5720eebb3e00e749f69c78a",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 106,
"avg_line_length": 29.242424242424242,
"alnum_prop": 0.4584455958549223,
"repo_name": "jeremy24/494-graph-algos",
"id": "c04e3f4c7fab428ac65dd450dcb4e15afa7850e9",
"s... |
from __future__ import unicode_literals
import json
from django.http import Http404
from django.core import serializers
from django.shortcuts import redirect
from django.forms.models import model_to_dict
from django.urls import reverse_lazy, reverse
from django.http import HttpResponse, JsonResponse
from django.views... | {
"content_hash": "cdf7fde202f68d360a0d5966bf0a39f6",
"timestamp": "",
"source": "github",
"line_count": 236,
"max_line_length": 119,
"avg_line_length": 39.889830508474574,
"alnum_prop": 0.6963033779477374,
"repo_name": "baylee-d/osf.io",
"id": "bdcb1e17a2fc73ef5e55950310d9566bf70f70a1",
"size": "94... |
"""
=======================================
Visualizing the stock market structure
=======================================
This example employs several unsupervised learning techniques to extract
the stock market structure from variations in historical quotes.
The quantity that we use is the daily variation in quote ... | {
"content_hash": "f1729ff1fac1f9ce13e049f651785355",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 79,
"avg_line_length": 32.015325670498086,
"alnum_prop": 0.6242221158449018,
"repo_name": "chrsrds/scikit-learn",
"id": "f7c3569d15808490aaa140e556c6cfdd76931c6e",
"size":... |
"""
Base export interface
"""
import re
import urllib
from datetime import datetime, time, timedelta
from types import GeneratorType
import pytz
from flask import current_app, request
from indico.core.config import config
from indico.core.db import db
from indico.core.logger import Logger
from indico.core.notificati... | {
"content_hash": "8e0ca4da2c55442f9499f45611c0a1b2",
"timestamp": "",
"source": "github",
"line_count": 281,
"max_line_length": 117,
"avg_line_length": 38.81494661921708,
"alnum_prop": 0.5974145044466856,
"repo_name": "OmeGak/indico",
"id": "f35b0bf5b1e1d575923432bee3d939ddea73223d",
"size": "11121... |
from bokeh.plotting import figure
from bokeh.layouts import row, column
from bokeh.models import HoverTool, ColumnDataSource, Range1d, TapTool
from bokeh.models.callbacks import CustomJS
from dashboard.models import Process, Fibermap, Job
from qlf_models import QLFModels
from bokeh.layouts import widgetbox
from bokeh.m... | {
"content_hash": "a0fc3683f70e4c5e385e980d0972ffbc",
"timestamp": "",
"source": "github",
"line_count": 265,
"max_line_length": 117,
"avg_line_length": 36.87547169811321,
"alnum_prop": 0.482705689725747,
"repo_name": "desihub/qlf",
"id": "065eb1813c86b030c7ff3accbc3f5c76f459de41",
"size": "9772",
... |
"""Utility classes for saving model checkpoints."""
import datetime
import os
import pickle
from typing import Any
from absl import logging
from acme import core
from acme.tf import savers as tf_savers
import jax
import numpy as np
import tree
# Internal imports.
CheckpointState = Any
_DEFAULT_CHECKPOINT_TTL = int... | {
"content_hash": "743f6ea5955701dbafcfea783a624bf5",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 80,
"avg_line_length": 28.817073170731707,
"alnum_prop": 0.6855691917054592,
"repo_name": "deepmind/acme",
"id": "2b5d5a013a8bf28cb9798373f62c28f447be18d4",
"size": "2979",... |
import logging
import pathlib
from email.message import Message
from typing import NamedTuple, Tuple, List, Dict
import pop3bot
import gerrit_rest
logging.basicConfig(level=logging.DEBUG)
basepath = pathlib.Path(__file__).parent
ProcessedEmail = NamedTuple('ProcessedEmail', [
('messages', List[Tuple[Message, s... | {
"content_hash": "f2b4f1410f45c936c4d8067286d710e0",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 88,
"avg_line_length": 27.46551724137931,
"alnum_prop": 0.6917765222849969,
"repo_name": "valhallasw/gerrit-reviewer-bot",
"id": "8aa30be04898d0c7860d84df815efbba89cd6350",
... |
import string, pickle, base64
from database import get, put
### INTERNAL VARIABLES ###
# Minimum acceptable name size.
minname = 2
# Maximum acceptable name size.
maxname = 32
# Characters allowed in a name. (whitelist)
allowednamechars = string.ascii_letters + string.digits + string.punctuation + string.whitespace... | {
"content_hash": "34d5259caa63111d08466a0e5a69a779",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 169,
"avg_line_length": 33.219298245614034,
"alnum_prop": 0.6796936889358332,
"repo_name": "pariahsoft/Dennis",
"id": "5040ef3f716458d5e41eb24de04fc376e311b97c",
"size": "... |
"""Provide a storage client to save results to persistent storage
Class Listings
--------------
StorageClient
Represent a storage client that supports saving results to HDFS
"""
from hdfs import InsecureClient
import numpy, cv2, tempfile, os
class StorageClient(object):
"""Represent a storage client t... | {
"content_hash": "cad35baf832bad4850c7cbb1682787da",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 146,
"avg_line_length": 36.869565217391305,
"alnum_prop": 0.6419025157232704,
"repo_name": "muhammad-alaref/CAM2DistributedBackend",
"id": "f67f153318b1bb7bbb1e197677b9ee4d2a... |
import unittest, test.support
import sys, io, os
import struct
import subprocess
import textwrap
import warnings
import operator
import codecs
# count the number of test runs, used to create unique
# strings to intern in test_intern()
numruns = 0
try:
import threading
except ImportError:
threading = None
cla... | {
"content_hash": "99f41ffac4b27d4eff2c1d55cf7748c6",
"timestamp": "",
"source": "github",
"line_count": 912,
"max_line_length": 100,
"avg_line_length": 37.32565789473684,
"alnum_prop": 0.5802414735172292,
"repo_name": "maxdeliso/elevatorSim",
"id": "6e0c6eef31967347477e436526f814f89d36ab89",
"size"... |
import six
from mongoengine.queryset import Q
from st2common import log as logging
from st2api.controllers.resource import BaseResourceIsolationControllerMixin
from st2api.controllers.resource import ContentPackResourceController
from st2common.models.api.rule import RuleViewAPI
from st2common.models.system.common im... | {
"content_hash": "9a6e7d7c601c649d1554d9fcf09bab5e",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 99,
"avg_line_length": 34.49769585253456,
"alnum_prop": 0.5753406358535934,
"repo_name": "nzlosh/st2",
"id": "39b4682c526709330aa791c0d4eb5cfdfb74095d",
"size": "8114",
... |
from inspect import signature
from functools import lru_cache
from typing import Iterable
from numpy import mean, nan
from statistics import stdev
# for population/biased standard deviation use:
# from numpy import std as stdev
from utils import jit
RANKING_METRICS = {}
def differential_expression_metric(case: Ite... | {
"content_hash": "684d45d15f67da06f7ec23204c824027",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 84,
"avg_line_length": 25.691358024691358,
"alnum_prop": 0.6573762614127823,
"repo_name": "sienkie/pathways-analysis",
"id": "277f4e0f2f9482f61681b6ad58fe5db6b7779adf",
"si... |
import unittest
from matrix import Matrix
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0
class MatrixTest(unittest.TestCase):
def test_extract_row_from_one_number_matrix(self):
matrix = Matrix("1")
self.assertEqual(matrix.row(1), [1])
def test_can_extract_row(se... | {
"content_hash": "cf935782693e9cee021affac0dd7f18f",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 75,
"avg_line_length": 32.883720930232556,
"alnum_prop": 0.6237623762376238,
"repo_name": "N-Parsons/exercism-python",
"id": "3d0be594541caf31f97c770d2ffa31b4169de121",
"si... |
import BaseHTTPServer
import os
import re
class GitIssues(BaseHTTPServer.BaseHTTPRequestHandler):
repos_dir_in_home = os.path.expanduser("~/.git-issues/")
def html_200(self):
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.end_headers()
def html_404(sel... | {
"content_hash": "6f38ce8fe7c1c22ae2c0d42be8d84347",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 99,
"avg_line_length": 35.15,
"alnum_prop": 0.4833570412517781,
"repo_name": "AutomatedTester/git-issues",
"id": "8b0f9626b5b7177611b56361415d6f9bc2f44f4a",
"size": "3537"... |
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | {
"content_hash": "3007d298c2ac2413b07d0a3309430114",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 78,
"avg_line_length": 39.93478260869565,
"alnum_prop": 0.6548720740337507,
"repo_name": "HewlettPackard/python-proliant-sdk",
"id": "37e8378af030385041cc563e902e7e6f78192235... |
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('account', '0007_subscription_active'),
]
operations = [
migrations.RemoveField(
mo... | {
"content_hash": "3b0dd4bed9c837b9706f7082d8222b9a",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 109,
"avg_line_length": 25.68,
"alnum_prop": 0.6074766355140186,
"repo_name": "pizzapanther/Super-Neutron-Drive",
"id": "ab5c585be90ab77af032c3cdd5d8799fbb8a8230",
"size": ... |
from __future__ import absolute_import
import unittest
import requests
import unittest.mock as mock
import dockercloud
from dockercloud.api.base import send_request
from .fake_api import fake_resp
class SendRequestTestCase(unittest.TestCase):
@mock.patch('dockercloud.api.http.Request', return_value=requests.Re... | {
"content_hash": "5d431fd0cb783b6d76067ef782b976f9",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 119,
"avg_line_length": 42.90909090909091,
"alnum_prop": 0.6871468926553672,
"repo_name": "penkin/python-dockercloud",
"id": "88802a406e8fbba2af1af8882438dfe3e5cf3025",
"si... |
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('..'))
# -- General configurat... | {
"content_hash": "928d5456c64fe7ead49e66321301ec86",
"timestamp": "",
"source": "github",
"line_count": 229,
"max_line_length": 80,
"avg_line_length": 32.10480349344978,
"alnum_prop": 0.6999455930359086,
"repo_name": "osupython/pip2",
"id": "b113c00d4fd919f1956740d90b1c1b9c7648d46b",
"size": "7790"... |
import login
import logout
import home
import error
| {
"content_hash": "34863c35857e962024a889d1a768c075",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 13,
"avg_line_length": 13,
"alnum_prop": 0.8461538461538461,
"repo_name": "VMatrixTeam/open-matrix",
"id": "e59452661fddc40a50cffa5c3050e86ff8f08446",
"size": "52",
"binar... |
import socket
import os.path
from thread import start_new_thread
import httplib
import mimetypes
mimetypes.init()
host = ''
port = 8080
backlog = 5
size = 1024
newline = "\r\n"
class Request:
def __init__(self, client, data):
self.client = client
self.data = data
self.lines = self.data.s... | {
"content_hash": "20b02532aedde799a6e8e5a6951eb6f0",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 105,
"avg_line_length": 27.36764705882353,
"alnum_prop": 0.5370768404083825,
"repo_name": "MattCorrigan/Python-REST-API",
"id": "0027a8db12e2f7b8c2b286cb4ac2dd4ff47a0fe8",
... |
"""Bio.SeqIO support for the binary Standard Flowgram Format (SFF) file format.
SFF was designed by 454 Life Sciences (Roche), the Whitehead Institute for
Biomedical Research and the Wellcome Trust Sanger Institute. SFF was also used
as the native output format from early versions of Ion Torrent's PGM platform
as well... | {
"content_hash": "69d9df673872bc9825ae4c70d6cb30f0",
"timestamp": "",
"source": "github",
"line_count": 1566,
"max_line_length": 115,
"avg_line_length": 41.44699872286079,
"alnum_prop": 0.5962468801035343,
"repo_name": "poojavade/Genomics_Docker",
"id": "353c6ba9e7cc0a25c02b0bf43b750ff589278827",
"... |
NELVES = 3012210
class LLNode(object):
def __init__(self, v, p, n):
self.value = v
self.prevn = p
self.nextn = n
def insert(self, v):
new = LLNode(v, self, self.nextn)
self.nextn = new
return new
def remove(self):
n = self.nextn
self.prevn... | {
"content_hash": "f5dac256dbeee5da61202ad0b6da1ba0",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 75,
"avg_line_length": 22.02127659574468,
"alnum_prop": 0.548792270531401,
"repo_name": "jlucangelio/adventofcode",
"id": "0df3aa877cd0b950ba1c6a90c24a80da0aa51359",
"size"... |
import json
import yaml
from heat_integrationtests.common import test
class TemplateResourceTest(test.HeatIntegrationTest):
"""Prove that we can use the registry in a nested provider."""
template = '''
heat_template_version: 2013-05-23
resources:
secret1:
type: OS::Heat::RandomString
outputs:
secre... | {
"content_hash": "c35c43ac46eafc68f6328fdba503fed4",
"timestamp": "",
"source": "github",
"line_count": 674,
"max_line_length": 79,
"avg_line_length": 27.68545994065282,
"alnum_prop": 0.5969989281886388,
"repo_name": "rh-s/heat",
"id": "0d5734b3ee8bcb092ff095f1f5ff3ff46a97f2dd",
"size": "19233",
... |
"""This code is a part of Hydra Toolkit
.. module:: hydratk.translation.lib.network.dbi.client.cs.messages
:platform: Unix
:synopsis: Czech language translation for DB client messages
.. moduleauthor:: Petr Rašek <bowman@hydratk.org>
"""
language = {
'name': 'Čeština',
'ISO-639-1': 'cs'
}
from hydratk... | {
"content_hash": "8deaa862d18b666be4e08ab34b56c692",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 88,
"avg_line_length": 39.432432432432435,
"alnum_prop": 0.6620973269362577,
"repo_name": "hydratk/hydratk-lib-network",
"id": "0584acf2c4b4f31390fbedbd2c02d43f436bc953",
"... |
import json
import logging
import pickle
from typing import Any, Iterable, Optional, Union
import pendulum
from sqlalchemy import Column, LargeBinary, String, and_
from sqlalchemy.orm import Query, Session, reconstructor
from airflow.configuration import conf
from airflow.models.base import COLLATION_ARGS, ID_LEN, Ba... | {
"content_hash": "e0661cf1428a76f52a0f3b98099105e0",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 110,
"avg_line_length": 35.52734375,
"alnum_prop": 0.6102253985706432,
"repo_name": "sekikn/incubator-airflow",
"id": "d9cdacfa065323ec3336bf206d261ffbab4bb303",
"size": "... |
from __future__ import print_function, division
import matplotlib
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import Net, RealApplianceSource, BLSTMLayer, SubsampleLayer, DimshuffleLayer
from lasagne.nonlinearities import sigmoid, rectify
from lasagne.objectives import c... | {
"content_hash": "1d5a867f63711b2fd6542693c047847c",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 92,
"avg_line_length": 29.171875,
"alnum_prop": 0.5431173004820568,
"repo_name": "JackKelly/neuralnilm_prototype",
"id": "010c9c4900250e34a28477cd117700dee41fc91c",
"size"... |
from crosspm.helpers.locker import Locker
class Usedby(Locker):
def __init__(self, config, do_load, recursive):
# Ignore do_load flag
super(Usedby, self).__init__(config, False, recursive)
def usedby_packages(self, deps_file_path=None, depslock_file_path=None, packages=None):
"""
... | {
"content_hash": "e28580e4ccb1551a27fb8d519113994f",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 97,
"avg_line_length": 37.26470588235294,
"alnum_prop": 0.6140489344909235,
"repo_name": "devopshq/crosspm",
"id": "3a26e78b8ebbea82969d1b07095941d6524f32b3",
"size": "1292... |
""" Cgroups read engine to read the cgroups data periodically
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import glob
import logging
import os
import threading
import time
from treadmill import appenv
from t... | {
"content_hash": "617dec343bee27f28e37abedb3706bc9",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 79,
"avg_line_length": 30.97945205479452,
"alnum_prop": 0.5529515808091975,
"repo_name": "captiosus/treadmill",
"id": "bd134b6aba1fa0a239621342374f4cb6cf63d89d",
"size": "... |
import threading
import time
import voodoo.log as log
from weblab.data.experiments import CommandSent, ExperimentUsage, FileSent
import weblab.core.file_storer as file_storer
import weblab.data.command as Command
class TemporalInformationRetriever(threading.Thread):
"""
This class retrieves continuously the ... | {
"content_hash": "c32ca47c5b21d9f135b9daf5e1f4316e",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 333,
"avg_line_length": 50.40723981900452,
"alnum_prop": 0.5702872531418313,
"repo_name": "zstars/weblabdeusto",
"id": "2060787451ef8b1d20f74a6545b0869091fd2545",
"size": ... |
import argparse
import jinja2
import os
import signal
import subprocess
import sys
import traceback
from blessings import Terminal
from contextlib import contextmanager
signals = dict((k, v) for v, k in signal.__dict__.iteritems() if v.startswith('SIG'))
term = Terminal()
TEST_ROOT = os.getcwd()
env = jinja2.Environ... | {
"content_hash": "80d9e2076967b8c3667610278db0024a",
"timestamp": "",
"source": "github",
"line_count": 262,
"max_line_length": 101,
"avg_line_length": 30.84732824427481,
"alnum_prop": 0.5308092056421678,
"repo_name": "RobertoMalatesta/glshim",
"id": "7af7110ecfe03f5106f5022b9f6adcc20da7aa54",
"siz... |
"""
pghoard - pg_basebackup handler
Copyright (c) 2016 Ohmu Ltd
See LICENSE for details
"""
import datetime
import io
import logging
import os
import select
import socket
import stat
import subprocess
import time
from concurrent.futures import ThreadPoolExecutor
from queue import Empty, Queue
from tempfile import Name... | {
"content_hash": "b434b83c7428d7010e75c6c0dc02ea60",
"timestamp": "",
"source": "github",
"line_count": 856,
"max_line_length": 124,
"avg_line_length": 45.14485981308411,
"alnum_prop": 0.5822896180519614,
"repo_name": "ohmu/pghoard",
"id": "4efed7c43baef68fe8967a5729dcd555880943b6",
"size": "38644"... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lgbtstats.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "55d47a5cc45bf9b08feb54d06d891d43",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 73,
"avg_line_length": 25.555555555555557,
"alnum_prop": 0.7130434782608696,
"repo_name": "arnoldtan/cep_2015_sem2_assign2",
"id": "e2bd0d8912e478236566456343d312766aef6975",
... |
from neutron.api.v2 import attributes as attr
from neutron.db import allowedaddresspairs_db as addr_pair_db
from neutron.db import db_base_plugin_v2
from neutron.db import portsecurity_db
from neutron.extensions import allowedaddresspairs as addr_pair
from neutron.extensions import portsecurity as psec
from neutron.man... | {
"content_hash": "716277e8136620b0f5939afed8cf3db9",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 79,
"avg_line_length": 49.75,
"alnum_prop": 0.5227453054747422,
"repo_name": "sajuptpm/neutron-ipam",
"id": "70eb1e336e8cba57bf981a2b6cfd5bba4d3fa492",
"size": "15716",
... |
import skimage.data
import instance_occlsegm_lib
def test_centerize():
img = skimage.data.astronaut()
dst_shape = (480, 640)
img_c, mask_c = instance_occlsegm_lib.image.centerize(
img, dst_shape, return_mask=True)
assert img_c.shape == (dst_shape[0], dst_shape[1], 3)
assert img_c.dtype ==... | {
"content_hash": "910a0e62c580d43a2677bb9c07134d43",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 58,
"avg_line_length": 28.571428571428573,
"alnum_prop": 0.6575,
"repo_name": "pazeshun/jsk_apc",
"id": "4976fc458503451e6dc49eb73262b18f8912c9a7",
"size": "400",
"binary... |
from ginga import RGBMap, AutoCuts
from ginga.gw import Widgets
from .base import Stage, StageAction
count = 0
class Preview(Stage):
_stagename = 'preview'
def __init__(self):
super().__init__()
self.fv = None
self.in_image = None
self.image = None
self._chname = "... | {
"content_hash": "c5810f07b2e3545038d13c997b47e8f5",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 76,
"avg_line_length": 30.36111111111111,
"alnum_prop": 0.5661024702653248,
"repo_name": "naojsoft/ginga",
"id": "369a9fccc684e506aee2c057b38f408c2a993a07",
"size": "4482"... |
"""Provides methods needed by installation script for OpenStack development
virtual environments.
Since this script is used to bootstrap a virtualenv from the system's Python
environment, it should be kept strictly compatible with Python 2.6.
Synced in from openstack-common
"""
from __future__ import print_function
... | {
"content_hash": "060c2056ef54cbda5c09619405d03176",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 100,
"avg_line_length": 35.16969696969697,
"alnum_prop": 0.5664311562984663,
"repo_name": "sajuptpm/contrail-controller",
"id": "87c8de2e4ed3d87f543333236e35e2944a9b2bae",
... |
import logging
import json
from webob import Response
from ryu.app.wsgi import ControllerBase
from ryu.app.wsgi import WSGIApplication
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller import dpset
from ryu.controller.handler import MAIN_DISPATCHER
from ryu.controller.handler i... | {
"content_hash": "78b719de23168ccf74f0a0fafcc21172",
"timestamp": "",
"source": "github",
"line_count": 668,
"max_line_length": 78,
"avg_line_length": 32.205089820359284,
"alnum_prop": 0.5474829173058151,
"repo_name": "samrussell/ryu",
"id": "e67ccd590c9e997233028a904df1a1cd6f5a1c28",
"size": "2212... |
"""Tracing unittests presubmit script.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on the presubmit API built into gcl.
"""
PRESUBMIT_VERSION = '2.0.0'
USE_PYTHON3 = True
def RunUnittests(input_api, output_api):
results = []
# Run Pylint over the files in the directo... | {
"content_hash": "5c8b09a723f4b0781646eebfddafaa58",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 79,
"avg_line_length": 29.571428571428573,
"alnum_prop": 0.6280193236714976,
"repo_name": "ric2b/Vivaldi-browser",
"id": "395a4faf3848768d23fe9fba7108d3025d29201a",
"size":... |
from passlib.handlers.pbkdf2 import pbkdf2_sha512
PBKDF2SHA512_HEADER = "$pbkdf2-sha512$12000$"
CUSTOM_HEADER = "biicode$"
def encrypt(password):
'''encrypt a plain password'''
enc = pbkdf2_sha512.encrypt(password, rounds=12000)
enc = enc.replace(PBKDF2SHA512_HEADER, CUSTOM_HEADER, 1)
return enc
de... | {
"content_hash": "c88cad9f19a1ceb917bf3c1c56dfca89",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 78,
"avg_line_length": 31.904761904761905,
"alnum_prop": 0.7074626865671642,
"repo_name": "biicode/bii-server",
"id": "799cf441685304ee2d59fe767870b9289ffb03c1",
"size": "1... |
from __future__ import unicode_literals
# Django
from django.views.generic.base import TemplateView
class DummyView(TemplateView):
template_name = "Landing Page"
| {
"content_hash": "e6b6e67c29b50c6186f914a540c57473",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 50,
"avg_line_length": 21.125,
"alnum_prop": 0.7692307692307693,
"repo_name": "craiglabenz/django-grapevine",
"id": "8e208f1c87bbe5d055ab36caa9938a4c8975172e",
"size": "169"... |
import sys
import pytsk3
import datetime
import pyewf
import argparse
import hashlib
class ewf_Img_Info(pytsk3.Img_Info):
def __init__(self, ewf_handle):
self._ewf_handle = ewf_handle
super(ewf_Img_Info, self).__init__(
url="", type=pytsk3.TSK_IMG_TYPE_EXTERNAL)
def close(self):
self._... | {
"content_hash": "659d762a91e5bb9743eaee87763bbb9b",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 122,
"avg_line_length": 33.91525423728814,
"alnum_prop": 0.6921539230384808,
"repo_name": "dlcowen/dfirwizard",
"id": "407a15f6c522050b638c9a753ea07f97531d51c2",
"size": "2... |
import json
from time import gmtime, strftime
from flask import render_template, make_response
from .ipxebase import PXEProvider
class StaticPXEProvider(PXEProvider):
def __init__(self, *args, **kwargs):
pass
def generate_ipxe_script(self, *args, **kwargs):
"""
Returns an iPXE scr... | {
"content_hash": "f00e713ebdb25a7be27b0b6ece92fb16",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 80,
"avg_line_length": 33.4468085106383,
"alnum_prop": 0.544529262086514,
"repo_name": "virtdevninja/steel_pigs",
"id": "8a05f83d84eeb9133a99addab80ad1988f1af6f8",
"size": ... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: mso_schema_site_anp_epg_staticleaf
short_description: Manage... | {
"content_hash": "b34daaef0c2f67291502b4bcddee5181",
"timestamp": "",
"source": "github",
"line_count": 255,
"max_line_length": 148,
"avg_line_length": 29.788235294117648,
"alnum_prop": 0.6270405476566614,
"repo_name": "thaim/ansible",
"id": "022f394a3b4f5c4c22aa13d58c9098edb0ddacb4",
"size": "7797... |
from flask_testing import TestCase
from logging import LogRecord
from connector.app import app
from connector.utils import ConnectorLogFormatter, JsonLogFormatter
from datetime import datetime
class TestUtils(TestCase):
def create_app(self):
app.config.update({'TESTING': True})
return app
de... | {
"content_hash": "d4ee953b4f4d68ea18db692062d94210",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 86,
"avg_line_length": 41.559322033898304,
"alnum_prop": 0.6272430668841762,
"repo_name": "ingrammicro/fallball-connector",
"id": "fd8e87677ec76281881a438111b1c5cf4ab1e02b",
... |
import pytest
@pytest.fixture
def base_reference(testapp, lab, award):
item = {
'award': award['@id'],
'lab': lab['@id']
}
return testapp.post_json('/reference', item).json['@graph'][0]
@pytest.fixture
def upgrade_18_19_reference(testapp, lab, award, gene):
item = {
'award': ... | {
"content_hash": "df88215c9937aa8dd8cd2900de243606",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 92,
"avg_line_length": 25.07792207792208,
"alnum_prop": 0.5613671672708441,
"repo_name": "ENCODE-DCC/encoded",
"id": "d0b83961e52f56f714926973cdb12a91db736346",
"size": "19... |
import sys
import copy
import numpy
import theano
import theano.tensor as T
from layer import Layer, LinearLayer
import pdb
class NeuralizedPCALayer(Layer):
def __init__(self, n_in, n_out, init_w, init_bvis, varin=None):
"""
The difference between a neuralized PCA Layer and a normal linear
... | {
"content_hash": "0f35f749d897a44dfdacaeab4f42f21a",
"timestamp": "",
"source": "github",
"line_count": 491,
"max_line_length": 80,
"avg_line_length": 38.39511201629328,
"alnum_prop": 0.5637598132824103,
"repo_name": "hantek/NeuroBricks",
"id": "42bb782dae4bbb49de1be1aa013d54c452973fce",
"size": "1... |
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/bio_engineer/creature/shared_creature_guf_drolg.iff"
result.attribute_template_id = -1
result.stfName("string_id_table","")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return re... | {
"content_hash": "abad20f53d830681e363aea66a328423",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 95,
"avg_line_length": 24.923076923076923,
"alnum_prop": 0.7037037037037037,
"repo_name": "anhstudios/swganh",
"id": "6b49d1a14677794a557473b1a2f131d1e3bd90eb",
"size": "46... |
"""
Interpolate OpenType Layout tables (GDEF / GPOS / GSUB).
"""
from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
from fontTools.ttLib import TTFont
from fontTools.varLib import models, VarLibError, load_designspace
from fontTools.varLib.merger import InstancerMerger
im... | {
"content_hash": "d5df27bfeb35e9309e0f4aed0676cd11",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 124,
"avg_line_length": 30.78021978021978,
"alnum_prop": 0.7361656551231703,
"repo_name": "Pal3love/otRebuilder",
"id": "ca9ccfeb0eac9e89b11b0dd7f6f7aecea442527f",
"size": ... |
from fellar.models import FacebookGroupPost, FacebookGroup
from flask import Blueprint, render_template
from glask import redirect_for
app = Blueprint('cellar', __name__)
@app.route('/')
def index():
return redirect_for('.group_list')
@app.route('/group/')
def group_list():
groups = FacebookGroup.query.all... | {
"content_hash": "3c698490b3163090edf5052889fe61d2",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 77,
"avg_line_length": 27.52173913043478,
"alnum_prop": 0.717219589257504,
"repo_name": "sungmin-park/fellar",
"id": "c5f100b16657ef83bedd3d132792b2e81d3bd8ca",
"size": "63... |
from django.db import models
# Create your models here.
class Drivers(models.Model):
name = models.CharField(max_length=100, blank=False)
address = models.CharField(max_length=200, blank=False)
scca_number = models.IntegerField(null=True)
emergency_name = models.CharField(max_length=100, blank=False)
... | {
"content_hash": "2cc01bfb6ae93eebc63cd045a8f84d9c",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 96,
"avg_line_length": 34.09090909090909,
"alnum_prop": 0.6782222222222222,
"repo_name": "tahosa/openracer-python",
"id": "837f1389019698ac5e07a949b15bbc91720a9315",
"size"... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('general', '0005_tag'),
('finance', '0004_auto_20180424_1009'),
]
operations = [
migrations.RenameField(
... | {
"content_hash": "9ece045b8beb020a3bd945eeef4c5f87",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 164,
"avg_line_length": 32.266666666666666,
"alnum_prop": 0.6157024793388429,
"repo_name": "access-missouri/am-django-project",
"id": "9849031ab0a490d0553103c86c4a68bca30cb63... |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Settings specific to chartforge:
CHART_FORGE = {
# list of all the apps containing charts
'chart_apps': [
'tests'
],
'chart_templates': [
os.path.join(BASE_DIR, 'tests/templates')
]
}
SECRET_KEY = ... | {
"content_hash": "6823c2200f30bf66aebeb1541b33a25c",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 70,
"avg_line_length": 25.064935064935064,
"alnum_prop": 0.6362694300518135,
"repo_name": "featherweightweb/django-chartforge",
"id": "455e8edb81a74d3e83d6e6aca66d07510a12ce7... |
import helper
# print("hello")
if __name__ == '__main__':
helper.greeting("hello")
| {
"content_hash": "a8ab45d61515e78174192e5ca4c83732",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 28,
"avg_line_length": 11.75,
"alnum_prop": 0.5425531914893617,
"repo_name": "tmg6hk/cs3240-labdemo",
"id": "a053eaecb3d5e1836743a61ec707d53cf26ab91f",
"size": "94",
"bina... |
"""
@file reboottime.py
"""
##
# @addtogroup pnp pnp
# @brief This is pnp component
# @{
# @addtogroup reboottime reboottime
# @brief This is reboottime module
# @{
##
import os
import time
from datetime import datetime
from oeqa.oetest import oeRuntimeTest
from oeqa.utils.helper import collect_pnp_log
class RebootT... | {
"content_hash": "3d99fffb2abd12db4ac24eae48568316",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 74,
"avg_line_length": 26.97530864197531,
"alnum_prop": 0.5395881006864989,
"repo_name": "daweiwu/meta-iotqa-1",
"id": "ddcca5ceb5b21ed84aac7d2f91d0a56df0961547",
"size": "... |
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('frontend', '0056_auto_20190903_1301'),
]
operations = [
migrations.AddField(
model_name='measure',... | {
"content_hash": "483f1a935ea0baaadeb3f54bf42f9d27",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 127,
"avg_line_length": 30.366666666666667,
"alnum_prop": 0.6070252469813392,
"repo_name": "annapowellsmith/openpresc",
"id": "8a8f1758ca6a6c5a602604eede9e09daf7557b12",
"s... |
"""Metadata request handler."""
import hashlib
import hmac
import os
from oslo_config import cfg
from oslo_log import log as logging
import six
import webob.dec
import webob.exc
from nova.api.metadata import base
from nova import conductor
from nova import exception
from nova.i18n import _
from nova.i18n import _LE
f... | {
"content_hash": "ce31dc4c32623e88f696a42fbb245c30",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 79,
"avg_line_length": 35.50239234449761,
"alnum_prop": 0.5654986522911051,
"repo_name": "affo/nova",
"id": "ff2e684bbc8adc5631af68bc22d28f9ef743f645",
"size": "8152",
"... |
__author__ = 'Jeff'
import re
import os
import zipfile
import smtplib
import getpass
from email import encoders
from email.mime.base import MIMEBase
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
userEmail = ''
toEmail = ''
while 1:
userEmail = input("Please enter your email ... | {
"content_hash": "04f591f395df345caa263984757ef72c",
"timestamp": "",
"source": "github",
"line_count": 238,
"max_line_length": 108,
"avg_line_length": 30.58823529411765,
"alnum_prop": 0.5677197802197802,
"repo_name": "jregistr/Academia",
"id": "13f44a995b6784a37da7d960fa4877d0aa7344e7",
"size": "7... |
from flask import render_template, request
from . import music
from . service import recommend
@music.route('/search', methods=['GET'])
def search():
return render_template('cloudmusic/search.html')
@music.route('/result', methods=['POST'])
def result():
data = request.values.get('username')
user = reco... | {
"content_hash": "4c6f694ac0a610974c8e3f0755e556dc",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 63,
"avg_line_length": 24.8125,
"alnum_prop": 0.707808564231738,
"repo_name": "JR--Chen/flasky",
"id": "aa9e853be4a0dedd51856f8b57a69a08aeae1997",
"size": "397",
"binary"... |
from setuptools import setup, find_packages
setup(
name="apollo",
version = '0.2',
maintainer='Luminoso, LLC',
maintainer_email='dev@lumino.so',
license = "LICENSE",
url = 'http://github.com/LuminosoInsight/apollo',
platforms = ["any"],
description = "A library for monitoring queues fro... | {
"content_hash": "8530ad7ccab50c43da10f0aa89293a6f",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 89,
"avg_line_length": 29,
"alnum_prop": 0.5977011494252874,
"repo_name": "pombredanne/apollo-1",
"id": "6b124de5a7c565b00aad553f6a59af985b65702b",
"size": "696",
"binary... |
"""A server node for the key value store."""
from __future__ import absolute_import
import ctypes
import sys
import pickle
import logging
from .base import _LIB, check_call
from .kvstore import create
class KVStoreServer(object):
"""The key-value store server."""
def __init__(self, kvstore):
"""Initial... | {
"content_hash": "840e92aea10dba9512a125c70a0d976b",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 133,
"avg_line_length": 35,
"alnum_prop": 0.5735607675906184,
"repo_name": "yhpeng-git/mxnet",
"id": "d19c14ba2e750f339cae07ddacbb64fc5708ef43",
"size": "2361",
"binary":... |
from flask_wtf import Form
from wtforms import StringField, SelectField, RadioField
from wtforms.validators import DataRequired
class AddAlarmForm(Form):
time_as_tuple = lambda arr : map(lambda e : (e, str(e) if len(str(e)) == 2 else '0'+str(e)), arr)
mode_as_tuple = lambda arr : map(lambda e : (e.lower(), e),... | {
"content_hash": "1d7c3856530d95061ee801e83b06182c",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 98,
"avg_line_length": 48.166666666666664,
"alnum_prop": 0.6833910034602076,
"repo_name": "simongarnier/rpi-alarm-web-ui",
"id": "f590a9b71e3aa533522ef2fe986d5e5c626ac2b9",
... |
import numpy as np
def learn_model(k, features, labels):
return k, features.copy(), labels.copy()
def plurality(xs):
from collections import defaultdict
counts = defaultdict(int)
for x in xs:
counts[x] += 1
maxv = max(counts.values())
for k, v in counts.items():
if v == maxv:... | {
"content_hash": "122fa9277a4ea952e7aa1780e5d36c6e",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 65,
"avg_line_length": 26.058823529411764,
"alnum_prop": 0.6049661399548533,
"repo_name": "Nelca/buildMLSystem",
"id": "75519766935cf127cd660a3fcde82ea4d2413213",
"size": "... |
import os
GITHUB_OAUTH_TOKEN = 'GITHUB_OAUTH_TOKEN'
GITHUB_REPOSITORIES = [
{
'org': 'codein',
'repo': 'poc'
},
]
##################
# LOCAL SETTINGS #
##################
# DO NOT PLACE ANYTHING BELOW THIS!!!!!!!
# Allow any settings to be defined in local_settings.py, which should be
# ig... | {
"content_hash": "8dfc13e7f900df7d8982e400699c7d85",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 72,
"avg_line_length": 20.53846153846154,
"alnum_prop": 0.6067415730337079,
"repo_name": "codein/poc",
"id": "3dd427bdf5a652997e8aaf10276e45942edcc31c",
"size": "534",
"b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.