text stringlengths 4 1.02M | meta dict |
|---|---|
from __future__ import print_function, absolute_import, division, unicode_literals
try:
import numpy
except: # NOQA
numpy = None
def Xtest_numpy():
import srsly.ruamel_yaml
if numpy is None:
return
data = numpy.arange(10)
print("data", type(data), data)
yaml_str = srsly.ruamel_... | {
"content_hash": "c5cd502eb5fcbf036f10993798eea1d9",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 82,
"avg_line_length": 21.40909090909091,
"alnum_prop": 0.6411889596602972,
"repo_name": "explosion/srsly",
"id": "2c21854408f94aea8f9a0fd86a562e6e0f59b012",
"size": "488",... |
"""Tests for tf.keras models using tf.distribute.Strategy."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import parameterized
import numpy as np
from tensorflow.python import keras
from tensorflow.python.data.experimental.ops import ca... | {
"content_hash": "7c5645521f44c835e80a530db43f148c",
"timestamp": "",
"source": "github",
"line_count": 1749,
"max_line_length": 91,
"avg_line_length": 40.81132075471698,
"alnum_prop": 0.6425139046498269,
"repo_name": "alsrgv/tensorflow",
"id": "bd594a8862f6b0f3e2ac9126d931d4c25ebe5b1e",
"size": "7... |
""" Module for producing the Project Summary Report
Note: Much of this code was written by Pontus and lifted from
the SciLifeLab repo
"""
from collections import defaultdict, OrderedDict
import os
from string import ascii_uppercase as alphabets
import ngi_reports.reports
class Report(ngi_reports.reports.BaseReport)... | {
"content_hash": "c1315132fe488177e4063d4008c42009",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 189,
"avg_line_length": 52.74688796680498,
"alnum_prop": 0.5313089993706733,
"repo_name": "NationalGenomicsInfrastructure/ngi_reports",
"id": "18eb547a209bba7a5a57b8771f6119... |
"""Wordcount exercise
Google's Python class
The main() below is already defined and complete. It calls print_words()
and print_top() functions which you write.
1. For the --count flag, implement a print_words(filename) function that counts
how often each word appears in the text and prints:
word1 count1
word2 count2
... | {
"content_hash": "17777c47c14c58b3812be7b0bdf3843e",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 79,
"avg_line_length": 29.658823529411766,
"alnum_prop": 0.6925823086076953,
"repo_name": "custom22/google-python-exercises",
"id": "5aaac4724d191edd4cc35e3afc86c5d8e8c092c4"... |
from preggy import expect
from tests.base import FilterTestCase
class QualityFilterTestCase(FilterTestCase):
def test_quality_filter(self):
image = self.get_filtered('source.jpg', 'thumbor.filters.quality', 'quality(10)')
expected = self.get_fixture('quality-10%.jpg')
expect(self.context... | {
"content_hash": "49c01966416f39c5f6ee0082de578943",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 89,
"avg_line_length": 34.07692307692308,
"alnum_prop": 0.6952595936794582,
"repo_name": "Bladrak/thumbor",
"id": "565b4d9b39909895a90b94f4ff61b507b78190eb",
"size": "695",... |
'''@file multi_target_dummy_processor.py
contains the MultiTargetDummyProcessor class'''
import os
import subprocess
import StringIO
import scipy.io.wavfile as wav
import numpy as np
import processor
from nabu.processing.feature_computers import feature_computer_factory
import pdb
class MultiTargetDummyProcessor(pro... | {
"content_hash": "bf51043f67c4f7d895617809678687da",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 94,
"avg_line_length": 31.025,
"alnum_prop": 0.6226161697555734,
"repo_name": "JeroenZegers/Nabu-MSSS",
"id": "4b030cbdbdc318395ea67fe3015391f3981f0673",
"size": "3723",
... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Observation.send'
db.add_column('notification_observation', 'send',
self.gf('django.db.models.... | {
"content_hash": "138c7c3721bed5e83b416b306c19626e",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 182,
"avg_line_length": 67.79591836734694,
"alnum_prop": 0.5552378085490668,
"repo_name": "arctelix/django-notification-automated",
"id": "c6692ba46cdb9f13fa36d0e69095a9a9e6a... |
import pickle
from django.conf import settings
from django_redis.serializers.pickle import PickleSerializer
from testil import eq
def test_highest_protocol():
assert pickle.HIGHEST_PROTOCOL <= 5, """
The highest pickle procol supported by Python at time of writing
this test is 5. Support for newe... | {
"content_hash": "8120429fb06d8f7e0df611ca0a7eae5e",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 75,
"avg_line_length": 37.225,
"alnum_prop": 0.7118871725990598,
"repo_name": "dimagi/commcare-hq",
"id": "ff72f8866bbe887c5eae3e97ab5df7c953dd58ef",
"size": "1489",
"bin... |
import os
from setuptools import setup, find_packages
long_description = open(
os.path.join(
os.path.dirname(__file__),
'README.rst'
)
).read()
setup(
name='prompt_toolkit',
author='Jonathan Slenders',
version='0.52',
license='LICENSE.txt',
url='https://github.com/jonatha... | {
"content_hash": "9e6a875a4153c5f6e3bf60d0485f1302",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 84,
"avg_line_length": 22.444444444444443,
"alnum_prop": 0.6287128712871287,
"repo_name": "ddalex/python-prompt-toolkit",
"id": "c3640d7386867d870ff2bd64ab59cad535d2f91c",
... |
import os,uuid,sys
import requests,subprocess,shutil
from pprint import pprint
from KBaseReport.KBaseReportClient import KBaseReport
from biokbase.workspace.client import Workspace as workspaceService
from ReadsUtils.ReadsUtilsClient import ReadsUtils
#END_HEADER
class kb_fastqc:
'''
Module Name:
kb_fastq... | {
"content_hash": "75df2c0f6d888073ac700fbd06bf1bca",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 125,
"avg_line_length": 44.723958333333336,
"alnum_prop": 0.5384884127168976,
"repo_name": "samseaver/kb_fastqc",
"id": "52298809c282be58f5e5c9a38102648d53cd9532",
"size":... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('icekit_events', '0014_eventbase_human_times'),
('fluent_contents', '0001_initial'),
]
operations = [
migrations.CreateModel(
nam... | {
"content_hash": "9ed36898bea24f64859576926bf30938",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 187,
"avg_line_length": 41.44444444444444,
"alnum_prop": 0.6210902591599643,
"repo_name": "ic-labs/icekit-events",
"id": "602ba23ffc8436dfacfb10381710beaa0ddc6ea3",
"size":... |
"""Implementation of an S3-like storage server based on local files.
Useful to test features that will eventually run on S3, or if you want to
run something locally that was once running on S3.
We don't support all the features of S3, but it does work with the
standard S3 client for the most basic semantics. To use t... | {
"content_hash": "160afc723cf5dfb27f26c84676213371",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 76,
"avg_line_length": 36.8828125,
"alnum_prop": 0.5883287439101885,
"repo_name": "hhru/tornado",
"id": "4e85794461ecf209d99eaa792ebb46414683bba3",
"size": "10017",
"bin... |
import os
import StringIO
import cProfile
from datetime import datetime
import pytz
from django.shortcuts import *
from django.utils import timezone
class TimezoneMiddleware(object):
def process_request(self, request):
if request.user.is_authenticated():
tzname = request.user.p... | {
"content_hash": "3ae6b329f2a5c79a160d20ada51dd378",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 118,
"avg_line_length": 31.647058823529413,
"alnum_prop": 0.6384758364312267,
"repo_name": "twitterdev/twitter-leaderboard",
"id": "c8d7ffd8efec4874e9c975f35de6a34f83b1a4d9",... |
from qingcloud.cli.misc.utils import explode_array
from qingcloud.cli.iaas_client.actions.base import BaseAction
class LeaveVxnetAction(BaseAction):
action = 'LeaveVxnet'
command = 'leave-vxnet'
usage = '%(prog)s --instances "instance_id, ..." --vxnet <vxnet_id> [-f <conf_file>]'
@classmethod
def... | {
"content_hash": "55d2ef470826a451ea4c537fc162d247",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 89,
"avg_line_length": 36.6,
"alnum_prop": 0.592896174863388,
"repo_name": "yunify/qingcloud-cli",
"id": "ff4311bf77c4e791a704db3d03ca81ae3e0e6548",
"size": "1931",
"bina... |
import datetime
import tzlocal
def now_tz():
"""Get the current local time as a time zone aware datetime."""
now = datetime.datetime.now(datetime.timezone.utc)
return now.astimezone()
def start_of_day_tz():
"""Get the start of the current day as a time zone aware datetime."""
now = now_tz()
... | {
"content_hash": "d03515cbb9d79fbaa588e5a8a8dd962c",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 74,
"avg_line_length": 28.70967741935484,
"alnum_prop": 0.6786516853932584,
"repo_name": "genericmoniker/mirror",
"id": "3aae291621ab952beb7c8700d2d4ac1e436929a2",
"size": ... |
"""Helper classes for Google Assistant integration."""
from __future__ import annotations
from abc import ABC, abstractmethod
from asyncio import gather
from collections.abc import Mapping
from http import HTTPStatus
import logging
import pprint
from aiohttp.web import json_response
from homeassistant.components imp... | {
"content_hash": "57039adf7250ebfdbaf8d124c684c2ee",
"timestamp": "",
"source": "github",
"line_count": 608,
"max_line_length": 87,
"avg_line_length": 31.43421052631579,
"alnum_prop": 0.6095646714106321,
"repo_name": "home-assistant/home-assistant",
"id": "238ee8d957648b1b3fee274e83c4327ea2667522",
... |
from odoo import api, models
from odoo.tools.translate import _
PARAMS = [
("web_debranding.new_name", _("Software")),
("web_debranding.new_title", _("Software")),
("web_debranding.new_website", "example.com"),
("web_debranding.new_documentation_website", ""),
("web_debranding.favicon_url", ""),
... | {
"content_hash": "1d572db3a5b57ab6f5d8abcdba43dd20",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 87,
"avg_line_length": 32.285714285714285,
"alnum_prop": 0.6389380530973451,
"repo_name": "it-projects-llc/misc-addons",
"id": "50e1ba9f1e278b0224cdf58e7ab1207c822baea0",
"... |
from __future__ import unicode_literals
from django import forms
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from reviewers import review_group_name
from reviewers.models import Review, Reviewer
... | {
"content_hash": "6b8376410b797a5b94250e3adf571ab3",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 116,
"avg_line_length": 29.115942028985508,
"alnum_prop": 0.6122448979591837,
"repo_name": "olea/PyConES-2016",
"id": "97b079425220fd30d9ad23ffd4f5b0af07b3ef95",
"size": "2... |
from __future__ import print_function
import time
import re
import sys
from google.appengine.ext import db
def iterate(query, callback=lambda x: x, batch_size=1000, verbose=True):
"""Utility for iterating over a query, applying the callback to each row."""
start = time.time()
count = 0
results = query.... | {
"content_hash": "bc20b0d1787d6d065a8b60b3bc244218",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 80,
"avg_line_length": 31.864864864864863,
"alnum_prop": 0.6030534351145038,
"repo_name": "gimite/personfinder",
"id": "8e8655181f8d21549fe42fb78f00ae2504851933",
"size": "... |
# Copyright 2009, Jean-Michel Sizun
# Copyright 2009 Frank Scholz <coherence@beebits.net>
import os.path
import time
from twisted.internet import threads
from twisted.web import server, static
from twisted.web.error import PageRedirect
from coherence.upnp.core.utils import ReverseProxyUriResource
from t... | {
"content_hash": "e0cecfa306be90b5bcec2b1408ecb009",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 186,
"avg_line_length": 40.61,
"alnum_prop": 0.5886481162275302,
"repo_name": "coherence-project/Coherence",
"id": "ef2e903d16775a55ddacf749e27432d44eb04d62",
"size": "820... |
"""
pyhik.constants
~~~~~~~~~~~~~~~~~~~~
Constants list
Copyright (c) 2016-2021 John Mihalic <https://github.com/mezz64>
Licensed under the MIT license.
"""
MAJOR_VERSION = 0
MINOR_VERSION = 3
SUB_MINOR_VERSION = 1
__version__ = '{}.{}.{}'.format(
MAJOR_VERSION, MINOR_VERSION, SUB_MINOR_VERSION)
CONNECT_TIMEOUT =... | {
"content_hash": "b3c3f6a3891ebffb55c472c09aeef341",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 65,
"avg_line_length": 27,
"alnum_prop": 0.6434494195688225,
"repo_name": "mezz64/pyHik",
"id": "fbad3e15501d4087647e6ab40dab0f41c6174dc4",
"size": "1809",
"binary": fals... |
from django.forms import CharField, Form, ModelChoiceField
from django.utils.translation import ugettext_lazy as _
from sendinel.backend.authhelper import format_and_validate_phonenumber
from sendinel.backend.models import get_enabled_wocs
from sendinel.infoservices.models import InfoMessage, InfoService
class Regis... | {
"content_hash": "fd9f3c9d8371a00981e9f4bf9f12ea3a",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 91,
"avg_line_length": 51.53125,
"alnum_prop": 0.5651910248635537,
"repo_name": "Sendinel/Sendinel",
"id": "02d7b76bb7189e06826d7245fe189090b1d136e7",
"size": "1649",
"bi... |
"""Helpers to build or extract data from feaLib AST objects."""
from __future__ import print_function, division, absolute_import, unicode_literals
from fontTools.feaLib import ast
from fontTools import unicodedata
import collections
import re
# we re-export here all the feaLib AST classes so they can be used from
# ... | {
"content_hash": "568db5a792d371e9286d2ee0202d139f",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 86,
"avg_line_length": 35.87128712871287,
"alnum_prop": 0.6577422025945349,
"repo_name": "jamesgk/ufo2ft",
"id": "f51c6247fd773e6f00c18988e892f08119bc7ebf",
"size": "7246"... |
"""
The classes in this module provide a property-like interface
to widget instance variables in a class. These properties translate
essential pieces of widget state into more convenient python objects
(for example, the check state of a button to a bool).
Example Use::
class Foo(object):
bar = ButtonPrope... | {
"content_hash": "621f0d31c222fcf63b9965941649040b",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 72,
"avg_line_length": 29.27848101265823,
"alnum_prop": 0.6437527021184609,
"repo_name": "glue-viz/glue-qt",
"id": "df4c4e21e6653ecf6e5578be7048cfb1cc7b41d5",
"size": "2313... |
import matplotlib
from getdist import plots, MCSamples
import getdist
import numpy as np
import matplotlib.pyplot as plt
import astropy
from loadMontePython import load as loadMCMC
import glob
basedir = '../chains/nonzero_model/'
#"/home/zequnl/Projects/isocurvature_2017/analysis/plot_triangle/nonzero/"
burnin = 10... | {
"content_hash": "c70b71895cdfb7789698d127fa82dca1",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 129,
"avg_line_length": 29.30841121495327,
"alnum_prop": 0.6817602040816326,
"repo_name": "xzackli/isocurvature_2017",
"id": "089788876591bee16482005ee77f8c5744794229",
"s... |
import sys
from typing import cast, Iterable, List, Tuple, TYPE_CHECKING, Union
from pyspark import since, SparkContext
from pyspark.sql.column import _to_seq, _to_java_column
from py4j.java_gateway import JavaObject
if TYPE_CHECKING:
from pyspark.sql._typing import ColumnOrName, ColumnOrName_
__all__ = ["Windo... | {
"content_hash": "f25773aac43e6d8774d2f95ab258e606",
"timestamp": "",
"source": "github",
"line_count": 365,
"max_line_length": 100,
"avg_line_length": 38.03013698630137,
"alnum_prop": 0.5881420646927454,
"repo_name": "WeichenXu123/spark",
"id": "7bb59f362898c19929f158fa629933e486b5f985",
"size": "... |
import re
from subprocess import Popen, PIPE
import sys
# Super hacky but easier to do than calling Keystone and Heat's APIs
process = Popen(('heat', 'stack-show', 'overcloud'), stdout=PIPE, stderr=PIPE)
output = process.stdout.read()
# If we're in a HA mode (i.e. more than one controller), make sure the
# NtpServer... | {
"content_hash": "475d6729045c97a122f22b7595948181",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 97,
"avg_line_length": 42.86363636363637,
"alnum_prop": 0.6744432661717922,
"repo_name": "coolsvap/clapper",
"id": "e092d7108d0382202b9146167e8c82d975540eb6",
"size": "943"... |
"""
Provides BaseConfig - a class that makes a config file act like a dictionary
myconf = BaseConfig("myfile.ini")
val = myconf["mysection"]["mykey"]
for each value you read, it tries to return int, failing this float,
failing this returns bool for special string values 'true' / 'false'
(case insensitive test... | {
"content_hash": "cf14ec84a8a8bcae762e23f64aa9b2e0",
"timestamp": "",
"source": "github",
"line_count": 404,
"max_line_length": 109,
"avg_line_length": 32.40841584158416,
"alnum_prop": 0.551210570533873,
"repo_name": "cedadev/mistamover",
"id": "5c5be2e06126c7ede167ec26ca7eadce8cf08b22",
"size": "1... |
import pytest
from selenium.webdriver.common.by import By
@pytest.mark.xfail_safari
def test_should_fire_click_event_when_clicking(driver, pages):
pages.load("javascriptPage.html")
_click_on_element_which_records_events(driver)
_assert_event_fired(driver, "click")
@pytest.mark.xfail_safari
def test_sho... | {
"content_hash": "3e8b9db45325751aa3e5548be5dfc5cc",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 94,
"avg_line_length": 34.56666666666667,
"alnum_prop": 0.7128736740597879,
"repo_name": "HtmlUnit/selenium",
"id": "ae63df258a1d26caa046154bb4323cf1d8ce51e1",
"size": "49... |
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
extra = {}
try:
from nowin_core.scripts import setup_cmd
extra['cmdclass'] = {
'initdb': setup_cmd.InitdbCommand,
'shell': setup_cmd.ShellCommand
}
except ImportError:
pass
tests_require =... | {
"content_hash": "1c6c8faea8f46d30026ed181f0203309",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 44,
"avg_line_length": 18.11111111111111,
"alnum_prop": 0.5631901840490797,
"repo_name": "g0v/nowin_core",
"id": "a2891035cca247696c9de7de9b7ea79078c8d9b2",
"size": "815",
... |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('pastebin', '0007_auto_20170129_1... | {
"content_hash": "a5b5b727fcb5b5cc22c64b42fbf72d91",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 121,
"avg_line_length": 33.48,
"alnum_prop": 0.6236559139784946,
"repo_name": "johannessarpola/django-pastebin",
"id": "779e663f839f9efe51e7c4e47ff8e9cdd2a4251f",
"size": "... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('topics', '0083_auto_20171019_0024'),
]
operations = [
migrations.CreateModel(
name='ClassroomResource',
fields=[
... | {
"content_hash": "62d413ece6dde16c0996f05c9455b032",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 114,
"avg_line_length": 29.9,
"alnum_prop": 0.5674470457079153,
"repo_name": "uccser/cs-unplugged",
"id": "543b9a2ace933ccb4c0e633f3bb4ebddfbb81102",
"size": "970",
"bina... |
"""Timeseries plotting functions."""
from __future__ import division
import numpy as np
import pandas as pd
from scipy import stats, interpolate
import matplotlib as mpl
import matplotlib.pyplot as plt
import warnings
from .external.six import string_types
from . import utils
from . import algorithms as algo
from .p... | {
"content_hash": "e4dfad5ab1f4a4edd70f22404a1830d0",
"timestamp": "",
"source": "github",
"line_count": 454,
"max_line_length": 79,
"avg_line_length": 35.35462555066079,
"alnum_prop": 0.5923618466139181,
"repo_name": "petebachant/seaborn",
"id": "a3b25bf457929357c97fc5af9b699978da9bf981",
"size": "... |
default_app_config = 't4proj.apps.stats.apps.StatsConfig' | {
"content_hash": "8d55021b624ea70a700eacb431b7910b",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 57,
"avg_line_length": 57,
"alnum_prop": 0.8070175438596491,
"repo_name": "mivanov-utwente/t4proj",
"id": "f1aeca083731ed0bdd451842a014bee412fca0cc",
"size": "81",
"binary... |
PROGRESS_BAR_LENGTH = 40
def generate_loading_string(completed_tasks, total_tasks):
""" <percentage completed>% [< -- based on percentage completion>] Completed/Total
"""
try:
fraction_completed = (completed_tasks / total_tasks)
except:
fraction_completed = 1 # To avoid division by Z... | {
"content_hash": "815ce2736052f12fbbe5df49327229db",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 87,
"avg_line_length": 41.35294117647059,
"alnum_prop": 0.6443812233285917,
"repo_name": "CodingVanGogh/parallelization3",
"id": "9e54a75e7c99889154abc00673671bb2e2ce7adf",
... |
import sys
import os
from xml.etree import ElementTree
import json
# Import vendor modules from a subdirectory
here = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(here, "./vendored"))
import requests
from bs4 import BeautifulSoup
import boto3
if os.environ.get("IN_AWS", "false").lower() =... | {
"content_hash": "05ea679e49c94642b8612695d99a363e",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 90,
"avg_line_length": 33.97142857142857,
"alnum_prop": 0.5971404541631623,
"repo_name": "Vilsepi/infinimonkey",
"id": "b36a6db0e47d27bc552ed2ddf9a84006db9768d1",
"size": ... |
import sys
sys.path.append("..")
import iac.app.libreoffice.calc as localc
import iac.app.libreoffice.writer as lowriter
import iac.app.gnumeric as gnumeric
| {
"content_hash": "2a6b9c16bbc789fce403906b05167ede",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 45,
"avg_line_length": 26.333333333333332,
"alnum_prop": 0.7974683544303798,
"repo_name": "Risto-Stevcev/iac-protocol",
"id": "7bbb3b5d85af34030708742a7e660c283c7f0d0f",
"si... |
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/space/engine/shared_engine_overdriver_mk1.iff"
result.attribute_template_id = -1
result.stfName("string_id_table","")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "efddb4c564c38bb18850a8b085272f7c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 89,
"avg_line_length": 24.46153846153846,
"alnum_prop": 0.7012578616352201,
"repo_name": "obi-two/Rebelion",
"id": "dcd27a30341b9b32eb80d80dec8d30eb94c33b8c",
"size": "463"... |
import collections
import heapq
class Solution:
def maxProbability(self, n: int, edges: List[List[int]], succProb: List[float], start: int, end: int) -> float:
graph = collections.defaultdict(list)
for i, (a, b) in enumerate(edges):
graph[a].append((b, i))
graph[b].append((a,... | {
"content_hash": "16da4bbcf9423f8393848b2d301d6bfe",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 115,
"avg_line_length": 36.55,
"alnum_prop": 0.4911080711354309,
"repo_name": "jiadaizhao/LeetCode",
"id": "963f02bb1903c3900727752b049ce824ce287eb2",
"size": "731",
"bin... |
import mock
import yaml
from nailgun import objects
from nailgun.openstack.common import jsonutils
from nailgun.plugins import attr_plugin
from nailgun.test import base
def get_config(config):
def _get_config(*args):
return mock.mock_open(read_data=yaml.dump(config))()
return _get_config
class Base... | {
"content_hash": "5f274e3fae55bb12a1ec4e8a42b8aa8f",
"timestamp": "",
"source": "github",
"line_count": 287,
"max_line_length": 79,
"avg_line_length": 38.149825783972126,
"alnum_prop": 0.5656224312722623,
"repo_name": "andrei4ka/fuel-web-redhat",
"id": "70f30564084011a5e343320c1a8940eb348c0fdb",
"s... |
import json
import os
import cloudpickle
import sys
if __name__ == '__main__':
temp_dir = sys.argv[1]
with open(os.path.join(temp_dir, "args.pkl"), 'rb') as f:
args = cloudpickle.load(f)
with open(os.path.join(temp_dir, "target.pkl"), 'rb') as f:
target = cloudpickle.load(f)
history ... | {
"content_hash": "9d44c4d7218a4f8e8853425ccff9b6d3",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 80,
"avg_line_length": 27.2,
"alnum_prop": 0.5808823529411765,
"repo_name": "yangw1234/BigDL",
"id": "82db9efaa10b216591e0961a4101745ab75870c3",
"size": "1131",
"binary":... |
from unittest import TestCase
from testdoubles.utils import bind_function_to_object
from tests.common.compat import mock
class BindFunctionToObjectTestCase(TestCase):
def test_when_binding_a_function_to_an_object_it_is_available_for_the_object_instance(self):
def f(self):
pass
class ... | {
"content_hash": "223e17061a8e084494e4cb75a87bd2f9",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 99,
"avg_line_length": 25.47142857142857,
"alnum_prop": 0.6029164329781268,
"repo_name": "testsuite/testdoubles",
"id": "11af6157f3a1ca8b933be7a6b8edd5727ccde831",
"size": ... |
"""
# UI/UX Authoring Tool
# @license http://www.apache.org/licenses/LICENSE-2.0
# Author @ Jamil Hussain
"""
from django.shortcuts import render
from .forms import AppCreationForm
from .models import (App,ActionLog,Log)
from accounts.models import MyUser
from django.http import HttpResponseRedirect, Http404
from d... | {
"content_hash": "acae090d78b266f0b85b0fc9d93f33a9",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 195,
"avg_line_length": 37.49382716049383,
"alnum_prop": 0.6825814948962792,
"repo_name": "ubiquitous-computing-lab/Mining-Minds",
"id": "21dbc250e8ca67e431e51810e410da7251d8... |
class BaseFactoryGenerator():
def __init__(self):
self.data = None
self.namespace = None
def init(self, data, namespace):
self.data = data
self.namespace = namespace
def generate_import(self):
raise NotImplementedError()
def generate(self, data, namespace):
... | {
"content_hash": "ce6434c17f32f3bb1aff503f6ad668fa",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 40,
"avg_line_length": 24.7,
"alnum_prop": 0.631578947368421,
"repo_name": "HenrikPoulsen/Json2Class",
"id": "810bb378062053c1cee6391b6de813f30d3070cb",
"size": "495",
"b... |
"""Actions for the help menu.
"""
# Authors: Gael Varoquaux <gael.varoquaux[at]normalesup.org>
# Prabhu Ramachandran
# Copyright (c) 2007-2008, Enthought, Inc.
# License: BSD Style.
# Standard library imports.
from os import path
import os
import sys
from os.path import join, dirname
# Enthought library imp... | {
"content_hash": "45d1ac12c3e4cb78d974691f592be784",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 79,
"avg_line_length": 32.60952380952381,
"alnum_prop": 0.5286214953271028,
"repo_name": "dmsurti/mayavi",
"id": "526036ee2fb6fb1e9c4b7323e686fbc3064b1850",
"size": "3424"... |
"""
Script to scan Zephyr include directories and emit system call and subsystem metadata
System calls require a great deal of boilerplate code in order to implement
completely. This script is the first step in the build system's process of
auto-generating this code by doing a text scan of directories containing
C or ... | {
"content_hash": "5082171cbea93b5dd9647898bbe9b268",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 85,
"avg_line_length": 33.31972789115646,
"alnum_prop": 0.5822784810126582,
"repo_name": "finikorg/zephyr",
"id": "9994efdd2742d700ac0e82855924c4c1c018aa72",
"size": "5003... |
"""
To run this script, type
python buyLotsOfFruit.py
Once you have correctly implemented the buyLotsOfFruit function,
the script should produce the output:
Cost of [('apples', 2.0), ('pears', 3.0), ('limes', 4.0)] is 12.25
"""
fruitPrices = {'apples':2.00, 'oranges': 1.50, 'pears': 1.75,
'limes':0.... | {
"content_hash": "7894a47469940c4bf8c0e2ca52357b75",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 69,
"avg_line_length": 28.387096774193548,
"alnum_prop": 0.6227272727272727,
"repo_name": "lucasosouza/berkeleyAI",
"id": "8daab6b98772f3fb525699ebce1b95bf854da569",
"size"... |
class InfinityType:
def __repr__(self) -> str:
return "Infinity"
def __hash__(self) -> int:
return hash(repr(self))
def __lt__(self, other: object) -> bool:
return False
def __le__(self, other: object) -> bool:
return False
def __eq__(self, other: object) -> bool:... | {
"content_hash": "7c3b0a1b879005ca6efd1b8a133fb071",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 56,
"avg_line_length": 23.338709677419356,
"alnum_prop": 0.5639253628196268,
"repo_name": "martbhell/wasthereannhlgamelastnight",
"id": "951549753afa255148c7c60d868303963f8c1... |
!/usr/bin/env python
import smtplib
import json
from pprint import pprint
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
# Send a text message notifying them of a new song by artist (based on their choices)
# This opens json file containing needed values
# TODO: investigate IMAP
... | {
"content_hash": "0741d369548a053616315d13c77972a7",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 100,
"avg_line_length": 34.391304347826086,
"alnum_prop": 0.6390644753476612,
"repo_name": "ekrause/splatfilch",
"id": "78433444bb463bd81f56a126a32b1c0474dec693",
"size": "... |
"""Defines the base component class from which Landlab components inherit.
Base component class methods
++++++++++++++++++++++++++++
.. autosummary::
~landlab.core.model_component.Component.name
~landlab.core.model_component.Component.from_path
~landlab.core.model_component.Component.unit_agnostic
~l... | {
"content_hash": "f59191ea71ba623fb81cf964de6e8842",
"timestamp": "",
"source": "github",
"line_count": 466,
"max_line_length": 148,
"avg_line_length": 29.86266094420601,
"alnum_prop": 0.541966082207531,
"repo_name": "cmshobe/landlab",
"id": "d1801b4d8b5fa75b621b43d02a763f92369111f9",
"size": "1393... |
from toontown.parties import PartyGlobals
from toontown.parties.DistributedPartyDanceActivityBase import DistributedPartyDanceActivityBase
from toontown.toonbase import TTLocalizer
class DistributedPartyValentineDanceActivity(DistributedPartyDanceActivityBase):
notify = directNotify.newCategory('DistributedPartyVa... | {
"content_hash": "5b9e607be8c7b8ed2fd96a9f1c898b58",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 197,
"avg_line_length": 46.629629629629626,
"alnum_prop": 0.727561556791104,
"repo_name": "ToontownUprising/src",
"id": "d61d5e40f0b8a9954ba1d8295be46bca633ef8da",
"size": ... |
"""
This module provides a hook which generates a cucumber json result file at the end of the run.
"""
from getpass import getuser
from socket import gethostname
from datetime import timedelta
import re
import json
import logging
from radish.terrain import world
from radish.hookregistry import after
from radish.e... | {
"content_hash": "db0dfefc942972482d34fe87cf6ff410",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 117,
"avg_line_length": 39.205882352941174,
"alnum_prop": 0.5358839709927482,
"repo_name": "SamuelYvon/radish",
"id": "ccd2b452457831ac935fa9fb440df4dc43a4416a",
"size": "... |
import os
import sys
_SCRIPT_DIR = os.path.realpath(os.path.dirname(__file__))
_CHROME_SOURCE = os.path.realpath(
os.path.join(_SCRIPT_DIR, *[os.path.pardir] * 6))
sys.path.append(os.path.join(_CHROME_SOURCE, 'build/android/gyp'))
import argparse
import json
from util import build_utils
def process_emoticon_dat... | {
"content_hash": "1b1e891ceef575c4e9ca881fe67f0f8d",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 68,
"avg_line_length": 28.49230769230769,
"alnum_prop": 0.5680345572354212,
"repo_name": "scheib/chromium",
"id": "0848a76f02557185d5c72dabe64f26b8f9badfac",
"size": "2015"... |
from ccxt.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import AccountNotEnabled
from ccxt.base.errors import AccountSuspended
from ccxt.base.errors import ArgumentsRequired
fr... | {
"content_hash": "27f52842665adbc1440d6cb7798ea3e8",
"timestamp": "",
"source": "github",
"line_count": 1419,
"max_line_length": 514,
"avg_line_length": 42.68851303735025,
"alnum_prop": 0.4993974411886092,
"repo_name": "ccxt/ccxt",
"id": "9a4a071c079f657007adc480a908e122c0aa48bd",
"size": "60756",
... |
"""Unit tests for the write transform."""
import logging
import unittest
import apache_beam as beam
from apache_beam.io import iobase
from apache_beam.testing.test_pipeline import TestPipeline
from apache_beam.testing.util import assert_that, is_empty
from apache_beam.transforms.ptransform import PTransform
class ... | {
"content_hash": "a113a11e9176841b8a80afd0cc76762b",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 78,
"avg_line_length": 31.174311926605505,
"alnum_prop": 0.6839317245438493,
"repo_name": "yk5/beam",
"id": "50f0debb0a704d267fc0c390e189ec8934bd6701",
"size": "4182",
"... |
"""Classes related to Rivendell Artists.
Artist uses sqlalchemy to represent a single artist and various
aspects about it as used in the Scheduler.
"""
from sqlalchemy import Column
from sqlalchemy import Integer
from sqlalchemy import Unicode
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy i... | {
"content_hash": "1d7cc295b6d216554851ad27b6c3ae9b",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 87,
"avg_line_length": 30.028985507246375,
"alnum_prop": 0.6037644787644788,
"repo_name": "opensourceradio/ram",
"id": "eda170784051902cc3630adb43e4b6f9e861d7a1",
"size": ... |
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^instavent/', include('weekend.urls', namespace='instavent')),
url(r'^admin/', include(admin.site.urls)),
]
| {
"content_hash": "3d291ef8c1ab3ae175291054d04d48dc",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 72,
"avg_line_length": 30.571428571428573,
"alnum_prop": 0.705607476635514,
"repo_name": "ecatkins/week6weekend",
"id": "4f38bc441e45841cc56228e5e655c66d4e242d7b",
"size": "... |
from appengine.memcache.guestbook import main
from tests import DatastoreTestbedCase
import webapp2
class TestHandlers(DatastoreTestbedCase):
def test_hello(self):
# Build a request object passing the URI path to be tested.
# You can also pass headers, query arguments etc.
request = webap... | {
"content_hash": "fba96662218962f768877fcc7d6fb38b",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 67,
"avg_line_length": 33.5625,
"alnum_prop": 0.7001862197392924,
"repo_name": "EricYangzhiHong/python-docs-samples",
"id": "b9747929d070e49769b230bd4df3ec938bd1cc9b",
"siz... |
import json
import libvirt
import sys
from lxml import etree
from . import virt_ifaces
def _handle_event(conn, domain, event, detail, opaque):
msg = dict(
type='libvirt',
vm=dict(
name=domain.name(),
uuid=domain.UUIDString(),
uri=opaque['uri'],
),
... | {
"content_hash": "14e804d2188b63d7dbd88fdb05ac956a",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 73,
"avg_line_length": 28.119402985074625,
"alnum_prop": 0.5448513800424628,
"repo_name": "ceph/propernoun",
"id": "d54b642cb4ef14023be7fc26ca8f9a842e6fd206",
"size": "376... |
from __future__ import print_function
import sys
import argparse
import maskgen.scenario_model
from maskgen.graph_rules import processProjectProperties
from maskgen.batch import pick_projects, BatchProcessor
from maskgen.userinfo import get_username, setPwdX,CustomPwdX
from maskgen.validation.core import hasErrorMess... | {
"content_hash": "b9662aa380a31bf4d4585bfe6cb139cc",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 127,
"avg_line_length": 46.30337078651685,
"alnum_prop": 0.6918223732103859,
"repo_name": "rwgdrummer/maskgen",
"id": "c0ae73732af2457a6d7a8a8c62c62ec8e9d4f3bb",
"size": "4... |
import unittest
from pypika import (
Case,
Field,
Table,
functions as fn,
)
from pypika.terms import (
Negative,
ValueWrapper,
)
class IsAggregateTests(unittest.TestCase):
def test__field_is_not_aggregate(self):
v = Field("foo")
self.assertFalse(v.is_aggregate)
def te... | {
"content_hash": "51c219f13fed0502b16eaa79151ee166",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 119,
"avg_line_length": 32.34426229508197,
"alnum_prop": 0.5884439939178915,
"repo_name": "kayak/pypika",
"id": "1c627d8e9c2d65410c67cf2c39974949b0720a0e",
"size": "3946",... |
import sys
import matplotlib
from matplotlib import style
import cloudside
matplotlib.use("agg")
style.use("classic")
if "--strict" in sys.argv:
sys.argv.remove("--strict")
status = cloudside.teststrict(*sys.argv[1:])
else:
status = cloudside.test(*sys.argv[1:])
sys.exit(status)
| {
"content_hash": "22e4b5616f23eb8cb591f832d5787136",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 48,
"avg_line_length": 18.5,
"alnum_prop": 0.706081081081081,
"repo_name": "phobson/cloudside",
"id": "e0232b22e356c82bd6b1e186277f01690dc7c00c",
"size": "296",
"binary":... |
"""
Check for unique lists within an array
"""
def unique_list(array, elements_to_check=0):
"""
:param array: Array of lists to be checked
:param elements_to_check: range of numbers corresponding to indices of list
:return: new unique array
"""
n_rows = len(array)
unique_array = []
... | {
"content_hash": "1062bbba3de15aa9c737e84d5ba6f0cf",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 102,
"avg_line_length": 18.46153846153846,
"alnum_prop": 0.525,
"repo_name": "nitikayad96/chandra_suli",
"id": "b1eea5882475eb66db26bc598f49ab9ae42adc75",
"size": "1200",
... |
import RPi.GPIO as GPIO
import time
import queue as Queue # https://pymotw.com/2/Queue/
from functools import partial
from threading import Thread
#------------------------------------------------------------------------
# use the raspi board pin number
#GPIO.setmode(GPIO.BOARD)
# use the gpio number
GPIO.setmode(GPIO... | {
"content_hash": "eb600f472f4e36f816e16e426c7e91e9",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 122,
"avg_line_length": 28.666666666666668,
"alnum_prop": 0.5593023255813954,
"repo_name": "meigrafd/Sample-Code",
"id": "513a0cf19adf5e14363fca60a8e4431a2574583d",
"size":... |
from google.cloud import monitoring_v3
def sample_get_alert_policy():
# Create a client
client = monitoring_v3.AlertPolicyServiceClient()
# Initialize request argument(s)
request = monitoring_v3.GetAlertPolicyRequest(
name="name_value",
)
# Make the request
response = client.get_... | {
"content_hash": "2c53e5779f55dcc0ff580b64527c7b64",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 70,
"avg_line_length": 24.68421052631579,
"alnum_prop": 0.7164179104477612,
"repo_name": "googleapis/python-monitoring",
"id": "a9ee89a26f46f36e41f47f8f7400b36a20cbef79",
"... |
"""@package src.wi.views.user.user
@author Piotr Wójcik
@date 31.01.2014
"""
from django.contrib import messages
from django.shortcuts import render_to_response, redirect
from django.template import RequestContext
from django.template.loader import render_to_string
from django.utils.translation import ugettext as _
f... | {
"content_hash": "e6df216b37579c8ef7411ba725715d62",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 125,
"avg_line_length": 37.07954545454545,
"alnum_prop": 0.6259577076310144,
"repo_name": "cc1-cloud/cc1",
"id": "779ca94f3295938fb0f803a6dd3397114bd47169",
"size": "7225"... |
"""
Django settings for elf project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import... | {
"content_hash": "e30896971a8b213804fefc4120628064",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 82,
"avg_line_length": 24.605263157894736,
"alnum_prop": 0.6898395721925134,
"repo_name": "KellyChan/python-examples",
"id": "5cf98149275ef38328bbf5342a0a6a5acadd1d0f",
"s... |
from tapiriik.services.ratelimiting import RateLimit, RateLimitExceededException
from tapiriik.services.api import ServiceException, UserExceptionType, UserException
class ServiceAuthenticationType:
OAuth = "oauth"
UsernamePassword = "direct"
class InvalidServiceOperationException(Exception):
pass
class ... | {
"content_hash": "eb5fbc22575873c22c0f8760dfef6f81",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 124,
"avg_line_length": 36.100628930817614,
"alnum_prop": 0.7369337979094077,
"repo_name": "cgourlay/tapiriik",
"id": "513a6f53e38a97b3f7e488528b3abdebea9dbc97",
"size": "... |
import warnings
from pathlib import Path
import matplotlib.pyplot as plt
import pytest
import pandas as pd
from plotnine import (ggplot, aes, geom_text, geom_point, facet_wrap,
ggsave, theme_xkcd)
from plotnine.data import mtcars
from plotnine.exceptions import PlotnineError, PlotnineWarning
p ... | {
"content_hash": "cdb40221692fa83bd756a91ce494a3d7",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 73,
"avg_line_length": 29.34013605442177,
"alnum_prop": 0.5981915140273592,
"repo_name": "has2k1/plotnine",
"id": "e733ecea3442bb7fee0c699175556aa7d3bbba6e",
"size": "4313... |
import json
from base64 import b64encode
from beanstalk_dispatch import ARGS
from beanstalk_dispatch import FUNCTION
from beanstalk_dispatch import KWARGS
from beanstalk_dispatch.common import create_request_body
from django.core.urlresolvers import reverse
from django.test import Client
from django.test import TestCa... | {
"content_hash": "2ebeaa97dd3ed2f5a9bf284b51be2d56",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 79,
"avg_line_length": 35.771929824561404,
"alnum_prop": 0.6074055909759686,
"repo_name": "Sonblind/orchestra",
"id": "500189f9f428e8025f869619dc7830904facbb57",
"size": "... |
import unittest
import numpy
import six
import chainer
from chainer import backend
from chainer.backends import cuda
from chainer import gradient_check
from chainer import initializers
from chainer import links
from chainer import memory_layouts
from chainer import testing
from chainer.testing import attr
from chaine... | {
"content_hash": "6a1c017feef8e81ec5ff175360235fcd",
"timestamp": "",
"source": "github",
"line_count": 774,
"max_line_length": 79,
"avg_line_length": 33.622739018087856,
"alnum_prop": 0.6077851214263756,
"repo_name": "pfnet/chainer",
"id": "b4bf70ae5ec5320ba58409c9a01267828e3102db",
"size": "26024... |
import mock
import pytest
from future.moves.urllib.parse import quote
from django.utils import timezone
from django.core.exceptions import MultipleObjectsReturned
from osf.models import Guid, NodeLicenseRecord, OSFUser
from osf_tests.factories import AuthUserFactory, UserFactory, NodeFactory, NodeLicenseRecordFactory,... | {
"content_hash": "cb5ecb089e7d80ed9906f4f305dddc81",
"timestamp": "",
"source": "github",
"line_count": 461,
"max_line_length": 212,
"avg_line_length": 42.23644251626898,
"alnum_prop": 0.6343279749370859,
"repo_name": "aaxelb/osf.io",
"id": "d3b5d9bd87a8636745bd21225f0db7296d09ce1e",
"size": "19471... |
import os
PROJECT_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
print PROJECT_ROOT
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_... | {
"content_hash": "76cf0014e92590940dbaa604ab669769",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 127,
"avg_line_length": 32.733333333333334,
"alnum_prop": 0.6860149355057705,
"repo_name": "bajubullet/twitter-clone",
"id": "53d1fd669f0476b98c67cb5e715079dc0e4354c3",
"s... |
"""Test class for Fake driver."""
import mock
from ironic.common import boot_devices
from ironic.common import driver_factory
from ironic.common import exception
from ironic.common import states
from ironic.conductor import task_manager
from ironic.drivers import base as driver_base
from ironic.tests.unit.conductor i... | {
"content_hash": "67daca29980a070b1fa94827670a3c87",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 79,
"avg_line_length": 41.242990654205606,
"alnum_prop": 0.6798096532970768,
"repo_name": "ruyang/ironic",
"id": "c0a849f5a522cb49a458ed62d569d0e1538ee057",
"size": "5086"... |
import os
import sys
from utdirect.utils import setup_extra
# If you use an 'extra' folder with svn externals, uncomment the following lines:
#CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
#setup_extra(os.path.join(CURRENT_DIR, 'extra'))
import settings
if __name__ == "__main__":
os.environ.setdefault... | {
"content_hash": "6b862ccd433a08086e10063394ddb7db",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 81,
"avg_line_length": 32.10526315789474,
"alnum_prop": 0.7016393442622951,
"repo_name": "jeffles/LI",
"id": "276060fd6e6f04dc1e3f2a462089afca05621c54",
"size": "632",
"b... |
'''
File: statistics.py
Author: Oliver Zscheyge
Description:
Collection of statistics functions.
'''
import math
def mean(values, ndigits=None):
"""
Return:
Mean of values, rounded to ndigits.
"""
n = len(values)
if n == 0:
raise ValueError(u"Can't compute mean over empty lis... | {
"content_hash": "03266651e910dd3fc4d519ec74214fb6",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 95,
"avg_line_length": 29.4375,
"alnum_prop": 0.6060054595086443,
"repo_name": "ooz/Confopy",
"id": "1bcf618b8baf446984bfce0d820c06c28cde07e5",
"size": "3313",
"binary":... |
r"""Train Onsets and Frames piano transcription model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from magenta.common import tf_utils
from magenta.models.onsets_frames_transcription import constants
from magenta.models.onsets_frames_trans... | {
"content_hash": "fe2aa84fed487aa46c4ad517bb81711f",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 79,
"avg_line_length": 31.410958904109588,
"alnum_prop": 0.6916703009158308,
"repo_name": "adarob/magenta",
"id": "9422fb329157f94caacef498e23e2cd70cc983bd",
"size": "2878"... |
import json
import os
import random
import unittest
import warnings
from copy import deepcopy
import numpy as np
from scipy.misc import central_diff_weights
from pymatgen.analysis.elasticity.elastic import (
ComplianceTensor,
ElasticTensor,
ElasticTensorExpansion,
NthOrderElasticTensor,
diff_fit,
... | {
"content_hash": "bed3b84c9bfdfab6ae0e3ef6915496f9",
"timestamp": "",
"source": "github",
"line_count": 478,
"max_line_length": 118,
"avg_line_length": 44.44979079497908,
"alnum_prop": 0.5946251235468537,
"repo_name": "davidwaroquiers/pymatgen",
"id": "db305bdaf5d12e6a82e74e43c49cc61d6e8494f2",
"si... |
import re
import six
from cassandra.util import OrderedDict
from cassandra.cqlengine import CQLEngineException
from cassandra.cqlengine import columns
from cassandra.cqlengine import connection
from cassandra.cqlengine import models
class UserTypeException(CQLEngineException):
pass
class UserTypeDefinitionExce... | {
"content_hash": "8a17b9a0683b679c2a51bc979cc6e056",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 124,
"avg_line_length": 30.524509803921568,
"alnum_prop": 0.5829452384775976,
"repo_name": "jregovic/python-driver",
"id": "88ec033ba8e26600349f385cebd97b04e3e96eec",
"siz... |
from rest_framework import viewsets
from rest_framework import pagination
from django_filters.rest_framework import DjangoFilterBackend
from .models import SkosConcept, SkosConceptScheme, SkosLabel, SkosNamespace
from .serializers import (
SkosLabelSerializer, SkosNamespaceSerializer, SkosConceptSchemeSerializer, S... | {
"content_hash": "94a4eb0c27ad0674318b6c9202e94632",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 100,
"avg_line_length": 31.333333333333332,
"alnum_prop": 0.8028368794326242,
"repo_name": "acdh-oeaw/vhioe",
"id": "6264881fd6db04c6b802fd4a6f639f65fadac7f1",
"size": "141... |
from ..helpers.search_helpers import get_filters_from_request
def sections_for_lot(lot, builder):
if lot is None or lot == 'all':
sections = builder.filter(
{'lot': 'iaas'}).filter(
{'lot': 'paas'}).filter(
{'lot': 'saas'}).filter(
{'lot': 'scs'}).sections
... | {
"content_hash": "f758565c69eac4184a48278cb434e56e",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 63,
"avg_line_length": 29.256756756756758,
"alnum_prop": 0.5108545034642032,
"repo_name": "AusDTO/dto-digitalmarketplace-buyer-frontend",
"id": "56c82725fb620d1c30758d485f196... |
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
from mse.constants import *
from mse.charset import fix_charset_collation
class EqualityMixin:
def __eq__(self, other):
return (type(other) is type(self)) and self.__dict__ == other.__dict__
def _... | {
"content_hash": "f46c42d4316cf2e01d0094e931ac9498",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 114,
"avg_line_length": 34.42857142857143,
"alnum_prop": 0.5887234561874543,
"repo_name": "frail/mysql-size-estimator",
"id": "11d51ce66d2d64bca35238a2556a5648331cc6b1",
"... |
import json
import httpretty
import pytest
import pypuppetdb
def stub_request(url, data=None, method=httpretty.GET, status=200, **kwargs):
if data is None:
body = '[]'
else:
with open(data, 'r') as d:
body = json.load(d.read())
return httpretty.register_uri(method, url, body=... | {
"content_hash": "f5ffe2efaa564ea8200f2923c23d7c2a",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 78,
"avg_line_length": 32.488,
"alnum_prop": 0.5685791676926866,
"repo_name": "puppet-community/pypuppetdb",
"id": "7c38c2fccbad5a8596bb1c392730c1528503e293",
"size": "406... |
from gnuradio import blocks
from gnuradio import eng_notation
from gnuradio import fft
from gnuradio import gr
from gnuradio import uhd
from gnuradio.eng_option import eng_option
from gnuradio.fft import window
from gnuradio.filter import firdes
from optparse import OptionParser
import time
class SALSA_eceiver(gr.top_... | {
"content_hash": "300a5fcf2c588a64c2b94bd2b537911d",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 100,
"avg_line_length": 35.09345794392523,
"alnum_prop": 0.5736351531291611,
"repo_name": "varenius/salsa",
"id": "4ebe7333ca04f08fbc730656e2f2def3514b7a7a",
"size": "3970... |
from __future__ import absolute_import
from zerver.lib.actions import check_send_message
from zerver.lib.response import json_success
from zerver.decorator import REQ, has_request_variables, api_key_only_webhook_view
import pprint
import ujson
from typing import Dict, Any
PAGER_DUTY_EVENT_NAMES = {
'incident.tri... | {
"content_hash": "7703ff5477dc5f95588136dee2239dd5",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 116,
"avg_line_length": 44.33613445378151,
"alnum_prop": 0.6432903714935557,
"repo_name": "peiwei/zulip",
"id": "ad33a8c1b9b8b8beecbfb668fd01e324795e4e6f",
"size": "5314",... |
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
# Examples:
# url(r'^$', 'aboyunapp.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
]
| {
"content_hash": "258624370627307113bd7ef5e36da35d",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 54,
"avg_line_length": 25.7,
"alnum_prop": 0.6342412451361867,
"repo_name": "markessien/aboyun",
"id": "f924c5d64fed4730fdbef0dc5b9b91b43d9a4867",
"size": "257",
"binary"... |
from __future__ import (unicode_literals, division, absolute_import, print_function)
from powerline.lib.watcher import create_file_watcher
def list_segment_key_values(segment, theme_configs, segment_data, key, function_name=None, name=None, module=None, default=None):
try:
yield segment[key]
except KeyError:
p... | {
"content_hash": "eb57ff897bfe8617ebb04e23b3633172",
"timestamp": "",
"source": "github",
"line_count": 449,
"max_line_length": 129,
"avg_line_length": 29.971046770601337,
"alnum_prop": 0.669242773277848,
"repo_name": "prvnkumar/powerline",
"id": "e48689b58de69f05690863d8ae87055cb11579d2",
"size": ... |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.pr... | {
"content_hash": "f3dd64512963443be1c595df4d3324b0",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 332,
"avg_line_length": 37.943820224719104,
"alnum_prop": 0.7234231566479123,
"repo_name": "ryfeus/lambda-packs",
"id": "81c992016e087438c9e481dea6ee33d5c5963f7c",
"size": ... |
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Get-WMIRegCachedRDPConnection',
'Author': ['@harmj0y'],
'Description': ('Uses remote registry functionality to query all entries for the '
... | {
"content_hash": "55717764accad42b199d585de83a6a87",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 121,
"avg_line_length": 34.43478260869565,
"alnum_prop": 0.51010101010101,
"repo_name": "EmpireProject/Empire",
"id": "7342618da523efb15c195c7917417ce0414511b9",
"size": "3... |
from __future__ import division
import json
import os
import os.path
# third party imports
import wx
# pyspend imports
import db
import gui
CONFIG = 'config.json'
OPEN = 0
SAVE = 1
def run():
spend = PySpend(redirect=False)
spend.MainLoop()
class PySpend(wx.App):
def OnInit(self):
self.config = s... | {
"content_hash": "e6dcfba12d27bb772f651ec4925bbe8e",
"timestamp": "",
"source": "github",
"line_count": 264,
"max_line_length": 88,
"avg_line_length": 32.89393939393939,
"alnum_prop": 0.5513588208198986,
"repo_name": "PreludeAndFugue/PySpend",
"id": "08e098ec28a497a6dd79e4f6cd027d4a5eea21bb",
"size... |
"""Device and network emulation utilities via devtools."""
import json
# Copied from
# WebKit/Source/devtools/front_end/network/NetworkConditionsSelector.js
# Units:
# download/upload: byte/s
# latency: ms
NETWORK_CONDITIONS = {
'GPRS': {
'download': 50 * 1024 / 8, 'upload': 20 * 1024 / 8, 'latency': ... | {
"content_hash": "745e5bd362ad4fd909a7d7194fae1f19",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 80,
"avg_line_length": 33.15,
"alnum_prop": 0.6435394670688789,
"repo_name": "junhuac/MQUIC",
"id": "d7f05c6284b8234f4230449a62851695786b5264",
"size": "4141",
"binary":... |
import socket, threading, random, multiprocessing, time
def processClient(client, address):
print('In', threading.currentThread().name, 'client descriptor', client, 'client address', address)
client.send(b' Welcome to this server')
while True:
data = client.recv(1024)
print('-> ... | {
"content_hash": "068021cb731d91a3d152bf600558a4bc",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 103,
"avg_line_length": 31.666666666666668,
"alnum_prop": 0.5645933014354066,
"repo_name": "JShadowMan/package",
"id": "b040536be1c9a4676a6f4fcc9ec16f200297572b",
"size": "... |
"""Stand-alone fitting utilities"""
import numpy as np
from scipy.special import gamma, psi
from ..misc import easylsq
from ..misc.errorvalue import ErrorValue
__all__ = ['fit_shullroess']
def fit_shullroess(q, Intensity, Error, R0=None, r=None):
"""Do a Shull-Roess fitting on the scattering data.
Inputs:
... | {
"content_hash": "4766270198123825011eada946eb8169",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 150,
"avg_line_length": 40.103092783505154,
"alnum_prop": 0.5727506426735218,
"repo_name": "awacha/sastool",
"id": "1f5e84a87c760529817ee49c1d1c9839f285a0b2",
"size": "3890... |
'''
This script parses uni-math symbols from
http://milde.users.sourceforge.net/LUCR/Math/data/unimathsymbols.txt
and save the result as a json file.
The result is used to generate command intellisense for LaTeX Workshop.
'''
import json
def remove_relation_character(description):
"""
From unimathsymbols.txt
... | {
"content_hash": "81183f7401fddca552db7eff82d60abc",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 84,
"avg_line_length": 35.1044776119403,
"alnum_prop": 0.5846088435374149,
"repo_name": "James-Yu/LaTeX-Workshop",
"id": "665d69c353a7847bd949ce50aa11d14eb4e6efb3",
"size":... |
__author__ = 'frank'
import zstacklib.utils.daemon as daemon
import zstacklib.utils.http as http
import zstacklib.utils.log as log
import zstacklib.utils.shell as shell
import zstacklib.utils.iptables as iptables
import zstacklib.utils.jsonobject as jsonobject
import zstacklib.utils.lock as lock
import zstacklib.utils... | {
"content_hash": "9c66addb10ee0977463663e4876a9435",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 95,
"avg_line_length": 28.457142857142856,
"alnum_prop": 0.6470883534136547,
"repo_name": "live4thee/zstack-utility",
"id": "531074f1e2809cb45dac4f18383a45cc594ef0b0",
"siz... |
import pygame
class Message(pygame.sprite.Sprite):
"""A class som simplify message writing."""
align_left = 'left';
align_right = 'right';
align_center = 'center';
def __init__(self, msglist, title=None, rect=None, vector=(0,0), align=align_left, linepadding=0.1,
padding=0.1, ... | {
"content_hash": "3d7810b2bb3ae72ac48f1e467b99f3c8",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 126,
"avg_line_length": 44.15533980582524,
"alnum_prop": 0.5756376429199648,
"repo_name": "khan-git/pialarmclock",
"id": "3d217d6ce3ee6b2e8b1705c42de820b057cbf361",
"size"... |
import yaml
from argparse import ArgumentParser
from constants import GOOGLE_CLOUD_TEST
from dict_util import deep_get
from yaml_util import load_resources_yaml
''' Remove all resources considered to be Kuberenetes Helm tests from
a given manifest file. '''
_HELM_HOOK_KEY = 'helm.sh/hook'
_HOOK_SUCCESS = 'test... | {
"content_hash": "1a1471ebafa558326ea80ee6d6734d40",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 111,
"avg_line_length": 31.64,
"alnum_prop": 0.6877370417193426,
"repo_name": "cliveseldon/marketplace-k8s-app-tools",
"id": "9a6388fa6c5a069e62d5e2fa1fd80b29a7fb6ae2",
"si... |
__author__ = 'scarroll'
from pygov.usda.enums import *
from pygov.usda.domain import Nutrient, Food, FoodReport
from pygov.base.client import DataGovClientBase, get_response_data
class UsdaClient(DataGovClientBase):
def __init__(self, api_gov_key):
super(UsdaClient, self).__init__('usda/', api_gov_key)
... | {
"content_hash": "4d789f0ef18c4cf7e46313341fe6cd17",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 143,
"avg_line_length": 44.734693877551024,
"alnum_prop": 0.6747262773722628,
"repo_name": "skeryl/pygov",
"id": "4fe20b2f87185031a7a73ca455ee954a8f6e9774",
"size": "2192",... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cbh_chembl_model_extension', '0019_auto_20150721_0515'),
]
operations = [
migrations.RemoveField(
model_name='skinningconfig',
... | {
"content_hash": "b81bb07e89dd0142bb8b7bdabbbc20e0",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 66,
"avg_line_length": 21.11764705882353,
"alnum_prop": 0.6128133704735376,
"repo_name": "thesgc/cbh_chembl_model_extension",
"id": "cba303ffb7c08c7a7404e7e077d732d46c1f9256"... |
"""
Python API for KB SRU
"""
import sys
import urllib
import requests
from lxml import etree
SRU_BASEURL = 'http://jsru.kb.nl/sru/sru'
SRU_BASEURL += '?version=1.2&maximumRecords=%i'
SRU_BASEURL += '&operation=searchRetrieve'
SRU_BASEURL += '&startRecord=%i'
SRU_BASEURL += '&recordSchema=%s'
SRU_BASEURL += '&x-colle... | {
"content_hash": "ac41b440b1d784cc69f13a1c0f788d1b",
"timestamp": "",
"source": "github",
"line_count": 344,
"max_line_length": 106,
"avg_line_length": 36.633720930232556,
"alnum_prop": 0.5153943818441518,
"repo_name": "KBNLresearch/omSipCreator",
"id": "4d986bc4e8b34e71f5af799c5a0cb6fff78aa276",
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.