text
stringlengths
4
1.02M
meta
dict
def test_cert_get_cn(client): from .vectors import INTERNAL_VALID_LONG_CERT from lemur.common.defaults import common_name assert common_name(INTERNAL_VALID_LONG_CERT) == 'long.lived.com' def test_cert_sub_alt_domains(client): from .vectors import INTERNAL_VALID_SAN_CERT, INTERNAL_VALID_LONG_CERT ...
{ "content_hash": "39bd52037dba5ba9303eec8bec743a54", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 105, "avg_line_length": 35.35443037974684, "alnum_prop": 0.6813462226996062, "repo_name": "kevgliss/lemur", "id": "a72689cc90a31962ef3c95e862f933322d328d22", "size": "2800"...
from neon import NervanaObject class Cost(NervanaObject): """ Base class for the cost functions """ def __call__(self, y, t): """ Applies the cost function Args: y (Tensor or OpTree): Output of previous layer or model t (Tensor or OpTree): True targets ...
{ "content_hash": "9532b46341e56b8e75c2b869e62c5ea5", "timestamp": "", "source": "github", "line_count": 232, "max_line_length": 96, "avg_line_length": 29.70689655172414, "alnum_prop": 0.5622460824143934, "repo_name": "sunclx/neon", "id": "7b4905c85a86af4fa1935d6498a0d3513a9e9534", "size": "7633", ...
import unittest from app.common.http_methods_unittests import get_request from app.common.string_methods import string_contains, get_values_from_regex from app.common.target_parse_strings import PLANE_PANEL_AVAILABLE_HTML, ALLIANCE_CONCORDE_PATTERN_HTML from app.common.target_urls import ALLIANCE_PAGE, ALLIANCE_PLANE_...
{ "content_hash": "c91715042feb8c1fd42f37ebaaa6ee96", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 102, "avg_line_length": 32.46666666666667, "alnum_prop": 0.7097878165639973, "repo_name": "egenerat/gae-django", "id": "8f6d8554ad52f8c854a950b706bc3fddc40a3dfa", "size": "...
""" router implementation base class a template for router implementation that support VRRP Those routers needs to be created by someone else. sample_manager.routerManager is an example. Usage example: PYTHONPATH=. ./bin/ryu-manager --verbose \ ryu.services.protocols.vrrp.manager \ ryu.service...
{ "content_hash": "e265ac7d32e48d52d6c2ee159ee8863b", "timestamp": "", "source": "github", "line_count": 523, "max_line_length": 79, "avg_line_length": 38.08221797323136, "alnum_prop": 0.5880403675252297, "repo_name": "torufuru/OFPatchPanel", "id": "ca834d29eabef1e46621c0404928544d21308585", "size":...
import sys import pytest import astroid from pylint.checkers import strings from pylint.testutils import CheckerTestCase class TestStringChecker(CheckerTestCase): CHECKER_CLASS = strings.StringFormatChecker @pytest.mark.skipif(sys.version_info <= (3, 0), reason="" "Tests that the s...
{ "content_hash": "f8ef3fce2ae10a111ddc7ed6710534e7", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 67, "avg_line_length": 30, "alnum_prop": 0.6348484848484849, "repo_name": "ClovisIRex/Snake-django", "id": "9cb518828b15ce9defc605853003f9f00adba5e3", "size": "873", "bin...
"""Add a new patient to the xpacsdb.patient_info table Usage: add_patient.py [options] add_patient.py -h Options: -h, --help Show this screen -d, --debug Show some debug information -s <host> The MySQL server host IP address. -p <port> MySQL...
{ "content_hash": "2f2e3aa5f6e304d045d4a15052a73347", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 86, "avg_line_length": 29.48701298701299, "alnum_prop": 0.5463554283197534, "repo_name": "CardiacAtlasProject/CAPServer2.0", "id": "a99a3ece7c9f12ec8a34f174a147734dbb5907ca"...
from feature_format import featureFormat, targetFeatureSplit import pickle from sklearn.naive_bayes import GaussianNB from sklearn.cross_validation import StratifiedShuffleSplit from sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score from sklearn.pipeline import Pipeline from sklearn.feature...
{ "content_hash": "a24100f845e24b23ac5195d51edbcdfb", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 83, "avg_line_length": 34.570093457943926, "alnum_prop": 0.6455798864557989, "repo_name": "rjegankumar/enron_email_fraud_identification", "id": "a8a6242d389ca5b999f731ba8fcc...
import sys, os.path sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src')) import skameyka skameyka.app.run(port=5001, debug=True)
{ "content_hash": "46e7e46b32bc29d3febdd5955ac83d41", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 66, "avg_line_length": 21.285714285714285, "alnum_prop": 0.697986577181208, "repo_name": "baverman/skameyka", "id": "063e358e784f1830e802c72c9208e82e93e7f679", "size": "172"...
import tigre import numpy as np from tigre.utilities import sample_loader import tigre.algorithms as algs #%% Geometry geo = tigre.geometry_default(high_resolution=False) # Offsets ## #################################################################################### # Lets try simnple offset: The detector gets com...
{ "content_hash": "fe2ae2f5642346af4245e7cb1ce54657", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 87, "avg_line_length": 32.78260869565217, "alnum_prop": 0.610079575596817, "repo_name": "CERN/TIGRE", "id": "f61ba7bcef144cb08d79cb8bfc6a99ff3faaadfd", "size": "3177", "b...
import sphinx_rtd_theme html_theme = "sphinx_rtd_theme" html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # # sklearn-dummies documentation build configuration file, created by # sphinx-quickstart on Thu Mar 2 23:06:01 2017. # # This file is execfile()d with the current directory set to its # containing di...
{ "content_hash": "3bc301fd580aae299ae3d9a1bb9ee0e0", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 79, "avg_line_length": 30.59006211180124, "alnum_prop": 0.6797969543147208, "repo_name": "gsmafra/sklearn-dummies", "id": "6f90c52f0bb408369b73b532a3841fa6bc576f0f", "size...
import math import m5 from m5.objects import * from m5.defines import buildEnv from Ruby import create_topology, create_directories from Ruby import send_evicts # # Declare caches used by the protocol # class L1Cache(RubyCache): pass class L2Cache(RubyCache): pass def define_options(parser): parser.add_option("--...
{ "content_hash": "f3058165e405a8884a4f14cb836d1702", "timestamp": "", "source": "github", "line_count": 242, "max_line_length": 82, "avg_line_length": 45.31818181818182, "alnum_prop": 0.6108324974924775, "repo_name": "TUD-OS/gem5-dtu", "id": "94a518b2afffe83f01a3c223f906c40e500dc6e5", "size": "1259...
import document import interface import package import rulegenerator import testgenerator class ArgumentVisitorBase(interface.ArgumentVisitor): def visitReturnValue(self, retValue): self.visitAllocation(retValue) class SingleArgumentVisitor(ArgumentVisitorBase): """ Visitor which handles comp...
{ "content_hash": "30e6012555d31549f582f12b6c4f2c1b", "timestamp": "", "source": "github", "line_count": 1619, "max_line_length": 94, "avg_line_length": 37.883261272390364, "alnum_prop": 0.519149560595438, "repo_name": "sparsebase/stromx", "id": "7e4f86c41abe18bb8ba8c4d66458da599e72ec14", "size": "6...
from django.shortcuts import render from django.core.urlresolvers import reverse from django.views.generic.edit import CreateView from . import models import ipdb class ZeigenUndEintragen(CreateView): """ zeigt die bisher einzige Liste an """ template_name = 'Notizen/liste.html' model = models.Zeile f...
{ "content_hash": "fdda3554210e6dd56fc196a9cdd9643e", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 76, "avg_line_length": 38.83783783783784, "alnum_prop": 0.6610995128740431, "repo_name": "wmles/olymp", "id": "515a01581f2bb6423649cb6dc5a2fdeec8490159", "size": "1447", ...
import logging import os import UserDict import yaml CONTOUR_YAML_NAMES = ['contour.yaml', 'contour.yml'] # TODO: Handle other configuration formats. # TODO: Handle persitent storage of configuration. class MissingConfigurationError(Exception): """Missing configuration option.""" class BadModulePathError(Exc...
{ "content_hash": "71c8f0a8e8d8aa016b3110f6954d4cf3", "timestamp": "", "source": "github", "line_count": 234, "max_line_length": 78, "avg_line_length": 27.316239316239315, "alnum_prop": 0.6290675844806007, "repo_name": "lyddonb/contour", "id": "91a8b80d88450a25078d3e25040faf30996ac9fb", "size": "639...
"""Functions for interpolating `GridVariables`s.""" from typing import Callable, Optional, Tuple, Union import jax import jax.numpy as jnp from jax_cfd.base import boundaries from jax_cfd.base import grids import numpy as np Array = Union[np.ndarray, jnp.DeviceArray] GridArray = grids.GridArray GridArrayVector = gri...
{ "content_hash": "f075e06f6b515b57ede0217299890516", "timestamp": "", "source": "github", "line_count": 345, "max_line_length": 83, "avg_line_length": 38.46376811594203, "alnum_prop": 0.6577995478522984, "repo_name": "google/jax-cfd", "id": "c531c5d71d48a49fab133e63abcc17c8f1c275f0", "size": "13846...
import unittest import requests import lxml.html import xmlrunner class TestHtmlTask(unittest.TestCase): def setUp(self): self.urls = open("urls.txt", 'r') self.url_google = self.urls.readline() self.url_habr = self.urls.readline() self.urls.close() def test_1(self): e...
{ "content_hash": "b3272b3d20f3c267c87b3bedd564683f", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 76, "avg_line_length": 29.37037037037037, "alnum_prop": 0.6355611601513241, "repo_name": "amazpyel/sqa_training", "id": "8c320fe4ccd5f0ace040d9448ed02fec43d4a85d", "size": ...
import rospy from vortex_msgs.msg import PropulsionCommand, Manipulator from sensor_msgs.msg import Joy class JoystickInterfaceNode(object): def __init__(self): rospy.init_node('joystick_node') self.sub = rospy.Subscriber( 'joy_throttle', Joy, self.callback, queue_size=1) self...
{ "content_hash": "8d0565d2b62f493bc1d6982e2710b3de", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 74, "avg_line_length": 35.64, "alnum_prop": 0.5054246165357277, "repo_name": "vortexntnu/rov-control", "id": "a430af4ffdda32cc395f06e45834ec1d5d475244", "size": "2695", "...
from decimal import Decimal from pathlib import Path from typing import TYPE_CHECKING, Any, Callable, Set, Tuple, Type, Union from .typing import display_as_type if TYPE_CHECKING: from .typing import DictStrAny # explicitly state exports to avoid "from .errors import *" also importing Decimal, Path etc. __all__ ...
{ "content_hash": "2a862bb6e02ebe81c538ac68e97bc015", "timestamp": "", "source": "github", "line_count": 583, "max_line_length": 120, "avg_line_length": 26.818181818181817, "alnum_prop": 0.6959385992964503, "repo_name": "glenngillen/dotfiles", "id": "db2df4f4bd6547d4f89bce97a52779983fd6f20c", "size"...
"""A module containing useful helper functions for unit tests.""" import string import random from pytodoist import todoist def generate_id(size=10): """Return a random alphanumeric string.""" chars = string.ascii_uppercase + string.digits return ''.join(random.choice(chars) for _ in range(size)) class...
{ "content_hash": "e6ac8b82c3b0ddd45fb49c867e4b7745", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 74, "avg_line_length": 30.181818181818183, "alnum_prop": 0.6556224899598394, "repo_name": "Garee/pytodoist", "id": "7a7259c33a089ba98d444f0ef40205dcc58db2db", "size": "996"...
import json from findig import App from werkzeug.serving import run_simple # A simple Findig example app # # Findig applications are collections of managed web resources. Apps are # described by declaring resources and the actions that they support # (get, save and delete). # # This example shows how a very simple ...
{ "content_hash": "66d87e949bdc3b856586cdb03d4c7faa", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 76, "avg_line_length": 23.25531914893617, "alnum_prop": 0.6953339432753889, "repo_name": "geniphi/findig", "id": "b1ebd89e5283b14460b477071743e665e37c443e", "size": "1117",...
from django.conf.urls import patterns, include, url from django.contrib.staticfiles.urls import staticfiles_urlpatterns import contacts.views # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'addr...
{ "content_hash": "4dba08c2368de15877fd2351424591ee", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 146, "avg_line_length": 41.416666666666664, "alnum_prop": 0.6847753185781355, "repo_name": "pyjosh/django_addressbook", "id": "7f0c56486a91afd537e50da631f75425608ad65b", "s...
""" The MIT License Copyright (c) 2010 Olle Johansson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, pub...
{ "content_hash": "2c688a481f6f661f02c38ee24771aa94", "timestamp": "", "source": "github", "line_count": 486, "max_line_length": 142, "avg_line_length": 31.497942386831276, "alnum_prop": 0.5535667624771361, "repo_name": "ollej/Twippy", "id": "89219be2f85dbdf84e97c332ef53be9634e5907f", "size": "15354...
""" ======================================================================================= This module implements a Description Horn Logic implementation as defined by Grosof, B. et.al. ("Description Logic Programs: Combining Logic Programs with Description Logic" [1]) in section 4.4. As such, it implements recursive...
{ "content_hash": "22f9e5c7d5c09d8475ce8b0d4b9e3e75", "timestamp": "", "source": "github", "line_count": 926, "max_line_length": 140, "avg_line_length": 43.6231101511879, "alnum_prop": 0.5919792053471964, "repo_name": "mpetyx/pyrif", "id": "414abe3e920d21da8161417079c3f9e9bb5a5a66", "size": "40443",...
from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('signprot', '0009_remove_signprotstructure_extra_proteins'), ] operations = [ migrations.AlterField( model_name='signprotstructureextraproteins',...
{ "content_hash": "1ff7ec78884a844549ffdabca69f3d2a", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 156, "avg_line_length": 30.88235294117647, "alnum_prop": 0.6742857142857143, "repo_name": "protwis/protwis", "id": "599fba9d8a0323912eab17ff9863e6294712fd16", "size": "574"...
import subprocess import sys try: import importlib.resources as importlib_resources except ImportError: import importlib_resources # type: ignore import pytest @pytest.mark.slow def test_issue519(): """ Test ability of Thinc mypy plugin to handle variadic arguments. This test can take up to 4...
{ "content_hash": "13874fd5d541a8c4eb0ba1df213c03fc", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 82, "avg_line_length": 28.17241379310345, "alnum_prop": 0.6940024479804161, "repo_name": "explosion/thinc", "id": "02601f0d7860475f221e68da486f7d110aad108d", "size": "817",...
from __future__ import absolute_import import pytest from sbdc.datasets import bbc_load def test_bbc_default(): data_all_classes = bbc_load() assert data_all_classes is not None assert data_all_classes.shape[0] == 2225 assert data_all_classes.shape[1] == 3 def test_bbc_custom_classes(): data_po...
{ "content_hash": "8d4260d49c081c59734d9708ba06861b", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 54, "avg_line_length": 25.46153846153846, "alnum_prop": 0.6722054380664653, "repo_name": "gakhov/sbdc", "id": "4067be4af8d8255169a9c70078de8c6d19451d08", "size": "686", "...
''' Following algorithm refers to the obsolete part: Input: Hand Mask nonzero xy_points Use laplacian of binary mask 0.Find entry segment 1.Calculate segment middle point 2.Transform nonzero points across the right semiplane* to new_polar coordinates , with reference center the point found and reference angle the one ...
{ "content_hash": "b668e90cca8ac663e8f43f3f0e258ebf", "timestamp": "", "source": "github", "line_count": 1748, "max_line_length": 127, "avg_line_length": 45.401029748283754, "alnum_prop": 0.5311046987815173, "repo_name": "VasLem/KinectPainting", "id": "0492849d2c70e3fa31939323c73366d75d6920bc", "siz...
import multiprocessing import os import os.path import sys import unittest import unittest.mock ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, ROOT_DIR) import autoninja class AutoninjaTest(unittest.TestCase): def test_autoninja(self): autoninja.main([]) def test_...
{ "content_hash": "602eb0ac318133598773b13622a7e894", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 78, "avg_line_length": 27.257142857142856, "alnum_prop": 0.6540880503144654, "repo_name": "CoherentLabs/depot_tools", "id": "55e6b5b17811a90d4b37e4099e849f210a43e98a", "siz...
from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation from keras.layers.recurrent import LSTM from nyse import * from nn import * from keras.optimizers import SGD # import theano # theano.compile.mode.Mode(linker='py', optimizer='fast_compile') class RNN: def __init__(self, ...
{ "content_hash": "3f4e2e27b77fab34e3fc297562753925", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 72, "avg_line_length": 31.016666666666666, "alnum_prop": 0.6260075228371843, "repo_name": "dzitkowskik/StockPredictionRNN", "id": "d07c611b87616a45cb160623f12c7ca087201671", ...
import datetime from django.db import connection from django.db.models.query import QuerySet, Q from django.utils.timezone import now as timezone_now from sqlalchemy.sql import ( column, literal, func, ) from zerver.lib.request import REQ from zerver.models import ( Message, Recipient, UserMe...
{ "content_hash": "0a856d3d1a8f5c77a6c61d595c10d32e", "timestamp": "", "source": "github", "line_count": 227, "max_line_length": 93, "avg_line_length": 32.93392070484582, "alnum_prop": 0.6264044943820225, "repo_name": "tommyip/zulip", "id": "3cc05fb5f00c39b01ea6f636cb2e3a8c293f4297", "size": "7476",...
__author__ = 'mwalker' from django.conf.urls import * urlpatterns = patterns('clinics.views', url(r'^(?P<filter_term>[a-zA-Z]+)/$', 'filter_clinics', name='filter_clinics'), url(r'^redirect/(?P<clinic_id>\d+)/$', 'redirect', name='redirect'), url(r'^$', 'index', name='injury_clinics'), )
{ "content_hash": "de32cb76e29f8c5354b992a2c7b41d64", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 83, "avg_line_length": 30.4, "alnum_prop": 0.6085526315789473, "repo_name": "marksweb/django-cms-app-examples", "id": "e485e5289c669fabc959958c53c09dd9aa960e76", "size": "3...
import csv from django.conf.urls import url from django.contrib import admin from django.urls import reverse from django.http import HttpResponseRedirect from huxley.core.models import PositionPaper class PositionPaperAdmin(admin.ModelAdmin): search_fields = ( 'assignment__committee__name', 'as...
{ "content_hash": "4be477a346712cb9798f8e968e5863b4", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 57, "avg_line_length": 22.842105263157894, "alnum_prop": 0.7327188940092166, "repo_name": "bmun/huxley", "id": "6f386205222c0fbee0abf2ec7f2985ce0bdba27d", "size": "583", ...
import ctypes import os import struct import sys # Each edit operation is assigned different cost, such as: # 'w' means swap operation, the cost is 0; # 's' means substitution operation, the cost is 2; # 'a' means insertion operation, the cost is 1; # 'd' means deletion operation, the cost is 3; # The smaller cost...
{ "content_hash": "dd6253d138ca3ec1e8ec2893b701364a", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 82, "avg_line_length": 29.845070422535212, "alnum_prop": 0.5809344030202926, "repo_name": "openstack/cliff", "id": "50f3ab61218c7a3459fc596ffd4ee8bbfd638ea0", "size": "478...
from __future__ import print_function, division, absolute_import, unicode_literals import os import glyphsLib from fontTools.designspaceLib import DesignSpaceDocument from glyphsLib.builder.instances import apply_instance_data import defcon import pytest import py.path from ..test_helpers import write_designspace_and_...
{ "content_hash": "f8a83d5a2b7a0b983429ff1ee8e5f6c0", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 87, "avg_line_length": 34.82022471910113, "alnum_prop": 0.7011939335269441, "repo_name": "googlei18n/glyphsLib", "id": "764e2c5d4300dd9ed6ac02b371f2665f2b04dc13", "size": "...
from flask import json from util import * from flask import Flask from flask import jsonify from flask import json app = Flask(__name__) @app.route("/") def hello(): return "Hello World!" @app.route("/buoys") def getAllBuoys(): return returnJson(["buoy1", "buoy2"]) @app.route("/buoys/<int:buoy...
{ "content_hash": "d005ec8178ae0da2cddc6244cea6fd58", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 42, "avg_line_length": 21.238095238095237, "alnum_prop": 0.6300448430493274, "repo_name": "Ilink/waveform", "id": "c82cd59061c24aa9fa6c19c9753e0d9701c5eaff", "size": "446",...
"""py2/py3 metaclass utility, from jinja2 via Bokeh.""" def with_metaclass(meta, *bases): """Add metaclasses in both Python 2 and Python 3. Function from jinja2/_compat.py. License: BSD. Use it like this:: class BaseForm(object): pass class FormType(type): pass ...
{ "content_hash": "6355793fd4f9400aa0afa4e7bc3d3c50", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 89, "avg_line_length": 32.48780487804878, "alnum_prop": 0.6313813813813813, "repo_name": "conda/kapsel", "id": "8e829ff8f3c237a2cc36120239c3b1733e46b208", "size": "1663", ...
""" This module contains a quadratic equation solver, but uses an optional parameter so multiple root functions do not need to be defined. """ import numpy as np a = 2.1 b = 5.4 c = 1.2 # The following shows how to define optional parameters. # The last input has a default value of True. # If a user calls the functi...
{ "content_hash": "22a5f4707b5bf9d2d6843e7633badca2", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 103, "avg_line_length": 30.733333333333334, "alnum_prop": 0.6568329718004339, "repo_name": "solter/pyTutorial", "id": "0671ad983342925d8717b2fe249fedb29ae296ea", "size": "2...
import _plotly_utils.basevalidators class ColumnValidator(_plotly_utils.basevalidators.IntegerValidator): def __init__(self, plotly_name="column", parent_name="indicator.domain", **kwargs): super(ColumnValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
{ "content_hash": "cd2216ac4706acadb8b6676ceb55b46f", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 87, "avg_line_length": 36.833333333333336, "alnum_prop": 0.6085972850678733, "repo_name": "plotly/plotly.py", "id": "1112db9257a1f6e38a51ef288813fc71a61ebe0c", "size": "442...
"""Event parser and human readable log generator.""" from __future__ import annotations from collections.abc import Callable from typing import Any import voluptuous as vol from homeassistant.components import frontend from homeassistant.components.recorder.const import DOMAIN as RECORDER_DOMAIN from homeassistant.c...
{ "content_hash": "c753948d7c650fc6cafd54923cb2a9e1", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 87, "avg_line_length": 31.89937106918239, "alnum_prop": 0.6910488958990536, "repo_name": "toddeye/home-assistant", "id": "1abfcaba6ff37761f0dd876059f5dca0ef251b5d", "size"...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Top10', fields=[ ('id', models.AutoField(auto_creat...
{ "content_hash": "ee515b0622466a7b388b8a3a0d76aefa", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 114, "avg_line_length": 26.08695652173913, "alnum_prop": 0.56, "repo_name": "okwow123/freebaram", "id": "659fa3747d5b69ded3d9592024d2952c992452c6", "size": "672", "binary...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'certified'} DOCUMENTATION = ''' module: na_ontap_broadcast_domain short_description: NetApp ONTAP manage...
{ "content_hash": "32570dae3366c33de7c6e37fd6c3ecbe", "timestamp": "", "source": "github", "line_count": 431, "max_line_length": 128, "avg_line_length": 42.76798143851508, "alnum_prop": 0.6002278522215592, "repo_name": "SergeyCherepanov/ansible", "id": "314402074a1b07aca64264671b69b857bc8dbc59", "si...
""" ====================================================== Smoothing of timeSeries data using convolution filters ====================================================== How to smooth a TimeSeries using a convolution filter kernel from `~astropy.convolution` and `~astropy.convolution.convolve` function. """ import matp...
{ "content_hash": "c72884b404fc2596fb814ed2dcd33698", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 79, "avg_line_length": 42.08108108108108, "alnum_prop": 0.6017983301220295, "repo_name": "dpshelio/sunpy", "id": "ccf63c33330cf570fef84f9e51cc971ca3d065e2", "size": "1563",...
from scraper import FacebookScraper
{ "content_hash": "1ccf2bb1ddb2d4cb844796a8fb045ebe", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 35, "avg_line_length": 36, "alnum_prop": 0.8888888888888888, "repo_name": "nprapps/graeae", "id": "d5b58f2b1d8ad6443842e186cb6f795f75997fd3", "size": "36", "binary": false...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('plea', '0015_datavalidation'), ] operations = [ migrations.AlterField( model_name='datavalidation', name='date_entered', ...
{ "content_hash": "89d9f36ddbddcb77b2230aac19f50d99", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 58, "avg_line_length": 21.833333333333332, "alnum_prop": 0.6055979643765903, "repo_name": "ministryofjustice/manchester_traffic_offences_pleas", "id": "6d19ac10e326ab949a28d4...
import smtplib from email.mime.text import MIMEText from collections import OrderedDict import simplejson from datetime import date, timedelta #def emailResults(folder, filename): def email_send( msg_content ): yesterday = date.today() - timedelta(1) # print yesterday.strftime('%d-%m-%y') # print yesterda...
{ "content_hash": "e5ae68acd11a19aecf26cdb43e93482d", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 58, "avg_line_length": 24.766233766233768, "alnum_prop": 0.56790770844258, "repo_name": "hnikolov/mqtt_meter_logger", "id": "0bfd0643a194a589dc1cd78153274f6ce97458c3", "siz...
''' Created on 14/8/2014 @author: victor ''' import unittest from hivprotmut.external.blast.blastOutputParser import BlastOutputParser import hivprotmut.external.blast.test.data as test_data import os class Test(unittest.TestCase): def test_parse(self): """ Tests if it can read the xml align...
{ "content_hash": "b530d957a801ddad7c9ef0b846ff97af", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 148, "avg_line_length": 43.098591549295776, "alnum_prop": 0.5666666666666667, "repo_name": "victor-gil-sepulveda/PhD-HIVProteaseMutation", "id": "9342ede187006ec7b22df6178a19...
import sys import math class Graph: def __init__(self, **kwargs): """Creates a Graph. Kwargs: graph (dictionary) : an already existing dictionary of vertex and edges. is_directed (bool) : is the graph directed (true) or not (false). Returns: An undirec...
{ "content_hash": "782411f8a1e631ec10f0cf8bee1ec0b4", "timestamp": "", "source": "github", "line_count": 251, "max_line_length": 109, "avg_line_length": 30.350597609561753, "alnum_prop": 0.5707534786033079, "repo_name": "informaticienzero/CodinGame", "id": "d1f5691f4b8b29d48bf2027cd64a2629924aae3a", ...
"""SCons.Tool.hpc++ Tool-specific initialization for c++ on HP/UX. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation ...
{ "content_hash": "09888ed9ece53c600a5f3c6522478e8d", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 89, "avg_line_length": 31.95294117647059, "alnum_prop": 0.680780559646539, "repo_name": "cournape/numscons", "id": "a23bfe3fd581e2ec7590a1e8245e29ce47b1e718", "size": "2716...
import random from maze_builder.mazes.maze import Route class FeatureFactory(object): def _count(self, castle): return int(castle.x*castle.y*self.density) class Courtyards(FeatureFactory): def __init__(self, density, widthfun=lambda: random.randint(2, 5), lengthfun=None): self.density = dens...
{ "content_hash": "d5611c927de1652e954321794c9f9481", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 111, "avg_line_length": 34.775, "alnum_prop": 0.5669781931464174, "repo_name": "kcsaff/maze-builder", "id": "8c6201263ae84418323334a1694d6306446b6105", "size": "4173", "...
import numpy as np class Register: def __init__(self, size): if size > 20: raise Exception("Register size too large to simulate") self.size = size self.qubits = [ 0+0j for x in range(2**size) ] self.qubits[0] = 1+0j def __str__(self): return str( [ str(x)+...
{ "content_hash": "263f6b468320627a1adc4faa88c76e08", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 92, "avg_line_length": 29.180851063829788, "alnum_prop": 0.4939846882974845, "repo_name": "byronwasti/Quantum-Computer-Simulation", "id": "a1ee0add94cee184d9c9fd7e234c044bb12...
import os import conda.lock # Propose as an enhancement to conda. This would be in order to be more specific with conda's lock files. class Locked(conda.lock.Locked): def __init__(self, directory_to_lock): """ Lock the given directory for use, unlike conda.lock.Lock which locks the direct...
{ "content_hash": "5571489787cab6cf2cec5396c165b5de", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 105, "avg_line_length": 36.63157894736842, "alnum_prop": 0.6551724137931034, "repo_name": "SciTools/conda-gitenv", "id": "9ad5b7830348b284a232e12f25f808078927fb2c", "size":...
from django.apps import AppConfig class DocenteConfig(AppConfig): name = 'docente'
{ "content_hash": "1c516905edb02199306550143b031094", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 33, "avg_line_length": 17.8, "alnum_prop": 0.7528089887640449, "repo_name": "Bleno/sisgestor-django", "id": "714250e8a1609253e52016305407214702797946", "size": "89", "bina...
from __future__ import unicode_literals from django.db import models from django.utils.translation import ugettext_lazy as _ class Sura(models.Model): """ Model to hold the Quran Chapters "Sura" """ index = models.PositiveIntegerField(primary_key=True) name = models.CharField(max_length=20, uniqu...
{ "content_hash": "cf5a897bddbfab6132cab71b9fcfe4e1", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 81, "avg_line_length": 29.36842105263158, "alnum_prop": 0.6123058542413381, "repo_name": "EmadMokhtar/tafseer_api", "id": "efd95655de3f3d163201eaa8a138d5e3b0a82bd1", "size"...
""" WSGI config for learn_models 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 os.environ.setdefault("DJANGO_...
{ "content_hash": "eb2a21f5f2d3d0dde958bfcdcf478d21", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 78, "avg_line_length": 25.0625, "alnum_prop": 0.770573566084788, "repo_name": "lichengshuang/createvhost", "id": "e81acecd3b350d49f2782eeeba558a980e23a5fd", "size": "401", ...
from __future__ import unicode_literals from django.http import QueryDict from cms.api import add_plugin from cms.utils.plugins import build_plugin_tree from cmsplugin_cascade.models import CascadeElement from cmsplugin_cascade.bootstrap3.container import (BootstrapContainerPlugin, BootstrapRowPlugin, Bootstr...
{ "content_hash": "1290416733f4efa86d86038c4a071212", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 150, "avg_line_length": 53.189473684210526, "alnum_prop": 0.6837522264001583, "repo_name": "rfleschenberg/djangocms-cascade", "id": "8e553b1a4f42e14ade527ccbbee112329ddb898b"...
import _plotly_utils.basevalidators class UirevisionValidator(_plotly_utils.basevalidators.AnyValidator): def __init__(self, plotly_name="uirevision", parent_name="scatterpolar", **kwargs): super(UirevisionValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name,...
{ "content_hash": "e76317dc38a50ea4b23865da68994304", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 87, "avg_line_length": 37.09090909090909, "alnum_prop": 0.6323529411764706, "repo_name": "plotly/plotly.py", "id": "b73384f3e2da01ebec64f728c3d0ab4c76272f86", "size": "408"...
import datetime import json import logging import logging.config import os import traceback from os.path import join as pjoin import unittest2 as unittest from curwmysqladapter import MySQLAdapter from observation.obs_raw_data.ObsRawData import \ get_dialog_timeseries, \ get_wu_timeseries, \ create_raw_ti...
{ "content_hash": "178a5c540f25e47688c902e55df2a747", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 124, "avg_line_length": 47.21739130434783, "alnum_prop": 0.6611418047882136, "repo_name": "gihankarunarathne/cfcwm-cms", "id": "0004dbd2799cb3ba62479c771d7ffbabd047ecbc", ...
""" This module contains the logic for collecting server group information from a cloud and deploying server groups on a cloud. Example: src_handler = ServerGroupsHandler(src_cloud) dst_handler = ServerGroupsHandler(dst_cloud) dst_handler.deploy_server_groups(src_handler.get_server_groups()) """ import c...
{ "content_hash": "41725f74310051d708ccfb90cac24f9b", "timestamp": "", "source": "github", "line_count": 252, "max_line_length": 79, "avg_line_length": 36.81349206349206, "alnum_prop": 0.5623585210736229, "repo_name": "mgrygoriev/CloudFerry", "id": "34ab67787233cee60b608751da62469dfefb2e5d", "size":...
import numpy as np __all__ = ['gp_predict', 'gp_covariance'] def gp_kernel(x, y, kernel_type='gaussian', **kwargs): """ Gaussian process kernel score """ if kernel_type == 'gaussian': beta = kwargs.get('beta', 0.3) return np.exp(-((x[0] - y[0]) ** 2 + (x[1] - y[1...
{ "content_hash": "1ba6d91eaeaec1ace0f49f2c4def9304", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 79, "avg_line_length": 30.48148148148148, "alnum_prop": 0.5710814094775213, "repo_name": "makokal/scalable-irl", "id": "a0584b17005953e45389eaa36580d20eb996bd66", "size": "...
""" GrantedByMe Cryptographic helper .. moduleauthor:: GrantedByMe <[email protected]> """ # -*- coding: utf-8 -*- import base64 import json import os import random import string import hashlib import time from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import serializatio...
{ "content_hash": "5857f646a8100f2b155ea99f1e0ea845", "timestamp": "", "source": "github", "line_count": 431, "max_line_length": 139, "avg_line_length": 40.67981438515081, "alnum_prop": 0.5957907945017966, "repo_name": "grantedbyme/grantedbyme-python-sdk", "id": "b9853f099f736a830fa6495442ebc985acdfb1...
__all__ = ['CBaseLoader', 'CSafeLoader', 'CLoader', 'CBaseDumper', 'CSafeDumper', 'CDumper'] from _yaml import CParser, CEmitter from constructor import * from serializer import * from representer import * from resolver import * class CBaseLoader(CParser, BaseConstructor, BaseResolver): ...
{ "content_hash": "ca8cccb14c8f198a1cbd72b3855f551e", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 73, "avg_line_length": 39.705882352941174, "alnum_prop": 0.6103703703703703, "repo_name": "croxis/SpaceDrive", "id": "e726baf13ec847a22be651cc53e8721f1be33b0b", "size": "33...
""" @file async_tcp_client.py @author Woong Gyu La a.k.a Chris. <[email protected]> <http://github.com/juhgiyo/pyserver> @date March 10, 2016 @brief AsyncTcpClient Interface @version 0.1 @section LICENSE The MIT License (MIT) Copyright (c) 2016 Woong Gyu La <[email protected]> Permission is hereby granted, ...
{ "content_hash": "5b833f3b97706210a9768728d3d10aa0", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 119, "avg_line_length": 36.861111111111114, "alnum_prop": 0.60120572720422, "repo_name": "juhgiyo/pyserver", "id": "ca5e1b2cda1152c5013e4295be1ea1c9e917502b", "size": "665...
from pants.goal.task_registrar import TaskRegistrar as task from squarepants.plugins.thrift_linter.tasks.thrift_linter import ThriftLinterDummy def register_goals(): task(name='thrift-linter', action=ThriftLinterDummy).install().with_description('Standin for thrift-linter options')
{ "content_hash": "9f680cea2eb8d74ee4a1604c693124fc", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 118, "avg_line_length": 47.833333333333336, "alnum_prop": 0.818815331010453, "repo_name": "ericzundel/mvn2pants", "id": "5929ac28edf396e2604416c77268c74b74c8d54f", "size": "...
import os, sys, subprocess, difflib from scripts.support import run_command, split_wast print '[ processing and updating testcases... ]\n' for asm in sorted(os.listdir('test')): if asm.endswith('.asm.js'): for precise in [1, 0]: for opts in [1, 0]: cmd = [os.path.join('bin', 'asm2wasm'), os.path....
{ "content_hash": "d3b1f60d140ac9daa353f32fc2561b0b", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 154, "avg_line_length": 42.707317073170735, "alnum_prop": 0.5962307252998287, "repo_name": "ddcc/binaryen", "id": "1ecbb7a40d949aa374db7fe35c73846ede49f14d", "size": "7027...
from flask import render_template from flask.views import MethodView from .exceptions import ImproperlyConfigured class BaseView(MethodView): """Base class for all other views.""" def __init__(self, **kwargs): """ Construct the view. Assigns the keyword arguments passed to the view ...
{ "content_hash": "f3ca5b3fa111d31d5989593fb8d981a1", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 76, "avg_line_length": 27.07017543859649, "alnum_prop": 0.61049902786779, "repo_name": "kvesteri/flask-generic-views", "id": "bf36817dd421062ca898bb90285b943db1425583", "si...
import abc import inspect import sys from wordinserter.operations import ChildlessOperation, IgnoredOperation, Group, Text from wordinserter.exceptions import InsertError import contextlib from collections.abc import Iterable def renders(*operations): def _wrapper(func): func.renders_operations = operat...
{ "content_hash": "420d43b18a82bdf680d67004fa1933f6", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 116, "avg_line_length": 36.47761194029851, "alnum_prop": 0.5963584288052373, "repo_name": "orf/wordinserter", "id": "95331f5471944919ad6ef923a08f2855353b7d9e", "size": "48...
from LRUCacheTest import LRUCacheTest from TaskMutexTest import TaskMutexTest if __name__ == "__main__": import unittest unittest.main()
{ "content_hash": "a0ff56355cc9dd7725f8903ef3ed5a4c", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 39, "avg_line_length": 23.333333333333332, "alnum_prop": 0.7571428571428571, "repo_name": "appleseedhq/gaffer", "id": "5c3a8c7ec9cee0b06b1895a70730456f2380b221", "size": "19...
from time import ctime from functools import partial from signal import signal, SIGINT from ..fdbus_h import * from ..exceptions.exceptions import * from ..fdobjects.fdobjects import FileDescriptorPool, FileDescriptor, FDBus class Server(FDBus, Thread): def __init__(self, path): super(Server, self).__in...
{ "content_hash": "8506dece0e27ad2b14e5b928854599e7", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 76, "avg_line_length": 32.26219512195122, "alnum_prop": 0.5671895671895671, "repo_name": "tijko/fdbus", "id": "825ca05a609be702a58641885b5910d81b2d46ae", "size": "5338", ...
from __future__ import print_function import getpass import inspect import os import sys import textwrap from oslo.utils import encodeutils from oslo.utils import strutils import prettytable import six from six import moves from cloudkittyclient.openstack.common._i18n import _ class MissingArgs(Exception): """...
{ "content_hash": "cde7cccc05f53273304822d23bba2f42", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 79, "avg_line_length": 28.59288537549407, "alnum_prop": 0.5948299695880565, "repo_name": "FNST-OpenStack/python-cloudkittyclient", "id": "368025ee9c6f1a746c25ef1c88672b9a738...
from django.conf.urls import url from . import views app_name = 'feedback' urlpatterns = [ # /profile/contact:url to take the feedback form url(r'^$', views.feedback_process, name='feedback_process'), ]
{ "content_hash": "3bcb4b18e20475b299c2ea6ef78c8fde", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 64, "avg_line_length": 21.4, "alnum_prop": 0.6962616822429907, "repo_name": "Nikita1710/ANUFifty50-Online-Mentoring-Platform", "id": "bee2c8e23923a2933dbdf02dbbcb52f58b8256b6...
import nose import traces from scipy import stats import numpy def test_quantiles(): data = [15, 15, 20, 20, 20, 35, 35, 40, 40, 50, 50] histogram = traces.Histogram(data) alpha = 0.5 q_list = [0.05, 0.25, 0.5, 0.75, 0.95] q_values = histogram.quantiles(q_list, alpha=alpha, smallest_count=1) ...
{ "content_hash": "61e6b66e2736d5db75b765ce9ad624ce", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 77, "avg_line_length": 27.6123595505618, "alnum_prop": 0.5916581892166837, "repo_name": "datascopeanalytics/traces", "id": "e72a2e9fb26f23bd0fbcf48b147d813df4782b94", "siz...
import fnmatch import os from os.path import dirname, exists, join from setuptools import find_packages, setup, Extension from setuptools.command.build_ext import build_ext import subprocess import sys import setuptools # # pybind-specific compilation stuff # class get_pybind_include(object): """Helper class to d...
{ "content_hash": "2f78b8ce54098cbfa984a895eae39903", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 76, "avg_line_length": 28.833333333333332, "alnum_prop": 0.6040462427745664, "repo_name": "DTChuck/HSImage", "id": "e7f462d30a991fb73f4ce696b48a9aa3b37bf262", "size": "319...
from __future__ import unicode_literals import logging from .config import * from .wrappers import * logger = logging.getLogger(__name__) class Transactions(ListWrapper): def wrap(self, resource): return Transaction(resource, self.client) class Transaction(Wrapper): @property def attributes...
{ "content_hash": "8b96ce22ace343639e44492544fc7919", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 66, "avg_line_length": 22.294117647058822, "alnum_prop": 0.5875109938434476, "repo_name": "GemHQ/round-py", "id": "360f4bf32cc1d9b0feebeb4cb461d8fa7e451daa", "size": "1227"...
from ._node import Node class ConflictNode(Node): pass
{ "content_hash": "a7e796fc8cae9909473c069fb5b625db", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 25, "avg_line_length": 12.2, "alnum_prop": 0.7049180327868853, "repo_name": "artPlusPlus/dijon", "id": "577b5e1be2a144abac8c816455de6c5b2bb12905", "size": "61", "binary": ...
"""Averaging of model weights.""" # pylint: disable=missing-docstring # pylint: disable=g-complex-comprehension from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow.compat.v1 as tf class Averaged(object): def __init__(self, tensors): ...
{ "content_hash": "9765cc9e91be82cfa096094bae27208a", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 78, "avg_line_length": 32.193548387096776, "alnum_prop": 0.6352705410821643, "repo_name": "deepmind/lamb", "id": "28c0e4db39c1dc7c34bab0a867443ddc9294a581", "size": "3689",...
from chatterbot.adapters.storage import StorageAdapter from chatterbot.conversation import Statement import random import twitter class TwitterAdapter(StorageAdapter): """ The TwitterAdapter allows ChatterBot to read tweets from twitter. """ def __init__(self, **kwargs): super(TwitterAdapter,...
{ "content_hash": "ff483b2f5263d1a37b8c8ec599a0ea59", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 73, "avg_line_length": 31.0873786407767, "alnum_prop": 0.6005621486570893, "repo_name": "imminent-tuba/thesis", "id": "5cd68ab6a29aa59f73416905857be2c0afc48774", "size": "...
from __future__ import absolute_import from google.cloud.vision_helpers.decorators import add_single_feature_methods from google.cloud.vision_helpers import VisionHelpers import sys import warnings from google.cloud.vision_v1p2beta1 import types from google.cloud.vision_v1p2beta1.gapic import enums from google.cloud....
{ "content_hash": "cfc4b72a4c28a7677ff011e3086c8ab1", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 79, "avg_line_length": 33.607142857142854, "alnum_prop": 0.7492029755579172, "repo_name": "tswast/google-cloud-python", "id": "565100ef1ae812ad2b608f825900f2ec2c83d939", "s...
import nnets.core.utils as nut import theano import theano.tensor as T import numpy,timeit import pdb class network(nut.persistent_container): ############################################# def __call__(self,x):return self.predictor(x) ############################################# ''' grow ...
{ "content_hash": "c28f12e3fd94e9e258732adf4f21aa17", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 95, "avg_line_length": 42.67261904761905, "alnum_prop": 0.5611661319570372, "repo_name": "ctogle/nnets", "id": "40af020197c339e77960b557705362762884320b", "size": "7169", ...
import sys,os,optparse,time from socket import gethostname # Check if DISPLAY variable is set try: os.environ["DISPLAY"] import pygtk,gtk except: print("Error: DISPLAY environment variable not set.") sys.exit(1) # Global Configuration File CONF_FILE = "/etc/classification-banner" # Returns Username d...
{ "content_hash": "563903a4acd29612b99f43f589c7483d", "timestamp": "", "source": "github", "line_count": 352, "max_line_length": 136, "avg_line_length": 40.31534090909091, "alnum_prop": 0.5552815164540906, "repo_name": "fcaviggia/hardening-script-el6-kickstart", "id": "a3bfd78e0341d9f353ad64e934420a08...
import vtk def main(): colors = vtk.vtkNamedColors() renderer = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(renderer) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) vol = vtk.vtkStructuredPoints() vol.SetDimensions(26, 26, 26) vol.SetO...
{ "content_hash": "ecf84e371aeb9ee024cdef18fac6cccb", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 64, "avg_line_length": 27.789473684210527, "alnum_prop": 0.6029040404040404, "repo_name": "lorensen/VTKExamples", "id": "001753645257990a17ed7de81d4fa8957ff66e9c", "size": ...
import unittest, shutil, argparse, os import scans class TestCommandHelp(unittest.TestCase): def test_help_parser_for_each_command(self): for cmd_name, parser_fun in scans.__commands__: parser = parser_fun(argparse.ArgumentParser()) helpstring = parser.format_help() class TestScans...
{ "content_hash": "3dc83f49cd14b8c043d1c371dc6484a2", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 65, "avg_line_length": 32.09090909090909, "alnum_prop": 0.6728045325779037, "repo_name": "broadinstitute/cms", "id": "09cb727695d70087a8bd4fe85da6546369eaebc5", "size": "72...
from _tree import Tree from _walk import walk from treebeard._at import set_at from _path import Path def structural_copy(tree): result = Tree() r = Path(result) for path, leaf in walk(tree): set_at(r, path, leaf) return result
{ "content_hash": "23a1443077ab4956498ca6e8d379cee4", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 33, "avg_line_length": 21.166666666666668, "alnum_prop": 0.6653543307086615, "repo_name": "dbew/treebeard", "id": "28476903ee0eb8775e94bc0e4081efdbdc009955", "size": "254",...
"""Generated message classes for dataflow version v1b3. Manages Google Cloud Dataflow projects on Google Cloud Platform. """ # NOTE: This file is autogenerated and should not be edited by hand. from __future__ import absolute_import from apitools.base.protorpclite import messages as _messages from apitools.base.py i...
{ "content_hash": "c7871b2c62baf79170d2dfdccdc631ab", "timestamp": "", "source": "github", "line_count": 5710, "max_line_length": 102, "avg_line_length": 39.65464098073555, "alnum_prop": 0.7327627325242461, "repo_name": "RyanSkraba/beam", "id": "9a76e8d1c8bb5ff64dd3205b2ca4b396c37cd15c", "size": "22...
from typing import Optional from appium.options.common.supports_capabilities import SupportsCapabilities KEYCHAIN_PASSWORD = 'keychainPassword' class KeychainPasswordOption(SupportsCapabilities): @property def keychain_password(self) -> Optional[str]: """ Custom keychain password. ""...
{ "content_hash": "1add367d0486b9a8957912481e059028", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 76, "avg_line_length": 29.318181818181817, "alnum_prop": 0.6914728682170542, "repo_name": "appium/python-client", "id": "5514519f09804ee2588d15581d2c4e3b3568abf2", "size": ...
# :Author: a Pygments author|contributor; Felix Wiemann; Guenter Milde # :Date: $Date: 2012-02-28 21:07:21 -0300 (Tue, 28 Feb 2012) $ # :Copyright: This module has been placed in the public domain. # # This is a merge of `Using Pygments in ReST documents`_ from the pygments_ # documentation, and a `proof of conc...
{ "content_hash": "45ca847c23b932d3eccb475986321b3a", "timestamp": "", "source": "github", "line_count": 364, "max_line_length": 104, "avg_line_length": 39.18681318681319, "alnum_prop": 0.5271312394840157, "repo_name": "ddd332/presto", "id": "7fd5bcab9e96f7a73687a142e091e6ab725de852", "size": "14461...
""" circleci module ~~~~~~~~~~~~~~~ This module provides a wrapper around the CircleCI API. :copyright: (c) 2017-2019 by Lev Lazinskiy :license: MIT, see LICENSE for more details. """
{ "content_hash": "4a57453577a7e0ac5ccd456a88d084bb", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 59, "avg_line_length": 22, "alnum_prop": 0.6363636363636364, "repo_name": "levlaz/circleci.py", "id": "7edf4697df849239592cc9b289b347981cd8f002", "size": "222", "binary": ...
"""Pytest configuration for REANA client.""" from __future__ import absolute_import, print_function import pytest from typing import Dict @pytest.fixture() def create_yaml_workflow_schema() -> str: """Return dummy YAML workflow schema.""" reana_yaml_schema = """ version: 0.7.2 inputs: ...
{ "content_hash": "76336d87284d10b596c8bd5fcebbf7a9", "timestamp": "", "source": "github", "line_count": 228, "max_line_length": 88, "avg_line_length": 28.223684210526315, "alnum_prop": 0.4111888111888112, "repo_name": "reanahub/reana-client", "id": "369beb3d5f9d1e6c3f9ca347418d339bb7577117", "size"...
"""Provides data related to hardware.""" from typing import Final from mimesis.data import ( CPU, CPU_CODENAMES, CPU_MODEL_CODES, GENERATION, GRAPHICS, HDD_SSD, MANUFACTURERS, PHONE_MODELS, RAM_SIZES, RAM_TYPES, RESOLUTIONS, SCREEN_SIZES, ) from mimesis.providers.base im...
{ "content_hash": "148b9b92547aecfc7f2bc1fcc903398a", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 66, "avg_line_length": 20.56050955414013, "alnum_prop": 0.5322180916976456, "repo_name": "lk-geimfari/church", "id": "4b79cde5507a19ae1734aafaf608656d02a15d31", "size": "3...
from __future__ import print_function import copy import errno import gc import logging import os import pprint import socket import sys import traceback import eventlet.backdoor import greenlet from oslo_config import cfg from cloudpulse.openstack.common._i18n import _LI help_for_backdoor_port = ( "Acceptable ...
{ "content_hash": "7f2276794a71214c2e4eab468d69b76f", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 77, "avg_line_length": 30.74074074074074, "alnum_prop": 0.6281927710843374, "repo_name": "anand1712/cloudpulse", "id": "cd4f35776cbd6cc4d4f0c20fd65706fcb97607fe", "size": ...
import zeit.cms.type from zeit.cms.i18n import MessageFactory as _ import lxml.objectify import zeit.cms.connector import zeit.cms.content.adapter import zeit.cms.content.dav import zeit.cms.content.metadata import zeit.cms.interfaces import zeit.content.quiz.container import grokcore.component import zeit.content.quiz...
{ "content_hash": "ee1b4082ce897363c3ec6323742c6c8f", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 77, "avg_line_length": 28.73913043478261, "alnum_prop": 0.6898638426626323, "repo_name": "ZeitOnline/zeit.content.quiz", "id": "3e0d3a5a4c7278a750e2410e797dd5e4422a2a32", "...
import numpy as np import cv2 from collections import deque class Preprocessor: def __init__(self): self.preprocess_stack = deque([], 2) def add(self, aleRGB): self.preprocess_stack.append(aleRGB) ''' Implement the preprocessing step phi, from the Nature paper. It takes the maximum pixel values of two con...
{ "content_hash": "24ad76a6c97edc7d710f0d7e0786c247", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 73, "avg_line_length": 23.4, "alnum_prop": 0.7155067155067155, "repo_name": "dsbrown1331/CoRL2019-DREX", "id": "cffd4e8dc4671fcc2e4a4f75067496a277d1bfac", "size": "819", ...
import matplotlib as mpl mpl.use('Agg') import sys import matplotlib.pyplot as plt import numpy as np Lx = 1. Ly = 1. n = int(sys.argv[1]) nodes, comm_size, init_time, factor_time, solve_time, total_time = \ np.loadtxt("./timings%i.dat"%n, unpack=True) fig1, ax1 = plt.subplots(1, 1) ax1.loglog(comm_size, total_t...
{ "content_hash": "29b74250b9a487194c8266c74984847d", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 70, "avg_line_length": 31.726027397260275, "alnum_prop": 0.7240932642487047, "repo_name": "denera/CSCI6360", "id": "50e319b68b5fd02dd85aab148af38949569e8f9e", "size": "2316...
import unittest import common.utils as utils # TODO - add more tests class TestUtilsMethods(unittest.TestCase): def test_strip_string(self): self.assertEqual(utils.strip_string("^&#*#*#*# foo &#&#&#&#&#").strip(" "), "foo") def test_consolidate_spelling_errors(self): pass def test_...
{ "content_hash": "99a0f02c60eb976c108f14a04d586516", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 94, "avg_line_length": 23.975609756097562, "alnum_prop": 0.6215666327568667, "repo_name": "seales/spellchecker", "id": "1b72dc334185f01b2c487bc016c791f16d278b43", "size": "...
import os import spyral from .sprites import sprite from . import collision WIDTH = 1200 HEIGHT = 900 WHITE = (255, 255, 255) SIZE = (WIDTH, HEIGHT) GREEN = (60, 179, 113) RED = (255, 0, 0) BLACKBLUE = (19, 15, 48) BG_COLOR = BLACKBLUE ENEMYGAP = 30 XMARGIN = 175 YMARGIN = 100 MOVEX = 15 MOVEY = 20 ENEMYSIDE = 50 BA...
{ "content_hash": "615c0acc15620065d34d9dd3e9da19f7", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 75, "avg_line_length": 26.803571428571427, "alnum_prop": 0.6322451698867422, "repo_name": "justinmeister/spaceinvaders-spyral", "id": "b29037245789e34b25cd2afadd5df6c3f273767...
from core.himesis import Himesis import uuid class HoutcategoriesSolveRefChannelCategoryATOMCategory(Himesis): def __init__(self): """ Creates the himesis graph representing the DSLTrans rule outcategoriesSolveRefChannelCategoryATOMCategory. """ # Flag this instance as compiled now self.is_compiled = True ...
{ "content_hash": "76a6355d2ba8a48c1451e17e98dda9e7", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 154, "avg_line_length": 35.61363636363637, "alnum_prop": 0.6569878749202297, "repo_name": "levilucio/SyVOLT", "id": "4a0837f9090356b0adbd2cf1b6d57eb72b5557b8", "size": "313...
""" ---------------------------------------------------------------------- Authors: Jan-Justin van Tonder ---------------------------------------------------------------------- Unit tests for the ID context module. ---------------------------------------------------------------------- """ import pytest from hutts_veri...
{ "content_hash": "f2dbb83bcb9ca27d1116f3daab90d92b", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 121, "avg_line_length": 31.9, "alnum_prop": 0.5694879832810867, "repo_name": "javaTheHutts/Java-the-Hutts", "id": "e753e9f9b3de97499a3bf7e013f7ead306b5c7c4", "size": "2871"...
from django.db import models from wevote_functions.functions import positive_value_exists import wevote_functions.admin logger = wevote_functions.admin.get_logger(__name__) # See also WeVoteServer/twitter/models.py for routines that manage internal twitter data # https://dev.twitter.com/overview/api/users # https:...
{ "content_hash": "d2d81f3d2f9f073e2ae0c93beec32974", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 120, "avg_line_length": 50.114583333333336, "alnum_prop": 0.6370816877987945, "repo_name": "wevote/WeVoteServer", "id": "97164eaf559c383d46f0f73360d9ed17a68b1af2", "size":...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('taborniki', '0007_druzina'), ] operations = [ migrations.RemoveField( model_name='druzina', name='druzina', ), ...
{ "content_hash": "6ce61f42ee16915f1b3b01e58f2f78ee", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 40, "avg_line_length": 19.6, "alnum_prop": 0.5612244897959183, "repo_name": "markbaltic/TaborniskaBaza", "id": "135519932a11b57b222917dd24d3f70a2d2c6233", "size": "416", ...
from __future__ import absolute_import, division, print_function, unicode_literals import os import django BASE_DIR = os.path.dirname(os.path.dirname(__file__)) DEBUG = True TEMPLATE_DEBUG = DEBUG SECRET_KEY = 'NOTASECRET' if django.VERSION[:2] == (1, 8): # Use a wrapper that includes Django commit 4f6a7663b...
{ "content_hash": "9bd2638273686b142ba9b81757cb16a0", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 88, "avg_line_length": 24.11627906976744, "alnum_prop": 0.6142719382835101, "repo_name": "moumoutte/django-perf-rec", "id": "b02bc1a47820b237a8d7b40d4328777c0b62eaf7", "siz...
from distutils.core import setup, Extension setup(name="PositionWeightMatrix", version="1.0", ext_modules = [ Extension("PositionWeightMatrix", ["PositionWeightMatrix.c"]) ])
{ "content_hash": "299302f854f7d71adbcfbe17076637c7", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 63, "avg_line_length": 36, "alnum_prop": 0.75, "repo_name": "tbepler/MESS", "id": "b00d8288394bb5874f736153772716418351557b", "size": "180", "binary": false, "copies": "...