text stringlengths 4 1.02M | meta dict |
|---|---|
"""This module exports the Lua plugin class."""
from SublimeLinter.lint import Linter, util
class GLua(Linter):
"""Provides an interface to gluac -p."""
syntax = 'lua'
cmd = 'gluac -p * -'
regex = r'^.+?:.+?:(?P<line>\d+): (?P<message>.+?(?:near (?P<near>\'.+\')|$))'
error_stream = util.STREAM_... | {
"content_hash": "0a8940852ead6dc7ace89dc843644fa0",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 82,
"avg_line_length": 25.153846153846153,
"alnum_prop": 0.5718654434250765,
"repo_name": "glua/SublimeLinter-contrib-glua",
"id": "87e4c0439ef216f56a61261b7f0dc45bc96ed179",... |
from __future__ import with_statement
import contextlib
from _Framework.Util import product
from _Framework.EncoderElement import EncoderElement
from _Framework.SubjectSlot import SubjectEvent
from _Framework.Signal import Signal
from _Framework.NotifyingControlElement import NotifyingControlElement
from _Framework.... | {
"content_hash": "23df4212d1f591d215e8e9b597e4a650",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 96,
"avg_line_length": 28.598765432098766,
"alnum_prop": 0.7034319015756529,
"repo_name": "LividInstruments/LiveRemoteScripts",
"id": "c43d9ceead53d184b470b6422370967d46d747... |
"""Example DAG demonstrating the usage of the PythonOperator."""
import time
from pprint import pprint
from airflow import DAG
from airflow.operators.python import PythonOperator, PythonVirtualenvOperator
from airflow.utils.dates import days_ago
args = {
'owner': 'airflow',
}
with DAG(
dag_id='example_python... | {
"content_hash": "dde8f341ecffc54f889f5ca5a14766fb",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 84,
"avg_line_length": 30.31168831168831,
"alnum_prop": 0.6323907455012854,
"repo_name": "sekikn/incubator-airflow",
"id": "a9db34254ebcc5227ccd03f09d0eb31cf8998aa1",
"size... |
"""Starter script for Nova API.
Starts both the EC2 and OpenStack APIs in separate greenthreads.
"""
import sys
from oslo_config import cfg
from oslo_log import log as logging
from nova import config
from nova import objects
from nova import service
from nova import utils
CONF = cfg.CONF
CONF.import_opt('enabled_... | {
"content_hash": "3df90c2a95796e808895a44a55f5dc03",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 69,
"avg_line_length": 26.594594594594593,
"alnum_prop": 0.6626016260162602,
"repo_name": "apporc/nova",
"id": "75e11be8e6daded9ec6de171e8f1d2972394ce03",
"size": "1715",
... |
"""empty message
Revision ID: 3cea1b2cfa
Revises: 42b10177639f
Create Date: 2013-05-05 17:07:07.392602
"""
# revision identifiers, used by Alembic.
revision = '3cea1b2cfa'
down_revision = '42b10177639f'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.add_column('party', sa.Column('logo', sa.St... | {
"content_hash": "889be7791911b0985f362b0c860c1f1c",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 84,
"avg_line_length": 19.523809523809526,
"alnum_prop": 0.7195121951219512,
"repo_name": "teampopong/pokr.kr",
"id": "385b9ee54853f9273bfb31ce0eb615d24f2eedc3",
"size": "4... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^weixin/admin/', include(admin.site.urls)),
url(r'^weixin/', include('weisite.urls')),
)
| {
"content_hash": "b9c0aea444d3e5d6107d73c7db94441b",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 53,
"avg_line_length": 26.444444444444443,
"alnum_prop": 0.7100840336134454,
"repo_name": "cnwarden/wei123",
"id": "549ac9fcf09f1af9ec98478d0e1854ddea634912",
"size": "238",... |
"""
=============
A-V sync test
=============
This example tests synchronization between the screen and the auditory/visual
playback. If a given machine (experimenta or development) is configured
correctly:
1. The inter-flip interval should be ``1 / refresh_rate``, i.e., ~16 ms for
a 60 Hz display.
2. The red rect... | {
"content_hash": "b810b656f8ad1e8f8ddd5bf73d627689",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 79,
"avg_line_length": 37.506493506493506,
"alnum_prop": 0.6644736842105263,
"repo_name": "drammock/expyfun",
"id": "bbf181f35bc1cee7a653bf535b8dd7ca7874d927",
"size": "288... |
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/item/shared_item_clothing_station.iff"
result.attribute_template_id = -1
result.stfName("string_id_table","")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "2444b5a3e49ac79009268642ee3ccd2b",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 81,
"avg_line_length": 23.846153846153847,
"alnum_prop": 0.6967741935483871,
"repo_name": "anhstudios/swganh",
"id": "cb5c8d8585e30432d3722f334ef9a535d052707f",
"size": "45... |
import unittest
import gym
import numpy as np
import ray
from ray.rllib.policy.sample_batch import SampleBatch
from ray.rllib.utils.framework import try_import_tf, try_import_torch
from ray.rllib.utils.numpy import convert_to_numpy
from ray.rllib.utils.torch_utils import convert_to_torch_tensor
from ray.rllib.algorit... | {
"content_hash": "4726a4380d4210ca3e57a75dc2c8b44c",
"timestamp": "",
"source": "github",
"line_count": 301,
"max_line_length": 87,
"avg_line_length": 34.69435215946844,
"alnum_prop": 0.5338504261227617,
"repo_name": "ray-project/ray",
"id": "a08eee880bab3c21d06da6c8b756443cb8289c24",
"size": "1044... |
import sys
import io
import versioneer
versioneer.VCS = 'git'
versioneer.versionfile_source = 'teensyio/_version.py'
versioneer.versionfile_build = 'teensyio/_version.py'
versioneer.tag_prefix = '' # tags are like 1.2.0
versioneer.parentdir_prefix = 'teensyio-' # dirname like 'myproject-1.2.0'
try:
from setupto... | {
"content_hash": "17ad30a559ac734cd07b56260e70ae9d",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 91,
"avg_line_length": 34.266666666666666,
"alnum_prop": 0.6697470817120622,
"repo_name": "ryanpdwyer/teensyio",
"id": "ec9e1213ecc5e494e4cedfb14ef2ccebb553ffc9",
"size": "... |
from django.conf import settings
#See http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html for all settings
CKEDITOR_SETTINGS = getattr(settings, 'CKEDITOR_SETTINGS', {
'language': '{{ language }}',
'toolbar': 'CMS',
'skin': 'moono',
# 'stylesSet': [
# {'name': 'Custom Style', 'ele... | {
"content_hash": "4cd4b4cb67f9d6ab07a25b3ba236ae70",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 134,
"avg_line_length": 36.13333333333333,
"alnum_prop": 0.6660516605166051,
"repo_name": "timgraham/djangocms-text-ckeditor",
"id": "07c2d160ed0e0754a577fcc9275caf00cfd1af47... |
import json
from tempest.common.rest_client import RestClient
class HypervisorV3ClientJSON(RestClient):
def __init__(self, config, username, password, auth_url, tenant_name=None):
super(HypervisorV3ClientJSON, self).__init__(config, username,
password... | {
"content_hash": "02cc0d211b43776e865e5a8660143388",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 79,
"avg_line_length": 39.44444444444444,
"alnum_prop": 0.612206572769953,
"repo_name": "armando-migliaccio/tempest",
"id": "fa1255a5e00573e3f7c8e7922ef5ff3e28dc5410",
"siz... |
import sys
import time
import nagios_common
import switchvox_common
import logging
logging.basicConfig(level=logging.WARNING)
class SwitchvoxNagiosInterface(object):
"""
Basic, standard, foundatoin of switchvox-nagios plugin object.
"""
# Set it as a class variable. Should be more than fine.
@cl... | {
"content_hash": "d564ff736e73da6fac641dd2c5ceceac",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 94,
"avg_line_length": 32.18260869565217,
"alnum_prop": 0.5711969737908673,
"repo_name": "psywhale/pyswitchvox",
"id": "ddde6ebf72bdfea28f1f9223231ed96916275048",
"size": ... |
import django_filters
from django.contrib.auth.models import User, Group
from rest_framework import viewsets, mixins
from rest_framework.response import Response
from rest_framework.authentication import TokenAuthentication
from rest_framework import filters
from api.pagination import LargeResultsSetPagination
from api... | {
"content_hash": "1776e4c798003220dac320fd06ae69ed",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 95,
"avg_line_length": 37.68,
"alnum_prop": 0.7887473460721869,
"repo_name": "Oinweb/py-fly",
"id": "2baa430e5898483ee927bc9dde5317a8928b12b5",
"size": "942",
"binary": f... |
from flask.ext.wtf import Form
from wtforms import StringField, PasswordField, BooleanField, SubmitField
from wtforms.validators import Required, Length, Email, Regexp, EqualTo
from wtforms import ValidationError
from ..models import User
class LoginForm(Form):
email = StringField('Email', validators=[Required(),... | {
"content_hash": "1425e57c0abea828cac95517f68a9ed9",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 78,
"avg_line_length": 43.59722222222222,
"alnum_prop": 0.6259955399808856,
"repo_name": "oztalha/dd-css",
"id": "68e51b4aaf6f946e5c2a2df5a392be03d4e58cd9",
"size": "3139",... |
from codecs import open
import os
import re
from setuptools import setup
with open(os.path.join('tr', '__init__.py'), 'r', encoding='utf8') as f:
version = re.compile(
r".*__version__ = '(.*?)'", re.S).match(f.read()).group(1)
setup(
name='python-tr',
packages=['tr'],
version=version,
lice... | {
"content_hash": "08a7a6e3a8fb622a54cbd32ea98dbcc1",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 79,
"avg_line_length": 37.3421052631579,
"alnum_prop": 0.5835095137420718,
"repo_name": "ikegami-yukino/python-tr",
"id": "9259e514b735f0f0c011159f4ed8a9703ef3db51",
"size"... |
from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.db import models
class Site(models.Model):
url = models.CharField(max_length=100)
class User(models.Model):
username = models.CharField(max_length=100)
c... | {
"content_hash": "c4331853d5bc1354f84d03cd390fde18",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 81,
"avg_line_length": 23.803571428571427,
"alnum_prop": 0.7096774193548387,
"repo_name": "dynamomobile/drf-writable-nested",
"id": "ae8e28068ab55ad46fa2d234979d610cdb727ee5"... |
import calvin.runtime.south.calvinsys.ui.uicalvinsys as ui
from calvin.runtime.south.calvinsys import base_calvinsys_object
class StandardOut(base_calvinsys_object.BaseCalvinsysObject):
"""
StandardOut - Virtual console device.
"""
init_schema = {
"type": "object",
"properties": {
... | {
"content_hash": "2af9f23f24dc54689626c289f148edb1",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 85,
"avg_line_length": 27.50943396226415,
"alnum_prop": 0.5294924554183813,
"repo_name": "EricssonResearch/calvin-base",
"id": "e7f1d5987a0661d710d05a79d918ae5021398c7d",
"... |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import uuid
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
... | {
"content_hash": "b1ea99e08025faf718595d2b27b8f43c",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 160,
"avg_line_length": 41.407407407407405,
"alnum_prop": 0.6135957066189625,
"repo_name": "Socialsquare/RunningCause",
"id": "8ef628ba127f30395145bf427a274726dbb7e21f",
"s... |
import _plotly_utils.basevalidators
class YanchorValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="yanchor", parent_name="densitymapbox.colorbar", **kwargs
):
super(YanchorValidator, self).__init__(
plotly_name=plotly_name,
pa... | {
"content_hash": "f2410aadb19362d27aca11d73a3e59cb",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 83,
"avg_line_length": 36.07142857142857,
"alnum_prop": 0.6059405940594059,
"repo_name": "plotly/plotly.py",
"id": "1e3e73b8133a60efe1245f2754f0dbf8e0a3cd6d",
"size": "505"... |
import django_filters
from rest_framework import filters
from bulbs.super_features.utils import get_superfeature_model
SUPERFEATURE_MODEL = get_superfeature_model()
def filter_status(queryset, value):
if not value:
return queryset
else:
# NOTE: this list comprehension is happening because
... | {
"content_hash": "2b277b1c5bbe14bb01785c8d6e9fbfb1",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 61,
"avg_line_length": 27.96,
"alnum_prop": 0.6824034334763949,
"repo_name": "theonion/django-bulbs",
"id": "044f0235357b044ed1732e545a8151c7868c1e8e",
"size": "699",
"bi... |
import IECore
## The Preset class serves as a base class for the implementation of
## 'presets'. In a nutshell, they are callable classes that manipulate
## the parameters of a Parameterised object. \see BasicPreset for an
## implementation that provides parameter value loading an saving, with
## support for Class an... | {
"content_hash": "d4d6143bedd7dafc1a0463dcbd182829",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 73,
"avg_line_length": 33.578947368421055,
"alnum_prop": 0.7507836990595611,
"repo_name": "appleseedhq/cortex",
"id": "fe8caa9541492c17e8bb30ed4218355e15872780",
"size": "3... |
"""
Example of scripting DFM and DWAQ
This script runs a simple DFM domain (square cartesian grid, with
oscillating flow boundary in one corner.), and then a DWAQ dye
release simulation.
sets up a tracer run with a spatially-variable initial
condition and runs it for the duration of the hydro.
"""
import os
import n... | {
"content_hash": "53ae2859da01352c3b3bad8ed4cd0745",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 111,
"avg_line_length": 31.87443946188341,
"alnum_prop": 0.6720596510973551,
"repo_name": "rustychris/stompy",
"id": "d2247ee2ecf44746b4b22d6166f36dcb5de28d29",
"size": "7... |
import errno
import click
import yaml
from sigopt.validate import ValidationError
class ValidatedData:
def __init__(self, filename, validated_data):
self.filename = filename
self.data = validated_data
def load_yaml(filename, validator, ignore_no_file):
if filename is None:
return None
try:
wi... | {
"content_hash": "c2d2fc13783781fb907b5a6218af3a90",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 89,
"avg_line_length": 29.942857142857143,
"alnum_prop": 0.7213740458015268,
"repo_name": "sigopt/sigopt-python",
"id": "1e4a81de0bac4dd9837f9606a885f45624dd2f1c",
"size": ... |
from sys import stdin
dummy = int(stdin.readline())
word = str(stdin.readline())
dictLength = int(stdin.readline())
# Build the list of words
words = [];
for i in range(1, dictLength + 1):
dummy = int(stdin.readline())
words.append(str(stdin.readline()))
# Is the word in our list?
if word in words:
print 0
else:
... | {
"content_hash": "1f3d1fbaf19b057c2f3f5e486deeecb3",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 36,
"avg_line_length": 19.294117647058822,
"alnum_prop": 0.6920731707317073,
"repo_name": "AntoineAugusti/katas",
"id": "a3d7b1e4ee65da811decb555b9468986595ad977",
"size": ... |
import pytest
from dj_anonymizer import fields
def test_function():
def base_func(value=0, *args, **kwargs):
result = value + sum(args)
if 'addition' in kwargs:
result += kwargs['addition']
return result
function_field = fields.function(base_func)
assert next(function... | {
"content_hash": "b70039362c51f16c974682b47d30a319",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 76,
"avg_line_length": 33.37313432835821,
"alnum_prop": 0.6149373881932021,
"repo_name": "knowledge-point/dj_anonymizer",
"id": "bdd8c2aafb62e6359332da09c77aa92b87394c85",
... |
def tensor_shape_string(tensor):
"""
Creates a string of the shape of the tensor with format (dim[0], dim[1], ..., dim[n])
:param tensor: input tensor
:return: String of shape
"""
shape = tensor.get_shape().as_list()
shape_str = '('
for i in range(len(shape)):
shape_str += '{:s}... | {
"content_hash": "962431b45eb64296e08288b43c6aae32",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 123,
"avg_line_length": 30.5,
"alnum_prop": 0.5947176684881603,
"repo_name": "BartKeulen/drl",
"id": "8d8bd195ab50ad0170ff5f4b840696090f399b55",
"size": "1098",
"binary":... |
"""
Django settings for djangostructlog project.
Generated by 'django-admin startproject' using Django 1.9.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
impo... | {
"content_hash": "a6caa3255053c35860a3f52d30958ca6",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 91,
"avg_line_length": 26.845588235294116,
"alnum_prop": 0.6852917009038619,
"repo_name": "carlohamalainen/django-struct-log",
"id": "e211ec82d887945f1851543900f7503f4033adf... |
"""
==========================================
Statistical functions (:mod:`scipy.stats`)
==========================================
.. module:: scipy.stats
This module contains a large number of probability distributions as
well as a growing library of statistical functions.
Each univariate distribution is an insta... | {
"content_hash": "8e2444753d3cc8b638e420536c496616",
"timestamp": "",
"source": "github",
"line_count": 359,
"max_line_length": 94,
"avg_line_length": 25.573816155988858,
"alnum_prop": 0.5710706894673783,
"repo_name": "kalvdans/scipy",
"id": "d8b9ce5fa103afada2bd6c27050860297221394c",
"size": "9181... |
import unittest
import ray
from ray.rllib import _register_all
from ray.tune import Trainable
from ray.tune.ray_trial_executor import RayTrialExecutor
from ray.tune.registry import _global_registry, TRAINABLE_CLASS
from ray.tune.result import TRAINING_ITERATION
from ray.tune.suggest import BasicVariantGenerator
from r... | {
"content_hash": "5a3926a6cb87416acb23956706c24e03",
"timestamp": "",
"source": "github",
"line_count": 267,
"max_line_length": 79,
"avg_line_length": 38.850187265917604,
"alnum_prop": 0.6467752819820688,
"repo_name": "richardliaw/ray",
"id": "c2afe6a5960895570b867e8fbde0e774faa97248",
"size": "103... |
Array=[int(x) for x in input().split()]
print(Array) | {
"content_hash": "ed871b7b6978fa268d89a29ee3c27079",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 39,
"avg_line_length": 17.666666666666668,
"alnum_prop": 0.660377358490566,
"repo_name": "vinitraj10/Java",
"id": "d61321fe6963c1fc7cd899299515c489556de7dd",
"size": "91",
... |
from __future__ import print_function
from sys import stderr
from vsts_cd_manager.continuous_delivery_manager import ContinuousDeliveryManager
from azure.cli.core._profile import Profile
class VstsContinuousDeliveryProvider(object):
def __init__(self):
self._progress_last_message = ''
def setup_conti... | {
"content_hash": "a62d9c5d5ba724bd845c71f4db71db25",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 100,
"avg_line_length": 44.36363636363637,
"alnum_prop": 0.5967213114754099,
"repo_name": "QingChenmsft/azure-cli",
"id": "89456c7386304fad5c9d5cde6ce1d010dff78d95",
"size"... |
from django.utils.safestring import mark_safe
from django_tables2.columns import Column, BooleanColumn, EmailColumn
import django_tables2 as tables
from orgsema.models import Radnik
class ListaRadnika(tables.Table):
id = Column(verbose_name=mark_safe('ID'))
puno_ime = Column(verbose_name=mark_safe('Ime i prez... | {
"content_hash": "a7afc796329a70f938826e52925c6795",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 75,
"avg_line_length": 35.5,
"alnum_prop": 0.6751173708920187,
"repo_name": "mbranko/kartonpmv",
"id": "c8ca2b2619b9e0c0dfffe10ac095f1844bc13324",
"size": "1112",
"binary... |
__author__ = 'yfauser'
from tests.config import *
from nsxramlclient.client import NsxClient
import time
client_session = NsxClient(nsxraml_file, nsxmanager, nsx_username, nsx_password, debug=True)
#TODO: add tests for all vds operations | {
"content_hash": "d44136952d8b42c5f62556da0413e912",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 92,
"avg_line_length": 24.1,
"alnum_prop": 0.7759336099585062,
"repo_name": "vmware/nsxramlclient",
"id": "43867a999b01cd7d7aedf5fb68f033ed472c6556",
"size": "1362",
"bin... |
"""File paths for the Reddit Classification pipeline.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
TRANSFORM_FN_DIR = 'transform_fn'
RAW_METADATA_DIR = 'raw_metadata'
TRANSFORMED_METADATA_DIR = 'transformed_metadata'
TRANSFORMED_TRAIN_DATA_FILE_PREF... | {
"content_hash": "9a02d353c7d4b1eb7dd11b1c9ed3f123",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 58,
"avg_line_length": 34.526315789473685,
"alnum_prop": 0.7698170731707317,
"repo_name": "GoogleCloudPlatform/cloudml-samples",
"id": "5d823a4ecfe9e85b78e00f3b4fadacc8dfc202... |
import argparse
import subprocess
import os
import os.path as op
import json
import re
from glob import glob
# slurm-related paths. change these if your slurm is set up differently or you
# use a different job submission system. see docs
# https://sylabs.io/guides/3.7/user-guide/appendix.html#singularity-s-environment... | {
"content_hash": "6e3a0dbf6768311ed5171976ecc579e8",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 176,
"avg_line_length": 54.09090909090909,
"alnum_prop": 0.6294764059469942,
"repo_name": "billbrod/spatial-frequency-preferences",
"id": "dd5ddb4821ccd340ee589d3cdbd24189b5... |
"""
This module contains all classes and functions used for handling macros.
"""
from pyccel.utilities.stage import PyccelStage
from .basic import PyccelAstNode
from .datatypes import NativeInteger, NativeGeneric
from .internals import PyccelSymbol
from .variable import Variable
pyccel_stage ... | {
"content_hash": "7c5c077c8afa370b0dc6ff675b30648f",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 106,
"avg_line_length": 26.408333333333335,
"alnum_prop": 0.48437993057746925,
"repo_name": "ratnania/pyccel",
"id": "d23e62a308a75b885821ca5b140b54f9a833488a",
"size": "3... |
from oslo.config import cfg
import stevedore
from neutron.common import exceptions as exc
from neutron.extensions import portbindings
from neutron.openstack.common import log
from neutron.plugins.ml2.common import exceptions as ml2_exc
from neutron.plugins.ml2 import driver_api as api
LOG = log.getLogger(__name__)
... | {
"content_hash": "12b7e9c16318e9d3ea7d92d05b09b1e6",
"timestamp": "",
"source": "github",
"line_count": 468,
"max_line_length": 79,
"avg_line_length": 45.57051282051282,
"alnum_prop": 0.6352042012472453,
"repo_name": "sajuptpm/neutron-ipam",
"id": "83066f3d850d845def6247bdc57863e9b9553ce8",
"size":... |
import math, sys
from Quartz import *
import Quartz
def doSimpleRect(context):
# Set the fill color to opaque red.
CGContextSetRGBFillColor(context, 1.0, 0.0, 0.0, 1.0)
# Set up the rectangle for drawing.
ourRect = CGRectMake(20.0, 20.0, 130.0, 100.0)
# Draw the filled rectangle.
CGContextFil... | {
"content_hash": "ddfa8137b09db282a563d3b4995844c4",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 83,
"avg_line_length": 39.21238938053097,
"alnum_prop": 0.6566237869555405,
"repo_name": "albertz/music-player",
"id": "8758e215be44ba3d7957b8725df9d1fd0fa7194a",
"size": ... |
""" A unittest script for the IHMPSession module. """
import unittest
from cutlass import iHMPSession
from CutlassTestUtil import CutlassTestUtil
# pylint: disable=W0703, C1801
class IHMPSessionTest(unittest.TestCase):
""" A unit test class for the IHMPSession module. """
username = "test"
password = "... | {
"content_hash": "c196d8005e58f5d52d48220f98c351d3",
"timestamp": "",
"source": "github",
"line_count": 326,
"max_line_length": 85,
"avg_line_length": 38.76993865030675,
"alnum_prop": 0.6727589208006962,
"repo_name": "ihmpdcc/cutlass",
"id": "735ba78560432d4ab5fee75802f9dd75d15a4be3",
"size": "1266... |
from django.db import transaction
import mailchimp
from framework import sentry
from framework.celery_tasks import app
from framework.celery_tasks.handlers import queued_task
from framework.auth.signals import user_confirmed
from osf.models import OSFUser as User
from website import settings
def get_mailchimp_api():... | {
"content_hash": "85c47bb86b6887158643f7d740a50368",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 109,
"avg_line_length": 32.04040404040404,
"alnum_prop": 0.6815889029003783,
"repo_name": "Nesiehr/osf.io",
"id": "8ab8fa36e4239b2e2bc46d34ce3a1e1d357ae6cb",
"size": "3197"... |
"""
Copyright (c) 2007-2008, Dj Gilcrease
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, me... | {
"content_hash": "8492cf50017e7eff784fdfbe0cc8b3ba",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 77,
"avg_line_length": 40.73015873015873,
"alnum_prop": 0.7381137957911146,
"repo_name": "TheSundar/django-cron",
"id": "b104dda0688d38cd9f6271fd1777160610d3df7d",
"size": ... |
import itertools
from ..lang import TypedFunc
from ..lang import Typeclass
from ..lang import is_builtin
from ..lang import build_instance
from ..lang import List
from ..lang import L
from ..lang import H
from ..lang import sig
from ..lang import t
from ..lang import instance
class Functor(Typeclass):
"""
The... | {
"content_hash": "176b0873d5572b5738c2b41498dd9e07",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 78,
"avg_line_length": 24.408163265306122,
"alnum_prop": 0.5852842809364549,
"repo_name": "shaunstanislaus/hask",
"id": "372265754c19220f6d006a14405988372e6caf26",
"size": ... |
from __future__ import absolute_import, unicode_literals
import datetime
import logging
import numbers
import pygst
pygst.require('0.10')
import gst # noqa
from mopidy import compat, httpclient
from mopidy.models import Album, Artist, Track
logger = logging.getLogger(__name__)
def calculate_duration(num_samples,... | {
"content_hash": "fa2e4b9a56605914e4eaf38b3370faee",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 79,
"avg_line_length": 34.90816326530612,
"alnum_prop": 0.6476176556562409,
"repo_name": "rawdlite/mopidy",
"id": "3b9ea30fa0ae204ad2e97bf91eeda7f7261171c3",
"size": "6842... |
import numpy as np
import hyperchamber as hc
import inspect
import nashpy as nash
import hypergan as hg
import hyperchamber as hc
import sys
import gc
import os
import random
from hypergan.trainers.base_trainer import BaseTrainer
TINY = 1e-12
class CurriculumTrainer(BaseTrainer):
def create(self):
self.c... | {
"content_hash": "33b1eee6e71a90d24d22ce04b80ba43f",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 114,
"avg_line_length": 34.65217391304348,
"alnum_prop": 0.5912797992471769,
"repo_name": "255BITS/HyperGAN",
"id": "185997a5ee71af79c131924cae779ce53096079c",
"size": "318... |
"""
MRX (XML for MRS) serialization and deserialization.
"""
import io
import re
from pathlib import Path
import xml.etree.ElementTree as etree
from delphin.mrs import MRS, EP, HCons, ICons, CONSTANT_ROLE
from delphin import predicate
from delphin.lnk import Lnk
from delphin import variable
from delphin.sembase impor... | {
"content_hash": "15ca4f66884c79d274f6a6cd53bbd393",
"timestamp": "",
"source": "github",
"line_count": 441,
"max_line_length": 78,
"avg_line_length": 29.857142857142858,
"alnum_prop": 0.5671755145439356,
"repo_name": "goodmami/pydelphin",
"id": "46caffb8ecbdf40f1c23581ce467030aa8ea0abf",
"size": "... |
import collections
from supriya.enums import CalculationRate
from supriya.synthdefs import UGen
class Unpack1FFT(UGen):
"""
::
>>> unpack_1_fft = supriya.ugens.Unpack1FFT.ar(
... binindex=binindex,
... bufsize=bufsize,
... chain=chain,
... whichmeasure... | {
"content_hash": "78ce4244b8f242ce96c854e5f5b4dfee",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 63,
"avg_line_length": 23.36470588235294,
"alnum_prop": 0.46651560926485397,
"repo_name": "josiah-wolf-oberholtzer/supriya",
"id": "f6caa6a70901a6a066c21d04087d57df6f1f9c4a"... |
from __future__ import unicode_literals
"""
bootstrap client session
"""
import frappe
import frappe.defaults
import frappe.desk.desk_page
from frappe.utils import get_gravatar
from frappe.desk.form.load import get_meta_bundle
def get_bootinfo():
"""build and return boot info"""
frappe.set_user_lang(frappe.session.... | {
"content_hash": "179c25b0ef9c31f4a6d7587e7e70d31c",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 125,
"avg_line_length": 29.793548387096774,
"alnum_prop": 0.7033347769597228,
"repo_name": "indictranstech/internal-frappe",
"id": "1acf97b254e8079564ab6854bdc3201a373929a5"... |
ax = opcsim.plots.pdfplot(d, weight='volume', with_modes=True)
ax.set_title("Volume Weighted Urban Aerosol Distribution", fontsize=16)
ax.legend(loc='best')
sns.despine()
| {
"content_hash": "51f9f6004468746e691082fccff28dab",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 71,
"avg_line_length": 42.75,
"alnum_prop": 0.7543859649122807,
"repo_name": "dhhagan/opcsim",
"id": "5a9a3a1cc28b51e526d0c015d1ce0f28e2296d2c",
"size": "171",
"binary": f... |
from __future__ import print_function, division
import json
import struct
import re
import os
import os.path
import base64
import httplib
import sys
import hashlib
import worldbit_hash
import datetime
import time
from collections import namedtuple
settings = {}
def uint32(x):
return x & 0xffffffffL
def bytereverse(... | {
"content_hash": "8bc268f445698ec902322eaa14c0e06d",
"timestamp": "",
"source": "github",
"line_count": 296,
"max_line_length": 108,
"avg_line_length": 29.2027027027027,
"alnum_prop": 0.6730680240629339,
"repo_name": "worldbit/worldbit",
"id": "6c9709b02f4cedc024012e210474a7f722544952",
"size": "89... |
from rest_framework import viewsets
from polls.models import Questionary, Question, Choice, Answer
from polls.serializers import (QuestionarySerializer, QuestionSerializer,
ChoiceSerializer, AnswerSerializer)
class QuestionaryViewSet(viewsets.ModelViewSet):
queryset = Questionary.o... | {
"content_hash": "db2a574357c9eebb22a1a95dee0fe2ce",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 73,
"avg_line_length": 30,
"alnum_prop": 0.764,
"repo_name": "ewokcillo/django_workshop",
"id": "4d9eabf1ace47bcff3b2b1814a1e3c8537d04160",
"size": "750",
"binary": false... |
"""
Interpolation
################################
Hidden wrapper function that makes it convenient to choose
an interpolation scheme available in scipy.
"""
import numpy as np
import pandas as pd
from scipy.interpolate import (interp1d, interp2d, griddata,
pchip_interpolate, krogh_interp... | {
"content_hash": "75255a90a0febbf5328f1bd9f016a866",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 110,
"avg_line_length": 46.88333333333333,
"alnum_prop": 0.5549235691432635,
"repo_name": "exa-analytics/exatomic",
"id": "7da5528b90e7144c6790e09d4351be0c6b492143",
"size... |
import ast
import builtins
import collections
import decimal
import fractions
import io
import locale
import os
import pickle
import platform
import random
import re
import sys
import traceback
import types
import unittest
import warnings
from contextlib import ExitStack
from operator import neg
from test.support impor... | {
"content_hash": "af4e33aaa63c8bada3e62bc9829f30be",
"timestamp": "",
"source": "github",
"line_count": 1978,
"max_line_length": 105,
"avg_line_length": 36.3422649140546,
"alnum_prop": 0.5314043263545941,
"repo_name": "FFMG/myoddweb.piger",
"id": "7c9768a337bbb022379a6c2682f82241d7c10abc",
"size": ... |
from django.shortcuts import render, redirect, get_object_or_404
from django.contrib.auth.decorators import permission_required
from django.contrib import messages
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.utils.translation import ugettext as _
from wagtail.wagtailsearch imp... | {
"content_hash": "7311e8e48e6fcdd5df184034914b5d59",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 131,
"avg_line_length": 35.01574803149607,
"alnum_prop": 0.659995502586013,
"repo_name": "CreativeOutbreak/wagtail",
"id": "e17cd9d0e7a025974d380005563d762f4da0be24",
"siz... |
import os
import re
import sys
import h5py
import numpy as np
import pandas as pd
from ggr.analyses.bioinformatics import run_gprofiler
from ggr.analyses.linking import regions_to_genes
from tronn.util.utils import DataKeys
from tronn.util.formats import array_to_bed
REMOVE_SUBSTRINGS = [
"anatomical",
"am... | {
"content_hash": "5eac354bca0e5a7c4334cc46a4c558d8",
"timestamp": "",
"source": "github",
"line_count": 335,
"max_line_length": 98,
"avg_line_length": 38.31044776119403,
"alnum_prop": 0.5561788997974131,
"repo_name": "vervacity/ggr-project",
"id": "0986b93a081af8b9f1b5eafecf3fe9c562866fc6",
"size":... |
SERVE_CONTROLLER_NAME = "SERVE_CONTROLLER_ACTOR"
#: Actor name used to register HTTP proxy actor
SERVE_PROXY_NAME = "SERVE_PROXY_ACTOR"
#: HTTP Address
DEFAULT_HTTP_ADDRESS = "http://127.0.0.1:8000"
#: HTTP Host
DEFAULT_HTTP_HOST = "127.0.0.1"
#: HTTP Port
DEFAULT_HTTP_PORT = 8000
#: Max concurrency
ASYNC_CONCURRE... | {
"content_hash": "fb68afc25bc5101ad767d9c67f73891e",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 62,
"avg_line_length": 18.605263157894736,
"alnum_prop": 0.669024045261669,
"repo_name": "richardliaw/ray",
"id": "52c76972f82d4d0909d81a1fd9f453920965eb36",
"size": "749",... |
import unittest
import mock
import maccli.service.configuration
from tests.mock_data import *
class AuthTestCase(unittest.TestCase):
@mock.patch('maccli.dao.api_configuration.get_user_configuration')
def test_list_configurations(self, mock):
mock.return_value = (200, MOCK_CONFIGURATION_LIST_JSON)
... | {
"content_hash": "6d488a0935f2306c657de267c973abdc",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 80,
"avg_line_length": 39.95454545454545,
"alnum_prop": 0.7406143344709898,
"repo_name": "manageacloud/manageacloud-cli",
"id": "b699b0d877f725dd26b9bdb58d5272d33526ac9f",
... |
from setuptools import setup, find_packages
import sgsclient
def readme():
with open("README.rst") as f:
return f.read()
setup(name="sgsclient",
version=sgsclient.version,
description="The python client library for the Stratum Game Server.",
long_description=readme(),
classifier... | {
"content_hash": "0428830f9b3df8f8b5962d58e92492c5",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 75,
"avg_line_length": 32.78787878787879,
"alnum_prop": 0.5988909426987061,
"repo_name": "stratumgs/stratumgs-python-client",
"id": "25c29fe6262df618c4ace952069159954d4f34e0"... |
from OSIM.Modeling.CircuitSystemEquations import CircuitSystemEquations
from OSIM.Simulation.CircuitAnalysis.CircuitAnalyser import CircuitAnalyser
from OSIM.Simulation.NetToComp import NetToComp
#seq = CircuitSystemEquations(NetToComp('Transistor_invers.net').getComponents())
#ca = CircuitAnalyser(seq)
#ca.plot_lin(c... | {
"content_hash": "cab9349cb8e41f5961ffced354edd190",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 85,
"avg_line_length": 51.81818181818182,
"alnum_prop": 0.7789473684210526,
"repo_name": "tmaiwald/OSIM",
"id": "7ea2e4e92b38674c4a2fa400fcc5323ce35283a1",
"size": "570",
... |
from random import choice
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from users.models import *
from competencies.models import Organization
from competencies import my_admin, utils
from competencies ... | {
"content_hash": "19750c7578912cd5d128896b089aee8d",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 97,
"avg_line_length": 38.96212121212121,
"alnum_prop": 0.6360101108302547,
"repo_name": "openlearningtools/opencompetencies",
"id": "0772e071980d5aca9bbf280fedb72b94645edc5... |
import pytest
_ = pytest.importorskip('pyaio')
import os
import unittest
import re
from tempfile import mkdtemp
from shutil import rmtree
from slimta.diskstorage import DiskStorage
from slimta.envelope import Envelope
class TestDiskStorage(unittest.TestCase):
id_pattern = re.compile(r'[0-9a-fA-F]{32}')
de... | {
"content_hash": "6b26bc010a7e21f99edd56db07cd0eb3",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 75,
"avg_line_length": 36.78813559322034,
"alnum_prop": 0.6166781847500576,
"repo_name": "slimta/python-slimta",
"id": "1eaf9f5bdc9114bb5ac760b27397cee37555aa89",
"size": ... |
"""Tests for homekit_controller config flow."""
import asyncio
import unittest.mock
from unittest.mock import AsyncMock, patch
import aiohomekit
from aiohomekit.exceptions import AuthenticationError
from aiohomekit.model import Accessories, Accessory
from aiohomekit.model.characteristics import CharacteristicsTypes
fr... | {
"content_hash": "b1596e648e6cecb6a99a237f75126105",
"timestamp": "",
"source": "github",
"line_count": 1099,
"max_line_length": 130,
"avg_line_length": 35.393994540491356,
"alnum_prop": 0.6611136819373746,
"repo_name": "nkgilley/home-assistant",
"id": "5e2c8249560887605e29621b2f6cbc40f4ee530c",
"s... |
from __future__ import unicode_literals
from django.db import models
| {
"content_hash": "55ef45c25b05843732e23d5d5f7d77e3",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 39,
"avg_line_length": 23.333333333333332,
"alnum_prop": 0.7857142857142857,
"repo_name": "jeremyphilemon/uniqna",
"id": "0d091e53aa86d6c73bc9559e7a97c6dd957098c4",
"size": ... |
from __future__ import print_function
from .array import to_device
from .kernelapi import Dim3, FakeCUDAModule, swapped_cuda_module
from numba.six import reraise
import numpy as np
import sys
import threading
from contextlib import contextmanager
"""
Global variable to keep track of the current "kernel context", i.e ... | {
"content_hash": "99705a7b2eabf27a6641849af80a6e18",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 81,
"avg_line_length": 31.33177570093458,
"alnum_prop": 0.580462341536167,
"repo_name": "stefanseefeld/numba",
"id": "7dc66cd77e0971b5f7a9a654eab85f1ddc54bd87",
"size": "6... |
from django.contrib import admin
from django.contrib.auth import get_user_model
from .models import Key, KeyLog, ServiceLocation, CycleInfo, RouteInfo
class KeyLogInline(admin.TabularInline):
model = KeyLog
extra=1
class KeyAdmin(admin.ModelAdmin):
inlines = [KeyLogInline]
class DefineRoute(RouteInfo):
... | {
"content_hash": "244542445f2cebf2b50deec78e35311b",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 70,
"avg_line_length": 24.434782608695652,
"alnum_prop": 0.7580071174377224,
"repo_name": "jancsarc/KIM-Online",
"id": "87013163d9ae46ea57efac3609d36fbfda02d04e",
"size": "... |
import asposeimagingcloud
from asposeimagingcloud.ImagingApi import ImagingApi
from asposeimagingcloud.ImagingApi import ApiException
import asposestoragecloud
from asposestoragecloud.StorageApi import StorageApi
from asposestoragecloud.StorageApi import ResponseMessage
apiKey = "XXXXX" #sepcify App Key
appSid = "XXX... | {
"content_hash": "6bce1d4eac7c3caaaa5adcd0cb371487",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 176,
"avg_line_length": 36.04761904761905,
"alnum_prop": 0.7404227212681638,
"repo_name": "asposeimaging/Aspose_Imaging_Cloud",
"id": "28eb82ee958dc5269ffefd5a0d34056a53d6dd4... |
import codecs
import os
import setuptools
def read(fname):
file_path = os.path.join(os.path.dirname(__file__), fname)
return codecs.open(file_path, encoding="utf-8").read()
setuptools.setup(
name="poyo",
version="0.5.0",
author="Raphael Pierzina",
author_email="raphael@hackebrot.de",
ma... | {
"content_hash": "4a0a48b3dc366a8901a32fd1dc9f1cda",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 70,
"avg_line_length": 34.38461538461539,
"alnum_prop": 0.610178970917226,
"repo_name": "hackebrot/poyo",
"id": "57a5489d4c9b36169fea6dc5ccc853a826787e56",
"size": "1838",
... |
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.models import User
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from c3nav.control.models import UserPermissions
class UserPermissionsInline(admin.Stack... | {
"content_hash": "5fd556759d5153d2129b136d64409a5a",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 86,
"avg_line_length": 32.89655172413793,
"alnum_prop": 0.6981132075471698,
"repo_name": "c3nav/c3nav",
"id": "59216378285eb103e111858f730328039e41a9bb",
"size": "954",
"... |
import unittest
class TddInPythonExample(unittest.TestCase):
def test_calculator_add_method_returns_correct_result(self):
result = 2 + 2
self.assertEqual(4, result)
if __name__ == "__main__":
unittest.main()
| {
"content_hash": "145fea61c386d5ecbcc63d8d2e583050",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 64,
"avg_line_length": 21.454545454545453,
"alnum_prop": 0.6567796610169492,
"repo_name": "DongjunLee/kino-bot",
"id": "6a2f7ebe2e1fa692af5e1b553a6b634d98020b9a",
"size": "... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import numpy as np
import zhusuan as zs
import tensorflow as tf
import tensorflow.contrib.layers as layers
def get_w_names(drop_rate, net_sizes):
w_names = []
return w_names
@zs.reuse('model')
def p_... | {
"content_hash": "8d25e0f9810b5c78e0393f93ba288104",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 72,
"avg_line_length": 29.423076923076923,
"alnum_prop": 0.6130718954248366,
"repo_name": "MaxInGaussian/ZS-VAFNN",
"id": "b30611611f6ef05e10f7ef5474a1604ddf81a523",
"size"... |
from select2_foreign_key import test_functional
from .models import TModel
class AdminForeignKeyTestCase(test_functional.AdminForeignKeyTestCase):
model = TModel
| {
"content_hash": "8ba6f4ba5db4825a2ed2ebb16db6736c",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 71,
"avg_line_length": 24.142857142857142,
"alnum_prop": 0.8224852071005917,
"repo_name": "yourlabs/django-autocomplete-light",
"id": "c05d561713f5cac5f5bd9ceb657bca19b6d8f28a... |
from __future__ import annotations
import os
from datetime import datetime
from airflow import models
from airflow.providers.google.cloud.operators.gcs import GCSCreateBucketOperator, GCSDeleteBucketOperator
from airflow.providers.google.cloud.transfers.mysql_to_gcs import MySQLToGCSOperator
from airflow.utils.trigge... | {
"content_hash": "7ca81c86c11f4e37b5f8afed36e63a33",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 105,
"avg_line_length": 30.661016949152543,
"alnum_prop": 0.699281370923162,
"repo_name": "apache/airflow",
"id": "55b4dd1b5731e07883c44eecc4efc2337e372596",
"size": "2594"... |
import jsonschema
from unittest import mock
from webob import exc
from senlin.api.common import util
from senlin.api.common import wsgi
from senlin.common import context
from senlin.common import policy
from senlin.objects import base as obj_base
from senlin.tests.unit.common import base
from senlin.tests.unit.common... | {
"content_hash": "614161df0a9ff8928d7ba47e33fbcd37",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 79,
"avg_line_length": 33.76605504587156,
"alnum_prop": 0.5916315717973102,
"repo_name": "openstack/senlin",
"id": "5484c3caca3534f0bb9b944258c9c5e686a9bea7",
"size": "791... |
import sys
import os
# Use OpenBLAS with 1 thread only as it seems to be using too many
# on the CIs apparently.
import scipy
import scipy.cluster._hierarchy
import scipy.cluster._vq
import scipy.fftpack._fftpack
import scipy.fftpack.convolve
import scipy.integrate._dop
import scipy.integrate._odepack
import scipy.in... | {
"content_hash": "63fa61a7b0d02de8e9be25fe91c9e2dc",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 66,
"avg_line_length": 30.06578947368421,
"alnum_prop": 0.8323851203501094,
"repo_name": "jjhelmus/berryconda",
"id": "08234c602ceb6b4e8c0195201b3db9692bca07fd",
"size": "2... |
"""
Support for Z-Wave climate devices.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/climate.zwave/
"""
# Because we do not compile openzwave on CI
import logging
from homeassistant.components.climate import (
DOMAIN, ClimateDevice, STATE_AUTO, STA... | {
"content_hash": "89804e7c4fcf11e37e38e8b4aabf9098",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 82,
"avg_line_length": 35.53846153846154,
"alnum_prop": 0.5930735930735931,
"repo_name": "persandstrom/home-assistant",
"id": "77b5e111686f6f9da29fa302ebaf883af4e34ca2",
"... |
""" Pykaf setup.py package.
https://docs.python.org/2/distutils/index.html
"""
from setuptools import setup
setup(
name='pynaf',
version='2.0.2',
author='Rodrigo Agerri',
author_email='rodrigo.agerri@ehu.es',
packages=['pynaf',],
url='https://github.com/josubg/pynaf/',
license=' Apach... | {
"content_hash": "801a744a0b4a01caa9d96b9c2a1508b9",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 71,
"avg_line_length": 30.566666666666666,
"alnum_prop": 0.6205016357688113,
"repo_name": "jofatmofn/pynaf",
"id": "4d4689febabb994caa03a0c19eb60595b5111df4",
"size": "932"... |
import libvirt
import logging
import os
import uuid
from string import Template
from dwarf import config
CONF = config.Config()
LOG = logging.getLogger(__name__)
DOMAIN_NOSTATE = 0
DOMAIN_RUNNING = 1
DOMAIN_PAUSED = 2
DOMAIN_SHUTDOWN = 3
DOMAIN_CRASHED = 4
DOMAIN_SUSPENDED = 5
_LIBVIRT_DOMAIN_STATE = {
libvirt... | {
"content_hash": "b85657876d6cca192e33ed165a7b1a86",
"timestamp": "",
"source": "github",
"line_count": 314,
"max_line_length": 79,
"avg_line_length": 28.05732484076433,
"alnum_prop": 0.5312145289443814,
"repo_name": "juergh/dwarf",
"id": "d9ad99a8cb928bde473a518abdb82f0af4e3f5cc",
"size": "9487",
... |
from django.contrib import admin
from . import models
@admin.register(models.Voter)
class VoterAdmin(admin.ModelAdmin):
# List
search_fields = [
'first_name',
'last_name',
'email',
]
list_display = [
'name',
'email',
'birth_date',
'zip_code',... | {
"content_hash": "5431640121d6508ac197fc5b38efc13a",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 64,
"avg_line_length": 17.358974358974358,
"alnum_prop": 0.5206794682422452,
"repo_name": "citizenlabsgr/voter-engagement",
"id": "3e2f56af6c4d88cb7ee5cd7fbcd9df13949ba604",
... |
import platform
class Platform:
def name(self):
if platform.system() == 'Linux':
print platform.system() + ':' + 'Ok'
else:
print platform.system() + ':' + 'Not supported, in debug mode'
| {
"content_hash": "a882090796d4cf45b4c19b45d7baef30",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 74,
"avg_line_length": 25.88888888888889,
"alnum_prop": 0.5407725321888412,
"repo_name": "gabriellacerda/setRobot-tool",
"id": "7bd4dd8b7f26dd06fd4f546f4b5fc64ddaeb86e7",
"s... |
from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HUnitR04b_ConnectedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HUnitR04b_ConnectedLHS
"""
# Flag this instance as compiled now
self.is_compiled = True
s... | {
"content_hash": "69ef770a501a873c9dd279c96f92e858",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 100,
"avg_line_length": 26.3125,
"alnum_prop": 0.6730007917656373,
"repo_name": "levilucio/SyVOLT",
"id": "a0619bf648fa4925949402aa4ca6715093b5cb24",
"size": "1263",
"bin... |
from __future__ import unicode_literals
import frappe, os, json
from frappe.modules import get_module_path, scrub_dt_dn
from frappe.utils import get_datetime_str
def import_files(module, dt=None, dn=None, force=False, pre_process=None):
if type(module) is list:
out = []
for m in module:
out.append(import_file... | {
"content_hash": "6e05399b2ba1ce5052ac3ea9487c9d5e",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 94,
"avg_line_length": 28.533333333333335,
"alnum_prop": 0.6799065420560748,
"repo_name": "anandpdoshi/frappe",
"id": "3738a049001ed032999ea13cbe830a227523844f",
"size": "... |
"""This module provides some common test case bases for
SparklingPandasTestCases"""
from sparklingpandas.utils import add_pyspark_path
import pandas
add_pyspark_path()
from pyspark import SparkConf
from sparklingpandas.pcontext import PSparkContext
import unittest2
import sys
from pandas.util.testing import assert_f... | {
"content_hash": "c4eccbc19c53994656acaaafe45932aa",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 79,
"avg_line_length": 39.020833333333336,
"alnum_prop": 0.5621996796583022,
"repo_name": "holdenk/sparklingpandas",
"id": "ca174ee32277184078b8d2a72d51cf5389cbe2f6",
"size... |
import os
import shutil
import urllib
import urllib2
import json
from subprocess import call, Popen
from time import sleep
from nosuch.oscutil import *
UseLoopMIDI = False
root = os.getenv("VIZBENCH")
print "root = ",root
def killtask(nm):
call(["c:/windows/system32/taskkill","/f","/im",nm])
call(["c:/python27/pyt... | {
"content_hash": "843cfdf6fbbadfb5ce4fd6ad2b6c4cef",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 81,
"avg_line_length": 27.36470588235294,
"alnum_prop": 0.7166809974204643,
"repo_name": "nosuchtim/VizBench",
"id": "d9662c1afcc554af691aa142d91a638462a0ae81",
"size": "23... |
import pymongo
class MongoPipeline(object):
def __init__(self, mongo_uri, mongo_db):
self.mongo_uri = mongo_uri
self.mongo_db = mongo_db
@classmethod
def from_crawler(cls, crawler):
return cls(
mongo_uri = crawler.settings.get('MONGO_URI'),
mongo_db = crawle... | {
"content_hash": "dc5fe25db935f438c318dd8e17b8377a",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 61,
"avg_line_length": 29.28,
"alnum_prop": 0.6079234972677595,
"repo_name": "aeoluswing/scrapy",
"id": "c32b72ea53537de54b86266877d9c3a3b27b4090",
"size": "925",
"binary... |
"""
Copyright 2013 Lyst Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | {
"content_hash": "20babd0ca529045676b2d2b765e1d6ac",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 92,
"avg_line_length": 29.974358974358974,
"alnum_prop": 0.5902480752780154,
"repo_name": "animeshramesh/incremental-learning",
"id": "dc23322a4da4a0de04e08461b62f4fb5930db18... |
import amici
import sys
import petab
import subprocess
import os
from amici.petab_import import import_model
def main():
arg = sys.argv[1]
if arg == 'compilation':
git_dir = os.path.join(os.curdir, 'CS_Signalling_ERBB_RAS_AKT')
if not os.path.exists(git_dir):
subprocess.run([
... | {
"content_hash": "d585d6f45870a91d0a6dd792cf9292d4",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 84,
"avg_line_length": 41.510416666666664,
"alnum_prop": 0.6434127979924718,
"repo_name": "AMICI-developer/AMICI",
"id": "0f853c4a665e463b57172f768d7a4a8edb63feb1",
"size":... |
from __future__ import print_function # Use print() instead of print
from flask import url_for
from StringIO import StringIO
def test_page_urls(client):
# Visit landing page
response = client.get(url_for('landing_page'))
assert b'<h1>Not sure' in response.data
# Login as user and visit User page
... | {
"content_hash": "61e099589384462eee91a3a4aac019b4",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 86,
"avg_line_length": 42.34090909090909,
"alnum_prop": 0.6210413311862587,
"repo_name": "xke/nash",
"id": "4b7c8e44ad0e830dc039227fe8348e47540b05ee",
"size": "1963",
"bi... |
"""Tests for tensor2tensor.models.research.transformer_vae."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensor2tensor.data_generators import problem_hparams
from tensor2tensor.models.research import transformer_vae
import tensor... | {
"content_hash": "7047e79bb6279410181b5e5d8e565ab8",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 79,
"avg_line_length": 37.78260869565217,
"alnum_prop": 0.6242807825086306,
"repo_name": "mlperf/training_results_v0.5",
"id": "c47c485b57feb4799d8e42fdda9790876ef2f5f7",
"... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import os
import time
import unittest
from pycopia import anypath
from pycopia import asyncio
from pycopia import asyncserver
from pycopia import basicconfig
from pycopia import benchmarks
from pycopia impor... | {
"content_hash": "6205e4b1965b47505b8f1ed417656c7f",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 102,
"avg_line_length": 32.75824175824176,
"alnum_prop": 0.6296544783629654,
"repo_name": "kdart/pycopia",
"id": "c92113271567d845e61038c1f4569bc7c6e34cb4",
"size": "6033"... |
def extractIvorycrescentWordpressCom(item):
'''
Parser for 'ivorycrescent.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
... | {
"content_hash": "31a29ffae3c28bb5bcb2bf3876da309f",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 104,
"avg_line_length": 26.904761904761905,
"alnum_prop": 0.6389380530973451,
"repo_name": "fake-name/ReadableWebProxy",
"id": "b7d8b14b69efaec1ef0abed87aeab901b17bdec9",
"... |
"""Cryptograhpy routines used by HAP."""
from typing import Optional
from pyatv.support.chacha20 import Chacha20Cipher
class HAPSession:
"""Manages cryptography for a HAP session according to IP in specification.
The HAP specification mandates that data is encrypted/decrypted in blocks
of 1024 bytes. T... | {
"content_hash": "582b2c57f8ad2a4266135fa61c9f0196",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 81,
"avg_line_length": 32.78787878787879,
"alnum_prop": 0.6016635859519408,
"repo_name": "postlund/pyatv",
"id": "0ad9f91df014919f0b8bdadede2295d09f95d486",
"size": "2164",... |
def helper_one():
print("HELLO MY FRIEND FROM HELPER ONE!!")
def testing(a):
print("HELPING TO PUSH ARGS: {0}".format(a))
| {
"content_hash": "45994fcc1952c030ed416f7ffdea6b08",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 45,
"avg_line_length": 25,
"alnum_prop": 0.672,
"repo_name": "mrchristine/dbc-notebooks",
"id": "9b6fba34f0536f2dd85b2ae9cce1a9e8a5a460ee",
"size": "125",
"binary": false,... |
from flask import g
from mongoengine.connection import get_db
from .model_document import ModelDocument, ModelQuerySet
################################################################################
__all__ = ('MultipleDatabaseModelDocument',)
#######################################################################... | {
"content_hash": "7e6f0f97878443446bbad3bfcd64a1ce",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 143,
"avg_line_length": 42.93700787401575,
"alnum_prop": 0.6310287914909224,
"repo_name": "SlideAtlas/SlideAtlas-Server",
"id": "cae60f7de5ddb79651b8ed08e0ca5f0021b51b48",
... |
from django import forms
class UploadForm(forms.Form):
file = forms.FileField()
| {
"content_hash": "6ab1b96d455002d4e7a649551393a9ee",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 29,
"avg_line_length": 17.2,
"alnum_prop": 0.7325581395348837,
"repo_name": "webkom/noetikon",
"id": "3d54bda26aef7a0a6f419fd100ebdc9a234933f8",
"size": "86",
"binary": fa... |
"""This module provides a common interface for all HTTP requests.
HttpResponse: Represents the server's response to an HTTP request. Provides
an interface identical to httplib.HTTPResponse which is the response
expected from higher level classes which use HttpClient.request.
GenericHttpClient: Provide... | {
"content_hash": "fd73fc354fae69c7e09c7b25943c326c",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 77,
"avg_line_length": 32.72142857142857,
"alnum_prop": 0.6902423051735429,
"repo_name": "HadiOfBBG/pegasusrises",
"id": "d8e8495aa1bf0923eb0d2e694a9770118bb98138",
"size"... |
from numpy import *
from time import *
import numpy.random as rnd
from matplotlib import cm
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.patches import Ellipse
# First column should be ellipsoidal inside (converging)
# Second column should be spherical inside (diverging)
# T... | {
"content_hash": "caaa40e7a4848f223db7959795b175cf",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 67,
"avg_line_length": 37.073170731707314,
"alnum_prop": 0.7421052631578947,
"repo_name": "tom-klotz/ellipsoid-solvation",
"id": "a53121636dc846a414d67cc05aee7f020143e0fb",
... |
import json
import yaml
from conda_build_missing import build, find_all_recipes, sort_dependency_order
import os
from conda_build.config import config as conda_bld_config
import conda_build
import conda.api
from conda.utils import url_path
from contextlib import contextmanager
import logging
import conda_manifest.... | {
"content_hash": "fa79e81846fd64c71aaaa4025b37c2cd",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 124,
"avg_line_length": 38.95336787564767,
"alnum_prop": 0.5597233306730514,
"repo_name": "marqh/conda-manifest",
"id": "d6657cff4f76d8c2c791bd3da898136c9afc9f09",
"size":... |
import pandas
from nltools.file_reader import onsets_to_dm
import os.path
import csv
import pickle
import warnings
from regress_rois import *
from scipy.stats import ttest_1samp, t, norm
import datetime
import time
self_onset_file_version='20180220T031755'
action_timestamp=datetime.datetime.fromtimestamp(time.time... | {
"content_hash": "5eff31400fb855892bbdf330ad242c16",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 163,
"avg_line_length": 49.916666666666664,
"alnum_prop": 0.6558708959376739,
"repo_name": "bjsmith/reversallearning",
"id": "f312199baedf4d368ba98df8e4e8424a64757ff9",
"s... |
from ctypes import byref
# Other GDAL imports.
from django.contrib.gis.gdal.envelope import Envelope, OGREnvelope
from django.contrib.gis.gdal.error import OGRException, OGRIndexError, SRSException
from django.contrib.gis.gdal.feature import Feature
from django.contrib.gis.gdal.field import FIELD_CLASSES
from django.c... | {
"content_hash": "04528aeda974ce0c8a833b61a33fdc8f",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 89,
"avg_line_length": 36.125786163522015,
"alnum_prop": 0.6241295264623955,
"repo_name": "paulsmith/geodjango",
"id": "a41b28819be425330eba954bed17d8fd41820f0a",
"size": ... |
from setuptools import setup
from setuptools.command.test import test as TestCommand
import sys
class Tox(TestCommand):
user_options = [('tox-args=', 'a', "Arguments to pass to tox")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.tox_args = None
def finalize_opt... | {
"content_hash": "4bbe02192943ccab36c49d9b7b7c82ee",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 79,
"avg_line_length": 30.46153846153846,
"alnum_prop": 0.6117424242424242,
"repo_name": "Zemanta/django-statsd-influx",
"id": "037800585f3b803fe39cceef93430b6da4a9c035",
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.