text
stringlengths
4
1.02M
meta
dict
"""This is the Bokeh charts interface. It gives you a high level API to build complex plot is a simple way. This is the Step class which lets you build your Step charts just passing the arguments to the Chart class and calling the proper functions. """ #-----------------------------------------------------------------...
{ "content_hash": "69218cd2468342fd71b76b8b4022e787", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 84, "avg_line_length": 36.47747747747748, "alnum_prop": 0.561373178562608, "repo_name": "almarklein/bokeh", "id": "ec3b68abc5c1a31973d9c5fda476b1f7e4b8fa1d", "size": "4049...
""" Several basic tests for hierarchical clustering procedures """ # Authors: Vincent Michel, 2010, Gael Varoquaux 2012, # Matteo Visconti di Oleggio Castello 2014 # License: BSD 3 clause import itertools from tempfile import mkdtemp import shutil import pytest from functools import partial import numpy as n...
{ "content_hash": "bef0493a72b3f10ff132fb4ecf448a11", "timestamp": "", "source": "github", "line_count": 837, "max_line_length": 79, "avg_line_length": 39.05615292712067, "alnum_prop": 0.6093300703579076, "repo_name": "kevin-intel/scikit-learn", "id": "bd70b2c1aac543a5b8b8e45f59c9def0d3a3924a", "siz...
from pySDC.Transfer import transfer from pySDC.datatype_classes.particles import particles, fields class particles_to_particles(transfer): """ Custon transfer class, implements Transfer.py This implementation is just a dummy for particles with no functionality. It can be used to check if in the particle ...
{ "content_hash": "f0aa4849764f04f7d861bd8bc3451ba8", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 119, "avg_line_length": 30.403225806451612, "alnum_prop": 0.6095490716180372, "repo_name": "torbjoernk/pySDC", "id": "047f8977bfa01d4f276412ad12957aba97c378aa", "size": "18...
import ddt import mock from oslo_log import log from oslo_utils import units import six from manila.common import constants as const from manila import exception from manila.share.drivers.dell_emc.plugins.isilon import isilon from manila.share.drivers.dell_emc.plugins.isilon import isilon_api from manila import test ...
{ "content_hash": "dd0c09ce84abed046a9a530424813af5", "timestamp": "", "source": "github", "line_count": 751, "max_line_length": 79, "avg_line_length": 42.271637816245004, "alnum_prop": 0.601083601083601, "repo_name": "vponomaryov/manila", "id": "777a18bc60a24cb71e604790c6adf5070ff3eccd", "size": "3...
__source__ = 'https://leetcode.com/problems/non-decreasing-array/' # Time: O(N) # Space: O(1) # # Description: Leetcode # 665. Non-decreasing Array # # Given an array with n integers, # your task is to check if it could become non-decreasing by modifying at most 1 element. # # We define an array is non-decreasing if a...
{ "content_hash": "a27f22b4a51c981666632cb364b45a8f", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 103, "avg_line_length": 25.224719101123597, "alnum_prop": 0.5363028953229398, "repo_name": "JulyKikuAkita/PythonPrac", "id": "2cf80b74bcd6f8775c9a89b38e7db2440b75400b", "si...
from direct.directnotify import DirectNotifyGlobal from direct.distributed import DistributedObject from otp.distributed import DistributedDistrict class ToontownDistrict(DistributedDistrict.DistributedDistrict): notify = DirectNotifyGlobal.directNotify.newCategory('ToontownDistrict') def __init__(self, cr): ...
{ "content_hash": "66d1ae22f32781f331acf2b151d2189b", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 76, "avg_line_length": 33.94117647058823, "alnum_prop": 0.7521663778162911, "repo_name": "ksmit799/Toontown-Source", "id": "830e473680a2bd6df498d9fba8b357c0fe43449d", "size...
def test_simple(): import kanten
{ "content_hash": "a3e95d2b486a02b7f03670551c3d11c4", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 18, "avg_line_length": 9.75, "alnum_prop": 0.6410256410256411, "repo_name": "ivanov/kanten", "id": "084af8693f288a7c65f77be948363353deee69f4", "size": "39", "binary": fals...
""" Module to handle interpreted Python objects. """ import itertools import tokenize from jedi.parser import representation as pr class ObjectImporter(object): """ Import objects in "raw" namespace such as :func:`locals`. """ def __init__(self, scope): self.scope = scope count = ...
{ "content_hash": "c0e91dfc045ba5db993925ff959863de", "timestamp": "", "source": "github", "line_count": 169, "max_line_length": 78, "avg_line_length": 32.27218934911242, "alnum_prop": 0.5031169783645031, "repo_name": "leonth/private-configs", "id": "dadf1b28c8dbcc174e4515b8a1f4b60ca93fcbbf", "size"...
"""This code example gets a line item creative association (LICA) by the line item and creative id. To determine which line items exist, run get_all_line_items.py. To determine which creatives exit, run get_all_creatives.py.""" __author__ = 'api.shamjeff@gmail.com (Jeff Sham)' # Locate the client library. If module w...
{ "content_hash": "a36caf14f9ef5e36066ea6e0e2fa2372", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 80, "avg_line_length": 35.4, "alnum_prop": 0.6908797417271993, "repo_name": "krux/adspygoogle", "id": "c3d900c13a14d55456fb2482af26c793738b4ee9", "size": "1857", "binary"...
""" Tests for swift.common.wsgi """ from __future__ import with_statement import errno import logging import mimetools import socket import unittest import os import re import pickle from textwrap import dedent from gzip import GzipFile from StringIO import StringIO from collections import defaultdict from contextlib ...
{ "content_hash": "867c4ea7740cab3e0f0940e0f9cc8f38", "timestamp": "", "source": "github", "line_count": 847, "max_line_length": 81, "avg_line_length": 36.78512396694215, "alnum_prop": 0.5465545463298778, "repo_name": "orion/swift-config", "id": "6dd5ef39e130ed544056b526dea4c092ab51fa83", "size": "3...
import time import numpy as np import pandas as pd import tensorflow as tf from tensorflow.contrib.distributions import percentile def do_clipped_factorization( counts_df, rank=3, clip_percentile=99.9, learning_rate=1.0, minibatch_size=1024 * 32, patience=5, max_epochs=1000, normalize...
{ "content_hash": "c2b0edf0a8130ff59f082a1600eb7aff", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 87, "avg_line_length": 37.53804347826087, "alnum_prop": 0.6332705950485015, "repo_name": "laserson/phip-stat", "id": "bd64d9f67c8663e55032af40d06240e06cdf6b11", "size": "6...
import sys import os from modules.logintools.xmlsqlite import SQL from modules.configobj import ConfigObj from modules.pathutils import * from modules.cgiutils import * from loginutils import * ################################################### def cSort(inlist, minisort=True): """A case insensitive sort. If min...
{ "content_hash": "cc9eb28e5f7d9358ce842c8f7d2b5561", "timestamp": "", "source": "github", "line_count": 569, "max_line_length": 159, "avg_line_length": 44.63093145869947, "alnum_prop": 0.6381571175428233, "repo_name": "amir-zeldes/rstWeb", "id": "5f39e8af3750e14c9b669cb31a7b93173719677e", "size": "...
from os import path import unicodecsv as csv from promrep.models import DateInformation, DateType, Person, SecondarySource def read_input_file(ifname): # noqa file_basename = path.basename(ifname) file_basename = path.splitext(file_basename)[0] log_fname = file_basename + "_import-log.csv" # se...
{ "content_hash": "53f577974b37140ccc195548252e5144", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 88, "avg_line_length": 39.10852713178294, "alnum_prop": 0.4103072348860258, "repo_name": "kingsdigitallab/dprr-django", "id": "54921ca954b7574da2c912e258e1773ee1b073f1", "...
class VmNetworkMapping(object): def __init__(self): self.vnic_name = '' self.dv_port_name = '' self.dv_switch_name = '' self.dv_switch_path = '' self.vlan_id = '' self.vlan_spec = '' class VmNetworkRemoveMapping(object): def __init__(self): self.vnic_nam...
{ "content_hash": "b36c9b188678af2bdfbadd63de8743fe", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 132, "avg_line_length": 45.18421052631579, "alnum_prop": 0.47815958066394876, "repo_name": "QualiSystems/vCenterShell", "id": "9fcaba8935a28a335af0a9a0f3f1e620650ffc63", "s...
import os import sys if __name__ == '__main__': os.environ.setdefault( 'DJANGO_SETTINGS_MODULE', 'ics_generator.tests.south_settings') from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "3b32a7c7e4876271c39a95e4d819f409", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 71, "avg_line_length": 25.5, "alnum_prop": 0.6941176470588235, "repo_name": "bitmazk/django-ics-generator", "id": "4b428aa5e8e9ad14d96f135c6d301a5dd5ae751c", "size": "277",...
import os import sys import pipes import shutil import subprocess """ This plugin uses glue to sprite images: http://glue.readthedocs.org/en/latest/quickstart.html Install: (Only if you want to sprite jpg too) brew install libjpeg (Only if you want to optimize pngs with optipng) brew install optipng sudo easy_inst...
{ "content_hash": "393be6421520b4f6e797ec8cac25573e", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 95, "avg_line_length": 21.527272727272727, "alnum_prop": 0.700168918918919, "repo_name": "koenbok/Cactus", "id": "730dbcfc39521741fb3a9283b9aa498dfce1fb51", "size": "1184",...
import typing import revoke_dataset_access import update_dataset_access if typing.TYPE_CHECKING: import pytest from google.cloud import bigquery def test_dataset_access_permissions( capsys: "pytest.CaptureFixture[str]", dataset_id: str, entity_id: str, bigquery_client: "bigquery.Client", ) -...
{ "content_hash": "e1096544b4877577fd4b5d9c0b131b3c", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 87, "avg_line_length": 36.644444444444446, "alnum_prop": 0.7077016373559734, "repo_name": "googleapis/python-bigquery", "id": "4d1a70eb1ede0c1f9d4bf0af184a48c7f53be373", "s...
import wpan from wpan import verify # ----------------------------------------------------------------------------------------------------------------------- # Test description: Router table # # Verify router table entries on a network with 4 routers: # {r1, r2, r3} forming a loop with r4 connecting to r3. # test_nam...
{ "content_hash": "0778641984e32d569e3babe865ca16f5", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 121, "avg_line_length": 33.08426966292135, "alnum_prop": 0.5515367634572933, "repo_name": "lanyuwen/openthread", "id": "41b98f53832d347f4acf126e103df0d393048548", "size": ...
from orangengine.drivers.base import BaseDriver from orangengine.drivers.juniper_srx import JuniperSRXDriver from orangengine.drivers.palo_alto_panorama import PaloAltoPanoramaDriver from orangengine.drivers.palo_alto_base import PaloAltoBaseDriver __all__ = ['BaseDriver', 'JuniperSRXDriver', 'PaloAltoPanoramaDriver'...
{ "content_hash": "27ce4d2e51161509deb2e8e048ae04c2", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 94, "avg_line_length": 49.42857142857143, "alnum_prop": 0.8352601156069365, "repo_name": "lampwins/orangengine", "id": "7f63e21a824a670a871302240794866c92bcef72", "size": "3...
"""Some utilities that may help. """ from iterables import (iff, flatten, group, take, subsets, variations, numbered_symbols, cartes, capture, any, all, dict_merge, postorder_traversal, preorder_traversal, interactive_traversal, prefixes, postfixes, sift) from lambdify import lambdify from source import so...
{ "content_hash": "0324f2e4297862f24811ec6fdf6be292", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 72, "avg_line_length": 32.214285714285715, "alnum_prop": 0.7804878048780488, "repo_name": "pernici/sympy", "id": "d8352fa34a262ca8d6b1a8f705bb6f96a30f04ac", "size": "451", ...
import zstackwoodpecker.test_state as ts_header import os TestAction = ts_header.TestAction def path(): return dict(initial_formation="template5", checking_point=1, faild_point=100000, path_list=[ [TestAction.create_mini_vm, 'vm1', 'cluster=cluster2'], [TestAction.create_volume, 'volume1', 'cluster=cluster2', ...
{ "content_hash": "7d1d223df724584536f2bfa461b5ac8b", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 104, "avg_line_length": 42.983870967741936, "alnum_prop": 0.6964352720450282, "repo_name": "zstackio/zstack-woodpecker", "id": "630d3af4668916d6c4d92f06d75c2f928c5f8b9b", "...
import re def match(command, settings): return ('rm' in command.script and 'is a directory' in command.stderr) def get_new_command(command, settings): return re.sub('^rm (.*)', 'rm -rf \\1', command.script)
{ "content_hash": "5fc4c39022308105d0498b05ef21da2f", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 59, "avg_line_length": 25.555555555555557, "alnum_prop": 0.6347826086956522, "repo_name": "JensTimmerman/thefuck", "id": "f9349ea45051156c96eead5875fdb777140119d5", "size": ...
import pytest from mitmproxy.test.tflow import tflow from mitmproxy.tools.console import defaultkeys, quickhelp from mitmproxy.tools.console.eventlog import EventLog from mitmproxy.tools.console.flowlist import FlowListBox from mitmproxy.tools.console.flowview import FlowView from mitmproxy.tools.console.grideditor im...
{ "content_hash": "15cdb1133a2ca173a41800deb48aca43", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 80, "avg_line_length": 31.29230769230769, "alnum_prop": 0.6691248770894789, "repo_name": "mhils/mitmproxy", "id": "958bf6ae40fd39cafe88f8e764da4366189b7745", "size": "2034"...
from a10sdk.common.A10BaseClass import A10BaseClass class Stats(A10BaseClass): """This class does not support CRUD Operations please use parent. :param radius_response_dropped: {"description": "Query Response Dropped", "format": "counter", "type": "number", "oid": "11", "optional": true, "size": "8"} ...
{ "content_hash": "9fe21a23c1ccc4113c3e667924e6d910", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 191, "avg_line_length": 47.1578947368421, "alnum_prop": 0.6216517857142857, "repo_name": "amwelch/a10sdk-python", "id": "2245c562e2fb92d9aa4d48f6e420d6da257b084c", "size": ...
import webapp2 import tweepy import ConfigParser from tweepy import * from time import ctime, gmtime, mktime, strftime import csv import random class BotHandler(webapp2.RequestHandler): def runBot(self): config = ConfigParser.RawConfigParser() config.read('settings.cfg') # http://dev.twitt...
{ "content_hash": "153100ac65766a5e7ab1814b9377ad47", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 93, "avg_line_length": 35.708333333333336, "alnum_prop": 0.5957659609934989, "repo_name": "fsiddiqi/quotedian", "id": "9928dffc26d8ec47ff2bb2013b3eaecdadbbef3e", "size": "...
""" Output for vt100 terminals. A lot of thanks, regarding outputting of colors, goes to the Pygments project: (We don't rely on Pygments anymore, because many things are very custom, and everything has been highly optimized.) http://pygments.org/ """ from __future__ import unicode_literals from prompt_toolkit.filter...
{ "content_hash": "dec758fdccb52c8fd8f1857f4819512a", "timestamp": "", "source": "github", "line_count": 630, "max_line_length": 95, "avg_line_length": 31.214285714285715, "alnum_prop": 0.5445715738621917, "repo_name": "lancezlin/ml_template_py", "id": "4568ee3c2b3b4a3f7a9f9fe5cbcf2a9c8e382259", "si...
"""Tests for tensor2tensor.utils.metrics.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensor2tensor.utils import metrics import tensorflow as tf class MetricsTest(tf.test.TestCase): def testAccuracyMetric(self): predi...
{ "content_hash": "3e3857279f9c8aac089a6e3f7d50343f", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 73, "avg_line_length": 35.217213114754095, "alnum_prop": 0.5982776678691959, "repo_name": "vthorsteinsson/tensor2tensor", "id": "3e504d88112aa02200f63e50f5c946e31d774120", ...
def init(job): from JumpScale.baselib.atyourservice81.AtYourServiceBuild import ensure_container ensure_container(job.service, root=False) def install(job): from JumpScale.baselib.atyourservice81.AtYourServiceBuild import build def build_func(cuisine): cuisine.systemservices.aydostor.build(st...
{ "content_hash": "2238591cb86e443f1b3f6cfbed2683d7", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 85, "avg_line_length": 30.583333333333332, "alnum_prop": 0.7683923705722071, "repo_name": "Jumpscale/ays_build", "id": "e5a3e529661e45a53723f416306675b223bc5119", "size": "...
from translate.convert import tiki2po from translate.storage import tiki from translate.convert import test_convert from translate.misc import wStringIO class TestTiki2Po: def test_converttiki_defaults(self): inputfile = """ "zero_source" => "zero_target", // ### Start of unused words "one_source" => "one_...
{ "content_hash": "a21a37cd49739a20c8c119ccc7908ad7", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 71, "avg_line_length": 31.244897959183675, "alnum_prop": 0.6557805355976486, "repo_name": "dbbhattacharya/kitsune", "id": "8024b4185f7899ebcdd70a2e170ee891436256b0", "size"...
''' This program sets up the feature input files to the HDF5 converter from S2S from VEN Run feature_combine.py first Uses splits from split_dir Uses individual numpy (.npy) features from npy_path Writes out tennis_allframes_tennis002_layer_split.txt annotation files ready for HDF5 conversion ''' import numpy as n...
{ "content_hash": "d83f95ec576f77388be54b5f43efd156", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 124, "avg_line_length": 38.45454545454545, "alnum_prop": 0.48857368006304175, "repo_name": "HaydenFaulkner/phd", "id": "3ba143181a066afe84c3fa5d42556d70ec7c7272", "size": "...
import logging if __name__ == '__main__': logging.basicConfig() _log = logging.getLogger(__name__) import pyxb.binding.generate import pyxb.utils.domutils from xml.dom import Node import os.path schema_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '../schemas/test-wildcard.xsd')) code = pyxb.bind...
{ "content_hash": "3a9880f50c30a5851a4ccdcd7c995807", "timestamp": "", "source": "github", "line_count": 220, "max_line_length": 103, "avg_line_length": 45.013636363636365, "alnum_prop": 0.6368777138240937, "repo_name": "CantemoInternal/pyxb", "id": "46216176a251d2994755fe786372dc86a5ef17bf", "size"...
""" URL patterns for the views included in ``django.contrib.auth``. Including these URLs (via the ``include()`` directive) will set up the following patterns based at whatever URL prefix they are included under: * User login at ``login/``. * User logout at ``logout/``. * The two-step password change at ``password/c...
{ "content_hash": "2cf2d64d9414cf144aeb5214942bdbdb", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 138, "avg_line_length": 43.81818181818182, "alnum_prop": 0.5245998814463545, "repo_name": "dresl/django18-bootstrap", "id": "3ff5d3d3291704ef9714f74e7c99d874e77f18d1", "siz...
""" Stager handling functionality for EmPyre. """ import fnmatch import imp import http import helpers import encryption import os import base64 class Stagers: def __init__(self, MainMenu, args): self.mainMenu = MainMenu # pull the database connection object out of the main menu self...
{ "content_hash": "3ab1efd50cffa62e45db2d08cf8639a3", "timestamp": "", "source": "github", "line_count": 392, "max_line_length": 185, "avg_line_length": 38.05357142857143, "alnum_prop": 0.5769256552926192, "repo_name": "EmpireProject/EmPyre", "id": "c5b7e9705ed30eb8a32a19fb1fe7ade2b0caf1c9", "size":...
""" Test logging in the evaluation loop """ import collections import itertools from unittest import mock from unittest.mock import call import numpy as np import pytest import torch from pytorch_lightning import callbacks, Trainer from pytorch_lightning.loggers import TensorBoardLogger from tests.helpers import Bori...
{ "content_hash": "e5379a7796d33cef10b883c791117efa", "timestamp": "", "source": "github", "line_count": 605, "max_line_length": 120, "avg_line_length": 35.30413223140496, "alnum_prop": 0.5890725221218222, "repo_name": "williamFalcon/pytorch-lightning", "id": "8579bc044734a7807994f94fdf820a8aa36cb5f2"...
from __future__ import unicode_literals from frappe.desk.page.setup_wizard.install_fixtures import setup_email_linking def execute(): setup_email_linking()
{ "content_hash": "9f90c001b9f23b69a5532406c9d6bec6", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 78, "avg_line_length": 26.333333333333332, "alnum_prop": 0.7911392405063291, "repo_name": "adityahase/frappe", "id": "08f57ca5e4a987afec6108b913358b289270ef62", "size": "158...
""" PynamoDB attributes """ import six import json from base64 import b64encode, b64decode from delorean import Delorean, parse from pynamodb.constants import ( STRING, NUMBER, BINARY, UTC, DATETIME_FORMAT, BINARY_SET, STRING_SET, NUMBER_SET, DEFAULT_ENCODING ) class Attribute(object): """ An attribut...
{ "content_hash": "e9efd7b17e587e85973a23c315ad1f26", "timestamp": "", "source": "github", "line_count": 268, "max_line_length": 85, "avg_line_length": 24.91417910447761, "alnum_prop": 0.5650741350906096, "repo_name": "mtsgrd/PynamoDB2", "id": "7b31c41a8283b2f781a2a8a7ef510c6329ffbe34", "size": "667...
from random import choice, seed from pytest import mark import sanic.router from sanic.request import Request seed("Pack my box with five dozen liquor jugs.") # Disable Caching for testing purpose sanic.router.ROUTER_CACHE_SIZE = 0 class TestSanicRouteResolution: @mark.asyncio async def test_resolve_rou...
{ "content_hash": "1eb7f4966abc7601c30187b20fdbd328", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 76, "avg_line_length": 27.65432098765432, "alnum_prop": 0.5334821428571429, "repo_name": "ashleysommer/sanic", "id": "a921d06306a1352d1a600a4088670f739d13960d", "size": "22...
import os import time import json from pUtil import tolog, convert def openFile(filename, mode): """ Open and return a file pointer for the given mode """ # Note: caller needs to close the file f = None if os.path.exists(filename): try: f = open(filename, mode) except IOEr...
{ "content_hash": "180207a51d24940f3b564107fed21859", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 114, "avg_line_length": 28.75, "alnum_prop": 0.5405034324942791, "repo_name": "RRCKI/pilot", "id": "221133a8d3f442666c8c8851324ccaf18082047c", "size": "4430", "binary": ...
from oslo.config import cfg from neutron.agent.common import config cisco_opts = [ cfg.StrOpt('vlan_name_prefix', default='q-', help=_("VLAN Name prefix")), cfg.StrOpt('provider_vlan_name_prefix', default='p-', help=_("VLAN Name prefix for provider vlans")), cfg.BoolOpt('pro...
{ "content_hash": "48e8059c9ade1f6e76f347d77be44332", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 77, "avg_line_length": 39.08661417322835, "alnum_prop": 0.6005237711522965, "repo_name": "samsu/neutron", "id": "ebc496bd1a3f9c9f9d2605caecac71760161b8a8", "size": "5576",...
from django.db import models from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User from django.db import IntegrityError from django.conf import settings from django.urls import reverse from django.utils.timezone import now from django_bleach.models import BleachField from ...
{ "content_hash": "688cd1aa4778272911d064ed2af9112f", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 202, "avg_line_length": 38.970588235294116, "alnum_prop": 0.6920754716981132, "repo_name": "p2pu/learning-circles", "id": "491b644dfbab482e724f0874e6cc8a817faa1529", "size...
import sys from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload from azure.core.exceptions import ( ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, map_error, ) from azure.core.pipeline import Pipeline...
{ "content_hash": "2c56732a4518f28d92ff5b5d6ea35a1a", "timestamp": "", "source": "github", "line_count": 292, "max_line_length": 221, "avg_line_length": 47.10958904109589, "alnum_prop": 0.6653096830473975, "repo_name": "Azure/azure-sdk-for-python", "id": "8ea0b5c93bdab6c90920c8baff44e300053ab6ba", "...
"""Status management pages.""" import datetime import json import re from google.appengine.api import memcache from google.appengine.ext import db from appengine_module.chromium_status.base_page import BasePage from appengine_module.chromium_status import utils ALLOWED_ORIGINS = [ 'https://gerrit-int.chromium....
{ "content_hash": "241c104e1caab19512d9b9320a101956", "timestamp": "", "source": "github", "line_count": 453, "max_line_length": 80, "avg_line_length": 34.211920529801326, "alnum_prop": 0.6395018712091883, "repo_name": "nicko96/Chrome-Infra", "id": "b6d7f9be8a27637a34620bda611bcc3cf4d9ad5c", "size":...
import os import datetime import collections import tabulate from modularodm import Q from dateutil.relativedelta import relativedelta from framework.analytics import get_basic_counters from website import settings from website.app import init_app from website.models import User, PrivateLink from website.addons.drop...
{ "content_hash": "f33753b5375f18c1955e93b4af8d0017", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 76, "avg_line_length": 27.34131736526946, "alnum_prop": 0.6108190976784932, "repo_name": "kushG/osf.io", "id": "78748aa34f7c3e18b50963c79275e53f588137d8", "size": "4607", ...
from .spec import Equal, NotEqual, LessThan, LessThanEqual, GreaterThan, GreaterThanEqual, In, NotIn, \ Exists, Type, Where, UpdateSpecification, Mod, All, Size, Slice, QuerySpecification, Match import types import re __all__ = ['Common', 'String', 'Number', 'List', 'Reference'] class _Base(object): def get_...
{ "content_hash": "67228f5393fe86966900e956591806da", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 103, "avg_line_length": 27.304, "alnum_prop": 0.5754468209786112, "repo_name": "GGOutfitters/conjure", "id": "74147d3fadb99c26b37014cba766136ffce9220e", "size": "6826", ...
import os import zipfile from selenium.webdriver.common.by import By extensions = os.path.abspath("../../../../../../test/extensions/") def test_install_uninstall_signed_addon_xpi(driver, pages): extension = os.path.join(extensions, "webextensions-selenium-example.xpi") id = driver.install_addon(extension)...
{ "content_hash": "88bbd233067ecf57f4522f150cf80c53", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 87, "avg_line_length": 37.86363636363637, "alnum_prop": 0.7271908763505402, "repo_name": "titusfortner/selenium", "id": "0fdd9f8c688b8902bbe18ef5628b8d45d93bf0b1", "size": ...
__all__ = ["Config"] import __builtin__ from pandac.PandaModules import Filename from ConfigParser import SafeConfigParser APP_PATH = __builtin__.APP_PATH class Config(SafeConfigParser): def parse_into_object(self, object): """Parses the configuration file and sets the properties of the specified objec...
{ "content_hash": "8e77177b0c2231960db19c2a8a01a918", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 165, "avg_line_length": 46.30769230769231, "alnum_prop": 0.6733111849390919, "repo_name": "asceth/devsyn", "id": "800dcc2179a703a22e3b78ca1c341b2a7a5704d5", "size": "1806",...
""" test_pypostman ---------------------------------- Tests for `pypostman` module. """ import unittest from pypostman import pypostman class TestPypostman(unittest.TestCase): def setUp(self): pass def test_something(self): pass def tearDown(self): pass if __name__ == '__mai...
{ "content_hash": "299c06577ad6b15dac0542d950e45673", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 39, "avg_line_length": 13.8, "alnum_prop": 0.5594202898550724, "repo_name": "skalanux/pypostman", "id": "fdd9675e4490d710557235207e1a8f16692e5b5e", "size": "392", "binary...
""" ========= Constants ========= .. currentmodule:: numpy NumPy includes several constants: %(constant_list)s """ # # Note: the docstring is autogenerated. # import re import textwrap # Maintain same format as in numpy.add_newdocs constants = [] def add_newdoc(module, name, doc): constants.append((name, doc)) ...
{ "content_hash": "188a8502af1a64d29a970b453bebd42b", "timestamp": "", "source": "github", "line_count": 416, "max_line_length": 75, "avg_line_length": 22.129807692307693, "alnum_prop": 0.5821203562893765, "repo_name": "WarrenWeckesser/numpy", "id": "2c629ad33da8d62a66f647d829021e42bcd45b80", "size"...
from __future__ import with_statement import sys import os from setuptools import setup with open('README.rst') as file: long_description = file.read() if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') ...
{ "content_hash": "1557bcd4b19a0a65e3759c9b8da35548", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 113, "avg_line_length": 30.428571428571427, "alnum_prop": 0.532394366197183, "repo_name": "thedavecollins/ExEmGel", "id": "d97532bbef8194cb7527c072dbd0808c197604f1", "size"...
from __future__ import unicode_literals # Grammar from arpeggio import ParserPython, Optional, EOF def g(): return [Optional('first'), Optional('second'), Optional('third')], EOF def test_optional_in_choice(): parser = ParserPython(g) input_str = "second" parse_tree = parser.parse(input_str) asse...
{ "content_hash": "e2d0c5a7d53830ad0fcac046694e7b96", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 82, "avg_line_length": 26.615384615384617, "alnum_prop": 0.6936416184971098, "repo_name": "leiyangyou/Arpeggio", "id": "de6484b65745a348e43548f53bbed98f0067b2cc", "size": "...
""" This is an example script utilizing dpc.py for Differential Phase Contrast (DPC) imaging based on Fourier shift fitting. This script requires a SOFC folder containing the test data in your home directory. The default path for the results (texts and JPEGs) is also your home directory. It will automatically download...
{ "content_hash": "d7db6f3303a786f51c27d2a445e76d4d", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 114, "avg_line_length": 31.293233082706767, "alnum_prop": 0.6504084574723691, "repo_name": "ericdill/scikit-beam-examples", "id": "92e1b5388aca7725002980cce8393f5e32cf4160",...
""" Resource link. This file is part of the everest project. See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information. Created on Jun 29, 2011. """ from everest.resources.interfaces import IResourceLink from everest.resources.utils import resource_to_url from zope.interface import implementer # pyl...
{ "content_hash": "7930fc971f1fc35d7b2c436a9dc2968b", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 77, "avg_line_length": 28, "alnum_prop": 0.6716269841269841, "repo_name": "helixyte/everest", "id": "a6e4457dd86d7d3d2b330576d0fb1a3e647a5a3a", "size": "1008", "binary": ...
def elo(winner_rank, loser_rank, weighting): """ :param winner: The Player that won the match. :param loser: The Player that lost the match. :param weighting: The weighting factor to suit your comp. :return: (winner_new_rank, loser_new_rank) Tuple. This follows the ELO ranking method. """ ...
{ "content_hash": "aebcba5c4e5c90a3288cda39f43caea8", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 73, "avg_line_length": 38.82142857142857, "alnum_prop": 0.6807727690892365, "repo_name": "ulternate/table_tennis_league", "id": "be9bd5f7d840a39915f5c547fcf6ced95fe85e75", ...
from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_swarming_lesser_dewback.iff" result.attribute_template_id = 9 result.stfName("monster_name","dewback") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "a194ee2e0d5794cdddc67230f9ae02e9", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 69, "avg_line_length": 23, "alnum_prop": 0.6989966555183946, "repo_name": "anhstudios/swganh", "id": "6f82ddc433771fe82010c6b512180c2212e33093", "size": "444", "binary": ...
""" This file is part of ranger, the console file manager. This configuration file is licensed under the same terms as ranger. =================================================================== NOTE: If you copied this file to ~/.config/ranger/commands_full.py, then it will NOT be loaded by ranger, and only serve as ...
{ "content_hash": "2e518432343b6135932ca60a9b6f4eac", "timestamp": "", "source": "github", "line_count": 647, "max_line_length": 119, "avg_line_length": 31.100463678516228, "alnum_prop": 0.5002981810953185, "repo_name": "nl253/Dot-files", "id": "7185b9688d73d536a354e756aefe7596e7a8a68d", "size": "20...
import collections import csv import argparse import sys if __name__ == '__main__': parser = argparse.ArgumentParser( description='Remove some items from the task. Removal process is' 'controled by queries/labels files or --prev_task') parser.add_argument('--queries_file', help=...
{ "content_hash": "539b46c849dcd0c90688c37503b24345", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 92, "avg_line_length": 43.0958904109589, "alnum_prop": 0.5982199618563255, "repo_name": "varepsilon/cas-eval", "id": "3c17509725f76cc5b5ad64f1b1e2241057562aa2", "size": "39...
from typing import Any, Dict, Tuple, Union, Optional from fontTools.pens.pointPen import AbstractPointPen from glyphsLib.types import Transform, Point Number = Union[int, float] class LayerPointPen(AbstractPointPen): """A point pen to draw onto GSLayer object. See :mod:`fontTools.pens.basePen` and :mod:`f...
{ "content_hash": "63ea9a74fa95140e21652a387c449c4b", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 80, "avg_line_length": 28.873684210526317, "alnum_prop": 0.5931461903025884, "repo_name": "googlefonts/glyphsLib", "id": "e00edd5b6f74badbb219d53501440d36f3d23f57", "size":...
from distutils.core import setup from catkin_pkg.python_setup import generate_distutils_setup d = generate_distutils_setup( packages=[ 'herbpy', ], package_dir={'': 'src'}, ) setup(**d)
{ "content_hash": "cb02fa95abef0242c5ac202084eefe31", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 60, "avg_line_length": 20.7, "alnum_prop": 0.6570048309178744, "repo_name": "Shushman/herbpy", "id": "0632e194bd3a1222a97cbd713499b969144350c4", "size": "229", "binary": ...
"""A tiny web server. This is intended to be used for testing, and only run from within the googleclient/native_client """ import BaseHTTPServer import logging import os import SimpleHTTPServer import SocketServer import sys logging.getLogger().setLevel(logging.INFO) # Using 'localhost' means that we only accept c...
{ "content_hash": "f34af722eb70af3fab0fde12fbe6b16a", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 75, "avg_line_length": 28.43548387096774, "alnum_prop": 0.735677821894498, "repo_name": "endlessm/chromium-browser", "id": "db6cefe138f68ab08095af93c337c67acde1440c", "size...
import argparse import timeit import wandb def main(size: int) -> None: run = wandb.init(settings={"console": "off"}) run.log({f"v_{i}": i for i in range(size)}) run.finish() if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( "--size", type=int, ...
{ "content_hash": "ddb1cef69de073bc8fd4633ff978a770", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 49, "avg_line_length": 20.296296296296298, "alnum_prop": 0.5711678832116789, "repo_name": "wandb/client", "id": "6bf5536172464962095cbe0fe72e9cad0887d531", "size": "548", ...
""" This module is meant for vendorizing Python libraries. Most libraries will need to have some ``sys.path`` alterations done unless they are doing relative imports. Do **not** add anything to this module that does not represent a vendorized library. Vendored libraries should go into the ``vendor`` directory and imp...
{ "content_hash": "d741b5f436675847b3db995d66587068", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 79, "avg_line_length": 30.25925925925926, "alnum_prop": 0.7674418604651163, "repo_name": "ceph/ceph-deploy", "id": "fefb992e748e75e9bf523f12001f07793fff25bd", "size": "817"...
class SessionHelper: def __init__(self, app): self.app = app def login(self, username, password): wd = self.app.wd self.app.open_home_page() wd.find_element_by_id("LoginForm").click() wd.find_element_by_name("user").click() wd.find_element_by_name("user").clear(...
{ "content_hash": "02d0a4e4f6727e8f391212b6c24f3990", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 76, "avg_line_length": 32.372093023255815, "alnum_prop": 0.5747126436781609, "repo_name": "OlgaKuratkina/python_training_qa", "id": "b3bc0c015a081998e9b1535f39be0a91622655b5"...
from .elementfinder import ElementFinder from .tableelementfinder import TableElementFinder from .windowmanager import WindowManager __all__ = [ "ElementFinder", "TableElementFinder", "WindowManager" ]
{ "content_hash": "132af17a5740979fc995db974f11f91e", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 50, "avg_line_length": 24.11111111111111, "alnum_prop": 0.7603686635944701, "repo_name": "vincentfretin/robotframework-selenium2library", "id": "7c3f180b8d9a945f1643a0c59930b5...
class DynamicObject(object): def __init__(self, dictionary = {}): self.__dict__['_dict'] = dictionary def __setattr__(self, name, value): d = self.__dict__['_dict'] d[name] = value def __getattr__(self, name): d = self.__d...
{ "content_hash": "ef7b906819d64fb687328d2c1d133a2b", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 43, "avg_line_length": 22.3, "alnum_prop": 0.4282511210762332, "repo_name": "ThomasBollmeier/bovinus", "id": "29cb2e93215f672065bf76cbb1d3a58eddb9fb40", "size": "1059", "...
from tempest.api.compute import base from tempest import exceptions from tempest.test import attr class ServerAddressesV3Test(base.BaseV3ComputeTest): _interface = 'json' @classmethod def setUpClass(cls): super(ServerAddressesV3Test, cls).setUpClass() cls.client = cls.servers_client ...
{ "content_hash": "9068495a8fe4f3e413d1ea43bd7271b1", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 77, "avg_line_length": 39.1044776119403, "alnum_prop": 0.6423664122137405, "repo_name": "adkerr/tempest", "id": "82588b686bb713e743c65252ba713aa31a7def40", "size": "3301", ...
import simuvex class UserHook(simuvex.SimProcedure): NO_RET = True # pylint: disable=arguments-differ def run(self, user_func=None, user_kwargs=None, default_return_addr=None, length=None): result = user_func(self.state, **user_kwargs) if result is None: self.add_successor(self...
{ "content_hash": "5d8d451566f64014e95e48c72c548191", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 97, "avg_line_length": 40.53846153846154, "alnum_prop": 0.6584440227703985, "repo_name": "chubbymaggie/simuvex", "id": "c1ec1de15f685e145d39864ede5c81c1aefa638f", "size": "...
""" Created on Tue Feb 09 16:03:00 2016 @author: JCole119213 """ #import pdb import Tkinter as tki import tkFileDialog from EmailSamplesDB import EmailSamplesDB import argparse import logging import os from ProgressWindow import * class DBBuildGUI(tki.Toplevel) : def __init__(self, parent, DBobj, *a...
{ "content_hash": "07766c01a2180af1796d67d107373a45", "timestamp": "", "source": "github", "line_count": 315, "max_line_length": 127, "avg_line_length": 39.94603174603174, "alnum_prop": 0.7043630294842248, "repo_name": "joecole889/spam-filter", "id": "8e747da93ee6b0c373457b82d1cf24a3c7a6a709", "size...
""" The MIT License (MIT) Copyright (c) 2014 NTHUOJ team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, ...
{ "content_hash": "fd550404c33767392d205fc1df988a62", "timestamp": "", "source": "github", "line_count": 222, "max_line_length": 92, "avg_line_length": 34.43693693693694, "alnum_prop": 0.6837148463047744, "repo_name": "bruce3557/NTHUOJ_web", "id": "88a73bdf67c799ebb80cd22070cb01881b506e67", "size": ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('netobjects', '0006_auto_20170426_1639'), ] operations = [ migrations.AlterField( model_name='corenetworkobject', name='cli_a...
{ "content_hash": "db1bb02cdb2704db78cbc99792584364", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 63, "avg_line_length": 28, "alnum_prop": 0.5892857142857143, "repo_name": "Landver/netmon", "id": "5327a0b2e7725b1d7fe014bedb6c4d5aef473275", "size": "855", "binary": fal...
""" """ from collections import namedtuple import inspect import logging from sqlalchemy import inspect as sqinspect from sqlalchemy.exc import NoInspectionAvailable from sqlalchemy.ext.associationproxy import AssociationProxy from sqlalchemy.ext.hybrid import hybrid_property from sqlalchemy.orm import ColumnProperty...
{ "content_hash": "d8f8b1994ebcb7d41d322357c7c6bb5a", "timestamp": "", "source": "github", "line_count": 395, "max_line_length": 112, "avg_line_length": 32.81518987341772, "alnum_prop": 0.6113254127449468, "repo_name": "tornado-utils/tornado-restless", "id": "e048828c29d1a5db1f4fcb50aa443ac68722cc1f",...
import sys import os import random import time FLAG = os.environ["TASK1_FLAG"] OFFSET = random.randint(38, 42) def get_correct(): return int(time.time()) + OFFSET print("Download path <game server>/0c16c4dd438b0042c4d725fab588e648.py\n") print("Oh! Look what time it is: " + str(int(time.time()))) print("Yes! It's...
{ "content_hash": "05f53ae141ec5f1428ebfc557a2af96d", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 74, "avg_line_length": 19.2, "alnum_prop": 0.6428571428571429, "repo_name": "google/google-ctf", "id": "c2ae5dde8219d16f045790789944fa618e63ab76", "size": "691", "binary"...
from __future__ import print_function import os import sys from setuptools import Command, setup from setuptools.command.test import test as TestCommand from fabulist import __version__ # Override 'setup.py test' command class ToxCommand(TestCommand): def finalize_options(self): TestCommand.finalize_op...
{ "content_hash": "bbb2997af3d62983c3f37a2c898e1fea", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 89, "avg_line_length": 30.041176470588237, "alnum_prop": 0.6205208537301743, "repo_name": "mar10/fabulist", "id": "fda5cddef76f3d8598ae46d3329169d6de156cf2", "size": "5130...
import os import sys import warnings import django from django.test.runner import DiscoverRunner warnings.simplefilter('always') os.environ['DJANGO_SETTINGS_MODULE'] = 'password_reset.tests.settings' def runtests(): parent = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, parent) django....
{ "content_hash": "dd7afc9f6e36ffc5791850e78201848e", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 70, "avg_line_length": 21.615384615384617, "alnum_prop": 0.6654804270462633, "repo_name": "brutasse/django-password-reset", "id": "8995ca540cdf8b8bbcfc3c3fefb9a4f0e8bfe0ee", ...
import threading import time import json from twisted.internet import reactor, ssl from twisted.internet.protocol import ServerFactory from twisted.protocols.basic import LineReceiver class TLSFactory(ServerFactory): mailcontent = [] communication = [] tlsCert = None tlsKey = None class TLSServer(Li...
{ "content_hash": "70951a3ba29a990af2caa6aee8676cae", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 103, "avg_line_length": 30.027027027027028, "alnum_prop": 0.5853585358535853, "repo_name": "tspycher/python-devtlssmtpserver", "id": "10aff1b883e0ab6cc64f26059bf424e1886edcc...
from flask import request, session, g, redirect, url_for, abort from . import api from ..exceptions import ExistsError from ..models import Category, Sub from .main import BaseMethodView class SubListView(BaseMethodView): def get(self): _subs = Sub.all() subs = [] for sub in _subs: ...
{ "content_hash": "1d814ab4409f86d18501845cab00a5c9", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 71, "avg_line_length": 26.430555555555557, "alnum_prop": 0.5717288491854966, "repo_name": "spaceexperiment/forum-app", "id": "789ff704c7e81df8d3a95cdbaae2e322b4af438d", "si...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ui', '0010_auto_20161118_0002'), ] operations = [ migrations.AddField( model_name='export', name='export_segment_size', ...
{ "content_hash": "b4ead188c81c7106a5be53c69fcd1e9b", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 262, "avg_line_length": 33.111111111111114, "alnum_prop": 0.6140939597315436, "repo_name": "gwu-libraries/sfm", "id": "1f411c3b3d3caef125c848aaf0cfb118870c37f0", "size": "6...
"""Utilities for interacting with Identity Servers""" from twisted.internet import defer from synapse.api.errors import ( CodeMessageException ) from ._base import BaseHandler from synapse.util.async import run_on_reactor from synapse.api.errors import SynapseError, Codes import json import logging logger = logg...
{ "content_hash": "dcb6b90d269cf118f728ff43a020c155", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 89, "avg_line_length": 32.75675675675676, "alnum_prop": 0.5377475247524752, "repo_name": "TribeMedia/synapse", "id": "559e5d5a716a3aafe2ded2c1eb640d22f9c2af98", "size": "5...
"""Config flow to configure Xiaomi Miio.""" from __future__ import annotations from collections.abc import Mapping import logging from re import search from typing import Any from micloud import MiCloud from micloud.micloudexception import MiCloudAccessDenied import voluptuous as vol from homeassistant import config...
{ "content_hash": "5718343be334c038ce8e7e5580823801", "timestamp": "", "source": "github", "line_count": 422, "max_line_length": 88, "avg_line_length": 37.002369668246445, "alnum_prop": 0.5766250400256164, "repo_name": "mezz64/home-assistant", "id": "70e6fb5c0b6bedf23d88e4e73bd9d87932002ce0", "size"...
from django.contrib import admin from starbowmodweb.ladder.models import Map, Client, BattleNetCharacter, CrashReport import modeladmins admin.site.register(Map, modeladmins.MapModelAdmin) admin.site.register(Client, modeladmins.ClientModelAdmin) # admin.site.register(ClientRegionStats) # admin.site.register(Matchmak...
{ "content_hash": "0f1cfaf16ea0556c1da55683e591eec6", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 84, "avg_line_length": 37.714285714285715, "alnum_prop": 0.8446969696969697, "repo_name": "Starbow/StarbowWebSite", "id": "9cf67cd03e8f3410d3836110ee44503afbc6d187", "size"...
import os import numpy as np if __name__ == "__main__": ## which have already been run? enumerate_dir = os.path.join(os.getcwd(),'enumerateOutput') if len(os.listdir(enumerate_dir))==1: results_dir = os.path.join(enumerate_dir,os.listdir(enumerate_dir)[0]) print 'Results dir is: {}'.format(results_dir) comp...
{ "content_hash": "e1b512712df981c37758a405c3e2417a", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 161, "avg_line_length": 34.86363636363637, "alnum_prop": 0.6714471968709257, "repo_name": "judithfan/graphcomm", "id": "2cdabed235e6fd9fa9465c8d107b7810419123a2", "size": "...
from django.conf import settings from django.core.exceptions import ImproperlyConfigured SETTINGS_TYPES = { "RECAPTCHA_DOMAIN": str, "RECAPTCHA_PRIVATE_KEY": str, "RECAPTCHA_PROXY": dict, "RECAPTCHA_PUBLIC_KEY": str, "RECAPTCHA_VERIFY_REQUEST_TIMEOUT": int, } # Validate settings types. for variab...
{ "content_hash": "457ad80805328cf1da58d567cd91d03b", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 75, "avg_line_length": 30.523809523809526, "alnum_prop": 0.6957878315132605, "repo_name": "praekelt/django-recaptcha", "id": "17d92a7b95f59d5392c1af3fec22f949650833d4", "si...
version_info = {'branch_nick': u'LOCALBRANCH', 'revision_id': 'LOCALREVISION', 'revno': 0} HORIZON_VERSION = ['2012', '2', None] YEAR, COUNT, REVISION = HORIZON_VERSION FINAL = True # This becomes true at Release Candidate time def canonical_version_string(): return '.'.join(fi...
{ "content_hash": "130e45cbe8221cb10d5719b94aa36beb", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 60, "avg_line_length": 26.05263157894737, "alnum_prop": 0.6222222222222222, "repo_name": "tylertian/Openstack", "id": "1db0857a4e40cf213b846f07ee7dfb7b62b9e9af", "size": "1...
"""dais URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/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-based ...
{ "content_hash": "62578e78b501344e98cc98764ccd7c27", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 79, "avg_line_length": 35.774193548387096, "alnum_prop": 0.6636609558160504, "repo_name": "amitdhiman000/dais", "id": "6120a889d0878333c118f432c87fef0c21d89750", "size": "1...
""" SAGA.database This subpackage contains database-related routines, including Database """ from .core import * from .saga_database import *
{ "content_hash": "53bb71b88c83208e9abb6b43fc096661", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 70, "avg_line_length": 18, "alnum_prop": 0.7638888888888888, "repo_name": "sagasurvey/saga", "id": "7f022be3405d60f5fe8280387481a6b1591501e6", "size": "144", "binary": fal...
import numpy as np import pytest import pandas as pd import pandas.util.testing as tm from pandas._libs.tslib import iNaT from pandas.core.arrays import PeriodArray from pandas.core.dtypes.dtypes import PeriodDtype from pandas.tests.extension import base @pytest.fixture def dtype(): return PeriodDtype(freq='D') ...
{ "content_hash": "29b8c6f3e93061ac871821637be8a958", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 76, "avg_line_length": 25.941935483870967, "alnum_prop": 0.6600348172096493, "repo_name": "amolkahat/pandas", "id": "6f59cbb66a145d65c274df0c394bd0b2a8a1e90a", "size": "40...
import tests class ATestCase(tests.BaseTestCase): def test_logging_configuration_loaded(self): self.assertTrue(self.logger is not None) def test_configuration_loaded(self): self.assertTrue(self.configuration is not None) def test_configuration_contents(self): self.assertTrue('ve...
{ "content_hash": "5268395fb9bba3d8bc1af5eaadc18b3e", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 76, "avg_line_length": 33.266666666666666, "alnum_prop": 0.7154308617234469, "repo_name": "collectdbit/verzamelend", "id": "68fa01ae632bd222ab280c4cd71163d43f8057ad", "size...
from django.core.management.base import BaseCommand from corehq.apps.domain.models import Domain class Command(BaseCommand): help = "Marks most recent snapshot of a domain" args = "" def handle(self, *args, **options): print "Migrating snapshot documents to have a marked head" for domain...
{ "content_hash": "0b668dfe6be41c036bc7097b812d8e72", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 66, "avg_line_length": 31.375, "alnum_prop": 0.5378486055776892, "repo_name": "qedsoftware/commcare-hq", "id": "3afdaa6c2ae64bb8fa42c067a730a1282432a601", "size": "753", ...
""" The host configuration controls system settings of the host OS. This module operates as follows: 1. The first time, we try to detect all devices and auto-generate a reasonable configuration, which we store to a persistent file. 2. (TODO) We present the configuration to the owner sometime around provisioning or f...
{ "content_hash": "9e53a4465098dfb0a87f26f78dfd66eb", "timestamp": "", "source": "github", "line_count": 329, "max_line_length": 85, "avg_line_length": 28.145896656534955, "alnum_prop": 0.588012958963283, "repo_name": "ParadropLabs/Paradrop", "id": "109114c520fc223a5a6b853a68b21211304f3707", "size":...
from jsonrpc import ServiceProxy import sys import string import getpass # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:9332") e...
{ "content_hash": "3cb827b83781815be24670cf30eea434", "timestamp": "", "source": "github", "line_count": 337, "max_line_length": 101, "avg_line_length": 28.679525222551927, "alnum_prop": 0.5685463010863943, "repo_name": "my-first/octocoin", "id": "b3ac04b2a25cd1b74231bcd28aed3ef684e0abe3", "size": "...
from django.test import TestCase from quotes.models import Quote class QuoteTestCase(TestCase): def test_create(self): ts = Quote(author="A", text="ABC") ts.save() self.assertEqual(str(ts), "A ABC")
{ "content_hash": "22cdfbb36cd5b8911e44ae6bb5423b28", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 42, "avg_line_length": 22.9, "alnum_prop": 0.6506550218340611, "repo_name": "eged/cmsplugin-quotes", "id": "5ab603a5f7c4ab01c2e7e6a069d379306b528514", "size": "229", "bin...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0034_simplify_transfer_status'), ] operations = [ migrations.AddField( model_name='layer', name='max_x', ...
{ "content_hash": "60a64594b8fd70ffd84b20c8b6e1d538", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 73, "avg_line_length": 30.641509433962263, "alnum_prop": 0.5431034482758621, "repo_name": "kdeloach/raster-foundry", "id": "eb9c50a7f96b5e0a42f4556d835fd1566f81a3a6", "size...
"""Updates an Plex library whenever the beets library is changed. Put something like the following in your config.yaml to configure: plex: host: localhost port: 32400 """ from __future__ import (division, absolute_import, print_function, unicode_literals) import requests fr...
{ "content_hash": "9625c585e7327f0f42ce75ee6ca8f84d", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 77, "avg_line_length": 30.68, "alnum_prop": 0.6205997392438071, "repo_name": "ttsda/beets", "id": "5aa096486ef99448792248b1eac638f557c76890", "size": "2301", "binary": fa...
import contextlib import shutil import tempfile import unittest import os.path as op import macholib DYLIB_DIRECTORY = op.join(op.dirname(__file__), "data") FOO_DYLIB = op.join(DYLIB_DIRECTORY, "foo.dylib") FILES_TO_INSTALL_NAME = { FOO_DYLIB: "foo.dylib", op.join(DYLIB_DIRECTORY, "foo2.dylib"): "yoyo.dylib...
{ "content_hash": "4ea328abbbbc205d13f8b5e21e3ae7fa", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 77, "avg_line_length": 28.80327868852459, "alnum_prop": 0.6573705179282868, "repo_name": "pombredanne/machotools", "id": "5618bbaab24490090f08c58ac83ce805784d44ec", "size":...
import time import unittest from newsApp.clusterTableManager import ClusterTableManager from newsApp.cluster import Cluster class ClusterTableManagerTests(unittest.TestCase): @classmethod def setUpClass(self): # construct the mock clusters to put clusters = [ Cluster(['d1', 'd2', 'd3', 'd4', 'd5']),...
{ "content_hash": "406c8f7ed6ff1a516bf2ac0758afdd00", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 84, "avg_line_length": 35, "alnum_prop": 0.7072356215213358, "repo_name": "adityabansal/newsAroundMe", "id": "109ef5d88b4c53579300bccb76c44ae6d7d9e0d8", "size": "2695", "...
"""Google Stackdriver Logging API wrapper.""" from pkg_resources import get_distribution __version__ = get_distribution('google-cloud-logging').version from google.cloud.logging.client import Client ASCENDING = 'timestamp asc' """Query string to order by ascending timestamps.""" DESCENDING = 'timestamp desc' """Qu...
{ "content_hash": "53c97aeb402612b5bf0cbd4288776177", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 62, "avg_line_length": 28.8, "alnum_prop": 0.7291666666666666, "repo_name": "ammarkhann/FinalSeniorCode", "id": "cced78370c6a6b8d5fbd6434d83316acaf3f3937", "size": "1008", ...
""" Start Test= 1365719423.979371 ms since start... Network start = 1001.649857 Network started = 18143.102884 Mote start = 18151.414871 Mote detect start = 19177.054882 Mote detected = 19177.067995 Mote ping = 19177.072048 Mote reached = 28441.315889 Mote stopped = 28754.582882 Network stop = 28757.023811 Network stop...
{ "content_hash": "ac22c3edd201d1f36ebc56216e7a90fe", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 100, "avg_line_length": 37.44776119402985, "alnum_prop": 0.6388999601434835, "repo_name": "bluerover/6lbr", "id": "c77d79f7ff946a40c16467fddedcc8c656ac0e55", "size": "2531"...
import os from oslo.config import cfg from oslo.utils import strutils from ironic.common import exception from ironic.common.i18n import _ from ironic.common.i18n import _LE from ironic.common.i18n import _LI from ironic.common import image_service as service from ironic.common import keystone from ironic.common impo...
{ "content_hash": "f35c9fa3778bd78eef5d3498dd801a16", "timestamp": "", "source": "github", "line_count": 398, "max_line_length": 79, "avg_line_length": 37.82663316582914, "alnum_prop": 0.6401195616074394, "repo_name": "Tehsmash/ironic", "id": "5526018caf002794ab11e20c8874eb09a2480a1d", "size": "1571...
import re from lline import LLine def to_logical_lines(natural_lines): """ Parse natural lines into a list of logical lines.""" lines = [] terminated_logical_line = True for l in natural_lines: if _is_comment(l): lines.append(LLine(natural_lines=[l], key=None, value=None)) ...
{ "content_hash": "c1b7e0af0f8fa66bad08e9e830bbf839", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 91, "avg_line_length": 26.17241379310345, "alnum_prop": 0.5428194993412385, "repo_name": "mkrcah/propsort", "id": "21c1a9d3a3d6259b6c2276ccf2bac315be62042e", "size": "1518"...
from poweredsites.libs.handler import ErrorHandler handlers = [] sub_handlers = [] ui_modules = {} from poweredsites.handlers import admin, blog, front, \ help, project, site, user handlers.extend(front.handlers) handlers.extend(user.handlers) handlers.extend(site.handlers) handlers.exten...
{ "content_hash": "f0d410720154a6b2f968264cc08fe8dc", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 63, "avg_line_length": 27.294117647058822, "alnum_prop": 0.7359913793103449, "repo_name": "felinx/poweredsites", "id": "db0dc2cdcface30eda39649fcde522221651e514", "size": "...
""" ===================================== Multi-class AdaBoosted Decision Trees ===================================== This example reproduces Figure 1 of Zhu et al [1] and shows how boosting can improve prediction accuracy on a multi-class problem. The classification dataset is constructed by taking a ten-dimensional ...
{ "content_hash": "3e0b19fe57ea853c450e0f43c740f7bb", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 79, "avg_line_length": 33.56880733944954, "alnum_prop": 0.7122164525826729, "repo_name": "treycausey/scikit-learn", "id": "9fe609f489c289279b66fa73c39725e28817e6d7", "size...