text
stringlengths
4
1.02M
meta
dict
import pytest import os import dj_haystack_url def test_parser_for_xapian_backend_with_relative_path(): config = dj_haystack_url.parse('xapian:relative/path/to/xapian_index') expected = { 'ENGINE': 'xapian_backend.XapianEngine', 'PATH': 'relative/path/to/xapian_index', } assert config...
{ "content_hash": "16c93793644f8d3ec60ccfaf21f8f215", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 80, "avg_line_length": 28.390243902439025, "alnum_prop": 0.6615120274914089, "repo_name": "simpleenergy/dj-haystack-url", "id": "6b26e4ce1a6e6259fb97236f3bae8b96d234c1cc", ...
from django.conf import settings from django.core.urlresolvers import reverse from django import http from django.test.utils import override_settings from mox3.mox import IsA # noqa from openstack_dashboard import api from openstack_dashboard.test import helpers as test from openstack_dashboard.dashboards.admin.ima...
{ "content_hash": "253f116449fe62d055204a9c50508d87", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 79, "avg_line_length": 45.95, "alnum_prop": 0.5267803167694354, "repo_name": "ankur-gupta91/horizon-net-ip", "id": "42c5e797826bd3c61ea776e020ce6a7f4c400c28", "size": "887...
from dynaconf.utils.parse_conf import parse_conf_data def parse_data(data): """Return converted data from @int, @float, @bool, @json markers""" return parse_conf_data(data) def custom_var_dict(cvarlist): cvarlist = cvarlist or [] return { cvar['key']: parse_data(cvar['value']) for cv...
{ "content_hash": "d291c992890725f16ddfba421cff5ba9", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 71, "avg_line_length": 24.357142857142858, "alnum_prop": 0.6451612903225806, "repo_name": "abnerpc/quokka", "id": "47510115298ba8b36ed3a38b68de8c5b4cd14d79", "size": "358",...
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( HEADRequest, get_element_by_attribute, parse_iso8601, ) class YesJapanIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?yesjapan\.com/video/(?P<slug>[A-Za-z0-9\-]*)_(?P<id>[A-Za-z0-9]+)\.html' _TEST...
{ "content_hash": "a0a90090ffe0f762540a9a3ecea898ab", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 117, "avg_line_length": 35.721311475409834, "alnum_prop": 0.5663148233134465, "repo_name": "Electroscholars/P.E.E.R.S", "id": "112a6c030138e6c7d0e58619d40f3af012e13362", "s...
""" Custom logger handle that adds the output to a text window.. """ __authors__ = "Nicu Tofan" __copyright__ = "Copyright 2015, Nicu Tofan" __credits__ = ["Nicu Tofan"] __license__ = "3-clause BSD" __maintainer__ = "Nicu Tofan" __email__ = "nicu.tofan@gmail.com" import logging class LoggerToWidget(logging.StreamHan...
{ "content_hash": "9f467716c1a4771b8e88ecf6c1d528a7", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 72, "avg_line_length": 24.35135135135135, "alnum_prop": 0.5849056603773585, "repo_name": "TNick/pyl2extra", "id": "aed457be119b2dc604b192ddd85a4af578d16ada", "size": "901",...
import jsonschema from girder.exceptions import ValidationException from girder.utility import setting_utilities class PluginSettings: AUTOJOIN = 'autojoin' @setting_utilities.default(PluginSettings.AUTOJOIN) def _defaultAutojoin(): return [] @setting_utilities.validator(PluginSettings.AUTOJOIN) def _val...
{ "content_hash": "e0668907de2fd68c1142a49ebd2a7e59", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 70, "avg_line_length": 25.55, "alnum_prop": 0.5205479452054794, "repo_name": "Kitware/girder", "id": "4291ac9d356f97582ad1afa3ac9990877b7204fd", "size": "1022", "binary":...
import datetime import os import glob from PySide import QtCore, QtGui from dpa.config import Config from dpa.action.registry import ActionRegistry from dpa.notify import Notification, emails_from_unames from dpa.ptask.area import PTaskArea, PTaskAreaError from dpa.ptask import PTask from dpa.queue import get_unique_...
{ "content_hash": "21e3f0e9511ac51f4eb08839d9e32855", "timestamp": "", "source": "github", "line_count": 502, "max_line_length": 119, "avg_line_length": 36.14342629482072, "alnum_prop": 0.5342261904761905, "repo_name": "Clemson-DPA/dpa-pipe", "id": "6a8dbfa010154e59391f1affd814da72f89519f2", "size":...
import random import numpy as np from numba.core import types from .templates import (ConcreteTemplate, AbstractTemplate, AttributeTemplate, CallableTemplate, Registry, signature) from numba.np.numpy_support import numpy_version from numba.core.overload_glue import glue_typing registry = Reg...
{ "content_hash": "b0e288d4bb0f9f0d62c6f88cf2dc14a7", "timestamp": "", "source": "github", "line_count": 300, "max_line_length": 79, "avg_line_length": 36.43666666666667, "alnum_prop": 0.6743207391821425, "repo_name": "IntelLabs/numba", "id": "0dc9cb4394dd8e896129677cc8d4c8b4cf13c053", "size": "1093...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('fluent_contents', '0001_initial'), ('glamkit_sponsors', '0001_initial'), ] operations = [ migrations.CreateModel( name='BeginSpo...
{ "content_hash": "9744434cfd59ea5f82ab4158d2eb09a4", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 176, "avg_line_length": 46.58490566037736, "alnum_prop": 0.5880923450789793, "repo_name": "ic-labs/django-icekit", "id": "333c987974f373177403894e08794d0f66cb96dd", "size":...
"""Embedding functions.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from six.moves import xrange # pylint: disable=redefined-builtin from tensorflow.contrib.framework.python.framework import tensor_util as contrib_tensor_util from tensorflow.contrib...
{ "content_hash": "65f7e3a0168095153dd05b6849a8a1fa", "timestamp": "", "source": "github", "line_count": 929, "max_line_length": 92, "avg_line_length": 45.02906350914962, "alnum_prop": 0.6384825014343086, "repo_name": "ghchinoy/tensorflow", "id": "14bbe5f9b30ef93149aa1fb317bd07d7dc2e6308", "size": "...
from warnings import warn from skimage.util.dtype import dtype_range from .base import Plugin from ..utils import ClearColormap, update_axes_image import six __all__ = ['OverlayPlugin'] def recent_mpl_version(): import matplotlib version = matplotlib.__version__.split('.') return int(version[0]) == 1 ...
{ "content_hash": "87a6ee4c236774672d6f88ec5acf353a", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 79, "avg_line_length": 29.459016393442624, "alnum_prop": 0.5948803561491375, "repo_name": "stefanv/register_gui", "id": "373d6bf4f796fc63ca47b699c7b5817781837fe9", "size":...
""" Created on 2015-05-21 @author: Danny<manyunkai@hotmail.com> DannyWork Project """ from __future__ import unicode_literals from django.contrib.sitemaps import Sitemap from django.core.urlresolvers import reverse from .models import Blog class BlogSitemap(Sitemap): """ 博客 Sitemap """ changefreq...
{ "content_hash": "7d690f614587b011a1965ffb29da86c4", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 89, "avg_line_length": 19.387096774193548, "alnum_prop": 0.6755407653910149, "repo_name": "manyunkai/dannysite4", "id": "e2b170d64d7b65cd8fff14da60eda87854504d0b", "size": ...
import ast import cPickle import logging import numpy from django.db import models from django.template import Template, Context from django.utils import timezone from django.conf import settings from django.db.models import Q from django.db.models.signals import post_delete from django.dispatch.dispatcher import rec...
{ "content_hash": "c040e54fdc6155798305ef530ca51954", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 88, "avg_line_length": 31.457142857142856, "alnum_prop": 0.5969118982742961, "repo_name": "crcollins/chemtools-webapp", "id": "ca071ffc2d90300792a4621b89fe1c86b9c19804", "...
"""personal URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/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-ba...
{ "content_hash": "6b52fa2e85acb2650b8855e812a77b5f", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 82, "avg_line_length": 36.5625, "alnum_prop": 0.7153846153846154, "repo_name": "SakiFu/personal-website", "id": "ebc8368c1ae1a136ecfb68f577056f1ed936299f", "size": "1170", ...
from __future__ import with_statement from alembic import context from sqlalchemy import engine_from_config, pool from logging.config import fileConfig import ConfigParser import os, sys sys.path.append(os.getcwd()) # this is the Alembic Config object, which provides # access to the values within the .ini file in us...
{ "content_hash": "8be3321c441ee972cdf48881ee89f080", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 69, "avg_line_length": 27.5, "alnum_prop": 0.7113636363636363, "repo_name": "CiscoSystems/fabric_enabler", "id": "29e249d7249cb6c0f3c3bd78096a40588f343148", "size": "2200",...
""" Use libraries from a virtualenv (by modifying sys.path) in production. """ import os import sys def setup_path() -> None: if os.path.basename(sys.prefix) != "zulip-py3-venv": BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) venv = os.path.join(BASE_DIR, "...
{ "content_hash": "d6edb5c47ab7c1b760af5ec62a1c114e", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 95, "avg_line_length": 45.8421052631579, "alnum_prop": 0.6498277841561424, "repo_name": "brainwane/zulip", "id": "20a190242aa2c9002b3a22eb72f7d4cb971bbdf8", "size": "871", ...
"""Tests for the Switch as X Siren platform.""" from homeassistant.components.siren import DOMAIN as SIREN_DOMAIN from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN from homeassistant.components.switch_as_x.const import CONF_TARGET_DOMAIN, DOMAIN from homeassistant.const import ( CONF_ENTITY_ID, ...
{ "content_hash": "d9f2b7704eb00beb6e7c0de46f051129", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 83, "avg_line_length": 31.803418803418804, "alnum_prop": 0.6560064498790648, "repo_name": "mezz64/home-assistant", "id": "2b3dedf6fb883b5ab7e6379a91ec9fd687f0d82a", "size"...
from .flaskext import FlaskJSONAPI from .serializer import (JSONAPI, AttributeActions, RelationshipActions, Permissions, attr_descriptor, relationship_descriptor, permission_test)
{ "content_hash": "f479632621a83a80c29095b605b89236", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 79, "avg_line_length": 57.5, "alnum_prop": 0.6652173913043479, "repo_name": "angelosarto/sqlalchemy-jsonapi", "id": "fcc0dcaa06ef25b48d5d1b4307e21fe56fe370ca", "size": "230"...
"""Test BIP65 (CHECKLOCKTIMEVERIFY). Test that the CHECKLOCKTIMEVERIFY soft-fork activates at (regtest) block height 1351. """ from test_framework.blocktools import ( create_block, create_coinbase, ) from test_framework.messages import ( CTransaction, msg_block, ) from test_framework.p2p import P2PInt...
{ "content_hash": "db7d83f0ef6f2471f061e51c5228a98f", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 119, "avg_line_length": 41.95876288659794, "alnum_prop": 0.6208845208845208, "repo_name": "apoelstra/bitcoin", "id": "10d2072dba01a071d0e861f401a0a60aa413a199", "size": "8...
import threading import sublime class EnsimeEnvironment: def __init__(self): self.settings = sublime.load_settings("Ensime.sublime-settings") self._clientLock = threading.RLock() self._client = None def set_client(self, client): self._clientLock.acquire() try: self._client = client ...
{ "content_hash": "781cbff259ac17d673a6a10e8c00723a", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 68, "avg_line_length": 19.583333333333332, "alnum_prop": 0.6723404255319149, "repo_name": "michaelpnash/sublime-ensime", "id": "e8fcc316c1a9903df6d6ad039f37df1451d37699", "...
__author__ = 'boris' """ takes: all_counts - pickled dict of mutation counts, all_counts[rRNA_name][sample_name] = counts_table all_Depths - pickled dict of coverage counts , all_depths[rRNA_name][sample_name] = depth_table min_mutations: if a position has less coverage than less mutations than this across...
{ "content_hash": "f59bcb7e7466032b4633ff4f259b7430", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 205, "avg_line_length": 56.510416666666664, "alnum_prop": 0.6849769585253456, "repo_name": "borisz264/mod_seq", "id": "3021d7f2fc24e5e0ec06f7b6db0813aca0ea5826", "size": "5...
"""Generates Json file for native library's resident pages.""" import argparse import json import logging import os import sys _SRC_PATH = os.path.abspath(os.path.join( os.path.dirname(__file__), os.pardir, os.pardir, os.pardir)) sys.path.insert(0, os.path.join(_SRC_PATH, 'third_party', 'catapult', 'devil')) fro...
{ "content_hash": "2727018e0b0f1a6249a3e6abb069034d", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 79, "avg_line_length": 25.928, "alnum_prop": 0.6670780623264425, "repo_name": "scheib/chromium", "id": "5f0fa9ec477363f4eee2179e6b75b0611c85f6a4", "size": "3429", "binar...
"""Implements ``ipython_display``, a function to embed images/videos/audio in the IPython Notebook. """ # Notes: # All media are physically embedded in the IPython Notebook # (instead of simple links to the original files) # That is because most browsers use a cache system and they won't # properly refresh the media w...
{ "content_hash": "51a2c3cb6ad3890b0d88a93c68b50fc6", "timestamp": "", "source": "github", "line_count": 281, "max_line_length": 86, "avg_line_length": 32.096085409252666, "alnum_prop": 0.5982924936245704, "repo_name": "Zulko/moviepy", "id": "d18b6a4e040c7642105e9ff9fe01cb98b5837752", "size": "9019"...
from unittest import TestCase from redis import StrictRedis import os from deferrable.backend.dockets import DocketsBackendFactory from deferrable.queue.dockets import DocketsQueue, DocketsErrorQueue class TestDocketsQueue(TestCase): def setUp(self): self.redis_client = StrictRedis(host=os.getenv("DEFERRA...
{ "content_hash": "41b62bf099a22f3926b436b3c044a4b2", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 93, "avg_line_length": 36.25, "alnum_prop": 0.7517241379310344, "repo_name": "gamechanger/deferrable", "id": "c44367a6b1c45b862ef6977110967e2ce4cb5b58", "size": "725", "b...
from flask import Blueprint, render_template, abort, request, redirect, session, url_for from flask.ext.login import current_user, login_user from sqlalchemy import desc from shutil import move from datetime import datetime from packages.objects import * from packages.common import * from packages.config import _cfg fr...
{ "content_hash": "599ac0be9c9edc60d0823f28cb55e887", "timestamp": "", "source": "github", "line_count": 231, "max_line_length": 139, "avg_line_length": 43.48051948051948, "alnum_prop": 0.6443647949024293, "repo_name": "MaxLeiter/packages.knightos.org", "id": "df16944c543a42f63fc4fc609c08ef87354d34db"...
from npr_sfs.datasets.loader import dataNames, loadData import results.ibme import results.lumo import results.compare from npr_sfs.results.results import batchResults batch_modules = [results.ibme, results.lumo, results.compare] if __name__ == '__main__': for batch_module in ba...
{ "content_hash": "a2008d15d31413528b5d8e43773b3048", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 70, "avg_line_length": 25.375, "alnum_prop": 0.6921182266009852, "repo_name": "tody411/NPR-SFS", "id": "41e7cfcd8cb839b3fd9933b8d26eb834d890e2bb", "size": "525", "binary"...
from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/intangible/ship/shared_tieadvanced_pcd.iff" result.attribute_template_id = 8 result.stfName("space_item_n","tieadvanced_pcd") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "339b757e674159b3fe063258cb3a1794", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 70, "avg_line_length": 23.846153846153847, "alnum_prop": 0.7032258064516129, "repo_name": "obi-two/Rebelion", "id": "19ca6d9bc151f3fd73e6d44c2232285c6e8674f0", "size": "455...
from jinja2 import Environment from jinja2 import FileSystemLoader from .base import BaseView class JinjaView(BaseView): """ Jinja view. """ def _load_engine(self, template_dir): """ Load template engine by name and return an instance. """ return Environment(loader=Fil...
{ "content_hash": "635d53d1bf897a945e12d0b45ace4d8e", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 65, "avg_line_length": 27.96969696969697, "alnum_prop": 0.6132177681473456, "repo_name": "PythonRails/rails", "id": "25123de2baaf203e6e21c5e3f06659e764188d36", "size": "923...
from collections import OrderedDict from django.db.models import Q from django.utils.functional import cached_property from pontoon.base.models import ( Locale, Project, Resource, TranslatedResource, Translation, ) from pontoon.tags.models import Tag class Clonable(object): """Instantiated d...
{ "content_hash": "80442b2376290bfb76a51966532b2eb7", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 88, "avg_line_length": 28.074468085106382, "alnum_prop": 0.6271314892004547, "repo_name": "jotes/pontoon", "id": "166059b06d49bb8b8b50b3cd88fe056310f852e9", "size": "5278"...
import warnings from http import HTTPStatus from typing import Any, Iterable, Optional, Set, Tuple from multidict import CIMultiDict from yarl import URL from . import hdrs from .helpers import CookieMixin from .typedefs import LooseHeaders, StrOrURL __all__ = ( "HTTPException", "HTTPError", "HTTPRedirec...
{ "content_hash": "e42433e4a4e8fbb36d26f31cc608d5b1", "timestamp": "", "source": "github", "line_count": 510, "max_line_length": 80, "avg_line_length": 23.788235294117648, "alnum_prop": 0.6201780415430267, "repo_name": "KeepSafe/aiohttp", "id": "b22995f39acc831149d7770facbfd3e578889b85", "size": "12...
import os c = get_config() load_subconfig('etc/base_config.py') load_subconfig('etc/github_auth.py') c.JupyterHub.hub_ip = '0.0.0.0' c.JupyterHub.proxy_api_ip = '0.0.0.0' c.JupyterHub.spawner_class = 'everware.CustomSwarmSpawner' c.Spawner.tls = True c.DockerSpawner.tls = True # Change this setting: # IP of the mac...
{ "content_hash": "e4e15218bea8334482d7a3d35a8f72da", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 63, "avg_line_length": 26.5625, "alnum_prop": 0.7388235294117647, "repo_name": "sashabaranov/everware", "id": "a2c716a8b097a818fb0c2948b04102f7e761d804", "size": "661", "...
''' Utilities to dynamically load plugin modules. Modules imported this way remain accessible to static imports, regardless of the order in which they are imported. For modules that are not part of an existing package tree, use create_subpackage() to dynamically create a package for them before loading them. ''' impo...
{ "content_hash": "1a6565a3179da9dc779a495c3ae9035b", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 79, "avg_line_length": 33.36904761904762, "alnum_prop": 0.674634320371031, "repo_name": "ntt-sic/heat", "id": "b59a7519e1c70a2c3ba0cb5b8cdabb92cc760d01", "size": "3423", ...
""" =============================================== .. module:: evodjango.i18n.models :platform: Django :synopsis: .. moduleauthor:: (C) 2014 Oliver Gutiérrez # TODO: Automatic translation support using Google Translate """ # Django imports from django.db import models from django.utils.translation import ...
{ "content_hash": "f882dc3342581a81ee0009a5bd09860d", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 97, "avg_line_length": 29.820224719101123, "alnum_prop": 0.6318764129615675, "repo_name": "olivergs/evodjango", "id": "e60fad10b4a38270100b1b6e5770f8610e2ba025", "size": "2...
import rlp from ethereum.transactions import Transaction from ethereum.utils import privtoaddr from eth_tester_client.utils import ( mk_random_privkey, encode_address, encode_data, ) from web3.providers.rpc import TestRPCProvider def test_eth_sendRawTransaction(web3, wait_for_transaction, extra_account...
{ "content_hash": "3e13e7460a0e854ed4de723a04c6f946", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 77, "avg_line_length": 29.62962962962963, "alnum_prop": 0.68625, "repo_name": "shravan-shandilya/web3.py", "id": "0d52fd52b7266a24b595fd2e54d72ad9798c7045", "size": "1600",...
""" Abstract base class for dhcp providers. """ import abc import six @six.add_metaclass(abc.ABCMeta) class BaseDHCP(object): """Base class for DHCP provider APIs.""" @abc.abstractmethod def update_port_dhcp_opts(self, port_id, dhcp_options, token=None): """Update one or more DHCP options on th...
{ "content_hash": "f8d36a27bf16c01677612357b8dc6943", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 71, "avg_line_length": 33.18518518518518, "alnum_prop": 0.5107886904761905, "repo_name": "SauloAislan/ironic", "id": "94f61fd091a4d326226daf74a8d6cbd70c2d64e5", "size": "33...
""" ================================================= Demo of affinity propagation clustering algorithm ================================================= Reference: Brendan J. Frey and Delbert Dueck, "Clustering by Passing Messages Between Data Points", Science Feb. 2007 """ print(__doc__) from sklearn.cluster impor...
{ "content_hash": "900b7ce80d82d6d2b3d94bc06f92a1d4", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 78, "avg_line_length": 36.806451612903224, "alnum_prop": 0.6007887817703769, "repo_name": "fspaolo/scikit-learn", "id": "7abd6822ffc5dd48c010e3f6c7567201197a8a5d", "size": ...
"""empty message Revision ID: 2956c7423d73 Revises: None Create Date: 2014-03-14 00:56:06.192705 """ # revision identifiers, used by Alembic. revision = '2956c7423d73' down_revision = None from alembic import op import sqlalchemy as sa def upgrade(): pass def downgrade(): pass
{ "content_hash": "6f9049330a8fc611e81eb86c5e397ead", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 40, "avg_line_length": 13.363636363636363, "alnum_prop": 0.7210884353741497, "repo_name": "sniboboof/flask-microblog", "id": "8797d12ec598529af45340d51a1849c2a32f7bdd", "si...
from msrest.paging import Paged class JobCollectionDefinitionPaged(Paged): """ A paging container for iterating over a list of JobCollectionDefinition object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, 'current_page': {'key': 'value', 'type': '[JobCollectio...
{ "content_hash": "2b3fe50fdff6b0700cb5a950c9efc3b4", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 82, "avg_line_length": 28.75, "alnum_prop": 0.6282608695652174, "repo_name": "lmazuel/azure-sdk-for-python", "id": "c14768483eb350e9c5cf59dab2a4ec90b17fd585", "size": "934"...
class numChain(object): def __init__(self, numberOfLinks, desiredValue): self.numberOfLinks = numberOfLinks self.desiredValue = desiredValue self.links=[] self.links.append(1) self.stringGroup=[] self.allPotentialValues=set() for x in range(numberOfLinks+1): ...
{ "content_hash": "49a9e768bf7ea71358a18ccfded3db7a", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 109, "avg_line_length": 38.77142857142857, "alnum_prop": 0.604274134119381, "repo_name": "jeremiahmarks/dangerzone", "id": "cf8b2cc1fda3a839a4f14abe27aa28f9ef6a3c6b", "size...
import datetime import io from os import linesep import re import sys from pip._vendor.toml.tz import TomlTz if sys.version_info < (3,): _range = xrange # noqa: F821 else: unicode = str _range = range basestring = str unichr = chr def _detect_pathlib_path(p): if (3, 4) <= sys.version_info: ...
{ "content_hash": "52b686be260400446ced03ba8d8f3df0", "timestamp": "", "source": "github", "line_count": 1057, "max_line_length": 80, "avg_line_length": 36.85335856196783, "alnum_prop": 0.4279406479437285, "repo_name": "jsirois/pex", "id": "e071100de0f3ef75b2149857861c2f60fc4e89af", "size": "38954",...
"""Tests for tf.py.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools import operator import numpy as np from tensorflow.python.eager import function from tensorflow.python.framework import constant_op from tensorflow.python.framework im...
{ "content_hash": "d4a54350ffb3b672c1919750e0043645", "timestamp": "", "source": "github", "line_count": 842, "max_line_length": 94, "avg_line_length": 38.402612826603324, "alnum_prop": 0.6518323797742385, "repo_name": "theflofly/tensorflow", "id": "b3316b73ff6c6fccedced987cfa8428092df4014", "size":...
import unittest # test_records = frappe.get_test_records('Ebay Manager') class TestEbayManager(unittest.TestCase): pass
{ "content_hash": "1806df79ed63cf43d08a904186c7fdcf", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 56, "avg_line_length": 18.142857142857142, "alnum_prop": 0.7559055118110236, "repo_name": "bglazier/erpnext_ebay", "id": "9e3070c37211c27e21d0c4aeb5849cf4d5466b6b", "size": ...
# coding: utf-8 from __future__ import print_function from __future__ import absolute_import # install_requires of ruamel.base is not really required but the old # ruamel.base installed __init__.py, and thus a new version should # be installed at some point _package_data = dict( full_package_name="ruamel.yaml", ...
{ "content_hash": "024912c023e0cecf1b24f9b3ecd71b3e", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 165, "avg_line_length": 35.67857142857143, "alnum_prop": 0.584250917584251, "repo_name": "KaranToor/MA450", "id": "9be208205ea694383b43ab60c013defe2f5e4b6e", "size": "2997"...
from lr.plugins.base import BasePlugin class DoNotPublishError(Exception): pass class ITombstonePolicy(BasePlugin): def __init__(self): super(ITombstonePolicy, self).__init__() def permit(self, original_rd3=None, original_crypto=None, replacement_rd3=None, replacement_crypto=None): '''...
{ "content_hash": "9e49d80eeb2ee3794935d2b41d36731e", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 114, "avg_line_length": 46.2, "alnum_prop": 0.729004329004329, "repo_name": "jimklo/LearningRegistry", "id": "55a6794560d1fddfce0e705a2f6f1efc9c4e03ee", "size": "1233", "...
""" Example using MySQL Connector/Python showing: * using warnings """ import mysql.connector STMT = "SELECT 'abc'+1" def main(config): output = [] config['get_warnings'] = True db = mysql.connector.Connect(**config) cursor = db.cursor() db.sql_mode = '' output.append("Executing '%s'"...
{ "content_hash": "ccf380655bb993cdf396abdb3affc73b", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 53, "avg_line_length": 19.352941176470587, "alnum_prop": 0.5379939209726444, "repo_name": "loicbaron/nutrition", "id": "b0c651aa0f7d7683e6d860638331f8f1dac934d6", "size": "...
from FRS.config._cfg import ConfigValue, is_type class names: PUBLIC_TEAMS = ConfigValue('teampub', condition=is_type(str)) # type: ConfigValue[str] PUBLIC_EVENTS = ConfigValue('eventpub', condition=is_type(str)) # type: ConfigValue[str] class schemas: PUBLIC_TEAMS_SCHEMA = ConfigValue('Publ...
{ "content_hash": "29c4b5c6693bcc8d65d18863eb0a3e82", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 104, "avg_line_length": 54.111111111111114, "alnum_prop": 0.704312114989733, "repo_name": "FRC-RS/FRS", "id": "c94b948428ed0b0e44538f66ec210f6f5c44338e", "size": "487", "b...
""" pylibftdi - python wrapper for libftdi Copyright (c) 2010-2014 Ben Bass <benbass@codedstructure.net> See LICENSE file for details and (absence of) warranty pylibftdi: http://bitbucket.org/codedstructure/pylibftdi This module contains some basic tests for the higher-level functionality without requiring an actual...
{ "content_hash": "640c350b96ea7c932de1ec00f211274c", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 77, "avg_line_length": 33.095238095238095, "alnum_prop": 0.6103597122302158, "repo_name": "claudyus/pylibftdi", "id": "ae3b68db215768ff25175436a8c00251372e3581", "size": "...
from dry_rest_permissions.generics import DRYPermissionFiltersBase from django.db.models import Q from apps.registration.models import Assignment from .models import Appearance from .models import Round class AppearanceFilterBackend(DRYPermissionFiltersBase): def filter_list_queryset(self, request, queryset, vi...
{ "content_hash": "213e4acb3da3096aac99040b8d772eba", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 113, "avg_line_length": 37.95238095238095, "alnum_prop": 0.5927227101631116, "repo_name": "barberscore/barberscore-api", "id": "70ca6de7692830a4cadb71ef43b934a17720039d", ...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging import Queue from pants.pantsd.service.pants_service import PantsService class SchedulerService(PantsService): """The pantsd scheduler service. ...
{ "content_hash": "4545c00c41699ec02176034017e250d6", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 100, "avg_line_length": 37.77777777777778, "alnum_prop": 0.6505882352941177, "repo_name": "gmalmquist/pants", "id": "86a561aa027f5efe38baea12fb9b59d5a17ffb0f", "size": "354...
""" Demo implementation of the media player. For more details about this platform, please refer to the documentation https://home-assistant.io/components/demo/ """ import homeassistant.util.dt as dt_util from homeassistant.components.media_player import ( MediaPlayerDevice) from homeassistant.components.media_play...
{ "content_hash": "6421c1466ebfa85bf6fb71ecd50648d9", "timestamp": "", "source": "github", "line_count": 414, "max_line_length": 79, "avg_line_length": 31.719806763285025, "alnum_prop": 0.6146816935729515, "repo_name": "HydrelioxGitHub/home-assistant", "id": "de455879d3d5abdb25963e7f4f634dea989892a1",...
"""Common functions for MongoDB and DB2 backends """ import pymongo import ceilometer from ceilometer.storage import base from ceilometer.storage import models from ceilometer.storage.mongo import utils as pymongo_utils from ceilometer import utils COMMON_AVAILABLE_CAPABILITIES = { 'meters': {'query': {'simple':...
{ "content_hash": "834cf508be79cd78d14f7a97562f58bf", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 78, "avg_line_length": 36.645161290322584, "alnum_prop": 0.5543573943661971, "repo_name": "m1093782566/openstack_org_ceilometer", "id": "32613e5f3adc049d7e382468b2f89f05220f...
class Channel(object): def __init__(self, server, name, id, members=[]): self.server = server self.name = name self.id = id self.members = members def __eq__(self, compare_str): if self.name == compare_str or self.id == compare_str: return True else: ...
{ "content_hash": "af4435726157772da264f04f9e8a75b3", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 79, "avg_line_length": 28.76923076923077, "alnum_prop": 0.5200534759358288, "repo_name": "pboennig/bellsbot", "id": "d12586199966879c1c8cf59b808fea55d336053f", "size": "748...
from portality.dao import DomainObject from portality.lib import dates class Notification(DomainObject): """~~Notification:Model->DomainObject:Model~~""" __type__ = "notification" def __init__(self, **kwargs): super(Notification, self).__init__(**kwargs) @property def who(self): ...
{ "content_hash": "32d94cc78a2ff0b9d794de9acb68c436", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 52, "avg_line_length": 22.36986301369863, "alnum_prop": 0.6093080220453154, "repo_name": "DOAJ/doaj", "id": "cc0944b470547782e66526442de2f0c3d3ceaf6d", "size": "1633", "b...
# def version(self, data): # yield from asyncio.sleep(self.delay) # return 1 # def ping(self, data): # yield from asyncio.sleep(self.delay) # response = ServiceMessage() # response.data = data # return response
{ "content_hash": "9832aa22841aef9b76d7de0ceb7bc9a1", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 45, "avg_line_length": 28.666666666666668, "alnum_prop": 0.5891472868217055, "repo_name": "drankinn/wolverine", "id": "c90a26eac06346454a5909914f1b4cbc9aa3b96d", "size": "18...
from copy import deepcopy import requests from six.moves.urllib.parse import urlparse from datadog_checks.base.checks.openmetrics import OpenMetricsBaseCheck from datadog_checks.base.errors import CheckException from .metrics import METRICS_MAP class GitlabCheck(OpenMetricsBaseCheck): """ Collect Gitlab me...
{ "content_hash": "09743089a5cd1b6ddac783e18008a4ad", "timestamp": "", "source": "github", "line_count": 182, "max_line_length": 118, "avg_line_length": 40.252747252747255, "alnum_prop": 0.6048321048321048, "repo_name": "DataDog/integrations-core", "id": "eddece214435cca4c220012bfedc3380c20d9693", "...
import time import atexit import pigpio class sensor: """ A class to read relative humidity and temperature from the DHT22 sensor. The sensor is also known as the AM2302. The sensor can be powered from the Pi 3V3 or the Pi 5V rail. Powering from the 3V3 rail is simpler and safer. You may need to...
{ "content_hash": "99930f550d662f3b58c63833519d005e", "timestamp": "", "source": "github", "line_count": 279, "max_line_length": 77, "avg_line_length": 26.121863799283155, "alnum_prop": 0.5362239297475302, "repo_name": "ninjawil/weather-station", "id": "8a10f1742d79029372c787f19d7bf7a43c6761ac", "si...
"""Constants for the P1 Monitor integration.""" from __future__ import annotations from datetime import timedelta import logging from typing import Final DOMAIN: Final = "p1_monitor" LOGGER = logging.getLogger(__package__) SCAN_INTERVAL = timedelta(seconds=5) SERVICE_SMARTMETER: Final = "smartmeter" SERVICE_PHASES: ...
{ "content_hash": "178ef7d15f5331ac938d73899e676b84", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 47, "avg_line_length": 25.4, "alnum_prop": 0.7322834645669292, "repo_name": "jawilson/home-assistant", "id": "d72927a80f63da64c7850caa75ca5434d46c3163", "size": "508", "b...
import datetime import dateutil.parser from pixiv_pixie.utils import LazyProperty from .constants import IllustType, IllustAgeLimit def _lazy(attr_name): def get_func(self): self.update() return getattr(self, attr_name) return LazyProperty(get_func, property_name=attr_name) class PixivIll...
{ "content_hash": "33c697243031aa1ca75022db26e341e6", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 80, "avg_line_length": 31.6, "alnum_prop": 0.5625316455696202, "repo_name": "Xdynix/PixivPixie", "id": "2ad9119460e9e8bcccaeb2805a0a3990f49566ba", "size": "7900", "binar...
import os.path import sys sys.path = [os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'lib')] + sys.path from amqpsfw import amqp_spec, ioloop from amqpsfw.client.client import Client from amqpsfw.client.configuration import ClientConfiguration class TestClientConsumer: def test_client_consumer(s...
{ "content_hash": "d66e8c3317353b1df0843c1cf9dee844", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 219, "avg_line_length": 53.433734939759034, "alnum_prop": 0.5812852311161217, "repo_name": "akayunov/amqpsfw", "id": "548e1664c00e21c4bb0a10b3ba0ce4c241e73d00", "size": "44...
from Code.Projects.Tracking.Tracking3 import read_redshift from Code.config import get_pwd def extract(): raw = read_redshift(get_pwd(), query) query = "SELECT DISTINCT 'tablename' FROM 'pg_table_def' WHERE 'schemaname' = 'public' ORDER BY 'tablename'" data = read_redshift(get_pwd(), query) print data
{ "content_hash": "9b3905a86336f8301bd05c3cc489ee01", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 108, "avg_line_length": 25.916666666666668, "alnum_prop": 0.7331189710610932, "repo_name": "ShipJ/Code", "id": "6514db1f938b228c7684df4a35dd109022938967", "size": "311", ...
import base64 import json from cattle import ApiError, ClientApiError from common_fixtures import * # NOQA from datetime import timedelta import time def test_container_create_count(client, context): cs = client.create_container(imageUuid=context.image_uuid, count=3) assert...
{ "content_hash": "78c36d766c00c8fae3d38f2777b38673", "timestamp": "", "source": "github", "line_count": 639, "max_line_length": 78, "avg_line_length": 29.322378716744915, "alnum_prop": 0.6307840102471046, "repo_name": "Cerfoglg/cattle", "id": "c144326e5b9b2f895695e387a87fab858b5384e3", "size": "187...
""" Communicates with RabbitMQ. """ import sys from copy import copy import logging from traceback import format_exc from twisted.internet import task from txamqp.client import Closed from txamqp.client import TwistedDelegate from txamqp.protocol import AMQClient from txamqp.content import Content import txamqp.spec f...
{ "content_hash": "d44e6109ac6affe458bee55643336e78", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 77, "avg_line_length": 32.04255319148936, "alnum_prop": 0.5965028773793714, "repo_name": "hiidef/hiispider", "id": "e17bdba52cf2b8e9323b820cbd69bbed0fdb35ca", "size": "456...
import os import sys import numpy as np sys.path.append(os.getcwd()) def noise_sampler(bs): return np.random.normal(0.0, 1.0, [bs, 2]) if __name__ == '__main__': from a_nice_mc.objectives.expression.ring2d import Ring2d from a_nice_mc.models.discriminator import MLPDiscriminator from a_nice_mc.mode...
{ "content_hash": "7319835ffb0b3416f4079fef1acec0f9", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 83, "avg_line_length": 25.9375, "alnum_prop": 0.6180722891566265, "repo_name": "ermongroup/a-nice-mc", "id": "f122ea3c5f53cb98cf1341703e9eb2d007415f9b", "size": "830", "b...
"""Multiprocessing via Popen. This module provides a multi-processing pool backed by Popen. with additional timeout support. """ import os import sys import struct import threading import subprocess import concurrent.futures from enum import IntEnum from collections import namedtuple import pickle def kill_child_pro...
{ "content_hash": "8e0a0d0b188acb9d7fcce52669339168", "timestamp": "", "source": "github", "line_count": 372, "max_line_length": 98, "avg_line_length": 29.026881720430108, "alnum_prop": 0.5759399888868308, "repo_name": "dmlc/tvm", "id": "907231c1a9fa07988cae1e08f18be533a5525cba", "size": "11614", ...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['deprecated'], 'supported_by': 'certified'} DOCUMENTATION = r''' --- module: bigip_gtm_facts short_description: Collect facts from F5...
{ "content_hash": "bef36611aeb5d8ba47d2d308b5396a57", "timestamp": "", "source": "github", "line_count": 979, "max_line_length": 101, "avg_line_length": 32.40449438202247, "alnum_prop": 0.5799079561215483, "repo_name": "SergeyCherepanov/ansible", "id": "745360cc10c533638731e727dccbdcc13d4ebf6b", "si...
import _plotly_utils.basevalidators class TickfontValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__( self, plotly_name="tickfont", parent_name="heatmap.colorbar", **kwargs ): super(TickfontValidator, self).__init__( plotly_name=plotly_name, parent_...
{ "content_hash": "f66da1c3020687ce942fcd07a5a61a83", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 78, "avg_line_length": 39.64102564102564, "alnum_prop": 0.5407503234152652, "repo_name": "plotly/plotly.py", "id": "0d554d1067f4c40ad57457ddb1c1fccb548a1701", "size": "1546...
import sys sys.path.append('../common/tests') import uuid import json from flexmock import flexmock, Mock from testtools.matchers import Equals, Contains, Not import stevedore.extension from test_utils import * from test_common import TestCase, setup_extra_flexmock import ConfigParser from vnc_cfg_api_server import vn...
{ "content_hash": "df1367167856cb2d36930f3744a5196e", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 112, "avg_line_length": 35.404761904761905, "alnum_prop": 0.6580363147276396, "repo_name": "Juniper/contrail-dev-controller", "id": "730d8db47b11a3f3684ebd3300f2230edf33a830"...
from django.conf import settings from django.db.models import Avg, Max, Min, Count # Python standard import math from datetime import date as _date # Spenglr from network.models import Network # Calculate mSQ for the oldest records def batch_network_update_sq(): # Random 1000 networks # NOTE: Fix to something...
{ "content_hash": "27b2917f3c06e26880b1743dd4fcaf8f", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 102, "avg_line_length": 30.875, "alnum_prop": 0.6811740890688259, "repo_name": "mfitzp/smrtr", "id": "7ab1e624b80b2f70b501a6bce09116bc80a1754a", "size": "988", "binary": ...
from warehouse import tasks from warehouse.accounts.interfaces import ITokenService, TokenExpired from warehouse.packaging.models import RoleInvitation, RoleInvitationStatus @tasks.task(ignore_result=True, acks_late=True) def update_role_invitation_status(request): invites = ( request.db.query(RoleInvitat...
{ "content_hash": "b78b0ed4b571636c973d84748fddef65", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 77, "avg_line_length": 35.473684210526315, "alnum_prop": 0.7240356083086054, "repo_name": "pypa/warehouse", "id": "6daa5fde1b2918dbfdba627f6fb65c90f364b263", "size": "1215"...
from importlib import import_module import os import sys from setuptools import setup, find_packages from setuptools.command.test import test def package_env(file_name, strict=False): file_path = os.path.join(os.path.dirname(__file__), file_name) if os.path.exists(file_path) or strict: return open(f...
{ "content_hash": "92a8448577848ce1930303ce31004534", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 89, "avg_line_length": 34.59803921568628, "alnum_prop": 0.5471805043921791, "repo_name": "denz/swarm-crawler", "id": "38b8daac4ab8c5de34c91ad5067acd34182058c1", "size": "3...
''' Created on 22.10.2014 @author: Philip ''' import flask import flask_login import users.forms import users.models import utils.forms import utils.redirect from utils.views import get_column_names, create_table, alert_warning, alert_info, alert_success, \ error_not_found, error_access_denied, create_action_url...
{ "content_hash": "bc8a25aa7d06f0e81628b4f58a91bba3", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 113, "avg_line_length": 37.747899159663866, "alnum_prop": 0.6667408726625111, "repo_name": "philipschoemig/TACTourney", "id": "18b82e5e02390f29d385fff5667833b488367013", "...
"""Openstack logging handler. This module adds to logging functionality by adding the option to specify a context object when calling the various log methods. If the context object is not specified, default formatting is used. Additionally, an instance uuid may be passed as part of the log message, which is intended ...
{ "content_hash": "e3f41cb2d4bd1b339f04a95f23c9ca5c", "timestamp": "", "source": "github", "line_count": 539, "max_line_length": 78, "avg_line_length": 35.06679035250464, "alnum_prop": 0.5901275064811385, "repo_name": "ccrouch/tuskar", "id": "b29d5b6cf94253e51fb287b1574067f0a01bf5ee", "size": "19717...
import unittest import numpy import chainer from chainer.backends import cuda from chainer import functions from chainer import gradient_check from chainer import testing from chainer.testing import attr from chainer.utils import type_check @testing.parameterize(*testing.product_dict( [{'dtype': numpy.float16},...
{ "content_hash": "e9c011f4c564f659d93fe4e86509a000", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 79, "avg_line_length": 37, "alnum_prop": 0.5895143263564316, "repo_name": "ktnyt/chainer", "id": "2905328d888813a0a164c1a7dc17c162e250d184", "size": "4921", "binary": fa...
__author__ = 'Charlie'
{ "content_hash": "7d77edd88d970ccc16f9861e9564f484", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 22, "avg_line_length": 23, "alnum_prop": 0.5652173913043478, "repo_name": "shekkizh/TensorflowProjects", "id": "9eaafa3d0e8020541c3987459efd1bab9646be7f", "size": "23", "b...
from __future__ import absolute_import, division, print_function, unicode_literals import os from os import path try: from urllib.parse import urljoin except ImportError: from urlparse import urljoin import nib from nib import Document, Resource, Render from nib.processor import preprocessors, postprocessors,...
{ "content_hash": "50636779330b40df934320ccd6ae1139", "timestamp": "", "source": "github", "line_count": 237, "max_line_length": 100, "avg_line_length": 36.25316455696203, "alnum_prop": 0.5874068901303539, "repo_name": "jreese/nib", "id": "d4018d497f0d5fa53d77575684ffb961ad614965", "size": "8592", ...
import numpy as np import tensorflow as tf import lucid.modelzoo.vision_models as models import lucid.optvis.objectives as objectives import lucid.optvis.param as param import lucid.optvis.render as render from lucid.misc.io import show, load from lucid.misc.io.showing import _image_url, _display_html from collections...
{ "content_hash": "4bc6665c064ac4dc2cf7c18828c446ef", "timestamp": "", "source": "github", "line_count": 228, "max_line_length": 155, "avg_line_length": 26.88157894736842, "alnum_prop": 0.634034915973242, "repo_name": "tensorflow/lucid", "id": "38c1a50de195af550d72d52f933f9f409e2bad2b", "size": "612...
__author__ = 'SmileyBarry' import requests import sys import time from .consts import API_CALL_DOCSTRING_TEMPLATE, API_CALL_PARAMETER_TEMPLATE, IPYTHON_PEEVES, IPYTHON_MODE from .decorators import Singleton, cached_property, INFINITE from .errors import APIException, APIUnauthorized, APIKeyRequired, APIPrivate, APICo...
{ "content_hash": "731e3f03077bf1db9b399aca02931031", "timestamp": "", "source": "github", "line_count": 685, "max_line_length": 120, "avg_line_length": 39.465693430656934, "alnum_prop": 0.5747207220537102, "repo_name": "smiley/steamapi", "id": "3653b32f0991d35061c1b0a2457a6d7c453baa97", "size": "27...
__author__ = 'Georgios Rizos (georgerizos@iti.gr)' import itertools from itertools import islice, zip_longest import numpy as np def grouper(iterable, n, pad_value=None): """ Returns a generator of n-length chunks of an input iterable, with appropriate padding at the end. Example: grouper(3, 'abcdefg',...
{ "content_hash": "6336a41923afb49efd1d975e48f3856f", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 101, "avg_line_length": 29.086206896551722, "alnum_prop": 0.6271487848251334, "repo_name": "MKLab-ITI/reveal-user-annotation", "id": "079834fba7cd7698952619a941be14233716ea4d...
from __future__ import unicode_literals, print_function, absolute_import default_app_config = "reviewers.apps.ReviewersConfig" review_group_name = "reviewers"
{ "content_hash": "e355aa163ecfe9eb909376e7068c7e6b", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 72, "avg_line_length": 27, "alnum_prop": 0.7777777777777778, "repo_name": "olea/PyConES-2016", "id": "94a81b72a5bcc33fc693f32a5dc59410c6be8c15", "size": "186", "binary": f...
from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/draft_schematic/structure/city/shared_garden_small.iff" result.attribute_template_id = -1 result.stfName("string_id_table","") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "e930d082fd0089b0541f27bbd95885c5", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 82, "avg_line_length": 23.923076923076923, "alnum_prop": 0.6977491961414791, "repo_name": "anhstudios/swganh", "id": "c117786085a1e00d99a8b3d78e8313ffd5021be9", "size": "45...
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 ...
{ "content_hash": "5dced5f1a515b1ea4224ab40357c32e2", "timestamp": "", "source": "github", "line_count": 277, "max_line_length": 79, "avg_line_length": 32.64259927797834, "alnum_prop": 0.7039371820393718, "repo_name": "bepetersn/gmail_client", "id": "f53b65772e7010f25a5c3a8074106b53c10f09c6", "size"...
''' Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License ...
{ "content_hash": "f813fda87bfd19382c752d39bfbeff5a", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 73, "avg_line_length": 37.333333333333336, "alnum_prop": 0.7648809523809523, "repo_name": "akon-dey/ground", "id": "35c825fd435fe926eb0c67e776ab99f5151aa0be", "size": "672"...
from pymongo import MongoClient from bson.objectid import ObjectId import os import json DATABASE_URI = os.getenv('MONGOLAB_URI') database = MongoClient(DATABASE_URI) database.drop_database(database.get_default_database()) db = database.get_default_database() os.chdir('..') basedir = os.path.abspath(os.curdir) + '/...
{ "content_hash": "40cee27123e2bcc965a0dfad76258e83", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 55, "avg_line_length": 27.35483870967742, "alnum_prop": 0.652122641509434, "repo_name": "LNM-HoverSpace/HoverSpace", "id": "03bf60e3226454f81b4d6ed388d3ba152d42e88f", "size...
from pytest import raises, skip from decimal import Decimal from mio import runtime from mio.utils import Null from mio.state import Completer from mio.errors import AttributeError, Error # Supported Types # { # dict: "Dict" # list: "List" # tuple: "Tuple", # unicode: "String" # str: ...
{ "content_hash": "ea45296231de44458345c9fb6ee5b07f", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 105, "avg_line_length": 22.29891304347826, "alnum_prop": 0.6417255666585425, "repo_name": "prologic/mio", "id": "2fd7046c6eef2d729d88ee2af55e99657d940542", "size": "4103",...
"""Ce fichier définit un conteneur de groupe. Il doit n'y voir qu'un conteneur de groupes et c'est de ce fait à la fois une classe singleton implicite dérivée de BaseObj. """ from abstraits.obase import BaseObj from primaires.interpreteur.groupe.groupe import * class ConteneurGroupes(BaseObj): """Classe contene...
{ "content_hash": "6c9f321aa2ec3bd32acf6a4ae7ed341e", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 78, "avg_line_length": 32, "alnum_prop": 0.6125, "repo_name": "vlegoff/tsunami", "id": "5cfa77ff9f6d49bb9bb54ebcafcf992153e772a8", "size": "5271", "binary": false, "co...
""" SESMailer """ from setuptools import setup, find_packages import ses_mailer PACKAGE = ses_mailer setup( name=PACKAGE.__NAME__, version=PACKAGE.__version__, license=PACKAGE.__license__, author=PACKAGE.__author__, author_email='mardix@github.com', description="A simple module to send email...
{ "content_hash": "53ff26566942f0ee79d5c2bd03e5f283", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 70, "avg_line_length": 28.92452830188679, "alnum_prop": 0.5727332028701891, "repo_name": "mardix/ses-mailer", "id": "c6a63d59d78dee11669a5523aebd9d726a6c142e", "size": "153...
from discord import Embed, Color description = "getting IDs" async def ex(message, client): args = message.content.split()[1:] server = message.server print(len(args)) if len(args) > 0: query = " ".join(args).lower() roles = ["%s - %s" % (r.name, r.id) for r in server.roles if query...
{ "content_hash": "1e979b9b1d5879847612029ac983a723", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 131, "avg_line_length": 45.25925925925926, "alnum_prop": 0.5990180032733224, "repo_name": "zekroTJA/regiusBot", "id": "30605f67a61ae4a6265ec4a1d7f31012767b9a14", "size": "1...
"""A lexical analyzer class for simple shell-like syntaxes.""" # Module and documentation by Eric S. Raymond, 21 Dec 1998 # Input stacking and error message cleanup added by ESR, March 2000 # push_source() and pop_source() made explicit by ESR, January 2001. # Posix compliance, split(), string arguments, and # iterato...
{ "content_hash": "90cc7a13bc932bfc7174b4636829cc90", "timestamp": "", "source": "github", "line_count": 303, "max_line_length": 76, "avg_line_length": 37.48844884488449, "alnum_prop": 0.4921207852803944, "repo_name": "MalloyPower/parsing-python", "id": "f08391800b14f62dfeae12ff721ad4ba1b418d52", "s...
import logging class NewStyleLogMessage(object): def __init__(self, message, *args, **kwargs): self.message = message self.args = args self.kwargs = kwargs def __str__(self): args = (i() if callable(i) else i for i in self.args) kwargs = dict((k, v() if ...
{ "content_hash": "52c22ef357b66e801d4e924cef56c3d0", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 75, "avg_line_length": 30.914285714285715, "alnum_prop": 0.5730129390018485, "repo_name": "poffey21/edge", "id": "3b954ed7ab1cd61b6a34e7b648f1501a181848cb", "size": "1818",...
from django.utils.translation import ugettext_lazy as _ import horizon class NGVolumes(horizon.Panel): name = _("Volumes") slug = 'ngvolumes' permissions = ('openstack.services.volume',)
{ "content_hash": "37af6c9b3bb10737169b604ccd8b262a", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 55, "avg_line_length": 22.444444444444443, "alnum_prop": 0.7079207920792079, "repo_name": "wolverineav/horizon", "id": "1ab2c7619b43f7c1b6a75326e3483af03522784d", "size": "7...
from __future__ import division, print_function, unicode_literals import os from django.core.wsgi import get_wsgi_application from whitenoise.django import DjangoWhiteNoise PROJECT_NAME = os.path.dirname(os.path.abspath(__file__)).split('/')[-1] os.environ.setdefault('DJANGO_SETTINGS_MODULE', '{}.settings'.format(PR...
{ "content_hash": "41970580d0a968e457e4bbb6d8e37364", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 83, "avg_line_length": 34.583333333333336, "alnum_prop": 0.7759036144578313, "repo_name": "theeluwin/mashiro", "id": "1c5739ade96482213b6b81796f72f710a289525a", "size": "44...
from __future__ import print_function, absolute_import, division, unicode_literals # TEST_UNICODE_LITERALS import pytest import os from astropy.table import Table from frb.frbcat import FRBCat #def data_path(filename): # data_dir = os.path.join(os.path.dirname(__file__), 'files') # return os.path.join(data_d...
{ "content_hash": "9a3623bf0f8f60f2e35010b6ca25f57a", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 82, "avg_line_length": 27.08, "alnum_prop": 0.7060561299852289, "repo_name": "FRBs/FRB", "id": "69921d24077d7f99e9d58ccfeb38b9c55bf926c7", "size": "723", "binary": false,...
from __future__ import division import time import numpy as np import tensorflow as tf from neupy import layers from neupy.core.properties import ( FunctionWithOptionsProperty, ScalarVariableProperty, IntProperty, Property, ) from neupy.utils import ( AttributeKeyDict, format_data, as_tuple, iter...
{ "content_hash": "2237582d32fec7b020ddfd0741d8aee0", "timestamp": "", "source": "github", "line_count": 419, "max_line_length": 76, "avg_line_length": 29.599045346062052, "alnum_prop": 0.5748266408643767, "repo_name": "itdxer/neupy", "id": "ac1f1315d85faca876a8cb810a4a5356e8c680c8", "size": "12402"...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('cfp', '0020_auto_20180507_1305'), ] operations = [ migrations.AddField( model_name='paperapplication', name='grant_email_contact', field=models.BooleanFi...
{ "content_hash": "970084b7b519bff0d99f9e2960e826e3", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 309, "avg_line_length": 36.388888888888886, "alnum_prop": 0.5946564885496183, "repo_name": "WebCampZg/conference-web", "id": "371314138b32edba4ef4aa3a41edb03706672604", "si...
from approver.models.models import * from approver.models.approve_models import * from approver.models.audit_trail_models import AuditTrail from approver.models.bridge_models import Registerable
{ "content_hash": "4ba16c04b73a4426ab5731a5ca76ee03", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 57, "avg_line_length": 48.75, "alnum_prop": 0.8461538461538461, "repo_name": "amberlallen/qipr_approver", "id": "9672ae1cb5bd2e3edfc1b65627ec9daaaa35d34c", "size": "195", ...
import os import sys sys.path.append('..') if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "demo.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "20659f9e77c071fc056f93aec6abdd52", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 68, "avg_line_length": 22.545454545454547, "alnum_prop": 0.6935483870967742, "repo_name": "Alkemic/yaACL", "id": "c2de76d7d1c39ad5ac9708a482fa6b71f3c3e5b2", "size": "270", ...
from horizon import exceptions from horizon import forms from horizon import workflows from openstack_dashboard.api import nova from openstack_dashboard.dashboards.project.data_processing.utils \ import neutron_support import openstack_dashboard.dashboards.project.data_processing.utils. \ workflow_helpers as ...
{ "content_hash": "02b3a22aec097f06b02d5285f667f497", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 79, "avg_line_length": 37.14107883817427, "alnum_prop": 0.6021673556027259, "repo_name": "blueboxgroup/horizon", "id": "e680c945dbbacef201e4fc4fdf541cb1f01c3610", "size": ...
import os import pytest import capnp this_dir = os.path.dirname(__file__) # flake8: noqa: E501 @pytest.fixture def capability(): capnp.cleanup_global_schema_parser() return capnp.load(os.path.join(this_dir, 'test_capability.capnp')) class Server: def __init__(self, val=1): self.val = val d...
{ "content_hash": "7117ba1c17470761b4414118a2e2b0ee", "timestamp": "", "source": "github", "line_count": 269, "max_line_length": 430, "avg_line_length": 31.390334572490705, "alnum_prop": 0.6856939838938891, "repo_name": "SymbiFlow/pycapnp", "id": "e4d6fb6d5752cfd25be2e94b4e79e3dc4e487b89", "size": "...
from django.contrib import admin from .models import Escuela, Colegiatura admin.site.register(Escuela) admin.site.register(Colegiatura)
{ "content_hash": "c3f67ea86a4ec2dd98929c20693bb9e3", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 40, "avg_line_length": 27.4, "alnum_prop": 0.8321167883211679, "repo_name": "erikiado/jp2_online", "id": "a3084327b1117b955da7544ac4d2f2a437799785", "size": "137", "binary...
''' Created on May 30, 2015 @author: isdal ''' import ConfigParser import logging import time from discretepid import PID from fancontroller.filters import MedianFilter from fancontroller.fan_gpio import FanGpio from math import ceil import urllib import httplib import os import sys import requests import json STATE_...
{ "content_hash": "a7472d13486c359df6db9e207c8fdbd6", "timestamp": "", "source": "github", "line_count": 267, "max_line_length": 113, "avg_line_length": 35.30337078651685, "alnum_prop": 0.5664120517716953, "repo_name": "isdal/raspberrypi-fan-controller", "id": "f223aff26cd68a446eba7b336215ad94cf2d4284...