text
stringlengths
4
1.02M
meta
dict
''' MAP Client Plugin Step ''' import os from PySide import QtGui from PySide import QtCore from mapclient.mountpoints.workflowstep import WorkflowStepMountPoint from mapclientplugins.loadstlstep.configuredialog import ConfigureDialog from gias.common import stlreader import numpy as np class LoadSTLStep(WorkflowSt...
{ "content_hash": "ff015f7e4d9247d1f6292e712f740cb9", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 90, "avg_line_length": 36.641891891891895, "alnum_prop": 0.6125760649087221, "repo_name": "MusculoskeletalAtlasProject/mapclient-tests", "id": "7c4a3b96bd58a73fad8e2c1dfe3ad...
from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from frame_sounds_ui import Ui_FrameSoundsForm class EditorFrameSounds(QDialog, Ui_FrameSoundsForm): def __init__(self, parent, title=u'创建音乐'): super(EditorFrameSounds, self).__init__(parent) self.setupUi(self) ...
{ "content_hash": "954bbcb32acc4cf6324038e21648c4f6", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 97, "avg_line_length": 25.75, "alnum_prop": 0.6106796116504855, "repo_name": "ASMlover/study", "id": "d7da5e471fe8ab87e2724a9a0d722156542b258d", "size": "1105", "binary":...
from newt.views import JSONRestView from newt.views import AuthJSONRestView from common.response import json_response from django.shortcuts import render from django.conf import settings import logging logger = logging.getLogger("newt." + __name__) from importlib import import_module acct_adapter = import_module(sett...
{ "content_hash": "212bc2260d80afad0399cc98e3ced698", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 84, "avg_line_length": 36.62068965517241, "alnum_prop": 0.7250470809792844, "repo_name": "NERSC/newt-2.0", "id": "8025b50d3cf99e1361b96f64ac52655e35722ce2", "size": "1062",...
from temboo.core.choreography import Choreography from temboo.core.choreography import InputSet from temboo.core.choreography import ResultSet from temboo.core.choreography import ChoreographyExecution import json class UpdateFirewall(Choreography): def __init__(self, temboo_session): """ Create ...
{ "content_hash": "475bfafdb9bbc7bde1babdb9f2706f23", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 254, "avg_line_length": 48.02197802197802, "alnum_prop": 0.7013729977116705, "repo_name": "jordanemedlock/psychtruths", "id": "fdf147008bacf351f069c59e5361badcf6d31f27", "s...
import argparse import boto import boto.s3 from boto.s3.connection import Location from boto_cli import configure_logging from boto_cli.s3 import class_iterator from boto_cli.s3 import RegionMap import logging log = logging.getLogger('boto_cli') from pprint import pprint # configure command line argument parsing parse...
{ "content_hash": "d623aba018802ceb8e313b1c8079a57d", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 112, "avg_line_length": 41.340425531914896, "alnum_prop": 0.7040658775090067, "repo_name": "cityindex-attic/ec2-clock-accuracy-research", "id": "1f7f27821ffefa2f32ada1d0546cd...
''' Created on Mar 4, 2012 @author: scottporter ''' from resource.resourcebase import ResourceType, ResourceBase from resource.resourcehandler import ResourceHandlerBase from render.texture import Texture from render.texturemanager import TextureManager class ImageResourceHandler(ResourceHandlerBase): def __ini...
{ "content_hash": "fbb85e6de4edbc89dcf8ffc52aac931a", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 101, "avg_line_length": 33.10204081632653, "alnum_prop": 0.6282367447595562, "repo_name": "freneticmonkey/epsilonc", "id": "82c66e4c01eee49b9d05a3638d8834d6786390ed", "size...
""" Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. It returns content of dockerfile and therefore displays it in results. """ from dockerfile_parse import DockerfileParser from atomic_reactor.plu...
{ "content_hash": "2dcb2816ffe4edcc195e9df6b6f3979d", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 74, "avg_line_length": 28.305555555555557, "alnum_prop": 0.6673209028459274, "repo_name": "jpopelka/atomic-reactor", "id": "0c38ab5a5798ad68920952bc4b5ca17ae7214ade", "size...
from keras.utils import np_utils import numpy as np import h5py class HDF5DatasetGenerator: def __init__(self, dbPath, batchSize, preprocessors=None, aug=None, binarize=True, classes=2): # store the batch size, preprocessors, and data augmentor, # whether or not the labels should be binarized, along with # th...
{ "content_hash": "0827f87d3240bbf24fe4829348919728", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 63, "avg_line_length": 29.958333333333332, "alnum_prop": 0.6903106165971257, "repo_name": "CyberLabs-BR/face_detect", "id": "a8cc428f2aa6aa7286a4cbfee9402077ca6b8527", "siz...
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class ColorBar(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "scatterternary.marker" _path_str = "scatterternary.marker.colorbar" _valid_props = { ...
{ "content_hash": "2c7b6f44923111b4a26f654e4a3fb460", "timestamp": "", "source": "github", "line_count": 1947, "max_line_length": 107, "avg_line_length": 35.898818695428865, "alnum_prop": 0.5547464053222692, "repo_name": "plotly/python-api", "id": "f9bffa92fac528195ba02f2b1492139519f63540", "size": ...
from .client import RaspiWsClient from .core import RaspiBaseMsg, RaspiAckMsg __all__ = ['TVService', 'TVPower', 'TVStatus', 'TVGetModes', 'TVSetExplicit'] class TVPower(RaspiBaseMsg): _handle = 'power_ctrl' _properties = {'power'} def __init__(self, **kwargs): super(TVPower, self).__init__(**kwa...
{ "content_hash": "f3848a56db0cfb664f38054b3d9ad7d6", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 97, "avg_line_length": 30.185185185185187, "alnum_prop": 0.6082822085889571, "repo_name": "amaork/raspi-io", "id": "7675499a9f37d3c690347bcb0b3b2663c23286aa", "size": "328...
''' Jobber Behaviors ''' # pylint: disable=W0232 # Import python libs from __future__ import absolute_import import os import sys import types import logging import traceback import multiprocessing import subprocess import json # Import salt libs import salt.ext.six as six import salt.daemons.masterapi import salt.ut...
{ "content_hash": "3bca3644085176880b994be9f27d69de", "timestamp": "", "source": "github", "line_count": 400, "max_line_length": 118, "avg_line_length": 37.785, "alnum_prop": 0.4872965462485113, "repo_name": "stephane-martin/salt-debian-packaging", "id": "242f75e4df26b28a9ccba452797b7ed5f12c3d38", "...
import random import molecules import numpy.random as npr from Input.KnowledgeBase import KnowledgeBase as know class Process(object): """ Parent for all cellular processes. """ def __init__(self, id, name): self.id = id self.name = name self.enzyme_ids = [] self.subs...
{ "content_hash": "cc00cb6516ac1cb186caac662f47f43b", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 130, "avg_line_length": 36.21904761904762, "alnum_prop": 0.483565606100447, "repo_name": "fugufisch/hu_bp_python_course", "id": "d019c2fa152c75fe39767c8da4e8a5abcabe14f7", ...
from utils.header import MagicField, Field from load_command import LoadCommandCommand, LoadCommandHeader class SymtabCommand(LoadCommandHeader): ENDIAN = None FIELDS = ( MagicField('cmd', 'I', {LoadCommandCommand.COMMANDS['LC_SYMTAB']: 'LC_SYMTAB'}), Field('cmdsize', 'I'), Field('symo...
{ "content_hash": "5a73fc17b467490e368d3de7f56c1753", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 88, "avg_line_length": 31.333333333333332, "alnum_prop": 0.5896656534954408, "repo_name": "hkkwok/MachOTool", "id": "1e24ad7594bc5df6ac1ae22a9de73c2a52b95238", "size": "658...
"""Functional tests using WebTest.""" import datetime as dt import httplib as http import logging import unittest import httpretty import markupsafe import mock from nose.tools import * # flake8: noqa (PEP8 asserts) import re from addons.wiki.utils import to_mongo_key from framework.auth import exceptions as auth_ex...
{ "content_hash": "979c231cf3d29bd730bed3bf0f0eb4ea", "timestamp": "", "source": "github", "line_count": 1114, "max_line_length": 201, "avg_line_length": 40.87342908438061, "alnum_prop": 0.6384600180089166, "repo_name": "chrisseto/osf.io", "id": "2482feb4196daa83c334b8faaa95f49f6bf4412b", "size": "4...
import calendar import datetime import math from django.conf import settings from django.contrib.auth.management import create_permissions from django.contrib.auth.models import Group, Permission from django.core.exceptions import ValidationError from django.core.mail.backends.smtp import EmailBackend as SMTPBackend f...
{ "content_hash": "19165e8366263ef73769a3ed23108c0d", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 77, "avg_line_length": 32.45454545454545, "alnum_prop": 0.6666666666666666, "repo_name": "chirilo/remo", "id": "7a39d3c6686a02150d400f02215cc568e9c2eb2f", "size": "5355", ...
from fabric.api import sudo, env from fabric.contrib.files import append from fab_deploy2.base import nginx as base_nginx from fab_deploy2.tasks import task_method from fab_deploy2 import functions class Nginx(base_nginx.Nginx): """ Installs nginx """ user = 'nginx' group = 'nginx' remote_con...
{ "content_hash": "b21a598e71d148c468b1b4aafbc1f1e0", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 116, "avg_line_length": 27.833333333333332, "alnum_prop": 0.6287425149700598, "repo_name": "ff0000/red-fab-deploy2", "id": "9782fe17cd3a9ded8397bb5173f5d617c4eec171", "size...
VERSION = (1, 0, 0) from .decorators import job from .queues import enqueue, get_connection, get_queue, get_scheduler, get_failed_queue from .workers import get_worker
{ "content_hash": "95f604a77ccc3eda703cbb27b68f4f66", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 87, "avg_line_length": 33.8, "alnum_prop": 0.7633136094674556, "repo_name": "1024inc/django-rq", "id": "ea2045740997fc9f00007bf888e6cee420086b3d", "size": "169", "binary":...
import tre fz = tre.Fuzzyness(maxerr = 3) print fz pt = tre.compile("Don(ald( Ervin)?)? Knuth", tre.EXTENDED) data = """ In addition to fundamental contributions in several branches of theoretical computer science, Donnald Erwin Kuth is the creator of the TeX computer typesetting system, the related METAFONT font def...
{ "content_hash": "6ed272e98e3df47b9cef8fea5edd3fd6", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 70, "avg_line_length": 23.85, "alnum_prop": 0.7421383647798742, "repo_name": "amlweems/tre", "id": "38f23308cc774e630eaa1f687e7de51e4c7b2a2e", "size": "477", "binary": fa...
from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s): return s try: _encoding = QtGui.QApplication.UnicodeUTF8 def _translate(context, text, disambig): return QtGui.QApplication.translate(context, text, disambig, _encoding) ex...
{ "content_hash": "cb6c4846c1148cb5a7bac04a6c74b2c5", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 115, "avg_line_length": 52.1, "alnum_prop": 0.7040307101727448, "repo_name": "rainer85ah/VisionViewer", "id": "8351804bb5bd804bb5b4b91aa1614e40ff203c8a", "size": "5441", ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # r""" A JSON data encoder and decoder. This Python module implements the JSON (http://json.org/) data encoding format; a subset of ECMAScript (aka JavaScript) for encoding primitive data types (numbers, strings, booleans, lists, and associative arrays) in a language-n...
{ "content_hash": "28ee6d7b353e85fa2643a56e49d8db25", "timestamp": "", "source": "github", "line_count": 2136, "max_line_length": 153, "avg_line_length": 41.13295880149813, "alnum_prop": 0.5254495788754837, "repo_name": "swiftcoder/ashima-iv", "id": "580fbfa35d557751864943a97d9bf6b6314b27c9", "size"...
"""WAL-E is a program to assist in performing PostgreSQL continuous archiving on S3 or Windows Azure Blob Service (WABS): it handles pushing and fetching of WAL segments and base backups of the PostgreSQL data directory. """ import sys def gevent_monkey(*args, **kwargs): import gevent.monkey gevent.monkey.pa...
{ "content_hash": "d6448736eb7dc405aa52c74642c2e071", "timestamp": "", "source": "github", "line_count": 656, "max_line_length": 79, "avg_line_length": 39.26219512195122, "alnum_prop": 0.5895325361080913, "repo_name": "ArtemZ/wal-e", "id": "a453c959a9b029edfa9618529f439cd8c9093ae5", "size": "25778",...
version_info = (1, 0) version = '.'.join(map(str, version_info))
{ "content_hash": "1dc9ef46ecd87154007aae2a4742fd7a", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 42, "avg_line_length": 32.5, "alnum_prop": 0.6307692307692307, "repo_name": "8468/tint", "id": "02f6932a4c62edacee60e5a35803000d6aa0515c", "size": "65", "binary": false, ...
""" TODO: docs! """ import os, pickle, base64, time from gppylib.gplog import * from gppylib.db import dbconn from gppylib.db import catalog from gppylib import gparray from base import * from unix import * import pg from gppylib import pgconf from gppylib.utils import writeLinesToFile, createFromSingleHostFile, shell...
{ "content_hash": "c3f979c27627a52f39d35b53d142e059", "timestamp": "", "source": "github", "line_count": 1729, "max_line_length": 183, "avg_line_length": 38.26778484673221, "alnum_prop": 0.5938487115544472, "repo_name": "lintzc/gpdb", "id": "cae5558a2b57e9b90c9fad4ffcb2688ea5417ac7", "size": "66249"...
""" WSGI config for django_api project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application from dj_static import Cling os....
{ "content_hash": "016eb7b50f92e69ef9e75b7769fbe462", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 78, "avg_line_length": 23.944444444444443, "alnum_prop": 0.7679814385150812, "repo_name": "unicef/un-partner-portal", "id": "3d8561d4d7b6e5e3bd3e1337f5a82c0ef8c9033d", "siz...
import sys import os PATHS = [ # src and config '.', 'src', ] CURRENT_DIR = os.path.dirname(os.path.realpath(__file__)) PROJECT_ROOT_DIR = os.path.abspath(os.path.join(CURRENT_DIR, os.pardir)) LOCAL_SETTINGS_DIR = os.path.abspath( os.path.join(PROJECT_ROOT_DIR, os.pardir, 'local_config')) LOCAL_SETTI...
{ "content_hash": "5b705c76d92b30a37a82572772674115", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 78, "avg_line_length": 28.64864864864865, "alnum_prop": 0.6575471698113208, "repo_name": "memodir/cv", "id": "1c52c158458a38b6e2e70d19fe46e3cd1190cdf5", "size": "1084", "...
import mock import six from nova import exception from nova import objects from nova.pci import devspec from nova import test dev = {"vendor_id": "8086", "product_id": "5057", "address": "0000:0a:00.5", "parent_addr": "0000:0a:00.0"} class PciAddressSpecTestCase(test.NoDBTestCase): def test...
{ "content_hash": "1a3aaf293dbf70f9869a09b09f41bf8f", "timestamp": "", "source": "github", "line_count": 422, "max_line_length": 76, "avg_line_length": 43.14691943127962, "alnum_prop": 0.5366871704745168, "repo_name": "rajalokan/nova", "id": "ad35d190e28b59fcc5dc1d86e13aaa75354c1ba2", "size": "18784...
"""readgroupsets list command.""" from apitools.base.py import list_pager from googlecloudsdk.api_lib.genomics import genomics_util from googlecloudsdk.calliope import base class List(base.ListCommand): """List genomics read group sets in a dataset. Prints a table with summary information on read group sets in...
{ "content_hash": "b0a27ac08cc3beccde835f9b4bc3ef6e", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 80, "avg_line_length": 33.54666666666667, "alnum_prop": 0.609697933227345, "repo_name": "KaranToor/MA450", "id": "600728db1c46916fb4b23ca2bb5588349a5d1b02", "size": "3112",...
from xml.dom import minidom import simple_xml_utils as x from xmlcomp import XmlComponent import urllib import codecs from xmlxplode import BOM_MAP, BOM_LOOKUP from functools import partial import os XInclude_NS = 'http://www.w3.org/2001/XInclude' class EncodingWriter(object): def __init__(se...
{ "content_hash": "e193031a7df4619b7246175cab01f946", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 137, "avg_line_length": 36.372262773722625, "alnum_prop": 0.6094722054986955, "repo_name": "LeonPoon/XMLExplode", "id": "0fbfaeee71bfdc179c0e0dc427095026b42ff0ea", "size":...
import random import logging import os from slackclient import SlackClient import json logger = logging.getLogger(__name__) outputs = [] crontable = [] titles = ["Superior Person", "Dear Leader", "Respected Leader", "Wise Leader", "Brilliant Leader", "Unique Leader",...
{ "content_hash": "0eb8e81f13d08206ff0a0bcd72b55fdd", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 107, "avg_line_length": 35.54945054945055, "alnum_prop": 0.5672333848531684, "repo_name": "jamestenglish/PySlackRespectBot", "id": "c5d0a1599d9341e5d6fe2f6334e5776e69b5a6ce",...
""" Class for multi-threaded compression tool """ __author__ = 'sergey' from time import sleep, time from .base import BaseCompressTool, Task, Result from threading import Thread from queue import Queue from multiprocessing import cpu_count from dedupsqlfs.lib import constants class MultiThreadCompressTool(BaseCompr...
{ "content_hash": "a5fb9d197ba6f7943180e58639e2349d", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 120, "avg_line_length": 24.804232804232804, "alnum_prop": 0.48293515358361777, "repo_name": "sergey-dryabzhinsky/dedupsqlfs", "id": "942a92c7b67fd472883defd5fea6811f25f3174a...
import sys import os import shlex import sphinx_rtd_theme # Mock to make docs buildable on readthedocs.org try: from mock import Mock as MagicMock class Mock(MagicMock): @classmethod def __getattr__(cls, name): return Mock() MOCK_MODULES = ['vcf', 'requests'] sys.mod...
{ "content_hash": "aa791c76d4c9feefb86346af319af9c8", "timestamp": "", "source": "github", "line_count": 312, "max_line_length": 83, "avg_line_length": 31.59294871794872, "alnum_prop": 0.7051841331033784, "repo_name": "genestack/task-library", "id": "8c07458b4fcc344491c53512cfcfa1be98a9935a", "size"...
import urllib from pytube import YouTube import os def downloadYt(url, path): if os.path.exists(path): os.remove(path) folder = path[0: path.rfind("/")] fname = path[path.rfind("/") + 1: path.rfind(".")] yt = YouTube(url) video = yt.filter('mp4')[-1] # highest res yt.set_filename(fna...
{ "content_hash": "783f82cdeac59db3ed685bc67e140eb2", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 80, "avg_line_length": 24.263157894736842, "alnum_prop": 0.6182212581344902, "repo_name": "Jspsun/HackTheNorth2017", "id": "1b9c439ec02c0bb8db6c14dd5e9040893ea8e3d3", "size...
import os import vcr absolute_cassette_lib_path = os.path.join(os.path.dirname(__file__)) vcr_explicit_path = vcr.VCR( cassette_library_dir=absolute_cassette_lib_path, )
{ "content_hash": "a92b5fc63f4aee360df3350bda740d27", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 68, "avg_line_length": 19.666666666666668, "alnum_prop": 0.7288135593220338, "repo_name": "geometalab/osmaxx-frontend", "id": "1476a845e21e3129b92faae34abe00cb4b44e1b3", "si...
import sys from PyQt5.QtWidgets import QListWidgetItem from Commands.CommandType import CommandType class CommandItem(QListWidgetItem): name = None delay = 0 code = None description = None text = None def __init__(self, delay = 0, commandType = None, cmdParams = []): if (not isinstance(delay, int)) or (delay ...
{ "content_hash": "51f2ae7d7c343da08f6e6c25acb299d6", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 122, "avg_line_length": 35.42553191489362, "alnum_prop": 0.6720720720720721, "repo_name": "akkenoth/BTSerial", "id": "e6fbea190b7b7a2f7f70b9ae49510ee985168968", "size": "16...
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:6668") else: access = Ser...
{ "content_hash": "31a90e5c4296bbc3fe510183fca472a6", "timestamp": "", "source": "github", "line_count": 324, "max_line_length": 79, "avg_line_length": 24.19753086419753, "alnum_prop": 0.6618622448979592, "repo_name": "error-dev/ErrorCoin", "id": "b79e357b7d2e938c6fbd7b8b841bc2163ff1adb8", "size": "...
import logging import subprocess import Adafruit_GPIO.Platform as Platform def reverseByteOrder(data): """Reverses the byte order of an int (16-bit) or long (32-bit) value.""" # Courtesy Vishal Sapre byteCount = len(hex(data)[2:].replace('L','')[::2]) val = 0 for i in range(byteCount): ...
{ "content_hash": "13c26db64a531840ad55e13449a45582", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 100, "avg_line_length": 42.95530726256983, "alnum_prop": 0.635063077123163, "repo_name": "RandomGamer342/TTM4115-plantsensor", "id": "e63a2d1a133d7c6b2f2a1928fdce89db8f4f48b...
import sys import socket import argparse import cryptoconfig import peersockets def pushtx(crypto,num_peers_to_send,tx_list,addresses): crypto=crypto.lower() if crypto not in cryptoconfig.SUPPORTED_CRYPTOS: raise Exception("Crypto {} not supported, suppored cryptos are {}".format(crypto,cryptoconfig.S...
{ "content_hash": "d722409be228ebff3f0a81a932079569", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 132, "avg_line_length": 39.32608695652174, "alnum_prop": 0.6274184632393588, "repo_name": "kaykurokawa/pushtx", "id": "5c52ec1988c40514c1becf0c9b2fec4eecdc1a2a", "size": "1...
"""Tokenization classes for CLIP.""" import json import os from functools import lru_cache from typing import List, Optional, Tuple import regex as re from transformers.models.bert.tokenization_bert import BasicTokenizer from ...tokenization_utils import AddedToken, PreTrainedTokenizer from ...utils import logging ...
{ "content_hash": "1dd97a4f9d50aeeb2e01920201ff0d4a", "timestamp": "", "source": "github", "line_count": 357, "max_line_length": 119, "avg_line_length": 39.299719887955185, "alnum_prop": 0.5869565217391305, "repo_name": "huggingface/pytorch-transformers", "id": "39eed99e3ac83211ec520a847f001be8f974624...
from flask import Blueprint, render_template, session, redirect, url_for, \ request, flash, g, jsonify, abort from flask.ext.openid import COMMON_PROVIDERS from flask_website import oid from flask_website.search import search as perform_search from flask_website.utils import requires_login, request_wants_json from...
{ "content_hash": "c880a26684152a0e0d3fb99e34d37084", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 75, "avg_line_length": 33.960629921259844, "alnum_prop": 0.62068166009738, "repo_name": "LiHaoGit/flask-website", "id": "257900bc33397f9965f25233146413aedd0072c1", "size":...
import sys import os from basic.common import ROOT_PATH,readRankingResults from basic.annotationtable import readConcepts,readAnnotationsFrom,writeAnnotationsTo,writeConceptsTo if __name__ == '__main__': rootpath = ROOT_PATH collection = 'geoflickr1m' collection = 'flickr1m' #collection = 'web13train' ...
{ "content_hash": "c3645dedbea58df8364f9de77b050115", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 134, "avg_line_length": 42.9390243902439, "alnum_prop": 0.6614598125532519, "repo_name": "li-xirong/jingwei", "id": "7bd15dd297b8ed749654265aa979f785ff7194b6", "size": "352...
""" The client object holds the connection information, and methods of the client connected via TCP. """ import Queue import time import logging from channel import Channel class TCPClient(object): """TCPClient object.""" def __init__(self, server, connection, address): """ Set up the ...
{ "content_hash": "1fe5b5a56a2204d9c638fad21dd5c461", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 102, "avg_line_length": 31.441558441558442, "alnum_prop": 0.5960346964064436, "repo_name": "martinjlowm/Voixer", "id": "252e964480fa152ba20ed8be38e77b2709862bcf", "size": "...
""" Atmosphere ========== The atmosphere module contains functions and classes related to atmospheric acoustics and is based on :mod:`acoustics.standards.iso_9613_1_1993`. Atmosphere class **************** .. autoclass:: acoustics.atmosphere.Atmosphere From ISO 9613-1 1993 ******************** Constants ---------...
{ "content_hash": "c2fad3c2059378f67b3044695a85249e", "timestamp": "", "source": "github", "line_count": 198, "max_line_length": 205, "avg_line_length": 36.101010101010104, "alnum_prop": 0.6225517627308338, "repo_name": "giumas/python-acoustics", "id": "06dcc59548cc327eefdfd4b372fc550f9dc396c9", "si...
__version__='${RFR_VERSION_MAJOR}.${RFR_VERSION_MINOR}.${RFR_VERSION_RELEASE}' __version_info__=(${RFR_VERSION_MAJOR}, ${RFR_VERSION_MINOR}, ${RFR_VERSION_RELEASE})
{ "content_hash": "1dcd21b493d00f533093400e44eb337b", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 85, "avg_line_length": 82.5, "alnum_prop": 0.6787878787878788, "repo_name": "sfalkner/random_forest_run", "id": "2b5894ec64c234665575543544d1e128e314d06d", "size": "165", ...
from __future__ import print_function, division, absolute_import from collections import defaultdict from datetime import timedelta import logging import six import socket import struct from time import time import traceback import uuid from toolz import assoc, first try: import cPickle as pickle except ImportEr...
{ "content_hash": "15ef27f30271d9bba988b1efb42ab85e", "timestamp": "", "source": "github", "line_count": 670, "max_line_length": 90, "avg_line_length": 30.562686567164178, "alnum_prop": 0.5708844068955413, "repo_name": "amosonn/distributed", "id": "d19074620850cc100b6a2e6a42372f2b61d6f6ff", "size": ...
class FormicaArgumentException(Exception): pass
{ "content_hash": "109da4a0c19595fa5af11378987e66c8", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 42, "avg_line_length": 26, "alnum_prop": 0.8076923076923077, "repo_name": "flomotlik/formica", "id": "80171995c6a32b8ce139c8eafe30f6a3ba29c1d1", "size": "52", "binary": fa...
"""cli. Desc: Command-line tool for listing Python packages installed by setuptools, package metadata, package dependencies, and querying The Cheese Shop (PyPI) for Python package release information such as which installed packages have updates available. Author: Rob Cakebread <gentoodev a t gmail....
{ "content_hash": "d0eb1c37535c80415a0b74d30ee8840a", "timestamp": "", "source": "github", "line_count": 1174, "max_line_length": 79, "avg_line_length": 32.885860306643956, "alnum_prop": 0.5347855366763365, "repo_name": "myint/yolk", "id": "3becfecacbf69c80a3c71d511f6615dd92902e3b", "size": "38633",...
""" lantz_core.unit ~~~~~~~~~~~~~~~ Unit handling is done using the Pint library. If absent the unit support is simply disabled. This module allows the user to specify the UnitRegistry to be used by Lantz and exposes some useful Pint features. :copyright: 2015 by Lantz Authors, see AUTHOR...
{ "content_hash": "40b367bfe190e8ad1ed14a63e26254dd", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 79, "avg_line_length": 24.04901960784314, "alnum_prop": 0.6583774969425193, "repo_name": "MatthieuDartiailh/lantz_core", "id": "94c1b5e77a19f2c884b72e4967a580d70059e312", ...
import flask from www import server from www import login import common.rpc import html from collections import OrderedDict SECTIONS = OrderedDict(( ("info", "Stream information"), ("quotes", "Quotes"), ("text", "Simple text responses"), ("misc", "Miscellaneous"), )) DEFAULT_SECTION = "misc" def command_format(cm...
{ "content_hash": "57e60b72902a86647675e43031d41fd3", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 111, "avg_line_length": 33.529411764705884, "alnum_prop": 0.7026315789473684, "repo_name": "andreasots/lrrbot", "id": "925ec5587b848c97fd6f5ab78ef46b589aeb2f02", "size": "1...
from bluffinmuffin.protocol.enums import BluffinMessageIdEnum from bluffinmuffin.protocol.interfaces import AbstractResponse from bluffinmuffin.protocol.data_types import TupleTable from .list_table_command import ListTableCommand class ListTableResponse(AbstractResponse): def __init__(self, success, message_id, ...
{ "content_hash": "3f963284ce09e2007574bb90a09e9d1d", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 92, "avg_line_length": 34.53333333333333, "alnum_prop": 0.6148648648648649, "repo_name": "Ericmas001/BluffinMuffin.Protocol", "id": "be95ebb9047ea6397fb6c4c9f301a7d1134f65f8"...
from twisted.internet import interfaces, reactor from zope.interface import implementer import logging log = logging.getLogger(__name__)
{ "content_hash": "b74923db94a1bbf0f18b41e2e8d50ed1", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 48, "avg_line_length": 17.625, "alnum_prop": 0.7943262411347518, "repo_name": "ebu/ebu-tt-live-toolkit", "id": "7f2d80c3041c0b9a22981827a11dd47c4bcc53d5", "size": "142", "...
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import Select from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import NoAlertPresentException import unittest, time, ...
{ "content_hash": "c70700c079b25c2fba3842e4da717918", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 76, "avg_line_length": 39.96610169491525, "alnum_prop": 0.6484308736217134, "repo_name": "foxtrot94/EchelonPlanner", "id": "d1c80b56376067c706c3c3e32fce02f0543765a5", "size...
from os.path import dirname, join try: from setuptools import setup except ImportError: from distutils.core import setup from rest_framework_rules import VERSION def get_version(version): return '.'.join(map(str, version)) with open(join(dirname(__file__), 'README.rst')) as f: long_description = f...
{ "content_hash": "af628a856051a91edf6305b22054b64c", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 71, "avg_line_length": 30.4, "alnum_prop": 0.6394736842105263, "repo_name": "escodebar/django-rest-framework-rules", "id": "bd3c0c51156f9b98dfb2e970d77c30bcff6db656", "size...
import os import re from . import util class IvwPaths: """ Given a path to a file try and find all related files. """ def __init__(self, filepath): (path, file) = os.path.split(filepath) abspath = os.path.abspath(path).split(os.sep) self.class_name = file self.file_name = file.lower() m = re.compile...
{ "content_hash": "c665103ed78cb63d241c50f16603167e", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 146, "avg_line_length": 41.23684210526316, "alnum_prop": 0.6426292278238672, "repo_name": "cgloger/inviwo", "id": "ad29b2dab940d47dc7bfd3422ed7572c60e34c3f", "size": "6260...
""" This module contains very useful functions you can use while unittesting student's code. .. note:: In order to use the :mod:`unittest` module, you need to make sure that you have SWIG installed, and that you have *Python development headers* installed, both of which are probably available through your...
{ "content_hash": "803493d24c6732f78539a2d1c5fe1cd6", "timestamp": "", "source": "github", "line_count": 312, "max_line_length": 82, "avg_line_length": 32.61217948717949, "alnum_prop": 0.6102211302211302, "repo_name": "galah-group/galah-interact-python", "id": "4261bfbd26697fc4cb1013a8de89e26041dcfd24...
<<<<<<< HEAD <<<<<<< HEAD r"""Fixer for unicode. * Changes unicode to str and unichr to chr. * If "...\u..." is not unicode literal change it into "...\\u...". * Change u"..." into "...". """ from ..pgen2 import token from .. import fixer_base _mapping = {"unichr" : "chr", "unicode" : "str"} class FixUnicode(fix...
{ "content_hash": "4376da7a15ced909bad8ac9c5023f734", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 77, "avg_line_length": 29.606060606060606, "alnum_prop": 0.513050153531218, "repo_name": "ArcherSys/ArcherSys", "id": "86dea3bc94ad2d1ccb8f871720010f9563536d56", "size": "...
''' Created on Apr 11, 2014 @author: igor ''' class AbstractAction(): pass class CreateNewModelInstanceAction(AbstractAction): pass class CreateModelAttributeAction(AbstractAction): pass class CreateReferenceInstanceAction(AbstractAction): pass class CreateAttributeValuesAction(AbstractAction)...
{ "content_hash": "4ddb726fabcee196ea8616d81b97ea48", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 52, "avg_line_length": 12.552631578947368, "alnum_prop": 0.7568134171907757, "repo_name": "igordejanovic/MetaMoRP", "id": "0caf7348f5d0618504947493d6c50e5dc10a6d37", "size"...
import matplotlib matplotlib.use('Agg') from matplotlib.mlab import PCA import matplotlib.pyplot as plt import argparse import os import shutil import time import sys import copy import torch from torchvision import datasets, transforms from torch.autograd import Variable import numpy as np from random import shuff...
{ "content_hash": "faf8c7cfb13ddb56d59916a6233138ad", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 125, "avg_line_length": 33.557522123893804, "alnum_prop": 0.6293512658227848, "repo_name": "schinmayee/metric-learning", "id": "d6f61cd6ebaa3d07a31690b2dac8f3790ecbbb6a", ...
import os import csv import shutil import subprocess from datetime import datetime from django.db import connection from django.conf import settings from django.core.management.base import BaseCommand def write(path, header, cursor): with open(path, 'w') as fout: writer = csv.writer(fout) writer....
{ "content_hash": "879a54c35912ef02387bca760b61c5ec", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 87, "avg_line_length": 43.27536231884058, "alnum_prop": 0.5780308104487609, "repo_name": "fpsw/Servo", "id": "253c4fae09929b1b494b2990b739295146b557fa", "size": "5997", ...
SECRET_KEY = 'dog' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', } } CHANNEL_LAYERS = { 'default': { 'BACKEND': 'asgiref.inmemory.ChannelLayer', 'ROUTING': "tests.routing.channel_routing", }, } MIDDLEWARE_CLASSES = [] INSTALLED_APPS = ( 'django.contri...
{ "content_hash": "3dc2919f5d72d0e01e1a8e1dbd9e1723", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 51, "avg_line_length": 17.708333333333332, "alnum_prop": 0.5882352941176471, "repo_name": "linuxlewis/channels-api", "id": "866f283bfe367ffdd5fa05d27cecb272633a9afd", "size...
import os import sys #sys.path.append('/Users/carlomazzaferro/Documents/Code/variantannotation-master') from variantannotation import annotate_batch from variantannotation import myvariant_parsing_utils from variantannotation import mongo_DB_export from variantannotation import create_output_files from variantannotati...
{ "content_hash": "817eed5fb0f004dd2863b8cb35fb7c69", "timestamp": "", "source": "github", "line_count": 243, "max_line_length": 110, "avg_line_length": 36.205761316872426, "alnum_prop": 0.7377813139349853, "repo_name": "ucsd-ccbb/jupyter-genomics", "id": "c2659dfd144eacab6cef4bc2cd38823362cb4dd2", ...
"""Public ops that allow FFmpeg encoding and decoding operations.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.ffmpeg.ops import gen_decode_audio_op_py from tensorflow.contrib.ffmpeg.ops import gen_encode_audio_op_py from tenso...
{ "content_hash": "a0942b20d150fb361d8ea9946259bf25", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 80, "avg_line_length": 34.57142857142857, "alnum_prop": 0.7119591638308216, "repo_name": "shishaochen/TensorFlow-0.8-Win", "id": "cdb8006e6b90c1942fdf79b4ccf710376ae18c65", ...
from __future__ import absolute_import from chaco.tools.toolbars.toolbar_buttons import *
{ "content_hash": "622418139b2c9d4b3741723b46f37f4e", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 50, "avg_line_length": 45, "alnum_prop": 0.8, "repo_name": "enthought/etsproxy", "id": "a5799c05904469daa6e9a3c1a7af9adbbaaf6cc9", "size": "105", "binary": false, "copie...
"""Color-mod.""" import re from mdpopups.coloraide import Color as ColorCSS from mdpopups.coloraide import ColorMatch from mdpopups.coloraide.spaces import _parse from mdpopups.coloraide import util import functools import math WHITE = [1.0] * 3 BLACK = [0.0] * 3 TOKENS = { "units": re.compile( r"""(?xi) ...
{ "content_hash": "0e605eadb71372a698886161743bb2e8", "timestamp": "", "source": "github", "line_count": 632, "max_line_length": 119, "avg_line_length": 34.6376582278481, "alnum_prop": 0.5092503768672058, "repo_name": "facelessuser/ThemeTweaker", "id": "1018d51cb70008ff96fa51e9a926363f9337cc2d", "si...
import glob import time import stat import math import linecache import os import sys import subprocess from fabric.operations import run, put from fabric.api import env,run,hide,settings from fabric.context_managers import shell_env from fabric.operations import put import shutil import datetime #====================...
{ "content_hash": "2b8f456e3c3d9b7239fc53da4ad4acaf", "timestamp": "", "source": "github", "line_count": 1014, "max_line_length": 249, "avg_line_length": 39.87179487179487, "alnum_prop": 0.6259213455354935, "repo_name": "leschzinerlab/AWS", "id": "e3c28899a8eb2707b82a596b2662250b5c842c0d", "size": "...
""" test_parse_tg ~~~~~~~~~~~~~ Test glass transition parser. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging import unittest from lxml import etree from chemdataextractor.doc.text import Sentenc...
{ "content_hash": "8316e034e532906b43d9b8ddb70df0e4", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 166, "avg_line_length": 39.95505617977528, "alnum_prop": 0.640607424071991, "repo_name": "mcs07/ChemDataExtractor", "id": "433620fe74edde0f4c9817efb732bedea9e85c42", "size"...
import sys from SentenceExampleWriter import SentenceExampleWriter import Utils.InteractionXML.IDUtils as IDUtils try: import xml.etree.cElementTree as ET except ImportError: import cElementTree as ET import Utils.Range as Range class PhraseTriggerExampleWriter(SentenceExampleWriter): def __init__(self): ...
{ "content_hash": "b575964e81fce026c9545f3401e2d136", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 169, "avg_line_length": 46.892857142857146, "alnum_prop": 0.6675552170601675, "repo_name": "ashishbaghudana/mthesis-ashish", "id": "e3228b4c951e4659888e41eb7d1b248e5324290a",...
import _TetGen # This file is compatible with both classic and new-style classes. def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "this"): if isinstance(value, class_type): self.__dict__[name] = value.this if hasattr(value,"thisown"): self.__dict__["th...
{ "content_hash": "a67424425fa42b8cddca01a0fc9ef320", "timestamp": "", "source": "github", "line_count": 289, "max_line_length": 161, "avg_line_length": 63.799307958477506, "alnum_prop": 0.7249701703004664, "repo_name": "minesense/VisTrails", "id": "8794b175eca9f43726287cedb8c26fc4b8e4b437", "size":...
from kivy.uix.boxlayout import BoxLayout from kivy.properties import StringProperty, NumericProperty class PotionWidget(BoxLayout): name = StringProperty(None) minimum = NumericProperty(1) maximum = NumericProperty(5) current = NumericProperty(1) potion_id = NumericProperty(None) current_durati...
{ "content_hash": "f3eb6a9256ad0c8b73bcae6af5467a48", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 79, "avg_line_length": 33.285714285714285, "alnum_prop": 0.7195994277539342, "repo_name": "Kovak/KivyNBT", "id": "6564c885b07678bcd31c2c033e8b96029a43a22e", "size": "699", ...
import base64 import os.path import string import sys import tempfile import zipfile DEBUG_ZIPPEY = False NAME = 'Zippey' ENCODING = 'UTF-8' def debug(msg): '''Print debug message''' if DEBUG_ZIPPEY: sys.stderr.write('{0}: debug: {1}\n'.format(NAME, msg)) def error(msg): '''Print error message'...
{ "content_hash": "feae30cff0e014a88c98cd05ff66fcb6", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 79, "avg_line_length": 31.26126126126126, "alnum_prop": 0.5510086455331412, "repo_name": "Empiria/matador", "id": "50bca14f925eec791b0ae9d96d6a0ed16aed158c", "size": "7260...
"""Exceptions related to publishing TestResults""" class PublishFailure(Exception): """An exception thrown when sending a test result to a publisher fails. :param publisher: The publisher that failed to publish. :param result: The result that failed to publish. """ def __init__(self, publisher,...
{ "content_hash": "ff07848886764e805feba75b48108a7e", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 78, "avg_line_length": 32.59722222222222, "alnum_prop": 0.6011930123561994, "repo_name": "curtisallen/Alarmageddon", "id": "75e9d9190c18ecec4547c7c724fc7d8f783617bc", "size...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('api', '0004_message_last_reply_date'), ] operations = [ migrations.AlterUniqueTogether( name='moduleasset', unique_together=set([]),...
{ "content_hash": "4eec5c367a2449bb1b63f1fbc8a822c2", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 48, "avg_line_length": 23.457142857142856, "alnum_prop": 0.5286236297198539, "repo_name": "patchew-project/patchew", "id": "d012b12e2844be447c8cbdbbf18907a12d1b4aed", "size...
""" LICENCE ------- Copyright 2013 by Kitware, Inc. All Rights Reserved. Please refer to KITWARE_LICENSE.TXT for licensing information, or contact General Counsel, Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065. """ from .VCDStoreBackendInterface import VCDStoreBackendInterface from .SQLiteVCDStoreBackend ...
{ "content_hash": "29ce4a61599d65a729cb683db45cd1d7", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 74, "avg_line_length": 31.727272727272727, "alnum_prop": 0.7994269340974212, "repo_name": "anguoyang/SMQTK", "id": "17875c78436709ba91fc4a97fbc3668c38e48d2a", "size": "349"...
"""Beam utilities.""" import apache_beam as beam import numpy as np from typing import List, Tuple class MeanVarianceCombineFn(beam.CombineFn): """Class implementing a beam transformation that computes dataset statistics. Implements methods required by beam.CombineFn interface to be used in a pipeline. Called ...
{ "content_hash": "c1779cf529f083d01504cb6f94878d99", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 80, "avg_line_length": 35.89705882352941, "alnum_prop": 0.6796394920114707, "repo_name": "google-research/data-driven-advection", "id": "76342056f39cb9ce388c021796e096f384397...
from django.db import models from django.utils.translation import ugettext as _ from django.contrib import admin from rest_framework import serializers class ProjectStatus(models.Model): title = models.CharField(verbose_name=_("Title"), max_length=250, bla...
{ "content_hash": "d26bd06af033255efb489fbcc5610bba", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 87, "avg_line_length": 29.595744680851062, "alnum_prop": 0.5111430625449317, "repo_name": "dario61081/koalixcrm", "id": "ccebbc4992d059cb499c812a27ff2b60e63e261c", "size": ...
from .avro import FlinkAvroDecoder, FlinkAvroDatumReader __all__ = [ "FlinkAvroDatumReader", "FlinkAvroDecoder" ]
{ "content_hash": "abd7898a42a22da2aa402915ff57d807", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 56, "avg_line_length": 20.5, "alnum_prop": 0.7235772357723578, "repo_name": "lincoln-lil/flink", "id": "eb2fc50337d9b5bb6644e792fb5f6d225e1a64aa", "size": "1081", "binary"...
""" @author: Exile @date: 05-07-2016 @place: Cartagena - Colombia @licence: Creative Common """ from django.contrib import admin from exile_ui.admin import admin_site from import_export.formats import base_formats from import_export.admin import ExportMixin, ImportExportModelAdmin from import_export imp...
{ "content_hash": "7f1d9aa95e0e57a264f4617ca4eca81a", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 67, "avg_line_length": 24.166666666666668, "alnum_prop": 0.6922413793103448, "repo_name": "exildev/Piscix", "id": "3a396eb55eb17bcfd66ff310bf9c2ba8e4d34334", "size": "1206"...
"""Hue sensor entities.""" from aiohue.sensors import TYPE_ZLL_LIGHTLEVEL, TYPE_ZLL_TEMPERATURE from homeassistant.const import ( DEVICE_CLASS_ILLUMINANCE, DEVICE_CLASS_TEMPERATURE, TEMP_CELSIUS, ) from homeassistant.helpers.entity import Entity from .const import DOMAIN as HUE_DOMAIN from .sensor_base im...
{ "content_hash": "164e5f3df1c24a7601091b3e8e68e410", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 95, "avg_line_length": 31.652631578947368, "alnum_prop": 0.6451612903225806, "repo_name": "postlund/home-assistant", "id": "5fa2ed683895ba8021c8369b3d5cd21403077f88", "size...
import logging from blox.modules.module import module from blox.exceptions import * from xml.dom.minidom import parseString logger = logging.getLogger( 'blox' ) class xmlparse(module): def output(self, input, params): logger.debug('processing xml') if not input: raise ParseException( 'Invalid input' ) ...
{ "content_hash": "c60942d4efdd1bede935a3b883b29458", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 45, "avg_line_length": 28.4, "alnum_prop": 0.7112676056338029, "repo_name": "pollett/blox", "id": "7b155522412701aaeab9b171d1e6bde7e90f5ba2", "size": "426", "binary": fal...
from setuptools import setup, find_packages setup(name='django-starter-box', version='0.1.1', license='MIT', description='Django starter box', long_description='Starter box', author='Lucas Tan', author_email='do-not-spam@gmail.com', url='http://github.com/lucastan/django-starter-box', p...
{ "content_hash": "799cbf148f3e2b00af8b738eb5f7bbb1", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 56, "avg_line_length": 32.75, "alnum_prop": 0.6170483460559797, "repo_name": "lucastan/django-starter-box", "id": "65c688c0a4a68a22de1cefe8504513e636f5fcf1", "size": "786",...
from charmhelpers.core import hookenv from charms.layer.apache_bigtop_base import get_layer_opts, get_package_version from charms.layer.bigtop_hive import Hive from charms.reactive import ( RelationBase, is_state, remove_state, set_state, when, when_not, ) from charms.reactive.helpers import dat...
{ "content_hash": "a2ab0c40fb1f671b4442ef3abfc4ed36", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 79, "avg_line_length": 31.43016759776536, "alnum_prop": 0.6477070742979026, "repo_name": "mbalassi/bigtop", "id": "bf4ce2b82da2d225e136a41419c5da7201fb8588", "size": "6408...
''' GUI written in QT5 to perform the Laplace Approximation ''' from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QHBoxLayout, QPushButton, QComboBox, QLabel, QLineEdit, QMessageBox, QMainWindow, QShortcut, QGroupBox,QFormLayout,QSpinBox from PyQt5.QtGui import QStandardItemModel, QStandardItem from PyQt5...
{ "content_hash": "7266ba83a979ecbba7b2d85329ceadc7", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 187, "avg_line_length": 30.043243243243243, "alnum_prop": 0.6658870097157251, "repo_name": "ckinzthompson/biasd", "id": "837c276db219ac046329fc5394838be2840f1db9", "size":...
from django.conf import settings ADMIN_THUMB_HEIGHT = 140 IMAGE_CROPPING_RATIO = getattr(settings, 'GALLERIES_IMAGE_CROPPING_RATIO', '16x9') # Find the ADMIN_THUMBNAIL_SIZE based on the given IMAGE_CROPPING_RATIO width, height = [int(i) for i in IMAGE_CROPPING_RATIO.split("x")] ADMIN_THUMBNAIL_SIZE = getattr(setting...
{ "content_hash": "91f07f4bd215fa98fa83297dbea445fe", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 159, "avg_line_length": 49.111111111111114, "alnum_prop": 0.7579185520361991, "repo_name": "espenhogbakk/django-galleries", "id": "a9df6fa0ee341975708a38bdb8f89b90471d1295", ...
import logging import os import pickle from typing import List, Optional import numpy as np import torch from anndata import AnnData, read from scvi import _CONSTANTS from scvi.data import transfer_anndata_setup from scvi.core.models import BaseModelClass, VAEMixin from scvi.core.modules import JVAE, Classifier from ...
{ "content_hash": "3b729cfae9afc8501a1a0b43402375f6", "timestamp": "", "source": "github", "line_count": 471, "max_line_length": 101, "avg_line_length": 36.30785562632696, "alnum_prop": 0.5579790655517222, "repo_name": "YosefLab/scVI", "id": "6b43b0862b4d667de1d29b3a760e9d928cdca95a", "size": "17101...
""" Setup script for PyPI """ import os from setuptools import setup from ConfigParser import SafeConfigParser settings = SafeConfigParser() settings.read(os.path.realpath('cumulus_ds/settings.conf')) setup( name='cumulus', version=settings.get('general', 'version'), license='Apache Software License', ...
{ "content_hash": "e9acb36d09a27a601ab134818bb7d23e", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 67, "avg_line_length": 29.558823529411764, "alnum_prop": 0.663681592039801, "repo_name": "skymill/cumulus", "id": "d5d3b314ecdd6dbfdd761ca68e7bd4f50dad5b5d", "size": "1005"...
""" Model for (133,171) rate-compatible punctured convolutional (RCPC) code; contains `RCPC` class. Revision Info ============= * $LastChangedBy: mandke $ * $LastChangedDate: 2011-04-28 14:37:55 -0500 (Thu, 28 Apr 2011) $ * $LastChangedRevision: 4954 $ :author: Ketan Mandke <kmandke@mail.utexas.edu> :copyright: ...
{ "content_hash": "49f75d37fe9b38ef1d694586c049201d", "timestamp": "", "source": "github", "line_count": 240, "max_line_length": 118, "avg_line_length": 40.6375, "alnum_prop": 0.6060699272018866, "repo_name": "reidlindsay/wins", "id": "ede2c25f4c83a498137f9bbdb9ddfaa00089c0ac", "size": "9778", "bi...
from .stochastic_gradient import BaseSGDClassifier from .stochastic_gradient import BaseSGDRegressor from .stochastic_gradient import DEFAULT_EPSILON class PassiveAggressiveClassifier(BaseSGDClassifier): """Passive Aggressive Classifier Parameters ---------- C : float Maximum step size (regu...
{ "content_hash": "3d38241fe7ae6033da315764233233c8", "timestamp": "", "source": "github", "line_count": 275, "max_line_length": 79, "avg_line_length": 35.32363636363636, "alnum_prop": 0.5595017500514721, "repo_name": "soulmachine/scikit-learn", "id": "b06c5f3146aba34c693e2a7f5b23357694cbf007", "siz...
from tigergrader.initdb import create_user import unittest from testhelper import TestHelper class LoginTestCases(TestHelper): def test_invalid_login(self): rv = self.login('nobody', 'sesame') assert "Invalid Credentials" in rv.data def test_no_login(self): rv = self.app.get('/report/...
{ "content_hash": "6ab8edb7668d53890a3f590a75c82930", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 78, "avg_line_length": 41.212765957446805, "alnum_prop": 0.6404233350542076, "repo_name": "pablooliveira/tigergrader", "id": "640743600049f536f1e3a78d1782a7720957c920", "si...
from azure.cli.command_modules.sf.config import SfConfigParser from azure.cli.core.util import CLIError from azure.servicefabric import ServiceFabricClientAPIs from azure.cli.command_modules.sf.cluster_auth import ClientCertAuthentication from azure.cli.core.commands.client_factory import configure_common_settings de...
{ "content_hash": "89ce0fc3f7eb78744621226523c868fc", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 94, "avg_line_length": 39.76190476190476, "alnum_prop": 0.7592814371257485, "repo_name": "samedder/azure-cli", "id": "949dda9be0dfca5f4da6e8af2ae44bb17db1c7db", "size": "11...
""" Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.7.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class V1beta1Ne...
{ "content_hash": "e21328ebb9c0da5ee1f6e2dff2220204", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 395, "avg_line_length": 37.829787234042556, "alnum_prop": 0.6166104236970379, "repo_name": "djkonro/client-python", "id": "61ab58de9d4612b9ebc098da76d5a3c349eefe19", "size...
from salesforce.testrunner.settings import * # replace the test app INSTALLED_APPS = tuple(x for x in INSTALLED_APPS if x != 'salesforce.testrunner.example') INSTALLED_APPS += ('tests.inspectdb',)
{ "content_hash": "a6d3832c0d6b4fcd6f7870e39a63b4c5", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 89, "avg_line_length": 39.6, "alnum_prop": 0.7575757575757576, "repo_name": "philchristensen/django-salesforce", "id": "af36226193ed23f0a0484098b028de2c255b0731", "size": "1...
# # Tables describing slots in the CPython type object # and associated know-how. # import Naming import PyrexTypes import StringEncoding invisible = ['__cinit__', '__dealloc__', '__richcmp__', '__nonzero__', '__bool__'] class Signature(object): # Method slot signature descriptor. # # ...
{ "content_hash": "0da973c3dc7377217ea3956ee9f03613", "timestamp": "", "source": "github", "line_count": 822, "max_line_length": 133, "avg_line_length": 40.77250608272506, "alnum_prop": 0.5716246456810383, "repo_name": "genome-vendor/cython", "id": "a66a1d33488a939243c70985366ec96de9a440aa", "size":...
"""Train and evaluate the model.""" import logging import tensorflow as tf import tensorflow_transform as tft from tfx_taxifare_tips.model_training import model_input from tfx_taxifare_tips.model_training import model def train( data_accessor, train_data_dir, eval_data_dir, tft_output_dir, log_di...
{ "content_hash": "3b5cb479f755df5362cd2c17eff24a26", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 88, "avg_line_length": 27.83653846153846, "alnum_prop": 0.6766839378238342, "repo_name": "GoogleCloudPlatform/training-data-analyst", "id": "41a8363756350617a90825c5f29e0b9e...
import frappe from frappe.defaults import * from frappe.tests.utils import FrappeTestCase class TestDefaults(FrappeTestCase): def test_global(self): clear_user_default("key1") set_global_default("key1", "value1") self.assertEqual(get_global_default("key1"), "value1") set_global_default("key1", "value2") s...
{ "content_hash": "1793b91d4c27fa01104c36d01509b401", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 76, "avg_line_length": 32.40845070422535, "alnum_prop": 0.6988265971316818, "repo_name": "frappe/frappe", "id": "3c04f16ec85838d3657dde7188929b43aeb0b314", "size": "2398", ...
""" Run RSA with py4java distribution and discovery module :author: Scott Lewis :copyright: Copyright 2020, Scott Lewis :license: Apache License 2.0 :version: 1.0.1 .. Copyright 2020 Scott Lewis Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in complian...
{ "content_hash": "0cf1bc04ece1d78f809f6da15e140b17", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 80, "avg_line_length": 28.073170731707318, "alnum_prop": 0.5925282363162467, "repo_name": "tcalmant/ipopo", "id": "98bb589cab0b7443d7eb122d09a530b16baebc01", "size": "2352"...
from oslo_serialization import jsonutils from oslo_utils import versionutils from nova import db from nova import exception from nova.objects import base from nova.objects import fields as obj_fields from nova.virt import hardware # TODO(berrange): Remove NovaObjectDictCompat @base.NovaObjectRegistry.register class ...
{ "content_hash": "f34ddaa9cf45fcd588f5f79f71e0a5c6", "timestamp": "", "source": "github", "line_count": 238, "max_line_length": 79, "avg_line_length": 38.39495798319328, "alnum_prop": 0.6116217990807616, "repo_name": "jianghuaw/nova", "id": "3872d69945416527614a7a7897ed33b072869759", "size": "9746"...
from django.contrib import admin from mords_api.models import Word, Book, Learner, Note, Entry, LearningWord admin.site.register(Word) admin.site.register(Book) admin.site.register(Learner) admin.site.register(Note) admin.site.register(Entry) admin.site.register(LearningWord)
{ "content_hash": "ae55f34797cbf6cffd6d757284ccf6be", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 75, "avg_line_length": 27.9, "alnum_prop": 0.8100358422939068, "repo_name": "cheng10/M-ords", "id": "e0327fb729273831281cd1676e9a702cc10dbf75", "size": "279", "binary": f...
from __future__ import print_function from doit.task import clean_targets def simple(): print("ok") def task_poo(): return { 'actions': ['touch poo'], 'targets': ['poo'], 'clean': [clean_targets, simple], }
{ "content_hash": "616753e7291b9a5c286a1d0f3ccc5bf4", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 41, "avg_line_length": 20.75, "alnum_prop": 0.5582329317269076, "repo_name": "gh0std4ncer/doit", "id": "d5317d5bb504d5960156824ec0a9f729f47c4e95", "size": "249", "binary"...
import sublime import sublime_plugin import fnmatch import os import shutil import sys import threading import time try: from . import tools except ValueError: from package_sync_helpers import tools class Queue(object): current = None pool = [] def __init__(self): pass def start(s...
{ "content_hash": "08a995ca948e1abf09ca7ead1c9e4fef", "timestamp": "", "source": "github", "line_count": 407, "max_line_length": 101, "avg_line_length": 37.51105651105651, "alnum_prop": 0.5545948778410952, "repo_name": "utkarsh9891/PackageSync", "id": "0b0d113f25a06318c92825a1cc884b466127133e", "siz...
import os from datetime import date from unittest import skipUnless from django.conf import settings from django.contrib.sitemaps import Sitemap from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.test import modify_settings, override_settings from django.ut...
{ "content_hash": "67292ce9abe773a62943be5a7eb52e7e", "timestamp": "", "source": "github", "line_count": 277, "max_line_length": 204, "avg_line_length": 45.57761732851986, "alnum_prop": 0.6707326732673268, "repo_name": "timgraham/django", "id": "e757170241d7e27f00141fb8aa4b3095c571ec8e", "size": "12...
""" To install MySQL Connector/Python: shell> python ./setup.py install """ from distutils.core import setup from distutils.command.install import INSTALL_SCHEMES # Make sure that data files are actually installed in the package directory for install_scheme in INSTALL_SCHEMES.values(): install_scheme['data...
{ "content_hash": "e512e8178f6021c7dd2fb1f0e4d51dba", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 75, "avg_line_length": 27.121951219512194, "alnum_prop": 0.7571942446043165, "repo_name": "loicbaron/nutrition", "id": "d83022b8da2a735d0bd877bcb772bff9bec3767d", "size": "...