text
stringlengths
4
1.02M
meta
dict
""" Description here """ from IDSS import IDSS from database import SeriationDatabase, SeriationRun, \ SeriationFileLocations, SeriationProfilingData, SeriationRunParameters, \ FrequencySeriationResult, OccurrenceSeriationResult, ContinuitySeriationResult
{ "content_hash": "a32ebfc5804e85333ff74637af0a4a7c", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 82, "avg_line_length": 26.6, "alnum_prop": 0.8270676691729323, "repo_name": "clipo/idss-seriation", "id": "cfabdff3d7064eac31663ae39e83845c21f4c39a", "size": "470", "bina...
""" Support for eQ-3 Bluetooth Smart thermostats. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/climate.eq3btsmart/ """ import logging import voluptuous as vol from homeassistant.components.climate import ClimateDevice, PLATFORM_SCHEMA from homeassist...
{ "content_hash": "c61a71bc2aa66299b3fa8d59822b04bc", "timestamp": "", "source": "github", "line_count": 203, "max_line_length": 77, "avg_line_length": 31.014778325123153, "alnum_prop": 0.6313532401524777, "repo_name": "HydrelioxGitHub/home-assistant", "id": "c7c5973fb865333fec33aa8d5537f511a1bc6542",...
'''Code from python notebook by simoninithomas available at https://github.com/simoninithomas/Deep_reinforcement_learning_Course/blob/master/Q%20learning/Q%20Learning%20with%20FrozenLake.ipynb ''' import numpy as np import gym import random env = gym.make("FrozenLake-v0") action_size = env.action_space.n state_siz...
{ "content_hash": "c56f4897361bfa14e2e6f795f3233baa", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 145, "avg_line_length": 30.756756756756758, "alnum_prop": 0.5946104276508495, "repo_name": "minimalparts/Tutorials", "id": "525a8e2a72b4ff5a4cc2bfc6eec80fc17a9784d0", "siz...
"""A device that can be attached to""" from Device import * class Attachable(Device): def __init__(self): """ Create a device that can be attached to. """ Device.__init__(self) self.menu.addAction("Restart", self.restart) self.menu.addAction("Stop", sel...
{ "content_hash": "364a37360bb125404c6d068617098fbd", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 105, "avg_line_length": 36.640625, "alnum_prop": 0.4814498933901919, "repo_name": "anrl/gini3", "id": "05b7f04484cca0548d639cc32ac8e98bcdd54210", "size": "2345", "binary"...
import hashlib import os import sys from io import BytesIO from PIL import Image, ImageDraw from django.conf import settings ''' p14(32): PLACEHOLDER SERVER IMAGE ''' DEBUG = os.environ.get('DEBUG', 'on') == 'on' SECRET_KEY = os.environ.get('SECRET_KEY', '&^y=98vyeg910i!p&1r9g&=odw5a=u-ko%t^4qhok!&l!256p1')...
{ "content_hash": "8da17bbd7629f2a91a39b34113987ff8", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 74, "avg_line_length": 29.595419847328245, "alnum_prop": 0.6321898375032241, "repo_name": "mezklador/lightweight-django", "id": "27b029d57cca2755bed5d29882ba0df460de31a4", ...
import inspect import random import shutil import os from .model import RIDE class Runner(object): def __init__(self, seed, path, root): self._path = path self._root = root self._seed = seed self._model = None self._random = random def initialize(self): shuti...
{ "content_hash": "9808c978b0ca27e78fd495b21c91fc5a", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 68, "avg_line_length": 26.839285714285715, "alnum_prop": 0.5602129075182968, "repo_name": "HelioGuilherme66/RIDE", "id": "fc1b05e11ae846af0d10376078a174b253238c04", "size":...
'''Driver for the TSL2561 digital luminosity (light) sensors. Pick one up at http://www.adafruit.com/products/439 Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! Code ported from Adafruit Arduino library, comm...
{ "content_hash": "61b9b751e3b4997c89dd80789c7d6e67", "timestamp": "", "source": "github", "line_count": 317, "max_line_length": 92, "avg_line_length": 34.586750788643535, "alnum_prop": 0.5784385260853703, "repo_name": "leandog/tsl2561", "id": "7a63ccb258257b3d863fefc2b7480613d61b4a62", "size": "109...
import random import torch import torch.nn as nn from torch.autograd import Variable from torch import optim import torch.nn.functional as F import pickle as pk use_cuda = torch.cuda.is_available() SOS_token = 0 EOS_token = 1 MAX_LENGTH = 80 class Dataset: def __init__(self, name): self.name = name ...
{ "content_hash": "84187205c237b510f4988a7dbf62b9aa", "timestamp": "", "source": "github", "line_count": 309, "max_line_length": 133, "avg_line_length": 36.385113268608414, "alnum_prop": 0.6317708796584541, "repo_name": "RITct/Rita", "id": "78608c425af91e2683073e392909750598cbd3a2", "size": "11243",...
""" The trim loss problems arises in the paper industry. The problem is to cut wide papers rolls into sub rolls (orders). The wide roll are cut into pieces with a cutting pattern. A cutting pattern defines the blades positions for cutting the roll. A maximum number of orders is allowed in a cutting pattern (here it i...
{ "content_hash": "aa893ed6ca9025505c50fc859520519c", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 141, "avg_line_length": 38.36585365853659, "alnum_prop": 0.6240728968001695, "repo_name": "IBMDecisionOptimization/docplex-examples", "id": "6569c173c50077e2ee47a33ffe3a0151...
from mock import call, Mock from pytest import fixture from mailthon.enclosure import PlainText from mailthon.postman import Session, Postman from mailthon.response import SendmailResponse from .utils import mocked_smtp, unicode class FakeSession(Session): def __init__(self, **kwargs): self.opts = kwargs ...
{ "content_hash": "aa3eab1bc8f6c506e467a070bdd7c0c4", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 67, "avg_line_length": 28.02061855670103, "alnum_prop": 0.5853568800588668, "repo_name": "eugene-eeo/mailthon", "id": "b52f0ff5e9f2ff247103e1684bbe081d0942c00e", "size": "2...
import sys from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy from ._version import VERSION if sys.version_info >= (3, 8): from typing import ...
{ "content_hash": "ed369dccf0abb27b945bd6718502a429", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 107, "avg_line_length": 49.46268656716418, "alnum_prop": 0.7100181050090525, "repo_name": "Azure/azure-sdk-for-python", "id": "2b49763625623e8567ec1a4d49cb9655e79e1c21", "s...
"""Function signature objects for callables. Back port of Python 3.3's function signature tools from the inspect module, modified to be compatible with Python 2.7 and 3.2+. """ #----------------------------------------------------------------------------- # Python 3.3 stdlib inspect.py is public domain # # Backpor...
{ "content_hash": "b88b810d93de035c89315d1c58939e48", "timestamp": "", "source": "github", "line_count": 816, "max_line_length": 84, "avg_line_length": 36.372549019607845, "alnum_prop": 0.5324797843665768, "repo_name": "initNirvana/Easyphotos", "id": "771899e6a9004967783c8a66e93ef6c6293bfbce", "size...
"""Stub API calls used in dataproc.py for testing. Instead of doing real API calls, we return test JSON data. """ from gcpdiag.queries import apis_stub #pylint: disable=unused-argument class DataprocApiStub: """Mock object to simulate dataproc api calls.""" def projects(self): return self def regions(s...
{ "content_hash": "cd31fa39a5c95113d96f8fd981fd9e3b", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 64, "avg_line_length": 22.51851851851852, "alnum_prop": 0.6381578947368421, "repo_name": "GoogleCloudPlatform/gcpdiag", "id": "c0910548e26519bd6372b01646c27ff41023c0e4", "s...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'ProjectRepo' db.create_table(u'unicoremc_projectrepo', ( ('project', ...
{ "content_hash": "4cc3118ca42f26a5ccb94dd02a89ff4c", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 223, "avg_line_length": 75.77777777777777, "alnum_prop": 0.5689149560117303, "repo_name": "universalcore/unicore-mc", "id": "598b8d4c61ea55c0cede593307d6fa567ca2241d", "si...
"""Settings related to authentication""" # pylint: disable=invalid-name,line-too-long import environ env = environ.Env( LOGIN_REDIRECT_URL=(str, '/messages/'), POST_LOGOUT_PAGE=(str, '/'), ACCOUNT_EMAIL_VERIFICATION=(str, 'optional'), ACCOUNT_IGNORE_UNSUBSCRIBE=(bool, True) ) #### # URLs exempt from ...
{ "content_hash": "fc9c93fb5e263ad52d41cc30cdce76a5", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 74, "avg_line_length": 26.3, "alnum_prop": 0.6762629005975014, "repo_name": "ofa/connect", "id": "5ef93eb0cc9f98eba16389eb935ce66720cc70e2", "size": "1841", "binary": fal...
DOCUMENTATION = '''This module will create refresh kerberos principal for specified user on his own account if it will expire in next 15 min.''' EXAMPLES = ''' You have to specify user and password for kerberos - name: Refresh ekerberos: usr='root' pass='kerberos_password' ''' from ansible.module_utils.basic im...
{ "content_hash": "951f7c14257e1acf1fe699052ed5877e", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 144, "avg_line_length": 36.644067796610166, "alnum_prop": 0.6419981498612396, "repo_name": "trustedanalytics/platform-ansible", "id": "a75d1a021bb1582a9331121845ce440e146cf9c...
from __future__ import absolute_import from pyemma.util import types ''' Created on 19.01.2015 @author: marscher ''' from .transformer import Transformer, SkipPassException from pyemma.util.linalg import eig_corr from pyemma.util.annotators import doc_inherit from pyemma.util.reflection import get_default_args impor...
{ "content_hash": "e04aa835795192d9baba669aefda904d", "timestamp": "", "source": "github", "line_count": 477, "max_line_length": 122, "avg_line_length": 39.343815513626836, "alnum_prop": 0.5627431129109607, "repo_name": "trendelkampschroer/PyEMMA", "id": "09f5b231524a318efbd550ca2c891519256c43dd", "...
''' Created on Dec 16, 2015 @author: Thomas Adriaan Hellinger ''' from django.views.generic.base import TemplateView from apps.OASIS_Blog.models import Category class BlogHomeView(TemplateView): template_name = "blog/blog.html" context_object_name = "categories" def get_context_data(self, **kwargs)...
{ "content_hash": "b739670270de5cc58293f95c74da7de4", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 70, "avg_line_length": 28.896551724137932, "alnum_prop": 0.6801909307875895, "repo_name": "brotherjack/oasison-repo", "id": "d154adaedf037747370d6fdc6fe5facb84c7de56", "siz...
__author__ = 'JIE' import socket import time HOST = '127.0.0.1' # The remote host PORT = 8000 # The same port as used by the server s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((HOST, PORT)) s.sendall('Hello, w') time.sleep(3) s.sendall('ord! \n') data = s.recv(1024) print 'Received...
{ "content_hash": "b21aa362bddb9868c2065762f6486f1c", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 59, "avg_line_length": 17.95, "alnum_prop": 0.6518105849582173, "repo_name": "stableShip/tornado_chatRoom", "id": "403894ad7a11469346e1a54e05d342b0df487896", "size": "374",...
import os import shutil import json from nose.plugins.skip import SkipTest from selenium import webdriver from django.test import TestCase, LiveServerTestCase from django.conf import settings from django.contrib.auth.models import User from django.core.files import File class DjangoTestCase(TestCase): def shor...
{ "content_hash": "f43f903bd5b4301b91f2835318f52c9f", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 78, "avg_line_length": 30.440860215053764, "alnum_prop": 0.6344048039561992, "repo_name": "Nolski/airmozilla", "id": "c028f4321a5f4ea6504b4ab296040a360b86f7d1", "size": "28...
from django.conf import settings from django.utils.importlib import import_module from brushfire.core.driver import Solr from brushfire.core.settings import configuration as conf from brushfire.core.query import * from brushfire.core import models driver = conf.get('driver', False, None) if driver: driver = impor...
{ "content_hash": "94130d07a5ceae08e21a0fa610b54666", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 57, "avg_line_length": 26.0625, "alnum_prop": 0.7817745803357314, "repo_name": "spuriousdata/django-brushfire", "id": "50366075cf715a4ddcc5c567255839856a537dd2", "size": "4...
from distutils.version import LooseVersion import easy_thumbnails if hasattr(easy_thumbnails, 'get_version'): ET_2 = LooseVersion(easy_thumbnails.get_version()) > LooseVersion('2.0') else: ET_2 = LooseVersion(easy_thumbnails.VERSION) > LooseVersion('2.0')
{ "content_hash": "d6534ad5cb9a51eebb749f8783f29176", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 76, "avg_line_length": 29.666666666666668, "alnum_prop": 0.7415730337078652, "repo_name": "webu/django-filer", "id": "f80880e661f9aac954e150f9dedb8cdea2779c0e", "size": "267...
from keras.models import load_model import os, sys import subprocess import h5py import json # try: file_name = sys.argv[1] data_dir = "".join(file_name.split("/")[:-1]) data_volume = "./data-volume" print("File name: %s" % file_name) model_name = file_name.split("/")[-1].split(".")[0] f = h5py.File(file_name, 'r') p...
{ "content_hash": "22a8dc797ecd60a4b3832db5203e4c5b", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 62, "avg_line_length": 29.916666666666668, "alnum_prop": 0.6476323119777159, "repo_name": "LiuVII/Self-driving-RC-car", "id": "906742062391408cde31fcdfaf50b0c7f8e92edc", "s...
''' Processed BCSD-orig 20-year average IR-level data by model Aggregated to impact regions using area weights. Produced from BCSD-originals using the GCP climate toolbox at https://github.com/ClimateImpactLab/pipelines ''' from __future__ import absolute_import import os import pipelines import pipelines.climate.tr...
{ "content_hash": "8b71ebc6a5402958096325faec81ea80", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 79, "avg_line_length": 28.910112359550563, "alnum_prop": 0.6673144189661874, "repo_name": "ClimateImpactLab/pipelines", "id": "a0acb2293c8bb582b110bc343895d8ba33968581", "s...
from django.shortcuts import render_to_response, get_object_or_404 from django.contrib.auth.forms import UserCreationForm from django.template import RequestContext from django.contrib.auth import authenticate, logout from django.contrib.auth import login as auth_login from django.http import HttpResponse, HttpResponse...
{ "content_hash": "132c6fa675788b4b977c74d34506a99e", "timestamp": "", "source": "github", "line_count": 297, "max_line_length": 152, "avg_line_length": 36.10774410774411, "alnum_prop": 0.6477060798209623, "repo_name": "Aaron1011/texting_wall", "id": "1ef92532811ad9aadabea890d7cd75f9b290c6e6", "size...
import os import sys def is_active(): return True def get_name(): return "iOS" def can_build(): import sys import os if sys.platform == 'darwin' or os.environ.has_key("OSXCROSS_IOS"): return True return False def get_opts(): return [ ('IPHONEPLATFORM', 'name of the...
{ "content_hash": "9beae1d1c63ca03ba5ff5bb19dcf5b4f", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 508, "avg_line_length": 50.791666666666664, "alnum_prop": 0.49415504511895, "repo_name": "ficoos/godot", "id": "2dcd6dd7e5dc177c2b6abbaa335590444d54e68a", "size": "9752", ...
import os import struct from binascii import hexlify, unhexlify import evpy.cipher import tuf.keydb import tuf.keys import tuf.log import tuf.util logger = tuf.log.get_logger() json = tuf.util.import_json() class KeyStore(tuf.keydb.KeyDB): """Helper to store private keys in encrypted files. Originally th...
{ "content_hash": "956311878eb3687a01915214f6cb26da", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 92, "avg_line_length": 34.70454545454545, "alnum_prop": 0.633267845448592, "repo_name": "sburnett/seattle", "id": "8f4c47bef5de4be533d4e32163cfbc133a98aa28", "size": "3213"...
import configparser import logging import smtplib from email.message import EmailMessage from typing import List from django.conf import settings from django.core.mail import EmailMultiAlternatives from django.core.mail.backends.base import BaseEmailBackend from django.template import loader def get_forward_address(...
{ "content_hash": "c1593f84b3b6c84dd8b642abd025a312", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 93, "avg_line_length": 37.58762886597938, "alnum_prop": 0.6445419637959408, "repo_name": "showell/zulip", "id": "fca554deee58f888d18de6c3a12b8285e7095a35", "size": "3646", ...
import os from StringIO import StringIO from abc import ABCMeta, abstractmethod from bokeh.models import ColumnDataSource from bokeh.plotting import Document, Session import pandas as pd from harvest import Harvest from domain import Domain from apps.crawl_space.settings import CRAWL_PATH class PlotsNotReadyExcept...
{ "content_hash": "a2ad64b869e4338dcbcfd1924f214b88", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 74, "avg_line_length": 28, "alnum_prop": 0.6039540816326531, "repo_name": "0x0mar/memex-explorer", "id": "eddacd58be1171f834bf4a4323a99301f981e5a2", "size": "1568", "bina...
import logging import sys from collections import namedtuple import numpy as np import pandas as pd from scipy.stats import chisquare from . import categorizer as cat from . import draw from .ipf.ipf import calculate_constraints from .ipu.ipu import household_weights logger = logging.getLogger("synthpop") FitQuality...
{ "content_hash": "aaaa86a43497870175c6b90b6a0fe441", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 77, "avg_line_length": 33.05161290322581, "alnum_prop": 0.6056997852820613, "repo_name": "hanase/synthpop", "id": "5b852e29e82e7c0705899bae2cf5525bd59d8803", "size": "5123...
import sys import traceback from urllib import urlencode, unquote from urlparse import parse_qs, parse_qsl import re from twisted.internet import defer from twisted.internet.defer import inlineCallbacks from twisted.internet.error import ConnectionRefusedError from twisted.web import http from twisted.web.resource imp...
{ "content_hash": "bc91ed30aff790bce67519c9cea27c4f", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 95, "avg_line_length": 37.774436090225564, "alnum_prop": 0.5642914012738853, "repo_name": "texttochange/vusion-backend", "id": "225e13e52b27464b14a20355e94aefe9274ebf68", ...
from setuptools import setup, Distribution, find_packages class BinaryDistribution(Distribution): def is_pure(self): return False setup( name='mozart', version='0.0', description='PDE Solver Package', url='https://github.com/yoon-gu/mozart-pub/', author='Yoon-gu Hwang', author_email='yz0624@gmail.com', l...
{ "content_hash": "0b08c61bc19a0707096db748e0752571", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 57, "avg_line_length": 23.82608695652174, "alnum_prop": 0.6788321167883211, "repo_name": "yoon-gu/Mozart", "id": "0877c70fa9625b8eef34aaebf1d3863cd5b96be3", "size": "548", ...
"""private_base will be populated from puppet and placed in this directory""" import logging import os import dj_database_url from lib.settings_base import CACHE_PREFIX, ES_INDEXES, KNOWN_PROXIES, LOGGING from .. import splitstrip import private_base as private ENGAGE_ROBOTS = False EMAIL_BACKEND = 'django.core.m...
{ "content_hash": "6d143baced66fefb41a5471e8c355027", "timestamp": "", "source": "github", "line_count": 187, "max_line_length": 94, "avg_line_length": 28.77005347593583, "alnum_prop": 0.6808550185873606, "repo_name": "wagnerand/zamboni", "id": "11ed4d2257684ae5dab7a45ac060ffa0a4a6c6ef", "size": "53...
""" Operating system independent start script (Win32 and UN*X) for the DataFinder application. """ import os import locale import sys from datafinder.gui.admin import admin_application __version__ = "$Revision-Id:$" # set the encoding encoding = "UTF-8" if not locale.getdefaultlocale()[1] ...
{ "content_hash": "38c15d48029e7ba598bd627d0d19a181", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 70, "avg_line_length": 21.533333333333335, "alnum_prop": 0.6718266253869969, "repo_name": "DLR-SC/DataFinder", "id": "9f648915a7136d0b97bd7f90e3561452f2f7042e", "size": "23...
from google.cloud import dialogflow_v2beta1 def sample_batch_delete_entities(): # Create a client client = dialogflow_v2beta1.EntityTypesClient() # Initialize request argument(s) request = dialogflow_v2beta1.BatchDeleteEntitiesRequest( parent="parent_value", entity_values=['entity_val...
{ "content_hash": "6fac094c5b3fa27836a9f5e2ce314773", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 73, "avg_line_length": 27.416666666666668, "alnum_prop": 0.7173252279635258, "repo_name": "googleapis/python-dialogflow", "id": "45cabc538a67b1db116c5f8f3c6641ff0d6724eb", ...
DEATH_INDICATORS = dict( app="mvp_deaths", indicators=dict( under5_deaths=dict( neonatal_deaths=dict( description="No. of Neonatal (0-28 days) Deaths", title="# Neonatal Deaths", indicator_key="neonatal_death", ), infant...
{ "content_hash": "a3cdf839f68e2c8268a21f3617799a6c", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 117, "avg_line_length": 40.611111111111114, "alnum_prop": 0.5294117647058824, "repo_name": "qedsoftware/commcare-hq", "id": "b8e98c564f3b7ac69270ad14cc90f707c951991a", "siz...
from numpy import * from iasecross import iasecross def iaedgeoff(f, Bc=iasecross()): from iaframe import iaframe from iasubm import iasubm from iainfrec import iainfrec edge = iaframe(f) return iasubm( f, iainfrec(edge, f, Bc))
{ "content_hash": "f467af3d0e319e6fa5cea4a013dd1c77", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 44, "avg_line_length": 22.90909090909091, "alnum_prop": 0.7103174603174603, "repo_name": "mariecpereira/IA369Z", "id": "5c68b0bf95f2d551876c70c326203bd7851d8174", "size": "...
''' A module for creating and managing node data. Node data in this library can have many types, dependent on whether the conditional probability distributions are discrete, linear Gaussian, or hybrid, and on whether the Bayesian network is static or dynamic. For example input files, see :doc:`unittestdict`, :doc:`unit...
{ "content_hash": "7170c85545396bd5fd99dd4c8a4de7ce", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 477, "avg_line_length": 48.15929203539823, "alnum_prop": 0.6109886071297317, "repo_name": "Anaphory/libpgm", "id": "fb420d93451d63bdb959ee5d2da51ce96240d1dc", "size": "703...
import re from algo.algorithm import Algorithm class Plugin(Algorithm): def __init__(self, parent=None): super().__init__(parent) self.manager = None def match(self, data): return None @staticmethod def _re_match(pattern, data): match = re.match(pattern, data, re.I) ...
{ "content_hash": "58d339f3b38c69c86c883a32a0f39b90", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 45, "avg_line_length": 20.5, "alnum_prop": 0.5707317073170731, "repo_name": "fpohtmeh/loki", "id": "e85bb7a386f3828b51fc5bb46d5bb5bbe04eaffc", "size": "410", "binary": fa...
import os; import sys; import subprocess; SCRIPT_PATH = os.path.dirname(os.path.realpath(__file__)); sys.path.append(SCRIPT_PATH + '/../tools/samscripts/src/'); import fastqparser; GOLDEN_BUNDLE_SRC = '../../golden-bundle/src/'; def execute_command(command): sys.stderr.write('Executing command: "%s"\n' % command)...
{ "content_hash": "6f962ed1f1053082ec1d836cc81167bf", "timestamp": "", "source": "github", "line_count": 169, "max_line_length": 182, "avg_line_length": 41.55621301775148, "alnum_prop": 0.6743556884522284, "repo_name": "isovic/test-scripts", "id": "50767e74829b0fa6ea08915057108837735750d6", "size": ...
import uuid from django.db import models class ORMPerson(models.Model): is_registered = models.BooleanField(default=False) username = models.CharField(max_length=20, blank=True, null=True, unique=True) email = models.CharField(max_length=64, blank=True, null=True, unique=True) is_email_confirmed = mo...
{ "content_hash": "8e067c471329cd6940fbd5db979312a5", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 87, "avg_line_length": 31.48076923076923, "alnum_prop": 0.6835675015271838, "repo_name": "jordifierro/abidria-api", "id": "9a15bd2e229b76034c2c628dd87c127da4eff994", "size"...
import pyvolve # Define a phylogeny, from a file containing a newick tree my_tree = pyvolve.read_tree(file = "file_with_tree.tre") # Define a nucleotide model, as a pyvolve.Model object. For this example, we'll use default parameters, but see the example script custom_aminoacid.py for other options # To implement ra...
{ "content_hash": "0dec7bf19d04ef1349b289e84a900116", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 289, "avg_line_length": 61.74074074074074, "alnum_prop": 0.7396520695860828, "repo_name": "SimonGreenhill/pyvolve", "id": "1f45144cb02de9b39f848a4d13bf7b43a10b3206", "size"...
"""" ProjectName: mail-ws Repo: https://github.com/chrisenytc/mail-ws Copyright (c) 2014 Christopher EnyTC Licensed under the MIT license. """ import os class Development(): API = { 'name': 'mailWS - Development', 'description': 'An simple implementation of a mail web service', 'version':...
{ "content_hash": "bdb518344c898afc897e18a5a1d65cf4", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 82, "avg_line_length": 25.96551724137931, "alnum_prop": 0.5710491367861886, "repo_name": "chrisenytc/mail-ws", "id": "d6b0f189ac1347e31d854ed82d88157db7157525", "size": "77...
from sys import argv,exit import optparse from time import sleep from tema.validator.modelvalidator import * from tema.model import getModelType,loadModel def validateModel(modelName,modelFormat,modelType): if not modelFormat: modelFormat = getModelType(modelName) if modelType: ...
{ "content_hash": "3dd30dfebf6ab4a257c9aef86fae0ab0", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 171, "avg_line_length": 33.983193277310924, "alnum_prop": 0.5870425321463897, "repo_name": "tema-tut/tema-tg", "id": "8f9509161281b3c7b8db7286f480b5b3735ee201", "size": "5...
""" TCP Port Scanner **************** Does a TCP connect scan on the IP:port pairs. """ import os from gevent import socket from datetime import datetime import socks from plugoo.assets import Asset from plugoo.tests import Test __plugoo__ = "TCP Port Scanner" __desc__ = "This a test template to be used...
{ "content_hash": "21183a3fc7ff8c2c1acb836fb079c291", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 74, "avg_line_length": 26.80952380952381, "alnum_prop": 0.5817051509769094, "repo_name": "hackerberry/ooni-probe", "id": "b371c886189066a4608ae6347187884dba49be97", "size":...
''' Action Bar ========== .. versionadded:: 1.8.0 .. image:: images/actionbar.png :align: right The ActionBar widget is like Android's `ActionBar <http://developer.android.com/guide/topics/ui/actionbar.html>`_, where items are stacked horizontally. When the area becomes to small, widgets are moved into the :clas...
{ "content_hash": "99830ef5361acdfac921544095e51cd4", "timestamp": "", "source": "github", "line_count": 905, "max_line_length": 79, "avg_line_length": 32.60552486187845, "alnum_prop": 0.6232885997017757, "repo_name": "inclement/kivy", "id": "49b45fe6d0b5e51a07d09a309774d76e10ff7e1f", "size": "29508...
""" Written by Lucas Sinclair. MIT Licensed. Contact at www.sinclair.bio """ # Built-in modules # import os, sys, io, gzip, shutil, itertools, platform from collections import Counter, OrderedDict from six import string_types # Internal modules # from fasta import graphs # First party modules # from plumbing.common ...
{ "content_hash": "81bbf199ed333804c5f021e51433b275", "timestamp": "", "source": "github", "line_count": 561, "max_line_length": 80, "avg_line_length": 36.68092691622103, "alnum_prop": 0.557585771211974, "repo_name": "xapple/fasta", "id": "97522eb30f1a5b833279b9b0c2c9dd0313402197", "size": "20626", ...
import os import shutil srcRoot = "../../" rpmRoot = "/usr/src/redhat/SOURCES/" rpmBin = "/usr/src/redhat/RPMS/i386/" rpmSource = "/usr/src/redhat/SRPMS/" verFileName = srcRoot + "scintilla/version.txt" vers = open(verFileName) #139 vFull = vers.read().strip() vers.close() #1.39 vPoint = vFull[0] + "." + vFull[1:] #...
{ "content_hash": "50c92a67dc80f21c23065adc603b8e25", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 61, "avg_line_length": 24.333333333333332, "alnum_prop": 0.6474885844748859, "repo_name": "sdottaka/mruby-bin-scite-mruby", "id": "3592bd95bdafa3d5a656ba971b102908de0763e2", ...
from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.login import LoginManager # import app configurations from config import * ## App initiallization app = Flask(__name__) app.secret_key = SECRET_KEY # Database initiallization app.config['SQLALCHEMY_DATABASE_URI'] = SQLALCHEMY_DATAB...
{ "content_hash": "2e76f9497f662befb1a2da8dc996e9ed", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 63, "avg_line_length": 18.11111111111111, "alnum_prop": 0.745398773006135, "repo_name": "cNikolaou/flask-user-login", "id": "98f307fc200e9b00f679b5baf424aa88c672093c", "siz...
"""Aggregate provider tests.""" from dependency_injector import providers, errors from pytest import fixture, mark, raises class Example: def __init__(self, init_arg1=None, init_arg2=None, init_arg3=None, init_arg4=None): self.init_arg1 = init_arg1 self.init_arg2 = init_arg2 self.init_arg...
{ "content_hash": "11f9f01da5ecf7e1b7021df95cbd1244", "timestamp": "", "source": "github", "line_count": 292, "max_line_length": 95, "avg_line_length": 28.86986301369863, "alnum_prop": 0.6727164887307236, "repo_name": "ets-labs/python-dependency-injector", "id": "b550db3b5089f64b3b89bf86f3237c5851e6fe...
from setuptools import setup setup( setup_requires=['pbr'], pbr=True, )
{ "content_hash": "a566fdd5acc5dea4ceaf4b9427a25a33", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 28, "avg_line_length": 13.333333333333334, "alnum_prop": 0.6625, "repo_name": "ouijan/rabbit", "id": "e7f83a9bd8b1b0a7b797c780fb05180ac1f60d60", "size": "103", "binary": f...
import argparse parser = argparse.ArgumentParser() parser.add_argument('review_path') args = parser.parse_args() import os import ujson as json import spacy import pickle import random from tqdm import tqdm from collections import defaultdict import numpy as np from yelp import * en = spacy.load('en') def read_revi...
{ "content_hash": "986a12f7d552e58f26deb6fe1d233b07", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 77, "avg_line_length": 22.640776699029125, "alnum_prop": 0.6230703259005146, "repo_name": "conversationai/conversationai-models", "id": "a3d27950c75dcdc2e7be15577e7c767a137c...
"""Functional tests for AdaMoo optimizer.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl.testing import parameterized import numpy as np from tensorflow.contrib.opt.python.training import shampoo from tensorflow.python.framework import consta...
{ "content_hash": "dcc5bcef1ef2281a8e3ad79944984657", "timestamp": "", "source": "github", "line_count": 757, "max_line_length": 80, "avg_line_length": 41.21532364597094, "alnum_prop": 0.58875, "repo_name": "AnishShah/tensorflow", "id": "05bcf2cfa3fdd2b52ecdb3d80f44f2a6c3147240", "size": "31890", ...
from __future__ import absolute_import, division, print_function, \ with_statement import os import logging def find_library_nt(name): # modified from ctypes.util # ctypes.util.find_library just returns first result he found # but we want to try them all # because on Windows, users may have both ...
{ "content_hash": "452a5ca94a1621bf8f0b27405aa1b35c", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 79, "avg_line_length": 30.029197080291972, "alnum_prop": 0.5622265435099659, "repo_name": "vanish87/shadowsocks", "id": "de389b99ccf218e368781b6186d705dd4dbe035d", "size":...
from django.contrib import admin from .models import Team, Mentor, Meetup, Coworking, Post, Event, Application, \ ImageMedia, About, OkthessMeetup, ResourceCategory, Resource, ApplyText, Partner, WeekendApplication admin.site.register(Team) admin.site.register(Mentor) admin.site.register(Meetup) admin.site.regist...
{ "content_hash": "0ded2396dc6d8c6646020f28ae9ae698", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 104, "avg_line_length": 30.625, "alnum_prop": 0.7763265306122449, "repo_name": "OKThess/website", "id": "8be8df8ad5a46afafe5dc3bb78886ea61e4b4220", "size": "1225", "binar...
""" Regular ini rules, except: special settings: _use: those will be marked as dependencies of the current section _provider: the python provider that creates shell commands keys can have no value values can be lists (whitespace is separator) values can contain references to other secti...
{ "content_hash": "1f66c50c587c7dec25c47441eeb79cca", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 79, "avg_line_length": 32.36, "alnum_prop": 0.5626699629171817, "repo_name": "pajaco/spaces", "id": "130c90bd1700f46582580df705b5dbe5b1866cc4", "size": "4045", "binary":...
""" Copyright 2015 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed...
{ "content_hash": "54c51c88f9dc83a7b2399cf0b8ae0ff4", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 126, "avg_line_length": 31.651162790697676, "alnum_prop": 0.6021307861866275, "repo_name": "Tennyson53/magnum", "id": "9f8fd001f1da94ca724831c937e868030b351ba0", "size": "...
''' Unit test for all of the example scripts provided in the examples folder. ''' from __future__ import absolute_import, division, print_function import os import unittest import mloop.testing as mlt import mloop.launchers as mll import mloop.utilities as mlu import logging import numpy as np import multiprocessing a...
{ "content_hash": "07894f85365884756dee9f2fa4a5a424", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 119, "avg_line_length": 48.528985507246375, "alnum_prop": 0.5003733014782739, "repo_name": "charmasaur/M-LOOP", "id": "959ea78f8a73d45b9b610b743b68bb90db61ed65", "size": "...
import os import requests from paramiko import SSHClient, AutoAddPolicy from cc_container_worker.commons import helper def http(connector_access, local_input_file): local_file_dir = local_input_file['dir'] local_file_name = local_input_file['name'] if not os.path.exists(local_file_dir): os.make...
{ "content_hash": "1a90778d567444717a925ed413db665b", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 96, "avg_line_length": 30.865384615384617, "alnum_prop": 0.6386292834890965, "repo_name": "curious-containers/cc-container-worker", "id": "69a07a8faa7f87ac48fdc23a944f162600a...
from setuptools import setup, find_packages with open('README.md') as f: long_description = f.read() setup( name='jiradoc', version='0.1', description='A small Python module to parse JIRAdoc markup files and insert them into JIRA', long_description=long_description, url='https://github.com/luc...
{ "content_hash": "2b63d032b6f1bf2b1882d8d3c84de1e5", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 96, "avg_line_length": 29.653846153846153, "alnum_prop": 0.6342412451361867, "repo_name": "lucianovdveekens/jiradoc", "id": "1577a96b5f7d5a672f2f72dc199bff39f94c5c2d", "siz...
from setuptools import setup, find_packages import sys, os sys.path.insert(0, os.path.abspath(os.path.dirname(__file__))) import mezzanine_pageview setup( name="mezzanine-pageview", version=mezzanine_pageview.__version__, url="https://github.com/zgohr/mezzanine-pageview", author="Zach Gohr", auth...
{ "content_hash": "0c85f987b8a30ab283725d098d055490", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 73, "avg_line_length": 36.945945945945944, "alnum_prop": 0.6269202633504023, "repo_name": "zgohr/mezzanine-pageview", "id": "f98e0fb913131da66326777d560f8a2709be89f7", "siz...
from argparse import ArgumentParser from getpass import getpass import requests as req from bs4 import BeautifulSoup import json import os import sys from pyduktape import DuktapeContext import warnings warnings.filterwarnings("ignore", category=UserWarning, module='bs4') def soup(s): return BeautifulSoup(s, "htm...
{ "content_hash": "18c5bdd34472f7e450df5e22ac998e52", "timestamp": "", "source": "github", "line_count": 477, "max_line_length": 143, "avg_line_length": 26.758909853249477, "alnum_prop": 0.5263240363522407, "repo_name": "rzhikharevich/vkmusic2", "id": "257b36991714b587d4daef55b99c53975f851965", "siz...
""" This is a template for creating custom ColumnMapExpectations. For detailed instructions on how to use it, please see: https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations """ import ipaddress import json from typing import Optional ...
{ "content_hash": "35594613f2253856e4fae9ba3cdd64aa", "timestamp": "", "source": "github", "line_count": 169, "max_line_length": 136, "avg_line_length": 37.36094674556213, "alnum_prop": 0.5918593601520431, "repo_name": "great-expectations/great_expectations", "id": "89b7e72a0e595f9f1f2d3673922f9be74ee...
import roslib roslib.load_manifest('nao_driver') import rospy import actionlib import random import copy from nao_driver import NaoNode from nao_msgs.msg import( BlinkAction, BlinkResult, BlinkFeedback, FadeRGB ) class NaoLeds(NaoNode): #This should be treated as a constant NODE_NAME = ...
{ "content_hash": "8c35c50f61c492390560e6498daf5b52", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 77, "avg_line_length": 30.753424657534246, "alnum_prop": 0.5503340757238308, "repo_name": "miguelsdc/nao_robot", "id": "8e551b2fb2c02d53995728dd9caf1de3e7a7c01b", "size": ...
import theano import theano.tensor as T # define some symbolic variables theano_matrix1 = T.matrix(name='theano_matrix1') theano_matrix2 = T.matrix(name='theano_matrix2') # define some functions # dot product/matrix product theano_dot = theano.function([theano_matrix1, theano_matrix2], T.dot(theano_matrix1, theano_m...
{ "content_hash": "87b2594bdd606ba64c77cd6901ddd8ff", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 138, "avg_line_length": 49.71052631578947, "alnum_prop": 0.7533086289041822, "repo_name": "saebrahimi/Emotion-Recognition-RNN", "id": "097ac0699e8009aa2ae6c7fa1f59638db81c31e...
import logging # logging using basicConfig() instead of getLogger() logging.basicConfig( level=logging.DEBUG, format='%(asctime)s %(levelname)s: %(message)s', datefmt='%Y-%m-%d %H:%M:%S') logging.error("foo")
{ "content_hash": "481041e4425c98d25c1e778c80758f16", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 53, "avg_line_length": 25, "alnum_prop": 0.6622222222222223, "repo_name": "jzinner/utils", "id": "640b38f5cd357e3af7db12e537c136fcd7cd2e7f", "size": "225", "binary": false...
"""This example illustrates how to create a report.""" import argparse import sys from apiclient import sample_tools from oauth2client import client # Declare command-line flags. argparser = argparse.ArgumentParser(add_help=False) argparser.add_argument( 'profile_id', type=int, help='The ID of the profile to...
{ "content_hash": "7ebba0a0b03429d820b4a8464a291e4c", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 77, "avg_line_length": 29.23076923076923, "alnum_prop": 0.6407894736842106, "repo_name": "falbassini/Samples", "id": "d4dc31a4536f9bcb3f367dab3bc6fcabe6cc879c", "size": "21...
""" MediaEval submission robot Usage: robot_submission <videos.lst> [options] Options: -h --help Show this screen. --version Show version. --debug Show debug information. --url=URL Submission server URL [defau...
{ "content_hash": "e0bdaa084964f37811e337b076b16c04", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 78, "avg_line_length": 33.33196721311475, "alnum_prop": 0.61109061846797, "repo_name": "camomile-project/scripts", "id": "c3921608c792bffdd1f5b316273ddfd13d8252ad", "size"...
"""The command group for gcloud dataflow metrics. """ from googlecloudsdk.calliope import base @base.ReleaseTracks(base.ReleaseTrack.ALPHA, base.ReleaseTrack.BETA) class Metrics(base.Group): """A group of subcommands for working with Dataflow metrics. """ pass
{ "content_hash": "be2eb9cbd0a71bea6855b23b4b418243", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 68, "avg_line_length": 26.9, "alnum_prop": 0.7657992565055762, "repo_name": "KaranToor/MA450", "id": "53d307e16ad0637dcaf3d00a3eca93ab88ccc3c6", "size": "865", "binary": ...
from markupsafe import escape def run(): string = '<strong>Hello World!</strong>' * 1000 escape(string)
{ "content_hash": "cb8a7f5d76d98277605253e8f539c546", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 51, "avg_line_length": 19, "alnum_prop": 0.6666666666666666, "repo_name": "alex/markupsafe", "id": "7bde595c10a8f83dde52176c0c64401ba38e5d50", "size": "114", "binary": fal...
import json from django.db import models from app.validators import json_schema_validator from jsonfield import JSONField _default='''{ "properties": { "id": { "title": "ID", "type": "integer" } }, "required": ["id"] }''' class MediaType(models.Model): ...
{ "content_hash": "2a4383a647d1f72a05704fc93d573aa9", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 75, "avg_line_length": 26.571428571428573, "alnum_prop": 0.5483870967741935, "repo_name": "zyphrus/fetch-django", "id": "5e749a67c13842ee36b3bd34ca2216bd7f18ed66", "size": ...
from collections import MutableMapping class KVList(MutableMapping): def __init__(self, *args, **kwargs): self.list = [] self.update(*args, **kwargs) def last_index(self, key): l = len(self.list) for i in range(l): if self.list[l-i-1][0] == key: retu...
{ "content_hash": "434059d5fbebd49d6ff1e323e03d033d", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 51, "avg_line_length": 23.392156862745097, "alnum_prop": 0.5071248952221291, "repo_name": "victorvde/dota2_nohats", "id": "977f2b4ebd44eee9702be21c872d85f7780384b9", "size"...
import unittest import numpy as np import flavio constraints = flavio.default_parameters wc_obj = flavio.WilsonCoefficients() par = constraints.get_central_all() class TestTauPnu(unittest.TestCase): def test_taupnu(self): # compare to the experimental values self.assertAlmostEqual( fla...
{ "content_hash": "7d08f2ec63dd206d056b1f52d37ea9f7", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 100, "avg_line_length": 36.11764705882353, "alnum_prop": 0.6840390879478827, "repo_name": "flav-io/flavio", "id": "57d14406bb3667d4af9bc9b6481307a924180997", "size": "614",...
"""mesmodules/part2/niveaudeuxbis.py"""
{ "content_hash": "e69418c1448f6b41fb876f97b08933a6", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 39, "avg_line_length": 39, "alnum_prop": 0.7692307692307693, "repo_name": "sdpython/teachpyx", "id": "cb34c775bcff0f8838b1ab543d409c285e0f33a7", "size": "39", "binary": fa...
import sys import imp imp.reload(sys) try: sys.setdefaultencoding('UTF8') except Exception as E: pass import testValue from popbill import StatementService, PopbillException statementService = StatementService(testValue.LinkID, testValue.SecretKey) statementService.IsTest = testValue.IsTest statementService...
{ "content_hash": "80e9bdc19f86bc763968e6c16a826a86", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 74, "avg_line_length": 25.428571428571427, "alnum_prop": 0.7438202247191011, "repo_name": "linkhub-sdk/popbill.statement.example.py", "id": "b1a29df1a3dd9005ae290b63861b0caa5...
def is_prime(n): if n < 2: return False if n == 2: return True if n % 2 == 0: return False for d in range(3, int(n**0.5)+1, 2): if n % d == 0: return False return True primes = [] def init_prime_array(limit): global primes primes = [2] q = 3...
{ "content_hash": "38128371b59558e08a8619fa7e6e0f2c", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 128, "avg_line_length": 27.96590909090909, "alnum_prop": 0.5006095083299472, "repo_name": "fbcom/project-euler", "id": "29bdf246f427d7501eb1318293239c4f8eb87ebb", "size": "...
import sys, os, rtf2xml.copy, tempfile # note to self. This is the first module in which I use tempfile. A good idea? """ """ class AddBrackets: """ Add brackets for old RTF. Logic: """ def __init__(self, in_file, bug_handler, copy = None, run_level =...
{ "content_hash": "0b7e496c6fad581207f607dd2607e626", "timestamp": "", "source": "github", "line_count": 270, "max_line_length": 81, "avg_line_length": 25.014814814814816, "alnum_prop": 0.46194847497779096, "repo_name": "sensusaps/RoboBraille.Web.API", "id": "6f2b29eeb7f24cede340227de783c20634bae0d5",...
from __future__ import absolute_import, unicode_literals from io import BytesIO from pythonic_testcase import * from soapfish.soap_dispatch import SOAPDispatcher, WsgiSoapApplication from soapfish.testutil import echo_service class WsgiSoapApplicationTest(PythonicTestCase): def test_can_dispatch_soap_request_w...
{ "content_hash": "2670c80bf0a57b8b3fccf1d3bb378b23", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 128, "avg_line_length": 38.96551724137931, "alnum_prop": 0.5730088495575221, "repo_name": "vpistis/soapfish", "id": "7cb6c65a39285cfa3e00a434c6556671d49f929b", "size": "228...
import os import tempfile import shutil from lxml import etree from plumber import plumber from node.interfaces import ( ICallable, IRoot, ) from node.base import OrderedNode from node.behaviors import ( Order, Reference, ) from zope.interface import ( implementer, alsoProvides, ) from node.util...
{ "content_hash": "4118d4e4a63f997edb67ac29d5c4990e", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 81, "avg_line_length": 30.816901408450704, "alnum_prop": 0.5382388787324802, "repo_name": "bluedynamics/node.ext.xml", "id": "c4f942f98d5375929f9e5c793ebb725741dee320", "s...
import http, sys # Python code for switching LEDs host = sys.argv[1] [res, data] = http.get(host, "/actuators/leds") print "LEDS:", data
{ "content_hash": "8711b5a64bbe8d8f13840ed5f529bf80", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 47, "avg_line_length": 23, "alnum_prop": 0.6884057971014492, "repo_name": "liamjjmcnamara/sicsthsense", "id": "6f1dfa38d0f4c0042e9987c37ae299d7af459544", "size": "156", "b...
""" A mostly direct translation of rdradcp.m to python. 1/3/2013: Updated with DKR changes to rdradcp.m """ from __future__ import division from __future__ import print_function # cruft that 2to3 added - but seems to make less compatible with older code # and unclear that it's needed for py3k. # from builtins imp...
{ "content_hash": "157c945f7235a76ab7f31f6ec1583541", "timestamp": "", "source": "github", "line_count": 1607, "max_line_length": 120, "avg_line_length": 41.03049159925327, "alnum_prop": 0.533926838146081, "repo_name": "rustychris/stompy", "id": "88c5fe76244bb89f895315d4571334d72be7f08d", "size": "6...
from shout import (Message, has_ears, hears, shout, typecheck_args) from nose.tools import * class MsgResults(Message): pass class MsgException(Message): pass class Msg(Message): pass class MsgArgsKwargs(Message): pass @has_ears class A(object): @hears(Msg) def a_class_method(self): ...
{ "content_hash": "284e4c01808460e6340a98b636782328", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 71, "avg_line_length": 21.645390070921987, "alnum_prop": 0.6061598951507209, "repo_name": "danbradham/shout", "id": "7ba6f355fb5a9064e98975cc82866a1261e0b1c1", "size": "30...
class FilterModule(object): """ Custom filters are loaded by FilterModule objects """ def filters(self): """ FilterModule objects return a dict mapping filter names to filter functions. """ return { 'endpoint_servers': self.endpoint_servers, } d...
{ "content_hash": "6f3b69a866154753ef8270b75e1f5c1e", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 66, "avg_line_length": 35.17391304347826, "alnum_prop": 0.5735475896168108, "repo_name": "retr0h/ansible-endpoint-filter", "id": "f9712bd0cead6c1c3ace638f03b5feea7b283131", ...
"""Decide which plugins to use for authentication & installation""" from __future__ import print_function import os import logging import zope.component from certbot import errors from certbot import interfaces from certbot.display import util as display_util logger = logging.getLogger(__name__) z_util = zope.comp...
{ "content_hash": "eff816911ba1866f9add756e3088c84e", "timestamp": "", "source": "github", "line_count": 273, "max_line_length": 100, "avg_line_length": 38.81684981684982, "alnum_prop": 0.6455600641691045, "repo_name": "brentdax/letsencrypt", "id": "ac509d779d60496dd1cfdbb8a5d2e5deda130dc6", "size":...
from django.db import models from month import forms from month import widgets from month import Month import datetime # Patch python3 basestring # Credits @leingang # https://github.com/oxplot/fysom/issues/1 try: unicode = unicode except NameError: # 'unicode' is undefined, must be Python 3 str = str ...
{ "content_hash": "ec0722fc524ca778dacb18b7fbb3a378", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 80, "avg_line_length": 27.566666666666666, "alnum_prop": 0.6378476420798065, "repo_name": "mpachas/django-monthfield", "id": "c0f692300f622a6eacc48477463f82965681306d", "si...
import os # from jieba.analyse import ChineseAnalyzer basedir = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) class BaseConfig(object): # 说明在py2和3的类定义关系:新式类和旧式类 MOMENTS_USERNAME = os.getenv('MOMENTS_USERNAME', 'greyli') MOMENTS_PASSWORD = os.getenv('MOMENTS_PASSWORD', '123456') MOMENTS_ADMI...
{ "content_hash": "958b9d609b039acb36ba7ba0fdb37f19", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 90, "avg_line_length": 31.823529411764707, "alnum_prop": 0.6816081330868762, "repo_name": "greyli/moments-dev", "id": "2f68c7a2e9eec0da2774e5006527ed3151f23045", "size": "2...
import argparse import logging import os from prettytable import PrettyTable import warnings from carto.auth import APIKeyAuthClient from carto.datasets import DatasetManager from carto.sql import SQLClient warnings.filterwarnings('ignore') # python table_info.py tornados_11 # Logger (better than print) logging.bas...
{ "content_hash": "5df03c6e9d3dcb0097efb16185eebd34", "timestamp": "", "source": "github", "line_count": 181, "max_line_length": 98, "avg_line_length": 35.74033149171271, "alnum_prop": 0.5699489874787448, "repo_name": "CartoDB/cartodb-python", "id": "e2734a5ff5bc78a69d1ce5a08a86a69fa8c5f7fe", "size"...
"""This module contains Language Server Protocol types https://microsoft.github.io/language-server-protocol/specification -- Language Features - Semantic Tokens -- Class attributes are named with camel case notation because client is expecting that. """ import enum from typing import Dict, List, Optional, Union from...
{ "content_hash": "cc990cd1a1b6f62d414365c9be72040a", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 123, "avg_line_length": 26.42105263157895, "alnum_prop": 0.7168468981217985, "repo_name": "glenngillen/dotfiles", "id": "9540fb893f5f7883f9f5ba46df4d792ba1e7f519", "size":...
from muntjac.api import Button from muntjac.demo.sampler.APIResource import APIResource from muntjac.demo.sampler.Feature import Feature, Version class CheckBoxes(Feature): def getSinceVersion(self): return Version.OLD def getName(self): return 'Checkbox' def getDescription(self): ...
{ "content_hash": "c50d018fa3301b723aec5506dbafb301", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 79, "avg_line_length": 25.894736842105264, "alnum_prop": 0.6849593495934959, "repo_name": "rwl/muntjac", "id": "9cb80baa2381603b7446179e4726972221fff2f2", "size": "985", ...
from typing import Any, Dict, Optional def assert_equivalent_repr( value: Any, *, setup_code: str = ( 'import cirq\nimport numpy as np\nimport sympy\nimport pandas as pd\nimport datetime\n' ), global_vals: Optional[Dict[str, Any]] = None, local_vals: Optional[Dict[str, Any]] = None, ) ...
{ "content_hash": "ac508f1924f2507db6b57a52e7a86719", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 95, "avg_line_length": 32.55294117647059, "alnum_prop": 0.5468015901698591, "repo_name": "balopat/Cirq", "id": "9bef2c4225f82df6dba2b75092ecf20c43175b0a", "size": "3352", ...
import os import ConfigParser import time import subprocess import alfred def b2d_exec(command, args=None, binary_path='/usr/local/bin/boot2docker'): if not args: args = [] cmdline = ' '.join([binary_path, command] + args) ret = subprocess.check_output('{}; exit 0'.format(cmdline), shell=True) ...
{ "content_hash": "9d32881e5a7f32af39e2d02050b48cf5", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 80, "avg_line_length": 36.913333333333334, "alnum_prop": 0.5670940942748781, "repo_name": "moul/alfred-workflow-boot2docker", "id": "8532ffc9dcf45a87fea752036b8abae5d19b8f80...
from lxml import etree tree = etree.parse(open('Data/bookstore.xml')) #root = tree.getroot() r = tree.xpath("//book[@category='WEB']") print len(r) for i in r: title = i.xpath('title')[0] author = i.xpath('author') print "TAG: {0}\nAUTHOR: {1}\n".format(title.text, author[0].text)
{ "content_hash": "316fd10bd0a98ac42e472fd903e6a207", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 70, "avg_line_length": 22.923076923076923, "alnum_prop": 0.6308724832214765, "repo_name": "kmunve/TSanalysis", "id": "d2736b1d2ca4d5d64e363070926bbbee0f2f90ee", "size": "32...
"""ms URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based vi...
{ "content_hash": "f7d33f183c6df7cd7c4a84ef11a522ed", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 114, "avg_line_length": 43.04761904761905, "alnum_prop": 0.7007743362831859, "repo_name": "brata-hsdc/brata.masterserver", "id": "2a32ea48b892cc08d16d540945dc57e7e6e8840e", ...
""" DataFrame --------- An efficient 2D container for potentially mixed-type time series or other labeled data series. Similar to its R counterpart, data.frame, except providing automatic data alignment and a host of useful data manipulation methods having to do with the labeling information """ from __future__ import...
{ "content_hash": "73c84be417f4a0f1f6948f3f9c434c78", "timestamp": "", "source": "github", "line_count": 9637, "max_line_length": 170, "avg_line_length": 34.20286396181384, "alnum_prop": 0.5221608371029055, "repo_name": "jreback/pandas", "id": "c32483aa2a23139fea5bf304a40126f2d40d0a5e", "size": "329...
from __future__ import unicode_literals import json import logging import os from uuid import uuid4 import mimeparse from django.core.exceptions import ObjectDoesNotExist from django.http import HttpResponse from django.template.context import RequestContext from django.template.loader import render_to_string from dj...
{ "content_hash": "b9b90437b21b5cdcaa45e7a4232e524b", "timestamp": "", "source": "github", "line_count": 460, "max_line_length": 79, "avg_line_length": 36.42173913043478, "alnum_prop": 0.6011101826429509, "repo_name": "beol/reviewboard", "id": "fd8837892636776ad830252ac1d76d4db967f0d6", "size": "167...
__doc__ = """ Compatibility idioms for __builtin__ names This module adds names to the __builtin__ module for things that we want to use in SCons but which don't show up until later Python versions than the earliest ones we support. This module checks for the following __builtin__ names: all() any() ...
{ "content_hash": "2ea2d94c1e1af834a6086996bd95a8b3", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 83, "avg_line_length": 26.842767295597483, "alnum_prop": 0.6077788191190253, "repo_name": "jbtule/keyczar-dev", "id": "f7267ca31364e2c221d467bdf1be6ce69d403ea2", "size": "...
__revision__ = '$Id: models.py 28 2009-10-22 15:03:02Z jarek.zgoda $' import re from django.db import models from django.core.urlresolvers import reverse from django.core.mail import send_mail from django.conf import settings from django.template import loader, Context from django.contrib.sites.models import Site fro...
{ "content_hash": "f7d4a5a05d8a203a2baeac3c9430db02", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 127, "avg_line_length": 40.38775510204081, "alnum_prop": 0.6461175677951827, "repo_name": "paxapy/zulip", "id": "29fb2025afd839990653176711a7f4b1df9107c5", "size": "6022",...
import collections import json import bleach def strip_html(unclean, tags=None): """Sanitize a string, removing (as opposed to escaping) HTML tags :param unclean: A string to be stripped of HTML tags :return: stripped string :rtype: str """ if not tags: tags = [] if unclean is ...
{ "content_hash": "2340d7347de449725d64153dc1459408", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 117, "avg_line_length": 32.375, "alnum_prop": 0.6636636636636637, "repo_name": "leb2dg/osf.io", "id": "b8a5d94877cfc511ff55954eb44ed34aa40f30bf", "size": "4686", "binary...
""" This module contains the definition for various Neutron and Cloud Formation networking resources' translators. """ from heat2arm.translators.networking.secgroups import ( EC2SecurityGroupARMTranslator, NeutronSecurityGroupARMTranslator, EC2SecurityGroupRuleEgressARMTranslator, EC2SecurityGr...
{ "content_hash": "ab61209cb55550848f715535da3ba06f", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 63, "avg_line_length": 31.233333333333334, "alnum_prop": 0.816435432230523, "repo_name": "cloudbase/heat2arm", "id": "49d0d6c76a3de9086aea1517a023f2f1822d4e29", "size": "15...
"""A "Test Server Spawner" that handles killing/stopping per-test test servers. It's used to accept requests from the device to spawn and kill instances of the chrome test server on the host. """ import BaseHTTPServer import json import logging import os import select import struct import subprocess import threading ...
{ "content_hash": "4912bfcb74df404fcd31f9eb314810be", "timestamp": "", "source": "github", "line_count": 404, "max_line_length": 80, "avg_line_length": 39.09405940594059, "alnum_prop": 0.661453716601241, "repo_name": "zcbenz/cefode-chromium", "id": "f70bf669380d96903bd4e90137b76c926924b501", "size":...