text
stringlengths
4
1.02M
meta
dict
import re import imaplib from mailbox import Mailbox from label import Label from utf import encode as encode_utf7, decode as decode_utf7 from exceptions import * class Gmail(): # GMail IMAP defaults GMAIL_IMAP_HOST = 'imap.gmail.com' GMAIL_IMAP_PORT = 993 # GMail SMTP defaults # TODO: implement ...
{ "content_hash": "03d1a4ded43dc362fa850b6947733825", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 118, "avg_line_length": 29.348958333333332, "alnum_prop": 0.5794143744454303, "repo_name": "asampat3090/gmail", "id": "6d396c51cc331ec42260f3d72ae715ba6c1baaa3", "size": "...
""" Script for building the example. Usage: python setup.py py2app """ from distutils.core import setup import py2app setup( name="Grady", app=["main.py"], data_files=["English.lproj"], )
{ "content_hash": "16af443b1caebe7fcf32424be16d1a7d", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 33, "avg_line_length": 14.714285714285714, "alnum_prop": 0.6553398058252428, "repo_name": "ariabuckles/pyobjc-framework-Cocoa", "id": "c534cbf5d3eea6cf0fb9ea3723d591f0a701373...
import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../..')) sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) import cocos from cocos.director import director import pyglet from pyglet import font, image from pyglet.gl import * from pyglet.window import key from cocos.a...
{ "content_hash": "a92924d5bfcd8bcb0ad2b5e0318715f4", "timestamp": "", "source": "github", "line_count": 351, "max_line_length": 83, "avg_line_length": 29.632478632478634, "alnum_prop": 0.4735121622920873, "repo_name": "shackra/thomas-aquinas", "id": "30588d5068d5d5d7b1ff147e2297fd4b8a410e9e", "size...
""" Budgetting Module - Controllers """ module = request.controller if module not in deployment_settings.modules: session.error = T("Module disabled!") redirect(URL(r=request, c="default", f="index")) # Options Menu (available in all Functions' Views) response.menu_options = [ [T("Parameters"), False...
{ "content_hash": "d0064feec1dadc426917f1c5ebac72fc", "timestamp": "", "source": "github", "line_count": 1445, "max_line_length": 370, "avg_line_length": 46.21799307958477, "alnum_prop": 0.5778393351800554, "repo_name": "ksetyadi/Sahana-Eden", "id": "5070437efffe83c9d01236420436da1aa9e480db", "size"...
from django.core.cache import cache from django.dispatch import receiver from django.test import TestCase, Client from django.core.urlresolvers import reverse_lazy from dj_box.signals import box_event from . import (TRANSLATED_WEBHOOK_DATA, WEBHOOK_POSTED_DATA, VALID_VIEW_RESPONSE) impo...
{ "content_hash": "dc58d5e38eafecda9fd42f261a074544", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 108, "avg_line_length": 30.955555555555556, "alnum_prop": 0.6740847092605886, "repo_name": "rosscdh/django-box", "id": "1b653125bb52f76d7a17e48ade1ce5d27cb8750a", "size": "...
def extractAmnesiactlCom(item): ''' Parser for 'amnesiactl.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('i\'ll never go back to bygone days!', 'I\'ll never go back to bygone days!',...
{ "content_hash": "5538a86f87326cd0e90c7443df62fc07", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 122, "avg_line_length": 39.43478260869565, "alnum_prop": 0.5214994487320838, "repo_name": "fake-name/ReadableWebProxy", "id": "a53b8032115494201559edcc14bffa6c3bd9d581", "s...
from __future__ import absolute_import import os from shutil import copyfile from setuptools import setup def version(): # Copy VERSION file of parent to module directory if not found if not os.path.exists("xossynchronizer/VERSION"): copyfile("../../VERSION", "xossynchronizer/VERSION") with open...
{ "content_hash": "cf1e8eccec2acf9bbd671d0d08ac2993", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 74, "avg_line_length": 28.558139534883722, "alnum_prop": 0.6783387622149837, "repo_name": "open-cloud/xos", "id": "51d9d78ab2c4c57b79ed3f84da3fa0d6683edbb7", "size": "1823"...
""" Cart-pole balancing with independent discretization """ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from rlpy.Domains import Pacman from rlp...
{ "content_hash": "29575e875cb84b3b808fa74214f01d1d", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 98, "avg_line_length": 33.482142857142854, "alnum_prop": 0.6624, "repo_name": "rlpy/rlpy", "id": "f726b54f3a46ebdee086c417557534ca46be6aee", "size": "1875", "binary": fal...
""" Classes that simplify learning rate modification. """ import theano import theano.tensor as TT class _LearningRate(object): """ Suplerclass for learning rates. """ def __init__(self, initial_rate): """ Args: initial_rate: Initial value of the learning rate. """ self._rate = initial_rate ...
{ "content_hash": "ff40afe7965d8f2a90fc6fb257a02d99", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 80, "avg_line_length": 27.386363636363637, "alnum_prop": 0.6473029045643154, "repo_name": "djpetti/rpinets", "id": "e67b46c5f7abca08b052ac9d84a5168eeb470d76", "size": "1205...
from .core import ( validate_bool, ) from .number import ( validate_int, validate_float, ) from .string import ( validate_text, validate_bytes, ) from .datetime import ( validate_date, validate_datetime, ) from .datastructure import ( validate_list, validate_set, validate_mapping, validate_s...
{ "content_hash": "e9c5f9f73d4feb0086d4160e5e749a10", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 54, "avg_line_length": 21.333333333333332, "alnum_prop": 0.66875, "repo_name": "JOIVY/validation", "id": "ef285ff3c5734f8239d637f3acf1ea2c39a9100f", "size": "641", "binar...
import sys from _pydevd_bundle.pydevd_constants import STATE_RUN, PYTHON_SUSPEND, IS_JYTHON, IS_IRONPYTHON from _pydev_bundle import pydev_log # IFDEF CYTHON # pydev_log.debug("Using Cython speedups") # ELSE from _pydevd_bundle.pydevd_frame import PyDBFrame # ENDIF version = 12 if not hasattr(sys, '_current_frames'):...
{ "content_hash": "bea71c075a99e28d4997b461b4521f68", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 120, "avg_line_length": 35.904, "alnum_prop": 0.5851158645276292, "repo_name": "mdanielwork/intellij-community", "id": "25f007f1e8de4b32ae10ed92602c6aa2c7a8b750", "size": ...
"""Test the abandontransaction RPC. The abandontransaction RPC marks a transaction and all its in-wallet descendants as abandoned which allows their inputs to be respent. It can be used to replace "stuck" or evicted transactions. It only works on transactions which are not included in a block and are not currently...
{ "content_hash": "1a65c23829d9f288de2bc06a39d9c478", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 137, "avg_line_length": 49.63953488372093, "alnum_prop": 0.6588193956430077, "repo_name": "Kogser/bitcoin", "id": "e5ac2c8bd45971c5673d765f84dd5620e03666fc", "size": "8752...
from django.conf import settings from django.contrib import messages from django.core.exceptions import ValidationError from django.http import HttpResponseRedirect from django.template.loader import render_to_string from django.urls import reverse from django.utils.translation import gettext_lazy as _ from django.view...
{ "content_hash": "4a4aea3b3d0f752e88d279164b4934d9", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 107, "avg_line_length": 32.2043795620438, "alnum_prop": 0.6350861287398005, "repo_name": "solarissmoke/django-oscar", "id": "5feb4921a78c930ab391db181b52bf2cb793b715", "si...
print('IMPORTING')
{ "content_hash": "ec7c5ef4372cffacddfce357ffbafdeb", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 18, "avg_line_length": 19, "alnum_prop": 0.7368421052631579, "repo_name": "ros/catkin", "id": "18d500504a5f25c21e4d3503d272a9ccf25dd52b", "size": "19", "binary": false, ...
import numpy as np from menpo.base import Targetable, Vectorizable from menpo.shape import PointCloud from menpo.transform.base import Transform, VComposable, VInvertible from menpofit.checks import check_model from menpofit.modelinstance import PDM, GlobalPDM, OrthoPDM from menpofit.differentiable import DP # TODO...
{ "content_hash": "283c469f7bbd7a3b140e32c5444f01c7", "timestamp": "", "source": "github", "line_count": 612, "max_line_length": 80, "avg_line_length": 36.59803921568628, "alnum_prop": 0.603580676846147, "repo_name": "grigorisg9gr/menpofit", "id": "d770290b33bc0c94c04b9740a90c9510334e05d9", "size": ...
""" my_project """
{ "content_hash": "591b16fe4a8b0f29c000fca229f416fe", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 18, "avg_line_length": 19, "alnum_prop": 0.47368421052631576, "repo_name": "jangeador/django_sample", "id": "12041f7ffe2429da61fa77d8f1e97e66f3219960", "size": "19", "bina...
def add_spider(heros=None): if(heros is None): heros = [] heros.append("spider") return heros print(add_spider()) print(add_spider(['mario', 'dora'])) print(add_spider())
{ "content_hash": "6251f1fd4d6bbad7cf0467cdd6a6dcc7", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 36, "avg_line_length": 22.666666666666668, "alnum_prop": 0.5784313725490197, "repo_name": "padmacho/pythontutorial", "id": "ae462b0fea00f1f7d06c718183e648b856b0f7da", "size"...
import logging from datetime import datetime from rest_framework.authentication import SessionAuthentication from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from rest_framework.views import APIView from rest_framework import status from seaserv import seafile_api f...
{ "content_hash": "1ade3cc12e56ef2763ccd8a65213acf4", "timestamp": "", "source": "github", "line_count": 223, "max_line_length": 102, "avg_line_length": 36.233183856502244, "alnum_prop": 0.6198019801980198, "repo_name": "miurahr/seahub", "id": "64c75a2a1c886c79ae004425006c96752179cbb6", "size": "811...
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel 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 ...
{ "content_hash": "987cf340fc9ddaac17fd751b13b32e03", "timestamp": "", "source": "github", "line_count": 1044, "max_line_length": 265, "avg_line_length": 33.5727969348659, "alnum_prop": 0.6065905848787446, "repo_name": "andelf/python-oauth2", "id": "cedcd4aa92d958f9f0af3ee937b0e7f2ba6602b4", "size":...
def main(j, args, params, tags, tasklet): params.merge(args) doc = params.doc tags = params.tags params.result = "h5. hello\nThis content is from the included macro\n" params.result = (params.result, doc) return params def match(j, args, params, tags, tasklet): return True
{ "content_hash": "9b8a90f0c4e6b649a73956f01933dbeb", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 74, "avg_line_length": 20.533333333333335, "alnum_prop": 0.6590909090909091, "repo_name": "Jumpscale/jumpscale_portal8", "id": "de2382620d937da3c68bc034b0e028e3d079da5e", "...
"""Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() If you want to require a specific version of setuptools, set a d...
{ "content_hash": "a87458b23f7de76e93e20b1c237fba2d", "timestamp": "", "source": "github", "line_count": 266, "max_line_length": 86, "avg_line_length": 35.330827067669176, "alnum_prop": 0.6415194722281337, "repo_name": "EnTeQuAk/dmlt", "id": "23f75e100978e923338cbb091587cd4aa509d4dd", "size": "9407"...
from __future__ import division, print_function import io import os import re from setuptools import setup # Example code to pull version from esptool.py with regex, taken from # http://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/ def read(*names, **kwargs): with io.open( ...
{ "content_hash": "e0b5e160c6d5cc854531ac0960947697", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 117, "avg_line_length": 31.189655172413794, "alnum_prop": 0.6351575456053068, "repo_name": "krzychb/rtd-test-bed", "id": "4e58c9cfd174c0834cd64b3d77123ce51d837af3", "size"...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Removing unique constraint on 'Category', fields ['slug'] db.delete_unique(u'cms_category', ['s...
{ "content_hash": "7d260e82cea3eb1c920f3b349a2530e8", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 195, "avg_line_length": 78.4090909090909, "alnum_prop": 0.552608695652174, "repo_name": "universalcore/unicore-cms-django", "id": "6a7efebd4a2a2099c19543ae7c2ec6973e6163f6", ...
from piston.account import Account from piston.post import Post from piston.instance import shared_steem_instance from piston.utils import is_comment class Blog(list): """ Obtain a list of blog posts of an account :param str account_name: Name of the account :param Steem steem_instance: Steem() i...
{ "content_hash": "70a655b792f83c7fba476f388d31af78", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 93, "avg_line_length": 34.7536231884058, "alnum_prop": 0.5617180984153461, "repo_name": "xeroc/python-steemlib", "id": "b0ae6d1b53126f54917bc018c5a4665131b98b7a", "size": "...
from distutils.core import setup, Extension setup(name = "LIBSVM", version = "2.91", author="Chih-Chung Chang and Chih-Jen Lin", maintainer="Chih-Jen Lin", maintainer_email="cjlin@csie.ntu.edu.tw", url="http://www.csie.ntu.edu.tw/~cjlin/libsvm/", description = "LIBSVM Python Interfa...
{ "content_hash": "9e851b762555fb8ae8a9b3cf1c5afb93", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 66, "avg_line_length": 36.5, "alnum_prop": 0.4811643835616438, "repo_name": "chenmoshushi/libsvm", "id": "9a6c2d733be7449539dcefce78a6212274a7c936", "size": "607", "binar...
"""Script for building and pushing base-images to gcr.io/oss-fuzz-base/ with "-test" suffix. This is useful for using the build infra to test image changes.""" import logging import multiprocessing import os import subprocess import sys import yaml import base_images import build_lib CLOUD_PROJECT = 'oss-fuzz-base' ...
{ "content_hash": "6776c802739cd4bf47376a309eb93bac", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 80, "avg_line_length": 33.868852459016395, "alnum_prop": 0.638431752178122, "repo_name": "robertswiecki/oss-fuzz", "id": "d7b926136bf5b8db75aeb2f84483522494fef0dc", "size"...
import sys from unittest import mock from oslo_config import cfg from watcher.cmd import dbmanage from watcher.db import migration from watcher.db import purge from watcher.tests import base class TestDBManageRunApp(base.TestCase): scenarios = ( ("upgrade", {"command": "upgrade", "expected": "upgrade"}...
{ "content_hash": "323ce68097e6d2b6366d42940c9fc170", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 78, "avg_line_length": 43.23899371069182, "alnum_prop": 0.6336, "repo_name": "stackforge/watcher", "id": "6ff030e5a6523128fbeeb1a3919a5f17fdebf93a", "size": "7477", "bin...
from invoke.tasks import task from invoke.collection import Collection @task def nope(ctx): return "You can't see this" @task(autoprint=True) def yup(ctx): return "It's alive!" @task(pre=[yup]) def pre_check(ctx): pass @task(post=[yup]) def post_check(ctx): pass sub = Collection('sub', yup) ns...
{ "content_hash": "06df4f761866ca7a617bc3c87e1eccee", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 54, "avg_line_length": 14.346153846153847, "alnum_prop": 0.6729222520107239, "repo_name": "mkusz/invoke", "id": "5d8f154e095862564d4b87438e425b460830f411", "size": "373", ...
from __future__ import division, print_function, absolute_import import numpy as np import amitgroup as ag import pnet import itertools as itr def _test(Xs, ys, net, n_classes): yhats = net.classify(Xs) return pnet.rescalc.confusion_matrix(ys, yhats, n_classes) def train_and_test(net, samples_per_class=None, ...
{ "content_hash": "40b4570c53a9195520b175d9078d85cc", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 109, "avg_line_length": 28.617391304347827, "alnum_prop": 0.5357034336068064, "repo_name": "amitgroup/parts-net", "id": "c77874e6e6c8851204c59e285646fb271d622720", "size":...
from quokka.core.app import QuokkaModule from .views import DonationView, TransactionListView from .functions import get_random_campaign, get_latest_donations module = QuokkaModule("fundraising", __name__, template_folder="templates") module.add_app_template_global(get_random_campaign) module.add_app_template_global(...
{ "content_hash": "42196eed08c72e3782672e5ca2a5535b", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 75, "avg_line_length": 41.07142857142857, "alnum_prop": 0.7426086956521739, "repo_name": "quokkaproject/quokka-fundraising", "id": "6c19a46b97adb6c913692e2f5388f94fa160148a",...
""" The Parameters module allows you to specify build parameters for a job. **Component**: parameters :Macro: parameter :Entry Point: jenkins_jobs.parameters Example:: job: name: test_job parameters: - string: name: FOO default: bar description: "A parameter named F...
{ "content_hash": "c2404696e0aa459bd8df6f89eb331584", "timestamp": "", "source": "github", "line_count": 891, "max_line_length": 79, "avg_line_length": 38.31200897867564, "alnum_prop": 0.635838996953363, "repo_name": "phinexus/jenkins-job-builder", "id": "7b0b3aebe4eba49d7695af96b80119bc3f66c0da", "...
""" The GeoDjango GEOS module. Please consult the GeoDjango documentation for more details: http://geodjango.org/docs/geos.html """ from .collections import GeometryCollection, MultiPoint, MultiLineString, MultiPolygon # NOQA from .error import GEOSException, GEOSIndexError # NOQA from .factory import fromfile, fr...
{ "content_hash": "0ff007e4556180f70215197673b56512", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 94, "avg_line_length": 37.15, "alnum_prop": 0.7631224764468372, "repo_name": "hackerbot/DjangoDev", "id": "48b321c6de25949b726f80ca31aed2f40989db41", "size": "743", "bina...
import datetime import os from djpcms.test import TestCase from djpcms.utils.pathtool import parentdir from djpcms.apps.included.docs import DocApplication class DocTestApplication(DocApplication): inherit = True deflang = None defversion = None name = 'test_documentation' DOCS_PICKLE_ROOT ...
{ "content_hash": "b7bd91670c2b90d49e4bb475cfdb1acb", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 59, "avg_line_length": 21.96551724137931, "alnum_prop": 0.6703296703296703, "repo_name": "strogo/djpcms", "id": "d5f2026951943e339ba46872a97b8348c51a7c72", "size": "637", ...
from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = patterns('', # New, for P2 url(r'^$', 'acorta.views.homePage'), url(r'^favicon.ico/$', 'acorta.views.favicon'), url(r'(.*)/', 'acorta.views.GetShort'), # Old resources url(r'^createPage/$', 'acor...
{ "content_hash": "e1a84fe7738699ba9133686696aec115", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 61, "avg_line_length": 37.26315789473684, "alnum_prop": 0.635593220338983, "repo_name": "enavarromo/X-Serv-18.2-Practica2", "id": "4b9a0b1e4494bfbdfc2b41622c243af430c78552", ...
"""Update encrypted deploy password in Travis config file """ from __future__ import print_function import base64 import json import os from getpass import getpass import yaml from cryptography.hazmat.primitives.serialization import load_pem_public_key from cryptography.hazmat.backends import default_backend from cry...
{ "content_hash": "2eed292d6867165747875835b768e552", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 79, "avg_line_length": 30.958333333333332, "alnum_prop": 0.6812920592193809, "repo_name": "dilnoza92/chemical_shifts", "id": "818a6ea5a7b69a97858889097a5ae993f35b9c42", "s...
"""Provides access functions for the app identity service.""" import os from google.appengine.api import apiproxy_stub_map from google.appengine.api import memcache from google.appengine.api.app_identity import app_identity_service_pb from google.appengine.runtime import apiproxy_errors __all__ = ['BackendDea...
{ "content_hash": "79b57851d00735acc42600d2551a5e2c", "timestamp": "", "source": "github", "line_count": 458, "max_line_length": 80, "avg_line_length": 29.08951965065502, "alnum_prop": 0.6953388876379194, "repo_name": "bratsche/Neutron-Drive", "id": "d4f7f6c0e710f9f7e6d97308a5a48ebc04999430", "size"...
def __bootstrap__(): """ Import the code in ``noname_wrapped.not_py`` in file as our own name This is a simplified version of the wrapper that setuptools writes for dynamic libraries when installing. """ import os import imp here = os.path.join(os.path.dirname(__file__)) imp.load_source...
{ "content_hash": "25751d9bd0d8483e7976480138aee625", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 76, "avg_line_length": 32.75, "alnum_prop": 0.6564885496183206, "repo_name": "cloudera/hue", "id": "32c0bc5b979909c52ad724c8fac40ea3bb396b18", "size": "393", "binary": fa...
from . import verify from .aga_membership import get_aga_info from flask import abort, redirect, url_for, render_template, current_app from flask.ext.security import login_required from flask.ext.login import current_user from flask.ext.wtf import Form from flask.ext.mail import Message from sqlalchemy.sql import and_...
{ "content_hash": "7bbb0833cda3b93e24a51f613e0c599f", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 113, "avg_line_length": 34.801980198019805, "alnum_prop": 0.6691322901849218, "repo_name": "usgo/online-ratings", "id": "89804faad5e2066767ff0be7096709a06f4a8da3", "size":...
from __future__ import with_statement import cPickle as pickle import logging import os import sys import unittest import urlparse import signal from contextlib import contextmanager, nested, closing from gzip import GzipFile from shutil import rmtree import gc import time from urllib import quote from hashlib import m...
{ "content_hash": "6e5e83865fc31af8e8c1fa588ce4ad5e", "timestamp": "", "source": "github", "line_count": 6496, "max_line_length": 99, "avg_line_length": 46.24168719211823, "alnum_prop": 0.5008688820384438, "repo_name": "ctbrizhp/swift1.9.2", "id": "c3202a9059381574b9a22b477bea67eabb3cccb3", "size": ...
import numpy as np import pyproj import quantities as pq import pandas as pd import multiprocessing class QCFlags: """Primary flags for QARTOD.""" # Don't subclass Enum since values don't fit nicely into a numpy array. GOOD_DATA = 1 UNKNOWN = 2 SUSPECT = 3 BAD_DATA = 4 MISSING = 9 # Coul...
{ "content_hash": "0ac61ac58946fcb11ee4bcfea8eab48c", "timestamp": "", "source": "github", "line_count": 302, "max_line_length": 86, "avg_line_length": 39.32119205298013, "alnum_prop": 0.6272842105263158, "repo_name": "benjwadams/QARTOD", "id": "3d65aa06232e7b7bff435154fb6aa4fd082390bf", "size": "11...
""" package.py """ from trytond.model import fields from trytond.pool import PoolMeta, Pool from trytond.pyson import Eval, Or, Bool, Id from trytond.transaction import Transaction __metaclass__ = PoolMeta __all__ = ['Package'] class Package: __name__ = 'stock.package' tracking_number = fields.Function...
{ "content_hash": "1c69fb16e098e6b67ab5e93ae6c8a04f", "timestamp": "", "source": "github", "line_count": 187, "max_line_length": 73, "avg_line_length": 29.844919786096256, "alnum_prop": 0.5577853431284716, "repo_name": "tarunbhardwaj/trytond-shipping", "id": "d83d34d585d95207bc661817df6c2d9f069d4e71",...
import pandas as pd import numpy as np import pytest from .conftest import DATA_DIR, assert_series_equal from numpy.testing import assert_allclose from pvlib import temperature, tools from pvlib._deprecation import pvlibDeprecationWarning import re @pytest.fixture def sapm_default(): return temperature.TEMPERA...
{ "content_hash": "efce7cf2b286896878443448c020054d", "timestamp": "", "source": "github", "line_count": 452, "max_line_length": 79, "avg_line_length": 39.32079646017699, "alnum_prop": 0.5978169132954482, "repo_name": "pvlib/pvlib-python", "id": "5e36714d12959550f0472c5f76bca9ba00219299", "size": "1...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
{ "content_hash": "10debe172eeaa72ca14a01926f8cbdca", "timestamp": "", "source": "github", "line_count": 462, "max_line_length": 155, "avg_line_length": 33.24025974025974, "alnum_prop": 0.6756527967702025, "repo_name": "dulems/hue", "id": "c4f159d7071ff874963bb131ee470a69a51f9bc4", "size": "15357", ...
import json, os import tensorflow as tf from gym.spaces import Discrete, Box from utils import phis class BasicAgent(object): def __init__(self, config, env): if not 'best' in config: config['best'] = False if not 'debug' in config: config['debug'] = False if not 'm...
{ "content_hash": "16497fbd73ca135ed8b77c6bc8160632", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 144, "avg_line_length": 34.25, "alnum_prop": 0.579683698296837, "repo_name": "morgangiraud/openai-rl", "id": "ed7c3b5bc1c2fb6fb8f74ea1288f7ef9aea15a9f", "size": "4932", ...
""" Copyright 2013 The Trustees of Princeton University All Rights Reserved """ import urllib import urllib2 import os import sys import socket import select import time import BaseHTTPServer import SocketServer import urlparse import subprocess import cgi import threading import signal import getopt import urll...
{ "content_hash": "3fdb2288ce7589c5bf9198c7f00ee06a", "timestamp": "", "source": "github", "line_count": 600, "max_line_length": 161, "avg_line_length": 25.966666666666665, "alnum_prop": 0.5400513478818999, "repo_name": "iychoi/syndicate", "id": "fd421427d3d1c60f29afac13a4c844c85c46ab5e", "size": "1...
import sqlite3 from contextlib import closing from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash # configuration DATABASE = 'C:/Users/SilviyaSoti/PycharmProjects/SunnyGlasgow/sunny_glasgow.db' DEBUG = True SECRET_KEY = 'development key' USERNAME = 'admin' PASSWORD = 'default...
{ "content_hash": "5a8eea30e73d76f40b3cde4c5dd77482", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 94, "avg_line_length": 27, "alnum_prop": 0.6349843819723338, "repo_name": "ppyordanov/HCI_4_Future_Cities", "id": "b2c355cfcb8adb09710805b16332a9d8fc5a352d", "size": "2259"...
from django.contrib import admin from django.contrib.flatpages.admin import FlatPageAdmin from django.contrib.flatpages.models import FlatPage from cms.search.models import SearchKeyword class SearchKeywordInline(admin.StackedInline): model = SearchKeyword class FlatPageAdminWithKeywords(FlatPageAdmin): inlines ...
{ "content_hash": "8295ce38148150788c31609425a9e6ec", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 56, "avg_line_length": 28.933333333333334, "alnum_prop": 0.847926267281106, "repo_name": "davogler/davsite", "id": "fec87988f83f88a22484020124fb3b7a95d734f8", "size": "434"...
import os import argparse import payu from payu import cli from payu.experiment import Experiment from payu.laboratory import Laboratory import payu.subcommands.args as args from payu import fsops title = 'run' parameters = {'description': 'Run the model experiment'} arguments = [args.model, args.config, args.initia...
{ "content_hash": "4e4017ecce90e41f57e3924f4af957c4", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 76, "avg_line_length": 31.244897959183675, "alnum_prop": 0.6135423470498584, "repo_name": "aidanheerdegen/payu", "id": "c34e31fa39f01e6ba91e188d983587f33035b94a", "size": ...
import unittest, time, sys, copy sys.path.extend(['.','..','py']) import h2o, h2o_cmd, h2o_glm, h2o_hosts, h2o_browse as h2b, h2o_import as h2i class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): localhost = h2o.decide_if_loc...
{ "content_hash": "f36252105f5ce013ab1e7371df560d7b", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 98, "avg_line_length": 36.78688524590164, "alnum_prop": 0.5873440285204992, "repo_name": "janezhango/BigDataMachineLearning", "id": "37d93ea8aeee71acb1b3afa8bdf9abdc98ce79cc"...
import pytest import numpy as np from pySDC.core.Collocation import CollBase t_start = np.random.rand(1) * 0.2 t_end = 0.8 + np.random.rand(1) * 0.2 tolQuad = 1e-13 node_types = ['EQUID', 'LEGENDRE'] quad_types = ['GAUSS', 'LOBATTO', 'RADAU-RIGHT', 'RADAU-LEFT'] @pytest.mark.base @pytest.mark.parametrize("node_ty...
{ "content_hash": "b65c57f7babbf9622028cac9a0addfbd", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 127, "avg_line_length": 43.05882352941177, "alnum_prop": 0.5905542544886807, "repo_name": "Parallel-in-Time/pySDC", "id": "0f761b880c813baab65bd4d21cb554e8603e5ebf", "size...
""" Easy way of sending HTML mails using templates. ======= License ======= Copyright (c) 2015 Thomas Lehmann 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 withou...
{ "content_hash": "49133cb462b2127034f069d300859926", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 97, "avg_line_length": 38.22516556291391, "alnum_prop": 0.6690921690921691, "repo_name": "Nachtfeuer/concept-py", "id": "aed4f81fc18331d119802fce68b272ed849c3bb9", "size":...
""" Django settings """ from django.core.urlresolvers import reverse_lazy DEBUG = True TEMPLATE_DEBUG = DEBUG TESTING = False THUMBNAIL_DEBUG = DEBUG SESSION_COOKIE_SECURE = False CSRF_COOKIE_SECURE = False TEMPLATE_STRING_IF_INVALID = '**** INVALID EXPRESSION: %s ****' ADMINS = ( ('admin', 'code@pkimber.net'),...
{ "content_hash": "3c713c7a1dba7c8d6d39fe08bead5d27", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 88, "avg_line_length": 31.203488372093023, "alnum_prop": 0.7063536426308925, "repo_name": "pkimber/blog", "id": "17229e496ac8bfcfea64fb600d10c782b9c98f55", "size": "5393",...
import numpy as np class MetropolisHastings(object): """Implementation of the Metropolis-Hastings algorithm to efficiently sample from a desired probability distributioni for which direct sampling is difficult. """ def __init__(self, target, data, iterations=1000): """Instantiate a *Metro...
{ "content_hash": "1a5e4d2768c7004ab3d27990aaa50213", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 79, "avg_line_length": 35.28915662650602, "alnum_prop": 0.6073745305565039, "repo_name": "IamGianluca/algorithms_collection", "id": "062c72b5a160316607e60c02eb5940db731c22cb"...
from __future__ import absolute_import, division, print_function import tempfile import operator as op import pytest import numpy as np from mock import MagicMock from glue.tests.helpers import requires_astropy from .. import DataCollection, ComponentLink from ..data import Data, Component from ..message import Sub...
{ "content_hash": "cb1d1047b5a92d3395db3d0dec8de890", "timestamp": "", "source": "github", "line_count": 624, "max_line_length": 79, "avg_line_length": 29.104166666666668, "alnum_prop": 0.577996806343263, "repo_name": "saimn/glue", "id": "a0aa3b308c9b410d3c91cf1b5b7725a8bb481fd9", "size": "18216", ...
"""Variational Autoencoder example on binarized MNIST dataset.""" from typing import Any, Iterator, Mapping, NamedTuple, Sequence, Tuple from absl import app from absl import flags from absl import logging import distrax import haiku as hk import jax import jax.numpy as jnp import numpy as np import optax import ten...
{ "content_hash": "0048a99ca0f30543aee7b61bcc1a545f", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 80, "avg_line_length": 29.51123595505618, "alnum_prop": 0.6605749095754807, "repo_name": "deepmind/distrax", "id": "93e8eb482fa4c30918d647acea2871c351497bba", "size": "594...
from pipetrans.errors import PipelineError, CommandError from pipetrans.operator import OperatorFactory from pipetrans.utils import list_sort _commands = {} class CommandFactory(object): @staticmethod def new(value, schema): if not isinstance(value, dict): raise PipelineError("pipeline e...
{ "content_hash": "5b453d8962d7a7778f18489177f2ca0c", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 95, "avg_line_length": 31.10091743119266, "alnum_prop": 0.5911504424778761, "repo_name": "junkainiu/mongodb-to-elasticsearch", "id": "ccbaa418ea1a0292599e47264e1870b6f076441...
'''Tests for craigslist blob benchmark module.''' import clblob.benchmark import clcommon.config import test CONFIG = clcommon.config.update(clblob.benchmark.DEFAULT_CONFIG, { 'clblob': { 'benchmark': { 'deletes_per_thread': 10, 'gets_per_thread': 10, 'puts_per_thread':...
{ "content_hash": "b0a0d8c8f07292b8284f395bd580ca5c", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 70, "avg_line_length": 33.53703703703704, "alnum_prop": 0.6399779127553837, "repo_name": "pdfernhout/python-clblob", "id": "d3431d86fa67ce3ef0dadb99c51a7cbf8e3517b6", "size...
"""This program plots the average electronic energy during a NAMD simulation averaged over several initial conditions. It plots both the SH and SE population based energies. Example: plot_cooling.py -p . -nstates 26 -nconds 6 Note that the number of states is the same as given in the pyxaid output. It must includ...
{ "content_hash": "5062612b2e93c0132882e19a7abf61f2", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 189, "avg_line_length": 40.24375, "alnum_prop": 0.6165553657400218, "repo_name": "SCM-NV/qmworks-namd", "id": "20736477a23456e91d8ce40505fa8b3591493959", "size": "6461", ...
import sys import os import unittest import importlib import argparse def discover_tests(directory, callback): do_insert = True for _f in os.listdir(directory): f = "%s/%s" % (directory, _f) if os.path.isdir(f): discover_tests(f, callback) continue if not os.pat...
{ "content_hash": "c74ccd892d4bd98311e9c288f7e5115b", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 68, "avg_line_length": 31.94871794871795, "alnum_prop": 0.5280898876404494, "repo_name": "FDio/vpp", "id": "0eaa149d0db2fd41cffbaa414756c813c18aa980", "size": "1270", "bi...
__version__ = "1.05" __project_url__ = "https://github.com/amoffat/sh" import platform if "windows" in platform.system().lower(): raise ImportError("sh %s is currently only supported on linux and osx. \ please install pbs 0.110 (http://pypi.python.org/pypi/pbs) for windows \ support." % __version__) import s...
{ "content_hash": "c34166ea3bda3ad6cf8f1517306617f5", "timestamp": "", "source": "github", "line_count": 1519, "max_line_length": 121, "avg_line_length": 35.69585253456221, "alnum_prop": 0.560289181513039, "repo_name": "hacosta/python-sh", "id": "edfdfb774c9776ec11970d2d5e02e662b9e389ea", "size": "5...
import os import sys import numpy sys.path.append('./code') sys.path.append('./code/trlda') from distutils.core import setup, Extension from distutils.ccompiler import CCompiler from utils import parallelCCompiler from python import __version__ if 'darwin' in sys.platform: libraries = [] extra_compile_args = ['-st...
{ "content_hash": "e6e8fb41192c821547fbb9079c929d41", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 105, "avg_line_length": 27.416666666666668, "alnum_prop": 0.6788247213779128, "repo_name": "lucastheis/trlda", "id": "7fcf336f096811bf1d3bebd8927ca23c362732b5", "size": "19...
""" Test configuration. """ import pytest @pytest.fixture def random(): pass def pytest_addoption(parser): parser.addoption( '--repeat-random', metavar='NUM', dest='repeat_random', type=int, default=10, help='Number of times to repeat randomized tests') def pytest_generate_tests(metafunc...
{ "content_hash": "ba4397d1b2bfb5ca4540bd8efd7453be", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 73, "avg_line_length": 22.75, "alnum_prop": 0.6886446886446886, "repo_name": "martijnvermaat/interval-binning", "id": "3e61fbf6aedf2ff5bb081431a47f81d8058481bc", "size": "5...
from django.template.defaultfilters import slugify from lingcod.straightline_spacing.models import * import lingcod.intersection.views as int_views import xlwt def spacing_workbook(in_dict, ws_title): wb = xlwt.Workbook(encoding='utf-8') ws = wb.add_sheet('spacing_matrix') ws = spacing_worksheet(in_dict, w...
{ "content_hash": "038cff3cfa389ea126bd091100c082e8", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 59, "avg_line_length": 34.08571428571429, "alnum_prop": 0.6563285834031852, "repo_name": "google-code-export/marinemap", "id": "fd567c03e77b436d5ef55d652b5de0387ccbafec", "...
from types import SimpleNamespace from typing import Dict from unittest.mock import MagicMock, patch from django.http import HttpRequest from django.http.response import HttpResponse from zerver.actions.streams import do_rename_stream from zerver.decorator import webhook_view from zerver.lib.exceptions import Invalid...
{ "content_hash": "3a177cd6670cda9d46ecf3c085cb9690", "timestamp": "", "source": "github", "line_count": 215, "max_line_length": 178, "avg_line_length": 42.986046511627904, "alnum_prop": 0.6653321791819953, "repo_name": "zulip/zulip", "id": "1112c4d5c0da97c00314e9e58111c0dd498d1b1b", "size": "9242",...
from .base_match import BaseMatchAdapter class ClosestMeaningAdapter(BaseMatchAdapter): """ This adapter selects a response by comparing the tokenized form of the input statement's text, with the tokenized form of possible matching statements. For each possible match, the sum of the Cartesian product ...
{ "content_hash": "cab4e8a79c1413a0f090cbfa9fae61b5", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 77, "avg_line_length": 35.583333333333336, "alnum_prop": 0.6276346604215457, "repo_name": "osDanielLee/SelfThinkingRobot", "id": "fcc2d8317ca937a16ecf4926a3b266c56583e741", ...
import collections from supriya import CalculationRate from supriya.ugens.UGen import UGen class Convolution2L(UGen): """ Strict convolution with fixed kernel which can be updated using a trigger signal. :: >>> source = supriya.ugens.In.ar(bus=0) >>> kernel = supriya.ugens.Mix.new( ...
{ "content_hash": "60d6b32941e66895700012da988ad0c1", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 85, "avg_line_length": 25.522727272727273, "alnum_prop": 0.5253784505788067, "repo_name": "Pulgama/supriya", "id": "f483fe20f276f45ad595208fa15116324e90e7c3", "size": "1123...
import datetime import httplib import json import time import uuid import requests base_url = "https://127.0.0.1:8445" def create_database(host, db): url = "%s/%s" % (host, db) response = requests.get(url) if response.status_code == httplib.OK: response = requests.delete(url) if respons...
{ "content_hash": "707ef3775d35f631d0dc5f4b396ad0e2", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 99, "avg_line_length": 25.92485549132948, "alnum_prop": 0.5612040133779265, "repo_name": "simonsdave/yar", "id": "87cb9ddb874094b210a760c0f9e1be6f3fb10f68", "size": "4508"...
class Solution: # @param board, a list of lists of 1 length string # @param word, a string # @return a boolean def exist(self, board, word): if len(board) ==0: return False if len(board[0]) == 0: return False m = len(board) n = len(board[0]) ...
{ "content_hash": "0148867ca424902704c660ff39af6d27", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 89, "avg_line_length": 39.706896551724135, "alnum_prop": 0.4181502388189318, "repo_name": "lijunxyz/leetcode_practice", "id": "f4faaa61bad77d07a82761e1e1583c30df59563b", "s...
import _plotly_utils.basevalidators class SizeValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="size", parent_name="image.hoverlabel.font", **kwargs ): super(SizeValidator, self).__init__( plotly_name=plotly_name, parent_name=pare...
{ "content_hash": "e16973496de34eb0f2c076a93f9d806d", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 79, "avg_line_length": 33.666666666666664, "alnum_prop": 0.5801980198019802, "repo_name": "plotly/plotly.py", "id": "62fd27c78fb43f5d578d8eca72b899b9aa89b620", "size": "505...
import logging import numpy as np import scipy.ndimage from sklearn.utils import check_random_state # from sklearn.cross_validation import KFold, StratifiedKFold logger = logging.getLogger('yatsm') def kfold_scores(X, y, algo, kf_generator): """ Performs KFold crossvalidation and reports mean/std of scores ...
{ "content_hash": "4cc2dc1ce655a5feea854393b1ba0c9c", "timestamp": "", "source": "github", "line_count": 216, "max_line_length": 79, "avg_line_length": 34.458333333333336, "alnum_prop": 0.6079537820771195, "repo_name": "valpasq/yatsm", "id": "d0641d2cce13f9e5b54f0ce81f59413ae4c2a7a4", "size": "7443"...
import unittest import os import comm class TestCrosswalkApptoolsFunctions(unittest.TestCase): def test_list_target_platforms(self): comm.setUp() os.chdir(comm.XwalkPath) cmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app platforms" status = os.popen(cmd).readlines() ...
{ "content_hash": "67cb4673904c6a85d0cbd766075e276b", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 75, "avg_line_length": 29.941176470588236, "alnum_prop": 0.6444007858546169, "repo_name": "JianfengXu/crosswalk-test-suite", "id": "13201f120c3406a7cc90831eae8b5a25392ea7ad",...
import os from constants import BLACKLIST class Blacklist: def __init__(self): self.file_handler = open(BLACKLIST, 'a+') def __del__(self): self.file_handler.close() def insert(self, host): self.file_handler.write(host + '\n') def get_hosts(self): self.file_handler....
{ "content_hash": "fca7d008080c118e972ef7cb631e31cd", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 49, "avg_line_length": 21.15, "alnum_prop": 0.6004728132387707, "repo_name": "thomas-sterrenburg/fingerprinting-python", "id": "3db7241825ac243c5c69aba2b2b38c1f71fbb051", "...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.contrib.auth import models as auth_models from django.core.management import call_command from django.db import models class Migration(DataMigration): depends_on = ( ("openduty", "0005...
{ "content_hash": "12b4439eac3c4407b8174a2e80eeda12", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 195, "avg_line_length": 67.3125, "alnum_prop": 0.5546270504487775, "repo_name": "ustream/openduty", "id": "0232a6c1c26b5e4a295e9e07cf5a63aa47b49242", "size": "9717", "bi...
import os from pathlib import Path import jinja2 import aiohttp_jinja2 from . import views from . import panels from .middlewares import middleware from .utils import APP_KEY, TEMPLATE_KEY, STATIC_ROUTE_NAME, hexlify, \ ToolbarStorage, ExceptionHistory from .views import ExceptionDebugView default_panel_names = ...
{ "content_hash": "2a8e63802c249764324c7f0179033c25", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 79, "avg_line_length": 33.62280701754386, "alnum_prop": 0.627967649360814, "repo_name": "aio-libs/aiohttp_debugtoolbar", "id": "d0f8b2cf675872b6b4ea7c12c06ba36373983c1b", ...
"""Compatibility code for using CherryPy with various versions of Python. CherryPy 3.2 is compatible with Python versions 2.3+. This module provides a useful abstraction over the differences between Python versions, sometimes by preferring a newer idiom, sometimes an older one, and sometimes a custom one. In particul...
{ "content_hash": "126d4bbdb4fbce4a1228d76c9aaf7c4a", "timestamp": "", "source": "github", "line_count": 341, "max_line_length": 89, "avg_line_length": 30.882697947214076, "alnum_prop": 0.6588168265122021, "repo_name": "bmbove/omxremote", "id": "a9740f586ce335347301c7cfb6d425d83b57c262", "size": "10...
"""Glue between metadata sources and the matching logic.""" from __future__ import (division, absolute_import, print_function, unicode_literals) from collections import namedtuple import re from beets import logging from beets import plugins from beets import config from beets.autotag import m...
{ "content_hash": "1914cb79d724d1dbb3eff608427599ee", "timestamp": "", "source": "github", "line_count": 595, "max_line_length": 78, "avg_line_length": 34.924369747899156, "alnum_prop": 0.6020692974013474, "repo_name": "kelvinhammond/beets", "id": "6b654573fb8daa2082d5c53db34abf455859cc0b", "size": ...
import unittest import sys import os from cStringIO import StringIO import aclgen class Test_AclGen(unittest.TestCase): def setUp(self): # Capture output during tests. self.iobuff = StringIO() sys.stderr = sys.stdout = self.iobuff def tearDown(self): sys.stdout = sys.__stdout__ sys.stderr = ...
{ "content_hash": "988f7d96682ec785e5682355339eb2d2", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 104, "avg_line_length": 30.29850746268657, "alnum_prop": 0.7576354679802956, "repo_name": "pettai/capirca", "id": "7dc3e91170cd6b9dfffa4e1c056f03321cccdcf1", "size": "2643"...
DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'bsblog_test', ...
{ "content_hash": "bd9f53d079394a660017ba80144dfd9f", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 120, "avg_line_length": 34.896103896103895, "alnum_prop": 0.6831038332713063, "repo_name": "jmichalicek/bsblog", "id": "473a05635578175156806fddcdf5352ab6d0c735", "size": ...
"""Objects representing obsolete MediaWiki sites.""" # # (C) Pywikibot team, 2019-2022 # # Distributed under the terms of the MIT license. # import pywikibot from pywikibot.exceptions import NoPageError from pywikibot.site._apisite import APISite from pywikibot.site._basesite import BaseSite class RemovedSite(BaseSit...
{ "content_hash": "ea8976e23ba6be5578f802df3ba053f5", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 75, "avg_line_length": 35.74074074074074, "alnum_prop": 0.5709844559585492, "repo_name": "wikimedia/pywikibot-core", "id": "c5f0a50e5d783ebb6cf3a5eac5ca29231d4a5dad", "size...
import html import json import re import unittest.mock import urllib.parse import pytest from freezegun import freeze_time from airflow import settings from airflow.exceptions import AirflowException from airflow.executors.celery_executor import CeleryExecutor from airflow.models import DAG, DagBag, DagModel, TaskFai...
{ "content_hash": "9144406e79b14fc8e75cf5906bf4a58a", "timestamp": "", "source": "github", "line_count": 954, "max_line_length": 109, "avg_line_length": 35.287211740041926, "alnum_prop": 0.6202174429657795, "repo_name": "Acehaidrey/incubator-airflow", "id": "d99a8fd5cacdcb9bac52d6dd79895f10797a72fd", ...
"""Discrete synthesis from a dummy abstraction with uncontrolled switching. This is an example to demonstrate how the output of the TuLiP discretization for a system with uncontrollable switching (i.e., modes are controlled by the environment) might look like. We will assume, we have the 6 cell robot example. +...
{ "content_hash": "8c62c17978b34810e5d289a57cc16659", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 82, "avg_line_length": 31.85, "alnum_prop": 0.6398295581969051, "repo_name": "tulip-control/tulip-control", "id": "bee7f4fab2e165ec18db31cf69e38c9b387fd77d", "size": "4481...
from collections import OrderedDict from typing import Dict, Type from .base import ControlServiceTransport from .grpc import ControlServiceGrpcTransport from .grpc_asyncio import ControlServiceGrpcAsyncIOTransport # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[Control...
{ "content_hash": "60088350b51e5a6dd56adb3a5bf3b910", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 85, "avg_line_length": 34.88235294117647, "alnum_prop": 0.8094435075885329, "repo_name": "googleapis/python-retail", "id": "76a489d3a89df811f80681224670b918c05db12f", "size...
"""Tensorflow utility functions to compute normals on meshes.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from six.moves import range import tensorflow as tf from tensorflow_graphics.geometry.representation import triangle from t...
{ "content_hash": "4d95df26384eab48787c35c5770b7f95", "timestamp": "", "source": "github", "line_count": 231, "max_line_length": 80, "avg_line_length": 38.37229437229437, "alnum_prop": 0.649481046931408, "repo_name": "tensorflow/graphics", "id": "693293dca0eedc261b597918965b4bffe4e45caf", "size": "9...
import plenario import weather import metar from metar.metar import Metar, ParserError from plenario.database import task_session as session, task_engine as engine, Base from sqlalchemy import Table, select, func, and_, distinct from sqlalchemy import event from sqlalchemy.engine import Engine import sys #import grequ...
{ "content_hash": "ba3ae10b44ec24a1e4d08a91276283a2", "timestamp": "", "source": "github", "line_count": 357, "max_line_length": 402, "avg_line_length": 34.0672268907563, "alnum_prop": 0.6299128432823549, "repo_name": "dssg/plenario", "id": "97b3ec32cfbf2358563b97e008a1dc4b1a66e1d8", "size": "12162"...
from collections import deque from itertools import count, cycle import lang_ast class InfiniteList(object): def __init__(self): self._iter = None self.filters = [] self.prepends = deque() def __repr__(self): rtn = "" for func, args, kwargs in self.filters: ...
{ "content_hash": "ea0150144d2f3eb746413dcebd44a9ab", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 68, "avg_line_length": 25.407185628742514, "alnum_prop": 0.5114305915625736, "repo_name": "muddyfish/PYKE", "id": "0441908fdcb1bc883038e5731101fa874c3d72f4", "size": "4243...
""" Watch for pkgs that have upgrades, then fire an event. .. versionadded:: 2016.3.0 """ import logging __virtualname__ = "pkg" log = logging.getLogger(__name__) def __virtual__(): """ Only load if strace is installed """ if "pkg.upgrade_available" in __salt__: return __virtualname__ e...
{ "content_hash": "5f897888b389e94db95709535b03c667", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 75, "avg_line_length": 27.673267326732674, "alnum_prop": 0.5338103756708408, "repo_name": "saltstack/salt", "id": "2613f41a61fc92bb9160d4d94b3058e4c44bb7f9", "size": "2795...
import numpy as np def design_matrix(t, frequency, dy=None, bias=True, nterms=1): """Compute the Lomb-Scargle design matrix at the given frequency This is the matrix X such that the periodic model at the given frequency can be expressed :math:`\\hat{y} = X \\theta`. Parameters ---------- t :...
{ "content_hash": "134784a6d8c728d93a2e22a30f29facb", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 88, "avg_line_length": 30.21904761904762, "alnum_prop": 0.6047904191616766, "repo_name": "pllim/astropy", "id": "79fd4ce970dc939138782be0db48432c7d595027", "size": "3173",...
import cmd, json, getopt import bstamp.api as api import bstamp.authentication as authentication # Command interpreter for Bitstamp API class BitstampCmd(cmd.Cmd): # session data # ============ nonce = 0 api_key = "X" api_secret = "X" client_id = "X" # overriding interpreter setup # ========================...
{ "content_hash": "fe329355b864182bb7eb6af7d4e77166", "timestamp": "", "source": "github", "line_count": 257, "max_line_length": 89, "avg_line_length": 30.80933852140078, "alnum_prop": 0.6286941146754231, "repo_name": "socec/bitstamp-simple", "id": "4d061e7db6e36b4ff9a117ff09ad408c3a76b884", "size":...
import logging import getopt import sys import couchapp.commands as commands from couchapp.errors import AppError, CommandLineError from couchapp.config import Config logger = logging.getLogger(__name__) class NullHandler(logging.Handler): """ null log handler """ def emit(self, record): pass def se...
{ "content_hash": "f6188f5c180f0e264266b4d7cdff1bdf", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 72, "avg_line_length": 26.694610778443113, "alnum_prop": 0.5610139075818753, "repo_name": "dustin/couchapp", "id": "100f144d7993474c983a183f973757c47d1ce5d3", "size": "459...
from . import wechat_pos from . import wechat_micropay from . import wechat_order from . import pos_config
{ "content_hash": "8bd2962f0c5f70e9482b3ba0844259b0", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 29, "avg_line_length": 26.75, "alnum_prop": 0.7757009345794392, "repo_name": "it-projects-llc/pos-addons", "id": "924296e36c0fadb76a005c6abe38c63df61f99c8", "size": "160", ...
import instrument import sys import dis def trace(frame, a, b): print frame.f_locals return lambda _1, _2, _3: None class Point: def __init__(self, x, y): self.x = x self.y = y def l1_distance(p1, p2): bar = "bar!" return abs(p1.x - p2.x) + abs(p1.y - p2.y) code = compile("""...
{ "content_hash": "eda04d8a3b582078c6f930043757c940", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 85, "avg_line_length": 27.285714285714285, "alnum_prop": 0.6034031413612565, "repo_name": "etosch/pyInstrument", "id": "9867044a2469eef2537635402cb4089a0df78f69", "size": "...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/component/armor/shared_armor_segment_enhancement_brackaset.iff" result.attribute_template_id = -1 result.stfName("craft_armor_ingredients_n","armor_segment_enhancement_brackaset") #### BEGIN MODIFICATIONS #...
{ "content_hash": "817688100cfbb58891b8b3964f2af344", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 99, "avg_line_length": 28.53846153846154, "alnum_prop": 0.7331536388140162, "repo_name": "obi-two/Rebelion", "id": "f7eb8bbfc16c87f0444d5385ed466f213f468891", "size": "516"...
import csnUtility import csnProject import csnBuild import os.path import inspect from csnProject import GenericProject class StandardModuleProject(GenericProject): """ GenericProject with applications and modules in specific folders. """ def __init__(self, _name, _type, _sourceRootFolder = None, _categories ...
{ "content_hash": "cf5e775fa0501517b3241ddd06db5747", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 173, "avg_line_length": 59.06611570247934, "alnum_prop": 0.6405484818805093, "repo_name": "csnake-org/CSnake", "id": "19f52f85daf8829c31e20cdea65ff18de36cfde9", "size": "7...
"""Test file manipulation functionality of Item. """ import shutil import os import stat from os.path import join import _common from _common import unittest from _common import item, touch import beets.library from beets import util class MoveTest(unittest.TestCase, _common.ExtraAsserts): def setUp(self): ...
{ "content_hash": "056a5407df9f2cd052477ce0a0a71d13", "timestamp": "", "source": "github", "line_count": 584, "max_line_length": 79, "avg_line_length": 34.20034246575342, "alnum_prop": 0.5945025784809492, "repo_name": "karlbright/beets", "id": "d0cd3615fc055752c7231e59f280ec729e8f567c", "size": "206...
""" Support for OpenWRT (ubus) routers. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.ubus/ """ import json import logging import re import requests import voluptuous as vol import homeassistant.helpers.config_validation as cv from home...
{ "content_hash": "ca059322440f2e2870881accba2fb503", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 79, "avg_line_length": 33.140449438202246, "alnum_prop": 0.5648414985590778, "repo_name": "LinuxChristian/home-assistant", "id": "9ccc61dffc91fff67f9f34b15aa856ab51a81a4c", ...
from django.conf.urls import url from django.contrib.auth.decorators import login_required as auth from . import views urlpatterns = [ url(r'^$', views.index, name='index'), #url(r'^news/$', views.news, name='news'), url(r'^news/$', views.HomeView.as_view(), name='news'), url(r'^latest/$', views.lat...
{ "content_hash": "4e8a8343a44e07221ddd1ae72ae6f97c", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 148, "avg_line_length": 35.15, "alnum_prop": 0.5917496443812233, "repo_name": "janusnic/dj-21v", "id": "0f97683c848d4a4dfedead735b11c27543317c11", "size": "703", "binary"...
from . import application from . import mqtt from . import windows from . import external from . import network def main(): application.init() network.init() mqtt.init() windows.init() external.init() application.main_loop() if __name__ == "__main__": main()
{ "content_hash": "2ef868923f94d06107304336c64bff2b", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 27, "avg_line_length": 16.166666666666668, "alnum_prop": 0.6323024054982818, "repo_name": "oconnor663/fbmessenger", "id": "db98d62f390b295966827ebd07edc469888968c2", "size"...
from unittest import TestCase as MyTest import unittest class RenamedImportTests(MyTest): def test_renamed_import_pass(self): pass def test_renamed_import_fail(self): self.assertTrue(False, "Force a failure in renamed import test.") if __name__ == '__main__': unittest.main()
{ "content_hash": "2a01ab654d9a2431c4eb03d7f629e1cc", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 73, "avg_line_length": 25.583333333333332, "alnum_prop": 0.6840390879478827, "repo_name": "DinoV/PTVS", "id": "91e648454815b987edff8f9f16b3ac0c970b9117", "size": "307", "...
from django.contrib.contenttypes.models import ContentType from wagtail import hooks from wagtail.coreutils import safe_snake_case from wagtail.models import UserPagePermissionsProxy, get_page_models _FORM_CONTENT_TYPES = None def get_field_clean_name(label): """ Converts a user entered field label to a str...
{ "content_hash": "2c9ec0096fd3c2e8130cb01191779f8c", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 91, "avg_line_length": 30.681818181818183, "alnum_prop": 0.6977777777777778, "repo_name": "rsalmaso/wagtail", "id": "167ea834881983a3b69eaf21e61462acaa76f420", "size": "135...
''' ''' # TODO Windows Vista: need to call SetProcessDPIAware? May affect GDI+ calls # as well as font. from ctypes import * import ctypes import math from sys import byteorder import pyglet from pyglet.font import base from pyglet.font import win32query import pyglet.image from pyglet.libs.win32.constants import *...
{ "content_hash": "8b8d278f8419fbbb05d9dab17af64971", "timestamp": "", "source": "github", "line_count": 445, "max_line_length": 78, "avg_line_length": 33.885393258426966, "alnum_prop": 0.6105179388553618, "repo_name": "shadowmint/nwidget", "id": "24de770edd566bae1e7d657616dafc9eb793fbb1", "size": "...