text stringlengths 4 1.02M | meta dict |
|---|---|
import os
import subprocess
import sys
SEVENZIP_EXE = os.path.join('.', '7zip', 'x64', '7za.exe')
BSDIFF_EXE = os.path.join('.', 'bsdiff', 'bsdiff.exe')
BSPATCH_EXE = os.path.join('.', 'bsdiff', 'bspatch.exe')
def bsdiff(oldFile, newFile, patchFile, silent=False):
"""Creates a binary diff between <oldFile> and <... | {
"content_hash": "14648006096d192f1f779328070332a7",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 103,
"avg_line_length": 34.02469135802469,
"alnum_prop": 0.6262699564586357,
"repo_name": "bschug/bindirpatch",
"id": "a0daacd3f60470a0d1748d8d1217d1461f110902",
"size": "2... |
import asyncio
import copy
import math
import operator
import sys
import time
from functools import partial
from threading import Thread
import pytest
from werkzeug import local
if sys.version_info < (3, 7):
def run_async(coro):
return asyncio.get_event_loop().run_until_complete(coro)
else:
def ... | {
"content_hash": "1cc4ac4897aaa4e405123cce43340954",
"timestamp": "",
"source": "github",
"line_count": 642,
"max_line_length": 82,
"avg_line_length": 21.152647975077883,
"alnum_prop": 0.5355670103092783,
"repo_name": "fkazimierczak/werkzeug",
"id": "b5c392890ad87ab134a127e50ce1d3dc4442cf03",
"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": "370cdaa6424b44a5f9189df9cde9d3be",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 103,
"avg_line_length": 41.58139534883721,
"alnum_prop": 0.7664988814317674,
"repo_name": "arenadata/ambari",
"id": "652c23ea4c0f28d600fd3a4d5c91b62e9b73543d",
"size": "357... |
""" Principal Component Analysis
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Denis A. Engemann <d.engemann@fz-juelich.de>
# Michael Eickenberg <michael.eickenberg@inria.fr>
#
# Lice... | {
"content_hash": "ef6c5c9909710729581fa772c589c98e",
"timestamp": "",
"source": "github",
"line_count": 698,
"max_line_length": 80,
"avg_line_length": 33.90830945558739,
"alnum_prop": 0.5948115599121176,
"repo_name": "walterreade/scikit-learn",
"id": "6169f5ca811ad6914cd9b3fb53e7103e0c208ed7",
"siz... |
from datetime import datetime, timezone, timedelta
import json
import sys
import tempfile
from shutil import rmtree
from os import path as op
import numpy as np
# Adapted from six
PY3 = sys.version_info[0] == 3
text_type = str if PY3 else unicode # noqa
string_types = str if PY3 else basestring # noqa
special_char... | {
"content_hash": "1316c87b8d0bb007559909e985f18928",
"timestamp": "",
"source": "github",
"line_count": 741,
"max_line_length": 79,
"avg_line_length": 36.78137651821862,
"alnum_prop": 0.5395340304531279,
"repo_name": "bloyl/mne-python",
"id": "ccb6c340f95e0f9887210934005fc26df4f674d9",
"size": "273... |
import contextlib
import uuid
from oslo.config import cfg
from oslo import messaging
from oslo.utils import excutils
from heat.common import exception
from heat.common.i18n import _
from heat.common import messaging as rpc_messaging
from heat.db import api as db_api
from heat.openstack.common import log as logging
fr... | {
"content_hash": "01fc51c7b3acd9728f1d66897c9f48f7",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 79,
"avg_line_length": 38.255172413793105,
"alnum_prop": 0.5361456643230575,
"repo_name": "redhat-openstack/heat",
"id": "735d8667b4dcb893c6a166b5ea4792171b7c8469",
"size"... |
"""Videos are randomly generated using a Windows executable and stored in
directories before this code is run"""
from VideoTools import *
from TDA import *
from sklearn.decomposition import PCA
import numpy as np
import scipy.io as sio
import os
from ROCExperiments import *
def runExperiments(foldername, packetLoss, N... | {
"content_hash": "79a9291913837468557060b5dfe5f567",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 136,
"avg_line_length": 40.92307692307692,
"alnum_prop": 0.6368421052631579,
"repo_name": "ctralie/SlidingWindowVideoTDA",
"id": "5d85f4ae0d56195bda269041d972a0e99147de7a",
... |
"""
homeassistant.components.alarm_control_panel.manual
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for manual alarms.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.manual/
"""
import logging
import datetime
import ho... | {
"content_hash": "14fb469202556ee9ee85a129554f2820",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 74,
"avg_line_length": 33.3445945945946,
"alnum_prop": 0.6024316109422493,
"repo_name": "sfam/home-assistant",
"id": "2658e005aea73c2e09976b87152e744a669c518c",
"size": "4... |
from django.conf.urls import *
from django.http import HttpResponseRedirect
from anon_provider import AnonProvider, openid_page
urlpatterns = patterns('',
(r'^$', lambda r: HttpResponseRedirect('/openid/')),
(r'^server/$', AnonProvider()),
(r'^(\w+)/$', openid_page),
)
| {
"content_hash": "2506ee790cc082cd35ac54ccf4607159",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 56,
"avg_line_length": 31.444444444444443,
"alnum_prop": 0.6784452296819788,
"repo_name": "fgirault/smeuhsocial",
"id": "8445e443a775ea978c9c18d24c4059f5bd354363",
"size": "... |
from __future__ import unicode_literals
import pytest
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
from machina.apps.forum.admin import PickUserForm
from machina.apps.forum_permission.models import ForumPermission
from machina.apps.forum_permission.models import GroupForum... | {
"content_hash": "14ec300d8b1e64186a64971b68ff2a1f",
"timestamp": "",
"source": "github",
"line_count": 353,
"max_line_length": 100,
"avg_line_length": 44.725212464589234,
"alnum_prop": 0.6102736255383836,
"repo_name": "reinbach/django-machina",
"id": "00ccc0bb7eec664e32230165f394d20e5cea2d6c",
"si... |
from lbrynet.dht.node import Node
import binascii
from twisted.internet import reactor, task
import logging
import sys
from lbrynet.core.utils import generate_id
log = logging.getLogger(__name__)
def print_usage():
print "Usage:\n%s UDP_PORT KNOWN_NODE_IP KNOWN_NODE_PORT HASH"
def join_network(udp_port, known... | {
"content_hash": "662e7c3670a97c37d323378b0d40cc2a",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 99,
"avg_line_length": 23.844660194174757,
"alnum_prop": 0.6319218241042345,
"repo_name": "DaveA50/lbry",
"id": "7d6dec167b609c2afd642c9f8c7684ef86c60623",
"size": "2456",... |
"""Tests for tf.layers.core."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.layers import conv_utils
from tensorflow.python.platform import test
class ConvUtilsTest(test.TestCase):
def testConvertDataFormat(self):
self.as... | {
"content_hash": "cc5ea19719fa7b7a546df391916fb1bc",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 80,
"avg_line_length": 33.50877192982456,
"alnum_prop": 0.6837696335078534,
"repo_name": "ppries/tensorflow",
"id": "431be414c22523fe485a6cc642129ba0be66ce5a",
"size": "259... |
"""Test for the set_val() view."""
import argparse
import django
import logging
import os
import sys
django.setup()
# env
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djsani.settings.shell')
from django.conf import settings
from django.contrib.auth.models import User
from djsani.core.utils import get_content_type... | {
"content_hash": "bbcc5023b029133fca131453334f5dd8",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 72,
"avg_line_length": 30.886138613861387,
"alnum_prop": 0.593684885398301,
"repo_name": "carthagecollege/django-djsani",
"id": "7b8fe9849dd8b081ac5b570fe451624e7ab4e801",
... |
from botless.models import AppIntegration
class S3(AppIntegration):
pass
| {
"content_hash": "594d1b336239f518d2a8f567d3a48192",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 41,
"avg_line_length": 15.8,
"alnum_prop": 0.7848101265822784,
"repo_name": "ivansabik/botless",
"id": "fd9879a6d558005c70b6f00fb6fb172b9c020e1f",
"size": "79",
"binary": ... |
import sys
import select
import termios
from time import sleep
import pytest
from pynq import Overlay
from pynq.overlays.base import BaseOverlay
from pynq.tests.util import user_answer_yes
try:
ol = Overlay('base.bit', download=False)
flag0 = True
except IOError:
flag0 = False
flag1 = user_answer_yes("\... | {
"content_hash": "0beeb92d34709145f5013e2f41e06e19",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 78,
"avg_line_length": 26.5,
"alnum_prop": 0.6467505241090147,
"repo_name": "Xilinx/PYNQ",
"id": "0707582deac4f1783095fe3dbefb8936697352ca",
"size": "1989",
"binary": fal... |
import os
import ssl
import sqlalchemy
# connect_tcp_socket initializes a TCP connection pool
# for a Cloud SQL instance of Postgres.
def connect_tcp_socket() -> sqlalchemy.engine.base.Engine:
# Note: Saving credentials in environment variables is convenient, but not
# secure - consider a more secure solutio... | {
"content_hash": "c34c43b862123db61d49cca64926934e",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 100,
"avg_line_length": 44.129411764705885,
"alnum_prop": 0.6542255398560384,
"repo_name": "GoogleCloudPlatform/python-docs-samples",
"id": "3c22165d980356b729394b5f39b4cd92e... |
"""add active boolean to committees
Revision ID: 39f25296cd6
Revises: 46085f5c8e36
Create Date: 2017-05-22 12:12:39.327466
"""
# revision identifiers, used by Alembic.
revision = '39f25296cd6'
down_revision = '46085f5c8e36'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto genera... | {
"content_hash": "7296c7635d62862c409b4d80da71f3df",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 114,
"avg_line_length": 25.46153846153846,
"alnum_prop": 0.6963746223564955,
"repo_name": "Code4SA/pmg-cms-2",
"id": "796bfc2698331b41271832781f20648025f7ac34",
"size": "66... |
def should_fizz(number):
'''Whether or not "fizz" should be printed for this number'''
return number % 3 == 0 | {
"content_hash": "c201510132ba2bcb9bc8d347d1de31c2",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 65,
"avg_line_length": 39,
"alnum_prop": 0.6581196581196581,
"repo_name": "sourcegraph/python-langserver",
"id": "4a60e3ef58047fd439b61c340e03d01b1b6a8bf8",
"size": "117",
... |
from azure.identity import DefaultAzureCredential
from azure.mgmt.synapse import SynapseManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-synapse
# USAGE
python sql_pool_vulnerability_assessment_rule_baseline_get.py
Before run the sample, please set the values of t... | {
"content_hash": "75d34cf59e43e4ed5121f9e4307bcb4a",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 156,
"avg_line_length": 36.78378378378378,
"alnum_prop": 0.7369581190301249,
"repo_name": "Azure/azure-sdk-for-python",
"id": "2a52c539aa7ed7a581078a738b399ebe287781ca",
"s... |
from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
from collections import OrderedDict
import math
import numpy as np
import os
import subprocess
import pygion
from pygion import disjoint_complete, index_launch, print_once, task, Domain, Fspace, Future, Ispace, IndexLau... | {
"content_hash": "ed7c8c628c9b1d71fa245a15eb675d79",
"timestamp": "",
"source": "github",
"line_count": 266,
"max_line_length": 185,
"avg_line_length": 42.20676691729323,
"alnum_prop": 0.6279504765297943,
"repo_name": "StanfordLegion/legion",
"id": "2783cf15665d8ed27192c2b5daea3a3e8be074cd",
"size"... |
"""Test MQTT diagnostics."""
import json
from unittest.mock import ANY
import pytest
from homeassistant.components import mqtt
from tests.common import async_fire_mqtt_message, mock_device_registry
from tests.components.diagnostics import (
get_diagnostics_for_config_entry,
get_diagnostics_for_device,
)
de... | {
"content_hash": "37aa2f12318758dccb304408e992541d",
"timestamp": "",
"source": "github",
"line_count": 269,
"max_line_length": 87,
"avg_line_length": 31.03717472118959,
"alnum_prop": 0.49742484129835907,
"repo_name": "toddeye/home-assistant",
"id": "65399a22f703b9fd370445f921f77d0061951ca1",
"size... |
"Base Cache class."
from __future__ import unicode_literals
import warnings
from django.core.exceptions import ImproperlyConfigured, DjangoRuntimeWarning
from django.utils.importlib import import_module
class InvalidCacheBackendError(ImproperlyConfigured):
pass
class CacheKeyWarning(DjangoRuntimeWarning):
... | {
"content_hash": "73689c74713d4ac8b881e1bf75f63746",
"timestamp": "",
"source": "github",
"line_count": 233,
"max_line_length": 87,
"avg_line_length": 34.2961373390558,
"alnum_prop": 0.606432236265799,
"repo_name": "chrisfranzen/django",
"id": "7234d3c4db8148e03375d4b89c22a3a5bf696560",
"size": "79... |
"""
The database schema of GoogleScraper.
There are four entities:
ScraperSearch: Represents a call to GoogleScraper. A search job.
SearchEngineResultsPage: Represents a SERP result page of a search_engine
Link: Represents a LINK on a SERP
Proxy: Stores all proxies and their statuses.
Because searche... | {
"content_hash": "92a4df5fb63c93d78f3511297489a9de",
"timestamp": "",
"source": "github",
"line_count": 289,
"max_line_length": 120,
"avg_line_length": 32.055363321799305,
"alnum_prop": 0.6395725388601037,
"repo_name": "ARDivekar/SearchDistribute",
"id": "f31223972c0090a645baf4019bc95941da87fe04",
... |
try:
import simplejson as json
except ImportError:
import json
from rest_framework.views import APIView
from rest_framework import permissions, status
from rest_framework.response import Response
from rest_framework.exceptions import NotFound
from django.db import IntegrityError
from reviews_manager.models i... | {
"content_hash": "818d48e548cf6d4104819154427c0a97",
"timestamp": "",
"source": "github",
"line_count": 266,
"max_line_length": 120,
"avg_line_length": 50.57142857142857,
"alnum_prop": 0.6828724353256022,
"repo_name": "lucalianas/ProMort",
"id": "baf4f7c39cd78678dafb4977c1d6f9e597c12060",
"size": "... |
from collections import OrderedDict
from typing import Dict, Type
from .base import GoogleAdsFieldServiceTransport
from .grpc import GoogleAdsFieldServiceGrpcTransport
# Compile a registry of transports.
_transport_registry = (
OrderedDict()
) # type: Dict[str, Type[GoogleAdsFieldServiceTransport]]
_transport_re... | {
"content_hash": "3b280950a97eb3270679dd9ddcb4f158",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 64,
"avg_line_length": 29.1875,
"alnum_prop": 0.7944325481798715,
"repo_name": "googleads/google-ads-python",
"id": "0e9210c55d59b154d756efe6e155d2333a511ad5",
"size": "106... |
from celery.task import task
from scipy.stats import mannwhitneyu
@task
def task_mannwhitneyu(dataOne, dataTwo):
"""
http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.mannwhitneyu.html
"""
uvalue, pvalue = mannwhitneyu(dataOne, dataTwo)
return uvalue, pvalue
| {
"content_hash": "c6c0057577d3d3851139f7e8fd759f09",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 85,
"avg_line_length": 22.846153846153847,
"alnum_prop": 0.7306397306397306,
"repo_name": "oess/django-caddstat",
"id": "cc5abb2a6c67cecebd86b3ffb120872ad950747d",
"size": ... |
from .geometry import Point
from .geometry import Line
from .particles import Distribution
from .orm import get_orm
from .orm import get_orbit
from .orm import inverse_matrix
from .orm import get_correctors_settings
__all__ = ['Point', 'Line', 'Distribution',
'get_orm', 'get_orbit', 'inverse_matrix',
... | {
"content_hash": "5ddf23bb29dc84ba916ce86f90b25485",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 52,
"avg_line_length": 32,
"alnum_prop": 0.7045454545454546,
"repo_name": "archman/phantasy",
"id": "fe740dcb68196a91f95bfacc52eb492b0f86827d",
"size": "409",
"binary": f... |
from zooq import ZooQ
from zooqdb import ZooQDB
| {
"content_hash": "4837deb63f735bd2da7cbcd91a238092",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 25,
"avg_line_length": 24,
"alnum_prop": 0.8333333333333334,
"repo_name": "ckane/zooq",
"id": "80cd018b83469ece6d09c20494900324b3982808",
"size": "70",
"binary": false,
... |
class Transaction:
def __init__(self, amount, order, url_ok, url_ko, transaction_type='0', currency='840', language='0'):
self.DS_MERCHANT_AMOUNT = str(amount)
self.DS_MERCHANT_ORDER = str(order)
self.DS_MERCHANT_TRANSACTIONTYPE = str(transaction_type)
self.DS_MERCHANT_CURRENCY = str... | {
"content_hash": "f03a8029c31936c6a1b520c4cfd198fa",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 106,
"avg_line_length": 51.44444444444444,
"alnum_prop": 0.6609071274298056,
"repo_name": "lexotero/python-redsys",
"id": "867ee99965736c74e649224d88b385f02fb789ed",
"size":... |
"""
Django settings for IngressKeysManagement project.
Generated by 'django-admin startproject' using Django 1.11.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
... | {
"content_hash": "af1f4b37cc69920cc40b2681402794f3",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 91,
"avg_line_length": 26.897959183673468,
"alnum_prop": 0.6906929691451694,
"repo_name": "bllli/ingress-keys-management",
"id": "acf4370c908688aff5eaf7a3b560bb666e00b4de",
... |
"""A set of simple Artifact types for use with AI Platform Pipelines.
Experimental: the artifact definitions here are expected to change.
"""
from tfx.types import artifact
class Dataset(artifact.Artifact):
TYPE_NAME = 'Dataset'
class File(artifact.Artifact):
TYPE_NAME = 'File'
class Statistics(artifact.Art... | {
"content_hash": "ce430401d50f4768e97fef8bdf6db26f",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 69,
"avg_line_length": 18.863636363636363,
"alnum_prop": 0.744578313253012,
"repo_name": "tensorflow/tfx",
"id": "4363693ebc221572c06d951ec374679a0e3f4030",
"size": "1011",... |
from os.path import isfile
from .. import app_log
from ..mastodon.get_api import get_mastodon_api
from ..twitter.get_api import get_twitter_api
from ..utils.config import get_config, get_config_file, init_config
from .data import init_param, invalid_param, invalid_param_api
def test_config_file(monkeypatch, tmpdir):... | {
"content_hash": "748d8d851652ca600d1d6aa6dc1798ad",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 78,
"avg_line_length": 38.8,
"alnum_prop": 0.6415543219666932,
"repo_name": "SamR1/django-twittfeed",
"id": "2ef4a5665e3d13a3add8a21122409a3dbed1a33f",
"size": "2522",
"b... |
__desc__ = "Python API and utilities for Batfish"
__name__ = "pybatfish"
__url__ = "https://github.com/batfish/pybatfish"
__version__ = "0.36.0"
| {
"content_hash": "f8fc1a8a37481c2af1af5494bfa541d2",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 49,
"avg_line_length": 21.142857142857142,
"alnum_prop": 0.6216216216216216,
"repo_name": "batfish/pybatfish",
"id": "4b151cb70e4a613bb4dabe0498b8ead6daa1fc52",
"size": "955... |
import csv
import fnmatch
import getopt
import logging
import os
import platform
import random
import re
import shutil
import string
import sys
import time
## Main logger
#
# There are two loggers:
# 1. A file logger starting a WARNING level
# 2. A console logger starting a DEUBG level
logger = logging.getLogge... | {
"content_hash": "39fba68726f60d348fab91472404f9ab",
"timestamp": "",
"source": "github",
"line_count": 738,
"max_line_length": 77,
"avg_line_length": 29.814363143631436,
"alnum_prop": 0.6240058173885379,
"repo_name": "jtheoof/dotfiles",
"id": "ba61d400f8b57fa12cc8c3893ae9262d26ff44e7",
"size": "22... |
from __future__ import absolute_import, unicode_literals
from functools import reduce
import json
import logging
from django.contrib.admin.views import main
from django.contrib.admin.actions import delete_selected
from django.contrib.auth import get_permission_codename
from django.contrib.staticfiles.templatetags.sta... | {
"content_hash": "980bb6a6fa1180bf993023febc7a641f",
"timestamp": "",
"source": "github",
"line_count": 530,
"max_line_length": 79,
"avg_line_length": 37.8811320754717,
"alnum_prop": 0.5754843851172984,
"repo_name": "joshuajonah/feincms",
"id": "9774dd4f5b36f5e95973f684adb635eeca15d21b",
"size": "2... |
from django.contrib import admin
from userprofile.models import *
admin.site.register(UserProfile)
| {
"content_hash": "d0bfa5b141bd06c10df34d0f51c8c774",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 32,
"avg_line_length": 25,
"alnum_prop": 0.83,
"repo_name": "zeickan/Django-Store",
"id": "a2d037bf65412ed17f42fa09c469f8b2573b30f4",
"size": "127",
"binary": false,
"co... |
from AxoPatch200 import *
| {
"content_hash": "2de137f4e9cce86e71c1267bd639bd5e",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 25,
"avg_line_length": 13.5,
"alnum_prop": 0.7777777777777778,
"repo_name": "hiuwo/acq4",
"id": "3af91bc68d1748b77cb42bafebb7f04500f8f0ef",
"size": "49",
"binary": false,
... |
"""
Copyright (c) 2016-2019 billyoyo
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, ... | {
"content_hash": "4305803f2023df79a5619f5d176da089",
"timestamp": "",
"source": "github",
"line_count": 368,
"max_line_length": 460,
"avg_line_length": 37.391304347826086,
"alnum_prop": 0.5883720930232558,
"repo_name": "billy-yoyo/RainbowSixSiege-Python-API",
"id": "0738ccd92f946b72effee0653a72131697... |
from django.views.generic.edit import CreateView
from django.http import HttpResponse, HttpResponseRedirect
from iiits.config import templates, urls
from iiits.mixins import AjaxableResponseMixin
from iiits.models import *
from iiits.forms import *
# Notice Board
class AddNotice(AjaxableResponseMixin, CreateView):
mo... | {
"content_hash": "528ef4d7ab88ce3c3ebfbd151bb73870",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 68,
"avg_line_length": 33.54838709677419,
"alnum_prop": 0.7778846153846154,
"repo_name": "IIITS/iiits.ac.in",
"id": "5ee0d88423ed179d6dc460dcda1e2749ec33075f",
"size": "104... |
import logging
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms
from horizon import workflows
from trove_dashboard import api
LOG = logging.getLogger(__name__)
class BackupDetailsAction(workflows.Action):
name = forms.CharField(max_length=80, lab... | {
"content_hash": "1c3368b66388086f59ec846f41b5bbd9",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 77,
"avg_line_length": 35,
"alnum_prop": 0.6056277056277056,
"repo_name": "rmyers/trove-dashboard",
"id": "891d03ba021e8229aab575d05ad3c532def8ba3a",
"size": "2965",
"bin... |
"""
SDoc
Copyright 2016 Set Based IT Consultancy
Licence MIT
"""
# ----------------------------------------------------------------------------------------------------------------------
from sdoc.sdoc1.data_type.DataType import DataType
class StringDataType(DataType):
"""
Class for string data types.
""... | {
"content_hash": "03a576306e659d99a86428888f43992b",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 120,
"avg_line_length": 28.81578947368421,
"alnum_prop": 0.28127853881278536,
"repo_name": "OlegKlimenko/py-sdoc",
"id": "9bf51fda94a062138f5e4ee759df8e5a72bd6370",
"size"... |
'''
Created on 23. nov. 2015
@author: kga
'''
from datetime import datetime
from base import ScrapeBaseSelenium
import sbot.twitter.scraper.functions.db as dbfunctions
import sbot.twitter.scraper.functions.helper as helper
class GetUser(ScrapeBaseSelenium):
"""
Get user class.
"""
def __i... | {
"content_hash": "8368eade0b7646c0f7b1c0d4771776fd",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 170,
"avg_line_length": 38.121212121212125,
"alnum_prop": 0.6065182829888712,
"repo_name": "kimgea/twitter_scraper_selenium",
"id": "a2c3851982e92cc1074631b7d3665f64841177ec"... |
from .fields import TagField
| {
"content_hash": "3904ca1cd9d1f66cad2e0bddeba5ec7b",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 28,
"avg_line_length": 29,
"alnum_prop": 0.8275862068965517,
"repo_name": "koorgoo/django-taggee",
"id": "a4049cc2e1d3dd5587d0ce67ae38fbeec889847f",
"size": "29",
"binary"... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "fo2.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
# issue is really ... | {
"content_hash": "2e0ed260f7ab80155ba81286b8e9d599",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 77,
"avg_line_length": 37.095238095238095,
"alnum_prop": 0.6187419768934531,
"repo_name": "anselmobd/fo2",
"id": "cfc5fda7809d1df286059d78844100c231ad0896",
"size": "801",
... |
import unittest
import threading
import imath
import inspect
import time
import IECore
import Gaffer
import GafferUI
import GafferTest
import GafferUITest
class NestedPlugTestNode( Gaffer.Node ) :
def __init__( self ) :
Gaffer.Node.__init__( self )
IECore.registerRunTimeTyped( NestedPlugTestNode )
Gaffer.Metad... | {
"content_hash": "75a23e29cc31e32bf97e54beb250d7b0",
"timestamp": "",
"source": "github",
"line_count": 1823,
"max_line_length": 276,
"avg_line_length": 36.48546352166758,
"alnum_prop": 0.6468509915354893,
"repo_name": "GafferHQ/gaffer",
"id": "a79750f32b5cf5673f64867bbc2f240813e68191",
"size": "68... |
import socket
from threading import *
import json
import os
import cv2
import numpy as np
from matplotlib import pyplot as plt
import timeit
# Declare socket parameters, global variables, and standard variables
host = "192.168.1.84"
port = 60000
print (host)
print (port)
n = 1
global existMoments
existMoments = float(... | {
"content_hash": "62bf58d59405f08fb0fa672524e8e520",
"timestamp": "",
"source": "github",
"line_count": 255,
"max_line_length": 125,
"avg_line_length": 26.32156862745098,
"alnum_prop": 0.573450536352801,
"repo_name": "awesomesauce12/image-recognition",
"id": "e038371e141e5c5dfb49eb299ac0c9232ef526dc"... |
"""Python TF-Lite interpreter."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import numpy as np
# pylint: disable=g-import-not-at-top
try:
from tensorflow.python.util.lazy_loader import LazyLoader
from tensorflow.python.util.tf_export im... | {
"content_hash": "ae9f8eafbf28d8b94e2975391393741a",
"timestamp": "",
"source": "github",
"line_count": 293,
"max_line_length": 84,
"avg_line_length": 36.02389078498293,
"alnum_prop": 0.6929417337754619,
"repo_name": "ghchinoy/tensorflow",
"id": "0bd7e8e04baa179b71cdf7557449c7ee0bc1736c",
"size": "... |
""" Module that implements an evaluator class. Used to traverse and
evaluate trees.
"""
import logging
from collections import deque
from .exceptions import CalculationException
logger = logging.getLogger(__name__)
class BasicEvaluator(object):
def evaluate(self, node):
tree = deque([node])
to... | {
"content_hash": "b5ec8fc8986d43c9d61c9f173bf04e2a",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 89,
"avg_line_length": 26.870967741935484,
"alnum_prop": 0.5894357743097239,
"repo_name": "ltron/tangle",
"id": "f46c02ae08580b78ae04c38e7e3e5ac917f8decf",
"size": "833",
... |
import csv, codecs, cStringIO
class UTF8Recoder:
"""
Iterator that reads an encoded stream and reencodes the input to UTF-8
"""
def __init__(self, f, encoding):
self.reader = codecs.getreader(encoding)(f)
def __iter__(self):
return self
def next(self):
return self.reader.next().encode("utf-8"... | {
"content_hash": "7e28ad051fd3659beb4173dc8f73cb12",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 72,
"avg_line_length": 27.366666666666667,
"alnum_prop": 0.6510353227771011,
"repo_name": "Letractively/kay-framework",
"id": "9889809c1605f0f7abab857783a0b8d6589d13f1",
"s... |
import logging
from . import helpers, models
from .log import event_logger
logger = logging.getLogger(__name__)
def log_invoice_save(sender, instance, created=False, **kwargs):
if created:
event_logger.paypal_invoice.info(
'{invoice_invoice_date}-{invoice_end_date}. Invoice for customer {cus... | {
"content_hash": "6b5089594753502748c6fe073c370886",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 112,
"avg_line_length": 32.59756097560975,
"alnum_prop": 0.6288814066591845,
"repo_name": "opennode/nodeconductor-assembly-waldur",
"id": "53c65fed79376d01025b68004d28011cebc... |
from sys import version_info
if version_info >= (2, 6, 0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_SimLocationAndWeather_DesignDay_Default', [dirname(__file__)])
except ImportErr... | {
"content_hash": "5fa17c46fd0724aab51407a190937108",
"timestamp": "",
"source": "github",
"line_count": 313,
"max_line_length": 174,
"avg_line_length": 49.629392971246006,
"alnum_prop": 0.7399253250933436,
"repo_name": "EnEff-BIM/EnEffBIM-Framework",
"id": "419da50c225f797b7efcc5d5d1397281d4d18b17",
... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_criminal_thug_rodian_male_01.iff"
result.attribute_template_id = 9
result.stfName("npc_name","rodian_base_male")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "bbb5bc9003be38799461bfd713aedd87",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 82,
"avg_line_length": 24.384615384615383,
"alnum_prop": 0.7003154574132492,
"repo_name": "obi-two/Rebelion",
"id": "a0d2fd5e7f524786b2a60c25584a7c230d29a895",
"size": "462... |
"""a graphical config manager for StaSh"""
import os
import ast
import threading
import console
import ui
from stash.system.shcommon import _STASH_CONFIG_FILES
import pythonista_add_action as paa
_stash = globals()["_stash"]
ORIENTATIONS = ("landscape", "landscape_left", "landscape_right")
# define option types
TY... | {
"content_hash": "62e3c8047b135765d2ee54d1942cc6ff",
"timestamp": "",
"source": "github",
"line_count": 567,
"max_line_length": 124,
"avg_line_length": 26.195767195767196,
"alnum_prop": 0.6371776745438632,
"repo_name": "cclauss/stash",
"id": "0d920a5499082084d29a105637ac962766ae6456",
"size": "1485... |
"""Serializers which initialize and serialize workflow models into formats needed for the IPTT React App/Excel export
Serializers:
IPTTQSProgramSerializer: Quickstart serializer, loads programs for populating IPTT Quickstart menus. Example:
IPTTQSProgramSerializer.load_for_user(user)
... | {
"content_hash": "3f80fc50819ca54de336352f7dd2478c",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 118,
"avg_line_length": 40.774193548387096,
"alnum_prop": 0.6644580696202531,
"repo_name": "mercycorps/TolaActivity",
"id": "d4e2fcf473bcd9df15b743732c21216ef6367b0b",
"si... |
import matplotlib as mpl
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
import dataProcessing as dp
import plotFuncs as pf
import sessionFuncs as sf
from types import *
import copy
class CompAnalysisBase(object):
def __init__(
self,
pNode,
analysisBranches,
... | {
"content_hash": "7c6e001565595305bfc44d4da8c0b475",
"timestamp": "",
"source": "github",
"line_count": 265,
"max_line_length": 76,
"avg_line_length": 35.509433962264154,
"alnum_prop": 0.5446333687566419,
"repo_name": "fracturica/shardlib",
"id": "925e9efafbcdbd8e8bb1d7d107031139309f9223",
"size": ... |
from setuptools import setup, find_packages
setup(
name='pymailer',
version='0.1.0',
description='Simple python bulk mailer script.',
author='Jonathan Bydendyk',
author_email='jonathan@blu-marble.co.za',
url='http://github.com/qoda/PyMailer',
packages=find_packages(),
include_... | {
"content_hash": "66ffd5d942b110306289e12face392f1",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 52,
"avg_line_length": 28.583333333333332,
"alnum_prop": 0.6618075801749271,
"repo_name": "bahill/python-mailer",
"id": "c030ea36214447bb0229d9c2394b155f502373e7",
"size": ... |
"""
Benchmarks for ``@vectorize`` ufuncs.
"""
import numpy as np
from numba import vectorize
@vectorize(["float32(float32, float32)",
"float64(float64, float64)",
"complex64(complex64, complex64)",
"complex128(complex128, complex128)"])
def mul(x, y):
return x * y
@vectoriz... | {
"content_hash": "ee5b94f6b1435246421ec5639e224eb6",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 75,
"avg_line_length": 26.53061224489796,
"alnum_prop": 0.5946153846153847,
"repo_name": "gmarkall/numba-benchmark",
"id": "62916843fc9df37b55aab1bd185e7fcf78d6e4cc",
"size... |
from flask import Flask, render_template
from app.wikipedia import get_search_articles, get_random_articles
app = Flask(__name__)
@app.route('/')
def show_random_posts():
return render_template('articles.html', articles=get_random_articles(5))
@app.route('/search/<query>')
@app.route('/category/<query>')
def s... | {
"content_hash": "08c27f3a89da5887fc506271ce5b5a36",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 76,
"avg_line_length": 28.6875,
"alnum_prop": 0.6862745098039216,
"repo_name": "kshvmdn/wiki-articles",
"id": "1b9ac99df66aae5113cfd9628699f71ef8379a7d",
"size": "459",
"... |
import os
import sys
from setuptools import setup
from extension_helpers import get_extensions
# First provide helpful messages if contributors try and run legacy commands
# for tests or docs.
TEST_HELP = """
Note: running tests is no longer done using 'python setup.py test'. Instead
you will need to run:
tox... | {
"content_hash": "ccdb877c7fedb62b1127542b5d2eb257",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 90,
"avg_line_length": 29.97041420118343,
"alnum_prop": 0.6511352418558737,
"repo_name": "adrn/gary",
"id": "2ecb7badc71f25c21d3a629b86116dc2206cff57",
"size": "5262",
"... |
from swgpy.object import *
def create(kernel):
result = Weapon()
result.template = "object/weapon/melee/sword/crafted_saber/shared_sword_lightsaber_one_handed_s13.iff"
result.attribute_template_id = 10
result.stfName("weapon_name","sword_lightsaber_type13")
#### BEGIN MODIFICATIONS ####
#### END MODIFICAT... | {
"content_hash": "93eeec0793401660f1261a50f9bbf11d",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 103,
"avg_line_length": 26.692307692307693,
"alnum_prop": 0.7175792507204611,
"repo_name": "obi-two/Rebelion",
"id": "8c27e9ea9f84a7ee80c3dfde26fa4a3c54ef86ca",
"size": "49... |
import responses
from ..utils import MontageTests, make_response
class TaskAPITests(MontageTests):
@responses.activate
def test_make_task(self):
endpoint = 'https://testco.hexxie.com/api/v1/tasks/'
responses.add(responses.POST, endpoint, body=make_response({}),
content_type='appli... | {
"content_hash": "9c22eebd86c23c61797f0effc9d49299",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 73,
"avg_line_length": 35.52,
"alnum_prop": 0.6576576576576577,
"repo_name": "EditLLC/python-montage",
"id": "ad8c2115a588cab465f04815a8d34aaf67bf8712",
"size": "888",
"b... |
import sys
import sqlite3
import itertools
preference = {v:k for k,v in enumerate(('updb', 'pdb', 'epub', 'mobi', 'vepub', 'prc'))}
def main(filename, update=None):
db = sqlite3.connect(filename)
cur = db.cursor()
for bookid, group in itertools.groupby(cur.execute(
"SELECT * FROM files "
"... | {
"content_hash": "b75e7b9503dd7ef131d96a122af7f330",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 88,
"avg_line_length": 33.44,
"alnum_prop": 0.5873205741626795,
"repo_name": "The-Orizon/nlputils",
"id": "1cfd4030e49289ce24d603488f84922113547be9",
"size": "884",
"bina... |
from tempest.common import rest_client
from tempest import config
CONF = config.CONF
class ObjectStorageClient(rest_client.RestClient):
"""
Base object storage client class
"""
def __init__(self, auth_provider):
super(ObjectStorageClient, self).__init__(
auth_provider, CONF.objec... | {
"content_hash": "b9741bfefdbaaf4fbf4343049b346c88",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 60,
"avg_line_length": 27.125,
"alnum_prop": 0.6728110599078341,
"repo_name": "Lilywei123/tempest",
"id": "3900e82f9a26356364c6be8fc3b356de303d568f",
"size": "1065",
"bin... |
import sys
import mox
from neutronclient.neutron.v2_0 import port
from neutronclient import shell
from neutronclient.tests.unit import test_cli20
class CLITestV20PortJSON(test_cli20.CLITestV20Base):
def setUp(self):
super(CLITestV20PortJSON, self).setUp(plurals={'tags': 'tag'})
def test_create_port... | {
"content_hash": "0c8c8fdd17fabaec585c210b07e626b0",
"timestamp": "",
"source": "github",
"line_count": 379,
"max_line_length": 79,
"avg_line_length": 40.92348284960422,
"alnum_prop": 0.5190844616376531,
"repo_name": "citrix-openstack-build/python-neutronclient",
"id": "e7e6a023f013190f8ffd3ac019d70e... |
from django import template
from django.template import RequestContext
from django.template.loader import render_to_string
# lfs imports
from lfs.catalog.models import Category
from lfs.manufacturer.models import Manufacturer
register = template.Library()
@register.inclusion_tag('manage/category/category_filter.htm... | {
"content_hash": "e77b1db4d3691610a96d4f134312280e",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 105,
"avg_line_length": 37.47435897435897,
"alnum_prop": 0.6671228190215532,
"repo_name": "leadbrick/django-lfs",
"id": "b6232c55e2a16109224e36af4e061035c717a4c7",
"size": ... |
import sys
import os
import time
# Use the built-in version of scandir/stat if possible, otherwise
# use the scandir module version
try:
from os import scandir, stat # noqa # pylint: disable=unused-import
except ImportError:
from scandir import scandir, stat # noqa # pylint: disable=unused-import
try:
i... | {
"content_hash": "10f32b868f7bf99158a082aff1ddec43",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 95,
"avg_line_length": 34.853932584269664,
"alnum_prop": 0.600902643455835,
"repo_name": "gwaldo/graphite-web",
"id": "36d254dc2a60ccaa537461f9f8970cf18de2ffff",
"size": "3... |
from distutils.core import setup
setup(name = 'django-app-flag',
version = '0.9.2',
author = 'Joe Groseclose',
author_email = 'joe.groseclose@example.com',
packages = ['django_app_flag'],
package_data= {'django_app_flag' : ['templates/*.html']},
url='http://pypi.python.org/pypi/djan... | {
"content_hash": "66aad1545090822f735cf569e96118a0",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 63,
"avg_line_length": 37.357142857142854,
"alnum_prop": 0.615678776290631,
"repo_name": "benderTheCrime/django-app-flag",
"id": "0b9984630076c295b18129fdfafac2636531bd0c",
... |
'''
@author: Frank
'''
import unittest
from zstacklib.utils import linux
class Test(unittest.TestCase):
def testName(self):
linux.create_bridge('testbr0', 'eth0')
if __name__ == "__main__":
#import sys;sys.argv = ['', 'Test.testName']
unittest.main() | {
"content_hash": "a7a733fe581c4e859ba4ae08e6b135d6",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 48,
"avg_line_length": 16.235294117647058,
"alnum_prop": 0.6231884057971014,
"repo_name": "live4thee/zstack-utility",
"id": "df86712c0386a1655f6ddd5e817bc3e4da85cdd0",
"siz... |
from os import path
from time import sleep
from threading import Thread
from requests import ConnectionError
from gi.repository import Gtk, AppIndicator3
from hiwifi import Hiwifi
class Indicator:
def __init__(self):
self.config = {
'password': 'your password',
'interval': 5,
... | {
"content_hash": "9a7768e8a658c306e7a8b12fd9d09736",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 73,
"avg_line_length": 31.037037037037038,
"alnum_prop": 0.5799522673031027,
"repo_name": "qiuxiang/indicator-hiwifi",
"id": "8a61b152e57d3c3f5081c3c0b8081c91f1bf5d02",
"si... |
from django.conf import settings
from django.conf.urls import url
from django.utils.translation import ugettext_lazy as _
from horizon.browsers.views import AngularIndexView
from openstack_dashboard.dashboards.identity.roles import views
if settings.ANGULAR_FEATURES.get('roles_panel', False):
# New angular panel... | {
"content_hash": "4d86d89e5ae49fb9c3aca742f50d0479",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 72,
"avg_line_length": 33.666666666666664,
"alnum_prop": 0.6562942008486563,
"repo_name": "BiznetGIO/horizon",
"id": "f7a4451f2722b9b7f86cf9406b5a13834e20b94e",
"size": "13... |
import os
from fabric.api import env, task, require, local, sudo, execute, run
from api.config import DB_USER, DB_NAME, DB_PASSWORD
DATA_DIR = 'censusreporter/api/data'
PSQL_STRING = 'PGPASSWORD=%s psql -d %s -U %s -h localhost' \
% (DB_PASSWORD, DB_NAME, DB_USER)
PACKAGES = (
'postgresql-9.3',
... | {
"content_hash": "dc2f57a78a7427db2233074be8a98570",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 199,
"avg_line_length": 29,
"alnum_prop": 0.5802615933412604,
"repo_name": "callmealien/wazimap_zambia",
"id": "bc8053541d718bfc89f9860a1b32a900471f87f6",
"size": "2523",
... |
from .common import BaseTest
from c7n.provider import clouds
class ProviderTest(BaseTest):
def test_available_clouds(self):
self.assertEqual(
sorted(clouds.keys()),
['aws', 'azure', 'gcp'])
| {
"content_hash": "036f2a8e34f1b82bcd03788fdb3180ab",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 36,
"avg_line_length": 20.90909090909091,
"alnum_prop": 0.6260869565217392,
"repo_name": "scotwk/cloud-custodian",
"id": "8c94c614a8fec832640160c7e9c82c3e10a5d4e7",
"size":... |
import argparse
import json
import sys
import socket
import time
from pkg_resources import parse_version
import tinctools
if parse_version(tinctools.__version__) >= parse_version('0.3') and \
parse_version(tinctools.__version__) < parse_version('0.4'):
from tinctools import connection, parse
from tinctoo... | {
"content_hash": "90c1369524dc1d60c18a5d7693f097f9",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 135,
"avg_line_length": 35.65605095541401,
"alnum_prop": 0.5005359056806002,
"repo_name": "exioReed/tinc-vis",
"id": "86841f4c9640bcc2565df8f44f5a85ce375403e8",
"size": "5... |
import httplib2
from restservice.RestServiceInterface import RestServiceInterface
class ServiceDefinition(RestServiceInterface):
id = u'xml'
verbose_name = u'XML POST'
def send(self, url, parsed_instance):
instance = parsed_instance.instance
headers = {"Content-Type": "application/xml"}
... | {
"content_hash": "64e72bd901dd29c18237b83f4fe7b330",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 67,
"avg_line_length": 32.57142857142857,
"alnum_prop": 0.6842105263157895,
"repo_name": "GeoODK/formhub",
"id": "58084974cf2fd312b41bbc335b487daeedd10ff6",
"size": "456",
... |
from __future__ import absolute_import
from __future__ import print_function
def regex_matches(test=None):
# [START regex_matches]
import apache_beam as beam
# Matches a named group 'icon', and then two comma-separated groups.
regex = r'(?P<icon>[^\s,]+), *(\w+), *(\w+)'
with beam.Pipeline() as pipeline:
... | {
"content_hash": "b2a9088e924a3d88bb83152288441be9",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 73,
"avg_line_length": 29.587155963302752,
"alnum_prop": 0.5327131782945737,
"repo_name": "markflyhigh/incubator-beam",
"id": "b39b534ff123ea5c5f42b478910f63cbc0815a4c",
"... |
import logging
from django.conf import settings
from django.db import connection
from firepy.loghandler import FirePHPHandler
from firepy.firephp import FirePHP
class FirePHPMiddleware():
"""FirePHP middleware for Django."""
def __init__(self):
# Set the FirePHP log handler to the root logger.
... | {
"content_hash": "15b1990521f543334f74533939a8a972",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 91,
"avg_line_length": 33.056603773584904,
"alnum_prop": 0.6301369863013698,
"repo_name": "kyzi007/firepy",
"id": "b73934d7b379c1b4b0335118ee07e798662fba6b",
"size": "2986"... |
from __future__ import absolute_import
from blockcanvas.numerical_modeling.workflow.block_experiment_networkx.block import *
| {
"content_hash": "1eeda3f4a5de0bd5b8d0624ed6042956",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 85,
"avg_line_length": 62.5,
"alnum_prop": 0.832,
"repo_name": "enthought/etsproxy",
"id": "411e2487576cff93a159d710706ec4ac2879979f",
"size": "140",
"binary": false,
"c... |
"""
Execution Contexts are objects that wraps the stateless data-structures (graphs and nodes) during a job execution to
keep an eye on their context/state (from the simplest things like i/o statistics to lifecycle and custom userland
state).
"""
from bonobo.execution.contexts.graph import GraphExecutionContext
from ... | {
"content_hash": "166e13be8650d4f98a4d1c6386c1cf98",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 116,
"avg_line_length": 44.5,
"alnum_prop": 0.8202247191011236,
"repo_name": "python-bonobo/bonobo",
"id": "18ddbe274f619b419d0bbd3448f1eb54965799e1",
"size": "534",
"bin... |
from django.core.urlresolvers import reverse # noqa
from openstack_dashboard.test import helpers as test
INDEX_URL = reverse("horizon:settings:user:index")
class UserSettingsTest(test.TestCase):
def test_timezone_offset_is_displayed(self):
res = self.client.get(INDEX_URL)
self.assertContains... | {
"content_hash": "1dac011e8a5c45745458026c35ad37c0",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 68,
"avg_line_length": 32.76470588235294,
"alnum_prop": 0.703770197486535,
"repo_name": "deepakselvaraj/federated-horizon",
"id": "bfa6f36ad22289e0d0c083e801542f44833f01e0",
... |
"""\
=====================================
Components - the basic building block
=====================================
A component is a microprocess with a microthread of control and input/output
queues (inboxes and outboxes) which can be connected by linkages to other
components. Ie. it has code that runs whilst the ... | {
"content_hash": "69711fcd2cd1803a8e6bf73886d31052",
"timestamp": "",
"source": "github",
"line_count": 755,
"max_line_length": 133,
"avg_line_length": 34.77350993377483,
"alnum_prop": 0.6404357431248572,
"repo_name": "sparkslabs/kamaelia_",
"id": "7387fa43409fec6aa103ff0a25676312a47f3c51",
"size":... |
"""Startup utilities"""
# pylint:skip-file
import os
import sys
from functools import partial
import paste.script.command
import werkzeug.script
etc = partial(os.path.join, 'parts', 'etc')
DEPLOY_INI = etc('deploy.ini')
DEPLOY_CFG = etc('deploy.cfg')
DEBUG_INI = etc('debug.ini')
DEBUG_CFG = etc('debug.cfg')
_buil... | {
"content_hash": "a96aefa7834bb9dc06ece774a442d998",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 77,
"avg_line_length": 26.234848484848484,
"alnum_prop": 0.6095870632399654,
"repo_name": "stxnext-kindergarten/presence-analyzer-kjagodzinski",
"id": "df5071913afb6b74907e4... |
"""Resizes a volume"""
from baseCmd import *
from baseResponse import *
class resizeVolumeCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "true"
"""the ID of the disk volume"""
"""Required"""
self.id = None
self.typeInfo['id'] = 'uuid'
"""new di... | {
"content_hash": "06b73303a70d8f4a1b478e8815a33d1f",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 131,
"avg_line_length": 40.674311926605505,
"alnum_prop": 0.5882485620841321,
"repo_name": "MissionCriticalCloud/marvin",
"id": "a975b63103cbc6356376385877ff30951cf25613",
... |
from django.views import generic
from .models import Character, Team
class IndexView(generic.ListView):
model = Team
template_name = "characters/index.html"
context_object_name = "teams"
class CharacterView(generic.DetailView):
model = Character
template_name = "characters/character.html"
... | {
"content_hash": "6551702d19409675dbbd994e71c13fc4",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 79,
"avg_line_length": 30.48,
"alnum_prop": 0.6640419947506562,
"repo_name": "evanepio/dotmanca",
"id": "267d2c0e57d82159323a1d36c7971f77a44d5eb4",
"size": "762",
"binary... |
__author__ = 'rrusk'
import datetime
import pymongo
class MongoDatabase(object):
DEFAULT_DB_NAME = "query_composer_development"
ENDPOINTS_COLLECTION = "endpoints"
QUERIES_COLLECTION = "queries"
RESULTS_COLLECTION = "results"
def __init__(self, db_name=DEFAULT_DB_NAME, host="localhost", port=2... | {
"content_hash": "489e87799554f509c4d365f1e133e2c6",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 98,
"avg_line_length": 34.660377358490564,
"alnum_prop": 0.534839412084921,
"repo_name": "scoophealth/query-composer",
"id": "1be99076bdebb8194698a5a3d2595ccb05e58826",
"s... |
from setuptools import setup, find_packages
setup(name="flatland0",
version='0.0.1.dev1',
author='Jason Kirtland',
author_email='jek@discorporate.us',
description='HTML form management and validation',
keywords='schema validation data web form forms roundtrip',
long_description=ope... | {
"content_hash": "6b394bb9e826be5aedd85a000fcc6c68",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 65,
"avg_line_length": 31.157894736842106,
"alnum_prop": 0.6334459459459459,
"repo_name": "mbr/flatland0",
"id": "e2b17b0e1869a5dca7efe21a181e9f252ccad5ab",
"size": "592",
... |
"""A wrapper around the generated Groc parser and lexer."""
__author__ = 'arb@google.com (Anthony Baxter)'
import antlr3
import GrocLexer
import GrocParser
class GrocException(Exception):
"""An error occurred while parsing the groc input string."""
class GrocLexerWithErrors(GrocLexer.GrocLexer):
"""An overr... | {
"content_hash": "c8fefd3ee0e5298705e340a38a3367a5",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 67,
"avg_line_length": 23.910714285714285,
"alnum_prop": 0.7199402539208365,
"repo_name": "flgiordano/netcash",
"id": "229a5d732e7cda20f9392962fe181d7abf1085d2",
"size": "2... |
import numpy as np
from numpy.random import randint
# Lasagne (& friends) imports
import theano
from lasagne import regularization
from nolearn.lasagne import BatchIterator, NeuralNet
from lasagne.objectives import categorical_crossentropy, aggregate, binary_crossentropy
from lasagne.layers import (InputLayer, DropoutL... | {
"content_hash": "12b9db52cf3c00fd580fc00ef74d4941",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 109,
"avg_line_length": 38.38333333333333,
"alnum_prop": 0.641626863511362,
"repo_name": "bitsofbits/kaggle_grasp_and_lift_eeg_detection",
"id": "8d89a2e594c11079e7c6c47f938... |
import mock
import unittest
import os
from acmedns.config import ConfigurationManager
from acmedns.adapter.ovh_adapter import OvhAdapter
TEST_CONFIG_FILENAME = os.path.join(os.path.dirname(__file__), 'acmedns_test.conf')
class BasicTestSuite(unittest.TestCase):
@mock.patch('acmedns.config.os.path')
def test... | {
"content_hash": "361defa25c8874577a887887b3015179",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 107,
"avg_line_length": 32.645161290322584,
"alnum_prop": 0.6946640316205533,
"repo_name": "wayoos/acmedns",
"id": "cef21f2c9656340c358a4aabebbf7356848a5a07",
"size": "2126... |
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group, Permission
from django.core.exceptions import FieldDoesNotExist, ImproperlyConfigured
from django.db.models import Q
from wagtail.wagtailcore.models import Collection, GroupCollectionPermission
from .base import BaseDjangoAut... | {
"content_hash": "13d0d56fdd2883dd9fea4f5f43d9dac5",
"timestamp": "",
"source": "github",
"line_count": 348,
"max_line_length": 98,
"avg_line_length": 44.172413793103445,
"alnum_prop": 0.6427270361696591,
"repo_name": "gogobook/wagtail",
"id": "7beb9d7a30f9b032c9bf1412f71b1df1efa4009d",
"size": "15... |
from django.shortcuts import render
# Create your views here.
from django.http import HttpResponse
from django.shortcuts import render_to_response, render
from . import tinderbot
import operator
import argparse
import sys
import pynder
import urllib
#rake stuff
import re
import operator
sys.path.insert(0, 'src/')
... | {
"content_hash": "f22f24cd580ab73aa9129b1ebc844a58",
"timestamp": "",
"source": "github",
"line_count": 302,
"max_line_length": 290,
"avg_line_length": 35.54304635761589,
"alnum_prop": 0.6130054033910938,
"repo_name": "ckjoshi9/Auto-Mate-for-Tinder",
"id": "ca197a43d00992d924a71839fe751296750087d4",
... |
"""Type hints for the parsers."""
from typing import Mapping, Optional, Tuple
__all__ = [
"Term",
"TermEncodingMapping",
"NamespaceTermEncodingMapping",
]
Term = Tuple[Optional[str], str]
TermEncodingMapping = Mapping[Term, str]
NamespaceTermEncodingMapping = Mapping[str, Mapping[Term, str]]
| {
"content_hash": "082d1755dd47ab93e3479847a2ac0080",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 63,
"avg_line_length": 23.692307692307693,
"alnum_prop": 0.7142857142857143,
"repo_name": "pybel/pybel",
"id": "2c4a6d416f588259e2a0f0fcb8678c8862b0b38f",
"size": "333",
... |
"""
Chirp z-transform.
We provide two interfaces to the chirp z-transform: an object interface
which precalculates part of the transform and can be applied efficiently
to many different data sets, and a functional interface which is applied
only to the given data set.
Transforms
----------
CZT : callable (x, axis=-1... | {
"content_hash": "618e90335bf3df7c0d9c644db6064994",
"timestamp": "",
"source": "github",
"line_count": 568,
"max_line_length": 89,
"avg_line_length": 33.87323943661972,
"alnum_prop": 0.5957380457380458,
"repo_name": "perimosocordiae/scipy",
"id": "53d952f69a1467aa1e2fa37cf8045981384568be",
"size":... |
"""
The Plaid API
The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from plaid.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal... | {
"content_hash": "ed17634c60f276446406e600055f7f96",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 199,
"avg_line_length": 41.970588235294116,
"alnum_prop": 0.5645409950946041,
"repo_name": "plaid/plaid-python",
"id": "5078d401b6db254469fe97a7bf29fb86ab602321",
"size": ... |
import unittest2
from google.appengine.ext import ndb
from google.appengine.ext import testbed
from datafeeds.usfirst_event_details_parser import UsfirstEventDetailsParser
from helpers.location_helper import LocationHelper
class TestEventGetTimezoneId(unittest2.TestCase):
def setUp(self):
self.testbed =... | {
"content_hash": "d151da7ed046da46006d79666e232b92",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 105,
"avg_line_length": 50.94252873563219,
"alnum_prop": 0.6861462093862816,
"repo_name": "tsteward/the-blue-alliance",
"id": "35027c3706aefc0657284c1abacb169bf600df5a",
"s... |
import os, logging
from datetime import datetime,timedelta
from google.appengine.ext import db
from google.appengine.api import images, taskqueue
import logging
from models import *
import tools
import services
import authorized
import json
import handlers
class GCMConnection(handlers.JsonRequestHandler):
@auth... | {
"content_hash": "ac6903f0ea073e4a22203b3870ddba38",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 79,
"avg_line_length": 27.551724137931036,
"alnum_prop": 0.6520650813516896,
"repo_name": "echomobi/echo-sense",
"id": "59d71a3f5ba1177354423b2f3ebf624d9945ede4",
"size": "... |
ip_supported_encodings = [ 'cp1252','ascii', 'utf-8', 'utf-16', 'latin-1',
'iso-8859-1', 'utf-16-le', 'utf-16-be', 'unicode-escape',
'raw-unicode-escape', 'utf-7', 'utf-8-sig']
#make sure all encoding names are lowercase
ip_supported_encodings = [ x.lower() for... | {
"content_hash": "0e738e19f3a95053563765ba6b430c52",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 86,
"avg_line_length": 52.294117647058826,
"alnum_prop": 0.5804274465691789,
"repo_name": "IronLanguages/ironpython3",
"id": "4e709aebd2325b73aa3025b16d67a87e160ff46f",
"si... |
import os.path
import shutil
def copytree(src, dest, symlinks=False):
"""My own copyTree which does not fail if the directory exists.
Recursively copy a directory tree using copy2().
If the optional symlinks flag is true, symbolic links in the
source tree result in symbolic ... | {
"content_hash": "25094e450f1a51b200a3c04dff55ace4",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 71,
"avg_line_length": 38.57142857142857,
"alnum_prop": 0.5597883597883598,
"repo_name": "OpenVnmrJ/OpenVnmrJ",
"id": "68b1768a4a878819da60a14f6611ee20aa5caff9",
"size": "1... |
"""Support for RDW binary sensors."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from vehicle import Vehicle
from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,
BinarySensorEntity,
BinarySensorEntityDescription,
)
fr... | {
"content_hash": "fb8e6029c16ea947a4eecbf605f69875",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 107,
"avg_line_length": 31.475728155339805,
"alnum_prop": 0.7060456508328192,
"repo_name": "w1ll1am23/home-assistant",
"id": "25ef6b27f1d6f6bc218ddcdc231b7fe12d60726c",
"s... |
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-Mimikatz LSA Dump',
'Author': ['@JosephBialek', '@gentilkiwi'],
'Description': ("Runs PowerSploit's Invoke-Mimikatz function "
... | {
"content_hash": "e5133d434dd42bbf5d3e0e0005a27b2e",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 104,
"avg_line_length": 28.82894736842105,
"alnum_prop": 0.5043359196713829,
"repo_name": "api0cradle/Empire",
"id": "5320cf7b1d3336ec6cd8e751c10414754e2f7fa0",
"size": "21... |
"""Hook for JIRA"""
from typing import Any, Optional
from jira import JIRA
from jira.exceptions import JIRAError
from airflow.exceptions import AirflowException
from airflow.hooks.base import BaseHook
class JiraHook(BaseHook):
"""
Jira interaction hook, a Wrapper around JIRA Python SDK.
:param jira_con... | {
"content_hash": "0e0da09ca0149657e1c76cf437b21fa2",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 110,
"avg_line_length": 35.65277777777778,
"alnum_prop": 0.5621347876899104,
"repo_name": "airbnb/airflow",
"id": "8951c12cc30c15b3c108b535d9e900bbd808ea6d",
"size": "3354"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.