text stringlengths 4 1.02M | meta dict |
|---|---|
from setuptools import setup, find_packages
setup(
name='validata',
version='0.0.1',
author='Alex Wiltschko',
description='Continuous Integration for data',
license='MIT',
packages=find_packages(exclude='docs'),
platforms='any',
install_requires=['numpy'],
include_package_data=True,... | {
"content_hash": "88b454e24248b297dd6d070f82069b57",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 50,
"avg_line_length": 24.76923076923077,
"alnum_prop": 0.6739130434782609,
"repo_name": "alexbw/validata",
"id": "b19014bd05ffcad2e372e5c9e95d3e334f31ec24",
"size": "322",... |
"""WSGI application factory for Invenio."""
from __future__ import absolute_import, print_function
from werkzeug.contrib.fixers import ProxyFix
from werkzeug.wsgi import DispatcherMiddleware
def create_wsgi_factory(mounts_factories):
"""Create a WSGI application factory.
Usage example:
.. code-block::... | {
"content_hash": "7a639d82f2cd8b2078b0c79872e7cbb8",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 77,
"avg_line_length": 28.319148936170212,
"alnum_prop": 0.6513899323816679,
"repo_name": "tiborsimko/invenio-base",
"id": "0b236f3dd96ad8dcabe9008013d4ec3ee6810a70",
"size... |
from hintsvm import *
def svm_read_problem(data_file_name):
"""
svm_read_problem(data_file_name) -> [y, x]
Read LIBSVM-format data from data_file_name and return labels y
and data instances x.
"""
prob_y = []
prob_x = []
for line in open(data_file_name):
line = line.split(None, 1)
# In case an instance wi... | {
"content_hash": "af431585321fab1e3dc47c8c2fef93f8",
"timestamp": "",
"source": "github",
"line_count": 245,
"max_line_length": 113,
"avg_line_length": 33.42040816326531,
"alnum_prop": 0.6504640937957987,
"repo_name": "ntucllab/hintsvm",
"id": "1470bc53647da62ff3315b1815473db58ded5bf0",
"size": "82... |
"""Made plugin names in kek datum non nullable
Revision ID: 47b69e523451
Revises: cd4106a1a0
Create Date: 2014-06-16 14:05:45.428226
"""
# revision identifiers, used by Alembic.
revision = '47b69e523451'
down_revision = 'cd4106a1a0'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.alter_column... | {
"content_hash": "04193fddc6e0cf8f32812b8bdb8411bc",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 62,
"avg_line_length": 20.227272727272727,
"alnum_prop": 0.7303370786516854,
"repo_name": "MCDong/barbican",
"id": "88d9c81cb9b96c71c8f40c100410a8e67ae448c1",
"size": "445"... |
import os
import sys
import logging
import traceback
# related third party imports
import webapp2
import httpagentparser
from webapp2_extras import jinja2
from google.appengine.api import app_identity
from google.appengine.api import taskqueue
# local application/library specific imports
from bp_includes.lib import jin... | {
"content_hash": "b9c39e557d56084e19dd10a8a6c32e17",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 119,
"avg_line_length": 48.951219512195124,
"alnum_prop": 0.5493273542600897,
"repo_name": "ThomasMarcel/webapp-course",
"id": "44081ce893b3896936367c751a80aeff5e65b8f9",
"... |
import os
import unittest
import subprocess32 as subprocess
import imath
import IECore
import Gaffer
import GafferTest
import GafferImage
import GafferImageTest
class ColorSpaceTest( GafferImageTest.ImageTestCase ) :
fileName = os.path.expandvars( "$GAFFER_ROOT/python/GafferImageTest/images/checker.exr" )
def te... | {
"content_hash": "c8b47751290cb21ef6761c96886d9c8a",
"timestamp": "",
"source": "github",
"line_count": 279,
"max_line_length": 153,
"avg_line_length": 35.16129032258065,
"alnum_prop": 0.6711518858307849,
"repo_name": "hradec/gaffer",
"id": "f827fac64b9759050da4fd1349334995b5de8cb7",
"size": "11675... |
import os
import sys
sys.path.append(os.path.abspath('./_ext'))
sys.path.insert(0, os.path.abspath('../'))
# -- Project information -----------------------------------------------------
project = 'The All of Us Raw Data Repository (RDR)'
copyright = '2019, RDR team' # pylint: disable=redefined-builtin
author = 'RDR ... | {
"content_hash": "714d7b6577ac02898ceb2bfd66f0e62a",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 78,
"avg_line_length": 31.333333333333332,
"alnum_prop": 0.6882656350741457,
"repo_name": "all-of-us/raw-data-repository",
"id": "54a8f38ef17eb3c814c04604adb7ffd3933c09d9",
... |
"""PubSub verifier used for end-to-end test."""
# pytype: skip-file
import logging
import time
from collections import Counter
from hamcrest.core.base_matcher import BaseMatcher
from apache_beam.io.gcp.pubsub import PubsubMessage
__all__ = ['PubSubMessageMatcher']
# Protect against environments where pubsub libra... | {
"content_hash": "615ec2d2e271f19e77e3734ecdf7dcfb",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 80,
"avg_line_length": 37.53225806451613,
"alnum_prop": 0.6580719094685575,
"repo_name": "apache/beam",
"id": "85836eaf3374615ae65d11038ffc0de757b81974",
"size": "7766",
... |
"""mel conversion ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_util
from tensorflow.python.ops import array_... | {
"content_hash": "808f234f237a3c72b1b4eed9396a881b",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 80,
"avg_line_length": 43.26829268292683,
"alnum_prop": 0.6676437429537768,
"repo_name": "aldian/tensorflow",
"id": "cf0bed9ef1be0661f0db947cc8dc434564d65eec",
"size": "95... |
import argparse
import collections
import glob
import os
import re
import sys
parser = argparse.ArgumentParser(
description='Parse kolla build logs and extract useful information about '
'the installed packages.')
parser.add_argument('-l', '--logdir',
help='Path to the build log... | {
"content_hash": "c4b49488b2349430f75e070ea196f498",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 78,
"avg_line_length": 33.39393939393939,
"alnum_prop": 0.543557168784029,
"repo_name": "openstack/kolla",
"id": "22b7182273e0aa36cccd74cda4925693d51b3b7a",
"size": "2769",... |
from dragonfly import (Grammar, AppContext, MappingRule, Dictation, Key, Text, Integer, Mimic)
context = AppContext(title="buffergator")
grammar = Grammar("buffergator", context=context)
noSpaceNoCaps = Mimic("\\no-caps-on") + Mimic("\\no-space-on")
rules = MappingRule(
name = "buffergator",
mapping = {
"... | {
"content_hash": "b5a8df7bfc52adbad321b8baa2d00cea",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 94,
"avg_line_length": 22.1,
"alnum_prop": 0.5897435897435898,
"repo_name": "simianhacker/code-by-voice",
"id": "4b7a34bbeab6aaf3ade3fa98f107564101c1353e",
"size": "663",
... |
'''
PARSER:
-------
This parser will intake dataverse dataset classes and
generate an HDX-like dictionary. It was designed to
register datasets in HDX in a posterior process.
'''
import os
import sys
import json
import requests
from copy import copy
from slugify import slugify
from datetime import datetime
from coun... | {
"content_hash": "0c779debcc914f0feac46f42eb94290f",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 112,
"avg_line_length": 28.90728476821192,
"alnum_prop": 0.6020618556701031,
"repo_name": "luiscape/hdxscraper-ifpri-dataverse",
"id": "64f157b27b3e64164a1a66214f29a677ff34c... |
import json
import uuid
import unittest
import testtools
from infosystem.tests.functional import test_base
class UserTestCase(test_base.CRUDTest,
testtools.TestCase):
def load_fixtures(self):
domain = self.post(
resource_ref={'name': uuid.uuid4().hex, 'active': True},
... | {
"content_hash": "d16829a8e33b6e9e9da013f02c059b60",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 68,
"avg_line_length": 23.122448979591837,
"alnum_prop": 0.5675198587819947,
"repo_name": "samueldmq/infosystem",
"id": "c8150eacab4d704d361c7ba1aadb07b41d5d47a9",
"size": ... |
from oslo.config import cfg
from nova import db
from nova.openstack.common.gettextutils import _
from nova.openstack.common import log as logging
from nova.scheduler import filters
LOG = logging.getLogger(__name__)
ram_allocation_ratio_opt = cfg.FloatOpt('ram_allocation_ratio',
default=1.5,
help='Vir... | {
"content_hash": "2079fecdbc253f2062b76c92b1443573",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 79,
"avg_line_length": 39.53333333333333,
"alnum_prop": 0.6337830241708825,
"repo_name": "afrolov1/nova",
"id": "25a5031afbc1ae13d3980ca4b3238db30200f2e0",
"size": "4232",
... |
from django.shortcuts import render
# Create your views here.
# render template then response
from django.shortcuts import render_to_response
# just response as string
from django.http import HttpResponse
from books.models import Book
def search_form(request):
return render_to_response('search_form.html')
def ... | {
"content_hash": "a0f5a0218da53f8cceb16d02fecfa3bd",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 69,
"avg_line_length": 30.40740740740741,
"alnum_prop": 0.6431181485992692,
"repo_name": "jizhouli/django-project-sample",
"id": "4b0490f73ae484a867d4433cd44c372e5a7c23b4",
... |
from __future__ import unicode_literals
from .buffer import Buffer, AcceptAction
from .buffer_mapping import BufferMapping
from .clipboard import Clipboard, InMemoryClipboard
from .enums import DEFAULT_BUFFER, EditingMode
from .filters import CLIFilter, to_cli_filter
from .key_binding.bindings.basic import load_basic_... | {
"content_hash": "719417ff50493dd6ff3f5cb7871d9ce5",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 95,
"avg_line_length": 45.557291666666664,
"alnum_prop": 0.6834343203384018,
"repo_name": "Edu-Glez/Bank_sentiment_analysis",
"id": "272d8bbcbb0512eac1ff9c6e38dc33b44d8b4fdf... |
from logbook import FileHandler
from zipline.finance.blotter import ORDER_STATUS
from six import itervalues
def setup_logger(test, path='test.log'):
test.log_handler = FileHandler(path)
test.log_handler.push_application()
def teardown_logger(test):
test.log_handler.pop_application()
test.log_handle... | {
"content_hash": "b0d75b8071f491198b48872550b24bd7",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 65,
"avg_line_length": 24.169642857142858,
"alnum_prop": 0.6039896564462505,
"repo_name": "lsbardel/zipline",
"id": "9f348c3b95792f0d1658197a3b99d392ee959ec6",
"size": "27... |
"""
Lob
The Lob API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and uses HTTP response codes to indicate any API errors. <p> Looking for our [previous documentation](https://lob.github.io/legacy-docs/)? # noqa: E501
The version of the OpenAPI document: 1.3.0... | {
"content_hash": "7c147f5b02f1015a7ecc59017aa1a63a",
"timestamp": "",
"source": "github",
"line_count": 287,
"max_line_length": 259,
"avg_line_length": 46.37979094076655,
"alnum_prop": 0.553226654646533,
"repo_name": "lob/lob-python",
"id": "77f83749eaa40f2551cd7b1e56a422d1d164357a",
"size": "13311... |
from setuptools import setup
setup(name='microsoftbotframework',
version='0.1.17',
description='A wrapper for the microsoft bot framework API',
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: MIT License',
'Programming Language :: Pyth... | {
"content_hash": "9b420b4d385728732472df52483e0b02",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 66,
"avg_line_length": 30.533333333333335,
"alnum_prop": 0.5655021834061136,
"repo_name": "RaminderSinghSahni/micro-ram-bot",
"id": "cbd762fa189f57048af89e1700b6d3892ff78928"... |
import sys
import argparse
from evohomeclient2 import EvohomeClient
try:
from config import username, password
except ImportError:
print("Please configure config.py")
sys.exit()
def do_restore(filename, debug):
print(f"Restoring schedule from: {filename}")
client = EvohomeClient(username, passwo... | {
"content_hash": "97f295f49d6177bf1e5a46af76d953f8",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 61,
"avg_line_length": 22.266666666666666,
"alnum_prop": 0.688622754491018,
"repo_name": "andrew-blake/evohome-monitor",
"id": "09835a075650f9da2c17e00bbff32cc0912d3b24",
"... |
from flask import render_template
from .. import lastuser_ui
@lastuser_ui.route('/')
def index():
return render_template('index.html')
| {
"content_hash": "7301fb14c9ba1eed87b5b4fc8d8d64a2",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 40,
"avg_line_length": 17.75,
"alnum_prop": 0.7112676056338029,
"repo_name": "sindhus/lastuser",
"id": "4cc39f78e5edf10fd52effbbad77ac80ba250078",
"size": "167",
"binary":... |
"""Unit-test suite for `pptx.oxml.slide` module."""
from pptx.oxml.slide import CT_NotesMaster, CT_NotesSlide
from ..unitutil.file import snippet_text
class DescribeCT_NotesMaster(object):
"""Unit-test suite for `pptx.oxml.slide.CT_NotesMaster` objects."""
def it_can_create_a_default_notesMaster_element(se... | {
"content_hash": "001fc8b3677a7322d307bcbb5df0f436",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 71,
"avg_line_length": 33.333333333333336,
"alnum_prop": 0.7057142857142857,
"repo_name": "scanny/python-pptx",
"id": "d1b48ebc427ec5868ce5131118328a60d2cca390",
"size": "7... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import inspect
import warnings
from functools import wraps
import six
from pants.base.revision import Revision
from pants.version import VERSION
_PANTS_SEMVER = Re... | {
"content_hash": "4c69b5b69dd531dec3f31c349f3ad174",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 100,
"avg_line_length": 41.139240506329116,
"alnum_prop": 0.7086153846153846,
"repo_name": "dturner-tw/pants",
"id": "c5d4fc4106f952fea8dae04f7ea53ff9918f3249",
"size": "6... |
"""Test object in lib/assemblers/base."""
import re
from os.path import join
import subprocess
from unittest.mock import MagicMock, patch, call
import pytest
from lib.assemblers.base import BaseAssembler
def build_assembler():
"""Build a generic assembler."""
args = {
'bit_score': 44,
'contig... | {
"content_hash": "48c8668ed095d0c953b75adf5968fefc",
"timestamp": "",
"source": "github",
"line_count": 354,
"max_line_length": 78,
"avg_line_length": 28.324858757062145,
"alnum_prop": 0.6223197367108806,
"repo_name": "AntonelliLab/seqcap_processor",
"id": "ac2b99ebf0d3eb7c0f41004e416cff74f3a90ecc",
... |
import sys
from numba.core.utils import _RedirectSubpackage
sys.modules[__name__] = _RedirectSubpackage(locals(), "numba.core.types")
| {
"content_hash": "263cf3d4749210677eacbb67513b7a4f",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 73,
"avg_line_length": 33.75,
"alnum_prop": 0.762962962962963,
"repo_name": "gmarkall/numba",
"id": "3bb9f21980380f18f25e3a859cc90f1449c483bf",
"size": "135",
"binary": fa... |
"""Common code for converting proto to other formats, such as JSON."""
import base64
import collections
import datetime
import json
import six
from apitools.base.protorpclite import message_types
from apitools.base.protorpclite import messages
from apitools.base.protorpclite import protojson
from apitools.base.py im... | {
"content_hash": "c0d68f7bf276f450b921b7f00fec6544",
"timestamp": "",
"source": "github",
"line_count": 792,
"max_line_length": 86,
"avg_line_length": 38.025252525252526,
"alnum_prop": 0.6423495816177447,
"repo_name": "google/apitools",
"id": "2d8a449339460809035be40b5a04f820911b9de3",
"size": "307... |
from json import *
class Track:
def __init__(self, json=None):
if json != None:
self.fromJson(json)
def fromJson(self, json):
self.href = json['href']
self.id = json['id']
self.name = json['name']
self.playbackURL = json['preview_url']
self.popularity = json['popularity']
if j... | {
"content_hash": "79c251c08e968633312b896ecb45413e",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 360,
"avg_line_length": 35.8,
"alnum_prop": 0.604050279329609,
"repo_name": "fbuitron/FBMusic_ML_be",
"id": "544658ad07f7dd4fcf5e4175bea9d8bacddf0dd2",
"size": "1432",
"b... |
from __future__ import division, unicode_literals
"""
This module define the various drones used to assimilate data.
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "1.0"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyuep@gmail.com"
__date__ = "Mar 18, 2012"... | {
"content_hash": "15dafd9b35b3dfd0e1530d101b9c6d9b",
"timestamp": "",
"source": "github",
"line_count": 417,
"max_line_length": 80,
"avg_line_length": 41.016786570743406,
"alnum_prop": 0.5481758652946679,
"repo_name": "ndardenne/pymatgen",
"id": "5b8f4ba742d33dc0f7edc0d38d319a24cfdd10a6",
"size": "... |
from tornado.web import RequestHandler
from swampdragon.default_settings import SwampDragonSettings
from django.conf import settings as django_settings
def get_host():
host = django_settings.DRAGON_URL
if host.endswith('/'):
return host[:-1]
return host
class SettingsHandler(RequestHandler):
... | {
"content_hash": "a1c7137e43cddc563490c0031cdd5854",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 65,
"avg_line_length": 28.75,
"alnum_prop": 0.6565217391304348,
"repo_name": "sahlinet/swampdragon",
"id": "d1216efd2b4853db5f9be2410d02ea2af59567a3",
"size": "690",
"bin... |
"""remove_freshmen_project
Revision ID: 4ac8ff82410a
Revises: 704962eabf9c
Create Date: 2019-09-06 11:21:28.515040
"""
# revision identifiers, used by Alembic.
revision = '4ac8ff82410a'
down_revision = '704962eabf9c'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
def upgr... | {
"content_hash": "1620d39e6224dfe58343cabe82e85164",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 106,
"avg_line_length": 31.566666666666666,
"alnum_prop": 0.6715945089757128,
"repo_name": "ComputerScienceHouse/conditional",
"id": "bc2352acbb8970225443501f20225f5bf59f666d... |
"""Nodes add console enabled
Revision ID: 3cb628139ea4
Revises: 21b331f883ef
Create Date: 2014-02-26 11:24:11.318023
"""
# revision identifiers, used by Alembic.
revision = '3cb628139ea4'
down_revision = '21b331f883ef'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('nodes',
... | {
"content_hash": "cf0ccd13a407db6ed3a11c7269601cf6",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 48,
"avg_line_length": 18.708333333333332,
"alnum_prop": 0.6859688195991092,
"repo_name": "rdo-management/ironic",
"id": "7fe1ca47588011045e3878dc8c0ee342e479da82",
"size":... |
import argparse
import glob
import os
import os.path
import shutil
from subprocess import call, Popen
import tempfile
CODESIGN_BIN = '/usr/bin/codesign'
PLIST_BUDDY_BIN = '/usr/libexec/PlistBuddy'
SECURITY_BIN = '/usr/bin/security'
ZIP_BIN = '/usr/bin/zip'
UNZIP_BIN = '/usr/bin/unzip'
class ReceivedApp(object):
... | {
"content_hash": "737104276c3705be9f4daa8903805c00",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 77,
"avg_line_length": 32.94930875576037,
"alnum_prop": 0.5825174825174825,
"repo_name": "CiNC0/Cartier",
"id": "6defe0e3c61cf351862966b6af97050aa63661a0",
"size": "7209",... |
from room import Room
r = Room()
r.roomname = 'eastbrook'
r.exits = {'intersection': 'intersection','house 6': 'house6', 'house 12': 'house12'}
r.roomdesc = """
east brook street houses number 12 and 6 are targets
"""
r.looktargets = {'house 12': 'its red\n\n',
'house 6': 'its blue\n\n'}
| {
"content_hash": "989bb0d2d5b8b862b93411e95ab375e0",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 85,
"avg_line_length": 30.8,
"alnum_prop": 0.6201298701298701,
"repo_name": "elstupido/rpg",
"id": "3173dfe07f7411e4cfd89b5bd7d14149058070ce",
"size": "308",
"binary": fa... |
from __future__ import unicode_literals, print_function
import frappe, os, json
from frappe.modules import get_module_path, scrub_dt_dn
from frappe.utils import get_datetime_str
def import_files(module, dt=None, dn=None, force=False, pre_process=None, reset_permissions=False):
if type(module) is list:
out = []
f... | {
"content_hash": "71e63baf71d76e0e3c67aab42eeedddf",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 101,
"avg_line_length": 30.07751937984496,
"alnum_prop": 0.6904639175257732,
"repo_name": "bohlian/frappe",
"id": "ade3614c8ed1b09646847cd2c2a0f27fc5c62dfc",
"size": "3981... |
"""Pluggable newsletter handling."""
from django import forms
from django.utils.translation import ugettext_lazy as _
from livesettings import config_value
from satchmo_store.accounts.signals import satchmo_registration
from satchmo_store.contact.signals import satchmo_contact_view
from satchmo_utils import load_modul... | {
"content_hash": "5bdc99c5b0541a552738725c28d22219",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 96,
"avg_line_length": 38.03448275862069,
"alnum_prop": 0.7411604714415231,
"repo_name": "grengojbo/satchmo",
"id": "d0f3281be2391e079e3236e6577d40287d0b4203",
"size": "220... |
PROCESS_FIELD = 1
SAMPLE_FIELD = 2
PROCESS_ATTR_FIELD = 3
SAMPLE_ATTR_FIELD = 4
PROCESS_FUNC = 5
SAMPLE_FUNC = 6
OP_EQ = "="
OP_NEQ = "<>"
OP_LT = "<"
OP_LTEQ = "<="
OP_GT = ">"
OP_GTEQ = ">="
def q_and(left, right):
return {
"and": 1,
"left": left,
"right": right
}
def q_or(left, r... | {
"content_hash": "139268305a81b57f6b4250a31bba6e2f",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 63,
"avg_line_length": 19.516129032258064,
"alnum_prop": 0.6099173553719008,
"repo_name": "materials-commons/mcapi",
"id": "3571f419ac1f42eeb7ce6f897b2a2e7f90b69afb",
"size... |
from indico.modules.events.abstracts.models.persons import AbstractPersonLink
from indico.modules.events.contributions.models.persons import (AuthorType, ContributionPersonLink,
SubContributionPersonLink)
from indico.modules.events.features.util import set... | {
"content_hash": "4363d6a1ff8071aa640c1026d32c9706",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 120,
"avg_line_length": 40.42553191489362,
"alnum_prop": 0.7263157894736842,
"repo_name": "indico/indico",
"id": "9677835d0a7c3355e595b625f042a5b97ce96c08",
"size": "2114",... |
import os
import numpy as np
from baseZhang import class_encoder_to_number
from sklearn.ensemble import VotingClassifier
from sklearn.externals import joblib
from preprocessData import getDataXY
trainX, trainY, testX, testY, validX, validY = getDataXY()
encoder_path = 'encoder.pkl'
if not os.path.isfile(encoder_pat... | {
"content_hash": "ba34cfc3983e97284ccd9f7bc90f85e2",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 77,
"avg_line_length": 29.12727272727273,
"alnum_prop": 0.7209737827715356,
"repo_name": "TheaGao/SklearnModel",
"id": "3b9ada0b9fb4212f3234a94951e2f0d2613e6276",
"size": "... |
import unittest
from jnius.reflect import autoclass
class SimpleEnum(unittest.TestCase):
def test_enum(self):
SimpleEnum = autoclass('org.jnius.SimpleEnum')
self.assertTrue(SimpleEnum)
def test_value(self):
SimpleEnum = autoclass('org.jnius.SimpleEnum')
self.assertTrue(Simpl... | {
"content_hash": "f857401c51d599550ab4c27593128046",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 54,
"avg_line_length": 25.8125,
"alnum_prop": 0.6973365617433414,
"repo_name": "jelford/pyjnius",
"id": "8c1039247be549c822d9d08fc8fcdee6676e51a9",
"size": "413",
"binary... |
import struct
from .message import Message
@Message.register
class Termination(Message):
TYPE = Message.TERMINATION
TYPE_STR = 'termination'
reason_codict = {
0: "Session administratively closed. The session might be re-initiated.",
1: "Unspecified reason.",
2: "Out of resource... | {
"content_hash": "e45727701429082f9cb591f9f6599b99",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 98,
"avg_line_length": 34.4054054054054,
"alnum_prop": 0.6048703849175177,
"repo_name": "smartbgp/libbgp",
"id": "d4baf61544413573da910108cd2c2f45dbf1df74",
"size": "1910",... |
"""Representation of Avro schemas.
A schema may be one of:
- A record, mapping field names to field value data;
- An error, equivalent to a record;
- An enum, containing one of a small set of symbols;
- An array of values, all of the same schema;
- A map containing string/value pairs, each of a declared schema;
... | {
"content_hash": "44a4722f2b6bd22685497460b8834b69",
"timestamp": "",
"source": "github",
"line_count": 1214,
"max_line_length": 90,
"avg_line_length": 29.678747940691927,
"alnum_prop": 0.5582292533999444,
"repo_name": "Azure/azure-sdk-for-python",
"id": "34fa5980a5f5e68aefb168e613c387140cde3e74",
... |
import numpy
from pandas import DataFrame, Series
def numpy_dot():
'''
Imagine a point system in which each country is awarded 4 points for each
gold medal, 2 points for each silver medal, and one point for each
bronze medal.
Using the numpy.dot function, create a new dataframe called
'o... | {
"content_hash": "e19184e2646b5b414b378c8f6e293075",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 102,
"avg_line_length": 36.161764705882355,
"alnum_prop": 0.5839772265148434,
"repo_name": "davidbroadwater/nyc-subway-datascience-project",
"id": "ab420166674504fe58961006d2... |
import json
import requests
import mock
import gevent
from gevent import wsgi
from locust import web, runners, stats
from locust.runners import LocustRunner
from locust.main import parse_options
from .testcases import LocustTestCase
class TestWebUI(LocustTestCase):
def setUp(self):
super(TestWebUI, self)... | {
"content_hash": "ba67aa424cf5cd0a0e5642b2854b12bc",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 109,
"avg_line_length": 41.986301369863014,
"alnum_prop": 0.6264274061990212,
"repo_name": "pglass/locust",
"id": "37814b0fe52f31d834f2560bcef18e82fcfe0e3d",
"size": "3065"... |
"""Define the menu contents, hotkeys, and event bindings.
There is additional configuration information in the EditorWindow class (and
subclasses): the menus are created there based on the menu_specs (class)
variable, and menus not created are silently skipped in the code here. This
makes it possible, for example, to... | {
"content_hash": "6df1f39332463ea23c8736613b82c512",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 79,
"avg_line_length": 32.741573033707866,
"alnum_prop": 0.5724090597117364,
"repo_name": "MonicaHsu/truvaluation",
"id": "df2b251426a91f5c298e3352c80a79510558a194",
"size"... |
from typing import List, TypedDict
from backend.common.sitevars.sitevar import Sitevar
class ContentType(TypedDict):
websites: List[str]
class WebsiteBlacklist(Sitevar[ContentType]):
@staticmethod
def key() -> str:
return "website_blacklist"
@staticmethod
def description() -> str:
... | {
"content_hash": "ebbc1c7331db77b7d4052a5b81363943",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 66,
"avg_line_length": 25.025641025641026,
"alnum_prop": 0.6260245901639344,
"repo_name": "the-blue-alliance/the-blue-alliance",
"id": "aac8b5ffafd696a62dcea5f04c1ef3e7251358... |
""""Argo Workflow for building notebook-server-rstudio's OCI image using Kaniko"""
from kubeflow.kubeflow.cd import config, kaniko_builder
def create_workflow(name=None, namespace=None, bucket=None, **kwargs):
"""
Args:
name: Name to give to the workflow. This can also be used to name
th... | {
"content_hash": "14d337fc768a610fd4e72e0fb29dd75a",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 93,
"avg_line_length": 46.8,
"alnum_prop": 0.6866096866096866,
"repo_name": "kubeflow/kubeflow",
"id": "18b72f4abdf20029ed71c960fbf9807486a8ac54",
"size": "702",
"binary"... |
"""
Common classes for local filesystem certificate handling
"""
import os
from oslo_config import cfg
from octavia.certificates.common import cert
TLS_CERT_DEFAULT = os.environ.get(
'OS_OCTAVIA_TLS_CA_CERT', '/etc/ssl/certs/ssl-cert-snakeoil.pem'
)
TLS_KEY_DEFAULT = os.environ.get(
'OS_OCTAVIA_TLS_CA_KEY', ... | {
"content_hash": "c7995f13595b2cf823b5b3a84d7b15c9",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 79,
"avg_line_length": 37.62352941176471,
"alnum_prop": 0.6022514071294559,
"repo_name": "openstack/octavia",
"id": "4db1af26968adba5710c0792c2c61b1a2a9b8417",
"size": "383... |
import netaddr
from oslo.utils import excutils
from oslo.utils import importutils
from sqlalchemy.orm import exc
from neutron.api.rpc.agentnotifiers import l3_rpc_agent_api
from neutron.api.rpc.handlers import l3_rpc
from neutron.api.v2 import attributes
from neutron.common import constants as l3_constants
from neutro... | {
"content_hash": "cb61202df0d25e5d9e7b6bdb92c110b5",
"timestamp": "",
"source": "github",
"line_count": 674,
"max_line_length": 79,
"avg_line_length": 42.954005934718104,
"alnum_prop": 0.5472004421263514,
"repo_name": "Brocade-OpenSource/vrouter-plugins",
"id": "38f5f44f9b061ddd88a53124f40a38897197e5... |
from azure.identity import DefaultAzureCredential
from azure.mgmt.cosmosdb import CosmosDBManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-cosmosdb
# USAGE
python cosmos_db_managed_cassandra_data_center_list.py
Before run the sample, please set the values of the c... | {
"content_hash": "85a093d0cc4ae0778257d1350d440698",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 163,
"avg_line_length": 34.14705882352941,
"alnum_prop": 0.7338501291989664,
"repo_name": "Azure/azure-sdk-for-python",
"id": "cc2be45795f4672b69832616b4ed5d5b7b11ebbc",
"s... |
from __future__ import print_function
from dbapi import Tweet
import json
import twitter
import argparse
def tweet(twit):
tweet_to_tweet = Tweet.top()
if not tweet_to_tweet:
return
return (twit.statuses.update(status=tweet_to_tweet.content),
tweet_to_tweet)
def url_with_endpoint(end_... | {
"content_hash": "3323fe2c138f256ef404af95097ff46c",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 70,
"avg_line_length": 26.864406779661017,
"alnum_prop": 0.6182965299684543,
"repo_name": "harlanhaskins/Twitter-Queue-Bot",
"id": "538e3b7db4e0c612439738f8b508b035560433a1",... |
import os.path
import shutil
import tempfile
import yaml
from synapse.config.homeserver import HomeServerConfig
from tests import unittest
class ConfigLoadingTestCase(unittest.TestCase):
def setUp(self):
self.dir = tempfile.mkdtemp()
print self.dir
self.file = os.path.join(self.dir, "home... | {
"content_hash": "468ccbb41cf50be39807f5f6cbff6b0c",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 82,
"avg_line_length": 37.51456310679612,
"alnum_prop": 0.6030020703933747,
"repo_name": "TribeMedia/synapse",
"id": "161a87d7e33f5990241f03044793ceb2d75a61d4",
"size": "4... |
from local import *
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
'USER': '',
},
}
PASSWORD_HASHERS = (
'django.contrib.auth.hashers.SHA1PasswordHasher',
)
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.StaticFilesStorage'
| {
"content_hash": "dda150657682fc6f42b6111979cdb983",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 77,
"avg_line_length": 20.733333333333334,
"alnum_prop": 0.6366559485530546,
"repo_name": "lamby/musicdb",
"id": "087add2fd8c02029f225335338c0c72d0c003326",
"size": "311",
... |
import pandas as pd
import pytest
# noinspection PyUnresolvedReferences
from contrib.experimental.great_expectations_experimental.expectations.expect_queried_column_value_frequency_to_meet_threshold import (
ExpectQueriedColumnValueFrequencyToMeetThreshold,
)
from great_expectations.core.batch import BatchRequest,... | {
"content_hash": "74665d6f99c144b190b6f379ea4655dd",
"timestamp": "",
"source": "github",
"line_count": 296,
"max_line_length": 159,
"avg_line_length": 35.888513513513516,
"alnum_prop": 0.5959710063070696,
"repo_name": "great-expectations/great_expectations",
"id": "02fa1fbf3b164ad6d503d3c0af94962fd7... |
'''
Some helper functions to assist in the plotting and wrangling of data
'''
import numpy as np
import matplotlib.pylab as plt
from matplotlib.ticker import MaxNLocator,AutoLocator
almost_black = '#262626'
def is_homogeneous(l):
''' Checks to see if a list has all identical entries
'''
for i in rang... | {
"content_hash": "b8bbda415cec8cf81f82ca02c6ab268d",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 74,
"avg_line_length": 27.927083333333332,
"alnum_prop": 0.6020141738157404,
"repo_name": "IDEALLab/design_method_recommendation_JMD_2014",
"id": "686d2d5270132f338f0a28dff82... |
'''
Created on 13/01/2014
@author: Dani
'''
class FileWriter(object):
'''
classdocs
'''
def __init__(self):
'''
Constructor
'''
pass
@staticmethod
def write_text_to_file(text, file_name):
fileStream = open(str(file_name), "w")
fileStream.w... | {
"content_hash": "956a1c3c191a19bac610e683cc568f29",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 47,
"avg_line_length": 18.379310344827587,
"alnum_prop": 0.5440900562851783,
"repo_name": "landportal/landbook-importers",
"id": "0ee824011da6276136330954e9df708d034f454e",
... |
import cherrypy
from girder.utility import config, server
config.loadConfig() # Read the config files first, so we can override some values
cherrypy.config.update({'engine.autoreload.on': False,
'environment': 'embedded'})
cherrypy.config['server'].update({'cherrypy_server': False,
... | {
"content_hash": "06b7effc018447bef271f7ae9cc653d5",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 95,
"avg_line_length": 37.93333333333333,
"alnum_prop": 0.6959578207381371,
"repo_name": "data-exp-lab/girder",
"id": "f27b9cf3b48ab0c1236bdc368f41d63a7b20e277",
"size": "1... |
"""Unit test cases for list.py."""
from typing import Dict, Tuple
from unittest import mock
from click.testing import CliRunner
from feeds.commands.list import list_command
from feeds.tests.fixtures import * # pylint: disable=wildcard-import
from feeds.tests.fixtures import TEMP_EXPORT_CSV_FILE
from feeds.tests.fix... | {
"content_hash": "bc7003f1cabb546251833758c4d587b4",
"timestamp": "",
"source": "github",
"line_count": 235,
"max_line_length": 79,
"avg_line_length": 31.485106382978724,
"alnum_prop": 0.6609001216380592,
"repo_name": "chronicle/cli",
"id": "a7a2030cc5089f4d713ddce62ae60ee6c68573bf",
"size": "7975"... |
import argparse
import math
import os.path
import pickle
import re
import sys
import time
from nltk.translate import bleu_score
import numpy
import six
import chainer
from chainer import cuda
import chainer.functions as F
import chainer.links as L
from chainer import reporter
from chainer import training
from chainer... | {
"content_hash": "a3ae9d88a135b7ee29da7597e06e0e78",
"timestamp": "",
"source": "github",
"line_count": 519,
"max_line_length": 101,
"avg_line_length": 35.703275529865124,
"alnum_prop": 0.5366432811656773,
"repo_name": "tkerola/chainer",
"id": "8b74aea8236ff8f380889400e6f3ddefb618f6d7",
"size": "18... |
from random import randint, getrandbits, choice
import pytest
from netaddr import IPAddress, IPNetwork
from pyASA.rule import RuleTCPUDP, ServiceComparator
from test.online import settings
@pytest.mark.skipif(not settings.online, reason="ASA not available for online tests")
class Test_ACL(object):
@pytest.fixtu... | {
"content_hash": "447e67b259d8de0837580c926bd2cb15",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 97,
"avg_line_length": 39.1764705882353,
"alnum_prop": 0.6081081081081081,
"repo_name": "xpac1985/pyASA",
"id": "48b6f889a7ee4b3c06412830b10fbecf0be4f00a",
"size": "1998",
... |
from connector import channel
from google3.cloud.graphite.mmv2.services.google.compute import vpn_tunnel_pb2
from google3.cloud.graphite.mmv2.services.google.compute import vpn_tunnel_pb2_grpc
from typing import List
class VpnTunnel(object):
def __init__(
self,
id: int = None,
name: str =... | {
"content_hash": "d84bf6ff99f192865fc06d6bde68f338",
"timestamp": "",
"source": "github",
"line_count": 303,
"max_line_length": 85,
"avg_line_length": 41.43564356435643,
"alnum_prop": 0.6444444444444445,
"repo_name": "GoogleCloudPlatform/declarative-resource-client-library",
"id": "40bf5c89785caa9897... |
"""Perform DOI activation task."""
class HSTaskRouter(object):
"""Perform DOI activation task."""
def route_for_task(self, task, args=None, kwargs=None):
"""Return exchange, exchange_type, and routing_key."""
if task == 'hs_core.tasks.manage_task_nightly':
return {
... | {
"content_hash": "8357f0ffee2aea3962a8605e5f961b0f",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 62,
"avg_line_length": 29.25,
"alnum_prop": 0.5427350427350427,
"repo_name": "hydroshare/hydroshare",
"id": "d43a4e74f4301177e627f376d476cb8eaaa50d5f",
"size": "468",
"bi... |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'ActionClusterVersion'
db.delete_table(u'actionclusters_actionclusterversion')
... | {
"content_hash": "e6b80d05e6f2261d7bf8178ffe585531",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 247,
"avg_line_length": 81.98101265822785,
"alnum_prop": 0.5761599629429476,
"repo_name": "us-ignite/us_ignite",
"id": "fd3933dbf1456d4964825226f61f7d8c9fc0311d",
"size": ... |
"""
Description
"""
__author__ = 'awang'
from tornado.web import RequestHandler
from models import Dao
from models import Session
from models import User
class BaseController(RequestHandler):
""""""
@property
def rds(self):
return Dao.redis()
@property
def current_user(self):
"... | {
"content_hash": "6b4217efc653e6e2cbdefa1cd8a30a6f",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 97,
"avg_line_length": 26.32,
"alnum_prop": 0.5851063829787234,
"repo_name": "ryanduan/duanyongwang",
"id": "d40001b568b911a81397c984fb9e6828f7b1632e",
"size": "1341",
"b... |
from django.conf.urls import include, url, patterns
from polls import views
urlpatterns = [
url(r'^home/$', views.home, name='home'),
url(r'^about/$', views.about, name='about'),
]
| {
"content_hash": "e1b8572a18e141621e37d0c86860f610",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 51,
"avg_line_length": 27.142857142857142,
"alnum_prop": 0.6631578947368421,
"repo_name": "Predator01/potential-adventure",
"id": "51a4351845807efe2f7230d1a996564e1c9bcb5c",
... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('checkout', '0004_auto_20171226_0910'),
]
operations = [
migrations.AlterField(
model_name='item',
... | {
"content_hash": "9d59a7cee930b9166df8c4fc14ae15ed",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 131,
"avg_line_length": 25.894736842105264,
"alnum_prop": 0.6402439024390244,
"repo_name": "CoutinhoElias/danibraz",
"id": "81cebf86749958ed80dd48b9ebfe9839cb973f3b",
"size... |
"""Story graph for the interactive storytelling system DoppioGioco."""
from collections import defaultdict
import csv
import os
from interactive_story.tension_evaluation import get_tension_value
from interactive_story.story_graph import StoryGraph
STORY_GRAPH_CSV = os.path.join(os.path.dirname(__file__),
... | {
"content_hash": "d8a483bbf7af769b6192bff80fd8f6fa",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 79,
"avg_line_length": 37.44690265486726,
"alnum_prop": 0.5602032376225925,
"repo_name": "msilvestro/dupin",
"id": "3571fe0e4543a780b045655697733ff7d16a8dde",
"size": "846... |
from .models import ModelFactory
from .utils import import_simplejson
from .error import TweepError
class Parser(object):
def parse(self, method, payload):
"""
Parse the response payload and return the result.
Returns a tuple that contains the result data and the cursors
(or None ... | {
"content_hash": "7b264aa5e3047394f71baccd9a2a552b",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 107,
"avg_line_length": 27.182795698924732,
"alnum_prop": 0.5992879746835443,
"repo_name": "balanced/status.balancedpayments.com",
"id": "aa3fe491474186ad260c84b0b2759fae79b5... |
"""
The pyro method-of-lines advection solver. This uses a piecewise linear
reconstruction in space together with a Runge-Kutta integration for time.
"""
__all__ = ['simulation']
from .simulation import Simulation
| {
"content_hash": "dd0c1f38a5210ead5c33e985df4316a5",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 73,
"avg_line_length": 30.857142857142858,
"alnum_prop": 0.7592592592592593,
"repo_name": "zingale/pyro2",
"id": "3e1c9e24f262a00cca0bfd9a9415936feba5bec6",
"size": "216",
... |
from tempest_lib.common.utils import data_utils
from tempest.api.compute import base
from tempest import test
class KeyPairsV2TestJSON(base.BaseComputeTest):
_api_version = 2
@classmethod
def setup_clients(cls):
super(KeyPairsV2TestJSON, cls).setup_clients()
cls.client = cls.keypairs_cl... | {
"content_hash": "963dfc5de57a6d3ace67ee7e835dbe68",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 77,
"avg_line_length": 45.75757575757576,
"alnum_prop": 0.617439293598234,
"repo_name": "yamt/tempest",
"id": "01e3c869ed4602376e98555c23c9920c1afe9b8a",
"size": "5166",
... |
"""
Post-processes the force coefficients from a cuIBM simulation.
This script reads the forces, computes the mean forces within a given range,
computes the Strouhal number within a range, plots the force coefficients,
saves the figure, and prints a data-frame that contains the mean values.
"""
from snake.cuibm.simul... | {
"content_hash": "13546d040dbb1baab35cb2b0c49401d2",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 76,
"avg_line_length": 37.25925925925926,
"alnum_prop": 0.6421471172962226,
"repo_name": "barbagroup/cuIBM",
"id": "b933f36657c63fc9a88121b34b0e53c2289f53ed",
"size": "1006... |
import requests
import bs4
import csv
def find_between( text, first, last ):
try:
start = text.index( first ) + len( first )
end = text.index( last, start )
return text[start:end]
except ValueError:
return ""
def extract_name(str_val):
return find_between( str_val, '>', '<... | {
"content_hash": "98362a407431601c9d3c82cfe8ee5109",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 67,
"avg_line_length": 28.5625,
"alnum_prop": 0.5988329686360321,
"repo_name": "sa501428/playground",
"id": "75b71072964135750369a57f26bb3842882fb85d",
"size": "1394",
"b... |
from ctypes import *
# Let's map the Microsoft types to ctypes for clarity
BYTE = c_ubyte
WORD = c_ushort
DWORD = c_ulong
LPBYTE = POINTER(c_ubyte)
LPTSTR = POINTER(c_char)
HANDLE = c_void_p
PVOID = c_void_p
LPVOID = c_void_p
UINT_PTR = c_ulong
SIZE_T = c_ulong
# Constants
DEBUG_PRO... | {
"content_hash": "4de94f644bb5890c93fa462c73f2137b",
"timestamp": "",
"source": "github",
"line_count": 270,
"max_line_length": 104,
"avg_line_length": 30.455555555555556,
"alnum_prop": 0.5669463699379789,
"repo_name": "after1990s/little_utils",
"id": "d89e8d861a7ad9a7fe6447e03d1f13145507e65a",
"si... |
"""This code example gets all first party audience segments.
To create first party audience segments, run create_audience_segments.py.
"""
__author__ = 'Nicholas Chen'
# Locate the client library. If module was installed via "setup.py" script, then
# the following two lines are not needed.
import os
import sys
sys.p... | {
"content_hash": "60079de79d1ab0bfc796d3e9279fc708",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 80,
"avg_line_length": 27.952380952380953,
"alnum_prop": 0.6473594548551959,
"repo_name": "caioserra/apiAdwords",
"id": "59ba74e2a55e66b8affb963145cfee6e643a17fb",
"size": ... |
'''
Created on Mar 1, 2017
@author: debanjan
'''
"""
Borrowed from textacy (https://github.com/chartbeat-labs/textacy)
"""
import sys
PY2 = int(sys.version[0]) == 2
if PY2:
from backports import csv
from itertools import izip as zip
bytes_ = str
unicode_ = unicode
string_types = (str, unicode)
... | {
"content_hash": "664c7a7661e870b1b94d431fc3dad4c5",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 65,
"avg_line_length": 23.487179487179485,
"alnum_prop": 0.6550218340611353,
"repo_name": "debanjanmahata/textmining-kit",
"id": "863e158ba681e2971723f4c48f23a930c9dc8753",
... |
import os
import abc
import glob
from datetime import datetime
import warnings
import numpy as np
class StaticBase(object):
"""
The StaticBase class serves as a template for i/o objects used in
GriddedStaticBase.
"""
__metaclass__ = abc.ABCMeta
def __init__(self, filename, mode='r', **kwarg... | {
"content_hash": "0477ee9d9fbfd5afda7eeb2051a4ce4a",
"timestamp": "",
"source": "github",
"line_count": 929,
"max_line_length": 78,
"avg_line_length": 27.980624327233585,
"alnum_prop": 0.5421635762098946,
"repo_name": "christophreimer/pygeobase",
"id": "586f693737654c3515e967cf703f299f6b80e171",
"s... |
from backend.site.serializers import ContactSubmissionSerializer
def test_contact_submission_serializer():
serializer = ContactSubmissionSerializer()
# check it escapes html tags, and converts paragraphs to html
data = {'message': '<h1>hello</h1>\nworld'}
msg = serializer.message_to_html(data)['messa... | {
"content_hash": "49bb3ebc34192630800af67923497353",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 82,
"avg_line_length": 43.041666666666664,
"alnum_prop": 0.6340755082284608,
"repo_name": "briancappello/flask-react-spa",
"id": "055435fadba67dd09ad46dd49a072e0949a51c4c",
... |
"""Miscellaneous utility functions."""
from __future__ import absolute_import, division, with_statement
try:
# You can get the monotime module from:
# http://pypi.python.org/pypi/Monotime/
import monotime
except ImportError:
pass
import time
try:
# python 3.3 has time.monotonic(), or the monotime... | {
"content_hash": "11e26e0817438dfd0be669dba4799efd",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 80,
"avg_line_length": 30.573033707865168,
"alnum_prop": 0.6515986769570011,
"repo_name": "shineyear/catawampus",
"id": "6f60911416365551bda162d7e2ecd432e67e8534",
"size": ... |
"""Real NVP bijector."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shape
from tensorflow.python.layers impor... | {
"content_hash": "971364b2118f32cd29b57b06e529a45d",
"timestamp": "",
"source": "github",
"line_count": 302,
"max_line_length": 80,
"avg_line_length": 40.450331125827816,
"alnum_prop": 0.6742796332678455,
"repo_name": "hfp/tensorflow-xsmm",
"id": "ab585a7de670b96c4e350684122c6401cf5f74e9",
"size": ... |
from quantum.openstack.common import cfg
DEFAULT_VLAN_RANGES = []
DEFAULT_INTERFACE_MAPPINGS = []
vlan_opts = [
cfg.StrOpt('tenant_network_type', default='local',
help="Network type for tenant networks "
"(local, vlan, or none)"),
cfg.ListOpt('network_vlan_ranges',
... | {
"content_hash": "ca8aff8f54ca07c9aec681b6e5733d03",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 72,
"avg_line_length": 29.86842105263158,
"alnum_prop": 0.6343612334801763,
"repo_name": "aristanetworks/arista-ovs-quantum",
"id": "45e86fa224054a06e4288221cb847f82a4760263"... |
"""Test script for ftplib module."""
# Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS
# environment
import ftplib
import asyncore
import asynchat
import socket
import StringIO
import errno
import os
try:
import ssl
except ImportError:
ssl = None
from unittest import TestCase, SkipTest, skipUnl... | {
"content_hash": "afaee47855a083df7ea3670e74016917",
"timestamp": "",
"source": "github",
"line_count": 808,
"max_line_length": 85,
"avg_line_length": 32.37871287128713,
"alnum_prop": 0.5779374665545448,
"repo_name": "shiblon/pytour",
"id": "b3d8f7efb26dbcc762b994305bf7e11193a10860",
"size": "26162... |
"""
Module for Input/Ouput
"""
from __future__ import absolute_import
from .core import save_all_figs # noqa
| {
"content_hash": "3c0c973779b987d30e3eccc74edae518",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 39,
"avg_line_length": 18.5,
"alnum_prop": 0.7027027027027027,
"repo_name": "tonysyu/mpltools",
"id": "9a51c9d47241196b53bc2c1bee557c95dfc8ff0d",
"size": "111",
"binary": ... |
import copy
from sqlalchemy import exc as sa_exc
import testtools
from sahara.conductor import manager
from sahara import context
from sahara import exceptions as ex
import sahara.tests.unit.conductor.base as test_base
SAMPLE_CLUSTER = {
"plugin_name": "test_plugin",
"hadoop_version": "test_version",
"t... | {
"content_hash": "22de0cdb33f4b1496f04108c7fde864e",
"timestamp": "",
"source": "github",
"line_count": 305,
"max_line_length": 76,
"avg_line_length": 33.19016393442623,
"alnum_prop": 0.5488491553887188,
"repo_name": "ekasitk/sahara",
"id": "7b68a7bd36d687c58c42e8574e00aaa5752c272a",
"size": "10706... |
"""
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2010 Nathanael C. Fritz
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
import logging
from optparse import OptionParser
import sleekxmpp
from sleekxmpp import Iq
from sleekxmpp.exceptions import XMPPError
from slee... | {
"content_hash": "e2db8408a1a5cff38654d6f99eace0d7",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 108,
"avg_line_length": 34.14594594594595,
"alnum_prop": 0.5816051923381352,
"repo_name": "aaronkvanmeerten/jibri",
"id": "8109814f42674f0a1bbf003fda2e8eba1292f735",
"size... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_hooligan_rodian_female_01.iff"
result.attribute_template_id = 9
result.stfName("npc_name","rodian_base_female")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "5e94937b9c9e4f875c6360bd50e2a406",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 79,
"avg_line_length": 24.307692307692307,
"alnum_prop": 0.7025316455696202,
"repo_name": "obi-two/Rebelion",
"id": "887a91a80188726a60da22a040ce1f8b8ea76a4b",
"size": "461... |
import os
import os.path
import shutil
import stat
def build(source_path, build_path, install_path, targets):
print source_path, build_path, install_path, targets
if "install" in (targets or []):
# rez-build create the folder by default. We'll replace it by a symlink for simplicity.
if os.path... | {
"content_hash": "2d99723c49dbb32d4aaea3b9c348bc7a",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 95,
"avg_line_length": 35.3125,
"alnum_prop": 0.6902654867256637,
"repo_name": "SqueezeStudioAnimation/omtk",
"id": "bc54a747793656a3584aea735f71d6492071b791",
"size": "565... |
from subprocess import call
import os
from SiddhiCEP3 import SiddhiLoader
# Download extension jars
call(["mvn", "install"], cwd=os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + "/Resources/Extensions3/")
# Add extensions
extensions_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + "/... | {
"content_hash": "3d3a34fe9bc4b6255ecdd9fbc0ac67c4",
"timestamp": "",
"source": "github",
"line_count": 341,
"max_line_length": 138,
"avg_line_length": 38.97947214076246,
"alnum_prop": 0.6220282876918447,
"repo_name": "madhawav/SiddhiCEPPythonAPI",
"id": "e49de79a93d39ca14c81181b98e272eebf0999b0",
... |
import pytest
import os
import sys
os.environ.setdefault(
'DJANGO_SETTINGS_MODULE', 'templatefield.test.settings')
sys.exit(pytest.main())
| {
"content_hash": "a583a5d37211cd7325720994d7cfc146",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 60,
"avg_line_length": 18.125,
"alnum_prop": 0.7586206896551724,
"repo_name": "orcasgit/django-template-field",
"id": "c54b8fbd83eeb985ecccad95dab0fb22bd3944fa",
"size": "24... |
"""
CERN@school - Processing Frames
See the README.md file for more information.
"""
#...for the operating stuff.
import os
#...for the file processing.
import glob
#...for parsing the arguments.
import argparse
#...for the logging.
import logging as lg
#...for file manipulation.
from shutil import rmtree
# ... | {
"content_hash": "653b67989248c6e7d59792326d3b461b",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 97,
"avg_line_length": 29.646408839779006,
"alnum_prop": 0.5585165859112933,
"repo_name": "CERNatschool/particle-rate-plotter",
"id": "2629cfff9902b42aeb61e84ba8a5374f308be8... |
from __future__ import division
from collections import deque
import time
import math
import random
import networkx as nx
import matplotlib.pyplot as plt
class HeuSearch():
def __init__(self, sourceword, dest, datalist, outlist, inlist):
self.sourceword = sourceword
self.dest = dest
self.con... | {
"content_hash": "1178b9e56e48b1a130eeeb2d07205f56",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 151,
"avg_line_length": 34.8494623655914,
"alnum_prop": 0.49166923788954026,
"repo_name": "laosiaudi/Wiki-search",
"id": "8f0b2356aaa406a3c8913d7cf18e1722816cb9af",
"size"... |
from llvmlite import ir
from numba import cuda, types
from numba.core import cgutils
from numba.core.errors import RequireLiteralValue
from numba.core.typing import signature
from numba.core.extending import overload_attribute
from numba.cuda import nvvmutils
from numba.cuda.extending import intrinsic
#-------------... | {
"content_hash": "9f044c90b3e7ee2e8f99414f72959b4d",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 80,
"avg_line_length": 29.918781725888326,
"alnum_prop": 0.6518493383101459,
"repo_name": "cpcloud/numba",
"id": "746669ed8d7927f7d17db8122ca7ad7633341543",
"size": "5894"... |
"""
Tests for txdav.caldav.datastore.util.
"""
import textwrap
from twisted.trial.unittest import TestCase as BaseTestCase
from txweb2.http_headers import MimeType
from twisted.internet.defer import inlineCallbacks
from twistedcaldav.ical import Component
from twistedcaldav.test.util import TestCase
from txdav.com... | {
"content_hash": "65cc0022e826f598e0fbcf0006789cec",
"timestamp": "",
"source": "github",
"line_count": 595,
"max_line_length": 98,
"avg_line_length": 33.2453781512605,
"alnum_prop": 0.6449117840351852,
"repo_name": "trevor/calendarserver",
"id": "698c15aa2777c1dfbb0f7266ea7d010367830157",
"size": ... |
import configparser
class Config(object):
def __init__(self, config_file):
config = configparser.ConfigParser()
config.read(config_file)
self.token = config.get('Credentials', 'Token', fallback=None)
self.master_id = config.get('Permissions', 'OwnerID', fallback=None)
self... | {
"content_hash": "3120ea516c514c24a38d869722974394",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 84,
"avg_line_length": 36.23076923076923,
"alnum_prop": 0.6475583864118896,
"repo_name": "Masaliukas/Dorna",
"id": "3839f075b7f2b28dc15dba3874eb69ab6c1a2a0e",
"size": "1413... |
from flask import Blueprint
familias = Blueprint('familias', __name__)
from . import views | {
"content_hash": "6ccb743abd6b19033949ed7a4a50a24b",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 42,
"avg_line_length": 14.285714285714286,
"alnum_prop": 0.68,
"repo_name": "originaltebas/chmembers",
"id": "5f58c6b7776e359387816e9be966f6a74864f5dc",
"size": "128",
"bi... |
"""Tests for Model subclassing."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tempfile
import numpy as np
from tensorflow.python.framework import tensor_shape
from tensorflow.python.framework import test_util
from tensorflow.python.k... | {
"content_hash": "39c93c36afafd957f4e4e30db435a293",
"timestamp": "",
"source": "github",
"line_count": 564,
"max_line_length": 80,
"avg_line_length": 33.765957446808514,
"alnum_prop": 0.6289119932787229,
"repo_name": "Xeralux/tensorflow",
"id": "58b144365be6cd8ea5b2ea82e275eacdee6b6c84",
"size": "... |
""" Sample command-line program for listing Google Dataproc Clusters"""
import argparse
import os
from google.cloud import storage
import googleapiclient.discovery
# Currently only the "global" region is supported
REGION = 'global'
DEFAULT_FILENAME = 'pyspark_sort.py'
def get_default_pyspark_file():
"""Gets th... | {
"content_hash": "7b4a4253325fcfe1375996671fca61a8",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 79,
"avg_line_length": 33.35294117647059,
"alnum_prop": 0.6258309591642925,
"repo_name": "JavaRabbit/CS496_capstone",
"id": "f165e145b67dea62af8cdf0105dc80768b4db8e0",
"si... |
__author__ = 'Bohdan Mushkevych'
import sys
import types
from six import class_types
from synergy.conf import context
def get_class(kls):
"""
:param kls - string of fully identified starter function or starter method path
for instance:
- workers.abstract_worker.AbstractWorker.start
- workers.... | {
"content_hash": "c38949b8048389803523b9a707573c0c",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 109,
"avg_line_length": 33.87951807228916,
"alnum_prop": 0.6173541963015647,
"repo_name": "mushkevych/scheduler",
"id": "3b5e27d87ee802ff58ec0a27aeece18cccd7703b",
"size": ... |
from workspacemanager.utils import *
import sh
"""
This file will install all req which can be find in the current prject directory
"""
# il y avait installReqs
if __name__ == '__main__':
installReqs()
| {
"content_hash": "0e8d46fd61939e3a22f64d443d90a2df",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 84,
"avg_line_length": 18.083333333333332,
"alnum_prop": 0.6682027649769585,
"repo_name": "hayj/WorkspaceManager",
"id": "8d9babb3717c52e3c3e3c1e14b966fcc532d2f2a",
"size":... |
"""Support for Netgear LTE sensors."""
import attr
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_HOST, CONF_SENSORS
from homeassistant.exceptions import PlatformNotReady
import homeassistant.helpers.config_validation as cv
from homeassistant.h... | {
"content_hash": "47e1d56063143f8af10d9b28f4fdd121",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 78,
"avg_line_length": 26.204301075268816,
"alnum_prop": 0.6512105047189167,
"repo_name": "HydrelioxGitHub/home-assistant",
"id": "339fa678d61cf41512dffcb60e42f6cf0adb2d0b",
... |
class Solution(object):
def combinationSum2(self, candidates, target):
candidates.sort()
table = [set() for _ in xrange(target + 1)]
for num in candidates:
if num > target:
break
for j in xrange(target - num, 0, -1):
table[num + j] |= {... | {
"content_hash": "db4be9b4eda25b2deb3e3d2d9fbabc08",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 68,
"avg_line_length": 33.125,
"alnum_prop": 0.5509433962264151,
"repo_name": "seanxwzhang/LeetCode",
"id": "7227fa1b7a34cb402fe8c85ec02b9d69a4a8f140",
"size": "1022",
"b... |
import unittest
from mock import patch
from securionpay import blacklist
@patch('securionpay.resource.Resource.request')
class TestBlacklist(unittest.TestCase):
def test_create(self, request):
blacklist.create({'some_param': 'some_value'})
request.assert_called_once_with('POST',
... | {
"content_hash": "83e51edf8a2d9bfb09ef1691cd399f89",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 69,
"avg_line_length": 37.93333333333333,
"alnum_prop": 0.4833040421792619,
"repo_name": "wesolutki/securionpay-python",
"id": "1ace870cc3283c876f5fa75922c6dd7f2a64a053",
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.