text
stringlengths
4
1.02M
meta
dict
from tehbot.plugins import * from cowsay import cowsay class CowSayPlugin(StandardPlugin): def __init__(self): StandardPlugin.__init__(self) self.parser.add_argument("msg", nargs=1) def execute(self, connection, event, extra, dbconn): if not self.privileged(connection, event): ...
{ "content_hash": "02ebea0de68b15bc0d6cb6774d8570d2", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 57, "avg_line_length": 30.52173913043478, "alnum_prop": 0.6054131054131054, "repo_name": "spaceone/tehbot", "id": "771bddf0902bdb8520d29c323223fc677e9d9832", "size": "702",...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'Program.room' db.delete_column(u'pyconkr_program', 'room_id') # Adding...
{ "content_hash": "dc4d6fbd03bc3f13cdb4d64dbd14f9af", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 156, "avg_line_length": 62.28813559322034, "alnum_prop": 0.5469387755102041, "repo_name": "pythonkr/pyconkr-2014", "id": "47050e68cf228a0de400981dd91a36f887f2024b", "size"...
from unittest import mock import pytest from mitmproxy import contentviews from mitmproxy.exceptions import ContentViewException from mitmproxy.net.http import Headers from mitmproxy.test import tutils class TestContentView(contentviews.View): name = "test" prompt = ("t", "test") content_types = ["test/1...
{ "content_hash": "3b2437c95470ea1ed621d68b37a6213d", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 82, "avg_line_length": 27.186046511627907, "alnum_prop": 0.6445680068434559, "repo_name": "xaxa89/mitmproxy", "id": "95d83af913425388bc994b36a941cc5f7b96bd64", "size": "233...
from . import Visitor class ExperimentsVisitor(Visitor): def __init__(self, site = None, scenario = None): self.result = [] self.site = site self.scenario = scenario def visit_Experiment(self, exp): if self.site is not None: if exp.get_site() != self.site: return if self.scenario is not None: ...
{ "content_hash": "6176d03ec03666270c7a37b36ce54c3a", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 50, "avg_line_length": 19.47826086956522, "alnum_prop": 0.6651785714285714, "repo_name": "stlemme/python-dokuwiki-export", "id": "b688234010197d8eceed4715c311f473e2361927", ...
from django.contrib import admin from .models import UserProfile, Question, Answer # Register your models here. admin.site.register(UserProfile) admin.site.register(Question) admin.site.register(Answer)
{ "content_hash": "2227129c1f8392de7dba6fbe46ea9dd9", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 49, "avg_line_length": 33.833333333333336, "alnum_prop": 0.8226600985221675, "repo_name": "InternsAtMBM/YetAnotherQnA", "id": "60aec754baf0f67514231bb2479cb304ea33c28f", "si...
import atexit import os import shutil import unittest from webkitpy.common.system.executive import Executive, ScriptError from webkitpy.common.system.executive_mock import MockExecutive from webkitpy.common.system.filesystem import FileSystem from webkitpy.common.system.filesystem_mock import MockFileSystem from webki...
{ "content_hash": "95cd95204597c3e2392d515b08f55e3d", "timestamp": "", "source": "github", "line_count": 673, "max_line_length": 117, "avg_line_length": 42.13670133729569, "alnum_prop": 0.6381620706678891, "repo_name": "xin3liang/platform_external_chromium_org_third_party_WebKit", "id": "67b59eb300529...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('transactions', '0002_auto_20150330_2148'), ] operations = [ migrations.AddField( model_name='onchaintransaction', name='is_d...
{ "content_hash": "a537a385e31a50e4fa10dffd1ff25c3f", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 68, "avg_line_length": 26.92, "alnum_prop": 0.5958395245170877, "repo_name": "ychaim/explorer", "id": "4dce98790e81b24b1e85186264ffef0278e957fb", "size": "697", "binary":...
# coding: utf-8 #------------------------------------------------------------------------- # Copyright (c) Microsoft. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at #...
{ "content_hash": "7b1913c2013d2ac92bde2e50baf578c8", "timestamp": "", "source": "github", "line_count": 825, "max_line_length": 94, "avg_line_length": 33.28, "alnum_prop": 0.5956439393939394, "repo_name": "jehine-MSFT/azure-storage-python", "id": "54bf976dd5583ad9325465c63fc581a5ae63c67b", "size": ...
""" This module provides an API for TCF documents. """ from collections import UserList, UserDict, OrderedDict from itertools import chain, product from warnings import warn import logging from lxml import etree try: import igraph except: pass from tcflib.tagsets import TagSet NS_DATA = 'http://www.dspin....
{ "content_hash": "a5ca71d05bbe288ae75f7c9f9a680f78", "timestamp": "", "source": "github", "line_count": 1048, "max_line_length": 86, "avg_line_length": 32.350190839694655, "alnum_prop": 0.5275049405657316, "repo_name": "SeNeReKo/TCFlib", "id": "18f0b8277ccf2c6036296a5d11479845818cfbe3", "size": "35...
""" Autopsy Forensic Browser Copyright 2019 Basis Technology Corp. Contact: carrier <at> sleuthkit <dot> org Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICE...
{ "content_hash": "4f4414b8e86c0a9464aa6728a7c0f26f", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 72, "avg_line_length": 30.3265306122449, "alnum_prop": 0.7079407806191117, "repo_name": "wschaeferB/autopsy", "id": "6db622d3ca439cb3b75021b6892bcb6a59d5ab1e", "size": "148...
"""Starts home assistant.""" from __future__ import print_function import argparse import os import signal import sys import threading import time from multiprocessing import Process from homeassistant.const import ( __version__, EVENT_HOMEASSISTANT_START, REQUIRED_PYTHON_VER, RESTART_EXIT_CODE, ) d...
{ "content_hash": "7d5db50ce362b8577042618ad09f6b66", "timestamp": "", "source": "github", "line_count": 347, "max_line_length": 79, "avg_line_length": 28.64265129682997, "alnum_prop": 0.5992554582956032, "repo_name": "Zyell/home-assistant", "id": "f12758a354d163e3a152ff137c9a4a1503d6faac", "size": ...
import requests import json import math customerId = '5709786a319313dd1b438fd0' apiKey = 'cf6fe22672e82008e57d304ac6e0d669' #Get the amount of money in the food bank account def getFoodAmount(): r = requests.get('http://api.reimaginebanking.com/accounts/57097f4a319313dd1b43b2bd?key=cf6fe22672e82008e57d304ac6e0d66...
{ "content_hash": "0488105b6a38693b09819f03fc0fbc5e", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 126, "avg_line_length": 33.27777777777778, "alnum_prop": 0.6917084028937117, "repo_name": "jerrrytan/bitcamp", "id": "b1680499d4b9376f8546f23ac2e1762361a428d1", "size": "18...
extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', # 'sphinx.ext.doctest', 'sphinx.ext.autosummary', 'sphinx.ext.napoleon', # 'sphinx.ext.todo', # 'sphinx.ext.coverage', # 'sphinx.ext.mathjax', 'sphinx.ext.githubpages'] autosummary_generate = True # Add any paths that c...
{ "content_hash": "150d12578f45403d0eabf8e22b3f79ea", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 78, "avg_line_length": 28.65, "alnum_prop": 0.6646721515831463, "repo_name": "komarov-k/pycudnn", "id": "7a367cc8d02cc749ef1aee6f3350aa86db081099", "size": "5063", "bina...
''' Problem 187 A composite is a number containing at least two prime factors. For example, 15 = 3 × 5; 9 = 3 × 3; 12 = 2 × 2 × 3. There are ten composites below thirty containing precisely two, not necessarily distinct, prime factors: 4, 6, 9, 10, 14, 15, 21, 22, 25, 26. How many composite integers, n < 108, have prec...
{ "content_hash": "530273ea54b974e8d2cb93c788edb592", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 114, "avg_line_length": 28.76923076923077, "alnum_prop": 0.6029411764705882, "repo_name": "byung-u/ProjectEuler", "id": "786893e90ee6d3e7f63925231aeb10595643c16b", "size": ...
from azure.identity import DefaultAzureCredential from azure.mgmt.cdn import CdnManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-cdn # USAGE python custom_domains_disable_custom_https.py Before run the sample, please set the values of the client ID, tenant ID and ...
{ "content_hash": "323dc1cd1a06844f5f1fb9d95054cb9e", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 135, "avg_line_length": 33.285714285714285, "alnum_prop": 0.7193133047210301, "repo_name": "Azure/azure-sdk-for-python", "id": "d3195e38a25cf295c81697576abc8c12f7772d3c", "...
import sys import LinkedList import solution FP_RATIO_PREC = 2 # The number of digits of precision in the values representing # the passed/failed ratio to the total number of tests. def TestMain(sol, log=sys.stdout, doNotLogPassed=True) -> bool: """ @param sol: the function to be tested. @par...
{ "content_hash": "1ade7ce3e7c0b9186f7d6dfa29997566", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 112, "avg_line_length": 40, "alnum_prop": 0.5465909090909091, "repo_name": "lilsweetcaligula/Algorithms", "id": "676c2a6bee3b73230dc844bf14f99d9fe93d53ca", "size": "3686", ...
from __future__ import print_function, division __author__ = 'george' from time import strftime import random, sys, math class Point: def __init__(self, name, hi=1, lo=0): """ Create a point :param name: Name of the point :param hi: Max value of the point :param lo: Min value of the point :r...
{ "content_hash": "dd4c2512f5831717c6e46bdbb3509f83", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 89, "avg_line_length": 25.364583333333332, "alnum_prop": 0.6117043121149898, "repo_name": "BigFatNoob-NCSU/x9115george2", "id": "64e215eb2e2848d27f77972198dd9119177a9cc6", ...
from deep_learning_layers import ConvolutionOver2DAxisLayer, MaxPoolOverAxisLayer, MaxPoolOver2DAxisLayer, \ MaxPoolOver3DAxisLayer, ConvolutionOver3DAxisLayer, ConvolutionOverAxisLayer from default import * import theano.tensor as T from layers import MuLogSigmaErfLayer, CumSumLayer import objectives from lasagn...
{ "content_hash": "c979b0c34b78ed972830b11287257d29", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 148, "avg_line_length": 46.35269709543569, "alnum_prop": 0.5194700563960254, "repo_name": "317070/kaggle-heart", "id": "b5c2f44b209565861a63276852b1839adac1984e", "size": ...
import mock from openstack import exceptions as sdk_exc from osc_lib import exceptions as exc from senlinclient.tests.unit.v1 import fakes from senlinclient.v1 import policy_type as osc_policy_type class TestPolicyType(fakes.TestClusteringv1): def setUp(self): super(TestPolicyType, self).setUp() ...
{ "content_hash": "2f3b8fb5f9d7f90f5cb4d15cef44a7fc", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 77, "avg_line_length": 35.11904761904762, "alnum_prop": 0.6010169491525423, "repo_name": "stackforge/python-senlinclient", "id": "f4d82c9bf897f3d166d8ac98747769db0b977fc8", ...
"""Tests for lite.py functionality related to MLIR-TFLite converter.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.lite.python import lite from tensorflow.lite.python import lite_constants from tensorflow.lite.python...
{ "content_hash": "66ddf5ddbc48a799bb69fbda57aae042", "timestamp": "", "source": "github", "line_count": 492, "max_line_length": 80, "avg_line_length": 39.64430894308943, "alnum_prop": 0.6748526018969495, "repo_name": "chemelnucfin/tensorflow", "id": "8d198c22babbfc3a5923ae9ed4abcf337bd315b6", "size...
from six import PY3, string_types from .comments import Comment class Setting(object): def __init__(self, setting_name, parent=None, comment=None): self.setting_name = setting_name self.parent = parent self._set_initial_value() self._set_comment(comment) def _set_initial_val...
{ "content_hash": "804cc23ad8c3e0801c60b79828fdc435", "timestamp": "", "source": "github", "line_count": 346, "max_line_length": 80, "avg_line_length": 24.910404624277458, "alnum_prop": 0.5896275670031326, "repo_name": "userzimmermann/robotframework-python3", "id": "4775d15a93f6d1615bf985d2537616bd43e...
from __future__ import print_function, division import os import sys import subprocess def class_process(dir_path, dst_dir_path, class_name): class_path = os.path.join(dir_path, class_name) if not os.path.isdir(class_path): return dst_class_path = os.path.join(dst_dir_path, class_name) if not os.path.exis...
{ "content_hash": "47a673acac67e006c341cf1fe3fdbad4", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 111, "avg_line_length": 31.458333333333332, "alnum_prop": 0.6423841059602649, "repo_name": "kenshohara/3D-ResNets", "id": "985f7cd1f57292b248551c7932e21a35ee59f3be", "size"...
from exception.AppException import ConvertFailed global_data = 'first' def get_global_data(): return global_data def set_global_data(data_param): # global_data is not considered global data global_data = data_param def func_sum(a,b): return a+b def get_res(payload): res = {} try: ...
{ "content_hash": "d87a86618a95c938cf42188afb5c6801", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 48, "avg_line_length": 16.708333333333332, "alnum_prop": 0.6508728179551122, "repo_name": "suriyaprakhash/learning", "id": "18a151dba25fa84d2958704a7cd9cea5ff915b86", "size...
from globals import * import life as lfe import language import missions import bad_numbers import weapons import spawns import alife import items import logging import random def generate(): create_territories() create_faction('Dawn', ['dawn_scout', 'dawn_sentry'], enemies=['Bandits', 'Runners', 'Military']) c...
{ "content_hash": "21c037973c5c3f332ee289fada8a170a", "timestamp": "", "source": "github", "line_count": 316, "max_line_length": 135, "avg_line_length": 36.901898734177216, "alnum_prop": 0.6478861161135409, "repo_name": "flags/Reactor-3", "id": "990dd4f0dd49fe805335cc95edd42f005e9654fa", "size": "11...
from django import template from django.template.defaultfilters import stringfilter from django.utils.html import conditional_escape from django.utils.safestring import mark_safe from datetime import date from website.models import Order, OrderProduct import re register = template.Library() @register.filter def get_i...
{ "content_hash": "bc333805832abcd71701d41625e6f540", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 83, "avg_line_length": 25.476190476190474, "alnum_prop": 0.7370716510903427, "repo_name": "vlameiras/cdkeyswholesale", "id": "0e5676f511d1e2b5cd077ca038d5f7ec7cd0a9ae", "si...
"""List SSH keys.""" # :license: MIT, see LICENSE for more details. import click import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting @click.command(cls=SoftLayer.CLI.command.SLCommand, ) @click.option('--sortby', help='Column to sort by', type=clic...
{ "content_hash": "65689e7b1038b4c9a11a086081baaeb7", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 69, "avg_line_length": 27.11764705882353, "alnum_prop": 0.5249457700650759, "repo_name": "softlayer/softlayer-python", "id": "7958675e6794dab5ef9addf67dd6e9c684f263dc", "si...
import unittest import webtest from rdflib import BNode, ConjunctiveGraph, Graph, Literal, URIRef from rdflib.namespace import RDF, RDFS, FOAF, XSD import bottle from flask_rdf.bottle import returns_rdf, output, Decorator def make_graph(): graph = Graph('IOMemory', BNode()) person = URIRef('http://example.com/#pers...
{ "content_hash": "6b7085c4fa6ef8a07f76f25af49b17ec", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 82, "avg_line_length": 36.547486033519554, "alnum_prop": 0.7190461632528279, "repo_name": "hufman/flask_rdf", "id": "4de4ed77b3f050188f6bf02f54f2d24ccadaa022", "size": "65...
''' Test Steps: 1. grace stop host where vip located. 2. check vip switch to another MN. @author: SyZhao ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_state as test_state import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.operations.node_operation...
{ "content_hash": "621d3232e7e647330956500f48d01427", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 166, "avg_line_length": 38.85333333333333, "alnum_prop": 0.6640356897735072, "repo_name": "zstackio/zstack-woodpecker", "id": "424f923822a2cce6e1f530b41de53748952078e4", "s...
import unittest import numpy import chainer from chainer.backends import cuda from chainer import functions from chainer import gradient_check from chainer import testing from chainer.testing import attr from chainer.testing import condition from chainer import Variable def _identiy_grid(in_shape): mesh = numpy...
{ "content_hash": "186a33cf6dc81a2cde1d5b6da7c0c658", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 79, "avg_line_length": 34.22127659574468, "alnum_prop": 0.5920169112161154, "repo_name": "aonotas/chainer", "id": "a282924f93e7e4b021d609f480221f28e584b436", "size": "8042...
from PyQt4 import QtCore, QtGui import os import socket import logging import inspect import MainWindow_rc from GitLib import LOG import GitLib # # MainWindow class # class MainWindow(QtGui.QMainWindow, GitLib.GitLibDelegate) : def __init__(self): super(MainWindow, self).__init__() self.git = None...
{ "content_hash": "9fc9807383323b425161e60b6a80c601", "timestamp": "", "source": "github", "line_count": 464, "max_line_length": 123, "avg_line_length": 39.86853448275862, "alnum_prop": 0.6237634466727932, "repo_name": "okertanov/Gitra-VCF", "id": "5acc5f0585a99e02d3302005b1d8c8a5b1236b40", "size": ...
"""Support to the Logi Circle cameras.""" import logging import asyncio from datetime import timedelta import voluptuous as vol from homeassistant.helpers import config_validation as cv from homeassistant.components.logi_circle import ( DOMAIN as LOGI_CIRCLE_DOMAIN, ATTRIBUTION) from homeassistant.components.came...
{ "content_hash": "b68ac186b497c3ea8a3e1c784a133666", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 78, "avg_line_length": 34.326829268292684, "alnum_prop": 0.6427454881341481, "repo_name": "HydrelioxGitHub/home-assistant", "id": "4f349dd986e449abb1953e354f42b3302b085ed9",...
"""Simulate a crashing-after-pass google-test executable. http://code.google.com/p/googletest/ """ import os import sys import gtest_fake_base TESTS = { 'Foo': ['Bar1', 'Bar2'], } def main(): test_cases, args = gtest_fake_base.parse_args(TESTS, 1) temp_dir = args[0] result = 0 for test_case in test_ca...
{ "content_hash": "3477503ff943e40aac33f3e30f4177d6", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 68, "avg_line_length": 22.525, "alnum_prop": 0.6492785793562708, "repo_name": "windyuuy/opera", "id": "58437815afdd4c8da015cb666b4cf9bc63688376", "size": "1090", "binary"...
""" ============================== Show the different brain views ============================== Among the views available are lateral, rostral, caudal, frontal etc. """ print __doc__ from surfer import Brain sub = 'fsaverage' hemi = 'both' surf = 'inflated' brain = Brain(sub, hemi, surf) ########################...
{ "content_hash": "72656bfe15d3a376bb6062aa33814ebc", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 79, "avg_line_length": 24.676470588235293, "alnum_prop": 0.5244338498212158, "repo_name": "aestrivex/PySurfer", "id": "8b417cf778243f2a34bed39529cbd67554f1584a", "size": "8...
"""This module contains code relating to the use of OpenFlow Metadata within Faucet. """ PORT_METADATA_MASK = 0xFFF VLAN_METADATA_MASK = 0xFFF000 EGRESS_METADATA_MASK = PORT_METADATA_MASK | VLAN_METADATA_MASK def get_egress_metadata(port_num, vid): """Return the metadata value to output a packet to port port_num ...
{ "content_hash": "4c4e56283ceabb51a996b95d39160da3", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 76, "avg_line_length": 33.84615384615385, "alnum_prop": 0.7272727272727273, "repo_name": "faucetsdn/faucet", "id": "037b3212c03d297c6a419157aa9d41cf631b6e64", "size": "440"...
import demistomock as demisto from CommonServerPython import * from CommonServerUserPython import * import json def parse_raw(raw_json): data = json.loads(raw_json) outputs = { 'expanse_raw_json_event': data } readable_outputs = tableToMarkdown('Event Information', data) return ( ...
{ "content_hash": "25c4afa95d7f1bec64c5245e367b6c3b", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 84, "avg_line_length": 21.225806451612904, "alnum_prop": 0.6367781155015197, "repo_name": "VirusTotal/content", "id": "124f6d4e39dda4e042273accf659d8c72052cb8a", "size": "6...
import unittest import mock import numpy import chainer from chainer import cuda from chainer import functions from chainer import links from chainer import testing from chainer.testing import attr @testing.parameterize( {'use_cudnn': 'always'}, {'use_cudnn': 'never'}, ) class TestMLPConvolution2D(unittest....
{ "content_hash": "ace182dc3fb0a1fe544493d1b2a87a78", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 77, "avg_line_length": 36.464285714285715, "alnum_prop": 0.5808031341821743, "repo_name": "delta2323/chainer", "id": "de05fd87a8fe5092347e042a70ac36afac28c063", "size": "7...
""" Automated tests for the astroML figures """
{ "content_hash": "3787080b426bdccbf64fbb788e707564", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 39, "avg_line_length": 16, "alnum_prop": 0.7083333333333334, "repo_name": "kcavagnolo/astroML", "id": "fab0b4eb44c0d39a13514522d28cf119dd8c50e3", "size": "48", "binary": f...
""" Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
{ "content_hash": "b3708f48dcc1088a895f3b6054f6da4d", "timestamp": "", "source": "github", "line_count": 321, "max_line_length": 130, "avg_line_length": 58.90342679127726, "alnum_prop": 0.7690924476412101, "repo_name": "mattf-horton/metron", "id": "de53e38c15c57a5b94e3733aae6c22538784120c", "size": ...
from flask import Flask from flask_turboduck.db import Database app= Flask(__name__) app.config.from_object('config.Configuration') db = Database(app) def create_tables(): User.create_table() Movie.create_table() Person.create_table() Cast.create_table()
{ "content_hash": "87b64eddba41915efe5756797c657d9c", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 46, "avg_line_length": 21, "alnum_prop": 0.7142857142857143, "repo_name": "dommert/DangerZone", "id": "e1fb96ea8eee1a1ba85a257ba8337f590ae4734d", "size": "310", "binary":...
import sys import os import tempfile from assertpy import assert_that,contents_of,fail class TestFile(object): def setup(self): self.tmp = tempfile.NamedTemporaryFile() self.tmp.write('foobar'.encode('utf-8')) self.tmp.seek(0) def teardown(self): self.tmp.close() def test...
{ "content_hash": "b42d19d9317caf148e3de59ff97f4da4", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 106, "avg_line_length": 37.369127516778526, "alnum_prop": 0.6023706896551724, "repo_name": "wuan/assertpy", "id": "4b217e154d065334f5e84eeff34bf67f3655d7d4", "size": "7116...
""" Utilities for validating user inputs such as metric names and parameter names. """ import numbers import posixpath import re from mlflow.exceptions import MlflowException from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE from mlflow.store.db.db_types import DATABASE_ENGINES from mlflow.utils.string_...
{ "content_hash": "e62090f3302137ec845994cdb6e6d3e0", "timestamp": "", "source": "github", "line_count": 382, "max_line_length": 100, "avg_line_length": 37.79842931937173, "alnum_prop": 0.653023062538957, "repo_name": "mlflow/mlflow", "id": "c1d8ffc5138de8c35e53b1ef89dcb78fd6341628", "size": "14439"...
import os import numpy as np from seisflows.tools import unix from seisflows.tools.math import dot from seisflows.tools.tools import loadtxt, savetxt, loadnpy, savenpy class NLCG: """ Nonlinear conjugate gradient method """ def __init__(self, path='.', load=loadnpy, save=savenpy, thresh=1., maxiter=np...
{ "content_hash": "47ed93695b7daebddc895aade43fd529", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 102, "avg_line_length": 24.650485436893202, "alnum_prop": 0.5482473414730209, "repo_name": "luan-th-nguyen/seisflows_ndt", "id": "c283d27aa79b2c886db3ce4eeea8cfdeaa76592c", ...
default_app_config = 'imagerprofile.apps.ImagerProfileConfig'
{ "content_hash": "50a48a5a8c30f7d8f89c46100d2bd9b2", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 61, "avg_line_length": 61, "alnum_prop": 0.8524590163934426, "repo_name": "nbeck90/django-imager", "id": "161388ffdfa0b0ef1a2e1191f68d62b1fb922aa3", "size": "61", "binary"...
"""Class for bitcoind node under test""" import contextlib import decimal import errno from enum import Enum import http.client import json import logging import os import re import subprocess import tempfile import time import urllib.parse import collections import shlex import sys from .authproxy import JSONRPCExce...
{ "content_hash": "251f8df967f4562ef5dc667e78ce3f7c", "timestamp": "", "source": "github", "line_count": 559, "max_line_length": 207, "avg_line_length": 42.32379248658319, "alnum_prop": 0.607887062006002, "repo_name": "mitchellcash/bitcoin", "id": "c7559ac7c899eca3d7a3b1589f6b5ae29e71d9ef", "size": ...
# Copyright (C) Alibaba Cloud Computing # All rights reserved. class Histogram: """ The class used to present the result of log histogram status. For every log histogram, it contains : from/to time range, hit log count and query completed status. :type fromTime: int :param from...
{ "content_hash": "39d9d4f6e634ebb35b2e0d79917bd462", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 79, "avg_line_length": 26.307692307692307, "alnum_prop": 0.5526315789473685, "repo_name": "amorwilliams/gsoops", "id": "6120a88036c5849686d7dad9d5acc52712dc61aa", "size": "...
import array import binascii import zmq import struct port = 25555 zmqContext = zmq.Context() zmqSubSocket = zmqContext.socket(zmq.SUB) zmqSubSocket.setsockopt(zmq.SUBSCRIBE, "hashblock") zmqSubSocket.setsockopt(zmq.SUBSCRIBE, "hashtx") zmqSubSocket.setsockopt(zmq.SUBSCRIBE, "rawblock") zmqSubSocket.setsockopt(zmq.SU...
{ "content_hash": "01be4f29af7827e4928e99dbb94ffe8b", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 56, "avg_line_length": 31.025641025641026, "alnum_prop": 0.6016528925619835, "repo_name": "navcoindev/navcoin-core", "id": "d66ecfa8c1c0701ccd04b664bea8db8e361d6ac9", "size...
import pytest import doctest from insights.tests import context_wrap from insights.parsers import SkipException, ParseException from insights.parsers import satellite_mongodb MONGO_PULP_STORAGE_ENGINE_OUTPUT1 = ''' MongoDB shell version v3.4.9 connecting to: mongodb://127.0.0.1:27017/pulp_database MongoDB server vers...
{ "content_hash": "046ca2e179eb522dbbb460a0db80a5f0", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 156, "avg_line_length": 33.23157894736842, "alnum_prop": 0.7348748812163446, "repo_name": "RedHatInsights/insights-core", "id": "ebdb49430ffac9dbd925ac8f37db189cfe66c05c", ...
"""Protocol constants used by the manager and executors.""" class WorkerProtocol: """Constants used by the manager workers.""" COMMAND = 'command' DATA_ID = 'data_id' COMMUNICATE = 'communicate' COMMUNICATE_SETTINGS = 'settings_override' COMMUNICATE_EXTRA = 'kwargs' FINISH = 'finish_dat...
{ "content_hash": "7a91ded541698b9204bd0a0c78c47900", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 61, "avg_line_length": 22.203389830508474, "alnum_prop": 0.6450381679389313, "repo_name": "jberci/resolwe", "id": "648ecc2fc2eb4bb60ce5b95debef3a5e9ad5c36e", "size": "1310"...
import os import subprocess import sys def rmtree(dir_path): if not os.path.exists(dir_path): return print("Remove directory: {}".format(dir_path)) if os.name == 'nt': subprocess.check_call(['cmd', '/c', 'rmdir', dir_path, '/S', '/Q']) else: subprocess.check_call(['rm', '-rf', dir_path]) # sanit...
{ "content_hash": "84876247ffe6ba0a545c3f12b5a7dc4d", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 71, "avg_line_length": 26.4375, "alnum_prop": 0.6335697399527187, "repo_name": "idscan/polly", "id": "580e652628053b46f1a6d1ba57c1038332e6a8ba", "size": "692", "binary": ...
from unittest.mock import patch import orjson from zerver.lib.test_classes import WebhookTestCase from zerver.lib.webhooks.git import COMMITS_LIMIT TOPIC_REPO = "public-repo" TOPIC_ISSUE = "public-repo / Issue #2 Spelling error in the README file" TOPIC_PR = "public-repo / PR #1 Update the README with new informatio...
{ "content_hash": "59eec982fe36168092383ba4d48a64fe", "timestamp": "", "source": "github", "line_count": 468, "max_line_length": 444, "avg_line_length": 61.333333333333336, "alnum_prop": 0.6906354515050167, "repo_name": "showell/zulip", "id": "d7d49c07c8bfb08e98e4186e47d99180bece096e", "size": "2870...
from setuptools import setup, find_packages setup( name='django-facebook-comments', version=__import__('facebook_comments').__version__, description='Django implementation for Facebook Graph API Comments', long_description=open('README.md').read(), author='ramusus', author_email='ramusus@gmail....
{ "content_hash": "b020ec754608353633925085e2f4247d", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 72, "avg_line_length": 37.4, "alnum_prop": 0.6443850267379679, "repo_name": "ramusus/django-facebook-comments", "id": "270b977b445a5e51ce794502f7b785dbecc54bd9", "size": "1...
import json import argparse import codecs import sys def main(args): data = args.in_lyapas.read() data = json.dumps(data, ensure_ascii=False, encoding='utf-8') json_data = '{"file": "' + args.in_lyapas.name + '",' + ' "source": ' + data +'}' args.out_filename.write(json_data) if __name__ == "__main__...
{ "content_hash": "9af620e7ec2b1410c9fc1d945adf0a96", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 144, "avg_line_length": 42.8235294117647, "alnum_prop": 0.6662087912087912, "repo_name": "tsu-iscd/lyapas-lcc", "id": "700554f78946be3b9b0d5a497dfee3aabd0030a1", "size": "7...
from . import bsm from . import normal from . import sabr
{ "content_hash": "5f5da6aa340edf5a55f847ba212609c1", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 20, "avg_line_length": 19, "alnum_prop": 0.7543859649122807, "repo_name": "PHBS-2017-ASP-Classroom/SABRmodel_Base", "id": "c85f6599664e51fa40b12395969cc153ebbcd5fc", "size":...
from __future__ import unicode_literals import decimal import datetime from biplist import writePlistToString from django.test import TestCase from django.utils import six from rest_framework_plist.renderers import PlistRenderer from rest_framework_plist.parsers import PlistParser if not six.PY3: chr = unichr ...
{ "content_hash": "e911f03591f015ca54d7072f9c653244", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 73, "avg_line_length": 29.076923076923077, "alnum_prop": 0.5789871504157218, "repo_name": "pombredanne/django-rest-framework-plist", "id": "7bbcd0fb0b07eba93a1c820ad5356073b1...
from m3.joint import M3Joint import numpy as nu import m3.unit_conversion as m3u import math import time import m3.toolbox as m3t class M3JointZLift(M3Joint): """Wrapper for 1DOF Z-Lift""" def __init__(self,name): M3Joint.__init__(self,name,type='m3joint_zlift') self.cb_mm_per_deg = self.config...
{ "content_hash": "289a7b68017ff8eca6152eeda759b5e9", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 131, "avg_line_length": 37.81927710843374, "alnum_prop": 0.5555909525326537, "repo_name": "ahoarau/m3meka", "id": "65ec0192d5d7dfe33cb76244ab1e2db2efc551f5", "size": "3873"...
from flask import Blueprint, request, redirect from models import User, db from functools import wraps, update_wrapper import hashlib utilities = Blueprint('utilities', __name__, template_folder='templates') def login_required(f): @wraps(f) def decorator(*args, **kwargs): try: session['...
{ "content_hash": "23efec7165fc1234e3b1481de712e760", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 110, "avg_line_length": 25.839285714285715, "alnum_prop": 0.6731167933655839, "repo_name": "levlaz/openfaqs", "id": "b79c426cebd0083fcc7c1b6608c7c88a578e30c4", "size": "144...
from __future__ import division import sys import time import pydoop.hdfs as hdfs import pydoop.mapreduce.api as api import pydoop.mapreduce.pipes as pipes SEP_KEY = "mapreduce.output.textoutputformat.separator" class Mapper(api.Mapper): def __init__(self, context): super(Mapper, self).__init__(contex...
{ "content_hash": "f392de41ce18b2ea16701a5d28295f65", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 74, "avg_line_length": 26.357142857142858, "alnum_prop": 0.5900116144018583, "repo_name": "simleo/pydoop", "id": "8a2931c0402bef8dcefabf5ed644bba0034a240b", "size": "3215",...
from nose.tools import eq_ from ..context import Context from ..dependent import Dependent def test_context(): # No context context = Context() foo = Dependent("foo", lambda: "foo") bar = Dependent("bar", lambda: "bar") foobar = Dependent("foobar", lambda foo, bar: foo + bar, ...
{ "content_hash": "8337578616efc18982e57a887a6d2748", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 74, "avg_line_length": 28.88235294117647, "alnum_prop": 0.6171079429735234, "repo_name": "aetilley/revscoring", "id": "ff14675380758e903a7405cf0ab3a1cad926ce54", "size": "9...
def check_calls(self, calls, values): self.assertEqual(len(calls), len(values)) r = {} for call in calls: name = call[0][0] value = call[0][1] r[name] = value for name, value in values: self.assertEqual(r.pop(name), value) self.assertEqual(len(r), 0)
{ "content_hash": "b066f0b72fd2fba7663a73fff3860f1e", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 45, "avg_line_length": 23.53846153846154, "alnum_prop": 0.5686274509803921, "repo_name": "sys-git/hoft", "id": "de67960899e277504dd99104d7b697837d614aa3", "size": "358", ...
from django import forms class ContactForm(forms.Form): title = forms.CharField(max_length=500) body = forms.CharField(max_length=5000, widget=forms.Textarea) class ContactEmailForm(forms.Form): email = forms.EmailField() title = forms.CharField(max_length=500) body = forms.CharField(max_length=...
{ "content_hash": "6f67dead14883edd442eb7473d41aebe", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 66, "avg_line_length": 29.083333333333332, "alnum_prop": 0.7392550143266475, "repo_name": "us-ignite/us_ignite", "id": "d1169575b5b1fb930ac264ce0d93d2e5847ee232", "size": "...
""" WSGI config for mendelmd 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.6/howto/deployment/wsgi/ """ import os import site import sys #site.addsitedir('/projects/venv/lib/python3.5/site-packages'...
{ "content_hash": "69d23196ffee4a7cb8fe2ade1d397a6f", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 81, "avg_line_length": 28, "alnum_prop": 0.7716836734693877, "repo_name": "raonyguimaraes/mendelmd", "id": "adfd8ae442477844eb923483e4109215e0088085", "size": "784", "bin...
'''OpenGL extension ARB.shader_atomic_counters This module customises the behaviour of the OpenGL.raw.GL.ARB.shader_atomic_counters to provide a more Python-friendly API Overview (from the spec) This extension provides a set of atomic counters. This extension provides GLSL built-in functions to query and inc...
{ "content_hash": "4eb482b65faccfa863073c583c5b95be", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 93, "avg_line_length": 37.37313432835821, "alnum_prop": 0.7991214057507987, "repo_name": "alexus37/AugmentedRealityChess", "id": "d67f4406397a07542e4c50ff8bce45e3bc0a5b83", ...
"""rasterio.vrt: a module concerned with GDAL VRTs""" from rasterio._warp import WarpedVRTReaderBase from rasterio.io import WindowMethodsMixin, TransformMethodsMixin class WarpedVRT(WarpedVRTReaderBase, WindowMethodsMixin, TransformMethodsMixin): """Creates a virtual warped dataset. Abstrac...
{ "content_hash": "12e10491d6c4dd262656926ae149bfe2", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 73, "avg_line_length": 32.05797101449275, "alnum_prop": 0.6460216998191681, "repo_name": "brendan-ward/rasterio", "id": "78969f06388a0d4ed80d48e562dd20a3f63f6af8", "size": ...
from alembic import op import sqlalchemy as sa """add standardattr to qos policies Revision ID: b12a3ef66e62 Revises: 3b935b28e7a0 Create Date: 2016-08-18 14:10:30.021055 """ # revision identifiers, used by Alembic. revision = 'b12a3ef66e62' down_revision = '3b935b28e7a0' depends_on = ('67daae611b6e',) # basic mo...
{ "content_hash": "8ea61dc65612a5d9559d8dbc59c6c08e", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 77, "avg_line_length": 36.375, "alnum_prop": 0.6128293241695304, "repo_name": "noironetworks/neutron", "id": "66004dc18ac02985fc0b827b5899c220c7e87e13", "size": "3196", "...
from django.middleware.csrf import get_token from django.shortcuts import render, redirect from django.template.loader import render_to_string from django.http import HttpResponse from django.contrib import messages from deploy_board.settings import IS_PINTEREST import json import logging from helpers import baseimage...
{ "content_hash": "53cda98d5f2d19b895fb849633f3854a", "timestamp": "", "source": "github", "line_count": 598, "max_line_length": 103, "avg_line_length": 37.73411371237458, "alnum_prop": 0.6603146465765566, "repo_name": "yujunglo/teletraan", "id": "7f1fea610702e448865cea4b62a09b3b74bc1bbd", "size": "...
"""Constants for the AdGuard Home integration.""" import logging DOMAIN = "adguard" LOGGER = logging.getLogger(__package__) DATA_ADGUARD_CLIENT = "adguard_client" DATA_ADGUARD_VERSION = "adguard_version" CONF_FORCE = "force" SERVICE_ADD_URL = "add_url" SERVICE_DISABLE_URL = "disable_url" SERVICE_ENABLE_URL = "enab...
{ "content_hash": "af33e05123030f4023a4eab63bf65c2e", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 49, "avg_line_length": 22.941176470588236, "alnum_prop": 0.7307692307692307, "repo_name": "nkgilley/home-assistant", "id": "a4ccde68539ad9df2355f05f5408f05c967a0862", "size...
"""Update metadata database with archive start for METAR sites. Looks at the asos database and finds the first observation from a site. """ import sys import datetime from pyiem.network import Table as NetworkTable from pyiem.util import get_dbconn, logger LOG = logger() def main(network): """GO!""" basets...
{ "content_hash": "7e82365b61b3235f969e58f2edf25556", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 74, "avg_line_length": 29.96551724137931, "alnum_prop": 0.5005753739930955, "repo_name": "akrherz/iem", "id": "6cc586bcb6692d654bef7eb062e5f85dd8c6383b", "size": "2607", ...
""" Copyright 2022 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software dis...
{ "content_hash": "ebc75dc43bd802de146a18b0c9321c3b", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 76, "avg_line_length": 33.3125, "alnum_prop": 0.6857410881801126, "repo_name": "googleworkspace/python-samples", "id": "17478b92e5c8e36ad125e642faeb78aae7302d52", "size": "...
""" The HQLdesign class can (de)serialize a design to/from a QueryDict. """ from builtins import object import json import logging import sys import django.http from beeswax.design import normalize_form_dict, denormalize_form_dict, split_statements from notebook.sql_utils import strip_trailing_semicolon if sys.vers...
{ "content_hash": "6478f92b87daa7f7cc2053554258f618", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 145, "avg_line_length": 29.142857142857142, "alnum_prop": 0.6692810457516339, "repo_name": "kawamon/hue", "id": "ba1e7a2c89c5cc0165e22938adc118284f82f7da", "size": "3852",...
"""Unit tests for the Workflow class in models.courses.""" __author__ = 'Sean Lip (sll@google.com)' import unittest from models.courses import LEGACY_HUMAN_GRADER_WORKFLOW from models.courses import Workflow import yaml DATE_FORMAT_ERROR = ( 'dates should be formatted as YYYY-MM-DD hh:mm (e.g. 1997-07-16 19:20...
{ "content_hash": "99f736ae186be5b708383848786af59a", "timestamp": "", "source": "github", "line_count": 214, "max_line_length": 80, "avg_line_length": 40.546728971962615, "alnum_prop": 0.6374322922669126, "repo_name": "graemian/ami-mooc-pilot", "id": "bfa1dc1f873c5436bb7c05ecf21e76f0e4d70b92", "siz...
import logging # 3rd party libs from flask import abort from flask import Blueprint from flask import g from flask_api import status # Own libs from oneview_redfish_toolkit.api.computer_system import ComputerSystem from oneview_redfish_toolkit.api.network_interface import NetworkInterface from oneview_redfish_toolkit...
{ "content_hash": "9a4a679c6c46eeab7ea0e49f5ddac3a9", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 76, "avg_line_length": 33.885245901639344, "alnum_prop": 0.6729559748427673, "repo_name": "HewlettPackard/oneview-redfish-toolkit", "id": "3e9063b249eaea0f1eba7599f7f82a4dddf...
from distutils.core import setup setup( name='createpyproject', version='0.1.0', author='Gennady Denisov', author_email='denisovgena@gmail.com', packages=['createpyproject', 'createpyproject.test'], url='https://www.bitbucket.org/createpyproject', license='LICENSE.txt', description='My ...
{ "content_hash": "d6feb0e9bce8d18c19ee8c5f6bb764e7", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 57, "avg_line_length": 30.923076923076923, "alnum_prop": 0.6965174129353234, "repo_name": "geaden/createpyproject", "id": "9bc011f9b4397c0d382ce8bb5de19dbc11d644e6", "size"...
"""This package defines the url configuration for the cloning app. All views in this app start from a request /cloning/cloning or /cloning/mutagenesis. There are simple new, edit, delete, detail and list views for each of cloning and mutagenesis. """ '''This is the urlconf for protocol urls.''' from django.conf.urls...
{ "content_hash": "cf5118df2b896cdbf13f2ff5b86c7c0b", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 104, "avg_line_length": 51.84, "alnum_prop": 0.6975308641975309, "repo_name": "davebridges/ExperimentDB", "id": "93e0667e56a14b21e12ad41ad26714cec89a3d74", "size": "1296", ...
"""This platform allows several cover to be grouped into one cover.""" import logging from typing import Dict, Optional, Set import voluptuous as vol from homeassistant.components.cover import ( ATTR_CURRENT_POSITION, ATTR_CURRENT_TILT_POSITION, ATTR_POSITION, ATTR_TILT_POSITION, DOMAIN, PLATF...
{ "content_hash": "489723a643fffe14de31ae200ffd7a59", "timestamp": "", "source": "github", "line_count": 316, "max_line_length": 88, "avg_line_length": 33.2373417721519, "alnum_prop": 0.5843092449776255, "repo_name": "leppa/home-assistant", "id": "d9efdfa53c692c4f7bb7ddb1e7148ee82af607c6", "size": "...
"""DNA - Service template - Main service module. Main methods to handle the service tasks. """ import base64 import json import logging import random import sys from dna_general_settings import GDS_KIND_LOG_SERVICE from dna_logging import configure_logging from dna_project_settings import PROJECT_ID from gcp_connect...
{ "content_hash": "335fd5e242626687db12c9f91a19a255", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 79, "avg_line_length": 29.193548387096776, "alnum_prop": 0.6844198895027624, "repo_name": "google/dnae", "id": "a4ff67feee27ecd3aa156489b69dfd0690b1803d", "size": "5102", ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0022_add_error_fields'), ] operations = [ migrations.RemoveField( model_name='layer', name='thumb_large', ),...
{ "content_hash": "ffbb8efdda7e97ee9659de638c55b8f4", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 334, "avg_line_length": 39.50847457627118, "alnum_prop": 0.5688545688545689, "repo_name": "kdeloach/raster-foundry", "id": "6482b56836ea7ed8bdaa2c9ad9140d7a5242ec1c", "size...
from capability import * from scapy.all import * import multiprocessing class Syn(Capability): def __init__(self, core): super(Syn, self).__init__(core) self.name = "Syn Flood" self.options = { "port" : Option("port", 80, "port to flood", True), "targe...
{ "content_hash": "de521e9d7970f51a949879fdd42bef0a", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 174, "avg_line_length": 45.473684210526315, "alnum_prop": 0.5792824074074074, "repo_name": "ecthros/pina-colada", "id": "a0292c059a7cfde4f9a7f728c05d2d18df2d67fa", "size": ...
"""Represents the ArcGIS online REST APIs""" from . import compat, server __all__ = ['AGORoot', 'Community', 'Content', 'Portals'] class AGORoot(server.RestURL): def __init__(self, url, username=None, password=None, token=None, generate_token=False, expiration=60): url_l...
{ "content_hash": "ddf4eedd82594ad83ce54f016285f93f", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 69, "avg_line_length": 36.53846153846154, "alnum_prop": 0.4789473684210526, "repo_name": "jasonbot/arcrest", "id": "acee3ee119b70828fd38143dc501c895e6e80a42", "size": "1916...
""" Copyright 2013-2014 Rackspace Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software...
{ "content_hash": "d0be16517b7ec4a3bd8307cee3ef9a19", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 72, "avg_line_length": 34.31428571428572, "alnum_prop": 0.7002497918401333, "repo_name": "jidar/ddtest", "id": "e654fbdb9b44b9ef63af29e8f402a8af09b53c44", "size": "1201", ...
from StringIO import StringIO from fabric import api from fabric.contrib.files import exists UPSTART_TEMPLATE = """ description "Temperature, Humidity, Pressure, & Luminosity Reporter" start on runlevel [2345] stop on runlevel [06] respawn respawn limit 10 5 env AWS_ACCESS_KEY_ID={aws_access_key_id} env AWS_SECRET_A...
{ "content_hash": "69137e41067042903c4adb58f543a061", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 104, "avg_line_length": 32.21052631578947, "alnum_prop": 0.6936274509803921, "repo_name": "projectweekend/Pi-DynamoDB-Reporter", "id": "44a759e2f9b4a176757c4846aa3b3a6e993cab...
import unittest from unittest import mock from airflow.providers.amazon.aws.hooks.dms import DmsHook from airflow.providers.amazon.aws.operators.dms_start_task import DmsStartTaskOperator TASK_ARN = 'test_arn' TASK_DATA = { 'replication_task_id': 'task_id', 'source_endpoint_arn': 'source_endpoint', 'targe...
{ "content_hash": "5462ccee8b2d730cb926ab78ce33b22f", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 104, "avg_line_length": 38.18604651162791, "alnum_prop": 0.6930572472594397, "repo_name": "dhuang/incubator-airflow", "id": "8b5533cffe6ddd86827685c53895ecb0300d6490", "siz...
def run(whatweb, pluginname): whatweb.recog_from_header(pluginname, "WT263CDN")
{ "content_hash": "e67789452d57126db6309c0772b98c25", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 53, "avg_line_length": 28.333333333333332, "alnum_prop": 0.7411764705882353, "repo_name": "cflq3/getcms", "id": "855082f4e7bb458831bff9110f513de4526a4aa2", "size": "127", ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import shutil import tempfile import time import unittest from apache_beam.io import filesystems from apache_beam.runners.interactive import cache_manager as cache class FileBasedCacheManagerTest(u...
{ "content_hash": "f4148a6bc3b044bb648c9961bfa1c22c", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 79, "avg_line_length": 39.26, "alnum_prop": 0.7072508065885549, "repo_name": "rangadi/beam", "id": "ff82f3b1b2371078101ec815bfc7e2c1c8c0e9d8", "size": "6674", "binary": ...
def setup(i): """ Input: { cfg - meta of this soft entry self_cfg - meta of module soft ck_kernel - import CK kernel module (to reuse functions) host_os_uoa - host OS UOA host_os_uid - host OS UID ...
{ "content_hash": "041346b19123b95cf969cf540fe93621", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 77, "avg_line_length": 27.064935064935064, "alnum_prop": 0.4731285988483685, "repo_name": "ctuning/ck-env", "id": "3cde2597515f9e91a3e1c4bd296551ddb620efe2", "size": "2418"...
#!/usr/bin/env python # encoding: utf-8 try: from setuptools import setup except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup import sys, os, time, platform, re, subprocess from setuptools import Extension as _Extension, Distribution, Command from pkg_resources im...
{ "content_hash": "23a6d33c92cd1eabc133ed1d2b727855", "timestamp": "", "source": "github", "line_count": 687, "max_line_length": 105, "avg_line_length": 27.653566229985444, "alnum_prop": 0.6491209601010632, "repo_name": "rsms/smisk", "id": "44f243f3e9e1b641e0bf4721d855b50a02277bb6", "size": "18998",...
import numpy as np import theano.tensor as T from pyglm.components.component import Component def create_nlin_component(model): type = model['nonlinearity']['type'].lower() if type == 'exp': nlin = ExpNonlinearity(model) elif type == 'explinear': nlin = ExpLinearNonlinearity(model) el...
{ "content_hash": "8256a46d78bb72d17dd5a8cb3fb6b20a", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 88, "avg_line_length": 32.08510638297872, "alnum_prop": 0.6147214854111406, "repo_name": "slinderman/theano_pyglm", "id": "6c7d243284faa9609d0dff8b9a294e4658158eab", "size"...
from django.core.management.base import BaseCommand, CommandError from javanlp.models import Sentence from javanlp.util import annotate_document import os, stat, csv class Command(BaseCommand): 'Takes documents from [source], sends them through JavaNLP for annotations and then populates the sentences table.' ...
{ "content_hash": "440ee81f1aa7cfaf28664066458883b2", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 138, "avg_line_length": 44.95744680851064, "alnum_prop": 0.6100331282536677, "repo_name": "arunchaganty/presidential-debates", "id": "4f4344625abf5b5e63ddcb91296b6c7578a18303...
"""Base classes for our unit tests. Allows overriding of flags for use of fakes, and some black magic for inline callbacks. """ import functools import os import shutil import uuid import unittest import mox import nose.plugins.skip import nova.image.fake import shutil import stubout from eventlet import greenthrea...
{ "content_hash": "b584e6b46556eb491578495acdf4df0b", "timestamp": "", "source": "github", "line_count": 276, "max_line_length": 79, "avg_line_length": 33.01086956521739, "alnum_prop": 0.5536165075183843, "repo_name": "salv-orlando/MyRepo", "id": "abd1294d4a83488873955552ebec6d0e8158d30e", "size": "...
name = "Example-HTTP-Gauss" execution_strategy = { "ignore_first_n_results": 0, "sample_size": 100, "type": "self_optimizer", "optimizer_method": "gauss", "optimizer_iterations": 20, "optimizer_random_starts": 10, "knobs": { "x": (-4.0, 4.0), "y": (-10.0, 10.0) } } def...
{ "content_hash": "7a679a98e1811ab9dcf2833a1d7ca79b", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 85, "avg_line_length": 21.081632653061224, "alnum_prop": 0.590513068731849, "repo_name": "Starofall/RTX", "id": "467159228a329f9bd6bf19feb8bc16a54a4465f7", "size": "1115", ...
from sqlalchemy import Integer, Column, \ Table, Boolean, MetaData, CheckConstraint from sqlalchemy.sql import column, func from alembic import op from alembic.testing.fixtures import op_fixture from alembic.testing.fixtures import TestBase class AutoNamingConventionTest(TestBase): __requires__ = ('sqlalche...
{ "content_hash": "4cf95870f502da7cc5610fdd42c34701", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 80, "avg_line_length": 33.87898089171974, "alnum_prop": 0.5416431660086483, "repo_name": "ImaginationForPeople/alembic", "id": "fd70faafcf2726261ce10da432525da8f6b4d8af", ...
import doctest from insights.parsr.query import first, last from insights.parsers import httpd_conf from insights.tests import context_wrap HTTPD_CONF_1 = """ ServerRoot "/etc/httpd" <Directory /> Options FollowSymLinks AllowOverride None </Directory> SSLProtocol -ALL +SSLv3 #SSLProtocol all -SSLv2 NSSProto...
{ "content_hash": "b4c477aa51d9f1e5375eb7d90f489816", "timestamp": "", "source": "github", "line_count": 223, "max_line_length": 120, "avg_line_length": 29.73542600896861, "alnum_prop": 0.6905444126074498, "repo_name": "RedHatInsights/insights-core", "id": "0ebf9d441a1b14a32d364396a78b3e03ddc3df40", ...
from cupy import core def argmax(a, axis=None, dtype=None, out=None, keepdims=False): """Returns the indices of the maximum along an axis. Args: a (cupy.ndarray): Array to take argmax. axis (int): Along which axis to find the maximum. ``a`` is flattened by default. dtype: ...
{ "content_hash": "74af91fade20626de7e11909789a77bc", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 79, "avg_line_length": 27.710280373831775, "alnum_prop": 0.5973018549747049, "repo_name": "AlpacaDB/chainer", "id": "89009c1cf20dcb0e6bb46f6c66c68e0e97766ac1", "size": "29...
import os import sys try: import qirest except ImportError: # A ReadTheDocs build does not install qirest. In that case, # load the module directly. src_dir = os.path.join(os.path.dirname(__file__), '..') sys.path.append(src_dir) import qirest extensions = ['sphinx.ext.autodoc', 'sphinx.ext.int...
{ "content_hash": "b27d1b7dc7ba5a83795a5b7379829608", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 97, "avg_line_length": 29.785714285714285, "alnum_prop": 0.7002398081534772, "repo_name": "ohsu-qin/qiprofile-rest", "id": "2d284b61c2297447e51196a88109fd1bc4b4cf7d", "size...
"""Selected UniProt data saved in Python.""" # Copyright (C) 2014-2019 DV Klopfenstein. All rights reserved # # ADAPTED TO PYTHON from the UniProt file: # ftp://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/complete DOWNLOADED = "2019_03_07" # UniProt source files were downloaded on this date # ...
{ "content_hash": "b5c70c8dc0a626c708d04021e17a1152", "timestamp": "", "source": "github", "line_count": 5934, "max_line_length": 166, "avg_line_length": 76.79305695989214, "alnum_prop": 0.7511268625600738, "repo_name": "dvklopfenstein/biocode", "id": "573f7adaf0395336258239b933b2fc5cab21ae45", "siz...
"""Tools for creating tests of implementations of the Face layer.""" import abc # face_interfaces and interfaces are referenced in specification in this module. from grpc.framework.face import interfaces as face_interfaces # pylint: disable=unused-import from tests.unit.framework.face.testing import interfaces # py...
{ "content_hash": "8744f9e74947dac2156d213280374219", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 94, "avg_line_length": 37.254901960784316, "alnum_prop": 0.7315789473684211, "repo_name": "maxwell-demon/grpc", "id": "23d4d919c2377ca7e3558a15368445f765445082", "size": "3...
import logging from qcodes import VisaInstrument from qcodes import validators as vals from time import time, sleep import visa import types import logging import numpy import struct class OxfordInstruments_IPS120(VisaInstrument): """This is the python driver for the Oxford Instruments IPS 120 Magnet Power Suppl...
{ "content_hash": "79a5b1e81911bd9433a79e0c3b7b69bc", "timestamp": "", "source": "github", "line_count": 1073, "max_line_length": 106, "avg_line_length": 29.295433364398882, "alnum_prop": 0.49869567983711904, "repo_name": "takafumifujita/qcodes-driver-test-TF", "id": "f40f8f1764ec974ec19f567edb3f73b42...
__author__ = "Naveen Purushotham" __copyright__ = "Copyright 2016, Xilinx" __email__ = "pynq_support@xilinx.com" import time import struct from pynq import MMIO from pynq.iop import request_iop from pynq.iop import iop_const from pynq.iop import PMODA from pynq.iop import PMODB from pynq.iop import ARDUI...
{ "content_hash": "027adf108d0fb1005496d44b04463d70", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 78, "avg_line_length": 35.72052401746725, "alnum_prop": 0.5491442542787286, "repo_name": "VectorBlox/PYNQ", "id": "7c01a6d3273ea6417943487ca44daddbc216a2d8", "size": "9800...
""" Delaney dataset loader. """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals import os import deepchem def load_delaney(featurizer='ECFP', split='index', reload=True): """Load delaney datasets.""" # Featurize Delaney dataset print("About to featu...
{ "content_hash": "bf957113bbb1593e690ff78bbf03d2a4", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 95, "avg_line_length": 31.77777777777778, "alnum_prop": 0.6844405594405595, "repo_name": "rbharath/deepchem", "id": "707590c82160035a52df3f6ae613da3704bacbeb", "size": "228...
"""Tests for Keras callbacks.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import shutil import tempfile import numpy as np from tensorflow.core.framework import summary_pb2 from tensorflow.python import keras from tensorflow.python.framew...
{ "content_hash": "113fe72f25bd4446ab2727750db5a2f7", "timestamp": "", "source": "github", "line_count": 554, "max_line_length": 78, "avg_line_length": 32.27617328519855, "alnum_prop": 0.6051115709412225, "repo_name": "DavidNorman/tensorflow", "id": "7df695a1a5797be44700dfa02f5e116cd4d98654", "size"...
"""Gin configurable optimizer definitions. """ from typing import Any, Optional from absl import logging from flax import optim from flax import struct import gin import jax.numpy as jnp import numpy as np OptimizerDef = Any @struct.dataclass class OptimizerConfig: """Base class for optimizer configurations."""...
{ "content_hash": "6e96fdc3cef21010ef9b3c16e9588be5", "timestamp": "", "source": "github", "line_count": 267, "max_line_length": 78, "avg_line_length": 33.7940074906367, "alnum_prop": 0.654549484650338, "repo_name": "google-research/meliad", "id": "72ba0869fd61287792d63c66c1f56f13a9f50ceb", "size": ...