text
stringlengths
4
1.02M
meta
dict
from django.contrib import admin from django.apps import apps ### register all models in this app in the admin for model in apps.get_app_config('bulkvote').get_models(): admin.site.register(model)
{ "content_hash": "43b61b49d42a3134ef173ed57716bd1a", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 58, "avg_line_length": 33.5, "alnum_prop": 0.7611940298507462, "repo_name": "tykling/bulkvote", "id": "60bab7a933d8242d81a3947c492654060ffdd7d9", "size": "201", "binary": ...
from sahara.plugins.vanilla.hadoop2 import config as c from sahara.tests.unit import base class VanillaTwoConfigTestCase(base.SaharaTestCase): def test_get_hadoop_dirs(self): ng = FakeNG(storage_paths=['/vol1', '/vol2']) dirs = c._get_hadoop_dirs(ng) expected = { 'hadoop_name_d...
{ "content_hash": "cde7dabe9fc8c7d37d0dcf0639922be9", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 67, "avg_line_length": 34.42307692307692, "alnum_prop": 0.5675977653631284, "repo_name": "crobby/sahara", "id": "cbfa6cd5f3c2820259ce7ec8d0d8e367932e3d0f", "size": "1478", ...
import os from setuptools import setup with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-social-widgets', version='0.5.0', packages=['social_widgets'], ...
{ "content_hash": "91924402db66e75206c0fa88f66712d2", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 79, "avg_line_length": 38.733333333333334, "alnum_prop": 0.6173264486517499, "repo_name": "creafz/django-social-widgets", "id": "86bcffc7d79d2f8fbf74557287b72357861b4356", ...
""" Utilities for applying a watermark to an image using PIL. Original Source: http://code.activestate.com/recipes/362879/ """ import Image, ImageEnhance import random import traceback def _percent(var): """ Just a simple interface to the _val function with a more meaningful name. """ return _val(var...
{ "content_hash": "6115595da0dc0ce2ff2b64d209f196bd", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 181, "avg_line_length": 29.4, "alnum_prop": 0.5572678050812162, "repo_name": "beholderrk/django-watermark", "id": "3c472665c21e6162ac13550a3f371bacaa73ae65", "size": "7203...
from share.normalize import * # noqa class AgentIdentifier(Parser): uri = IRI(ctx) class WorkIdentifier(Parser): uri = IRI(ctx) class Person(Parser): name = ctx.full_name identifiers = Map( Delegate(AgentIdentifier), ctx.orcid_id, RunPython(lambda x: 'http://figshare.com/a...
{ "content_hash": "fe469e03e84b965019fedcbf09974fb2", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 127, "avg_line_length": 25.64788732394366, "alnum_prop": 0.6161449752883031, "repo_name": "zamattiac/SHARE", "id": "154d77b3f2c2ae0aaa65f81f540f41c11081c7f9", "size": "1821...
def getSecret(secret): with open(secret, 'r') as f: res = f.readline().strip('\'') f.close() return res def train(args): from watson_machine_learning_client import WatsonMachineLearningAPIClient from minio import Minio from urllib.parse import urlsplit from pathlib import Path i...
{ "content_hash": "d1dc9a293418f92e324cd7ec84e8ddee", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 116, "avg_line_length": 40.66829268292683, "alnum_prop": 0.6186877773779537, "repo_name": "kubeflow/pipelines", "id": "64c96f8a1ac2cde0c34458eb54f98de987e17a3e", "size": "...
from lxml import etree import mock from six.moves import urllib from cinder.tests.unit.volume.drivers.netapp.dataontap import fakes as fake import cinder.volume.drivers.netapp.dataontap.client.api as netapp_api FAKE_VOL_XML = b"""<volume-info xmlns='http://www.netapp.com/filer/admin'> <name>open123</name> <s...
{ "content_hash": "0aabccce779aca9fe538ab5029b6e7cb", "timestamp": "", "source": "github", "line_count": 1397, "max_line_length": 88, "avg_line_length": 35.27415891195419, "alnum_prop": 0.6169893258654978, "repo_name": "ge0rgi/cinder", "id": "40bb4e022d64e94cf56899d6a99daea535cd9335", "size": "49969...
import os from pathlib import Path from setuptools import Extension, find_namespace_packages, setup PROJECT_ROOT = Path(__file__).parent long_description = (PROJECT_ROOT / "README.md").read_text(encoding="utf8") setup( name="pyinstrument", packages=find_namespace_packages(include=["pyinstrument*"]), vers...
{ "content_hash": "42908aa48b92942e91f7e1fabc26d9dd", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 84, "avg_line_length": 35.58139534883721, "alnum_prop": 0.6385620915032679, "repo_name": "joerick/pyinstrument", "id": "0fc734cd9eb2b2ed984aa29884dfc72c3ceb192a", "size": "...
""" The Maven Project module handles creating Maven Jenkins projects. To create a Maven project, specify ``maven`` in the ``project-type`` attribute to the :ref:`Job` definition. It also requires a ``maven`` section in the :ref:`Job` definition. :Job Parameters: * **root-module**: * **group-id** (`str`): ...
{ "content_hash": "000660aa8daa9aa041edd4b94280aaa0", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 79, "avg_line_length": 40.87640449438202, "alnum_prop": 0.6283672347443651, "repo_name": "gtest-org/test15", "id": "005203060b708e5b6125ea01c99f2475e710e3d7", "size": "4241...
import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt import pickle import os.path from include.dataset_fnames import generate_station_data_fname, generate_data_fname from include.feature_lists import numeric_features def merge_numeric_features_with_time(): for i, station_id...
{ "content_hash": "f63a705bee15d4c53771907d0614c3c3", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 144, "avg_line_length": 38.76315789473684, "alnum_prop": 0.6707399864222675, "repo_name": "zakkum42/Bosch", "id": "5c823c2399ba8e264749ca963c7b912664433703", "size": "1473"...
""" This module is a scratchpad for general development, testing & debugging Well, even more so than pcmd.py. You best ignore p2cmd.py. """ import sys import time from pprint import pprint from random import Random from django.core.management import BaseCommand from django.db import connection from pexp.models import...
{ "content_hash": "46a5d6accdb3f7228a7000db3c4af8e1", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 89, "avg_line_length": 29.016806722689076, "alnum_prop": 0.5792064871126557, "repo_name": "chrisglass/django_polymorphic", "id": "b26026ae94bb84c966cb2861ebed3fd87efdb699", ...
from django.http import Http404 from django.contrib.auth import get_user_model from django.db.models import Count, Max, Prefetch from rest_framework import generics, permissions, status from rest_framework.response import Response from .models import Thread, Post, Category from .serializers import ThreadListSerializer...
{ "content_hash": "e5cb254dceba6be2db1dde168ddb8e33", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 112, "avg_line_length": 33.67741935483871, "alnum_prop": 0.6864623243933589, "repo_name": "Axiologue/AxiologueAPI", "id": "8c52849729719a4eda56c27ed31c4c9a82cd8754", "size"...
""" Modules required to work with ironic_inspector: https://pypi.python.org/pypi/ironic-inspector """ import eventlet from futurist import periodics from oslo_log import log as logging from oslo_utils import importutils from ironic.common import exception from ironic.common.i18n import _ from ironic.common.i18n i...
{ "content_hash": "6650169c626dcbc363d6affc59c9c720", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 79, "avg_line_length": 36.32446808510638, "alnum_prop": 0.6216137062527456, "repo_name": "bacaldwell/ironic", "id": "907ad21960ec28a06d942d5ce1e666ee308666c8", "size": "73...
""" Content negotiation deals with selecting an appropriate renderer given the incoming request. Typically this will be based on the request's Accept header. """ from __future__ import unicode_literals from django.http import Http404 from rest_framework import HTTP_HEADER_ENCODING, exceptions from rest_framework.setti...
{ "content_hash": "78ffa5033dc5ad78da15f66a0ab1a9d3", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 89, "avg_line_length": 44.09278350515464, "alnum_prop": 0.5997194295066636, "repo_name": "hnarayanan/django-rest-framework", "id": "663ec4c8a20f4c5c268a5b745c8606c879f2a188",...
from data_importers.management.commands import BaseXpressDemocracyClubCsvImporter class Command(BaseXpressDemocracyClubCsvImporter): council_id = "WAE" addresses_name = "2021-03-01T10:16:29.232903/Democracy_Club__06May2021.tsv" stations_name = "2021-03-01T10:16:29.232903/Democracy_Club__06May2021.tsv" ...
{ "content_hash": "b43172ad5e07ad1014d1e2431b9440c7", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 81, "avg_line_length": 33.53846153846154, "alnum_prop": 0.6062691131498471, "repo_name": "DemocracyClub/UK-Polling-Stations", "id": "83c8586d12919343be0f9c8f97f60aadb122225f"...
from mongo_connector.doc_managers.formatters import DefaultDocumentFormatter class HzkgDocumentFormatter(DefaultDocumentFormatter): """ original formatter: { "_id": ObjectId("57edbe3843ece042bb10ca9d"), "source": { "confidence": "0.6", "trackingId": "fd6d245b75096dfcf10a9905c377e28a0e53b103" }, "cl...
{ "content_hash": "1749e5dc6c166ad47a74c12b53586841", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 76, "avg_line_length": 33.028169014084504, "alnum_prop": 0.4997867803837953, "repo_name": "LaoLiulaoliu/hzkgelastic2-doc-manager", "id": "8a6c55bedc72691ae2e9e6bef073d9d4671e...
from __future__ import print_function import numpy as np import theano import theano.tensor as T from theano.tensor.signal import downsample from theano.tensor.nnet import conv # globals RNG = np.random.RandomState() class SoftmaxLayer(object): def __init__(self, x, in_dim, out_dim, layer_id): self.weig...
{ "content_hash": "75813a54e7338f3f0e240f9b6aba928f", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 99, "avg_line_length": 35.524752475247524, "alnum_prop": 0.5398550724637681, "repo_name": "mitenjain/R3N", "id": "18e6b9a1282a7ae68b5624a3df48d68a6f4f2e39", "size": "3610"...
import inspect from django.template.loader import render_to_string from django.db import connection import settings from xformmanager.models import Metadata, FormDefModel, ElementDefModel from reports.models import Case, SqlReport from reports.util import get_whereclause from shared import monitoring_repo...
{ "content_hash": "6cc553754c50bf1ec3d4b6d1f65ae25b", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 116, "avg_line_length": 48.63013698630137, "alnum_prop": 0.6305633802816901, "repo_name": "commtrack/temp-aquatest", "id": "5c969aff149993f20e2f62595d369bc82ce86cda", "siz...
import os import shutil from collections import OrderedDict from git import Repo def get_raw_data(): cldr_version = '31.0.1' raw_data_directory = "../raw_data" cldr_data = { 'dates_full': { 'url': 'https://github.com/unicode-cldr/cldr-dates-full.git', 'dir': "{}/cldr_date...
{ "content_hash": "8841212a68032322855b1fea51c1acfc", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 97, "avg_line_length": 36.08450704225352, "alnum_prop": 0.6030444964871194, "repo_name": "scrapinghub/dateparser", "id": "d43843892a67434b55db4fd00956e38f0752d73d", "size":...
from .aws import Action as BaseAction from .aws import BaseARN service_name = "Amazon Macie Classic" prefix = "macie" class Action(BaseAction): def __init__(self, action: str = None) -> None: super().__init__(prefix, action) class ARN(BaseARN): def __init__(self, resource: str = "", region: str = "...
{ "content_hash": "727c79150d1c3fcc2ff5deda4849acae", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 88, "avg_line_length": 46.721518987341774, "alnum_prop": 0.8206448117041453, "repo_name": "cloudtools/awacs", "id": "f38b384a160f8b8c68067be620eff4ba46c58cfd", "size": "380...
from neutron.api.v2 import attributes as attr from neutron.common.test_lib import test_config from neutron import context from neutron.db import db_base_plugin_v2 from neutron.db import portsecurity_db from neutron.db import securitygroups_db from neutron.extensions import portsecurity as psec from neutron.extensions i...
{ "content_hash": "ebaf24e8bb90bf25c0f9b8d4a764f6a9", "timestamp": "", "source": "github", "line_count": 356, "max_line_length": 79, "avg_line_length": 49.40449438202247, "alnum_prop": 0.5638503525130771, "repo_name": "CiscoSystems/quantum", "id": "695fb01bb2a52e763f76325437b748ce19b0ac43", "size": ...
import asposecellscloud from asposecellscloud.CellsApi import CellsApi from asposecellscloud.CellsApi import ApiException import asposestoragecloud from asposestoragecloud.StorageApi import StorageApi apiKey = "XXXXX" #sepcify App Key appSid = "XXXXX" #sepcify App SID apiServer = "http://api.aspose.com/v1.1" data_fol...
{ "content_hash": "58a26e12472855019f2f9e7b547d7f47", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 105, "avg_line_length": 33.26315789473684, "alnum_prop": 0.7507911392405063, "repo_name": "asposecells/Aspose_Cells_Cloud", "id": "1cbd1eeccc37b5c1684c28dca9fa651876b29fe4", ...
import numpy as np from .img import rgb2lum from .const import Path from .os import open_file from .imprt import preset_import from .log import get_logger logger = get_logger() def compute_ci(data, level=0.95): r"""Computes confidence interval. Args: data (list(float)): Samples. level (floa...
{ "content_hash": "2e4bbe93be0c9d724d2f9fb607ac29e9", "timestamp": "", "source": "github", "line_count": 276, "max_line_length": 80, "avg_line_length": 33.79710144927536, "alnum_prop": 0.5596054888507719, "repo_name": "google/nerfactor", "id": "f877e021198ecb0a3d2a96c3d318c29188a27324", "size": "936...
import six import logging from aleph.authz import get_public_roles from aleph.util import dict_list from aleph.model import Role from aleph.datasets.query import DBQuery, CSVQuery log = logging.getLogger(__name__) class Dataset(object): """A dataset describes one set of data to be loaded.""" def __init__(s...
{ "content_hash": "55740f7226c1117ea55ec028c0b41744", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 75, "avg_line_length": 31.12087912087912, "alnum_prop": 0.5723870056497176, "repo_name": "OpenGazettes/aleph", "id": "064e7010abbc84054a491e7a14b1d02f12062db5", "size": "28...
import feedparser from flask import Response import json from sqlalchemy.orm.exc import NoResultFound from werkzeug.exceptions import NotFound, BadRequest from server.database import helpers from server.database.models import Entry from server.import_opml import create_db_from_opml def halify_entry_list(entry_list, ...
{ "content_hash": "9d2332b995f3af675ada8cebf5c1f4ee", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 76, "avg_line_length": 32.43150684931507, "alnum_prop": 0.5947201689545935, "repo_name": "flacerdk/smoke-signal", "id": "848eff10148c21e54c52cfb28a41f111ff359c61", "size":...
import uuid from openstack_dashboard.test import helpers as test from openstack_dashboard.utils.filters import get_int_or_uuid class UtilsFilterTests(test.TestCase): def test_accept_valid_integer(self): val = 100 ret = get_int_or_uuid(val) self.assertEqual(val, ret) def test_accept_v...
{ "content_hash": "fbb97cb9285ec53c8c59771c4f9b58bf", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 61, "avg_line_length": 28.48, "alnum_prop": 0.6460674157303371, "repo_name": "tuskar/tuskar-ui", "id": "2096b26766689f9e7b303fc8e5beb82658b53cb5", "size": "1397", "binary...
"""Student (Model) query functions. """ __authors__ = [ '"Lennard de Rijk" <[email protected]>', ] from soc.logic.models import role from soc.logic.models import program as program_logic import soc.models.role import soc.models.student class Logic(role.Logic): """Logic methods for the Student model. """...
{ "content_hash": "c0752749dd35c5ce26bc461fa5d188bd", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 74, "avg_line_length": 26.8125, "alnum_prop": 0.6072261072261073, "repo_name": "SRabbelier/Melange", "id": "67ccc9ce750b1fe5f47613115fedcf7887af11ee", "size": "1468", "bi...
from decimal import Decimal as D from django.test import TestCase from nose.plugins.attrib import attr from oscar.apps.shipping.models import OrderAndItemCharges, WeightBased from oscar.core.compat import get_user_model from oscar.test import factories User = get_user_model() @attr('shipping') class TestOrderAndI...
{ "content_hash": "ac1b42dcd5a814a0eaa87b228d3bc7d7", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 83, "avg_line_length": 38.68783068783069, "alnum_prop": 0.6686269146608315, "repo_name": "kapt/django-oscar", "id": "c67565fcbac7428dfa7921a168140bb8b09c5dc5", "size": "73...
from pycoin.tx import Tx, pay_to, Spendable from pycoin.serialize import b2h, b2h_rev, h2b, h2b_rev from pycoin.merkle import merkle from pycoin.encoding import double_sha256 from pycoin.convention import tx_fee, satoshi_to_mbtc from pycoin.networks import address_prefix_for_netcode from pycoin.services import spendabl...
{ "content_hash": "969a359f1e1b0e73bedfa99b1da39267", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 149, "avg_line_length": 41.897260273972606, "alnum_prop": 0.6988719960765081, "repo_name": "bit-oasis/multisig-recovery", "id": "268b5b272a169ad243c6b370d65c2c88f42e49d5", ...
import sys sys.path.append("..") import sympy a=sympy.Symbol('a') b=sympy.Symbol('b') e=(a+b)**5 print e print e.expand()
{ "content_hash": "12bc5f7eb475b6b13383c0f9d9cbdf3e", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 21, "avg_line_length": 13.666666666666666, "alnum_prop": 0.6585365853658537, "repo_name": "certik/sympy-oldcore", "id": "8ce8a2d87546ce26c86f719139295a4d36687c9d", "size": "...
import json import os from eg import config from eg import substitute from eg import util from mock import Mock from mock import patch PATH_UNSQUEEZED_FILE = os.path.join( 'test', 'assets', 'pwd_unsqueezed.md' ) PATH_SQUEEZED_FILE = os.path.join( 'test', 'assets', 'pwd_squeezed.md' ) def _cr...
{ "content_hash": "af66375711eef95037dc215bdabcb857", "timestamp": "", "source": "github", "line_count": 1131, "max_line_length": 79, "avg_line_length": 28.261715296198055, "alnum_prop": 0.6323050932298836, "repo_name": "scorphus/eg", "id": "d8743971ba681c7d60eda6356538b2e7c98a6660", "size": "31964"...
"""File data sources for traits GUIs.""" # Authors: Christian Brodbeck <[email protected]> # # License: BSD-3-Clause import os import os.path as op import numpy as np from traits.api import (Any, HasTraits, HasPrivateTraits, cached_property, on_trait_change, Array, Bool, Button, Dele...
{ "content_hash": "a3d2584e9260f1b54d3e24f1ee818cde", "timestamp": "", "source": "github", "line_count": 576, "max_line_length": 79, "avg_line_length": 33.845486111111114, "alnum_prop": 0.5629648627853295, "repo_name": "bloyl/mne-python", "id": "16d82059e52c8573514342f8511b173eb96b3e65", "size": "19...
from __future__ import print_function import argparse import io from math import fsum if __name__ == '__main__': parser = argparse.ArgumentParser(description='Shows the length (in hours) of a Kaldi folder. Either the segment file or the utt2dur file needs to be present.') parser.add_argument('-f', '--folder',...
{ "content_hash": "d334f4bd98251f98948355300d62d060", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 163, "avg_line_length": 35.627450980392155, "alnum_prop": 0.57347275729224, "repo_name": "tudarmstadt-lt/kaldi-tuda-de", "id": "9749c3c1268e62df252687b9b19df63fac8c12d2", "...
from __future__ import unicode_literals import itsdangerous import mock import pytest import pytz from django.utils import timezone from addons.base.utils import get_mfr_url from addons.github.models import GithubFileNode from addons.osfstorage import settings as osfstorage_settings from addons.osfstorage.listeners i...
{ "content_hash": "01a293192ab02b9d0815f9c708262332", "timestamp": "", "source": "github", "line_count": 944, "max_line_length": 109, "avg_line_length": 36.24576271186441, "alnum_prop": 0.5580430208089783, "repo_name": "adlius/osf.io", "id": "bca35a6c5b57633f63e6d361758edc50b2657caa", "size": "34216...
"""Contains miscellaneous helpers""" from __future__ import unicode_literals, division, absolute_import, print_function import copy import urllib2 import httplib import os import socket import time import re import sys import locale import Queue import ast import operator from collections import MutableMapping from u...
{ "content_hash": "949a3c43b3f01ad57eda450fb45a238e", "timestamp": "", "source": "github", "line_count": 459, "max_line_length": 119, "avg_line_length": 32.854030501089326, "alnum_prop": 0.6031167108753316, "repo_name": "ZefQ/Flexget", "id": "4f86f2242f42c53c0b35dec36a051cb4f897af07", "size": "15080...
import cv2, os import numpy as np from PIL import Image # For face detection we will use the Haar Cascade provided by OpenCV. cascadePath = "haarcascade_frontalface_default.xml" faceCascade = cv2.CascadeClassifier(cascadePath) def get_images_and_labels(path): # Append all the absolute image paths in a list image_...
{ "content_hash": "ad694707f17f5132f976a7c6d5f3a863", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 97, "avg_line_length": 43.52459016393443, "alnum_prop": 0.6655367231638418, "repo_name": "The-J-Person/Barfacecor", "id": "bea21b64bc8bc344724375498e6b9ccacb3576e1", "size"...
""" Master configuration file for Evennia. NOTE: NO MODIFICATIONS SHOULD BE MADE TO THIS FILE! All settings changes should be done by copy-pasting the variable and its value to <gamedir>/conf/settings.py. Hint: Don't copy&paste over more from this file than you actually want to change. Anything you don't copy&paste...
{ "content_hash": "8f2173b415f540e31c7c756e65720b53", "timestamp": "", "source": "github", "line_count": 748, "max_line_length": 104, "avg_line_length": 49.643048128342244, "alnum_prop": 0.6894945196994587, "repo_name": "whitehorse-io/encarnia", "id": "f94bf5d3ef35ed106ca919bb0ba33e0bc14338f6", "siz...
import sys import time import random import rsa from botocore.utils import parse_to_aware_datetime from botocore.signers import CloudFrontSigner from awscli.arguments import CustomArgument from awscli.customizations.utils import validate_mutually_exclusive_handler from awscli.customizations.commands import BasicComma...
{ "content_hash": "e0391659232b4779f76beab9ac6eca04", "timestamp": "", "source": "github", "line_count": 248, "max_line_length": 96, "avg_line_length": 40.38306451612903, "alnum_prop": 0.6003994008986521, "repo_name": "mnahm5/django-estore", "id": "968a1c65a3b8a915db81cf0090878954993f49a6", "size": ...
import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) # testinfo = "s, t 0.5, s, t 1, s, q" tags = "SkewVertical" import pyglet import cocos from cocos.director import director from cocos.actions import * from cocos.layer import * class BackgroundLayer(cocos.layer.Layer...
{ "content_hash": "f4515ef11183a7b36b6c963e0f5ec7c6", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 65, "avg_line_length": 23.23076923076923, "alnum_prop": 0.5960264900662252, "repo_name": "shadowmint/nwidget", "id": "8489af344303c869da9faf57df24f8321667a738", "size": "98...
import sys import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General conf...
{ "content_hash": "e02f57ad6848922b3fae89097f281538", "timestamp": "", "source": "github", "line_count": 251, "max_line_length": 79, "avg_line_length": 31.49402390438247, "alnum_prop": 0.7065148640101202, "repo_name": "pobear/restless", "id": "a511f70fdf66483d907774655bb49e346409b6c1", "size": "8326...
from swgpy.object import * def create(kernel): result = Building() result.template = "object/building/player/city/shared_cityhall_naboo.iff" result.attribute_template_id = -1 result.stfName("building_name","cityhall") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "bb22cfbdeef16c59e7eb19f92101a1d1", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 74, "avg_line_length": 23.615384615384617, "alnum_prop": 0.7003257328990228, "repo_name": "obi-two/Rebelion", "id": "92c720b375e8a7d542a6c098d34273b2e126c2f3", "size": "452...
""" ORCID Member No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: Latest Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six from orcid_api_...
{ "content_hash": "91709735775d220eb33a2afaff6385fd", "timestamp": "", "source": "github", "line_count": 387, "max_line_length": 257, "avg_line_length": 32.91472868217054, "alnum_prop": 0.613911132045847, "repo_name": "Royal-Society-of-New-Zealand/NZ-ORCID-Hub", "id": "2dc452c9aca9814b06395f9b36da5e4c...
NEVER_TIMEOUT = None # for django caches setting None as a timeout value means the cache never times out. FIVE_MIN_TIMEOUT = 60 * 5 STORAGE_USAGE_KEY = 'storage_usage:{target_id}'
{ "content_hash": "fdf68050bc708bf042fe71d2378341d0", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 106, "avg_line_length": 45.5, "alnum_prop": 0.7417582417582418, "repo_name": "mattclark/osf.io", "id": "489c232d96e806c514c8c03f68fef73c15515699", "size": "182", "binary":...
from __future__ import division, absolute_import, print_function import warnings import sys import collections import operator import numpy as np import numpy.core.numeric as _nx from numpy.core import linspace, atleast_1d, atleast_2d from numpy.core.numeric import ( ones, zeros, arange, concatenate, array, asarr...
{ "content_hash": "f2b01771e99622e8b50bac6b6044c7a9", "timestamp": "", "source": "github", "line_count": 4383, "max_line_length": 99, "avg_line_length": 32.92379648642482, "alnum_prop": 0.5716364644329718, "repo_name": "LumPenPacK/NetworkExtractionFromImages", "id": "6a64ebe85402b156d01cc0e12f9faa64f0...
from http import HTTPStatus class ResponseError(Exception): def __init__(self, message=None, status: HTTPStatus=None, *, body=None, headers=None, correlation_id=None, reason=None, content_type=None, log=False): super().__init__(message) self.message = message if hasattr(se...
{ "content_hash": "60acc4b8561e1992cfa7accb402d41d7", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 89, "avg_line_length": 30.77777777777778, "alnum_prop": 0.5974729241877257, "repo_name": "wasp/waspy", "id": "b77cd1a59979ddfc682e3244d097c4bdaaa89014", "size": "1662", "...
"""Integration test program for Subpar. Test bootstrap interaction with __future__ imports and source file encodings. """ # Test __future__ imports from __future__ import print_function # Test the source file encoding specification above. See PEP 263 for # details. In the line below, this source file contains a b...
{ "content_hash": "8a3d828280ce074d8cb69f0c71d1e90c", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 77, "avg_line_length": 36, "alnum_prop": 0.7376543209876543, "repo_name": "google/subpar", "id": "03ef2d6bd6a9865fa3a49e658a7e20d69fbbc54e", "size": "747", "binary": fals...
import os import unittest from mi.core.log import get_logger from mi.dataset.dataset_driver import ParticleDataHandler from mi.dataset.driver.parad_j.cspp.parad_j_cspp_recovered_driver import parse from mi.dataset.driver.parad_j.cspp.resource import RESOURCE_PATH __author__ = 'Joe Padula' log = get_logger() class S...
{ "content_hash": "4f055ab71a4ba5ca3cf2da11656f9199", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 84, "avg_line_length": 28.29032258064516, "alnum_prop": 0.7058152793614595, "repo_name": "vipullakhani/mi-instrument", "id": "f5e8ad1e781b02f4efaf5f62d94ad22ea8977fc1", "si...
""" """ import py def cmdexec(cmd): import os, sys import subprocess from subprocess import Popen, PIPE """ return unicode output of executing 'cmd' in a separate process. raise cmdexec.Error exeception if the command failed. the exception will provide an 'err' attribute containing the ...
{ "content_hash": "e6f69d241b918f49504f379b573a9773", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 80, "avg_line_length": 34.092592592592595, "alnum_prop": 0.6632265073329712, "repo_name": "mikewesner-wf/glasshouse", "id": "98e7ed4089b28690212ff31007a8a2aafd2759c5", "siz...
'''Load the latest update for a Twitter user and leave it in an XHTML fragment''' __author__ = '[email protected]' import codecs import getopt import sys import twitter TEMPLATE = """ <div class="twitter"> <span class="twitter-user"><a href="http://twitter.com/%s">Twitter</a>: </span> <span class="twitter-text">...
{ "content_hash": "3029fd90281831adc64121b56a551332", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 108, "avg_line_length": 24.791044776119403, "alnum_prop": 0.6225165562913907, "repo_name": "MosheBerman/brisket-mashup", "id": "8a386fd586430acb7b2a81d5f71bb41df6edad73", "...
""" Class-based, modern views for elephantblog ========================================== Add the following code to ``settings.py`` if you want to integrate Elephantblog through ApplicationContent:: def elephantblog_entry_url_app(self): from feincms.apps import app_reverse return app_reverse( ...
{ "content_hash": "3954680a5cd10b6b7c75f6317f877b43", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 79, "avg_line_length": 34.55913978494624, "alnum_prop": 0.596764156813939, "repo_name": "sbaechler/feincms-elephantblog", "id": "8a92e5b4daa74a2070f1ce88200c51195f9c3f8e", ...
import os import sys import hashlib import commands import threading from six.moves import _thread, range, queue import six Lock = threading.Lock() class WorkerPool(object): def __init__(self, func, nworker=1): self.nworker = nworker self.func = func self.queue = queue.Queue() def st...
{ "content_hash": "1062d529b0bce0712a295b4781932137", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 124, "avg_line_length": 32.54945054945055, "alnum_prop": 0.47299122214719785, "repo_name": "pengzhangdev/slackbot", "id": "8e8e3ae2b34bf2ed8196e9597d4d161f1ee8e346", "size"...
from setuptools import setup, find_packages import os import cms CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independ...
{ "content_hash": "edb4798f29ea3a6334c9d6baca90d247", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 88, "avg_line_length": 31.215686274509803, "alnum_prop": 0.6381909547738693, "repo_name": "bittner/django-cms", "id": "aa2a030e2eadcca72f8027d203aed5147ed6d649", "size": "1...
import math from itertools import chain from rdkit import Chem from ._base import Descriptor __all__ = ("PathCount",) class PathCountBase(Descriptor): __slots__ = () explicit_hydrogens = False class PathCountCache(PathCountBase): __slots__ = ("_order", "_bonds") def parameters(self): ret...
{ "content_hash": "908741ab429b7b01d826d6a67882243e", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 81, "avg_line_length": 23.160919540229884, "alnum_prop": 0.4913151364764268, "repo_name": "mordred-descriptor/mordred", "id": "4298e6ef46c8f7a382cfed42e700912fc418ce4b", "...
import cudamat_conv.cudamat_conv reload (cudamat_conv.cudamat_conv) import gnumpy as g imSizeX = 10 numImages = 2 filterSizeX = 3 numChannels = 3 numGroups = 1 assert numChannels % numGroups == 0 numFilterColors = numChannels / numGroups numFilters = 16 * numGroups moduleStride = 1 numModulesX = (imSizeX - filterS...
{ "content_hash": "518759fbf5e8f5224e420f493853c00b", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 85, "avg_line_length": 21.08108108108108, "alnum_prop": 0.5801282051282052, "repo_name": "hqxu/deepnet", "id": "41eccffb0d215a0c773d6d5d4e982cca7859bbaf", "size": "1560", ...
from __future__ import absolute_import import uuid from datetime import datetime from sqlalchemy import Column, DateTime, String, Integer from sqlalchemy.schema import Index, UniqueConstraint from changes.config import db from changes.constants import Result, Status from changes.db.types.enum import Enum from change...
{ "content_hash": "ec07fd2afd1c4b20ab07624f34f4d5e6", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 87, "avg_line_length": 37.39705882352941, "alnum_prop": 0.642548171451042, "repo_name": "alex/changes", "id": "d52f8a2f308896897e0e6b1b1b45c799d964a4f4", "size": "2543", ...
class OSNetworksV2(object): def on_get(self, req, resp, tenant_id): networks = [] client = req.env['sl_client'] sl_networks = client['Account'].getSubnets( mask='id, modifyDate, gateway, networkVlanId, broadcastAddress, ' 'netmask, networkIdentifier, cidr, reverseDoma...
{ "content_hash": "814a2d99d7ebf3fde366f519a321c771", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 77, "avg_line_length": 39.80555555555556, "alnum_prop": 0.5910676901605024, "repo_name": "BillArnold/barnoldjg", "id": "517f76683782082302b6c0f323daea3b53a8b423", "size": "...
import copy import logging from curwmysqladapter import Data from cms_utils.UtilValidation import validate_timeseries from cms_utils.UtilInterpolation import interpolate_timeseries from cms_utils.InterpolationStrategy import InterpolationStrategy # from ..config import Constants as con def get_interpolated_timeserie...
{ "content_hash": "f95983d64417f106f6653efb1a84aff6", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 120, "avg_line_length": 40.673469387755105, "alnum_prop": 0.5637230306071249, "repo_name": "gihankarunarathne/cfcwm-cms", "id": "6bbf1e568c79c9ab3aee3d54f3418e0f2e760c84", ...
import unittest from pyparsing import ParseException from tests.utils.grammar import get_record_grammar """ CWR acknowledgement grammar tests. The following cases are tested: """ __author__ = 'Bernardo Martínez Garrido' __license__ = 'MIT' __status__ = 'Development' class TestAcknowledgementGrammar(unittest.Test...
{ "content_hash": "e9dde9e81445fbef0ae458b5a3bf4381", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 178, "avg_line_length": 42.43877551020408, "alnum_prop": 0.6838182255349844, "repo_name": "weso/CWR-DataApi", "id": "8f78aa1500fc69dc65478eb189ee4a15fa5435fa", "size": "418...
from clientbase import FaceClientBase class Person(FaceClientBase): def __init__(self): super(Person, self).__init__() def create(self, person_name, face_id): return self.api.person.create(person_name=person_name, face_id=face_id) def delete(self, person_name): return self.api.pe...
{ "content_hash": "b15650b7597f64eeef16319ac75cb163", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 79, "avg_line_length": 21.333333333333332, "alnum_prop": 0.62109375, "repo_name": "KellyChan/Python", "id": "12dfe4b6085803bfbf2e76bc02fddc3dfa39cdc7", "size": "512", "bi...
import logging as real_logging import os import sys from telemetry.core import discover from telemetry.core import local_server from telemetry.core import memory_cache_http_server from telemetry.core import network_controller from telemetry.core import tracing_controller from telemetry.core import util from telemetry....
{ "content_hash": "dca99307dac9ba9322974d0cfffde34d", "timestamp": "", "source": "github", "line_count": 393, "max_line_length": 80, "avg_line_length": 35.51908396946565, "alnum_prop": 0.7167418869546529, "repo_name": "Bysmyyr/chromium-crosswalk", "id": "3199369416dff1922575f0049e4a59fc1bde67f6", "s...
from flask import Flask from flask_sqlalchemy import SQLAlchemy from sqlalchemy.sql import text from flask_ask import Ask, statement, dialog, elicit, delegate, question from configobj import ConfigObj from geopy.geocoders import GoogleV3 from pyproj import Proj, transform from datetime import date import logging import...
{ "content_hash": "bfaad2ce0ac479ee1afd0d01f03353a8", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 642, "avg_line_length": 47.295918367346935, "alnum_prop": 0.6687162891046387, "repo_name": "stevemulligan/ottawagarbage", "id": "617e5745ef39ed61665ebd186f662878200e48db", ...
import json from django.conf import settings from django.core.management import BaseCommand from django.utils import timezone from django.utils.dateparse import parse_datetime from django.utils.translation import ugettext_lazy from odk_logger.models import Instance class Command(BaseCommand): help = ugettext_lazy...
{ "content_hash": "60244608efbd44d3d29d918a956c2ede", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 77, "avg_line_length": 39.67567567567568, "alnum_prop": 0.5946866485013624, "repo_name": "eHealthAfrica/formhub", "id": "0ec19cd104399411da30715858eba77a8a12630e", "size": ...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import keops.models.fields class Migration(migrations.Migration): initial = True dependencies = [ ('contenttypes', '0002_remove_content_type_name'), ('auth', '0008_alter_user_us...
{ "content_hash": "38cc3b41c42c11c1f5dbbf82716ddacc", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 188, "avg_line_length": 54.697916666666664, "alnum_prop": 0.5913159398209865, "repo_name": "katrid/keops", "id": "1b83de9ecf23216c60b487cdb24b7272cc873e61", "size": "5324",...
import six def create_multi_node_evaluator(actual_evaluator, communicator): """Create a multi node evaluator from a normal evaluator. Actually this method patches the evaluator to work in multi node environment. This method adds several hidden attributes starting with `_mn_` prefix. Args: ...
{ "content_hash": "df9d57057ce2beea23436e7ab17e1e09", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 70, "avg_line_length": 31.94871794871795, "alnum_prop": 0.6613162118780096, "repo_name": "tkerola/chainer", "id": "4144422710f830298b46bf3e209a7428b4a0cf43", "size": "1246"...
"""Tests for the file entry implementation using SQLite blob.""" import unittest from dfvfs.lib import definitions from dfvfs.path import factory as path_spec_factory from dfvfs.resolver import context from dfvfs.vfs import sqlite_blob_file_entry from dfvfs.vfs import sqlite_blob_file_system from tests import test_l...
{ "content_hash": "f8f7a259d30014c6a54ceb2522361013", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 79, "avg_line_length": 35.52564102564103, "alnum_prop": 0.6975821003247925, "repo_name": "log2timeline/dfvfs", "id": "1e14d081dcf30ea5cc907cc43b9b643edf5bf143", "size": "5...
from telemetry.core import platform from telemetry.util import wpr_modes from telemetry.internal.browser import browser_finder from telemetry.internal.browser import browser_finder_exceptions class ProfileExtender(object): """Abstract base class for an object that constructs a Chrome profile.""" def __init__(sel...
{ "content_hash": "6b4653e58fb8e8a4694b6e3526e89a19", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 80, "avg_line_length": 33.54109589041096, "alnum_prop": 0.7104349601797019, "repo_name": "lihui7115/ChromiumGStreamerBackend", "id": "95b9fb0f55b337bed3254787ec3c7bdc21bd31d...
from fabric.api import * from fabric.contrib.files import * from fabric.contrib.project import rsync_project from subprocess import check_output env.use_ssh_config = True env.user = 'ubuntu' ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) HOME_DIR = '/home/ubuntu' DEPLOY_PATH = '%s/cabot' % HOME_DIR LOG_DIR =...
{ "content_hash": "5b22b732feaa9c049236eecc5ae003bc", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 127, "avg_line_length": 31.924418604651162, "alnum_prop": 0.6049899836095429, "repo_name": "labxio/cabot", "id": "7bc0e844e320b446ef44e2a631a79ec52b89ba77", "size": "5491"...
from Folders import *
{ "content_hash": "9b3e5199bda8202882004a29bbfdd4bf", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 21, "avg_line_length": 22, "alnum_prop": 0.7727272727272727, "repo_name": "tartakynov/enso", "id": "c654fcffd3ba5615289a3595eefd65276f9b9f7a", "size": "22", "binary": fals...
class Solution: dict = {} # @param node, a undirected graph node # @return a undirected graph node def cloneGraph(self, node): if not node: return None if node not in self.dict: self.dict[node] = UndirectedGraphNode(node.label) for e in node.n...
{ "content_hash": "b7e76cde5242fdb8b753e66f9c67350d", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 68, "avg_line_length": 30.428571428571427, "alnum_prop": 0.5868544600938967, "repo_name": "KickAlgorithm/leetcode", "id": "189907fdf164b1152c52aeb2bf0f18eef11071e4", "size"...
from django.test import TestCase from django.test import Client from django.core.urlresolvers import reverse from django.contrib.auth import get_user_model User = get_user_model() USERNAME = 'test' PASSWORD = 'test' EMAIL = '[email protected]' NEXT = '/about/' class ViewTests(TestCase): """ Tests the core views...
{ "content_hash": "119d9315284ea240671e0539cbb06ccd", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 74, "avg_line_length": 36.34375, "alnum_prop": 0.4815133276010318, "repo_name": "ainmosni/jolly_roger", "id": "da0af52f58820c1cd09be1fcea472f7012ee93a4", "size": "2350", ...
import random import hashlib import smtplib import socket import sys import time import mailpile.util from mailpile.util import * from mailpile.i18n import gettext as _ from mailpile.i18n import ngettext as _n from mailpile.config import ssl, socks from mailpile.mailutils import CleanMessage, MessageAsString from mail...
{ "content_hash": "c3fceeb2d59847a04ea15bce7f7fc822", "timestamp": "", "source": "github", "line_count": 365, "max_line_length": 79, "avg_line_length": 37.90958904109589, "alnum_prop": 0.4983739249837392, "repo_name": "jparyani/Mailpile", "id": "eb1a7980f9afaade527c7150059b497f78b48a02", "size": "13...
from __future__ import print_function import argparse import os import re import subprocess REPO_BASE = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) CLI = argparse.ArgumentParser("Set the package version information") CLI.add_argument( "target", help="The part of the current version to bump.",...
{ "content_hash": "2f7a0322134c1a57b7c50944d16c3a99", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 107, "avg_line_length": 32.286821705426355, "alnum_prop": 0.6156062424969988, "repo_name": "maxfischer2781/cpy2py", "id": "a7fce00ae08e6eb128c4eb6860447d30853a5f73", "size...
"""Create VM with a single disk. Creates a Persistent Disk. Then creates an instance that attaches that Persistent Disk as a data disk. """ COMPUTE_URL_BASE = 'https://www.googleapis.com/compute/v1/' def GenerateConfig(context): """Create instance with disks.""" datadisk = 'datadisk-'+ context.env['deployment'...
{ "content_hash": "5ef73ae4b4e310fc3a68f733cbf1c0cf", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 79, "avg_line_length": 39.35064935064935, "alnum_prop": 0.463036303630363, "repo_name": "aljim/deploymentmanager-samples", "id": "e39c1fc0266c5b7d8a618e5914f0f0bf8f76b857", ...
from __future__ import unicode_literals import datetime from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('volunteerapp', '0013_auto_20171117_0045'), ] operations = [ migrations.AddField( m...
{ "content_hash": "88aca98bdb34584d6807133215f23cc6", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 130, "avg_line_length": 27.53846153846154, "alnum_prop": 0.6089385474860335, "repo_name": "mclark4386/volunteer_connection", "id": "3f10b1459915e690215f0722abd93deaacf53276",...
__author__ = 'Bitvis AS' __copyright__ = "Copyright 2017, Bitvis AS" __version__ = "1.1.1" __email__ = "[email protected]" import os division_line = "--========================================================================================================================" class Channel: def __init__(self, name...
{ "content_hash": "d7e492ce3f142a29739362b79d97be88", "timestamp": "", "source": "github", "line_count": 1344, "max_line_length": 244, "avg_line_length": 59.53497023809524, "alnum_prop": 0.5860151221645942, "repo_name": "AndyMcC0/UVVM_All", "id": "b1d65f858a5827ef1c93c880535cfbf2854543cb", "size": "...
import dict import urllib2 import pyxb_114.utils.domutils as domutils from xml.dom import minidom # Get the list of dictionaries available from the service. port_uri = 'http://services.aonaware.com/DictService/DictService.asmx' uri = port_uri + '/DictionaryList' dle_xml = urllib2.urlopen(uri).read() dle_dom = domutils...
{ "content_hash": "9eff538f90232ff908a6a9f8571c24d8", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 99, "avg_line_length": 42.69565217391305, "alnum_prop": 0.7158859470468432, "repo_name": "msherry/PyXB-1.1.4", "id": "93c3777359743991d7844c84b1f82dcd0f1d5d66", "size": "98...
""" A simple example showing how to process RDFa from the web """ from rdflib import Graph if __name__ == '__main__': g = Graph() g.parse('http://www.worldcat.org/title/library-of-babel/oclc/44089369', format='rdfa') print "Books found:" for row in g.query("""SELECT ?title ?author WHERE { ...
{ "content_hash": "09b22a02fbdd074806b6cc246132ad7e", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 90, "avg_line_length": 23.318181818181817, "alnum_prop": 0.5769980506822612, "repo_name": "marma/rdflib", "id": "02112ce3c73498a7a712bb27ffc796dce645c46f", "size": "513", ...
""" ============================================ :mod:`selectors` -- Parent selection methods ============================================ This module provides pre-defined selectors for evolutionary computations. All selector functions have the following arguments: - *random*...
{ "content_hash": "cf94901c2fe401c0eeb457e0362852cd", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 90, "avg_line_length": 36.48547717842324, "alnum_prop": 0.6303878084840214, "repo_name": "saulshanabrook/pushgp.py", "id": "c9e9a8d80a1528435d929baf89d6681aeb1dce55", "siz...
from django.utils.translation import ugettext_lazy as _ import horizon from horizon.dashboards.project import dashboard class AccessAndSecurity(horizon.Panel): name = _("Access & Security") slug = 'access_and_security' dashboard.Project.register(AccessAndSecurity)
{ "content_hash": "afeca3fd487d50278044904a61443ba5", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 55, "avg_line_length": 23.166666666666668, "alnum_prop": 0.7769784172661871, "repo_name": "1ukash/horizon", "id": "485e8be3135959c0d3a55ad0caa680d0531313d0", "size": "959",...
"""Tests for the event filters manager.""" import unittest from plaso.filters import manager from tests.filters import test_lib class FiltersManagerTest(unittest.TestCase): """Tests for the event filters manager.""" def testFilterRegistration(self): """Tests the RegisterFilter and DeregisterFilter functio...
{ "content_hash": "9e400ef6ecbdba5f902eb463d3cc9e7a", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 69, "avg_line_length": 28.424242424242426, "alnum_prop": 0.7334754797441365, "repo_name": "ostree/plaso", "id": "18f60443d768c5c5e1acc9811c854fcd774bac58", "size": "980", ...
import string # The lexer knows two classes of symbols: # - any number of meta-symbols, which match a single meta-character each. # this argument is a dictionary mapping meta-characters to symbol classes. # # - exactly one terminal symbol, which matches a run of any characters # but ends as soon as a meta-...
{ "content_hash": "3ec5efeced8b8a3e6435e4ee3072daee", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 114, "avg_line_length": 40.614285714285714, "alnum_prop": 0.593387266971509, "repo_name": "cburschka/modod", "id": "019134fbfbd22f48a741e4ab7ba78c250e3fb895", "size": "2843...
LOG_LEVEL = "DEBUG" LOG_FILE = "/var/log/security_monkey/security_monkey-deploy.log" SQLALCHEMY_DATABASE_URI = 'postgresql://postgres:securitymonkeypassword@localhost:5432/secmonkey' SQLALCHEMY_POOL_SIZE = 50 SQLALCHEMY_MAX_OVERFLOW = 15 ENVIRONMENT = 'ec2' USE_ROUTE53 = False FQDN = 'ec2-XX-XXX-XXX-XXX.compute-1.ama...
{ "content_hash": "674109a9c357f59c10a4d6e58a339404", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 97, "avg_line_length": 30.914893617021278, "alnum_prop": 0.7405368203716449, "repo_name": "monkeysecurity/security_monkey", "id": "6a37587dd7c350df642fb408cf2248d472a243f6", ...
import xml.etree.ElementPath import attr @attr.s class Element(object): tag = attr.ib() attrib = attr.ib(default=()) children = attr.ib(default=attr.Factory(list)) def append(self, element): self.children.append(element) def extend(self, elements): self.children.extend(elements)...
{ "content_hash": "2439c8a0094aa246f35f04741a33c291", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 71, "avg_line_length": 23.571428571428573, "alnum_prop": 0.5965367965367966, "repo_name": "Perlence/rpp", "id": "0c1498ec037af62a4f82ca7052bc2e69c25ee640", "size": "2310", ...
"""Generic interface to all dbm clones. Use import dbm d = dbm.open(file, 'w', 0o666) The returned object is a dbm.bsd, dbm.gnu, dbm.ndbm or dbm.dumb object, dependent on the type of database being opened (determined by the whichdb function) in the case of an existing dbm. If the dbm does not exist ...
{ "content_hash": "d64a5320284f2834c84cd8ac3f41e4f2", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 78, "avg_line_length": 31.09375, "alnum_prop": 0.5829145728643216, "repo_name": "MalloyPower/parsing-python", "id": "56555be78f33d1f8669242cc93dd57c5e5964c59", "size": "59...
import sys sys.path.insert(1, "../../") import h2o, tests def javapredict_smallcat(): # optional parameters params = {'epochs':100} print "Parameter list:" for k,v in zip(params.keys(), params.values()): print "{0}, {1}".format(k,v) train = h2o.upload_file(h2o.locate("smalldata/iris/setosa_versic...
{ "content_hash": "b98ecd065b2a4052772c4c84878a1aa6", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 80, "avg_line_length": 29.45, "alnum_prop": 0.634974533106961, "repo_name": "junwucs/h2o-3", "id": "b71fcd2eefebe93372cac4773780f62035c664ae", "size": "589", "binary": fa...
import requests class BiblesAPI(object): _BIBLES_API_KEY = "" _API_URL = "https://bibles.org/v2/" _BIBLE_VERSION = "ESV" _LANGUAGE = "eng" def __init__(self,api_key,bible_version="ESV"): self._BIBLES_API_KEY = api_key; self._BIBLE_VERSION = bible_version; pri...
{ "content_hash": "30f3aec161d491e3d3fd1ebffbf254c6", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 133, "avg_line_length": 37.6625, "alnum_prop": 0.574510454696316, "repo_name": "samuelstevens9/apiai-bibles_org", "id": "0b4b2d0df05ecada55921ea267d5fbf88a10bd76", "size": ...
import re import warnings from django.contrib.auth import get_user_model from django.core.exceptions import ValidationError from django.db import models from django.db.models import Q from django.db.models.expressions import RawSQL from django.utils.translation import gettext_lazy from .abstract_applicationkeyvalue i...
{ "content_hash": "af6bf7b805b860cbd02025e4130be960", "timestamp": "", "source": "github", "line_count": 470, "max_line_length": 131, "avg_line_length": 40.42765957446809, "alnum_prop": 0.6420714699226356, "repo_name": "devilry/devilry-django", "id": "aa585a295f16afa8329f287d07db0b5ef6cdc2e9", "size...
""" Datebook month views """ import datetime from django.conf import settings from django import http from django.views import generic from django.views.generic.edit import FormMixin from django.contrib.auth.models import User from braces.views import LoginRequiredMixin, PermissionRequiredMixin from datebook.forms.m...
{ "content_hash": "61c8a12a83bf9f96b6e32428d8184cdd", "timestamp": "", "source": "github", "line_count": 266, "max_line_length": 156, "avg_line_length": 40.93984962406015, "alnum_prop": 0.6319559228650138, "repo_name": "sveetch/django-datebook", "id": "2f7e7988ab3965de743acfec1a5fd1eb4b6c1cd1", "siz...
from datetime import date from corehq.apps.userreports.specs import EvaluationContext from custom.champ.tests.utils import TestDataSourceExpressions from custom.champ.utils import POST_TEST_XMLNS, ACCOMPAGNEMENT_XMLNS, SUIVI_MEDICAL_XMLNS CHAMP_CAMEROON_DATA_SOURCE = 'champ_cameroon.json' class TestEnhancedPeerMobi...
{ "content_hash": "c6d46fb8e74d5c5b310b8905637a7393", "timestamp": "", "source": "github", "line_count": 385, "max_line_length": 89, "avg_line_length": 37.79220779220779, "alnum_prop": 0.52, "repo_name": "dimagi/commcare-hq", "id": "7fadbd355c9888fc01869f17f77e2eefbdf0a9b7", "size": "14550", "bina...
import os, logging from io import StringIO from threading import Thread from yapsy.PluginManager import PluginManager from yapsy.IPlugin import IPlugin from yapsy.PluginInfo import PluginInfo import BasePlugin from Logger import Logger class DpxPluginManager(PluginManager, Logger): def __init__(self, **kwargs): ...
{ "content_hash": "d1567e0ce9e8d14b0e5068a604716118", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 105, "avg_line_length": 36.99038461538461, "alnum_prop": 0.6399792045749935, "repo_name": "puhitaku/digital-pen-experiment", "id": "f2c616360fee1652b5abc319d5d58a60a55f6230"...
"""Unit tests for contextlib.py, and other context managers.""" import io import sys import tempfile import unittest from contextlib import * # Tests __all__ from test import support try: import threading except ImportError: threading = None class ContextManagerTestCase(unittest.TestCase): def test_con...
{ "content_hash": "30681c3af95d93f4255b48bd03bfad91", "timestamp": "", "source": "github", "line_count": 828, "max_line_length": 80, "avg_line_length": 31.397342995169083, "alnum_prop": 0.5431780590068085, "repo_name": "samuelhavron/heroku-buildpack-python", "id": "39cc776dbcafa743d46080a57e9243e2c9ed...
""" Continuous Random Variables - Prebuilt variables Contains ======== Arcsin Benini Beta BetaPrime Cauchy Chi ChiNoncentral ChiSquared Dagum Erlang Exponential FDistribution FisherZ Frechet Gamma GammaInverse Gompertz Kumaraswamy Laplace Logistic LogNormal Maxwell Nakagami Normal Pareto QuadraticU RaisedCosine Raylei...
{ "content_hash": "eca696508014d0eefacc8458beea8c70", "timestamp": "", "source": "github", "line_count": 2577, "max_line_length": 90, "avg_line_length": 24.063639891346526, "alnum_prop": 0.48753467070889506, "repo_name": "Davidjohnwilson/sympy", "id": "cf237990e267150c18f9048d078fbef0fd110c8e", "siz...
""" RACKSPACE API KEY EXTENSION This WSGI component - detects calls with extensions in them. - processes the necessary components """ import json import logging from lxml import etree import os from webob.exc import Request, Response from keystone import utils EXTENSION_ALIAS = "RAX-KSKEY-admin" logger = logging.g...
{ "content_hash": "6a16f99305ac24d11a6f8cd4ce5a6b0d", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 78, "avg_line_length": 38.10344827586207, "alnum_prop": 0.5182503770739065, "repo_name": "admiyo/keystone", "id": "4f3f0796d6418c41cf795a130c6ae4072d99dbd5", "size": "3973"...
""" Landlab component for overland flow using the kinematic-wave approximation. Created on Fri May 27 14:26:13 2016 @author: gtucker """ from landlab import Component import numpy as np class KinwaveOverlandFlowModel(Component): """ Calculate water flow over topography. Landlab component that impl...
{ "content_hash": "64315f8aa2115d1ea4457cace122c40e", "timestamp": "", "source": "github", "line_count": 198, "max_line_length": 77, "avg_line_length": 34.964646464646464, "alnum_prop": 0.5750397226635852, "repo_name": "SiccarPoint/landlab", "id": "eb3c1e341c0eb28ecde4f205c302f4c6bd96193a", "size": ...
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. """ from django.test import TestCase from django.contrib.auth.models import User from models import Candidate, CandidateList class Creatio...
{ "content_hash": "4c4e63f1cf0769f00b63887ca8a55d93", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 84, "avg_line_length": 30.756756756756758, "alnum_prop": 0.6599297012302284, "repo_name": "hasadna/open-shot", "id": "21a29b994112fe5dfe09bdfbf403effc0c769816", "size": "11...
import _plotly_utils.basevalidators class ColorscaleValidator(_plotly_utils.basevalidators.ColorscaleValidator): def __init__( self, plotly_name="colorscale", parent_name="scattergl.marker", **kwargs ): super(ColorscaleValidator, self).__init__( plotly_name=plotly_name, ...
{ "content_hash": "cd8f6ac9360d30a8059d06f4be48ab50", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 81, "avg_line_length": 37.333333333333336, "alnum_prop": 0.6107142857142858, "repo_name": "plotly/python-api", "id": "6d262eec0bd53e2ddc5331c2aca9e383e1fc80d9", "size": "56...
from django.db.transaction import non_atomic_requests from django.utils.translation import ugettext import caching.base as caching from olympia import amo from olympia.amo.helpers import url, absolutify from olympia.amo.feeds import NonAtomicFeed from olympia.amo.utils import render from .models import AppVersion ...
{ "content_hash": "cbd747abb4de929a059cd011d8b4a037", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 76, "avg_line_length": 30.41269841269841, "alnum_prop": 0.6466597077244259, "repo_name": "harikishen/addons-server", "id": "749293252c283428efeefe2c5a4518631e5f5c71", "size...
"""Tests for tf.data service ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import time from absl.testing import parameterized from tensorflow.python.data.experimental.kernel_tests import data_service_test_base from tensorflow.python.dat...
{ "content_hash": "b1722ebe8e94ab7842920703a62f97ce", "timestamp": "", "source": "github", "line_count": 903, "max_line_length": 86, "avg_line_length": 42.80841638981174, "alnum_prop": 0.6943553394039735, "repo_name": "petewarden/tensorflow", "id": "bae14987eafa70f0a83ad4dd00db8675e35699a3", "size":...
import os import io import Exalt.view as vu import Exalt.messages as messages import Exalt.encodings as encodings import Exalt.constants as constants import Exalt.namespaces as namespaces import Exalt.utils as utils import Exalt.exalt as exalt from functools import partial from lxml import etree from lxml import iso...
{ "content_hash": "a3f53b2331a7961648025020a4c6e3e8", "timestamp": "", "source": "github", "line_count": 267, "max_line_length": 77, "avg_line_length": 32.46067415730337, "alnum_prop": 0.6288219683858313, "repo_name": "eerohele/exalt", "id": "63abd559ecc1e6d97f2fd2d7a3a3684b30fd5c37", "size": "8667"...
from heat.common.i18n import _ from heat.engine import constraints from heat.engine import properties from heat.engine import resource from heat.engine import support class GlanceImage(resource.Resource): """A resource managing images in Glance.""" support_status = support.SupportStatus(version='2014.2') ...
{ "content_hash": "5ef2ea0de72f9709c30765c0fe5b4485", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 76, "avg_line_length": 34.85840707964602, "alnum_prop": 0.5374460522975374, "repo_name": "maestro-hybrid-cloud/heat", "id": "6c2b30bb516f3b6dcaa22180d43cca98acb2492c", "si...