text
stringlengths
4
1.02M
meta
dict
import os import sys import unittest DIR = os.path.dirname(os.path.abspath(__file__)) sys.path[0] = os.path.dirname(DIR) from yorbay.builder import build_from_standalone_source from yorbay.compiler import ErrorWithSource from yorbay.globals import Global from yorbay.debug.stacktrace import get_stack class DummyGlo...
{ "content_hash": "66874d0bc179c07e64eb4896186a5f05", "timestamp": "", "source": "github", "line_count": 156, "max_line_length": 95, "avg_line_length": 33.717948717948715, "alnum_prop": 0.5889733840304182, "repo_name": "rusek/yorbay-python", "id": "d44732a18f2dee95ba21ff169c080187fb2dd085", "size": ...
import re from unidecode import unidecode import numpy as np """ Functions to read in the files from the GermEval contest, create suitable numpy matrices for train/dev/test @author: Nils Reimers """ def readFile(filepath): sentences = [] sentence = [] for line in open(filepath): line = lin...
{ "content_hash": "c4309879a2e18905731042235fb6e416", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 106, "avg_line_length": 32.0625, "alnum_prop": 0.5736563631300473, "repo_name": "UKPLab/deeplearning4nlp-tutorial", "id": "78905cfec6245ef9bf4899a418aebd9b29108213", "size...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: lambda_event short_description: Creates, updates or deletes...
{ "content_hash": "c703877dd694ca939bb8c323c224fa2e", "timestamp": "", "source": "github", "line_count": 420, "max_line_length": 134, "avg_line_length": 34.226190476190474, "alnum_prop": 0.6074434782608695, "repo_name": "e-gob/plataforma-kioscos-autoatencion", "id": "f7298cb548fa7c1de09bf4bf092c51b5d8...
""" mbed CMSIS-DAP debugger Copyright (c) 2006-2013 ARM Limited 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 ...
{ "content_hash": "97cb3a224e13577ee373ee7c051e648f", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 121, "avg_line_length": 33.857142857142854, "alnum_prop": 0.7097046413502109, "repo_name": "geky/pyOCD", "id": "181fa67acf07f408a75fca51f0e9dfb7b455b871", "size": "1185", ...
from unittest import TestCase from mock import Mock from chatterbot.conversation import Statement from chatterbot.input import gitter from chatterbot.input import Gitter class MockResponse(object): def __init__(self, status_code, data): self.status_code = status_code self.data = data def jso...
{ "content_hash": "5287b1b11daa5483b206ea13b4bf4b5d", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 111, "avg_line_length": 30.830645161290324, "alnum_prop": 0.6311797018048653, "repo_name": "sahararaju/dataasservices", "id": "fe1489877d6d0f07f8ddab0a3d72aeefcdfbfa70", "...
""" Enthought pyface package component """ # Major package imports. import wx # Enthought library imports. from traits.api import HasTraits, provides # Local imports. from pyface.i_image_cache import IImageCache, MImageCache @provides(IImageCache) class ImageCache(MImageCache, HasTraits): """ The toolkit speci...
{ "content_hash": "248bbe56f44032275ed421fe6ba8bc8f", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 84, "avg_line_length": 29.95, "alnum_prop": 0.4941569282136895, "repo_name": "brett-patterson/pyface", "id": "49d50cf526927bfe05ccd2256c8f5e602d4a64b7", "size": "2999", "...
from django.contrib.auth import get_user_model User = get_user_model() class UserPersistor(object): @staticmethod def create_user(vid, email, username, first_name=None, last_name=None): user = User() user.email = email user.username = username user.first_name = fi...
{ "content_hash": "dba8520308c51c1260df4ee3924c2a2c", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 81, "avg_line_length": 28.17391304347826, "alnum_prop": 0.6095679012345679, "repo_name": "visipedia/django-visipedia", "id": "5bf27ca552a43c2496db76f6927906d616356b35", "si...
from taiga.requestmaker import RequestMaker from taiga.models import WikiLink, WikiLinks import unittest from mock import patch class TestWikiLinks(unittest.TestCase): @patch('taiga.models.base.ListResource._new_resource') def test_create_wikilink(self, mock_new_resource): rm = RequestMaker('/api/v1'...
{ "content_hash": "db2a58553da09f160567e6122735fa29", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 87, "avg_line_length": 43.44444444444444, "alnum_prop": 0.5677749360613811, "repo_name": "mlq/python-taiga", "id": "c8f91b6516c51ecc3fc9fca6ce4d47d9be4fe616", "size": "1173...
""" WSGI config for djtest project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTIN...
{ "content_hash": "ea347d5e85d4a3080a0e88fcac582a10", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 24.3125, "alnum_prop": 0.7686375321336761, "repo_name": "Elemnir/presentations", "id": "cbe40b6d69fa1dcdfa294f873895a83a7f55f7b8", "size": "389", "...
"""The tests for the Tasmota cover platform.""" import copy import json from unittest.mock import patch from hatasmota.utils import ( get_topic_stat_result, get_topic_stat_status, get_topic_tele_sensor, get_topic_tele_will, ) import pytest from homeassistant.components import cover from homeassistant....
{ "content_hash": "c4ee4e7db141b532c2894be2a3ced8f3", "timestamp": "", "source": "github", "line_count": 762, "max_line_length": 88, "avg_line_length": 33.25984251968504, "alnum_prop": 0.6317471590909091, "repo_name": "mezz64/home-assistant", "id": "06471e1175768574d1fb8bc41309c1113a66444a", "size":...
''' Created on 12/23/2015 @Ronak Shah ''' from collections import defaultdict import pandas as pd import logging import coloredlogs # Gives elements at particular index in list getVar = lambda searchList, ind: [searchList[i] for i in ind] coloredlogs.install(level='DEBUG') def ReadRepeatFile(filename, verbose): i...
{ "content_hash": "d4c260976bf35e890f2ca9a5f4696d66", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 126, "avg_line_length": 39.61194029850746, "alnum_prop": 0.6096458176337604, "repo_name": "rhshah/iAnnotateSV", "id": "7dd0a14e3fb3f625d70f2bc7262e5c622a210323", "size": "2...
import sys import getpass from boliau import cmdlib from boliau.plugins.gspread import actionlib def do_insert(): cmd = cmdlib.as_command(actionlib.Upsert(), require_stdin=True) cmd.add_argument('spreadsheet', help="spreadsheet name.") cmd.add_argument('--email', help = "us...
{ "content_hash": "d86519a136fc9697b62d3de41ea3dcf3", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 77, "avg_line_length": 34.46666666666667, "alnum_prop": 0.6634429400386848, "repo_name": "hychen/boliau", "id": "f7351859a92efdb3f574e5bd14e14d145e99a4c7", "size": "517", ...
from sqlalchemy import and_ from sqlalchemy import delete from sqlalchemy import exc from sqlalchemy import exists from sqlalchemy import ForeignKey from sqlalchemy import Integer from sqlalchemy import or_ from sqlalchemy import select from sqlalchemy import String from sqlalchemy import testing from sqlalchemy.dialec...
{ "content_hash": "7492f203672bc91778e9c2fbb07e9fe2", "timestamp": "", "source": "github", "line_count": 379, "max_line_length": 79, "avg_line_length": 31.796833773087073, "alnum_prop": 0.5450170110364285, "repo_name": "sqlalchemy/sqlalchemy", "id": "5b7e5ebbe3a9ab082521b24bae8c781f9279ade8", "size"...
from .._abstract.abstract import BaseSecurityHandler, BaseAGSServer from ..security.security import AGSTokenSecurityHandler import json, types ######################################################################## class MobileServiceLayer(BaseAGSServer): """ Represents a single mobile service layer """ ...
{ "content_hash": "3b55a8a7e0f00797c274d1f608faff38", "timestamp": "", "source": "github", "line_count": 413, "max_line_length": 85, "avg_line_length": 37.191283292978206, "alnum_prop": 0.4329427083333333, "repo_name": "conklinbd/MovementAnalysis", "id": "278a602781af467466646b82fa93e7bea4b0e113", "...
from servee import frontendadmin from servee.frontendadmin.insert import ModelInsert from sample_image_insert.models import Image class ImageInsert(ModelInsert): model = Image frontendadmin.site.register_insert(ImageInsert)
{ "content_hash": "8bd1d0abb668878ebfb1d8e302bcd08e", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 51, "avg_line_length": 28.625, "alnum_prop": 0.8384279475982532, "repo_name": "servee/servee", "id": "2f6eb21dd333b32325f26abb8a9fb7045b605634", "size": "229", "binary": f...
from typing import Optional from functools import partial from ConfigSpace import NotEqualsCondition from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, UniformFloatHyperparameter, ) from autosklearn.askl_typing import FEAT_TYPE_...
{ "content_hash": "0c78b486e321b40dc86b567382d0993a", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 86, "avg_line_length": 33.986666666666665, "alnum_prop": 0.5961161239701844, "repo_name": "automl/auto-sklearn", "id": "3a728d753ec21d45e7105c41dbbf63cf2808e611", "size": ...
import atexit from collections import deque from functools import partial import logging import os import socket import sys from threading import Lock, Thread import time import weakref from six.moves import range try: from weakref import WeakSet except ImportError: from cassandra.util import WeakSet # noqa ...
{ "content_hash": "473be404c39d03bc99f352f87eb4c2cb", "timestamp": "", "source": "github", "line_count": 392, "max_line_length": 131, "avg_line_length": 29.45408163265306, "alnum_prop": 0.5788151740862636, "repo_name": "Ahmad31/Web_Flask_Cassandra", "id": "9fd0d15a4ec72273933e155d66c14cf4adcd34be", ...
import luigi import logging import numpy as np from concurrent import futures import os import vigra from pipelineParameter import PipelineParameter from multicutProblemTasks import MulticutProblem from blockwiseMulticutTasks import BlockwiseMulticutSolver from nifty_helper import nifty_lmc_objective, run_nifty_lmc, n...
{ "content_hash": "9aaf7e0e70f7b08ed0f04b49a1e195cf", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 112, "avg_line_length": 30.387254901960784, "alnum_prop": 0.6363929666075173, "repo_name": "constantinpape/mc_luigi", "id": "24a3e46473949e8fc79b997578d5971df8c80ffe", "si...
""" WSGI config for pyment project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` s...
{ "content_hash": "033bb065a65d11553f56a232ee8887a1", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 79, "avg_line_length": 39.13793103448276, "alnum_prop": 0.7991189427312775, "repo_name": "mathuin/pyment", "id": "528ab72773d57477ab5d366311608100f1f5c9af", "size": "1135",...
from .candlefactory import CandleFactory, granularity_to_time from .streamrecord import *
{ "content_hash": "0ea3a2b3b00caefc11d73328501667c8", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 61, "avg_line_length": 45, "alnum_prop": 0.8333333333333334, "repo_name": "hootnot/oanda-trading-environment", "id": "11bbb9c57aede0f1ba3a39f7028eca40cf96f71f", "size": "91"...
from car import Car from belief import BeliefDriveItEnv from DeepQNetwork import * from argparse import ArgumentParser from explorer import ExpEpsilonAnnealingExplorer if __name__ == '__main__': parser = ArgumentParser() parser.add_argument('-g', '--gamma', default=0.99, type=float, help='Reward discount facto...
{ "content_hash": "3f9ab20ac5d2c0a89a51800051115e2b", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 125, "avg_line_length": 37.46666666666667, "alnum_prop": 0.6577698695136418, "repo_name": "jcsharp/DriveIt", "id": "5e8bc942bd0d86f3a7ea7da8548df342285a67a6", "size": "1726...
import sys sys.path.append('/srv/newsblur') import os import datetime import requests import settings import socket def main(): t = os.popen('stat -c%Y /var/lib/redis/dump.rdb') timestamp = t.read().split('\n')[0] modified = datetime.datetime.fromtimestamp(int(timestamp)) ten_min_ago = datetime.dateti...
{ "content_hash": "373ac3706ed1b8f6de47cf9fb7650236", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 113, "avg_line_length": 40.064516129032256, "alnum_prop": 0.5909822866344605, "repo_name": "youprofit/NewsBlur", "id": "bf2b376f8c45191dfc4b99b076c52bdd09c9cbe5", "size": "...
import hou import IECore import IECoreHoudini import unittest import os import shutil class TestOpHolder( IECoreHoudini.TestCase ): def testOpHolder(self): obj = hou.node("/obj") geo = obj.createNode("geo", run_init_scripts=False) op = geo.createNode( "ieOpHolder" ) self.assert_( op ) fn = IECoreHoudini.Fn...
{ "content_hash": "bfd901a7ad749037fea33aa8b550dd5d", "timestamp": "", "source": "github", "line_count": 706, "max_line_length": 160, "avg_line_length": 44.259206798866856, "alnum_prop": 0.6996831695842801, "repo_name": "Alwnikrotikz/cortex-vfx", "id": "ca85c3984d9b757eda8ae43a5b8af17cb8dc16a5", "si...
"""A module providing information about the necessity of brackets""" from sympy import S from sympy.core.function import _coeff_isneg # Default precedence values for some basic types PRECEDENCE = { "Lambda":1, "Relational":20, "Or":20, "And":30, "Add":40, "Mul":50, "Pow":60, "Not":100,...
{ "content_hash": "1d1236c3c80fe4adb66bb91ba40c3406", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 79, "avg_line_length": 26.258823529411764, "alnum_prop": 0.6420250896057348, "repo_name": "flacjacket/sympy", "id": "214136ed262b6bfde3df51d61087b9784f07e391", "size": "223...
import contextlib import os import re import socket import subprocess import time from collections import OrderedDict from tempfile import NamedTemporaryFile, TemporaryDirectory from typing import Any, Dict, List, Optional, Union import pandas import unicodecsv as csv from airflow.configuration import conf from airfl...
{ "content_hash": "3baffedd8a836c0e570b57bb67614ebd", "timestamp": "", "source": "github", "line_count": 1047, "max_line_length": 107, "avg_line_length": 39.080229226361034, "alnum_prop": 0.56306669599433, "repo_name": "apache/incubator-airflow", "id": "ce2e4d9eaa998ec1c46d3bd281658ae0a9be4843", "si...
__author__ = "Rick Sherman, Nitin Kumar" __credits__ = "Jeremy Schulman" import unittest from nose.plugins.attrib import attr from mock import MagicMock, patch, mock_open import os from lxml import etree from ncclient.manager import Manager, make_device_handler from ncclient.transport import SSHSession imp...
{ "content_hash": "bc36f1d196621d88b6e0d7634be98935", "timestamp": "", "source": "github", "line_count": 412, "max_line_length": 167, "avg_line_length": 40.19174757281554, "alnum_prop": 0.5877166495561326, "repo_name": "dgjnpr/py-junos-eznc", "id": "7837474bab16c41fd19daa7c4028c616035164c4", "size":...
"""test the IPython Kernel""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import io import os.path import sys import nose.tools as nt from IPython.testing import decorators as dec, tools as tt from IPython.utils import py3compat from IPython.utils.path import...
{ "content_hash": "2947b79308dd4c09d9e021ae0725b98c", "timestamp": "", "source": "github", "line_count": 227, "max_line_length": 92, "avg_line_length": 35.74008810572687, "alnum_prop": 0.585480093676815, "repo_name": "martydill/url_shortener", "id": "2849da552732e2b957a99a27ef9532f8b77178a0", "size"...
from django.conf.urls.defaults import * # Shop urlpatterns = patterns('lfs.utils.views', (r'^/test$', "test"), (r'^/upload-test$', "upload_test"), (r'^/import-easyshop$', "import_easyshop"), (r'^/update-products-from-es$', "update_products_from_es"), (r'^/update-product-images-from-es$', "update_im...
{ "content_hash": "f8d8708905782e64d21775be53cb06e0", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 69, "avg_line_length": 37.09090909090909, "alnum_prop": 0.6348039215686274, "repo_name": "baffolobill/django-lfs", "id": "8ccdb1dea30611fb50d06fa51445d7701e09fed1", "size":...
import _plotly_utils.basevalidators class MetaValidator(_plotly_utils.basevalidators.AnyValidator): def __init__(self, plotly_name="meta", parent_name="candlestick", **kwargs): super(MetaValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, array_...
{ "content_hash": "b62a5184bd7ea396a0d529136a6910db", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 80, "avg_line_length": 37.23076923076923, "alnum_prop": 0.5929752066115702, "repo_name": "plotly/python-api", "id": "5489a00f76e2ba8426f4a1fee03ee5ba6797789e", "size": "484...
from django.core.urlresolvers import resolve, reverse from django.db import models from django.utils.translation import ugettext_lazy as _ from mezzanine.conf import settings from mezzanine.core.models import Displayable, Orderable, RichText from mezzanine.pages.fields import MenusField from mezzanine.pages.managers i...
{ "content_hash": "2f933d85d3a4cc1df4ee173dda3c1f08", "timestamp": "", "source": "github", "line_count": 278, "max_line_length": 79, "avg_line_length": 36.2589928057554, "alnum_prop": 0.5822420634920635, "repo_name": "wrwrwr/mezzanine", "id": "dee0d1e81f777a7f29efae4cc63438a336f78a2f", "size": "1008...
""" svn vcs support. """ from __future__ import absolute_import, print_function, unicode_literals import os import sys import tarfile import dateutil.parser # For parsing date strings import xml.dom.minidom # For parsing logfiles from vcstools.vcs_base import VcsClientBase, VcsError from vcstools.common import s...
{ "content_hash": "4f9d7f60b4a39b7f7bdb3978cd417cda", "timestamp": "", "source": "github", "line_count": 249, "max_line_length": 105, "avg_line_length": 38.626506024096386, "alnum_prop": 0.5140361821584529, "repo_name": "k-okada/vcstools", "id": "a2731a810c903c0c6b921b621daa6535668186fd", "size": "1...
class BaseAction(object): """ The base class for an action. This should be subclassed for every new Action created. At a minimum, every action should have a name, a unique action_id (e.g. my_action) and a function `execute` that accepts an EmailReport and options. Each Action can specify a diction...
{ "content_hash": "43c133ef7fa5b6d073f0bb68a5dafbd8", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 92, "avg_line_length": 36.714285714285715, "alnum_prop": 0.6336853807670928, "repo_name": "duo-labs/isthislegit", "id": "40a773285dbd9fd0fb3eca9e1bbe182f3a6024c0", "size": ...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'List' db.create_table(u'simplelist_list', ( (u'id', self.gf('django.d...
{ "content_hash": "fd84a07665a35e7ef8516833c749d826", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 110, "avg_line_length": 44.75925925925926, "alnum_prop": 0.5825403392635499, "repo_name": "ransage/hatch", "id": "7c7f7fd257ef3f1a7a655a5051065174557fb0c5", "size": "2441",...
import os import re from setuptools import setup, find_packages, Command readme = open('README.rst').read() history = open('HISTORY.rst').read().replace('.. :changelog:', '') def read_reqs(name): with open(os.path.join(os.path.dirname(__file__), name)) as f: return [line for line in f.read().split('\n') ...
{ "content_hash": "67372b21a55179f436aeee6cb2543cb7", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 163, "avg_line_length": 31.510204081632654, "alnum_prop": 0.5948834196891192, "repo_name": "TriOptima/tri.named_struct", "id": "9ec53bf980bb3dbee93b96269559a69ce6210b5f", "...
import re from setuptools import setup try: # Distributions have to delete *requirements.txt with open('requirements.txt', 'r') as fp: install_requires = [re.split(r'[<>=]', line)[0] for line in fp if line.strip()] except EnvironmentError: print("No requirements.txt, n...
{ "content_hash": "80b8539da6cce8c23bf1e23843723871", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 93, "avg_line_length": 33.91836734693877, "alnum_prop": 0.6197352587244284, "repo_name": "OpenDaisy/daisy-discoverd", "id": "b91359d4e22cdd92a85d8b26f260f91f2471b3fe", "siz...
import binascii import json import logging from abc import ABCMeta, abstractmethod from copy import deepcopy from datetime import date, datetime, time from decimal import Decimal from distutils.util import strtobool from typing import Any, Callable, Dict, Optional, Type _logger = logging.getLogger(__name__) # type: i...
{ "content_hash": "e68100c892daf5e6f301a9f90046d2e2", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 92, "avg_line_length": 28.664383561643834, "alnum_prop": 0.629868578255675, "repo_name": "laughingman7743/PyAthena", "id": "8d88b619dde0c97b7a7d9670090702ecef1d9515", "siz...
"""The Versioneer - like a rocketeer, but for versions. The Versioneer ============== * like a rocketeer, but for versions! * https://github.com/warner/python-versioneer * Brian Warner * License: Public Domain * Compatible With: python2.6, 2.7, 3.2, 3.3, 3.4, 3.5, 3.6, and pypy * [![Latest Version] (https://pypip.in/...
{ "content_hash": "ed24763f3f0b264b26c0b20aa675e2da", "timestamp": "", "source": "github", "line_count": 1879, "max_line_length": 88, "avg_line_length": 36.502927088877065, "alnum_prop": 0.6122410299027541, "repo_name": "jhamman/xray", "id": "7b55d5d06cb0ab563ad94eee8fa39192843831f3", "size": "68622...
"""Tests for qhbmlib.inference.vqt_loss""" import functools import cirq import sympy import tensorflow as tf import tensorflow_quantum as tfq from qhbmlib import inference from qhbmlib import models from tests import test_util class VQTTest(tf.test.TestCase): """Tests for VQT.""" def setUp(self): """Initi...
{ "content_hash": "36f93ad4faf78ecda93dd3c039b27720", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 89, "avg_line_length": 39.88775510204081, "alnum_prop": 0.6506779227423893, "repo_name": "google/qhbm-library", "id": "3b95ae6c24ac8420022ec3acc2d1af8b518d7c34", "size": "...
import _plotly_utils.basevalidators class OpacityValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="opacity", parent_name="bar.unselected.marker", **kwargs ): super(OpacityValidator, self).__init__( plotly_name=plotly_name, parent_...
{ "content_hash": "bdfd9226908b7283675237ae59025525", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 82, "avg_line_length": 34.1875, "alnum_prop": 0.5740402193784278, "repo_name": "plotly/python-api", "id": "5fe2476f48e212ae0989837a5b379b4feab29054", "size": "547", "bina...
"""Module for the DocRef cog.""" import asyncio import os import pathlib import re import tempfile import urllib.parse from typing import Dict, Iterator, List, Match, Optional, Tuple, cast import aiohttp import discord import sphinx.util.inventory as sphinx_inv from redbot.core import Config, checks, commands, data_ma...
{ "content_hash": "68acfa32e87c27c0084ecf8e35ebc45e", "timestamp": "", "source": "github", "line_count": 747, "max_line_length": 88, "avg_line_length": 32.57429718875502, "alnum_prop": 0.5570624255126783, "repo_name": "Tobotimus/Tobo-Cogs", "id": "68c262ac27ae61c740657c0dd0c4d567e642857d", "size": "...
""" Copyright (c) 2016 Keith Sterling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute,...
{ "content_hash": "1e7aab949e78d9b6693cd118fa517b78", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 157, "avg_line_length": 31.201438848920862, "alnum_prop": 0.6241641687802628, "repo_name": "dkamotsky/program-y", "id": "20e630a9deac617f91d83632772b0494bcc19387", "size":...
import functools import operator from nova import block_device from nova.i18n import _ from nova.i18n import _LI from nova import objects from nova.objects import base as obj_base from nova.openstack.common import excutils from nova.openstack.common import jsonutils from nova.openstack.common import log as logging fro...
{ "content_hash": "cbd662cbd0ab8d390ea5e23380a922b8", "timestamp": "", "source": "github", "line_count": 454, "max_line_length": 79, "avg_line_length": 35.56167400881057, "alnum_prop": 0.5822855373180551, "repo_name": "srajag/nova", "id": "1f8adbe0e6a555ae0880ebad456a879482e4fd8d", "size": "16743", ...
''' validators.py simple validation and cleaning of model data structures Copyright (c) 2017 Vanessa Sochat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without ...
{ "content_hash": "3f82398122130312da8ec40e757fb3eb", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 80, "avg_line_length": 40.23076923076923, "alnum_prop": 0.7431485022307202, "repo_name": "radinformatics/som-tools", "id": "4e95e9ad193100ae8d61910c6b7b438a957a8855", "size...
from django.db import connection from django.http import HttpResponseRedirect from django.shortcuts import redirect from django.shortcuts import render from django.views.generic import FormView def load_template(request, template_name, extra_context=None): if not extra_context: extra_context = dict() return r...
{ "content_hash": "b2d3e0a8cfe5e128a7d95d5d43a178b3", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 97, "avg_line_length": 33.699029126213595, "alnum_prop": 0.6191299337366754, "repo_name": "TimothyBest/Django_Boilerplate", "id": "8e0c1c69cbcd2a7a05a13603df452974b7f36bc6",...
import sys import os import unittest import logging # Extend PYTHONPATH with local 'lib' folder if __name__ == "__main__": jasyroot = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), os.pardir, os.pardir, os.pardir, os.pardir)) sys.path.insert(0, jasyroot) print("Running from %s..." % jasyroot) ...
{ "content_hash": "f78f620f04e6722ccc1a5765c6ae69b2", "timestamp": "", "source": "github", "line_count": 285, "max_line_length": 124, "avg_line_length": 26.53684210526316, "alnum_prop": 0.43012032262329764, "repo_name": "sebastian-software/jasy", "id": "c1a27805fa220aa4654b5cea6ec29eebb1e4c455", "si...
import importlib import os import sys import warnings from setuptools import setup if sys.version_info[0:2] < (3, 6): warnings.warn('This package is tested with Python version 3.6+') root_path = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(root_path, 'README.rst')) as readme: README = r...
{ "content_hash": "d68d4e1eda5a91f23227f269601493d6", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 105, "avg_line_length": 32.96551724137931, "alnum_prop": 0.6276150627615062, "repo_name": "ministryofjustice/django-moj-irat", "id": "b861d5872c80e5573eb3ec5fd661a736ed2ee70f...
"""A library for cross-platform browser tests.""" import os import sys try: # This enables much better stack upon native code crashes. import faulthandler faulthandler.enable() except ImportError: pass # Ensure Python >= 2.7. if sys.version_info < (2, 7): print >> sys.stderr, 'Need Python 2.7 or greater.' ...
{ "content_hash": "dd2b356880cdb5654f1e2d738d90f5a5", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 75, "avg_line_length": 35.17142857142857, "alnum_prop": 0.7546709991876523, "repo_name": "endlessm/chromium-browser", "id": "ff7225b79561a2f5618820dbff6cde7146c9390e", "siz...
''' Copyright [2020] [Anoop Bhat] 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 di...
{ "content_hash": "7f1c9588c6bf3999b0d258fecb0e7340", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 72, "avg_line_length": 27.86111111111111, "alnum_prop": 0.6819541375872383, "repo_name": "amanmehara/programming-app-data", "id": "a52c8cec171feae0eafd331bd5c5ae059af659c6", ...
from horizon.test import helpers as test class CoursesTests(test.TestCase): # Unit tests for courses. def test_me(self): self.assertTrue(1 + 1 == 2)
{ "content_hash": "b836997724db3de127f67276a9946098", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 40, "avg_line_length": 23.857142857142858, "alnum_prop": 0.6706586826347305, "repo_name": "sikessle/htwg-lab-cloud", "id": "44def9390282bba55f372fbbf1bc6d82d517624b", "size"...
from migrate.changeset import UniqueConstraint from sqlalchemy import MetaData, Table def upgrade(migrate_engine): meta = MetaData(bind=migrate_engine) t = Table('chassis', meta, autoload=True) # NOTE: new name convention for UC uc = UniqueConstraint('uuid', table=t, name='uniq_chassis0uuid') uc....
{ "content_hash": "23884abae88bb4b401f130d001aee581", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 75, "avg_line_length": 29.2, "alnum_prop": 0.7374429223744292, "repo_name": "citrix-openstack-build/ironic", "id": "9d5d7c5423a977c59622c3f2d0827f021b8ba483", "size": "1083...
from oslo_config import cfg from nova.compute import api as compute_api from nova.tests.functional.api_sample_tests import test_servers from nova.tests.unit.image import fake CONF = cfg.CONF CONF.import_opt('osapi_compute_extension', 'nova.api.openstack.compute.legacy_v2.extensions') class PreserveE...
{ "content_hash": "5da2f5936e7d1f36f1ff9df69640b1af", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 78, "avg_line_length": 41.71875, "alnum_prop": 0.5838951310861423, "repo_name": "mmnelemane/nova", "id": "1b52f61828825ab23af6b922e29946c8ed430ce8", "size": "3272", "bina...
import torch import filters_bank_pytorch as filters_bank import scattering_pytorch as scattering def run_filter_bank(M, N, J): filters = filters_bank.filters_bank(M, N, J) d_save = {} # Save phi d_save["phi"] = {} for key in filters["phi"].keys(): val = filters["phi"][key] if isin...
{ "content_hash": "256a14ee2f82e217bf51363bddc3d13c", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 70, "avg_line_length": 25.361702127659573, "alnum_prop": 0.5562080536912751, "repo_name": "tdeboissiere/DeepLearningImplementations", "id": "2a32a8c54905afa08cfc80739673dd104...
import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy from .._version import VERSION if sys.version_info >= (3, 8): from typing i...
{ "content_hash": "8d7fc93b337e16b3d2f87eaec6b49119", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 107, "avg_line_length": 52.84615384615385, "alnum_prop": 0.7231441048034934, "repo_name": "Azure/azure-sdk-for-python", "id": "5528490fd773b26528745f93901e554cf2fc3eea", "s...
def makePalyerData(tokenId, name): playerData = { 'player token id' : tokenId, 'player game channel id' : -1, 'player name' : name, 'player id' : -1 } return playerData def setChannelId(playerData, channelId): playerData['player game channel id'] = channelId # game data 관련 함수들 def makeGameData(gameChann...
{ "content_hash": "c2efee5e7b164f1d74c6cf7ccb4ddb19", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 156, "avg_line_length": 31.028985507246375, "alnum_prop": 0.6445586174684726, "repo_name": "junggang/blackbags", "id": "b6e89eaebfab81393691c57a21c2c2e6bf3c7ac6", "size": ...
"""Installer for the ckm.sitetheme package.""" from setuptools import find_packages from setuptools import setup import os def read(*rnames): return open(os.path.join(os.path.dirname(__file__), *rnames)).read() long_description = read('README.rst') setup( name='ckm.sitetheme', version='1.0.0', des...
{ "content_hash": "f4901070ab1befb3796540948262a5b3", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 74, "avg_line_length": 25.571428571428573, "alnum_prop": 0.5667287399130975, "repo_name": "a25kk/ck", "id": "f7e2b51d8f5666aa32015644cc4458baef152c11", "size": "1635", "b...
import numpy as np from numpy import cross from numpy.linalg import norm from poliastro.core.thrust.change_a_inc import ( beta, compute_parameters, extra_quantities, ) def change_a_inc(k, a_0, a_f, inc_0, inc_f, f): """Guidance law from the Edelbaum/Kéchichian theory, optimal transfer between circula...
{ "content_hash": "2d23877f5968358cd91970bcc2f90acc", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 106, "avg_line_length": 26.949152542372882, "alnum_prop": 0.5679245283018868, "repo_name": "Juanlu001/poliastro", "id": "b13b564ca2d6ce3234f360c4d3af0c6359504b83", "size": ...
from setuptools import setup, find_packages setup(name='django-geonames', version=__import__('geonames').__version__, description='Fork of official GeoDjango geonames application refactored and adopted for Django 1.2.1', author='Justin Bronn', author_email='[email protected]', url='htt...
{ "content_hash": "eda096a1020e41958554fd6ad8a8176b", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 108, "avg_line_length": 33.53333333333333, "alnum_prop": 0.6441351888667992, "repo_name": "ramusus/django-geonames", "id": "17d8f5973496a60ccc5259aa66cfbb82218f6c8f", "size...
import json import logging import operator from environment_wrappers import CreateUrlFetcher import url_constants class ChannelInfo(object): '''Represents a Chrome channel with three pieces of information. |channel| is one of 'stable', 'beta', 'dev', or 'master'. |branch| and |version| correspond with each oth...
{ "content_hash": "69ffe1b6c6b14621af2de1aedac49d4d", "timestamp": "", "source": "github", "line_count": 232, "max_line_length": 80, "avg_line_length": 35.71551724137931, "alnum_prop": 0.662925416364953, "repo_name": "ltilve/ChromiumGStreamerBackend", "id": "955cfbb6b8abd1f50301fcf1502e78b75cfe21f3", ...
from django.utils.translation import ugettext_lazy as _ from horizon import tabs class NetworkProfileTab(tabs.Tab): name = _("Network Profile") slug = "network_profile" template_name = 'router/nexus1000v/network_profile/index.html' def get_context_data(self, request): return None class Pol...
{ "content_hash": "4029253c86f9f856795e99f9161f52b6", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 66, "avg_line_length": 24.833333333333332, "alnum_prop": 0.7063758389261745, "repo_name": "JioCloud/horizon", "id": "d3d36900072f4b77168b59f5db3c4ed221f2b6d4", "size": "127...
from lastuserapp import db import lastuser_core.models as models from .test_db import TestDatabaseFixture class TestClient(TestDatabaseFixture): def setUp(self): super(TestClient, self).setUp() self.user = models.User.query.filter_by(username=u"user1").first() class TestUserClientPermissions(Tes...
{ "content_hash": "d4f8e14a9128d279838e491979996717", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 135, "avg_line_length": 41.51, "alnum_prop": 0.6824861479161648, "repo_name": "sindhus/lastuser", "id": "d6867d26226f1afd3fa0a56ea3f5d86f1cbbe0df", "size": "4176", "bina...
import json import cPickle as pickle from bubbly.model import Model, ModelGroup from bubbly.extractors import MultiViewExtractor, ManyManyExtractors from bubbly.dr1 import WideLocationGenerator from bubbly.wiserf import WiseRF def make_model(mod3): params = {'max_features': 'auto', 'min_samples_spl...
{ "content_hash": "ea0c290499a04f4f09367822061f4833", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 68, "avg_line_length": 26.428571428571427, "alnum_prop": 0.6367567567567568, "repo_name": "ChrisBeaumont/brut", "id": "7d4a647654cea0e1eceaaa55bb138f68a8431d79", "size": "9...
class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: def lowestCommonAncestor(self, root: 'TreeNode', p: 'TreeNode', q: 'TreeNode') -> 'TreeNode': while root: if root.val < p.val and root.val < q.val: ...
{ "content_hash": "da0abef95ddf4413ab6409b66e1719bb", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 97, "avg_line_length": 30.4375, "alnum_prop": 0.5030800821355236, "repo_name": "jiadaizhao/LeetCode", "id": "d694595f14442339fe6f350f282cb418c34e930a", "size": "524", "bi...
from __future__ import absolute_import import click from jinja2.exceptions import UndefinedError from djay.application import get_current_application class GenerateCommand(click.MultiCommand): @property def application(self): if not hasattr(self, "_application"): self._application = get_cu...
{ "content_hash": "4946560b27c6a6aad775c878c3be744d", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 80, "avg_line_length": 32, "alnum_prop": 0.6067708333333334, "repo_name": "aleontiev/dj", "id": "eab79ad4c681a946a70687b9775e04b1b7bd4566", "size": "1920", "binary": fals...
import cx_Oracle from django.db.backends.oracle.introspection import DatabaseIntrospection class OracleIntrospection(DatabaseIntrospection): # Associating any OBJECTVAR instances with GeometryField. Of course, # this won't work right on Oracle objects that aren't MDSYS.SDO_GEOMETRY, # but it is the only...
{ "content_hash": "09cda2b9f4c1cafc9de9fc4ef763a224", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 88, "avg_line_length": 40.02173913043478, "alnum_prop": 0.5714285714285714, "repo_name": "intgr/django", "id": "886441a9d0349115a0ef89f6ecf01c0dfaed7baf", "size": "1841", ...
import os import math import logging import sys logger = logging.getLogger(__name__) logger.debug('Logging in {0} started.'.format(__name__)) try: import dynamixel_functions as dynamixel logger.debug('Imported dynamixel_functions.') except Exception as e: logger.critical("Importing dynamixel_functions fai...
{ "content_hash": "2a8d01849b9ed84e3d7a7c3322510a9b", "timestamp": "", "source": "github", "line_count": 218, "max_line_length": 131, "avg_line_length": 41.10091743119266, "alnum_prop": 0.6332589285714286, "repo_name": "shorlee/felix", "id": "4a2fd6f27d92a97439e477654b2a7071b7592e03", "size": "9330"...
from listenclosely.services.base import BaseMessageServiceBackend import random import string class DummyMessageService(BaseMessageServiceBackend): def __init__(self, caller, *args, **kwargs): super(DummyMessageService, self).__init__(caller, *args, **kwargs) self.incoming_messages = [] ...
{ "content_hash": "f027c4a327f69bd08c08041aa4ed1b70", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 80, "avg_line_length": 30.862068965517242, "alnum_prop": 0.6435754189944134, "repo_name": "jlmadurga/listenclosely", "id": "2b5a5c73aaa5964506f137f6bfc1772c49fd7bb9", "size...
from optparse import make_option import sys from django.conf import settings from django.core.management.base import NoArgsCommand from django.core.management.color import no_style from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal from django.db import connections, router, trans...
{ "content_hash": "04e4bc98eabea8649588472212a04b6b", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 121, "avg_line_length": 50.58860759493671, "alnum_prop": 0.5536094082322032, "repo_name": "hunch/hunch-gift-app", "id": "5fa6e3f6fd8eb63630bcb8713ee38c49b0f44f38", "size":...
import numpy import time import ctypes from ..kdtree import kdtree from . import expr __all__ = [ 'Points', 'points', 'zeros', 'ones', 'empty', 'zeros_like', 'ones_like', 'empty_like', 'rand', 'load' ] class Final(type): # copied from https://stackoverflow.com/questions/16...
{ "content_hash": "384275feabd3e6d29beb077e34650dbb", "timestamp": "", "source": "github", "line_count": 263, "max_line_length": 77, "avg_line_length": 33.14448669201521, "alnum_prop": 0.5725593667546174, "repo_name": "heremaps/pptk", "id": "b40e4d117dd629c54f20ac9dc4a0fe9bd9cb7613", "size": "8717",...
"""This code example updates a creative wrapper to the 'OUTER' wrapping order. To determine which creative wrappers exist, run get_all_creative_wrappers.py. The LoadFromStorage method is pulling credentials and properties from a "googleads.yaml" file. By default, it looks for this file in your home directory. For mor...
{ "content_hash": "e7d44f8628ac21763297ea362201c065", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 78, "avg_line_length": 34.16393442622951, "alnum_prop": 0.685700575815739, "repo_name": "haveal/googleads-python-lib", "id": "177ef7462f4f028ddc6865ec84bf216df515deed", "si...
import pytest class TestClass(object): @pytest.fixture def something(self, request): return request.instance def test_method(self, something): assert something is self
{ "content_hash": "d6419236905734e951bc1bad0c4a1894", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 37, "avg_line_length": 19.9, "alnum_prop": 0.6834170854271356, "repo_name": "kawamon/hue", "id": "1004d5d1352ca00f839781cf25e52c4f661f3e59", "size": "223", "binary": fals...
from rospy import init_node, Subscriber, Publisher, get_param from rospy import Rate, is_shutdown, ROSInterruptException, spin, on_shutdown from barc.msg import ECU from numpy import pi import rospy import time motor_pwm = 1500 servo_pwm = 1600 def arduino_interface(): global ecu_pub, motor_pwm, servo_pwm in...
{ "content_hash": "752a722df3c6c08daed8b86ab9599257", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 99, "avg_line_length": 26.244897959183675, "alnum_prop": 0.5645412130637636, "repo_name": "MPC-Berkeley/barc", "id": "8d96866bab283280f7e8fe0a0074bde17b44bca4", "size": "22...
from cliff import show from gnocchiclient import utils class CliStatusShow(show.ShowOne): """Show the status of measurements processing.""" def take_action(self, parsed_args): status = utils.get_client(self).status.get() d = { "storage/total number of measures to process": ...
{ "content_hash": "bc975c7f0182806d07b4ea8124957108", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 69, "avg_line_length": 29.045454545454547, "alnum_prop": 0.6118935837245696, "repo_name": "gnocchixyz/python-gnocchiclient", "id": "95d569eccc91e231909f707ed2f2e2dc506c93b2",...
import subprocess import signal import sys import time import os from uart_bridge import UartBridge from threading import Thread from fake_xbee import FakeXbee include_path = os.path.dirname(os.path.realpath(__file__)) + "/../../src" sys.path.insert(0, include_path) from xbee_gateway import XBeeGateway from decoder im...
{ "content_hash": "0668fbd5b37b17e3087002c760268a96", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 73, "avg_line_length": 21.513513513513512, "alnum_prop": 0.7267587939698492, "repo_name": "scel-hawaii/data-gateway", "id": "b97b7868ad55be06bd5962a8c841b36a3d7dc9e0", "siz...
''' Examines log generated by ccid_ctid.test.py, returns 0 if valid, 1 if not. ''' # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses th...
{ "content_hash": "f47150e313c96dfabeb398a62b618ed6", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 75, "avg_line_length": 28.830188679245282, "alnum_prop": 0.6668848167539267, "repo_name": "clearswift/trafficserver", "id": "1b4cee5e885894d14be49a2d62f2541b2f0b4006", "siz...
import event_confirm # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
{ "content_hash": "5c422039370d643c01004e3fbfa6d3d5", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 65, "avg_line_length": 43.5, "alnum_prop": 0.8275862068965517, "repo_name": "diogocs1/comps", "id": "92e33960484f8b3f5e9ba21fba294898109e5129", "size": "1067", "binary": f...
import core.implant class EnumUsersJob(core.job.Job): def create(self): self.users = [] def report(self, handler, data, sanitize = False): user = data.decode() handler.reply(200) if user == "Complete": super(EnumUsersJob, self).report(handler, data, False) ...
{ "content_hash": "3a338874491c5c527df3dbb023ae417b", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 209, "avg_line_length": 29.01923076923077, "alnum_prop": 0.5931080185553347, "repo_name": "zerosum0x0/koadic", "id": "7981f9dbacec562f9a45197dff4523f0f17aa822", "size": "15...
"""TensorBoard Summary Writer for TensorFlow Eager Execution.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import uuid from tensorflow.contrib.summary import gen_summary_ops from tensorflow.python.eager import context from tensorflow.python.framework...
{ "content_hash": "1fdd66b189f9032ed6e5d5d93b47f466", "timestamp": "", "source": "github", "line_count": 230, "max_line_length": 80, "avg_line_length": 37.86086956521739, "alnum_prop": 0.6632981166743225, "repo_name": "mdrumond/tensorflow", "id": "39993558e33d9f88c9f642db2273fb81fd7be9e9", "size": "...
''' Created on Aug 10, 2009 @author: bud ''' import logging import logging.handlers import optparse import os import pwd import sys import atexit import signal import tornado import subprocess # # Init singleton object holding reloadable config values # Must be done in the very first place because some import might...
{ "content_hash": "523fda722cc24a18f1c6ee69f3fe6bcf", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 152, "avg_line_length": 39.16243654822335, "alnum_prop": 0.6785482825664291, "repo_name": "mikrosimage/OpenRenderManagement", "id": "4966bcf0e10c50512dea8f068d6cbac8bc4313e4...
from __future__ import absolute_import from rest_framework.response import Response from sentry.api.base import EnvironmentMixin from sentry.api.bases.organization import OrganizationEndpoint, OrganizationPermission from sentry.api.helpers.releases import get_group_ids_resolved_in_release from sentry.api.serializers ...
{ "content_hash": "00cb65e4b50a21ab7950aa8de2c36172", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 92, "avg_line_length": 38.875, "alnum_prop": 0.6630225080385852, "repo_name": "beeftornado/sentry", "id": "7f74116304eec45fe688f631c6b130b8a9c3dfb5", "size": "1555", "bin...
import sys from PyQt4 import QtCore, QtGui from addServerKey import Ui_addServerKey import ConfigParser import Tkinter, tkFileDialog import shutil import os class ServerKeyDialog(QtGui.QMainWindow): def setIconImage(self): app_icon = QtGui.QIcon() app_icon.addFile('images/cryptoknocker_resize.png',...
{ "content_hash": "23321857706e44224b9532f8825ca250", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 83, "avg_line_length": 37.666666666666664, "alnum_prop": 0.660275319567355, "repo_name": "bb111189/CryptoKnocker", "id": "31e5616c8a8cc5987a2ccf3cf65b134f822d7cec", "size":...
from __future__ import unicode_literals, absolute_import from django.core.urlresolvers import reverse from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import AbstractUser @python_2_unico...
{ "content_hash": "c9b0e3e8a8010feed74daf21fea99cd2", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 85, "avg_line_length": 35.76923076923077, "alnum_prop": 0.7322580645161291, "repo_name": "Uran198/med", "id": "6166ab1ea9c1c48582f372b8dac216f65cee0854", "size": "954", "...
import wx import armid import WidgetFactory class TaskPersonaDialog(wx.Dialog): def __init__(self,parent,setPersonas,currentEnvironmentName,dp,pName='',pDur='',pFreq='',pDem='',pGsup=''): wx.Dialog.__init__(self,parent,armid.TASKPERSONA_ID,'Add Task Persona',style=wx.DEFAULT_DIALOG_STYLE|wx.MAXIMIZE_BOX|wx.THICK...
{ "content_hash": "9e80450273320eca639b23c9f11c7e11", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 168, "avg_line_length": 47.848837209302324, "alnum_prop": 0.7287970838396112, "repo_name": "RobinQuetin/CAIRIS-web", "id": "1440aed4e87b3c9ef70fa871820d8d088ed17b25", "size...
from trove.datastore import models as datastore_models from trove.module import models class ModuleView(object): def __init__(self, module): self.module = module def data(self): module_dict = dict( id=self.module.id, name=self.module.name, type=self.module...
{ "content_hash": "8c3547c33d8b54683401a5584f86b995", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 76, "avg_line_length": 35.8, "alnum_prop": 0.6041899441340782, "repo_name": "zhangg/trove", "id": "20134a81674b5a16356040819774168ecec02c2a", "size": "4210", "binary": f...
import sys TOTAL_MONEY = 500 fruit_combos = set() fruit_combos.add( (0, ) ) fruit_menu = [] for line in sys.stdin: fruit_name, fruit_price = line.strip().split() fruit_menu.append( (int(fruit_price), fruit_name )) fruit_menu.sort() for fruit_price, fruit_name in fruit_menu: new_combos = set() for...
{ "content_hash": "122c6a49e56625675ebe6eec9f3289a9", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 66, "avg_line_length": 27.710526315789473, "alnum_prop": 0.5460588793922128, "repo_name": "fsufitch/dailyprogrammer", "id": "a0dabe29790a5b1a08568ac43b356c804fc66be7", "siz...
""" homeassistant.components.device_tracker.asuswrt ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Device tracker platform that supports scanning a ASUSWRT router for device presence. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/device_tracker.asuswrt...
{ "content_hash": "5631f5e14601b1dcfd10b032a5aefd39", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 79, "avg_line_length": 34.425925925925924, "alnum_prop": 0.5589026358257128, "repo_name": "nnic/home-assistant", "id": "d9b6d1a809e1448ea0899af03676daac5dde850e", "size": ...
from __future__ import unicode_literals import json from math import floor import sqlite3 import string try: from itertools import izip except ImportError: # Python 3 izip = zip import supybot.conf as conf import supybot.log as log import supybot.utils as utils from supybot.commands import * import supybot.pl...
{ "content_hash": "546c3bdc8c78cf7720da23671fc183c8", "timestamp": "", "source": "github", "line_count": 576, "max_line_length": 171, "avg_line_length": 45.095486111111114, "alnum_prop": 0.5332050048123196, "repo_name": "GLolol/Supybot-Weather", "id": "0d3213e51aa583fb4f9eecb1839aa5f2f5bf6cb6", "siz...
import pickle def store(obj, identifier): file_name = get_file_name(identifier) with open(file_name, 'w+') as handle: pickle.dump(obj, handle) def load(identifier): file_name = get_file_name(identifier) file = open(file_name,'r') obj = pickle.load(file) file.close() ...
{ "content_hash": "fc8f4368fefcc71aea4db94ba0dfbb4c", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 45, "avg_line_length": 20.894736842105264, "alnum_prop": 0.6221662468513854, "repo_name": "mohammadkrb/Fittak", "id": "3b0323311fdc8bd9655e7fb64815cc46e8dc5975", "size": "3...
from importlib import import_module from django.shortcuts import render from django.urls import URLResolver def home(request): apps = __get_apps() return render(request, "learning_django/learning_django.html", {"apps":apps}) def __get_apps(): apps = {} urls_module = import_module("learning_django.u...
{ "content_hash": "037b3f4240a20524f104cfe709fbfaad", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 81, "avg_line_length": 29.2, "alnum_prop": 0.684931506849315, "repo_name": "matija94/show-me-the-code", "id": "3239b1d81237c9d85f2845843c672f4e5642a0fc", "size": "584", "...
import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mamase.settings.dev") import django django.setup() from apps.utils.models import Field, Channel, ChannelField from apps.utils.api import (aggregateDailyFeedData, aggregateMonthlyFeedData, createAggregateDailyData, createAggregateMo...
{ "content_hash": "1396a4fec06cd3f5f46cf1fb1e3a5369", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 96, "avg_line_length": 34.875, "alnum_prop": 0.6541218637992832, "repo_name": "Upande/MaMaSe", "id": "570812ab282a58a9a0935e53ba67bec6045da3aa", "size": "1674", "binary":...
import json from django.contrib.auth.decorators import login_required from cpan2repo.tasks import start_build from django.shortcuts import render, get_object_or_404 from webui.models import Branch, BuildConfiguration, PackageNameMapping from django.http import HttpResponseRedirect, HttpResponse from webui.forms import ...
{ "content_hash": "bc0765c258178676987e77fc29befb7c", "timestamp": "", "source": "github", "line_count": 311, "max_line_length": 116, "avg_line_length": 28.418006430868168, "alnum_prop": 0.6280832767594479, "repo_name": "daniel-yavorovich/cpan2repo", "id": "f4ee096a060c16642a0448d2daf3a35238677e2a", ...
import os import sys import socket import signal import struct import thread from bisect import insort from cStringIO import StringIO from traceback import print_exc from errno import EWOULDBLOCK, ENOBUFS, EINTR from BitTorrent.platform import bttime from BitTorrent import WARNING, CRITICAL, FAQ_URL from BitTorrent.de...
{ "content_hash": "c70a2ef8908fc813de403dc2a5707818", "timestamp": "", "source": "github", "line_count": 489, "max_line_length": 110, "avg_line_length": 37.646216768916155, "alnum_prop": 0.5374545059481776, "repo_name": "galaxy001/libtorrent", "id": "efa067d330a1bd13802d1de88f47cb64643598d6", "size"...
# program067: # The Fibonacci Sequence is computed based on the following formula: # f(n)=0 if n=0 # f(n)=1 if n=1 # f(n)=f(n-1)+f(n-2) if n>1 # Please write a program using list comprehension to # print the Fibonacci Sequence in comma separated form with a given n # input by console. # Example: # If the...
{ "content_hash": "4b93a3a54c1342f81170dba8631b89e7", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 74, "avg_line_length": 24.93877551020408, "alnum_prop": 0.6350245499181669, "repo_name": "dek-odoo/python-samples", "id": "98e34d7dae59cf0e49526ed7f3dc7eacc7d9509f", "size"...
from django.utils.translation import ugettext_lazy as _ import horizon from openstack_dashboard.dashboards.fogbow import dashboard class Status(horizon.Panel): name = _("Status") slug = "status" dashboard.Fogbow.register(Status)
{ "content_hash": "24ea77c5f13f092653d70816c0cf543c", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 59, "avg_line_length": 18.692307692307693, "alnum_prop": 0.757201646090535, "repo_name": "fogbow/fogbow-dashboard", "id": "4438cd23e31577d76f3f8ad7b7e32e09b66310d3", "size"...
import unittest from sqlalchemy import Table, MetaData, Column, String, create_engine from sqlalchemy.engine.reflection import Inspector from alembic.util import CommandError version_table = Table('version_table', MetaData(), Column('version_num', String(32), nullable=False)) class TestMigrati...
{ "content_hash": "7b197e32a205ecb4e64d43e0b422e162", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 75, "avg_line_length": 40.264367816091955, "alnum_prop": 0.6203254353411362, "repo_name": "briandailey/alembic", "id": "0343cb1c6b0491593999e89023edfe9aece34ee6", "size": "...
import os import datetime from slugify import slugify from contextlib import contextmanager from flask import Flask, render_template, make_response, request, jsonify, redirect from flask_sqlalchemy import SQLAlchemy from sqlalchemy import Column, Integer, Sequence, String, DateTime, create_engine from sqlalchemy.or...
{ "content_hash": "18de0691fd4b9b0b6fd3dd6584d9c5bd", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 123, "avg_line_length": 28.81118881118881, "alnum_prop": 0.6660194174757281, "repo_name": "BartGo/bottle-cuturl", "id": "30421618d1251bef57cd8955396e83c76a82480f", "size":...
"""Handles EC2 communication via boto""" __author__ = 'ml483'
{ "content_hash": "a8e21cbe07c2d47b6680c215575818af", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 40, "avg_line_length": 31, "alnum_prop": 0.6612903225806451, "repo_name": "optiminimalist/movingdata", "id": "a806b4ef2b17b6bad339e9b3e87421b5a7929f3f", "size": "62", "bin...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "real_estate_agency.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the # i...
{ "content_hash": "8c932a48afbc5ebc477e2771d6fb246e", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 82, "avg_line_length": 37.80952380952381, "alnum_prop": 0.6234256926952141, "repo_name": "Dybov/real_estate_agency", "id": "621729fe3d1999c1a7bfd8aadb7ba39f0751b6e4", "size...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import models from django.db.models import F from sentry.utils.query import RangeQuerySetWrapperWithProgressBar class Migration(DataMigration): def forwards(self, orm): Project = or...
{ "content_hash": "2e489029e8d7dc7bd72112fc1f2ea734", "timestamp": "", "source": "github", "line_count": 2581, "max_line_length": 98, "avg_line_length": 36.80317706315382, "alnum_prop": 0.39643537672783163, "repo_name": "looker/sentry", "id": "34121be9e01f1ed9746f5f41731c96b5a84e90bd", "size": "9501...
import unittest import bootstrap import nark class LogTests(unittest.TestCase): def test_can_create_logger(self): a = nark.Assert() i = nark.Logging.get() a.not_null(i, "Unable to create log instance") def test_can_log_message(self): a = nark.Assert() i = nark.Logging.get() i.debug("Hell...
{ "content_hash": "067a08375d568fc684cb40515e709a66", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 50, "avg_line_length": 21.625, "alnum_prop": 0.6069364161849711, "repo_name": "shadowmint/python-nark", "id": "1c45441e2bef433e828fef7485bbc809e1defc92", "size": "1097", ...
import pytest import unittest from mock import Mock from calvin.runtime.north import scheduler from calvin.runtime.north.plugins.port import queue from calvin.runtime.north.plugins.port.endpoint import LocalOutEndpoint, LocalInEndpoint from calvin.csparser.codegen import calvin_codegen def create_actor(kind, args): ...
{ "content_hash": "a7e23a7700a58ad41f67139b86f205af", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 149, "avg_line_length": 38.82208588957055, "alnum_prop": 0.6460176991150443, "repo_name": "EricssonResearch/calvin-base", "id": "ae3f942659ca4c408d115fe0c261182d8a3f28a3", ...