text stringlengths 4 1.02M | meta dict |
|---|---|
"""
WSGI config for inonemonth project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION... | {
"content_hash": "46e285d2f45eed7b3ff2a30e546a34d0",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 81,
"avg_line_length": 42.37837837837838,
"alnum_prop": 0.7914540816326531,
"repo_name": "robrechtdr/inonemonth",
"id": "a7ac28b6c58486ace2e0de75ce2a09cfa15dc734",
"size": ... |
"""
Copyright 2015 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | {
"content_hash": "c47117119ee363732c6476f87763450c",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 77,
"avg_line_length": 26.901785714285715,
"alnum_prop": 0.5585794888815134,
"repo_name": "realms-team/solmanager",
"id": "f782288c762ba9c091b1c4fa5155f2c9b4de8f63",
"size... |
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
workspace_sid = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
client = Client(account_sid, auth_token)
workers = client.taskrouter.workspaces(workspac... | {
"content_hash": "2b96381b06063670c17f59ca65e7c0f1",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 68,
"avg_line_length": 30.615384615384617,
"alnum_prop": 0.7939698492462312,
"repo_name": "teoreteetik/api-snippets",
"id": "a9c0cfd166e38d46d09b9a80b60ddc69b903720c",
"siz... |
import os
import glob
import hashlib
import mimetypes
from flask import Flask, render_template, request, redirect
from flask import url_for, send_from_directory, abort
from werkzeug import secure_filename
# Initialize the Flask application
app = Flask(__name__)
# This is the path to the upload directory
app.config['D... | {
"content_hash": "de6f502e41ebe3d06585ecf8346c9406",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 69,
"avg_line_length": 30.352,
"alnum_prop": 0.7150764364786505,
"repo_name": "iswt/hashserv",
"id": "158071b73e61c029ccf5f4a93158e7166a5c8e1a",
"size": "3794",
"binary"... |
from __future__ import absolute_import
import collections
import base64
import os
import re
import sys
import subprocess
import time
import tempfile
import warnings
import logging
import xml.dom.minidom
from uiautomator import Device as UiaDevice
from uiautomator import AutomatorDeviceObject
from PIL import Image
fr... | {
"content_hash": "06cfe73e737c7fe2db0f4334efd1a3e6",
"timestamp": "",
"source": "github",
"line_count": 530,
"max_line_length": 141,
"avg_line_length": 31.460377358490565,
"alnum_prop": 0.5491183879093199,
"repo_name": "Andy-hpliu/AirtestX",
"id": "eabc2226591b7328b07a4bcbdc7e43975b685011",
"size":... |
import sys
# If your extensions are in another directory, add it here.
sys.path.insert(0, '../..')
# General configuration
# ---------------------
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ex... | {
"content_hash": "333129ff52e6efd8eef91baa0f197dd5",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 92,
"avg_line_length": 30.824,
"alnum_prop": 0.709576953023618,
"repo_name": "JensGrabner/mpmath",
"id": "a5a45faa14c2662e0bcef67750a3dc01a76ccbe3",
"size": "4351",
"bin... |
from rest_framework import serializers, pagination
from .models import Stock, Share, Application, Log
from accounts.serializers import AccountField
class StockSerializer(serializers.HyperlinkedModelSerializer):
publisher = AccountField(read_only = True, exclude = ['members'])
class Meta:
model = Stock
... | {
"content_hash": "0c89320901fb8a870dc117cb696116b8",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 78,
"avg_line_length": 28.87878787878788,
"alnum_prop": 0.7124868835257083,
"repo_name": "hfercc/mese2014",
"id": "886a926b93f3c21a6bdd31000418bae4df412be0",
"size": "953",... |
"""Categorical tests."""
# limitations under the License.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from tensorflow.contrib.learn.python.learn.io import HAS_PANDAS
from tensorflow.contrib.learn.python.learn... | {
"content_hash": "546ee80abc80c6faa11d86706b3934fa",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 80,
"avg_line_length": 37.46341463414634,
"alnum_prop": 0.6100260416666666,
"repo_name": "EvenStrangest/tensorflow",
"id": "ea0f9c584e5e8234751330165a068fee4013c87c",
"size... |
import sqlalchemy.exceptions as sa_exc
from sqlalchemy import sql, util
from sqlalchemy.sql import expression, util as sql_util, operators
from sqlalchemy.orm.interfaces import MapperExtension, EXT_CONTINUE,\
PropComparator, MapperProperty,\
AttributeExten... | {
"content_hash": "cd67e37be384bd641f14aebd0bef1bae",
"timestamp": "",
"source": "github",
"line_count": 685,
"max_line_length": 78,
"avg_line_length": 33.995620437956205,
"alnum_prop": 0.6031262077554,
"repo_name": "igemsoftware/SYSU-Software2013",
"id": "f26da6c7d1db35c03b0540f8659ee1df9d3b8b49",
... |
from oslo_log import log as logging
from oslotest import base
LOG = logging.getLogger(__name__)
class BaseTest(base.BaseTestCase):
def setUp(self):
super(BaseTest, self).setUp()
def _assert_single_item(self, items, **props):
return self._assert_multiple_items(items, 1, **props)[0]
def ... | {
"content_hash": "ba1f7061acc6ef022b48473f2e51baaa",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 74,
"avg_line_length": 29.31578947368421,
"alnum_prop": 0.5502692998204668,
"repo_name": "openstack/mistral-extra",
"id": "febf6c9de7c94c964307eae57c5bd4e2c9a26aa3",
"size"... |
from setuptools import setup, find_packages
import sys, os
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README')).read()
NEWS = open(os.path.join(here, 'NEWS.rst')).read()
from release_info import version
install_requires = [
# 'anyjson',
# 'argparse',
# 'html',
# '... | {
"content_hash": "9123d8904850aa896167a32f6c07df18",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 79,
"avg_line_length": 28.36,
"alnum_prop": 0.6064880112834978,
"repo_name": "rjw57/pygis",
"id": "6b435c70d4bf598008b55cbd3d4fe29c6a1017c1",
"size": "1418",
"binary": fa... |
import importlib
import inspect
import os
import re
import sys
import tempfile
from io import StringIO
from pathlib import Path
from django.conf.urls import url
from django.core import mail
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db import DatabaseError, connection
from django.shortcu... | {
"content_hash": "6a494f8dd18a181d0c7b0346d823e220",
"timestamp": "",
"source": "github",
"line_count": 1156,
"max_line_length": 117,
"avg_line_length": 43.28373702422145,
"alnum_prop": 0.6158565832600528,
"repo_name": "edmorley/django",
"id": "b677fd98c9b0fb327a3160d69c52866da2754dea",
"size": "50... |
from .api_object import APIObject
class Error(APIObject): # pylint: disable=abstract-method
pass
| {
"content_hash": "d69ce83e5285c847ef8a35521143ee5b",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 58,
"avg_line_length": 25.75,
"alnum_prop": 0.7572815533980582,
"repo_name": "slash-testing/backslash-python",
"id": "201086d7e33547012ec768ea989601c492336ec3",
"size": "103... |
import sys
import logging
from os import path, getenv, makedirs
APP_DATA = getenv("APPDATA")
LOG_FILE = path.join(APP_DATA, "Subtitles Distributor/subtitles_distributor.log")
makedirs(path.dirname(LOG_FILE), exist_ok=True)
with open(LOG_FILE, 'a'): pass
def logging_level():
if getattr(sys, 'frozen', False):
... | {
"content_hash": "309b9d3d3108e46b95158edddaca0b26",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 113,
"avg_line_length": 27.984615384615385,
"alnum_prop": 0.49752611324903795,
"repo_name": "michael-stanin/Subtitles-Distributor",
"id": "26a198f89c12ee5971e42b99e45f3878167... |
"""Ops for building neural network layers, regularizers, summaries, etc.
See the @{$python/contrib.layers} guide.
@@avg_pool2d
@@batch_norm
@@convolution2d
@@conv2d_in_plane
@@convolution2d_in_plane
@@conv2d_transpose
@@convolution2d_transpose
@@dropout
@@embedding_lookup_unique
@@flatten
@@fully_connected
@@layer_no... | {
"content_hash": "0a94740d6d5cb8d13b318beaf3d96ec7",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 72,
"avg_line_length": 23.72340425531915,
"alnum_prop": 0.7125560538116592,
"repo_name": "tntnatbry/tensorflow",
"id": "e746107e361d0502f727bbf28d0c6697b754cfcb",
"size": "... |
import os
import sys
from datetime import datetime
from optparse import (OptionParser,BadOptionError,AmbiguousOptionError)
base_path = os.popen("pwd").read()
# stolen from http://stackoverflow.com/questions/1885161/how-can-i-get-optparses-optionparser-to-ignore-invalid-options
class PassThroughOptionParser(OptionPars... | {
"content_hash": "257a984d0801c3ed58efd01a33559ef9",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 123,
"avg_line_length": 31.50769230769231,
"alnum_prop": 0.66943359375,
"repo_name": "mp13on11/dwarf_mine",
"id": "b72d38e6de3350e64b7051ea34a356368cdb3257",
"size": "2066"... |
from lib.plugins import PluginBase
from lib.irma.common.utils import IrmaProbeType
class VirusTotalFormatterPlugin(PluginBase):
# =================
# plugin metadata
# =================
_plugin_name_ = "VirusTotal"
_plugin_author_ = "IRMA (c) Quarkslab"
_plugin_version_ = "1.0.0"
_plugi... | {
"content_hash": "3b92c8fa4cc1dd4a0ce7ac9c7f871c05",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 78,
"avg_line_length": 39.660714285714285,
"alnum_prop": 0.5821701936064836,
"repo_name": "deloittem/irma-frontend",
"id": "9dd4f8f0983519a648fb44948ebbe90ec2cc7fa4",
"size... |
from cms.api import create_page
from cms.models import Page
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.utils.unittest import skipIf
try:
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.common.exceptions import NoSuchElementExcep... | {
"content_hash": "d68efc647bdc2fbb11043e9111669021",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 118,
"avg_line_length": 34.862385321100916,
"alnum_prop": 0.6510526315789473,
"repo_name": "pancentric/django-cms",
"id": "b2b541aa7211ab3de9de9a21752ad758fa7486c6",
"size... |
import pickle
from StringIO import StringIO
from test.test_support import verbose, run_unittest, findfile
import unittest
import xml.dom
import xml.dom.minidom
import xml.parsers.expat
from xml.dom.minidom import parse, Node, Document, parseString
from xml.dom.minidom import getDOMImplementation
tstfile = findfile(... | {
"content_hash": "9cf593c2feb5417c76b6bd39fc92dfcf",
"timestamp": "",
"source": "github",
"line_count": 1441,
"max_line_length": 81,
"avg_line_length": 42.501040943789036,
"alnum_prop": 0.5623081444712952,
"repo_name": "mcking49/apache-flask",
"id": "a962ddc1d09aae11b7d3108c92fca88bf3cb0dec",
"size... |
import math
MIN_ELLIPSE_VERTICES = 50
MAX_ELLIPSE_VERTICES = 5000
FULL_CIRCLE = (0, 2*math.pi)
def constrain(n:float, minimum:float=None, maximum:float=None)->float:
if minimum is not None and n < minimum: return minimum
if maximum is not None and n > maximum: return maximum
return n
def flatten(iterable... | {
"content_hash": "619e49be4db717a1081e1d3c78c32b47",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 120,
"avg_line_length": 38.666666666666664,
"alnum_prop": 0.6657088122605364,
"repo_name": "Potato42/primitivepyg",
"id": "e0d0170b4fa53a3bc3030bc953d2bd9e723862df",
"size"... |
import mock
from rally.plugins.openstack.scenarios.sahara import (node_group_templates
as ngts)
from tests.unit import test
SAHARA_NGTS = ("rally.plugins.openstack.scenarios.sahara.node_group_templates"
".SaharaNodeGroupTemplates")
class SaharaNod... | {
"content_hash": "26adc6a89eb9bf113220a29be2548852",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 78,
"avg_line_length": 42.693333333333335,
"alnum_prop": 0.6030605871330419,
"repo_name": "gluke77/rally",
"id": "abe7bcae8ddfed43932c152268521c3d1a1a1c33",
"size": "3832",... |
"""Test the importmulti RPC."""
from test_framework.test_framework import PivxTestFramework
from test_framework.util import *
class ImportMultiTest (PivxTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.extra_args = [["-addresstype=legacy"], ["-addresstype=legacy"]]
self.se... | {
"content_hash": "a8f6c79ea7653e833e21486c8d904220",
"timestamp": "",
"source": "github",
"line_count": 447,
"max_line_length": 135,
"avg_line_length": 48.18568232662192,
"alnum_prop": 0.6133525233297739,
"repo_name": "martexcoin/martexcoin",
"id": "730841348ff26bf14b6750a9e5582d7eeeab80f0",
"size"... |
from zeep import xsd
from .mappings import query_type_mapping
def query_filter(vm, field, value, query_type):
query_function = query_type_mapping[query_type]
if field['type'] is 'String':
query_filter = vm.query_factory[query_function](Field=field['name'], Value=xsd.AnyObject(xsd.String(), value))
... | {
"content_hash": "a9a54e53b92ab30f4699c46c256029f9",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 134,
"avg_line_length": 46.50877192982456,
"alnum_prop": 0.6725763862693324,
"repo_name": "jay-tuckey/python-vmwaremirage",
"id": "fa3a1baeeb6bb6bec63010a8302e6276e3ca6601",
... |
import theano
import theano.tensor as T
import numpy as np
from recnn_train import RNTN as TheanoRNTN
from recnn import RNTN as NumpyRNTN, RNTNLayer
from numpy_impl import LogisticRegression
from test_util import assert_matrix_eq
vocab_size = 6
embed_dim = 3
label_n = 5
word2id = {
'I': 0,
'love': 1,
'yo... | {
"content_hash": "758e032233d2e592f663bb24d274776f",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 132,
"avg_line_length": 27.96153846153846,
"alnum_prop": 0.625171939477304,
"repo_name": "xiaohan2012/twitter-sent-dnn",
"id": "bcd66a3cc72d659f653543ff48ee39cac052eb42",
"... |
"""Tota game runner.
Usage:
./play.py --help
./play.py RADIANT_HEROES DIRE_HEROES [-m MAP] [-s SIZE] [-d] [-b] [-f MAX_FRAMES] [-c] [-r REPLAY_DIR] [-q] [-p]
DIRE_HEROES and RADIANT_HEROES must be comma separated lists
Options:
-h --help Show this help.
-m MAP The path to... | {
"content_hash": "37cbb0d210b5ca6e73281e908b04b8e0",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 116,
"avg_line_length": 33.19277108433735,
"alnum_prop": 0.5651542649727768,
"repo_name": "dmoisset/tota",
"id": "c3e467d55c068200d99776741b9c853606a91de0",
"size": "2777",... |
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
class GenericFilterFormHelper(FormHelper):
def __init__(self, *args, **kwargs):
super(GenericFilterFormHelper, self).__init__(*args, **kwargs)
self.helper = FormHelper()
self.form_class = 'genericFilterForm'
... | {
"content_hash": "672af03e89d693b1ba39b70874b25800",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 70,
"avg_line_length": 36.72727272727273,
"alnum_prop": 0.6732673267326733,
"repo_name": "acdh-oeaw/vhioe",
"id": "e4bab9d3f9dfea56fd02bd64991e366eea9e4ae5",
"size": "404",... |
import os
import IECore
import GafferScene
import GafferSceneTest
class VDBTestCase( GafferSceneTest.SceneTestCase ) :
def setUp( self ) :
GafferSceneTest.SceneTestCase.setUp( self )
self.dataDir = os.path.join( os.path.dirname( __file__ ), "data")
self.filters = [] # need to keep hold of the filters for the... | {
"content_hash": "a8781120d7b19f7c0dce7a5423bef743",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 83,
"avg_line_length": 28.38095238095238,
"alnum_prop": 0.7181208053691275,
"repo_name": "johnhaddon/gaffer",
"id": "064d80095040792c2412132bff4caf1b7be77b38",
"size": "240... |
__author__ = 'max'
import gpxpandas.gpxreader as gpx_reader
import os
def read_gpx_file(gpx_file_name):
with open(gpx_file_name, 'r') as gpx_file:
gpx = gpx_reader.parse_gpx(gpx_file)
# Ensure a name after parsing.
if not gpx.name:
file_name = os.path.basename(gpx_file_name)
... | {
"content_hash": "3ef8548ac80ff3d9260f1e7e5ba7ff3c",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 60,
"avg_line_length": 25.125,
"alnum_prop": 0.6301824212271974,
"repo_name": "komax/gpx-pandas",
"id": "b5ae96c182badc9f6b0a408ab753bf93e0efbb7f",
"size": "603",
"binary... |
"""Helper class for patching and unpatching."""
import math
from typing import NamedTuple, Optional, Tuple
import tensorflow as tf
from vct.src import extract_patches
class Patched(NamedTuple):
"""Represents a patched tensor.
Attributes:
tensor: The patched tensor, shape (b', patch_size ** 2, d)
num_p... | {
"content_hash": "8702f35943f68ab55f9d8d772c65bde8",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 80,
"avg_line_length": 32.43956043956044,
"alnum_prop": 0.600609756097561,
"repo_name": "google-research/google-research",
"id": "b1ade06430dd63e026e371057617ef96ee617165",
... |
'''
Created on 2017年3月27日
@author: wanlipeng
'''
from problems.listnode import ListNode
class Solution(object):
def reverseList(self, head):
if head is None:
return None
newHead = ListNode(0)
newHead.next = head
curNode = head.next
head.next = None
whil... | {
"content_hash": "655bf465f4ec73d4c5d723eb5f26b250",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 51,
"avg_line_length": 24.895833333333332,
"alnum_prop": 0.5112970711297071,
"repo_name": "lunabox/leetcode",
"id": "9601d044b5a42bf9ee0cdd0e3d9b98c197eccb45",
"size": "125... |
"""
Django settings for todo project.
Generated by 'django-admin startproject' using Django 1.8.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths i... | {
"content_hash": "bfac180f04e7349f576272044f7e3555",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 75,
"avg_line_length": 26.88135593220339,
"alnum_prop": 0.6935687263556116,
"repo_name": "samfcmc/todo_django_react",
"id": "b07654afe8abe04c7864746b4df35243be427d37",
"si... |
"""Generate black and white test TFRecords with Example protos.
Each record within the TFRecord file is a
serialized Example proto. The Example proto contains the following fields:
image/encoded: string containing JPEG encoded image in RGB colorspace
image/height: integer, image height in pixels
image/width: in... | {
"content_hash": "2db8079fc0a244168224ccd82792c821",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 77,
"avg_line_length": 37.785714285714285,
"alnum_prop": 0.686578449905482,
"repo_name": "annarev/benchmarks",
"id": "05b62e4f14812d850ab765bef12a53bb8ecd5cfd",
"size": "8... |
try:
import ujson as json
except ImportError:
import json
try:
import msgpack
except ImportError:
pass
class DtoObject(dict):
@property
def __dict__(self):
return {k: v for k, v in self.items()}
def to_json(self, **kwargs):
return json.dumps(self, **kwargs)
def to_by... | {
"content_hash": "d2d7a92eba2a68654c63f9e406edbbf0",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 46,
"avg_line_length": 18.38095238095238,
"alnum_prop": 0.6139896373056994,
"repo_name": "sserrot/champion_relationships",
"id": "311b91836703a1d6805443e54a80e0ff7989004c",
... |
from __future__ import absolute_import
from datetime import timedelta
from django.utils import timezone
from sentry.models import Environment, Release, ReleaseEnvironment
from sentry.testutils import TestCase
class GetOrCreateTest(TestCase):
def test_simple(self):
project = self.create_project(name="foo... | {
"content_hash": "eca9ddd63159842499670c7ccb38abe5",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 99,
"avg_line_length": 37.78181818181818,
"alnum_prop": 0.6823869104908566,
"repo_name": "beeftornado/sentry",
"id": "9e284172854fef7fd42dcb8c8ec882a7872c36a6",
"size": "20... |
import sys
import os
# 3p
import mock
import requests
from nose.plugins.attrib import attr
# project
from checks import AgentCheck
from tests.checks.common import AgentCheckTest
CONFIG = {
'init_config': {},
'instances': [
{
'rabbitmq_api_url': 'http://localhost:15672/api/',
'... | {
"content_hash": "7281625a5ee28cb52780c6eac85e5091",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 107,
"avg_line_length": 32.63243243243243,
"alnum_prop": 0.5986417094583403,
"repo_name": "darnould/integrations-core",
"id": "2c01f4c01eee1516ed21abba00cd0aeb9a0ea0e9",
"... |
'''
Watch files and translate the changes into salt events
:depends: - pyinotify Python module >= 0.9.5
:Caution: Using generic mask options like open, access, ignored, and
closed_nowrite with reactors can easily cause the reactor
to loop on itself. To mitigate this behavior, consider
... | {
"content_hash": "634fa5f2ac11c0f2162273830a4e4a73",
"timestamp": "",
"source": "github",
"line_count": 434,
"max_line_length": 106,
"avg_line_length": 36.463133640552996,
"alnum_prop": 0.5207582938388625,
"repo_name": "HubbleStack/Pulsar",
"id": "a7af0d1ec39cf450db474bd95e3deb5652295102",
"size": ... |
from ..Module import Module
from ..TagData import TagData
class balance(Module):
opmap = {
'infData': 'descend',
'contract': 'set',
'contractUntil':'set',
}
def __init__(self, xmlns):
Module.__init__(self, xmlns)
self.name = 'balance'
def parse_status... | {
"content_hash": "7f2b1204d891eb771b08a703bf02eeb0",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 68,
"avg_line_length": 27.258064516129032,
"alnum_prop": 0.5775147928994083,
"repo_name": "hiqdev/reppy",
"id": "c244e4fb52c53ada6fecf5f54623b85b0a191a25",
"size": "845",
... |
"""
API for OGC Filter Encoding (FE) constructs and metadata.
Filter Encoding: http://www.opengeospatial.org/standards/filter
Supports version 2.0.2 (09-026r2).
"""
from owslib.etree import etree
from owslib import util
from owslib.namespaces import Namespaces
from abc import ABCMeta, abstractmethod
# default vari... | {
"content_hash": "f9efb15b551320c34c250c098ccad55c",
"timestamp": "",
"source": "github",
"line_count": 488,
"max_line_length": 119,
"avg_line_length": 35.14139344262295,
"alnum_prop": 0.6330981398332264,
"repo_name": "geopython/OWSLib",
"id": "795104fd451102ab74a6f058c4e2dc425a73fbc9",
"size": "17... |
from django.conf.urls import patterns, url
from mc2.controllers.base import views
urlpatterns = patterns(
'',
url(
r'^add/$',
views.ControllerCreateView.as_view(),
name='add'
),
url(
r'^(?P<controller_pk>\d+)/$',
views.ControllerEditView.as_view(),
name... | {
"content_hash": "0625fa4ddac1eb2818114064800c7e0f",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 99,
"avg_line_length": 29.545454545454547,
"alnum_prop": 0.5423076923076923,
"repo_name": "praekelt/mc2",
"id": "21a39e5b39daebfd153c72549d3821cb8f748927",
"size": "1300",
... |
import netaddr
import six
from sqlalchemy import func
import neutron.db.models_v2 as mod
NETWORK_ID = 'network_id'
NETWORK_NAME = 'network_name'
SUBNET_ID = 'subnet_id'
SUBNET_NAME = 'subnet_name'
SUPPORTED_FILTERS = {
NETWORK_ID: mod.Network.id,
NETWORK_NAME: mod.Network.name,
'tenant_id': mod.Network.t... | {
"content_hash": "dd7bd076e65bdd33086beea208ff0424",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 79,
"avg_line_length": 40.41463414634146,
"alnum_prop": 0.6071213035606517,
"repo_name": "MaximNevrov/neutron",
"id": "4855be2c9b2f093104ef4c4b714fb6e9ccfacab1",
"size": "... |
"""Isomap for manifold learning"""
# Author: Jake Vanderplas -- <vanderplas@astro.washington.edu>
# License: BSD 3 clause (C) 2011
import numpy as np
from ..base import BaseEstimator, TransformerMixin
from ..neighbors import NearestNeighbors, kneighbors_graph
from ..utils import check_array
from ..utils.graph import... | {
"content_hash": "a324f6e402390ba0b3fa57dd4942f02c",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 79,
"avg_line_length": 35.029411764705884,
"alnum_prop": 0.5917996081724042,
"repo_name": "eickenberg/scikit-learn",
"id": "3354c36db8447bb599e33a4ca62ed40b56ea73cc",
"siz... |
import Gaffer
## The CompoundPathFilter class simply combines a number of other
# PathFilters, applying them in sequence.
class CompoundPathFilter( Gaffer.PathFilter ) :
def __init__( self, filters=[], userData={} ) :
Gaffer.PathFilter.__init__( self, userData )
self.__filters = None
self.__changedConnecti... | {
"content_hash": "92cac9422f1713bf05791a4463296527",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 128,
"avg_line_length": 25.348484848484848,
"alnum_prop": 0.6700537955768081,
"repo_name": "davidsminor/gaffer",
"id": "e70897011e4a1d277a67765cc5a7ed6e6a8af773",
"size": "... |
from ...Helpers.commands import Nop
def skip_statement(commands, data, node):
""" Компиляция оператора пропуска команды """
commands.add(Nop)
| {
"content_hash": "a5e0251cf373e75e6f97ac99d0aee13f",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 49,
"avg_line_length": 25.333333333333332,
"alnum_prop": 0.7105263157894737,
"repo_name": "PetukhovVictor/compiler",
"id": "ae690d7321a0373a0cc07f00abdf3bdf29114af5",
"size"... |
r"""
Punkt Sentence Tokenizer
This tokenizer divides a text into a list of sentences,
by using an unsupervised algorithm to build a model for abbreviation
words, collocations, and words that start sentences. It must be
trained on a large collection of plaintext in the taret language
before it can be used.
The NLTK d... | {
"content_hash": "b12a784b498de04c05460bcd53eb5d33",
"timestamp": "",
"source": "github",
"line_count": 1584,
"max_line_length": 118,
"avg_line_length": 38.53977272727273,
"alnum_prop": 0.5558176486969056,
"repo_name": "sivu22/nltk-on-gae",
"id": "fbb1cb3612da5aeb71d64854e84255103f4e3700",
"size": ... |
import socket
import os
import select
import sys
HOSTNAME = 'localhost'
PORT = 5000
def prompt():
sys.stdout.write("YOU > ")
sys.stdout.flush()
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(2)
try:
s.connect((HOSTNAME, PORT))
except:
print("ERROR > Unable to connect");
sys.exit()
prompt()... | {
"content_hash": "c4372e03b8ae83cd7feb3b5457c8b020",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 81,
"avg_line_length": 18.3125,
"alnum_prop": 0.6496018202502845,
"repo_name": "rusucosmin/courses",
"id": "a0a4aebbcc96f31514ffc9681eceb646af3f8ed8",
"size": "879",
"bin... |
from collections import OrderedDict
from typing import Dict, Type
from .base import BiddingStrategyServiceTransport
from .grpc import BiddingStrategyServiceGrpcTransport
# Compile a registry of transports.
_transport_registry = (
OrderedDict()
) # type: Dict[str, Type[BiddingStrategyServiceTransport]]
_transport... | {
"content_hash": "0c73eba3a560dd5af9b304628b5ef2ec",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 65,
"avg_line_length": 29.5625,
"alnum_prop": 0.7970401691331924,
"repo_name": "googleads/google-ads-python",
"id": "80d3172dc8a2deb19ae47923a09ed44e4c30d63f",
"size": "107... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import copy
import logging
import os
import shutil
import threading
from collections import defaultdict
from twitter.common.collections import maybe_list
from pants.... | {
"content_hash": "20fa0e337943bc598f8cac0db1f66f26",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 99,
"avg_line_length": 43.29665071770335,
"alnum_prop": 0.653442369322577,
"repo_name": "tejal29/pants",
"id": "48dda45c87025d79bc319cacc0b27276f5511e39",
"size": "9196",
... |
from __future__ import absolute_import
from uuid import uuid4
import six
import logging
from django.utils.translation import ugettext_lazy as _
from rest_framework.serializers import ValidationError
from six.moves.urllib.parse import urlencode
from sentry.integrations import (
IntegrationInstallation,
Integ... | {
"content_hash": "4da4eb00fcda6ef6a20bc72e2b299b92",
"timestamp": "",
"source": "github",
"line_count": 430,
"max_line_length": 133,
"avg_line_length": 37.30930232558139,
"alnum_prop": 0.5979554946082404,
"repo_name": "beeftornado/sentry",
"id": "7eefb4912892e27bbe3f5bcb144ae5ac1408e6a5",
"size": "... |
"""Module containing non-deprecated functions borrowed from Numeric.
"""
import functools
import types
import warnings
import numpy as np
from . import multiarray as mu
from . import overrides
from . import umath as um
from . import numerictypes as nt
from .multiarray import asarray, array, asanyarray, concatenate
fr... | {
"content_hash": "3d3d4593bfde2f78fa82d79c5650389f",
"timestamp": "",
"source": "github",
"line_count": 3789,
"max_line_length": 103,
"avg_line_length": 32.40353655318026,
"alnum_prop": 0.6027594744944086,
"repo_name": "ryfeus/lambda-packs",
"id": "65a42eb1ee72c7843efbf8a2cf8f8c47d0b17644",
"size":... |
"""
<comment-ja>
libvirtの仮想ネットワークの設定を生成する
</comment-ja>
<comment-en>
Generate configuration file of virtual networks for libvirt.
</comment-en>
@file: config_network.py
@author: Taizo ITO <taizo@karesansui-project.info>
@copyright:
"""
import time
import os, stat
import re
import errno
from StringIO import ... | {
"content_hash": "c1959fb9758fbeca179f9345d2f21aaa",
"timestamp": "",
"source": "github",
"line_count": 315,
"max_line_length": 103,
"avg_line_length": 32.27301587301587,
"alnum_prop": 0.6053511705685619,
"repo_name": "karesansui/karesansui",
"id": "3dc48f591945baa6f3f37b4808544aff1264036e",
"size"... |
import smtplib
def main():
hostname = 'smtp.gmail.com'
port = 587
username = 'jlyoung.gmail.test@gmail.com'
password = 'testpassword'
sender = 'jlyoung.gmail.test@gmail.com'
receivers = ['jlyoung.receiver.addr@stackoverflowexample.com']
message = '''From: J.L. Young <jlyoung.gmail.test@gmail.com>
To: JLY Receiv... | {
"content_hash": "a7f6f7ac90a458fcf2b94b7b514ba192",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 65,
"avg_line_length": 24.06451612903226,
"alnum_prop": 0.7184986595174263,
"repo_name": "jlyoung/stackoverflow_answers",
"id": "e263f97803698c50429122f4bbe2eccc0d04cc68",
... |
"""
Russell RGB Colourspace
=======================
Defines the *Russell RGB* colourspace:
- :attr:`colour.models.RGB_COLOURSPACE_RUSSELL_RGB`.
References
----------
- :cite:`Cottrella` : Cottrell, R. (n.d.). The Russell RGB working color
space. http://www.russellcottrell.com/photo/downloads/RussellRGB.icc
"... | {
"content_hash": "ce91ea3ec6223086cac0855fd1211995",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 78,
"avg_line_length": 27.68235294117647,
"alnum_prop": 0.6914577135571611,
"repo_name": "colour-science/colour",
"id": "b9c1769bbb587e1efc632ae25c265ed6cb21d81e",
"size": ... |
from unittest import TestCase
from mock import MagicMock
from src.main.com.rowley.shavekeeper.productdatacompiler.models.ProductConsolidator import ProductConsolidator
from src.main.com.rowley.shavekeeper.productdatacompiler.models.ProductModels import ItemBase
from src.main.com.rowley.shavekeeper.productdatacompiler.... | {
"content_hash": "6a707546917031697bb9c404d12e5698",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 120,
"avg_line_length": 54.738219895287955,
"alnum_prop": 0.6287900526064084,
"repo_name": "alphonzo79/ShaveKeeper",
"id": "e0d7202bfad1134831b25fbedcd368b44cd4b233",
"siz... |
"""
Create the list of programs that will be executed.
The result is a list of tuples of the following format :
(function_id, schedule_id)
Example :
(function524, function524_schedule_125)
"""
import pickle
from pathlib import Path
# Path to the directory containing the programs
data_path = Path("/data/scratch/henn... | {
"content_hash": "f5fd4de664095ad1228669ad037c37cd",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 79,
"avg_line_length": 28.15,
"alnum_prop": 0.6580817051509769,
"repo_name": "rbaghdadi/COLi",
"id": "f63910d04efeb98ecaf13b504bec3e1931355e7e",
"size": "1126",
"binary":... |
"""Higher level child and data watching API's.
:Maintainer: Ben Bangert <ben@groovie.org>
:Status: Production
.. note::
:ref:`DataWatch` and :ref:`ChildrenWatch` may only handle a single
function, attempts to associate a single instance with multiple functions
will result in an exception being thrown.
"... | {
"content_hash": "917583a43063770f38cbd4f4d90d0999",
"timestamp": "",
"source": "github",
"line_count": 419,
"max_line_length": 77,
"avg_line_length": 34.55369928400955,
"alnum_prop": 0.5837132200580191,
"repo_name": "pombredanne/kazoo",
"id": "ad585da15d5f66121f3c1b86819c930fe72a0679",
"size": "14... |
"""Runs SpecCPU2006.
From SpecCPU2006's documentation:
The SPEC CPU2006 benchmark is SPEC's industry-standardized, CPU-intensive
benchmark suite, stressing a system's processor, memory subsystem and compiler.
SpecCPU2006 homepage: http://www.spec.org/cpu2006/
"""
import logging
import posixpath
import re
from perfk... | {
"content_hash": "30f76b6ba1231ae6d612af1346e34771",
"timestamp": "",
"source": "github",
"line_count": 254,
"max_line_length": 80,
"avg_line_length": 34.69291338582677,
"alnum_prop": 0.5873808443032229,
"repo_name": "emaeliena/PerfKitBenchmarker",
"id": "30066053a4fae4c3fac3d0019a5e7e7ef223997e",
... |
'''
Test interacting with the wheel system. This script is useful when testing
wheel modules
'''
# Import Python libs
from __future__ import absolute_import
import optparse
import pprint
# Import Salt Libs
import salt.config
import salt.wheel
import salt.auth
def parse():
'''
Parse the command line options
... | {
"content_hash": "1ba3fc2e3e0152189d85097c7a32037a",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 74,
"avg_line_length": 22.774647887323944,
"alnum_prop": 0.562152133580705,
"repo_name": "stephane-martin/salt-debian-packaging",
"id": "1bdec2e328d7dccf06aa28f45b3602eb9ab32... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 30, transform = "Difference", sigma = 0.0, exog_count = 0, ar_order = 0); | {
"content_hash": "6746a0b96d75d2d3acb4496169c650a9",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 168,
"avg_line_length": 38.285714285714285,
"alnum_prop": 0.7089552238805971,
"repo_name": "antoinecarme/pyaf",
"id": "0c14f355c972d63312125314b3e93ac483ad27fc",
"size": "26... |
from django.db.models.signals import post_save
from django.dispatch import receiver
from users.models import User
from communications.models import SMS
@receiver(post_save, sender=User)
def post_save_user(sender, instance, created, **kwargs):
if created:
# instance.send_signup_greeting_sms()
SMS... | {
"content_hash": "b8811efa2c1ea3cb5d4eac81628a91c0",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 56,
"avg_line_length": 28.055555555555557,
"alnum_prop": 0.6633663366336634,
"repo_name": "dobestan/fastblog",
"id": "99010ae06233bb5b42e6b7587e34bd44d2e117a1",
"size": "52... |
from typing import Optional
from appium.options.common.supports_capabilities import SupportsCapabilities
DISABLE_SUPPRESS_ACCESSIBILITY_SERVICE = 'disableSuppressAccessibilityService'
class DisableSuppressAccessibilityServiceOption(SupportsCapabilities):
@property
def disable_suppress_accessibility_service(... | {
"content_hash": "8cd145feeecec90e0c770250edc37ca2",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 78,
"avg_line_length": 41.21739130434783,
"alnum_prop": 0.7468354430379747,
"repo_name": "appium/python-client",
"id": "980da567c8990dafc76a34704e4aa0a31551fe8c",
"size": "... |
USAGE="""
XMT
usage:
xmt init [-v...] [--parse=OPTS] [--transfer=OPTS] [--generate=OPTS]
[--rephrase=OPTS] [--full] [--reverse] [--ace-bin=PATH]
DIR [ITEM...]
xmt parse [-v...] [ITEM...]
xmt transfer [-v...] [ITEM...]
xmt generate [-v...] [ITEM...]
xmt rephrase [-v... | {
"content_hash": "d01a348379c5aad665d71fe97eb4d56d",
"timestamp": "",
"source": "github",
"line_count": 317,
"max_line_length": 79,
"avg_line_length": 34.13564668769716,
"alnum_prop": 0.5228721929581369,
"repo_name": "goodmami/xmt",
"id": "540a40f081e04054ee864634251611dec79a8da5",
"size": "10845",... |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name=... | {
"content_hash": "4f26d3a4a9b0b7f3617a87381f3b323a",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 95,
"avg_line_length": 29.304347826086957,
"alnum_prop": 0.5712166172106825,
"repo_name": "frankmaina/django2fa",
"id": "896684851495bbf9cc08d47d5b00545b1531ec85",
"size": ... |
ZOGGERY_PROTO_SPEC = """
protocol org.xlattice.zoggery
message logEntry:
timestamp fuint32
nodeID fbytes20
key fbytes20
length vuint32
by lstring
path lstring
"""
| {
"content_hash": "6a6623dc3c7585caca55f9d6a3e38591",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 29,
"avg_line_length": 18.181818181818183,
"alnum_prop": 0.655,
"repo_name": "jddixon/fieldz",
"id": "75d65edc4bca4f983abf01cbd8d1e5986c9eb776",
"size": "239",
"binary": ... |
"""distutils.command.bdist_wininst
Implements the Distutils 'bdist_wininst' command: create a windows installer
exe-program."""
# This module should be kept compatible with Python 1.5.2.
__revision__ = "$Id: bdist_wininst.py,v 1.46 2003/06/12 17:23:58 theller Exp $"
import sys, os, string
from distutils.core import... | {
"content_hash": "f9784804ad80544307bb315c9b3456a3",
"timestamp": "",
"source": "github",
"line_count": 242,
"max_line_length": 88,
"avg_line_length": 38.239669421487605,
"alnum_prop": 0.5499243570347958,
"repo_name": "OS2World/APP-INTERNET-torpak_2",
"id": "e2c48c534dd9252e21abbae17b19b618a9507752",... |
from FileSystemLLAError import FileSystemLLAError
def copyACL(rc,output,outerr,parseParamList,Logger):
return
def makeMountpoint(rc,output,outerr,parseParamList,Logger):
return
def removeMountpoint(rc,output,outerr,parseParamList,Logger):
return
def listMountpoint(rc,output,outerr,parseParam... | {
"content_hash": "be890733ddea18e9859873e414784342",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 63,
"avg_line_length": 22.75,
"alnum_prop": 0.6843156843156843,
"repo_name": "openafs-contrib/afspy",
"id": "aa6aa7e17f3e3be52b3c766393166c425a8163e7",
"size": "1001",
"b... |
from string import Template
from datetime import date
bitcoinDir = "./";
inFile = bitcoinDir+"/share/qt/Info.plist"
outFile = "Moneta-Qt.app/Contents/Info.plist"
version = "unknown";
fileForGrabbingVersion = bitcoinDir+"bitcoin-qt.pro"
for line in open(fileForGrabbingVersion):
lineArr = line.replace(" ", ... | {
"content_hash": "8f36e6ab4f349e23514ed2e9691036e9",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 69,
"avg_line_length": 27.166666666666668,
"alnum_prop": 0.7085889570552147,
"repo_name": "moneta-dev/moneta",
"id": "ff9a84b649d47015ecfdb8d40df1c287b56c6d2e",
"size": "89... |
import sys
import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('..'))
import ... | {
"content_hash": "e4e68488153a18e6c1941800ce0d54e7",
"timestamp": "",
"source": "github",
"line_count": 280,
"max_line_length": 79,
"avg_line_length": 33.1,
"alnum_prop": 0.6842900302114804,
"repo_name": "imsweb/django-bootstrap",
"id": "540c1460b636f97b31a66f8195c830bbc452706d",
"size": "9706",
... |
__author__ = 'Ariel Anthieni'
#Definicion de Librerias
import os
import json
import csv
import codecs
#Establecimiento de variables
dir_origen = '/opt/desarrollo/metadata-tools/convert-tools/data/in/'
dir_destino = '/opt/desarrollo/metadata-tools/convert-tools/data/out/'
geocampo = 'WKT'
tabla = 'calles_indec'
#Lis... | {
"content_hash": "15375c177d2786a2aca54c286bff3009",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 103,
"avg_line_length": 23.775862068965516,
"alnum_prop": 0.5532994923857868,
"repo_name": "elcoloo/metadata-tools",
"id": "08627cea7e27d5071ec070675023a0b58c37e61f",
"siz... |
from datetime import datetime
from qiita_db.metadata_template.constants import (
SAMPLE_TEMPLATE_COLUMNS, PREP_TEMPLATE_COLUMNS,
PREP_TEMPLATE_COLUMNS_TARGET_GENE)
from qiita_db.metadata_template.prep_template import PrepTemplate
from qiita_db.metadata_template.sample_template import SampleTemplate
from qiita_... | {
"content_hash": "0c6aa96c02c88e4ffe8f511b41d56e0c",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 78,
"avg_line_length": 39.61467889908257,
"alnum_prop": 0.539138490041686,
"repo_name": "antgonza/qiita",
"id": "62c86e02e83278bd30f0b7a8949e1fc678ba39cd",
"size": "4669",... |
import sys
import os
from time import sleep
from threading import Timer
import rospy
import baxter_interface
from baxter_interface import CHECK_VERSION
class JointRecorder(object):
def __init__(self, filename, rate):
"""
Records joint data to a file at a specified rate.
"""
self.... | {
"content_hash": "54c18cf5a283dcb4b76998f0e2c4e726",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 79,
"avg_line_length": 35.08403361344538,
"alnum_prop": 0.5667065868263473,
"repo_name": "LCAS/zoidbot",
"id": "a1d82184003169677cf126a45ddfe05bb170265e",
"size": "4195",
... |
from unittest import mock
import uuid
def service_registered_successfully(registry, *services):
for service in services:
service_entry = (
service['host'], service['port'], service['node_id'], service['type'])
try:
entry = registry._repository._registered_services[
... | {
"content_hash": "c6f6e242dc519191c88b39d5bb9434ea",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 119,
"avg_line_length": 35.095238095238095,
"alnum_prop": 0.6640434192672998,
"repo_name": "kashifrazzaqui/vyked",
"id": "80af64a08d15a406a932d00d250ef1e26a449137",
"size"... |
from django.contrib import admin
from djcelery.models import TaskMeta
from .models import (Application, BenchmarkConfig, DBConf, DBMSCatalog,
DBMSMetrics, KnobCatalog, MetricCatalog, PipelineResult,
Project, Result, ResultData, Statistics, WorkloadCluster)
class DBMSCatalogA... | {
"content_hash": "b576971b193c5d201e6297ce5702eefa",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 78,
"avg_line_length": 31.235714285714284,
"alnum_prop": 0.6695632289046421,
"repo_name": "dvanaken/website",
"id": "d5c4f34cca15b726007ba44324b8e03ba7aaf00d",
"size": "43... |
from client import SliceMatrix
import core
import connect
| {
"content_hash": "6af95aee9c4dde7209d012ad51b430ac",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 30,
"avg_line_length": 19.333333333333332,
"alnum_prop": 0.8620689655172413,
"repo_name": "tynano/slicematrixIO-python",
"id": "4fcf45d8103caa30e29b49f6ee2146c74789f97e",
"s... |
import cv2
import numpy as np
from plantcv.plantcv import rotate
def test_rotate(test_data):
"""Test for PlantCV."""
img = cv2.imread(test_data.small_rgb_img)
rotated = rotate(img=img, rotation_deg=45, crop=True)
imgavg = np.average(img)
rotateavg = np.average(rotated)
assert rotateavg != imga... | {
"content_hash": "46946c94082dffd98624f6dbc99099c1",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 57,
"avg_line_length": 26.916666666666668,
"alnum_prop": 0.6934984520123839,
"repo_name": "danforthcenter/plantcv",
"id": "e4891d3ac85424ad4c9b748cb4113efad6edf359",
"size"... |
from __future__ import absolute_import
from django.utils.translation import ugettext_lazy as _
from sentry import http, options
from sentry.identity.pipeline import IdentityProviderPipeline
from sentry.identity.github import get_user_info
from sentry.integrations import Integration, IntegrationFeatures, IntegrationPr... | {
"content_hash": "7600547767ba7aa8e67b133a26e331b7",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 208,
"avg_line_length": 35.9492385786802,
"alnum_prop": 0.6341428974865857,
"repo_name": "looker/sentry",
"id": "21331a5a4a25f33fac9bcfc563cc22c1850b82a7",
"size": "7082",... |
"""Tests for network API"""
from nova import context
from nova import network
from nova.openstack.common import rpc
from nova import test
class ApiTestCase(test.TestCase):
def setUp(self):
super(ApiTestCase, self).setUp()
self.network_api = network.API()
self.context = context.RequestCont... | {
"content_hash": "031c508ee783a474dbb37e6897c043d9",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 75,
"avg_line_length": 35.20634920634921,
"alnum_prop": 0.5495942290351669,
"repo_name": "NewpTone/stacklab-nova",
"id": "a29756caaea4f8ace056a17a33bdf53aed50092d",
"size":... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('jobportal', '0007_auto_20170314_2337'),
]
operations = [
migrations.RemoveField(
model_name='person',
name='join_date',
),
... | {
"content_hash": "4ce8a04567ee32a39cac4d9bf2d757b8",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 49,
"avg_line_length": 19.11764705882353,
"alnum_prop": 0.5876923076923077,
"repo_name": "klenks/jobsportal",
"id": "bb32713cad3ef761bc5847b3b339d1aab75152e6",
"size": "398... |
Import('env')
#
# Dump build environment (for debug)
#print env.Dump()
#
flags = " ".join(env['LINKFLAGS'])
flags = flags.replace("-u _printf_float", "")
flags = flags.replace("-u _scanf_float", "")
newflags = flags.split()
env.Replace(
LINKFLAGS=newflags
) | {
"content_hash": "e965058398902641b2bf17acf20b479c",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 45,
"avg_line_length": 17.466666666666665,
"alnum_prop": 0.6564885496183206,
"repo_name": "Aircoookie/WLED",
"id": "da916ebe2b863128ca2c0c9f22e0960658817a3d",
"size": "262"... |
def __bootstrap__():
global __bootstrap__, __loader__, __file__
import sys, pkg_resources, imp
__file__ = pkg_resources.resource_filename(__name__, '_unpacker.cp35-win32.pyd')
__loader__ = None; del __bootstrap__, __loader__
imp.load_dynamic(__name__,__file__)
__bootstrap__()
| {
"content_hash": "faf37b082e4cee76a8fb1b0d1e30fcf2",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 84,
"avg_line_length": 42.42857142857143,
"alnum_prop": 0.5925925925925926,
"repo_name": "stevenzhang18/Indeed-Flask",
"id": "a65a01d8e3af7590b30b571683d43b754eb7cc74",
"siz... |
class Config(object):
"""Global configuration variables for all queries derived from ``mysqlstmt.Stmt``.
Values set on these class attributes will affect all queries.
Examples: ::
mysqlstmt.Config.placeholder = '%'
"""
placeholder = '?'
"""Parameterize queries using this placeholder.... | {
"content_hash": "22c468c9cd115cbd3b8a984f6a2672c9",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 86,
"avg_line_length": 24.195121951219512,
"alnum_prop": 0.6370967741935484,
"repo_name": "lovette/mysqlstmt",
"id": "51720b9914a1c46f14f8d90ae249ec299cef8d2b",
"size": "10... |
import collections
import itertools
import mimetypes
import time
import math
import random
from hashlib import md5
from swift import gettext_ as _
from urllib import unquote, quote
from greenlet import GreenletExit
from eventlet import GreenPile
from eventlet.queue import Queue
from eventlet.timeout import Timeout
fr... | {
"content_hash": "5d4ef4c532d4d8805c977a940443c8d6",
"timestamp": "",
"source": "github",
"line_count": 2502,
"max_line_length": 144,
"avg_line_length": 43.03357314148681,
"alnum_prop": 0.5667131048574348,
"repo_name": "heemanshu/swift_liberty",
"id": "9f283bbc1f254f84f07097b68f7b188ab8b684c1",
"si... |
import random, time
import os, sys, socket, subprocess, re
class GridController:
"""
To initialize an instance of the class:
test_controller = BsubController.BsubController(test_cmd_list, ...)
To run commands on the grid using that instance:
test_controller.run_grid_submission()
To get failed commands upon c... | {
"content_hash": "cf1c6217dced6f766d0bce5bd18069d7",
"timestamp": "",
"source": "github",
"line_count": 424,
"max_line_length": 197,
"avg_line_length": 34.155660377358494,
"alnum_prop": 0.6349261151774617,
"repo_name": "rhysf/Synima",
"id": "9b5f0f232b17412e6f71ec2475f6dbd8b65c2726",
"size": "14558... |
from collections import (
Counter,
defaultdict,
)
import numpy as np
import pytest
import pandas as pd
from pandas import (
DataFrame,
Index,
MultiIndex,
Series,
concat,
isna,
timedelta_range,
)
import pandas._testing as tm
from pandas.tests.apply.common import series_transform_ker... | {
"content_hash": "6d1b24eda05d8273ca94a591a8fb39d3",
"timestamp": "",
"source": "github",
"line_count": 892,
"max_line_length": 88,
"avg_line_length": 31.477578475336323,
"alnum_prop": 0.600683809388133,
"repo_name": "jorisvandenbossche/pandas",
"id": "1d0b64c1835dfd79bfcb18c8854d3d82272e9288",
"si... |
import copy
import json
import os
from typing import Tuple
import pytest
from test_utilities.utils import assert_final_job_status, get_automl_job_properties
from azure.ai.ml import MLClient, automl
from azure.ai.ml.constants._common import AssetTypes
from azure.ai.ml.entities import Data
from azure.ai.ml.entities._in... | {
"content_hash": "6be0391399591ae773d458f670871cef",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 123,
"avg_line_length": 44.77372262773723,
"alnum_prop": 0.6371046625366807,
"repo_name": "Azure/azure-sdk-for-python",
"id": "1831c46eb28d32d86e70fc24fc93008233329379",
"... |
from .base import Layout
DEFAULT_FLOAT_WM_TYPES = set([
'utility',
'notification',
'toolbar',
'splash',
'dialog',
])
DEFAULT_FLOAT_RULES = [
{"role": "About"},
]
class Floating(Layout):
"""
Floating layout, which does nothing with windows but handles focus order
"""
defaults ... | {
"content_hash": "41090d5bb79d44e5f48ba69ffebfb955",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 85,
"avg_line_length": 32.091787439613526,
"alnum_prop": 0.5426765015806112,
"repo_name": "jdowner/qtile",
"id": "3663d9cb0197367030c9684b524302f4acdba84c",
"size": "8049"... |
"""
backend.agent_backend.impl_knot2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Knot DNS agent backend
Create, update, delete zones locally on a Knot DNS resolver using the
knotc utility.
Supported Knot versions: >= 2.1, < 3
`Knot DNS 2 User documentation <../../admin/backends/knot2_agent.html>`_
.. WARNING::
Untested, ... | {
"content_hash": "0a33d4c1187d790b32576fbf0e77154c",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 78,
"avg_line_length": 35.5625,
"alnum_prop": 0.5842120679554774,
"repo_name": "openstack/designate",
"id": "ca9b6b15f7a9344c4fb32f7700d974b9cc1fbd8b",
"size": "7499",
"... |
"""
A collection of "vanilla" transforms for spatial operations
https://github.com/Project-MONAI/MONAI/wiki/MONAI_Design
"""
import warnings
from copy import deepcopy
from enum import Enum
from itertools import zip_longest
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
import numpy as n... | {
"content_hash": "9a7fd800ceee13e996687f66073a05c2",
"timestamp": "",
"source": "github",
"line_count": 3368,
"max_line_length": 129,
"avg_line_length": 51.39489311163896,
"alnum_prop": 0.6085743336144843,
"repo_name": "Project-MONAI/MONAI",
"id": "dcddefce3a4724b1ef1e521b7762c269d4f29e86",
"size":... |
import warnings
import numpy as np
from petram.mfem_config import use_parallel
if use_parallel:
from petram.helper.mpi_recipes import *
import mfem.par as mfem
else:
import mfem.ser as mfem
def make_matrix(x, y, z):
pass
def do_findpoints(mesh, *args):
sdim = mesh.SpaceDimension()
sha... | {
"content_hash": "50691c358fd8302390997eec636e4bdb",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 85,
"avg_line_length": 29.14,
"alnum_prop": 0.5998627316403569,
"repo_name": "mfem/PyMFEM",
"id": "89e3bdcddb2846365fd29b71ccf048d90487891b",
"size": "1457",
"binary": fa... |
import os, urllib2, cStringIO
from dota2py import api
import Image
if ___name__ == "__main__":
if not os.path.exists("../data/images"):
os.makedirs("../data/images")
os.chdir("../data/images")
scale = 50/1080.0
for hero in api.get_heroes()["result"]["heroes"]:
if "abyssal_underlord" in hero["name"]:
... | {
"content_hash": "33aa4ad086555f974fb7ee3534ee7f7d",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 127,
"avg_line_length": 35.85,
"alnum_prop": 0.6276150627615062,
"repo_name": "GuitaringEgg/CounterPyck",
"id": "a34207b8bccbde7393ddcbab420fed17194b7534",
"size": "717",
... |
"""Referral Whois."""
| {
"content_hash": "d6e9a803f444d1dbc2e431ee27bad26d",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 21,
"avg_line_length": 22,
"alnum_prop": 0.5909090909090909,
"repo_name": "cloudify-cosmo/softlayer-python",
"id": "ef14d68803883cff0772ac45f71704c716910cbc",
"size": "22",
... |
"""A class that performs HTTP-01 challenges for Nginx"""
import io
import logging
from typing import Any
from typing import List
from typing import Optional
from typing import TYPE_CHECKING
from certbot_nginx._internal import nginxparser
from certbot_nginx._internal.obj import Addr
from acme import challenges
from a... | {
"content_hash": "2041d9dff73cb3266b9c1d945d89e03c",
"timestamp": "",
"source": "github",
"line_count": 243,
"max_line_length": 99,
"avg_line_length": 40.358024691358025,
"alnum_prop": 0.6131334760885082,
"repo_name": "letsencrypt/letsencrypt",
"id": "9b086d42950faee79647b932007baaaa606462d4",
"siz... |
#from email.mime.base import MIMEBase
from django.conf import settings
from django.core.mail import EmailMultiAlternatives
from django.template.loader import select_template
from django.template import Context, RequestContext, TemplateDoesNotExist
class EmailMultiRelated(EmailMultiAlternatives):
"""
... | {
"content_hash": "3b55ca1c94ce2473a7441531fa417c62",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 192,
"avg_line_length": 48.036866359447004,
"alnum_prop": 0.6534919416730621,
"repo_name": "baskoopmans/djcommon",
"id": "1323e0ad2611f12744bdf3acb79cba30fe8b169a",
"size"... |
from __future__ import unicode_literals
import time
from django.core import signing
from django.http import HttpRequest, HttpResponse
from django.test import TestCase, override_settings
class SignedCookieTest(TestCase):
def test_can_set_and_read_signed_cookies(self):
response = HttpResponse()
r... | {
"content_hash": "2cbd0f98ea99784b48346d90f7161609",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 79,
"avg_line_length": 38.61643835616438,
"alnum_prop": 0.6200780418588152,
"repo_name": "helenst/django",
"id": "ff8fe76bf6ad9f02e52d9a2b88e39cc063363ab2",
"size": "2819",... |
from onnxruntime.capi._pybind_state import get_model_after_loading_checkpoint as _internal_load_checkpoint_to_model
from onnxruntime.capi._pybind_state import save_checkpoint as _internal_save_checkpoint
def save_checkpoint(parameters, path_to_checkpoint):
"""Saves the parameters to the checkpoint directory path_... | {
"content_hash": "ba710719be5a27b1f1bde3dff4eb1a08",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 115,
"avg_line_length": 49.72727272727273,
"alnum_prop": 0.7696526508226691,
"repo_name": "microsoft/onnxruntime",
"id": "b94d7dd052c185fc84abd9f3502f9f9e00418970",
"size":... |
import os
import time
from config import MEM_SAVE_PATH, FREE_SIZE, SAVE_PATH, LAST_FILE, MAX_LOCK_WAIT, LOCK
__author__ = 'ihciah'
def clean_env():
to_delete = ['/dev/shm/mmssms.db', '/dev/shm/mmssms.db-journal',
'/tmp/mmssms.db', '/tmp/mmssms.db-journal']
for f in to_delete:
if os.... | {
"content_hash": "3a516ea2962ffb3517e5762771a0144c",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 86,
"avg_line_length": 24.438356164383563,
"alnum_prop": 0.5285874439461884,
"repo_name": "ihciah/AndroidSMSRelay",
"id": "b717c3a71f98552d314d2af1eda0c76ce52df2cf",
"size"... |
def filter_list(lst):
return filter(lambda a: isinstance(a, int), lst)
| {
"content_hash": "05f20b68776c1fa80697898466303b9e",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 52,
"avg_line_length": 37.5,
"alnum_prop": 0.6933333333333334,
"repo_name": "the-zebulan/CodeWars",
"id": "efa6f7c7e04119f8c3d18358c963c74d7bf8a063",
"size": "75",
"binary... |
import unittest
import config
import mle
import thread_cert
from pktverify.consts import MLE_CHILD_ID_RESPONSE, ADDR_QRY_URI, ADDR_NTF_URI, NL_TARGET_EID_TLV
from pktverify.packet_verifier import PacketVerifier
LEADER = 1
ROUTER = 2
MED = 3
SED = 4
MTDS = [MED, SED]
# Test Purpose and Description:
# ---------------... | {
"content_hash": "269137e49af161b142a102ff25a8c8dc",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 97,
"avg_line_length": 29.935064935064936,
"alnum_prop": 0.5689804772234274,
"repo_name": "srickardti/openthread",
"id": "abb9e8cdd4a01e28ec34c3cea2dc782cf57d4bc6",
"size"... |
from block import *
import time
from logging import ERROR, WARN, INFO, DEBUG
class counter(Block):
def do_task(self):
for i in range(20):
log = Log()
log.log["value"] = [self.count]
self.log(INFO, "Sending " + str(self.count))
self.push("output", log)
self.count = self.count + 1
... | {
"content_hash": "ddfdb5755a237e4343e7dd424d38e8ab",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 63,
"avg_line_length": 26.736842105263158,
"alnum_prop": 0.6141732283464567,
"repo_name": "mpi-sws-rse/datablox",
"id": "19f82a1a8045869f4cbe82024fbbd7f41cbfe959",
"size": ... |
from parglare import Grammar, GLRParser
def test_regex_alternative_match_bug():
"""
"""
grammar = """
A: "Begin" Eq "End";
terminals
Eq: /=|EQ/;
"""
g = Grammar.from_string(grammar)
parser = GLRParser(g)
parser.parse('Begin EQ End')
| {
"content_hash": "8dbf3422c1d9195dbff6015e1345ca69",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 39,
"avg_line_length": 17.3125,
"alnum_prop": 0.5703971119133574,
"repo_name": "igordejanovic/parglare",
"id": "99612783b16e93771ec3c1c970319d9ef909339e",
"size": "277",
... |
'''
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
tests.unit.utils.warnings_test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Test ``salt.utils.warn_until`` and ``salt.utils.kwargs_warn_until``
'''
# Import python libs
from __future__ import absolute_import
import sys
import warnings
# Import Salt Tes... | {
"content_hash": "3ab7627a725b331b9d97c33413636911",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 87,
"avg_line_length": 41.146198830409354,
"alnum_prop": 0.5596930073905628,
"repo_name": "stephane-martin/salt-debian-packaging",
"id": "2fd94e17ccf3a2b27f918ad4a2034cd90bd... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.