text
stringlengths
4
1.02M
meta
dict
from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='MarketSegment', fields=[ ('id', models.AutoField(auto_created=True, primary_...
{ "content_hash": "dc3ba5707c87ad98df3f8a8bc8edb824", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 114, "avg_line_length": 28.185185185185187, "alnum_prop": 0.5216819973718791, "repo_name": "Semprini/cbe-retail", "id": "c03485eb1867d5b450471c7d51b1c26b4efb6eef", "size": ...
from __future__ import absolute_import, division, unicode_literals from future.builtins import int, open, str from hashlib import md5 from json import loads import os from dublincore.models import AbstractQualifiedDublinCoreTerm import re try: from urllib.request import urlopen from urllib.parse import urlenc...
{ "content_hash": "c30657a8f409c36c894b2a7a406e9784", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 131, "avg_line_length": 33.04854368932039, "alnum_prop": 0.7379553466509988, "repo_name": "hydroshare/hydroshare_temp", "id": "5a1a2465c084963e2dea07fb7b7b6287693b8fe8", "...
import asposewordscloud from asposewordscloud.WordsApi import WordsApi from asposewordscloud.WordsApi import ApiException from asposewordscloud.models import ProtectionRequest import asposestoragecloud from asposestoragecloud.StorageApi import StorageApi from asposestoragecloud.StorageApi import ResponseMessage apiK...
{ "content_hash": "224c521948255fd6e78e9503f9c31cb0", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 96, "avg_line_length": 34.254901960784316, "alnum_prop": 0.7418431597023469, "repo_name": "asposewords/Aspose_Words_Cloud", "id": "d5e398aab542a7288adf9e0e5a6748219f533ca3", ...
import re from typing import Dict from pandas import DataFrame from lib.data_source import DataSource from lib.time import datetime_isoformat class OxfordGovernmentResponseDataSource(DataSource): def parse_dataframes( self, dataframes: Dict[str, DataFrame], aux: Dict[str, DataFrame], **parse_opts ) ->...
{ "content_hash": "2ff3aa46cac9bf50a3e3f6a0196ea43e", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 97, "avg_line_length": 42.88059701492537, "alnum_prop": 0.6028541594152453, "repo_name": "GoogleCloudPlatform/covid-19-open-data", "id": "39d3a1dec97e6eb6877dc01b5a45ba273bb4...
import tests.model_control.test_ozone_custom_models_enabled as testmod testmod.build_model( ['Fisher'] , ['ConstantTrend'] , ['BestCycle'] , ['AR'] );
{ "content_hash": "f4da4fd667d66159bcd5b314fb2c9975", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 79, "avg_line_length": 38, "alnum_prop": 0.7039473684210527, "repo_name": "antoinecarme/pyaf", "id": "18557cdb85b92b9513a340e59a8e3499d21e2541", "size": "152", "binary": f...
from argparse import ArgumentParser from datetime import datetime from subprocess import Popen from malmopy.agent import QLearnerAgent, TemporalMemory from malmopy.environment.gym import GymEnvironment try: from malmopy.visualization.tensorboard import TensorboardVisualizer from malmopy.visualization.tensorbo...
{ "content_hash": "fea55196471a07b9a91b3e276af349ba", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 82, "avg_line_length": 39.535714285714285, "alnum_prop": 0.6172086720867209, "repo_name": "village-people/flying-pig", "id": "7cfe7717ed32b3abdd05c2ef775b10cd0bc703f4", "s...
from migen import * # Goals: # - understand how to create simple logical core # - understand how to create a FSM # Indications: # You can choose to code the clock core with only # - If/Elif/Else in Migen: # https://m-labs.hk/migen/manual/fhdl.html#statements # # or with # # - a FSM in Migen: # https://github.com/m-la...
{ "content_hash": "413fadd3e2d46f7da5bd076e4924ca95", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 100, "avg_line_length": 26.401869158878505, "alnum_prop": 0.4715044247787611, "repo_name": "litex-hub/fpga_101", "id": "97a317222f67a2f7a553018d90e1c8170b6cd43c", "size": ...
from __future__ import absolute_import, unicode_literals, division def use(**kwargs): """ Updates the active resource configuration to the passed keyword arguments. Invoking this method without passing arguments will just return the active resource configuration. @returns The previou...
{ "content_hash": "8b744fb064b751951aa8d71d97ee0738", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 71, "avg_line_length": 24.1, "alnum_prop": 0.7053941908713693, "repo_name": "armet/python-armet", "id": "0a904fdf3e49915a3dc1a15e5a5154c2d39b3d72", "size": "506", "binary...
from django import forms from haystack.forms import FacetedSearchForm from crispy_forms.layout import * from crispy_forms.bootstrap import * import datetime class MyForm(FacetedSearchForm): #faceted_choices = (('author', 'Author'), ('creators', 'Creators'),('subjects', 'Subjects'), # ('publi...
{ "content_hash": "587168024435001b72c069c7b1057c8e", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 140, "avg_line_length": 50.107142857142854, "alnum_prop": 0.6478973627940128, "repo_name": "hydroshare/hydroshare", "id": "1ca2bd7f3d491dd624ab0c95b1fe5268058babbf", "size"...
import mock from oslo_config import cfg from arsenal.director import scheduler from arsenal.strategy import base as sb from arsenal.tests.unit import base CONF = cfg.CONF def strat_directive_mock(): return [ sb.CacheNode('node-a', 'image-a', 'checksum-a'), sb.CacheNode('node-b', 'image-b', 'chec...
{ "content_hash": "56f8f3f83c0366e59a1bfbfc3ff00e64", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 78, "avg_line_length": 43.06748466257669, "alnum_prop": 0.653988603988604, "repo_name": "rackerlabs/arsenal", "id": "9c3c5e6e553a9f5a766f529510e8bc1c9cfda506", "size": "76...
import unittest from django import forms from django.forms.utils import ErrorList from django.core.exceptions import ValidationError from wagtail.wagtailcore import blocks class TestFieldBlock(unittest.TestCase): def test_charfield_render(self): block = blocks.CharBlock() html = block.render("He...
{ "content_hash": "f9d78b9fd5dc9d744a48832def3b88a0", "timestamp": "", "source": "github", "line_count": 872, "max_line_length": 157, "avg_line_length": 38.518348623853214, "alnum_prop": 0.5878885316184351, "repo_name": "dresiu/wagtail", "id": "f1a839af4229f8f73010453993f3d05aeff9d25f", "size": "335...
"""Type classes for LIT inputs and outputs. These are simple dataclasses used in model.input_spec() and model.output_spec() to describe the semantics of the model outputs, while allowing clients to still use flexible data structures. These are used by the LIT framework to configure front-end components and to enable ...
{ "content_hash": "33b32f3ef2e5e4b7b7127cf46c5cb099", "timestamp": "", "source": "github", "line_count": 421, "max_line_length": 96, "avg_line_length": 34.5938242280285, "alnum_prop": 0.7131969239219994, "repo_name": "pair-code/lit", "id": "af193f20f1989862867696e178f3eb9d2d56224f", "size": "15238",...
from __future__ import print_function import airflow from airflow.operators.python_operator import PythonOperator from airflow.models import DAG import os args = { 'owner': 'airflow', 'start_date': airflow.utils.dates.days_ago(2) } dag = DAG( dag_id='example_kubernetes_executor', default_args=args, sc...
{ "content_hash": "d8ff7f5fe6b4259c3106072f9abc7ecb", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 89, "avg_line_length": 27.354430379746834, "alnum_prop": 0.5761221656640444, "repo_name": "fenglu-g/incubator-airflow", "id": "d03e255ab3287504083e0a038740f07da9db5d86", "s...
from tempest.api.compute import base from tempest import test class AZAdminV3Test(base.BaseComputeAdminTest): """ Tests Availability Zone API List """ _api_version = 3 @classmethod def setUpClass(cls): super(AZAdminV3Test, cls).setUpClass() cls.client = cls.os_adm.availability...
{ "content_hash": "344bb7e925eb662d5054b28c0726726f", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 74, "avg_line_length": 29.18918918918919, "alnum_prop": 0.6787037037037037, "repo_name": "vmahuli/tempest", "id": "9555367bbdc4be08a7b3dfc1ae2c2067d3165532", "size": "1711"...
""" Configures MySQLdb driver-specific aspects of the db layer. """ def process_dsn(dsn): """ Take a standard DSN-dict and return the args and kwargs that will be passed to the MySQLdb Connection constructor. We use the t.e.adbapi.ConnectionPool kwargs here to provide a callback that fixes broken connections, ...
{ "content_hash": "bc4bbab5076d20edeed6ee57fd3d1643", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 100, "avg_line_length": 26.272727272727273, "alnum_prop": 0.7231833910034602, "repo_name": "philchristensen/modu", "id": "004506133184d3fbb0b774c6a7137e26890543ff", "size":...
from runner.koan import * class AboutTuples(Koan): def test_creating_a_tuple(self): count_of_three = (1, 2, 5) self.assertEqual(5, count_of_three[2]) def test_tuples_are_immutable_so_item_assignment_is_not_possible(self): count_of_three = (1, 2, 5) try: count_of_th...
{ "content_hash": "fa64d598baec24981fc377b8dc6f28d0", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 91, "avg_line_length": 35.61194029850746, "alnum_prop": 0.5670578373847444, "repo_name": "pnichols104/python-koans", "id": "b1c522a111ed313839a4313b3e64a36437af65bc", "size...
import json import os import socket import httplib2 try: from urlparse import urljoin except ImportError: from urllib.parse import urljoin class HTTPError(Exception): """ An error response from the API server. This should be an HTTP error of some kind (404, 500, etc). """ def __init__(self...
{ "content_hash": "3451bf85acad50299dd49ac920355ccc", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 80, "avg_line_length": 33.34426229508197, "alnum_prop": 0.5599803343166175, "repo_name": "vshn/pyrabbit-debian", "id": "15630c3e5bd60bf5353d1796cdab339b389bbc46", "size": ...
"""Example DAG demonstrating the DummyOperator and a custom DummySkipOperator which skips by default.""" from airflow import DAG from airflow.exceptions import AirflowSkipException from airflow.operators.dummy_operator import DummyOperator from airflow.utils.dates import days_ago args = { 'owner': 'airflow', } ...
{ "content_hash": "1f24e0be65e7f422ac7cf68204aac260", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 104, "avg_line_length": 32.95348837209303, "alnum_prop": 0.7148906139731828, "repo_name": "mrkm4ntr/incubator-airflow", "id": "7a0cc675911c3eb14db82491555f4183545a58f6", "s...
try: import astroquery except ImportError: print('-----------------------------------------------------------') print('-----------------------------------------------------------') print('WARNING: Not loading modules in xastropy.obs except radec. \n Install astroquery if you want them') print('----...
{ "content_hash": "296c411b8203e32d86e85a3944362ffe", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 111, "avg_line_length": 33.06666666666667, "alnum_prop": 0.43951612903225806, "repo_name": "profxj/old_xastropy", "id": "59b77ae12a7a197851a4932701fd58c388b6bb2e", "size": ...
""" CIFAR-10 dataset. This module will download dataset from https://www.cs.toronto.edu/~kriz/cifar.html and parse train/test set into paddle reader creators. The CIFAR-10 dataset consists of 60000 32x32 colour images in 10 classes, with 6000 images per class. There are 50000 training images and 10000 test images. """ ...
{ "content_hash": "f467335f821e848c1f42496f43e627e7", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 82, "avg_line_length": 34.137724550898206, "alnum_prop": 0.5884932467988072, "repo_name": "kuke/models", "id": "20b32b504e9245c4ff3892f08736d800080daab4", "size": "6536", ...
""" Copyright (c) 2013, SMART Technologies ULC All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the fo...
{ "content_hash": "01741854d0d72fef9d11dad901c72357", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 150, "avg_line_length": 38.993975903614455, "alnum_prop": 0.6326278387146609, "repo_name": "foo123/sikuli-framework", "id": "adfa0c8f0fb7af1ba360015921b16b389697be18", "si...
from sys import version_info if version_info >= (2,6,0): def swig_import_helper(): from os.path import dirname import imp fp = None try: fp, pathname, description = imp.find_module('_almath', [dirname(__file__)]) except ImportError: import _almath ...
{ "content_hash": "d4c2ec8ac0c04a7b0705393427b97026", "timestamp": "", "source": "github", "line_count": 2531, "max_line_length": 113, "avg_line_length": 37.22797313314895, "alnum_prop": 0.6240872813720496, "repo_name": "AliGhahraei/nao-classroom", "id": "0766d8b81378f443b539a8990e16513e6cb43a82", "...
"""Self-test suite for Crypto.PublicKey.RSA""" __revision__ = "$Id$" import os import pickle from pickle import PicklingError from Crypto.Util.py3compat import * import unittest from Crypto.SelfTest.st_common import list_test_cases, a2b_hex, b2a_hex class RSATest(unittest.TestCase): # Test vectors from "RSA-OAE...
{ "content_hash": "5c5305eff75e7000be69515977ac3b3f", "timestamp": "", "source": "github", "line_count": 291, "max_line_length": 85, "avg_line_length": 37.99312714776632, "alnum_prop": 0.6192112879884226, "repo_name": "marcuskelly/recover", "id": "839ab25ce2a35f88dd6f7f102a66be3a8aa1bc88", "size": "...
from __future__ import absolute_import from django.core.management.base import BaseCommand from ..internal import IntentsSchema class AlexaBaseCommand(BaseCommand): def add_arguments(self, parser): parser.add_argument( "args", metavar="app_label", nargs="*", ...
{ "content_hash": "fab4bde6970043bea2893036a47194fb", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 62, "avg_line_length": 30.419354838709676, "alnum_prop": 0.5334040296924708, "repo_name": "rocktavious/django-alexa", "id": "4e4a52da1ede506d9c6ceb99866022eab425b471", "siz...
import contextlib import mock from neutron.api.v2 import attributes from neutron.extensions import securitygroup as ext_sg from neutron import manager from neutron.tests.unit.ryu import fake_ryu from neutron.tests.unit import test_extension_security_group as test_sg from neutron.tests.unit import test_security_groups...
{ "content_hash": "59c9b0b4f70245d30bb00c08176ebb23", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 77, "avg_line_length": 44.49367088607595, "alnum_prop": 0.5738264580369844, "repo_name": "beagles/neutron_hacking", "id": "3293508ca472012fdd0c8d6414df5d4798c0ea70", "size"...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('person', '0001_initial'), ] operations = [ migrations.AddField( model_name='email', name='primary', field=models...
{ "content_hash": "a8a57b69e751be60be7a5d97726c2252", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 53, "avg_line_length": 21.157894736842106, "alnum_prop": 0.582089552238806, "repo_name": "wpjesus/codematch", "id": "dca735bd21f0cd8b90f0fbb520fc1ea5dbf51627", "size": "426...
""" Demo XML format translation, specifically one thesaurus information to another. Specifically, convert Zthes-in-XML [1] file to SKOS [2] [1] http://zthes.z3950.org/schema/index.html [2] http://www.w3.org/2004/02/skos/ Sample usage: zthes2skos.py http://zthes.z3950.org/schema/sample-05.xml """ MORE_DOC = """ Zthe...
{ "content_hash": "5a2c2c43d5b2f82e45e3905388a2bd0d", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 112, "avg_line_length": 35.140845070422536, "alnum_prop": 0.6589178356713427, "repo_name": "zepheira/amara", "id": "008fe93367160e5392093ad6ac6fe935cf19e1f6", "size": "2495...
import textwrap from contextlib import contextmanager class TextWrapper(textwrap.TextWrapper): def _handle_long_word(self, reversed_chunks, cur_line, cur_len, width): space_left = max(width - cur_len, 1) if self.break_long_words: last = reversed_chunks[-1] cut = last[:spac...
{ "content_hash": "e4ad98d080d37f204c6bdb3c5d87c11d", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 75, "avg_line_length": 32.45945945945946, "alnum_prop": 0.5828476269775187, "repo_name": "rochacbruno/dynaconf", "id": "7a052b70df328776293d0b5a3be0f2f53564b44b", "size": "...
from skybase import schemas schemas.set_indicators() #Directory schemas layout of the directories artiball_schema = [ [[''],['skybase.yaml']], # [['app'], []], [['app_config'], ['main_app_config.yaml']], [['installation'], []], [['installation', 'chef', 'cookbooks'], []], [['installation', 'ch...
{ "content_hash": "72df8251ceaa3ec62bebc17090bc181e", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 131, "avg_line_length": 38.74590163934426, "alnum_prop": 0.6458641844721811, "repo_name": "lithiumtech/skybase.io", "id": "e4c4475768e40f44e0f75d09f4d6594fb3f22543", "size...
from lemonyellow.models import Slot class Daycare(Slot): """Right now, I'll try to add the ability to host one pokemon in the daycare, but it's not a big priority. Eventually I'll add the ability to have two so they can make eggs, but that is very much not a priority.""" original_level = 0
{ "content_hash": "392b8fc09d238e7b3d7146ba57cfa1fc", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 76, "avg_line_length": 34.44444444444444, "alnum_prop": 0.7096774193548387, "repo_name": "itsthejoker/Pokemon-Homage", "id": "faa8aacb1054f4caef128ad923903450f12bfcd9", "siz...
""" ex20161128_tax_cut_comparison.py Extend the SIM model (Godley and Lavoie, Chapter 3) with a capitalist sub-sector, and then look at the effect of a tax cut. Copyright 2016 Brian Romanchuk Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the Licen...
{ "content_hash": "c8779d4fed8151133b3a45611b5783ce", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 118, "avg_line_length": 41.857142857142854, "alnum_prop": 0.6773192677629538, "repo_name": "brianr747/SFC_models", "id": "33c36e3b1626e7c61375113dd556205922fee3fc", "size":...
"""DenseNet, implemented in Gluon.""" __all__ = ['DenseNet', 'densenet121', 'densenet161', 'densenet169', 'densenet201'] import os from ....context import cpu from ...block import HybridBlock from ... import nn from ...contrib.nn import HybridConcurrent, Identity # Helpers def _make_dense_block(num_layers, bn_size, ...
{ "content_hash": "39eb9141603eceb6794a3c64e4e9bbe3", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 100, "avg_line_length": 37.924731182795696, "alnum_prop": 0.6338247802665155, "repo_name": "precedenceguo/mxnet", "id": "b03f5ce8d52ac71b502d3bcc919ae87a825a3b1c", "size":...
import unittest from two_to_the import two_to_the class TwoToTheTest(unittest.TestCase): def test0(self): self.assertEqual(1, two_to_the(0)) def test1(self): self.assertEqual(2, two_to_the(1)) def test2(self): self.assertEqual(4, two_to_the(2)) def test3(self): self...
{ "content_hash": "6e6f8d0027d535864a110833483455fd", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 42, "avg_line_length": 19, "alnum_prop": 0.6090225563909775, "repo_name": "keithio/practice-data-structures-and-algorithms", "id": "1e78bdd022fc2d4255576fd6327772c438a20d70",...
import smtplib from email.mime.image import MIMEImage from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.mime.base import MIMEBase from email import encoders import xml from xml.dom.minidom import parse, parseString def send_email(to, server, subj, body, attachments...
{ "content_hash": "cbb10890bea8e5a0852a3806db673da6", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 84, "avg_line_length": 34.204081632653065, "alnum_prop": 0.6270883054892601, "repo_name": "raman-bt/autopsy", "id": "5d12e6afa3213fec3ccdb4adfe3ed383edb33caf", "size": "167...
from django.shortcuts import render def home(request): return render(request, '{{ project_name }}/home.html', {})
{ "content_hash": "67d9c517dae0c64d0d25a82d89f12b39", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 60, "avg_line_length": 29.25, "alnum_prop": 0.7094017094017094, "repo_name": "theduke/django-kickstart", "id": "dd9f116e8ddfadc3eb34b061f84db9bb23e894da", "size": "117", "...
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 'Skill.short_description' db.add_column('dnd_skill', 'short_description', self.gf('django.db.models.fields.Te...
{ "content_hash": "7e1c2a33746ea057f67d6bc5330b1124", "timestamp": "", "source": "github", "line_count": 264, "max_line_length": 220, "avg_line_length": 80.0719696969697, "alnum_prop": 0.545484649226548, "repo_name": "gregpechiro/dndtools", "id": "394c43cdd993a72db2444c2f8c09e313190f8bf1", "size": "...
import sys import clr clr.AddReference('System') import System def get_system_information(): info = System.String(sys.version_info) return info @property def system_information(): info = System.String(sys.version_info) return info def echo(something): return something if __name__=="__main__": ...
{ "content_hash": "ca35732162571d0a1359b2e1d8caba17", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 42, "avg_line_length": 19.666666666666668, "alnum_prop": 0.7046004842615012, "repo_name": "MaciekTalaska/IronPythonCSIntegration", "id": "da19f672e8583c878ea6fe5e8318dc598bb7...
import glob, itertools, os, sys, time try: import _thread except ImportError: import _dummy_thread as thread # This import does nothing, but it's necessary to avoid some race conditions # in the threading module. See http://code.djangoproject.com/ticket/2330 . try: import threading except ImportError: ...
{ "content_hash": "a9d56477aa31e776b7071c0cf4711eb5", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 92, "avg_line_length": 29.40909090909091, "alnum_prop": 0.6009273570324575, "repo_name": "akheron/stango", "id": "30585684c6502b98eaf851069e3d25ab71bda783", "size": "6915"...
import os import sys PROJECT_DIR = os.path.abspath( os.path.join(os.path.dirname(__file__)) ) if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dj.settings") from django.core.management import execute_from_command_line sys.path.append(os.path.join(PROJECT_DIR, 'dj', 'apps')...
{ "content_hash": "6f4767238eff2342db96285b05ab5763", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 66, "avg_line_length": 24.2, "alnum_prop": 0.6776859504132231, "repo_name": "matllubos/django-is-core", "id": "fdd12bff118ae05d204379ed8973c87bc41932e5", "size": "385", "...
"""Etcd2 specific configuration.""" import os import shutil import server class Etcd2Cluster(object): """Sets up a global or cell-local etcd cluster.""" def __init__(self, name): import environment # pylint: disable=g-import-not-at-top self.port_base = environment.reserve_ports(2) self.name = na...
{ "content_hash": "b6958a833b2d10d53d27982045ae5acb", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 75, "avg_line_length": 29.36036036036036, "alnum_prop": 0.610309911015649, "repo_name": "alainjobart/vitess", "id": "5c7d3bdcd11eeb26a498d2c57f596c051ce0d1cc", "size": "38...
try: import unittest2 as unittest except ImportError: import unittest # noqa from datetime import datetime, date, time from decimal import Decimal from mock import Mock from uuid import UUID, uuid4 from cassandra.cqlengine.models import Model from cassandra.cqlengine.usertype import UserType, UserTypeDefinit...
{ "content_hash": "cb2114b4ba199b70492a234b6b74490f", "timestamp": "", "source": "github", "line_count": 516, "max_line_length": 143, "avg_line_length": 36.40503875968992, "alnum_prop": 0.6201756720787862, "repo_name": "kishkaru/python-driver", "id": "dc7eb134c0e1d107697ea5ec4168855d79e58ee7", "size...
"""SavedModel builder. Builds a SavedModel that can be saved to storage, is language neutral, and enables systems to produce, consume, or transform TensorFlow Models. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os from google.protobuf.any_p...
{ "content_hash": "33615d623620e6ee047d54a0fc2c4f17", "timestamp": "", "source": "github", "line_count": 325, "max_line_length": 80, "avg_line_length": 38.52, "alnum_prop": 0.6886332774183241, "repo_name": "mrry/tensorflow", "id": "23768f12476a03f4a74e17e50014e48138b78538", "size": "13209", "binar...
#!/usr/bin/python #-*- coding: utf-8 -*- ###################################################################### # Copyright (c) 2017 by WLBlazers Corporation # # switchover.py # # ###################################################################### # Modifications Section: #######################################...
{ "content_hash": "7c8b1f1d853119eff6771c3bdda20fc3", "timestamp": "", "source": "github", "line_count": 276, "max_line_length": 140, "avg_line_length": 37.84782608695652, "alnum_prop": 0.5341757610568638, "repo_name": "JK-Warriors/Heimdallr", "id": "390d1a670c94a4308fb775e007ad738f90f2deca", "size"...
from django.conf import settings from django.test.simple import DjangoTestSuiteRunner try: # pragma: no cover from xmlrunner import XMLTestRunner as runner except: # pragma: no cover runner = False class TestSuiteRunner(DjangoTestSuiteRunner): # pragma: no cover use_runner = runner def run_suite(self...
{ "content_hash": "2c7dde145b8a14ff52e96d090b66a1b7", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 75, "avg_line_length": 35.05555555555556, "alnum_prop": 0.6671949286846276, "repo_name": "ojii/django-nani", "id": "9c56435cdee65666af8c295dbff61924e48acaf5", "size": "631"...
"""change_vim_shared_property_to_false Revision ID: 31acbaeb8299 Revises: e7993093baf1 Create Date: 2017-05-30 23:46:20.034085 """ # flake8: noqa: E402 # revision identifiers, used by Alembic. revision = '31acbaeb8299' down_revision = 'e7993093baf1' from alembic import op import sqlalchemy as sa def upgrade(acti...
{ "content_hash": "30141036478cb3ee61c2ada082fd56e5", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 52, "avg_line_length": 22.91304347826087, "alnum_prop": 0.6622390891840607, "repo_name": "stackforge/tacker", "id": "c733addec8d35acddacc649886230c8d1686be25", "size": "114...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): # This flag is used to mark that a migration shouldn't be automatically run in # production. We set this to True for operations that we think are risky and want # someone from ops to ru...
{ "content_hash": "2ea9614b9495c007a5f3e658c8f22bc0", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 88, "avg_line_length": 41.285714285714285, "alnum_prop": 0.6899653979238755, "repo_name": "beeftornado/sentry", "id": "8ffa231303e12183a13a3413ebac794ccb256f09", "size": "1...
import json import time from morph import flatten def write_in_csv_format(iostream, frame): """ Writes frame data and metadata into iostream in csv format. :param iostream: a CStringIO used to buffer the formatted features. :param frame: a BaseFrame object to be written into iostream :return: Non...
{ "content_hash": "da98ace13287879999ad8f37688d4e34", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 79, "avg_line_length": 37.22142857142857, "alnum_prop": 0.6008443676837459, "repo_name": "canturkisci/agentless-system-crawler", "id": "95a4c663f49a196c735c0cb4b6317f8312b64...
'''Autogenerated by get_gl_extensions script, do not edit!''' from OpenGL import platform as _p, constants as _cs, arrays from OpenGL.GL import glget import ctypes EXTENSION_NAME = 'GL_EXT_vertex_array' def _f( function ): return _p.createFunction( function,_p.GL,'GL_EXT_vertex_array',False) _p.unpack_constants( ""...
{ "content_hash": "ea97d83365a476f648306479d966fdc8", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 76, "avg_line_length": 42.391752577319586, "alnum_prop": 0.7621595330739299, "repo_name": "frederica07/Dragon_Programming_Process", "id": "72cd9d8374fd68da8208ff982ca0849c42c...
""" contains some chess-related utility functions """ from cmd_util import input_int from pieces import ChessPiece def format_board(board, row_count, col_count): """ convert a `board` into string than can be shown in console board: a dict { (row_num, col_num) => piece_symbol } row_count: number of r...
{ "content_hash": "c7e55767ec1b1b945298c668f9b84851", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 75, "avg_line_length": 29.894736842105264, "alnum_prop": 0.5757042253521126, "repo_name": "ilius/chess-challenge", "id": "56d8c69f00b416c13817a05dba3550cea37a2dd6", "size":...
''' $Id$ myexc.py -- "my exceptions" demo which highlights user-created exceptions. NOTE: this example does not currently work with JPython as neither the errno nor tempfile modules have been implemented, and also, the socket module is incomplete. ''' # import all our needed modules import os,...
{ "content_hash": "6123acb437fb0ae3e81a01e341956fde", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 77, "avg_line_length": 29.31168831168831, "alnum_prop": 0.5686752326096588, "repo_name": "github641/python-journey", "id": "10159f02a898ab4d00709ec4106653bc22190e89", "siz...
import os import sys import warnings import getopt from shutil import move from os import remove, close """Modify meta information in raw experimental data. While comparing algorithms with the bbob_proc package, it is sometimes needed to change the algorithm name (given as algId in the :file`.info` files) or the algo...
{ "content_hash": "10bb119d8c1137504a91a6fb68b73df7", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 115, "avg_line_length": 30.517045454545453, "alnum_prop": 0.5200148948054366, "repo_name": "oaelhara/numbbo", "id": "541e2ee578287feee8994e789099a5601c1d337f", "size": "54...
from django.test import TestCase from compose.management.commands import ( demo_data_compose, init_app_compose, init_app_compose_news, ) class TestCommand(TestCase): def test_demo_data(self): """ Test the management command """ command = demo_data_compose.Command() command.ha...
{ "content_hash": "03eb87d567560c6d74e529746c2e56a2", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 49, "avg_line_length": 25.74074074074074, "alnum_prop": 0.6244604316546762, "repo_name": "pkimber/compose", "id": "4598532abdc99b3650341abb1aa88722769740d0", "size": "721",...
import urllib import hashlib from datetime import datetime, timedelta, date import os from django import template from django.conf import settings from django.utils import timezone from django.core.urlresolvers import reverse, resolve from django.contrib.auth.models import User from django.utils.translation import uge...
{ "content_hash": "573d6b109f820aca5858578acef8acc1", "timestamp": "", "source": "github", "line_count": 470, "max_line_length": 80, "avg_line_length": 29.41276595744681, "alnum_prop": 0.5844907407407407, "repo_name": "Alkemic/webpage", "id": "0b124c4f59aa26bdee1d8de08042df3166d2e8e9", "size": "1385...
""" Contains functionality to use a X10 dimmer over Mochad. For more details about this platform, please refer to the documentation at https://home.assistant.io/components/light.mochad/ """ import logging import voluptuous as vol from homeassistant.components.light import ( ATTR_BRIGHTNESS, SUPPORT_BRIGHTNESS, ...
{ "content_hash": "062feb0a0fa94dace1c8c021d913f847", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 79, "avg_line_length": 35.583941605839414, "alnum_prop": 0.6147692307692307, "repo_name": "tinloaf/home-assistant", "id": "2e68c369ba644739bc74d1a59d812c2a5975db4c", "size...
from .resource import Resource class ApplicationGateway(Resource): """Application gateway resource. Variables are only populated by the server, and will be ignored when sending a request. :param id: Resource ID. :type id: str :ivar name: Resource name. :vartype name: str :ivar type: ...
{ "content_hash": "1ed6a6308637e6c7b6db4367af7fc132", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 524, "avg_line_length": 58.44117647058823, "alnum_prop": 0.7155259184700553, "repo_name": "lmazuel/azure-sdk-for-python", "id": "9cfb32ac4edc4df2b556e014d692eda70bfef7f2", ...
"""Handle intents with scripts.""" import copy import logging import voluptuous as vol from homeassistant.helpers import config_validation as cv, intent, script, template DOMAIN = "intent_script" CONF_INTENTS = "intents" CONF_SPEECH = "speech" CONF_ACTION = "action" CONF_CARD = "card" CONF_TYPE = "type" CONF_TITLE...
{ "content_hash": "760419dff3e7ba251f7dde5ef1802841", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 83, "avg_line_length": 29.737864077669904, "alnum_prop": 0.5719882468168462, "repo_name": "postlund/home-assistant", "id": "38f93ed35061254628c0cd2af59eaa97e4f9f176", "siz...
from .async_client import GameServerDeploymentsServiceAsyncClient from .client import GameServerDeploymentsServiceClient __all__ = ( "GameServerDeploymentsServiceClient", "GameServerDeploymentsServiceAsyncClient", )
{ "content_hash": "2033b10c9d69c1b4a55538a3cf773bb0", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 65, "avg_line_length": 32.142857142857146, "alnum_prop": 0.8266666666666667, "repo_name": "googleapis/python-game-servers", "id": "2e7bfd824404e6c766725cd28c629702e2104791", ...
import contextlib import json import logging import unittest import secrets from http import HTTPStatus import multiprocessing as mp from flask import Flask from flask_testing import TestCase from fedlearner_webconsole.composer.composer import Composer, ComposerConfig from fedlearner_webconsole.db import db_handler as...
{ "content_hash": "69f64abdad693bbb6a9022081469cf56", "timestamp": "", "source": "github", "line_count": 265, "max_line_length": 100, "avg_line_length": 37.22264150943396, "alnum_prop": 0.5132806163828062, "repo_name": "bytedance/fedlearner", "id": "fff83b5a03be466b1cf2c2dc91e87e270edcabcc", "size":...
""" miscellaneous sorting / groupby utilities """ import numpy as np from pandas.compat import long, string_types, PY3 from pandas.core.dtypes.common import ( _ensure_platform_int, _ensure_int64, is_list_like, is_categorical_dtype) from pandas.core.dtypes.cast import infer_dtype_from_array from pandas....
{ "content_hash": "296ea3a10a44027f92f0235e5d1fb49f", "timestamp": "", "source": "github", "line_count": 485, "max_line_length": 79, "avg_line_length": 32.88247422680412, "alnum_prop": 0.61518685728618, "repo_name": "ryfeus/lambda-packs", "id": "27252b9616a445da6378791ddd252bad5d712a9c", "size": "15...
from django.db.models.sql import compiler from django.db.models.sql.where import WhereNode from django.db.models.sql.where import EmptyShortCircuit, EmptyResultSet from django.db.models.sql.expressions import SQLEvaluator from django.conf import settings class SphinxWhereNode(WhereNode): def sql_for_columns(self,...
{ "content_hash": "fc160ab252e0300c76cd6f566477d452", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 119, "avg_line_length": 43.77272727272727, "alnum_prop": 0.5950155763239875, "repo_name": "jnormore/django-sphinx-db", "id": "e96ae12cad7edfeb5a1a50ca20af285880fa6f78", "s...
import xml.etree.ElementTree as ET import socket import vdebug.log import base64 import time import errno """ Response objects for the DBGP module.""" class Response: """Contains response data from a command made to the debugger.""" ns = '{urn:debugger_protocol_v1}' def __init__(self,response,cmd,cmd_arg...
{ "content_hash": "2ee54b126dcf71b5450aeb1472fa6cda", "timestamp": "", "source": "github", "line_count": 732, "max_line_length": 123, "avg_line_length": 31.172131147540984, "alnum_prop": 0.5504864580594268, "repo_name": "mispencer/vdebug", "id": "91282b9bbe783f1d629fd8ca0fe9e0ea3189dbf9", "size": "2...
import operator import time from itertools import chain from datetime import datetime from py4j.protocol import Py4JJavaError from pyspark import RDD from pyspark.storagelevel import StorageLevel from pyspark.streaming.util import rddToFileName, TransformFunction from pyspark.rdd import portable_hash from pyspark.res...
{ "content_hash": "03826ff76418f6825835ffccbfbfba49", "timestamp": "", "source": "github", "line_count": 711, "max_line_length": 100, "avg_line_length": 38.15611814345991, "alnum_prop": 0.6156880091415091, "repo_name": "xuanyuanking/spark", "id": "f445a78bd95301bb211e6e5946c32050bca71a78", "size": "...
""" Tests of neo.io.NSDFIO """ # needed for python 3 compatibility from __future__ import absolute_import, division import numpy as np import quantities as pq from datetime import datetime import os try: import unittest2 as unittest except ImportError: import unittest from neo.io.nsdfio import HAVE_NSDF, NS...
{ "content_hash": "92036ed2bec0bb69a458736b0977e0cb", "timestamp": "", "source": "github", "line_count": 231, "max_line_length": 113, "avg_line_length": 36.15584415584416, "alnum_prop": 0.6404454022988506, "repo_name": "theunissenlab/python-neo", "id": "d388e2157d8562c69ee327d418b2b60dba959b24", "si...
import asyncio import inspect import io import os.path import urllib.parse import zlib from http.cookies import SimpleCookie from unittest import mock import pytest from multidict import CIMultiDict, CIMultiDictProxy, upstr from yarl import URL import aiohttp from aiohttp import BaseConnector, hdrs, helpers from aioh...
{ "content_hash": "5c01968f0a682eee4d6e9e41839da7f1", "timestamp": "", "source": "github", "line_count": 1036, "max_line_length": 77, "avg_line_length": 30.617760617760617, "alnum_prop": 0.6183480453972258, "repo_name": "moden-py/aiohttp", "id": "659502249a523fbc0da8f402eaf6f7fdbef8a4a3", "size": "3...
__all__ = ["Login","Register","AccessToken"]
{ "content_hash": "8f2e295918015b88bdfdd7b9326c82f5", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 44, "avg_line_length": 44, "alnum_prop": 0.6136363636363636, "repo_name": "KJSCE-C12/VDOC", "id": "d9dff03bf79f03fc3d96478cae63b4f2ea5f3702", "size": "44", "binary": false...
from .. import DataType class LoadFitting: def __init__(self, parent=None): self.parent = parent self.session_dict = parent.session_dict def table_dictionary(self): self.parent.session_dict['fitting'] = self.session_dict["fitting"] self.parent.table_loaded_from_session = True...
{ "content_hash": "03c47c028f99e900c3f53c0b0d0a7516", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 115, "avg_line_length": 41, "alnum_prop": 0.6693766937669376, "repo_name": "ornlneutronimaging/iBeatles", "id": "a0a3d406381b3e4492d82fb07cd63710a4ec3842", "size": "738", ...
from six import assertRaisesRegex from unittest import TestCase from dark.btop import countGaps, parseBtop, btop2cigar def btop2cigarStr(btopString, concise=False, aa=False): """ Call btopString and turn its generator result into a string. See btopString for the explanation of the args. """ retu...
{ "content_hash": "ade7237ae6e72f5ab561aa84225c41a0", "timestamp": "", "source": "github", "line_count": 295, "max_line_length": 79, "avg_line_length": 34.65423728813559, "alnum_prop": 0.6052039518732271, "repo_name": "acorg/dark-matter", "id": "72d8fbcaa3446593910a7e03d7cb7201caf57791", "size": "10...
from beritest_tools import BaseBERITestCase class test_raw_pism_truncation(BaseBERITestCase): def test_addressing(self): '''Test PISM isn't mangling addresses.''' self.assertRegisterEqual(self.MIPS.a0, 0x1111, "Load of stored double word failed")
{ "content_hash": "abe019235776e290463e3fd8cc8e1dc5", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 91, "avg_line_length": 44.666666666666664, "alnum_prop": 0.7388059701492538, "repo_name": "8l/beri", "id": "e23535c057e944a2be816ff193c26d96afbcc9d4", "size": "1810", "bin...
from .sink import ( HttpTransportSink ) from ..core import Scales from ..loadbalancer.aperture import ApertureBalancerSink from ..pool import SingletonPoolSink class _HttpIface(object): def Get(self, url, **kwargs): """Issue an HTTP GET to url. kwargs aligns with arguments to requests, although timeout i...
{ "content_hash": "f0a53f3dafc3df493ba68c94cda86369", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 74, "avg_line_length": 23.397260273972602, "alnum_prop": 0.6662763466042154, "repo_name": "steveniemitz/scales", "id": "19ec41c84bb328f4a2807159ad3a2a4ea140bd88", "size": "...
from Tkinter import Tk r = Tk() r.withdraw() r.clipboard_clear() r.clipboard_append('i can copy to clipboardz?') r.destroy()
{ "content_hash": "cd36f0f3383700e57cb033404b1e2362", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 47, "avg_line_length": 20.833333333333332, "alnum_prop": 0.72, "repo_name": "wolfdale/10MinutesEmailWrapper", "id": "09ad503e7348a363551e5dfb55b3ade103da1167", "size": "157"...
__author__ = 'gjp' from django.test import TestCase from mock import patch from fiware_cloto.cloto.manager import RuleManager from fiware_cloto.cloto.models import RuleModel class RuleManagerTests(TestCase): def setUp(self): self.rule = '{\"name\": \"test Name\", \"condition\": ' \ '{...
{ "content_hash": "8f792a9e888c631504a94845b6ef706a", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 118, "avg_line_length": 56.21153846153846, "alnum_prop": 0.5398563120082107, "repo_name": "Fiware/cloud.Cloto", "id": "bc3b289069af60bf1bd70d26bab1007f14f32709", "size": "...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from ..message_parser import MessageParser __all__ = ['ClientMessageParser'] class ClientMessageParser(MessageParser): pass
{ "content_hash": "843f7471b2f3a5de68e67b585144cf86", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 42, "avg_line_length": 20.166666666666668, "alnum_prop": 0.7520661157024794, "repo_name": "foxdog-studios/pyddp", "id": "1a7055a28521d88d60eb5d67470a2f29802010a9", "size": ...
import re from django import forms from hydroshare.models import HydroShareResource class MDLRadioButton(forms.RadioSelect): def render(self, name, value, attrs=None, renderer=None): """Adds MDL HTML classes to label and input tags""" html = super(MDLRadioButton, self).render(name, value, attrs=at...
{ "content_hash": "a9c029887950443b9983fff2ea1c0c9f", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 120, "avg_line_length": 33.46153846153846, "alnum_prop": 0.6151067323481116, "repo_name": "ODM2/ODM2WebSDL", "id": "63513528ca4bbe9484e760efcc19a3a593d7b691", "size": "3070...
from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("comms", "0010_auto_20161206_1912")] operations = [ migrations.AlterField( model_name="channeldb", name="db_attributes", field=models....
{ "content_hash": "7d3fe6de9b97f6cf6251a0f961972380", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 137, "avg_line_length": 34.52307692307692, "alnum_prop": 0.5040106951871658, "repo_name": "jamesbeebop/evennia", "id": "8c212a7befbe5e449a629d83766687543c996148", "size": ...
import types import asyncio from typing import Optional, Type from algoliasearch.recommendation_client import RecommendationClient from algoliasearch.configs import RecommendationConfig from algoliasearch.helpers_async import _create_async_methods_in from algoliasearch.http.transporter_async import TransporterAsync ...
{ "content_hash": "2bee28711c6a77c916b1c327156d0027", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 123, "avg_line_length": 33.53488372093023, "alnum_prop": 0.7004160887656034, "repo_name": "algolia/algoliasearch-client-python", "id": "784c64aae45128473c1a92b26933212f8a3b22...
from ginga.gtkw import ImageViewGtk from ginga.canvas.mixins import DrawingMixin, CanvasMixin, CompoundMixin from ginga.util.toolbox import ModeIndicator class ImageViewCanvasError(ImageViewGtk.ImageViewGtkError): pass class ImageViewCanvas(ImageViewGtk.ImageViewZoom, DrawingMixin, CanvasMi...
{ "content_hash": "31eac906f1adf2b8b051a7451e22eeaa", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 72, "avg_line_length": 36.214285714285715, "alnum_prop": 0.5788954635108481, "repo_name": "Cadair/ginga", "id": "b7fa0c071583292e8891ba87760c9c379bc0758c", "size": "1290", ...
from contextlib import contextmanager from fabric.api import local, cd, prefix, env import os BASE_DIR = os.path.join(os.path.dirname(__file__)) ENV_DIR = os.path.join(BASE_DIR, 'env') PROJECT = "shanemartin" activate = os.path.join(BASE_DIR, 'env', 'bin', 'activate') @contextmanager def virtualenv(): with pr...
{ "content_hash": "e57b2c965f5a3512cd061805bafda2b7", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 59, "avg_line_length": 21, "alnum_prop": 0.6360544217687075, "repo_name": "shamrt/sha.nemart.in-flask", "id": "0c95cdd427da67bdabaa23fd3e09a04e824f11f8", "size": "1005", ...
from oslo_log import log as logging from jacket.i18n import _LW from jacket.compute.scheduler import filters from jacket.compute import servicegroup LOG = logging.getLogger(__name__) class ComputeFilter(filters.BaseHostFilter): """Filter on active Compute nodes.""" def __init__(self): self.serviceg...
{ "content_hash": "d41ebbab465842610f191b5b257e63a2", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 78, "avg_line_length": 34.5625, "alnum_prop": 0.6003616636528029, "repo_name": "HybridF5/jacket", "id": "2a99e20341a65f0e3f493af2b80f03c4a5ab3232", "size": "1746", "binar...
import os import conexiuneBaza import MySQLdb import datetime def afisareDestinatii(bazaDate): sql="Select * from sejur WHERE data_plecare >= CURDATE() AND ora_plecare >= CURTIME()" cursor=bazaDate.cursor() try: cursor.execute(sql) a=datetime.datetime.now().strftime("%Y-%m-%d") datet...
{ "content_hash": "312f5bb8cd0418d1be795f4be621e60e", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 206, "avg_line_length": 41.4, "alnum_prop": 0.6256038647342995, "repo_name": "acd8/proiectBDOO", "id": "b6caebf14c3c1d9b105a9fad8e6749b96a094508", "size": "828", "binary"...
"""Sorting helpers for ISY994 device classifications.""" from __future__ import annotations from typing import Any from pyisy.constants import ( ISY_VALUE_UNKNOWN, PROTO_GROUP, PROTO_INSTEON, PROTO_PROGRAM, PROTO_ZWAVE, TAG_FOLDER, ) from pyisy.nodes import Group, Node, Nodes from pyisy.progra...
{ "content_hash": "9bd1dbaf5e6d1a424613a178e89cb478", "timestamp": "", "source": "github", "line_count": 422, "max_line_length": 93, "avg_line_length": 34.77251184834123, "alnum_prop": 0.6212348371268911, "repo_name": "jawilson/home-assistant", "id": "d1790fcc13cf43785ccd72475d51ccaf20ccd582", "size...
__author__ = 'Sergey Sobko' __email__ = 'ssobko@rbc.ru' __copyright__ = 'Copyright 2014, RosBusinessConsulting' import logging def initialize_logger(logger=None): """Initialize logger""" if logger: if isinstance(logger, basestring): return logging.getLogger(logger) return logger ...
{ "content_hash": "05bcb52dd8fa8c06bbdb7286fffe1112", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 55, "avg_line_length": 24.266666666666666, "alnum_prop": 0.6648351648351648, "repo_name": "RosBusinessConsulting/sessionclient-python", "id": "5c82bde79875b461375587cdf087a82...
"""Test Home Assistant yaml loader.""" import io import logging import os import unittest import pytest from homeassistant.config import YAML_CONFIG_FILE, load_yaml_config_file from homeassistant.exceptions import HomeAssistantError import homeassistant.util.yaml as yaml from homeassistant.util.yaml import loader as ...
{ "content_hash": "264dda370b04d4c94b2fe73aecb4a511", "timestamp": "", "source": "github", "line_count": 463, "max_line_length": 88, "avg_line_length": 35.00215982721382, "alnum_prop": 0.573306182895224, "repo_name": "robbiet480/home-assistant", "id": "4d6f4ce3ac9168a23d6daceb340c04c28594cd01", "siz...
""" based on https://github.com/tomchristie/django-rest-framework/blob/master/runtests.py """ from __future__ import print_function import pytest import sys import os import subprocess PYTEST_ARGS = { 'default': ['tests'], 'fast': ['tests', '-q'], } FLAKE8_ARGS = ['rest_framework_friendly_errors', 'tests', ...
{ "content_hash": "59eceffda5a6b86c185d3ede3247a237", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 85, "avg_line_length": 26.118279569892472, "alnum_prop": 0.599011939069576, "repo_name": "oasiswork/drf-friendly-errors", "id": "311e57bf9fca0e0f94a74e11f43fa8475517054f", ...
'''Runner for debugging with J-Link.''' import argparse import os import platform import re import shlex from subprocess import TimeoutExpired import sys import tempfile from runners.core import ZephyrBinaryRunner, RunnerCaps, \ BuildConfiguration try: from packaging import version MISSING_REQUIREMENTS =...
{ "content_hash": "a788d0130c683ed96f21d3fe2b12f82b", "timestamp": "", "source": "github", "line_count": 259, "max_line_length": 94, "avg_line_length": 40.38996138996139, "alnum_prop": 0.5396233629672116, "repo_name": "Vudentz/zephyr", "id": "2d6e0d77986ee7e3bae50f6ffdfa6992ea3cebaa", "size": "10539...
import Tix, os, copy from Tkconstants import * TCL_ALL_EVENTS = 0 def RunSample (root): dirlist = DemoDirList(root) dirlist.mainloop() dirlist.destroy() class DemoDirList: def __init__(self, w): self.root = w self.exit = -1 z = w.winfo_toplevel() z.wm_protoco...
{ "content_hash": "9fa5e48255dbaba9d62d6ba158de677f", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 79, "avg_line_length": 34.3716814159292, "alnum_prop": 0.5574150360453141, "repo_name": "mollstam/UnrealPy", "id": "5fd8c0de7f10b3874602e88d36dffd3cf94b542f", "size": "456...
from setuptools import setup, find_packages DESCRIPTION = 'Python Mumble for Humans™' with open('README.md') as f: LONG_DESCRIPTION = f.read() VERSION = '0.1.0' setup( name='mumble', version=VERSION, packages=find_packages(), author='Stanislav Vishnevskiy', author_email='vishnevskiy@gmail.co...
{ "content_hash": "976356ed353e883aa500e24f2e62e936", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 50, "avg_line_length": 23.48, "alnum_prop": 0.6729131175468483, "repo_name": "vishnevskiy/mumblepy", "id": "e135e9ecb6a8b6110018eb782f6f450ee0d80edb", "size": "605", "bin...
import ConfigParser import sys from impala_shell_config_defaults import impala_shell_defaults from optparse import OptionParser class ConfigFileFormatError(Exception): """Raised when the config file cannot be read by ConfigParser.""" pass class InvalidOptionValueError(Exception): """Raised when an option cont...
{ "content_hash": "9c2655baa2856119fd49434e75395560", "timestamp": "", "source": "github", "line_count": 231, "max_line_length": 90, "avg_line_length": 49.523809523809526, "alnum_prop": 0.609527972027972, "repo_name": "cloudera/Impala", "id": "27b371ab7e9196ca542d6ad2f9b81d38d0c970e7", "size": "1238...
''' Created on 2016/8/22 :author: hubo ''' from vlcp.server.module import Module, call_api, depend, api import vlcp.service.connection.httpserver as httpserver import vlcp.service.sdn.viperflow as viperflow from vlcp.utils.connector import TaskPool from vlcp.utils.http import HttpHandler from vlcp.config import defaul...
{ "content_hash": "5281a697b3365ec97f3f11170583fa9c", "timestamp": "", "source": "github", "line_count": 833, "max_line_length": 134, "avg_line_length": 48.48859543817527, "alnum_prop": 0.5171201505285831, "repo_name": "hubo1016/vlcp-docker-plugin", "id": "68a10e5f6781e9196e2fd831c1a3e9641400e6ce", ...
from ...command import SubCommand from ...wsgi import WSGIApplication from ...compat import text_type, raw_input, urlparse import sys import json try: import readline except ImportError: pass class Email(SubCommand): """Manage email""" help = "manage email" def add_arguments(self, parser): ...
{ "content_hash": "7556ea0058670e7c4ce5aefe640eae98", "timestamp": "", "source": "github", "line_count": 278, "max_line_length": 88, "avg_line_length": 30.66906474820144, "alnum_prop": 0.5025803424818203, "repo_name": "moyaproject/moya", "id": "900f3eb007b0e95a3afb416905124c0dc47dfb24", "size": "852...
"""Common code tests.""" from datetime import timedelta from pyHS100 import SmartDeviceException from homeassistant.components.tplink.common import async_add_entities_retry from homeassistant.helpers.typing import HomeAssistantType from tests.async_mock import MagicMock async def test_async_add_entities_retry(hass...
{ "content_hash": "59732b762c41126ba6092e1f51e4107a", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 79, "avg_line_length": 28.975609756097562, "alnum_prop": 0.6443602693602694, "repo_name": "pschmitt/home-assistant", "id": "a2bd7ef87ff2b1db9f0154a11f1e4240a9336ada", "size...
''' ''' # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License");...
{ "content_hash": "46a4696b9d69986d7449d880c8292e88", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 130, "avg_line_length": 58.56872037914692, "alnum_prop": 0.7219614824405244, "repo_name": "duke8253/trafficserver", "id": "f35f554a0d7f932ada28c64d2ba633478ce99cf1", "size...
import os import frappe from frappe.core.doctype.data_import.data_import import export_json, import_doc from frappe.desk.form.save import savedocs from frappe.model.delete_doc import delete_doc from frappe.tests.utils import FrappeTestCase class TestFixtureImport(FrappeTestCase): def create_new_doctype(self, DocTyp...
{ "content_hash": "de35e6df8afb26600c264a004405dfbc", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 96, "avg_line_length": 30.705128205128204, "alnum_prop": 0.7219206680584551, "repo_name": "StrellaGroup/frappe", "id": "b9bd4550b25e1920870ae8986f2845eef59bb0ee", "size": "...
import statistics import math import os def convert_ipaddress(ipint): """Function for converting a 32 bit integer to a human readable ip address https://geekdeck.wordpress.com/2010/01/19/converting-a-decimal-number-to-ip-address-in-python/ :param ipint: 32 bit int ip address :type ipint: integer :return: hu...
{ "content_hash": "35c131e5f9569fe68e09a4158e2a48ff", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 117, "avg_line_length": 30.813253012048193, "alnum_prop": 0.6566959921798632, "repo_name": "ut-dacs/https-ids", "id": "51e57e129b8fe5b27f57213e88ff693672b77657", "size": "...
from __future__ import absolute_import from .diffusion import create_mrtrix_dti_pipeline from .connectivity_mapping import create_connectivity_pipeline from .group_connectivity import (create_group_connectivity_pipeline)
{ "content_hash": "c5e15f115e7b011a22f409656beb1550", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 68, "avg_line_length": 55.25, "alnum_prop": 0.8371040723981901, "repo_name": "FCP-INDI/nipype", "id": "044007abb1d402dbe98deed3871def2046cb3397", "size": "221", "binary": ...
"""Tests for numpy_utils.""" from etils import enp import jax import jax.numpy as jnp import numpy as np import pytest import tensorflow as tf import tensorflow.experimental.numpy as tnp # Activate the fixture set_tnp = enp.testing.set_tnp def fn(x): xnp = enp.get_np_module(x) y = xnp.sum(x) + x.mean() retur...
{ "content_hash": "844cd1801330db259592367142ee3b01", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 79, "avg_line_length": 24.438356164383563, "alnum_prop": 0.6631165919282511, "repo_name": "google/etils", "id": "cccb0a1ed6320a36f4a635344853e454e27e9ab8", "size": "5935",...
"""Utilities for Keras classes with v1 and v2 versions.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.framework import ops from tensorflow.python.util import lazy_loader # TODO(b/134426265): Switch back to single-quotes once the ...
{ "content_hash": "829934b2e61f3fbe88556b2a980f30c6", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 80, "avg_line_length": 37.145833333333336, "alnum_prop": 0.7002243409983174, "repo_name": "gunan/tensorflow", "id": "551a07d242285a80537381dc04cb5322744c1838", "size": "429...
'''This module is the foundation that allows users to write PyVows-style tests. ''' # pyVows testing engine # https://github.com/heynemann/pyvows # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 Bernardo Heynemann heynemann@gmail.com class VowsInternalError(Exc...
{ "content_hash": "e820a34305237dcbc4ffefe6bc2e5e2a", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 105, "avg_line_length": 31.09375, "alnum_prop": 0.6562814070351759, "repo_name": "heynemann/pyvows", "id": "3fc1d3bf3482f5fe88719ed46d4c4b344b801270", "size": "1019", "bi...
{ "name":u'CoMPS', 'version': '1.0', 'category': u'Saúde', 'depends':[], 'data':[ 'views/qweb/comps_template.xml', 'security/comps_security.xml', 'security/ir.model.access.csv', 'views/cadastro_usuarios_view.xml', 'views/cadastro_escola_view.xml', ...
{ "content_hash": "eedde612e72bb4cbc766e36d91d1d0fe", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 71, "avg_line_length": 38.829268292682926, "alnum_prop": 0.5722361809045227, "repo_name": "diogocs1/comps", "id": "33340fe0a83bf5f0537db77d36796931d6943b18", "size": "1611"...
import os import cv2 from gxic_rit.konan import Detector TEST_IMAGE = os.path.join( os.path.dirname(os.path.realpath(__file__)), 'example.jpg' ) if __name__ == '__main__': detector = Detector(None, 0.2) image = cv2.imread(TEST_IMAGE) frame, peoples = detector.detect(image) cv2.imwrite('exa...
{ "content_hash": "9284ca5545647459e701a7179b47beb9", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 48, "avg_line_length": 19.166666666666668, "alnum_prop": 0.6492753623188405, "repo_name": "GXIC-Real-Intelligence-Team/surveillance-core", "id": "ba2d90ef4082c8f3df15616ceb0a...
""" @author: Adam Reinhold Von Fisher - https://www.linkedin.com/in/adamrvfisher/ """ #This is an Edge Ratio calculator for single issue #May be deprecated see ERatioSingleIssueDonchianTrendIII.py #N Period Edge Ratio Computation #Import modules from YahooGrabber import YahooGrabber import numpy as np ...
{ "content_hash": "af95a85a5f735cb7c7d6ed3860c58cf5", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 122, "avg_line_length": 40.67307692307692, "alnum_prop": 0.6200945626477541, "repo_name": "adamrvfisher/TechnicalAnalysisLibrary", "id": "643cf658ff3190248bcf771e4a96c38a45e...