text
stringlengths
4
1.02M
meta
dict
from flask import Flask from .core import db from .helpers import register_blueprints def create_app(package_name, package_path, settings_override=None): """Returns a :class:`Flask` application instance configured with common functionality for the Fogspoon platform. :param package_name: application pack...
{ "content_hash": "e12f52b67a08ef3c54543f31dd8fa10a", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 75, "avg_line_length": 31.708333333333332, "alnum_prop": 0.7411300919842313, "repo_name": "tkalus/fogspoon", "id": "9f6950a88294662b166ad4f09c397cb630fa7100", "size": "786"...
""" Definition of urls for QuickScrum. """ from django.conf.urls import include, url from app.forms import BootstrapAuthenticationForm, JiraAuthenticationForm, BootstrapRegisterForm, BootstrapPasswordChangeForm, TeamLoginForm from app.views import status_view, readstatus_view, dashboard_view, login_view, jiralogin_vi...
{ "content_hash": "89e017789a4b1df4c6e578e8e289239a", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 181, "avg_line_length": 34.413223140495866, "alnum_prop": 0.5883765609990393, "repo_name": "sunnytambi/QuickScrum", "id": "308031450fdacf8cfdc8affbb78157970ffea817", "size...
from __future__ import absolute_import from __future__ import print_function import six from builtins import str, zip, range from past.builtins import basestring import json from os import environ import pickle import re import unittest2 from richenum import RichEnum from richenum import RichEnumValue import normali...
{ "content_hash": "0af42f5104bf83dfe35f092ac8f9f898", "timestamp": "", "source": "github", "line_count": 498, "max_line_length": 79, "avg_line_length": 34.63253012048193, "alnum_prop": 0.5280918420594886, "repo_name": "hearsaycorp/normalize", "id": "d417feb58a4879795d577f5dd5b35968a5e8b49a", "size":...
import pygame import pymunk import math import helper from pymunk.vec2d import Vec2d from pygame.constants import * from ColorConstants import * from Globals import * ############################################ ############# SHADOW ENGINE ############### Info: http://forums.tigsource.com/index.php?topic=8803.0 ###...
{ "content_hash": "e6fc7cff5c64cad41306d2201d409590", "timestamp": "", "source": "github", "line_count": 644, "max_line_length": 165, "avg_line_length": 38.36801242236025, "alnum_prop": 0.5623861750779068, "repo_name": "GMadorell/Shades", "id": "9940e45c155def0f24eb510139721d3f3df25f69", "size": "24...
"""Data generators for VQA data sets.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import base64 import csv import json import os import random import sys import tarfile import zipfile import numpy as np from tensor2tensor.data_generators import gene...
{ "content_hash": "c055f47a2df9ad836627d4265a14e804", "timestamp": "", "source": "github", "line_count": 439, "max_line_length": 80, "avg_line_length": 37.227790432801825, "alnum_prop": 0.650186624242795, "repo_name": "tensorflow/tensor2tensor", "id": "cd932845ae432182138563385fd9b762b40dbdaf", "siz...
from utils.vector_manager import VectorManager from time import time import multiprocessing as mp import argparse import numpy as np import os import sys confidence = 0.8 def id2Word(param): filename, id2w = param file_words = "%s_clean" % filename.split("_num")[0] print("Comparing original %s with %s" %...
{ "content_hash": "00ee828b051c1ca5bde4b23d20ef1f44", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 122, "avg_line_length": 35.35625, "alnum_prop": 0.55524129397207, "repo_name": "kafkasl/contextualLSTM", "id": "2c900ce67abd5cd2a8ca5d404f1a0c9cdbc12503", "size": "5657", ...
import sys from rdkit import Chem,DataStructs # our default rdkit fingerprinter parameters: rdkitFpParams=dict(maxPath=5,fpSize=1024,nBitsPerHash=2) #Fragmentation algorithm #----------------------- #identify acyclic bonds #enumerate all single cuts #make sure you chop off more that 1 atom #keeps bits which...
{ "content_hash": "d0804163ddd3cb65b36c5cf8305814ff", "timestamp": "", "source": "github", "line_count": 439, "max_line_length": 792, "avg_line_length": 35.16400911161731, "alnum_prop": 0.6079549135194662, "repo_name": "adalke/rdkit", "id": "ed2f5cfcf47af7f81ad58a2f2cc1a82e94e78e90", "size": "17117"...
"""Common operations on Posix pathnames. Instead of importing this module directly, import os and refer to this module as os.path. The "os.path" name is an alias for this module on Posix systems; on other systems (e.g. Mac, Windows), os.path provides the same operations in a manner specific to that platform, and is a...
{ "content_hash": "287619f8f068517cfdab7267f2cf1bec", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 78, "avg_line_length": 29.236180904522612, "alnum_prop": 0.6412856651770368, "repo_name": "anandology/pyjamas", "id": "9c1769096b9860419dc3b48f014979bcd13392a2", "size": "...
import sys import pytest from collections import Counter from io import BytesIO import os import tempfile import warcio.utils as utils from . import get_test_file try: from multidict import CIMultiDict, MultiDict except ImportError: pass class TestUtils(object): def test_headers_to_str_headers(self): ...
{ "content_hash": "baf73926dfaa879e87422d3c1f70d4d7", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 97, "avg_line_length": 33.16129032258065, "alnum_prop": 0.5959792477302205, "repo_name": "webrecorder/warcio", "id": "b235e00e3002199df682ae1cdf810c372e68d8e6", "size": "30...
import asyncio import time import logging import json from decimal import Decimal from lbry.error import InvalidExchangeRateResponse, CurrencyConversionError from lbry.utils import aiohttp_request log = logging.getLogger(__name__) CURRENCY_PAIRS = ["USDBTC", "BTCLBC"] BITTREX_FEE = 0.0025 COINBASE_FEE = 0.0 # add f...
{ "content_hash": "f8a902a195897bcec94d8da8ae73b08a", "timestamp": "", "source": "github", "line_count": 240, "max_line_length": 100, "avg_line_length": 34.12083333333333, "alnum_prop": 0.5833435095860301, "repo_name": "lbryio/lbry", "id": "f15d1447868f7338b0fb376d087b97335308ce17", "size": "8189", ...
"""Tests for association.AcceptorRequestor.""" import logging import time import threading import pytest from pynetdicom import ( AE, VerificationPresentationContexts, PYNETDICOM_IMPLEMENTATION_UID, PYNETDICOM_IMPLEMENTATION_VERSION, build_context, debug_logger ) from pynetdicom.association import ServiceUse...
{ "content_hash": "9995a35d488ef1a99cb2367b89a89b67", "timestamp": "", "source": "github", "line_count": 2316, "max_line_length": 81, "avg_line_length": 38.96459412780656, "alnum_prop": 0.6385164335896811, "repo_name": "scaramallion/pynetdicom3", "id": "066b03c8e67df0c5897e751ce76e222aef70c595", "si...
from sklearn2sql_heroku.tests.classification import generic as class_gen class_gen.test_model("SVC_sigmoid" , "digits" , "hive")
{ "content_hash": "7942e6cd7b7da0be9b1f50bd3df3963d", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 72, "avg_line_length": 32.75, "alnum_prop": 0.7633587786259542, "repo_name": "antoinecarme/sklearn2sql_heroku", "id": "7c1cf430ca57681ef8f57f33671a5d420a4f1c7a", "size": "13...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @Author: yyg @Create: 2017MMDD @LastUpdate: 2017-02-14 HH:MM:SS @Version: 0.0.0-Beta """ # Import import sqlite3 from logging import getLogger from os import walk, mkdir from os.path import join, isdir from shutil ...
{ "content_hash": "c1fdc3f0fe96eed9908faa5c238512fd", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 103, "avg_line_length": 33.04210526315789, "alnum_prop": 0.5082828926409685, "repo_name": "hipnusleo/laserjet", "id": "11eaf8621b58b9fc3cd3821b2ffa7668b469c894", "size": "...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'UserProfile' db.create_table(u'profiles_userprofile', ( ('user', self.gf('django.db.models.fields.relate...
{ "content_hash": "c78bb6c4f3cac149f6364ab2f512be61", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 187, "avg_line_length": 62.985074626865675, "alnum_prop": 0.566350710900474, "repo_name": "team-stroller/critical_critiques", "id": "b02cd860f840a7f8635f3d00d4309e603f959f93"...
""" Handle motion-related events, e. g. beginning capture. Should accept input from the IR sensor, and may interface with OpenCV to detect motion in buffered video. The video capture and image processing should probably be done in parallel (separate threads / python equivalent) """ import cv2 # Deter...
{ "content_hash": "55a40e45b2094b5dba780dc1c672b712", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 86, "avg_line_length": 34.37313432835821, "alnum_prop": 0.6891011723838472, "repo_name": "nat543207/spi-camera", "id": "ff233552358a9ed3ec8e7fbd677d8a4eb7a09a16", "size": "...
from __future__ import unicode_literals import coursereg.models from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('coursereg', '0004_auto_20160731_1541'), ] operations = [ migrations.RemoveField( ...
{ "content_hash": "6a78788cf505ca1968f81c0e9152b226", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 136, "avg_line_length": 28.9625, "alnum_prop": 0.5217954251186879, "repo_name": "s-gv/bheemboy", "id": "4c0470ac449eeb6af19c6ccb6edaac8776072604", "size": "2389", "binary...
""" module for creating frames of data that can be sent to a YubiKey """ # Copyright (c) 2010, Yubico AB # See the file COPYING for licence statement. __all__ = [ # constants # functions # classes 'YubiKeyFrame', ] import struct from . import yubico_util from . import yubikey_defs from . import yubic...
{ "content_hash": "4a38b9d480aea0bff824f7a35b2955ef", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 84, "avg_line_length": 34.62903225806452, "alnum_prop": 0.5207265952491849, "repo_name": "Frostman/python-yubico", "id": "f095d20b4417f0247f295e327ef36df1a26ad132", "size"...
from twitter_feed.core.hashtag import Hashtag def test_hashtag_full(): hashtag_dict = { 'text': 'bagr' } test_hashtag = Hashtag.from_dict(hashtag_dict) assert test_hashtag.text == hashtag_dict['text']
{ "content_hash": "3ff27c221207b819f9ce9fb583f848ac", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 52, "avg_line_length": 20.727272727272727, "alnum_prop": 0.6535087719298246, "repo_name": "petrkotas/twitter-feed", "id": "4ce13bd90727560e981c84cb033d713f39232743", "size"...
print("Hello World!") print("Hello Again!") print("I like this tpying this.") print("This is fun.") print("Printing!") print("I'd much rather you 'not'!") print('I "said" do not touch this.')
{ "content_hash": "06910ed0ab28d31d44d9f65e0f98115b", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 36, "avg_line_length": 27.428571428571427, "alnum_prop": 0.6666666666666666, "repo_name": "Vayne-Lover/Effective", "id": "874eb8eaf558aeca14be90ed5cb9f2c8a9b0c231", "size": ...
import os import tarfile import unittest import mxnet as mx import numpy as np import random from mxnet import gluon import platform from common import setup_module, with_seed, teardown from mxnet.gluon.data import DataLoader import mxnet.ndarray as nd from mxnet import context from mxnet.gluon.data.dataset import Data...
{ "content_hash": "a2f492b7db2b0b531c2727d2c35e4a07", "timestamp": "", "source": "github", "line_count": 233, "max_line_length": 104, "avg_line_length": 37.63519313304721, "alnum_prop": 0.6391834872847532, "repo_name": "mlperf/training_results_v0.6", "id": "d48937c7259cce3327d917cc7f719cf9b33adcaa", ...
import os import requests # pip install requests # Please NOTE: In this sample we're assuming Cloud Api Server is hosted at "https://localhost". # If it's not then please replace this with with your hosting url. # Base URL for PDF.co Web API requests BASE_URL = "https://localhost" # Direct URL of source PDF file. S...
{ "content_hash": "5e0f4afa8d3943b8ddecefa102403cbc", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 120, "avg_line_length": 31.17105263157895, "alnum_prop": 0.6099620092866188, "repo_name": "bytescout/ByteScout-SDK-SourceCode", "id": "63bf4ddc1f9107ea110d0e8987db6f1e3f62165...
import fileinput, string, sys # This script takes a gnuplot data file and extracts data of only a specified index of each block. # The result is written to the standard output and can be used as an input to gnuplot. try: if(len(sys.argv) < 3) : print "Usage: python extract.py <filename> index=<node index> for extr...
{ "content_hash": "4883f5533a0e1c9523aa3b6a4082adad", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 104, "avg_line_length": 30.705479452054796, "alnum_prop": 0.6625027883113986, "repo_name": "pederpansen/dune-ax1", "id": "c4d3b5b038f62f952111f8d32ba9ae281b03caad", "size"...
import unittest import mock import numpy import chainer from chainer import cuda from chainer import functions from chainer import gradient_check from chainer import testing from chainer.testing import attr from chainer.testing import condition @testing.parameterize(*testing.product({ 'shape': [None, (2, 3), (2...
{ "content_hash": "0c695c1f891767587b7aacd6d59c9778", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 79, "avg_line_length": 32.208695652173915, "alnum_prop": 0.6201403887688985, "repo_name": "benob/chainer", "id": "aa3a1fe4eb72a1528ea133d3d0aeb38152edf296", "size": "3704"...
''' This file contains various heuristic classes all meant to adjust the word choice for the AI in various ways, such as from tiles selected to the board positions ''' import board, player, tile, aistats # BASE CLASS class Heuristic(object): def __init__(self): self.stats = aistats.AIStats() ''' Given variou...
{ "content_hash": "09f53774bb67a717e98674ae99879d86", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 125, "avg_line_length": 35.83720930232558, "alnum_prop": 0.7198788665368808, "repo_name": "grokcore/dev.lexycross", "id": "ec7dcd4eab8d9109f23f7404528a09ae3e14ed40", "size...
from collections import defaultdict, OrderedDict class HookRegistry(): def __init__(self): self.hooks = defaultdict(OrderedDict) def register(self, name, func): self.hooks[name][func] = True def run_hook(self, name, *args, **kwargs): return_val = None for hook in self.hoo...
{ "content_hash": "381583b89b0db0b3b9e0e79847eae8cc", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 48, "avg_line_length": 24.9, "alnum_prop": 0.5943775100401606, "repo_name": "stefanw/froide", "id": "6b0d364e2ef16969236245ed87911c4703823005", "size": "498", "binary": f...
import datetime import sys from cStringIO import StringIO from urlparse import urlparse from django.conf import settings from django.contrib.auth import authenticate, login from django.contrib.sessions.models import Session from django.contrib.sessions.middleware import SessionWrapper from django.core.handlers.base imp...
{ "content_hash": "a81b93a52bf9110dcd93cf4fc87b24ee", "timestamp": "", "source": "github", "line_count": 254, "max_line_length": 106, "avg_line_length": 36.66535433070866, "alnum_prop": 0.5999140985718887, "repo_name": "jonaustin/advisoryscan", "id": "c3110f02eca163184ca08c4e45fa7482916596cd", "size...
import collections ##__________________________________________________________________|| EventBuilderConfig = collections.namedtuple( 'EventBuilderConfig', 'base component' ) # base is for roottree.EventBuilderConfig ##__________________________________________________________________||
{ "content_hash": "0bdcaf36804f3ea83723569c265e2532", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 70, "avg_line_length": 27.272727272727273, "alnum_prop": 0.4066666666666667, "repo_name": "TaiSakuma/AlphaTwirl", "id": "3f114375473b8a164c0fc492aafef7d3f5431da9", "size": ...
import unittest from flask import url_for from yapper import create_app, db from yapper.blueprints.user.models import Role, User from yapper.blueprints.blog.models import Post class LoginTestCase(unittest.TestCase): def setUp(self): self.app = create_app('test') self.app.config['CSRF_ENABLED'] =...
{ "content_hash": "5c686ec4245d42cfc448f29df59391c8", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 77, "avg_line_length": 29.884057971014492, "alnum_prop": 0.5645004849660524, "repo_name": "brijeshb42/yapper", "id": "dd38f2eb8399be0e6290bbf4e85d04e6694a1d10", "size": "20...
from django.contrib import admin admin.site.site_header = 'Sysgate Admin' admin.site.site_title = 'Sysgate' admin.site.index_title = 'Admin'
{ "content_hash": "7bf60a5d0ed32f263c422fb0d7ae197f", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 40, "avg_line_length": 28.4, "alnum_prop": 0.7605633802816901, "repo_name": "klashxx/PyConES2017", "id": "bbf811ae10ef899dc3a3a3a8f7f0beb02c3babb7", "size": "142", "binary...
from collections import OrderedDict # Code snippet from RTC-Tools, copyright Stichting Deltares, originally under the terms of the GPL # version 3. Relicensed with permission. class AliasRelation: def __init__(self): self._aliases = {} self._canonical_variables_map = OrderedDict() self._c...
{ "content_hash": "3723cf1b7237dce21c4ae357f809917c", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 98, "avg_line_length": 33.17142857142857, "alnum_prop": 0.5968992248062015, "repo_name": "jgoppert/pymola", "id": "7a05e4162a06915486873dc545216716ac566b4d", "size": "2322"...
from datetime import datetime, timedelta, timezone import json from django.test import TestCase, Client from django.contrib.auth.models import User from binder import history from binder.history import Change, Changeset from .testapp.models import Animal, Caretaker class HistoryTest(TestCase): def setUp(self): ...
{ "content_hash": "ce0a8f12c0013229de9df4db62b604ff", "timestamp": "", "source": "github", "line_count": 216, "max_line_length": 145, "avg_line_length": 32.21296296296296, "alnum_prop": 0.7099741304972693, "repo_name": "CodeYellowBV/django-binder", "id": "6957ace3095434f13107d02fcb4f9ccc87a4638c", "...
from heatclient.v1.stacks import Stack from heatclient.v1.stacks import StackManager from mock import MagicMock import testscenarios from testscenarios.scenarios import multiply_scenarios import testtools load_tests = testscenarios.load_tests_apply_scenarios def mock_stack(manager, stack_name, stack_id): return...
{ "content_hash": "bff2bf28c95083145b0ad95be1a4cb47", "timestamp": "", "source": "github", "line_count": 288, "max_line_length": 78, "avg_line_length": 30.46527777777778, "alnum_prop": 0.5257579211306131, "repo_name": "larsks/python-heatclient", "id": "d1920742df36e4b4d54d9f2d43bad372eff9c65c", "siz...
from __future__ import absolute_import from sentry.testutils.cases import RuleTestCase from sentry.rules.conditions.tagged_event import TaggedEventCondition, MatchType class TaggedEventConditionTest(RuleTestCase): rule_cls = TaggedEventCondition def get_event(self): event = self.event event....
{ "content_hash": "066d3b4ef34148b838aaaea40d0e7430", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 100, "avg_line_length": 35.09345794392523, "alnum_prop": 0.5762982689747004, "repo_name": "beeftornado/sentry", "id": "f955ea21398e06fd65f04b3b5be48f3c0b859400", "size": "...
import itertools import codegen_common # ============================================================================== # The template used to generate the basic operator tests. op_template = ''' ############################################################################## class %(funcname)s_operator_%(typecode)s(u...
{ "content_hash": "82c433680df8e17a429cac42011bed88", "timestamp": "", "source": "github", "line_count": 671, "max_line_length": 173, "avg_line_length": 34.32637853949329, "alnum_prop": 0.582989623583554, "repo_name": "m1griffin/arrayfunc", "id": "711ae8765dead38e3e378a5cebdfa995168a15ff", "size": "...
import re from setuptools import setup, find_packages # import multiprocessing to avoid this bug (http://bugs.python.org/issue15881#msg170215_ import multiprocessing assert multiprocessing def get_version(): """ Extracts the version number from the version.py file. """ VERSION_FILE = 'entity/version....
{ "content_hash": "f70c7a4bcd5c4a68c6d63ae9aa48afb6", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 96, "avg_line_length": 31.436363636363637, "alnum_prop": 0.6541353383458647, "repo_name": "ambitioninc/django-entity", "id": "5a067ea3e719fe1a9e42f634289ad705f24f827c", "si...
from . import db class ActivitySkill(db.Model): item_id = db.Column(db.Integer, db.ForeignKey('item.id'), primary_key=True) activity = db.Column(db.Integer, primary_key=True, autoincrement=False) skill_id = db.Column(db.Integer, db.ForeignKey('item.id'), primary_key=True) level = db.Column(db.Integer...
{ "content_hash": "b20be2d7c399be82f563f0d6d61da8ed", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 80, "avg_line_length": 37.44444444444444, "alnum_prop": 0.7091988130563798, "repo_name": "Kyria/LazyBlacksmith", "id": "1d9f73c9232219ca453f6b73a542a2e37b588227", "size": "3...
import rest_framework_jwt.views from django.conf.urls import url, include urlpatterns = [ # login for browsable API url(r"^api-auth/", include("rest_framework.urls")), # token auth url(r"^token-auth/$", rest_framework_jwt.views.obtain_jwt_token), url(r"^token-refresh/$", rest_framework_jwt.views.re...
{ "content_hash": "eb56a6f25838bfb7637e46335a0b08f2", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 73, "avg_line_length": 37.45454545454545, "alnum_prop": 0.6941747572815534, "repo_name": "geometalab/osmaxx", "id": "45f770b06b8bb7da1da3170cd501512e6e8d1b31", "size": "412...
"""ML-ENSEMBLE author: Sebastian Flennerhag :copyright: 2017-2018 :licence: MIT """ from __future__ import division import os import numpy as np import sysconfig import subprocess from mlens import config from mlens.utils import utils from mlens.utils.exceptions import ParallelProcessingError from time import sleep...
{ "content_hash": "f51361593e299240c6e0b95c696a7cc8", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 70, "avg_line_length": 25.175324675324674, "alnum_prop": 0.6022697962342017, "repo_name": "flennerhag/mlens", "id": "b35d78a8ba25a9cd043a3b68df081e30f126762c", "size": "38...
import argparse import sys from typing import Callable, List, Optional import torch from fairseq import utils from fairseq.data.indexed_dataset import get_available_dataset_impl def get_preprocessing_parser(default_task="translation"): parser = get_parser("Preprocessing", default_task) add_preprocess_args(p...
{ "content_hash": "45acdbf05a203061c3ee81c6d3cf3131", "timestamp": "", "source": "github", "line_count": 673, "max_line_length": 120, "avg_line_length": 53.49034175334324, "alnum_prop": 0.6140170560293341, "repo_name": "hfp/libxsmm", "id": "23bb005dc47d37d041b3ee40f3b30c305dd806f8", "size": "36177",...
from __future__ import absolute_import, unicode_literals # Formulários from itertools import izip from gaebusiness.business import CommandSequential, CommandParallel from gaebusiness.gaeutil import SaveCommand, ModelSearchCommand from gaeforms.ndb.form import ModelForm from gaegraph.business_base import DeleteArcs, De...
{ "content_hash": "f702fcc448508508d3708614aa0411d5", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 113, "avg_line_length": 31.96590909090909, "alnum_prop": 0.7095627444009954, "repo_name": "renzon/appengineepython", "id": "cc25d6224e450ee9ffcc78369ce75dceed5213f5", "size...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('profiles', '0001_initial'), ] operations = [ migrations.AlterModelOptions( name='profile', options={'ordering': ['user__user...
{ "content_hash": "0a89536ac1376e95d7968d9c2c7b488e", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 53, "avg_line_length": 20.352941176470587, "alnum_prop": 0.5895953757225434, "repo_name": "jonsimington/app", "id": "5dbf9d6f3aff973a11a61153f00c6b418a01241a", "size": "370...
"""adding_syntax_highlighter_choice Revision ID: 13234475ad5 Revises: 12ca4cba34c Create Date: 2015-03-12 10:28:43.604768 """ # revision identifiers, used by Alembic. revision = '13234475ad5' down_revision = '12ca4cba34c' from alembic import op import sqlalchemy as sa from sqlalchemy.sql import table, column from ...
{ "content_hash": "ec3b07ab44486603e47302041dd56ce0", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 364, "avg_line_length": 37.61290322580645, "alnum_prop": 0.6895368782161235, "repo_name": "Depado/MarkDownBlog", "id": "bba8231e9c9edfe6a95908b08398bf5c57b8e8be", "size": "...
import logging import datetime import sys #logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) #logging.basicConfig(level=logging.DEBUG) #logging.info('Wetransfer started') from .wetransfer import WeTransfer
{ "content_hash": "73c2ca2a2a0bb7d9f764013172fe3bd8", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 60, "avg_line_length": 21.9, "alnum_prop": 0.817351598173516, "repo_name": "predat/wetransferpy", "id": "9317721e1f4e53a8525d602a988f7a58e59f825c", "size": "219", "binary...
"""Loss functions.""" import enum from typing import Tuple, Mapping, Optional, Union from flax.training import common_utils import jax import jax.numpy as jnp import numpy as np @jax.custom_vjp def cross_entropy_with_logits(logits: jnp.ndarray, targets: jnp.ndarray, z_loss: float) -> Tu...
{ "content_hash": "c585cbd71deaf66a642239fa76847ea3", "timestamp": "", "source": "github", "line_count": 291, "max_line_length": 80, "avg_line_length": 41.28865979381443, "alnum_prop": 0.6930503537245111, "repo_name": "google-research/t5x", "id": "e45579d92b9793a3cc26da06077bff136c8c84fe", "size": "...
import _plotly_utils.basevalidators class ShowticksuffixValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="showticksuffix", parent_name="contourcarpet.colorbar", **kwargs ): super(ShowticksuffixValidator, self).__init__( ...
{ "content_hash": "b4772bbc8a4a606c2714c3a851d66c9b", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 80, "avg_line_length": 33.333333333333336, "alnum_prop": 0.5833333333333334, "repo_name": "plotly/python-api", "id": "138105a17ed15de7005148d6aee3d99e09000170", "size": "60...
""" WSGI config for portality 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_SET...
{ "content_hash": "67df333b91a548415913c632a1350c5b", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 24.6875, "alnum_prop": 0.7721518987341772, "repo_name": "genonfire/portality", "id": "0b76ad950d3e05771dbb914dc32ba32365156413", "size": "395", "bi...
from six.moves import http_client as httplib from xml.etree import ElementTree import six class ResponseError(Exception): """An error received from the Recurly API in response to an HTTP request.""" def __init__(self, response_xml): self.response_xml = response_xml @property def respons...
{ "content_hash": "8a56b64e40988abf23759a5d7924c4b0", "timestamp": "", "source": "github", "line_count": 320, "max_line_length": 94, "avg_line_length": 28.675, "alnum_prop": 0.6378596338273758, "repo_name": "cgerrior/recurly-client-python", "id": "036adc1b85e817e69b3e5a0e4bdf95b1c1d77737", "size": "...
from django import forms from restaurants.models import Restaurant class RestaurantCreateFormEasy(forms.ModelForm): class Meta: model = Restaurant fields = ['name', 'location', 'category'] def clean_name(self): name = self.cleaned_data.get('name') ''' method to clean ...
{ "content_hash": "75890bd343857790eb6ead26a8ebf28b", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 58, "avg_line_length": 25.11111111111111, "alnum_prop": 0.6305309734513275, "repo_name": "matija94/show-me-the-code", "id": "d508192195b3b4303df0687fa7471f969424d410", "siz...
import pytest from mitmproxy.proxy.commands import CloseConnection, OpenConnection, SendData from mitmproxy.proxy.events import ConnectionClosed, DataReceived from mitmproxy.proxy.layers import tcp from mitmproxy.proxy.layers.tcp import TcpMessageInjected from mitmproxy.tcp import TCPFlow, TCPMessage from ..tutils imp...
{ "content_hash": "c80d875ffd8c509853b45227c13e42d7", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 101, "avg_line_length": 31.114864864864863, "alnum_prop": 0.5637350705754615, "repo_name": "Kriechi/mitmproxy", "id": "299aa99939df9bf97f01a59a59083a8ca555faf7", "size": "...
cases = int(input("")) for a in range(cases): string = raw_input("") if not "." in string: print(1) else: decimal = string.split(".")[-1] decimal = 10**len(decimal)/int(decimal) print(int(decimal))
{ "content_hash": "69647b43fa93eca935da1eb5821a5a7a", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 47, "avg_line_length": 27, "alnum_prop": 0.5308641975308642, "repo_name": "geekpradd/Sphere-Online-Judge-Solutions", "id": "ca2f99b8bd31f2a943599927ecfeff734b55ef30", "size"...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "Lag1Trend", cycle_length = 30, transform = "Logit", sigma = 0.0, exog_count = 0, ar_order = 12);
{ "content_hash": "7ea422bd9c42e4713e4711d13174990a", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 161, "avg_line_length": 37.285714285714285, "alnum_prop": 0.7011494252873564, "repo_name": "antoinecarme/pyaf", "id": "d8c97542c8eb12a691b61606223acf0e3f9c94ce", "size": "26...
import pytest from neo4j._conf import PoolConfig from neo4j._sync.io._bolt4 import Bolt4x0 from ...._async_compat import mark_sync_test @pytest.mark.parametrize("set_stale", (True, False)) def test_conn_is_stale(fake_socket, set_stale): address = ("127.0.0.1", 7687) max_connection_lifetime = 0 connectio...
{ "content_hash": "996808b439d370016c076aa955c3dd77", "timestamp": "", "source": "github", "line_count": 191, "max_line_length": 80, "avg_line_length": 31.287958115183248, "alnum_prop": 0.6442436412315931, "repo_name": "neo4j/neo4j-python-driver", "id": "88f549936acfc62658552e057a2264d249143e3c", "s...
"""Tests for LUCluster* """ import OpenSSL import copy import unittest import operator import re import shutil import os from ganeti.cmdlib import cluster from ganeti.cmdlib.cluster import verify from ganeti import constants from ganeti import errors from ganeti import netutils from ganeti import objects from ganet...
{ "content_hash": "05f4f45f908fcd5e7c5357e12e8a2abc", "timestamp": "", "source": "github", "line_count": 2524, "max_line_length": 80, "avg_line_length": 36.48058637083994, "alnum_prop": 0.6833193957231447, "repo_name": "dimara/ganeti", "id": "3e44d62c7bf5de5d629bdfa7997e3eee67745faf", "size": "93453...
from __future__ import absolute_import from datetime import datetime from django.core.urlresolvers import reverse from sentry.models import Release, ReleaseCommit, ReleaseProject from sentry.testutils import APITestCase class ProjectReleaseListTest(APITestCase): def test_simple(self): self.login_as(user...
{ "content_hash": "fd3e8c7d319ee7654e2bd14749d6d707", "timestamp": "", "source": "github", "line_count": 357, "max_line_length": 98, "avg_line_length": 30.641456582633054, "alnum_prop": 0.5362464576286681, "repo_name": "jean/sentry", "id": "3520ce4c211ee1215d258283da5a5ef956f4ef7d", "size": "10939",...
""" Handling of block device information and mapping. This module contains helper methods for intepreting the block device information and determining the suitable mapping to guest devices and libvirt XML. Throughout these methods there are a number of standard variables / types used * 'mapping': a dict contains th...
{ "content_hash": "b7dc48dcdb8c0bda7750b385a656b14d", "timestamp": "", "source": "github", "line_count": 431, "max_line_length": 76, "avg_line_length": 31.62877030162413, "alnum_prop": 0.5585387323943662, "repo_name": "DirectXMan12/nova-hacking", "id": "aabcef964a9f2ca964dfdbf116fa5d9725363fac", "si...
import os from ivf.io_util.dict_data import saveDict, loadDict _root = __file__ ## Dataset root directories. def datasetRootDirs(): setting_file = os.path.abspath(os.path.join(_root, "../setting.json")) setting_data = loadDict(setting_file) dataset_root_dirs = setting_data["dataset_roots"] return da...
{ "content_hash": "325d9603a76bd6a2fc8a5137ed93440c", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 88, "avg_line_length": 28.55, "alnum_prop": 0.6981903093987157, "repo_name": "tody411/ImageViewerFramework", "id": "e8d47bb1442004c627c271176dab887126726ec6", "size": "1866...
from __future__ import absolute_import, unicode_literals __author__ = 'marcos'
{ "content_hash": "fa9250159bfbe9e65483f95a6ae13895", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 56, "avg_line_length": 26.666666666666668, "alnum_prop": 0.7125, "repo_name": "MarcosVn/turinginformatica", "id": "0f69ed0cd5c16ad2d1e6f110d58f3649ecb60b9d", "size": "104", ...
import unittest import tempfile import atomic_file import os import time from os import path class TestAtomicFile(unittest.TestCase): def setUp(self): self.directory = path.dirname(__file__) self.name = tempfile.mktemp() def tearDown(self): try: os.remove(self.name) ...
{ "content_hash": "eeb097896b6712e97bb481a280d69551", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 128, "avg_line_length": 40.118811881188115, "alnum_prop": 0.5518262586377097, "repo_name": "rik0/rk-exempla", "id": "a64811fabdb914a151564b7ee226bcbc5c9ee139", "size": "40...
"""Converter construction support. This module contains a base class for all converters, as well as supporting structures. These structures are referred to as contexts. The class hierarchy is as follows: <your converter> [extends] converter.Base [extends] transformer.Base [extends] gast...
{ "content_hash": "7a29c926c5904614f8ca70facfce5a8c", "timestamp": "", "source": "github", "line_count": 489, "max_line_length": 81, "avg_line_length": 35.59918200408998, "alnum_prop": 0.6997357536764706, "repo_name": "asimshankar/tensorflow", "id": "4543b113983f56e8a987a4dbce3bba9db47da517", "size"...
import time import types import unittest import threading import multiprocessing import mcl.messages.messages from mcl.network.network import RawListener from mcl.network.network import RawBroadcaster from mcl.network.network import QueuedListener from mcl.network.network import MessageListener from mcl.network.networ...
{ "content_hash": "b6c92f120c042c47d2dbc4e8d8df1ab5", "timestamp": "", "source": "github", "line_count": 1006, "max_line_length": 83, "avg_line_length": 38.806163021868784, "alnum_prop": 0.5851840467225082, "repo_name": "asherbender/mcl", "id": "8796182352c301e6b74aa520e71efbedf15b3666", "size": "39...
from random import choice COLORS = ('white', 'yellow', 'purple', 'red') class Ghost(object): def __init__(self): self.color = choice(COLORS)
{ "content_hash": "ac86eefe265a8259838c10498381f84f", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 45, "avg_line_length": 19.5, "alnum_prop": 0.6153846153846154, "repo_name": "the-zebulan/CodeWars", "id": "d1955ac2064ece34ba001bc319c7d6f7a93d6bbf", "size": "156", "binar...
import atexit import inspect import logging import os from collections import defaultdict def GetChildPids(processes, pid): """Returns all child processes of |pid| from the given |processes| list. Args: processes: A tuple of (pid, ppid, state) as generated by ps. pid: The pid for which to get children. ...
{ "content_hash": "b1c4670069a0c556b1c25e6cf6909b82", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 79, "avg_line_length": 31.011494252873565, "alnum_prop": 0.6386212008895478, "repo_name": "SummerLW/Perf-Insight-Report", "id": "d8ef2c7a706ab56e0912e2355953f016cb94a0ff", ...
import pytest import pandas as pd def test_code_changes(metrics): #repo_id assert metrics.code_changes(10, 25430, period='year').isin([pd.Timestamp('2019-01-01T00:00:00+00:00'), 2]).any().any() # repo_group_id assert metrics.code_changes(10, period='year').isin([pd.Timestamp('2019-01-01T00:00:00+00:00...
{ "content_hash": "90ee2cbc1d05ca6ef109287b7695f44a", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 138, "avg_line_length": 47.06172839506173, "alnum_prop": 0.6508394543546695, "repo_name": "OSSHealth/ghdata", "id": "105189062f0085dc7a365a64c2b2af22a70f53a3", "size": "384...
""" This special file is for keeping track of `models.Manager` classes. TODO: If this file grows too large to maintain, create a `managers` folder and split out files based on class being managed. """ from core.query import only_current_instances from django.db import models from django.utils import timezone cl...
{ "content_hash": "ccdb96c8a7a84a30e195ad11dc721cc6", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 79, "avg_line_length": 30.294117647058822, "alnum_prop": 0.6485436893203883, "repo_name": "CCI-MOC/GUI-Backend", "id": "12c43396183494c0380decb5a8fdecec9a7b563b", "size": "...
class Solution(object): @staticmethod def get_row_col(idx, row_offset_list, col_offset_list): col_size = col_offset_list[-1] + 1 col = col_size * (idx / len(col_offset_list)) + col_offset_list[idx % len(col_offset_list)] row = row_offset_list[idx % len(col_offset_list)] return ro...
{ "content_hash": "fc1747b0d6998d64bc0a298ba8de87d7", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 115, "avg_line_length": 41.035714285714285, "alnum_prop": 0.5126196692776327, "repo_name": "AlgorithmLover/OJCodes", "id": "c27bbfc18d28e8da7f06f711a593527b14478bc0", "size...
"""Tests exceptions and DB-API exception wrapping.""" from sqlalchemy import exc as sa_exceptions from sqlalchemy import util from sqlalchemy.testing import fixtures from sqlalchemy.testing import eq_ if util.py2k: from exceptions import StandardError, KeyboardInterrupt, SystemExit else: Exception = BaseExce...
{ "content_hash": "2b0421be9478c5009f9170aea8438586", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 78, "avg_line_length": 36.76829268292683, "alnum_prop": 0.5058043117744611, "repo_name": "Abi1ity/uniclust2.0", "id": "a6238272575cf6040cb0738082ff94a5ccf68900", "size": "...
"""Pipes, pipe segments and piplines, for flowing data from sources to partitions. """ class PipelineError(Exception): def __init__(self, pipe, *args, **kwargs): from rowgenerators.util import qualified_class_name super(PipelineError, self).__init__(*args, **kwargs) self.pipe = pipe ...
{ "content_hash": "e9451be23c1a9d689d059110d4fefa9d", "timestamp": "", "source": "github", "line_count": 2116, "max_line_length": 123, "avg_line_length": 28.95982986767486, "alnum_prop": 0.5559163824474942, "repo_name": "CivicKnowledge/rowgenerators", "id": "5e39250bc022081442c723ac5d0264ece93f129f", ...
from django import forms class GenericRepeaterForm(forms.Form): url = forms.URLField( required=True, label='URL to forward to', help_text='Please enter the full url, like http://www.example.com/forwarding/', widget=forms.TextInput(attrs={"class": "url"}) ) class FormRepeaterF...
{ "content_hash": "fe92cf7c5ab0099ae657ee3a0ef42fd7", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 87, "avg_line_length": 26.944444444444443, "alnum_prop": 0.6597938144329897, "repo_name": "SEL-Columbia/commcare-hq", "id": "4fb09b8b442bdae96112617cefdb36d5a246ca88", "siz...
import os from flask import (Flask, jsonify, render_template, request, make_response, send_from_directory) from flask_cors import CORS from db import get_full_name app = Flask(__name__) cors = CORS(app) @app.route("/") def index(): content_type = request.headers.get('Content-Type', '') br...
{ "content_hash": "cde8b97bd0e0dd3907758040c1d07b04", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 78, "avg_line_length": 30.71794871794872, "alnum_prop": 0.6168614357262103, "repo_name": "treyhunner/pseudorandom.name", "id": "928ab78ba6fc7ec84bd5a03249fae803dea8c01b", "...
from __future__ import absolute_import from .zmqredis import ZMQRedis def factory(commclass, config): if commclass == 'ZMQRedis': return ZMQRedis(config) return ZMQRedis(config) def cleanup(commclass, config): return ZMQRedis.cleanup(config)
{ "content_hash": "d220365fe0674c717316bebd2a0eaab9", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 38, "avg_line_length": 19.142857142857142, "alnum_prop": 0.7164179104477612, "repo_name": "PaloAltoNetworks/minemeld-core", "id": "f9c6f9a039a6f49d1e545fc2974f0e8d35984b83", ...
"""Utility functions for metric evaluation in Pax.""" import numbers import typing from typing import Any, Dict, Mapping, Optional, Sequence, Union from absl import logging import clu.values as clu_values import jax from jax import numpy as jnp from jax.experimental import global_device_array import numpy as np from ...
{ "content_hash": "d6a4cf3c23ea7a7cee286f6953d0037a", "timestamp": "", "source": "github", "line_count": 223, "max_line_length": 115, "avg_line_length": 37.25112107623318, "alnum_prop": 0.670278078728783, "repo_name": "google/paxml", "id": "f8851071f67f885bbb559868952102b7363bfe33", "size": "8898", ...
from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_dressed_stormtrooper_bombardier_m.iff" result.attribute_template_id = 9 result.stfName("npc_name","") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "03c07239e8e251f8da721468af02bc18", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 79, "avg_line_length": 22.923076923076923, "alnum_prop": 0.6946308724832215, "repo_name": "anhstudios/swganh", "id": "b3ec6038e6f3d93fd4b54f99f2dc1a4bdca750eb", "size": "44...
from actstream.models import Action from django.test import TestCase from cyidentity.cyfullcontact.tests.util import create_sample_contact_info class FullContactActivityStreamTestCase(TestCase): def test_contact_create(self): contact_info = create_sample_contact_info() action = Action.objects.acto...
{ "content_hash": "f5c912c1a9edeb4a6bb89547390e098b", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 76, "avg_line_length": 43.3, "alnum_prop": 0.7736720554272517, "repo_name": "shawnhermans/cyborgcrm", "id": "286cc0c6dd5ebf47c641901da335c874abae6f46", "size": "433", "bi...
import _thread as thread import atexit from collections.abc import Mapping from datetime import timedelta from enum import IntEnum import functools import glob import json import logging import numbers import os import re import sys import threading import time import traceback from types import TracebackType from typi...
{ "content_hash": "dc2ce3a8141fc6dd39be67c6bb4600b4", "timestamp": "", "source": "github", "line_count": 3694, "max_line_length": 151, "avg_line_length": 37.36897671900379, "alnum_prop": 0.5647525010685231, "repo_name": "wandb/client", "id": "c2678ffc9678a88e5f793d1194ce0393258f5d66", "size": "13804...
import argparse from util.analyser import Analyser def parse_args(): parser = argparse.ArgumentParser(description="Analyse your Benchmark log") parser.add_argument( "path_to_log", help="Path to File containing the logs of the benchmark." ) return vars(parser.parse_args()) def main(): ...
{ "content_hash": "28769a087d0fb9dc0f353b87d5aa9568", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 78, "avg_line_length": 25.210526315789473, "alnum_prop": 0.6576200417536534, "repo_name": "Osslack/HANA_SSBM", "id": "f86e56615ab69dee13516f083e62622dea3e8b90", "size": "50...
from __future__ import absolute_import, unicode_literals from chatterbox import events, registry class UserSavesSomemodelEvent(events.ChatterboxMailEvent): originator = 'demoapp' event = 'User saves somemodel' template_subject = 'demoapp/email_subject.jinja' template_body = 'demoapp/email_body.jinja' ...
{ "content_hash": "e72e35aaa34244e408ed01d3831a38c9", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 58, "avg_line_length": 26.36, "alnum_prop": 0.6342943854324734, "repo_name": "sthzg/django-chatterbox", "id": "07fc5cec2971e5f0095dd9a8a6a7ac7c255395de", "size": "683", "...
"""Sets environment variables needed to run a chromium unit test.""" import os import subprocess import sys # This is hardcoded to be src/ relative to this script. ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) def fix_python_path(cmd): """Returns the fixed command line to call the right p...
{ "content_hash": "fa7bff14e60457d7c8b42b43728be547", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 75, "avg_line_length": 27.73913043478261, "alnum_prop": 0.6700626959247649, "repo_name": "wubenqi/zutils", "id": "bbbcac529d1d7594213faa25304fefde9771adb2", "size": "1465",...
"""Exception superclass for all HipPy exceptions.""" class Error(Exception): """Exception superclass for all HipPy exceptions.""" pass
{ "content_hash": "966ed597182c1635364033c3a90c68bc", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 56, "avg_line_length": 18.375, "alnum_prop": 0.7006802721088435, "repo_name": "Sean1708/HipPy", "id": "a7f5b72a8a950be27d67f8cba48dcf926a3373f1", "size": "147", "binary": ...
import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tryit.settings.production") application = get_wsgi_application()
{ "content_hash": "19e1e3c9614222e4df1386c3db06da87", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 76, "avg_line_length": 25.285714285714285, "alnum_prop": 0.7966101694915254, "repo_name": "lexotero/try-it", "id": "749585fee5eaabfc4c984d8d92d61f07ed7e97a0", "size": "177",...
from pyvisdk.base.managed_object_types import ManagedObjectTypes from pyvisdk.base.base_entity import BaseEntity import logging ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) class HostHealthStatusSystem(Ba...
{ "content_hash": "a33b287d020de7b7c8f3b9c0c8e71e63", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 98, "avg_line_length": 32.325, "alnum_prop": 0.6403712296983759, "repo_name": "xuru/pyvisdk", "id": "f06edad0ab19abf286a5b626d54dbb3aff0de1c8", "size": "1294", "binary": ...
import os from setuptools import find_packages, setup with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-maslow', ver...
{ "content_hash": "fdc886e3c114219045f875a947e6cb9d", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 78, "avg_line_length": 35.189189189189186, "alnum_prop": 0.6221198156682027, "repo_name": "obitec/django-maslow", "id": "8366e84057824589f2bb6e4f1bd805240e8e05fc", "size": ...
from enum import IntEnum import json from multiprocessing import Pool import pathlib import numpy as np import pandas as pd BRANCH_ARTIFACTS_DIR = ( pathlib.Path(__file__).parent.resolve() / "googleapiclient" / "discovery_cache" / "documents" ) MAIN_ARTIFACTS_DIR = ( pathlib.Path(__file__).parent....
{ "content_hash": "32edad068db6e17b43f1128f298b70e6", "timestamp": "", "source": "github", "line_count": 524, "max_line_length": 88, "avg_line_length": 41.711832061068705, "alnum_prop": 0.5945921215171341, "repo_name": "googleapis/google-api-python-client", "id": "2742b00b2e2484c2eb6fedf5a6387c7b2677e...
""" Installs and configures nova """ import os import uuid import logging from packstack.installer import validators import packstack.installer.common_utils as utils from packstack.installer.exceptions import ScriptRuntimeError from packstack.modules.ospluginutils import NovaConfig, getManifestTemplate, appendManife...
{ "content_hash": "ed2b2ac694b8bc2fd33b1c2f35f92412", "timestamp": "", "source": "github", "line_count": 357, "max_line_length": 132, "avg_line_length": 50.94677871148459, "alnum_prop": 0.5037937101385529, "repo_name": "skottler/packstack", "id": "0102c2442f1e7b602628d7ccea56ac3adef793a0", "size": "...
import logging import os __author__ = 'Tim Schneider <tim.schneider@northbridge-development.de>' __copyright__ = "Copyright 2015, Northbridge Development Konrad & Schneider GbR" __credits__ = ["Tim Schneider", ] __maintainer__ = "Tim Schneider" __email__ = "mail@northbridge-development.de" __status__ = "Development" ...
{ "content_hash": "3885107054102c1d04cb4655eea17025", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 80, "avg_line_length": 25.26086956521739, "alnum_prop": 0.7039586919104991, "repo_name": "NB-Dev/django-splitdate", "id": "5c43decff65c84426570b55b817068458121f413", "size"...
""" Component Classes for Genomic Jobs Components are assembled by the JobController for a particular Genomic Job """ import csv import json import logging import re import pytz from collections import deque, namedtuple from copy import deepcopy from dateutil.parser import parse import sqlalchemy from werkzeug.excepti...
{ "content_hash": "0a370baa2a878ae025d3345016f18b71", "timestamp": "", "source": "github", "line_count": 3886, "max_line_length": 132, "avg_line_length": 39.630468347915595, "alnum_prop": 0.5572387730188826, "repo_name": "all-of-us/raw-data-repository", "id": "6c27289da3b7038d86ee170ad1ff74395572287e"...
import urllib, os from tqdm import tqdm class TqdmUpTo(tqdm): """Provides `update_to(n)` which uses `tqdm.update(delta_n)`. https://pypi.python.org/pypi/tqdm """ def update_to(self, b=1, bsize=1, tsize=None): """ b : int, optional Number of blocks transferred so far [defaul...
{ "content_hash": "cceeb187259d3b7e33fec38b31970ecb", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 85, "avg_line_length": 38.458333333333336, "alnum_prop": 0.6056338028169014, "repo_name": "jsqihui/reimplement-paper", "id": "96dd1d2397486e86d29b2bec7c230c81e20adef4", "si...
from djpj.decorator import pjax_block, pjax_template
{ "content_hash": "8a27ed2dc258d5a00cba4398b37392c3", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 52, "avg_line_length": 53, "alnum_prop": 0.8301886792452831, "repo_name": "AlexHill/djpj", "id": "81f7c546cf3f57c8a4df36d62f41068505778768", "size": "53", "binary": false,...
""" --- Part Two --- As the door slides open, you are presented with a second door that uses a slightly more inspired security mechanism. Clearly unimpressed by the last version (in what movie is the password decrypted in order?!), the Easter Bunny engineers have worked out a better solution. Instead of simply fillin...
{ "content_hash": "39ccf7a2a8025bc77dfabffb4e4fdc0e", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 319, "avg_line_length": 47.56, "alnum_prop": 0.6997476871320437, "repo_name": "shaggy245/adventofcode", "id": "bc56a41ebd7e8e8badd39190b4bc4f0f7c52048d", "size": "2378", ...
from __future__ import unicode_literals from django.db import models, migrations import easy_thumbnails.fields class Migration(migrations.Migration): dependencies = [ ('users', '0001_initial'), ] operations = [ migrations.AddField( model_name='user', name='avatar...
{ "content_hash": "47d25e4a7579eb0c066494c192fc8aef", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 127, "avg_line_length": 24.63157894736842, "alnum_prop": 0.6260683760683761, "repo_name": "chedv13/taskist", "id": "7c4b5e8b4a0ce9bed52b3913080e7c5faa8c91a7", "size": "492"...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('saas', '0001_initial'), ('users', '0002_auto_20150708_1621'), ] operations = [ migrations.AddField( ...
{ "content_hash": "009c17b297dd6e720b341276c5e90d8a", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 206, "avg_line_length": 42.475, "alnum_prop": 0.6327251324308417, "repo_name": "moshthepitt/answers", "id": "3709c91e547fb15cbfbe67cd318ecd1e6ba6c6c0", "size": "1723", "b...
import serial import sys import os from serial.tools.list_ports import comports as list_serial_ports default = { 'ARDUINO':"VID:PID=2341:0043", # Works for Uno R3, untested on anything else 'MICRO:BIT':"VID:PID=0D28:0204",'MICROBIT':"VID:PID=0D28:0204" # Now can use both 'micro:bit' and 'microbit' ...
{ "content_hash": "4f1ad1ad95dc5c1e371ae66bcb5bb61e", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 112, "avg_line_length": 23, "alnum_prop": 0.5340264650283554, "repo_name": "ed-raspberrypi/connect", "id": "1ada9df38c388c98c24d9d0b524dab8fbb8b4b8c", "size": "2116", "bi...
''' Script to generate list of seed nodes for chainparams.cpp. This script expects two text files in the directory that is passed as an argument: nodes_main.txt nodes_test.txt These files must consist of lines in the format <ip> <ip>:<port> [<ipv6>] [<ipv6>]:<port> <onion>.onion 0xDD...
{ "content_hash": "dd6bb36104b78530db644de7a80414ae", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 98, "avg_line_length": 31.362204724409448, "alnum_prop": 0.5699221692191815, "repo_name": "FoundationAwesome/coinawesome-qt", "id": "1a6fa21cfe01d68be3080364d3e075b33c8a8ea4...
import re import urllib import logging import urlparse import furl from flask import request, url_for from website import settings as website_settings from api.base import settings as api_settings # Keep me: Makes rubeus importable from website.util from . import rubeus # noqa logger = logging.getLogger(__name__)...
{ "content_hash": "70009b7c2726b486b5ca2493e054eaf9", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 116, "avg_line_length": 36.84905660377358, "alnum_prop": 0.6613756613756614, "repo_name": "arpitar/osf.io", "id": "954c81afc74b0daea45a64bdae91045706370f77", "size": "5884...
from gppylib.mainUtils import * from optparse import Option, OptionGroup, OptionParser, OptionValueError, SUPPRESS_USAGE import os, sys, getopt, socket, StringIO, signal import datetime from gppylib import gparray, gplog, pgconf, userinput, utils from gppylib.commands import base, gp, pg, unix from gppylib.db import ...
{ "content_hash": "556a3957ce850b7be6f278eaa03400a2", "timestamp": "", "source": "github", "line_count": 1511, "max_line_length": 185, "avg_line_length": 48.632693580410326, "alnum_prop": 0.5887131892656905, "repo_name": "Chibin/gpdb", "id": "39784a7a7030002870799da25078f94455297637", "size": "73652...
from . import domainresource class RiskAssessment(domainresource.DomainResource): """ Potential outcomes for a subject with likelihood. An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. """ resource_type = "RiskAssessment" ...
{ "content_hash": "e675494e4d6dcd5ca4f006b8f7807189", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 120, "avg_line_length": 40.58571428571429, "alnum_prop": 0.6091751730611287, "repo_name": "all-of-us/raw-data-repository", "id": "9398aa0c42845e2a2ba3a72a4ce54e5d1fb3abf6", ...
"""Logging functions. This module has functions for logging errors and warnings. """ import sys _num_errors = 0 _num_warnings = 0 def Error(msg): """Prints an error.""" global _num_errors _num_errors += 1 print >> sys.stderr, ('ERROR: %s' % msg) def Warning(msg): """Prints an war...
{ "content_hash": "e905cfbdd22845949d168122973e7898", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 63, "avg_line_length": 21.254901960784313, "alnum_prop": 0.6070110701107011, "repo_name": "AlexSc/HelloWorld", "id": "1af21464957aec233571e3e5a3c824973e9c584a", "size": "16...
import json import requests BASE_URL = "http://musicbrainz.org/ws/2/" ARTIST_URL = BASE_URL + "artist/" query_type = { "simple": {}, "atr": {"inc": "aliases+tags+ratings"}, "aliases": {"inc": "aliases"}, "releases": {"inc": "releases"}} def query_site(url, params, u...
{ "content_hash": "2a577ebbee0d3960c2e578166c3e9480", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 75, "avg_line_length": 24.263157894736842, "alnum_prop": 0.586406362979031, "repo_name": "tuanvu216/udacity-course", "id": "13b27ffa77e3e337b169180036327a8491e76dbf", "size...
import numpy as np import os.path import astropy.units as u def waypoint(comps, intTimes, duration, mpath, tofile): """Generates waypoint dictionary for MissionSim Args: comps (array): An array of completeness values for all stars intTimes (array): An array of predicte...
{ "content_hash": "df9a9f729281cdc68b6bb3a4f780ab03", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 87, "avg_line_length": 30.8125, "alnum_prop": 0.6146044624746451, "repo_name": "dsavransky/EXOSIMS", "id": "e4a40cde14b7eaa2a72023a909093da43a9e4376", "size": "1972", "bi...
"""Float class. Represents an unbounded float using a widget. """ # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. from traitlets import ( Instance, Unicode, CFloat, Bool, CaselessStrEnum, Tuple, TraitError, validate, default ) from .widget_description import D...
{ "content_hash": "123dd28979da2a39532eb6f97745f874", "timestamp": "", "source": "github", "line_count": 279, "max_line_length": 167, "avg_line_length": 37.92831541218638, "alnum_prop": 0.6457191457191457, "repo_name": "nitin-cherian/LifeLongLearning", "id": "98d9ea8f43dc3fa5e16a0f34e94b67d22d6f3eb6",...
__author__ = 'leifos' from ifind.seeker.common_helpers import file_exists from ifind.seeker.common_helpers import AutoVivification class TopicDocumentFileHandler(object): def __init__(self, filename=None): self.data = AutoVivification() if filename: self.read_file(filename) def...
{ "content_hash": "ec8af163917aaca8cde22f0ee0d40805", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 96, "avg_line_length": 28.117117117117118, "alnum_prop": 0.5200256328099968, "repo_name": "leifos/ifind", "id": "4166a60b17662e660687d4c2515d9e9b9c907900", "size": "3121",...