text
stringlengths
4
1.02M
meta
dict
from __future__ import absolute_import, unicode_literals from sys import platform def get_pytify_class_by_platform(): if 'linux' in platform: from spotiplay.linux import Linux return Linux elif 'darwin' in platform: from spotiplay.darwin import Darwin return Darwin else: ...
{ "content_hash": "da45f3d8985cc36f8f9e0c1e855c1c24", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 58, "avg_line_length": 25.266666666666666, "alnum_prop": 0.6701846965699209, "repo_name": "jaruserickson/spotiplay", "id": "769b7f036c9ee53924119d31ae911cfbf88d9109", "size...
import datetime import werkzeug from openerp import tools from openerp.addons.web import http from openerp.addons.web.http import request from openerp.addons.website.models.website import slug from openerp.osv.orm import browse_record from openerp.tools.translate import _ from openerp import SUPERUSER_ID from openerp....
{ "content_hash": "c1efdaca88a8bcb84b3afaaf6b36bcee", "timestamp": "", "source": "github", "line_count": 359, "max_line_length": 141, "avg_line_length": 46.22562674094708, "alnum_prop": 0.5854172943657728, "repo_name": "diogocs1/comps", "id": "12fd63f2fab6479d686bcf8754985dc04fd9ab62", "size": "1662...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('eventlog', '0029_auto_20180513_1045'), ] operations = [ migrations.AlterField( model_name='celerytaskprogress', name='task_t...
{ "content_hash": "6b60a69d1bc419df36169bcd5ecf503f", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 195, "avg_line_length": 29.944444444444443, "alnum_prop": 0.614100185528757, "repo_name": "awemulya/fieldsight-kobocat", "id": "d50a871992da1f720f7a4fdb82aa552f5a054fd0", "...
""" test_in_serializers ------------------- Tests of the fields cooperation in the serializer interfaces for serialization, de-serialization, and validation. """ from . import test_settings from rest_framework import serializers from drf_compound_fields.fields import DictField from drf_compound_fields.fields impo...
{ "content_hash": "c92a40416fdd3c566588b424dca15d38", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 99, "avg_line_length": 34.991379310344826, "alnum_prop": 0.7166789849716679, "repo_name": "estebistec/drf-compound-fields", "id": "d6301309c6b0d5401fc6f4109be5c12243f083ad",...
def import_1(): from m_module import func from n_module import func func() def import_2(): import m_module, n_module m_module.func() n_module.func() def import_3(): from m_module import func as mfunc from n_module import func as nfunc mfunc(); nfunc() if __name__ == '__main__': ...
{ "content_hash": "72f50ac210bb4530bf6b147def4d44a1", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 38, "avg_line_length": 19.105263157894736, "alnum_prop": 0.5922865013774105, "repo_name": "ordinary-developer/education", "id": "50c6a0dd52810e362efd10adf1c02900b7155cc4", ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('customers', '0009_recipient_type'), ] operations = [ migrations.AlterModelOptions( name='recipient', options={'ordering': ['...
{ "content_hash": "bf98bd15a9983fc76f515af3eca56cad", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 85, "avg_line_length": 22.823529411764707, "alnum_prop": 0.6082474226804123, "repo_name": "davogler/POSTv3", "id": "a0b8c1226a17d261ff2955178936b14b9e5fc04e", "size": "412"...
"""This provides a lineno() function to make it easy to grab the line number that we're on. Danny Yoo (dyoo@hkn.eecs.berkeley.edu) """ import inspect def lineno(): """Returns the current line number in our program.""" return inspect.currentframe().f_back.f_lineno if __name__ == '__main__': print "hello,...
{ "content_hash": "3b44a0484ae1b290a6774800ea00ef49", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 69, "avg_line_length": 24.294117647058822, "alnum_prop": 0.6585956416464891, "repo_name": "ActiveState/code", "id": "9a7e327ab03e6663d207e6e3ae3dbb00f78d93f8", "size": "413...
from direct.tkwidgets.AppShell import AppShell from direct.tkwidgets.VectorWidgets import ColorEntry from direct.showbase.TkGlobal import spawnTkLoop import seSceneGraphExplorer import Pmw, sys if sys.version_info >= (3, 0): from tkinter import Frame, IntVar, Checkbutton, Toplevel import tkinter else: fro...
{ "content_hash": "eab98eeae04984742163f8870380a484", "timestamp": "", "source": "github", "line_count": 462, "max_line_length": 122, "avg_line_length": 41.142857142857146, "alnum_prop": 0.5167824074074074, "repo_name": "chandler14362/panda3d", "id": "96c225c58fafea67c25527280b053ba87174f28a", "size...
from django.test import TestCase from mock import Mock, NonCallableMock, NonCallableMagicMock, patch from silk.collector import DataCollector from silk.models import SQLQuery, Request from silk.sql import execute_sql from .util import delete_all_models def mock_sql(): mock_sql_query = Mock(spec_set=['_execute_sq...
{ "content_hash": "a77d2fb65dab46b538092fa81e0ede30", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 92, "avg_line_length": 33.44186046511628, "alnum_prop": 0.6356050069541029, "repo_name": "CloudNcodeInc/silk", "id": "23c460196aa62cfecd72c74347d2479d18090422", "size": "28...
""" jinja2.testsuite.security ~~~~~~~~~~~~~~~~~~~~~~~~~ Checks the sandbox and other security features. :copyright: (c) 2017 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import pytest from jinja2 import Environment from jinja2.sandbox import SandboxedEnvironment, \ Imm...
{ "content_hash": "2938e7cce5da741224fec1cc505b5959", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 87, "avg_line_length": 37.212765957446805, "alnum_prop": 0.547455688965123, "repo_name": "ThiefMaster/jinja2", "id": "8e4222e521f742e6f9ce1cd5e4d862a62b10d54d", "size": "7...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os from errno import EEXIST from ansible.errors import AnsibleError from ansible.module_utils._text import to_bytes, to_native, to_text __all__ = ['unfrackpath', 'makedirs_safe'] def unfrackpath(path, follow=True, based...
{ "content_hash": "dee642d76a792888f40277a50d9d6d09", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 125, "avg_line_length": 35.42168674698795, "alnum_prop": 0.6653061224489796, "repo_name": "SergeyCherepanov/ansible", "id": "41ed017ef43e87c44a4c9567c7075ada22bad1fa", "siz...
import timeit import numpy as np from PIL import Image class CoMatrix(): ''' Co-occurrence matrix class ''' def __init__(self, dx, dy): ''' Initialize the class. Set non-negative distance between neighbours ''' if dx < 0 or dy < 0: raise Exception(u'Neighbour distance have to be non-negative') ...
{ "content_hash": "756d2ea918652728fc825cc34501d513", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 91, "avg_line_length": 51.5, "alnum_prop": 0.5867313915857605, "repo_name": "foobar167/junkyard", "id": "34dabd8611c6797ba8e5f921e1f8170513d4c481", "size": "3114", "binar...
from __future__ import unicode_literals from django.db import migrations, models import uuid class Migration(migrations.Migration): dependencies = [ ('cxbx_compat', '0011_executable_signature_status'), ] operations = [ migrations.AddField( model_name='executable', ...
{ "content_hash": "8a63868bf7379bf3d445b2e95fdf9bf1", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 95, "avg_line_length": 26.2, "alnum_prop": 0.6, "repo_name": "donwayo/xbox-db", "id": "941dbb0e2d84b97a917189fc660dc57063b2a4a9", "size": "728", "binary": false, "copie...
from django.db.models.fields.files import FileField, FieldFile from django.http import HttpResponse from django.core.files.storage import get_storage_class class ProtectedFileField(FileField): # attr_class = ProtectedFieldFile """ A FileField that gives the 'private' ACL to the files it uploads to S3, i...
{ "content_hash": "d33c7c1552f3108a08d2d967b83b7377", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 103, "avg_line_length": 40.11764705882353, "alnum_prop": 0.6906158357771262, "repo_name": "flavoi/diventi", "id": "31e8a15fa5892aadbcf7851bdd7b6aaee1d52932", "size": "683",...
""" zine.plugins.example_remote_auth ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sample remote authentication instead of Zine's built-in authentication. """ from zine.application import Request as RequestBase from zine.database import db from zine.utils import forms from zine.models import User, Group class Request...
{ "content_hash": "0747b4f6c74e914bd0d9a61c7e2f99be", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 75, "avg_line_length": 39.34285714285714, "alnum_prop": 0.6238198983297023, "repo_name": "mitsuhiko/zine", "id": "5c44fe6851e60b800c88155a6af8c98d6649b3ff", "size": "2778",...
""" The MIT License (MIT) Copyright (c) 2018 tilda 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, publis...
{ "content_hash": "f8639adc2cb7952cf423be25cc12a567", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 75, "avg_line_length": 27.341772151898734, "alnum_prop": 0.7379629629629629, "repo_name": "tilda/lolbot", "id": "2b0fa4c2d7ee8875b003a801122623805ac267bb", "size": "2160", ...
from collections import namedtuple import random import json from rdbtools.parser import RdbCallback from rdbtools.callbacks import encode_key ZSKIPLIST_MAXLEVEL=32 ZSKIPLIST_P=0.25 REDIS_SHARED_INTEGERS = 10000 MemoryRecord = namedtuple('MemoryRecord', ['database', 'type', 'key', 'bytes', 'encoding','size', 'len_la...
{ "content_hash": "a3cbf31effd877c2e6aabd5ad845441c", "timestamp": "", "source": "github", "line_count": 339, "max_line_length": 153, "avg_line_length": 40.448377581120944, "alnum_prop": 0.5977975495915986, "repo_name": "svolle/redis-rdb-tools", "id": "3ade7e32d40e8f42beac2407c2dab456f1304045", "siz...
import os import option import utility import grapeMenu import grapeGit as git import grapeConfig class Clone(option.Option): """ grape-clone Clones a git repo and configures it for use with git. Usage: grape-clone <url> <path> [--recursive] [--allNested] Arguments: <url> The URL of th...
{ "content_hash": "dc1aa347eaf388b655c7946e0d462b2a", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 120, "avg_line_length": 31.181818181818183, "alnum_prop": 0.5889212827988338, "repo_name": "robinson96/GRAPE", "id": "530ebd58aea0c6b33d05245813f2f54d1c4a046b", "size": "20...
import sentimentFilteredTweets import getEntities import spacy from spacy.en import English import unittest class TestUM(unittest.TestCase): parser = English() def setUp(self): pass def test_polarityscore(self): actual_value = sentimentFilteredTweets.getPolarityScores("RT @ANI_news: Terrorists attack po...
{ "content_hash": "ea371736725be441ddfacf4a967be30f", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 166, "avg_line_length": 42.58441558441559, "alnum_prop": 0.7197316254955779, "repo_name": "project-spinoza-dev/tsakpy", "id": "b265e17ee62eface21acc32cd0f3d6cb4d1e283c", "s...
from setuptools import setup, find_packages setup( name='ris.clickatellhttp', version='0.0.5', description='Python implementation of the HTTP API for Clickatell SMS gateway', url='https://github.com/rwizi/clickatellhttp', license='Apache', author='Rwizi Information Systems', author_email='...
{ "content_hash": "aff77deae74bfc174690685ba682da1f", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 83, "avg_line_length": 28.857142857142858, "alnum_prop": 0.6336633663366337, "repo_name": "rwizi/clickatellhttp", "id": "af778218dec7c6a2a970a40a955c65779ea740b1", "size": ...
from .stage03_quantification_dG_f_postgresql_models import * #SBaaS base from SBaaS_base.sbaas_base import sbaas_base from SBaaS_base.sbaas_base_query_update import sbaas_base_query_update from SBaaS_base.sbaas_base_query_drop import sbaas_base_query_drop from SBaaS_base.sbaas_base_query_initialize import sbaas_base_qu...
{ "content_hash": "02c6053ca575dbf41a57561913de212e", "timestamp": "", "source": "github", "line_count": 307, "max_line_length": 188, "avg_line_length": 48.32247557003257, "alnum_prop": 0.45527468823727674, "repo_name": "dmccloskey/SBaaS_thermodynamics", "id": "d1dbbb08448bb2d427413c5a19492a3142fe3874...
"""Tests for compute service.""" import base64 import contextlib import copy import datetime import operator import sys import testtools import time import traceback import uuid import mock import mox from oslo.config import cfg import nova from nova import availability_zones from nova import block_device from nova ...
{ "content_hash": "4342ea672479a941fcde98281bf11d16", "timestamp": "", "source": "github", "line_count": 9496, "max_line_length": 79, "avg_line_length": 43.652801179443976, "alnum_prop": 0.575996255973676, "repo_name": "ntt-sic/nova", "id": "a16f8c19ee1b1d00e136c70b9c74ed4add4e5027", "size": "415380...
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations ...
{ "content_hash": "c195f84ac98df5a1aab7dcb46e523f61", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 145, "avg_line_length": 33.46153846153846, "alnum_prop": 0.6333333333333333, "repo_name": "julienawilson/news-project", "id": "b894e9a1b1dc72210b1708b103abe2bae64b8634", "s...
import time import roslib; import rospy import actionlib from control_msgs.msg import * from trajectory_msgs.msg import * JOINT_NAMES = ['front_left_wheel_joint', 'back_left_wheel_joint', 'back_right_wheel_joint', 'front_right_wheel_joint'] Q1_ANGLE = 1.5708 Q0 = [0, 0, 0, 0] Q1 = [Q1_ANGLE, Q1_ANGLE, Q1_ANGLE, Q1_AN...
{ "content_hash": "697aab04c72c0510733768c9c23dd75e", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 118, "avg_line_length": 29.145833333333332, "alnum_prop": 0.6604717655468192, "repo_name": "arennuit/vrep_ros_control_example", "id": "cd00e2dad20d1ac777c8dc16419bdeefb61c00d...
"""Oppia base constants and handlers.""" __author__ = 'Sean Lip' import json import logging import sys import traceback import feconf import jinja2 from models.exploration import Exploration from models.state import State import webapp2 from google.appengine.api import users def require_user(handler): """Deco...
{ "content_hash": "dfa565fd5e4b0b68c12e20439609c01e", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 80, "avg_line_length": 34.565714285714286, "alnum_prop": 0.625227310299223, "repo_name": "sunu/oppia-test", "id": "1a9f00c1cfd4f60bf6de1ce1fa5d170f4b3c995b", "size": "6647...
import networkx as nx import operator class Properties: """ Some important properties of the graph. Arguments: graph - A networkx graph or digraph. """ def __init__(self, graph): self.g = graph def ConnectedComponents(self): """ Compute the connected components of the graph. Returns: a list c...
{ "content_hash": "1715c9ad44a32eccdb1ca807e354cce9", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 102, "avg_line_length": 21.62280701754386, "alnum_prop": 0.7022312373225152, "repo_name": "Jverma/TextGraphics", "id": "2ee74f9c8fd36143539f79e39a3f344681d41d95", "size": ...
import hmac, base64, struct, hashlib, time, json, os def get_hotp_token(secret, intervals_no): """This is where the magic happens.""" key = base64.b32decode(normalize(secret), True) # True is to fold lower into uppercase msg = struct.pack(">Q", intervals_no) h = bytearray(hmac.new(key, msg, hashlib.sha1).digest())...
{ "content_hash": "f052282c3f72f0532ebefd8e58d304a4", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 87, "avg_line_length": 30.069767441860463, "alnum_prop": 0.6465583913379737, "repo_name": "grahammitchell/google-authenticator", "id": "69139b2ee50b7e492a3520ffe99369e29420d5...
from RGT.XML.SVG.Attribs.basicSvgAttribute import BasicSvgAttribute from types import StringType class PositionAttributes(BasicSvgAttribute): ATTRIBUTE_X = 'x' ATTRIBUTE_Y = 'y' def __init__(self): BasicSvgAttribute.__init__(self) def setX(self, data): if data is not No...
{ "content_hash": "74d44687e1029e985fcc223f814d51b7", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 67, "avg_line_length": 27.405405405405407, "alnum_prop": 0.5690335305719921, "repo_name": "danrg/RGT-tool", "id": "67dd94524bb51570e767ee519d1133811c4030c2", "size": "1014"...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('studies', '0019_auto_20170723_1738'), ] operations = [ migrations.AlterModelOptions( name='study', options={'ordering': ['name'], 'p...
{ "content_hash": "871460fa71b17292f6c871dd573210bd", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 934, "avg_line_length": 72.17647058823529, "alnum_prop": 0.6658516707416463, "repo_name": "pattisdr/lookit-api", "id": "5164a3e83284b6088f756f76323f18b5a00c4116", "size": "...
""" Config module This module defines the class for getting configuration options :license: MIT, see LICENSE for more details :copyright: (c) 2016 by NETHINKS GmbH, see AUTORS for more details """ import os import configparser class AppConfig(object): def __init__(self, config_file=None): # get directory...
{ "content_hash": "caebb9a87fe3288e680d094faa4e4a35", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 68, "avg_line_length": 29.366666666666667, "alnum_prop": 0.6027241770715096, "repo_name": "NETHINKS/opennms-docker-env", "id": "1fc005cedf7cacfa0cc4741b62f003760b87b417", "...
"""Preprocessor applying tf.transform to the chicago_taxi data.""" # pytype: skip-file from __future__ import absolute_import, division, print_function import argparse import os import tensorflow as tf import tensorflow_transform as transform import tensorflow_transform.beam as tft_beam from tensorflow_transform.cod...
{ "content_hash": "2eec2dea7aaa13c459dd8495eb4ad1a1", "timestamp": "", "source": "github", "line_count": 241, "max_line_length": 79, "avg_line_length": 35.024896265560166, "alnum_prop": 0.6762231963037555, "repo_name": "iemejia/incubator-beam", "id": "057cb5863e2f67471094535ef4947780d42f4318", "size...
"""Fichier contenant le type Assiette.""" from .conteneur_nourriture import ConteneurNourriture class Assiette(ConteneurNourriture): """Type d'objet: assiette """ nom_type = "assiette" def __init__(self, cle=""): """Constructeur de l'objet""" ConteneurNourriture.__i...
{ "content_hash": "40ae4bf077aa8d14d707dfde3f9501e3", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 53, "avg_line_length": 22.8125, "alnum_prop": 0.6054794520547945, "repo_name": "stormi/tsunami", "id": "ce724e1b6998c54ad39758f7fa5cda02eff1c282", "size": "1930", "binary...
from pyramid.httpexceptions import HTTPClientError, HTTPInternalServerError from pyramid.renderers import render_to_response from pyramid.security import NO_PERMISSION_REQUIRED def error_view(context, request): data = { 'exc': context, } error_template = '/error.html' response = render_to_resp...
{ "content_hash": "27857982506e8f11247639269fb08aea", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 76, "avg_line_length": 32.56923076923077, "alnum_prop": 0.7085498346717053, "repo_name": "storborg/sidecar", "id": "5d8848edfddfe7a26eb15a1c1949583f8d810421", "size": "2117...
""" A custom manager for working with trees of objects. """ from django.db import connection, models, transaction from django.db.models import F, Max from django.utils.translation import ugettext as _ try: from django.db import connections, router except ImportError: # multi db support was new in django 1.2 ...
{ "content_hash": "5f49ea4d91c1811709fe241fa83717b4", "timestamp": "", "source": "github", "line_count": 907, "max_line_length": 99, "avg_line_length": 39.50826901874311, "alnum_prop": 0.5429201317184796, "repo_name": "danielnaab/django-mptt", "id": "848dad0e3fc5eb4fb50a761038d281979b867d3c", "size"...
from xformmanager.util import * # unfortunately, have to do something like this because of semi-circular dependencies import xformmanager as xfm from lxml import etree import logging XPATH_SEPARATOR = "/" class ElementDef(object): """ Stores metadata about simple and complex types """ def __init__(self, nam...
{ "content_hash": "654e89340e60065fced2e553535ef844", "timestamp": "", "source": "github", "line_count": 497, "max_line_length": 122, "avg_line_length": 43.06438631790744, "alnum_prop": 0.5696397701256833, "repo_name": "icomms/wqmanager", "id": "7df954061c5e2b02993591e439f2767565ba2361", "size": "21...
import os from setuptools import setup, find_packages def read(fname): buf = open(os.path.join(os.path.dirname(__file__), fname), 'rb').read() return buf.decode('utf8') setup(name='mtgjson', version='0.4.1.dev1', description='A python library for working with data from mtgjson.com.', long...
{ "content_hash": "d7f529d6c659333197bc118bb4151c48", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 77, "avg_line_length": 30.208333333333332, "alnum_prop": 0.6220689655172413, "repo_name": "mbr/pymtgjson", "id": "29b54ca9751c8b6920b8fac45349e7e24d66ec8d", "size": "772", ...
from sklearn2sql_heroku.tests.regression import generic as reg_gen reg_gen.test_model("SVR_poly" , "freidman1" , "sqlite")
{ "content_hash": "4328e0ff8f96f94cf3a9270e9e094d00", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 66, "avg_line_length": 31.25, "alnum_prop": 0.752, "repo_name": "antoinecarme/sklearn2sql_heroku", "id": "6f32db4cc1fd39577c786d93061d8f9e17356a46", "size": "125", "binary...
import argparse import sys import thread import logging import random import string import re import os from threading import Thread from impacket import version, smb3, smb from impacket.examples import logger from impacket.examples import serviceinstall from impacket.examples.ntlmrelayx.servers import SMBRelayServer,...
{ "content_hash": "42dbf07e8a1c963cbebee6345d21a3d4", "timestamp": "", "source": "github", "line_count": 447, "max_line_length": 160, "avg_line_length": 48.868008948545864, "alnum_prop": 0.6111060245376305, "repo_name": "tholum/PiBunny", "id": "26f4463c8cdf986ca949be19793bd534775516da", "size": "234...
import testtools from kmip.core import enums from kmip.core import exceptions from kmip.core import objects from kmip.core import primitives from kmip.core import utils from kmip.core.messages import payloads class TestSetAttributeRequestPayload(testtools.TestCase): """ A unit test suite for the SetAttribut...
{ "content_hash": "5f1c9eff1aea2609d276127d99cd155b", "timestamp": "", "source": "github", "line_count": 630, "max_line_length": 79, "avg_line_length": 34.06666666666667, "alnum_prop": 0.5928618022551486, "repo_name": "OpenKMIP/PyKMIP", "id": "bb113fa9e614c5c65afc22a7a9b3544478cf752d", "size": "2210...
"""Plotting function for the example 2D problem. """ import numpy as np import math import utils import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec from matplotlib import cm from mpl_toolkits.mplot3d import Axes3D def plot(proof, slice_, grid_size, dim_limits, slice_samples_X, slice_samples_Y, pas...
{ "content_hash": "51f1ff62d090ee3b83e43659d4ab4edc", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 116, "avg_line_length": 39.159574468085104, "alnum_prop": 0.6310785112741103, "repo_name": "langhabel/optimization-surrogate-generalization", "id": "f5d1b34e84f5a9cb6a8a1e98d...
import os import sys import logging from unittest import TestCase from nose.tools import ok_, eq_ from checker import * class OFPTest(TestCase): def setUp(self): # add cleanup func. self.addCleanup(self.cleanups) checker_setup(self) self.opts = checker_get_opts(self) # ...
{ "content_hash": "bd1dbbf3d91005c3068d440f85bd7951", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 77, "avg_line_length": 38.28, "alnum_prop": 0.46018808777429465, "repo_name": "lagopus/lagopus", "id": "59f60ec27937d0c17df3acddf622558b606ab8ad", "size": "4785", "binar...
from __future__ import (absolute_import, division, print_function, unicode_literals) def log(logger): """ Example: import plpacker import tests.helpers tests.helpers.log(plpacker.packager.LOGGER) """ import logging handler = logging.StreamHandler() ...
{ "content_hash": "601016a071c105727c3654b2b260e071", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 75, "avg_line_length": 25.523809523809526, "alnum_prop": 0.6455223880597015, "repo_name": "digitalrounin/py-lambda-packer", "id": "3c1f4a83c155fce2b645e350af8c54b9bf70c7aa", ...
from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineRes...
{ "content_hash": "dd3c939b8257a0989f387d87d3977a6e", "timestamp": "", "source": "github", "line_count": 709, "max_line_length": 250, "avg_line_length": 45.21156558533145, "alnum_prop": 0.6418655435969427, "repo_name": "Azure/azure-sdk-for-python", "id": "e4832b4a1e8d1e92d78f681ccb37c5fbb809b4d1", "...
import mock import six import ssl import testtools from kmip.core import attributes as attr from kmip.core import enums from kmip.core import objects as obj from kmip.core.factories import attributes from kmip.core.messages import contents from kmip.services.kmip_client import KMIPProxy from kmip.services import res...
{ "content_hash": "3f54d2affeef3995cdb3700faefceb1c", "timestamp": "", "source": "github", "line_count": 584, "max_line_length": 76, "avg_line_length": 37.542808219178085, "alnum_prop": 0.6285062713797035, "repo_name": "dmend/PyKMIP", "id": "92fce568b29c3b0a50258f801ce99a8703472b0e", "size": "22571"...
''' Created on Sep 21, 2015 @author: fteychene ''' import os from survey.settings import SurveyConfiguration from result.settings import ResultConfiguration SETTINGS = { 'DOMAIN': { 'survey': SurveyConfiguration.domain(), 'results': ResultConfiguration.domain(), }, 'DATE_FORMAT': '%Y-%m-%...
{ "content_hash": "65401d10eaa673b2801e17e984f742fb", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 80, "avg_line_length": 25.08, "alnum_prop": 0.6634768740031898, "repo_name": "fteychene/survey-server", "id": "75cf84fd00a2a85b026ff9f688047c01b2732f18", "size": "627", "...
""" Make a call graph for async functions. Does not catch regular function calls. """ import string from collections import OrderedDict # utils def is_func(line): line = line.strip(string.whitespace) return line.startswith('async def') or line.startswith('def') all_whitespace = lambda line: not line.strip(str...
{ "content_hash": "4df57f3b8c880b1f1130da5815c3d5a4", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 74, "avg_line_length": 30.130081300813007, "alnum_prop": 0.5315704263356719, "repo_name": "WIPACrepo/iceprod", "id": "f4caaa5f582d8cc8ec6d634b12796c04961c3345", "size": "3...
from rest_framework.decorators import api_view from rest_framework.response import Response from rest_framework.exceptions import APIException @api_view() def normal_response(request): # $ requestHandler # has no pre-defined content type, since that will be negotiated # see https://www.django-rest-framework.or...
{ "content_hash": "6e8a9807ebd6f2924dee5c6166cecdeb", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 118, "avg_line_length": 47.32, "alnum_prop": 0.621301775147929, "repo_name": "github/codeql", "id": "ec093499df63c897686815e6f1a2d64c08e5849a", "size": "2366", "binary": ...
import os import json import datetime import webapp2 import pkgutil from time import mktime from google.appengine.api import users from google.appengine.ext import ndb def set_api_path(api_path): __all__ = [] for loader, module_name, is_pkg in pkgutil.walk_packages(api_path): __all__.append(module_nam...
{ "content_hash": "50fe4dc5d7f2a874015a5be95ff407a8", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 83, "avg_line_length": 34.27906976744186, "alnum_prop": 0.6472184531886025, "repo_name": "trevorhreed/gae-demo", "id": "036387737a82263e8387257f9f3d27906d787442", "size": "...
"""Database models""" # pylint: disable=invalid-name,too-few-public-methods from sqlalchemy import Column, ForeignKey, Integer, Text from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship Base = declarative_base() class Question(Base): """Quizz question model""" __ta...
{ "content_hash": "cbd7d163405572c4baa29f73beb589ea", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 65, "avg_line_length": 22.77777777777778, "alnum_prop": 0.6604878048780488, "repo_name": "virtualtam/botibal", "id": "7fbe90bbb6d58f60ade4d7a94325e17cd39b3bc5", "size": "10...
""" Unit testing stuff """
{ "content_hash": "6d143cfeebce9a51afaa0a129c7aae67", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 26, "avg_line_length": 27, "alnum_prop": 0.5925925925925926, "repo_name": "dustinbcox/email_parser", "id": "431496ad7d6ab5515c1b7d1bbae2ed3a5056eeec", "size": "27", "binar...
from __future__ import unicode_literals from django.db import migrations import share.robot class Migration(migrations.Migration): dependencies = [ ('share', '0001_initial'), ('djcelery', '0001_initial'), ] operations = [ migrations.RunPython( code=share.robot.RobotU...
{ "content_hash": "ffba837bdbd0ec44995d9e9e0f624a01", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 66, "avg_line_length": 24.041666666666668, "alnum_prop": 0.6048526863084922, "repo_name": "zamattiac/SHARE", "id": "7cc5dc748d43a7186350abfb99b65cae1c6881fd", "size": "649"...
from __future__ import absolute_import, unicode_literals import importlib from contextlib import contextmanager from case import ( ANY, Case, ContextMock, MagicMock, Mock, call, mock, skip, patch, sentinel, ) __all__ = [ 'ANY', 'Case', 'ContextMock', 'MagicMock', 'Mock', 'call', 'mock', 'skip', 'pat...
{ "content_hash": "23566da12261a3a6557198f21e455a31", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 67, "avg_line_length": 23.441176470588236, "alnum_prop": 0.6041405269761606, "repo_name": "Elastica/kombu", "id": "057229e165f067e2d6ecb277ba260339f4167e83", "size": "1594"...
try: from urllib.error import HTTPError, URLError from urllib.parse import urlencode except ImportError: from urllib2 import HTTPError, URLError from urllib import urlencode import socket from pyowm.exceptions import api_call_error, not_found_error, unauthorized_error from pyowm.utils import timeformat...
{ "content_hash": "1ebbe5472846914c187d5511029238bf", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 85, "avg_line_length": 37.19580419580419, "alnum_prop": 0.5653318292912202, "repo_name": "mpvoss/RickAndMortyWeatherTweets", "id": "def200eae78dadf892169dd208308ac02212bcbf"...
import pytest import requests import requests_mock from pybib import utils from hamcrest import * class MockRequest: def __init__(self, code): self.code = code @property def status_code(self): return self.code def test_handle_status_code_200(): utils.handle_status_code(MockRequest(20...
{ "content_hash": "53557ec49d36d4b75c0d55f27a61e874", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 83, "avg_line_length": 29.31578947368421, "alnum_prop": 0.5175044883303411, "repo_name": "jgilchrist/pybib", "id": "d8196798a2a3d7a36f4f4efdc9a227198050cafa", "size": "2228...
from django.forms.forms import BaseForm from django.forms.widgets import media_property from django.http import HttpResponseRedirect from six import with_metaclass from .constants import WIZARD_TYPE_COOKIE, WIZARD_TYPE_SESSION from formtools.wizard.views import ( CookieWizardView, SessionWizardView, Wiza...
{ "content_hash": "1e509e83f34be902b7ea9c6aaeb32b16", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 78, "avg_line_length": 39.03636363636364, "alnum_prop": 0.5407545412203074, "repo_name": "mansonul/events", "id": "bac27e246b0cd33f7972f9da6b43fd8e20d01c3a", "size": "4294...
"""toger URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based...
{ "content_hash": "fec18ba202a274d7b3417b3c4e0d689d", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 83, "avg_line_length": 38.58620689655172, "alnum_prop": 0.646112600536193, "repo_name": "MarsBighead/mustang", "id": "9b2bf9a563e94385c72dec2314c745ffa660cccd", "size": "11...
""" Export nikeplus data to csv or print to screen """ import argparse from collections import namedtuple import csv from datetime import datetime import json import os.path import sys import time import urllib2 # FIXME: Could use descriptors here: # - Could hold: default value, api name, pretty name, and conversio...
{ "content_hash": "5d5a65f6eff4f1a3ee36e187883404b8", "timestamp": "", "source": "github", "line_count": 217, "max_line_length": 83, "avg_line_length": 31.493087557603687, "alnum_prop": 0.5845771144278606, "repo_name": "durden/nikeplus", "id": "f5b577ff7be4bcbde82a1b3e16a10f93a8dba53c", "size": "685...
"""Location helpers for Home Assistant.""" from blumate.const import ATTR_LATITUDE, ATTR_LONGITUDE from blumate.core import State from blumate.util import location as loc_util def has_location(state): """Test if state contains a valid location.""" return (isinstance(state, State) and isinstance(s...
{ "content_hash": "bbb05f6aa6fa346f5362815b1d1c1b07", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 70, "avg_line_length": 31.48148148148148, "alnum_prop": 0.6835294117647058, "repo_name": "bdfoster/blumate", "id": "9df7e6d6bfd8130b8d7145c772167dd8eac476d0", "size": "850"...
import sys import os import os.path import inspect from ply import lex, yacc class Parser(object): """Wrapper object for PLY lexer/parser.""" exception = ValueError @classmethod def _table_name(cls, suffix, relative=False): """Return the module name for PLY's parsetab file.""" mname...
{ "content_hash": "0247af033851db1861cbad5b9fb6f10d", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 76, "avg_line_length": 32.922222222222224, "alnum_prop": 0.5420182247721903, "repo_name": "geertj/argproc", "id": "a748c97e7c11b44128345fbf86d529fd8dc817d7", "size": "3283"...
import _include from co8Util.Logger import Logger from co8Util.PersistentData import Co8PersistentData print "initializing _co8init.py\n" def save(savename): ## logger = Logger(__name__) ## logger.logme("save:" + savename) print "Executing Co8 Save Hook\n" Co8PersistentData.save(savename) def load(savename): ...
{ "content_hash": "e001bb081bb69b08a9ad4e8a9101c497", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 52, "avg_line_length": 24.666666666666668, "alnum_prop": 0.7207207207207207, "repo_name": "GrognardsFromHell/TemplePlus", "id": "1f117d6d0980f7af168858aac5337f3043ef6232", ...
from .resource import Resource class VirtualNetworkGatewayConnection(Resource): """A common class for general resource information. 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. :va...
{ "content_hash": "189d04234b114c499de5a9e9b3e876e4", "timestamp": "", "source": "github", "line_count": 125, "max_line_length": 282, "avg_line_length": 49.8, "alnum_prop": 0.6729317269076305, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "eafc299d245401ac96e46e4ab7b9e6dbe3980592", "size": "...
from core.himesis import Himesis, HimesisPreConditionPatternLHS import uuid class HSS1_if_ConnectedLHS(HimesisPreConditionPatternLHS): def __init__(self): """ Creates the himesis graph representing the AToM3 model HSS1_if_ConnectedLHS. """ # Flag ...
{ "content_hash": "f1a3dd39ecdb670ff3d339c15e1b1bd6", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 125, "avg_line_length": 43.19672131147541, "alnum_prop": 0.4713472485768501, "repo_name": "levilucio/SyVOLT", "id": "cbebf0b1beeed3802405548d555d5c18204f4c10", "size": "263...
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 model 'Event' db.create_table(u'events_event', ( (u'id', self.gf('django.db.models.fields.AutoField')(primary_k...
{ "content_hash": "82a8d1e3d71a13fbd044e274d2242a4c", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 187, "avg_line_length": 68.69620253164557, "alnum_prop": 0.5638474295190713, "repo_name": "alexlovelltroy/django-telemetry", "id": "0f3cec9a3d60644f1b42857873b22d073374c28e",...
"""A sample application for cmd2 that explores a GNU Readline bug related to ANSI color escape codes. """ import colorama from colorama import Fore from cmd2 import Cmd, make_option, options class CmdLineApp(Cmd): """ Example cmd2 application. """ def __init__(self): # Set use_ipython to True to enab...
{ "content_hash": "36e5d962d16795ab1c498f6ad66129d3", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 101, "avg_line_length": 28.85, "alnum_prop": 0.6447140381282496, "repo_name": "tleonhardt/CodingPlayground", "id": "1fe9a9f574d6b1e20b9dbc6cc02911492a1836ca", "size": "615"...
"""Support for the light on the Sisyphus Kinetic Art Table.""" import logging import aiohttp from homeassistant.components.light import SUPPORT_BRIGHTNESS, Light from homeassistant.const import CONF_HOST from homeassistant.exceptions import PlatformNotReady from . import DATA_SISYPHUS _LOGGER = logging.getLogger(__...
{ "content_hash": "579fb4992e2eb100ca5534dcd23a3b7a", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 76, "avg_line_length": 29.885057471264368, "alnum_prop": 0.6342307692307693, "repo_name": "jabesq/home-assistant", "id": "9ad36df6118e551a6047710b5e8abc3a8be89985", "size":...
""" Script to get spectrum from OceanOptics Spectroscope over time Things to modify before use: - gid and uid of current user """ from __future__ import print_function from builtins import str from builtins import range import sys, os base_dir = os.path.dirname(os.path.realpath(__file__)) root_dir = os.path.abspath(o...
{ "content_hash": "78f5f4acb5b21d3da280145ebfa94ff4", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 172, "avg_line_length": 38.55084745762712, "alnum_prop": 0.5647395031875138, "repo_name": "sunjerry019/photonLauncher", "id": "e3a311c6637a4a2c5cb439c4a14b23301b32b433", "...
import sys, unittest from decimal import Decimal from datetime import date from pony.orm import * from pony.orm.tests.testutils import * db = Database('sqlite', ':memory:') class Student(db.Entity): name = Required(str) scholarship = Optional(int) gpa = Optional(Decimal, 3, 1) dob = Opti...
{ "content_hash": "e0492197667dac9c61e3fe57c2dde6a4", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 120, "avg_line_length": 34.72072072072072, "alnum_prop": 0.6097560975609756, "repo_name": "compiteing/flask-ponypermission", "id": "e33f3c97f1fa070dc345be4fdbe795f1f4a3154b"...
"""Process application events.""" from __future__ import absolute_import import tempfile import logging import os import time import kazoo.client import yaml from . import exc from . import idirwatch from . import sysinfo from . import zkutils from . import zknamespace as z _LOGGER = logging.getLogger(__name__) _...
{ "content_hash": "b3388428ee63953335dca114cb00b034", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 78, "avg_line_length": 31.21212121212121, "alnum_prop": 0.5673139158576052, "repo_name": "toenuff/treadmill", "id": "d8a758f40dbb7bdabe760b020d86c4a2b2db4d87", "size": "309...
"""Access and/or modify INI files * Compatiable with ConfigParser * Preserves order of sections & options * Preserves comments/blank lines/etc * More conveninet access to data Example: >>> from StringIO import StringIO >>> sio = StringIO('''# configure foo-application ... [foo] ... bar1 = qualia ...
{ "content_hash": "38e1d5c9529d5bbff6bbdd7a3e22f51c", "timestamp": "", "source": "github", "line_count": 634, "max_line_length": 83, "avg_line_length": 32.09305993690852, "alnum_prop": 0.5350665945839681, "repo_name": "m00dawg/holland", "id": "56f4c30768d01eddaf1d11428692d5a4c8313260", "size": "2034...
__revision__ = "$Id: test_Acspy_Common_TimeHelper.py,v 1.1.1.1 2012/03/07 17:40:45 acaproni Exp $" #--REGULAR IMPORTS------------------------------------------------------------- import unittest import time import acstime #--ACS IMPORTS____------------------------------------------------------------- import Acspy.Commo...
{ "content_hash": "f72d484c9c5d9f21ad29c9666affef18", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 98, "avg_line_length": 34.58119658119658, "alnum_prop": 0.634206623826001, "repo_name": "csrg-utfsm/acscb", "id": "eaec642161f800698ef2655eb753f5b68ed4a452", "size": "5268...
from wsgiref.handlers import format_date_time from six.moves.urllib.parse import urlparse from requests.auth import AuthBase from datetime import datetime import six import time import hmac import base64 import hashlib import logging log = logging.getLogger('bigstash.sign') class Light_HTTPSignatureAuth(AuthBase): ...
{ "content_hash": "1daaaced6e1c12c55e19e058ead8a9db", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 116, "avg_line_length": 36.58108108108108, "alnum_prop": 0.5526413003324714, "repo_name": "longaccess/bigstash-python", "id": "27751f0324663289f1b17d866976005eed119ca0", "s...
from scribe_client import ScribeClient from trace import Annotation, Trace, Endpoint from collections import defaultdict from formatters import base64_thrift_formatter class ZipkinClient(ScribeClient): DEFAULT_END_ANNOTATIONS = ("ss", "cr", "end") def __init__(self, port, host): super(ZipkinClient, ...
{ "content_hash": "75378d7e8d3a896175618c7bafc220b2", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 73, "avg_line_length": 34.970588235294116, "alnum_prop": 0.605130361648444, "repo_name": "linuxbox2/blkin", "id": "28118facb4c39d8256ff4b4de175cbb167f46873", "size": "2397"...
"""An Ant wrapper that suppresses useless Ant output. Ant build scripts output "BUILD SUCCESSFUL" and build timing at the end of every build. In the Android build, this just adds a lot of useless noise to the build output. This script forwards its arguments to ant, and prints Ant's output up until the BUILD SUCCESSFUL...
{ "content_hash": "208fce9505e1fd841d2163921046cb62", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 79, "avg_line_length": 28, "alnum_prop": 0.7023809523809523, "repo_name": "shaochangbin/crosswalk", "id": "6eca4fc0c6483a2b6c80e32c9156a8db9907abb0", "size": "883", "bina...
"""Test URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based ...
{ "content_hash": "608e603e8d34c3af8a8c721938ee6bd2", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 79, "avg_line_length": 36.19047619047619, "alnum_prop": 0.6986842105263158, "repo_name": "13lcp2000/CF_django_1-9-6", "id": "a76b01124dc6d2a39a95e068d432048ad21834de", "siz...
from datetime import time, timedelta import unittest from convertish.util import SimpleTZInfo class TestSimpleTZInfo(unittest.TestCase): def test_utcoffset(self): self.assertEquals(SimpleTZInfo(60).utcoffset(None), timedelta(minutes=60)) self.assertEquals(SimpleTZInfo(-60).utcoffset(None), timed...
{ "content_hash": "fd4cbf66b66914222a0de309706d7df2", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 92, "avg_line_length": 39.857142857142854, "alnum_prop": 0.6693548387096774, "repo_name": "ish/convertish", "id": "a6bc774e01b09f0b7fb3a63086d7fe8f2c00b399", "size": "1116"...
from __future__ import absolute_import, print_function, division import unittest from pony.orm.core import * db = Database('sqlite', ':memory:') class Person(db.Entity): name = Required(unicode) age = Required(int) db.generate_mapping(create_tables=True) with db_session: p1 = Person(nam...
{ "content_hash": "2dd4bc941ba74380a0797d8236b38dce", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 93, "avg_line_length": 28.450292397660817, "alnum_prop": 0.5405960945529291, "repo_name": "Ahmad31/Web_Flask_Cassandra", "id": "7d9dd5df7624d617d1172bde5288a10f47be60cf", ...
import urllib.parse import flask from dila import config from dila.frontend.flask import languages from dila.frontend.flask import user_tools def setup_app(app): @app.template_global() def static_url(filename): if config.STATIC_URL: return urllib.parse.urljoin(config.STATIC_URL, filename...
{ "content_hash": "b0671fa470477566c3bb3c2cba5077fc", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 71, "avg_line_length": 28.235294117647058, "alnum_prop": 0.659375, "repo_name": "socialwifi/dila", "id": "2c3847fc74c6fa8f2b7d0d307ae1badc02d34591", "size": "960", "binar...
from setuptools import setup, find_packages from os import path import re # Get current path here = path.abspath(path.dirname(__file__)) # Get version from strikepackage.py with open(path.join(here, 'strikepackage/strikepackage.py')) as f: version_file = f.read() version_match = re.search(r"^__version__ = ['\"]([...
{ "content_hash": "c48a3b44f0a336178c8563d2d5dc5def", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 79, "avg_line_length": 29.46153846153846, "alnum_prop": 0.6318537859007833, "repo_name": "pwyliu/strikepackage", "id": "f236c92fe62c811692fe807e58a9db0d5a216b8f", "size": "...
from textwrap import dedent from pants.testutil.pants_run_integration_test import PantsRunIntegrationTest class DependeesIntegrationTest(PantsRunIntegrationTest): TARGET = "examples/src/scala/org/pantsbuild/example/hello/welcome" def run_dependees(self, *dependees_options): args = ["-q", "dependees...
{ "content_hash": "3f95930ffa287939361cbe3e7e85f5ae", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 96, "avg_line_length": 41.17910447761194, "alnum_prop": 0.602392171076477, "repo_name": "wisechengyi/pants", "id": "fef4ff1fbc2da9ddb86a56e3afedba28e1b53627", "size": "2891...
__version__ = "0.9.10.3" # cfgrib core API depends on the ECMWF ecCodes C-library only from .abc import Field, Fieldset, Index, MappingFieldset from .cfmessage import COMPUTED_KEYS from .dataset import ( Dataset, DatasetBuildError, compute_index_keys, open_fieldset, open_file, open_from_index, ...
{ "content_hash": "8fd8da2998bb3c444ff8bd1e1875c675", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 86, "avg_line_length": 27.95, "alnum_prop": 0.7334525939177102, "repo_name": "ecmwf/cfgrib", "id": "cc71588d47d37b274b46b61f208373502fdf6318", "size": "1188", "binary": f...
from azure.identity import DefaultAzureCredential from azure.mgmt.redisenterprise import RedisEnterpriseManagementClient """ # PREREQUISITES pip install azure-identity pip install azure-mgmt-redisenterprise # USAGE python redis_enterprise_databases_import.py Before run the sample, please set the value...
{ "content_hash": "3c544392f78b619cb158f244408e9366", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 147, "avg_line_length": 35.475, "alnum_prop": 0.7061310782241015, "repo_name": "Azure/azure-sdk-for-python", "id": "a1111a5b6ce665b4f97ff16dbbaea5212ee84830", "size": "1887...
from __future__ import division import numpy as np from .utils import lazy_range, izip, iteritems from .mp_utils import progress def _linear(Bs, dim, num_q, rhos, nus): # and the rest of the estimator is # B / m * mean(nu ^ -dim) return Bs / num_q * np.mean(nus ** (-dim), axis=0) def kl(Ks, dim, num...
{ "content_hash": "952b0ef9b638ef3491d0913633cb0382", "timestamp": "", "source": "github", "line_count": 203, "max_line_length": 80, "avg_line_length": 36.38423645320197, "alnum_prop": 0.5335770376387761, "repo_name": "dougalsutherland/py-sdm", "id": "1136a51fe256d1fd15d8a8ba5976bbdd8d4a234c", "size...
from flask_failsafe import failsafe @failsafe def create_app(): from app import app return app if __name__ == '__main__': create_app().run()
{ "content_hash": "a11610ebd7b72a7abca3a972039c2e50", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 35, "avg_line_length": 14.272727272727273, "alnum_prop": 0.6242038216560509, "repo_name": "Snuggert/moda", "id": "00d873a76f7b21b51456043d29f009bbc0c4ebc1", "size": "157", ...
""" Tests for the `v2ex last` function """ from __future__ import absolute_import import re import pytest from v2ex_daily_mission.cli import cli @pytest.mark.usefixtures('mock_api') class TestLast(): def test_last(self, runner): result = runner.invoke(cli, ['--config', './tests/v2ex_config.json', ...
{ "content_hash": "14ce657bb71de914970bee06474fedfb", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 76, "avg_line_length": 23.285714285714285, "alnum_prop": 0.5869120654396728, "repo_name": "lord63/v2ex_daily_mission", "id": "2c2fa5dda9208cbbd306c60ebb79ac2a134be9ea", "si...
from test_framework.test_framework import KoreTestFramework from test_framework.util import * class ZapWalletTXesTest (KoreTestFramework): def setup_chain(self): print("Initializing test directory "+self.options.tmpdir) initialize_chain_clean(self.options.tmpdir, 3) def setup_network(self, s...
{ "content_hash": "d17e55296586a6e25570936143d9b446", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 106, "avg_line_length": 37.49295774647887, "alnum_prop": 0.6187077385424493, "repo_name": "Kore-Core/kore", "id": "eae2229cbd04a2ad76c00e74933edd5029392847", "size": "2874"...
import unittest from pymal import account from pymal.account_objects import account_mangas from pymal.account_objects import account_animes from pymal.account_objects import account_friends from tests.constants_for_testing import ACCOUNT_TEST_USERNAME, ACCOUNT_TEST_PASSWORD class InitTestCase(unittest.TestCase): ...
{ "content_hash": "8a59940f486264fcfad0eb19d0099b1d", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 84, "avg_line_length": 33.72289156626506, "alnum_prop": 0.7034655234012147, "repo_name": "pymal-developers/pymal", "id": "5e11591c55e9c73684f8f3dab038fc33cee062e0", "size":...
from pyss.mpi.algorithm.linsolve import * from pyss.mpi.algorithm.svd import *
{ "content_hash": "9e132ae091fab086bb88b892cee5f102", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 41, "avg_line_length": 39.5, "alnum_prop": 0.7974683544303798, "repo_name": "ibara1454/pyss", "id": "b6ef76f7a919f08af5f6795eede5db6392128ee9", "size": "126", "binary": fa...
from copy import deepcopy from bson.objectid import ObjectId from flask_mongoengine import DoesNotExist from mongoengine.queryset.visitor import Q from pymongo import UpdateOne from app.api.article.model import Article from app.api.comment.model import Comment from app.api.group.model import Group from app.api.list.m...
{ "content_hash": "baa5c4238e904e38ee565528ba2ff0c4", "timestamp": "", "source": "github", "line_count": 650, "max_line_length": 106, "avg_line_length": 29.736923076923077, "alnum_prop": 0.6319519892389673, "repo_name": "TeamGhostBuster/restful-api", "id": "cb01ff6a2d4f3d75c7739b91ef9d1217611d150b", ...
""" Installs and configures an OpenStack Swift """ import uuid import logging import os from packstack.installer import validators from packstack.installer import basedefs import packstack.installer.common_utils as utils from packstack.modules.ospluginutils import getManifestTemplate, appendManifestFile, manifestfil...
{ "content_hash": "d966e914d756b97655725e3ab7e9e38a", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 411, "avg_line_length": 47.94285714285714, "alnum_prop": 0.5720245189851865, "repo_name": "skottler/packstack", "id": "e06a02ffbb42e9cc480db69ef9d9b3dcb11bf62e", "size": "...
from common.adafruit.Adafruit_ADS1x15 import Adafruit_ADS1x15 # from threading import RLock # May be needed if we end up multiplexing readings with a 16:1 analog mux class VH400MoistureSensor(object): """ This class supports the Vegetronix VH400 MoistureSensor """ ADS1115 = 0x01 def __init__...
{ "content_hash": "c73da1247ed7a89dae3282a52d6272ab", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 140, "avg_line_length": 34.3968253968254, "alnum_prop": 0.5592985694508538, "repo_name": "mecworks/garden_pi", "id": "e5da6ca424400a1b6cb33f2a5d4463e82fce6fcf", "size": "4...
from xudd.lib.server import Server from xudd.lib.http import HTTP from xudd.lib.wsgi import WSGI from xudd.hive import Hive import logging def wsgi_app(environ, start_response): response = start_response(200, {'Content-Type': 'text/plain'}.items()) response('Hello World!') def serve(): logging.basicConfi...
{ "content_hash": "f6e6a7c6b739feb60473d6c64ab02b47", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 74, "avg_line_length": 24.09090909090909, "alnum_prop": 0.6792452830188679, "repo_name": "xudd/xudd", "id": "0f27fb94889bb9cab7b98e1c7a1e0112574d06a4", "size": "795", "bi...
"""Script for unittesting the bdev module""" import os import random import unittest from ganeti import compat from ganeti import constants from ganeti import errors from ganeti import objects from ganeti import utils from ganeti.storage import bdev import testutils def _FakeRunCmd(success, stdout, cmd): if succ...
{ "content_hash": "0e2f708c37343179a2d06c14107bf691", "timestamp": "", "source": "github", "line_count": 620, "max_line_length": 81, "avg_line_length": 41.248387096774195, "alnum_prop": 0.6298584499882693, "repo_name": "leshchevds/ganeti", "id": "a894e8fd641557ea7572e98f29e6f730e8637be4", "size": "2...
cars = 100 space_in_a_car = 4 drivers = 30 passengers = 90 cars_not_driven = cars - drivers cars_driven = drivers carpool_capacity = cars_driven * space_in_a_car average_passengers_per_car = passengers / cars_driven print("There are {0} cars available.".format(cars)) print("There are only {0} drivers available.".forma...
{ "content_hash": "767ebae09c019014b295ece70bbd118a", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 92, "avg_line_length": 39.25, "alnum_prop": 0.7372611464968153, "repo_name": "eilinx/lpthw", "id": "ca22991f54cd503afa75c65db98b37ca7c0bf451", "size": "653", "binary": fa...
__all__ = [ 'overlay_hook' ] from code import * from dump import * from mem import * includes['hook'] = '#include "hook.h"' defines['hook_stack_lines'] = 8 defines['hook_show_stack'] = True defines['hook_show_registers'] = True defines['hook_show_timestamp'] = True defines['hook_show_message'] = True def overlay_h...
{ "content_hash": "6f7b75682f54aceed6e02c9809266715", "timestamp": "", "source": "github", "line_count": 327, "max_line_length": 103, "avg_line_length": 43.22935779816514, "alnum_prop": 0.5870826259196378, "repo_name": "scanlime/coastermelt", "id": "e8b1c9b3114612b49883d96b07d8bae4633cb823", "size":...
from django.conf import settings from .models import Achievement from .utils import check_achievement_plain class AutoAchievementChecker(object): def process_response(self, request, response): if not getattr(request, 'user'): return response user = request.user try: methods = [i.lower() fo...
{ "content_hash": "b8b4dfe56983d7844f58be0be2945d02", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 84, "avg_line_length": 27.130434782608695, "alnum_prop": 0.7035256410256411, "repo_name": "ogirardot/django-achievements", "id": "3aaa3fe0727a54cd3e8d9b3805bdfed6b83e3194", ...
from __future__ import absolute_import import os from datetime import timedelta from celery import Celery from celery.schedules import crontab # set the default Django settings module for the 'celery' program. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'server.settings') from django.conf import settings # noq...
{ "content_hash": "66078957e4619a7b3a85cdfa2549bbfd", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 70, "avg_line_length": 29.539473684210527, "alnum_prop": 0.578173719376392, "repo_name": "malaonline/Server", "id": "ac1a0cf93c8fd18ad10400fd344b6f2f9133adac", "size": "227...
import requests import json #ANNA_KENDRICK_1 = "http://hellogiggles.com/wp-content/uploads/2015/04/10/anna-kendrick-pitch-perfect-650-430.jpg" #ANNA_KENDRICK_2 = "http://zntent.com/wp-content/uploads/2015/02/Anna-Kendrick-2.jpg" DETECT_URL = "https://api.projectoxford.ai/face/v1.0/detect?returnFaceId=true&returnFaceL...
{ "content_hash": "e12154b23c6515fa52c4d611f8ed8d9b", "timestamp": "", "source": "github", "line_count": 161, "max_line_length": 141, "avg_line_length": 25.46583850931677, "alnum_prop": 0.6809756097560976, "repo_name": "jayendrajog/LA-Hacks-2016", "id": "adfd8594ac8ad7fb2ed436786f90cf1c20a70046", "s...
""" experipy.system ~~~~~~~~~~~~~~~ This module provides a number of system and shell tools for helping to specify common tasks within the experipy grammar. """ from os import path from .grammar import Executable def cd(dirname): return Executable("cd", [dirname]) def cp(target, dest,...
{ "content_hash": "1526f0abbfec046695c7b3822ff1d7cf", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 75, "avg_line_length": 23.040816326530614, "alnum_prop": 0.6359610274579274, "repo_name": "Elemnir/experipy", "id": "d3484bd579ec7f9f459039b4bb531879780085a9", "size": "112...
import proto def test_singly_nested_message(): class Foo(proto.Message): class Bar(proto.Message): value = proto.Field(proto.INT32, number=1) bar = proto.Field(proto.MESSAGE, number=1, message=Bar) foo = Foo(bar=Foo.Bar(value=42)) assert foo.bar.value == 42 def test_multipl...
{ "content_hash": "6c5ddec87e86be1165ef4039db0a3234", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 71, "avg_line_length": 29.74, "alnum_prop": 0.6086079354404842, "repo_name": "googleapis/proto-plus-python", "id": "41af9507f22e3e18e58f4c629967754d082bf352", "size": "2063...
from setuptools import setup, find_packages from cybots import __version__ setup( name='{{ cybots }}', version=__version__, url='http://host/', author='TrungAnh', author_email='trungnt13@outlook.com', packages=find_packages(), include_package_data=True, scripts=['manage.py'], ins...
{ "content_hash": "5b4b231fce01fa9be96311fc26e51373", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 43, "avg_line_length": 19.263157894736842, "alnum_prop": 0.6120218579234973, "repo_name": "trungnt13/django_template", "id": "7c0496894ad30fede4df7f27fb285aa02eb6d348", "si...