text
stringlengths
4
1.02M
meta
dict
'''------------------------------------------------------------------------- Copyright IBM Corp. 2015, 2015 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 http://www.apache.org/...
{ "content_hash": "fcfe90176b6820bb418b1c585f977712", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 76, "avg_line_length": 40.96969696969697, "alnum_prop": 0.6257396449704142, "repo_name": "os-cloud-storage/openstack-workload-disaster-recovery-client", "id": "51f96f24ba4e88...
from steerclear import app from steerclear.forms import RideForm from steerclear.models import * import unittest, flask """ RideFormTestCase ---------------- Test class for the RideForm class """ class RideFormTestCase(unittest.TestCase): """ submit_form ----------- helper method to submit a RideForm ...
{ "content_hash": "6cc134a88b328ffc93cb2fa92ea121dd", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 56, "avg_line_length": 29.8, "alnum_prop": 0.587248322147651, "repo_name": "beblount/Steer-Clear-Backend", "id": "ec7dab13922808da2a084ae8ee7a3047406c31dd", "size": "3278"...
from rockstar import RockStar pascal_code = """program HelloWorld; begin writeln('Hello World'); end.""" rock_it_bro = RockStar(days=400, file_name='helloworld.pas', code=pascal_code) rock_it_bro.make_me_a_rockstar()
{ "content_hash": "2019c3057801437a0c48cf26ece2ee58", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 78, "avg_line_length": 22.5, "alnum_prop": 0.7155555555555555, "repo_name": "RobertWang/rockstar", "id": "eab133691567f5b802f5a4379cf6afce8671d5a7", "size": "225", "binar...
import configparser import os from logging import getLogger import emoji from .utils import markup_inline_keyboard logger = getLogger(__name__) def load_user_config(): config = configparser.ConfigParser() try: config.read('config.ini') or config.read(os.environ['CONFIG_FILE']) except KeyError:...
{ "content_hash": "0efb02af4c89fd392a4be2ca1e6a5741", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 117, "avg_line_length": 47.375, "alnum_prop": 0.6441436273947458, "repo_name": "akita8/helper_bot", "id": "be566fd3df0bb9aa36dd0f75501303226678a359", "size": "8723", "bi...
from telemetry import decorators from telemetry.testing import legacy_page_test_case from measurements import skpicture_printer class SkpicturePrinterUnitTest(legacy_page_test_case.LegacyPageTestCase): # Picture printing is not supported on all platforms. @decorators.Disabled('android', 'chromeos') def testSkp...
{ "content_hash": "42e3ba0c57a6fcf8e01357b53e744f82", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 75, "avg_line_length": 43.86666666666667, "alnum_prop": 0.7781155015197568, "repo_name": "nwjs/chromium.src", "id": "dd5742152e7704720902d6082ca78ff2b2f24ae4", "size": "799...
'''Generates certificate chains for testing name normalization.''' import os import subprocess import sys sys.path.append(os.path.join('..', '..', '..', 'tools', 'testserver')) import minica def pretty_print_cert(der): command = ["openssl", "x509", "-text", "-inform", "DER"] p = subprocess.Popen(command, ...
{ "content_hash": "7a8473a9fed3628574fe42154b1700dc", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 80, "avg_line_length": 36.03225806451613, "alnum_prop": 0.5816174276335422, "repo_name": "endlessm/chromium-browser", "id": "06429c1f0b039c7d9e73be4c9d21a14c6ccccbdd", "siz...
"""Interface tests.""" import logging import unittest from unittest.mock import Mock from pyof.v0x04.common.port import PortFeatures from kytos.core.interface import Interface from kytos.core.switch import Switch logging.basicConfig(level=logging.CRITICAL) class TestInterface(unittest.TestCase): """Test Interf...
{ "content_hash": "35be838ff020e5a653b7eee42c08fb1a", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 77, "avg_line_length": 37.598130841121495, "alnum_prop": 0.6273924931643052, "repo_name": "macartur/kytos", "id": "4db2eb4df185e6a0024cfa29916e15e5c50649d3", "size": "4023...
import datetime import math import time import requests def main(): t0 = datetime.datetime.now() compute_some() compute_some() compute_some() download_some() download_some() download_some_more() download_some_more() wait_some() wait_some() wait_some() wait_some() ...
{ "content_hash": "188c1c9dc98a18f6c687f1c462d46661", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 99, "avg_line_length": 20.852459016393443, "alnum_prop": 0.6155660377358491, "repo_name": "Wintellect/WintellectWebinars", "id": "2b14dd1f0509c487a54ebb65a9d1cde4e89d1077", ...
import os from os import PathLike from typing import Union, Dict, Optional import torch from torch.cuda import amp from torch.testing import assert_allclose import pytest from allennlp.common.testing import AllenNlpTestCase, run_distributed_test, requires_multi_gpu from allennlp.nn.util import load_state_dict_distrib...
{ "content_hash": "9bb4ef4caefbe776a1ea84795e65a328", "timestamp": "", "source": "github", "line_count": 234, "max_line_length": 108, "avg_line_length": 36.02991452991453, "alnum_prop": 0.6283952081603605, "repo_name": "allenai/allennlp", "id": "1a63f464d6393d5f3901ca9e499eb0c318161794", "size": "84...
from CGATReport.Tracker import TrackerSQL class ProjectTracker(TrackerSQL): '''Define convenience tracks for plots''' class WordFrequencies(ProjectTracker): pattern = "(.*)_counts" def __call__(self, track): return self.getValues("SELECT freq FROM %(track)s_counts")
{ "content_hash": "51789da99b7b588e2e0f7d24a13cddcc", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 66, "avg_line_length": 24.333333333333332, "alnum_prop": 0.702054794520548, "repo_name": "CGATOxford/CGATPipelines", "id": "9db302d874908fa81273d8159fad7297bf2213f8", "size...
from oslo_config import cfg from congress.api.system import driver_model from congress.api import webservice from congress import harness from congress.managers import datasource as datasource_manager from congress.tests import base from congress.tests import helper class TestDriverModel(base.SqlTestCase): def s...
{ "content_hash": "3c44f56e77d9d99edefdf01102f660be", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 73, "avg_line_length": 35.88095238095238, "alnum_prop": 0.5321831453218314, "repo_name": "ekcs/congress", "id": "d83888c424eaad2db625bc9e55d4655e996fd6da", "size": "3604", ...
import os import shutil import tempfile import numpy as np from vtk.numpy_interface import dataset_adapter as dsa # VTK imports: from vtk.util import numpy_support as nps from base import TestBase # Functionality to test: from PVGeo.readers import ( DelimitedTextReader, MadagascarReader, PackedBinariesR...
{ "content_hash": "d7cf69d00eec08428541663c18dc2ca2", "timestamp": "", "source": "github", "line_count": 391, "max_line_length": 83, "avg_line_length": 32.59079283887468, "alnum_prop": 0.5436710350780821, "repo_name": "banesullivan/ParaViewGeophysics", "id": "ce3625c561b9cacfd0bbfc53a3ab9b64fee29974",...
import socket import struct __all__ = [ "is_private_subnet", "is_public_subnet", "is_valid_ip_address", "join_ipv4_segments", "increment_ipv4_segments", ] def is_private_subnet(ip): """ Utility function to check if an IP address is inside a private subnet. :type ip: ``str`` :para...
{ "content_hash": "d7b32c7b3c8affd7e44fb6890c40aa98", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 75, "avg_line_length": 23.803571428571427, "alnum_prop": 0.5843960990247562, "repo_name": "mistio/libcloud", "id": "60d4572143da5b2acef7b6ef61d60c9d5771dcca", "size": "344...
__author__ = 'Jan Pecinovsky' import pandas as pd """ A Device is an entity that can contain multiple sensors. The generic Device class can be inherited by a specific device class, eg. Fluksometer """ class Device(object): def __init__(self, key=None, site=None): self.key = key self.site = site ...
{ "content_hash": "6ddff9eb5e211d75fd56aea95b89e4d7", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 119, "avg_line_length": 28.816326530612244, "alnum_prop": 0.5576015108593012, "repo_name": "WolfBerwouts/opengrid", "id": "a074b63d4512ea333a82c93b40e79581188091a6", "size...
""" Module for testing the Reader class. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import pytest from surprise import Reader def test_params(): """Test Reader parameters""" with pytest.raises(ValueError): Reader(name='wrong_nam...
{ "content_hash": "720f9f2d64b2843c282f7cd43f1aeed8", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 66, "avg_line_length": 25.858823529411765, "alnum_prop": 0.6287534121929026, "repo_name": "charmoniumQ/Surprise", "id": "8ea8d16ab8cd6216f7cb6a0d2281b924c8f0ec12", "size": ...
from setuptools import find_packages, setup setup( name='rnnmorph', packages=find_packages(), version='0.4.1', description='RNNMorph: neural network disambiguation of pymorphy2 parses for precise ' 'POS-tagging in Russian language.', author='Ilya Gusev', author_email='phoenixily...
{ "content_hash": "5f527db26908d070e4017c1cafe8403a", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 90, "avg_line_length": 31.044444444444444, "alnum_prop": 0.5647816750178954, "repo_name": "IlyaGusev/rnnmorph", "id": "ef5938e0b51f6f1d2435f04934510f26c2c5fd12", "size": "1...
import argparse import datetime import logging import os import sys from multiprocessing.pool import ThreadPool import devil_chromium from devil.android import device_denylist from devil.android import device_errors from devil.android import device_utils from devil.utils import run_tests_helper from pylib import con...
{ "content_hash": "057b07aa4cc1f1f8b775a8ba6a598d4e", "timestamp": "", "source": "github", "line_count": 269, "max_line_length": 80, "avg_line_length": 32.86617100371747, "alnum_prop": 0.6530935414545865, "repo_name": "scheib/chromium", "id": "ae478bf689754821a14cbfa9cdd29e29425130cd", "size": "9186...
from django.http import HttpResponse from django.template import Context, loader from django.db import models from django.shortcuts import (render, get_object_or_404, redirect,) from spmurray_app.models import Post, User from django.views.decorators.cache impo...
{ "content_hash": "35b04b8ca94b1f22ee6ca25f371a9d6e", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 76, "avg_line_length": 26.30821917808219, "alnum_prop": 0.6183285602707628, "repo_name": "hijonathan/spmurraydev.com", "id": "2c2603432e924ad870f654c91c64c160cacf4c87", "s...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "whturk.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "4725c777b23f6d9d529b17c6ad2aac29", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 70, "avg_line_length": 25.22222222222222, "alnum_prop": 0.7092511013215859, "repo_name": "paftree/WHturk", "id": "87675954c0b628bce2549e1e83218ecf32d486fd", "size": "249", ...
import logging import optparse import os import re import shutil import subprocess import sys import tempfile from kudu_util import check_output, init_logging JAVA_ACC_GIT_URL = "https://github.com/lvc/japi-compliance-checker.git" # The annotations for what we consider our public API. PUBLIC_ANNOTATIONS = ["Interfac...
{ "content_hash": "6e4b4f3e982b0dc29f7a85b62f6d1fe6", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 93, "avg_line_length": 33.78606965174129, "alnum_prop": 0.6050655279045796, "repo_name": "EvilMcJerkface/kudu", "id": "61d56613bf8bbfff33af6a54043222ccc1ccb613", "size": "...
from abc import ABC from typing import TYPE_CHECKING from ._configuration import AnomalyDetectorClientConfiguration if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core import AsyncPipelineClient from .._serialization import Deserializer, Serializer class AnomalyDetectorC...
{ "content_hash": "3a420fe98cfa390836fc4a8f4626c7ad", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 68, "avg_line_length": 29.210526315789473, "alnum_prop": 0.7711711711711712, "repo_name": "Azure/azure-sdk-for-python", "id": "4225c867c0db4eb32b523573b8d1bdd52ea19ba1", "s...
from test_framework import BitcoinTestFramework from halobitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException from util import * from binascii import a2b_hex, b2a_hex from hashlib import sha256 from struct import pack def check_array_result(object_array, to_match, expected): """ Pass in array of JS...
{ "content_hash": "d4e2701eaee61197f91f3cd4274bdd33", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 237, "avg_line_length": 34.3954802259887, "alnum_prop": 0.5855781865965834, "repo_name": "HaloExchange/HaloBitcoin", "id": "0e9f671119b06a81fd95eab96aa16499b9074a2c", "siz...
from msrest.serialization import Model from msrest.exceptions import HttpOperationError class ErrorResponse(Model): """Error reponse indicates Relay service is not able to process the incoming request. The reason is provided in the error message. :param code: Error code. :type code: str :param me...
{ "content_hash": "1b277f9850f0ff1dc338f2a0c2569ace", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 99, "avg_line_length": 30.147058823529413, "alnum_prop": 0.6702439024390244, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "33d628db5418552676b0981b540d9e017400af53",...
""" Copyright 2012 Ali Ok (aliokATapacheDOTorg) 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 wr...
{ "content_hash": "61820bf788137577156527ee8c79e2b5", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 124, "avg_line_length": 34.87162162162162, "alnum_prop": 0.6138345281922108, "repo_name": "aliok/trnltk", "id": "8250c65ee266ab643415dd2d530ccbe25b4dd2b2", "size": "5161",...
import time from seesaw.item import Item def install_stdout_extension(control): ''' Each item has a log output, and we want to be able to broadcast that in the ArchiveBot Dashboard. This extension overrides an item's logger to shove a log message into ArchiveBot's Redis instance for broadcast. '...
{ "content_hash": "9474fdbe741a7bf5c8f146ac8ed29e2a", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 75, "avg_line_length": 27.37837837837838, "alnum_prop": 0.5715695952615992, "repo_name": "Frogging101/ArchiveBot", "id": "b6576dc873b9caec0ae2add3f8db1818eda46eda", "size":...
import threading from SmartMeshSDK import ApiException class IpMgrSubscribe(object): ''' \brief Notification listener for IpMgrConnectorMux object ''' class SubscribeError(Exception) : def __init__(self, msg) : self.msg = msg def __str__(self): ...
{ "content_hash": "388abc12702d4197d4b7f93aeb5f0956", "timestamp": "", "source": "github", "line_count": 217, "max_line_length": 100, "avg_line_length": 43.32258064516129, "alnum_prop": 0.5480268056589724, "repo_name": "dustcloud/dustlink", "id": "d888250155bcbe6d67fbe3b42d6f8b363d0a0f6a", "size": "...
from runner.koan import * def my_global_function(a,b): return a + b class AboutMethods(Koan): def test_calling_a_global_function(self): self.assertEqual(5, my_global_function(2,3)) # NOTE: Wrong number of arguments is not a SYNTAX error, but a # runtime error. def test_calling_functions_w...
{ "content_hash": "8baf6d36de0008a9ab374b07da135436", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 91, "avg_line_length": 34.22012578616352, "alnum_prop": 0.5611100900569749, "repo_name": "taw/python_koans", "id": "778f93489dd91aa0f618fdb194c29d0ff26f3e2e", "size": "554...
from __future__ import absolute_import import weakref from defcon.objects.base import BaseDictCompareObject from defcon.objects.color import Color from defcon.tools.identifiers import makeRandomIdentifier class Anchor(BaseDictCompareObject): """ This object represents an anchor point. **This object post...
{ "content_hash": "640ff70513fb107771fa0871ba762041", "timestamp": "", "source": "github", "line_count": 243, "max_line_length": 271, "avg_line_length": 31.522633744855966, "alnum_prop": 0.5955613577023499, "repo_name": "moyogo/defcon", "id": "d37accd2a33c71bb83bb3ae0eb01dd8192e82a38", "size": "7660...
from .VectorDifferenceQuantity import VectorDifferenceQuantity from ..kinvarbuilder import CachingFunction, IllegalArgumentTypes @CachingFunction class MeanEta(VectorDifferenceQuantity): """ average pseudorapidity of two or more vectors, as a generalization of the mean pseudorapidity proposed by Zeppenfeld et....
{ "content_hash": "fb75d02a90f534f3f81da2267cee5642", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 82, "avg_line_length": 32.13157894736842, "alnum_prop": 0.5749385749385749, "repo_name": "kinvarbuilder/kinvarbuilder", "id": "c96a3336d40c596f18f3f17ad5a0096c4a0e3fd2", "s...
from azure.identity import DefaultAzureCredential from azure.mgmt.cdn import CdnManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-cdn # USAGE python log_analytics_get_log_analytics_resources.py Before run the sample, please set the values of the client ID, tenant I...
{ "content_hash": "a753057e782c30f9ed6ba21cf417c093", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 140, "avg_line_length": 32.81818181818182, "alnum_prop": 0.7285318559556787, "repo_name": "Azure/azure-sdk-for-python", "id": "c71e49b2be1718eeefb3f5e7e26a6f13de25e43b", "s...
import yaml from models import Session from interface import Artifice default_config = "/etc/artifice/config.yaml" def connect(config=None): if config is None: try: fh = open(default_config) except IOError: print "Can't open default config!" raise config...
{ "content_hash": "1106a9be502dce930b56fabd6ccda33e", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 95, "avg_line_length": 33.65384615384615, "alnum_prop": 0.592, "repo_name": "aurynn/openstack-artifice", "id": "f937fd2b10377d51a1ab3a0d563593d04e57d16d", "size": "875", ...
from decimal import Decimal from .choices import WirelessChannelChoices __all__ = ( 'get_channel_attr', ) def get_channel_attr(channel, attr): """ Return the specified attribute of a given WirelessChannelChoices value. """ if channel not in WirelessChannelChoices.values(): raise ValueErr...
{ "content_hash": "101a6cec63082fb5a117987971543f93", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 75, "avg_line_length": 25.962962962962962, "alnum_prop": 0.6433666191155493, "repo_name": "digitalocean/netbox", "id": "d98d6a853a0a1921b433a5152172f74154a88bd3", "size": "...
import nltk from nltk.corpus import stopwords class NounPhraseExtractor: def __init__(self): self.lemmatizer = nltk.WordNetLemmatizer() self.grammar = grammar = r""" NOUN: {<VBG|NN.*|JJ|>*<NN.*>} # Nouns and Adjectives, terminated with Nouns ENTITY: {<VBG|NN|NE.*|JJ|>*<NE...
{ "content_hash": "702058b9ce30960ced655f3681a92eef", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 125, "avg_line_length": 37.469565217391306, "alnum_prop": 0.599443026224182, "repo_name": "ipachev/irc_chatbot", "id": "4cd21c075e386cbf712b8eae44fefa64b49fe742", "size": ...
""" ================================== Regularized OT with generic solver ================================== Illustrates the use of the generic solver for regularized OT with user-designed regularization term. It uses Conditional gradient as in [6] and generalized Conditional Gradient as proposed in [5][7]. [5] N. C...
{ "content_hash": "8b421783fcaa58c9db3ffd9d06efe66c", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 78, "avg_line_length": 22.7890625, "alnum_prop": 0.5282824820020569, "repo_name": "rflamary/POT", "id": "2c58defb4d32e0bdd46816aa476bcc67555fe0c9", "size": "2942", "bina...
'''Chemical Engineering Design Library (ChEDL). Utilities for process modeling. Copyright (C) 2019, 2020 Caleb Bell <Caleb.Andrew.Bell@gmail.com> 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 wi...
{ "content_hash": "c858a16bee229fc40763c499fc6dc925", "timestamp": "", "source": "github", "line_count": 508, "max_line_length": 119, "avg_line_length": 33.846456692913385, "alnum_prop": 0.5711294637664301, "repo_name": "CalebBell/thermo", "id": "51415004ae2ff9154484e8b389f51ebe9ecbd54a", "size": "1...
import collections from supriya import CalculationRate from supriya.ugens.DUGen import DUGen class Dswitch(DUGen): """ A demand-rate generator for embedding different inputs. :: >>> index = supriya.ugens.Dseq(sequence=[0, 1, 2, 1, 0]) >>> sequence = (1., 2., 3.) >>> dswitch = su...
{ "content_hash": "93d28fdb6d571a01684ff7b0f4490c73", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 64, "avg_line_length": 22.21875, "alnum_prop": 0.5668073136427567, "repo_name": "Pulgama/supriya", "id": "ebf49ee7be1c91c9c2fbf36cb767c4fb50588265", "size": "711", "binar...
''' Copyright 2013 Cosnita Radu Viorel 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, publish, distribute...
{ "content_hash": "e9b287eaa6fccb601bc7ceb98d247431", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 126, "avg_line_length": 47.42857142857143, "alnum_prop": 0.7607573149741824, "repo_name": "rcosnita/fantastico", "id": "845e0081310dde057800aeed4eb4a3ae0ae61517", "size": "...
from __future__ import unicode_literals import frappe def get_notification_config(): return { "for_doctype": { "Error Log": {"seen": 0}, "Communication": {"status": "Open", "communication_type": "Communication"}, "ToDo": "frappe.core.notifications.get_things_todo", "Event": "frappe.core.notifications.ge...
{ "content_hash": "86a81a9f8956ab9d0a646ff1c77b0974", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 78, "avg_line_length": 31.5, "alnum_prop": 0.6699346405228758, "repo_name": "RicardoJohann/frappe", "id": "619231e5cdd9b5b7486f7dba0b6f70f8cf164c18", "size": "2243", "bin...
""" Unit tests for :mod:`behave.api.async_test` for Python 3.5 (or newer). """ # -- IMPORTS: from __future__ import absolute_import, print_function import sys from behave._stepimport import use_step_import_modules from behave.runner import Context, Runner import pytest from .testing_support import StopWatch, SimpleSt...
{ "content_hash": "9447e5563d95c736264df282f9085551", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 87, "avg_line_length": 41.465753424657535, "alnum_prop": 0.5744962008589363, "repo_name": "jenisys/behave", "id": "f4068db22eb9f6c74d672a26a81162b1b8f96bcc", "size": "6078...
from unittest import mock from heat.engine.clients.os import monasca as client_plugin from heat.engine.resources.openstack.monasca import alarm_definition from heat.engine import stack from heat.engine import template from heat.tests import common from heat.tests import utils sample_template = { 'heat_template_v...
{ "content_hash": "e2192b321b88fc8f56ac2fdc1e881036", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 79, "avg_line_length": 38.67027027027027, "alnum_prop": 0.6133631534805704, "repo_name": "openstack/heat", "id": "8dba8d04defe36d7d9e2e719adde1946bb4e4402", "size": "7729"...
from setuptools import setup setup(name='widendeep', packages=['widendeep'], version='0.1', description='TensorFlow Wide and Deep example', url='https://github.com/amygdala/tensorflow-workshop', author='Yufeng Guo', author_email='yfg@google.com', license='MIT', install_r...
{ "content_hash": "4287ce481d42f5508f45aa8a860ed2a0", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 60, "avg_line_length": 31.166666666666668, "alnum_prop": 0.6417112299465241, "repo_name": "Resly/pipeline", "id": "77e652f97168646f68a1c85c3d40c4d899ad2139", "size": "374",...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "rms.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "7820e3db1b877fea072c4af2c8f77ad3", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 67, "avg_line_length": 24.88888888888889, "alnum_prop": 0.7053571428571429, "repo_name": "Ashaba/rms", "id": "aa80ec4730786c72dc1535a427a250bd0819101d", "size": "246", "bi...
import os from viper.common.out import * from viper.core.project import __project__ def store_sample(file_object): sha256 = file_object.sha256 if not sha256: print_error("No hash") return None folder = os.path.join(__project__.get_path(), 'binaries', sha256[0], sha256[1], sha256[2], ...
{ "content_hash": "034af3e86ac9ff487c34922eb15c6180", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 111, "avg_line_length": 28.060606060606062, "alnum_prop": 0.6187904967602592, "repo_name": "rommelfs/viper", "id": "1978567059b4f5fade23a3e1b47501889d7bb8d4", "size": "1042...
"""Generic Node base class for all workers that run on hosts.""" import errno import os import random import signal import sys import time import eventlet import logging as std_logging from oslo.config import cfg from cinder.openstack.common import eventlet_backdoor from cinder.openstack.common.gettextutils import _...
{ "content_hash": "c3e44a0ccacdd487bca61496bf8593ba", "timestamp": "", "source": "github", "line_count": 314, "max_line_length": 77, "avg_line_length": 30.038216560509554, "alnum_prop": 0.5838634435962681, "repo_name": "cloudbau/cinder", "id": "7cbd3690a64002b523c8f6f43b3acfa454d96aef", "size": "102...
""" Views which allow subscribers to create and activate accounts. """ from django.shortcuts import redirect from django.views.generic.base import TemplateView from django.views.generic.edit import FormView from mailinglist_registration.models import Subscriber from mailinglist_registration.forms import Registration...
{ "content_hash": "6f95a7040a14170ecd5b87e9e0908bd7", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 79, "avg_line_length": 35.11486486486486, "alnum_prop": 0.6492207042524534, "repo_name": "remarkablerocket/django-mailinglist-registration", "id": "73c2b584fabe805f2f5850636...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('events', '0020_auto_20170112_1440'), ] operations = [ migrations.AddField( model_name='staggeredstartrace', name='algorithm'...
{ "content_hash": "c2532f86e635ef4cb98c239c34a8a582", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 145, "avg_line_length": 26.944444444444443, "alnum_prop": 0.5958762886597938, "repo_name": "abecede753/trax", "id": "e602d85a74f5981a0bb4f231e14174ef553042a9", "size": "558...
import numpy as np import math from scipy import signal from openpyxl import Workbook from openpyxl import load_workbook #from openpyxl.compat import range import openpyxl.compat import matplotlib matplotlib.use('TkAgg') from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg from mat...
{ "content_hash": "6f7e20231608a8c0212ad599a6b97718", "timestamp": "", "source": "github", "line_count": 501, "max_line_length": 229, "avg_line_length": 33.70459081836327, "alnum_prop": 0.5775790595759801, "repo_name": "goddoe/GraphTool", "id": "1afe2b9f1dfb70abca73e0156f00b1b1df4bd9f6", "size": "16...
import requests from flask import Flask, request app = Flask(__name__) @app.route("/taint_test") # $ routeSetup="/taint_test" def test_taint(): # $ requestHandler url = request.args['untrusted_input'] # response from a request to a user-controlled URL should be considered # user-controlled as well. ...
{ "content_hash": "44afdfd63e1685059d36e1d890ed523c", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 84, "avg_line_length": 30.527272727272727, "alnum_prop": 0.6188207266229899, "repo_name": "github/codeql", "id": "48ff417baa737fd7a8f5ab5d1cb79581d318ef95", "size": "1679",...
"""The Categorical distribution class.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.contrib.distributions.python.ops import distribution from tensorflow.contrib.distributions.python.ops import distribution_util from tensorflow.python.f...
{ "content_hash": "16817df840f6dbda16cfdf7dfdc746de", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 80, "avg_line_length": 34.95673076923077, "alnum_prop": 0.6428276715719984, "repo_name": "juharris/tensorflow", "id": "9fa013db3625d4d52968edd268eeb2a9b9d5d8a2", "size": "...
''' Test Attach/Detach Port Forwarding @author: czhou25 ''' import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.test_state as test_state import zstackwoodpecker.zstack_test.zstack_test_port_forwarding as zstack_pf_header import apibinding.inventory as in...
{ "content_hash": "9fc82941994388c5f14fe797d398dae6", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 180, "avg_line_length": 31.22772277227723, "alnum_prop": 0.6873811033608117, "repo_name": "zstackio/zstack-woodpecker", "id": "51cedfcbc9ad5f3bd8161bf1367510e08f5d2d56", "...
import unittest from .fixtures import ops, operations, getOperationNameForId, getOperationName class Testcases(unittest.TestCase): def test_ops(self): self.assertIsInstance(ops, list) def test_operations(self): for op, id in operations.items(): self.assertIsInstance(op, str) ...
{ "content_hash": "4f72a8e4850559289e4989137c05608b", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 79, "avg_line_length": 36.041666666666664, "alnum_prop": 0.6947976878612717, "repo_name": "xeroc/python-graphenelib", "id": "83d42d57bb3fc50e82bdc7972a791c24fe1dde83", "siz...
''' Copyright (c) 2013, Agora Games, LLC All rights reserved. https://github.com/agoragames/torus/blob/master/LICENSE.txt ''' from urlparse import * import re from redis import Redis from pymongo import MongoClient from kairos import Timeseries from sqlalchemy import create_engine import cql import time def long_or...
{ "content_hash": "681ec1e51d6801c15f1a90d948f601d0", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 75, "avg_line_length": 27.857142857142858, "alnum_prop": 0.6518853695324284, "repo_name": "agoragames/torus", "id": "14a2fd403fdf930a9e7ad7c073212a2478390f80", "size": "33...
import re from grab.spider import Spider, Task from d_parser.helpers.cookies_init import cookies_init from d_parser.helpers.parser_extender import check_body_errors, process_error, common_init, extend_class, check_errors, process_finally from helpers.config import Config from helpers.url_generator import UrlGenerator...
{ "content_hash": "9f2896450a66d8ca1f2aacf0285a420f", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 159, "avg_line_length": 34.9766081871345, "alnum_prop": 0.5392074903862231, "repo_name": "Holovin/D_GrabDemo", "id": "a46b0c9c4f1e23c76cbd9f086437c10b03e63fb5", "size": "6...
from typing import Tuple, Union import numpy as np import scipy.stats from emukit.core.acquisition import Acquisition from emukit.core.interfaces import IDifferentiable, IModel class ManualCausalExpectedImprovement(Acquisition): def __init__( self, current_global_min, task, mean_function, variance_functio...
{ "content_hash": "e65951eae3cbb4296edb0399ea3a1a9b", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 118, "avg_line_length": 37, "alnum_prop": 0.634984984984985, "repo_name": "neildhir/DCBO", "id": "4bb2465ba57b5e9b2d05afd436b31296512953bd", "size": "6660", "binary": fa...
import os, sys apache_configuration = os.path.dirname(__file__) project = os.path.dirname(apache_configuration) workspace = os.path.dirname(project) sys.path.append(workspace) sys.path.append('/usr/lib/python2.4/site-packages/django') os.environ['DJANGO_SETTINGS_MODULE'] = 'lcr.settings' import django.core.handlers....
{ "content_hash": "6df3374a46ac9b831af80bf28ac7c08f", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 58, "avg_line_length": 31.5, "alnum_prop": 0.7777777777777778, "repo_name": "tmpkn/lcr", "id": "05bc9f6633665c0e28d93ab0d15ab0d21ec9fc03", "size": "378", "binary": false,...
''' description: Download KNMI radar hdf5 files (inside a tar archive) from ftp license: APACHE 2.0 author: Ronald van Haren, NLeSC (r.vanharen@esciencecenter.nl) ''' from ftplib import FTP import os import datetime import tarfile class download_radar_data: def __init__(self, dt, outputdir): '...
{ "content_hash": "102797a5a27b494ae0cc59052eeb4adb", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 79, "avg_line_length": 30.03846153846154, "alnum_prop": 0.6254801536491678, "repo_name": "ERA-URBAN/fm128_radar_knmi", "id": "8b7bd2ff8a613d4d01538c6690e691b6a3ad2a41", "s...
from nova.api.openstack.compute import plugins from nova.api.openstack.compute.plugins.v3 import access_ips from nova.api.openstack.compute.plugins.v3 import servers from nova.api.openstack import wsgi from nova.compute import api as compute_api from nova import db from nova import exception from nova.objects import in...
{ "content_hash": "37260e1b416bb31c3a9a2b5ee8140614", "timestamp": "", "source": "github", "line_count": 368, "max_line_length": 79, "avg_line_length": 40.04076086956522, "alnum_prop": 0.5923311842551747, "repo_name": "tianweizhang/nova", "id": "0f78f161832e1f81343f7dc5549a2099fd3db6c4", "size": "15...
import unittest import os import sys from functools import wraps from django.conf import settings from south.hacks import hacks # Add the tests directory so fakeapp is on sys.path test_root = os.path.dirname(__file__) sys.path.append(test_root) # Note: the individual test files are imported below this. class Monkeyp...
{ "content_hash": "f2e6f2cf53c5e368cd3ec8515ed9d78a", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 86, "avg_line_length": 27.858823529411765, "alnum_prop": 0.5929054054054054, "repo_name": "peterbe/airmozilla", "id": "4280bdf9bdd493b0651447179eec3010b1257031", "size": "2...
"""SchoolCMS-schoolcms-group.""" from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from . import BaseHandler from ..db import GroupList, User import re def _to_int(s, default): if not s.isdigit(): return default return int(s) clas...
{ "content_hash": "88fc09506da39635b5a1780c4d39589b", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 91, "avg_line_length": 32.05982905982906, "alnum_prop": 0.5323913623033858, "repo_name": "team6612/School_CMS", "id": "56af778a3436225babdb6cfc93ec5cc260029518", "size": "...
from __future__ import absolute_import from google.cloud.tasks_v2beta3 import types from google.cloud.tasks_v2beta3.gapic import cloud_tasks_client from google.cloud.tasks_v2beta3.gapic import enums class CloudTasksClient(cloud_tasks_client.CloudTasksClient): __doc__ = cloud_tasks_client.CloudTasksClient.__doc__...
{ "content_hash": "baeb8529f0ad13ded15a6fc4b78892f6", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 63, "avg_line_length": 23.823529411764707, "alnum_prop": 0.7283950617283951, "repo_name": "tseaver/gcloud-python", "id": "e83b3b1a3b08ed31d6ae67c22177da5e4dfa20e8", "size":...
from chatschoolette import db from chatschoolette.mod_auth.models import User for user in User.query.all(): print(user) user.is_active = True print('User {} now active.'.format(user.username)) db.session.commit() print('Done')
{ "content_hash": "f1b29084230a5da193b4f9f3445fb4e8", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 54, "avg_line_length": 26.666666666666668, "alnum_prop": 0.7208333333333333, "repo_name": "gorel/chatschoolette", "id": "f69efb77d36ccbf7edddaf2f537cdc8ec87991e9", "size": "...
""" Author: --<v1ll4n> Purpose: Tester For Threadpoolex Created: 05/13/17 """ import unittest import queue import time from threadpoolex import ThreadPoolXLabor, ThreadPoolX, _LaborFactory #---------------------------------------------------------------------- def test_task_error(arg1, arg2=4): """""" ...
{ "content_hash": "38507071ea3b2bfdbf400bdae7398ebc", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 79, "avg_line_length": 25.90277777777778, "alnum_prop": 0.4479892761394102, "repo_name": "VillanCh/g3ar", "id": "dbf9d03f54aa43d03004761dfba31e6786e8190b", "size": "3766",...
import numpy as np import theano from deepgraph.conf import rng __docformat__ = 'restructedtext en' def normal(mu=0, dev=0.01, dtype=theano.config.floatX): """ Return a generating function filling weights with a normal distribution :param mu: Float :param dev: Float :param dtype: np.type :ret...
{ "content_hash": "aa6f1f312420206b9be34a1cd463ac98", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 115, "avg_line_length": 26.553398058252426, "alnum_prop": 0.560146252285192, "repo_name": "sebastian-schlecht/deepgraph", "id": "d1ff83622e8dd1ee849c854a6dff5434f8f15acd", ...
from models import WaitingListUser class WaitingListDB(): def __init__(self, db): self.db = db def get_match(self, gender, interest): waitlist = WaitingListUser.query.all() print("WAITLIST", waitlist, gender, interest) for i in range(len(waitlist)): user = waitlist[...
{ "content_hash": "9bc6b67c60298adb2ef5f11ed5d99f3a", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 73, "avg_line_length": 33.31707317073171, "alnum_prop": 0.5424597364568082, "repo_name": "mayukh18/BlindChat", "id": "83dd6c8a263a055dbeb57c1d71c46fbe88557a91", "size": "13...
from __future__ import absolute_import import os import shutil from contextlib import contextmanager from urlparse import urlparse import boat.paths import boat.webcomic.model as model import boat.webcomic.views as views from boat.cli import manager command = manager.add_command('build', help='build/rebuild static s...
{ "content_hash": "b82e0283a2f5f7f3ca290ea51e24f35c", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 79, "avg_line_length": 31.39622641509434, "alnum_prop": 0.6941105769230769, "repo_name": "rhestilow/boat", "id": "c2547b92036a84dae28a766ecdf236539e0d762c", "size": "1664",...
from django.db import models from django.utils import timezone from django.utils.http import urlquote from django.utils.translation import ugettext_lazy as _ from django.core.mail import send_mail from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin from accounts.managers import ExpensiUserManager...
{ "content_hash": "6522653c7c60e19db5b23d66c5eb2f92", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 112, "avg_line_length": 36.285714285714285, "alnum_prop": 0.6737204724409449, "repo_name": "lacion/expensi", "id": "cd1798677912daccb3e82a5a91d6505540e8a3cb", "size": "2032...
"""SCons.Tool.Packaging.rpm The rpm packager. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation # # 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 Softwa...
{ "content_hash": "db8dbfd417f69adafb0e1f7b4d8138f3", "timestamp": "", "source": "github", "line_count": 362, "max_line_length": 125, "avg_line_length": 37.30386740331492, "alnum_prop": 0.585678317535545, "repo_name": "kuiche/chromium", "id": "d13ddc4357fff0f70527bff994b990d7734a307b", "size": "1350...
import re import click def test_other_command_invoke(runner): @click.command() @click.pass_context def cli(ctx): return ctx.invoke(other_cmd, arg=42) @click.command() @click.argument('arg', type=click.INT) def other_cmd(arg): click.echo(arg) result = runner.invoke(cli, []...
{ "content_hash": "8e15e63076f09b40ad336d09b8f68488", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 76, "avg_line_length": 27.537549407114625, "alnum_prop": 0.582603703172097, "repo_name": "evaautomation/libdispatch", "id": "7c8b453d69b516be723fd0e2b922ae1b0c12aba4", "si...
""" Implements a simple, robust, safe, Messenger class that allows one to register callbacks for a signal/slot (or event/handler) kind of messaging system. One can basically register a callback function/method to be called when an object sends a particular event. The Messenger class is Borg. So it is easy to instanti...
{ "content_hash": "8318dbe2f8dc33d433a4dc8adae0c6a2", "timestamp": "", "source": "github", "line_count": 312, "max_line_length": 80, "avg_line_length": 32.49038461538461, "alnum_prop": 0.5537141166025451, "repo_name": "alexandreleroux/mayavi", "id": "7ec3a0f12891830ecb43d7436fa1794a93856160", "size"...
from __future__ import absolute_import import logging from django.conf import settings from openstack_dashboard.api import base from openstack_dashboard.api import neutron from gbpclient.v2_0 import client as gbp_client LOG = logging.getLogger(__name__) def gbpclient(request): insecure = getattr(settings, 'O...
{ "content_hash": "a2f96564769eb33a16618160a7c16bef", "timestamp": "", "source": "github", "line_count": 612, "max_line_length": 79, "avg_line_length": 33.3562091503268, "alnum_prop": 0.702557068678358, "repo_name": "tbachman/group-based-policy-ui", "id": "5ac16788e6942ffdda8441ada738579a0791122b", ...
""" Configuration functions for the logging package for Python. The core package is based on PEP 282 and comments thereto in comp.lang.python, and influenced by Apache's log4j system. Should work under Python versions >= 1.5.2, except that source line information is not available unless 'sys._getframe()' is. Copyrigh...
{ "content_hash": "3ef94abf02cd6f7bb9673045ed7e52d4", "timestamp": "", "source": "github", "line_count": 338, "max_line_length": 91, "avg_line_length": 33.30769230769231, "alnum_prop": 0.5735476994137502, "repo_name": "kevinr/750book-web", "id": "f1dd6dd8e0d591bf5bb925b64ba28df42b8f153e", "size": "1...
""" .. _tut-autogenerate-metadata: =============================== Auto-generating Epochs metadata =============================== This tutorial shows how to auto-generate metadata for `~mne.Epochs`, based on events via `mne.epochs.make_metadata`. We are going to use data from the :ref:`erp-core-dataset` (derived fr...
{ "content_hash": "16c30e91aaac1e3ec445a71b794d779d", "timestamp": "", "source": "github", "line_count": 440, "max_line_length": 79, "avg_line_length": 43.127272727272725, "alnum_prop": 0.7007799325463744, "repo_name": "kingjr/mne-python", "id": "270bb61532b1e4516d1a13cbca1971fed5f7acb1", "size": "1...
""" ExpandBuiltins replaces builtins by their full paths. """ from pythran.analyses import Globals, Locals from pythran.passmanager import Transformation from pythran.syntax import PythranSyntaxError from pythran.tables import MODULES import gast as ast class ExpandBuiltins(Transformation): """ Expands all...
{ "content_hash": "ee05dc63d16f2b86961221620961d3f8", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 77, "avg_line_length": 29.88, "alnum_prop": 0.5870147255689424, "repo_name": "pombredanne/pythran", "id": "88f55c86b83cf9fad36bbecddf79948b9be0ca24", "size": "1494", "bin...
import os from cffi import FFI BASE_DEFINITIONS = """ typedef struct secp256k1_context_struct secp256k1_context; typedef struct { unsigned char data[64]; } secp256k1_pubkey; typedef struct { unsigned char data[64]; } secp256k1_ecdsa_signature; typedef int (*secp256k1_nonce_function)( unsigned char *non...
{ "content_hash": "a0cf422f81219cfffae9efeda7925927", "timestamp": "", "source": "github", "line_count": 376, "max_line_length": 79, "avg_line_length": 23.909574468085108, "alnum_prop": 0.7261401557285874, "repo_name": "ofek/coincurve", "id": "34115a7fb6bf06170aac4b85430d8cb935629682", "size": "8990...
from __future__ import print_function import os import sys import subprocess import shutil def setup_parser(parser): parser.what_group.add_argument('--services', action='store_true', help="Install macOS services.") def main(args): if not (args.all or args.services): return for home in a...
{ "content_hash": "feecaefe7d8ad847ed79011df5f34eaa", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 90, "avg_line_length": 26.384615384615383, "alnum_prop": 0.6209912536443148, "repo_name": "vfxetc/sgactions", "id": "6aa3cdf2ca42e667e1e327062bfb7597eef1f571", "size": "137...
""" ========================================================================= Non-parametric between conditions cluster statistic on single trial power ========================================================================= This script shows how to compare clusters in time-frequency power estimates between condition...
{ "content_hash": "6b4262583845832025e2955697731de4", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 79, "avg_line_length": 36.13333333333333, "alnum_prop": 0.5945059450594506, "repo_name": "mne-tools/mne-tools.github.io", "id": "0d84eb96d9cdb62a6c762417318ea3ef1f4aa689", ...
from __future__ import unicode_literals from nltk.sem import Valuation, Model, Assignment, evaluate_sents if __name__ == '__main__': valuation_describe = [ ('ember', 'e'), ('asztal', 'a'), (['alive', set('e')]), (['!alive', set('a')]), (['agent', set('e')]), (['!age...
{ "content_hash": "0005bd81ed58a7d4c392a0a644fd5ad3", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 90, "avg_line_length": 33.03846153846154, "alnum_prop": 0.5657741559953434, "repo_name": "davidpgero/hungarian-nltk", "id": "d67811f7d488326ecb3c5b7ccd169bf67f844ed6", "siz...
import itertools import event_insight_lib import backend class ConceptModel: """The ConceptModel object is a container for the user's concept model.""" maturity = 1 model = dict() def __init__(self, model=dict(), maturity=1): self.model = model self.maturity = maturity def loadModel(self, email, filename='a...
{ "content_hash": "f7b98903dba5d9eb98bb35491e8c2cac", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 134, "avg_line_length": 45.359375, "alnum_prop": 0.7218394764037203, "repo_name": "ResidentMario/cultural-insight", "id": "e6cc24382470db47417bf0b2833d1ebec9cf08ce", "size...
""" Created on Sat Sep 17 04:26:02 2016 @author: naman """ import multiprocessing import json from operator import itemgetter import os import gensim, logging from gensim.models.doc2vec import TaggedDocument from gensim.models.doc2vec import LabeledSentence import re import numpy as np logging.basicConfig(format='%(...
{ "content_hash": "6b1bc23e626e4ac7d6179cdd0871d65c", "timestamp": "", "source": "github", "line_count": 283, "max_line_length": 101, "avg_line_length": 31.954063604240282, "alnum_prop": 0.6295477164657747, "repo_name": "njordsir/Movie-Script-Analysis", "id": "7ad1a02b21254c3d2bc2321d3db3b3d841f844ba"...
""" Classes that implement ASN.1 data structures. """ from __future__ import absolute_import from scapy.asn1.asn1 import ASN1_Class_UNIVERSAL, ASN1_NULL, ASN1_Error, \ ASN1_Object, ASN1_INTEGER from scapy.asn1.ber import BER_tagging_dec, BER_Decoding_Error, BER_id_dec, \ BER_tagging_enc from scapy.volatile imp...
{ "content_hash": "d3eb4daa53cfff2ba5e16500c8d90708", "timestamp": "", "source": "github", "line_count": 658, "max_line_length": 136, "avg_line_length": 34.39209726443769, "alnum_prop": 0.5565620857269111, "repo_name": "4shadoww/usploit", "id": "87679b550770a0d4a686c46595401c2017b870c7", "size": "22...
import unittest from pyowm.utils import strings class Placeholder: pass # don't move! class TestStringUtils(unittest.TestCase): def test_obfuscate_API_key(self): API_key = '22e28da2669c4283acdbd9cfa7dc0903' expected = '************************a7dc0903' self.assertEqual(expected, s...
{ "content_hash": "576bd74a4ab897a0af26d63474bc456e", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 81, "avg_line_length": 32.1875, "alnum_prop": 0.6388349514563106, "repo_name": "csparpa/pyowm", "id": "2cf32946d14ecbca5689b6621ca072498ed4b543", "size": "1077", "binary"...
from sqlalchemy import cast from sqlalchemy import Column from sqlalchemy import exc from sqlalchemy import ForeignKey from sqlalchemy import func from sqlalchemy import Integer from sqlalchemy import MetaData from sqlalchemy import select from sqlalchemy import String from sqlalchemy import Table from sqlalchemy impor...
{ "content_hash": "a9b66b41c2d9f5eca82b1fc28a8346d7", "timestamp": "", "source": "github", "line_count": 515, "max_line_length": 79, "avg_line_length": 32.22135922330097, "alnum_prop": 0.5779197300228999, "repo_name": "sqlalchemy/sqlalchemy", "id": "ad4b4db95916f19962876409b3e083899369621e", "size":...
""" Cat Facts Test for Bots """ __author__ = 'Steve Cvar' __license__ = 'MIT'
{ "content_hash": "5f1946bb9e0541e01d030c46189a518b", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 25, "avg_line_length": 15.6, "alnum_prop": 0.5641025641025641, "repo_name": "vgan/catFactsTest", "id": "31cd4698e2fb8463fdf3c493c5f54da19604b76c", "size": "106", "binary":...
import sys from midiutil.MidiFile import MIDIFile import random ratios = [0, 2, 4, 7, 9, 12] def generateScale(rootNote): return [rootNote+x for x in ratios] def pickPitch(charNum, rootNote): #C Major Penatonic notes = generateScale(rootNote) #print notes return notes[ord(charNum)%len(notes)] def main(argv=Non...
{ "content_hash": "64c8d09768bbaae9c79fe9222475331c", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 76, "avg_line_length": 20.149253731343283, "alnum_prop": 0.6688888888888889, "repo_name": "rcgilbert/csc344-wi14", "id": "ba034d7138d032c72c3ed4b2fdf044b8c4240f42", "size":...
""" Tests for L{twisted.internet.fdesc}. """ import os, sys import errno try: import fcntl except ImportError: skip = "not supported on this platform" else: from twisted.internet import fdesc from twisted.python.util import untilConcludes from twisted.trial import unittest class NonBlockingTests(unitt...
{ "content_hash": "9d0f5cbee78a9ca0656668ec76da6c06", "timestamp": "", "source": "github", "line_count": 263, "max_line_length": 97, "avg_line_length": 27.745247148288975, "alnum_prop": 0.570097300260381, "repo_name": "EricMuller/mynotes-backend", "id": "1f8b62740bbdedae59619c6859d6ccd91a796dbd", "s...
# coding: utf-8 from sqlalchemy.test.testing import eq_ from sqlalchemy import * from sqlalchemy import types as sqltypes, exc from sqlalchemy.sql import table, column from sqlalchemy.test import * from sqlalchemy.test.testing import eq_, assert_raises, assert_raises_message from sqlalchemy.test.engines import testing...
{ "content_hash": "2eed319981c51a5ecb2f67f6d33fbb81", "timestamp": "", "source": "github", "line_count": 1265, "max_line_length": 105, "avg_line_length": 40.54229249011858, "alnum_prop": 0.49580782279764457, "repo_name": "dbbhattacharya/kitsune", "id": "29d18b988c6a8ac6c899f63f76c251488419491f", "si...
import argparse import json import sys if len(sys.argv) < 3: print("syntax: "+sys.argv[0]+" INFILE OUTFILE") sys.exit(0) with open(sys.argv[1], "r") as infile: genesis = json.load(infile) with open(sys.argv[2], "w") as outfile: json.dump(genesis, outfile, indent=2, sort_keys=True)
{ "content_hash": "28b49824c9d4794acd684c28a8c53478", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 57, "avg_line_length": 25, "alnum_prop": 0.6633333333333333, "repo_name": "FinanceChainFoundation/FinChain-core", "id": "bb518fc52ba4e8eb35b80ac10f309cebdbd5c27d", "size": ...
"""Job related commands""" # pylint: disable=W0401,W0613,W0614,C0103 # W0401: Wildcard import ganeti.cli # W0613: Unused argument, since all functions follow the same API # W0614: Unused import %s from wildcard import (since we need cli) # C0103: Invalid name gnt-job from ganeti.cli import * from ganeti import consta...
{ "content_hash": "4643f7f96b3ca2856f443b429a0fa6a7", "timestamp": "", "source": "github", "line_count": 552, "max_line_length": 79, "avg_line_length": 29.41485507246377, "alnum_prop": 0.6161852558970253, "repo_name": "leshchevds/ganeti", "id": "3dd4eff0db11942d6afdcfc46e67a7d2ae1fd53a", "size": "17...
from __future__ import division import cvxopt import numpy as np from pylab import * import math from cvxpy import * # Taken from CVX website http://cvxr.com/cvx/examples/ # Example: Section 5.2.5: Mixed strategies for matrix games (LP formulation) # Ported from cvx matlab to cvxpy by Misrab Faizullah-Khan # Origina...
{ "content_hash": "4cdfccac2cf505aa415df0ca09727559", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 80, "avg_line_length": 29.328358208955223, "alnum_prop": 0.6529262086513995, "repo_name": "riadnassiffe/Simulator", "id": "54ab67e080fccf5bcb1f39cd4b5969305d9378d7", "size"...
''' The MIT License (MIT) Copyright (c) 2014 NTHUOJ team 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,...
{ "content_hash": "08fac7a83df6aa93db42a04774fab34e", "timestamp": "", "source": "github", "line_count": 386, "max_line_length": 94, "avg_line_length": 42.056994818652846, "alnum_prop": 0.6419243562892695, "repo_name": "drowsy810301/NTHUOJ_web", "id": "464693553ea4bc3d2951be6539bccfb6d0d58cb4", "siz...
from datetime import datetime from django.test import TestCase from django.conf import settings from django.core.urlresolvers import reverse from django.contrib.auth.models import User, Group, Permission from mks.models import Member from links.models import LinkType from committees.models import Committee, Topic from ...
{ "content_hash": "a2d05eea0ef4aaa9f08289d5eeebebd3", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 96, "avg_line_length": 52.513333333333335, "alnum_prop": 0.5277389869239558, "repo_name": "OriHoch/Open-Knesset", "id": "2d96a15813cd758f0c0858ad30c582e29bc645ca", "size":...
from __future__ import print_function import cx_Oracle import db_config con = cx_Oracle.connect(db_config.user, db_config.pw, db_config.dsn) cur = con.cursor() # Create table cur.execute("""begin execute immediate 'drop table testgeometry'; exception when others then ...
{ "content_hash": "86abf6a50ef131532c73321fefd663dc", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 71, "avg_line_length": 31.95774647887324, "alnum_prop": 0.6024680475980608, "repo_name": "kawamon/hue", "id": "4f21eda07f313fc2b523bdc3648bc3b2df8a935f", "size": "2694", ...
from gnuradio import gr from gnuradio import eng_notation from gnuradio.eng_option import eng_option from optparse import OptionParser import time, struct, sys from gnuradio import digital # from current dir from uhd_interface import uhd_transmitter class my_top_block(gr.top_block): def __init__(self, options): ...
{ "content_hash": "4466f8ccddc341413d80c84711bf6bcc", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 92, "avg_line_length": 37.21311475409836, "alnum_prop": 0.5231277533039648, "repo_name": "YaguangZhang/EarsMeasurementCampaignCode", "id": "96b52a092aad9845297433c7dec842a58...
""" Snapcast Client. """ import logging import queue import socket import threading import time from snapcast.client.messages import (hello_packet, request_packet, command_packet, packet, basemessage, BASE_SIZE) from snapcast.client.gstreamer...
{ "content_hash": "b4e7f9c5c97aa7826a5994c83888c93d", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 79, "avg_line_length": 33.51724137931034, "alnum_prop": 0.5787037037037037, "repo_name": "happyleavesaoc/python-snapcast", "id": "0d6f599cdfcca6657b474dbaafbc13e9fb620d00", ...
import os import subprocess import tempfile from contextlib import contextmanager from jinja2 import Template from cloudify_rest_client import exceptions as rest_exceptions from cloudify import ctx from cloudify.state import ctx_parameters as inputs from cloudify import exceptions from cloudify import utils CONFIG_...
{ "content_hash": "f1f44b352e0f62ad7aad766b42433e0e", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 122, "avg_line_length": 31.723684210526315, "alnum_prop": 0.6943177104935712, "repo_name": "Frank-G/orchestration_comparision", "id": "f9e2d549201810b826e993ac14832af3266a2d9...
import os from optparse import make_option from django.core.management.base import BaseCommand, CommandError from django.core.management.color import color_style from django.template.loader import get_template from django_extensions.compat import add_to_builtins_compat from django_extensions.management.utils import s...
{ "content_hash": "ae82f6fde27fe8e2d9c59bc6e40ffd0e", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 117, "avg_line_length": 44.22222222222222, "alnum_prop": 0.5787269681742043, "repo_name": "pabulumm/neighbors", "id": "e5d4ed0b87c7c2421748f9abd1bf2a7cacb43595", "size": "3...
""" setup.py Basic setup file to enable pip install http://python-distribute.org/distribute_setup.py python setup.py register sdist upload """ from setuptools import setup, find_packages setup( name = 'demoing', version = '0.0.1', description = 'OpenWest Demo Application', url =...
{ "content_hash": "e07432d5675286f9b1ae8f99ea56d8c0", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 79, "avg_line_length": 33.64705882352941, "alnum_prop": 0.5524475524475524, "repo_name": "SmithSamuelM/openwestdemo", "id": "9729fa61bc59cef96a50a41f5fb417f3eda067fb", "siz...
""" WSGI config for Djember Sample 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 import sys from django.core.wsgi import get_wsgi_application BASE_DIR = os.pat...
{ "content_hash": "e64aaeab0fbe0838c97add7cd5d99c1f", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 78, "avg_line_length": 24.45, "alnum_prop": 0.754601226993865, "repo_name": "drf-forms/ember_sample", "id": "140dded7627c237537fcaf860aa5fbde44e82085", "size": "489", "bi...
import numpy as np import pickle import ray from ray.rllib.models.modelv2 import ModelV2 from ray.rllib.models.tf.misc import normc_initializer from ray.rllib.models.tf.recurrent_net import RecurrentNetwork from ray.rllib.utils.annotations import override from ray.rllib.utils.framework import try_import_tf tf1, tf, t...
{ "content_hash": "2ccd30554dd8924c413daf2a3eb4fb1e", "timestamp": "", "source": "github", "line_count": 141, "max_line_length": 85, "avg_line_length": 33.276595744680854, "alnum_prop": 0.558610400682012, "repo_name": "ray-project/ray", "id": "fdf280f043f833285c96b5d354edb902e8af4de6", "size": "4692...
"""Tf-Idf similarity measure""" from __future__ import division from math import log, sqrt import collections from py_stringmatching import utils from py_stringmatching.similarity_measure.token_similarity_measure import \ TokenSimilarityMeasure class TfIdf(TokenSi...
{ "content_hash": "4192060ab26bd4cd3575203d1f67d02a", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 113, "avg_line_length": 37.81218274111675, "alnum_prop": 0.5069136796885488, "repo_name": "Anson-Doan/py_stringmatching", "id": "d3dded2b63bd4a2143ac3e416fa209f6cc262d46", ...