text
stringlengths
4
1.02M
meta
dict
""" Test the post wrangling module and functionality. """ ########################################################################## ## Imports ########################################################################## import os import pickle import unittest from .test_models import MongoTestMixin try: from uni...
{ "content_hash": "63594a5d671c9a0722876262886fa3f0", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 79, "avg_line_length": 32.04, "alnum_prop": 0.58270911360799, "repo_name": "janetriley/baleen", "id": "ef62b222fc3747d0217a814ed92cd728a60c7925", "size": "6718", "binary...
import sys import asyncio import os import types import functools from collections import namedtuple from collections.abc import Iterator import abc from typing import List, Union, NamedTuple import uuid import yaml import logging log = logging.getLogger(__name__) Fire = NamedTuple('Fire', [('rate', int), ('duration...
{ "content_hash": "21980c4c1e1c86a2731203b325bbe81c", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 80, "avg_line_length": 27.802325581395348, "alnum_prop": 0.6072772898368883, "repo_name": "cfchou/choreography", "id": "1240434eb70ba7d2bc17cdc0b377acaabec82c70", "size": "...
from module import XMPPModule class Help(XMPPModule): def help(self, feature): if feature != None: return 'help: There is no such subfeature to the help module.' return 'help: The glorious module that provides you with this glorious help.' def handleMessage(self, msg): cmds = msg['body'].split(' ') if ...
{ "content_hash": "ded4699bb1d8286f802434f57fb6a383", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 82, "avg_line_length": 26.818181818181817, "alnum_prop": 0.632768361581921, "repo_name": "Halibot/halibot-legacy", "id": "63dc75244e0a6e460cbf6a46e46a9ce5224ca981", "size":...
import os import tempfile pid1 = str(os.getpid()) print "pid1 = %s" % pid1 filename = os.path.join(tempfile.gettempdir(), pid1) print "filename = %s" % filename fileh = open(filename, "w") fileh.write(pid1) fileh.close() fileh = open(filename, "r") pid2 = fileh.read() if pid1 == pid2: print "success" else: ...
{ "content_hash": "743b49a24ba9725a0578fe6f331331a5", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 52, "avg_line_length": 16.85, "alnum_prop": 0.6646884272997032, "repo_name": "jtraver/dev", "id": "dbd0c9b959976110d9f6e5eb28e656aab1f3a762", "size": "337", "binary": fal...
import itertools import logging import multiprocessing import os import signal import sys import time import warnings from collections import defaultdict from datetime import timedelta from typing import Collection, DefaultDict, Dict, Iterator, List, Optional, Set, Tuple from sqlalchemy import func, not_, or_, text fr...
{ "content_hash": "b8c131a9991709a16c0c15e5a98080d9", "timestamp": "", "source": "github", "line_count": 1373, "max_line_length": 110, "avg_line_length": 44.450837581937364, "alnum_prop": 0.5742163818387377, "repo_name": "danielvdende/incubator-airflow", "id": "8452950e0467fc7d0bf1621df21816efa75b3ad3...
import random import discord from discord.ext import commands class Invite: """Aya invite link""" def __init__(self, Aya): self.Aya = Aya @commands.command() async def invite(self): """ Use this link to add Aya to your server! """ serv_owner = ctx.message.server.owner ...
{ "content_hash": "82dcc6bcbf51b575874fd597de802adc", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 135, "avg_line_length": 33.25806451612903, "alnum_prop": 0.5664403491755577, "repo_name": "Drinka/Aya", "id": "54e97c557a854cea883cc3c65663af584bd104e6", "size": "1031", ...
""" Setup declaration to install Pyptables """ params = dict( name='pyptables', version='0.1', packages=['pyptables'], url='https://github.com/BenjaminSchubert/Pyptables', license='MIT', author='Benjamin Schubert', author_email='[email protected]', description='A python wrapper a...
{ "content_hash": "3f20c6e37f7101196578c7b2f9fc8bf1", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 97, "avg_line_length": 26.404761904761905, "alnum_prop": 0.6158701532912534, "repo_name": "BenjaminSchubert/Pyptables", "id": "233882ac931c86e4d48add9f0dce9d9b9900e618", "s...
from setuptools import setup from setuptools.extension import Extension try: import Cython.Distutils except ImportError: cmdclass = {} ext_modules = None print "WARNING: unable to import Cython." else: cmdclass = {"build_ext": Cython.Distutils.build_ext} ext_modules = [ Extension("borg...
{ "content_hash": "bda1375be0c335223bf798c026663833", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 90, "avg_line_length": 42.234042553191486, "alnum_prop": 0.653904282115869, "repo_name": "borg-project/borg", "id": "3c827206b10e58665b254abecaab7c8b03aeb73b", "size": "198...
__version__=''' $Id$ ''' __doc__='''Page Layout and Typography Using Scripts" - higher-level framework for flowing documents''' from reportlab.platypus.flowables import Flowable, Image, Macro, PageBreak, Preformatted, Spacer, XBox, \ CondPageBreak, KeepTogether, TraceInfo, FailOnWrap, FailOnDra...
{ "content_hash": "35715aa6685f93564e9ccd1f5a27fe07", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 109, "avg_line_length": 70.3076923076923, "alnum_prop": 0.762582056892779, "repo_name": "makinacorpus/reportlab-ecomobile", "id": "381e714778600ccdff28ee8b45bb9fb80eb39568", ...
import data import fft import fmt import pair import walls __all__ = ['data','fft','fmt','pair','walls']
{ "content_hash": "8ea05467ac76e36e0d272553a6cbc320", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 45, "avg_line_length": 15.142857142857142, "alnum_prop": 0.6698113207547169, "repo_name": "mphoward/flyft", "id": "d17dcd38cf0d790fe92706f9ed388ef498a50ed2", "size": "106", ...
# -*- coding: utf-8 -*- """A Python implemntation of a kd-tree This package provides a simple implementation of a kd-tree in Python. https://en.wikipedia.org/wiki/K-d_tree """ from __future__ import print_function import operator import math from collections import deque from functools import wraps __author__ = ...
{ "content_hash": "9d99d8e6786f5a2eca8e57697307fbff", "timestamp": "", "source": "github", "line_count": 718, "max_line_length": 106, "avg_line_length": 28.77715877437326, "alnum_prop": 0.5773884425515439, "repo_name": "karulont/combopt", "id": "ca69ea046b90c81fd1c383ec73dac80e6cce84df", "size": "20...
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 = "PolyTrend", cycle_length = 7, transform = "Integration", sigma = 0.0, exog_count = 100, ar_order = 12);
{ "content_hash": "3015c89017112a23eea89b75eef81317", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 168, "avg_line_length": 38.285714285714285, "alnum_prop": 0.7089552238805971, "repo_name": "antoinecarme/pyaf", "id": "8c7e95fad227054eda05cacce0a82a16e806a28a", "size": "26...
from tokens import Token import types import inspect import copy from nodes import AstNode from errors import CodeTalkerException class TranslatorException(CodeTalkerException): pass class Translator: def __init__(self, grammar, **defaults): self.grammar = grammar self.register = {} s...
{ "content_hash": "0d14d943d343350d6223f17d6b673785", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 90, "avg_line_length": 30.48051948051948, "alnum_prop": 0.5223689816787388, "repo_name": "jaredly/codetalker", "id": "fba2c0f759628155c00a0bf5c7ca782f469e8afa", "size": "23...
''' ein Class for login und logout session ''' class SessionHelper: def __init__(self, app): self.app = app def login(self, username, password): wd = self.app.wd # Zugang zu Driver wird benötigt self.app.open_home_page() wd.find_element_by_name("username"...
{ "content_hash": "66af314254dcf9b02d40a4e0a8363ea8", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 90, "avg_line_length": 31.196428571428573, "alnum_prop": 0.5695477962220951, "repo_name": "Oliebert/testing_mantis", "id": "53373c6ea6608c5d4c6babac3edc0084f90c18df", "size...
from django.conf import settings from django.utils.functional import SimpleLazyObject from django_town.core.exceptions import SettingError from django_town.utils import DictObject, recursive_dict_update _DJANGO_TOWN_SETTINGS = { "oauth2": { "USER_SECRET_KEY_LENGTH": 5, "SERVICE_SECRET_KEY_LENGTH"...
{ "content_hash": "6db3ed975ca1c46938a28b71856a0082", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 117, "avg_line_length": 35.529411764705884, "alnum_prop": 0.5749172185430463, "repo_name": "uptown/django-town", "id": "3a8ccbe40bd0115bddc36988f6471a1640238d27", "size": "...
import time import operator import os import pickle import shutil import random import sys import json import numpy as np from collections import OrderedDict from collections import defaultdict from datetime import datetime from sklearn.cross_validation import train_test_split # import our costum modules import config...
{ "content_hash": "f1dfc3db2a1b9b58681f39d38bb48dd0", "timestamp": "", "source": "github", "line_count": 223, "max_line_length": 117, "avg_line_length": 39.318385650224215, "alnum_prop": 0.6730155109489051, "repo_name": "tttor/csipb-jamu-prj", "id": "8a25de7f123d9645989cbf6f6dc5347a7a4137f9", "size"...
import alsaaudio, time, audioop card_info={} for device_number, card_name in enumerate (alsaaudio.cards()): card_info[card_name] = "hw:%s,0" % device_number inp=alsaaudio.PCM(alsaaudio.PCM_CAPTURE,alsaaudio.PCM_NONBLOCK,card_info["Device"]) #Selektuj USB zvucnu karticu inp.setchannels(1) #Mono inp.setrate(...
{ "content_hash": "a9188598240a4c9f4e28f9f2fe3aa3af", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 112, "avg_line_length": 27.22222222222222, "alnum_prop": 0.7204081632653061, "repo_name": "aleksailic/smart-alarm-client", "id": "426c5917d083becdbb436b25c4701806d5ff1e67", ...
def quickSort(alist): quickSortHelper(alist,0,len(alist)-1) def quickSortHelper(alist,first,last): if first<last: splitpoint = partition(alist,first,last) quickSortHelper(alist,first,splitpoint-1) quickSortHelper(alist,splitpoint+1,last) def partition(alist,first,last): pivotvalue = a...
{ "content_hash": "161c0b4211091c62ab1864156a93221e", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 49, "avg_line_length": 22.642857142857142, "alnum_prop": 0.6151419558359621, "repo_name": "robin1885/algorithms-exercises-using-python", "id": "35f45f1376bdd40e1df397237a17a9...
import pytest from pytest_embedded import Dut @pytest.mark.supported_targets @pytest.mark.generic def test_newlib(dut: Dut) -> None: dut.expect_unity_test_output()
{ "content_hash": "f0b66ce5c51ca7d506c5fa2b737f40ee", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 34, "avg_line_length": 21.25, "alnum_prop": 0.7588235294117647, "repo_name": "espressif/esp-idf", "id": "81a2f579b4ccde07970a45c5471d3c5878e1467d", "size": "273", "binary"...
"""social Revision ID: 352e12e0f114 Revises: 3f69a0a6351f Create Date: 2017-05-22 16:08:02.658574 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '352e12e0f114' down_revision = '3f69a0a6351f' branch_labels = None depends_on = None def upgrade(): # ### co...
{ "content_hash": "4647db8a8674ea8a6a304d29f38e120a", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 65, "avg_line_length": 18.862068965517242, "alnum_prop": 0.6782449725776966, "repo_name": "exleym/IWBT", "id": "a05a50692c227bcb3596a8b49c95ce5e1a05c059", "size": "547", ...
from libmt94x.remittance_info import AbstractRemittanceInfo from libmt94x.transfer_failed_codes import TransferFailed class InfoToAcccountOwnerSubField(object): '''Abstract base class for all subfields of InformationToAcccountOwner''' pass class BeneficiaryParty(InfoToAcccountOwnerSubField): tag = 'BENM...
{ "content_hash": "5ebf23adfae049dcbab2e9fafa5067f3", "timestamp": "", "source": "github", "line_count": 225, "max_line_length": 89, "avg_line_length": 25.475555555555555, "alnum_prop": 0.6540474528960223, "repo_name": "gingerpayments/python-libmt94x", "id": "da113e68c55654b622989d40022d8074525fec59",...
''' NetConsole - file ``/etc/sysconfig/netconsole`` =============================================== This parser reads the ``/etc/sysconfig/netconsole`` file. It uses the ``SysconfigOptions`` parser class to convert the file into a dictionary of options. Sample data:: # This is the configuration file for the net...
{ "content_hash": "680a7ae6c4c275b00473c11e0eb255ff", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 77, "avg_line_length": 25.743589743589745, "alnum_prop": 0.6752988047808764, "repo_name": "wcmitchell/insights-core", "id": "37c23c07c12524396cad751cd12bab9f9bec26b9", "siz...
from django.conf.urls import url from terp import views urlpatterns = [ url(r'^$', views.HomeView.as_view(),name='home'), url(r'^load/$', views.LoadStoryView.as_view(),name='load_story'), url(r'^start/(?P<story_id>[0-9])/$', views.StartStoryView.as_view(),name='start_story'), url(r'^restart/(?...
{ "content_hash": "3d9ce0d279d0e97356c86a4e1fcfb28f", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 110, "avg_line_length": 59.07142857142857, "alnum_prop": 0.6457073760580411, "repo_name": "moosepod/moosezmachine", "id": "bd1569372e0d9e6f9229c7b22f4b269ff7fe73c9", "size"...
import logging from .backends.cache import cache LOG = logging.getLogger(__name__) class BaseManager(object): """Simple manager util for storing data related to the group store informations in free keys name + self.scope + object.id = object name + self.scope + count = count name + self.scope ...
{ "content_hash": "aa794087ae48078e93ecfeb938ddbf15", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 75, "avg_line_length": 24.846715328467152, "alnum_prop": 0.5543478260869565, "repo_name": "leonardo-modules/leonardo-channels", "id": "56c2839ea0edc823cbd1f096b51bf8c3d3a4d5...
import requests import json def yo_momma(): """Returns a random yo momma joke (<str>).""" data = requests.get("http://api.yomomma.info/").text return json.loads(data)["joke"]
{ "content_hash": "2403f3b587179a286aa3d5eb2dee2e6d", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 56, "avg_line_length": 23.625, "alnum_prop": 0.6455026455026455, "repo_name": "neelkamath/hack.chat-bot", "id": "9f85336f24716aaa3196ddac1f58a1581dc9d68a", "size": "213", ...
'''test_cpython.py - test the JNI CPython class python-javabridge is licensed under the BSD license. See the accompanying file LICENSE for details. Copyright (c) 2003-2009 Massachusetts Institute of Technology Copyright (c) 2009-2013 Broad Institute All rights reserved. ''' import unittest import javabridge class ...
{ "content_hash": "ce603a4b7bb1b17b45ce4d33cfe9d438", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 77, "avg_line_length": 34.94444444444444, "alnum_prop": 0.6554054054054054, "repo_name": "CellProfiler/python-javabridge", "id": "86601843b4723149a4ed9657690287e03f7b0655", ...
""" Django settings for dashboard project. Generated by 'django-admin startproject' using Django 1.10.3. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import ...
{ "content_hash": "0d273b9661c1d6ca8553533296fefa04", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 91, "avg_line_length": 24.932098765432098, "alnum_prop": 0.6377816291161178, "repo_name": "agarman/pulsar", "id": "05eb47df899f5ad0e993cfefc4c08e1693f834ca", "size": "4618...
import logging from typing import Optional from google.api_core import exceptions from google.auth import credentials as auth_credentials from google.cloud.aiplatform import base, initializer from google.cloud.aiplatform import compat from google.cloud.aiplatform import utils from google.cloud.aiplatform_v1beta1.type...
{ "content_hash": "f8a7295ef685945f92e00c776c50c54d", "timestamp": "", "source": "github", "line_count": 223, "max_line_length": 115, "avg_line_length": 42.39013452914798, "alnum_prop": 0.6120808209034169, "repo_name": "sasha-gitg/python-aiplatform", "id": "3327f47d1f304b37ef77b2dbee36bb16fd8e3320", ...
__author__ = 'Daniele Sartiano and Giuseppe Attardi' """ Class for dealing with NER data from CoNLL03 file. """ from ..reader import TaggerReader import nlpnet.config as config import sys def toIOBES(sent): """Convert from IOB to IOBES notation.""" l = len(sent) for i in range(l): tok = sent[i] ...
{ "content_hash": "54551b97efb47811a8ce738d82dd2f1d", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 101, "avg_line_length": 31.205298013245034, "alnum_prop": 0.5171901528013583, "repo_name": "attardi/nlpnet", "id": "a486cb5fd5ed90e00523a595f372dae2d56d5bf9", "size": "473...
from unittest import mock import hyperframe import pytest from mitmproxy import exceptions from mitmproxy.net import http, tcp from mitmproxy.net.http import http2 from pathod.protocols.http2 import HTTP2StateProtocol, TCPHandler from ...mitmproxy.net import tservers as net_tservers class TestTCPHandlerWrapper: ...
{ "content_hash": "674b480d8fab75ffc5cd84bbb6a1c357", "timestamp": "", "source": "github", "line_count": 500, "max_line_length": 108, "avg_line_length": 35.07, "alnum_prop": 0.6071285999429712, "repo_name": "vhaupert/mitmproxy", "id": "63a13c881c9e6a5abe0c53f39ab818e6f6031fb9", "size": "17535", "b...
import csv import os from app import create_app, get_db, assets from flask_assets import Environment, ManageAssets from flask_script import Manager from pymongo import MongoClient manager = Manager(create_app) manager.add_command("assets", ManageAssets()) @manager.command def fix_dates(): from datetime import ...
{ "content_hash": "ff36ddd3808c7cf47f4df385f81983ed", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 124, "avg_line_length": 37.596, "alnum_prop": 0.4609000957548675, "repo_name": "ForumOrganisation/forumorg", "id": "57961dc004408bed6f3d73a1fe523d6b421b58ee", "size": "940...
from __future__ import absolute_import import sys import socket import time import greenlet from functools import wraps from tornado.ioloop import IOLoop from tornado.iostream import IOStream from tornado.concurrent import Future from tornado.gen import coroutine, Return from tornado.netutil import Resolver IS_PYPY ...
{ "content_hash": "9e8b434d1940139afa5597efb1276de9", "timestamp": "", "source": "github", "line_count": 415, "max_line_length": 92, "avg_line_length": 27.221686746987952, "alnum_prop": 0.5458971408338497, "repo_name": "alex8224/gTornado", "id": "69581bf73583b8456300f630c2a035aaf365f531", "size": "1...
from collections import namedtuple from pman.abstractmgr import Resources from pman.cromwell.slurm.wdl import SlurmJob, Image, StrWdl # Since conversion to WDL is lossy, we need to define the # expected WDL, actual source info, and WDL-converted info (lossy_info) Example = namedtuple('Example', ['wdl', 'info', 'lossy_...
{ "content_hash": "f138f642e48439d43f3f115ebe0dadef", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 107, "avg_line_length": 27.854545454545455, "alnum_prop": 0.577023498694517, "repo_name": "FNNDSC/pman", "id": "500795d7f6a7eff0207b1c6b5c6e47715748d542", "size": "3064", ...
def get_rows(rows_filename): """ Read the filename with the labels of rows and add them to a list of lists """ rows = [] with open(rows_filename) as f: lines = f.readlines() for line in lines: line_list = line.strip().strip('\n').split(' ') # Convert t...
{ "content_hash": "593ff2aab62c9958cd3dbb029375521d", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 91, "avg_line_length": 27.0974025974026, "alnum_prop": 0.5938173975557153, "repo_name": "svagionitis/puzzles", "id": "9889475771acf78b482c9d2f2c9dde4a1397e9c8", "size": "4...
import happybase # https://happybase.readthedocs.io/en/latest/ ''' If running on Windows with thriftpy 0.3.9, and you get this error: “thriftpy.parser.exc.ThriftParserError: ThriftPy does not support generating module with path in protocol 'c'” edit thriftpy/parser/parser.py, and change line 488 from ...
{ "content_hash": "eeca5f5838d468c104d521a96727e87a", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 114, "avg_line_length": 32.333333333333336, "alnum_prop": 0.709278350515464, "repo_name": "bundgus/python-playground", "id": "0e9b93026aece40c1bba6766d9a4cba307287cbe", "si...
"""Utilities for interacting with Google Service Management.""" import json import os.path from googlecloudsdk.core import exceptions from googlecloudsdk.core import log from googlecloudsdk.third_party.apitools.base import py as apitools_base class SwaggerOpenException(exceptions.Error): def __init__(self, messa...
{ "content_hash": "bb38121ba2d9d7d61674255c7ec59149", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 77, "avg_line_length": 37.05263157894737, "alnum_prop": 0.7540584415584416, "repo_name": "flgiordano/netcash", "id": "24f016772e6464bbf2126e68288c98a55f93e531", "size": "5...
from setuptools import setup setup( name='mr_bot', packages=['mr_bot'], version='1.1.3', description='Small package for assist telegram bot development', author='Root Kid', author_email='[email protected]', url='https://github.com/r00tkid/mr_bot.git', download_url='https://github.com/r00tkid/mr_bot/t...
{ "content_hash": "1ece34ae59f617ec9e47375ac7951d0a", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 66, "avg_line_length": 23.8, "alnum_prop": 0.6184873949579832, "repo_name": "r00tkid/mr_bot", "id": "69fe5cbf18ff1d58b49ab2fcd05208505dc8c651", "size": "654", "binary": f...
"""Defines the Gin configuration framework. Programs frequently have a number of "hyperparameters" that require variation across different executions of the program. When the number of such parameters grows even moderately large, or use of some parameter is deeply embedded in the code, top-level flags become very cumb...
{ "content_hash": "5cb0620ca26762234b29fdbcea3accf3", "timestamp": "", "source": "github", "line_count": 2901, "max_line_length": 110, "avg_line_length": 38.77111340916925, "alnum_prop": 0.6954789953322961, "repo_name": "google/gin-config", "id": "46e9c3fcafc384376fbb87e81a2ab2b551a8fc4b", "size": "...
import sys, getopt from py4j.java_gateway import java_import, JavaGateway, GatewayClient from pyspark.conf import SparkConf from pyspark.context import SparkContext from pyspark.rdd import RDD from pyspark.files import SparkFiles from pyspark.storagelevel import StorageLevel from pyspark.accumulators import Accumulato...
{ "content_hash": "13bfb391365addaf84f12eecd4062588", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 72, "avg_line_length": 26.67479674796748, "alnum_prop": 0.6705272782688205, "repo_name": "myrtleTree33/zeppelin", "id": "b822c0d3baa8fa8c7513b539827611fa6e95bc21", "size":...
import os import random from ctypes import * class Packet(Structure): _fields_ = [ ('mu', c_double), ('r', c_double), ('energy', c_double), ('nu', c_double), ('nu_line', c_double), ('tau_event', c_double), ('next_line_id', c_int), ...
{ "content_hash": "d3ec298813bc7287ecd2b8b219c7aebd", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 71, "avg_line_length": 29.96969696969697, "alnum_prop": 0.7269969666329625, "repo_name": "Minhmo/tardis", "id": "ac0f61c2a1816c5a9c4c9a9f85be1b0b6b11e8fb", "size": "2967", ...
from __future__ import unicode_literals import importlib import mimetypes import posixpath try: from urllib.parse import quote except ImportError: from urllib import quote from django.utils.encoding import smart_text from pipeline.conf import settings def to_class(class_str): if not class_str: ...
{ "content_hash": "09f8483659e5d4bb02aac00c56c367bb", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 73, "avg_line_length": 26.732142857142858, "alnum_prop": 0.6760187040748163, "repo_name": "leonardoo/django-pipeline", "id": "dc5380b3d359faf04e0dfc419013e770b7a62eca", "si...
""" Application testing Generated by yeoman generator-django-ana <%= version %> on <%= date %>. """ from django.test import TestCase from django.urls import reverse class <%= pascalName %>Tests(TestCase): def test(self): response = self.client.get(reverse('index'))
{ "content_hash": "2c67d19d79a70bdef160d901a149f21c", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 71, "avg_line_length": 25.454545454545453, "alnum_prop": 0.6892857142857143, "repo_name": "Wtower/generator-django-ana", "id": "661b8cd2e168a6ae11c84c2f2dc6f750a1b88466", "...
import xml.etree.ElementTree as ET import time from objects.cube.rubiks_cube import RubiksCube from objects.xml import xml_step from objects.xml.abstact_xml import AbstractXml from objects.xml.xml_cube import XmlCube from xml_step import Step from helper import Helper class XmlObject(AbstractXml): def __init__(s...
{ "content_hash": "911a92136a7eec89a4519fd73455a73f", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 82, "avg_line_length": 28.394736842105264, "alnum_prop": 0.5764596848934198, "repo_name": "Willempie/Artificial_Intelligence_Cube", "id": "623f425add4fbd923cf9f14378ac9c0bc8...
import sys from PyQt4 import Qt from PyQt4.phonon import Phonon class AIPYbody(): # in the class body are all functionalities of the AIPY Music Player # body will be one window from PyQT def __init__ (self): pass def Display(): # used for showing the remaining time, or elapsed time of song, it is posible to ...
{ "content_hash": "29f96bc4775b6772d6396dc263baa898", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 84, "avg_line_length": 24.52173913043478, "alnum_prop": 0.724290780141844, "repo_name": "MrIliev/AIPY-Music-Player", "id": "43698c78bb9265eed77616d6fdc2f12bf10a06db", "size...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterface'], 'supported_by': 'core'} DOCUMENTATION = r''' --- module: win_user version_added: "1.7" short_description: Manages local Windows user accounts description: - Manages local Windows user accounts ...
{ "content_hash": "2dc51a6d6efab8d7fde106939d45065b", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 78, "avg_line_length": 27.127551020408163, "alnum_prop": 0.6567613315779575, "repo_name": "e-gob/plataforma-kioscos-autoatencion", "id": "9664df67f39cd50e432660fa816fc540f39...
""" FOSS FIAStar """ from bika.lims.browser import BrowserView from DateTime import DateTime from Products.CMFCore.utils import getToolByName from plone.i18n.normalizer.interfaces import IIDNormalizer from zope.component import getUtility from bika.lims import bikaMessageFactory as _ from bika.lims.utils import t from ...
{ "content_hash": "6f187be7e684dc77cf60eae05d1bf474", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 79, "avg_line_length": 36.407407407407405, "alnum_prop": 0.5496778569006443, "repo_name": "hocinebendou/bika.gsoc", "id": "424d13d30da0c8011a3890774250f3b8de1d0f55", "size...
import sys import requests from bs4 import BeautifulSoup import webbrowser import os import threading verbose_mode = False; def get_urls(config_file): if not os.path.isfile(config_file): print ("Can not find file {0}".format(config_file)) print ("Be sure to create a config file as the one provide...
{ "content_hash": "a191a64f0b9c44a470b250e93359217c", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 127, "avg_line_length": 34.56701030927835, "alnum_prop": 0.6286907247241277, "repo_name": "gl051/Instagram_Scraper", "id": "2d2ce8ab8244b6c867fce32e8598fce38763c7e6", "size...
from datetime import timedelta from django.conf import settings as django_settings default = { 'FULLCALENDAR_FIRST_WEEKDAY': 0, 'FULLCALENDAR_OCCURRENCE_DURATION': timedelta(hours=1), 'FULLCALENDAR_SITE_COLORS': {} } settings = type('SettingsDummy', (), default) for key, value in default.items(): se...
{ "content_hash": "9690ccd3a36d9ffb7506ae06629ec98f", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 59, "avg_line_length": 25.8, "alnum_prop": 0.7080103359173127, "repo_name": "jonge-democraten/mezzanine-fullcalendar", "id": "3d5eb9805f4ab49cb448f33a59cf37ae503fb857", "si...
from django.shortcuts import render from django.views.generic import DetailView from .models import Movie class MovieDetailView(DetailView): model = Movie template_name = "movies/detail.html"
{ "content_hash": "90a8893e4624b15cf4330f573efac3b7", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 43, "avg_line_length": 25.125, "alnum_prop": 0.7860696517412935, "repo_name": "juliancantillo/royal-films", "id": "384c0aceb4226c184d3c5a7682efbe14e2016384", "size": "201", ...
import datetime def compute_latest_post(media_list): if len(media_list) == 0: return None return datetime.datetime.now()-media_list[0].created_time def compute_average_post(media_list): if len(media_list) == 0: return None return (media_list[0].created_time - media_list[-1].created_time).days/(1.0*len(...
{ "content_hash": "0d65331716b92db5991ce1da76c6ee74", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 94, "avg_line_length": 36, "alnum_prop": 0.7032828282828283, "repo_name": "btabibian/instagramInactive", "id": "0e930d108734f87184108a736cbaea4fcf5e2e99", "size": "792", ...
import logging from grappa import log def test_log_module(should): log | should.be.a('module') log | should.have.property('handler') log | should.have.property('log') > should.be.instance.of(logging.Logger) (log | should.have.property('formatter') > should.be.instance.of(logging.Form...
{ "content_hash": "a4149b346326ade3491b78044a117056", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 77, "avg_line_length": 25.23076923076923, "alnum_prop": 0.6676829268292683, "repo_name": "grappa-py/grappa", "id": "34a07e87ecd94ad94c3d9cabc1d75d51b55e22a2", "size": "328"...
from django.conf.urls import patterns, include, url from django.contrib import admin from tastypie.api import Api from apps.mds_auth.api import SocialSignUpResource, BackendResource, UserResource, ProfileResource from apps.muni_scales.api import MscaleResource, UDHResource, UXCResource from apps.trails.api import Trai...
{ "content_hash": "8bd9b1522f4d05f73f11dc2b956a3b5f", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 98, "avg_line_length": 45.026315789473685, "alnum_prop": 0.7293980128579778, "repo_name": "schocco/mds-web", "id": "f61260d60a0efe489960ead4e2083a2eeca46d92", "size": "1711...
import vanilla import urlparse import fnmatch import base64 import bencode import struct import socket import peers import posixpath from eventlet.green import zmq import cPickle as pickle import eventlet.queue import fairywren import itertools import logging import array def sendBencodedWsgiResponse(env,start_respons...
{ "content_hash": "43e0b3e49de9345cb31708dc924b79a5", "timestamp": "", "source": "github", "line_count": 294, "max_line_length": 124, "avg_line_length": 30.397959183673468, "alnum_prop": 0.6966543582857783, "repo_name": "hydrogen18/fairywren", "id": "523be045afab95981f618d837c88eebb38f83355", "size"...
__author__ = "gaunt" from . import SysRoleAuthorities def get_authorities(role_id): sql = SysRoleAuthorities.select(SysRoleAuthorities.authority).where(SysRoleAuthorities.role_id == role_id) result = [f for f in sql.dicts()] return result
{ "content_hash": "fdeeb852396084cfc03daec8b5cbebbb", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 110, "avg_line_length": 25.5, "alnum_prop": 0.7215686274509804, "repo_name": "chenghao/haoAdmin", "id": "1e9d7ff54e38a5274e8758bd2e5588a172c26e72", "size": "270", "binary...
""" File used to synchronize operations between processes """ import os class LockFile(object): """ Use this to lock operations that need to occur only once, even if several processes try to run the operation. It works by getting an exclusive lock on the listed file. It will fail with an exception if the lock a...
{ "content_hash": "0d430b8d501a5b13a546783cd2d74dc3", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 78, "avg_line_length": 27.31111111111111, "alnum_prop": 0.6802278275020341, "repo_name": "blindsightcorp/rigor", "id": "1c49703f28f036f4d4ac9547a92dd0ad4100c1c4", "size": "...
"""Generic helper functions useful in tests (App Engine only).""" import datetime from clusterfuzz._internal.tests.test_libs import test_utils from libs.issue_management import monorail from libs.issue_management.monorail.comment import Comment from libs.issue_management.monorail.issue import Issue def create_gener...
{ "content_hash": "dad85e2b9ecb8f8d65fca2dfdc5f2d40", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 79, "avg_line_length": 27.695121951219512, "alnum_prop": 0.6437692646411273, "repo_name": "google/clusterfuzz", "id": "af447e286a00e7f9690db076605ef4b61fbfff55", "size": "2...
import os import six import socket import xdrlib from oslo_config import cfg from oslo_log import log as logging from random import randint from cinder import exception from cinder.i18n import _ from cinder.volume.drivers import nfs # # RPC Definition # RPCVERSION = 2 CALL = 0 REPLY = 1 AUTH_NULL = 0 MSG_ACCEPTE...
{ "content_hash": "f8a883d8b3e1bbb96248fe7c93599c6d", "timestamp": "", "source": "github", "line_count": 382, "max_line_length": 78, "avg_line_length": 32.40575916230367, "alnum_prop": 0.582034089991114, "repo_name": "apporc/cinder", "id": "0b2c3f8fbd4181e3a06a4d75bdf9857a3f7695ab", "size": "13014",...
import tensorflow as tf from dnc.dnc import * from recurrent_controller import * graph = tf.Graph() config = tf.ConfigProto(allow_soft_placement=True) config.gpu_options.allow_growth = True graph_nodes = None nodes = {} with graph.as_default(): with tf.Session(graph=graph, config=config) as session: nco...
{ "content_hash": "e0a88c3676ce40aa8a74568fbf096132", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 109, "avg_line_length": 25.785714285714285, "alnum_prop": 0.5170821791320406, "repo_name": "HimariO/VideoSum", "id": "a52129836e84c8326d62f380ae716ff95d321c2c", "size": "10...
from concurrent_tree_crawler.html_multipage_navigator.web_browser import \ MechanizeBrowserCreator from concurrent_tree_crawler.html_multipage_navigator.throttled_web_browser \ import ThrottledWebBrowserCreator from concurrent_tree_crawler.common.threads.token_bucket import \ TokenBucketFiller, StandardTokenBucket f...
{ "content_hash": "34181eee75c82b64da4ab80a4d3327d3", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 85, "avg_line_length": 37.68115942028985, "alnum_prop": 0.7584615384615384, "repo_name": "mkobos/tree_crawler", "id": "f389491eb1c8abc58a1985af76254f6511ca0513", "size": "2...
import time DEFAULT_REDIS_KEY = 'kamikaze' class Package(object): """ Instances of this class store the values of a package on the kamikaze queue This item should be treated as immutable """ def __init__(self, payload, expire_time, score): self._payload = payload self._expire_ti...
{ "content_hash": "4ecedda3bea5b467b81caa182ec56282", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 79, "avg_line_length": 24.988505747126435, "alnum_prop": 0.6039558417663293, "repo_name": "brendanmaguire/kamikaze", "id": "c495c51f277eafe23bf366c3e6f424b5d5bb033e", "size...
import sys import redis import csv import os import posixpath import datetime import logging import logging.handlers from email.utils import parsedate # Make sure our PyPI directory is on the sys.path root = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path = [root] + sys.path import config conf ...
{ "content_hash": "ece1a66deb1735892342e5158c57d32d", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 85, "avg_line_length": 26.63529411764706, "alnum_prop": 0.6435512367491166, "repo_name": "pydotorg/pypi", "id": "c2f7e4ff7205348dbf3b9a90e1402add947b4112", "size": "2285", ...
import sys import itk if len(sys.argv) != 4: print("Usage: " + sys.argv[0] + " <inputImage> <outputImage> <sigma>") sys.exit(1) inputImage = sys.argv[1] outputImage = sys.argv[2] sigma = float(sys.argv[3]) PixelType = itk.UC Dimension = 2 ImageType = itk.Image[PixelType, Dimension] reader = itk.ImageFileRe...
{ "content_hash": "8f83ad8d3494112363316f79d685fc7b", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 84, "avg_line_length": 23.857142857142858, "alnum_prop": 0.7544910179640718, "repo_name": "InsightSoftwareConsortium/ITKExamples", "id": "b58c57d4039f1298c6d9a7f3df1b94259fb2...
"""Utility methods for working with WSGI servers.""" import copy from oslo import i18n from oslo.serialization import jsonutils from oslo.utils import importutils from oslo.utils import strutils import routes.middleware import six import webob.dec import webob.exc from keystone.common import config from keystone.com...
{ "content_hash": "08c283f7078a5db8b05c779b45dc098e", "timestamp": "", "source": "github", "line_count": 783, "max_line_length": 79, "avg_line_length": 37.04214559386973, "alnum_prop": 0.5901944559371122, "repo_name": "ging/keystone", "id": "6205321466d02adda87879348ff1b083f196ab69", "size": "29812"...
import os.path as osp import pprint from chainer import training import yaml class ParamsReport(training.Extension): def __init__(self, params, file_name='params.yaml'): self._params = params self._file_name = file_name def __call__(self, trainer): pass def initialize(self, tra...
{ "content_hash": "2a9f614e730bc4937e9a2dbed1978e40", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 69, "avg_line_length": 25.636363636363637, "alnum_prop": 0.5957446808510638, "repo_name": "wkentaro/fcn", "id": "193a193edb6a4517c036cb34be7780a855012f00", "size": "564", ...
from google.cloud import talent_v4 async def sample_batch_delete_jobs(): # Create a client client = talent_v4.JobServiceAsyncClient() # Initialize request argument(s) request = talent_v4.BatchDeleteJobsRequest( parent="parent_value", ) # Make the request operation = client.batch_...
{ "content_hash": "cfff5189a3b0f9c41924e7146ad78fbf", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 58, "avg_line_length": 23.82608695652174, "alnum_prop": 0.7007299270072993, "repo_name": "googleapis/python-talent", "id": "3fc26c7d6cbd04b62186ae8243fe4e4602be88bd", "size...
import pytest from openstack_dashboard.test.integration_tests import helpers from openstack_dashboard.test.integration_tests.regions import messages class TestInstances(helpers.TestCase): INSTANCE_NAME = helpers.gen_random_resource_name('instance', timestamp=F...
{ "content_hash": "9327f3992057c068270917b144a3319c", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 79, "avg_line_length": 46.01639344262295, "alnum_prop": 0.6389383683648023, "repo_name": "ChameleonCloud/horizon", "id": "fcd696f55ac39b244e5db891e45a75729fd6215e", "size"...
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def CustomizationEvent(vim, *args, **kwargs): '''Base for customization events.''' ...
{ "content_hash": "2786eb79344d55fb62121f41fc99fab3", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 124, "avg_line_length": 34.84848484848485, "alnum_prop": 0.5947826086956521, "repo_name": "xuru/pyvisdk", "id": "6f35913f5607773cf108a9a32a5a324c96eedf4a", "size": "1151", ...
import sys import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General conf...
{ "content_hash": "d78b60c232143be6ca4c90048d3f66dc", "timestamp": "", "source": "github", "line_count": 255, "max_line_length": 79, "avg_line_length": 31.294117647058822, "alnum_prop": 0.7026315789473684, "repo_name": "salas106/irc-ltl-framework", "id": "8b29c44f2e97a95010009b0c4ad7156837ef1158", "...
from django.contrib.contenttypes.models import ContentType from django.db import transaction from django.db.models import Q from django.forms import ModelChoiceField from django.http import QueryDict from django.template import loader from django.urls.base import reverse from django.utils.decorators import method_decor...
{ "content_hash": "cd2dedd8a2f8be4a8b0f733cd96644d4", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 128, "avg_line_length": 30.617021276595743, "alnum_prop": 0.6813064628214037, "repo_name": "alexsilva/django-xadmin", "id": "9c7b0b3cff6c39a9cdb7d03246722bb8035707b8", "si...
from .utils import connect_foirequest def connect_campaign(sender, **kwargs): reference = kwargs.get("reference") if not reference: reference = sender.reference if not reference: return if "@" in reference: parts = reference.split("@", 1) else: parts = reference.spl...
{ "content_hash": "631bc182b5d91a6dc1c1301b48fb1e94", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 41, "avg_line_length": 24.333333333333332, "alnum_prop": 0.6118721461187214, "repo_name": "fin/froide", "id": "c9d88bc712674e5de83cfbbbe6ba3d008419a6a2", "size": "438", "...
"""Entity to track connections to websocket API.""" from homeassistant.core import callback from homeassistant.helpers.entity import Entity from .const import ( SIGNAL_WEBSOCKET_CONNECTED, SIGNAL_WEBSOCKET_DISCONNECTED, DATA_CONNECTIONS, ) async def async_setup_platform(hass, config, async_add_entities,...
{ "content_hash": "599ea6fee5ffc1299428aa3a501e68a8", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 86, "avg_line_length": 27.054545454545455, "alnum_prop": 0.6438172043010753, "repo_name": "fbradyirl/home-assistant", "id": "1ae76b562525c888eeae04819f1112f47e54e061", "siz...
import argparse import time # from pygecko import TopicSub # from pygecko.transport import zmqTCP, GeckoCore from pygecko.multiprocessing import geckopy from pygecko.test import GeckoSimpleProcess try: import simplejson as json except ImportError: import json def handleArgs(): parser = argparse.ArgumentP...
{ "content_hash": "1dc085ff1d2ff0421a2146b4bcab6d60", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 133, "avg_line_length": 29.174311926605505, "alnum_prop": 0.6, "repo_name": "walchko/pygecko", "id": "c2b2d4cafa0a3f87f2ec6405d08536767e43dea7", "size": "3435", "binary"...
from unittest import mock from ddt import data, ddt from pylxd.deprecated import connection, exceptions from pylxd.deprecated.tests import LXDAPITestBase, annotated_data, fake_api @ddt @mock.patch.object( connection.LXDConnection, "get_object", return_value=("200", fake_api.fake_host()) ) class LXDAPIHostTestOb...
{ "content_hash": "884f028034c486175e7483337bc0c520", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 86, "avg_line_length": 33, "alnum_prop": 0.5863177226813591, "repo_name": "lxc/pylxd", "id": "1220ff38879e698442c5ec17574bdc3a178f8a34", "size": "2788", "binary": false, ...
from CalFord import * import argparse import sys,os import re pmapFile = "" outputResultFile = "" outputHistogramFile = "" configFile = "calford.conf" outputHandle = None def argsSanityCheck(): isOk = True if not os.path.isfile(pmapFile): print "Error: cannot find %s"%pmapFile isOk = False retur...
{ "content_hash": "eb894a6a7f2a718a0a00ac149ec186e6", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 111, "avg_line_length": 28.2125, "alnum_prop": 0.6154186973859105, "repo_name": "tdangkhoa/calford", "id": "e5f91f9a60172897809e7131fa128b359ed390c2", "size": "4586", "b...
import numpy import matplotlib import pylab from numba import autojit @autojit def iterMandel(x, y, iterMax): """ Dadas las partes real e imaginaria de un numero complejo, determina la iteracion en la cual el candidato al conjunto de Mandelbrot se escapa. """ c = complex(x, y) z = 0.0j ...
{ "content_hash": "691a12d712166a2c17a9109901293474", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 88, "avg_line_length": 27.771929824561404, "alnum_prop": 0.6298168035375868, "repo_name": "robblack007/mandelbrot-sets", "id": "ed3baf9475e0730f03cb1ffc04336be0d57fbb3e", "...
import pyaf import numpy as np import pandas as pd DATA_FREQ = 'M' PERIODS = ["M" , "Q" , "A"] H = 36 N = H * 10 lDateColumn = "Date" lSignalVar = "Signal"; START_TIME = "2001-01-25" # generate a daily signal covering one year 2016 in a pandas dataframe np.random.seed(seed=1960) df_train = pd.DataFrame({lDateColumn ...
{ "content_hash": "d9c45c2d14eed4ea9df7c337f6bfe9f7", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 99, "avg_line_length": 26.017241379310345, "alnum_prop": 0.6905235255135852, "repo_name": "antoinecarme/pyaf", "id": "7673d5a4ee827862196dc9c993855c30c8b46184", "size": "15...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('catalogue', '0003_delete_member'), ('member', '0001_initial'), ] operations = [ migrations.AddField( model_name='member', ...
{ "content_hash": "0af7f25383dbc2f09428552afbd831fa", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 62, "avg_line_length": 22.105263157894736, "alnum_prop": 0.5833333333333334, "repo_name": "R-Wolf/CFD_A_library", "id": "d0f9f96bbffcd7b04d35f6c66b41eb279f70e1fc", "size": ...
import unittest from openfermion.ops import BinaryCode, FermionOperator, QubitOperator from openfermion.transforms import binary_code_transform, dissolve class CodeTransformTest(unittest.TestCase): def test_transform(self): code = BinaryCode([[1, 0, 0], [0, 1, 0]], ['W0', 'W1', '1 + W0 + W1']) ha...
{ "content_hash": "669764561caf1cf01abfce3e9b775b58", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 78, "avg_line_length": 44.57142857142857, "alnum_prop": 0.5230769230769231, "repo_name": "jarrodmcc/OpenFermion", "id": "76ea3c8faa6edef42fd794aad60e91eb9ea6cda0", "size": ...
from typing import Optional import numpy as np from ConfigSpace.configuration_space import ConfigurationSpace from ConfigSpace.hyperparameters import ( CategoricalHyperparameter, Constant, UniformFloatHyperparameter, UniformIntegerHyperparameter, UnParametrizedHyperparameter, ) from autosklearn.as...
{ "content_hash": "b420d36e66bb9e7150fa464ee8f36b4a", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 82, "avg_line_length": 33.7514450867052, "alnum_prop": 0.5995889707141634, "repo_name": "automl/auto-sklearn", "id": "10e741a44e2039ad7afed0560b1fd5d1b5add71e", "size": "5...
import boto3 import botocore import logging import json import time import custom_exceptions import os import shutil import tempfile class DBS3: def __init__(self,bucket): self.log = logging.getLogger("DB.S3") self.bucket = bucket self.client = boto3.client('s3') self.indexDirectory = "/tmp/pageIndex" def ...
{ "content_hash": "9f21d12adde7b2c72fd54eb82f6c73e3", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 126, "avg_line_length": 27.88125, "alnum_prop": 0.7146379735485318, "repo_name": "intirix/serverless-wiki", "id": "28c0afd4dea5428f2ed1200ea54b20c71ef87770", "size": "4480...
from classifiers import abstract_classifier as ac from classifiers import classifiers_helper as helper #from sklearn.naive_bayes import GaussianNB from sklearn.naive_bayes import BernoulliNB class NaiveBayesScikit(ac.AbstractClassifier): def __repr__(self): return "<NaiveBayesScikit>" def __str__(sel...
{ "content_hash": "351a13142bb7216a902343aff5a4b3a0", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 68, "avg_line_length": 32.46153846153846, "alnum_prop": 0.6800947867298578, "repo_name": "Rolinh/tweetmining", "id": "d00e24c48b7cdaebce3d14b7a7980b8e787f2528", "size": "84...
from django import forms from django.contrib.auth.models import User from models import Profile from django.contrib.auth.forms import UserCreationForm # our new form class SeeJobsForm(forms.Form): job_title = forms.CharField(required=True) city = forms.CharField(required=False) state = forms.CharField(req...
{ "content_hash": "be1f726f8696b57b1f4edb148e5841db", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 91, "avg_line_length": 29.885714285714286, "alnum_prop": 0.6787762906309751, "repo_name": "Qlwentt/qually", "id": "5be7c778db4fa75c55d5de68325d26a55d566bc5", "size": "1097"...
import csv import errno import flask import os from werkzeug.exceptions import Forbidden, NotFound from .constants import REPORT_DIR, REPORT_EXT def raise_errno(err): if err.errno in [errno.EPERM, errno.EACCES]: raise Forbidden elif err.errno == errno.ENOENT: raise NotFound else: ...
{ "content_hash": "04d6d56804c37b43def9fe7dbb88d2a4", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 75, "avg_line_length": 26.152173913043477, "alnum_prop": 0.6658354114713217, "repo_name": "bhrutledge/dsvbrowser", "id": "46a45d2cb8ac09d5ecc3679e704191e598a04f65", "size":...
"""Tests for core.storage.feedback.gae_models.""" from __future__ import annotations import types from core import feconf from core import utils from core.domain import feedback_domain from core.domain import feedback_services from core.platform import models from core.tests import test_utils from typing import Dic...
{ "content_hash": "ec118f9e21c7d2ce603d3b4941ca2d06", "timestamp": "", "source": "github", "line_count": 545, "max_line_length": 106, "avg_line_length": 40.579816513761465, "alnum_prop": 0.6226713691445107, "repo_name": "brianrodri/oppia", "id": "56e711b0e42060ea808591421e509a0487e3d31a", "size": "2...
import asyncio from sanic import Sanic from sanic import response from sanic.config import Config from sanic.exceptions import RequestTimeout Config.REQUEST_TIMEOUT = 1 app = Sanic(__name__) @app.route('/') async def test(request): await asyncio.sleep(3) return response.text('Hello, world!') @app.exception...
{ "content_hash": "d41a1d232ca5a383db14f1a95e40cd97", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 67, "avg_line_length": 22.523809523809526, "alnum_prop": 0.7463002114164905, "repo_name": "jrocketfingers/sanic", "id": "fb2822eeb34a5fe6c782d6209138aa8ac473631d", "size": ...
import sys import argparse import json # Import smtplib to provide email functions import smtplib # Import the email modules from email.mime.text import MIMEText try: from .mac_notify import notify as mac_notify mac_notifications = True except Exception as ex: mac_notifications = False print( "Faile...
{ "content_hash": "16d4c9312717941f574b7de7df433b02", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 140, "avg_line_length": 31.77922077922078, "alnum_prop": 0.6526358806702084, "repo_name": "Bleyddyn/malpi", "id": "16e76a9640e70db5e69f3309421389d497ef1d45", "size": "2467"...
import numpy as np def topattern(pd, patlen, patternlength): m=np.zeros((len(pd), patternlength)) for i, ID in enumerate(pd.keys()): starts = pd[ID] length = patlen[ID] for t in starts: start = min(t, patternlength) le = min(length, patternlength - t) m[i, start: t + le] = 1 return m class Pattern...
{ "content_hash": "a123265fad2c115546ac8c8ea80c71b9", "timestamp": "", "source": "github", "line_count": 358, "max_line_length": 210, "avg_line_length": 35.76536312849162, "alnum_prop": 0.6629959387691347, "repo_name": "zjonke/EImotif", "id": "85f9f5636575a3c29bc9f3fc9ffb663d2b28df53", "size": "1280...
'''Bookstore Stores IPython notebooks automagically onto OpenStack clouds through Swift. ''' __title__ = 'bookstore' __version__ = '1.0.0' __build__ = 0x010000 __author__ = 'Kyle Kelley' __license__ = 'Apache 2.0' __copyright__ = 'Copyright 2013 Kyle Kelley' from .swift import SwiftNotebookManager from .openstack im...
{ "content_hash": "672ccad8e671c3535bc55ccf64f6316f", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 75, "avg_line_length": 26.666666666666668, "alnum_prop": 0.745, "repo_name": "MatthewTurk/bookstore", "id": "b051534888c0d3cfecf43b5b23e985d2cb29b8bf", "size": "447", "bi...
import json import sys # # fio_latency2csv.py # # This tool converts fio's json+ completion latency data to CSV format. # For example: # # fio_latency2csv.py fio-jsonplus.output fio-latency.csv # import os # import json import argparse def parse_args(): parser = argparse.ArgumentParser() parser.add_argument...
{ "content_hash": "ffe41a8cffff5a2f7b49d174017d5889", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 95, "avg_line_length": 33.8974358974359, "alnum_prop": 0.5542107917297024, "repo_name": "msterin/play", "id": "0f7588b3c13e5302b43de68677acbc012e552dfa", "size": "4263", ...
import _plotly_utils.basevalidators class MarkerValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__(self, plotly_name="marker", parent_name="splom.unselected", **kwargs): super(MarkerValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
{ "content_hash": "922f6042301a9434efe97c8c963d4db7", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 87, "avg_line_length": 36.68, "alnum_prop": 0.5528898582333697, "repo_name": "plotly/python-api", "id": "c80a741d59d31b26101cc41ede93a37e34b4df76", "size": "917", "binary...
import ShtikerPage from direct.gui.DirectGui import * from pandac.PandaModules import * from toontown.toonbase import ToontownGlobals from toontown.toonbase import TTLocalizer from toontown.suit import SuitDNA from toontown.battle import SuitBattleGlobals from toontown.minigame import MinigamePowerMeter from toontown.c...
{ "content_hash": "6962457097e5d21f3dcb280ada142593", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 444, "avg_line_length": 51.56122448979592, "alnum_prop": 0.6270532357015635, "repo_name": "ksmit799/Toontown-Source", "id": "bc485bf9604340530f740f91812b062320d804bf", "si...
import sys import sqlalchemy from SQLiteConnection import engine, Session from ModelClasses import * filename = 'student_data.txt' data = open(filename) lines = data.readlines() data.close() session = Session() for line in lines[5:]: line = line.split("|") #print line try: a_student = session.query(Student)....
{ "content_hash": "64005755272f8cae57c3731a9db977a7", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 113, "avg_line_length": 23.43076923076923, "alnum_prop": 0.685489166119501, "repo_name": "rcmorehead/scicoder2014", "id": "40335ada2521e087e90853125bb6b87b074c7399", "size"...
"""Test RPC commands for signing and verifying messages.""" from test_framework.test_framework import IonTestFramework class SignMessagesTest(IonTestFramework): def __init__(self): super().__init__() self.setup_clean_chain = True self.num_nodes = 1 def run_test(self): message...
{ "content_hash": "c5f03ab3e2ac62b6489929fe27692000", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 74, "avg_line_length": 33.25806451612903, "alnum_prop": 0.6702230843840931, "repo_name": "aspaas/ion", "id": "cfc57b17bc979f8b83b0df7671964fc5e10680ee", "size": "1240", "...
import csv import json import traceback import re import sys import warnings from ..sentence import * from ..word import * warnings.filterwarnings("ignore", category=FutureWarning, module="__main__") ################################################################################ #### HELPER FUNCTIONS ##############...
{ "content_hash": "042ef6b9a73094828fb17981ac931be2", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 100, "avg_line_length": 41.61340206185567, "alnum_prop": 0.5362318840579711, "repo_name": "meyersbs/uncertainty", "id": "63d26651335bb50002c28d743db05092fd5f1321", "size":...
from jsg import Document from jsg.fields import NumberField, IntField from utils import check_schema, schema import pytest def test_resolve(schema): @schema.add() class A(Document): a = IntField() schema.resolve(A) def test_extra(schema): @schema.add() class A(Document): a = Int...
{ "content_hash": "ad3b340982bb974dc11b9469ae9090b6", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 61, "avg_line_length": 20.92105263157895, "alnum_prop": 0.4691823899371069, "repo_name": "pbutler/jsg", "id": "824f64c6c6e64733621b94dce959e2f782dedc1a", "size": "796", "...
def pancake(): D = int(input()) P = map(int, raw_input().strip().split()) time = max(P) # Try to split each plate into target count of pancakes, and count waiting time for cnt in xrange(2, max(P)): wait = 0 for cakes in P: wait += (cakes-1)//cnt time = min(ti...
{ "content_hash": "0918664c5ec0df5205a4d4129db0b565", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 83, "avg_line_length": 28.466666666666665, "alnum_prop": 0.5480093676814989, "repo_name": "kamyu104/GoogleCodeJam-2015", "id": "6c89cb3e3ce7d48003663667aa06c80a0d5f2cac", "...
_platform_backends_to_devtools_clients_maps = {} def _RemoveStaleDevToolsClient(platform_backend): """Removes DevTools clients that are no longer connectable.""" devtools_clients_map = _platform_backends_to_devtools_clients_maps.get( platform_backend, {}) devtools_clients_map = { port: client ...
{ "content_hash": "41f8f7f358f7a467db48093b57ee14c8", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 79, "avg_line_length": 36.61538461538461, "alnum_prop": 0.7478991596638656, "repo_name": "endlessm/chromium-browser", "id": "d6565b1040297651d04b513c20eaf0d3b12f3a45", "siz...
import os import sys from setuptools import find_packages from setuptools import setup version = '1.32.0.dev0' install_requires = [ 'dnspython>=1.15.0', 'setuptools>=41.6.0', ] if not os.environ.get('SNAP_BUILD'): install_requires.extend([ # We specify the minimum acme and certbot version as the...
{ "content_hash": "24c5cd4baa2fe65170db0b628e7c7456", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 84, "avg_line_length": 31.34246575342466, "alnum_prop": 0.6140734265734266, "repo_name": "lmcro/letsencrypt", "id": "670654c4231e8fdf4eccc4a75a587557fb95163b", "size": "228...
from __future__ import division, absolute_import, division from sklearn.preprocessing import LabelEncoder from .base import _validate_X_y_ratio_classes from ..utils import get_random_state, DEFAULT_SEED from . import base import numpy as np __all__ = [ 'over_sample_balance' ] def over_sample_balance(X, y, balanc...
{ "content_hash": "6bdd3fcf33ef38aaa627fb3cff68dec8", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 103, "avg_line_length": 38.51898734177215, "alnum_prop": 0.6375287545185672, "repo_name": "tgsmith61591/smrt", "id": "48955dcc181792549b9b7a393125d6ac222a0d50", "size": "32...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "MovingMedian", cycle_length = 30, transform = "Quantization", sigma = 0.0, exog_count = 0, ar_order = 12);
{ "content_hash": "ddbc847bbc9de5e91280706b4378e4d7", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 170, "avg_line_length": 38.57142857142857, "alnum_prop": 0.7111111111111111, "repo_name": "antoinecarme/pyaf", "id": "34c7e1908a013ffdfd59077a3215a56eaf342493", "size": "270...