text stringlengths 4 1.02M | meta dict |
|---|---|
import _setup
import inspect
import pprint
from httpmessage._multidict import MultiDict
def header_case(header_key):
return "-".join([part.capitalize() for part in header_key.split("-")])
def _key_wrap(func):
"""creates a function where the value of the 'key' argument, if there
is one, has the function ... | {
"content_hash": "b868728726c03050a5cbd3365817c7af",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 74,
"avg_line_length": 27.753246753246753,
"alnum_prop": 0.5049134300421151,
"repo_name": "mangpo/cacheall-proxy-server",
"id": "ffb5d35619ad0031ade1661b4550b2fdabff6d47",
... |
from django.conf.urls import patterns, url
from .views import EvolucionesListView, EvolucionesCreateView, EvolucionesUpdateView, EvolucionesDeleteView
urlpatterns = patterns('',
url(r'^/(?P<historia>\d+)$', EvolucionesListView.as_view(), name='list'),
url(r'^/create/(?P<historia>\d+)$', EvolucionesCreateView.... | {
"content_hash": "136776454eb14579df7191ab06f1dd6a",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 107,
"avg_line_length": 39.642857142857146,
"alnum_prop": 0.6792792792792792,
"repo_name": "btenaglia/hpc-historias-clinicas",
"id": "b7c02cd77a230dce6e950245c219d5cd0220d74b... |
from django.conf.urls import patterns # noqa
from django.conf.urls import url # noqa
from contrail_openstack_dashboard.openstack_dashboard.dashboards.admin.l3routers import views
ROUTER_URL = r'^(?P<router_id>[^/]+)/%s'
urlpatterns = patterns('horizon.dashboards.admin.l3routers.views',
url(r'^$', views.Index... | {
"content_hash": "cf4771335603ef134f245aab8850d956",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 93,
"avg_line_length": 29.444444444444443,
"alnum_prop": 0.660377358490566,
"repo_name": "Juniper/contrail-horizon",
"id": "5ab3e3830d3fd7ec529f8b309781e2452b9c2fdb",
"size... |
import os
import re
import time
import unittest
from requests.exceptions import Timeout
import tests.file_utils as file_utils
from ingenico.connect.sdk.communication_exception import CommunicationException
from ingenico.connect.sdk.declined_payment_exception import DeclinedPaymentException
from ingenico.connect.sdk.d... | {
"content_hash": "a8ca81fffc7d6bed85c4c87cb878c046",
"timestamp": "",
"source": "github",
"line_count": 804,
"max_line_length": 120,
"avg_line_length": 51.190298507462686,
"alnum_prop": 0.6763855480234225,
"repo_name": "Ingenico-ePayments/connect-sdk-python3",
"id": "4d2638f258f4c1577639326ab6d6694ff... |
import os
import time
import urlparse
import uuid
from flask import Flask, abort, request, jsonify, json
from doppler.queue import callback, rpqueue
SENTRY_DSN = os.environ.get('SENTRY_DSN')
if SENTRY_DSN:
from raven.contrib.flask import Sentry
sentry = Sentry(dsn=SENTRY_DSN)
def _get_job(request_id):
... | {
"content_hash": "bdbbf4e28ec002b9b76d7420acf9fe16",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 83,
"avg_line_length": 25.518796992481203,
"alnum_prop": 0.5981143193871538,
"repo_name": "TakumiHQ/doppler",
"id": "2ed96dac662715e0d5eea9423a2f04103bf21f4b",
"size": "34... |
import os
import shutil
import stat
import sys
import tempfile
import time
import unittest
sys.path.append(os.path.join(os.path.dirname(__file__), '../scoot'))
import client_lib as proto
tmpdir = None
def setUp():
""" Start a (verified) client connection.
"""
global tmpdir
tmpdir = tempfile.mkdtemp()
p... | {
"content_hash": "ee2525009d959ef5f8cc95de4f49c3da",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 132,
"avg_line_length": 36.91943127962085,
"alnum_prop": 0.6342747111681644,
"repo_name": "dbentley/scoot",
"id": "66b2ea5aa73116d74f9e2c23acca21e5e625f0bf",
"size": "7813... |
import subprocess
subprocess.call('python manage.py runserver')
| {
"content_hash": "6c58e69c5ca42178f0b966ad6f1b10ac",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 45,
"avg_line_length": 33,
"alnum_prop": 0.803030303030303,
"repo_name": "nishowsan/pyblog",
"id": "74774e36d17ad70a694532dce540186c849b82e2",
"size": "66",
"binary": fals... |
"""ProjektSuper URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Clas... | {
"content_hash": "03a7431457ba201f2f85b0c21982cbc5",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 79,
"avg_line_length": 35.84615384615385,
"alnum_prop": 0.7145922746781116,
"repo_name": "ztmtoosm/ztmtoosm-django",
"id": "bcabb182f50378c38b62b19d8588b6e9a3bc7ca0",
"size... |
import time
from django.conf import settings
from django.template import Context
from sekizai.context import SekizaiContext
from cms.api import add_plugin, create_page, create_title
from cms.cache import _get_cache_version, invalidate_cms_page_cache
from cms.cache.placeholder import (
_get_placeholder_cache_key, ... | {
"content_hash": "c0368b4337815e12b4efceccb79e82b0",
"timestamp": "",
"source": "github",
"line_count": 901,
"max_line_length": 157,
"avg_line_length": 44.68257491675916,
"alnum_prop": 0.6150177600039742,
"repo_name": "rsalmaso/django-cms",
"id": "76a7f0222019a84123890d560a97489baaa1fa1f",
"size": ... |
"""
@author: efourrier
Purpose : File with all custom exceptions
"""
class NotNumericColumn(Exception):
""" The column should be numeric """
pass
class NumericError(Exception):
""" The column should not be numeric """
pass
# class NotFactor
| {
"content_hash": "31e0a56be9fe153e5b6b1cf2c1244719",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 45,
"avg_line_length": 17.533333333333335,
"alnum_prop": 0.6768060836501901,
"repo_name": "ericfourrier/auto-clean",
"id": "48970a5d692ba1a8480c1c9898ceeb571c6e2001",
"size... |
"""
Plugin for generation of Sphinx-suitable JSON from Protobuf definitions
It's a plugin for protoc as per https://developers.google.com/protocol-buffers/docs/reference/other
Usage:
protoc --plugin=protoc-gen-custom=<script path>/protobuf-json-docs.py <proto file>
The JSON output can then be interpreted by prot... | {
"content_hash": "780cd0b2e175f02afd1e4895298a1508",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 174,
"avg_line_length": 40.262773722627735,
"alnum_prop": 0.5360768672951414,
"repo_name": "heuermh/ga4gh-schemas",
"id": "1c93af0cd027cb97f886005bef8beffe03167a0e",
"size... |
from smartform import descriptor
errors = descriptor.errors
ConfigurationDescriptor = descriptor.ConfigurationDescriptor
DescriptorData = descriptor.DescriptorData
ProtectedUnicode = descriptor.ProtectedUnicode
class CredentialsDescriptor(descriptor.BaseDescriptor):
"Class for representing the credentials descrip... | {
"content_hash": "84b43f5681e1bc81416c256e316d9502",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 66,
"avg_line_length": 37.6,
"alnum_prop": 0.849290780141844,
"repo_name": "sassoftware/catalog-service",
"id": "92f7996469ad981d6f3b5ea1f1f508dcbf5a70f8",
"size": "1169",
... |
'''
Copyright@USTC SSE
Author by ch yy in suzhou ,28/11/2015
Find out nevents, ndays_act, nplay_video, nchapters, nforum_posts weather or not determined on
viewed,explored,certified,grade
'''
from numpy import *
import load_csv as lc
import operator
def knn(base, dataSet, labels, k):
'''
:param base: ... | {
"content_hash": "9f357b87d8aa0aed9301f34fb863437e",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 98,
"avg_line_length": 35.114285714285714,
"alnum_prop": 0.6493083807973963,
"repo_name": "ch710798472/GithubRecommended",
"id": "8d32f3bd5491fc2d6315b14326551ca55f00790e",
... |
import distro
import subprocess
import pkg_resources
from manager_rest import premium_enabled
def get_version() -> str:
return pkg_resources.get_distribution('cloudify-rest-service').version
def get_edition():
return 'premium' if premium_enabled else 'community'
def get_distribution():
distro_id = dis... | {
"content_hash": "b7de26327dfb9e270c99c8e0bab661b8",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 77,
"avg_line_length": 27.487179487179485,
"alnum_prop": 0.6352611940298507,
"repo_name": "cloudify-cosmo/cloudify-manager",
"id": "72c54505667c89343be4d9757176d69c77e5ab59",... |
import fnmatch
import os
import sh
from molecule import ansible_playbook
from molecule import config
from molecule import util
from molecule.verifier import base
class Testinfra(base.Base):
def __init__(self, molecule):
super(Testinfra, self).__init__(molecule)
self._testinfra_dir = molecule.con... | {
"content_hash": "acb09269a70a366eff17ae76f89e16b6",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 78,
"avg_line_length": 34.01754385964912,
"alnum_prop": 0.5838060856111398,
"repo_name": "rgreinho/molecule",
"id": "c4eff28adb81f3c27c3a0741f9a9a72723616622",
"size": "49... |
from django.db import models
__all__ = ['VisibilityManager', 'VisibilityManagerMixin']
class VisibilityManagerMixin(object):
"""
This manager should be used with a model that implements the Hideable
mixin.
"""
def __init__(self, *args, **kwargs):
self.visible = kwargs.pop('visible')
... | {
"content_hash": "0372f22765a8d4c4343e45dc1caa3924",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 73,
"avg_line_length": 25.727272727272727,
"alnum_prop": 0.6802120141342756,
"repo_name": "jleeothon/trufflehog",
"id": "4ac6f9df34de4d8e50a9725548fde740879a425f",
"size": ... |
from xbee import XBee, ZigBee
import serial
import time
import sys, getopt
ser = serial.Serial('/dev/ttyUSB1', 9600)
xbee = ZigBee(ser)
#xbee = XBee(ser)
position = 'n'
timeout = 1
def doCommand():
#destinationAddrLong = b'\x00\x13\xA2\x00\x40\xBA\xF5\xE8'
destinationAddrLong = b'\x00\x13\xA2\x00\x40\xC5\x5A\x84'
t... | {
"content_hash": "ef4cb3c7ee7c09ea30d85817f40ecdca",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 64,
"avg_line_length": 24.113636363636363,
"alnum_prop": 0.6135721017907634,
"repo_name": "louietsai/python-xbee",
"id": "70acd88d15a707770bdcb1204051de19747b4a21",
"size":... |
import sys,os
import re,glob
import numpy as np
import scipy.sparse
from sklearn.naive_bayes import MultinomialNB
import cPickle as pickle
import pkg_resources
from . import content_sources
#remove punctuation and prepositions from a string
def find_keywords(text):
keywords=re.sub('[{}:?!@#$%^&*\(\)_.\\/,\'\"]','... | {
"content_hash": "cddd4161f6538cdf4ff242f2350bfb5a",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 120,
"avg_line_length": 38.23456790123457,
"alnum_prop": 0.6336777526638683,
"repo_name": "benjaminaschultz/shakespeare",
"id": "937cfd49c404c8f23878ab82510d1f1b488f85b3",
... |
from typing import TYPE_CHECKING, Optional
from twisted.web.server import Request
from sydent.http.auth import authV2
from sydent.http.servlets import SydentResource, get_args, jsonwrap, send_cors
from sydent.types import JsonDict
from sydent.util.emailutils import EmailAddressException, EmailSendException
from syden... | {
"content_hash": "1ad988b6e197add8ad92d715e6c05eb2",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 96,
"avg_line_length": 36.29032258064516,
"alnum_prop": 0.5880634920634921,
"repo_name": "matrix-org/sydent",
"id": "6e60f17c92302484ce2b68c1158c18b303dadc00",
"size": "84... |
"""
Copyright (c) 2019 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.
"""
from textwrap import dedent
import sys
from flexmock import flexmock
import pytest
import atomic_reactor.utils.koji as koji_util
from atomi... | {
"content_hash": "0fb97655960f2592e739ff89f80b29d1",
"timestamp": "",
"source": "github",
"line_count": 403,
"max_line_length": 98,
"avg_line_length": 33.08684863523573,
"alnum_prop": 0.6147442627868607,
"repo_name": "DBuildService/atomic-reactor",
"id": "fdf8afa131cd0bf1086a3781c786078134767198",
... |
"""Dashboard models."""
import datetime as dt
from enum import Enum
from league.database import (Column, Model, SurrogatePK, association_proxy, db,
func, reference_col, relationship, session)
Color = Enum('Color', 'white black')
Color.white.abbr = 'w'
Color.black.abbr = 'b'
class Playe... | {
"content_hash": "e97fcd9475f358935413aee3a1724756",
"timestamp": "",
"source": "github",
"line_count": 524,
"max_line_length": 80,
"avg_line_length": 38.80534351145038,
"alnum_prop": 0.5386052916297827,
"repo_name": "MattClarke131/league",
"id": "2a4f42a0529667d45cb5507f3e96e0de730141ff",
"size": ... |
"""Configure test fixtures"""
# std imports
import os
import platform
import subprocess
# 3rd party
import pytest
IS_WINDOWS = platform.system() == 'Windows'
all_terms_params = 'xterm screen ansi vt220 rxvt cons25 linux'.split()
many_lines_params = [40, 80]
# we must test a '1' column for conditional in _handle_lon... | {
"content_hash": "680d3109a5ddfa1263290b0755c8f32f",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 82,
"avg_line_length": 24.833333333333332,
"alnum_prop": 0.6452540747842761,
"repo_name": "jquast/blessed",
"id": "8ef49e96c93c7db89a133d64f1c587c18a5bea4f",
"size": "2086"... |
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.shortcuts import redirect, render
from django.utils.translation import ugettext as _
from django.views.decorators.debug import sensitive_post_parameters
from user.forms import UserForm, UserInformationForm... | {
"content_hash": "adfdb8c30be714aad4953f3339bf0ea6",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 166,
"avg_line_length": 30.206349206349206,
"alnum_prop": 0.6106148187073043,
"repo_name": "fsr/course-management",
"id": "552bf6eeaca133bb7377529fb76e125289c10648",
"size... |
import sys
import time
imported_neural_signal = False
no_bci = False
try:
#from unlock.bci.acquire.neuralsignal import create_timer
from unlock.bci.acquire.random_signal import create_timer, create_random_signal
imported_neural_signal = True
except:
assert sys.platform == 'darwin' or sys.platform == '... | {
"content_hash": "c91c1f13b5e16af280277dddcb61e082",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 175,
"avg_line_length": 31.89873417721519,
"alnum_prop": 0.5954365079365079,
"repo_name": "NeuralProsthesisLab/unlock",
"id": "9a553808a850ce9be1f825a05e4ec741c2b55fde",
"... |
"""Call HLA alleles with assembly methods implemented in bwakit.
https://github.com/lh3/bwa/blob/master/README-alt.md#hla-typing
https://github.com/lh3/bwa/tree/master/bwakit
"""
import csv
import glob
import os
import toolz as tz
from bcbio import utils
from bcbio.distributed.transaction import file_transaction
fro... | {
"content_hash": "3f33447b6dff1eb8bf6f796e6c9ada4e",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 116,
"avg_line_length": 46.157303370786515,
"alnum_prop": 0.5676728334956183,
"repo_name": "lpantano/bcbio-nextgen",
"id": "99d8bcc6d98b6d53e5b200b3377d1f62fe76692c",
"size... |
"""
Rotations, VTK Textbook figure 3-31a.
Note: Make sure Rotations.py is in the same directory as this program.
"""
import Rotations
def main():
file_name, figure, book_color = Rotations.get_program_parameters()
# Set up for six rotations about the x-axis.
figure = 1
book_color = True
Rotations... | {
"content_hash": "61e605ef71e441152d9e4ec08ed17a7b",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 70,
"avg_line_length": 21,
"alnum_prop": 0.6641604010025063,
"repo_name": "lorensen/VTKExamples",
"id": "db2e2329ad06efe6846146d451226b5cd08ccb18",
"size": "422",
"binary... |
""" Export a Guidebook schedule CSV file with the currently accepted
talks.
Usage: manage.py guidebook_csv ep2015 gb.csv
Guidebook CSV format (UTF-8 encoded):
-------------------------------------
Session Title,Date,Time Start,Time End,Room/Location,Schedule Track (Optional),Description (Optional... | {
"content_hash": "560036aa83b0510c555d74d0cf50ee1f",
"timestamp": "",
"source": "github",
"line_count": 237,
"max_line_length": 168,
"avg_line_length": 29.80168776371308,
"alnum_prop": 0.5603851054792581,
"repo_name": "EuroPython/epcon",
"id": "c983141ac3895ad088ae7799d68b354b1267014b",
"size": "70... |
from pycerberus.validators.basic_numbers import *
from pycerberus.validators.checkbox import *
from pycerberus.validators.domain import *
from pycerberus.validators.foreach import *
from pycerberus.validators.email import *
from pycerberus.validators.matching_fields import *
from pycerberus.validators.oneof import *
fr... | {
"content_hash": "222e26b84d8524d50a0e90f1c4371067",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 51,
"avg_line_length": 40.22222222222222,
"alnum_prop": 0.8370165745856354,
"repo_name": "gpatonay/popy",
"id": "be899e584a2082e15d0adbc7177a1f4a4de2e3a3",
"size": "363",
... |
__author__ = """Nicholas A. Del Grosso"""
__email__ = '[email protected]'
__version__ = '0.1.0'
from .reading import read_objfile, parse_mixed_delim_str, read_mtlfile, read_wavefront
from .writing import WavefrontWriter
| {
"content_hash": "b05514e0c9d0bf2e2261f3259f6680db",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 86,
"avg_line_length": 37.333333333333336,
"alnum_prop": 0.7053571428571429,
"repo_name": "neuroneuro15/wavefront_reader",
"id": "c92d326d0c2e5e10f2e35598de421aff7eb07ec4",
... |
from parser_3x3_abilities import *
class StrategicLobe(Parser):
def take_the_center(self, intel):
if 4 in intel['options']:
return 4
return False
def take_catty_corner(self, intel):
center = intel['board'][4]
NWSE_diag = intel['analysis'][6]
NESW_diag = int... | {
"content_hash": "33eae2399dbff7466227f14e92887746",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 65,
"avg_line_length": 31.576923076923077,
"alnum_prop": 0.5566382460414129,
"repo_name": "IanDCarroll/xox",
"id": "3f996de7f18a2bc1badab5eb6ebd508aeca84c34",
"size": "821"... |
from __future__ import absolute_import, print_function
try:
from llvm.core import Builder, Constant, Module, Type
from llvm.core import IPRED_EQ, IPRED_NE, IPRED_SGE, IPRED_SGT, IPRED_SLE, IPRED_SLT
except:
pass
from tinyc import token
from tinyc.analyzer import Analyzer
from tinyc.common import Kinds
c... | {
"content_hash": "6a1c2fdee8fe66fdfce7686bbab247e1",
"timestamp": "",
"source": "github",
"line_count": 333,
"max_line_length": 101,
"avg_line_length": 38.210210210210214,
"alnum_prop": 0.5922665828355863,
"repo_name": "ymyzk/tinyc",
"id": "f56e78d367b2fe60bea606147701c9b99443f2a9",
"size": "13187"... |
import time
import sqlite3
import datetime
"""DB interface for comunicating with sqlite3"""
class DBError(Exception):
pass
class DB(object):
"""
Public methods:
add_request(): add a request to the database (requests table).
get_user(): get user info from the database (users table).
... | {
"content_hash": "45a96d12cdf970c87911e61c994f14e4",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 78,
"avg_line_length": 32.09756097560975,
"alnum_prop": 0.5364741641337386,
"repo_name": "ilv/gettor",
"id": "7a595a308374715bdd67275edaee4fb69e69baf7",
"size": "4287",
... |
import libsvm
import argparse
from cPickle import load
from learn import extractSift, computeHistograms, writeHistogramsToFile
import os
#default file paths
HISTOGRAMS_FILE = 'testdata.svm'
CODEBOOK_FILE = 'codebook.file'
MODEL_FILE = 'trainingdata.svm.model'
#parsing for classification purpose
#python classify.py ... | {
"content_hash": "ebec1dad66975e1ed335d66658db7d22",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 146,
"avg_line_length": 32.12,
"alnum_prop": 0.7256122872561229,
"repo_name": "navinpai/CS706",
"id": "7560cbf172d6863efefa853536155f301538d220",
"size": "2409",
"binary"... |
from django.template import Library
from django.template.base import Node
from django.test import TestCase
class FilterRegistrationTests(TestCase):
def setUp(self):
self.library = Library()
def test_filter(self):
@self.library.filter
def func():
return ''
... | {
"content_hash": "a15ce8c0397de18901afab78e676642c",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 67,
"avg_line_length": 29.431818181818183,
"alnum_prop": 0.5742599742599742,
"repo_name": "yephper/django",
"id": "2e58102bfddf9a5abe710c85116a7d78202186c8",
"size": "3885... |
__title__ = 'unihan-etl'
__package_name__ = 'unihan_etl'
__description__ = 'Export UNIHAN to Python, Data Package, CSV, JSON and YAML'
__version__ = '0.10.3'
__author__ = 'Tony Narlock'
__email__ = '[email protected]'
__github__ = 'https://github.com/cihai/unihan-etl'
__docs__ = 'https://unihan-etl.git-pull.com'
__tra... | {
"content_hash": "74d4ec27e7a015ebc59f1656d7204f01",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 81,
"avg_line_length": 44.083333333333336,
"alnum_prop": 0.6597353497164461,
"repo_name": "cihai/cihaidata-unihan",
"id": "97b9414077a550dcd9f2d8027e7a03a7578225dc",
"size"... |
import tempfile
import subprocess
from typing import List
from typeguard import check_argument_types
from neuralmonkey.logging import warn
from neuralmonkey.evaluators.evaluator import Evaluator
# pylint: disable=too-few-public-methods
class MultEvalWrapper(Evaluator[List[str]]):
"""Wrapper for mult-eval's refer... | {
"content_hash": "486aef01ac89504f9c121d27b72dcfda",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 78,
"avg_line_length": 35.47191011235955,
"alnum_prop": 0.5470383275261324,
"repo_name": "ufal/neuralmonkey",
"id": "bb0ae7bd0fe9c2d0d84f6d440e603d216b4a6421",
"size": "315... |
import collections as coll
import numpy as np
from scipy import ndimage
import warnings
from skimage.util import img_as_float, regular_grid
from skimage.segmentation._slic import _slic_cython, _enforce_label_connectivity_cython
from skimage.color import rgb2lab
def slic(image, n_segments=100, compactness=10., max_it... | {
"content_hash": "50cc6555f2c18b597735580b3d347e44",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 87,
"avg_line_length": 40.025510204081634,
"alnum_prop": 0.6281708094327597,
"repo_name": "chintak/scikit-image",
"id": "11373381255d99bbbc8e84631db71b0c4d8fa24f",
"size":... |
import unittest
import datetime
import numpy as np
import desisurvey.tiles
import desisurvey.config
from desisurvey.test.base import Tester
from desisurvey.plan import Planner
class TestPlan(Tester):
def test_plan(self):
tiles = desisurvey.tiles.get_tiles()
donefrac = np.zeros(tiles.ntiles, 'f4... | {
"content_hash": "e964cfda9d17260a10b6c9d7261c5a31",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 94,
"avg_line_length": 42.15384615384615,
"alnum_prop": 0.6031021897810219,
"repo_name": "desihub/desisurvey",
"id": "35dfb205fda592993b2c0dea8685b63c8d8bc927",
"size": "21... |
from __future__ import unicode_literals
from __future__ import print_function
import os
import sys
import sh
from sh import uwsgi, ErrorReturnCode
from termcolor import colored
from studio.frame import config
from studio.launch.base import manager
from .contrib import build_structure
uwsgi_manager = manager.subcomman... | {
"content_hash": "c51e6eaa75df5cb7e5b4808a0ae6ca93",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 64,
"avg_line_length": 27.252032520325205,
"alnum_prop": 0.5802505966587113,
"repo_name": "qisanstudio/qstudio-launch",
"id": "3489645188a4316924bf0196e22dbf29f563b33b",
"... |
"""
NAME
huji_magic.py
DESCRIPTION
converts HUJI format files to measurements format files
SYNTAX
huji_magic.py [command line options]
OPTIONS
-h: prints the help message and quits.
-usr USER: Colon delimited list of analysts, default is ""
-ID: directory for input file if not included in -f... | {
"content_hash": "b4d7ee1760808edc055e4ef06e571413",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 141,
"avg_line_length": 40.78857142857143,
"alnum_prop": 0.605771924908938,
"repo_name": "lfairchild/PmagPy",
"id": "0aef2f3f04b2c94a9508ce6bfd3612cbc27b3ada",
"size": "71... |
from mytools.utilities import not_str
from . import exceptions as exc, reg
from .cid import controllers as ctl
from .cid.enum import CidEnum
class Builder():
def __init__(self, obj):
self.obj = obj
def __enter__(self):
self.obj.listener = self.build(self.obj)
exec_logic = self.exec_logi... | {
"content_hash": "6232e09986e476a084b1504bc3cf26f1",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 100,
"avg_line_length": 41.86,
"alnum_prop": 0.512979773849339,
"repo_name": "Ricyteach/candemaker",
"id": "015305073e8fc5c752d960c20db94f8c9bcb95b4",
"size": "6279",
"b... |
from plugit.utils import action, only_orga_member_user, json_only, cache, PlugItRedirect
from models import Ecc, CountryCode
# Include homepage
@action(route="/", template="main/home.html")
@only_orga_member_user()
def main_home(request):
"""Show the home page."""
return PlugItRedirect('stations')
# Inclu... | {
"content_hash": "c91b0d76cb91db090fa72c3e52910205",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 88,
"avg_line_length": 21.313725490196077,
"alnum_prop": 0.6623735050597976,
"repo_name": "ebu/radiodns-plugit",
"id": "82de981d866fdc5be8304170f5b6ee5a01384397",
"size": "... |
''' FSL IO '''
from __future__ import with_statement
import os
from os.path import join as pjoin
from subprocess import Popen, PIPE
import numpy as np
import numpy.linalg as npl
from numpy import newaxis
from scipy.ndimage import map_coordinates as mc
from scipy.ndimage import affine_transform
from dipy.io.dpy impo... | {
"content_hash": "f1720f26cc8d34e748fbea2bfda4ebeb",
"timestamp": "",
"source": "github",
"line_count": 418,
"max_line_length": 119,
"avg_line_length": 34.73444976076555,
"alnum_prop": 0.6227012879674909,
"repo_name": "maurozucchelli/dipy",
"id": "197d4c5a23c4ac05523f6a88c8690791ff0ef1c2",
"size": ... |
from time import sleep
from django.core.management.base import BaseCommand
import celery
from applications.cart.models import Order
from applications.cart.tasks import recompile_order
__author__ = 'AlexStarov'
""" Парсим заказы - переводим Email-ы в базу Email-ов а телефоны в базу телефонов. """
class Command(BaseC... | {
"content_hash": "71621296a90eabac5d94ad9a2caf92a1",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 95,
"avg_line_length": 29.75,
"alnum_prop": 0.569327731092437,
"repo_name": "AlexStarov/Shop",
"id": "f4e170f29d0f3aa65259d5225ba5c27e1ce7eb16",
"size": "1028",
"binary":... |
import os
from subprocess import PIPE
from ovm.exceptions import OVMError
from ovm.utils.compat23 import Popen
from ovm.utils.copyprogress import CopyProgress
class ImageTemplate:
def __init__(self, config):
self.path = config.get('path')
self.format = config.get('format')
self.size = in... | {
"content_hash": "712ca22f5d9f5fa3fdd7b00db81df8c0",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 70,
"avg_line_length": 26.833333333333332,
"alnum_prop": 0.5755693581780539,
"repo_name": "lightcode/OVM",
"id": "54580eeec6b6ff5daaffc81097ffd6817a9a1ab7",
"size": "1014",... |
''' Interface and other definitions needed to create game modes for the drafting engine. '''
import os
from abc import ABCMeta as abstractclass, abstractmethod
# Definition of how many cards a set draft should have.
HS_NUM_CARDS_IN_SET = 3
# Private definitions; boilerplate for module definition.
thisdir = os.path.s... | {
"content_hash": "f5dcf76810e836a9d8f9c4be53c5bf6c",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 116,
"avg_line_length": 35.73913043478261,
"alnum_prop": 0.6763990267639902,
"repo_name": "AlexSafatli/HearthstoneDrafter",
"id": "8345ea36360eea474f43fc00a4aaa0828d64b88f",
... |
import re
from hacking import core
RE_RELATIVE_IMPORT = re.compile(r'^from\s*[.]')
@core.flake8ext
def hacking_import_rules(logical_line, filename, noqa):
r"""Check for imports.
OpenStack HACKING guide recommends one import per line:
Do not import more than one module per line
Examples:
Okay: ... | {
"content_hash": "c0bb06d19a1bc9f7ad92461878d99ced",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 78,
"avg_line_length": 36.141304347826086,
"alnum_prop": 0.5840601503759398,
"repo_name": "openstack-dev/hacking",
"id": "627b7aa8cba11955a6ec0af9c8ece2f5d9223464",
"size":... |
__author__ = 'Allison MacLeay'
from sklearn.tree import DecisionTreeRegressor
import CS6140_A_MacLeay.Homeworks.HW4 as hw4
import numpy as np
class GradientBoostRegressor(object):
def __init__(self, n_estimators=10, learning_rate=0.1, max_depth=1, learner=DecisionTreeRegressor):
self.train_score = 0
... | {
"content_hash": "90b637021e3dcf0d5426626995c02b50",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 103,
"avg_line_length": 33.70175438596491,
"alnum_prop": 0.599167100468506,
"repo_name": "alliemacleay/MachineLearning_CS6140",
"id": "b42876d1d46f187abb6308fea92690e77792b86... |
import RPi.GPIO as GPIO
import time
#GPIO Mode (BOARD / BCM)
GPIO.setmode(GPIO.BCM)
#set GPIO Pins
GPIO_TRIGGER = 18
GPIO_ECHO = 24
GPIO_IR = 6
#set GPIO direction (IN / OUT)
GPIO.setup(GPIO_TRIGGER, GPIO.OUT)
GPIO.setup(GPIO_ECHO, GPIO.IN)
GPIO.setup(GPIO_IR, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
def main ():
... | {
"content_hash": "015b3502d0ab0fcc2ac7c40cca9bfb2e",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 103,
"avg_line_length": 27.104477611940297,
"alnum_prop": 0.5759911894273128,
"repo_name": "JohnOmernik/pimeup",
"id": "efd35b8881584fd353af658e680ebf4299679c4f",
"size": "... |
"""Task driver for completing node provisioning with Canonical MaaS 2.2+."""
import logging
import uuid
import concurrent.futures
from oslo_config import cfg
import drydock_provisioner.error as errors
import drydock_provisioner.objects.fields as hd_fields
import drydock_provisioner.config as config
from drydock_pro... | {
"content_hash": "d2316c38c102be380513a38891b53d15",
"timestamp": "",
"source": "github",
"line_count": 238,
"max_line_length": 90,
"avg_line_length": 38.529411764705884,
"alnum_prop": 0.5917121046892039,
"repo_name": "att-comdev/drydock",
"id": "25973e519943ff01159c87aa99408695fa5370d7",
"size": "... |
from . import base
from .. import utils
from grow.pods import env
from protorpc import messages
import os
import webreview
class Config(messages.Message):
env = messages.MessageField(env.EnvConfig, 1)
project = messages.StringField(2, required=True)
name = messages.StringField(3, required=True)
server = messa... | {
"content_hash": "f29b8990153459b10c1e76de0b2b509b",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 80,
"avg_line_length": 31.74,
"alnum_prop": 0.6802142407057341,
"repo_name": "codedcolors/pygrow",
"id": "f93f18ccfb3112626054fbbbbb7d47ccf92dd636",
"size": "3174",
"bin... |
"""
Copyright 2017-present Airbnb, Inc.
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, sof... | {
"content_hash": "37ee81e4144d8ec184e94ca8d3b8e1d7",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 96,
"avg_line_length": 32.54,
"alnum_prop": 0.690842040565458,
"repo_name": "airbnb/streamalert",
"id": "9dd37f3d0ad5c30e1e32ccb497d1d5509062520b",
"size": "4881",
"bina... |
import argparse
def main():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(dest="subparser_name")
server_parser = subparsers.add_parser("server",
description="Capdash server")
server_parser.\
add_argument("-l",
... | {
"content_hash": "3b92e77040435b8b2d2f8150374ae747",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 73,
"avg_line_length": 28.263157894736842,
"alnum_prop": 0.4851024208566108,
"repo_name": "mwhooker/messier",
"id": "9dc637f4299970c99567b72c677103454c75ab46",
"size": "107... |
#!/usr/bin/env python2
'''
You should normally never use this! Use emcc instead.
This is a small wrapper script around the core JS compiler. This calls that
compiler with the settings given to it. It can also read data from C/C++
header files (so that the JS compiler can see the constants in those
headers, for the li... | {
"content_hash": "203f2b339292da6cc3d194dc2158b54b",
"timestamp": "",
"source": "github",
"line_count": 1691,
"max_line_length": 338,
"avg_line_length": 44.51271437019515,
"alnum_prop": 0.6162798421702913,
"repo_name": "PopCap/GameIdea",
"id": "39f301b0acfb1015281aa0288d09cd964d941193",
"size": "75... |
from api.models import * # noqa
from rest_framework import viewsets
from api.serializers import * # noqa
from rest_framework import filters
from rest_pandas import PandasViewSet
import django_filters
class ProgramViewSet(viewsets.ModelViewSet):
queryset = Program.objects.all()
serializer_class = ProgramSeri... | {
"content_hash": "40bd3d9ffa1d3626ab38b4fa0e8fe80b",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 70,
"avg_line_length": 26.61875,
"alnum_prop": 0.7161305470767786,
"repo_name": "Seshra/holocron-api",
"id": "9c588a11359f50482b8c5a47b37c5169c201baf8",
"size": "4259",
... |
import line_patterns, composite_patterns, diamond_patterns, grid_patterns
import copy
def create(d):
if 'topology' not in d:
raise Exception('topology is missing in pattern.create')
topology = d['topology']
if 'composite' in d:
c = d['composite']
dcopy = copy.copy(d)
del d... | {
"content_hash": "0cc35d6c769ecdaf7ff8a2601cda94fa",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 84,
"avg_line_length": 35.04054054054054,
"alnum_prop": 0.5599691477053605,
"repo_name": "efectivo/network_sim",
"id": "1207d0f156615ccd8e42b719cc7b1a262a0d65e4",
"size": "... |
import os
import sys
DBG_OUTPUT_FILE="Output/" + sys.argv[1] + ".dbg.out"
OPT_DBG_OUTPUT_FILE="Output/" + sys.argv[1] + ".dbg.opt.out"
LOG_FILE="Output/" + sys.argv[1] + ".log"
NATIVE_DBG_OUTPUT_FILE="Output/" + sys.argv[1] + ".native.dbg.out"
NATIVE_OPT_DBG_OUTPUT_FILE="Output/" + sys.argv[1] + ".native.dbg.opt.out"
... | {
"content_hash": "d7202a0f67fdbac0f913c5099ba4e2a0",
"timestamp": "",
"source": "github",
"line_count": 191,
"max_line_length": 87,
"avg_line_length": 30.837696335078533,
"alnum_prop": 0.5932088285229202,
"repo_name": "ensemblr/llvm-project-boilerplate",
"id": "be6fa2368d8b89b3d76c8a505f82f680af74e02... |
from __future__ import division
"""Defines a Client class that can be used to communicate with the
Server class defined in server.py.
The client will connect to the port specified in the environment
variable PYSYN_PORT. If this variable is not set, it will use
the default_port imported from server.py.
"""
... | {
"content_hash": "7bafa90253327e427a962c12655591d0",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 74,
"avg_line_length": 32.717948717948715,
"alnum_prop": 0.5783699059561128,
"repo_name": "martindurant/starclassifier",
"id": "5fc9783ef065492f1b023d8573ddf4c9ba5480b7",
"... |
from abc import ABCMeta
from numbers import Integral
import numpy as np
import sqlite3
from sqlite3 import Row
import warnings
from logbook import Logger
import pandas as pd
from pandas.tseries.tools import normalize_date
from six import with_metaclass, string_types
from zipline.errors import (
ConsumeAssetMetaDa... | {
"content_hash": "68508c7386cca5e30c625ee043010920",
"timestamp": "",
"source": "github",
"line_count": 908,
"max_line_length": 79,
"avg_line_length": 33.78193832599119,
"alnum_prop": 0.5390558779422312,
"repo_name": "ronalcc/zipline",
"id": "199853193886ff19f0e92b8b116de2833e352213",
"size": "3125... |
import sys
from mixbox.binding_utils import *
from . import cybox_common
from . import address_object
from . import network_route_entry_object
class RoutesType(GeneratedsSuper):
"""The RoutesType is intended to characterize a set network routes."""
subclass = None
superclass = None
def __init__(self... | {
"content_hash": "87e6aa460ec2e8901fda705d5ef04eda",
"timestamp": "",
"source": "github",
"line_count": 371,
"max_line_length": 156,
"avg_line_length": 45.58490566037736,
"alnum_prop": 0.6828878902554399,
"repo_name": "CybOXProject/python-cybox",
"id": "3a7d07ac585bfd463a2a93a0ab334d34e76262aa",
"s... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import itertools
import typing # NOQA: F401
from nixnet import _frames
from nixnet import _funcs
from nixnet import _props
from nixnet._session import collection
from nixnet import constants
from nixnet impo... | {
"content_hash": "064bf9a5dcab4e2ea79f5a5eb877eeae",
"timestamp": "",
"source": "github",
"line_count": 395,
"max_line_length": 109,
"avg_line_length": 40.8253164556962,
"alnum_prop": 0.6183802554880318,
"repo_name": "ni/nixnet-python",
"id": "64cc3a2ea63ac5c91957f86bd47b88283173fab2",
"size": "161... |
from django.conf.urls import url
from users import views
urlpatterns = [
# url(r'^$', views.home, name='home'),
]
| {
"content_hash": "3fe6652ca41352c5aeef4ca8516eb187",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 42,
"avg_line_length": 15.125,
"alnum_prop": 0.6528925619834711,
"repo_name": "asyncee/django-project-template",
"id": "7c73c7a33deec99bd2b99ec6f23c33c18dd6a83f",
"size": "1... |
import _plotly_utils.basevalidators
class TickformatstopdefaultsValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(
self, plotly_name="tickformatstopdefaults", parent_name="layout.xaxis", **kwargs
):
super(TickformatstopdefaultsValidator, self).__init__(
plotly... | {
"content_hash": "6a3961e24478759d427400ae8a2a9818",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 88,
"avg_line_length": 32.5,
"alnum_prop": 0.582905982905983,
"repo_name": "plotly/python-api",
"id": "a9189ae00c9a59065e953d51b20ff370d663923f",
"size": "585",
"binary":... |
from data_collection.management.commands import BaseHalaroseCsvImporter
class Command(BaseHalaroseCsvImporter):
council_id = 'E07000188'
addresses_name = 'parl.2017-06-08/Version 1/polling_station_export-2017-05-25.csv'
stations_name = 'parl.2017-06-08/Version 1/polling_station_export-2017-05-25.cs... | {
"content_hash": "917abfc9e6d83ff9816e9141d8b6f8f6",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 87,
"avg_line_length": 52.142857142857146,
"alnum_prop": 0.7287671232876712,
"repo_name": "chris48s/UK-Polling-Stations",
"id": "7ac902803e892f4e86c164ce41b5fe91d3f0f9f2",
"... |
from south.db import db
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'TestInstance.string_value'
db.add_column('qa_testinstance', 'string_value',
self.gf('django.db.models.fields.CharField')(max_length=1024, n... | {
"content_hash": "5061eec60a174911ab9155666e6c6eaa",
"timestamp": "",
"source": "github",
"line_count": 258,
"max_line_length": 199,
"avg_line_length": 86.50387596899225,
"alnum_prop": 0.5523792454521015,
"repo_name": "sharifelguindi/qatrackplus",
"id": "e64f74bcec2e9e6be8f7a9a1b172ec6a2d72df56",
"... |
import factory
import django.contrib.auth.models
from . import models
class User(factory.DjangoModelFactory):
FACTORY_FOR = django.contrib.auth.models.User
username = factory.Sequence(lambda n: 'user%d' % n)
first_name = 'John'
last_name = 'Doe'
email = '[email protected]'
# admin = False
class ... | {
"content_hash": "c7b9b92fd45ade8aa4db87a930e3989f",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 65,
"avg_line_length": 24.77777777777778,
"alnum_prop": 0.6853512705530643,
"repo_name": "linovia/wight-invoices",
"id": "9a17890b9599c4cec03c51ab6a5924e02f5b92ce",
"size":... |
from flask_wtf import FlaskForm
from wtforms import StringField, TextAreaField, BooleanField, SelectField,\
SubmitField, FileField
from wtforms.validators import Required, Length, Email, Regexp
from wtforms import ValidationError
from flask_pagedown.fields import PageDownField
from ..models import Role, User
clas... | {
"content_hash": "5194f82cadec441e97550209b4cdc4dd",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 78,
"avg_line_length": 38.19402985074627,
"alnum_prop": 0.6393122313403673,
"repo_name": "superchilli/webapp",
"id": "f34211bbc5f9b6991a7c30c878003e9a52c2938e",
"size": "25... |
import unittest
__author__ = 'Noel'
class GrammarTestCase(unittest.TestCase):
@staticmethod
def parse_function(parser):
"""
Return a function that parses a value with the specified parser and
returns the results as a list.
"""
def function(value):
return p... | {
"content_hash": "4c2d0244f8968e3685b33161adcfea97",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 75,
"avg_line_length": 23.11764705882353,
"alnum_prop": 0.6361323155216285,
"repo_name": "pyrapt/rapt",
"id": "18b31d595757aa7641e521540f318a58d7d15320",
"size": "393",
"... |
import PIL
from PIL import ImageFont
from PIL import Image
from PIL import ImageDraw
# font = ImageFont.truetype("Arial-Bold.ttf",14)
font = ImageFont.truetype("Arial.ttf",14)
img=Image.new("RGBA", (500,250),(255,255,255))
draw = ImageDraw.Draw(img)
draw.text((0, 0),"This is a test",(0,0,0),font=font)
draw = ImageDraw... | {
"content_hash": "e71e34f349df9666b0b20ec2c12f75ab",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 52,
"avg_line_length": 29.5,
"alnum_prop": 0.7175141242937854,
"repo_name": "poseidn/KungFoo-legacy",
"id": "de1157c4f0ca0c35eddc2e7acf98eea6876b9149",
"size": "354",
"bi... |
import os
import brica1.gym
import numpy as np
import six.moves.cPickle as pickle
from ml.cnn_feature_extractor import CnnFeatureExtractor
from ml.agent import Agent
from config.model import CNN_FEATURE_EXTRACTOR, CAFFE_MODEL, MODEL_TYPE
from config.log import APP_KEY
import logging
app_logger = logging.getLogger(A... | {
"content_hash": "b43cdedc6328cbeffbbc13dc16ea71aa",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 105,
"avg_line_length": 35.992753623188406,
"alnum_prop": 0.6188846386148581,
"repo_name": "pekin0609/-",
"id": "2ef4d8ffa1fb3b8b6d3e5d5b63e8bfb1356dc344",
"size": "4984",... |
from pyxb_114.bundles.opengis.raw._ogc import *
| {
"content_hash": "7574018c231a7dab30b5263642e88a01",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 47,
"avg_line_length": 48,
"alnum_prop": 0.7708333333333334,
"repo_name": "msherry/PyXB-1.1.4",
"id": "f0aaa6f56aeb3b7e750686273c7ea5fca3bcb098",
"size": "48",
"binary": f... |
from google.cloud import network_security_v1
def sample_get_client_tls_policy():
# Create a client
client = network_security_v1.NetworkSecurityClient()
# Initialize request argument(s)
request = network_security_v1.GetClientTlsPolicyRequest(
name="name_value",
)
# Make the request
... | {
"content_hash": "ee787b0c1700fd5365252fc5d3a8eacc",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 85,
"avg_line_length": 27,
"alnum_prop": 0.7290448343079922,
"repo_name": "googleapis/python-network-security",
"id": "f7b567d9477546e09724d6a831e6064b7fbc50f0",
"size": "1... |
import os, time, getpass, locale
# Third party modules #
import matplotlib
################################################################################
class Graph(object):
def __init__(self, parent, base_dir=None, short_name=None):
self.parent = parent
# Base dir #
if not base_dir: s... | {
"content_hash": "7f052802432073a8c8f94c4bb8fa1f41",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 113,
"avg_line_length": 44.4390243902439,
"alnum_prop": 0.5724478594950604,
"repo_name": "inodb/gefes",
"id": "d545e68c226c91ba94cc3b5ba30d3a7b284c1fb4",
"size": "1843",
... |
import pygame
import sys
class GUI:
def __init__(self, _game_state):
pygame.init()
self.state = _game_state
self.font_size = 30
self.window_height = 430
self.window_width = 570
self.colors = {"white": (255, 255, 255),
"black": (41, 36, 33),
... | {
"content_hash": "77535d1e7a267b923d49d64aa0e8cc0c",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 130,
"avg_line_length": 47.22605363984675,
"alnum_prop": 0.5057601817296771,
"repo_name": "sontung/pathfinder",
"id": "e692d96cb153a3087409379df896639c2570663b",
"size": "... |
"""
Cleans up Units of measurement for graphing
"""
from settings import Settings
def fix_units(list):
MMOLL_CONVERT_FACTOR = 18.0
if Settings.DISPLAY_UNIT == 'mmol/L':
for idx in range(0, len(list)):
# Recent Glucose:
if 'sgv' in list[idx]:
list[idx]['sgv'] =... | {
"content_hash": "664afe56fe18b2229fe88e45609495c5",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 84,
"avg_line_length": 30.76,
"alnum_prop": 0.5279583875162549,
"repo_name": "channemann/openaps-monitor",
"id": "120aefb72989cb5555b50ad14b1b3a820a1dd01c",
"size": "784",
... |
import coherence.extern.louie as louie
from coherence.upnp.core.utils import generalise_boolean
from coherence.backend import Backend
DEFAULT_NAME_SIMPLE = 'SimpleLight'
DEFAULT_NAME_BETTER = 'BetterLight'
class SimpleLight(Backend):
""" this is a backend for a simple light
that only can be switched on... | {
"content_hash": "54b8ef03c5a5611943bd46eee88b06ca",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 89,
"avg_line_length": 35.772277227722775,
"alnum_prop": 0.6437863271519513,
"repo_name": "coherence-project/Coherence",
"id": "b2b344ecfb9d29c5f8eb034bbd1a9a10f9f5a546",
... |
from django.conf.urls import patterns, url
from django.contrib.admin.views.decorators import staff_member_required
from ckeditor import views
urlpatterns = patterns(
'',
url(r'^upload/', staff_member_required(views.upload), name='ckeditor_upload'),
url(r'^browse/', staff_member_required(views.browse), nam... | {
"content_hash": "b17c446af83eebb0ce96b0b7f82f7ee6",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 82,
"avg_line_length": 34.4,
"alnum_prop": 0.7412790697674418,
"repo_name": "sergey-romanov/django-ckeditor",
"id": "a88bb0d8f1c1e9907277da6e92d829c38bd2b1da",
"size": "344... |
from __future__ import unicode_literals
from django.core.urlresolvers import reverse_lazy
from django.views import generic
from django.contrib.auth import get_user_model
# from django.contrib import auth
from django.contrib import messages
from authtools import views as authviews
from braces import views as bracesviews... | {
"content_hash": "0eafdae7948d11439fcb2caed9330c44",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 106,
"avg_line_length": 35.65384615384615,
"alnum_prop": 0.6854368932038835,
"repo_name": "zazasa/TeaRoom",
"id": "eb7d2d28117b52a1dd9edb837c647d329ae626d0",
"size": "4635... |
from __future__ import absolute_import, division, print_function
import abc
import six
@six.add_metaclass(abc.ABCMeta)
class MACContext(object):
@abc.abstractmethod
def update(self, data):
"""
Processes the provided bytes.
"""
@abc.abstractmethod
def finali... | {
"content_hash": "a9465e9def6d7a8baf32afe9e5b69524",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 71,
"avg_line_length": 21.705882352941178,
"alnum_prop": 0.5772357723577236,
"repo_name": "hipnusleo/laserjet",
"id": "40adb4ddb568b8f51db734f6fe0011192f6f00f5",
"size": "9... |
import os
from tornado import web
from tornado.web import URLSpec as url
from tnb.contrib.urls import include
from tnb.settings import settings
from tnb.apps.core.views import (DocsHandler, CachingFrontendHandler, HomeHandler)
from tnb.config import PYTHON_PROJECT_DIR, ASSETS_FOLDER
urls = [
# NEED to capture "... | {
"content_hash": "e3b9c9c9e62dbd2f838919940c66b872",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 86,
"avg_line_length": 36.45454545454545,
"alnum_prop": 0.6932668329177057,
"repo_name": "vladiibine/trust-network",
"id": "82e6c820f9faf9dc8bc08870331a28867cc3e1ae",
"size... |
"""This is the setup.py file for the GRR client.
This is just a meta-package which pulls in the minimal requirements to create a
client.
This package needs to stay simple so that it can be installed on windows and
ancient versions of linux to build clients.
"""
from __future__ import absolute_import
from __future__ i... | {
"content_hash": "69e956ec647f874d213e848ae9518890",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 80,
"avg_line_length": 31.821428571428573,
"alnum_prop": 0.6736812570145904,
"repo_name": "demonchild2112/travis-test",
"id": "47d6482299cb9b099cd32290f25989815e5cc84a",
"... |
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'version': '1.0'}
DOCUMENTATION = '''
---
module: nxos_mtu
version_added: "2.2"
short_description: Manages MTU settings on Nexus switch.
description:
- Manages MTU settings on Nexus switch.
extends_docum... | {
"content_hash": "1ccede8384fc8c016c5013b0d12d7921",
"timestamp": "",
"source": "github",
"line_count": 580,
"max_line_length": 85,
"avg_line_length": 30.643103448275863,
"alnum_prop": 0.5586563889045181,
"repo_name": "nwiizo/workspace_2017",
"id": "48a92c2f9413112659c31c2ac792d9df663adfc9",
"size"... |
from subconscious.model import RedisModel, Column, InvalidQuery
from uuid import uuid1
from datetime import datetime
from .base import BaseTestCase
import enum
class StatusEnum(enum.Enum):
ACTIVE = 'active'
class TestUser(RedisModel):
id = Column(primary_key=True)
name = Column(index=True, sort=True)
... | {
"content_hash": "7608d3df1b0a9f5e4f9b6260890cdac8",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 98,
"avg_line_length": 38.87074829931973,
"alnum_prop": 0.5829541477073854,
"repo_name": "paxos-bankchain/subconscious",
"id": "4bf04872d8c0b4d426654bc2e9fe4c550bd5b9d3",
... |
"""Cary."""
# --- import --------------------------------------------------------------------------------------
import fnmatch
import queue
import pathlib
import os
from ._collection import Collection
# --- define --------------------------------------------------------------------------------------
__all__ = ... | {
"content_hash": "30d080298784b9b87b5be6097acbfdea",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 99,
"avg_line_length": 33.130434782608695,
"alnum_prop": 0.5259186351706037,
"repo_name": "wright-group/WrightTools",
"id": "9f269b6d73c7d0d3d15a1e3548b587aafe00f049",
"siz... |
import datetime
import ftplib
import logging
import os.path
from airflow.hooks.base_hook import BaseHook
from past.builtins import basestring
def mlsd(conn, path="", facts=None):
"""
BACKPORT FROM PYTHON3 FTPLIB.
List a directory in a standardized format by using MLSD
command (RFC-3659). If path is o... | {
"content_hash": "a301e632bb7df6a7e3bd8edd55df0156",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 78,
"avg_line_length": 30.472477064220183,
"alnum_prop": 0.588438958301972,
"repo_name": "yiqingj/airflow",
"id": "e14bfe214a3daff45cb81195ec56b9acad6facdd",
"size": "7212... |
from __future__ import unicode_literals
import pytest
from django.conf import settings
from django.core.files.uploadedfile import SimpleUploadedFile
from django.urls import reverse
from machina.core.db.models import get_model
from machina.core.loading import get_class
from machina.test.factories import GroupFactory
f... | {
"content_hash": "8c2108c9bedcca5fd85c59c0a49f762d",
"timestamp": "",
"source": "github",
"line_count": 399,
"max_line_length": 94,
"avg_line_length": 39.19298245614035,
"alnum_prop": 0.6427931960608774,
"repo_name": "franga2000/django-machina",
"id": "7db220c3b55d6e3be024cef4f210d57a8f71f509",
"si... |
import logging
from .utils.indexes import check_index_names
log = logging.getLogger(__name__)
class DataProcessingCollection:
def __init__(self, db, collection_name):
self._rules = db[collection_name]
async def index(self):
await check_index_names(self._rules, ['unique_id'])
await... | {
"content_hash": "6285db26376c9baec9fc945c1c1e20db",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 75,
"avg_line_length": 28.31578947368421,
"alnum_prop": 0.5384138785625775,
"repo_name": "optiflows/nyuki",
"id": "e810d23dd9ca46ce12becd42cf91203ea27215b7",
"size": "1614"... |
from ._models_py3 import CloudErrorBody
from ._models_py3 import DisableSerialConsoleResult
from ._models_py3 import EnableSerialConsoleResult
from ._models_py3 import GetSerialConsoleSubscriptionNotFound
from ._models_py3 import ProxyResource
from ._models_py3 import Resource
from ._models_py3 import SerialConsoleOper... | {
"content_hash": "c83eda3033c0c8eff1484f0ffc4c5ae6",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 78,
"avg_line_length": 36.83783783783784,
"alnum_prop": 0.7784299339691856,
"repo_name": "Azure/azure-sdk-for-python",
"id": "d0dff097b6e08719b87def692188bb4b6c2d65bf",
"si... |
import unittest
from sensorfusion.height_provider import HeightProvider, correct_ultrasonic_angle
import time
import numpy as np
from sensorfusion.fusion_master import SensorFusionMaster
import logging
class TestFusionMaster(unittest.TestCase):
"""
Test to manually check the values that the sens... | {
"content_hash": "413f80aab43d1409da47c133e569a6a5",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 145,
"avg_line_length": 33.10909090909091,
"alnum_prop": 0.628775398132894,
"repo_name": "timdelbruegger/freecopter",
"id": "793252cc4ef8763a129fa693918c326ffa9f33a5",
"siz... |
"""The Tautulli integration."""
from __future__ import annotations
from pytautulli import PyTautulli, PyTautulliHostConfiguration
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_API_KEY, CONF_URL, CONF_VERIFY_SSL, Platform
from homeassistant.core import HomeAssistant
from hom... | {
"content_hash": "586d634ee05eebae11460f44358ad983",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 87,
"avg_line_length": 39.07936507936508,
"alnum_prop": 0.7303005686433793,
"repo_name": "toddeye/home-assistant",
"id": "fe6eeb9e3030a19b9cc3ca7b6b8113f83c6ca25c",
"size":... |
from .delete_security_groups import DeleteSecurityGroupsAction
from .add_security_group_rules import AddSecurityGroupRulesAction
from .describe_security_group_rules import DescribeSecurityGroupRulesAction
from .apply_security_group import ApplySecurityGroupAction
from .describe_security_groups import DescribeSecurityGr... | {
"content_hash": "7986b667d9d923069e25e48b420222b2",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 92,
"avg_line_length": 63.47826086956522,
"alnum_prop": 0.8595890410958904,
"repo_name": "yunify/qingcloud-cli",
"id": "6c5337999184814d739f172d4343064c0ec96715",
"size": "... |
import unittest
from yama import database
class TestFilterString(unittest.TestCase):
def test_return_type(self):
self.assertEqual(type(database.filter_string('123')),type(''))
def test_check_casting(self):
self.assertEqual(type(database.filter_string(123)),type(''))
class TestConnectDb(unitt... | {
"content_hash": "772a8b93ffb629f9b4c7aff4085818fb",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 70,
"avg_line_length": 26.11111111111111,
"alnum_prop": 0.6893617021276596,
"repo_name": "vitovitolo/yama",
"id": "61b167b58efff9c491ef4d7e6f6a8384c09ba3ec",
"size": "470",... |
from google.transit import gtfs_realtime_pb2
import urllib
from pprint import pprint
#sudo -H pip install protobuf_to_dict
from protobuf_to_dict import protobuf_to_dict
from itertools import chain
#for deciding if the arduino should light up
import datetime
#for comparing the arrival times
import time
#for grabber
im... | {
"content_hash": "5d95a71fa54f8c8d96467189c2fa461d",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 121,
"avg_line_length": 31.847533632286996,
"alnum_prop": 0.6899464939453676,
"repo_name": "mwweinberg/NYC-MTA-Next-Train",
"id": "d21eaaf1b469eaf050403ff35785d7870b580be0",... |
"""Builds the CIFAR-10 network.
Summary of available functions:
# Compute input images and labels for training. If you would like to run
# evaluations, use inputs() instead.
inputs, labels = distorted_inputs()
# Compute inference on the model inputs to make a prediction.
predictions = inference(inputs)
# Comp... | {
"content_hash": "c2f1fe605d3be827b10bb5888404713d",
"timestamp": "",
"source": "github",
"line_count": 405,
"max_line_length": 91,
"avg_line_length": 36.94320987654321,
"alnum_prop": 0.6513835048790269,
"repo_name": "taylorpaul/cifar10_tf",
"id": "492c54f1038a5475be3aad3269f3c6c0fd03365d",
"size":... |
from app.models import Slot
def create_slot_from_json(slot_json, match):
slot = Slot(
match=match,
team='radiant' if slot_json['player_slot'] < 5 else 'dire',
account_id=slot_json['account_id'],
hero_id=slot_json['hero_id'],
items=[slot_json['item_0'], slot_json['item_1'], ... | {
"content_hash": "69814d74bc090fed8bd23e3cdbf550f4",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 78,
"avg_line_length": 36.464285714285715,
"alnum_prop": 0.5739471106758081,
"repo_name": "lucashanke/houseofdota",
"id": "5bd2e646110c22fed52c31ec93ebf528edaa3600",
"size"... |
from google.cloud import aiplatform_v1beta1
def sample_create_tensorboard():
# Create a client
client = aiplatform_v1beta1.TensorboardServiceClient()
# Initialize request argument(s)
tensorboard = aiplatform_v1beta1.Tensorboard()
tensorboard.display_name = "display_name_value"
request = aipl... | {
"content_hash": "e4ea70daf53c9da568ac29a1f6f3ae93",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 78,
"avg_line_length": 26.925925925925927,
"alnum_prop": 0.7276478679504814,
"repo_name": "googleapis/python-aiplatform",
"id": "a747831c9d38aa4c19f6325f8dac54eaba78a389",
... |
import warnings
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.db.models.fields.related import OneToOneField
from django.db.models.manager import Manager
from django.db.models.query import QuerySet
import six
c... | {
"content_hash": "71cab43360610b1e076f317d79c0d09d",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 97,
"avg_line_length": 37.429906542056074,
"alnum_prop": 0.6111111111111112,
"repo_name": "coagulant/django-model-utils",
"id": "c10660393fbee314ac877556baa03375f185432f",
... |
from slackstocks.components.slackstocks import SlackStocks
| {
"content_hash": "7abbd026cfa5d8b83c758e783b6c1401",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 58,
"avg_line_length": 59,
"alnum_prop": 0.8983050847457628,
"repo_name": "mraypold/slack-stockbot",
"id": "087f3456d61e18a6b378e25a3a5ed051277b3459",
"size": "59",
"binar... |
import socketio
import eventlet
import eventlet.wsgi
from flask import Flask, render_template
# Your IP local address
SERVER = '192.168.1.110'
#################
## Documentation
#################
## https://github.com/miguelgrinberg/python-socketio
#################
sio = socketio.Server()
app = Flask(__name__)
@app... | {
"content_hash": "7d2bc5ba6a0dbb39476d1842e9f11690",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 62,
"avg_line_length": 24.153846153846153,
"alnum_prop": 0.6528662420382165,
"repo_name": "thiagomarques2015/Kaio-machine-learning-human-face-detection",
"id": "566ae839765d5... |
"""
Test client for the <TestEnv> simulation environment.
This simple program shows how to control a robot from Python.
For real applications, you may want to rely on a full middleware,
like ROS (www.ros.org).
"""
import sys
try:
from pymorse import Morse
except ImportError:
print("you need first to install... | {
"content_hash": "a0a17e6cb9c52b7074f5d772d31eadd2",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 78,
"avg_line_length": 22.72340425531915,
"alnum_prop": 0.598314606741573,
"repo_name": "zwarren/morse-car-controller",
"id": "014f39170fb33d54770b679404cc6555267d253b",
"s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.