text
stringlengths
4
1.02M
meta
dict
""" Tests for L{game.network} (Network support for Game). """ import numpy from twisted.trial.unittest import TestCase from twisted.internet.defer import Deferred from twisted.internet.task import Clock from game.test.util import ( ArrayMixin, PlayerCreationMixin, PlayerVisibilityObserver) from game.environment ...
{ "content_hash": "b79393077da79d11b59254908d9d0d23", "timestamp": "", "source": "github", "line_count": 788, "max_line_length": 80, "avg_line_length": 35.81979695431472, "alnum_prop": 0.6233968681357613, "repo_name": "eriknelson/gam3", "id": "f8982ec9ec2d6c07cc3a4b9389c2200ee6506689", "size": "2822...
"""CodeShare URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
{ "content_hash": "26999a01ef09727ccdfb1a2b6acc7a2a", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 82, "avg_line_length": 38.733333333333334, "alnum_prop": 0.7185886402753873, "repo_name": "xSash/SocialMediaProject", "id": "791e6f13ebecc19d6461ae2a7799f93d3562a89f", "siz...
import SimpleHTTPServer import threading import SocketServer import datetime import urllib import json from core.term_test import TermTestManage from core.flow import Flow #import chronic #from pprint import pprint #import hadoop.hadoopget DATE_FORMAT = '%Y-%m-%d' TERM_FILE = 'data/term_list.txt' DIM_FILE = 'data/di...
{ "content_hash": "5e0de194794ee95daa79c1bc82db3701", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 75, "avg_line_length": 22.693693693693692, "alnum_prop": 0.6010321556173085, "repo_name": "gjgj821/traffic_prediction", "id": "19968493eeda49a228daf042eadf3ade6b753d02", "...
""" Fast cryptographic hash of Python objects, with a special case for fast hashing of numpy arrays. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. import warnings import pickle import hashlib import sys import types import ...
{ "content_hash": "19ea99c6c0abb4c5a44fe1040dd8adf4", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 75, "avg_line_length": 34.66326530612245, "alnum_prop": 0.5787459523108626, "repo_name": "jmargeta/scikit-learn", "id": "01e90aea4718e0385d3b9c66f83eb324ca17d151", "size":...
""" Resource PDF Tools @see: U{B{I{S3XRC}} <http://eden.sahanafoundation.org/wiki/S3XRC>} @requires: U{B{I{ReportLab}} <http://www.reportlab.com>} ###################################################################### DEPRECATION WARNING This class is being replaced by the S3RL_PDF codec In...
{ "content_hash": "cefe4a179381ac0de80688565e870b87", "timestamp": "", "source": "github", "line_count": 4402, "max_line_length": 220, "avg_line_length": 44.73103134938664, "alnum_prop": 0.41562471433069587, "repo_name": "mrGeen/eden", "id": "a778674eb8f02f7704e794a4edfbfcabad8f2e8e", "size": "19693...
""" Flask-User ========== .. image:: https://img.shields.io/pypi/v/Flask-User.svg :target: https://pypi.python.org/pypi/Flask-User .. image:: https://img.shields.io/travis/lingthio/Flask-User.svg :target: https://travis-ci.org/lingthio/Flask-User .. image:: https://img.shields.io/pypi/dm/Flask-User.svg :...
{ "content_hash": "a9cb5bbb4149e129537fa817ddbd2367", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 158, "avg_line_length": 36, "alnum_prop": 0.6629901960784313, "repo_name": "sundisee/Flask-User", "id": "29a394edb65d7ca493daf0d4bae2ab5ea47eb97b", "size": "4896", "bina...
from __future__ import unicode_literals import copy import os import re import sys from io import BytesIO from pprint import pformat from django.conf import settings from django.core import signing from django.core.exceptions import DisallowedHost, ImproperlyConfigured from django.core.files import uploadhandler from...
{ "content_hash": "e1b3e6720ae52805fba817585cd91742", "timestamp": "", "source": "github", "line_count": 533, "max_line_length": 135, "avg_line_length": 36.20637898686679, "alnum_prop": 0.5884029433101876, "repo_name": "frederick-masterton/django", "id": "4f272ec2c7024443b8e636b757b2463069663ae0", "...
import os import h5py import numpy from fuel.converters.base import fill_hdf5_file, check_exists TRAIN_FILE = 'binarized_mnist_train.amat' VALID_FILE = 'binarized_mnist_valid.amat' TEST_FILE = 'binarized_mnist_test.amat' ALL_FILES = [TRAIN_FILE, VALID_FILE, TEST_FILE] @check_exists(required_files=ALL_FILES) def ...
{ "content_hash": "c3ae82e3fae0cede2840d2dee649dcaa", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 74, "avg_line_length": 32.906976744186046, "alnum_prop": 0.6586572438162545, "repo_name": "ejls/fuel", "id": "7a772927f889fc03d672a20fd477ce8feb25e24d", "size": "2830", "...
from swampdragon import route_handler from swampdragon.route_handler import ModelRouter, BaseRouter import time from dataset_manager.enums import ComputingStateType from dataset_manager.facades import DatasetFacade, VideoFacade from dataset_manager.dragon_serializers import DatasetSerializer, VideoSerializer, FeaturesS...
{ "content_hash": "9c45c1992a9f23827fc8b78ad91b2e4b", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 164, "avg_line_length": 39.5125, "alnum_prop": 0.6962986396709901, "repo_name": "dumoulinj/ers", "id": "58e1348879b1c0f015810578eaa0d396bd99e53d", "size": "3161", "binary...
import csv import json import requests from django.core.exceptions import ObjectDoesNotExist from Manager.models import catagories from django.core.management.base import BaseCommand class Command(BaseCommand): """docstring for Command. There is actually no use for this anymore. This was usefull when #5 ...
{ "content_hash": "49396ee6bcb1eff229b3d518ddad11d0", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 76, "avg_line_length": 28.529411764705884, "alnum_prop": 0.6078350515463917, "repo_name": "OGKevin/ComBunqWebApp", "id": "9dc3951fc710c4aa1e8f1a0603003d29e93d86a2", "size":...
""" Skype4Py distutils script. Copyright (c) 2007-2009, Arkadiusz Wahlig All rights reserved. Distributed under the BSD License, see the accompanying LICENSE file for more information. """ import os import sys from setuptools import setup from distutils.cmd import Command from distutils.command.install_lib import...
{ "content_hash": "46d28e3c7610b3af5f04dd3d2a4319be", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 87, "avg_line_length": 30.923076923076923, "alnum_prop": 0.5887230514096186, "repo_name": "awahlig/skype4py", "id": "24e47f36b84d9bb3e894003a6ac09a1271c47912", "size": "48...
from freezegun import freeze_time import io import os import unittest import json from pathlib import Path from unittest.mock import patch, Mock from IdentityRecordedFuture import Actions, Client, period_to_date import vcr as vcrpy CASSETTES = Path(__file__).parent / "test_data" DATETIME_STR_VALUE = "2021-12-08T12:10...
{ "content_hash": "f621e7d42d59c5a42a2479bd8e641d26", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 91, "avg_line_length": 31.87878787878788, "alnum_prop": 0.6279467680608365, "repo_name": "demisto/content", "id": "e3f582db9f52c7965c8385e8f4e034771b0a9f42", "size": "5260...
import argparse import itertools import logging import uuid import mock from oslo_config import cfg from oslo_config import fixture as config from oslo_serialization import jsonutils import requests import six from testtools import matchers from keystoneclient import adapter from keystoneclient.auth import base from ...
{ "content_hash": "4df1f12025ed0ae3d03c99f5ef633ed8", "timestamp": "", "source": "github", "line_count": 1069, "max_line_length": 79, "avg_line_length": 36.56969130028064, "alnum_prop": 0.6004143964392602, "repo_name": "klmitch/python-keystoneclient", "id": "b72a1858c78058feb436541828c9d56a84f36a03", ...
from django.contrib import admin from django.contrib.auth.admin import UserAdmin as UserAdminBase from huxley.accounts.models import User class UserAdmin(UserAdminBase): model = User fieldsets = UserAdminBase.fieldsets + ( ('BMUN-Specific Information', { 'fields': ( 'user_...
{ "content_hash": "9041396ef72daf66c6a9cd250f087e94", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 64, "avg_line_length": 22.65, "alnum_prop": 0.5894039735099338, "repo_name": "ctmunwebmaster/huxley", "id": "5603fe1826f639674e7350567e12c2edb3d255c7", "size": "625", "bi...
__author__ = 'jeffrey creighton & anand patel' # Purpose: to collect and store scores from all players and matches import ScorekeeperHistoryItem import ScoreKeeperListItem class Scorekeeper: leader_board = [] match_history = [] def __init__(self): self.leader_board = [] self.match_histor...
{ "content_hash": "981365829cf309a0058a4729684ce641", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 98, "avg_line_length": 33.36363636363637, "alnum_prop": 0.628519527702089, "repo_name": "PaulieC/sprint1_Council", "id": "811a8b3c88024206042be7c6eb8bfa931154204d", "size":...
<<<<<<< HEAD <<<<<<< HEAD """CodeContext - Extension to display the block context above the edit window Once code has scrolled off the top of a window, it can be difficult to determine which block you are in. This extension implements a pane at the top of each IDLE edit window which provides block structure hints. T...
{ "content_hash": "8da1d871bb6f468cef7981ab93bed7d2", "timestamp": "", "source": "github", "line_count": 534, "max_line_length": 80, "avg_line_length": 47.161048689138575, "alnum_prop": 0.5758815120711563, "repo_name": "ArcherSys/ArcherSys", "id": "f56b5c8ec3b6ca8af65f7b20322993a258504ad5", "size": ...
""" Implements oldconfig functionality. 1. Loads existing .config 2. Prompts for the value of all modifiable symbols/choices that aren't already set in the .config 3. Writes an updated .config The default input/output filename is '.config'. A different filename can be passed in the KCONFIG_CONFIG environme...
{ "content_hash": "8c3ba98ac55aa0a5e1c35581f744a39b", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 79, "avg_line_length": 33.12448132780083, "alnum_prop": 0.5856194413127896, "repo_name": "gem5/gem5", "id": "53434b252ff60969f948effd1218bbd4dbc200fd", "size": "8080", "...
import json import requests from glance.openstack.common import uuidutils from glance.tests import functional TENANT1 = uuidutils.generate_uuid() TENANT2 = uuidutils.generate_uuid() TENANT3 = uuidutils.generate_uuid() TENANT4 = uuidutils.generate_uuid() class TestImages(functional.FunctionalTest): def setUp(...
{ "content_hash": "0c2c2be14fd11a86192d2fa56e55b08b", "timestamp": "", "source": "github", "line_count": 1306, "max_line_length": 79, "avg_line_length": 44.26033690658499, "alnum_prop": 0.5939554356099924, "repo_name": "citrix-openstack-build/glance", "id": "2e010a5a1cf78cd2e3725bd0e9d9148486780680", ...
"""Utility to retrieve function args..""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools from tensorflow.python.util import tf_decorator from tensorflow.python.util import tf_inspect def _is_bounded_method(fn): return tf_inspect.ismet...
{ "content_hash": "3ea9291575e240acf41378bbf388bc94", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 80, "avg_line_length": 26.093023255813954, "alnum_prop": 0.6827094474153298, "repo_name": "Kongsea/tensorflow", "id": "b31486dfa1122c2549ba3e9f6a730fd26444450a", "size": "1...
__author__ = 'Juan A. Ugalde' def split_sequence_fragments(sequence, block_size): """ Function that takes a sequence of letters (usually a DNA sequence), and returns fragments of a defined block size """ fragments = [] total_size = len(sequence) for i in range(0, total_size, block_size): ...
{ "content_hash": "0915fe1b4de4d684855644f28f298de9", "timestamp": "", "source": "github", "line_count": 325, "max_line_length": 161, "avg_line_length": 36.09538461538462, "alnum_prop": 0.640610348648879, "repo_name": "dacuevas/bioinformatics", "id": "aad609d5dfacd7973d2a44936ec1e082f90ace95", "size...
from typing import Tuple from controller.app import Application from controller.deploy.docker import Docker from controller.utilities import services SERVICE_NAME = __name__ PASSWORD_VARIABLES = ["ALCHEMY_PASSWORD"] IS_RUNNING_NEEDED = True def password(container: Tuple[str, str], old_password: str, new_password: s...
{ "content_hash": "07dfffa456f074cf9c385ad931482fd6", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 87, "avg_line_length": 29.551724137931036, "alnum_prop": 0.646441073512252, "repo_name": "rapydo/do", "id": "62bd0e77ad6932b0552fc43782ab55178e9ca35c", "size": "857", "bi...
from django.conf import settings from django.contrib.auth import get_user_model, authenticate, login, password_validation from django.contrib.auth.forms import PasswordResetForm from django.contrib.sites.shortcuts import get_current_site from django.core.mail import EmailMultiAlternatives from django.core.exceptions im...
{ "content_hash": "ef0bbaecafbc0d997e111ee2e7627a5b", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 113, "avg_line_length": 43.66867469879518, "alnum_prop": 0.6538832942474824, "repo_name": "awesto/django-shop", "id": "ce06d4ccba75d015e1563adf57b3325e6c3aa8b7", "size": "...
import os; import sys; import time; # a marker object to indicate not found class _NotFound (object): def __init__(self): pass; NOT_FOUND = _NotFound(); # a basic lru cache class class LRUCache (object): DEBUG_DUMP_ENABLED = False; @classmethod def currentTimeMicros(cls): return long(...
{ "content_hash": "23ed0bd796284eb132d00d817c9a308b", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 130, "avg_line_length": 35.845588235294116, "alnum_prop": 0.5298461538461539, "repo_name": "disqus/channels", "id": "e8c556ed97b143fcbe649f015d713c480b6152ae", "size": "58...
import os from django.conf import settings from django.shortcuts import render_to_response, RequestContext, Http404, HttpResponseRedirect, HttpResponse from cart.models import Cart from products.models import Featured def home(request): featured_products = [] featured = Featured.objects.get_featured_i...
{ "content_hash": "bdeabc7a6a03a60b1e3196e9c5d620fa", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 108, "avg_line_length": 26.6, "alnum_prop": 0.6629072681704261, "repo_name": "codingforentrepreneurs/marketplace", "id": "b522641d51e5ce3f8da3a7026acdae269b245fd7", "size":...
import os import shutil import win32api import win32con #dir_input = raw_input('Enter dir: ') dir_input = r"C:\Users\romeroj1\Desktop\Google Drive" win_trace = ['.svn'] files_removed = 0 def main(): '''Main module''' for dirname, dirnames, filenames in os.walk(dir_input): for subdirname in dirnames: ...
{ "content_hash": "ce8b8253224a93ab1918071a0522d74e", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 105, "avg_line_length": 29.057692307692307, "alnum_prop": 0.5698213103904699, "repo_name": "romeroj1/potential-batman", "id": "8ad1e81493c7c2985623810c56104b961f4b0af4", "s...
"""Translates gates to a target basis using a given equivalence library.""" import time import logging from itertools import zip_longest from collections import defaultdict from functools import singledispatch import retworkx from qiskit.circuit import Gate, ParameterVector, QuantumRegister, ControlFlowOp, QuantumC...
{ "content_hash": "b3c230ee188008873b9290f66e77bd62", "timestamp": "", "source": "github", "line_count": 611, "max_line_length": 100, "avg_line_length": 41.18166939443535, "alnum_prop": 0.6022573722279628, "repo_name": "QISKit/qiskit-sdk-py", "id": "67131298f1b72eed960afba2bf90c0b4f3c5130d", "size":...
import os import base64 import json import copy from unittest import mock from Cryptodome.PublicKey import RSA from Cryptodome.Cipher import AES from keepercommander import rest_api, api, params, record, shared_folder, team, crypto, utils _USER_NAME = 'unit.test@company.com' _USER_PASSWORD = base64.b64encode(os.uran...
{ "content_hash": "c55f5ad0a70414398c7c00a503799c98", "timestamp": "", "source": "github", "line_count": 348, "max_line_length": 132, "avg_line_length": 32.439655172413794, "alnum_prop": 0.5941181681282665, "repo_name": "Keeper-Security/Commander", "id": "938eba44f7a41b72ea122686fbd4d4e42064ae58", "...
import ursgal import importlib import os import sys import csv import os.path # csv.field_size_limit(sys.maxsize) class venndiagram_1_0_0(ursgal.UNode): """Venn Diagram uNode""" META_INFO = { "edit_version": 1.00, "name": "Venndiagram", "version": "1.0.0", "release_date": None,...
{ "content_hash": "9615efe0343ce8d7148816077a8b930a", "timestamp": "", "source": "github", "line_count": 255, "max_line_length": 103, "avg_line_length": 43.09803921568628, "alnum_prop": 0.4873521383075523, "repo_name": "ursgal/ursgal", "id": "d83097acc67a0b7d2bd3e5467f8519bbe131fcd4", "size": "11012...
import cbor import hashlib import json import time import logging import collections import collections.abc import traceback import random import sys # JadeError from .jade_error import JadeError # Low-level comms backends from .jade_serial import JadeSerialImpl from .jade_tcp import JadeTCPImpl # 'jade' logger logg...
{ "content_hash": "f58d2ac5106b248a7ddd05c7759073c0", "timestamp": "", "source": "github", "line_count": 1747, "max_line_length": 100, "avg_line_length": 36.88151116199199, "alnum_prop": 0.582583188477775, "repo_name": "spesmilo/electrum", "id": "4b31f06e3a031e731d81224658eaf21d8fb29c5d", "size": "6...
import os from django.conf import settings from django.contrib.admin.sites import AdminSite from django.contrib.auth.models import Permission, User from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse from django.http import HttpRequest from django.test import TestCas...
{ "content_hash": "a17760b704481ebc84e7cd06f8af8c8e", "timestamp": "", "source": "github", "line_count": 506, "max_line_length": 99, "avg_line_length": 37.444664031620555, "alnum_prop": 0.6384124135747083, "repo_name": "blancltd/django-glitter", "id": "e47f22de8d13ade8e6a5050eb2096b7c8af15762", "siz...
from django.contrib import admin from models import Item class ItemAdmin(admin.ModelAdmin): date_hierarchy = 'timestamp' list_display = ('timestamp', 'object_str') list_filter = ('content_type', 'timestamp') search_fields = ('object_str', 'tags') #admin.site.register(Item, ItemAdmin)
{ "content_hash": "bb5baf40746df1c435f3d3de4be47bc9", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 47, "avg_line_length": 23.76923076923077, "alnum_prop": 0.6893203883495146, "repo_name": "twatson/django-plugables", "id": "bf2f0409dee86ecda7963f9fa08a27408f9dbf9f", "size...
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response from nssrc.com.citrix.netscaler.nitro.service.options import options from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_...
{ "content_hash": "ef63216ca44c8d975755f49c51e996c2", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 142, "avg_line_length": 33.554140127388536, "alnum_prop": 0.7285497342444951, "repo_name": "mahabs/nitro", "id": "16a4e07dc041847b79a0d0c3fa7d1cf9f180d4e8", "size": "5882"...
HTTP_METHODS = ['POST', 'PUT', 'GET', 'DELETE', 'PATCH'] BOOT_DEVICES = ['pxe', 'disk', 'cdrom', 'bios', 'safe', 'wanboot'] # Polling intervals in seconds. _LONG_ACTION_POLL_INTERVAL = 10 _SHORT_ACTION_POLL_INTERVAL = 2 # This dict acts as both list of possible provision actions and arguments for # wait_for_provision...
{ "content_hash": "de0867c82b21f113c64e4f54de58b023", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 78, "avg_line_length": 46.945945945945944, "alnum_prop": 0.6108232584916523, "repo_name": "openstack/python-ironicclient", "id": "4c0719306ffb382d5b2716d95116858a73d57de5", ...
"""Embedding layer. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.keras.python.keras import backend as K from tensorflow.contrib.keras.python.keras import constraints from tensorflow.contrib.keras.python.keras import initializer...
{ "content_hash": "89cb2e71365d3e69b8575c78d0f713a5", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 76, "avg_line_length": 36.1764705882353, "alnum_prop": 0.6612466124661247, "repo_name": "whn09/tensorflow", "id": "12a2ce39ebdc8bc900e9c373e50562803cfa6524", "size": "6224...
"""API tests which do not interact with a site.""" # # (C) Pywikibot team, 2012-2014 # # Distributed under the terms of the MIT license. # from __future__ import unicode_literals __version__ = '$Id$' # import os import datetime import pywikibot from pywikibot.data.api import ( CachedRequest, ParamInfo, R...
{ "content_hash": "986eca4b11b010939d432394addf7193", "timestamp": "", "source": "github", "line_count": 427, "max_line_length": 99, "avg_line_length": 31.91334894613583, "alnum_prop": 0.5478094958538197, "repo_name": "valhallasw/pywikibot-core", "id": "5266256e3e62da17c0685f8e859c2032c6772da3", "si...
import hashlib, imp, os, sqlite3 # Load the OpenShift helper library lib_path = os.environ['OPENSHIFT_REPO_DIR'] + 'wsgi/openshift/' modinfo = imp.find_module('openshiftlibs', [lib_path]) openshiftlibs = imp.load_module('openshiftlibs', modinfo[0], modinfo[1], modinfo[2]) # Open the database conn = sqlite3...
{ "content_hash": "5d6168d167378a0564e436e2852779c5", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 84, "avg_line_length": 33.19512195121951, "alnum_prop": 0.6994856722997795, "repo_name": "grafuls/openshiftdjango", "id": "b48de05613be6aa63e5b0865b12255a37d391243", "size"...
''' Provides a Server which instantiates Application instances as clients connect ''' from __future__ import absolute_import, print_function import atexit import logging log = logging.getLogger(__name__) import signal from tornado.httpserver import HTTPServer from tornado.ioloop import IOLoop from tornado import net...
{ "content_hash": "f337b59777c5e6b2f09aef61b7292a7a", "timestamp": "", "source": "github", "line_count": 267, "max_line_length": 129, "avg_line_length": 35.80898876404494, "alnum_prop": 0.5692919150716452, "repo_name": "draperjames/bokeh", "id": "bdcbb0d956c7dda324464bfe54fd70458f098dd8", "size": "9...
import json import io import csv import numpy as np from django.shortcuts import render from django.http import HttpResponse from .forms import ReferencePointsForm from .fit import * # utility def json_response(data, status=200): return HttpResponse(json.dumps(data, ensure_ascii=False), content_type="application/json...
{ "content_hash": "381979a3d65f5ce38c43f93579fa097a", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 121, "avg_line_length": 37.57692307692308, "alnum_prop": 0.7090583418628454, "repo_name": "georgeouzou/survgr", "id": "c478d2868e5c2da8f227e2a101cfa98d802e4921", "size": "...
"""Webhook handlers for mobile_app.""" import asyncio from functools import wraps import logging import secrets from aiohttp.web import HTTPBadRequest, Request, Response, json_response from nacl.secret import SecretBox import voluptuous as vol from homeassistant.components import notify as hass_notify, tag from homea...
{ "content_hash": "b10cacfea8f9c196daeca804e23005f7", "timestamp": "", "source": "github", "line_count": 582, "max_line_length": 88, "avg_line_length": 32.08247422680412, "alnum_prop": 0.6410132819194516, "repo_name": "tboyce1/home-assistant", "id": "043a555b6b757cdf3938a5f4e43cff09e39cb49b", "size"...
from os import path from gluon import * from gluon.storage import Storage from s3 import * # ============================================================================= class index(): """ Custom Home Page """ def __call__(self): request = current.request response = current.response ...
{ "content_hash": "d1645a3a042549b1c95f553b0f69da10", "timestamp": "", "source": "github", "line_count": 318, "max_line_length": 118, "avg_line_length": 41.5062893081761, "alnum_prop": 0.43677551329646186, "repo_name": "sammyshj/gci", "id": "2134fd947c6daf18e9bdf4f2253e41fe5e207158", "size": "13224"...
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,re,sys,shutil from waflib import Utils,Errors exclude_regs=''' **/*~ **/#*# **/.#* **/%*% **/._* **/CVS **/CVS/** **/.cvsignore **/SCCS **/SCCS/** **/vssver.scc **/....
{ "content_hash": "6df57913b5c2db97e9e39e66feb2b0e5", "timestamp": "", "source": "github", "line_count": 466, "max_line_length": 137, "avg_line_length": 22.957081545064376, "alnum_prop": 0.6277808936249766, "repo_name": "pipsiscool/audacity", "id": "79d6bbfcb6585eb9de4e4429c59063bd7c1027fd", "size":...
from flask import Flask from flask_mongoengine import MongoEngine app = Flask(__name__) app.config.from_object("config") db = MongoEngine(app) from app import views,models
{ "content_hash": "e17536eeb24ec55a361b2491d18a921f", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 42, "avg_line_length": 19.555555555555557, "alnum_prop": 0.7613636363636364, "repo_name": "dangger/awesome-flask-todo", "id": "d32a838943adb33cc758e3cf68c04187e2825104", "si...
import os import sys from datetime import datetime sys.path.insert(0, os.path.abspath('..')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as ...
{ "content_hash": "805d2439c16cee1560943eda0dff823d", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 78, "avg_line_length": 28.033519553072626, "alnum_prop": 0.6476683937823834, "repo_name": "gilmarsquinelato/gulpy", "id": "03c5e613d721df61766d2c601c7e4ef33cb80219", "size...
"""OSF mailing utilities. Email templates go in website/templates/emails Templates must end in ``.txt.mako`` for plaintext emails or``.html.mako`` for html emails. You can then create a `Mail` object given the basename of the template and the email subject. :: CONFIRM_EMAIL = Mail(tpl_prefix='confirm', subject="...
{ "content_hash": "ed4bd0d0c5ac3c74acd50d50ca7a0464", "timestamp": "", "source": "github", "line_count": 351, "max_line_length": 117, "avg_line_length": 31.333333333333332, "alnum_prop": 0.7046735770140026, "repo_name": "rdhyee/osf.io", "id": "2afb0e160195038d90972287581f1e5b1aaa6ace", "size": "1102...
from __future__ import unicode_literals import os from collections import defaultdict from datetime import datetime, timedelta from boto3 import Session from moto.core import ACCOUNT_ID, BaseBackend, CloudFormationModel from moto.core.utils import unix_time from moto.utilities.tagging_service import TaggingService f...
{ "content_hash": "8ed64681958ca708d26173e67acd44a0", "timestamp": "", "source": "github", "line_count": 364, "max_line_length": 100, "avg_line_length": 34.027472527472526, "alnum_prop": 0.5971257871790732, "repo_name": "william-richard/moto", "id": "7a9918f2bbb5c4917beef89994fee2bb7d347250", "size"...
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from future.builtins import str from future import standard_library from future.utils import text_to_native_str with standard_library.hooks(): from http import cook...
{ "content_hash": "07be063da2c4be5579d47426696d04c2", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 95, "avg_line_length": 39.94672131147541, "alnum_prop": 0.5585308299989741, "repo_name": "krischer/python-future", "id": "ef1a11266bb7b245d05896185ae5a8cbb8de482a", "size"...
from __future__ import division import re import os import json import io import sys import pprint import logging logger = logging.getLogger() logger.setLevel(logging.DEBUG) import requests from requests_oauthlib import OAuth2Session from apiclient import errors from gdcmdtools.auth import GDAuth from gdcmdtools.auth...
{ "content_hash": "67e0caf9d6d305ddeece05cf3e74252b", "timestamp": "", "source": "github", "line_count": 209, "max_line_length": 135, "avg_line_length": 34.196172248803826, "alnum_prop": 0.5308521057786484, "repo_name": "timchen86/gdcmdtools", "id": "3abd3495445c678dee228141f831c0adbf6a288d", "size"...
import hashlib import logging import threading import traceback from datetime import datetime, timedelta, timezone from logging import Logger from typing import Optional, Tuple, Union import orjson from django.conf import settings from django.core.cache import cache from django.utils.timezone import now as timezone_no...
{ "content_hash": "ce76616a9f8221fa1d6c5b365550f8cb", "timestamp": "", "source": "github", "line_count": 296, "max_line_length": 98, "avg_line_length": 36.59121621621622, "alnum_prop": 0.6262579632536238, "repo_name": "andersk/zulip", "id": "dc902ea8408a2c4cfb31a81a5a5a23cded02b1b2", "size": "10917"...
from fine_mapping_pipeline.finemap.paintor import run_paintor, _select_annotations, _do_lrt, _get_likelihood import logging logging.basicConfig(level=logging.INFO) def test_run_paintor(tmpdir): input_directory = 'tests/paintor_data/' output_directory = tmpdir.mkdir('output') run_paintor(input_directory, ...
{ "content_hash": "53b3f115faf2bd46e2f7a58be63915d5", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 109, "avg_line_length": 43.111111111111114, "alnum_prop": 0.6950171821305842, "repo_name": "theboocock/fine_mapping_pipeline", "id": "649d815cf1896f02fe270f5b2c8966a71d1f7ae1...
import sys import os import shlex # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('..')) # --...
{ "content_hash": "73b204ce41d64be4278919051e4ccf9a", "timestamp": "", "source": "github", "line_count": 344, "max_line_length": 80, "avg_line_length": 31.325581395348838, "alnum_prop": 0.7042501855976243, "repo_name": "OTL/jps", "id": "9fc4cdba2615df135227207c6519015e5cebfb9b", "size": "11192", "...
"""Task sub-commands""" import importlib import json import logging import os import textwrap from contextlib import contextmanager, redirect_stderr, redirect_stdout, suppress from typing import List, Optional from pendulum.parsing.exceptions import ParserError from sqlalchemy.orm.exc import NoResultFound from airflo...
{ "content_hash": "f56184846d24257586856174daa5c114", "timestamp": "", "source": "github", "line_count": 503, "max_line_length": 107, "avg_line_length": 33.4572564612326, "alnum_prop": 0.6333709667835284, "repo_name": "apache/incubator-airflow", "id": "565a19e5094746067e3b2b91069d195ab9b6b935", "siz...
from django.db.models import get_model from oscar.test.factories import create_product from oscar.test.testcases import WebTestCase WishList = get_model('wishlists', 'WishList') class TestProductDetailPage(WebTestCase): is_anonymous = False def setUp(self): super(TestProductDetailPage, self).setUp(...
{ "content_hash": "bb4fc90f8e93ffce8c85062eec01f6c2", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 63, "avg_line_length": 31.428571428571427, "alnum_prop": 0.6806818181818182, "repo_name": "elliotthill/django-oscar", "id": "76b540aa192c135362fb59033a38814f53ffe31f", "siz...
DEBUG = False TEMPLATE_DEBUG = DEBUG COMPRESS_ENABLED = not DEBUG COMPRESS_OFFLINE = not DEBUG
{ "content_hash": "ec9aa31bfb7d30c46274fd39a8fb064b", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 28, "avg_line_length": 23.75, "alnum_prop": 0.7789473684210526, "repo_name": "wonderbeyond/ezlog", "id": "61b2c6947063dbee430bb2f49b60287a73ce1be2", "size": "95", "binary"...
import cherrypy # import config import sys import json import os config = {} class Alice(object): exposed = True def __init__(self) : self.modules = {} # load modules for mod_name in config['module_list']: mod = __import__('modules.' + mod_name + '.' + mod_name, fromlist=...
{ "content_hash": "ef67eee5a716835d502c5eefb7631c7c", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 166, "avg_line_length": 34.673469387755105, "alnum_prop": 0.5329605650382578, "repo_name": "SelenaProject/selena", "id": "358d8ed1b7dbd92e99eff0c7fbf139a81db77f47", "size":...
from __future__ import unicode_literals import unittest import os from pymatgen import Structure from pymatgen.io.feff.sets import MPXANESSet, MPELNESSet, FEFFDictSet, MPEXAFSSet from pymatgen.io.feff.inputs import Potential, Tags, Atoms, Header from pymatgen.io.cif import CifParser, CifFile import shutil import num...
{ "content_hash": "9011e4b8f81c3e273081a6fe44897648", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 116, "avg_line_length": 46.395121951219515, "alnum_prop": 0.6062454000630848, "repo_name": "johnson1228/pymatgen", "id": "d191b5d66ccb306678dc6a2aeffcf295cd677f03", "size"...
"""Define the base whispy lispy types From now on, all the functions will operate on these """ from __future__ import unicode_literals, absolute_import class Type(object): """Abstract base type""" def __init__(self, values): """ :param tuple values: a tuple of values """ self....
{ "content_hash": "1f061fdd6762f2fbba986c32194bf4c6", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 84, "avg_line_length": 25.00862068965517, "alnum_prop": 0.5853154084798345, "repo_name": "vladiibine/whispy_lispy", "id": "c964e69c274dc962d65e4f4901b14ee242a9baf4", "size...
""" Built-in, globally-available admin actions. """ from django.core.exceptions import PermissionDenied from django.contrib import messages from django.contrib.admin import helpers from django.contrib.admin.util import get_deleted_objects, model_ngettext from django.contrib.admin.admin_names import extended_verbose_na...
{ "content_hash": "4e1aa76b5a0bdadd40872f20f72c604d", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 95, "avg_line_length": 38.15909090909091, "alnum_prop": 0.6759976176295414, "repo_name": "yaroslavprogrammer/django", "id": "7863c05a7425c54443b4c1f87ba844fcd17981f0", "siz...
import django.contrib.postgres.fields from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('stein', '0029_auto_20171010_1149'), ] operations = [ migrations.AlterField( model_name='glossaryentry', name='examples', ...
{ "content_hash": "f609768f260beaa4af55d34b969b1736", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 232, "avg_line_length": 33.1764705882353, "alnum_prop": 0.648936170212766, "repo_name": "GeoMatDigital/django-geomat", "id": "484050d7a5f5639a63630167db22808bdf477b4e", "si...
"""Preprocessing code for MetaQA datasets.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import os from absl import app from absl import flags from tqdm import tqdm FLAGS = flags.FLAGS flags.DEFINE_string('metaqa_dir', None, 'Base direc...
{ "content_hash": "404deed0614c66bf7376c8bc80724988", "timestamp": "", "source": "github", "line_count": 223, "max_line_length": 79, "avg_line_length": 29.170403587443946, "alnum_prop": 0.623674096848578, "repo_name": "google-research/language", "id": "7ca3c034bede703686a12c1dd1b2e249392a079c", "siz...
print('This is another demo') print("It's supposed to test git")
{ "content_hash": "5230106b3615ffd680531d5d060c40be", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 34, "avg_line_length": 32, "alnum_prop": 0.734375, "repo_name": "erc7as/cs3240-labdemo", "id": "f833c78bed919a59a2af6d766bf9f325fd42757a", "size": "64", "binary": false, ...
""" This module contains the Adaptive Dynamic Event Tree and the Adaptive Hybrid Dynamic Event Tree sampling strategies Created on May 21, 2016 @author: alfoa supercedes Samplers.py from alfoa """ #for future compatibility with Python 3-------------------------------------------------------------- from __fut...
{ "content_hash": "ee17354a6ca864da9cbf35d380a561d9", "timestamp": "", "source": "github", "line_count": 599, "max_line_length": 199, "avg_line_length": 53.15358931552588, "alnum_prop": 0.6764973774301957, "repo_name": "idaholab/raven", "id": "e37ee36e5528c27508acea83e6fd4671e1fcb329", "size": "3242...
import sys from shutil import copy2 from copy import deepcopy from collections import namedtuple from macholib.MachO import MachO from macholib.ptypes import sizeof from macholib.mach_o import * from .common.macho_helpers import modify_macho_file_headers def insert_load_command(target_path, library_install_name): ...
{ "content_hash": "99d35d9293c90a1cb01ebb01baf3901c", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 105, "avg_line_length": 43.2, "alnum_prop": 0.7375925925925926, "repo_name": "wxdublin/machobot", "id": "5af3e5679378420f0c6194e61cc3282830f308a4", "size": "5623", "bina...
""" WSGI config for mysite project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))...
{ "content_hash": "252e9cf5ffbe8b4c0bf6e645417879a2", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 78, "avg_line_length": 28, "alnum_prop": 0.7647058823529411, "repo_name": "gbriones1/django-skelleton", "id": "64c7a1fb284aa56acdde351d23d3918341a4fcb4", "size": "1073", ...
""" A lan connect class using udp """ __author__ = "Oliver Lindemann <oliver@expyriment.org>" __version__ = "0.5" import atexit import os import socket from multiprocessing import Process, Event, Queue import logging from .types import UDPData from .polling_time_profile import PollingTimeProfile from .process_priori...
{ "content_hash": "4d1c30206eb60d7b85393560b1756f94", "timestamp": "", "source": "github", "line_count": 318, "max_line_length": 89, "avg_line_length": 31.132075471698112, "alnum_prop": 0.5522222222222222, "repo_name": "lindemann09/pyForceDAQ", "id": "6380a3c9d1131dd50cf5eb46ca464f8b3478bb6d", "size...
import unittest from stix.test import EntityTestCase from stix.common import CampaignRef class CampaignRefTests(EntityTestCase, unittest.TestCase): klass = CampaignRef _full_dict = { 'idref': "example:foo-1", 'timestamp': "2014-01-31T06:14:46", 'names': ["foo", "bar"] } if __nam...
{ "content_hash": "b92dec6e06caf1ad37ef54a21f769fd2", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 58, "avg_line_length": 19, "alnum_prop": 0.6232686980609419, "repo_name": "STIXProject/python-stix", "id": "eb407308f8ad5d37e5ed463d4a68e2f91a02f82d", "size": "466", "bin...
__version_info__ = { 'major': 2, 'minor': 4, 'micro': 2, 'releaselevel': 'beta', 'serial': 1 } def get_version(short=False): assert __version_info__['releaselevel'] in ('alpha', 'beta', 'final') vers = ["%(major)i.%(minor)i.%(micro)i" % __version_info__, ] if __version_info__['releasel...
{ "content_hash": "73825865713a7119e9e69bd7b501ff9e", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 73, "avg_line_length": 29.055555555555557, "alnum_prop": 0.5315487571701721, "repo_name": "murphyke/avocado", "id": "0a84b8010baf3c8775a27a950dd1813ce885d1f3", "size": "523...
init_fun = 'main.init' entity_path = 'entities' connect_entity = 'Account' global_entity = 'Global' max_aoi = 80 # max aoi in meter # client options for debug client_entity_path = 'client/entities' entity_def_path = 'defs'
{ "content_hash": "e9e69cbf3f15c997aeb4706af72e5080", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 38, "avg_line_length": 17.46153846153846, "alnum_prop": 0.7048458149779736, "repo_name": "dennisding/ether", "id": "ff12c062481ebcc2d734739824e75081c07d5eb6", "size": "251"...
import logging import pygame from objects.globals.gamecolors import GameColors from objects.globals.gamesettings import GameSettings from objects.leaderboards.leaderboard_entry import LeaderboardEntry from objects.leaderboards.score_service import ScoreService from objects.screens.base_screen import BaseScreen from o...
{ "content_hash": "4572b3554061b011bd7cd7d076aa1279", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 118, "avg_line_length": 45.06382978723404, "alnum_prop": 0.6093012275731823, "repo_name": "Superzer0/pyRiverRaid", "id": "be49745d959cd66f2c18b9ad8ec55ed120d29a2d", "size":...
import sys sys.path.append("tools") import mergejs have_compressor = None try: import jsmin have_compressor = "jsmin" except ImportError: try: import minimize have_compressor = "minimize" except Exception, E: print E pass sourceDirectory = "../src" configFilename = "lib...
{ "content_hash": "326db985462fd96d97cc452ff934f4ad", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 59, "avg_line_length": 23.979166666666668, "alnum_prop": 0.6776715899218071, "repo_name": "srv94/PingConsole", "id": "e9e49b944310a5f3a5e70e7d8d0beb8613554bcc", "size": "11...
from urllib.parse import urlparse, urljoin from flask import request, url_for, redirect def is_safe_url(target): ref_url = urlparse(request.host_url) test_url = urlparse(urljoin(request.host_url, target)) return test_url.scheme in ('http', 'https') and \ ref_url.netloc == test_url.netloc def ge...
{ "content_hash": "2b18bba278e8372559fd3044f60bafb9", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 63, "avg_line_length": 34.095238095238095, "alnum_prop": 0.6522346368715084, "repo_name": "ilhamadun/har", "id": "3c89f3f18d3083a4a90841ec633f7429bde8fa9b", "size": "716", ...
""" Created on 2014-05-12 :author: Andreas Kaiser (disko) """ from __future__ import absolute_import from fanstatic import Library from fanstatic import Resource from js.jquery import jquery library = Library('jquery_sortable', 'resources') jquery_sortable = Resource( library, 'jquery-sortable.js', min...
{ "content_hash": "58b3032ea2db3be8ce914f9d506d08a6", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 49, "avg_line_length": 19.789473684210527, "alnum_prop": 0.7180851063829787, "repo_name": "fanstatic/js.jquery-sortable", "id": "fd464997e0efdf13e86029d2537018b7d75be7f6", ...
""" @file @brief This modules contains a class which implements a simple server. """ import sys import os import urllib import datetime from http.server import HTTPServer from socketserver import ThreadingMixIn from pyquickhelper.loghelper import fLOG from pyensae.sql.database_main import Database from ..simple_serv...
{ "content_hash": "ebde457d6b302128dae6e0fdf1ac6a68", "timestamp": "", "source": "github", "line_count": 406, "max_line_length": 129, "avg_line_length": 34.53448275862069, "alnum_prop": 0.5106625775622281, "repo_name": "sdpython/pyrsslocal", "id": "2077dbb33ee2143d97008f2b8de1b788a10937cd", "size": ...
import subprocess def theme(): # Here we just triage to GTK settings for now try: out = subprocess.run( ['gsettings', 'get', 'org.gnome.desktop.interface', 'gtk-theme'], capture_output=True) stdout = out.stdout.decode() except Exception: return 'Light' # ...
{ "content_hash": "d23068fc0c87e94f287463013da584ce", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 123, "avg_line_length": 30.696969696969695, "alnum_prop": 0.5972359328726555, "repo_name": "Syncplay/syncplay", "id": "094a2fc09d73e5266683ecbb1d19813cb032d991", "size": "1...
""" Ensemble verification ===================== In this tutorial we perform a verification of a probabilistic extrapolation nowcast using MeteoSwiss radar data. """ from datetime import datetime import matplotlib.pyplot as plt import numpy as np from pprint import pprint from pysteps import io, nowcasts, rcparams, ...
{ "content_hash": "917f4c594af965c525fd93d7ba27aabd", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 86, "avg_line_length": 30.53157894736842, "alnum_prop": 0.631098086536804, "repo_name": "pySTEPS/pysteps", "id": "54d2500c8aa7a088403df09405109322933a3bc5", "size": "5819"...
import os import sys import random import time from itertools import product import Tkinter as tk import tkFont import tkSimpleDialog import tkMessageBox from PIL import ImageTk, Image class Card: FACES = {11: 'Jack', 12: 'Queen', 13: 'King', 14: 'Ace'} SUITS = {'Hearts': 1, 'Diamonds': 2, 'Spades': 3, 'Cl...
{ "content_hash": "b1298d6946ce3d5a0785c282e69ae2dd", "timestamp": "", "source": "github", "line_count": 538, "max_line_length": 92, "avg_line_length": 27.345724907063197, "alnum_prop": 0.5279363784665579, "repo_name": "JFeaux/pedro", "id": "6bf0c51819fa3b5b1d4f82fd2f19c7d4ea4ee195", "size": "14731"...
"""Module implementing RNN Cells. This module provides a number of basic commonly used RNN cells, such as LSTM (Long Short Term Memory) or GRU (Gated Recurrent Unit), and a number of operators that allow adding dropouts, projections, or embeddings for inputs. Constructing multi-layer cells is supported by the class `M...
{ "content_hash": "0894722fc2884e7abc90ca238df1eed5", "timestamp": "", "source": "github", "line_count": 1740, "max_line_length": 82, "avg_line_length": 39.08505747126437, "alnum_prop": 0.6566139277732032, "repo_name": "ghchinoy/tensorflow", "id": "19b7bfa8d86172455517b0cba3998befd6b56cc8", "size": ...
from django.shortcuts import render_to_response, get_object_or_404 from django.http import HttpResponseRedirect, Http404 from django.template import RequestContext from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User from django...
{ "content_hash": "574e5de5ffb923a0be7d653d03025125", "timestamp": "", "source": "github", "line_count": 274, "max_line_length": 154, "avg_line_length": 41.76642335766423, "alnum_prop": 0.6327333100314575, "repo_name": "andriibekker/django-swaps", "id": "bc6d1d79b5cc8a4c6f41d813bb7c6f45f0deede3", "s...
""" Echo client and server examples. Support for: - U{Twisted<http://twistedmatrix.com>} - U{WSGI<http://wsgi.org>} - U{Django<http://djangoproject.com>} - U{WASD<http://wasd.vsm.com.au/WASD/>} You can use this example with the echo_test.swf client on the U{EchoTest<http://pyamf.org/wiki/EchoTest>} wiki page. ...
{ "content_hash": "14de8e3a4210299b1bb2ad09edfa78fb", "timestamp": "", "source": "github", "line_count": 264, "max_line_length": 85, "avg_line_length": 29.625, "alnum_prop": 0.6256233218258535, "repo_name": "ethankennerly/hotel-vs-gozilla", "id": "e2bd9f2f516a380a2a750bb0f862eca2c9d86ba1", "size": "...
import sys, time, copy import numpy as np from threading import RLock import roslib; roslib.load_manifest('hrl_dynamic_mpc') roslib.load_manifest('pr2_controllers_msgs') import rospy from geometry_msgs.msg import Wrench, Twist from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint from pr2_controllers_m...
{ "content_hash": "71522bf58402955d92cdcfbb9992a978", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 145, "avg_line_length": 37.84699453551912, "alnum_prop": 0.6368755414380595, "repo_name": "gt-ros-pkg/hrl-haptic-manip", "id": "916b4733516e8f188221a34528abba16755dbe6b", ...
import StringIO import webob import glance.api.v2.image_data from glance.common import exception from glance.openstack.common import uuidutils from glance.tests.unit import base import glance.tests.unit.utils as unit_test_utils import glance.tests.utils as test_utils class Raise(object): def __init__(self, exc)...
{ "content_hash": "796067da2bc96aecbcc3e1195d4a67c3", "timestamp": "", "source": "github", "line_count": 358, "max_line_length": 78, "avg_line_length": 39.19553072625698, "alnum_prop": 0.6246436716077537, "repo_name": "citrix-openstack-build/glance", "id": "c84b984ad94ee0f88e1955f2d58f0a740a8a1d54", ...
from core.nn.neuralnet import * from core.rl.portfolio import evalLinUCB from core.rl.policyGradient import policyGradient from core.util.data import StockHistory import sys def main() : if len(sys.argv) < 2 : usage() method = sys.argv[1] args = sys.argv[2:] argDict = {arg.split('=')[0]:arg.spl...
{ "content_hash": "4a67a21f19a73049b5aa97579bf2005a", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 80, "avg_line_length": 29.24137931034483, "alnum_prop": 0.6084905660377359, "repo_name": "hassaanm/stock-trading", "id": "3b10775285ec6f989ee4c6b2e498b3cde84be7cd", "size":...
"""Generated client library for deploymentmanager version v2.""" # NOTE: This file is autogenerated and should not be edited by hand. from googlecloudsdk.third_party.apitools.base.py import base_api from googlecloudsdk.third_party.apis.deploymentmanager.v2 import deploymentmanager_v2_messages as messages class Deploy...
{ "content_hash": "055790a429f4c517d02d721b5b6673b8", "timestamp": "", "source": "github", "line_count": 480, "max_line_length": 233, "avg_line_length": 41.6375, "alnum_prop": 0.6297408185730011, "repo_name": "flgiordano/netcash", "id": "934d5d856a60c27b120eb9164655f11133e6412b", "size": "19986", ...
""" This module provides a class :class:`MockTarget`, an implementation of :py:class:`~luigi.target.Target`. :class:`MockTarget` contains all data in-memory. The main purpose is unit testing workflows without writing to disk. """ import multiprocessing from io import BytesIO import sys from luigi import six from lui...
{ "content_hash": "381317fe9f7ae37becd747ab5c243521", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 104, "avg_line_length": 30.583815028901736, "alnum_prop": 0.5365715365715366, "repo_name": "PeteW/luigi", "id": "e0aa364d9525f8d02777bdb8398f9f856e5e3015", "size": "5894",...
from __future__ import absolute_import import logging from django.conf import settings from django.utils.functional import cached_property # noqa from django.utils.translation import ugettext_lazy as _ from novaclient import exceptions as nova_exceptions from novaclient.v1_1 import client as nova_client from novacl...
{ "content_hash": "ea7515d83b8bb8f0c1f255c8c4bd66d4", "timestamp": "", "source": "github", "line_count": 869, "max_line_length": 79, "avg_line_length": 34.208285385500574, "alnum_prop": 0.6310424866283177, "repo_name": "AlexOugh/horizon", "id": "45c8d4068a5584ce897a0e1aaf8ca8c5f6051e54", "size": "30...
import ctypes import ctypes.util import os try: # If possible, get nicer tracebacks from low-level signals. import faulthandler faulthandler.enable() except: pass from .v31 import * class _Mock(object): def __init__(self, *args, **kwargs): pass try: _llvm = ctypes.cdll.LoadLibrary(os...
{ "content_hash": "9ae1e87e840c591ef47620fe3e7d9c58", "timestamp": "", "source": "github", "line_count": 532, "max_line_length": 101, "avg_line_length": 31.144736842105264, "alnum_prop": 0.6813929627617841, "repo_name": "dtcaciuc/nitrous", "id": "99d19cba43cf58b4dd770e04166baa355eb98185", "size": "1...
import os import shutil import signal import sys import threading import warnings import importlib from threading import RLock from tempfile import NamedTemporaryFile from py4j.protocol import Py4JError from py4j.java_gateway import is_instance_of from pyspark import accumulators, since from pyspark.accumulators impo...
{ "content_hash": "debe7f68b43930fdffed4e03e90df18e", "timestamp": "", "source": "github", "line_count": 1278, "max_line_length": 99, "avg_line_length": 41.91940532081377, "alnum_prop": 0.6069475295391336, "repo_name": "BryanCutler/spark", "id": "79fdd22ab13fd9205aeb5ca40f26d71ce9cd3185", "size": "5...
""" Crawl Reddit for moderator and subscriber # data and insert it into the database. """ from bs4 import BeautifulSoup import datetime import re import time import urllib3 from redditchat.core.models import Room from script_log import make_logger, log logger = make_logger('crawl_reddit') def get_rooms_to_crawl():...
{ "content_hash": "0dd2c92ba2c7dd487a2c84ea17fd67be", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 108, "avg_line_length": 33.53398058252427, "alnum_prop": 0.6479444122756225, "repo_name": "reverie/seddit.com", "id": "eb6a04e4fad4458ed9d7537bc84fc4dc2a3f14e7", "size": "...
""" write_obs_cvs.py ================ Writes JSON CV files from the `config_tables.xls` vocabs from Climate-Grid package. """ # Third-party imports import pandas import simplejson import numpy CONFIG_XLS = 'config_tables.xls' json_tmpl = { "version_metadata":{ "author":"Ag Stephens <ag.stephens@stfc.ac....
{ "content_hash": "31167f030230fa761ff4c1041b13408d", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 83, "avg_line_length": 23.231884057971016, "alnum_prop": 0.5676855895196506, "repo_name": "ukcp-data/UKCP18_CVs", "id": "c02adb7686f65712ddf8c761f3e8a7c2b7d59f19", "size": ...
import os import pwd import random import sys from conary import dbstore from conary.repository import errors from conary.repository.netrepos import netauth from conary.server import schema def main(argv): if len(argv) < 2: dbPath = '/srv/rmake-repos/db/sqldb' else: dbPath = sys.argv[1] d...
{ "content_hash": "79a755593b7c38c7491e7eedab63b112", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 87, "avg_line_length": 30, "alnum_prop": 0.6447916666666667, "repo_name": "fedora-conary/rmake-2", "id": "9b65e599a9d8bb3498d0e084d33ba3b5538af365", "size": "2525", "bina...
from setuptools import setup, find_packages # https://github.com/QuantConnect/Lean/blob/master/LICENSE with open('../LICENSE') as f: license = f.read() with open('README.rst') as f: readme = f.read() setup( name='quantconnect', version='0.1', description = 'QuantConnect API', long_descrip...
{ "content_hash": "3f100e44c51b8b32b55c61f91f1f472f", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 58, "avg_line_length": 27.904761904761905, "alnum_prop": 0.6518771331058021, "repo_name": "redmeros/Lean", "id": "dcd06cc6c7f9fd9fe96ac4e2a050a251291c57f5", "size": "1298",...
from skimage import io import pandas as pd import fastparquet as fp import numpy as np import os import tempfile def readTiff(filename): """Read data from the tiff file and return a Pandas dataframe""" filenamePrefix = os.path.splitext(os.path.basename(filename))[0] im = io.imread(filename) # Re...
{ "content_hash": "271f2b25e960fc035b03049c70e6b0b5", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 107, "avg_line_length": 28.310344827586206, "alnum_prop": 0.6583434835566383, "repo_name": "OpenDataAnalytics/etl", "id": "94238c07c86e28683e8309fee9e1edceeb3cb877", "size"...
import os import re from concurrent import futures import grpc import structlog from google.cloud import storage from grpc_health.v1 import health_pb2, health_pb2_grpc from opentelemetry import propagate, trace from opentelemetry.exporter.cloud_trace import CloudTraceSpanExporter from opentelemetry.instrumentation.grp...
{ "content_hash": "7314ed8bc32b286d96081b134df66aa7", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 109, "avg_line_length": 31.33582089552239, "alnum_prop": 0.6865920457251726, "repo_name": "GoogleCloudPlatform/opentelemetry-trace-codelab-python", "id": "7c02a5d8383cf0432f...
import re import yaml def parse_front_matter(fileobj): line = fileobj.readline().strip() match = re.match(r'^\s*#\s*cob:\s*(.*)$', line) if match: return _parse_oneline_dict(match.group(1)) if re.match(r'^#\s?cob-yaml:\s*$', line): s = "" for line in fileobj: if ...
{ "content_hash": "85170f308c9afc47b6ac2710a4fd4f75", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 51, "avg_line_length": 23, "alnum_prop": 0.4935370152761457, "repo_name": "getweber/weber-cli", "id": "8b0b09bb0d41a453b1ec626ef084aa65b0d134df", "size": "851", "binary":...
"""Recursion With an understanding of how to write and call functions, we can now combine the two concepts in a really nifty way called **recursion**. For seasoned programmers, this concept will not be at all new - please feel free to move on. Everyone else: strap in. Python functions, like those in many programming ...
{ "content_hash": "7f3854327fee31b0e32ebf1445c43efe", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 56, "avg_line_length": 25.65277777777778, "alnum_prop": 0.7249593936112615, "repo_name": "shiblon/pytour", "id": "946e782cd29ef204e749b02d02573df74e8371aa", "size": "1860",...
""" family.py Created by Thomas Mangin on 2014-06-22. Copyright (c) 2014-2014 Exa Networks. All rights reserved. """ from exabgp.configuration.engine.registry import Raised from exabgp.configuration.engine.registry import Entry from exabgp.protocol.family import AFI from exabgp.protocol.family import SAFI # =======...
{ "content_hash": "4a70d96b19f59f7aba394e532be7d380", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 80, "avg_line_length": 29.06206896551724, "alnum_prop": 0.6623160892263882, "repo_name": "jbfavre/exabgp", "id": "0e45c4e3f7b3f52cd902b0fb697f946d284eb204", "size": "4232"...
import atexit import sqlite3 get_all_mappings_query = ''' SELECT * FROM mappings ''' get_all_mapping_names_query = ''' SELECT DISTINCT mname FROM mappings ''' get_mapping_from_name_query = ''' SELECT key, note FROM mappings WHERE mname = "{0}" ''' delete_mapping_from_name_query = ''' DELETE FROM mappings WHERE mnam...
{ "content_hash": "96b9304ea6199b770bfe5d8bbb316154", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 68, "avg_line_length": 23.6, "alnum_prop": 0.6370056497175142, "repo_name": "killalea/digital-keyboard", "id": "b552adb1b4c85d350003b29e07a6f96e60ba351f", "size": "1416", ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('fcm_app', '0005_auto_20170827_1811'), ] operations = [ migrations.DeleteModel( name='Maps', ), migrations.RenameField( ...
{ "content_hash": "a8dcf1773da8182dc5f03138ade94b3c", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 90, "avg_line_length": 27.813953488372093, "alnum_prop": 0.532608695652174, "repo_name": "gtsapelas/TRANSrisk_fcm_project", "id": "f4434d926f7fd3290e7710afe5dc0c949c450388", ...
import json import time import socket import multiprocessing import sys import os import queue import random import traceback from http.server import BaseHTTPRequestHandler, HTTPServer from multiprocessing.context import ForkProcess from unittest import TestCase from unittest.mock import patch, MagicMock from threading...
{ "content_hash": "11faabf794363fd3bcfbed0286a4182a", "timestamp": "", "source": "github", "line_count": 607, "max_line_length": 92, "avg_line_length": 34.200988467874794, "alnum_prop": 0.6081888246628131, "repo_name": "crate/crate-python", "id": "ee32778b6379097a643b9e826aae561103bba5a0", "size": "...
"""The ViCare integration.""" from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass import logging from PyViCare.PyViCare import PyViCare from PyViCare.PyViCareDevice import Device import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT, Con...
{ "content_hash": "e6123231b1dcaa6218b4ea6ec73347be", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 119, "avg_line_length": 29.310344827586206, "alnum_prop": 0.6294117647058823, "repo_name": "home-assistant/home-assistant", "id": "a79dbf0657d97483b317f27fa9fa32a6fa4dff2e",...
import os DEBUG = False TEMPLATE_DEBUG = DEBUG APPEND_SLASH=True BRUTE_PROTECT = False BRUTE_COOLOFF = 3 BRUTE_LIMIT = 3 PROJECT_DIR = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), os.path.pardir)) ADMINS = ( # ('Your Name', 'your_email@example.com'), ) AUTH_PROFILE_MODULE = "sal.UserPro...
{ "content_hash": "712d8e0aef9ac27699294ebc2abcbaad", "timestamp": "", "source": "github", "line_count": 236, "max_line_length": 168, "avg_line_length": 31.970338983050848, "alnum_prop": 0.7033797216699801, "repo_name": "chasetb/sal", "id": "880818d59981c42936a0db526bd5f97eabc33a9a", "size": "7545",...