text stringlengths 4 1.02M | meta dict |
|---|---|
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.views.generic.edit import CreateView
from django.http import HttpResponse
from .models import Match, Player
from .forms import MatchUploadForm
from django.contrib.auth.decorators import login_required
from dja... | {
"content_hash": "5d7d3a46f29b22f565be6c1c9135a7a8",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 125,
"avg_line_length": 36.11940298507463,
"alnum_prop": 0.6958677685950413,
"repo_name": "wraithan/rplay",
"id": "55009dd32e725df0de6b3c5dee6a7bcbce1dff53",
"size": "2420"... |
import json
import gspread
from oauth2client.client import SignedJwtAssertionCredentials
import datetime
from participantCollection import ParticipantCollection
# Edit Me!
participantFileNames = ['../stayclean-2014-november/participants.txt',
'../stayclean-2014-december/participants.txt',
... | {
"content_hash": "b935209868cf271490d409e2d6d1adde",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 143,
"avg_line_length": 56.837606837606835,
"alnum_prop": 0.673984962406015,
"repo_name": "foobarbazblarg/stayclean",
"id": "e7b7983943db30335cd401162daf5898f416dc8c",
"si... |
"""
Function to load configuration files for bots.
"""
import runpy
import os.path as op
import yaml
def load_config_file(conf_file_path):
file_name, file_extension = op.splitext(conf_file_path)
try:
if file_extension.lower() in ('.yml', '.yaml'):
cfg = load_yml_config(conf_file_path)
... | {
"content_hash": "01de00d76857a7817820718fac8ba4be",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 94,
"avg_line_length": 29.523809523809526,
"alnum_prop": 0.5959677419354839,
"repo_name": "PythonSanSebastian/pyper_the_bot",
"id": "9e5bdcdf886197d7d53506ac577946e26d095b2e"... |
from __future__ import unicode_literals
import copy
import json
import os
import pickle
import unittest
import uuid
from django.core.exceptions import SuspiciousOperation
from django.core.serializers.json import DjangoJSONEncoder
from django.core.signals import request_finished
from django.db import close_old_connect... | {
"content_hash": "ea894c880617dfb98e3a311396de3429",
"timestamp": "",
"source": "github",
"line_count": 701,
"max_line_length": 94,
"avg_line_length": 38.4793152639087,
"alnum_prop": 0.6004671164825387,
"repo_name": "liangazhou/django-rdp",
"id": "c7bf63b4caed9410cbce8c70b7770ad22e8177ce",
"size": ... |
import sys
import os
# If extensions (or modules to document with autodoc) are in another
# directory, add these directories to sys.path here. If the directory is
# relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# Get the proje... | {
"content_hash": "8003fcc0a586d2a0cd3428a36ff0465b",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 76,
"avg_line_length": 31.003846153846155,
"alnum_prop": 0.7047512715543978,
"repo_name": "zastari/masterha_toolkit",
"id": "01431338ab0d5c07bc6d2a57f52d5e64fe7ade4d",
"si... |
from __future__ import unicode_literals
import frappe, os
from frappe import _
import frappe.modules.import_file
from frappe.model.document import Document
from frappe.utils.data import format_datetime
from frappe.core.doctype.data_import.importer import upload
from frappe.utils.background_jobs import enqueue
class D... | {
"content_hash": "173a8aa21491266c140192c40426d20a",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 134,
"avg_line_length": 38.283185840707965,
"alnum_prop": 0.7182154415164124,
"repo_name": "chdecultot/frappe",
"id": "02624cdf65e038a21bd186cbafc56e1111119ad8",
"size": "... |
import datetime
from typing import Dict, List, Optional, TYPE_CHECKING, Union
from ... import _serialization
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from .. import models as _models
class AddressSpace(_serialization.Model):
"""AddressSpace contains an array of IP address rang... | {
"content_hash": "3fd01c4f22df66b1b29d387d04f7ede2",
"timestamp": "",
"source": "github",
"line_count": 9650,
"max_line_length": 540,
"avg_line_length": 45.208082901554405,
"alnum_prop": 0.6532350123092299,
"repo_name": "Azure/azure-sdk-for-python",
"id": "5d6318e3ecf679f4e2d142d8c3528771a8eff912",
... |
from collections import defaultdict
from functools import partial
from typing import (
Any,
Collection,
DefaultDict,
Dict,
List,
Mapping,
Optional,
Tuple,
Union,
cast,
)
from ..language import (
DirectiveDefinitionNode,
DirectiveLocation,
DocumentNode,
EnumTypeDe... | {
"content_hash": "7f7cfd8c7ee26c30e45f610d76ef7a5a",
"timestamp": "",
"source": "github",
"line_count": 759,
"max_line_length": 88,
"avg_line_length": 38.179183135704875,
"alnum_prop": 0.6214024432327973,
"repo_name": "graphql-python/graphql-core",
"id": "445f0c030d4c2415aa51dca08b5ee28168d1afcd",
... |
import logging
import uuid
from datetime import date, datetime, timedelta
from django.conf import settings
from django.db import transaction
from django.template.loader import render_to_string
from django.utils.translation import gettext
from celery import chord
from corehq.apps.users.role_utils import initialize_do... | {
"content_hash": "939f88589c892f209a91ade53a98721f",
"timestamp": "",
"source": "github",
"line_count": 272,
"max_line_length": 138,
"avg_line_length": 35.73529411764706,
"alnum_prop": 0.6385802469135803,
"repo_name": "dimagi/commcare-hq",
"id": "d368e7f8e830e6c27e10c48239496f3172670cd1",
"size": "... |
from .setup import TestPygletGUI
from pyglet_gui.core import Viewer
from pyglet_gui.manager import Manager
from pyglet_gui.containers import HorizontalContainer
class TestHorizontalContainer(TestPygletGUI):
"""
This test case tests basic functionality of
an horizontal container.
"""
def setUp(se... | {
"content_hash": "48ba7b9be1f79fffad0fa6eff2ece47e",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 102,
"avg_line_length": 35.74444444444445,
"alnum_prop": 0.642524090767796,
"repo_name": "jorgecarleitao/pyglet-gui",
"id": "ac9a217de315550dadc9bf781189e4c76fd16f7d",
"siz... |
import math
import tensorflow as tf
import numpy as np
from utils import tf_mean_std_normalize
from tensorflow.python.framework.tensor_shape import TensorShape
class HolographicMemory:
def __init__(self, sess, input_size, num_models, seed=None,
complex_normalize=True, l2_normalize=False, use_fft_m... | {
"content_hash": "63ad3a180a9d9a605687357de86a4afa",
"timestamp": "",
"source": "github",
"line_count": 376,
"max_line_length": 121,
"avg_line_length": 41.773936170212764,
"alnum_prop": 0.5540841662952823,
"repo_name": "jramapuram/holographic_memory",
"id": "909cf9ebddd60d869a2a64c25e04fffff1a367b2",... |
"""
A helper class to get the files generated from thrift IDL files.
"""
import os
import blade
import configparse
import console
import build_rules
import java_jar_target
import py_targets
from blade_util import var_to_list
from cc_targets import CcTarget
from thrift_helper import ThriftHelper
class ThriftLib... | {
"content_hash": "fd74db9589ce3a435bd1f300db3dc41e",
"timestamp": "",
"source": "github",
"line_count": 255,
"max_line_length": 86,
"avg_line_length": 32.6,
"alnum_prop": 0.5009022013713461,
"repo_name": "Lunewcome/typhoon-blade",
"id": "16188fd3ca1e2933ce60ddbba2c219a53bb334d9",
"size": "8519",
... |
from inferbeddings.nli.evaluation.base import accuracy, stats
from inferbeddings.nli.evaluation.util import evaluate
__all__ = [
'accuracy',
'stats',
'evaluate'
]
| {
"content_hash": "f4e7136e4f4188583415bbce1ef81127",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 61,
"avg_line_length": 22,
"alnum_prop": 0.7102272727272727,
"repo_name": "uclmr/inferbeddings",
"id": "3567bef82764321811c9bf3ed634f4ebc22f0bcd",
"size": "201",
"binary":... |
from distutils.core import setup
import py2exe
setup(name='completedir', scripts=['btcompletedirgui.py'])
| {
"content_hash": "9090e9a6bb7bc825ad09265a375ab7cd",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 58,
"avg_line_length": 26.75,
"alnum_prop": 0.794392523364486,
"repo_name": "jakesyl/BitTornado",
"id": "62be63be386f32c9a8457b68c5a338f2ea1f7aa3",
"size": "198",
"binary"... |
from django.contrib import admin
# Register your models here.
from .models import Job, Server, LoadMeasurement, JobSchedulingEvent
admin.site.register(Job)
admin.site.register(Server)
admin.site.register(LoadMeasurement)
admin.site.register(JobSchedulingEvent)
| {
"content_hash": "09d37de7f242270cc3616f5a1e246da8",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 68,
"avg_line_length": 26.4,
"alnum_prop": 0.8257575757575758,
"repo_name": "ewerkema/job-scheduler",
"id": "c0f31fe2b731ad0bd4998f87614e44d0a622ad49",
"size": "264",
"bi... |
import sys
from sumologic import SumoLogic
args = sys.argv
sumo = SumoLogic(args[1], args[2])
fromCat, toCat = args[3], args[4]
cs = sumo.collectors()
for c in cs:
if 'category' in c and c['category'] == fromCat:
cv, etag = sumo.collector(c['id'])
cv['collector']['category'] = toCat
print(sumo.update_collecto... | {
"content_hash": "d383ed31f4f20bdc6aed067395cd396e",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 52,
"avg_line_length": 27.2,
"alnum_prop": 0.6397058823529411,
"repo_name": "SumoLogic/sumologic-python-sdk",
"id": "366a9dc295fcf0bbcdef328c203b79117e7b8ed8",
"size": "740... |
"""
Error Bars showing Confidence Interval
======================================
This example shows how to show error bars using covidence intervals.
The confidence intervals are computed internally in vega by
a non-parametric [bootstrap of the mean](https://github.com/vega/vega-statistics/blob/master/src/bootstrapCI.... | {
"content_hash": "e5e366ee4dc35c486825de1a17f375e8",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 113,
"avg_line_length": 26.333333333333332,
"alnum_prop": 0.6582278481012658,
"repo_name": "ellisonbg/altair",
"id": "41aaaca0be0b1c8cf09889c44c971bfc3c5069af",
"size": "79... |
from neutronclient._i18n import _
from neutronclient.common import exceptions
from neutronclient.common import utils
from neutronclient.common import validators
from neutronclient.neutron import v2_0 as neutronv20
def get_bgp_peer_id(client, id_or_name):
return neutronv20.find_resourceid_by_name_or_id(client,
... | {
"content_hash": "73d0bb46fcbcd8d7111aa225d9f7c17e",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 77,
"avg_line_length": 33.450450450450454,
"alnum_prop": 0.5545381093455427,
"repo_name": "eayunstack/python-neutronclient",
"id": "8fefb660a68834f80c06cdc71cadd7ca4d0bb595"... |
"""Trains an nltk language model."""
import random
import pickle
from typing import List, Tuple
from nltk.lm.preprocessing import padded_everygram_pipeline
from nltk.lm import Laplace
from absl import app
from absl import flags
from tqdm import tqdm
FLAGS = flags.FLAGS
flags.DEFINE_string('string_to_normalize', None... | {
"content_hash": "7652b81be007afabd9193e62812c92c6",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 86,
"avg_line_length": 36.518248175182485,
"alnum_prop": 0.6092344593244053,
"repo_name": "googleinterns/text-norm-for-low-resource-languages",
"id": "d10ce02ed75052797a7594... |
from unittest import TestCase
from django.template import Engine
from .utils import TEMPLATE_DIR
class OriginTestCase(TestCase):
def setUp(self):
self.engine = Engine(dirs=[TEMPLATE_DIR])
def test_origin_compares_equal(self):
a = self.engine.get_template('index.html')
b... | {
"content_hash": "1adbf225f45820265e414b58af1c2941",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 56,
"avg_line_length": 33.833333333333336,
"alnum_prop": 0.6440886699507389,
"repo_name": "yephper/django",
"id": "12afa35ec5d541869e424e23ed234e4bf3356d56",
"size": "812",... |
'''
Copyright (c) 2014, K. Kumar (me@kartikkumar.com)
All rights reserved.
'''
###################################################################################################
# Set up input deck
###################################################################################################
# Set path to TLE c... | {
"content_hash": "bf5359ae942a677641db0f21082ddc6e",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 99,
"avg_line_length": 36.79865771812081,
"alnum_prop": 0.575414918840051,
"repo_name": "kartikkumar/sda",
"id": "d815d0711244f94c3f9efc3db44190c351a61ac3",
"size": "5483"... |
"""
WSGI config for bucketlist project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
from dj_static import Cling
os.e... | {
"content_hash": "48408460c419762b4f09a920ef159beb",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 78,
"avg_line_length": 25.41176470588235,
"alnum_prop": 0.7754629629629629,
"repo_name": "andela-ggikera/djangular-bucketlist-app",
"id": "6bb3c5da938c0615fe5a2bf19b5f75cae6f... |
import os
import hashlib
import random
import logging
import shutil
import glob
from twisterlib.testsuite import TestCase
from twisterlib.error import BuildError
from twisterlib.size_calc import SizeCalculator
from twisterlib.handlers import Handler, SimulationHandler, BinaryHandler, QEMUHandler, DeviceHandler, SUPPOR... | {
"content_hash": "f380318f5b1d2a2b916aaa911211b61e",
"timestamp": "",
"source": "github",
"line_count": 250,
"max_line_length": 123,
"avg_line_length": 34.608,
"alnum_prop": 0.5943134535367545,
"repo_name": "zephyrproject-rtos/zephyr",
"id": "1c7a702e0380a67f83e14105afbbb54bde1d15d2",
"size": "8790... |
from social_core.backends.khanacademy import BrowserBasedOAuth1, \
KhanAcademyOAuth1
| {
"content_hash": "f924a2f6826a28440bb4b9a5f3c65f81",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 66,
"avg_line_length": 44.5,
"alnum_prop": 0.8314606741573034,
"repo_name": "cjltsod/python-social-auth",
"id": "7ae755869a37577e33ea3c9be7ca405117bec112",
"size": "89",
"... |
class Node():
def __init__(self, board_state=None, algebraic_move=None, value=None):
self.board_state = board_state
self.algebraic_move = algebraic_move
self.value = value
| {
"content_hash": "a256a1f22b168b7f6b738ceeeb88d761",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 74,
"avg_line_length": 40,
"alnum_prop": 0.64,
"repo_name": "lamesjim/Chess-AI",
"id": "7609f9570e0e060ed92f5905cebda3a0a33c2ce6",
"size": "200",
"binary": false,
"copie... |
import argparse
import json
import os
import random
import numpy as np
from ray import tune
from ray.tune import Trainable, run
class TestLogger(tune.logger.Logger):
def on_result(self, result):
print("TestLogger", result)
def trial_str_creator(trial):
return "{}_{}_123".format(trial.trainable_nam... | {
"content_hash": "19e708b3dcd430710b56d9c4b5f8e9b4",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 79,
"avg_line_length": 28.91176470588235,
"alnum_prop": 0.6185147507629705,
"repo_name": "stephanie-wang/ray",
"id": "9643034e70390f6b5d65b5c201cff058c9ecfe80",
"size": "19... |
from sys import argv
script, first, second = argv
print "The script is called", script
print "First argument is", first
print "Second argument is", second
missing= raw_input("What you forgot: ")
print "Entered: ", missing
| {
"content_hash": "5ef1437585ce00e6493f3c641b2ffe5d",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 39,
"avg_line_length": 20.545454545454547,
"alnum_prop": 0.7300884955752213,
"repo_name": "aurelo/lphw",
"id": "49e3a8d423848bb1fce809e0a967a4f81f054306",
"size": "226",
... |
PANEL = 'cluster_templates'
# The slug of the panel group the PANEL is associated with.
PANEL_GROUP = 'container_infra'
# The slug of the dashboard the PANEL associated with. Required.
PANEL_DASHBOARD = 'project'
# Python panel class of the PANEL to be added.
ADD_PANEL = 'magnum_ui.content.cluster_templates.panel.Clus... | {
"content_hash": "d265b6e0f673af1a2a80ce33b55a1e90",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 72,
"avg_line_length": 41.75,
"alnum_prop": 0.7724550898203593,
"repo_name": "openstack/magnum-ui",
"id": "7f61d3baa4280c1c4addabdedeee9fefa3701845",
"size": "1014",
"bina... |
"""
Read data from the "current" BATSE catalog (dubbed 5Bp here, with "p" for
"preliminary," since an official 5B successor to the 4B catalog has not yet
been released). Provide access to catalog data and other GRB data via
a GRBCollection instance providing access to its individual GRB elements
in three ways:
* as a... | {
"content_hash": "0af734f761c1c542f8406db11bc4ce47",
"timestamp": "",
"source": "github",
"line_count": 237,
"max_line_length": 95,
"avg_line_length": 32.30801687763713,
"alnum_prop": 0.628966958338775,
"repo_name": "tloredo/batse5bp",
"id": "b2af14876b67de4d929b217500ea90da34235824",
"size": "7657... |
"""Integration tests for the pr_curves plugin."""
import collections.abc
import functools
import os.path
import numpy as np
import tensorflow as tf
from tensorboard import context
from tensorboard.backend.event_processing import (
plugin_event_multiplexer as event_multiplexer,
)
from tensorboard.backend.event_p... | {
"content_hash": "485afb458f843698afd894001b07769e",
"timestamp": "",
"source": "github",
"line_count": 301,
"max_line_length": 82,
"avg_line_length": 38.96345514950166,
"alnum_prop": 0.593281036834925,
"repo_name": "tensorflow/tensorboard",
"id": "bb5eb41ce15a1235006b409fb366e6aaff20b54f",
"size":... |
from django.db import models
from server.models import *
class Catalog(models.Model):
machine_group = models.ForeignKey(MachineGroup, on_delete=models.CASCADE)
content = models.TextField()
name = models.CharField(max_length=253)
sha256hash = models.CharField(max_length=64)
class Meta:
ord... | {
"content_hash": "089a9aa0aed83db2b8986ef790df30d1",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 77,
"avg_line_length": 29.5,
"alnum_prop": 0.711864406779661,
"repo_name": "salopensource/sal",
"id": "3495fef7cebbfc1dab2c25d60cb2b984ed008638",
"size": "354",
"binary":... |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("common", "0026_auto_20210325_1923"),
]
operations = [
migrations.AlterField(
model_name="address",
... | {
"content_hash": "25f77269205b174ec0cdad2e0bd9a66d",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 83,
"avg_line_length": 31.57547169811321,
"alnum_prop": 0.4980579623543472,
"repo_name": "MicroPyramid/Django-CRM",
"id": "8e3c08bae7c3e498151eb56362c67de14ee8c1cb",
"size... |
"""Replacement for ``django.template.loader`` that uses Jinja 2.
The module provides a generic way to load templates from an arbitrary
backend storage (e.g. filesystem, database).
"""
from coffin.template import Template as CoffinTemplate
from jinja2 import TemplateNotFound
def find_template_source(name, dirs=None)... | {
"content_hash": "db6a2d587d762dba695c59746cfbc74e",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 76,
"avg_line_length": 34.93939393939394,
"alnum_prop": 0.7003469210754554,
"repo_name": "havard024/prego",
"id": "9fa80496f45d85aa4abcea79be5418f2c74fafc4",
"size": "2306"... |
"""
Copyright Philip Castiglione 2018
Licensed under the MIT Licence. Refer to LICENSE.txt.
"""
from game import Game
if __name__ == '__main__':
Game.start()
| {
"content_hash": "0e937f1dc8d3a71a46aec0e1d15fe6d5",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 53,
"avg_line_length": 16.5,
"alnum_prop": 0.6666666666666666,
"repo_name": "PhilipCastiglione/learning-machines",
"id": "34c107a5e7cc4f62c38a0be814073093bcf0bda0",
"size":... |
import webob.exc
from nova.api.openstack import extensions
from nova import db
from nova import exception
from nova.openstack.common.gettextutils import _
authorize = extensions.extension_authorizer('compute', 'fixed_ips')
class FixedIPController(object):
def show(self, req, id):
"""Return data about th... | {
"content_hash": "de3595db646b6d9a46272fad175cd445",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 79,
"avg_line_length": 35.78481012658228,
"alnum_prop": 0.5886098337460205,
"repo_name": "tanglei528/nova",
"id": "23647f51b3adee8beb1fc9253ea15e7163e76f15",
"size": "3429"... |
default_app_config = 'course.apps.CourseConfig'
| {
"content_hash": "a81d294a89014e50783f0768a1f72fde",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 47,
"avg_line_length": 48,
"alnum_prop": 0.7916666666666666,
"repo_name": "OpenCourseProject/OpenCourse",
"id": "10308e50109453da49fbc2072499f878365a0e17",
"size": "48",
"... |
from modules.setup.app import app
from modules.views.login import facebook, google, github
from flask import redirect, url_for, flash, session as login_session
@app.route('/logout/')
def logout():
if 'provider' in login_session:
if login_session['provider'] == 'facebook':
facebook.fbdisconnect... | {
"content_hash": "b53c3b593912156656a6021d829bcd60",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 68,
"avg_line_length": 37.19230769230769,
"alnum_prop": 0.6204756980351603,
"repo_name": "stonescar/item-catalog",
"id": "fffcba4ab36d87a0a67e5425676ba715bc3636a0",
"size":... |
import os
from settings import *
INSTALLED_APPS += [
'simple_tests',
]
HAYSTACK_SEARCH_ENGINE = 'simple'
| {
"content_hash": "a00d789ef2f85dcd94851ad6bbdac080",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 33,
"avg_line_length": 13.875,
"alnum_prop": 0.6846846846846847,
"repo_name": "calvinchengx/django-haystack",
"id": "b21dcac55b05ca87bfb3ac691b656439b120ec5c",
"size": "111"... |
import errno
import imp
import marshal
import os
import py_compile
import random
import stat
import struct
import sys
import unittest
import textwrap
import shutil
from test.test_support import (unlink, TESTFN, unload, run_unittest, rmtree,
is_jython, check_warnings, EnvironmentVarGuard,... | {
"content_hash": "42178d39df1cf1faa239c9a55602ae03",
"timestamp": "",
"source": "github",
"line_count": 657,
"max_line_length": 93,
"avg_line_length": 36.81430745814308,
"alnum_prop": 0.5629056931409435,
"repo_name": "jedie/pypyjs-standalone",
"id": "4da6a3121726703f21facf89df94317d1359d677",
"size... |
class Printer(object):
def __init__(self, owning_particle):
super(Printer, self).__init__()
self.owning_particle = owning_particle
def collide(self, another_particle):
print str(another_particle.contents)
def __str__(self):
return 'Printer'
class Reader(object):
"""do... | {
"content_hash": "d7d4a6ee284d7976ebfacea18ce39f1f",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 46,
"avg_line_length": 25.61904761904762,
"alnum_prop": 0.5855018587360595,
"repo_name": "autowitch/moop",
"id": "0de3b480b9cdaa044cf8e761d47529e97a4e5fda",
"size": "1077",... |
import spirit.spiritlib as spiritlib
import ctypes
### Load Library
_spirit = spiritlib.LoadSpiritLibrary()
# The Bohr Magneton [meV / T]
_mu_B = _spirit.Constants_mu_B
_mu_B.argtypes = None
_mu_B.restype = scalar
def mu_B():
return _mu_B()
# The Boltzmann constant [meV / K]
_k_B ... | {
"content_hash": "a74cd8d70e2e853da560411a7c5a92d9",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 42,
"avg_line_length": 21.1,
"alnum_prop": 0.6113744075829384,
"repo_name": "Disselkamp/spirit",
"id": "2234bc04e8bf3d51009c2e1c53f86236718965d3",
"size": "422",
"binary"... |
import six
from rally.common.i18n import _
class RallyException(Exception):
"""Base Rally Exception
To correctly use this class, inherit from it and define
a "msg_fmt" property. That msg_fmt will get printf'd
with the keyword arguments provided to the constructor.
"""
msg_fmt = _("%(message... | {
"content_hash": "a1396db25003da65e9d049c005346d3d",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 79,
"avg_line_length": 28.040485829959515,
"alnum_prop": 0.674126479930696,
"repo_name": "varuntiwari27/rally",
"id": "df739466ed2fcc8ef1ced3353d3d73dcc6818d31",
"size": "... |
from pkg_resources import resource_filename
import pytest
import watershed
def test(*args):
options = [resource_filename('watershed', '')]
options.extend(list(args))
return pytest.main(options)
| {
"content_hash": "1ecea82141351069f4a13dfc0c645fa8",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 50,
"avg_line_length": 19.09090909090909,
"alnum_prop": 0.7238095238095238,
"repo_name": "phobson/watershed",
"id": "ecfb8ee20c2df31e5244ed457a0c64c8f39f3e06",
"size": "210... |
"""Tests for losses.py."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from language.labs.consistent_zero_shot_nmt.models import losses
import tensorflow.compat.v1 as tf
class LossesTest(tf.test.TestCase):
"""Tests for losses."""
def test_l2_dist... | {
"content_hash": "e923f4ac7ebde585a382176f780e9ae1",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 75,
"avg_line_length": 28.666666666666668,
"alnum_prop": 0.6382428940568475,
"repo_name": "google-research/language",
"id": "9dd280f4439353994ab0a216758663066e1fc49f",
"siz... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/deed/pet_deed/shared_dewback_deed.iff"
result.attribute_template_id = 2
result.stfName("pet_deed","dewback")
#### BEGIN MODIFICATIONS ####
result.setStringAttribute("radial_filename", "radials/deed_datapad... | {
"content_hash": "707eed8a4d98436a26bb4a6c62175c94",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 86,
"avg_line_length": 33.875,
"alnum_prop": 0.7380073800738007,
"repo_name": "anhstudios/swganh",
"id": "6b35b52c0a6aefb560b63bf04bd0178f0d3a618f",
"size": "687",
"binar... |
from .resource import Resource
class VirtualMachineExtensionImage(Resource):
"""Describes a Virtual Machine Extension Image.
Variables are only populated by the server, and will be ignored when
sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Res... | {
"content_hash": "25ea8c32b041ea7e2ad7af7c99a4a49e",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 105,
"avg_line_length": 42.5,
"alnum_prop": 0.6440336134453781,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "7273e2b847542395497089873cf0fd2c5e3bd757",
"size": "3449... |
"""
Ax_Metrics - Query component for ghost comparisons specification
------------------------------------------------------------------------------
Author: Dan Kamins <dos at axonchisel dot net>
Copyright (c) 2014 Dan Kamins, AxonChisel.net
"""
# ----------------------------------------------------------------------... | {
"content_hash": "2f2c0e8c7f3ad573e8e698c66e8ab6d4",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 78,
"avg_line_length": 23.772727272727273,
"alnum_prop": 0.5079668578712556,
"repo_name": "axonchisel/ax_metrics",
"id": "18d09a52770b9e5fac4fb87680c609ffe53be405",
"size":... |
"""
Base functionality useful to various parts of Twisted Names.
"""
import socket
from twisted.names import dns
from twisted.names.error import DNSFormatError, DNSServerError, DNSNameError
from twisted.names.error import DNSNotImplementedError, DNSQueryRefusedError
from twisted.names.error import DNSUnknownError
fr... | {
"content_hash": "38a3bbf7239ad17e75f01159d8f6d7a8",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 112,
"avg_line_length": 33.55555555555556,
"alnum_prop": 0.6141813199360585,
"repo_name": "sorenh/cc",
"id": "c76b2adf7607a98301259b62937821528aa62f7b",
"size": "8886",
... |
import _plotly_utils.basevalidators
class TickvalssrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="tickvalssrc",
parent_name="scattergeo.marker.colorbar",
**kwargs
):
super(TickvalssrcValidator, self).__init__(
plotly... | {
"content_hash": "6687cac706e57278105154d836a3437b",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 70,
"avg_line_length": 29.823529411764707,
"alnum_prop": 0.5798816568047337,
"repo_name": "plotly/python-api",
"id": "4d4469e6521d096386b643c0d60e0bdfadcf7c62",
"size": "50... |
import string
import copy
import sys
import re
import pyDDDParameters
import pprint
# ===============================================================
# ==========================================
# Find the type of a parametere, that we understand.
# Inputs:
# name - the type name
# tag - the pass... | {
"content_hash": "932eaf94390e13cd95ef00600bbaf241",
"timestamp": "",
"source": "github",
"line_count": 398,
"max_line_length": 88,
"avg_line_length": 32.04271356783919,
"alnum_prop": 0.518779894926684,
"repo_name": "henjo/pyoa",
"id": "abe966f7499329128997c96ee09ff5731d54a2c7",
"size": "13739",
... |
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from djangobmf.dashboards import Warehouse
from djangobmf.sites import Category
class LocationCategory(Category):
name = _('Locations')
slug = "locations"
dashboard = Warehouse
| {
"content_hash": "16a4e2440a139268b14e6c9d7904802d",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 55,
"avg_line_length": 24.083333333333332,
"alnum_prop": 0.7612456747404844,
"repo_name": "django-bmf/django-bmf",
"id": "59b3f0821c61ec0cde55442f81b303ac49c504a3",
"size":... |
from sklearn2sql_heroku.tests.regression import generic as reg_gen
reg_gen.test_model("GradientBoostingRegressor" , "freidman2" , "hive")
| {
"content_hash": "7a506da5450e342e113bca48ab497a3a",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 70,
"avg_line_length": 35,
"alnum_prop": 0.7857142857142857,
"repo_name": "antoinecarme/sklearn2sql_heroku",
"id": "73cb79af6d3756b12cdd90dfd92665fb7d8018b0",
"size": "140",... |
import yaml
class Enemy:
enemy_file = file('data/enemies.yml')
enemy_dat = yaml.load(enemy_file)
# Player Profile
Name = ''
Is_Person = ''
Level = 0
# Player Stats
hp = 0
str = 0
agi = 0
acc = 0
end = 0
spd = 0
armor = 0
# Equipped Melee
weapon_name = ''... | {
"content_hash": "574420de9e80706baf636c28de75ea17",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 64,
"avg_line_length": 27.625,
"alnum_prop": 0.5571266968325792,
"repo_name": "DinkWerks/Kivy-Game",
"id": "2f2977b10d03b5b8cff8cde119147a7039cf9eb7",
"size": "1768",
"bi... |
from html5lib import html5parser, sanitizer
import markdown
def parse(text):
# First run through the Markdown parser
text = markdown.markdown(text, extensions=["extra"], safe_mode=False)
# Sanitize using html5lib
bits = []
parser = html5parser.HTMLParser(tokenizer=sanitizer.HTMLSanitizer)
f... | {
"content_hash": "3604da66356e715dab6c588eebdcb0cf",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 73,
"avg_line_length": 26.9375,
"alnum_prop": 0.7146171693735499,
"repo_name": "toulibre/symposion",
"id": "178708f655f9824bf2c6cfca7be4f0d82a3d9748",
"size": "431",
"bin... |
from atom.api import Bool, Unicode, Enum, Typed, ForwardTyped, observe
from enaml.core.declarative import d_
from .container import Container, ProxyContainer
class ProxyGroupBox(ProxyContainer):
""" The abstract definition of a proxy GroupBox object.
"""
#: A reference to the GroupBox declaration.
... | {
"content_hash": "2030eedab482b589667a394e787fdca3",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 79,
"avg_line_length": 30.58490566037736,
"alnum_prop": 0.6051819864281308,
"repo_name": "ContinuumIO/ashiba",
"id": "e67343e7b063343f7f83ad84d9a4f9e6fd579bdc",
"size": "19... |
from django.db import models
from django.contrib.auth import models as auth_models
from django.utils.timezone import now
class SuggestionManager(models.Manager):
def get_query_set(self):
return super(SuggestionManager, self).get_query_set().filter(in_reply_to=None)
class Comment(models.Model):
author ... | {
"content_hash": "521c9e9791372b51b999ffdcd1aa8df3",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 98,
"avg_line_length": 35.58,
"alnum_prop": 0.6312535132096684,
"repo_name": "sorenh/python-django-suggestionbox",
"id": "82169f88ed831fff5e86a7c53701a9427b38a730",
"size":... |
"""Privileges that can be granted by user to tasks and pools"""
from typing import Dict
class Privileges(object):
_exportApiAndStorageCredentialsInEnvironment: bool = False # Export the Api and Storage credentials to the task/pool environment
def __init__(self, exportCredentialsInEnv: bool = False):
... | {
"content_hash": "56ab21c58c5523bb40b57b00d9ad3233",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 133,
"avg_line_length": 40.90243902439025,
"alnum_prop": 0.7006559332140727,
"repo_name": "qarnot/qarnot-sdk-python",
"id": "1665ef4fe5591f75cbd362ac05fd720eb3201721",
"siz... |
from __future__ import unicode_literals
import json
import six
import re
from moto.core.responses import BaseResponse
from moto.core.utils import camelcase_to_underscores, amzn_request_id
from .models import dynamodb_backends, dynamo_json_dump
def has_empty_keys_or_values(_dict):
if _dict == "":
return T... | {
"content_hash": "0c227be32a32575f7f65af9a9b046306",
"timestamp": "",
"source": "github",
"line_count": 620,
"max_line_length": 163,
"avg_line_length": 42.325806451612905,
"alnum_prop": 0.5459568630439753,
"repo_name": "rocky4570/moto",
"id": "e2f1ef1cc5bbf122eecdc2ea6498e9fc6addd530",
"size": "262... |
from jsonschema import exceptions as js_exceptions
from jsonschema import validate
from oslo_config import cfg
from oslo_log import log as logging
import oslo_messaging as messaging
from stevedore import driver as stevedore_driver
from octavia_lib.api.drivers import data_models as driver_dm
from octavia_lib.api.drive... | {
"content_hash": "628ce8b90d295c8394778b187e84885f",
"timestamp": "",
"source": "github",
"line_count": 533,
"max_line_length": 79,
"avg_line_length": 44.36210131332083,
"alnum_prop": 0.6016071050962148,
"repo_name": "openstack/octavia",
"id": "420ca1b7789502bababb22d4e1bfb7c600a23b3f",
"size": "24... |
import unittest
from walky.messenger import *
from _common import *
class Test(unittest.TestCase):
def test_messenger(self):
msg = Messenger()
q = msg.subscribe_all()
q2 = msg.subscribe_message_id(22)
q3 = msg.subscribe_message_id(123)
msg.put('msg',123)
(data,... | {
"content_hash": "a0621ccd2a83823543aa7851b19da8a6",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 52,
"avg_line_length": 21.847826086956523,
"alnum_prop": 0.5791044776119403,
"repo_name": "amimoto/walky",
"id": "17291c51e902f15ea28e971c84ff18f6747c4cb5",
"size": "1005",... |
import wx
from cairis.core.armid import *
import WidgetFactory
__author__ = 'Shamal Faily'
class ChannelDialog(wx.Dialog):
def __init__(self,parent):
wx.Dialog.__init__(self,parent,CHANNEL_ID,'Add Channel',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK_FRAME|wx.RESIZE_BORDER,size=(400,150))
self.the... | {
"content_hash": "dbd176ddf022067b6fd58d9d5aff4892",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 153,
"avg_line_length": 37.85,
"alnum_prop": 0.7120211360634082,
"repo_name": "nathanbjenx/cairis",
"id": "8a58863165e2bddffee82adac6a65e0032cea004",
"size": "2313",
"bin... |
from django.db import models
# Create your models here.
class Word(models.Model):
word = models.CharField(max_length=30)
class Document(models.Model):
docid = models.IntegerField(default=-1)
class Entry(models.Model):
word = models.ForeignKey('Word', primary_key=True)
docid = models.ForeignKey('Document', pr... | {
"content_hash": "a4d17ccfce5ea19540d97393058fc4b7",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 56,
"avg_line_length": 22,
"alnum_prop": 0.7513368983957219,
"repo_name": "nh0815/PySearch",
"id": "97b293dbe0a2693b4ef931c57a6f3485249332a4",
"size": "374",
"binary": fa... |
from os.path import dirname, join
import subprocess
from dxr.testing import DxrInstanceTestCaseMakeFirst
from nose import SkipTest
from nose.tools import ok_
class MercurialTests(DxrInstanceTestCaseMakeFirst):
"""Test our Mercurial integration, both core and omniglot."""
def test_diff_file1(self):
... | {
"content_hash": "2ffdd9a930898103df1819e583b39bf5",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 147,
"avg_line_length": 54.42857142857143,
"alnum_prop": 0.7022872140982377,
"repo_name": "bozzmob/dxr",
"id": "79c4927dd21f22c89b7fb01ebb4bfe11235b01d3",
"size": "2667",
... |
from debile.slave.wrappers.perlcritic import parse_perlcritic
from debile.slave.utils import cd
from debile.utils.commands import run_command
def perlcritic(dsc, analysis):
run_command(["dpkg-source", "-x", dsc, "source-perlcritic"])
with cd('source-perlcritic'):
out, _, ret = run_command([
... | {
"content_hash": "4c9b98aea92aba714420237e894f33d3",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 64,
"avg_line_length": 32.148148148148145,
"alnum_prop": 0.5956221198156681,
"repo_name": "opencollab/debile",
"id": "4b93e4d10eb6a63537b18b721eaf898c36958363",
"size": "20... |
from __future__ import (
absolute_import, division, print_function, with_statement,
unicode_literals)
import os.path as p
import swutils
import config
from subprocess import call
from functools import partial
from flask import current_app as app
from flask.ext.script import Manager
from tabutils.process impo... | {
"content_hash": "c617646fcd713079ed6844b609d0413b",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 78,
"avg_line_length": 24.03669724770642,
"alnum_prop": 0.6541984732824427,
"repo_name": "reubano/hdxscraper-fao",
"id": "0cb9484762a3f135ca0fecf0f9b9201acd9018e7",
"size"... |
"""
Example of client query
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import ga4gh.client.client as client
def runDemo():
httpClient = client.HttpClient("http://localhost:8000")
iterator = httpClient.search_variants(
"WyIxa2ctcD... | {
"content_hash": "957a5cf704f4ddb7a72b934f38091485",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 71,
"avg_line_length": 26.291666666666668,
"alnum_prop": 0.6735340729001584,
"repo_name": "ga4gh/server",
"id": "206f88c404a2d585d84e87c0051770b205dfd770",
"size": "653",
... |
import os, sys
from pprint import pformat
from colourize import colourize, RED, BLACK, YELLOW
from properties import parse_properties
from ear import Ear, WebModule
### begin logging stuff
import logging
logging.basicConfig(format="%(message)s")
log = logging.getLogger(__name__)
def debug(s):
log.debug(colouriz... | {
"content_hash": "99c3583b42234f538ce6bf7abeb24eb1",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 92,
"avg_line_length": 33.224806201550386,
"alnum_prop": 0.6297246850209987,
"repo_name": "MnM/tomcat-ear",
"id": "611039744f2f4ee2362d16a8bad2e4425c026d24",
"size": "4286... |
import sys
import inspect
from collections import OrderedDict
class TracebackFancy:
def __init__(self, traceback):
self.t = traceback
def getFrame(self):
return FrameFancy(self.t.tb_frame)
def getLineNumber(self):
return self.t.tb_lineno if self.t is not None else None
def ... | {
"content_hash": "381acd8c88fe427ab8837c12356619b0",
"timestamp": "",
"source": "github",
"line_count": 360,
"max_line_length": 175,
"avg_line_length": 30.53611111111111,
"alnum_prop": 0.567361047939598,
"repo_name": "youtube/cobalt_sandbox",
"id": "a166f21e98392a6f8c06062c1c581e6545bce4c8",
"size"... |
import pytest
from configuration.models import Configuration
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from accounts.models import User
from accounts.tests.test_views import accounts_route_questionnaires
from model_mommy import mommy
f... | {
"content_hash": "5fc185579c37b9e31dd303a14e2a9761",
"timestamp": "",
"source": "github",
"line_count": 935,
"max_line_length": 81,
"avg_line_length": 40.510160427807484,
"alnum_prop": 0.5793225440240779,
"repo_name": "CDE-UNIBE/qcat",
"id": "94d93d50216063494d1206818f2105dab8c831a9",
"size": "3787... |
from __future__ import print_function
from bokeh.browserlib import view
from bokeh.models import ColumnDataSource, DataRange1d, Plot, LinearAxis, Grid, Circle, HoverTool, BoxSelectTool
from bokeh.models.widgets import (
Select, DataTable, TableColumn, StringFormatter, HBox, VBox,
NumberFormatter, StringEditor,... | {
"content_hash": "f9e559eb394299046dc8c80ef08901fb",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 158,
"avg_line_length": 44.37241379310345,
"alnum_prop": 0.6114392290954305,
"repo_name": "htygithub/bokeh",
"id": "4d9c7e69a246f68dec7214ef7301fe940c73dc57",
"size": "643... |
"""Tests for lmod."""
import unittest
import mock
from perfkitbenchmarker import errors
from perfkitbenchmarker.linux_packages import lmod
from tests import pkb_common_test_case
def MockVm():
return mock.Mock()
class LmodTest(pkb_common_test_case.PkbCommonTestCase):
def testYumInstall(self):
vm = MockVm()... | {
"content_hash": "64d3ee5ad4177eef9f66525c6410a9d5",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 73,
"avg_line_length": 22.74,
"alnum_prop": 0.671943711521548,
"repo_name": "GoogleCloudPlatform/PerfKitBenchmarker",
"id": "1b2b1b3781771cbdebc2d97e32104aaac470c9d5",
"siz... |
import argparse
import os
import sys
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(BASE_DIR)
from scripts.lib.setup_path import setup_path
setup_path()
os.environ['DJANGO_SETTINGS_MODULE'] = 'zproject.settings'
import django
django.setup()
from zerver.worke... | {
"content_hash": "50d43ec85ef0eb17fd323c4ee586ecc9",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 88,
"avg_line_length": 28.8,
"alnum_prop": 0.6972222222222222,
"repo_name": "brainwane/zulip",
"id": "68b337c38a1f4c2368e8ef2f70f6593caff1acfa",
"size": "743",
"binary": ... |
from django.conf.urls import patterns, url
from django.utils.translation import ugettext as _
from know.core.plugins import registry
from know.core.plugins.base import BasePlugin
from know.plugins.attachments import views
from know.plugins.attachments import models
from know.plugins.attachments import settings
from kno... | {
"content_hash": "d04b24f498c60a88e68cefad3d901518",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 166,
"avg_line_length": 52.625,
"alnum_prop": 0.6828978622327792,
"repo_name": "indexofire/gork",
"id": "7da3d4c8c3dd4317f0431355a1c48dc587f6452c",
"size": "2550",
"binar... |
import contextlib
import errno
import os
from glance.openstack.common import excutils
from glance.openstack.common.gettextutils import _ # noqa
from glance.openstack.common import log as logging
LOG = logging.getLogger(__name__)
_FILE_CACHE = {}
def ensure_tree(path):
"""Create a directory (and any ancestor d... | {
"content_hash": "7d410e8da3af7226b13016f9f618218f",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 68,
"avg_line_length": 24.967391304347824,
"alnum_prop": 0.629516760992599,
"repo_name": "SUSE-Cloud/glance",
"id": "72ae50c37e170da7478f2fe93d52934b1acc836c",
"size": "298... |
from __future__ import print_function
import unittest
import numpy as np
import paddle.fluid.core as core
from op_test import OpTest
class TestElementwiseAddOp(OpTest):
def init_kernel_type(self):
self.use_mkldnn = False
def setUp(self):
self.op_type = "elementwise_add"
self.dtype = n... | {
"content_hash": "ba13d322a353a31165fe77d02344d14d",
"timestamp": "",
"source": "github",
"line_count": 296,
"max_line_length": 73,
"avg_line_length": 32.273648648648646,
"alnum_prop": 0.6285983460692977,
"repo_name": "tensor-tang/Paddle",
"id": "5783048f5fb68217dfbad829b33449e7951d8b0b",
"size": "... |
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, ... | {
"content_hash": "3b225f3465d710567c37f094a1a687d2",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 299,
"avg_line_length": 52.5,
"alnum_prop": 0.7238095238095238,
"repo_name": "fdr/tinytalk",
"id": "a49fbada81d23d475dde6f903a6239ce49eddef1",
"size": "543",
"binary": fa... |
from tweepy import Stream
from tweepy import OAuthHandler
from tweepy.streaming import StreamListener
import json
import sys
import webbrowser
import codecs
import csv
from string import punctuation
import matplotlib.pyplot as plt
import time
class tweetlistener(StreamListener):
def on_status(self,status):
... | {
"content_hash": "ab77ae2584afca46553808824271f5a3",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 142,
"avg_line_length": 35.19900497512438,
"alnum_prop": 0.5858657243816254,
"repo_name": "Swaraj1998/MyCode",
"id": "0ecd54c9f3d6e72ab0977534d824887407ebb4d0",
"size": "7... |
import requests
import json
import datetime
INPUT_FILE = "tickers.txt"
FILENAME = "stocktwits.json"
REMOVE_OLDER_THAN = 21 # in days
KEEP_NULL_SENTIMENT = False
class Sentiment():
def __init__(self):
self.tickers = []
self.data = {}
# write to JSON file and properly formats the file
def w... | {
"content_hash": "70e8eb6512872afff651cff26d9a8114",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 91,
"avg_line_length": 34.2093023255814,
"alnum_prop": 0.5781781101291639,
"repo_name": "Vaibhav/Stock-Analysis",
"id": "24e7d91163a141e0bd0e534d94789a1bbf04fe03",
"size": ... |
"""Phonological operations that depend on iso graphemes."""
import pynini as p
from nisaba.scripts.natural_translit.brahmic import iso_inventory as gr
from nisaba.scripts.natural_translit.common import rewrite_functions as rw
from nisaba.scripts.natural_translit.common import util as u
from nisaba.scripts.natural_tran... | {
"content_hash": "16d496cc5daf2f10cecb3ef108f76e41",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 80,
"avg_line_length": 26.92896174863388,
"alnum_prop": 0.671672077922078,
"repo_name": "google-research/nisaba",
"id": "dd4ab2c1fedc95c81624c353b0fa5c78a6437df1",
"size":... |
from __future__ import annotations
import logging
from dataclasses import dataclass
from typing import ClassVar
import ijson
from pants.backend.go.util_rules.build_opts import GoBuildOptions
from pants.backend.go.util_rules.sdk import GoSdkProcess
from pants.engine.fs import CreateDigest, Digest, FileContent
from pa... | {
"content_hash": "931e42f26982b5d603efa4b2ff9951e0",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 95,
"avg_line_length": 32.82178217821782,
"alnum_prop": 0.6868778280542986,
"repo_name": "pantsbuild/pants",
"id": "5fa6bf98f2a81b6dd03b3f36b9485709c3fc328f",
"size": "344... |
import os
import pickle
import torch
import numpy as np
import matplotlib.pyplot as plt
from deluca.lung.controllers import ResidualExplorer, PID
from deluca.lung.environments import PhysicalLung
from deluca.lung.utils.data.analyzer import Analyzer
from deluca.lung.utils.core import BreathWaveform
from deluca.lung.ut... | {
"content_hash": "065db2bcbd55c9cb73983ac8075fa6a0",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 99,
"avg_line_length": 24.363636363636363,
"alnum_prop": 0.6215351812366737,
"repo_name": "google/deluca-lung",
"id": "af430365b606eb3adbb39f122f015c6570be667f",
"size": "1... |
import time
from testrunner import testcase
from testutils import mock
from webob import request
from upsrv import config
from upsrv import url_sign
class UrlSignTest(testcase.TestCase):
def setUp(self):
testcase.TestCase.setUp(self)
self.cfg = config.UpsrvConfig()
self.cfg.downloadSigna... | {
"content_hash": "5c5397cd185e450b2550bace294c6a7a",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 105,
"avg_line_length": 36.08955223880597,
"alnum_prop": 0.6555004135649297,
"repo_name": "sassoftware/rbm",
"id": "c4ca6302b5353c15c639faf7a57186a61b042275",
"size": "3005... |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | {
"content_hash": "472bc6780ff33f2a33306daf9c488bbf",
"timestamp": "",
"source": "github",
"line_count": 300,
"max_line_length": 190,
"avg_line_length": 50.833333333333336,
"alnum_prop": 0.6873442622950819,
"repo_name": "arenadata/ambari",
"id": "78692cba45bc8dca84a9d3ef90a75b5c5c67bd35",
"size": "1... |
from k5test import *
realm = K5Realm(create_host=False)
keyctl = which('keyctl')
out = realm.run([klist, '-c', 'KEYRING:process:abcd'], expected_code=1)
test_keyring = (keyctl is not None and
'Unknown credential cache type' not in out)
# Test kdestroy and klist of a non-existent ccache.
realm.run([kd... | {
"content_hash": "4ddc54027438f7ee7c5a3e395d521d99",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 79,
"avg_line_length": 43.46610169491525,
"alnum_prop": 0.6402807564827452,
"repo_name": "drankye/kerb-token",
"id": "dd20e11399a53c57ec64c815d6ab3ed4e5ee3fcf",
"size": "6... |
import doctest
import os
import pickle
import shutil
import sys
import tempfile
import unittest
from genshi.compat import BytesIO, StringIO
from genshi.core import Markup
from genshi.input import XML
from genshi.template.base import BadDirectiveError, TemplateSyntaxError
from genshi.template.loader import TemplateLoad... | {
"content_hash": "d6bc3c410b104818ef86f290375e3cfd",
"timestamp": "",
"source": "github",
"line_count": 780,
"max_line_length": 88,
"avg_line_length": 35.91025641025641,
"alnum_prop": 0.5056051410210639,
"repo_name": "hodgestar/genshi",
"id": "b6084f43ff4bb9f100962c55fd9423d9018537f3",
"size": "285... |
bg0_hard = "#1d2021"
bg0_soft = '#32302f'
bg0_normal = '#282828'
bg0 = bg0_normal
bg1 = "#3c3836"
bg2 = "#504945"
bg3 = "#665c54"
bg4 = "#7c6f64"
fg0 = "#fbf1c7"
fg1 = "#ebdbb2"
fg2 = "#d5c4a1"
fg3 = "#bdae93"
fg4 = "#a89984"
bright_red = "#fb4934"
bright_green = "#b8bb26"
bright_yellow = "#fabd2f"
bright_blue = "#8... | {
"content_hash": "3e4be1e72af5fb7de6c657a2ccacece1",
"timestamp": "",
"source": "github",
"line_count": 325,
"max_line_length": 95,
"avg_line_length": 29.775384615384617,
"alnum_prop": 0.7628397230546657,
"repo_name": "The-Compiler/dotfiles",
"id": "7c96968c16ed5f9c71cd6e370740521b5f95d707",
"size"... |
__author__ = 'Jachym Cepicky'
from pywps import Process, LiteralInput, ComplexOutput, ComplexInput, Format
from pywps.app.Common import Metadata
from pywps.validator.mode import MODE
from pywps.inout.formats import FORMATS
from pywps.response.status import WPS_STATUS
inpt_vector = ComplexInput(
'vector',
'Vec... | {
"content_hash": "ea78a0edd2a4438063f95a6373a8d3cd",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 111,
"avg_line_length": 30.26732673267327,
"alnum_prop": 0.6584887144259077,
"repo_name": "bird-house/PyWPS",
"id": "96de80a15c7d8bec04f731005b5d746c37d84fa0",
"size": "43... |
import os
import sys
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0... | {
"content_hash": "6ee9edb6ac0c8c1443f3c4fa71420330",
"timestamp": "",
"source": "github",
"line_count": 378,
"max_line_length": 204,
"avg_line_length": 38.42857142857143,
"alnum_prop": 0.7030152829409335,
"repo_name": "jlongstaf/f5-openstack-lbaasv2-driver",
"id": "41a373f65010b6f8f56d75ecbd3ce880c08... |
BOT_NAME = 'tutorial'
SPIDER_MODULES = ['tutorial.spiders']
NEWSPIDER_MODULE = 'tutorial.spiders'
ITEM_PIPELINES = {
# 'tutorial.pipelines.JsonWithEncodingPipeline': 300,
}
# Crawl responsibly by identifying yourself (and your website) on the user-agent
# USER_AGENT = 'tutorial (+http://www.yourdomain.com)'
DOWNL... | {
"content_hash": "b43519b391160854ab019628ba9bf5a3",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 80,
"avg_line_length": 30.625,
"alnum_prop": 0.7448979591836735,
"repo_name": "openslack/openslack-crawler",
"id": "609038dd5b6a67330cde9d9147867fe6928b4ffb",
"size": "723"... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import djgeojson.fields
import elecciones.models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
nam... | {
"content_hash": "a908a12a2d3ce53186ff18ae4cdac721",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 197,
"avg_line_length": 47.71111111111111,
"alnum_prop": 0.5576773792889302,
"repo_name": "democraciaconcodigos/escrutinio-social",
"id": "1dbd333499749707307d213e71764c9b48... |
from collections import namedtuple
from corehq.apps.app_manager.xpath_validator.config import get_xpath_validator_path
from corehq.apps.app_manager.xpath_validator.exceptions import XpathValidationError
from dimagi.utils.subprocess_manager import subprocess_context
XpathValidationResponse = namedtuple('XpathValidation... | {
"content_hash": "64af587cbc8002485100f4df603fc982",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 88,
"avg_line_length": 46.666666666666664,
"alnum_prop": 0.6595238095238095,
"repo_name": "qedsoftware/commcare-hq",
"id": "df9e766dfee8333852581c910314b3b1ff843ac7",
"size... |
'''OpenGL extension EXT.texture_object
This module customises the behaviour of the
OpenGL.raw.GL.EXT.texture_object to provide a more
Python-friendly API
Overview (from the spec)
This extension introduces named texture objects. The only way to name
a texture in GL 1.0 is by defining it as a single display list... | {
"content_hash": "466947b9e3a1a972515fe66ff73d8dfd",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 85,
"avg_line_length": 38.816326530612244,
"alnum_prop": 0.7949526813880127,
"repo_name": "alexus37/AugmentedRealityChess",
"id": "a7ef9e7588bbbd0275ced58bc02f7f2f87309b2f",
... |
from datetime import datetime
from django.test import TestCase
from .models import Article, IndexErrorArticle, Person
class EarliestOrLatestTests(TestCase):
"""Tests for the earliest() and latest() objects methods"""
def tearDown(self):
"""Makes sure Article has a get_latest_by"""
if not Ar... | {
"content_hash": "63b5a7571cefd15717fca77b524584e8",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 95,
"avg_line_length": 40.78362573099415,
"alnum_prop": 0.6098365357040436,
"repo_name": "darjeeling/django",
"id": "eaa318663fb7135dc7a454c5dd4d841583562d09",
"size": "69... |
from elasticsearch import Elasticsearch
from pytest import raises
from elasticsearch_dsl import connections, serializer
def test_default_connection_is_returned_by_default():
c = connections.Connections()
con, con2 = object(), object()
c.add_connection("default", con)
c.add_connection("not-default",... | {
"content_hash": "fe79c7568866d4223b5d6ba7b32297b2",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 84,
"avg_line_length": 29.22972972972973,
"alnum_prop": 0.675913083680074,
"repo_name": "elastic/elasticsearch-dsl-py",
"id": "278760cc38f1be7422ed1601f23349b94a336177",
"s... |
from nose.tools import assert_equals
from os.path import dirname, relpath, join
from diylisp.interpreter import interpret, interpret_file
from diylisp.types import Environment
env = Environment()
path = join(dirname(relpath(__file__)), '..', 'stdlib.diy')
interpret_file(path, env)
"""
Consider these tests as suggest... | {
"content_hash": "cbecdd5061ed8d72a527dea1748bd472",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 82,
"avg_line_length": 31.158730158730158,
"alnum_prop": 0.5858380030565461,
"repo_name": "kjbekkelund/kim-lisp",
"id": "57695c614d87d20fe0fc7e2b6f431eae00c46380",
"size":... |
import sys, os, logging, itertools
from hmm.pssm import seq_to_numpy, numpy_to_seq
import hmm.pssm.logo as L
from biopsy.chow_liu.chow_liu import DependencyAnalyser
from gapped_pssms.parse_gapped_format import parse_models, build_hmm_from_semi_parsed
from cookbook.dicts import DictOf
from cookbook.pylab_utils import py... | {
"content_hash": "c0d180bbb0441715435a5861a77b3136",
"timestamp": "",
"source": "github",
"line_count": 361,
"max_line_length": 134,
"avg_line_length": 33.24930747922438,
"alnum_prop": 0.5874364742147796,
"repo_name": "JohnReid/biopsy",
"id": "a18d7ebf4c542dc1f64a3a8d6e9ad182dce7c75e",
"size": "120... |
import datetime
from argparse import ArgumentParser
from typing import Any, List
import pytz
from django.core.management.base import BaseCommand
from django.db.models import Count
from django.utils.timezone import now as timezone_now
from zerver.models import Message, Realm, Recipient, Stream, \
Subscription, Use... | {
"content_hash": "09634bce6d70faa36e721caabeae50ad",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 104,
"avg_line_length": 52.111111111111114,
"alnum_prop": 0.6026589740373761,
"repo_name": "jackrzhang/zulip",
"id": "f41ee54debd6a28f4a176d5978e8e02dd1dc6ffe",
"size": "7... |
"""
This bot appends some text to all unused images and notifies uploaders.
Parameters:
-limit Specify number of pages to work on with "-limit:n" where
n is the maximum number of articles to work on.
If not used, all pages are used.
-always Don't be asked every time.
... | {
"content_hash": "26760e5774f954c0b3ff7e7e662d0c03",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 79,
"avg_line_length": 32.416666666666664,
"alnum_prop": 0.5721401028277635,
"repo_name": "wikimedia/pywikibot-core",
"id": "c61bee54e80f8d1530bf4896fb0b76e2f0eec46e",
"si... |
import simple
class Simple2:
def __init__(self):
self.info = "SimpleClass2"
class Simple3(simple.Simple):
def __init__(self):
simple.Simple.__init__(self)
text = "text in simple"
assert simple.text == text
_s=simple.Simple()
_s3=Simple3()
assert _s.info==_s3.info
import recursive_import
_s=rec... | {
"content_hash": "f059003acd9483da17eaf7c51de033eb",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 61,
"avg_line_length": 18.5,
"alnum_prop": 0.701280227596017,
"repo_name": "firmlyjin/brython",
"id": "09f1a58fe2fee4ddf9f38c4d8a598992d3bbeb33",
"size": "703",
"binary":... |
from flask import redirect, render_template, render_template_string, session
from flask import current_app, flash, redirect, render_template, request, url_for
from flask_user import current_user, login_required
from flask_login import login_user, logout_user
from app.pages.date import *
from app.pages.encryption import... | {
"content_hash": "069f9593bbcfd1363e7a7e4dd59a5327",
"timestamp": "",
"source": "github",
"line_count": 603,
"max_line_length": 164,
"avg_line_length": 38.892205638474294,
"alnum_prop": 0.6412672693160498,
"repo_name": "rcharp/Simple",
"id": "27f46b85bd2197e0bdd0fa68b1b013595316a846",
"size": "2355... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.