text
stringlengths
4
1.02M
meta
dict
"""Tests for tf.GrpcServer.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf class GrpcServerTest(tf.test.TestCase): def testRunStep(self): server = tf.train.Server.create_local_server() with tf.Sess...
{ "content_hash": "8804b56b79def077461d9ad241d58d4b", "timestamp": "", "source": "github", "line_count": 160, "max_line_length": 78, "avg_line_length": 35.65, "alnum_prop": 0.6104488078541375, "repo_name": "wchan/tensorflow", "id": "c6d2f1e1f86c3618c962925d63721493ab8cfff4", "size": "6381", "binar...
import json import re import pprint import urllib from collections import OrderedDict try: file=open("../api_data.json") data=json.load(file, object_pairs_hook=OrderedDict) file.close() except: file=open("../api_data.json", encoding='utf-8') data=json.load(file, object_pairs_hook=OrderedDict) file.close() ...
{ "content_hash": "d447180e214860768f298bb93347da02", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 115, "avg_line_length": 32.57142857142857, "alnum_prop": 0.5786099865047234, "repo_name": "Normation/rudder-api-client", "id": "da0e845653e67eea0f7f33f422817b5e0a59dfcd", "...
from passlib.context import CryptContext from .tokens import TokenManager class UserManager: def __init__(self, app): self.enable_email = True self.send_password_changed_email = True self.send_registered_email = True self.enable_confirm_email = True self.show_email_does_no...
{ "content_hash": "9c01b59fbdd940ae459b5a6b11df39ae", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 80, "avg_line_length": 40.595238095238095, "alnum_prop": 0.6668621700879765, "repo_name": "soybean217/lora-python", "id": "07858e4f21565fb0189d0dd8fea32a436f68b3d8", "size"...
"""big array mult""" from time import time from random import random @gpu.vectorize def array_mult(a,b,c,d): a = numpy.array(a, dtype=numpy.float32 ) b = numpy.array(b, dtype=numpy.float32 ) c = numpy.array(c, dtype=numpy.float32 ) d = numpy.array(d, dtype=numpy.float32 ) return a * b * c * d def main(): ARRAY...
{ "content_hash": "2f29f4a46dcca8bde6c0689538777aa3", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 43, "avg_line_length": 23.96, "alnum_prop": 0.6444073455759599, "repo_name": "jinankjain/PythonJS", "id": "5b50e9b1d26f64615d71cfbb7e587e6f1dff85eb", "size": "599", "bina...
import unittest from webtest import TestApp import test_helper class MoviesControllerTests(unittest.TestCase): def test_movies(self): app = TestApp(test_helper.get_app()) assert app.get('/movies').status == '200 OK'
{ "content_hash": "7ee73f244b9846d89258008c1dc74676", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 52, "avg_line_length": 21.818181818181817, "alnum_prop": 0.7, "repo_name": "Rolinh/pydeo", "id": "39567b0c2a5f49e20b50c1a0674a3c6e1ff4c88d", "size": "240", "binary": fals...
""" URL patterns for testing Horizon views. """ from django.conf.urls.defaults import include # noqa from django.conf.urls.defaults import patterns # noqa from django.conf.urls.defaults import url # noqa from django.contrib.staticfiles.urls import staticfiles_urlpatterns # noqa from django.views.generic import Tem...
{ "content_hash": "fede907dbadc43cf42d742d368317871", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 75, "avg_line_length": 30.52, "alnum_prop": 0.6985583224115334, "repo_name": "r-icarus/openstack_microserver", "id": "b6bce7dca655ef15a6d897b09ab360dd2388e606", "size": "15...
""" Script that imports locally stored data as a new dataset for the user Usage: import id outputfile """ import sys, os from shutil import copyfile #tempfile, shutil BUFFER = 1048576 uids = sys.argv[1].split(",") out_file1 = sys.argv[2] #remove NONE from uids have_none = True while have_none: try: uids.r...
{ "content_hash": "0b9b5cdbf1ef821baafdc7bef695e40f", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 96, "avg_line_length": 30.88888888888889, "alnum_prop": 0.6015187849720224, "repo_name": "jmchilton/galaxy-central", "id": "735eed94929a232d61d982af8c76ff49d9b60628", "size...
from AppKit import NSLevelIndicator, NSLevelIndicatorCell, NSTickMarkAbove, NSTickMarkBelow, \ NSDiscreteCapacityLevelIndicatorStyle, NSContinuousCapacityLevelIndicatorStyle, \ NSRatingLevelIndicatorStyle, NSRelevancyLevelIndicatorStyle, NSImage from vanilla.vanillaBase import VanillaBaseControl # This...
{ "content_hash": "cff7a3f96e7ea4488e0ed37a1a7fef9d", "timestamp": "", "source": "github", "line_count": 290, "max_line_length": 106, "avg_line_length": 37.241379310344826, "alnum_prop": 0.5471296296296296, "repo_name": "moyogo/vanilla", "id": "6f7e274d72ceb5e4b0f26016430694ca8a56dde7", "size": "108...
import sys, os sys.path.insert(0, os.path.abspath('..')) from conf_common import * # General information about the project. project = u'ESP-IDF 编程指南' copyright = u'2016 - 2018 乐鑫信息科技(上海)有限公司' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. language = 'zh...
{ "content_hash": "d56c79a7e05911ded2827f742115db89", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 74, "avg_line_length": 29.545454545454547, "alnum_prop": 0.7415384615384616, "repo_name": "mashaoze/esp-idf", "id": "a4017c8c0b0636b098f47e6d8788ca759ffdea06", "size": "587...
"""Logger initialization.""" import os import logging import logging.config import pkgutil import yaml # Search path for config file. Will default to packaged file. CONFIG_PATH = ['./picdb_log.yaml', '~/.picdb/picdb_log.yaml'] def _lookup_configuration(): """Lookup the configuration file. :return: path to ...
{ "content_hash": "a6e16491a23fabab1df377b67edc53c7", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 63, "avg_line_length": 26.659574468085108, "alnum_prop": 0.6711891460494812, "repo_name": "stbraun/picdb", "id": "b4536b7793c04ccff4cd2997e24748e067a0e047", "size": "1253",...
from twilio.twiml.voice_response import Connect, VoiceResponse, Say, VirtualAgent response = VoiceResponse() response.say('Hello! You will be now be connected to a virtual agent.') connect = Connect(action='https://myactionurl.com/virtualagent_ended') connect.virtual_agent( connector_name='project', status_callbac...
{ "content_hash": "c70e5f3857e9d64db9c5c86e36877d30", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 81, "avg_line_length": 35.81818181818182, "alnum_prop": 0.7817258883248731, "repo_name": "TwilioDevEd/api-snippets", "id": "59e4f091901b36333864040042c0e4b4997d5823", "size...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Podcast.author' db.add_column('podcast_podcast', 'author', self.gf('django.db.models.fields.Ch...
{ "content_hash": "cf37b6b7e5da87f945ed821b9565b277", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 193, "avg_line_length": 59.90277777777778, "alnum_prop": 0.54022722003246, "repo_name": "stickwithjosh/hypodrical", "id": "aa58264aa5278abd4e96eb3311e5a9ec345f8ab7", "size"...
''' This submodule collects useful functionality required across the task submodules, such as preprocessing, validation, and common computations. ''' import os import inspect import six import numpy as np def index_labels(labels, case_sensitive=False): """Convert a list of string identifiers into numerical indi...
{ "content_hash": "2ffee8705236f582fc357af16e75b308", "timestamp": "", "source": "github", "line_count": 958, "max_line_length": 82, "avg_line_length": 30.647181628392484, "alnum_prop": 0.5880790190735695, "repo_name": "bmcfee/mir_eval", "id": "600677ace11510134b984aa51ce10aefa4ebbe9d", "size": "293...
import tensorflow as tf def mse(sname, true, model): with tf.name_scope(sname): waveform_loss = tf.reduce_mean(tf.square(tf.subtract(true, model))) tf.summary.scalar(sname, waveform_loss) return waveform_loss def l2(sname, true, model): with tf.name_scope(sname): waveform_loss = tf.n...
{ "content_hash": "53a436e200a69cdeb4a164af239ea735", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 75, "avg_line_length": 29.633333333333333, "alnum_prop": 0.655793025871766, "repo_name": "jhetherly/EnglishSpeechUpsampler", "id": "aec0908e8e2c61f51ebc0b78c0a2ec142d9dcad5",...
import unittest from pymmrouting.routeplanner import MultimodalRoutePlanner from pymmrouting.inferenceengine import RoutingPlanInferer from pymmrouting.orm_graphmodel import SwitchType, Mode, Session class RoutePlannerTestCase(unittest.TestCase): def setUp(self): routing_options_file = \ "test...
{ "content_hash": "fe30a917cdd21d9726bf885200d8ad06", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 102, "avg_line_length": 56.22549019607843, "alnum_prop": 0.5787271142109852, "repo_name": "tumluliu/pymmrouting", "id": "7c91bcaeebf4adf0b80cfd9f789958b4812fd8ed", "size":...
import json from tempest_lib.common import rest_client from tempest_lib import exceptions as lib_exc from neutron_lbaas.tests.tempest.lib.common import service_client from neutron_lbaas.tests.tempest.lib import exceptions class TokenClientJSON(rest_client.RestClient): def __init__(self, auth_url, disable_ssl_ce...
{ "content_hash": "ec04dd4af5a306766725bf46d3540f95", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 73, "avg_line_length": 33.197916666666664, "alnum_prop": 0.5591465327894571, "repo_name": "gandelman-a/neutron-lbaas", "id": "4795e720040fbdb85ca94bc3433f14edb1668f21", "si...
from rdflib.graph import Graph from rdflib.namespace import RDF from rdflib.plugins.parsers.rdfxml import CORE_SYNTAX_TERMS from rdflib.term import BNode, Literal, URIRef """ Ah... it's coming back to me... [6:32p] eikeon: think it's so transitivity holds... [6:32p] eikeon: if a==b and b==c then a should == c [6:32p] ...
{ "content_hash": "68807583ec40191b4874de462ad57e7a", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 146, "avg_line_length": 37.507246376811594, "alnum_prop": 0.6561051004636785, "repo_name": "RDFLib/rdflib", "id": "2dfdb734d19b7efe7cfb0ecfbe64764fa11823f0", "size": "2588"...
"""Adds support for generic thermostat units.""" import asyncio import logging import math import voluptuous as vol from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity from homeassistant.components.climate.const import ( ATTR_PRESET_MODE, CURRENT_HVAC_COOL, CURRENT_HVAC_HEAT, C...
{ "content_hash": "6075a2fe553c3b882d4bd79774d0268c", "timestamp": "", "source": "github", "line_count": 541, "max_line_length": 102, "avg_line_length": 35.52310536044362, "alnum_prop": 0.5755021334165886, "repo_name": "jawilson/home-assistant", "id": "2c27d371c5e3672811650fa7bcd79be22f46eae0", "siz...
from __future__ import absolute_import, division, print_function, unicode_literals from c7n.exceptions import PolicyValidationError from c7n.actions import AutoTagUser from c7n.utils import query_instances from .common import BaseTest, event_data from mock import MagicMock class AutoTagCreator(BaseTest): def te...
{ "content_hash": "21037a1a27d03bfb4c5aa10a34b2ef1b", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 88, "avg_line_length": 39.11351351351351, "alnum_prop": 0.5174129353233831, "repo_name": "FireballDWF/cloud-custodian", "id": "3ea45aabcf5433774a3a85ef4543c6601c40ca40", "...
''' Created on 2017/11/23 @author: sunyihuan ''' import keras import scipy import numpy as np from keras import layers from keras.layers import Input, Dense, Activation, ZeroPadding2D, BatchNormalization, Flatten, Conv2D from keras.layers import AveragePooling2D, MaxPooling2D, Dropout, GlobalMaxPooling2D, GlobalAverag...
{ "content_hash": "c83d52fdc346885cbfb5453b2c011060", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 117, "avg_line_length": 30.29268292682927, "alnum_prop": 0.7020933977455717, "repo_name": "sunyihuan326/DeltaLab", "id": "9b6aed0d3a9fd56fa251a5625f6941c129526797", "size":...
from req import WebRequestHandler from req import Service import tornado import math import datetime from map import * class WebContestsHandler(WebRequestHandler): @tornado.gen.coroutine def get(self): args = ["page"] meta = self.get_args(args) meta['count'] = 10 meta["group_id...
{ "content_hash": "bbab754be18fca462d4f3c0805773d04", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 221, "avg_line_length": 40.79329608938548, "alnum_prop": 0.5905231443440153, "repo_name": "Tocknicsu/nctuoj", "id": "4c5ae5b939ab23e6f32794379dc4145b0aff9b69", "size": "73...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion def forwards_func(apps, schema_editor): # We get the model from the versioned app registry; # if we directly import it, it'll be the wrong version Casella = apps.get_model("taulell", "Casella"...
{ "content_hash": "c2ad5b8c7ded95a6a1c0e858e2857536", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 136, "avg_line_length": 71.12582781456953, "alnum_prop": 0.7078212290502793, "repo_name": "ctrl-alt-d/practicaMonoPoli", "id": "026661fe28046aff44ab0a6667e801f6154cb7bf", ...
import os import unittest from datetime import datetime, timedelta from time import sleep import pytest from reactivex.scheduler.eventloop import EventletScheduler eventlet = pytest.importorskip("eventlet") CI = os.getenv("CI") is not None class TestEventletScheduler(unittest.TestCase): @pytest.mark.skipif(CI,...
{ "content_hash": "9ac88ebbfafb245916b2f3175b2df5f1", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 78, "avg_line_length": 28.129411764705882, "alnum_prop": 0.6344625679631953, "repo_name": "ReactiveX/RxPY", "id": "6d7adb1f25386cdcfee0f46e0706106c1920d278", "size": "2391"...
import datetime from cinder import exception as exc FAKE_UUID = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' FAKE_UUIDS = {} def stub_volume(id, **kwargs): volume = { 'id': id, 'user_id': 'fakeuser', 'project_id': 'fakeproject', 'host': 'fakehost', 'size': 1, 'availabil...
{ "content_hash": "5b1404895dd29f1a9e744ee215e30a78", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 75, "avg_line_length": 28.887931034482758, "alnum_prop": 0.5768427335123844, "repo_name": "tomasdubec/openstack-cinder", "id": "c787ef78c2068d426afbbcf9fd9cc999e7692268", ...
from azure.identity import DefaultAzureCredential from azure.mgmt.sql import SqlManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-sql # USAGE python update_a_database's_threat_detection_policy_with_all_parameters.py Before run the sample, please set the values of t...
{ "content_hash": "6888fba88ce76677c73162e1201e29ea", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 142, "avg_line_length": 39.04347826086956, "alnum_prop": 0.6765033407572383, "repo_name": "Azure/azure-sdk-for-python", "id": "4828bdfc7fab791c2a8b8fd195ba8a92be90b5ac", "s...
import os import fnmatch def Walk(root='.', recurse=True, pattern='*'): """ Generator for walking a directory tree. Starts at specified root folder, returning files that match our pattern. Optionally will also recurse through sub-folders. """ for path, subdirs, files in os.w...
{ "content_hash": "fa81224c308061377a707135d34c7d9f", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 67, "avg_line_length": 30.906976744186046, "alnum_prop": 0.5334838224228743, "repo_name": "ActiveState/code", "id": "c49654a1b72f361a99709956929bdfcfe9636569", "size": "132...
import logging if __name__ == '__main__': logging.basicConfig() _log = logging.getLogger(__name__) from pyxb.exceptions_ import * import unittest import pyxb.binding.datatypes as xsd class Test_NCName (unittest.TestCase): def testValid (self): valid = [ 'schema', '_Underscore', '_With.Dot', 'With-Hyphe...
{ "content_hash": "4159d1eda13b687cacd6be772faa451e", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 76, "avg_line_length": 33.17391304347826, "alnum_prop": 0.5937090432503277, "repo_name": "jonfoster/pyxb-upstream-mirror", "id": "7fd3fd6d7afa4f0f6dd9cc0e208686146c19352d", ...
""" Output CSV format from output generated by algostat.py """ import sys from operator import itemgetter from algorithm import ALGORITHMS DELIMITER = "," def write_header(): sys.stdout.write(DELIMITER.join(["repository"] + sorted(ALGORITHMS)) + "\n") def write_line(line): algorithms = {key: 0 for key in ...
{ "content_hash": "6de9c872a8c3c347e786d0639a7d4028", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 80, "avg_line_length": 24, "alnum_prop": 0.6401515151515151, "repo_name": "lukasmartinelli/algostat", "id": "8af1b2e05020daee90f43e5bd853bd8499f9a395", "size": "814", "bi...
from django.core.management.base import BaseCommand, CommandError from driver27.models import Driver, Team, Seat import sys if sys.version_info < (3, 0): try: import unicodecsv as csv except ImportError: import csv else: import csv class Command(BaseCommand): help = 'Export seats to c...
{ "content_hash": "accf24ee01b436671d2882cfeb80eccd", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 112, "avg_line_length": 33.52173913043478, "alnum_prop": 0.585603112840467, "repo_name": "SRJ9/django-driver27", "id": "71cc0ae1232b64873792b5ee88038a80077d7c1b", "size": "...
import _plotly_utils.basevalidators class XpadValidator(_plotly_utils.basevalidators.NumberValidator): def __init__(self, plotly_name="xpad", parent_name="heatmapgl.colorbar", **kwargs): super(XpadValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, ...
{ "content_hash": "3e265af3642b8a3260d70c5192a84681", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 87, "avg_line_length": 37.07692307692308, "alnum_prop": 0.5933609958506224, "repo_name": "plotly/python-api", "id": "f62cbe0488560ad66e3a59eda537bd5b7776c0eb", "size": "482...
''' TabbedPanel =========== .. image:: images/tabbed_panel.jpg :align: right .. versionadded:: 1.3.0 The `TabbedPanel` widget manages different widgets in tabs, with a header area for the actual tab buttons and a content area for showing the current tab content. The :class:`TabbedPanel` provides one default ta...
{ "content_hash": "47b891aad4b9eee969c3d47a05438b74", "timestamp": "", "source": "github", "line_count": 849, "max_line_length": 79, "avg_line_length": 34.33804475853946, "alnum_prop": 0.598566185298254, "repo_name": "jegger/kivy", "id": "39aa327ca3ac5d5fc0c29906c9564dc9f65d739d", "size": "29153", ...
from heat.common.i18n import _ from heat.engine import properties from heat.engine import resource from heat.engine import support class NovaFlavor(resource.Resource): """ A resource for creating OpenStack virtual hardware templates. Due to default nova security policy usage of this resource is limited t...
{ "content_hash": "ed317574a4ee3bec69d98aa9aa834504", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 78, "avg_line_length": 32.62903225806452, "alnum_prop": 0.5884824518042511, "repo_name": "cryptickp/heat", "id": "b1474639d64d28236a1fe0d23504f5d5d038507b", "size": "4621"...
""" Vericred API Vericred's API allows you to search for Health Plans that a specific doctor accepts. ## Getting Started Visit our [Developer Portal](https://developers.vericred.com) to create an account. Once you have created an account, you can create one Application for Production and another for our San...
{ "content_hash": "cac54826ed5b02da34e00eb8667a5169", "timestamp": "", "source": "github", "line_count": 346, "max_line_length": 228, "avg_line_length": 36.725433526011564, "alnum_prop": 0.6133627134650192, "repo_name": "vericred/vericred-python", "id": "d7869465b9a8fb2c71c146f634a6154a28ecd1f3", "s...
import argparse import json import random import subprocess import time #------------------------------------------------------------------------------ # Configuration mode: return the custom metrics data should be defined def config(): settings = { 'maxruntime': 30000, # How long the script is allowed to ...
{ "content_hash": "592e53f013c9e3f91cde7783636345fa", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 122, "avg_line_length": 31.110526315789475, "alnum_prop": 0.43495178480798513, "repo_name": "CoScale/coscale-generic-scripts", "id": "97fc280ddea0655bec8783cc2d104128afe836c...
"""Exceptions used by Cisco Nexus1000V ML2 mechanism driver.""" from neutron.common import exceptions class VSMConnectionFailed(exceptions.ServiceUnavailable): """No response from Cisco Nexus1000V VSM.""" message = _("Connection to VSM failed: %(reason)s.") class VSMError(exceptions.NeutronException): ...
{ "content_hash": "9c68d3d45c5d47ef22b7ba9bf9869194", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 76, "avg_line_length": 34.542857142857144, "alnum_prop": 0.6989247311827957, "repo_name": "hareeshpc/networking-cisco", "id": "08fb50215356b93ada75a4439cfbf233a0ca6019", "s...
"""SCons.Platform.posix Platform-specific initialization for POSIX (Linux, UNIX, etc.) systems. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method. """ # # __COPYRIGHT__ # # Permission is hereby granted, fre...
{ "content_hash": "c7f86edc8ffe916a541e87b4c5658ba0", "timestamp": "", "source": "github", "line_count": 251, "max_line_length": 76, "avg_line_length": 33.00398406374502, "alnum_prop": 0.5899323998068566, "repo_name": "datalogics-robb/scons", "id": "1d4e9f70d82d1e26b10325ff4498f480f3267739", "size":...
from netmiko.oneaccess.oneaccess_oneos import OneaccessOneOSSSH, OneaccessOneOSTelnet __all__ = ["OneaccessOneOSSSH", "OneaccessOneOSTelnet"]
{ "content_hash": "601c554b6b0e594bf10a224ba78bf030", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 85, "avg_line_length": 47.666666666666664, "alnum_prop": 0.8181818181818182, "repo_name": "ktbyers/netmiko", "id": "a3d597813cb65053a1b2c4ab1c7c12bdc6edae0a", "size": "143",...
'''Migration script for Search-enabled Models.''' from __future__ import absolute_import import logging from elasticsearch import helpers from modularodm.query.querydialect import DefaultQueryDialect as Q from website import settings from framework.auth import User from website.models import Node from website.app im...
{ "content_hash": "5dd17c5a7f799393b8477f286301d019", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 82, "avg_line_length": 29.761467889908257, "alnum_prop": 0.6430332922318126, "repo_name": "himanshuo/osf.io", "id": "f9fc0682ee02fdf322c24ddde073ca985e56f030", "size": "32...
from __future__ import absolute_import, division, print_function, with_statement from tornado import gen from tornado.log import app_log from tornado.stack_context import (StackContext, wrap, NullContext, StackContextInconsistentError, ExceptionStackContext, run_with_stack_context, _...
{ "content_hash": "8908d3ce156f1bae301581053b452c2b", "timestamp": "", "source": "github", "line_count": 280, "max_line_length": 98, "avg_line_length": 38.392857142857146, "alnum_prop": 0.6015813953488373, "repo_name": "mywaiting/LifeLogger", "id": "d6f8239e67c050d538301ce7674dd767b2c30c97", "size":...
import random import numpy as np import matplotlib from matplotlib import pyplot as plt import pickle import os import pylab matplotlib.rcParams['backend'] = "Qt4Agg" with open('../dataset/ENGLISH_TRAIN','r') as f: x = np.array([a.count(' ') for a in f.readlines()]) with open('../dataset/TAMIL_TRAIN','r') as f: ...
{ "content_hash": "4cb21caff16a5b086a1b23e3c7a3f2d0", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 55, "avg_line_length": 25.50943396226415, "alnum_prop": 0.6708579881656804, "repo_name": "hanskrupakar/English-Tamil-MT", "id": "5b7e79c54e870934687f0de187efce063b569391", ...
import yaml import json with open("ex6.yml") as f: f_yml = yaml.load(f) print yaml.dump(f_yml, default_flow_style=False) with open("ex6.json") as f: f_json = json.load(f) print json.dumps(f_json, indent=4)
{ "content_hash": "7034283a34edce528e2b4c3f9f05452c", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 52, "avg_line_length": 22.4, "alnum_prop": 0.6517857142857143, "repo_name": "rickkosa/pynet_test", "id": "c8cd7b9166192e0eeb86c77ed911eb3e736be99a", "size": "243", "binar...
"""Module with helper classes used by grr_response_test."""
{ "content_hash": "fdcee42b09cb52a13c6d585a38872be0", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 59, "avg_line_length": 30.5, "alnum_prop": 0.7213114754098361, "repo_name": "google/grr", "id": "78b1043ff02188d791aa1b3ccf644fae949a09ac", "size": "83", "binary": false, ...
import numpy as np # Load the dataset and scrap everything but the first 16 entries from keras.datasets import imdb from keras.preprocessing import sequence max_features = 20000 max_length = 80 if __name__ == '__main__': print('Fetching the imdb dataset') (x_train, y_train), (x_test, y_test) = imdb.load_data...
{ "content_hash": "df8c76d5e5fa197d925c0addb08b35b4", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 81, "avg_line_length": 31.466666666666665, "alnum_prop": 0.6970338983050848, "repo_name": "plaidml/plaidml", "id": "b3f0b1b3eba2a389ad74a4614341e2214a237d5b", "size": "1077...
''' Display a variety of simple scatter marker shapes whose attributes can be associated with data columns from ``ColumnDataSources``. The full list of markers built into Bokeh is given below: * :class:`~bokeh.models.markers.Asterisk` * :class:`~bokeh.models.markers.Circle` * :class:`~bokeh.models.markers.CircleCross...
{ "content_hash": "dc45490446003250f8cc4b129896fed9", "timestamp": "", "source": "github", "line_count": 397, "max_line_length": 79, "avg_line_length": 30.55919395465995, "alnum_prop": 0.6027035938015166, "repo_name": "ericmjl/bokeh", "id": "d85eb566456ea645c849b133e1ea244e9df683a3", "size": "12463"...
from parcels import FieldSet, GridCode import numpy as np import math try: from pympler import asizeof except: asizeof = None from os import path import xarray as xr try: from parcels.tools import perlin2d as PERLIN except: PERLIN = None noctaves = 4 perlinres = (32, 8) shapescale = (1, 1) perlin_persi...
{ "content_hash": "cfbccb9d4879c1fe03c975db5d4e792a", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 134, "avg_line_length": 46.530434782608694, "alnum_prop": 0.6236217529433751, "repo_name": "OceanPARCELS/parcels", "id": "efd0dc4bfd1d9c6b3e9864ad35f16e5912dc9388", "size"...
from __future__ import absolute_import, division, print_function, unicode_literals from guessit.plugins.transformers import all_transformers def best_quality_properties(props, *guesses): """Retrieve the best quality guess, based on given properties :param props: Properties to include in the rating :type...
{ "content_hash": "a2cf6ba0a6529e6e2f7bb95e2dfbc296", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 82, "avg_line_length": 31.666666666666668, "alnum_prop": 0.6463157894736842, "repo_name": "Kallehz/Python", "id": "870bbdbb477872c7f81fcf962a57ce0df76fe561", "size": "2245"...
"""Partial dependence plots for tree ensembles. """ # Authors: Peter Prettenhofer # License: BSD 3 clause from itertools import count import numbers import numpy as np from scipy.stats.mstats import mquantiles from ..utils.extmath import cartesian from ..externals.joblib import Parallel, delayed from ..externals im...
{ "content_hash": "8f43111fd39e0e7e47c0cab3b99aed4f", "timestamp": "", "source": "github", "line_count": 389, "max_line_length": 79, "avg_line_length": 38.491002570694086, "alnum_prop": 0.5862552594670407, "repo_name": "costypetrisor/scikit-learn", "id": "bf5b1e9e2562f47a46ae42ca23ee370578996efa", "...
from .xcbuildsystem import * from .xcbuildrule import * from .xcspec_helper import * from .xcplatform import * from .xcsdk import * from .xccompiler import * from .swiftcompiler import * from .clangcompiler import * from .xclinker import * from .XCSpec.xcspec import * from .LangSpec.langspec import *
{ "content_hash": "81cd9168979ebd6f233a63b5ce9e5c74", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 32, "avg_line_length": 19.125, "alnum_prop": 0.761437908496732, "repo_name": "samdmarshall/xcparse", "id": "d1c8d4ea52dfe3a8cc3616de419fc2fc9d4f1e6f", "size": "306", "bin...
import re import os import os.path import sys import traceback import IECore ## This function provides an easy means of providing a flexible configuration # mechanism for any software. It works by executing all .py files found on # a series of searchpaths. It is expected that these files will then make appropriate # c...
{ "content_hash": "70b288beb4de7048914569f7d30c703e", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 143, "avg_line_length": 41.09090909090909, "alnum_prop": 0.7116519174041298, "repo_name": "tectronics/cortex-vfx", "id": "64a770b069c47a34053cc7eb27c065e5ce0393e8", "size":...
from pcaspy import Driver, SimpleServer, Alarm, Severity prefix = 'MTEST:' pvdb = { 'RAND' : { 'prec' : 3, 'low' : -5, 'high': 5, 'lolo': -10,'hihi': 10, }, 'STATUS' : { 'type' : 'enum', 'enums': ['OK', 'ERROR'], 'states': [Severity.NO_ALARM, Severity.MAJOR_...
{ "content_hash": "6642d5cf1f37fb4a82818e9481a56046", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 92, "avg_line_length": 27.714285714285715, "alnum_prop": 0.5368188512518409, "repo_name": "HaveF/pcaspy", "id": "dbcc36d12400c4f4c2b7580c6150179404f97041", "size": "1381", ...
""" Verifies builds are the same even with different PYTHONHASHSEEDs. Tests both solibs and implicit_deps. """ import os import sys import TestGyp test = TestGyp.TestGyp() if test.format == 'ninja': os.environ["PYTHONHASHSEED"] = "1" test.run_gyp('empty-targets.gyp') base = open(test.built_file_path('build.ninj...
{ "content_hash": "004af8ae2722c340d8c048d023b7b86f", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 65, "avg_line_length": 25.125, "alnum_prop": 0.681592039800995, "repo_name": "ayoubserti/winpty", "id": "cf49f5008484b7270cef06bd1aaa7af7ea8f19d9", "size": "783", "binary...
from __future__ import absolute_import import ast import pycodestyle from collections import namedtuple from functools import partial class SentryVisitor(ast.NodeVisitor): NODE_WINDOW_SIZE = 4 def __init__(self, filename, lines): self.errors = [] self.filename = filename self.lines ...
{ "content_hash": "c5f3e42fa375cd91a7856db6f001bf92", "timestamp": "", "source": "github", "line_count": 329, "max_line_length": 93, "avg_line_length": 31.51063829787234, "alnum_prop": 0.5882125976656699, "repo_name": "gencer/sentry", "id": "229add3206070de8d8b092e287960eb4109627a0", "size": "11526"...
import django.db.models.deletion from django.db import migrations, models UNFULFILLED = "unfulfilled" PARTIALLY_FULFILLED = "partially fulfilled" def create_allocation( product_variant, warehouse, order_line, quantity_allocated, Allocation ): stock = product_variant.stocks.get(warehouse=warehouse) Alloca...
{ "content_hash": "579759b6d0601e5a359e3ca793f4016b", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 86, "avg_line_length": 33.634408602150536, "alnum_prop": 0.5067135549872123, "repo_name": "mociepka/saleor", "id": "b4d41551974a4fb65733e3a95638977238e01cb3", "size": "3177...
"""GDB Pretty printers and convenience functions for Go's runtime structures. This script is loaded by GDB when it finds a .debug_gdb_scripts section in the compiled binary. The [68]l linkers emit this with a path to this file based on the path to the runtime package. """ # Known issues: # - pretty printing only ...
{ "content_hash": "05aa69179de02c6c73223a00286e021b", "timestamp": "", "source": "github", "line_count": 396, "max_line_length": 100, "avg_line_length": 24.904040404040405, "alnum_prop": 0.6489555871020077, "repo_name": "niemeyer/golang", "id": "a96f3f3828c32e6a84991225bb0310a6fd613cde", "size": "10...
extensions = [ 'sphinx.ext.doctest', 'sphinx.ext.coverage', 'sphinx.ext.viewcode', ] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. # source_encoding = 'utf-8...
{ "content_hash": "b7d1346797532c7aea0665dda77b9328", "timestamp": "", "source": "github", "line_count": 232, "max_line_length": 82, "avg_line_length": 31.745689655172413, "alnum_prop": 0.70020366598778, "repo_name": "mjumbewu/django-nopassword", "id": "be2c265fba6c2ed5a0452b443d27427349595e8b", "si...
""" Offer numeric state listening automation rules. For more details about this automation rule, please refer to the documentation at https://home-assistant.io/components/automation/#numeric-state-trigger """ import logging import voluptuous as vol from homeassistant.const import ( CONF_VALUE_TEMPLATE, CONF_PLAT...
{ "content_hash": "3feef7044a3a396fa696c9d261a214e1", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 78, "avg_line_length": 32.01449275362319, "alnum_prop": 0.6414667270258035, "repo_name": "emilhetty/home-assistant", "id": "3a148b0880f04265c7ec82a0729705d4ef2bdcf5", "size...
import sys from thrift import Thrift from thrift.transport import TSocket from thrift.transport import TTransport from thrift.protocol import TCompactProtocol from accumulo import AccumuloProxy from accumulo.ttypes import * transport = TSocket.TSocket('localhost', 42424) transport = TTransport.TFramedTransport(trans...
{ "content_hash": "83a1517acc6c5f20832ee974e36f9404", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 89, "avg_line_length": 30.433333333333334, "alnum_prop": 0.7831325301204819, "repo_name": "phrocker/accumulo", "id": "5509ded0946a16455eea8b570a96a71ba15d4ebf", "size": "17...
"""Subclass of pnlExisting, which is generated by wxFormBuilder.""" import wx from odmtools.view import clsExisting from odmtools.odmdata import series import wx.wizard as wiz import datetime # Implementing pnlExisting #class pnlExisting(clsExisting.pnlExisting): # def __init__(self, parent): # clsExisting....
{ "content_hash": "8567aa73362ee312e16855011268ed4d", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 122, "avg_line_length": 40, "alnum_prop": 0.6387195121951219, "repo_name": "ODM2/ODMToolsPython", "id": "302bd5223b3eba295be1bb3c779dfa640022e682", "size": "3280", "binar...
from keystone import exception from keystone import tests from keystone.tests import test_backend class RulesPolicy(tests.TestCase, test_backend.PolicyTests): def setUp(self): super(RulesPolicy, self).setUp() self.config([tests.dirs.etc('keystone.conf.sample'), tests.dirs.test...
{ "content_hash": "26878911267b109de50d6aa440beb508", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 74, "avg_line_length": 36.44444444444444, "alnum_prop": 0.6189024390243902, "repo_name": "dsiddharth/access-keys", "id": "124dca152da36784f1d52aef1d41d3292a93d261", "size":...
import csv import sys import pyodbc import numpy as np #TODO:Implementar coluna com id de cada linha de transmissao dataini = "'"+str(sys.argv[1]) horaini = str(sys.argv[2])+"'" datafim = "'"+str(sys.argv[3]) horafim = str(sys.argv[4])+"'" cnxn = pyodbc.connect('DRIVER={SQL Server};SERVER=.\SQLExpress;DATABASE=DTS...
{ "content_hash": "978bb973579d7e5855fc8096277e5280", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 207, "avg_line_length": 26.41717791411043, "alnum_prop": 0.5534138411518811, "repo_name": "lucaskotres/DTS_Charts", "id": "8ff0a77ccda8637f2a99d67d00b47509f8dc30c2", "size...
__all__ = ['BasicGenerator', 'CodeGenerator', 'RandomCodeGenerator', 'GeneratorChild', 'FunctionGenerator', 'ConditionalGenerator'] # Import all submodules as classes from .basic import BasicGenerator from .code import CodeGenerator from .random import RandomCodeGenerator from .child import GeneratorChild ...
{ "content_hash": "5f74f17d0401622cc36da79f80f5d768", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 73, "avg_line_length": 36.45454545454545, "alnum_prop": 0.7955112219451371, "repo_name": "lgrahl/klausuromat", "id": "8ee7e090fcefa4ecfa632ba42dc01867550159f0", "size": "42...
from __future__ import division from math import sin, cos def eoms(_x, t, _params): """Point mass pendulum equations of motion. _x is an array/list in the following order: q1: Angle of pendulum link relative to vertical (0 downwards) u1: A[1] measure number of the inertial angular velocity o...
{ "content_hash": "86c3046dd7891786808aec7d606db2d3", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 84, "avg_line_length": 26.50515463917526, "alnum_prop": 0.6285492026448852, "repo_name": "hazelnusse/pydy", "id": "08975846f80484c523ca3699266ddf394f4dc1de", "size": "2571"...
""" Module for input/output utilities """ import numpy as np def _fmt_string(array, float_format='{}'): """makes a formatting string for a rec-array; given a desired float_format.""" fmt_string = '' for field in array.dtype.descr: vtype = field[1][1].lower() if (vtype == 'i'): ...
{ "content_hash": "ef304fecd14f18b96e371f9ca613ff01", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 82, "avg_line_length": 32.779411764705884, "alnum_prop": 0.537909376401974, "repo_name": "mrustl/flopy", "id": "947b2d718da092fab76ccb4d66eb68dfdae5535f", "size": "6687", ...
from . import ffi, librtmp __all__ = ["RTMPPacket", "PACKET_SIZE_LARGE", "PACKET_SIZE_MEDIUM", "PACKET_SIZE_SMALL", "PACKET_SIZE_MINIMUM", "PACKET_TYPE_CHUNK_SIZE", "PACKET_TYPE_BYTES_READ_REPORT", "PACKET_TYPE_CONTROL", "PACKET_TYPE_SERVER_BW", "PACKET_TYPE_CLIE...
{ "content_hash": "41fd038fc90f29069a2ed9451eb5bc4a", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 72, "avg_line_length": 28.258064516129032, "alnum_prop": 0.6024543378995434, "repo_name": "Autotonic/piny-librtmp", "id": "0bdecb50ea5a7e1326b02e4d5ddea527f9398e0c", "size...
import multiprocessing preload_app = True workers = multiprocessing.cpu_count() * 2 + 1 worker_class = 'gevent' keepalive = 60 timeout = 900 max_requests = 120 # defaults to 30 sec, setting to 5 minutes to fight `GreenletExit`s graceful_timeout = 5*60 # cryptically, setting forwarded_allow_ips (to the ip of the hqproxy...
{ "content_hash": "5216e735393031e5eb70b77b4276a215", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 99, "avg_line_length": 42.55, "alnum_prop": 0.7614571092831962, "repo_name": "gmimano/commcaretest", "id": "841bf8fe738ad5ce074f3289ead87fa8196e0d7d", "size": "851", "bin...
""" @package mi.dataset.parser.test.test_metbk_a_dcl @file marine-integrations/mi/dataset/parser/test/test_metbk_a_dcl.py @author Ronald Ronquillo @brief Test code for a metbk_a_dcl data parser In the following files, Metadata consists of 4 records. There is 1 group of Sensor Data records for each set of metadata. Fi...
{ "content_hash": "a1b311d79ca6848b618a6022dd3fd4e2", "timestamp": "", "source": "github", "line_count": 261, "max_line_length": 86, "avg_line_length": 36.91570881226053, "alnum_prop": 0.6546964193046185, "repo_name": "renegelinas/mi-instrument", "id": "58aac13c4cf0df98597e5f1e501db25b3b37fee1", "si...
"""Tests for mb.py.""" import ast import json import StringIO import os import sys import unittest import mb class FakeMBW(mb.MetaBuildWrapper): def __init__(self, win32=False): super(FakeMBW, self).__init__() # Override vars for test portability. if win32: self.src_dir = 'c:\\fake_src' s...
{ "content_hash": "09c741b510f91105c9fc6ca7b9bfcc9b", "timestamp": "", "source": "github", "line_count": 874, "max_line_length": 80, "avg_line_length": 34.59038901601831, "alnum_prop": 0.5381053188674253, "repo_name": "koobonil/Boss2D", "id": "dd475317ba4dba4ae68fc36cadfbda5d5ab5f226", "size": "3064...
import os import re import sh import pytest from binaryornot.check import is_binary PATTERN = '{{(\s?cookiecutter)[.](.*?)}}' RE_OBJ = re.compile(PATTERN) @pytest.fixture def context(): return { 'project_name': 'My Test Project', 'project_slug': 'my_test_project', 'author_name': 'Test Au...
{ "content_hash": "2e68c0210e728a3c4f29d77ad23c9add", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 72, "avg_line_length": 27.21590909090909, "alnum_prop": 0.6413361169102296, "repo_name": "aeikenberry/cookiecutter-django-rest-babel", "id": "6815751a81b72cb7d016832b1dc68ac5...
''' roverbattery.py Check battery on Brookstone Rover 2.0. Copyright (C) 2014 Simon D. Levy This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your opti...
{ "content_hash": "1da7f006f0cd1dffd55f82ebe0edb007", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 68, "avg_line_length": 26, "alnum_prop": 0.7606837606837606, "repo_name": "GearsAD/semisorted_arnerve", "id": "cc6cc8cdaa27e10526612931261208ddf53465b7", "size": "725", "...
import re import sys import hashlib from .. import DistData, SEPRTR, W_BADPRICE # Distributors definitions. from .distributor import distributor_class from .log__ import debug_overview, debug_obsessive, warning __all__ = ['dist_local_template'] if sys.version_info[0] < 3: from urlparse import urlsplit, urlunspli...
{ "content_hash": "5566f9cdaa3c5aa70ffe6f5c042b479d", "timestamp": "", "source": "github", "line_count": 157, "max_line_length": 129, "avg_line_length": 43.43312101910828, "alnum_prop": 0.5590262501833113, "repo_name": "hildogjr/KiCost", "id": "ab7df11e63320254ddc20da0465e1afded746f6a", "size": "801...
import setuptools # In python < 2.7.4, a lazy loading of package `pbr` will break # setuptools if some other modules registered functions in `atexit`. # solution from: http://bugs.python.org/issue15881#msg170215 try: import multiprocessing # noqa except ImportError: pass setuptools.setup( setup_requires=...
{ "content_hash": "ece2eab58f4d0d0bbda24a18f386ea84", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 68, "avg_line_length": 26.076923076923077, "alnum_prop": 0.7315634218289085, "repo_name": "galthaus/setup-kubernetes", "id": "43c5ca1b4969930cb18b03c78528e2e99ec147d2", "si...
import _plotly_utils.basevalidators class TicklenValidator(_plotly_utils.basevalidators.NumberValidator): def __init__( self, plotly_name="ticklen", parent_name="layout.ternary.baxis", **kwargs ): super(TicklenValidator, self).__init__( plotly_name=plotly_name, parent_n...
{ "content_hash": "177c29694a3124b9b605e3eff70d1964", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 81, "avg_line_length": 33, "alnum_prop": 0.5930735930735931, "repo_name": "plotly/plotly.py", "id": "be3d81e24e9c26f2cdbb0ea12da70e56af698def", "size": "462", "binary": f...
from __future__ import absolute_import, division, print_function __metaclass__ = type import pytest from units.modules.utils import set_module_args, exit_json, fail_json, AnsibleExitJson from ansible.module_utils import basic from ansible.modules.network.check_point import cp_mgmt_threat_indicator OBJECT = { "na...
{ "content_hash": "c10b02df9204b2e74866259bc8ff81d1", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 109, "avg_line_length": 30.92248062015504, "alnum_prop": 0.6237152168463274, "repo_name": "thaim/ansible", "id": "6cb952f4999ec0bbd718143c887a02c41f439687", "size": "4669"...
""" ConvertCSV @author: phoexer This is a lovely little script that converts my stanchart account statement to a YNAB compatible format. """ #%reset -f import os import sys import argparse import csv import pandas as pd import logging logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s -...
{ "content_hash": "0e0657ad2feb3635c1b120d2ee57665f", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 129, "avg_line_length": 29.088607594936708, "alnum_prop": 0.5870322019147084, "repo_name": "phoexer/Kelly", "id": "7f1a79982bad2c6f7bf9a72790e452c6c817f03d", "size": "2320"...
from bson.json_util import object_hook import json from mongodisco.mongo_util import get_collection ''' File: mongodb_input.py Description: ''' def _open(input_description, task=None): """Return a :class:`~mongodisco.mongodb_input.MongoWrapper` which wraps a cursor selecting just those documents relevant ...
{ "content_hash": "88fc3cb67e1a363fed6fca58fc58dac2", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 83, "avg_line_length": 30.684931506849313, "alnum_prop": 0.615625, "repo_name": "johntut/MongoDisco", "id": "b8f0faf7b30a137dcdc6ac429ba19d7d355af839", "size": "2834", "b...
import simplegui import random # helper function to initialize globals def new_game(): global cards, exposed, state, counter exposed = [] state = 0 counter = 0 cards = range(8) cards.extend(range(8)) random.shuffle(cards) for card in cards: exposed.append(False) # define e...
{ "content_hash": "6b92553a0943f88b639c2b99e2f9c0a9", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 124, "avg_line_length": 29.71875, "alnum_prop": 0.594111461619348, "repo_name": "anyaelise/interactive-python", "id": "ce1e71c578e5b7d4f21e90fab0639109e18bad81", "size": "1...
import os.path as op from nose.tools import assert_true, assert_raises import numpy as np from numpy.testing import assert_array_almost_equal, assert_array_equal import warnings import mne from mne import compute_covariance from mne.datasets import testing from mne.beamformer import lcmv, lcmv_epochs, lcmv_raw, tf_lc...
{ "content_hash": "01e9603ee21efeb939e875c926c33506", "timestamp": "", "source": "github", "line_count": 378, "max_line_length": 79, "avg_line_length": 41.84391534391534, "alnum_prop": 0.6046026427261807, "repo_name": "yousrabk/mne-python", "id": "d92c60a111d198c7d7599f37e231b1b58f80d992", "size": "...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/ship/attachment/weapon/shared_xwing_weapon1_pos_s02_1.iff" result.attribute_template_id = 8 result.stfName("item_n","ship_attachment") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return ...
{ "content_hash": "4af3bd573ad882712f4f86e450a712f5", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 94, "avg_line_length": 25.076923076923077, "alnum_prop": 0.7055214723926381, "repo_name": "anhstudios/swganh", "id": "ea53693eb123975a42ceac89d08ffc219a7af44a", "size": "47...
include NATLayer_rpc.repy # This test connects a server to a forwarder and uses waitforconn # Then it is tested to make sure it works properly with 2 clients. # However, after the first client a stopcomm is issued, so the 2nd client should not be able to connect # Then numbers 1-50 are exchanged # There is no expecte...
{ "content_hash": "b97a8c5901a8a5d98e45860e1b8a37c7", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 103, "avg_line_length": 26.614035087719298, "alnum_prop": 0.6499670402109426, "repo_name": "sburnett/seattle", "id": "b49f814012c4dcceb5217bb0494d30c005a95d46", "size": "3...
from argparse import ArgumentParser from typing import Any from zerver.lib.actions import do_rename_stream from zerver.lib.management import ZulipBaseCommand from zerver.models import get_stream class Command(ZulipBaseCommand): help = """Change the stream name for a realm.""" def add_arguments(self, parser:...
{ "content_hash": "3032325f143dc77a1e67476ea3112122", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 71, "avg_line_length": 39.03846153846154, "alnum_prop": 0.645320197044335, "repo_name": "shubhamdhama/zulip", "id": "798de1c3c0fa2f032366bd29635b2b25333b3218", "size": "101...
from __future__ import unicode_literals from django.contrib.admin.widgets import AdminFileWidget from django.forms import ( HiddenInput, FileInput, CheckboxSelectMultiple, Textarea, TextInput, PasswordInput ) from django.forms.widgets import CheckboxInput from .bootstrap import ( get_bootstrap_setting, ge...
{ "content_hash": "2138ea8b34896f2321f46f2d5decfa53", "timestamp": "", "source": "github", "line_count": 181, "max_line_length": 83, "avg_line_length": 30.29281767955801, "alnum_prop": 0.614079883275579, "repo_name": "py-geek/City-Air", "id": "989de25849cf3b4d958f6414a8608745eb7b9aa7", "size": "5507...
import argparse import json from pprint import pprint, pformat import requests def print_response(response): pad = '===========================' dpad = pad.replace('=', '-') request = response.request print("\n#===================================================" + pad) print("# %s %s %s" % (respo...
{ "content_hash": "ba46dd5deb810ea011f837e8d12ee684", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 79, "avg_line_length": 35.96511627906977, "alnum_prop": 0.5386356288393146, "repo_name": "davidlmorton/webapp-ci", "id": "ad01414a31eee780214d55c18f49eb6e29d0efc3", "size":...
from openshift_checks import OpenShiftCheck, OpenShiftCheckException, get_var from openshift_checks.mixins import NotContainerizedMixin class DiskAvailability(NotContainerizedMixin, OpenShiftCheck): """Check that recommended disk space is available before a first-time install.""" name = "disk_availability" ...
{ "content_hash": "0c82d0ffabd562ceaab0c01cd14e5bcb", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 109, "avg_line_length": 41.74242424242424, "alnum_prop": 0.6323049001814882, "repo_name": "DG-i/openshift-ansible", "id": "962148cb8b77546e4833aa1baeda1ed4dd857790", "size"...
from concurrent import futures import grpc import pytest from grpc_health.v1 import health, health_pb2, health_pb2_grpc from datadog_checks.base import AgentCheck, ConfigurationError from datadog_checks.dev.utils import get_metadata_metrics from datadog_checks.grpc_check import GrpcCheck def create_insecure_grpc_se...
{ "content_hash": "8888b0d7bdcaa91b390b66a942ff38dd", "timestamp": "", "source": "github", "line_count": 586, "max_line_length": 92, "avg_line_length": 29.064846416382252, "alnum_prop": 0.6067989666510099, "repo_name": "DataDog/integrations-extras", "id": "9c1bc410fbea1b2b7f7078753cf6488c9feb77e8", ...
from jsonrpc import ServiceProxy access = ServiceProxy("http://127.0.0.1:11000") pwd = raw_input("Enter old wallet passphrase: ") pwd2 = raw_input("Enter new wallet passphrase: ") access.walletpassphrasechange(pwd, pwd2)
{ "content_hash": "bebee903bcffb31fdc24640e62bfb87c", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 49, "avg_line_length": 44.2, "alnum_prop": 0.7601809954751131, "repo_name": "gfneto/testcoin", "id": "8b97813e89b473fd8b79e28ec4162cb8a1857d46", "size": "221", "binary": f...
import unittest import azure.mgmt.relay from devtools_testutils import AzureMgmtRecordedTestCase, ResourceGroupPreparer, recorded_by_proxy class TestMgmtRelay(AzureMgmtRecordedTestCase): def setup_method(self, method): self.relay_client = self.create_mgmt_client( azure.mgmt.relay.RelayAPI ...
{ "content_hash": "9c3c69ee72684576c48f1a3c7bbb299a", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 98, "avg_line_length": 27.863636363636363, "alnum_prop": 0.6068515497553018, "repo_name": "Azure/azure-sdk-for-python", "id": "9ae17d3f2e13ce5f7ba74a9582ee88c9642f7ae7", "s...
""" virtstrap.commands.info ----------------------- The 'info' command """ import os import shutil from virtstrap import commands from virtstrap import constants class InfoCommand(commands.ProjectCommand): """Displays information about the current project This excludes VEfile and requirements.lock "...
{ "content_hash": "fe4069d50e0df0a453e57340c030147b", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 90, "avg_line_length": 29.5, "alnum_prop": 0.6319612590799032, "repo_name": "ravenac95/virtstrap", "id": "24068de19c9863ba505f5d316e5a4d1898b36117", "size": "826", "binar...
import re from typing import Any, Dict, Optional from django.http import HttpRequest from django.views.debug import SafeExceptionReporterFilter class ZulipExceptionReporterFilter(SafeExceptionReporterFilter): def get_post_parameters(self, request: Optional[HttpRequest]) -> Dict[str, Any]: post_data = Saf...
{ "content_hash": "f15dbfc5a175229281cc50e344a652c3", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 84, "avg_line_length": 30.555555555555557, "alnum_prop": 0.5581818181818182, "repo_name": "kou/zulip", "id": "09d50e583e25a24fcfc6487ef4937b833db38b97", "size": "1100", "...
import os import shutil import subprocess import sys # Dictionary of settings that control java source compilation CONFIG = { 'out' : 'bin', 'src' : [ 'src', 'test' ], 'libraries' : [ 'third_party/junit4-4.11.jar', 'third_party/hamcrest-core-1.3.jar', 'third_party/gson-2.8.2.jar' ], 'separators'...
{ "content_hash": "83f8b2ac716bda4638a41155adbda8f9", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 91, "avg_line_length": 25.570422535211268, "alnum_prop": 0.6053428807491049, "repo_name": "lee-tammy/CodeU-Summer-2017", "id": "0292b4cf48ab62b6fa24d6caf8d2486ec124fdbd", ...
"""Add RTPLaunchRecord table Revision ID: bad90ab035ba Revises: 77c082c87844 Create Date: 2021-03-08 19:16:44.611253+00:00 """ import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = "bad90ab035ba" down_revision = "77c082c87844" br...
{ "content_hash": "447dc1c00dc3768cb5f6b21c6a7449d9", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 69, "avg_line_length": 28.736842105263158, "alnum_prop": 0.6575091575091575, "repo_name": "HERA-Team/hera_mc", "id": "808ea86744da0958223a5746293ef4c67aa9f6e7", "size": "10...
"""This example demonstrates the flow for retrieving a refresh token. In order for this example to work your application's redirect URI must be set to http://localhost:8080. This tool can be used to conveniently create refresh tokens for later use with your web application OAuth2 credentials. """ import praw import ...
{ "content_hash": "282cfefe873124a2a130f55ffab7dd19", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 78, "avg_line_length": 31.5, "alnum_prop": 0.6199294532627866, "repo_name": "RGood/praw", "id": "fb12386da2f293ab56a67cf71e5fd20d19afe120", "size": "2291", "binary": fals...
from pyqrllib.pyqrllib import bin2hstr from qrl.core.State import State from qrl.core.StateContainer import StateContainer from qrl.core.misc import logger from qrl.core.txs.Transaction import Transaction from qrl.generated.qrl_pb2 import LatticePKMetadata class LatticeTransaction(Transaction): def __init__(sel...
{ "content_hash": "af2ea58e56d3308365916377e3f92831", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 113, "avg_line_length": 40.71900826446281, "alnum_prop": 0.6444083620864623, "repo_name": "cyyber/QRL", "id": "cd5921a41cafa9a533ca1656e38589e084af19a9", "size": "4927", ...
import os from modularodm import Q from modularodm.exceptions import ModularOdmException from framework.auth.core import User from website import settings from website.app import init_app from website.conferences.model import Conference def main(): init_app(set_backends=True, routes=False) populate_confere...
{ "content_hash": "edccede2edb27c7692a6451a84b281f2", "timestamp": "", "source": "github", "line_count": 537, "max_line_length": 156, "avg_line_length": 31.945996275605214, "alnum_prop": 0.5316817254444768, "repo_name": "njantrania/osf.io", "id": "3c4c0c262f41f269a5844350d61b5590514dc7d7", "size": "...
"""Benchmarks of orthogonal matching pursuit (:ref:`OMP`) versus least angle regression (:ref:`least_angle_regression`) The input data is mostly low rank but is a fat infinite tail. """ import gc from time import time import sys import numpy as np from sklearn.linear_model import lars_path, orthogonal_mp from sklear...
{ "content_hash": "47be96e6ace8f2674102020ee3ff5f46", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 76, "avg_line_length": 35.70247933884298, "alnum_prop": 0.5243055555555556, "repo_name": "sgenoud/scikit-learn", "id": "7341c892911bc8fd0e2cf7fa22d0bf217cc1e8a6", "size": ...
from __future__ import division import numpy as np import logging np.seterr(divide='warn') import seaborn as sns import scipy.stats as pyst import scipy.signal as ssig import scipy.optimize as sopt import matplotlib.pyplot as plt from sklearn.neighbors import KernelDensity import os import json import mc_functions ...
{ "content_hash": "e9bf9be41f9d46694eec7f67698588a4", "timestamp": "", "source": "github", "line_count": 1088, "max_line_length": 216, "avg_line_length": 45.36580882352941, "alnum_prop": 0.5043761902832368, "repo_name": "ppuggioni/invivoinfer", "id": "c638cf8bc864aae53d6b24f4e08b1567e910560f", "size...
import functools import logging from html.parser import HTMLParser from io import StringIO from recipe_scrapers.settings import settings from ._interface import PluginInterface logging.basicConfig() logger = logging.getLogger(__name__) # Taken from @jksimoniii 's PR: # - https://github.com/hhursev/recipe-scrapers/...
{ "content_hash": "035ab6ba1e985af327ece66ed7db229f", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 94, "avg_line_length": 28.617283950617285, "alnum_prop": 0.640207075064711, "repo_name": "hhursev/recipe-scraper", "id": "2591815963c951933738b834988c3b81b1a35083", "size":...
import json from tests import BaseTestCase from redash.models import ApiKey, Dashboard, AccessPermission from redash.permissions import ACCESS_TYPE_MODIFY class TestDashboardListResource(BaseTestCase): def test_create_new_dashboard(self): dashboard_name = 'Test Dashboard' rv = self.make_request('p...
{ "content_hash": "f9ec1b1fe6c55d4af40815d895b2b987", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 104, "avg_line_length": 40.41772151898734, "alnum_prop": 0.6390541810209834, "repo_name": "ninneko/redash", "id": "e367094c7711863ae1af96ffb40636a8889ce45e", "size": "6386...
from django.db import models class Country(models.Model): name = models.CharField(max_length=30) class EUCountry(Country): join_date = models.DateField() class City(models.Model): name = models.CharField(max_length=30) country = models.ForeignKey(Country, models.CASCADE) class EUCity(models.Mode...
{ "content_hash": "09ababaf73ded824d1921b21ba154a5d", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 81, "avg_line_length": 26.06896551724138, "alnum_prop": 0.7275132275132276, "repo_name": "simonw/django", "id": "c84f9ad6b29a140b16951b306015740b60be9d1d", "size": "756", ...
""" MultiRenderWidget :Authors: Berend Klein Haneveld """ from vtk import vtkOpenGLGPUMultiVolumeRayCastMapper from vtk import vtkRenderer from vtk import vtkInteractorStyleTrackballCamera from vtk import vtkImagePlaneWidget from vtk import vtkVolume from vtk import vtkImageData from vtk import vtkColorTransferFunct...
{ "content_hash": "ba1f645ff7422f7d2a186e145f481a2d", "timestamp": "", "source": "github", "line_count": 372, "max_line_length": 95, "avg_line_length": 34.23924731182796, "alnum_prop": 0.7733375206092487, "repo_name": "berendkleinhaneveld/Registrationshop", "id": "2240dcbf505e5b25d952d2ed33ebf3ed4a2fa...
import csv # this was the solution from Question1 def open_with_csv(filename, d='\t'): data = [] with open(filename, encoding='utf-8') as tsvin: tsvin = csv.reader(tsvin, delimiter=d) for row in tsvin: data.append(row) return data
{ "content_hash": "eb0d5a2a2b266ec0d6c01c2bd86d8716", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 51, "avg_line_length": 30.333333333333332, "alnum_prop": 0.6153846153846154, "repo_name": "katychuang/python-data-sci-basics", "id": "39f27148d19571ec6fd7cdf70a57c5a333fde072"...