text stringlengths 4 1.02M | meta dict |
|---|---|
"""Sphinx build configuration file."""
import os
import sys
from sphinx.ext import apidoc
from docutils import nodes
from docutils import transforms
# Change PYTHONPATH to include artifacts module and dependencies.
sys.path.insert(0, os.path.abspath('..'))
import artifacts # pylint: disable=wrong-import-position
... | {
"content_hash": "962f4715f069faca947c5b3aed6bc669",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 80,
"avg_line_length": 30.236686390532544,
"alnum_prop": 0.6913894324853229,
"repo_name": "ForensicArtifacts/artifacts",
"id": "8706d25835807c87eb475d25f3df67ac4db795f2",
... |
'''
'''
from __future__ import absolute_import
import __builtin__
import tempfile
from contextlib import contextmanager, closing
from random import randrange
from .filepath import FilePath, DirPath
@contextmanager
def temporary_file(*args, **kwds):
tmp_path = FilePath(tempfile.mktemp(*args, **kwds))
try:
... | {
"content_hash": "29996454512a66ad33daa743c2eb2dc2",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 105,
"avg_line_length": 25.642857142857142,
"alnum_prop": 0.6225626740947076,
"repo_name": "matthagy/Jamenson",
"id": "12032dcab10ba88ae0659ffd70fb8019d040dc31",
"size": "1... |
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": "6ec835d82f36496d9a62f02cedd313b3",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 464,
"avg_line_length": 73.21808510638297,
"alnum_prop": 0.6029059208136578,
"repo_name": "gnotaras/django-powerdns-manager",
"id": "873047eac9c10326abfc23de6366b228c0bcf40b... |
from __future__ import print_function
from __future__ import absolute_import
from .securityhandlerhelper import securityhandlerhelper
import re as re
dateTimeFormat = '%Y-%m-%d %H:%M'
import arcrest
from . import featureservicetools as featureservicetools
from arcrest.hostedservice import AdminFeatureService
import... | {
"content_hash": "509bcd499add12d306b79716159c994f",
"timestamp": "",
"source": "github",
"line_count": 3119,
"max_line_length": 201,
"avg_line_length": 42.84834882975313,
"alnum_prop": 0.4404312950824579,
"repo_name": "BrunoCaimar/ArcREST",
"id": "c88a58592072e604c111b8ccedddfa7833cc2874",
"size":... |
from oslo_config import cfg
from toscaparser.tosca_template import ToscaTemplate
import yaml
from tacker.common import utils
from tacker.tests import constants
from tacker.tests.functional import base
from tacker.tests.utils import read_file
from tacker.vm.tosca import utils as toscautils
CONF = cfg.CONF
class VnfT... | {
"content_hash": "0acba684061847de4e158d8cc6b690a9",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 76,
"avg_line_length": 37.869565217391305,
"alnum_prop": 0.6119402985074627,
"repo_name": "trozet/tacker",
"id": "10c83aeeba3d6e844132aa3bee7035fdf0c5bed6",
"size": "3239",... |
"""
Tests the EventAdmin service
:author: Thomas Calmant
"""
# Standard library
import random
import threading
import time
try:
import unittest2 as unittest
except ImportError:
import unittest
# Pelix
from pelix.ipopo.constants import use_ipopo
import pelix.framework
import pelix.services
# ----------------... | {
"content_hash": "4afb6c28f3b6e962c6adb1c43e34d351",
"timestamp": "",
"source": "github",
"line_count": 246,
"max_line_length": 80,
"avg_line_length": 30.146341463414632,
"alnum_prop": 0.5511057173678533,
"repo_name": "tcalmant/ipopo",
"id": "0e24411f97c6b3bd0db90de1c83999190d166c8d",
"size": "7470... |
from madrona.features.forms import FeatureForm
from seak.models import Folder, Scenario
from django import forms
class FolderForm(FeatureForm):
class Meta(FeatureForm.Meta):
model = Folder
class ScenarioForm(FeatureForm):
input_scalefactor = forms.FloatField(widget=forms.TextInput(attrs={'class': 'sl... | {
"content_hash": "7db79abb70685ce5a5b561433c2f1a7c",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 109,
"avg_line_length": 33.375,
"alnum_prop": 0.7116104868913857,
"repo_name": "Ecotrust/juniper-priorities",
"id": "a7fe2fa00b1a20ecfe28f39a73f4609b6dec7cb3",
"size": "534... |
import numpy as np
from mock import MagicMock
import pytest
from ..data import Data, Component, ComponentID, DerivedComponent
from ..hub import Hub, HubListener
from ..data_collection import DataCollection
from ..message import (Message, DataCollectionAddMessage,
DataCollectionDeleteMessage,
... | {
"content_hash": "e5cf6ba9bb68e064b34249934f457152",
"timestamp": "",
"source": "github",
"line_count": 237,
"max_line_length": 77,
"avg_line_length": 32.392405063291136,
"alnum_prop": 0.5960661716816464,
"repo_name": "glue-viz/glue-qt",
"id": "ae154147cb6b05962d3079d1a831e46744806e77",
"size": "77... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Member.image'
db.add_column(u'cmsplugin_member', 'image',
self.gf('django.db.models.fields.fil... | {
"content_hash": "b608ffe3eb0640de803d6b2b2dbff58b",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 157,
"avg_line_length": 68.88607594936708,
"alnum_prop": 0.5648658581403896,
"repo_name": "robertour/commas",
"id": "a18e935aeb145292a6a81cc012e12ca9f9bc47c9",
"size": "546... |
"""Update encrypted deploy password in Travis config file
"""
from __future__ import print_function
import base64
import json
import os
from getpass import getpass
import yaml
from cryptography.hazmat.primitives.serialization import load_pem_public_key
from cryptography.hazmat.backends import default_backend
from cry... | {
"content_hash": "bc7e0e92f37648f9f6c618dd04c42461",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 79,
"avg_line_length": 30.775,
"alnum_prop": 0.6812889249932305,
"repo_name": "jalbin/plumbery",
"id": "c647f410260affe4aa28ba81b8a436a06a789345",
"size": "3739",
"binar... |
import chardet
import six
from django.utils.translation import ugettext_lazy as _
from tablib.compat import BytesIO, StringIO
from tablib.core import Dataset
from tablib.formats import _csv, _json, _xls, _xlsx, _yaml
from typing_extensions import OrderedDict
try:
from yaml import CSafeDumper
except:
CSafeDumper... | {
"content_hash": "ece5fd4aeb900ea9471850cbadbd0dba",
"timestamp": "",
"source": "github",
"line_count": 239,
"max_line_length": 117,
"avg_line_length": 29,
"alnum_prop": 0.6052517674217285,
"repo_name": "sdelements/django-multi-import",
"id": "20181d95839444606e6a1d188aaf0771b3ee8024",
"size": "693... |
'''
This program will take a /24 IP Network input and print the list regardless of entry
forms: 10.2.2. or 10.2.3 or 10.2.3.0
'''
#Request IP Network input
a = raw_input("Enter an IP Network: ")
# Create list
octets = a.split(".")
#Make 3 octets
octets = octets[:3]
#Append 4th 0 Octet
octets.append('0')
#print r... | {
"content_hash": "4503443d641fa67935b07b8a4a2100b1",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 85,
"avg_line_length": 20.735294117647058,
"alnum_prop": 0.675177304964539,
"repo_name": "shamurti/Python_Class",
"id": "c6dc2648d179a1beb0668a47be889e198c26e9b4",
"size": ... |
def ${function_name}(${', '.join(input_names)}, *args, **kwargs):
%for line in body_code.splitlines():
${line}
%endfor
${return_code}
| {
"content_hash": "c5858c3da814ee1248c98aeeafbe0704",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 65,
"avg_line_length": 28.4,
"alnum_prop": 0.6056338028169014,
"repo_name": "jcrudy/sklearntools",
"id": "d5bb6fd3e4ff828d738a202dc66e490ac902757b",
"size": "142",
"binary... |
"""Find the IP address of a VirtualBox virtual machine and ssh into it.\
Add or update /etc/hosts entries upon user interaction."""
import os
import subprocess
import sys
def check_exists(name):
"""Check if the virtual machine exists."""
virtualbox_exists = subprocess.Popen(["VBoxManage", "list", "vms"], ... | {
"content_hash": "a0c57b2ed40c8fe9da283da402507118",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 179,
"avg_line_length": 36.784615384615385,
"alnum_prop": 0.6200334588038477,
"repo_name": "jessemillar/pythonista",
"id": "e43c119d4db52aa64705756ce99b8c481c466fc1",
"siz... |
import base64, os
def get_content(texts):
if isinstance(texts, str) or isinstance(texts, unicode):
file_path = texts
with open(file_path, 'r') as f:
result = list(f.read().decode("utf-8"))
f.close()
return result
else:
return texts
def write_file( pat... | {
"content_hash": "7a43f45795c082df6336247d7875d539",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 60,
"avg_line_length": 20.59375,
"alnum_prop": 0.5614567526555387,
"repo_name": "eHanlin/font-generator",
"id": "c2064c416dab128850beca360bb53cec76fc04a0",
"size": "659",
... |
from setuptools import setup
import sys
# azure v0.x is not compatible with this package
# azure v0.x used to have a __version__ attribute (newer versions don't)
try:
import azure
try:
ver = azure.__version__
raise Exception(
'This package is incompatible with azure=={}. '.format(ve... | {
"content_hash": "df345fbaf95869554e29e3a3898a840c",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 73,
"avg_line_length": 30.25925925925926,
"alnum_prop": 0.5899632802937577,
"repo_name": "phonnz/azure-storage-python",
"id": "73648d88f1682d792a779a820f36d2e9bb33e1c1",
"s... |
"""
Firebase Cloud Messaging
Previously known as GCM / C2DM
Documentation is available on the Firebase Developer website:
https://firebase.google.com/docs/cloud-messaging/
"""
import json
from django.core.exceptions import ImproperlyConfigured
from .compat import Request, urlopen
from .conf import get_manager
from .... | {
"content_hash": "8ef9c92f20b5e9489352343c12c5591d",
"timestamp": "",
"source": "github",
"line_count": 212,
"max_line_length": 99,
"avg_line_length": 34.64622641509434,
"alnum_prop": 0.718992511912866,
"repo_name": "matthewh/django-push-notifications",
"id": "854e5667c642e31ff9995470b51fcb7d5e2ef24e... |
from ryu.lib.mac import haddr_to_bin
from ryu.lib.stringify import StringifyMixin
from ryu.ofproto.ofproto_v1_0_parser import OFPMatch
class PacketMatch(StringifyMixin):
def __init__(self, in_port=None, dl_src=None, dl_dst=None, dl_vlan=None,
dl_vlan_pcp=None, dl_type=None, nw_tos=None, nw_proto=... | {
"content_hash": "f72e90f122abcd402dd034f7ae9a12ac",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 76,
"avg_line_length": 30.983606557377048,
"alnum_prop": 0.5650793650793651,
"repo_name": "shimojo-lab/flowsieve",
"id": "df9eb2cee15a5be76412f85c7a0e98c073091bb1",
"size":... |
import unittest
import re
from passgen import passgen
class TestPassgen(unittest.TestCase):
def test_errors(self):
with self.assertRaises(ValueError):
passgen(length=-2)
with self.assertRaises(ValueError):
passgen(case="spam")
with self.assertRaises(ValueError):
... | {
"content_hash": "6e7de9f1f88a3c6b821592f9efa80401",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 71,
"avg_line_length": 32.274193548387096,
"alnum_prop": 0.5897051474262869,
"repo_name": "soslan/passgen",
"id": "f2cf1fa43e0b7c33730bf6bb688e2d98b1b17508",
"size": "2001"... |
import array
import struct
from impacket import ImpactPacket
from impacket import uuid
from impacket import dcerpc
from impacket.dcerpc import ndrutils
from impacket.dcerpc import transport
MSRPC_UUID_MGMT = uuid.uuidtup_to_bin(("afa8bd80-7d8a-11c9-bef4-08002b102989", "1.0"))
class IfIdsRequestHeader(ImpactPacket.He... | {
"content_hash": "001c6f41180d65812a4e9ce7b0b6c702",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 92,
"avg_line_length": 27.442307692307693,
"alnum_prop": 0.6517168885774351,
"repo_name": "hecchi777/S3-SlaacSecuritySolution",
"id": "114576f1183f86925a1d3edd5c78f2ac1bb238f... |
"""Test Z-Wave binary sensors."""
import asyncio
import datetime
from unittest.mock import patch
from homeassistant.components.zwave import const
from homeassistant.components.binary_sensor import zwave
from tests.mock.zwave import (
MockNode, MockValue, MockEntityValues, value_changed)
def test_get_device_det... | {
"content_hash": "a8b3e375c7f1a8a60802a74daf38addf",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 71,
"avg_line_length": 34.01960784313726,
"alnum_prop": 0.7028818443804035,
"repo_name": "LinuxChristian/home-assistant",
"id": "a5dabf6953a6664e627d278cdc5fb7e65d3a3da0",
... |
"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
Exceptions raised by OSBS
"""
from __future__ import print_function, absolute_import, unicode_literals
import json
from traceback import format... | {
"content_hash": "d34789295c2760d392c6b22b8917beb5",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 80,
"avg_line_length": 31.68831168831169,
"alnum_prop": 0.5967213114754099,
"repo_name": "jpopelka/osbs-client",
"id": "bd58db19220a836cdaa839d21582f1eb694f2d94",
"size": "... |
"""
Test Resty Codes
Unit test for the resty codes API.
by: Carl J. Nobile
email: carl.nobile@gmail.com
"""
__docformat__ = "restructuredtext en"
import unittest
from unittest import skip
from io import StringIO
from rulesengine import InvalidNodeSizeException
from restycodes import (RESTYARGS, RestyCodes, Cond... | {
"content_hash": "2747274eab49ca93f620415e0a166077",
"timestamp": "",
"source": "github",
"line_count": 443,
"max_line_length": 79,
"avg_line_length": 41.62979683972912,
"alnum_prop": 0.5041210280880598,
"repo_name": "cnobile2012/restycodes",
"id": "0b72b8aa119e06417bd20fd084238992ece16cc4",
"size"... |
__author__ = "chenghao"
from util import config
import os, logging, re, uuid, json
from logging import handlers
from datetime import datetime, date
from dogpile.cache import make_region
# 基本配置
ADMIN_PREFIX = "/admin" # 管理平台访问前缀
UEDITOR_PREFIX = "/ueditor" # 富文本编辑访问前缀
ROW = 10 # 每页显示多少行
DB_NAME = "blog" # 数据库名称
... | {
"content_hash": "7c7e1720819c95def347a43318c0e03f",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 100,
"avg_line_length": 26.627906976744185,
"alnum_prop": 0.6689956331877729,
"repo_name": "chenghao/blog",
"id": "c2c3aaebfbf708ca5b9cf314b6b8de6e17b8d8eb",
"size": "4843... |
"""
Merge two dictionaries into one.
"""
from typing import Dict
import copy
def merge2(dict1, dict2):
# type: (Dict, Dict) -> Dict
"""Recrusively merge two dictionaries.
The two input dictionaries can have arbitrary depths.
If there is a conflict, values from dict2 will
override dict1.
Args... | {
"content_hash": "248b936f2c40e295007a299cba10c05b",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 57,
"avg_line_length": 27.75,
"alnum_prop": 0.5805805805805806,
"repo_name": "yuhangwang/ninjag-python",
"id": "d2212c5009ebd847bee2d69f51a1d18c12a0648b",
"size": "999",
... |
from setuptools import setup
setup(
name='c_ext',
version='0.1',
packages=['c_ext'],
url='https://github.com/KivApple/c_ext',
license='MIT',
author='Ivan Kolesnikov',
author_email='kiv.apple@gmail.com',
description='Translator from extended C to normal C',
entry_points={
'co... | {
"content_hash": "a29ca917b177b609d15c84122bf5662b",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 57,
"avg_line_length": 21.82608695652174,
"alnum_prop": 0.547808764940239,
"repo_name": "KivApple/c_ext",
"id": "da1eed3cf799df3c3f3b6dd62229fe71b445c25a",
"size": "524",
... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Architecture',
fields=[
('key', models.CharField(ma... | {
"content_hash": "18ce7f606325c3c7adc1fedfc2070dda",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 114,
"avg_line_length": 33.166666666666664,
"alnum_prop": 0.47661383842288363,
"repo_name": "popen2/djangopypi2",
"id": "e68a352c5942dce9ba10218529b370c28149280d",
"size": ... |
"""
Tests For Scheduler Host Filter Drivers.
"""
import json
from nova import exception
from nova import flags
from nova import test
from nova.scheduler import host_filter
FLAGS = flags.FLAGS
class FakeZoneManager:
pass
class HostFilterTestCase(test.TestCase):
"""Test case for host filter drivers."""
... | {
"content_hash": "186043dc95479e86ea95e0b3cb7bb850",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 79,
"avg_line_length": 37.88659793814433,
"alnum_prop": 0.5476190476190477,
"repo_name": "superstack/nova",
"id": "c029d41e6afaba6df42ffc493123e55917a4a1ec",
"size": "7979... |
try:
import cPickle as pickle
except ImportError:
import pickle
import zlib
import time
import argparse
import sys
import MySQLdb as mysqldb
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Genetic Algorithm MySQL Client.')
parser.add_argument('path', help='path to add fo... | {
"content_hash": "c0ca874e8ac229de5f6d7cbad1e69c66",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 140,
"avg_line_length": 37.108108108108105,
"alnum_prop": 0.6125273124544792,
"repo_name": "afaulconbridge/PyGA",
"id": "96d9b0365bd66a62699b00c742c437bbc40d8cf2",
"size": ... |
from os import environ
import six
if six.PY34:
import configparser
else:
import ConfigParser as configparser
base_config = {
'wait_timeout': environ.get('TENABLEIOTEST_WAIT_TIMEOUT', '800'),
'scan_template_name': environ.get('TENABLEIOTEST_SCAN_TEMPLATE_NAME', 'basic'),
'registry_host': environ.ge... | {
"content_hash": "a85258627011a8cae489ccbc6cc37862",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 102,
"avg_line_length": 28.48,
"alnum_prop": 0.7289325842696629,
"repo_name": "tenable/Tenable.io-SDK-for-Python",
"id": "f8f882f24054bfa0a0aac9f4d481bff57548acef",
"size":... |
from __future__ import unicode_literals
from catalog.urls import catalog_url
from catalog.reviews.views import (
ReviewListView, ReviewDetailView, ReviewCreateView, ReviewUpdateView,
ReviewDeleteView)
# Pats are automatically inserted into urlpatterns in catalog urls.py
# so urlpatterns are not specified her... | {
"content_hash": "21dd7c0dd35dd1702278311a9ed6a64c",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 77,
"avg_line_length": 36.193548387096776,
"alnum_prop": 0.5650623885918004,
"repo_name": "dinoperovic/django-shop-catalog",
"id": "3b9da192b7882e9a96e5cea4caaa5b3c28d2ea16",... |
from libcloud.container.types import Provider
from libcloud.container.providers import get_driver
from libcloud.container.base import ContainerImage
driver = get_driver(Provider.RANCHER)
connection = driver(
"MYRANCHERACCESSKEY", "MYRANCHERSECRETKEY", host="17.23.66.4", port=443
)
image = ContainerImage(
"ha... | {
"content_hash": "1e3608e4e7f273ca08bf5bc67073436f",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 75,
"avg_line_length": 27.2,
"alnum_prop": 0.7389705882352942,
"repo_name": "mistio/libcloud",
"id": "af63c95f6bcf989f35162ec3dfe4fb3ff02bf68f",
"size": "544",
"binary": ... |
from __future__ import unicode_literals
from django.db import models, migrations
import oauth2client.django_orm
class Migration(migrations.Migration):
dependencies = [
('sites', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Profile',
fields=[
... | {
"content_hash": "5453ea44978ba35b5dfd726a355e6d30",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 229,
"avg_line_length": 46.02439024390244,
"alnum_prop": 0.6030736618971914,
"repo_name": "thecut/thecut-googleanalytics",
"id": "4a01fc65bf751adb385ee27f14149ec365da06af",
... |
import os
# try/except added for compatibility with python < 3.8
try:
from unittest import mock
from unittest.mock import AsyncMock # pragma: NO COVER
except ImportError: # pragma: NO COVER
import mock
import math
from google.api_core import (
future,
gapic_v1,
grpc_helpers,
grpc_helper... | {
"content_hash": "61b5158afbe4fb8fdf3c93187a438a60",
"timestamp": "",
"source": "github",
"line_count": 4123,
"max_line_length": 107,
"avg_line_length": 35.97647344166869,
"alnum_prop": 0.6402235540783787,
"repo_name": "googleapis/python-talent",
"id": "b63847b151cbc37d147497c2fa0464cfdf140324",
"s... |
import os, string, re, java, javax, sys, StringIO
from xml.dom import minidom
from java.awt import Color
from java.awt import FlowLayout
from java.awt import BorderLayout
from java.awt import Rectangle
from java.awt import GridLayout
from java.awt import GridBagLayout
from java.awt import GridBagConstraints
fr... | {
"content_hash": "ff03263bfbca7d59609a5418c09a063b",
"timestamp": "",
"source": "github",
"line_count": 277,
"max_line_length": 241,
"avg_line_length": 51.324909747292416,
"alnum_prop": 0.6161637476260815,
"repo_name": "pjdufour/felspar",
"id": "5590cf50ed175ff07a85101092ddad2719736539",
"size": "1... |
"""
test package backported for python-future.
Its primary purpose is to allow use of "import test.support" for running
the Python standard library unit tests using the new Python 3 stdlib
import location.
Python 3 renamed test.test_support to test.support.
"""
| {
"content_hash": "55afbca8761e63e38bc7cb2a44b2f2b9",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 72,
"avg_line_length": 30.333333333333332,
"alnum_prop": 0.7582417582417582,
"repo_name": "noisemaster/AdamTestBot",
"id": "2863cd1bcd15f0bf0f3c8259a8b6c57a6370b1c5",
"size"... |
"""
Webpack template tags
=====================
To use
.. code-block:: html
{% load webpack_tags %}
<!-- Render inclusion tag for frontend JS elements -->
{% base_frontend_sync %}
<!-- Render on-demand async inclusion tag for frontend JS elements -->
{% base_frontend_async %}
"""
from __future... | {
"content_hash": "215f2c171e9b3a939da9dbff3e595f15",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 80,
"avg_line_length": 31.5,
"alnum_prop": 0.699436763952893,
"repo_name": "indirectlylit/kolibri",
"id": "e0d11f34ff31cca11b9f21f4a9ce43128bc0a50f",
"size": "1953",
"bin... |
"""Internal support module for sre"""
import _sre
import sre_parse
from sre_constants import *
from _sre import MAXREPEAT
assert _sre.MAGIC == MAGIC, "SRE module mismatch"
if _sre.CODESIZE == 2:
MAXCODE = 65535
else:
MAXCODE = 0xFFFFFFFF
_LITERAL_CODES = set([LITERAL, NOT_LITERAL])
_REPEATING_CODES = set([R... | {
"content_hash": "9fbc517cfe01e0fffd484d9ab997d8de",
"timestamp": "",
"source": "github",
"line_count": 582,
"max_line_length": 109,
"avg_line_length": 33.74914089347079,
"alnum_prop": 0.49353426331330824,
"repo_name": "ArcherSys/ArcherSys",
"id": "520d78222eef7d9d7ab2d835d1026d4d2cad086f",
"size":... |
"""JSON utility functions."""
from collections import deque
import json
import logging
import os
import tempfile
from typing import Any, Callable, Dict, List, Optional, Type, Union
from homeassistant.core import Event, State
from homeassistant.exceptions import HomeAssistantError
_LOGGER = logging.getLogger(__name__)... | {
"content_hash": "7aa81c28c2762c328afd17f15391db25",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 136,
"avg_line_length": 32.064748201438846,
"alnum_prop": 0.597487098945479,
"repo_name": "titilambert/home-assistant",
"id": "7b6da837c491a103b405d2acc2fae60d049dd69d",
"... |
"""
Assumes a bare-bones pengines service running on 4242
You can use this:
docker run -p 4242:9083 -e PORT=9083 --name sparqlprog cmungall/sparqlprog
"""
import unittest
from pengines.Builder import PengineBuilder
from pengines.Pengine import Pengine
from tests.log_testing import log_tests
import logging
log_... | {
"content_hash": "e5e0561feabf46330c004c9b333102dd",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 111,
"avg_line_length": 31.451612903225808,
"alnum_prop": 0.5801709401709402,
"repo_name": "ian-andrich/PythonPengines",
"id": "faa3019687f62a57918d047263bb0c6dd9588c8b",
"... |
"""Library for loading train and eval data.
This libary contains two functions, make_train_iterator for generating a
training data iterator from multiple sources of different formats and
make_eval_function for creating an evaluation function that evaluates on
data from multiple sources of different formats.
"""
# pyl... | {
"content_hash": "e32f785de746b007ed9379d7ab8a776c",
"timestamp": "",
"source": "github",
"line_count": 267,
"max_line_length": 80,
"avg_line_length": 39.47940074906367,
"alnum_prop": 0.6433924675078265,
"repo_name": "google-research/google-research",
"id": "02818b8fff60c5fe32283b391e4935c036d6a765",... |
from twilio.rest import TwilioRestClient
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)
call = client.calls.create(
url="http://demo.twilio.com/docs/voice.xml",
... | {
"content_hash": "376d7d7fd5f69c833b1bd321a95c41da",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 62,
"avg_line_length": 29.384615384615383,
"alnum_prop": 0.7486910994764397,
"repo_name": "teoreteetik/api-snippets",
"id": "458e3e9f6e5268728d53c55a9c4b780c50dba5b2",
"siz... |
from datetime import datetime
from pydantic import validator
from pydantic.dataclasses import dataclass
@dataclass
class DemoDataclass:
ts: datetime = None
@validator('ts', pre=True, always=True)
def set_ts_now(cls, v):
return v or datetime.now()
print(DemoDataclass())
print(DemoDataclass(ts='... | {
"content_hash": "6eb54486ca331ec31e0c7c75caa55713",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 43,
"avg_line_length": 20,
"alnum_prop": 0.7235294117647059,
"repo_name": "samuelcolvin/pydantic",
"id": "11db5fca3c2c0ce4944d7a0fa190035bf0eefa2c",
"size": "340",
"binar... |
"""
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Audiophiles Music Manager Build 20180119 VER0.0.0PREALPHA *
* (C)2017 Mattijs Snepvangers pegasus.ict@gmail.com *
* lib/ui.py User Interface VER0.0.0PREALPH... | {
"content_hash": "80cc02acc2e48f2fecab05d2c8b93feb",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 80,
"avg_line_length": 40.019762845849804,
"alnum_prop": 0.4591604938271605,
"repo_name": "pegasusict/AMM",
"id": "0721081441e4109f89494657716a4325848fdf07",
"size": "1014... |
'''
Copyright (C) 2022, WAFW00F Developers.
See the LICENSE file for copying permission.
'''
NAME = 'TransIP Web Firewall (TransIP)'
def is_waf(self):
schemes = [
self.matchHeader(('X-TransIP-Backend', '.+')),
self.matchHeader(('X-TransIP-Balancer', '.+'))
]
if any(i for i in schemes):
... | {
"content_hash": "a3e8c55e21affa4426796af37efeaac4",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 54,
"avg_line_length": 22.125,
"alnum_prop": 0.6129943502824858,
"repo_name": "EnableSecurity/wafw00f",
"id": "ccde146d79af93b6cf4ea6cadcd77b527d9117db",
"size": "376",
"... |
class Station(object):
"""Radio station configuration:
id: station id, used to select which station to play
url: mp3 stream URL
name: human-readable station name
"""
def __init__(self, id, url, name):
self.id = id
self.url = url
self.name = name
| {
"content_hash": "ebc3a3e4c9d2f2d44295ac24ebec4443",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 56,
"avg_line_length": 24.666666666666668,
"alnum_prop": 0.597972972972973,
"repo_name": "petli/codplayer",
"id": "b364dbbd25e3ab7766eb8fa63d0605ac25acf447",
"size": "488",... |
"""
This program includes a subclass (MinBalAcct) that inherits from
BankAccount and then overrides __init__, __str__ and withdraw.
Note - class variables are referenced through the original class.
"""
class BankAccount(object): # Top tier class (super class)
acct_cntr = 0 # class variable
def... | {
"content_hash": "224ad189298a6d490d06aa8eb69026b6",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 77,
"avg_line_length": 39.16326530612245,
"alnum_prop": 0.6055237102657635,
"repo_name": "sharkySharks/PythonForDevs",
"id": "2e51877a71e6820fc2fcc0be69fa32bf54ff6a6d",
"si... |
import os, sys, json
from argparse import ArgumentParser
class Tester:
TESTS_DIRECTORY_NAME = "tests"
JSON_DESCRIPTION_FILE_NAME = "info.json"
ERR_LOG_FILE_NAME = "err.log"
ROOT_DIR = os.path.dirname(os.path.realpath(__file__))
TESTS_PATH = os.path.join(ROOT_DIR, TESTS_DIRECTORY_NAME)
def run... | {
"content_hash": "172685fcb00a30ed0ff6626fa22b5023",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 106,
"avg_line_length": 44.10526315789474,
"alnum_prop": 0.5613895518430124,
"repo_name": "letconex/MMT",
"id": "a7f4481256ee36a4a68c18eddc518b12af280709",
"size": "7564",... |
"""Home of the `Sequential` model.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
from tensorflow.python.eager import context
from tensorflow.python.framework import ops
from tensorflow.python.keras import layers as layer_module
from tensor... | {
"content_hash": "f3dba9371ed7f8f2b73afd8ae95746b6",
"timestamp": "",
"source": "github",
"line_count": 362,
"max_line_length": 79,
"avg_line_length": 34.28729281767956,
"alnum_prop": 0.648082500805672,
"repo_name": "manipopopo/tensorflow",
"id": "415b15fde1655f43f3c317cfc6e7756859fc9da1",
"size": ... |
"""
Hack to get scripts to run from source checkout without having to set
PYTHONPATH.
"""
import sys
from os.path import dirname, join, abspath
db_path = dirname(__file__)
project_path = abspath(join(db_path, ".."))
sys.path.insert(0, project_path)
| {
"content_hash": "28cf2ad90728c159b701e065efcaf11b",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 69,
"avg_line_length": 22.818181818181817,
"alnum_prop": 0.7171314741035857,
"repo_name": "bd4/monster-hunter-scripts",
"id": "d44515eab15e6fff927464a6511d5f1e4b9298d8",
"s... |
from cached import Resource
from lib.paypal.client import get_client
from lib.paypal.errors import PaypalError
from lib.paypal.forms import GetPersonal
class Personal(object):
def obj_create(self, bundle, request, **kwargs):
form = self._meta.form(bundle.data)
if not form.is_valid():
... | {
"content_hash": "8c6770e4e1d8597695aa02298a491bba",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 76,
"avg_line_length": 30.916666666666668,
"alnum_prop": 0.5936657681940701,
"repo_name": "muffinresearch/solitude",
"id": "ff2e8e534ba36e7ee9d8b677f906d2b110b6d7ed",
"size... |
import logging
import cloudio.common.utils.timestamp_helpers as TimeStampProvider
from cloudio.endpoint.attribute.constraint import CloudioAttributeConstraint as AttributeConstraint
from cloudio.endpoint.attribute.type import CloudioAttributeType as AttributeType
from cloudio.endpoint.exception.cloudio_modification_ex... | {
"content_hash": "029c3f01230fdef931729b5ceeb2b32e",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 118,
"avg_line_length": 38.846715328467155,
"alnum_prop": 0.6184704998121007,
"repo_name": "cloudio-project/cloudio-endpoint-python",
"id": "ac4513dc3d8e0bb12fce0af2c3768e5b... |
"""Tests for tf.contrib.layers."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import numpy as np
import tensorflow.compat.v1 as tf
import tensorflow.compat.v1.losses as losses
from tf_slim import layers as layers_lib
from tf_slim.layers ... | {
"content_hash": "4fb8b90ebfa6fb8ba86536268373b221",
"timestamp": "",
"source": "github",
"line_count": 4238,
"max_line_length": 80,
"avg_line_length": 41.77394997640396,
"alnum_prop": 0.6495046261254646,
"repo_name": "google-research/tf-slim",
"id": "0aa91d3ba2c57df5c25806438c011760ba14da8d",
"siz... |
"""
Invert a binary tree.
4
/ \
2 7
/ \ / \
1 3 6 9
to
4
/ \
7 2
/ \ / \
9 6 3 1
Trivia:
This problem was inspired by this original tweet by Max Howell:
Google: 90% of our engineers use the software you wrote (Homebrew), but you can’t invert a binary tree on a whiteboard ... | {
"content_hash": "0d0fab0ce597a6f86af26505a33443e2",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 131,
"avg_line_length": 18.27659574468085,
"alnum_prop": 0.6321303841676368,
"repo_name": "Ahmed--Mohsen/leetcode",
"id": "9ea8f2f917feead30d0729995ea1b563c0e99c1d",
"size"... |
""" Configuration handler """
from dynamic_dynamodb import config
CONFIGURATION = config.get_configuration()
def get_configured_tables():
""" Returns a list of all configured tables
:returns: list -- List of tables
"""
try:
return CONFIGURATION['tables'].keys()
except KeyError:
r... | {
"content_hash": "3be2523b635c9d0a7299f32670b5970b",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 74,
"avg_line_length": 21.394736842105264,
"alnum_prop": 0.6260762607626076,
"repo_name": "tellybug/dynamic-dynamodb",
"id": "42713a2a2a5318f18299440bafedc5025ba62aaf",
"si... |
import time
from prometheus_api_client import PrometheusConnect
class PrometheusChecker:
def __init__(self):
self.prometheus_client = PrometheusConnect(url="http://localhost:9090", disable_ssl=True)
def wait_for_metric_class_on_prometheus(self, metric_class, timeout_seconds):
start_time = tim... | {
"content_hash": "fb4c8c5dbc17fa54f9a4614b1a873661",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 198,
"avg_line_length": 57.723404255319146,
"alnum_prop": 0.6763730187983782,
"repo_name": "dtrodrigues/nifi-minifi-cpp",
"id": "14dc8eda6ef3f1388c1d93d1192624193b1b7311",
... |
from __future__ import absolute_import
from __future__ import unicode_literals
import ctypes
import struct
class Packet(object):
# General
VERSION_INFO = 0xFA00
# Differential Base
SET_ACCELERATION = 0xFA10
GET_ACCELERATION = 0xFA11
SET_TARGET_SPEED = 0xFA12
GET_TARGET_SPEED = 0xFA13
... | {
"content_hash": "a71cb586e1e19a7c8f540a63ef340b86",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 78,
"avg_line_length": 27.727810650887573,
"alnum_prop": 0.5633802816901409,
"repo_name": "dfautomation/zalpha-api",
"id": "6161a891e98598040eb5a6e8e4ecb4b50056f8b6",
"siz... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('registrasion', '0004_groupmemberdiscount_groupmemberflag'),
]
operations = [
migrations.AlterField(
model_name='category',
n... | {
"content_hash": "570f5573c276fade2e5bda9ba2026948",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 86,
"avg_line_length": 29.21212121212121,
"alnum_prop": 0.5778008298755186,
"repo_name": "chrisjrn/registrasion",
"id": "e590939469bf3e56db41e06bd1559206bd232625",
"size": ... |
import os, time
boundary = '--boundarydonotcross'
def request_headers():
return {
'Cache-Control': 'no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0',
'Connection': 'close',
'Content-Type': 'multipart/x-mixed-replace;boundary=%s' % boundary,
'Expires': 'Mon... | {
"content_hash": "17aed9ea75fef1b38307024efe054e01",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 101,
"avg_line_length": 29.5,
"alnum_prop": 0.5785310734463277,
"repo_name": "HackaRobot/rpi",
"id": "bd23c7d87eb211ff475d1ba39eb1b986f796d070",
"size": "885",
"binary": ... |
def f(
a,
**kwargs,
) -> A:
with cache_dir():
if something:
result = (
CliRunner().invoke(black.main, [str(src1), str(src2), "--diff", "--check"])
)
limited.append(-limited.pop()) # negate top
return A(
very_long_argument_name1=very_long_value_for... | {
"content_hash": "665b60234f2ca939096d51b3ba0359e7",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 91,
"avg_line_length": 19.99173553719008,
"alnum_prop": 0.5638693675072344,
"repo_name": "psf/black",
"id": "5bb36c26318cbd0b9992b55fd73da3485cf500c7",
"size": "2419",
"... |
from pants.build_graph.target import Target
class ToolsJar(Target):
"""A private target type injected by the JavacPlugin to represent the JDK's tools.jar.
The classpath for this target is provided by the ProvideToolsJar task.
"""
def __init__(self, *args, **kwargs):
super().__init__(scope="c... | {
"content_hash": "c8d03b1c32aced98e4ab41b3e17ec586",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 90,
"avg_line_length": 31.454545454545453,
"alnum_prop": 0.6791907514450867,
"repo_name": "tdyas/pants",
"id": "407c13c4407024ae2d1a4eb0244dfad6e3e75ed3",
"size": "478",
... |
"""User interface for Win32 terminals."""
#
# (C) Pywikibot team, 2003-2019
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, division, unicode_literals
from pywikibot.tools import ModuleDeprecationWrapper
from pywikibot.userinterfaces import (
terminal_interface_base,
... | {
"content_hash": "c9c5112a07f9cae119586500e14ab4bd",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 79,
"avg_line_length": 28.97872340425532,
"alnum_prop": 0.5888399412628488,
"repo_name": "PersianWikipedia/pywikibot-core",
"id": "78f18c9a749a0f38822c1bea255eaf9490340bdd",
... |
try:
import unittest2 as unittest
except ImportError:
import unittest # noqa
from mock import Mock, ANY, call, patch
import six
from six import BytesIO
import time
from threading import Lock
from cassandra import OperationTimedOut
from cassandra.cluster import Cluster
from cassandra.connection import (Connec... | {
"content_hash": "1a067f2441ca7df0ccc483fd46307e06",
"timestamp": "",
"source": "github",
"line_count": 421,
"max_line_length": 141,
"avg_line_length": 40.13776722090261,
"alnum_prop": 0.6185347378387975,
"repo_name": "coldeasy/python-driver",
"id": "3209d312eff9aa812411d19776268454bd7580ee",
"size... |
from __future__ import print_function
import numbers
import os
import sys
import textwrap
import uuid
import prettytable
import six
import yaml
from monascaclient import exc
from oslo_serialization import jsonutils
from oslo_utils import importutils
supported_formats = {
"json": lambda x: jsonutils.dumps(x, in... | {
"content_hash": "4fb523ca969fd9acbf80a5649972e89c",
"timestamp": "",
"source": "github",
"line_count": 281,
"max_line_length": 78,
"avg_line_length": 27.772241992882563,
"alnum_prop": 0.566376217324449,
"repo_name": "sapcc/python-monascaclient",
"id": "c4fac77c32715700c515ca1c5207415f700f93a5",
"s... |
from lisp import Symbol as _S
from proc import _ME, _UME
| {
"content_hash": "8849028507418cbed6b23e63d33dfeff",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 29,
"avg_line_length": 28.5,
"alnum_prop": 0.7368421052631579,
"repo_name": "kuangyh/chord",
"id": "e913e365f22bd3c877f2a0238e6e5b45c0176f49",
"size": "82",
"binary": fals... |
import re
from django.conf import settings
from django.utils.encoding import force_unicode
from django.utils.functional import allow_lazy
from django.utils.translation import ugettext_lazy
from htmlentitydefs import name2codepoint
# Capitalizes the first letter of a string.
capfirst = lambda x: x and force_unicode(x)[... | {
"content_hash": "a8a6eae089c913ecd15934fb31902264",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 132,
"avg_line_length": 34.43065693430657,
"alnum_prop": 0.5590417638329447,
"repo_name": "sanjuro/RCJK",
"id": "7592cead094bd7332bbb9d002a0ecdb8dc2916f2",
"size": "9434",... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Denominator.multiplier'
db.add_column('profiles_denominator', 'multiplier', self.gf('django.db.models.fields... | {
"content_hash": "589600ea9e091d84585e10245bc1bb39",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 192,
"avg_line_length": 81.73869346733669,
"alnum_prop": 0.5555760481986967,
"repo_name": "ProvidencePlan/Profiles",
"id": "b6be0268a5fa0e603fd478e80db15c136faa2824",
"siz... |
import os
import unittest
from collections import OrderedDict
import time
from nose.plugins.attrib import attr
from parameterized.parameterized import parameterized
from conans import DEFAULT_REVISION_V1, load, ONLY_V2
from conans.client.tools import environment_append
from conans.errors import RecipeNotFoundExceptio... | {
"content_hash": "f4833cefeb75ad7ffd05f82cf9d18a74",
"timestamp": "",
"source": "github",
"line_count": 1578,
"max_line_length": 99,
"avg_line_length": 48.19391634980989,
"alnum_prop": 0.624707429322814,
"repo_name": "memsharded/conan",
"id": "fa396fec56e1fdb20d8ba6006b695f474e10722a",
"size": "760... |
import json
import os
import re
import xml.etree.ElementTree as etree
def process_node(path, node):
"""
if node.tag == "TestCase":
if node.attrib.get("result", "UNKNOWN") != "passed":
failset.add(node)
return
if node.tag in ["TestResult", "TestSuite"]:
for child in node:... | {
"content_hash": "2edd7b8305203563902224c40531350a",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 91,
"avg_line_length": 28.795454545454547,
"alnum_prop": 0.5577479610628782,
"repo_name": "pidiscovery/pi",
"id": "0f41f355f7342082d6285c0ff0d206c72b62a465",
"size": "3825... |
import subprocess
from thefuck.utils import for_app, replace_command, eager
@for_app('ifconfig')
def match(command):
return 'error fetching interface information: Device not found' \
in command.output
@eager
def _get_possible_interfaces():
proc = subprocess.Popen(['ifconfig', '-a'], stdout=subpro... | {
"content_hash": "6675f812d27a5a66317e9ca51f719d4a",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 71,
"avg_line_length": 30.608695652173914,
"alnum_prop": 0.671875,
"repo_name": "scorphus/thefuck",
"id": "f65c77ad6c644f8e49d678e05a9a5856a3428300",
"size": "704",
"bina... |
from pyface.ui.wx.action.status_bar_manager import *
| {
"content_hash": "9c265edf53b2102b66d2a9d76853afa1",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 52,
"avg_line_length": 53,
"alnum_prop": 0.7924528301886793,
"repo_name": "enthought/etsproxy",
"id": "646248756fbd81736e81c6682c88cb0dc90f6c7e",
"size": "68",
"binary": f... |
from adafruit import TCS34725
try:
from .component import *
except SystemError:
from component import *
class ColorSensor(LoopedComponent, I2CComponent):
_mswait = 20
_FN = "color"
def init(self):
super().init()
self.tcs = TCS34725(integrationTime=0xEB, gain=0x01)
self... | {
"content_hash": "4e79876fb6780c556f487571a04ea44a",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 68,
"avg_line_length": 24,
"alnum_prop": 0.6060606060606061,
"repo_name": "PHSCRC/boxbot",
"id": "49f9d16967c23b272aaead25a7aea2564d100814",
"size": "792",
"binary": fals... |
"""Bootstrap a buildout-based project
Simply run this script in a directory containing a buildout.cfg.
The script accepts buildout command-line options, so you can
use the -c option to specify an alternate configuration file.
$Id: bootstrap.py 102545 2009-08-06 14:49:47Z chrisw $
"""
import os, shutil, sys, tempfile... | {
"content_hash": "9b2b1447fd4fa5b7fb98b1d4405f07d7",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 79,
"avg_line_length": 27.471153846153847,
"alnum_prop": 0.6272313615680783,
"repo_name": "LPgenerator/pynba",
"id": "30a14cf225f4ba9985f3574f4fc98d189ad7510d",
"size": "3... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('courses', '0033_blank_edx_key'),
]
operations = [
migrations.CreateModel(
name='Topic',
fields=[
('id', models.AutoField(auto_created=True, primary_k... | {
"content_hash": "dc762e680ec2eda846a2aff93eb1a21a",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 114,
"avg_line_length": 29.130434782608695,
"alnum_prop": 0.5537313432835821,
"repo_name": "mitodl/micromasters",
"id": "241ee2219e45ab07b2fc9aee8ca8e1c316a3ac77",
"size": ... |
import os, sys
# Adds the fabric_bolt package from the working copy instead of site_packages
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'fabric_bolt.core.settings.local')
sys.path.append(os.getcwd())
from djang... | {
"content_hash": "4a3166757ac3764ff6e705a265dd7830",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 86,
"avg_line_length": 33.11764705882353,
"alnum_prop": 0.7051509769094139,
"repo_name": "gvangool/fabric-bolt",
"id": "81454aaa4134d36e928a1ca678a1a6266f6e3bbe",
"size": "... |
import sys
import time
import logging
import os
import gc
import datetime
import numpy as np
import pyfits
import scipy
import scipy.interpolate
# Check if we have matplotlib for graphical output
has_matplotlib = True
try :
import matplotlib.pyplot as plt
import matplotlib.patches
except :
has_matplotlib =... | {
"content_hash": "be015468a55baae240555c0d721f5f4a",
"timestamp": "",
"source": "github",
"line_count": 531,
"max_line_length": 257,
"avg_line_length": 44.440677966101696,
"alnum_prop": 0.5603864734299517,
"repo_name": "mraue/pyfact",
"id": "30f1020ad32d70e39e479d36b62b24c474966032",
"size": "25355... |
from django.apps import AppConfig
class CoreConfig(AppConfig):
name = 'aedes_server.core'
verbose_name = 'Aedes'
| {
"content_hash": "786d141ec3dd9e240057f61d502e1a7a",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 33,
"avg_line_length": 17.714285714285715,
"alnum_prop": 0.7096774193548387,
"repo_name": "henriquenogueira/aedes",
"id": "e77ae03badd8fdda3d67187d874eab6c89f0335e",
"size":... |
import os
import sys
import mezzanine_buffer
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
version = mezzanine_buffer.__version__
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
print("You probably want to also tag the version now:")
... | {
"content_hash": "3647257889d535e90bce54fabd0ae0b0",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 81,
"avg_line_length": 29.017543859649123,
"alnum_prop": 0.6124546553808948,
"repo_name": "caffodian/mezzanine-buffer",
"id": "bafadeb610167b48f3240945ad007dcec2456c10",
"s... |
from lxml import etree
import re
import os
import sys
# Regex
re_transform = re.compile('([a-zA-Z]+)\((-?\d+\.?\d*),?\s*(-?\d+\.?\d*)?\)')
re_translate = re.compile('\((-?\d+\.?\d*)\s*,?\s*(-?\d+\.?\d*)\)')
re_coord_split = re.compile('\s+|,')
re_path_coords = re.compile('[a-zA-Z]')
re_path_split = re.compile('([ACHLM... | {
"content_hash": "3aedd52443ee3452158cb9504aa068d4",
"timestamp": "",
"source": "github",
"line_count": 544,
"max_line_length": 138,
"avg_line_length": 34.786764705882355,
"alnum_prop": 0.522722468822659,
"repo_name": "lamka02sk/wrinche",
"id": "396264b99c553f5f95283fcbd37c9721947eb5eb",
"size": "1... |
import sys
import random
test=False
calc_evo=True
extinction=True
seed=-1
outfile="out"
nefile="neat.ne"
solve_evals=0
#was 40000
interval=40000
if(len(sys.argv)>1):
extinction = sys.argv[1]=='e'
seed = int(sys.argv[2])
outfile= sys.argv[3]
nefile=sys.argv[4]
if(len(sys.argv)>5):
interval=int(sys.argv[5])
... | {
"content_hash": "e56c6a2ead01486faff85b78a6d5af36",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 104,
"avg_line_length": 22,
"alnum_prop": 0.6874437443744374,
"repo_name": "jal278/mazerobot-python",
"id": "f5ac054c57080964be8e2a43c28465482cbc2c0a",
"size": "4444",
"... |
import urllib
import oauth
# Fill in the application's information in hidden
import hidden
# How to do OAuth signing
def augment(url, parameters):
secrets = hidden.oauth()
consumer = oauth.OAuthConsumer(secrets['consumer_key'], secrets['consumer_secret'])
token = oauth.OAuthToken(secrets['token_key'],secre... | {
"content_hash": "369075ca6437d35b25f927fb90ae809f",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 87,
"avg_line_length": 31.314285714285713,
"alnum_prop": 0.6733576642335767,
"repo_name": "lastralab/Statistics",
"id": "604a99f07ab4d14a56171452a3a5470c8998accf",
"size": ... |
"""This script runs an automated Cronet performance benchmark.
This script:
1. Sets up "USB reverse tethering" which allow network traffic to flow from
an Android device connected to the host machine via a USB cable.
2. Starts HTTP and QUIC servers on the host machine.
3. Installs an Android app on the attached And... | {
"content_hash": "d2b6803ce6b0bcffbbbbdf21abcec271",
"timestamp": "",
"source": "github",
"line_count": 316,
"max_line_length": 80,
"avg_line_length": 37.901898734177216,
"alnum_prop": 0.6984219754529515,
"repo_name": "lihui7115/ChromiumGStreamerBackend",
"id": "111a907bee8ec99c0974eed756260ce8c042e6... |
from optparse import make_option
import subprocess
from multiprocessing import Pool
from bluebottle.common.management.commands.base import Command as BaseCommand
from bluebottle.clients.models import Client
def reindex(schema_name):
print(f'reindexing tenant {schema_name}')
return (
schema_name,
... | {
"content_hash": "d905a26b10a931e7ed33cf3785bdc957",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 110,
"avg_line_length": 26.13953488372093,
"alnum_prop": 0.6165480427046264,
"repo_name": "onepercentclub/bluebottle",
"id": "3c128573a3a4c1e288f9eef17a9b8bfc6d23e73f",
"si... |
"""Area/message template importer for CAPCollector project.
Imports area/messages template files to corresponding SQL tables.
File names must end with .xml.
An area template is a single CAP <area> block.
A message template is a single CAP <alert> block with a single <info> block;
<area> blocks are ignored.
Run
$ pyth... | {
"content_hash": "2c8001b9f4dc729778c1f81390999c00",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 80,
"avg_line_length": 34.11594202898551,
"alnum_prop": 0.7073067119796091,
"repo_name": "CAPTools/CAPCollector",
"id": "15f67a46d9f0e6586f1e6d176506ac3a77aff264",
"size": ... |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | {
"content_hash": "6e7a3eef76f0faebc08226b18ec712e3",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 278,
"avg_line_length": 40.714285714285715,
"alnum_prop": 0.7017543859649122,
"repo_name": "arenadata/ambari",
"id": "0de2f5b59150b0dc985e6f5f3d1e791872dee537",
"size": "28... |
"""Helper utilities for Faint file formats."""
import ifaint
def _io_save_error(io_error, file_name):
"""Turns an IOException (which would be reported as an
internal error) into an ifaint.SaveError, which is reported
without stack-trace etc."""
err_str = 'Faint could not write to "%s".\n\nError code: ... | {
"content_hash": "88f72f4836421539ec7d1face7f905ce",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 75,
"avg_line_length": 30.931818181818183,
"alnum_prop": 0.6296840558412932,
"repo_name": "tectronics/faint-graphics-editor",
"id": "79965edfa46f36c69147fcc713678326b95455a4"... |
from datadog_checks.base import AgentCheck, ConfigurationError
from datadog_checks.base.errors import CheckException
class KernelcareCheck(AgentCheck):
KEY_KCARE_NAGIOS_ENDPOINT = 'https://cln.cloudlinux.com/clweb/api/kcare/nagios/'
RES_KCARE_NAGIOS_ENDPOINT = 'https://cln.cloudlinux.com/clweb/api/kcare/nagi... | {
"content_hash": "cf6c32c94f41605365aa353f82317a4d",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 104,
"avg_line_length": 33.03846153846154,
"alnum_prop": 0.5968180054326736,
"repo_name": "DataDog/integrations-extras",
"id": "911e04149f7e46bd08d02801e51ab1c859b1fdf7",
"... |
import logging
from django import template
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tabs
from trove_dashboard import api
from trove_dashboard.content.database_configurations \
import config_param_manager
from trove_dashboard.content.databases impor... | {
"content_hash": "8f0a26162528b6642c200e5aa50b362c",
"timestamp": "",
"source": "github",
"line_count": 208,
"max_line_length": 77,
"avg_line_length": 35.34615384615385,
"alnum_prop": 0.5832426550598476,
"repo_name": "Tesora-Release/tesora-trove-dashboard",
"id": "cfe1ce0d89895a4b0b44eaf0524a5665e3d4... |
try:
from setuptools import setup
except:
from distutils.core import setup
setup(
name = "parikstra",
description = "Parisian transport system API client",
py_modules = ["parikstra"],
test_suite = "tests",
install_requires = [
"beautifulsoup4",
"requests",
],
... | {
"content_hash": "4144dc650510ce987d5823915cdbe858",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 57,
"avg_line_length": 23.46875,
"alnum_prop": 0.5752330226364847,
"repo_name": "Gawen/parikstra",
"id": "018716e678e1e41a52907235dd74766cefeda2da",
"size": "774",
"binar... |
from joueur.delta_mergeable import DeltaMergeable
# the base class that every game object within a game inherit from for Python
# manipulation that would be redundant via Creer
class BaseGameObject(DeltaMergeable):
def __init__(self):
DeltaMergeable.__init__(self)
def __str__(self):
return "{... | {
"content_hash": "3e6df7bf2f2b743c8178d7191dc02018",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 77,
"avg_line_length": 30,
"alnum_prop": 0.6491228070175439,
"repo_name": "siggame/Joueur.py",
"id": "b4db2b9b8e8d3256c86648d9c9224d9502dbd6cd",
"size": "570",
"binary": ... |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('accounting', '0053_app_user_profiles_advanced'),
]
operations = [
migrations.CreateModel(
name='AuthenticatedEmailDomain',
... | {
"content_hash": "6bb3910991a6c941a5689323fa447d5c",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 132,
"avg_line_length": 53.74647887323944,
"alnum_prop": 0.5911949685534591,
"repo_name": "dimagi/commcare-hq",
"id": "55e42ca3fb4c6d562905d4cba393593334ed5fe4",
"size": "3... |
from lxml import etree
from src.Player import Player, Video
import praw
import re
import pickle
r = praw.Reddit("filling the database")
def contains_video_link(text):
return "oddshot" in text or "youtu.be" in text or "twitch.tv" in text or "youtube" in text
def get_url(submission):
text = submission.selfte... | {
"content_hash": "8e7a817725076496cec2dbbc9666a811",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 118,
"avg_line_length": 35.22727272727273,
"alnum_prop": 0.54,
"repo_name": "Ashvio/ProPlayerInfoBot",
"id": "8195789f774b372cc57e6ded1373afa3e2dd0c40",
"size": "4650",
... |
from bs4 import BeautifulSoup
import urllib
#csv is for the csv writer
import csv
#initiates the dictionary to hold the output
holder = []
#this is the target URL
target_url = "target.html"
def scraper(url):
#opens the url for read access
this_url = urllib.urlopen(url).read()
#creates a new BS holder b... | {
"content_hash": "cf00e4fa8fda3b4cbeda9ef20fd03322",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 90,
"avg_line_length": 30.275229357798164,
"alnum_prop": 0.6260606060606061,
"repo_name": "mwweinberg/guofa-scraper",
"id": "cf988f9800f233b15dc01177636cf1786b534c39",
"si... |
from oslo.config import cfg
import webob.exc
from glance.common import exception
from glance.openstack.common import excutils
from glance.common import utils
import glance.db
import glance.openstack.common.log as logging
import glance.registry.client.v1.api as registry
import glance.store
CONF = cfg.CONF
LOG = loggi... | {
"content_hash": "38671cd225be0bdcd6c5f317f88cd240",
"timestamp": "",
"source": "github",
"line_count": 229,
"max_line_length": 79,
"avg_line_length": 40.109170305676855,
"alnum_prop": 0.5502449646162221,
"repo_name": "citrix-openstack-build/glance",
"id": "b718c399555432d6e1af59a03650dcff70a24117",
... |
"""
Copyright 2017 Robin Verschueren
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... | {
"content_hash": "c669168eaf64bef916f71f7b614faaf4",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 75,
"avg_line_length": 30.611940298507463,
"alnum_prop": 0.6313993174061433,
"repo_name": "merraksh/cvxpy",
"id": "1a127f81ea2bbcde2dbe2fb28e90bf0f93348de9",
"size": "2051"... |
'''Functions for defining, extracting data from, and serializing transform matrices'''
from numpy import *
def MakeTransform(rot,trans):
if size(rot,0) == 9 and size(rot,1) == 1:
tm = rot.reshape(3,3)
elif size(rot,0) == 3 and size(rot,1) == 3:
tm = rot
else:
print('rotation imprope... | {
"content_hash": "7004558be02611ffe1f2789787a542b1",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 86,
"avg_line_length": 29.026315789473685,
"alnum_prop": 0.5947416137805984,
"repo_name": "yzxsunshine/SoCBirrt",
"id": "1d149a3b1f4fd08d17aeee684c606d79a42df732",
"size": ... |
def get_card_mask(card_type, card_number):
raise NotImplementedError()
| {
"content_hash": "746dda152333b91a5e704a5bde157aa9",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 42,
"avg_line_length": 37.5,
"alnum_prop": 0.7466666666666667,
"repo_name": "coolshop-com/coolshop-application-assignment",
"id": "c27741779157d4f4a8739fac8b6bf039c6e9113a",
... |
from flask import Flask
from routing.api import api
def create_app():
app = Flask(__name__)
app.register_blueprint(api)
return app
| {
"content_hash": "0c8007878084b4d91b4ee0d26af040c1",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 31,
"avg_line_length": 20.571428571428573,
"alnum_prop": 0.6875,
"repo_name": "evz/routing",
"id": "97f99a93838222fb0284437f9222d069ca574990",
"size": "144",
"binary": fal... |
from __future__ import unicode_literals
from django.db import models, migrations
import django.contrib.postgres.fields.hstore
from django.contrib.postgres.operations import HStoreExtension
class Migration(migrations.Migration):
dependencies = [
('events', '0004_auto_20150607_2003'),
]
operation... | {
"content_hash": "3821307f473bc5e5d0a9c97c0d09041b",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 79,
"avg_line_length": 27.96153846153846,
"alnum_prop": 0.6354883081155434,
"repo_name": "tuomas777/linkedevents",
"id": "ebc9340db30d2e27a579d48bbcb09419c0a05cd5",
"size":... |
from . import tservers
class TestApp(tservers.HTTPProxyTest):
def test_basic(self):
assert self.app("/").status_code == 200
def test_cert(self):
for ext in ["pem", "p12"]:
resp = self.app("/cert/%s" % ext)
assert resp.status_code == 200
assert resp.content... | {
"content_hash": "1cfa3fc0d611a0625d45ea16284c1251",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 47,
"avg_line_length": 24.692307692307693,
"alnum_prop": 0.5638629283489096,
"repo_name": "gzzhanghao/mitmproxy",
"id": "4c9eff08ea054150005e1f24778056b9b8738312",
"size": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.