text stringlengths 4 1.02M | meta dict |
|---|---|
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat.mock import patch
from ansible.modules.network.onyx import onyx_vxlan
from units.modules.utils import set_module_args
from .onyx_module import TestOnyxModule, load_fixture
class TestOnyxVxlanModule(TestOnyxModul... | {
"content_hash": "7f0259c00c4864af4036390c8c094ec5",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 107,
"avg_line_length": 52.291666666666664,
"alnum_prop": 0.6256972111553785,
"repo_name": "thaim/ansible",
"id": "5800d0fda7198f6adc4a42f9e7918239b1a29b76",
"size": "5176"... |
"""
Gole topology parser.
Author: Henrik Thostrup Jensen <[email protected]>
Jeroen van der Ham <[email protected]>
Copyright: NORDUnet (2011-2012)
"""
import re
import StringIO
from xml.etree import ElementTree as ET
from twisted.python import log
from opennsa import nsa, error
from opennsa.topology import topolog... | {
"content_hash": "d96bb10a6f5c9ed1c390f8220acdb05c",
"timestamp": "",
"source": "github",
"line_count": 288,
"max_line_length": 135,
"avg_line_length": 35.545138888888886,
"alnum_prop": 0.583667089967764,
"repo_name": "jeroenh/OpenNSA",
"id": "021367f1844bc9f05a1c17ee69c4b08e43cddafd",
"size": "102... |
from twisted.internet.defer import Deferred
from axiom.test.historic.stubloader import StubbedTest
from axiom.test.historic.stub_processor1to2 import DummyProcessor
class ProcessorUpgradeTest(StubbedTest):
def setUp(self):
# Ick, we need to catch the run event of DummyProcessor, and I can't
# thin... | {
"content_hash": "282073cca1fbc802663884d496dcde86",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 79,
"avg_line_length": 34.76923076923077,
"alnum_prop": 0.6806784660766961,
"repo_name": "twisted/axiom",
"id": "d9affc35f44c505d834b26cbc4062a1bc1b99675",
"size": "1357",
... |
from django.db import models
class Settings(models.Model):
address = models.TextField(verbose_name='Server address')
port = models.IntegerField(verbose_name='Server port')
| {
"content_hash": "a4c0249b69cb969c41cbb8dea75a4127",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 61,
"avg_line_length": 30.333333333333332,
"alnum_prop": 0.7527472527472527,
"repo_name": "chyla/slas",
"id": "28d3f5c7d504b914e9736febcab62d889578bab8",
"size": "207",
"b... |
from jupyter_client.client import *
| {
"content_hash": "a001d62d00fbeb0f1ef4e77e5d8c5e3d",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 35,
"avg_line_length": 36,
"alnum_prop": 0.8055555555555556,
"repo_name": "bdh1011/wau",
"id": "a98690b74cc408238aa6ceb4e7e09aba7c999fa3",
"size": "36",
"binary": false,
... |
"""Representation for the MongoDB internal MaxKey type.
"""
from typing import Any
class MaxKey(object):
"""MongoDB internal MaxKey type."""
__slots__ = ()
_type_marker = 127
def __getstate__(self) -> Any:
return {}
def __setstate__(self, state: Any) -> None:
pass
def __eq... | {
"content_hash": "ef8e564d8efef1b6eb2124e85d8b3bcb",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 55,
"avg_line_length": 21.658536585365855,
"alnum_prop": 0.5506756756756757,
"repo_name": "mongodb/mongo-python-driver",
"id": "b4f38d072eb509459464c016de74c9ac2ce0e89d",
"... |
import sys, cbor, json
from subprocess import Popen, PIPE, STDOUT
## emulate 'jq' argument pattern
## no options for now
fltr=sys.argv[1]
try:
input=sys.argv[2]
except IndexError:
input=sys.stdin
with open(input, 'rb') as f:
data = json.dumps(cbor.load(f))
p = Popen(['jq', fltr], stdout=PIPE, stdin=... | {
"content_hash": "0024996bf1d1c4348ef99a92113019ca",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 79,
"avg_line_length": 26.333333333333332,
"alnum_prop": 0.6629746835443038,
"repo_name": "usc-isi-i2/dig-tools",
"id": "a31c5f6d04501435598ce77bab44a59df509399f",
"size": ... |
from JumpScale.clients.racktivity.energyswitch.common import convert
from JumpScale.clients.racktivity.energyswitch.common.GUIDTable import Value
from JumpScale.clients.racktivity.energyswitch.modelfactory.models.common.Master_0_1_2_16 import Model as Master
class Model(Master):
def __init__(self, parent):
... | {
"content_hash": "271df091632ba7de0e99c0383b5ec43c",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 112,
"avg_line_length": 40.779661016949156,
"alnum_prop": 0.6579384871155445,
"repo_name": "Jumpscale/jumpscale_core8",
"id": "8626d9cbe85850e094c91cc4d6fde86f2f46540a",
"s... |
from __future__ import absolute_import # to enable import io from stdlib
from collections import defaultdict, deque
import errno
from functools import wraps, partial
from heapq import heappush, heappop
import io
import logging
import six
from six.moves import range
import socket
import struct
import sys
from threading... | {
"content_hash": "614002caca83102b9b2922ad6d300185",
"timestamp": "",
"source": "github",
"line_count": 1045,
"max_line_length": 196,
"avg_line_length": 37.65071770334928,
"alnum_prop": 0.5769220993773033,
"repo_name": "tempbottle/python-driver",
"id": "32ffa85710167cd92d199e470672b8a725d7a24b",
"s... |
import sys
from twisted.internet import reactor
from twisted.python import log
from twisted.web.server import Site
from twisted.web.static import File
from autobahn.twisted.websocket import WebSocketServerProtocol, \
WebSocketServerFactory, \
listenWS
from autobahn.websocket.compress import PerMessageDeflate... | {
"content_hash": "5d406062092e7ee33305dd585ba76781",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 89,
"avg_line_length": 26.48076923076923,
"alnum_prop": 0.7167755991285403,
"repo_name": "Jenselme/AutobahnPython",
"id": "ffd61150d98690901dc27a7fc6c122dc18c8e43e",
"size"... |
from haystack.utils.geo import Point, Distance
def point_from_lat_long(value):
if isinstance(value, Point):
return value
if isinstance(value, basestring):
lat, lng = value.split(',')
elif isinstance(value, (list, tuple)):
lat, lng = value
else:
raise ValueError("I don't... | {
"content_hash": "b1d707f6edafc71c253de740298fc299",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 62,
"avg_line_length": 29.4,
"alnum_prop": 0.6244897959183674,
"repo_name": "apnarm/django-apn-search",
"id": "df00ce81be255c9b60cfa8ee0dd72bfae80312f6",
"size": "735",
"... |
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module that will appear in module menus
'Name': 'SSHCommand',
# list of one or more a... | {
"content_hash": "e0b9ead781a1bc2c0e0f20ce54a8d74c",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 127,
"avg_line_length": 31.515873015873016,
"alnum_prop": 0.5021405187610174,
"repo_name": "api0cradle/Empire",
"id": "39ec4d2bb0652e5370d63eb6f225d3d3ea224619",
"size": "... |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations ... | {
"content_hash": "f45d662429e03aa9b9eb07d4eb0e246a",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 130,
"avg_line_length": 44.05769230769231,
"alnum_prop": 0.5766041030117852,
"repo_name": "Oriwiki/DuckPy",
"id": "bd4e524003590815b6fa40200f9836f18346e00c",
"size": "2364"... |
import pathlib
import typing
from clize import Clize, run, converters # type: ignore
def main(
# The ideal case: Clize and mypy understand the same annotation
same_annotation_for_both_str: str,
same_annotation_for_both_converter: pathlib.Path,
*,
# Unfortunately, Clize doesn't understand typing.... | {
"content_hash": "48d118f610ce4bb5bfd1d9dc5ce7e914",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 108,
"avg_line_length": 39.77272727272727,
"alnum_prop": 0.6948571428571428,
"repo_name": "epsy/clize",
"id": "8af7d75ba440d8f5b81e37a59696a7fed0a2f5fa",
"size": "1750",
... |
from django.db import models
from daiquiri.core.managers import AccessLevelManager
from daiquiri.jobs.managers import JobManager
class QueryJobManager(JobManager):
def get_size(self, user):
# get the size of all the tables of this user
return self.filter_by_owner(user).exclude(phase=self.model.P... | {
"content_hash": "85ad845e2f69a1fcb789d7bc77a72829",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 130,
"avg_line_length": 27.3125,
"alnum_prop": 0.7505720823798627,
"repo_name": "aipescience/django-daiquiri",
"id": "f786e0411807df4a2117109ad65e09f10eacef6b",
"size": "43... |
from heat.common.i18n import _
from heat.engine import clients
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
from heat.engine import support
class MonascaAlarmDefinition(resource.Resource):
"""Heat Template Resource for Monasca Alarm definition.
This ... | {
"content_hash": "350b60ca971d6f2822f4cf00d1322642",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 79,
"avg_line_length": 33.896907216494846,
"alnum_prop": 0.5799878345498783,
"repo_name": "pratikmallya/heat",
"id": "063a6e1cd5efd015390f42c893ddb0bcefa275bd",
"size": "7... |
import os
import random
import struct
import unittest2
from mock import MagicMock, patch
from kafka import KafkaClient
from kafka.common import (
ProduceRequest, BrokerMetadata, PartitionMetadata,
TopicAndPartition, KafkaUnavailableError,
LeaderUnavailableError, PartitionUnavailableError
)
from kafka.prot... | {
"content_hash": "4251bc2c73aa4c7a01c6d68f1a08375e",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 103,
"avg_line_length": 40.22489959839358,
"alnum_prop": 0.6129193290734825,
"repo_name": "jerluc/kafka-python",
"id": "fe9beff26bce558a70a7cd89df31a5bba33ca855",
"size": ... |
class AppSettings(object):
class AuthenticationMethod:
USERNAME = 'username'
EMAIL = 'email'
USERNAME_EMAIL = 'username_email'
class EmailVerificationMethod:
# After signing up, keep the user account inactive until the email
# address is verified
MANDATORY = 'ma... | {
"content_hash": "0aa5e6e9512c9127739eab5f98e185a3",
"timestamp": "",
"source": "github",
"line_count": 326,
"max_line_length": 79,
"avg_line_length": 31.49079754601227,
"alnum_prop": 0.6043249561659848,
"repo_name": "pztrick/django-allauth",
"id": "a69fd5b77d062a1894b9617d09eca14f46f29f80",
"size"... |
from __future__ import division
class ThumbnailTool(object):
def avatar_thumbnail(self):
pass
# 按长边,指定缩放倍数等比例缩放
@classmethod
def constrain_thumbnail(cls, img, times=2):
width, height = img.size
# 按给定的倍数缩放
img.thumbnail((width//times, height//times))
return img... | {
"content_hash": "486c1290ffcc44e8d8f04d564a73d7dd",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 52,
"avg_line_length": 23.838709677419356,
"alnum_prop": 0.5615696887686062,
"repo_name": "zer0Black/zer0Blog",
"id": "42fc1990ee1a414a684e3f799f9c1b224cb4bd97",
"size": "8... |
"""
Files views.
"""
from flask import request
from website.util import rubeus
from website.project.decorators import must_be_contributor_or_public, must_not_be_retracted_registration
from website.project.views.node import _view_project
@must_not_be_retracted_registration
@must_be_contributor_or_public
def collect_f... | {
"content_hash": "8a07e6a6d46c86c7bc3b48af164b9f93",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 104,
"avg_line_length": 32,
"alnum_prop": 0.7291666666666666,
"repo_name": "crcresearch/osf.io",
"id": "2ba34a35307d09576e5fe29db81e1dafae499496",
"size": "864",
"binary"... |
from django.utils import timezone
# Django stuff
from Instanssi.kompomaatti.misc.events import get_upcoming
from Instanssi.screenshow.models import IRCMessage
from Instanssi.kompomaatti.models import Event
def django_get_event(event_id):
try:
return Event.objects.get(pk=event_id)
except Event.DoesNot... | {
"content_hash": "0da62b04ce9432dad9529a8d80810ca5",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 58,
"avg_line_length": 23,
"alnum_prop": 0.6390293225480284,
"repo_name": "Instanssi/KompomaattiBot",
"id": "f39d0c75092ac355c35c58e8305a9bbd78ea3f4e",
"size": "1026",
"b... |
from __future__ import (
absolute_import, division, print_function, with_statement
)
from contextlib import contextmanager
from gevent import GreenletExit
@contextmanager
def ignored(*exceptions):
try:
yield
except GreenletExit as e:
raise e
except exceptions:
pass
| {
"content_hash": "500a2c0b3b2c5010faf7bf20192b3279",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 61,
"avg_line_length": 20.533333333333335,
"alnum_prop": 0.698051948051948,
"repo_name": "fcwu/docker-ubuntu-vnc-desktop",
"id": "e1198615918814eba657641e88693adee36cbd3b",
... |
"""Helper module for uploading solve status posts to SolveTracker repository."""
import json
import datetime
from util.githandler import GitHandler
from util.ctf_template_resolver import resolve_ctf_template, resolve_stats_template
from util.loghandler import log
from bottypes.invalid_command import InvalidCommand
ST_... | {
"content_hash": "49fcb1ad313f4c118daf03ebb922020b",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 113,
"avg_line_length": 38.42372881355932,
"alnum_prop": 0.6704896338773709,
"repo_name": "OpenToAllCTF/OTA-Challenge-Bot",
"id": "bd022283ef748de5921f4479428dd2970a04acf9",
... |
import re
def commands():
"""Returns the list of commands that this plugin handles.
"""
return [
{
'type':'text',
'triggers':[re.compile('.*')],
'field':'text'
}
]
def process(status):
return "%s: %s" %(status['user... | {
"content_hash": "9105d28793a2fb34c6abbf09057047a7",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 68,
"avg_line_length": 22.5,
"alnum_prop": 0.4388888888888889,
"repo_name": "sengupta/spritzbot",
"id": "3645056244801ad29680c2574a0e89811460e0fa",
"size": "360",
"binary... |
from oslo_log import log as logging
from trove.common import cfg
from trove.common import exception
from trove.common.i18n import _
from trove.common import instance as rd_instance
from trove.common import utils as utils
from trove.guestagent.common import operating_system
from trove.guestagent.datastore.experimental.... | {
"content_hash": "99fe8dcca211ea6651d640e31517f294",
"timestamp": "",
"source": "github",
"line_count": 425,
"max_line_length": 79,
"avg_line_length": 39.06588235294117,
"alnum_prop": 0.5191230500511955,
"repo_name": "cp16net/trove",
"id": "eccc8175f84b5cce9c7f08e37fb15ec03b1e3ac8",
"size": "17228"... |
"""
Created on Thu Jul 27 10:23:21 2017
@author: casari
"""
import sys, os, time, glob, serial
class SerialPort:
def __init__(self):
self.serial = serial.Serial()
self.serial.baudrate = 9600
self.portnames = []
self.timeout = 0.1
... | {
"content_hash": "9464bac10103559486f6f2af2e2e5e51",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 83,
"avg_line_length": 24.129411764705882,
"alnum_prop": 0.5163334958556801,
"repo_name": "MCasari-PMEL/EDD-ICMGUI",
"id": "6cd9ec19f52de226d86ebff8ea875ec05d2843bf",
"size... |
import os
from numpy import array,zeros,ndarray,around,sqrt,arange
from numpy.linalg import norm
from developer import DevBase
from generic import obj
from structure import Structure
from plotting import *
class DensityAnalyzer(DevBase):
def __init__(self,densfile=None,denserrfile=None,transpose=False):
d... | {
"content_hash": "48ebe235d30b0139d330cd92f4029046",
"timestamp": "",
"source": "github",
"line_count": 265,
"max_line_length": 162,
"avg_line_length": 33.06792452830189,
"alnum_prop": 0.4728974095629351,
"repo_name": "habanero-rice/hclib",
"id": "538f17aa6bef958c4aa3d7e5d56b2259a53f1d0d",
"size": ... |
from ftplib import FTP
import StringIO
ftp = FTP('hanna.ccmc.gsfc.nasa.gov') # connect to host, default port
ftp.login() # user anonymous, passwd anonymous@
ftp.cwd('pub/FlareScoreboard/in/UFCORIN_1') # change into "debian" directory
str_file = StringIO.StringIO("hello")
#ftp.stor... | {
"content_hash": "327e37fe307f431765f82e09823ac697",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 90,
"avg_line_length": 35.95,
"alnum_prop": 0.674547983310153,
"repo_name": "nushio3/UFCORIN",
"id": "c9f0947e29d43c676550b238b83fc6a8b572166a",
"size": "742",
"binary": ... |
from django.conf import settings
from django import shortcuts
import django.views.decorators.vary
import horizon
from horizon import base
from horizon import exceptions
from horizon import notifications
MESSAGES_PATH = getattr(settings, 'MESSAGES_PATH', None)
def get_user_home(user):
dashboard = None
if us... | {
"content_hash": "013cb1bf908d8ea864342bbb0d8a71d5",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 74,
"avg_line_length": 27.7,
"alnum_prop": 0.7184115523465704,
"repo_name": "davidcusatis/horizon",
"id": "365e47a4eb5e965965d7a96806d4682e68d2189f",
"size": "1713",
"bin... |
import bluebottle.utils.fields
import bluebottle.utils.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('members', '0045_auto_20210708_1020'),
]
operations = [
migrations.AlterField(
... | {
"content_hash": "d34caa8140f2e3a368322fd7030c4eb1",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 313,
"avg_line_length": 49.1875,
"alnum_prop": 0.6331003811944091,
"repo_name": "onepercentclub/bluebottle",
"id": "4b6ddd276d1338301d7b85bf778eb621f22a6542",
"size": "3198... |
from PyInstaller.hooks.hookutils import eval_statement
hiddenimports = ["PyQt5.QtCore",
"PyQt5.QtWidgets",
"PyQt5.QtGui",
"PyQt5.QtSvg"]
if eval_statement("from PyQt5 import Qwt5; print hasattr(Qwt5, 'toNumpy')"):
hiddenimports.append("numpy")
if eval_statement("... | {
"content_hash": "1a99703f34f94289397ab4714bc1423a",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 79,
"avg_line_length": 41,
"alnum_prop": 0.6735459662288931,
"repo_name": "timeyyy/PyUpdater",
"id": "22747a703da37a6a528094fe22a40872948fe2f0",
"size": "938",
"binary": ... |
from anvil import Anvil
from anvil.entities import KilnRepo
def main():
anvil = Anvil("spectrum")
anvil.create_session_by_prompting()
res = anvil.get_json("/Repo/68219")
repo = KilnRepo.from_json(anvil, res)
subrepos = repo.where_used()
if __name__ == '__main__':
main()
| {
"content_hash": "8aee301b27d007a831c6c278fa5134ea",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 41,
"avg_line_length": 24.75,
"alnum_prop": 0.6464646464646465,
"repo_name": "luigiberrettini/Anvil",
"id": "5af9fc408d2d867e3e6628f4cd5dc2a1a76eebb4",
"size": "298",
"bi... |
import pandas
import os
import utilities
def summarize_flight_history_day(base_day_path, test_day_path = None):
path = os.path.join(base_day_path, "FlightHistory", "flighthistory.csv")
flighthistory = pandas.read_csv(path)
print "In file %s:" % path
print "Number of flight_history_ids: %d, Number unique: %d" % (le... | {
"content_hash": "5dea13e682172ad28187ddf5f11e6db5",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 183,
"avg_line_length": 37.875,
"alnum_prop": 0.7392739273927392,
"repo_name": "benhamner/GEFlightQuest",
"id": "351875757925cb204be23148b9f90041aeb8215b",
"size": "2121",
... |
import os
import sys
import imp
from .collection import Collection
from .exceptions import CollectionNotFound
from .util import debug
DEFAULT_COLLECTION_NAME = 'tasks'
class Loader(object):
"""
Abstract class defining how to load a session's base `.Collection`.
"""
def find(self, name):
"""... | {
"content_hash": "c1ca72ffd0bd727006cb0bce9f91bf23",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 79,
"avg_line_length": 35.463157894736845,
"alnum_prop": 0.6147224695755417,
"repo_name": "singingwolfboy/invoke",
"id": "7e37f4e050c39be238d0fbce92452f4226acb9a1",
"size":... |
from __future__ import unicode_literals
import datetime
import re
import sys
from unittest import skipIf
import warnings
from xml.dom.minidom import parseString
try:
import pytz
except ImportError:
pytz = None
from django.core import serializers
from django.core.urlresolvers import reverse
from django.db.mod... | {
"content_hash": "47b2f5a2a971475682bd3d733af14f4a",
"timestamp": "",
"source": "github",
"line_count": 1150,
"max_line_length": 144,
"avg_line_length": 47.89739130434783,
"alnum_prop": 0.6138121346356341,
"repo_name": "frederick-masterton/django",
"id": "d16c7f7fd27cbf3053185a5ffd4bb1ec437374f7",
... |
import ctypes
import os, sys
# The plugin .so file has to be loaded at global scope and before `import torch` to avoid cuda version mismatch.
NMS_OPT_PLUGIN_LIBRARY="build/plugins/NMSOptPlugin/libnmsoptplugin.so"
if not os.path.isfile(NMS_OPT_PLUGIN_LIBRARY):
raise IOError("{}\n{}\n".format(
"Failed to loa... | {
"content_hash": "d3ee8b91c46704060bf1f21c9c07f366",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 130,
"avg_line_length": 37.22047244094488,
"alnum_prop": 0.6069388618574149,
"repo_name": "mlperf/inference_results_v0.5",
"id": "961e3c2d6d47fdd603d40595c7943534ea769747",
... |
import os
import os.path
import tempfile
import subprocess
def generate_credentials(ip, cakeystore=None, cacert=None):
tmpdir = tempfile.mkdtemp()
if not cakeystore:
cakeystore = generate_cakeypair(tmpdir, 'ca')
if not cacert:
cacert = generate_cert(tmpdir, "ca", cakeystore)
# creat... | {
"content_hash": "6ba22a351aacd685ce7d43437b16fb98",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 125,
"avg_line_length": 33.4,
"alnum_prop": 0.6194278110445776,
"repo_name": "spodkowinski/cassandra-dtest",
"id": "ed90a835582a29e50a825ed28c41feaa642f6d66",
"size": "3006... |
import time
from myModbus_udp import *
class ModbusUDPClient():
def __init__( self, address ):
self.instrument = Instrument_UDP() # 10 is instrument address
self.instrument.debug = None
self.instrument.set_ip(address)
def read_bit(self, modbus_address, registeraddress ):... | {
"content_hash": "555042adba766c5139f9a38de029f282",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 130,
"avg_line_length": 42.74251497005988,
"alnum_prop": 0.6590081255253573,
"repo_name": "glenn-edgar/local_scda",
"id": "826fa41af733d8f8bfc332438ebbf21209851d17",
"size... |
from django.db import models
class pharmacy(models.Model):
pharmacy_id = models.CharField(max_length=20,primary_key=True)
pharmacy_name = models.CharField(max_length=200)
password = models.CharField(max_length=20)
owner_fname = models.CharField(max_length=50)
owner_lname = models.CharField(max_leng... | {
"content_hash": "654849ff0bde4144dfd7c12398ca0e01",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 72,
"avg_line_length": 39.375,
"alnum_prop": 0.7386243386243386,
"repo_name": "mpiplani/Online-Pharmacy",
"id": "cb9f68ea7754fcf7360d0d2dde71991127352f9f",
"size": "945",
... |
"""
TNC: A Python interface to the TNC non-linear optimizer
TNC is a non-linear optimizer. To use it, you must provide a function to
minimize. The function must take one argument: the list of coordinates where to
evaluate the function; and it must return either a tuple, whose first element is the
value of the function... | {
"content_hash": "0a33a9463321aae8bdc893104fb5afad",
"timestamp": "",
"source": "github",
"line_count": 420,
"max_line_length": 84,
"avg_line_length": 37.81428571428572,
"alnum_prop": 0.6076060949502582,
"repo_name": "aeklant/scipy",
"id": "44bc996213b8b1bd94b9371a10155fdf53a26dd2",
"size": "17086"... |
from __future__ import unicode_literals
import frappe
from frappe.utils import formatdate, fmt_money, flt, cstr, cint, format_datetime
from frappe.model.meta import get_field_currency, get_field_precision
import re
def format_value(value, df, doc=None, currency=None):
# Convert dict to object if necessary
if (isinst... | {
"content_hash": "b4c85bb1a50ac1b501b9efb51d1d5fee",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 105,
"avg_line_length": 29.127659574468087,
"alnum_prop": 0.6800584368151936,
"repo_name": "mbauskar/omnitech-frappe",
"id": "1d2b1783cbe796b727a4f13146916748012636e6",
"si... |
from .core import Migration
from .core.exceptions import MigrationException
from .helpers import Utils
class MSSQL(object):
def __init__(self, config=None, mssql_driver=None):
self.__mssql_script_encoding = config.get("database_script_encoding", "utf8")
self.__mssql_encoding = config.get("database... | {
"content_hash": "8ff83883a7502a1b03b5713449de37c4",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 311,
"avg_line_length": 46.39784946236559,
"alnum_prop": 0.5841251448435689,
"repo_name": "guilhermechapiewski/simple-db-migrate",
"id": "6a6bd59e37fa8fe6e7ada0e75ee130ded4e... |
import unittest
from katas.kyu_8.barking_mad import Dog
class DogTestCase(unittest.TestCase):
def test_equals(self):
self.assertEqual(Dog("Beagle").bark(), 'Woof')
def test_equals_2(self):
self.assertEqual(Dog("Great Dane").bark(), 'Woof')
def test_equals_3(self):
self.assertEqu... | {
"content_hash": "b10f5df9cf3af5b908081853c9e3aebb",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 58,
"avg_line_length": 25.428571428571427,
"alnum_prop": 0.6544943820224719,
"repo_name": "the-zebulan/CodeWars",
"id": "893dd7be51d2a5d8c0a1af2f45f990ffddd5bbf4",
"size": ... |
import cgi
import flask
import random
import urllib
# [START taskq-imp]
from google.appengine.ext import ndb
from google.appengine.api import taskqueue
# [END taskq-imp]
class Note(ndb.Model):
"""Models an individual Note entry with content."""
content = ndb.StringProperty()
def parent_key(page_name):
r... | {
"content_hash": "1a3f7160f2ec1f04b41de74130c6ec9f",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 111,
"avg_line_length": 27.873563218390803,
"alnum_prop": 0.6090721649484536,
"repo_name": "googlearchive/datastore-samples",
"id": "6f06bc067ff4b5a7ae0d4942e6bd42f20b61f8de... |
import ast
import sys
import os
####################################################################################################################################################################################################################################
##########################################################... | {
"content_hash": "9658804427e5cdef4ba4d1a2ad356964",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 228,
"avg_line_length": 63.66463414634146,
"alnum_prop": 0.3746767551000862,
"repo_name": "dimtion/jml",
"id": "f9686094d12715255d74d2e32960099aa168037e",
"size": "11276",... |
app_name = "frappe"
# app_title = "Frappe Framework"
app_title = "LetzERP"
# app_publisher = "Web Notes Technologies Pvt. Ltd."
app_publisher = "LetzERP Pvt. Ltd."
app_description = "Full Stack Web Application Framework in Python"
app_icon = "assets/frappe/images/LetzERP.svg"
app_version = "5.0.0-alpha"
app_color = "#3... | {
"content_hash": "69ec0d0645d500fb19b8aad95ddeb42e",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 86,
"avg_line_length": 32.4468085106383,
"alnum_prop": 0.7288524590163934,
"repo_name": "gangadharkadam/letzfrappe",
"id": "d1d63e7645d769f7b3df1477968992fdb37b5374",
"size... |
import codecs
import functools
import json
import os
import sys
import time
import socket
import redis
import logging
import signal
import aioredis
import asyncio
def noop(i):
return i
def env(identifier, default, type=noop):
return type(os.getenv("SINGLE_BEAT_%s" % identifier, default))
class Config(obje... | {
"content_hash": "c408bb5c02ea51675fdebaf18dedb01b",
"timestamp": "",
"source": "github",
"line_count": 508,
"max_line_length": 111,
"avg_line_length": 32.74409448818898,
"alnum_prop": 0.5611999519057352,
"repo_name": "ybrs/single-beat",
"id": "89aee9a82cb4ac101b90442c846a719b94eef8bf",
"size": "16... |
import math
import unittest
from rx import Observable
from rx.testing import TestScheduler, ReactiveTest, is_prime, MockDisposable
from rx.disposables import Disposable, SerialDisposable
on_next = ReactiveTest.on_next
on_completed = ReactiveTest.on_completed
on_error = ReactiveTest.on_error
subscribe = ReactiveTest.s... | {
"content_hash": "ae96849c36900eaf68673d0721dda9a8",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 99,
"avg_line_length": 34.6231884057971,
"alnum_prop": 0.6596902469652575,
"repo_name": "dbrattli/RxPY",
"id": "206d9781bb96418fa27dcb4f0b37a3dc8adbcf3c",
"size": "2389",
... |
import collections
from . import machines
from . import syntax
__all__ = ['Graph', 'from_graph', 'write_dot', 'read_tgf', 'to_graph', 'Editor']
class Graph:
"""A directed graph. Both nodes and edges can have a `dict` of attributes.
Nodes can be any object that implements `__hash__` and `__eq__`.
If `g` ... | {
"content_hash": "c2b794e0ec659a0f79e26a95d98792ee",
"timestamp": "",
"source": "github",
"line_count": 529,
"max_line_length": 155,
"avg_line_length": 36.226843100189036,
"alnum_prop": 0.48121477770820287,
"repo_name": "ND-CSE-30151/tock",
"id": "ecc5f8773016908c29a1115fb2944d9d174fe5b7",
"size": ... |
try:
# Python 2.7
from collections import OrderedDict
except:
# Python 2.6
from gluon.contrib.simplejson.ordered_dict import OrderedDict
from gluon import current
from gluon.storage import Storage
def config(settings):
"""
Template settings for CERT (Community Emergency Response Teams)
... | {
"content_hash": "a194b7395ef1c9a964025235d9e35d84",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 151,
"avg_line_length": 40.056497175141246,
"alnum_prop": 0.5451339915373766,
"repo_name": "sahana/Turkey",
"id": "989c2805cbb577f441ec93e49215acbaaf7ea3b1",
"size": "7115... |
from .identifier import Identifier
from .declaration import Declaration
from .vardeclarator import VarDeclarator
from .parameter import Parameter
from .functiondef import FunctionDef
| {
"content_hash": "d03482ee7415bdc8975458d50d83b153",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 40,
"avg_line_length": 36.6,
"alnum_prop": 0.8633879781420765,
"repo_name": "andaviaco/tronido",
"id": "e0859f728458e6ae5d22f86b2fca49fbf53b5151",
"size": "183",
"binary":... |
import mock
from oslo_config import cfg
from mistral.actions import std_actions
from mistral.db.v2 import api as db_api
from mistral import exceptions as exc
from mistral.services import workbooks as wb_service
from mistral.tests.unit.engine import base
from mistral.workflow import states
# Use the set_default metho... | {
"content_hash": "efca41415576e8a88002efcf780e9fd1",
"timestamp": "",
"source": "github",
"line_count": 519,
"max_line_length": 79,
"avg_line_length": 36.190751445086704,
"alnum_prop": 0.5993717723473354,
"repo_name": "dennybaa/mistral",
"id": "d9a5cd58ba40677d9555d103da3890bbe59d9233",
"size": "19... |
import tornado
from tornado.websocket import WebSocketHandler
from tornado.web import RequestHandler, Application, url
import tornadis
clients = []
class GetHandler(RequestHandler):
@tornado.gen.coroutine
def get(self):
self.render("websocket.html")
class WSHandler(WebSocketHandler):
@tornad... | {
"content_hash": "343b780e14c7b39e5c557c9f0dec4a53",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 68,
"avg_line_length": 22.54,
"alnum_prop": 0.639751552795031,
"repo_name": "thefab/tornadis",
"id": "edea9a9466423f02dd4923d271d9f6b83c4773f3",
"size": "1127",
"binary":... |
import MSService
import MSMessage
import MSSession
import MSModule
import MSTaskManager
import time
import math
class MSModuleAccount(MSModule.Module):
def __init__(self, network, dbMgr, svrDispatcher, sesTransfer):
super(MSModuleAccount, self).__init__(MSService.SERVICE_PLAYER_ACCOUNT, network, dbMgr, svrDispatche... | {
"content_hash": "59739b9b1760b559f76e3843d8cb093a",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 161,
"avg_line_length": 35.68055555555556,
"alnum_prop": 0.6923575969897495,
"repo_name": "liaow10/MetalStrike",
"id": "24f8b99faa1361ef4f449daf58f0afeb97da9d5f",
"size": ... |
from __future__ import unicode_literals
from netmiko.cisco import CiscoIosSSH
from netmiko.cisco import CiscoAsaSSH
from netmiko.cisco import CiscoNxosSSH
from netmiko.cisco import CiscoXrSSH
from netmiko.cisco import CiscoWlcSSH
from netmiko.arista import AristaSSH
from netmiko.hp import HPProcurveSSH, HPComwareSSH
fr... | {
"content_hash": "563c5af4bcd0d340fc92792a9031d08c",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 99,
"avg_line_length": 29.836363636363636,
"alnum_prop": 0.704448507007922,
"repo_name": "mileswdavis/netmiko",
"id": "117d0f838a92a989a5cac71c93a0c44b12712652",
"size": "1... |
import os
import time
import pandas as pd
import numpy as np
import tsam.timeseriesaggregation as tsam
def test_accuracyIndicators():
hoursPerPeriod = 24
noTypicalPeriods = 8
raw = pd.read_csv(
os.path.join(os.path.dirname(__file__), "..", "examples", "testdata.csv"),
index_col=0,
... | {
"content_hash": "dbc3ca3fb55367ad2f1755296cd98497",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 118,
"avg_line_length": 30.61904761904762,
"alnum_prop": 0.6801451529289787,
"repo_name": "FZJ-IEK3-VSA/tsam",
"id": "4dc4a2a8f26b59cd9e2a3810a2d25de5109565e3",
"size": "19... |
from runtime import *
'''
evaluation order
'''
# https://github.com/PythonJS/PythonJS/issues/131
def main():
a = False and (False or True)
assert( a==False )
main()
| {
"content_hash": "008eba1e4a0a4c145b3bbb3136855654",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 49,
"avg_line_length": 16.8,
"alnum_prop": 0.6785714285714286,
"repo_name": "rusthon/Rusthon",
"id": "590b76fe57552943a3d9d9e64129034ab31ed6be",
"size": "168",
"binary": ... |
import re
from oslo_config import cfg
from oslo_log import log
from pecan import hooks
import six
from six.moves import http_client
from ironic.common import context
from ironic.common import policy
from ironic.conductor import rpcapi
from ironic.db import api as dbapi
LOG = log.getLogger(__name__)
CHECKED_DEPRECAT... | {
"content_hash": "85fdf65c2f22cf8c57af7edc2c334766",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 79,
"avg_line_length": 38.091503267973856,
"alnum_prop": 0.6177076183939602,
"repo_name": "pshchelo/ironic",
"id": "94e89d98f8f0235c87b20e459b2732257b371b2c",
"size": "645... |
"""
PipelineLoader accepting a DataFrame as input.
"""
from functools import partial
from interface import implements
from numpy import (
ix_,
zeros,
)
from pandas import (
DataFrame,
DatetimeIndex,
Index,
Int64Index,
to_datetime
)
from zipline.lib.adjusted_array import AdjustedArray
from z... | {
"content_hash": "6e075d659ef7e212bb87288bd82c00cf",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 79,
"avg_line_length": 35.688442211055275,
"alnum_prop": 0.6064488876372852,
"repo_name": "humdings/zipline",
"id": "5a5b08dd64a37729665d140b7fce09460808b5de",
"size": "71... |
"""Module implementing the master-side code.
This file only imports all LU's (and other classes) in order to re-export them
to clients of cmdlib.
"""
from ganeti.cmdlib.base import \
LogicalUnit, \
NoHooksLU, \
ResultWithJobs
from ganeti.cmdlib.cluster import \
LUClusterActivateMasterIp, \
LUClusterDeacti... | {
"content_hash": "995ecc25acb918aa4aac49e38fb48fc7",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 78,
"avg_line_length": 24.533980582524272,
"alnum_prop": 0.7696873763355758,
"repo_name": "dimara/ganeti",
"id": "ee024177bb75f93b597b476eab74f8c929eb4642",
"size": "3911"... |
from copy import deepcopy
import torch
import progressbar
import math
import numpy as np
from torch.multiprocessing import Lock, Manager
from .PER_src import per_operator
def cut_data(seq, sizeSeq):
maxSeq = sizeSeq.max()
seq = seq[:, :maxSeq]
return seq
def beam_search(score_preds, nKeep, blankLabel):
... | {
"content_hash": "a4cfb86b087bb627ba03913980252c51",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 128,
"avg_line_length": 29.366013071895424,
"alnum_prop": 0.5036723792566214,
"repo_name": "facebookresearch/libri-light",
"id": "93eba74eb19daa1e225827b121dfabbb011fb63f",
... |
try:
import xmlrpclib
pypi = xmlrpclib.ServerProxy('https://pypi.python.org/pypi')
except:
import xmlrpc.client
pypi = xmlrpc.client.ServerProxy('https://pypi.python.org/pypi')
import pip
packages_to_upgrade = []
for dist in pip.get_installed_distributions():
try:
available = pypi.package... | {
"content_hash": "2df67cd82db0a22ce5f460c61659d73c",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 81,
"avg_line_length": 30.142857142857142,
"alnum_prop": 0.6296547054840894,
"repo_name": "bcarroll/authmgr",
"id": "33d2791650b8bf7218cc2ce40662516c618b582d",
"size": "154... |
from telemetry.page import page_test
class NoOp(page_test.PageTest):
def __init__(self):
super(NoOp, self).__init__()
def ValidateAndMeasurePage(self, page, tab, results):
pass
| {
"content_hash": "3e025fbb554db266e334e8e799e91521",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 55,
"avg_line_length": 19.3,
"alnum_prop": 0.6787564766839378,
"repo_name": "ds-hwang/chromium-crosswalk",
"id": "09639105e57d79a9f98f5a4909b462efb5bd72f6",
"size": "356",
... |
from .constant import Constant
__NR_exit = Constant('__NR_exit',1)
__NR_fork = Constant('__NR_fork',2)
__NR_read = Constant('__NR_read',3)
__NR_write = Constant('__NR_write',4)
__NR_open = Constant('__NR_open',5)
__NR_close = Constant('__NR_close',6)
__NR_waitpid = Constant('__NR_waitpid',7)
__NR_creat = Constant('__N... | {
"content_hash": "295413fc0ce892373e1c4bf41c8233d0",
"timestamp": "",
"source": "github",
"line_count": 602,
"max_line_length": 73,
"avg_line_length": 45.34551495016611,
"alnum_prop": 0.7001611839695215,
"repo_name": "anthraxx/pwndbg",
"id": "13f5fb13769b3acc27dc61ef1c0bdfe9d37bc329",
"size": "2734... |
import unittest, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_import as h2i, h2o_glm, h2o_common, h2o_exec as h2e
import h2o_print
DO_GLM = True
LOG_MACHINE_STATS = True
print "Assumes you ran ../build_for_clone.py in this directory"
print "Using h2o-nodes.json. Also the sandbox dir"
cl... | {
"content_hash": "84c5e6b0c01869483623067b61889b93",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 114,
"avg_line_length": 46.19047619047619,
"alnum_prop": 0.5077319587628866,
"repo_name": "woobe/h2o",
"id": "4781591ecd2550c60a30c8b2cdda41f2e05b0e3a",
"size": "5820",
... |
import argparse, glob, os, sys, csv
import numpy as np
from matplotlib import pyplot as plt
from importlib import import_module
from scipy.interpolate import interp1d
from sklearn.metrics import roc_curve, roc_auc_score
label_file = "./data/outcome.txt"
target_names = []
with open(label_file, "rb") as vfile:
for l... | {
"content_hash": "9ca2a8868ff3cc73bec1519e3d48a00e",
"timestamp": "",
"source": "github",
"line_count": 276,
"max_line_length": 143,
"avg_line_length": 47.36231884057971,
"alnum_prop": 0.5516370869033048,
"repo_name": "broadinstitute/ebola-predictor",
"id": "e2e4ce44eb31cccc40246be6f8981a55d6fb5c6e",... |
"""
Exceptions common to OpenStack projects
"""
import itertools
import logging
class ProcessExecutionError(IOError):
def __init__(self, stdout=None, stderr=None, exit_code=None, cmd=None,
description=None):
if description is None:
description = "Unexpected error while runnin... | {
"content_hash": "c8121c0cb9711dcdc32e7048c41a2293",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 78,
"avg_line_length": 23.49618320610687,
"alnum_prop": 0.6195581546458739,
"repo_name": "xchenum/quantum",
"id": "e5da94b9496518923bf69507a22065589e7f4bfa",
"size": "3753... |
def sayHello():
print 'Hello, world'
version = 0.1
### This is the end of mymodule.py
| {
"content_hash": "e8ab207be306da75ef47885205565815",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 34,
"avg_line_length": 18.2,
"alnum_prop": 0.6483516483516484,
"repo_name": "DeercoderPractice/exp-code",
"id": "a4a0d0e44b6b00d7378782ab12e3901bfb17918e",
"size": "290",
... |
from waflib import Utils,Task,Options,Logs,Errors
from waflib.TaskGen import before_method,after_method,feature
from waflib.Tools import ccroot
from waflib.Configure import conf
import os,tempfile
ccroot.USELIB_VARS['cs']=set(['CSFLAGS','ASSEMBLIES','RESOURCES'])
ccroot.lib_patterns['csshlib']=['%s']
@feature('cs')
@be... | {
"content_hash": "2ce68004bd3fa7e49e2da7c8c2c874b3",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 98,
"avg_line_length": 31.40625,
"alnum_prop": 0.6703980099502488,
"repo_name": "romejoe/CByteStream",
"id": "a78e13821da2853034623d6d5ddf7f6669eaaca9",
"size": "4165",
... |
import threading
# Monkeypatch xmlsec.initialize() to only run once (https://github.com/ansible/ansible-tower/issues/3241).
xmlsec_init_lock = threading.Lock()
xmlsec_initialized = False
import dm.xmlsec.binding # noqa
original_xmlsec_initialize = dm.xmlsec.binding.initialize
def xmlsec_initialize(*args, **kwargs):... | {
"content_hash": "12ecf671a8176b03ae5edd2231e83c6b",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 106,
"avg_line_length": 29.636363636363637,
"alnum_prop": 0.7392638036809815,
"repo_name": "wwitzel3/awx",
"id": "aa65d65a11066de7663fa0cff792cffa21d76297",
"size": "720",
... |
'''
Created on Jan 2, 2016
@author: Dustin
'''
def save_all_interesections_as_white_stones(img):
'''
After the intersections have been properly identified, this will crop the image into
361 individual images, one for each intersection.
'''
w, h = 18,18
count = 0
global SAVE_NEG_IMAGES, IN... | {
"content_hash": "f84a03a1db65b3527878419cda917640",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 108,
"avg_line_length": 37.014925373134325,
"alnum_prop": 0.5479838709677419,
"repo_name": "dtdannen/pocket-sai",
"id": "974d2b89921f3c5380c5784fc26c261c256543f3",
"size": ... |
from __future__ import absolute_import
from django.conf import settings # noqa
from django import http
from django.test.utils import override_settings # noqa
from mox import IsA # noqa
from novaclient.v1_1 import servers
from openstack_dashboard import api
from openstack_dashboard.test import helpers as test
cl... | {
"content_hash": "13981072891ecdfbd0c744a96dc6dabe",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 79,
"avg_line_length": 39.35532994923858,
"alnum_prop": 0.5757771185347608,
"repo_name": "kaiweifan/horizon",
"id": "19ec38575ea1dd3ea41fd2b6b32803fee1681303",
"size": "86... |
from django.conf.urls import patterns
from django.conf.urls import url
import sys, os
urlpatterns = patterns('geonition_client.views',
#javascript API for the REST
url(r'^geonition.js',
'javascript_api',
name="api_javascript"),
... | {
"content_hash": "75ca957ac0b81f4de5b7d9625a37923b",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 48,
"avg_line_length": 26.82608695652174,
"alnum_prop": 0.4538087520259319,
"repo_name": "geonition/django_geonition_client",
"id": "a9222c0328e7cde9cae26586478b875c46bb9800"... |
from typing import Any, Optional, TYPE_CHECKING
from azure.mgmt.core import AsyncARMPipelineClient
from azure.profiles import KnownProfiles, ProfileDefinition
from azure.profiles.multiapiclient import MultiApiClientMixin
from .._serialization import Deserializer, Serializer
from ._configuration import ComputeManageme... | {
"content_hash": "c56dbc429b4785f2e2142a144a9dde5e",
"timestamp": "",
"source": "github",
"line_count": 2307,
"max_line_length": 182,
"avg_line_length": 78.42045947117468,
"alnum_prop": 0.7142541289880386,
"repo_name": "Azure/azure-sdk-for-python",
"id": "5eddff3dd99e78b1ab91bff9d406b00abba39e4f",
... |
from __future__ import annotations
import io
import logging
import socket
import sys
import time
import typing
import warnings
from test import LONG_TIMEOUT, SHORT_TIMEOUT
from threading import Event
from unittest import mock
from urllib.parse import urlencode
import pytest
from dummyserver.server import HAS_IPV6_AN... | {
"content_hash": "5222679a24de5f119f6b75e1e7162c7f",
"timestamp": "",
"source": "github",
"line_count": 1446,
"max_line_length": 110,
"avg_line_length": 39.45089903181189,
"alnum_prop": 0.5554640114994916,
"repo_name": "urllib3/urllib3",
"id": "6aea007a21887696fee0310ee5a45bcdce24481b",
"size": "57... |
"""mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-base... | {
"content_hash": "6cbc4603eec6a989fbe1c6cf6bc85778",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 125,
"avg_line_length": 37.3125,
"alnum_prop": 0.6957007258514796,
"repo_name": "janusnic/dj-21v",
"id": "58bb549bdc1f8c1cab850995f8870d2f9dff1d60",
"size": "1791",
"bina... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_noble_old_zabrak_female_02.iff"
result.attribute_template_id = 9
result.stfName("npc_name","zabrak_base_female")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "552dc8049d1ac9a66fd11cf8439b80d1",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 80,
"avg_line_length": 24.384615384615383,
"alnum_prop": 0.7003154574132492,
"repo_name": "anhstudios/swganh",
"id": "6f9ba529164ae7d27b6302b250a010df71af867c",
"size": "46... |
import os
import pickle
from ffthompy.tensorsLowRank.homogenisation import (homog_Ga_full_potential,
homog_GaNi_full_potential,
homog_Ga_sparse,
homog_GaNi_sparse)... | {
"content_hash": "99c378ee41107ade8a145afcbca664a0",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 136,
"avg_line_length": 52.82142857142857,
"alnum_prop": 0.5206220419202163,
"repo_name": "vondrejc/FFTHomPy",
"id": "81e8b2ce30475ae7e904b8ae47224d75ef7ebc50",
"size": "5... |
from django.conf.urls import url
from api.eating.views import EatingAPIView
from api.date.views import UserDateAPIView, AdminDateAPIView
urlpatterns = [
url(r'^eating/$', EatingAPIView.as_view()),
url(r'^user/date/(?P<year>\d+)/(?P<month>\d+)/(?P<day>\d+)/$', UserDateAPIView.as_view()),
url(r'^admin/dat... | {
"content_hash": "04a7c03dd0d505f9f3f1a2bae27ae45d",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 96,
"avg_line_length": 36.27272727272727,
"alnum_prop": 0.6541353383458647,
"repo_name": "jupiny/MIDASChallenge2017",
"id": "5711945d741bc3e9e21345491b50a9faf31f73d3",
"siz... |
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,sys,errno,re,shutil
try:
import cPickle
except ImportError:
import pickle as cPickle
from waflib import Runner,TaskGen,Utils,ConfigSet,Task,Logs,Options,Context,Er... | {
"content_hash": "7621f87d55bbf7ff1222dcdc9ba2ac80",
"timestamp": "",
"source": "github",
"line_count": 769,
"max_line_length": 115,
"avg_line_length": 27.4629388816645,
"alnum_prop": 0.6688290165254037,
"repo_name": "pipsiscool/audacity",
"id": "70330ef35d748e8d715dbd79a0c3f58736b4c4f5",
"size": "... |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.pr... | {
"content_hash": "a937b135a427ad09eb89c041d579230a",
"timestamp": "",
"source": "github",
"line_count": 235,
"max_line_length": 817,
"avg_line_length": 37.13191489361702,
"alnum_prop": 0.7110932844373138,
"repo_name": "ryfeus/lambda-packs",
"id": "cd66ddb5c07e06d8aa59121266644039c6af986e",
"size": ... |
import os
import re
import subprocess
from charmhelpers.core.hookenv import (
log,
INFO,
)
from charmhelpers.contrib.hardening.audits.file import (
FilePermissionAudit,
DirectoryPermissionAudit,
NoReadWriteForOther,
TemplatedFile,
)
from charmhelpers.contrib.hardening.audits.apache import Disa... | {
"content_hash": "606841fa75bc81ade909f6edc930b737",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 76,
"avg_line_length": 34.726190476190474,
"alnum_prop": 0.5539938292766541,
"repo_name": "coreycb/charm-keystone",
"id": "51b636f77fd71bcfc4af15bedafdb4a669c016d8",
"size"... |
"""Support for EnOcean sensors."""
import logging
import voluptuous as vol
from homeassistant.components import enocean
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_DEVICE_CLASS,
CONF_ID,
CONF_NAME,
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_TEMPERATU... | {
"content_hash": "54c9979aae9146eca90c22f42ac8091c",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 85,
"avg_line_length": 33.199074074074076,
"alnum_prop": 0.6148375400920374,
"repo_name": "joopert/home-assistant",
"id": "2e6b5bdb986da638ee3a69070fffcdad88b1b653",
"size... |
""" self.run with
python setup.py install; nosetests -v --nocapture tests/cm_basic/test_face.py:Test_face.test_001
nosetests -v --nocapture tests/cm_basic/test_face.py
or
nosetests -v tests/cm_basic/test_face.py
"""
from __future__ import print_function
from cloudmesh_client.common.Shell import Shell
from cloudmes... | {
"content_hash": "0c0b4ae90844b31c56ce5b73172a6252",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 96,
"avg_line_length": 23.229166666666668,
"alnum_prop": 0.6502242152466368,
"repo_name": "cloudmesh/ansible-cloudmesh-face",
"id": "10da33d252e91e153532a234f16eac4cf6f3058f"... |
"""IOThomeinspector URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')... | {
"content_hash": "e674a577297b5160c109bc1cd4a6b2ed",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 79,
"avg_line_length": 36.285714285714285,
"alnum_prop": 0.6618547681539807,
"repo_name": "rveeblefetzer/IOT-home-inspector",
"id": "7c0f5d7a07bb3682e698cbd022f52f9c41f8e910"... |
import logging
import os
import re
import sys
import time
import liveandletdie
import pytest
import requests
from selenium.webdriver.common.keys import Keys
from selenium.common.exceptions import TimeoutException
from selenium.common.exceptions import (
NoSuchElementException,
TimeoutException,
UnexpectedA... | {
"content_hash": "ede0133fb96bbb40c36ca85f6c175b5b",
"timestamp": "",
"source": "github",
"line_count": 563,
"max_line_length": 80,
"avg_line_length": 32.18827708703375,
"alnum_prop": 0.5911599161240482,
"repo_name": "dougchestnut/authomatic",
"id": "6b285942003ba4e4e6d78617a9d9643be9082bc7",
"size... |
u"""
Send a SOAP request to the :term: `BCSS` server
using Gaëtan Delannay's :term:`appy` toolkit.
test4 : Using a class AnyMarshaller and a slightly
modified `xml_parser.py` to support ANY elements.
"""
import sys
from cStringIO import StringIO
import logging
logger = logging.getLogger(__name__)
from appy impo... | {
"content_hash": "b3c47e5e318528a5bf0e4aa57716c550",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 663,
"avg_line_length": 34.25333333333333,
"alnum_prop": 0.6584274036590113,
"repo_name": "lino-framework/lino",
"id": "60cfc184ae0bba372e56343b3b4f9f76913b249e",
"size": ... |
import json
import os
from django.conf import settings
from django.core.files.storage import default_storage as storage
from mock import patch
from nose.tools import eq_
from pyquery import PyQuery as pq
import amo
import amo.tests
from amo.tests import assert_required, formset, initial
from amo.urlresolvers import ... | {
"content_hash": "7fb4e85b944c8206ac82bdfd3d0b7dc5",
"timestamp": "",
"source": "github",
"line_count": 286,
"max_line_length": 79,
"avg_line_length": 41.48601398601399,
"alnum_prop": 0.5808680994521702,
"repo_name": "clouserw/olympia",
"id": "d735f0763d6f0a7251e6588091bf7ce0d4a8486b",
"size": "118... |
""" Rally command: info
Samples:
$ rally info find create_meter_and_get_stats
CeilometerStats.create_meter_and_get_stats (benchmark scenario).
Test creating a meter and fetching its statistics.
Meter is first created and then statistics is fetched for the same
using GET /v2/meters/(meter_name)/s... | {
"content_hash": "ec030b912f8d057f6b166680a6cdd16d",
"timestamp": "",
"source": "github",
"line_count": 393,
"max_line_length": 79,
"avg_line_length": 44.478371501272264,
"alnum_prop": 0.5504004576659038,
"repo_name": "go-bears/rally",
"id": "8e9fbe72be5b89817e0304fb3a79d44d8ffb3665",
"size": "1811... |
from abc import ABCMeta, abstractmethod
from os import path
import six
import abc
import json
import logging
#@six.add_metaclass(abc.ABCMeta)
class Parser(object):
__metaclass__ = abc.ABCMeta
def __init__(self, config):
self.logger = logging.getLogger('parser')
if config is None:
raise Exception("[Parser]: j... | {
"content_hash": "9d0ec0ce8fa98eb3a9bb5eb856122581",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 116,
"avg_line_length": 28.520833333333332,
"alnum_prop": 0.6530314097881665,
"repo_name": "fmount/tmux-layout",
"id": "8b1d6e428bab2ac54a78d3a03db61f0716e681bb",
"size": "... |
"""
A selection of names to be used in tested documents.
"""
import six # TODO: remove here and then run all doctests
import django
django.setup()
from lino.api.shell import *
from django.utils import translation
from django.utils.encoding import force_str
from django.test import Client
from django.db import connect... | {
"content_hash": "5cd7467b019e60b888fa7574346db844",
"timestamp": "",
"source": "github",
"line_count": 554,
"max_line_length": 99,
"avg_line_length": 32.18231046931408,
"alnum_prop": 0.6010432441527848,
"repo_name": "lino-framework/lino",
"id": "f6c8ff260c34a903c547be69d2bec6daaf64ddf5",
"size": "... |
import re
import sqlite3
from mock import Mock, call, patch
from pytest import fixture, mark, raises
import nosqlite
@fixture(scope="module")
def db(request):
_db = sqlite3.connect(':memory:')
request.addfinalizer(_db.close)
return _db
@fixture(scope="module")
def collection(db, request):
return n... | {
"content_hash": "ad8ca8401c5f4eb926d23e9426e0f005",
"timestamp": "",
"source": "github",
"line_count": 426,
"max_line_length": 93,
"avg_line_length": 35.15023474178404,
"alnum_prop": 0.5788700414051022,
"repo_name": "shaunduncan/nosqlite",
"id": "339cb4e136d302c918f1a9089ae1c3ac9d54a215",
"size": ... |
import os
import scrapy
from scrapy.selector import Selector
from scrapy.pipelines.images import ImagesPipeline
from scrapy.exceptions import DropItem
class CSDNImagesPipeline(ImagesPipeline):
def file_path(self, request, response = None, info = None):
# handle such image(with watermark) url:
# ... | {
"content_hash": "85ddbe3c1fab764ba3f8f9e92031283a",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 184,
"avg_line_length": 42.04545454545455,
"alnum_prop": 0.6897297297297297,
"repo_name": "sighingnow/Spider-Utils",
"id": "01fef1d74682eee2c27bb5176555318ed4d9102a",
"size... |
"""Template tags for working with Recurly.js"""
from django import template
from django.template import Library, Node, Variable, loader
from django_recurly.utils import recurly
from django_recurly.models import Account
from django_recurly.helpers.recurlyjs import get_config, get_subscription_form, get_billing_info_up... | {
"content_hash": "bc94e9d3d344a6236b6a65a1cd00aebc",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 138,
"avg_line_length": 34.285714285714285,
"alnum_prop": 0.6798611111111111,
"repo_name": "pakal/django-recurly",
"id": "d978a1699546f4431526e6f8b0f223ef0e49d9b2",
"size":... |
import warnings
from six import string_types
from django.db import models
class Indexed(object):
@classmethod
def indexed_get_parent(cls, require_model=True):
for base in cls.__bases__:
if issubclass(base, Indexed) and (issubclass(base, models.Model) or require_model is False):
... | {
"content_hash": "f41dd9837fdd4542bbb4f8a8cf40c6ff",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 104,
"avg_line_length": 28.302158273381295,
"alnum_prop": 0.5945602440264361,
"repo_name": "chimeno/wagtail",
"id": "bbe9dbf6afd16b6f560016d8d3b3e0869bb49a44",
"size": "39... |
"""
WSGI config for sinek_tasarim 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.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO... | {
"content_hash": "cfe5c53d22aece1dc194931e087c20f8",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 25.1875,
"alnum_prop": 0.771712158808933,
"repo_name": "hanakamer/sinek-tasarim",
"id": "d99ab9132c21f520cfbe7a55f3427468b46b4c03",
"size": "403",
... |
import ctypes
class DynamicArray():
def __init__(self):
self.n = 0
self.capacity = 1
self.A = self.make_array(self.capacity)
def __len__(self):
return self.n
def __getitem__(self, k):
if not 0 <= k < self.n:
return IndexError('K is out of bounds!')
... | {
"content_hash": "df89eef2d82ebbc44da5e7108060818f",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 90,
"avg_line_length": 30.333333333333332,
"alnum_prop": 0.5714285714285714,
"repo_name": "kozlowsm/Python",
"id": "1e8111dac1a23a5867fd78040d32e2a7c48a0a9a",
"size": "1365... |
try:
import unittest2 as unittest
except ImportError:
import unittest
from cassandra.query import BatchStatement
from cassandra.cluster import Cluster
from tests.integration import use_singledc, PROTOCOL_VERSION
def setup_module():
use_singledc()
class ClientWarningTests(unittest.TestCase):
@clas... | {
"content_hash": "67ff483feaffcb81da6b6915f695f8bb",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 125,
"avg_line_length": 34.05172413793103,
"alnum_prop": 0.6288607594936709,
"repo_name": "jregovic/python-driver",
"id": "14405a8df1db48e330ee531d0013e3d899bd1216",
"size... |
"""fuelclient.objects sub-module contains classes that mirror
functionality from nailgun objects.
"""
from fuelclient.objects.base import BaseObject
from fuelclient.objects.environment import Environment
from fuelclient.objects.node import Node
from fuelclient.objects.node import NodeCollection
from fuelclient.objects... | {
"content_hash": "958afbe059980f1fc817f83b2ce54d36",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 61,
"avg_line_length": 40.083333333333336,
"alnum_prop": 0.8565488565488566,
"repo_name": "koder-ua/nailgun-fcert",
"id": "0917a7632a6f708a99630d6f536a746093aaa88f",
"size"... |
from django.conf.urls import patterns,url
from people import views
urlpatterns = patterns('',
# url(r'^$', views.IndexView.as_view(), name='index'),
# url(r'^(?P<pk>\d+)/$', views.DetailView.as_view(), name='detail'),
# url(r'^(?P<pk>\d+)/results/$', views.ResultsView.as_view(), name='results'),
url(r'^signup/$',... | {
"content_hash": "2eccae01f755b0e21a76e3c87d33a922",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 79,
"avg_line_length": 38,
"alnum_prop": 0.6428571428571429,
"repo_name": "youtaya/knight",
"id": "812bf6b1e796e58198a1afec4bd31e24513629fa",
"size": "532",
"binary": fal... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.