text
stringlengths
4
1.02M
meta
dict
from panda3d.core import * from panda3d.direct import * import Playground import random from direct.fsm import ClassicFSM, State from direct.actor import Actor from toontown.toonbase import ToontownGlobals class MMPlayground(Playground.Playground): def __init__(self, loader, parentFSM, doneEvent): Playgro...
{ "content_hash": "22ff6612b39b62e7c3d65f05d63d5277", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 208, "avg_line_length": 31.78, "alnum_prop": 0.7123977344241661, "repo_name": "silly-wacky-3-town-toon/SOURCE-COD", "id": "3c298b668edc428dda8197b4ecbeaa303c795386", "size"...
import configs.locs import os import db.text import configs.mload import random import utils class LineDB: def __init__(self, name, plural, seperprefix, seper, add, main, remove, showlist, random, eh='', channel=False, aname=None, search=True): self.dbfolder = configs.locs.userdb + '/' + ...
{ "content_hash": "38d966ad0930c450d3f2a7ba5cc79e5e", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 76, "avg_line_length": 37.36725663716814, "alnum_prop": 0.43931320307874483, "repo_name": "shacknetisp/fourthevaz", "id": "da9228b34a9850a3b585eeb7da32b478bddf10e1", "size...
from __future__ import print_function from __future__ import division from __future__ import absolute_import import logging import os from subprocess import PIPE, Popen from stacker.exceptions import ImproperlyConfigured logger = logging.getLogger(__name__) def _devnull(): return open(os.devnull, 'wb') def r...
{ "content_hash": "03bff50e4e756b89cdd6005b68d3f7cb", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 77, "avg_line_length": 32.38709677419355, "alnum_prop": 0.5572709163346613, "repo_name": "remind101/stacker", "id": "2539753d8282746ec070fd7c1cd3c7bf0a2bbd0f", "size": "40...
import numpy as np import sklearn.datasets as datasets import sklearn.learning_curve as lc import sklearn.naive_bayes as nb import sklearn.svm as svm import pandas_ml as pdml import pandas_ml.util.testing as tm class TestLearningCurve(tm.TestCase): def test_learning_curve(self): digits = ...
{ "content_hash": "2b8b476cafa8aa8267b2f50ab9fde206", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 81, "avg_line_length": 36.46808510638298, "alnum_prop": 0.5950991831971996, "repo_name": "sinhrks/pandas-ml", "id": "0b05ecfceccf41ba622fd3a466f04fc63738e4e9", "size": "173...
class Car(object): def __init__(self, price, speed, fuel, milage) def tax(self): if price>10000: self.tax = .015 else: self.tax = .012 def print_all(self): print 'Price' +str(self.price) print 'Speed' +str(self.speed) print 'Fuel' +str(self.fuel) print 'Milage' +str(self.milage) print 'Tax' +s...
{ "content_hash": "f9f3e388ffec3f660225d089ea552ee0", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 285, "avg_line_length": 27.176470588235293, "alnum_prop": 0.6746031746031746, "repo_name": "authman/Python201609", "id": "8750c05ed257570d1bc99410d5afa7b5fedd9417", "size":...
from data.tools import Control from data.states import init, run, halt fuck = Control() fuck.setup_states({'Init': init.Init(), 'Run': run.Run(), 'Halt': halt.Halt() },'Init') fuck.main()
{ "content_hash": "e7a3fcdecfc228f0f073c11cef71dcb7", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 39, "avg_line_length": 27.333333333333332, "alnum_prop": 0.5203252032520326, "repo_name": "rabitdash/practice", "id": "bd4e431479306f58d3156f8c39b5922168cbbb09", "size": "24...
import sys import types import cherrypy import urllib import unittest import re import os import FileStoreDatabase import DarunGrimSessions import DarunGrimDatabase import SecurityImplications import MSPatchWeb import FileStore from mako.template import Template from HTMLPages import * config_file = 'DarunGrim3.cfg'...
{ "content_hash": "972b61dbf75c53595b1cb4cffd419e60", "timestamp": "", "source": "github", "line_count": 901, "max_line_length": 211, "avg_line_length": 35.08546059933407, "alnum_prop": 0.6862267493356953, "repo_name": "jenix21/DarunGrim", "id": "179f8eedd297ce753cbdb594bd1cda875445f9e0", "size": "3...
from __future__ import absolute_import from io import TextIOBase from splunklib.six import ensure_text try: import xml.etree.cElementTree as ET except ImportError as ie: import xml.etree.ElementTree as ET class Event(object): """Represents an event or fragment of an event to be written by this modular inp...
{ "content_hash": "68e5ffaac14a162c88572f3b4b61fea2", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 109, "avg_line_length": 38.74, "alnum_prop": 0.5836344863190501, "repo_name": "splunk/splunk-sdk-python", "id": "9cd6cf3ae8b1be4aef5ea44c38acb622180a803f", "size": "4456",...
import unittest from unittest.mock import Mock, patch, mock_open from collections import Counter from vasppy.calculation import Calculation, delta_E, delta_stoichiometry, energy_string_to_float, import_calculations_from_file import numpy as np class CalculationTestCase( unittest.TestCase ): def test_calculation...
{ "content_hash": "0403fef5ed58b2f3187046e03c0db17f", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 132, "avg_line_length": 47.65811965811966, "alnum_prop": 0.600609756097561, "repo_name": "bjmorgan/vasppy", "id": "6c418f828462e87289e4d3089c4545561d026551", "size": "5576...
from __future__ import unicode_literals import copy import os import pickle import unittest import warnings from django.core.exceptions import SuspiciousOperation from django.core.signals import request_finished from django.db import close_old_connections from django.http import (QueryDict, HttpResponse, HttpResponse...
{ "content_hash": "6fb424f45f10080dafd2f55ffe4f2c6d", "timestamp": "", "source": "github", "line_count": 628, "max_line_length": 95, "avg_line_length": 38.76910828025478, "alnum_prop": 0.5940362262291042, "repo_name": "tastynoodle/django", "id": "287d800c21ce8864a27b7d3e6e996c5ee8269e6c", "size": "2...
"""Tests that HTML generation is awesome.""" import datetime import glob import json import os import os.path import re import sys import coverage from coverage.backward import unicode_class from coverage import env from coverage.files import flat_rootname import coverage.html from coverage.misc import CoverageExcept...
{ "content_hash": "aae39c7d63b9965eb1a97cc0df607aff", "timestamp": "", "source": "github", "line_count": 890, "max_line_length": 99, "avg_line_length": 38.6314606741573, "alnum_prop": 0.5636088651038335, "repo_name": "blueyed/coveragepy", "id": "9706cd33c5ab61a4c356fbe4a8e928662d50895c", "size": "34...
from collections import UserDict class TupleUserDict(UserDict): ######################################### # Implement these in a subclass ######################################### # TODO: implement same behaviour via magic methods ... @staticmethod def _get_key(*args, **kwargs): rais...
{ "content_hash": "b0d813fd724fa03db1a3fa9fbfa7568b", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 58, "avg_line_length": 25.193548387096776, "alnum_prop": 0.44878361075544176, "repo_name": "miniworld-project/miniworld_core", "id": "f2d7dac9c75822d5c0911312ac00af3353367e91...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('comercial', '0018_metamodeloreferencia_multiplicador'), ] operations = [ migrations.RemoveField( model_name='metamodeloreferencia', ...
{ "content_hash": "7d74f6f84e6e47a394b6d900d917dca2", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 65, "avg_line_length": 21.11764705882353, "alnum_prop": 0.6323119777158774, "repo_name": "anselmobd/fo2", "id": "3f63cb7c08eaf7fba4512a9ec2763f716145abcf", "size": "433", ...
from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('seminar', '0004_auto_20180621_1606'), ] operations = [ migrations.AlterField( model_name='seminarattachment', name='seminar', ...
{ "content_hash": "6d1988b627fdd5585ea6021e49c9b459", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 139, "avg_line_length": 27.705882352941178, "alnum_prop": 0.6454352441613588, "repo_name": "PLUS-POSTECH/study.plus.or.kr", "id": "a29f96b6068fceb6da9e07edd00bedd8ec1f8b22", ...
from oslo_utils import timeutils from senlin.common import exception from senlin.common import utils as common_utils from senlin.engine import cluster_policy as cpm from senlin.objects import cluster_policy as cpo from senlin.tests.unit.common import base from senlin.tests.unit.common import utils CLUSTER_ID = '8d674...
{ "content_hash": "e5207c78c797b7fe8ccbe6083e644098", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 76, "avg_line_length": 35.53846153846154, "alnum_prop": 0.604978354978355, "repo_name": "openstack/senlin", "id": "1ea077dbc99312098392c09114284c0382b50ada", "size": "5169...
"""ext_gw_mode Revision ID: 128e042a2b68 Revises: 32b517556ec9 Create Date: 2013-03-27 00:35:17.323280 """ # revision identifiers, used by Alembic. revision = '128e042a2b68' down_revision = '32b517556ec9' # Change to ['*'] if this migration applies to all plugins migration_for_plugins = [ 'neutron.plugins.hype...
{ "content_hash": "24b77e1088a78fcb9ea933799f066d74", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 72, "avg_line_length": 29.8, "alnum_prop": 0.7240865026099925, "repo_name": "ykaneko/neutron", "id": "20d08ae14af446fdb8a9b00ff56dceaad1cc95f5", "size": "2002", "binary":...
from itertools import combinations import numpy as np import pytest from sklearn.utils._testing import assert_almost_equal from sklearn.utils._testing import assert_array_almost_equal from sklearn.exceptions import ConvergenceWarning from sklearn.decomposition import FactorAnalysis from sklearn.utils._testing import ...
{ "content_hash": "b4d4f2d45e57aa3af529e385bc0bdc2e", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 81, "avg_line_length": 36.95798319327731, "alnum_prop": 0.6421100500227376, "repo_name": "huzq/scikit-learn", "id": "08aad7e5d32e98839023badf66a7c6363d802a93", "size": "45...
class Node: __slots__ = '_data', '_next' def __init__(self, data, successor): self._next = successor self._data = data @property def data(self): return self._data @property def next(self): return self._next @next.setter def next(self, other: 'Node'): ...
{ "content_hash": "840d92976abb6159c7a4fda99701924a", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 66, "avg_line_length": 23.678571428571427, "alnum_prop": 0.5143288084464555, "repo_name": "rlishtaba/py-algorithms", "id": "415526cd18f84015c525ff642b382a828116b714", "size...
"""HomeKit session fixtures.""" from unittest.mock import patch from pyhap.accessory_driver import AccessoryDriver import pytest from homeassistant.components.homekit.const import EVENT_HOMEKIT_CHANGED from homeassistant.core import callback as ha_callback @pytest.fixture(scope="session") def hk_driver(): """Re...
{ "content_hash": "5b2d1020a882c815a11ab53cb2ea5aa8", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 78, "avg_line_length": 31.517241379310345, "alnum_prop": 0.7242888402625821, "repo_name": "postlund/home-assistant", "id": "ef534d0e47286f97534deb6553b479ebb0340dc4", "size...
import sys sys.path.insert(1, "../../") import h2o,tests def stratified_split(): fr = h2o.import_file(tests.locate("bigdata/laptop/covtype/covtype.data")) stratified = fr[54].stratified_split() train = fr[stratified=="train"] test = fr[stratified=="test"] print (fr[54].table()["Count"] / fr[54].table()["Cou...
{ "content_hash": "a5a717ea7d7a2aa7f22050499f51d357", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 78, "avg_line_length": 37.86666666666667, "alnum_prop": 0.6285211267605634, "repo_name": "kyoren/https-github.com-h2oai-h2o-3", "id": "7fa5cddee88c7495c442b4aec3b35a53b930324...
import os from vee.cli import style_error from vee.commands.main import command, argument from vee.subproc import call from vee.utils import makedirs @command( help='run a command in the database', parse_known_args=True, aliases=['sqlite'], acquire_lock=True, group='plumbing', ) def sqlite3(args,...
{ "content_hash": "33c24454e447b1b06bd60cb2c1ca90ba", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 47, "avg_line_length": 22.6, "alnum_prop": 0.6880530973451328, "repo_name": "westernx/vee", "id": "128ed3f7a83b2f412f9b05cce51f19d2bc662904", "size": "452", "binary": fal...
""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
{ "content_hash": "526dad7be093cb5f53235d936ccc8525", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 174, "avg_line_length": 49.30102040816327, "alnum_prop": 0.7522508537721204, "repo_name": "arenadata/ambari", "id": "97657ad7f491397add8546f8c2a49e7c7d42f170", "size": "96...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os from ansible.plugins.action import ActionBase class ActionModule(ActionBase): TRANSFER_FILES = True def run(self, tmp=None, task_vars=None): ''' handler for file transfer operations ''' if task...
{ "content_hash": "db7a57ba4ddb4af206aec4ff0d63fd87", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 114, "avg_line_length": 33.26470588235294, "alnum_prop": 0.5680813439434129, "repo_name": "silpion/ansible-java", "id": "9d76e44801712574ebbb07bc4de8119baba62bf5", "size": ...
extensions = [ 'reno.sphinxext', 'openstackdocstheme', ] # openstackdocstheme options openstackdocs_repo_name = 'openstack/blazar' openstackdocs_bug_project = 'blazar' openstackdocs_bug_tag = '' # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suf...
{ "content_hash": "f708c462f2be0dabb6b1183e73a78ae2", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 79, "avg_line_length": 31.733031674208146, "alnum_prop": 0.7046912876087267, "repo_name": "openstack/blazar", "id": "fa7a94b2822028d0054fae721f53e37c8e5e5c38", "size": "85...
""" Process extraclusions on PUT of a single Tiddler. Tiddler validation happens after bag policy checks so we know we can write. As long as this validator is late in the stack of validators, other, security related, validators will operate on the extraclude text. """ from tiddlyweb.model.tiddler import Tiddler from...
{ "content_hash": "b26b43d6cefcd27fbcabd4df66455453", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 76, "avg_line_length": 28.078125, "alnum_prop": 0.672787979966611, "repo_name": "cdent/tiddlywebplugins.extraclude", "id": "82d1d15c8d2f88f26eacf66dcda0876327e35bdd", "size...
import roslib; roslib.load_manifest('behavior_driving_between_two_waypoints') from flexbe_core import Behavior, Autonomy, OperatableStateMachine, ConcurrencyContainer, PriorityContainer, Logger from behavior_set_points.set_points_sm import SetPointsSM from behavior_simplemissiondriveto.simplemissiondriveto_sm import Si...
{ "content_hash": "ca709d775ef7832e014cd8801f92817b", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 115, "avg_line_length": 33.73118279569893, "alnum_prop": 0.7054510678992668, "repo_name": "tu-darmstadt-ros-pkg/hector_flexbe_behavior", "id": "57bbabb7ba95604632a23eb1476794...
"""Tests for the McAfee AV Logs file event formatter.""" import unittest from plaso.formatters import mcafeeav from tests.formatters import test_lib class McafeeAccessProtectionLogEventFormatterTest( test_lib.EventFormatterTestCase): """Tests for the McAfee Access Protection Log event formatter.""" def te...
{ "content_hash": "17ae73bbd05cda53c1417f5b538fbb81", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 72, "avg_line_length": 26.763157894736842, "alnum_prop": 0.7168141592920354, "repo_name": "dc3-plaso/plaso", "id": "b85f9459431346e88bd392b07ba508a384357f54", "size": "1059...
"""SDK Fn Harness entry point.""" from __future__ import absolute_import import http.server import json import logging import os import re import sys import threading import traceback from builtins import object from google.protobuf import text_format from apache_beam.internal import pickler from apache_beam.option...
{ "content_hash": "30c4f8032a4f80cfd96a721256d3c006", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 76, "avg_line_length": 33.89340101522843, "alnum_prop": 0.6973191553092706, "repo_name": "rangadi/incubator-beam", "id": "da21418e4cc30848b8f7700b5a9b5600b6c7f694", "size"...
r"""Benchmarks for low-level eager execution primitives. To run CPU benchmarks: bazel run -c opt benchmarks_test -- --benchmarks=. To run GPU benchmarks: bazel run --config=cuda -c opt --copt="-mavx" benchmarks_test -- \ --benchmarks=. """ from __future__ import absolute_import from __future__ import division...
{ "content_hash": "e7f8923a1ae3e228a54edecfe038724e", "timestamp": "", "source": "github", "line_count": 907, "max_line_length": 80, "avg_line_length": 35.65270121278942, "alnum_prop": 0.658007854779355, "repo_name": "jbedorf/tensorflow", "id": "8a1319f9efa847911b799cb54007f5971973ebb2", "size": "33...
from pprint import pprint from st2actions.runners.pythonrunner import Action class PrintConfigAction(Action): def run(self): print('=========') pprint(self.config) print('=========')
{ "content_hash": "5a36752e3da0765b3b4ccae21e69ad47", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 50, "avg_line_length": 21.4, "alnum_prop": 0.6121495327102804, "repo_name": "emedvedev/st2", "id": "f65d393d36abfb5232aa86229925a4a47f722b03", "size": "214", "binary": fa...
from django.shortcuts import render, redirect from django.http import HttpResponse from backend.forms import PraiseForm from backend.models import Praise import random from django.views.generic.edit import UpdateView def home(request): if request.user.is_authenticated (): praise = random.choice(Praise.objects.fi...
{ "content_hash": "44438e97031046664074fdca790738e6", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 66, "avg_line_length": 26.816901408450704, "alnum_prop": 0.7048319327731093, "repo_name": "SEACodeCarrots/PraiseReminder", "id": "2b66c7374b23d1b61b1562ae868681324e838550", ...
from .base import ManagerApi from maxipago.requesters.customer import CustomerRequester from maxipago.resources.customer import CustomerAddResource, CustomerDeleteResource, CustomerUpdateResource class CustomerManager(ManagerApi): def add(self, **kwargs): fields = ( ('customer_id', {'translat...
{ "content_hash": "932c4bf43874ff14ebe8ce76150a4b6a", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 107, "avg_line_length": 49.96153846153846, "alnum_prop": 0.5619707467282525, "repo_name": "maxipago/Python-integration-lib", "id": "6848b52e89acdc316f5c07ed0a60be57be21e358",...
""" Rasterplots Utilities for raster image manipulation (e.g. OR maps) using PIL/Pillow and Numpy. Used for visualizing orientation maps (with and without selectivity), polar FFT spectra and afferent model weight patterns. """ import Image import ImageOps import numpy as np import colorsys rgb_to_hsv = np.vectorize(...
{ "content_hash": "36d6c08ae2c23da4cbe63e74e99facd1", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 85, "avg_line_length": 37.72027972027972, "alnum_prop": 0.6245828698553949, "repo_name": "ioam/topographica", "id": "7a0a5e77c99ae356720972804a9813a19658c226", "size": "53...
import sys from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ...
{ "content_hash": "266db2b6499666adfe0601f9b8838cb1", "timestamp": "", "source": "github", "line_count": 672, "max_line_length": 148, "avg_line_length": 44.651785714285715, "alnum_prop": 0.6438378990868493, "repo_name": "Azure/azure-sdk-for-python", "id": "59210109ff6d441116381ce94a8035f25a86752e", ...
import sublime import sublime_plugin import os import re import imp import sys import warnings DEFAULT_SETTINGS = \ ''' { // If you want exceptions reraised so you can see them in the console, change this to true. "reraise_exceptions": false, // If you want to have a syntax applied when new files are crea...
{ "content_hash": "b85be21d5facba847d6b4e076d3712ed", "timestamp": "", "source": "github", "line_count": 291, "max_line_length": 291, "avg_line_length": 36.32302405498282, "alnum_prop": 0.5855250709555345, "repo_name": "dostavro/dotfiles", "id": "f1ec8d928d91b4ef344f90a76526808473a6c8dd", "size": "1...
"""Utilities used in tornado.""" import socket import errno from tornado import ioloop class TCPHandler(object): """TCP socket handler backed tornado event loop. Parameters ---------- sock : Socket The TCP socket, will set it to non-blocking mode. """ def __init__(self, sock): ...
{ "content_hash": "34e1aef5291ebeb3e6b6ef383d20a3c9", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 97, "avg_line_length": 32.39047619047619, "alnum_prop": 0.5142605116142311, "repo_name": "Huyuwei/tvm", "id": "b7b16188a5f6dfbe926556335b535f4ebc541b88", "size": "4186", ...
""" Script to draw skimage logo using Scipy logo as stencil. The easiest starting point is the `plot_colorized_logo`. Original snake image from pixabay [1]_ .. [1] http://pixabay.com/en/snake-green-toxic-close-yellow-3237/ """ import sys if len(sys.argv) != 2 or sys.argv[1] != '--no-plot': print("Run with '--no-p...
{ "content_hash": "8ad129a4501e63c64088e80adad4cb86", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 78, "avg_line_length": 30.606060606060606, "alnum_prop": 0.6259405940594059, "repo_name": "chintak/scikit-image", "id": "85ba51991a7cf08b3ab41c9bbdc68c8c91895fd5", "size":...
from collections import Iterable import logging import itertools from pulp import LpProblem, lpSum, LpVariable, LpMinimize, LpMaximize def _add_elements(seq, *elements): for element in elements: seq.append(element) def _reciprocal(func): def _wrapper(*args, **kw): result = func(*args, **kw) ...
{ "content_hash": "f2568451a2a7184d80dcb99d59947d63", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 100, "avg_line_length": 45.39568345323741, "alnum_prop": 0.61743264659271, "repo_name": "gaufung/LMDI", "id": "f5e38d93ec251930d8684370b985ffbd320edeb7", "size": "6335", ...
def extractMoooriyelsmtladventureWordpressCom(item): ''' Parser for 'moooriyelsmtladventure.wordpress.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('PRC', 'PRC', ...
{ "content_hash": "41278ae55d62fbe8173ecfbe89f6c9a8", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 104, "avg_line_length": 27.761904761904763, "alnum_prop": 0.6500857632933105, "repo_name": "fake-name/ReadableWebProxy", "id": "ecb754675cee7c191d67f8f5bbca0d31c646395e", "...
from __future__ import print_function, division import matplotlib import logging from sys import stdout matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import (Net, RealApplianceSource, BLSTMLayer, DimshuffleLayer, Bidirectio...
{ "content_hash": "1356209d77718efef967bc51cd05cef4", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 86, "avg_line_length": 30.959798994974875, "alnum_prop": 0.5700373316020126, "repo_name": "mmottahedi/neuralnilm_prototype", "id": "6537652057c3484f6b5fa9093b532c10d1488a08"...
from discord.ext import commands import os.path import json class Battle(): def __init__(self, bot): self.bot = bot @commands.command(pass_context = True) async def start_quest(self, ctx): """Starts the quest! Will fill in all it does as I go.""" first_player = ctx.messa...
{ "content_hash": "97fdca40d40284bf1f073bc8b0b2297e", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 94, "avg_line_length": 33.48148148148148, "alnum_prop": 0.5907079646017699, "repo_name": "padilin/Discord-RPG-Bot", "id": "509a361f725015fb9d35be5ce67915b65ea30e45", "size"...
from gemstone.core.modules import Module import gemstone class FirstModule(Module): @gemstone.exposed_method("module1.say_hello") def say_hello(self): return "Hello from module 1!"
{ "content_hash": "b4e48417eb21a3288d0ceb1e44629542", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 49, "avg_line_length": 24.875, "alnum_prop": 0.7236180904522613, "repo_name": "vladcalin/pymicroservice", "id": "0d5f87225693624a0a36908ee48e82206865b344", "size": "199", ...
"""A wrapper to have a portable SHA-256 tool.""" # TODO(dmarting): instead of this tool we should make SHA-256 of artifacts # available in Skylark. import hashlib import sys if __name__ == "__main__": if len(sys.argv) != 3: # pylint: disable=superfluous-parens print("Usage: %s input output" % sys.argv[0]) ...
{ "content_hash": "ca79178867163688073297852cada879", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 74, "avg_line_length": 33.13333333333333, "alnum_prop": 0.6639839034205232, "repo_name": "variac/bazel", "id": "12c39dfdc27a5fce6348dd32f17feff4bf618850", "size": "1099", ...
""" This file is part of Ludolph: Erigones SDDC API plugin Copyright (C) 2015-2017 Erigones, s. r. o. See the LICENSE file for copying permission. """ import json import time import logging from ludolph_erigones import __version__ from ludolph.command import CommandError, command from ludolph.message import red, gree...
{ "content_hash": "9bc8050c06829f7cba5861aaaf6a852f", "timestamp": "", "source": "github", "line_count": 305, "max_line_length": 119, "avg_line_length": 35.86229508196721, "alnum_prop": 0.5259645273358932, "repo_name": "erigones/ludolph-erigones", "id": "1b75b6368015634e9c24ce6c86d94bb4e868c8c2", "s...
""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
{ "content_hash": "38bb7cd8a2c4c2c8e037380eeaecf4b7", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 140, "avg_line_length": 41.888888888888886, "alnum_prop": 0.7738726790450928, "repo_name": "arenadata/ambari", "id": "734e9ec8260299817a1b5d7f00acfff675c02832", "size": "15...
"""Enable/disable ejector.""" from mpf.devices.ball_device.ball_device_ejector import BallDeviceEjector from mpf.core.delays import DelayManager from mpf.devices.ball_device.default_ball_search import DefaultBallSearch class EnableCoilEjector(DefaultBallSearch, BallDeviceEjector): """Enable a coil to eject one ...
{ "content_hash": "3eef7cfe16fbfedd997f26e17d91c7a0", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 110, "avg_line_length": 40.61666666666667, "alnum_prop": 0.616741895773492, "repo_name": "missionpinball/mpf", "id": "0c896a9aa6102a46a6dc3961240188e01a3951e6", "size": "24...
from participantCollection import ParticipantCollection import string import re import datetime import pyperclip # Edit Me! # Remember, this is during signup, so current month is not March, it's February. currentMonthTotalDays = 30 currentMonthURL = "https://www.reddit.com/r/pornfree/comments/6xecnc/stay_clean_septemb...
{ "content_hash": "e7bebdee89d0c96fa0be4df5e07b3942", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 569, "avg_line_length": 62.857142857142854, "alnum_prop": 0.7022727272727273, "repo_name": "foobarbazblarg/stayclean", "id": "953e26b1c67bd5eb5c7010e25dcea1ea21bea247", "s...
import atexit from functools import wraps import json import os import requests import time from pyvcloud import vcloudair from pyvcloud.schema.vcd.v1_5.schemas.vcloud import taskType from cloudify import ctx from cloudify import context from cloudify import exceptions as cfy_exc TASK_RECHECK_TIMEOUT = 2 TASK_STATUS...
{ "content_hash": "2700786be3d46b3af6b0895b0a76ac57", "timestamp": "", "source": "github", "line_count": 303, "max_line_length": 79, "avg_line_length": 33.99009900990099, "alnum_prop": 0.5649092144868434, "repo_name": "geokala/tosca-vcloud-plugin", "id": "e8abef2c2cd430b0f5cbfdaa0c2a153f9c0eb4be", "...
""" Start the GEOS server from command line. """ from geos import app import argparse import geos.mapsource import pkg_resources from geos.kml import URLFormatter MAPSOURCES = pkg_resources.resource_filename("geos", "mapsources") app.config.from_object('geos.default_settings') def run_app(default_host=app.config['...
{ "content_hash": "be914e590f4d78fb7825d735969748cc", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 128, "avg_line_length": 40.94444444444444, "alnum_prop": 0.6246042514699232, "repo_name": "grst/geos", "id": "ebf466a658d8d1cbb862c3a4bd0cd31f63a67406", "size": "2235", "...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'TalentSaturation' db.create_table(u'analytics_talentsaturation', ( (u'id', self.gf('django.db.models.fie...
{ "content_hash": "2deb9929137bac18b79f5affe3d6287a", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 164, "avg_line_length": 70.96067415730337, "alnum_prop": 0.5469875702636371, "repo_name": "arpitprogressive/arpittest", "id": "c6fafe0f0bc5907a50d748df534ce8394873bf26", "...
"""Support for statistics for sensor values.""" from collections import deque import logging import statistics import voluptuous as vol from homeassistant.components.recorder.models import States from homeassistant.components.recorder.util import execute, session_scope from homeassistant.components.sensor import PLAT...
{ "content_hash": "29676833a1ccc7e92cd93b3c09396cc6", "timestamp": "", "source": "github", "line_count": 346, "max_line_length": 88, "avg_line_length": 35.88728323699422, "alnum_prop": 0.5866956591769349, "repo_name": "mKeRix/home-assistant", "id": "945e5ff89d16f99ca3bf12d082fd3c8686e0dfd6", "size":...
from pywps.dblog import store_status from pywps.response.status import WPS_STATUS from jinja2 import Environment, PackageLoader import os class RelEnvironment(Environment): """Override join_path() to enable relative template paths.""" def join_path(self, template, parent): return os.path.dirname(paren...
{ "content_hash": "efa1fa1bd2b4a536a652327117485ffc", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 92, "avg_line_length": 31.805555555555557, "alnum_prop": 0.6327510917030568, "repo_name": "tomkralidis/pywps", "id": "3ecfa222cd1ede842da11142514062956294b691", "size": "22...
"""This script reads our requirements.txt file and removes the pinned versions""" import re import os from os.path import abspath, dirname TOP_LEVEL = abspath(dirname(dirname(dirname(__file__)))) REQUIREMENTS = os.path.join(TOP_LEVEL, 'requirements.txt') BUILD_REQUIREMENTS = os.path.join(TOP_LEVEL, 'build_tools', 'bu...
{ "content_hash": "f1e073788321dbb429f805d634acc547", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 85, "avg_line_length": 33.476190476190474, "alnum_prop": 0.6557610241820768, "repo_name": "alkaline-ml/pmdarima", "id": "1528e45631e7ec54080d0c82be516d20b2f950f9", "size": ...
def main(j, args, params, tags, tasklet): doc = args.doc ayspath = args.getTag('ayspath') or '' if ayspath: repo = j.atyourservice.repoGet(ayspath) templates = repo.templates else: templates = j.atyourservice.actorTemplates out = [] try: reponame = j.sal.fs.getBa...
{ "content_hash": "7a43005ee7d5bfd70af5bcca0a619999", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 113, "avg_line_length": 30.42105263157895, "alnum_prop": 0.6262975778546713, "repo_name": "Jumpscale/jumpscale_portal8", "id": "618b9c24d5b9cc88d977a101ab47f70a065a4806", "...
""" Created on Tue Sep 15 20:25:53 2015 @author: Wasit """ import numpy as np import pandas as pd df = pd.read_csv('cs401.csv',delimiter=",",parse_dates=True, infer_datetime_format=True,dayfirst=False,encoding='utf8') myheader=list(df.columns.values) advisors={'name':[]} for ad in df[myheader[7]]: ...
{ "content_hash": "de3218a6d6236b0377ff95e2b42b3611", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 75, "avg_line_length": 30.38235294117647, "alnum_prop": 0.6292352371732817, "repo_name": "wasit7/cs426", "id": "d9e598c1827654c8d5d48cd96efb79fd5b5cde76", "size": "1057", ...
import json import requests from .device import Device from .channel import Channel from .contact import Contact from .invalid_key_error import InvalidKeyError from .filetype import get_file_type class PushBullet(object): DEVICES_URL = "https://api.pushbullet.com/v2/devices" CONTACTS_URL = "https://api.p...
{ "content_hash": "7d65664cfa35243cfeb351225913621d", "timestamp": "", "source": "github", "line_count": 258, "max_line_length": 120, "avg_line_length": 33.201550387596896, "alnum_prop": 0.5754144291384543, "repo_name": "aerobit/pushbullet.py", "id": "83daf5a48d6d78d6ccbf633070aa6c484fb65592", "size...
import struct import Config from Util import Util class MsgHead: parser = struct.Struct('=iibb%dsiii' % (Config.IDLEN + 2)) _fields = ['pos', 'len', 'sent', 'mode', ['id', 1, Config.IDLEN + 2], 'time', 'frompid', 'topid'] #struct msghead size = parser.size def unpack(self, str): Util....
{ "content_hash": "f12ad801ebaf4c4d65a63198594a310a", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 101, "avg_line_length": 24.041666666666668, "alnum_prop": 0.5736568457538995, "repo_name": "HenryHu/pybbs", "id": "c1a31e210fb245d7267313337a6aa11ec0c7741e", "size": "599",...
import datetime import time from flask import g, session, request, redirect from rrd import app, config from rrd.view.utils import get_usertoken_from_session, get_current_user_profile @app.template_filter('fmt_time') def fmt_time_filter(value, pattern="%Y-%m-%d %H:%M"): if not value: return '' return ...
{ "content_hash": "5a63a7cde192136770acc18d641538fa", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 82, "avg_line_length": 31.06153846153846, "alnum_prop": 0.6220901436354631, "repo_name": "open-falcon/dashboard", "id": "6fa04eb88c9a253bb756dc3bf968f1ea3c5f99ca", "size": ...
from locust import HttpUser, TaskSet, task import random def index(l): l.client.get("/") def stats(l): l.client.get("/stats/requests") class UserTasks(TaskSet): # one can specify tasks like this tasks = [index, stats] # but it might be convenient to use the @task decorator @task def p...
{ "content_hash": "6ff985ab334653325a8980b4eb8afa37", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 87, "avg_line_length": 24.87272727272727, "alnum_prop": 0.6476608187134503, "repo_name": "locustio/locust", "id": "05a5ff0501cac87404c675959c23f1eda1605cb2", "size": "1368"...
from pylcp.crud import base as crud class PaymentAuth(crud.LCPCrud): def create(self, path, payload): return super(PaymentAuth, self).create(path, payload) class PaymentCapture(crud.LCPCrud): def create(self, path): return super(PaymentCapture, self).create(path, '{}')
{ "content_hash": "9872a075e5caa823c93dd01519d3e942", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 61, "avg_line_length": 27.09090909090909, "alnum_prop": 0.7013422818791947, "repo_name": "Points/PyLCP", "id": "bc304a4e11ee51d0d1745c887103d8ec18142edc", "size": "298", ...
from django.conf.urls import patterns, url from .views import dashboard urlpatterns = patterns('', url(r'^source/(?P<pk>\d+)/course/list/$', dashboard.SourceCourseListView.as_view(), name='source-course-list'), url(r'^course/(?P<pk>\d+)/edit/$', dashboard.CourseFormEditView.as_view(), name='course-edit'), ...
{ "content_hash": "ef6ffc9bc67915633c67f724da077b88", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 121, "avg_line_length": 42, "alnum_prop": 0.6831501831501832, "repo_name": "ocwc/ocwc-data", "id": "3d483cb58010541ec7c11be1edc3af66f3669cac", "size": "546", "binary": fa...
''' Module for interfacing with SysFS .. seealso:: https://www.kernel.org/doc/Documentation/filesystems/sysfs.txt .. versionadded:: 2016.3.0 ''' # Import python libs from __future__ import absolute_import import logging import os import stat # Import external libs import salt.ext.six as six # Import salt libs import...
{ "content_hash": "c9a6cf2853514af4d977aef51dc34423", "timestamp": "", "source": "github", "line_count": 257, "max_line_length": 97, "avg_line_length": 26.540856031128406, "alnum_prop": 0.525142940917754, "repo_name": "stephane-martin/salt-debian-packaging", "id": "4c1eb675d31d53f59bc5628fc2f3f10dd9ee...
import pathofexile.api import pathofexile.ladder.analytics def main(): # set default leagues leagues = ['Standard', 'Hardcore'] # try to get a list of updated leagues from the API try: leagues = [league.get('id') for league in pathofexile.api.get_leagues()] except: pass for lea...
{ "content_hash": "7a0fe5bb71e7daa7234ce61e029011de", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 80, "avg_line_length": 25.11764705882353, "alnum_prop": 0.6416861826697893, "repo_name": "willroberts/pathofexile", "id": "9cc82de2d05aacfe4b231339edcf3da742f168da", "size"...
from django.shortcuts import render, redirect from django.contrib.auth import authenticate, login, logout from django.contrib.auth.models import User from django.contrib import messages from getraenkewart.forms import RegistrationForm REGISTRATION_SUCCESS = "Neuen Benutzer erfolgreich angelegt. Bitte warte auf deine ...
{ "content_hash": "ae7057471a8a3368313ba1c60de5ce4e", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 96, "avg_line_length": 38.95161290322581, "alnum_prop": 0.6525879917184265, "repo_name": "Faerbit/getraenkewart.de", "id": "3ca468e0177927dd9e658d42471ea7e4486f7c00", "size...
__author__ = 'kra869' available_sections = ['modules', 'mods', 'configuration', 'config'] def init(context): parser = context.register_command('show', command_show, help='Show information about armory repository') global available_sections parser.add_argument('sections', nargs='+', choices=available_sec...
{ "content_hash": "1b0c346aea9002209744fdea8c4c0750", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 179, "avg_line_length": 35, "alnum_prop": 0.6857142857142857, "repo_name": "mikaelbrandin/armory", "id": "1fbcebcd327ee4f347cc718f1ab37212ae4ffb99", "size": "1190", "bina...
from pylons import tmpl_context as c from tg import request, url import json import logging from formencode import validators as fev from webhelpers import paginate import ew as ew_core import ew.jinja2_ew as ew log = logging.getLogger(__name__) def onready(text): return ew.JSScript('$(function () {%s});' % te...
{ "content_hash": "5d12b7270f3ccc0d85ed4cfc38178a89", "timestamp": "", "source": "github", "line_count": 509, "max_line_length": 158, "avg_line_length": 31.24557956777996, "alnum_prop": 0.5685990945674044, "repo_name": "heiths/allura", "id": "900e46eb6f2853fa7906897ae84c7b59d100fe60", "size": "16774...
"""Commands for managing billing accounts and associate them with projects.""" from googlecloudsdk.api_lib.billing import utils from googlecloudsdk.calliope import base @base.ReleaseTracks(base.ReleaseTrack.ALPHA) class Billing(base.Group): """Manage billing accounts and associate them with projects.""" def Fil...
{ "content_hash": "80997bf3f791ed456e952029d429baab", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 78, "avg_line_length": 34.38461538461539, "alnum_prop": 0.7606263982102909, "repo_name": "KaranToor/MA450", "id": "673199d930cbc0943da17cd5da3d965f0577d85e", "size": "1042"...
import osv/power.hh def __request_rebuild( reboots, sleep_seconds ): counter = 0 try: print 'trying to readfile...' d = readfile( open('/reboot.log', 'r' ) ) print d #counter = int( d ) counter = inline('(int)(d[0])') - 48 print counter print '--------' except: print 'first bootup...' counter += ...
{ "content_hash": "38655f517a889993ad8ac9f5ad5f9450", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 48, "avg_line_length": 18.766666666666666, "alnum_prop": 0.6003552397868561, "repo_name": "secureosv/pythia", "id": "c15aa087f43951bf9e9e4cc6684c72f0c31633bb", "size": "645...
""" pyexcel_io.readers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ file readers :copyright: (c) 2014-2022 by Onni Software Ltd. :license: New BSD License, see LICENSE for more details """ from pyexcel_io.plugins import IOPluginInfoChainV2 IOPluginInfoChainV2(__name__).add_a_reader( relative_plugin_cla...
{ "content_hash": "3242fb2be5990284aeb1c4b5306c0cb7", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 60, "avg_line_length": 28.783783783783782, "alnum_prop": 0.6262910798122066, "repo_name": "chfw/pyexcel-io", "id": "c597292422fb188174fc49e77bdbd3afd2cb02d6", "size": "1065...
from __future__ import absolute_import, division, print_function from ..utils import ignoring from .core import (Array, stack, concatenate, take, tensordot, transpose, from_array, choose, where, coarsen, insert, broadcast_to, ravel, reshape, fromfunction, unique, store, squeeze, topk, bincount, ...
{ "content_hash": "737ee31c111fd1baec98f70586e77e01", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 79, "avg_line_length": 54.21212121212121, "alnum_prop": 0.6629401900503075, "repo_name": "cowlicks/dask", "id": "3b87004933569320826ca6be4441289560098cac", "size": "1789", ...
"""Provides functionality to notify people.""" from __future__ import annotations import voluptuous as vol import homeassistant.components.persistent_notification as pn from homeassistant.const import CONF_NAME, CONF_PLATFORM from homeassistant.core import HomeAssistant, ServiceCall import homeassistant.helpers.confi...
{ "content_hash": "fe0bb6d72e3f555c9ad3375c86dfb506", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 81, "avg_line_length": 29.70769230769231, "alnum_prop": 0.7027446918694976, "repo_name": "GenericStudent/home-assistant", "id": "bc8a7bffa952db9866f4af1d59fd38e262dff5ed", ...
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin from django.db import models from django.contrib.auth.models import BaseUserManager class AccountManager(BaseUserManager): def create_account(self, username, password, **kwargs): if not username: raise ValueError('Users ...
{ "content_hash": "57208aac14c494533ea0f795bb711884", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 78, "avg_line_length": 27.107692307692307, "alnum_prop": 0.6617480136208853, "repo_name": "mik4el/gadget-board", "id": "d4c077539127a8587cde3926a7050d5d0ff32e17", "size": "...
import re from setuptools import setup, find_packages with open('dronedemo/__init__.py', 'r') as fd: version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) if not version: raise RuntimeError('Cannot find version information') setup( name=...
{ "content_hash": "2322467658f81bc411e7ff3eaf158095", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 66, "avg_line_length": 33.23809523809524, "alnum_prop": 0.5959885386819485, "repo_name": "drone-demos/drone-with-python", "id": "6c8b8bb78a9d5b2c93e3e411edd511f7aaace6fe", ...
import numpy as np from scipy import stats,special import scipy as sp from . import link_functions from ..util.misc import chain_1, chain_2, chain_3, blockify_dhess_dtheta, blockify_third, blockify_hessian, safe_exp from ..util.quad_integrate import quadgk_int from scipy.integrate import quad from functools import part...
{ "content_hash": "cef990ee47a420b28bdbb339a3d77f25", "timestamp": "", "source": "github", "line_count": 849, "max_line_length": 344, "avg_line_length": 42.96113074204947, "alnum_prop": 0.5848823819707188, "repo_name": "SheffieldML/GPy", "id": "0f17a883b1d70a63af83668e2dad46f929dbac36", "size": "365...
from __future__ import unicode_literals import requests from zerotest.utils.generator_helper import dict_to_param_style_code from zerotest.utils.url_helper import urlparse from zerotest.utils.encode_helper import ensure_unicode class Request(object): def __init__(self, scheme=None, method=None, params=None, hos...
{ "content_hash": "db2fea1e590329bb8685992339febed9", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 108, "avg_line_length": 32.20338983050848, "alnum_prop": 0.5868421052631579, "repo_name": "jjyr/zerotest", "id": "b976113441db51fea516b81d3ad030a0a3325968", "size": "1900",...
import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils from h2o.estimators.random_forest import H2ORandomForestEstimator import numpy as np from sklearn import ensemble from sklearn.metrics import roc_auc_score def smallcatRF(): # Training set has 26 categories from A to Z # Catego...
{ "content_hash": "e887e38736e8772b95ffb11d6aedadf4", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 115, "avg_line_length": 32.416666666666664, "alnum_prop": 0.693573264781491, "repo_name": "madmax983/h2o-3", "id": "0d43988c4ecda8fe35ff5b9743468b231b5c9a47", "size": "1945...
import sys import unittest class DocutilsTests(unittest.TestCase): def test_publish_string(self): from docutils.core import publish_string s = publish_string('foo', writer_name='html') if sys.version_info[0] >= 3: s = s.decode('utf-8') self.assertTrue(s.startswith('<?...
{ "content_hash": "965776e703a15db51f68b2eca68dd465", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 80, "avg_line_length": 25.857142857142858, "alnum_prop": 0.6243093922651933, "repo_name": "Jarn/jarn.viewdoc", "id": "a591e11e1eb568b5ca370e6b9a4349de70499b27", "size": "36...
from django import forms from users.models import AdminUser, MemberUser class AdminUserForm(forms.Form): username = forms.CharField(label='Username', max_length=10) first_name = forms.CharField(label='First Name', max_length=30) last_name = forms.CharField(label='Last Name', max_length=30) email = for...
{ "content_hash": "a57d56866f97575ad8f8ffa35962dce2", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 106, "avg_line_length": 40, "alnum_prop": 0.6742857142857143, "repo_name": "mmunchkinn/Hex-Omega", "id": "1ec28682041349a29f547b4f76672938e7018f00", "size": "2800", "bina...
import atexit import requests from tools import cli from pyVmomi import vim from pyVim.connect import SmartConnect, Disconnect from tools import tasks # disable urllib3 warnings if hasattr(requests.packages.urllib3, 'disable_warnings'): requests.packages.urllib3.disable_warnings() def delete_virtual_disk(si, vm...
{ "content_hash": "c8fd6034d8b8d3e3ee10d656bd8e1b73", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 78, "avg_line_length": 31.403225806451612, "alnum_prop": 0.5906522855675398, "repo_name": "pfitzer/pyvmomi-community-samples", "id": "a3010119d749d25082f6479e7258e1cfa7b3dab...
import os.path as op from os import environ import time import logging import shutil from Bio import SeqIO from . import conf, errors, helper, structure_tools logger = logging.getLogger(__name__) class TCoffee(object): """Alignes sequences using t_coffee in expresso mode.""" def __init__(self, alignment_fas...
{ "content_hash": "570fcb83fdcac7d7a683d0ee46c92bd1", "timestamp": "", "source": "github", "line_count": 260, "max_line_length": 98, "avg_line_length": 43.64230769230769, "alnum_prop": 0.5417290913897946, "repo_name": "ostrokach/elaspic", "id": "c6081b1080e56b762ce7b3fbe1614ed31041ef16", "size": "11...
""" CISCO_RADIUS_EXT_MIB This MIB module defines objects describing RADIUS (Remote Access Dialin User Service), serving as an extension of the following MIB modules\: \- \- RADIUS\-AUTH\-CLIENT\-MIB [RFC4668] \- RADIUS\-AUTH\-SERVER\-MIB [RFC4669] \- RADIUS\-ACC\-CLIENT\-MIB [RFC4670] \- RADIUS\-...
{ "content_hash": "038b798af162dce8883991ab07abba05", "timestamp": "", "source": "github", "line_count": 638, "max_line_length": 276, "avg_line_length": 34.13009404388715, "alnum_prop": 0.6111136624569461, "repo_name": "111pontes/ydk-py", "id": "8d8b7afa623aa6d241333f2b64a02fc81f87dbe2", "size": "21...
import sys from django.conf import settings from django.core.management import execute_from_command_line if not settings.configured: settings.configure( DATABASES={ 'default': { 'ENGINE': 'django.db.backends.sqlite3', } }, MIDDLEWARE_CLASSES=( ...
{ "content_hash": "42d425add2e556578d2b89145b521d72", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 76, "avg_line_length": 28.56451612903226, "alnum_prop": 0.5561829474872954, "repo_name": "opps/opps-facebook-comments", "id": "9f61c376c08d47cc767a6eab2af6d5585710b799", "s...
''' bac tester. This works by running a number of scenarios and catching the log output and comparing it to a successful log. ''' import json import socket import traceback import time import bac class TestError(Exception): pass def find_server(): '''Locate a bac server''' s = socket.socket(socket.AF...
{ "content_hash": "fb382114cbfccbceaad31d415b46623f", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 80, "avg_line_length": 23.701570680628272, "alnum_prop": 0.5840512480671527, "repo_name": "atbentley/bac", "id": "669861a3e651f13cd022ecb2c0110af00408eb0e", "size": "4527"...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2014, Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can # be found in the LICENSE file. # This file contains integration tests for the go/vt/binlog package. # It sets up filtered replication between two sha...
{ "content_hash": "6acafbeadc3349d82aabb719c01cd3f4", "timestamp": "", "source": "github", "line_count": 249, "max_line_length": 80, "avg_line_length": 35.54216867469879, "alnum_prop": 0.6543502824858757, "repo_name": "kuipertan/vitess", "id": "e64e81c4cac1b08d0d1acf8baf5d76e8fcafbcc5", "size": "886...
"""This code example creates a new line item to serve to video content. This feature is only available to DFP premium solution networks. To determine which line items exist, run get_all_line_items.py. To determine which orders exist, run get_all_orders.py. To create a video ad unit, run create_video_ad_unit.py. To crea...
{ "content_hash": "6028efbc868ca2089b7f45611ab2e48c", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 80, "avg_line_length": 31.853658536585368, "alnum_prop": 0.5809086268504339, "repo_name": "donspaulding/adspygoogle", "id": "4e8a9f1ab978ffb6207adb3ff1741cdb946dd609", "si...
from .endpoint import Endpoint from .check_traffic_manager_relative_dns_name_availability_parameters import CheckTrafficManagerRelativeDnsNameAvailabilityParameters from .dns_config import DnsConfig from .monitor_config import MonitorConfig from .profile import Profile from .traffic_manager_name_availability import Tra...
{ "content_hash": "eb23eb4327a091eac6b66555cef4ea0e", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 133, "avg_line_length": 33.73684210526316, "alnum_prop": 0.7987519500780031, "repo_name": "rjschwei/azure-sdk-for-python", "id": "657f837d95ad5009db671883db10f07ec2df90c1", ...
from django.http import StreamingHttpResponse from rest_framework.generics import ListAPIView, ListCreateAPIView, RetrieveAPIView from rest_framework.settings import api_settings from spillway import filters, forms, mixins, pagination, renderers, serializers _default_filters = tuple(api_settings.DEFAULT_FILTER_BACKEN...
{ "content_hash": "2a4bd640ba52cb5129155857fcdf55ef", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 83, "avg_line_length": 39, "alnum_prop": 0.7331166486096063, "repo_name": "kuzmich/django-spillway", "id": "6c6335377ab95cf545dab49d63274cfa6f6deace", "size": "2769", "bi...
class ViewRootController(): def __init__(self, view_root, model_document): self._view_root = view_root self._model_document = model_document self.connectSignals() def connectSignals(self): m_d = self._model_document v_r = self._view_root m_d.documentPartAddedSign...
{ "content_hash": "15dd5b3bb3c07b52bcd037beecf16dad", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 91, "avg_line_length": 47.285714285714285, "alnum_prop": 0.7109768378650554, "repo_name": "JMMolenaar/cadnano2.5", "id": "050b0f2b683d5d859b1a1a2897f023f88f82be61", "size":...
from __future__ import absolute_import from sentry.message_filters import _localhost_filter from sentry.relay.config import ProjectConfig from sentry.testutils import TestCase class LocalhostFilterTest(TestCase): def apply_filter(self, data): project_config = ProjectConfig(self.project) return _l...
{ "content_hash": "bef9412f3b050a7edb435957778955a4", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 87, "avg_line_length": 35.3469387755102, "alnum_prop": 0.6610854503464203, "repo_name": "mvaled/sentry", "id": "256cd66312faa5c3cdf997cbf70072c031152f48", "size": "1732", ...
from mistral import exceptions as exc from mistral.tests.unit.rpc.kombu import base from mistral.tests.unit.rpc.kombu import fake_kombu from mistral import utils import mock from six import moves with mock.patch.dict('sys.modules', kombu=fake_kombu): from mistral.rpc.kombu import base as kombu_base from mistr...
{ "content_hash": "b70e2b84f652f80df51ac4a962c8bbb0", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 77, "avg_line_length": 30.480392156862745, "alnum_prop": 0.6326793181087166, "repo_name": "StackStorm/mistral", "id": "53f42df03c9e0e407f670cc2f9e94d06a98dcca9", "size": "...
"""Clean up resources from gcp projects. """ import argparse import collections import datetime import json import os import subprocess import sys # A resource that need to be cleared. Resource = collections.namedtuple('Resource', 'name group condition managed tolerate') DEMOLISH_ORDER = [ # [WARNING FROM KRZYZA...
{ "content_hash": "ac6723ab5be938feb39c3a1d861046f1", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 98, "avg_line_length": 37.213740458015266, "alnum_prop": 0.5822564102564103, "repo_name": "krousey/test-infra", "id": "054d0b1bee5e110cc7ed8448b5b556d9ecf0a1c4", "size": "...
from .helper import *
{ "content_hash": "ae44ab7dc4d5728c1fc31dab269a0816", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 21, "avg_line_length": 11.5, "alnum_prop": 0.6956521739130435, "repo_name": "SarahWooller/Using_NetSurfP", "id": "bdfdb117ccbb50980ad170207b74cf0291bf7e54", "size": "24", ...
SESSION_CASE_TYPE = 'session' PEER_RATING_CASE_TYPE = 'peer_rating' SESSION_RATING_CASE_PROP = 'session_rating' MEAN_TREATMENT_SPECIFIC_SCORE_CASE_PROP = 'mean_treatment_specific_score' MEAN_GENERAL_SKILLS_SCORE_CASE_PROP = 'mean_general_skills_score' DATE_OF_PEER_REVIEW_CASE_PROP = 'date_of_peer_review' NEEDS_AGGREGA...
{ "content_hash": "3526c24af9992bc586d9166b7a409b7f", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 73, "avg_line_length": 39.2, "alnum_prop": 0.7678571428571429, "repo_name": "dimagi/commcare-hq", "id": "91393f583e1877f19d3b58b25a52506943677c32", "size": "392", "binary...
countries = [['China','Beijing',1350], ['India','Delhi',1210], ['Romania','Bucharest',21], ['United States','Washington',307]] # Write code to print out the capital of India # by accessing the array. print countries[1][1]
{ "content_hash": "d251f550c87901d3acda1ea135703c43", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 48, "avg_line_length": 29.22222222222222, "alnum_prop": 0.5817490494296578, "repo_name": "xala3pa/Computer-Science-cs101", "id": "4d2a0fb23c8ec07f59ba5ca4bff75aedda3f2a4c", ...
from collections import namedtuple from oslo_config import cfg from oslo_log import log as logging from senlin.common import constraints from senlin.common import consts from senlin.common import exception as exc from senlin.common.i18n import _ from senlin.common import scaleutils from senlin.common import schema fro...
{ "content_hash": "686dccfc1f12b96f65162c568da81a78", "timestamp": "", "source": "github", "line_count": 505, "max_line_length": 79, "avg_line_length": 41.964356435643566, "alnum_prop": 0.48367308418271043, "repo_name": "stackforge/senlin", "id": "bb1fa6bc5987a5217754468614007aa0c09328f8", "size": "...
from test_framework.names import NameTestFramework from test_framework.util import * class NameExpirationTest (NameTestFramework): def set_test_params (self): self.setup_name_test ([["-debug=names"]] * 4) def checkUTXO (self, ind, name, shouldBeThere): """ Query for a name's coin in the UTXO set and ...
{ "content_hash": "e5613f59001c717f8106d054fac627ca", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 80, "avg_line_length": 42.16778523489933, "alnum_prop": 0.6551010663695687, "repo_name": "brandonrobertz/namecoin-core", "id": "2746eef41f1bcd41be73058413923f4db69b8807", ...
import mock from sherlock.batch.ingest_multiple_dates import ParallelEtStepper, ETLStepper from sherlock.batch.ingest_multiple_dates import ETLStep, _executor from sherlock.batch.ingest_multiple_dates import KeyboardInterruptError from sherlock.batch.ingest_multiple_dates import parse_command_line from sherlock.batch....
{ "content_hash": "64ec2246e9d3230fe0f8ec8593d5decd", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 89, "avg_line_length": 35.54210526315789, "alnum_prop": 0.6041759218125278, "repo_name": "Yelp/mycroft", "id": "e1f1aa18fed143db79ecbe4e0f14a8452ed4771b", "size": "6778", ...
""" pyvisa-py.tcpip ~~~~~~~~~~~~~~~ TCPIP Session implementation using Python Standard library. :copyright: 2014 by PyVISA-py Authors, see AUTHORS for more details. :license: MIT, see LICENSE for more details. """ import random import socket import select import time from pyvisa import constant...
{ "content_hash": "52c4caf2101db615ca3f77549b7d6746", "timestamp": "", "source": "github", "line_count": 474, "max_line_length": 122, "avg_line_length": 32.333333333333336, "alnum_prop": 0.5988516246900691, "repo_name": "andeh575/pyvisa-py", "id": "2f6528df8bb124d82fb5fb99436ac3012c1cd399", "size": ...
import queue import collections from .cmdsys import command, is_command from .event import Event, Target class BridgeChannel: def __init__(self, manager): self._manager = manager self.bridges = set() self.users = {} def _bridge_join(self, bridge_id): if bridge_id in self.bridg...
{ "content_hash": "ce92f7537429ebbb525e6c0e923ed861", "timestamp": "", "source": "github", "line_count": 251, "max_line_length": 79, "avg_line_length": 35.06772908366534, "alnum_prop": 0.5331742785730516, "repo_name": "Hornwitser/YetiBridge", "id": "aa8130544b974323e152dce7e225bf8b765f0c90", "size":...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: avi_poolgroup author: Gaurav Rastogi (grastogi@avinetworks.com) short_description: Module for setup of PoolGroup Avi RESTful Object description: ...
{ "content_hash": "5eec2b896da949a42628b6aadc491cd6", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 144, "avg_line_length": 33.84375, "alnum_prop": 0.6170360110803325, "repo_name": "e-gob/plataforma-kioscos-autoatencion", "id": "8d7cbf5b22bda26ed516b9668904e7336e1ab0e2", ...