text
stringlengths
4
1.02M
meta
dict
"""Python wrappers around TensorFlow ops. This file is MACHINE GENERATED! Do not edit. Original C++ source file: audio_ops.cc """ import collections as _collections import six as _six from tensorflow.python import pywrap_tensorflow as _pywrap_tensorflow from tensorflow.python.eager import context as _context from te...
{ "content_hash": "a0ed615d184f746482c02553b2da56f2", "timestamp": "", "source": "github", "line_count": 542, "max_line_length": 975, "avg_line_length": 39.6309963099631, "alnum_prop": 0.6806797020484171, "repo_name": "ryfeus/lambda-packs", "id": "7187ddb0a6a8f61dfb3019d043e53ec6c2b1a394", "size": "...
import os import pytest from pandas import read_csv, read_table class BaseParser: engine = None low_memory = True float_precision_choices = [] def update_kwargs(self, kwargs): kwargs = kwargs.copy() kwargs.update(dict(engine=self.engine, low_memory=self.low_memory)) return ...
{ "content_hash": "936001179ef41539b264ad9a256c697b", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 75, "avg_line_length": 22.209876543209877, "alnum_prop": 0.6837131739855475, "repo_name": "kushalbhola/MyStuff", "id": "2c347a096006a9a052fdb77b8bfad03bc96f9ce2", "size": "...
import sys import os up_time_quanta = 2000 f = open(sys.argv[1]) announce_histogram = {} node_uptime_histogram = {} counter = 0; for line in f: counter += 1 # if counter % 1000 == 0: # print '\r%d' % counter, try: if 'distance:' in line: l = line.split(' ') idx = l.index('distance:') d = int(l[idx+1...
{ "content_hash": "b60eb6803709c0a4d96c0def606388c7", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 76, "avg_line_length": 25.216216216216218, "alnum_prop": 0.6666666666666666, "repo_name": "dikshie/instrumented-rasterbar-libtorrent", "id": "9303e8c86582322729cd64d9610bda62...
import numpy as np def plot_place(ax, location="upper right", offset=0.02): bbox = ax.get_position() ratio = bbox.bounds[2]/bbox.bounds[3] if ratio < 1.0: xoffset, yoffset = offset, offset/ratio else: xoffset, yoffset = offset/ratio, offset if location == "upper right": x, ...
{ "content_hash": "e68db257242557cf0480f707cf8b39df", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 76, "avg_line_length": 29.70212765957447, "alnum_prop": 0.5508595988538681, "repo_name": "mrshannon/asen-3113-lab3-software", "id": "b9916c47beb3701fa4aa9b61b2f20501b08f2d8f"...
import os import eventlet from oslo.config import cfg from nova import exception from nova.i18n import _ from nova.openstack.common import importutils from nova.openstack.common import log as logging from nova.openstack.common import loopingcall from nova.servicegroup import api evzookeeper = importutils.try_import(...
{ "content_hash": "9035ceb5f1b269b7a8c036397c5b7e9f", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 78, "avg_line_length": 39.66901408450704, "alnum_prop": 0.5778448428901118, "repo_name": "srajag/nova", "id": "9ba3ae64f98287b053fdcbf1681c08146fb622ea", "size": "6266", ...
import urllib import os from PIL import Image import numpy as np def download(url, path, overwrite=False): if os.path.exists(path) and not overwrite: return print('Downloading {} to {}.'.format(url, path)) urllib.URLopener().retrieve(url, path) def get_mobilenet(): url = 'https://docs-assets.d...
{ "content_hash": "38d3f94ea70491d4bfd368323fe1517c", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 142, "avg_line_length": 37.57575757575758, "alnum_prop": 0.6895161290322581, "repo_name": "mlperf/training_results_v0.6", "id": "0a39053b6d47edfb608effd356421a43b884fa9e", ...
from graphql import build_schema, execute_sync, parse from graphql.utilities import get_introspection_query from ..fixtures import big_schema_sdl # noqa: F401 def test_execute_introspection_query(benchmark, big_schema_sdl): # noqa: F811 schema = build_schema(big_schema_sdl, assume_valid=True) document = pa...
{ "content_hash": "1279cad2f320c9708c7a02212bcf90e2", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 78, "avg_line_length": 42.09090909090909, "alnum_prop": 0.7602591792656588, "repo_name": "graphql-python/graphql-core", "id": "4c30d96596b4f7557e4a86de0095f55a0d01251a", "s...
""" RenderPipeline Copyright (c) 2014-2016 tobspr <tobias.springer1@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 without restriction, including without limitation the right...
{ "content_hash": "4866d3b9b98298aef2ef09a6a98589cf", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 98, "avg_line_length": 35.39041095890411, "alnum_prop": 0.6018966518289143, "repo_name": "croxis/SpaceDrive", "id": "79f090b7f3ffbda5811fb2bd4ae443d2a5a559be", "size": "51...
"""pool but no finish.""" import multiprocessing as mp import wandb import yea def do_run(num): run = wandb.init() run.config.id = num run.log(dict(s=num)) return num def main(): wandb.require("service") wandb.setup() num_proc = 4 pool = mp.Pool(processes=num_proc) result = poo...
{ "content_hash": "5006af1d9753c98d2933a1c8334ac6e4", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 72, "avg_line_length": 18.366666666666667, "alnum_prop": 0.5970961887477314, "repo_name": "wandb/client", "id": "64713e29d07cd9c8742e80b6c4366feeb4f6d5cf", "size": "573", ...
import os import sys sys.path.insert(0, os.path.abspath('../tk_tools')) print('cwd: ', os.getcwd()) print('sys path', sys.path) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphin...
{ "content_hash": "a9f2402274fe4c0c24692364f5160545", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 79, "avg_line_length": 29.746753246753247, "alnum_prop": 0.6540056756166776, "repo_name": "slightlynybbled/tk_tools", "id": "837e267619f80852d7f3db86ed6c75ca9593c517", "si...
"""Support for HomeKit Controller locks.""" from __future__ import annotations from typing import Any from aiohomekit.model.characteristics import CharacteristicsTypes from aiohomekit.model.services import Service, ServicesTypes from homeassistant.components.lock import STATE_JAMMED, LockEntity from homeassistant.co...
{ "content_hash": "dd0cf80e7106d5ccc3ea6a635740c577", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 87, "avg_line_length": 33.207692307692305, "alnum_prop": 0.6583275422747278, "repo_name": "rohitranjan1991/home-assistant", "id": "248bb93a68f6c82bf935cf466ade6a332945243e",...
"""generated automatically by auto_dao.py""" from __future__ import division from sql_dao import SQLDAO from vistrails.db.versions.v1_0_4.domain import * class DBMashupAliasSQLDAOBase(SQLDAO): def __init__(self, daoList): self.daoList = daoList self.table = 'mashup_alias' def getDao(self, d...
{ "content_hash": "f28aa190b64f8a154c61ab1755c6340f", "timestamp": "", "source": "github", "line_count": 8316, "max_line_length": 229, "avg_line_length": 47.498075998076, "alnum_prop": 0.5452487885891938, "repo_name": "VisTrails/VisTrails", "id": "fc342985c81a329ad496d61b515033c552017391", "size": "...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: zabbix_template short_description: Create/update/delete/dum...
{ "content_hash": "04c3069349ce18052135d8a4f5075575", "timestamp": "", "source": "github", "line_count": 737, "max_line_length": 131, "avg_line_length": 37.92265943012212, "alnum_prop": 0.5955848151991127, "repo_name": "thaim/ansible", "id": "275288d7f5512b5c8776d1527879ae518a59eb6d", "size": "28106...
from sys import stdin _ = int(stdin.readline()) words = stdin.readline().split() _ = int(stdin.readline()) positions = [int(x) for x in stdin.readline().split()] for pos in positions: words[pos-1] = '*' * len(words[pos-1]) print ' '.join(str(word) for word in words)
{ "content_hash": "df84c24eb5caf94791f0930975c94713", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 54, "avg_line_length": 24.90909090909091, "alnum_prop": 0.6496350364963503, "repo_name": "AntoineAugusti/katas", "id": "4cef8a2487b85e37de8de2ac174d1c8fe21b9361", "size": "...
""" Turtle graphics is a popular way for introducing programming to kids. It was part of the original Logo programming language developed by Wally Feurzig and Seymour Papert in 1966. Imagine a robotic turtle starting at (0, 0) in the x-y plane. After an ``import turtle``, give it the command turtle.forward(15), and it...
{ "content_hash": "9ae0e9e43f4369a4a803468d2cf773eb", "timestamp": "", "source": "github", "line_count": 4010, "max_line_length": 97, "avg_line_length": 34.4211970074813, "alnum_prop": 0.5458200812872657, "repo_name": "tequa/ammisoft", "id": "264318effc3dc2d803ea9ab7fcf9c0e9cedf80f6", "size": "13904...
from operator import itemgetter from .enums import WEBSOCKET_UPDATE_0SECOND from .websockets import BinanceSocketManager class DepthCache(object): _symbol = None _bids = {} _asks = {} def __init__(self, symbol): """Intialise the DepthCache :param symbol: Symbol to create depth cach...
{ "content_hash": "fe8c6241d5785ea0f2485e2b002c3cb4", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 106, "avg_line_length": 23.936842105263157, "alnum_prop": 0.46745822339489884, "repo_name": "57s/BeastTools", "id": "146bd3cbd6f5b58730ec1f510ba85e38bd1abd29", "size": "45...
from __future__ import division, print_function from sqlalchemy import exists from sqlalchemy.sql import func, and_ from .tables import Run, Tract, Patch, Source from .connect import connect, Session __all__ = ['HugsIngest'] class HugsIngest(object): def __init__(self, session, run_name): self.run_n...
{ "content_hash": "c5611d43c0fc7ae74adba4341eace36f", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 78, "avg_line_length": 35.358024691358025, "alnum_prop": 0.5831005586592178, "repo_name": "johnnygreco/hugs", "id": "3fddf9168dedb8be4496bc35d2f17486c0527bae", "size": "286...
try: from setuptools import setup except ImportError: from distutils.core import setup with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read().replace('.. :changelog:', '') requirements = [ 'pash>=1.1.0' ] test_...
{ "content_hash": "313a1f0abbe0f45af3ec118b5e765654", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 84, "avg_line_length": 25.708333333333332, "alnum_prop": 0.6296596434359806, "repo_name": "iansmcf/busybees", "id": "99d9ec029e950c143b97a45a01889bc00745cbe6", "size": "128...
from django.conf import settings from django import template from social.backends.utils import load_backends register = template.Library() @register.assignment_tag def get_social_backends(*args, **kwargs): """Returns a dictionary of social enabled backends, in the form: {'backend name': backend class }""" r...
{ "content_hash": "3a9d6761416bec890a76cca2598edf1b", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 104, "avg_line_length": 31.166666666666668, "alnum_prop": 0.7700534759358288, "repo_name": "georgeyk/quickstartup", "id": "3b0eee89e1ceadafc490228650bdb57c24904476", "size"...
from .material import * from .emitter import * from .absorber import * from .lambert import * from .dielectric import * from .conductor import * from .modifiers import *
{ "content_hash": "30fdd07a0b937326780d9a6f829c80e4", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 25, "avg_line_length": 19.11111111111111, "alnum_prop": 0.7441860465116279, "repo_name": "raysect/source", "id": "9c75b535741fb84278a32063a2ee3d62060b0bbc", "size": "1778", ...
""" POLL APP This module describes the poll model. Classes: PollQuestion PollAnswer Functions: n/a Created on 26 Mar 2013 @author: michael """ from django.conf import settings from django.contrib.sites.models import Site from django.db import models from tunobase.core import models as core_models fro...
{ "content_hash": "b1e76686e500a47d6dab587178de9cdd", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 69, "avg_line_length": 25.91304347826087, "alnum_prop": 0.6772930648769575, "repo_name": "unomena/tunobase", "id": "c05f3d340e929b09ee5554f70e8be6d9cd24af91", "size": "1788...
""" Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ from lib.core.enums import HTTP_HEADER __product__ = "SecureIIS Web Server Security (BeyondTrust)" def detect(get_page): page, headers, code = get_page() retval = code != 404 page, hea...
{ "content_hash": "fcb7ddc30afdf9c8c7cf34c995942efb", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 131, "avg_line_length": 32.86666666666667, "alnum_prop": 0.6957403651115619, "repo_name": "V11/volcano", "id": "425ebdfe581a3cb1985e9811b9e96ce897fe4ff8", "size": "516", ...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('workshops', '0067_person_username_regexvalidator'), ] operations = [ migrations.AddField( model_name='person', name='occupat...
{ "content_hash": "3e4d3c9ee12c1c19d76771cdeb5abbf7", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 123, "avg_line_length": 29, "alnum_prop": 0.6041979010494752, "repo_name": "vahtras/amy", "id": "62c04d899fda3fef23bab90cbab934570d04deb9", "size": "691", "binary": false...
from .base import BaseTestCase class CommitteesSearchTestCase(BaseTestCase): url_tmpl = '/api/v1/committees/' data = dict(state='ex', chamber='lower') def test_count(self): self.assertEquals( len(self.json), self.db.committees.find(self.data).count()) def test_correc...
{ "content_hash": "ad80d078ad2c6c92c18cfb1fb468f47f", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 83, "avg_line_length": 30.130434782608695, "alnum_prop": 0.6024531024531025, "repo_name": "mileswwatkins/billy", "id": "78afcf71652870da56500058a34f2096aef0cd9d", "size": "...
""" Test suite for VMwareAPI. """ import urllib2 import mox from oslo.config import cfg from nova.compute import power_state from nova.compute import task_states from nova import context from nova import db from nova import exception from nova import test import nova.tests.image.fake from nova.tests import matchers f...
{ "content_hash": "bd40c1d49b3bb91cedaa5da8099351b9", "timestamp": "", "source": "github", "line_count": 412, "max_line_length": 78, "avg_line_length": 38.050970873786405, "alnum_prop": 0.6058557121898323, "repo_name": "sridevikoushik31/nova", "id": "f63e403d6d9820f405eee1bc7910249bfdb7a812", "size"...
""" Implementation of basic functions. """ from __future__ import division from __future__ import absolute_import from __future__ import print_function import numpy as np from ._core import Mean from ..kernels._distances import rescale, dist __all__ = ['Zero', 'Constant', 'Linear', 'Quadratic'] class Zero(Mean): ...
{ "content_hash": "b5e10be0581d877718e87caa8d6f3882", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 69, "avg_line_length": 26.165354330708663, "alnum_prop": 0.5356605476978634, "repo_name": "mwhoffman/reggie", "id": "10160f4c985ce8b7c49a79a6b05e1b96a949b011", "size": "33...
from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from __future__ import print_function import numpy as np import pandas as pd from sklearn.decomposition import PCA from scipy.interpolate import splev, splrep import logging log = logging.getLogger(__name__...
{ "content_hash": "49e1d5751f1b055012773f48ae7c8f3a", "timestamp": "", "source": "github", "line_count": 270, "max_line_length": 99, "avg_line_length": 34.8, "alnum_prop": 0.5964240102171137, "repo_name": "hadim/spindle_tracker", "id": "b17e16a9d908756f4e7c9bfdc40fff09dc64acfa", "size": "9421", "b...
import datetime import hashlib import os import csv import codecs import cStringIO from django.core.paginator import Paginator, InvalidPage, EmptyPage from django.conf import settings def _upload_path(tag): def _upload_path_tagged(instance, filename): now = datetime.datetime.now() path = os.path....
{ "content_hash": "f9e27e604ad8039e277e8f4e375de4e7", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 75, "avg_line_length": 30.529411764705884, "alnum_prop": 0.6292870905587669, "repo_name": "mozilla/gameon", "id": "42d4060b8b23d863007543e45296b14550cee566", "size": "2595"...
"""Tests for optimizers.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf def _setup_model(): x = tf.placeholder(tf.float32, []) var = tf.get_variable("test", [], initializer=tf.constant_initializer(10)) loss = tf.abs(var *...
{ "content_hash": "ab04b625d54d1d6b2ac9cbb2d4145d42", "timestamp": "", "source": "github", "line_count": 322, "max_line_length": 80, "avg_line_length": 45.67080745341615, "alnum_prop": 0.5470556235550116, "repo_name": "pierreg/tensorflow", "id": "fb76fd20b4a2cdee0ff3ca2d423bca8c10db292b", "size": "1...
""" classes representing meta data used in COMBINE Archives, such as the OMEX meta data """ from datetime import datetime from xml.etree import ElementTree try: # Python 3 from urllib.parse import urlparse, urljoin except ImportError: # Python 2 from urlparse import urlparse, urljoin import combinearch...
{ "content_hash": "287aa8e31535a32c99179d634cd595ad", "timestamp": "", "source": "github", "line_count": 337, "max_line_length": 144, "avg_line_length": 36.97329376854599, "alnum_prop": 0.6202247191011236, "repo_name": "FreakyBytes/pyCombineArchive", "id": "a533fd44833262a63bbbbced30830f5c9074df26", ...
""" UCF101 action recognition process functions. """ from __future__ import print_function, division import os import numpy as np import progressbar from dbcollection.datasets import BaseTask from dbcollection.utils.file_load import load_txt from dbcollection.utils.string_ascii import convert_str_to_ascii as str2asc...
{ "content_hash": "4ca918795a54e5ba4196a1d8dad01044", "timestamp": "", "source": "github", "line_count": 243, "max_line_length": 99, "avg_line_length": 39.36625514403292, "alnum_prop": 0.5137988710014635, "repo_name": "dbcollection/dbcollection", "id": "e45e13b59fa93d5406bc3372df48e1960fb30abc", "si...
from __future__ import annotations import unittest from unittest import mock from airflow.providers.amazon.aws.operators.s3 import S3ListPrefixesOperator TASK_ID = 'test-s3-list-prefixes-operator' BUCKET = 'test-bucket' DELIMITER = '/' PREFIX = 'test/' MOCK_SUBFOLDERS = ['test/'] class TestS3ListOperator(unittest....
{ "content_hash": "d00f8e6e7be6184668a018903c124e8a", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 109, "avg_line_length": 30.857142857142858, "alnum_prop": 0.7268518518518519, "repo_name": "cfei18/incubator-airflow", "id": "967dd692069c07d6ca238d76e3fc8b56bd0c93ea", "si...
'''OpenGL extension EXT.read_format_bgra This module customises the behaviour of the OpenGL.raw.GLES1.EXT.read_format_bgra to provide a more Python-friendly API The official definition of this extension is available here: http://www.opengl.org/registry/specs/EXT/read_format_bgra.txt ''' from OpenGL import platform,...
{ "content_hash": "192e725174e544fe4bd4c08a79e0cb9f", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 71, "avg_line_length": 33.869565217391305, "alnum_prop": 0.7907573812580231, "repo_name": "alexus37/AugmentedRealityChess", "id": "4a70e5d098b5a68897a8612b3b89d853b30b74ca", ...
""" .. function:: serialize(obj) Serialize the object to JSON. .. function:: deserialize(obj) Deserialize JSON-encoded object to a Python object. """ # Try to import a module that provides json parsing and emitting, starting # with the fastest alternative and falling back to the slower ones. try: # cj...
{ "content_hash": "3f314df2328b738ff92c1e9c9241b10e", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 74, "avg_line_length": 29.342105263157894, "alnum_prop": 0.6430493273542601, "repo_name": "runeh/carrot", "id": "0bdb314e1d15778b71b85d169bbbbea922ebf44a", "size": "1115", ...
"""test_utils""" import os, sys, time, unittest from nose.tools import eq_, assert_raises from routes.util import controller_scan, GenerationException from routes import * class TestUtils(unittest.TestCase): def setUp(self): m = Mapper(explicit=False) m.minimization = True m.connect('archi...
{ "content_hash": "ec942696627a37814dcc88960b351f2c", "timestamp": "", "source": "github", "line_count": 959, "max_line_length": 130, "avg_line_length": 50.5140771637122, "alnum_prop": 0.5963709927130855, "repo_name": "bbangert/routes", "id": "e2a6a0489f00e03ff30e44cad5e4185c2898ed65", "size": "4844...
import yaml, shutil, os, sys from collections import OrderedDict # Placeholder region code used when particular location has no region specified. # Shouldn't match any of subdivision codes defined by ISO 3166-2 UNKNOWN_REGION_CODE = ".NONE" DEFAULT_OUTPUT_BASENAME = "country" PARSER_HINT_TAG = "flags" TODO_MARKER = "(...
{ "content_hash": "f9cf2d816996ce6b664eccb0ac105a8a", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 118, "avg_line_length": 36.45238095238095, "alnum_prop": 0.6209993468321359, "repo_name": "sergeuz/locode", "id": "fa20f071779017edc5435ed7e938e04cbd9a3441", "size": "6341...
"""fb Revision ID: 0844c85671d9 Revises: Create Date: 2017-09-05 21:42:15.234396+00:00 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '0844c85671d9' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto generated...
{ "content_hash": "0c8b23e2a23739cd441cd45c104ee002", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 101, "avg_line_length": 37.26315789473684, "alnum_prop": 0.6807909604519774, "repo_name": "yolosec/zeman-parser", "id": "b6145e1fd09c15f247d71f7b464c87358ad6bbd9", "size": ...
from __future__ import absolute_import import unittest import six import mock from telemetry import project_config from telemetry.internal.backends.chrome import chrome_startup_args from telemetry.internal.browser import browser_options as browser_options_module from telemetry.util import wpr_modes class FakeBrowser...
{ "content_hash": "326b62a4e09d6f4719b989c9ce6d556b", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 80, "avg_line_length": 34.19469026548673, "alnum_prop": 0.6915113871635611, "repo_name": "catapult-project/catapult", "id": "ef0bac6f99b99f3b2066d77c16193eff5ee6ef50", "si...
from os.path import join, dirname, abspath import yaml CONFIG = join(dirname(abspath(__file__)), "config.yml") with open(CONFIG, "r") as config: config = yaml.load(config) for database in config["databases"]: print "DROP DATABASE IF EXISTS %s;" % database print "DROP ROLE IF EXISTS %s;" % config["usernam...
{ "content_hash": "3bc0aeb51c1309ab7a3d7edd37b52bb2", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 95, "avg_line_length": 28, "alnum_prop": 0.6842105263157895, "repo_name": "pyfarm/pyfarm-build", "id": "fd8397891344e818648b9d3d8623693d11f2e935", "size": "532", "binary"...
from flask import Markup, url_for from sqlalchemy import Column, Integer, Float, String, ForeignKey, Text from sqlalchemy.orm import relationship from flask.ext.appbuilder.models.mixins import ImageColumn from flask.ext.appbuilder.filemanager import ImageManager from flask.ext.appbuilder import Model from flask_appbuil...
{ "content_hash": "f254e7eca764b1cc3bde1f9f093f6f0e", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 145, "avg_line_length": 36.702127659574465, "alnum_prop": 0.6295652173913043, "repo_name": "zhounanshu/Flask-AppBuilder", "id": "1e942a8de3f58eedc1752c6ffd735412ada42f63", ...
from datetime import datetime from utils.Dir import Dir from utils.Text import Text class DateDomainWriter(object): def __init__(self, domain, base_dump_directory='./raw_data'): self._str_now = (datetime.now().strftime("%m_%d_%y")) self._root_dir = base_dump_directory + '/' + self._str_now + '/' +...
{ "content_hash": "6d760b64341c521616f96060a3568aab", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 87, "avg_line_length": 33.2, "alnum_prop": 0.6144578313253012, "repo_name": "DanielDeychakiwsky/abstraction-engine", "id": "57fc1d8d6fee3f5fc31601dd44e87f53bff03875", "size...
import smbus import time import math import RPi.GPIO as GPIO import struct import sys debug =0 if sys.version_info<(3,0): p_version=2 else: p_version=3 rev = GPIO.RPI_REVISION if rev == 2 or rev == 3: bus = smbus.SMBus(1) else: bus = smbus.SMBus(0) # I2C Address of Arduino address = 0x04 # Command Format # dig...
{ "content_hash": "716cf26a2e82cb67d73069d9a77e12ce", "timestamp": "", "source": "github", "line_count": 523, "max_line_length": 129, "avg_line_length": 28.90248565965583, "alnum_prop": 0.7083223074887537, "repo_name": "royveshovda/pifog", "id": "c6d3feb9fb25d3445066b9d328392780378d0e11", "size": "1...
from operator import mul import numpy as np from numpy.random import randint from numpy.lib import Arrayterator def test(): np.random.seed(np.arange(10)) # Create a random array ndims = randint(5)+1 shape = tuple(randint(10)+1 for dim in range(ndims)) els = reduce(mul, shape) a = np.arange(el...
{ "content_hash": "7e05274170242488d2729b57dcf81c14", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 61, "avg_line_length": 28.302325581395348, "alnum_prop": 0.6392769104354972, "repo_name": "efiring/numpy-work", "id": "4215696516c8ce44b0c90a95086c97dd1c82f826", "size": "1...
import werkzeug.serving import gevent.monkey gevent.monkey.patch_all() @werkzeug.serving.run_with_reloader def runServer(): from bakery.app import app, register_blueprints import os from werkzeug.wsgi import SharedDataMiddleware register_blueprints(app) app = SharedDataMiddleware(app, { '/...
{ "content_hash": "6c50a32d366d35ca0794560c30917274", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 75, "avg_line_length": 31.333333333333332, "alnum_prop": 0.6580547112462006, "repo_name": "vitalyvolkov/fontbakery", "id": "4e79b3e1923128168a292bdf6173faac35531aa8", "size...
from __future__ import unicode_literals, division, absolute_import, print_function from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import codecs import collections import contextlib import logging import logging.handlers import sys import threading import uuid import warnings import os ...
{ "content_hash": "3787cb23de097dd2b97f239587001a03", "timestamp": "", "source": "github", "line_count": 236, "max_line_length": 116, "avg_line_length": 34.771186440677965, "alnum_prop": 0.6715817694369973, "repo_name": "OmgOhnoes/Flexget", "id": "be164c090aabe10bb9ae4a1e64c468c094fb7549", "size": "...
from cosmo_tester.framework.examples import get_example_deployment from cosmo_tester.framework.util import get_resource_path from . import validate_agent def test_3_2_agent_install(image_based_manager, ssh_key, logger, test_config): # Check agent install with the 3.2 types and 1.2 DSL version via ssh example...
{ "content_hash": "a8dbd5740450d70a77da5baa27e5202a", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 78, "avg_line_length": 45.11764705882353, "alnum_prop": 0.6792698826597132, "repo_name": "cloudify-cosmo/cloudify-system-tests", "id": "29c0af2046cc7d3bb7a5f9a4fd8ef25e1d8b83...
import numpy as np from math import sqrt # Fibonacci version 1 in exponential time. # The running time of fib1(n) is proportional to 2^(0.69n) ~ (1.6)^n, so it takes 1.6 times longer to compute Fn+1 than Fn. def fib1(n): if n == 0: return 0 if n == 1: return 1 return fib1(n-1) + fib1(n-2) # Fibonacci v...
{ "content_hash": "ca3a1fdd0eb97a38bc2bdffdfcac071a", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 278, "avg_line_length": 38.39393939393939, "alnum_prop": 0.664561957379637, "repo_name": "AlexOuyang/CSE-20", "id": "1b85ed7d8c2cc7fb5d2d333dd5de3aa30aee10ef", "size": "126...
import logging import subprocess import sys from rejviz import nic from rejviz import tmp logging.basicConfig(level=logging.INFO) LOG = logging.getLogger(__name__) def main(): try: tmp_dir = tmp.create_dir() LOG.debug('Created tmp directory %s', tmp_dir) virt_builder_args = _process_arg...
{ "content_hash": "75694e933ef46e7e6adb12b4d279e376", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 65, "avg_line_length": 24.03125, "alnum_prop": 0.6605981794538361, "repo_name": "jistr/rejviz", "id": "a09808b79e4da1b7e9a8b49d8151a839826b16aa", "size": "1315", "binary"...
# This is only needed for Python v2 but is harmless for Python v3. #import sip #sip.setapi('QString', 2) import math from PySide import QtCore, QtGui import diagramscene_rc class Arrow(QtGui.QGraphicsLineItem): def __init__(self, startItem, endItem, parent=None, scene=None): super(Arrow,...
{ "content_hash": "22289170e833f489ec3ebdf03795d5f6", "timestamp": "", "source": "github", "line_count": 787, "max_line_length": 133, "avg_line_length": 39.0571791613723, "alnum_prop": 0.617444205868957, "repo_name": "cherry-wb/SideTools", "id": "57f2ea01cbad8ba00fd6e8a780ac86c8ae245f97", "size": "3...
from __future__ import absolute_import from __future__ import division # Copyright (c) 2010-2019 openpyxl import math #constants DEFAULT_ROW_HEIGHT = 15. # Default row height measured in point size. BASE_COL_WIDTH = 13 # in characters DEFAULT_COLUMN_WIDTH = 51.85 # in points, should be characters DEFAULT_LEFT_MA...
{ "content_hash": "b3c466a3fc53a7f730611e919c5093c6", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 109, "avg_line_length": 24.34259259259259, "alnum_prop": 0.6884747052111069, "repo_name": "kawamon/hue", "id": "393af3e27458d578dfd3909b665e1816eac36110", "size": "2629", ...
""" El proposito de este experimento es analizar la convergencia del método de Newton para diferentes magnitudes de x0 y de alphas. Graficaremos una escala logaritimica en x 10^-n..10^n y veremos cuantas iteraciones tarda en converger. """ import itertools from copy import deepcopy from math import sqrt from pylab i...
{ "content_hash": "75b37687dcb8670a3925dd16438c84db", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 141, "avg_line_length": 24.678571428571427, "alnum_prop": 0.6852387843704776, "repo_name": "metnum/2013-1c-tp1", "id": "4beb7c24b9018a72020c0f4367789ef664e9b8c5", "size": "...
from rest_framework import generics from rest_framework import status from rest_framework.response import Response from rest_framework import permissions from django.contrib.auth.models import User from django.shortcuts import get_object_or_404 from apps.core.serializers import * from apps.core.models import * from dja...
{ "content_hash": "076373c42a3a74317fa4eeaeaaf7425c", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 94, "avg_line_length": 34.317460317460316, "alnum_prop": 0.6433857539315448, "repo_name": "dparizek/newecosystems", "id": "32078d3577f9689fa55ce6c9a2d6558f98497819", "size...
from __future__ import unicode_literals from flask import session from jinja2.filters import do_filesizeformat from indico.core import signals from indico.core.logger import Logger from indico.core.settings.converters import EnumConverter from indico.modules.events.features.base import EventFeature from indico.module...
{ "content_hash": "b2e14d51e9c778ce36f02e9e708b58cc", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 114, "avg_line_length": 37.12605042016807, "alnum_prop": 0.6933001358080579, "repo_name": "OmeGak/indico", "id": "d0b1893cdb5b85dfa3fac17a9b07ec787f68e5dd", "size": "4632"...
import sys, os from PySide import QtCore, QtGui class Window(QtGui.QWidget): def __init__(self, startDirectory): super(Window, self).__init__() self.init_(startDirectory) def init_(self, startDirectory): self.startButton = QtGui.QPushButton('START', self) self.startButton.setFixedSize(QtCore.QSize(2...
{ "content_hash": "8774b2c5db742522197e2a9b6167a08e", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 104, "avg_line_length": 41.17857142857143, "alnum_prop": 0.6816999132697311, "repo_name": "stwb/winestart", "id": "ca38b49eeadbac3128be9100a8833143d189cae6", "size": "1176"...
"""Implementation of JSONDecoder """ import re import sys import struct from jsb.contrib.simplejson.scanner import make_scanner def _import_c_scanstring(): return None c_scanstring = _import_c_scanstring() __all__ = ['JSONDecoder'] FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL def _floatconstants(): _BYTES...
{ "content_hash": "62ed3aaa486d167526a7e2cc3c5853d9", "timestamp": "", "source": "github", "line_count": 418, "max_line_length": 78, "avg_line_length": 35.995215311004785, "alnum_prop": 0.5438654791971288, "repo_name": "melmothx/jsonbot", "id": "468b32f8e3a8434d4113f98b2f88bc9669945358", "size": "15...
""" test.test_common ~~~~~~~~~~~ Test common utility code. """ import logging import mock import os import unittest import calico.common as common # Logger log = logging.getLogger(__name__) class TestCommon(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_va...
{ "content_hash": "bf6681bcf3eceefb45d620335eea7c53", "timestamp": "", "source": "github", "line_count": 95, "max_line_length": 69, "avg_line_length": 44.04210526315789, "alnum_prop": 0.643642447418738, "repo_name": "fasaxc/felix", "id": "08229e60f6dcff504a1f68220c7a278e48669998", "size": "4791", ...
import os import sys import traceback import webbrowser import pyqrcode import requests import mimetypes import json import xml.dom.minidom import urllib import time import re import random from traceback import format_exc from requests.exceptions import ConnectionError, ReadTimeout import HTMLParser from datetime impo...
{ "content_hash": "e83aea23be4e5a6d069eb2591fb7ebab", "timestamp": "", "source": "github", "line_count": 1511, "max_line_length": 420, "avg_line_length": 39.651224354731966, "alnum_prop": 0.49523475706441006, "repo_name": "Detailscool/YHSpider", "id": "13ad10d060cc5acc0bfc80e4c4f9ea949c4f5149", "siz...
"""Test transaction signing using the signrawtransaction* RPCs.""" from test_framework.address import check_script, script_to_p2sh from test_framework.key import ECKey from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, assert_raises_rpc_error, find_vout_for_add...
{ "content_hash": "a2771af38df440ab1b0625de32f24bca", "timestamp": "", "source": "github", "line_count": 233, "max_line_length": 712, "avg_line_length": 53.8412017167382, "alnum_prop": 0.6953367875647668, "repo_name": "alecalve/bitcoin", "id": "b962e1c3a552bedb8643a91326c780fbc045496a", "size": "127...
import csv import datetime import json import os # my lib import vra_helper def get_race_name(f, rest): _, f_name = os.path.split(f) return f_name.replace(rest, "").strip() def read_split_data(f): """ Read the content of a Concept2 VRA split data file. """ result = {} with open(f) as csvfi...
{ "content_hash": "390e88c8537b3c34ee446afac84a5fd1", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 122, "avg_line_length": 32.56934306569343, "alnum_prop": 0.5432541461228149, "repo_name": "ruderphilipp/regatta", "id": "5e192046d6124c626bf7dfde888d79c55810e598", "size":...
"""Delegate accounts are used to provide secure access to the XMLRPC API. They are normal Unix accounts with a shell that tunnels XMLRPC requests to the API server.""" from pwd import getpwnam from grp import getgrnam import logger import tools import accounts class Controller(accounts.Account): SHELL = '/usr/bi...
{ "content_hash": "ce282e8246d3e6d1abed20331d5b5b7f", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 107, "avg_line_length": 32.567567567567565, "alnum_prop": 0.6506224066390042, "repo_name": "planetlab/NodeManager", "id": "9979370d5398c92e2f6ea47ec48e2a8bda552594", "size"...
"""Enable Filter Select Revision ID: f1f2d4af5b90 Revises: e46f2d27a08e Create Date: 2016-11-23 10:27:18.517919 """ # revision identifiers, used by Alembic. revision = 'f1f2d4af5b90' down_revision = 'e46f2d27a08e' from alembic import op import sqlalchemy as sa def upgrade(): op.add_column('datasources', sa.Co...
{ "content_hash": "fb360ebdcbccaddec1ff5c8c8cd03615", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 72, "avg_line_length": 27.4, "alnum_prop": 0.6423357664233577, "repo_name": "alanmcruickshank/superset-dev", "id": "36bae518ce0637fcfaa884f4ed50132ed2881fae", "size": "685"...
"""Support for Meteoclimatic sensor.""" import logging from homeassistant.components.sensor import SensorEntity from homeassistant.config_entries import ConfigEntry from homeassistant.const import ATTR_ATTRIBUTION from homeassistant.core import HomeAssistant from homeassistant.helpers.update_coordinator import ( C...
{ "content_hash": "5e64ee61a854fd862044c4c78012b40b", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 88, "avg_line_length": 30.666666666666668, "alnum_prop": 0.644524959742351, "repo_name": "sander76/home-assistant", "id": "b5a07ad06e6622d798045e4a2951484e99d18816", "size"...
from stratiform.base import NameableAWSObject, prop from stratiform.utils import Wrapper class Parameter(NameableAWSObject): class Type(Wrapper): pass Type.String = Type('String') Type.Number = Type('Number') Type.ListNumber = Type('List<Number>') Type.Comm...
{ "content_hash": "eaab2d3346e7d56d79d1988f0475af7a", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 77, "avg_line_length": 40.973333333333336, "alnum_prop": 0.6068987959648552, "repo_name": "drbild/stratiform", "id": "4b86a81776bc50cd187fad969af8032c65262c9b", "size": "36...
def get_grid_index_for_ray_point(ray, ray_idx, n_depth_pts): """Given a ray and a particular point along that ray, return the corresponding grid point index.""" if ray.mu < 0: return (ray_idx) else: return (n_depth_pts - ray_idx - 1) def get_ray_index_for_grid_point(ray, grid_idx, n_depth_p...
{ "content_hash": "ce81b1ce569958ef1d68bfed01e95825", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 127, "avg_line_length": 42.61538461538461, "alnum_prop": 0.6389891696750902, "repo_name": "bcfriesen/PyRT", "id": "49dd5753c00824fa1f039a6c77ff5bb2f1b08dd9", "size": "554",...
from __future__ import unicode_literals import psutil from .base import Metric, MetricData class Memory(Metric): TYPE = 'memory' def collect(self): virtual_memory = psutil.virtual_memory() return [MetricData( name=self.measurement, tags=self.tags, fields=...
{ "content_hash": "7157c5db8f910427f6a5f21ec5000217", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 54, "avg_line_length": 29, "alnum_prop": 0.5386444708680143, "repo_name": "falgore88/grafana-metrics", "id": "3028915402c667a45c81cc2bd8db3ed82006a06e", "size": "856", "b...
import base64 import os import re import random import shutil import socket import string import json import ipaddress import charms.leadership from shutil import move from shlex import split from subprocess import check_call from subprocess import check_output from subprocess import CalledProcessError from charms ...
{ "content_hash": "3c955314c25b7c005993033f2a2eed2a", "timestamp": "", "source": "github", "line_count": 1233, "max_line_length": 79, "avg_line_length": 37.15409570154096, "alnum_prop": 0.6531837331645238, "repo_name": "rajatchopra/kubernetes", "id": "37f89197812a062fc04273b3c85b7eca822d56e6", "size...
# Comment out or delete your code after finishing each challenge. # Here is a big list of names to have fun with!! # from: http://deron.meranda.us/data/census-derived-all-first.txt names = [ "Rosanna", "Kristofer", "Yesenia", "Lovie", "Reita", "Merrilee", "Glenna", "Liz", "Wen", "Danille", "Josefine"...
{ "content_hash": "54435144f5ea54c8834863b8b7f1fb9c", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 85, "avg_line_length": 53.96666666666667, "alnum_prop": 0.6084002470660902, "repo_name": "google/teknowledge", "id": "afb169eba3f1f96ae523fc1490916e6e487e57f4", "size": "33...
import functools from django import http from django.shortcuts import get_object_or_404 from olympia.access import acl from olympia.addons.models import Addon def owner_or_unlisted_reviewer(request, addon): return (acl.check_unlisted_addons_reviewer(request) or # We don't want "admins" here, because...
{ "content_hash": "eea2efc70f525bcf90324eb1ea65797e", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 79, "avg_line_length": 40.186440677966104, "alnum_prop": 0.6149304091100801, "repo_name": "psiinon/addons-server", "id": "735d8ef8907555ad06c46800934223fb0ab862f1", "size":...
from __future__ import unicode_literals from django.db import migrations import phonenumber_field.modelfields class Migration(migrations.Migration): dependencies = [ ('app', '0010_auto_20170204_1835'), ] operations = [ migrations.AddField( model_name='patient', n...
{ "content_hash": "edbb8586040d7c16eca3d3541b91fb42", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 94, "avg_line_length": 23.63157894736842, "alnum_prop": 0.6347438752783965, "repo_name": "cqw1/palliassist_webportal", "id": "d815b4f0969c23360503e1d512650195b997f200", "si...
from django import template register = template.Library() from django.template import Node, TemplateSyntaxError, Variable from django.core.mail import mail_admins try: from hashlib import md5 except ImportError: from md5 import md5 import struct from urlparse import urljoin from os import remove, rename from ...
{ "content_hash": "cd56da1676d0e9d5d0295686f35f0e88", "timestamp": "", "source": "github", "line_count": 298, "max_line_length": 91, "avg_line_length": 41.43624161073826, "alnum_prop": 0.6145934564301911, "repo_name": "akaihola/django-cairo-text", "id": "4bd6cefa910f91c7ba49789a6353846e5c0d3d49", "s...
import xmpp import feedparser from models import * import time,re import urllib login = '<Your feeder bot>' pwd = '<your feeder bot password>' # Lets login jid=xmpp.JID(login) user, server = jid.getNode(), jid.getDomain() cnx = xmpp.Client(server,debug=[]) conres = cnx.connect(server=('talk.google.com',5223)) authr...
{ "content_hash": "ac858211b2b603e9b9a7d463d1cfd87d", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 106, "avg_line_length": 30.944444444444443, "alnum_prop": 0.5230400957510473, "repo_name": "electrosocial/buzztracker", "id": "47e2ba25906336227f25d64ff7666d987a4780cf", "s...
from tests import * import unittest if __name__ == '__main__': testsuite = unittest.TestLoader().discover('.') unittest.TextTestRunner(verbosity=1).run(testsuite)
{ "content_hash": "5658c9e9608d7614d1af4a1e06ae0410", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 55, "avg_line_length": 28.666666666666668, "alnum_prop": 0.686046511627907, "repo_name": "ecohealthalliance/EpiTator", "id": "abf4caa66c5bf44e089f2efe1dad9a4b974e96cb", "siz...
import ibis def test_column_ref_quoting(translate): schema = [('has a space', 'double')] table = ibis.table(schema) assert translate(table['has a space']) == '`has a space`' def test_identifier_quoting(translate): schema = [('date', 'double'), ('table', 'string')] table = ibis.table(schema) ...
{ "content_hash": "5c04533f83bb009a0d7a38eed7d0ecb7", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 66, "avg_line_length": 30, "alnum_prop": 0.6043478260869565, "repo_name": "cloudera/ibis", "id": "da65a4cd0e9ce8c2f6538ed843033bf0a8cd4f66", "size": "690", "binary": fals...
"""Configuration and hyperparameter sweeps.""" from lra_benchmarks.image.configs.cifar10 import base_cifar10_config def get_config(): """Get the hyperparameter configuration.""" config = base_cifar10_config.get_config() config.model_type = "longformer" config.model.num_layers = 4 config.model.emb_dim = 128...
{ "content_hash": "102a59cb0a34843302c0209fadbc5d51", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 68, "avg_line_length": 25.7, "alnum_prop": 0.7237354085603113, "repo_name": "google-research/long-range-arena", "id": "8b91c7548a82bebc26bd73c2eb9b76863458bad4", "size": "1...
""" astropy.cosmology contains classes and functions for cosmological distance measures and other cosmology-related calculations. See the `Astropy documentation <http://docs.astropy.org/en/latest/cosmology/index.html>`_ for more detailed usage examples and references. """ from __future__ import (absolute_import, divis...
{ "content_hash": "fc28ef0e3b647a98a097756b32731b8c", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 69, "avg_line_length": 37.27272727272727, "alnum_prop": 0.748780487804878, "repo_name": "nhmc/xastropy", "id": "ac9f99f6f60b9becd44d5f1c6fefe4639be389b0", "size": "474", ...
import fixtures from essential import lockutils class LockFixture(fixtures.Fixture): """External locking fixture. This fixture is basically an alternative to the synchronized decorator with the external flag so that tearDowns and addCleanups will be included in the lock context for locking between t...
{ "content_hash": "6c9cc53d246063640a56a62b78c39047", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 79, "avg_line_length": 34.72222222222222, "alnum_prop": 0.6528, "repo_name": "zhangxiaolins/python_base", "id": "fd3a97f802bd7cede248f64d083def014b46ee9d", "size": "1887", ...
from sklearn import svm import numpy as np np.random.seed(1) CSV_START_COLUMN = 6 CSV_END_COLUMN = 53 DATASET = np.genfromtxt('training.csv', delimiter=',', skip_header=1, usecols=np.arange(CSV_START_COLUMN,CSV_END_COLUMN), invalid_raise=False) X = DATASET[:,:46] Y = DATASET[:,46] def combineData(values1, valu...
{ "content_hash": "5c1821c67b8107104e133ab9317ef664", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 76, "avg_line_length": 20.239520958083833, "alnum_prop": 0.6556213017751479, "repo_name": "sidharthrajaram/NBA-Predict", "id": "2956d45b77c1001ce9b848fda693f0b31f6dcfd8", ...
inmoov = Runtime.createAndStart("inmoov","InMoov") inmoov.startRightHand("COM7") inmoov.rightHand.index.setMinMax(0,160) inmoov.rightHand.thumb.setMinMax(55,135) inmoov.rightHand.majeure.setMinMax(50,170) inmoov.rightHand.ringFinger.setMinMax(48,145) inmoov.rightHand.pinky.setMinMax(30,168) sleep(1) inmoov.rightHand.st...
{ "content_hash": "5dc1350c1e24c9b3023382d518f75849", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 50, "avg_line_length": 37.5, "alnum_prop": 0.8213333333333334, "repo_name": "MyRobotLab/pyrobotlab", "id": "bb02c3a17966e33f1382c48dd1cf5c2cb1b3b2f8", "size": "375", "bin...
from werkzeug.wsgi import DispatcherMiddleware from .app import create_app application = DispatcherMiddleware(create_app(config_name='production'))
{ "content_hash": "a98ab7f2e1586fbadf770609ce3942d9", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 72, "avg_line_length": 30, "alnum_prop": 0.8266666666666667, "repo_name": "RRCKI/prodsys-pa", "id": "868d09d43ff1d7c03687fff67254a590b010f4fd", "size": "580", "binary": fa...
import pytest from pock.matchers import ExactValueMatcher, AnyValueMatcher, Matcher, MatchCriteria def test_base_matcher(): matcher = Matcher() with pytest.raises(NotImplementedError): matcher == 1 with pytest.raises(NotImplementedError): matcher != 1 with pytest.raises(NotImplemen...
{ "content_hash": "cd990753fffc884635f0770c9e251146", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 102, "avg_line_length": 26.221374045801525, "alnum_prop": 0.6847161572052402, "repo_name": "atbentley/pock", "id": "8fa732953f9f253ef2f583cfd6e11385ce0d2500", "size": "343...
from xml.dom.minidom import parseString from xml.etree.ElementTree import tostring, SubElement, Element from datetime import datetime from dateutil.parser import parse from api import XeroPrivateClient, XeroException from api import XERO_BASE_URL, XERO_API_URL import urllib class XeroException404(XeroException): p...
{ "content_hash": "fd72d432f2efde05538fccc79ace5e2f", "timestamp": "", "source": "github", "line_count": 277, "max_line_length": 93, "avg_line_length": 35.55234657039711, "alnum_prop": 0.5115759545085297, "repo_name": "jaydlawrence/XeroPy", "id": "4e3b9a7095892c5c6a79741d4c726721520ac1af", "size": "...
from org.myrobotlab.service import Runtime from org.myrobotlab.document.transformer import WorkflowConfiguration from org.myrobotlab.document.transformer import StageConfiguration # create the pipeline service pipeline = runtime.start("docproc", "DocumentPipeline") # create a pipeline # pipeline.workflowName = "default...
{ "content_hash": "35d7c56390c4e28af39472dcdee0164f", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 96, "avg_line_length": 46.6, "alnum_prop": 0.8267167381974249, "repo_name": "MyRobotLab/myrobotlab", "id": "a1fbfe7e58e669d1063ed24293fa0847ceb396fd", "size": "1981", "bi...
from django.conf.urls import include, url from todo import views urlpatterns = [ url(r'^$', views.home), ]
{ "content_hash": "c459fe68c9b4b26ab9a0352d5ca0e318", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 41, "avg_line_length": 18.666666666666668, "alnum_prop": 0.6875, "repo_name": "gregwym/djangoProjectStructure", "id": "4c5f0f08332877b88c07acbf72aa2b50918cdd60", "size": "11...
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 'Badge.points' db.add_column('badges_badge', 'points', self.gf('django.db.models.fields.IntegerField')(defaul...
{ "content_hash": "273815b2284449e6a829e2a3090bb242", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 182, "avg_line_length": 73.57522123893806, "alnum_prop": 0.5449843637238393, "repo_name": "KendyllD/boukenda-project", "id": "d9af5011bfafcb6d7db1bc1b4fb3c4976f8623f6", "s...
import django from django.conf.urls import include, url from django.contrib import admin if django.VERSION < (1, 9): admin_urls = include(admin.site.urls) else: admin_urls = admin.site.urls urlpatterns = [ url(r'^admin/', admin_urls), ]
{ "content_hash": "f2a3f83d6c320a82c48ec1c4812463bc", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 41, "avg_line_length": 19.384615384615383, "alnum_prop": 0.6944444444444444, "repo_name": "kbussell/django-auditlog", "id": "c9346f253732cdabc684d84ab0d2656d8cb11e16", "siz...
import tensorflow as tf import numpy as np from data import * def weight_variable(shape, name=None): initial = tf.truncated_normal(shape, stddev=0.1) if name: return tf.Variable(initial, name) else: return tf.Variable(initial) def bias_variable(shape, name=None): initial = tf.constant(0.1, shape=shap...
{ "content_hash": "8704c3ff890c36acebcc1c41414e0059", "timestamp": "", "source": "github", "line_count": 327, "max_line_length": 108, "avg_line_length": 35.37003058103976, "alnum_prop": 0.5972678540549887, "repo_name": "evanthebouncy/nnhmm", "id": "01bed6b445b0593cbaaa211bd64b0736b18ec589", "size": ...
import os ####### Database config. This assumes Postgres ####### INTERNAL_IPS = ['127.0.0.1'] DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'commcarehq', 'USER': 'commcarehq', 'PASSWORD': 'commcarehq', 'HOST': 'localhost', '...
{ "content_hash": "d7ea63b3077a9c5f709d9846c80075c1", "timestamp": "", "source": "github", "line_count": 304, "max_line_length": 173, "avg_line_length": 37.625, "alnum_prop": 0.5922364049659031, "repo_name": "qedsoftware/commcare-hq", "id": "2766c80476b4299030b31c4c91674a89cef44985", "size": "11438"...
import struct import zlib def parse_from(binary): """ Turn a packed binary message as recieved from a Kafka broker into a :class:`Message`. """ # A message. The format of an N byte message is the following: # 1 byte "magic" identifier to allow format changes # 4 byte CRC32 of the payload # N - 5 byte payloa...
{ "content_hash": "b2c21db760847d5195874d3e5911e7cf", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 108, "avg_line_length": 29.6, "alnum_prop": 0.6593468468468469, "repo_name": "xujun10110/pykafka", "id": "32e1d4049e5f054caf5e93a3b4bfd9d691bdda43", "size": "1776", "bina...
from collections import OrderedDict from service import api_client import logging LOGGER = logging.getLogger(__name__) healthchecks = OrderedDict([ ('digital-register-api', api_client.check_health), ]) # TODO: tested through test_app - should have its own tests now def perform_healthchecks(): LOGGER.debug("...
{ "content_hash": "0f89a1582706395c05a0e36d9f3790fe", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 100, "avg_line_length": 38.054545454545455, "alnum_prop": 0.6798853320592451, "repo_name": "LandRegistry/digital-register-frontend", "id": "afd340426ab1e127c58abb034bd8eacb7a...
import re import os import base64 import uuid from pprint import pprint import config COMMAND = '~' ''' This module operates like ‘textnet’ filesystem: - finds files by set of tags - gets data from known ‘root’ nodes NO CACHE YET Quite naive and messed up implementation. Fragments will probably become classes '''...
{ "content_hash": "eaae0b787af2fd48d66136b72b09cdd8", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 125, "avg_line_length": 35.16393442622951, "alnum_prop": 0.5620823620823621, "repo_name": "textnet/protoserver", "id": "cc46e691b2b4d7a419df3adc776f43758f8e9845", "size": ...
""" Test for the deletion of L{BatchManholePowerup}. """ from axiom.batch import BatchManholePowerup from axiom.test.historic.stubloader import StubbedTest class BatchManholePowerupTests(StubbedTest): def test_deletion(self): """ The upgrade to schema version 2 deletes L{BatchManholePowerup}. ...
{ "content_hash": "1a995ebda6b4f21595327f967bb2a6b6", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 74, "avg_line_length": 28.857142857142858, "alnum_prop": 0.7252475247524752, "repo_name": "hawkowl/axiom", "id": "2836595f9653f2799d96bb426905b20008197168", "size": "461", ...
""" werkzeug.wrappers ~~~~~~~~~~~~~~~~~ The wrappers are simple request and response objects which you can subclass to do whatever you want them to do. The request object contains the information transmitted by the client (webbrowser) and the response object contains all the information...
{ "content_hash": "4da33cbadcf3b2d9542d33143b6c4d70", "timestamp": "", "source": "github", "line_count": 1640, "max_line_length": 83, "avg_line_length": 43.43353658536585, "alnum_prop": 0.6165152812679873, "repo_name": "Glottotopia/aagd", "id": "676e3bf3817ad47f38ea48854a65382b1af45e86", "size": "71...
""" Copyright (C) 2012 Alan J Lockett 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": "567b1463715b6912e511f42ecbd37d4a", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 460, "avg_line_length": 36.77828054298642, "alnum_prop": 0.6434547244094488, "repo_name": "hypernicon/pyec", "id": "b975e5a6c8ad45d7361b438babb2c386e308c378", "size": "812...
class TreeNode: def __init__(self, d): self.left = None self.right = None self.data = d def __lt__(self, other): return self.data < other.data def __repr__(self): return self.data class Tree: def __init__(self): self.root = None def add(self, d): newNode = TreeNode(d) if self.root == None: s...
{ "content_hash": "b4e1e8bb0b84bcdb7028a6c7e6256f26", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 39, "avg_line_length": 18.476190476190474, "alnum_prop": 0.6237113402061856, "repo_name": "capsci/chrome", "id": "4ba1858be38df90967675eadde33a0f577a18c57", "size": "776", ...
""" Revision ID: 0258_service_postage_nullable Revises: 0257_letter_branding_migration Create Date: 2019-02-12 11:52:53.139383 """ import sqlalchemy as sa from alembic import op revision = "0258_service_postage_nullable" down_revision = "0257_letter_branding_migration" def upgrade(): # ### commands auto genera...
{ "content_hash": "4250bfb3067693b07d55975eb89e495e", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 94, "avg_line_length": 33.57692307692308, "alnum_prop": 0.7033218785796106, "repo_name": "alphagov/notifications-api", "id": "711a6f90dea115731eb637ba1e9ae8a7b4806b56", "si...
""" Created on Fri Mar 4 20:44:24 2016 @author: ddboline """ from __future__ import (absolute_import, division, print_function, unicode_literals) import os # nasbase = '/media/dileptonnas/Documents' nasbase = '/media/sabrent2000/Documents' def remove_leftover_avi(run_command=False): naspaths = ('%s/television'...
{ "content_hash": "20ab44d2061b7d15d874620dd9f449e8", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 84, "avg_line_length": 33, "alnum_prop": 0.5151515151515151, "repo_name": "ddboline/movie_collection_app", "id": "0809529bd777334a79e8ce77638c748da1ad5dae", "size": "1070",...
from sfa.client.sfaserverproxy import SfaServerProxy from sfa.util.xml import XML # GeniLight client support is optional try: from egeni.geniLight_client import * except ImportError: GeniClientLight = None class Interface: """ Interface to another SFA service, typically a peer, or the loca...
{ "content_hash": "992dae2a7f9a6c463e516af76252f89f", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 93, "avg_line_length": 36.413333333333334, "alnum_prop": 0.5822043207616258, "repo_name": "yippeecw/sfa", "id": "2f4614618d9810918321438302b483f01a8f2067", "size": "2731", ...
import datetime from django.utils import timezone from utils import * RCD_PER_PAGE = 8 def user_own_events(request, userid): context = {} context['user_info'] = get_object_or_404(UserInfo, user__username=userid) event_list = Event.objects.filter(topic__user__exact=context['user_info'].user).order_by("-time_period...
{ "content_hash": "81e362e8123ca42d295e685f1b55ff56", "timestamp": "", "source": "github", "line_count": 227, "max_line_length": 296, "avg_line_length": 37.36123348017621, "alnum_prop": 0.7372951302912393, "repo_name": "zhubw91/biyemaijianbing", "id": "cb6a7861f75dc5ff43d768b9226fc73b6dac45e3", "siz...
from django.apps import AppConfig from django.core.management import settings class ODM2AdminConfig(AppConfig): name = '{}'.format(settings.APP_NAME) verbose_name = '{}'.format(settings.VERBOSE_NAME)
{ "content_hash": "cfc768d1e935ac98ed020b0a2f131869", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 53, "avg_line_length": 30, "alnum_prop": 0.7476190476190476, "repo_name": "miguelcleon/ODM2-Admin", "id": "2a83bdf29bf73da17ac76e1333665bb7b11f230e", "size": "210", "binar...
import os import logging from datetime import datetime import typing import jinja2 import markupsafe import pymongo from pymongo.errors import DuplicateKeyError from tg import tmpl_context as c, app_globals as g import tg from ming import schema from ming.orm.base import session from ming.orm.property import (FieldPr...
{ "content_hash": "19b498ebab2681fad109e3514daf4c2d", "timestamp": "", "source": "github", "line_count": 860, "max_line_length": 119, "avg_line_length": 34.967441860465115, "alnum_prop": 0.5725591912742751, "repo_name": "apache/allura", "id": "2c40db80fad3df0864e2d95883a818ccb829ab14", "size": "3094...