text
stringlengths
4
1.02M
meta
dict
class ENoteAuth(): def __init__(self): pass def get_token(self): token = raw_input('Request token from https://www.evernote.com/api/DeveloperToken.action and past it here: ') return token
{ "content_hash": "70c2256a5f0671b72678ddfcd3ba14a6", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 117, "avg_line_length": 31.571428571428573, "alnum_prop": 0.6289592760180995, "repo_name": "tkjacobsen/enote", "id": "2395b001e2ebabe2c7f63eba6f3629d309161fc6", "size": "316...
from time import time import numpy as np import tensorflow as tf tf.logging.set_verbosity(tf.logging.INFO) def load_cifar10(path=None): if path is None: # DATASET_DIR = '/Users/Zhang/Research/Deep Learning Dataset/CIFAR/cifar-10-batches-py/' DATASET_DIR = '/home/ubuntu/datasets/cifar-10-batches-...
{ "content_hash": "58293735e4f922568750e391c846c6c5", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 120, "avg_line_length": 49.08571428571429, "alnum_prop": 0.5965408282055547, "repo_name": "zhangjunpeng9354/Learning-Tensorflow-by-Models", "id": "f416a3005f79f42406acf3fdfd...
""" WSGI config for djdan project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` se...
{ "content_hash": "f4a68cd220766091a777f454e477889a", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 79, "avg_line_length": 40.42857142857143, "alnum_prop": 0.799469964664311, "repo_name": "BL-Labs/annotator_demonstrator", "id": "3e779158329f8301096bf1430822566717eb5ae4", ...
"""Registration facilities for DOM. This module should not be used directly. Instead, the functions getDOMImplementation and registerDOMImplementation should be imported from xml.dom.""" # This is a list of well-known implementations. Well-known names # should be published by posting to [email protected], and are # ...
{ "content_hash": "4c78d07410705910edffc39c5925cd19", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 78, "avg_line_length": 34.85858585858586, "alnum_prop": 0.6708200521587946, "repo_name": "huguesv/PTVS", "id": "69c17eebb265daad3243e62018409d72942a93af", "size": "3451", ...
""" Code to manage the creation and SQL rendering of 'where' constraints. """ import operator from functools import reduce from django.core.exceptions import EmptyResultSet from django.db.models.expressions import Case, When from django.db.models.lookups import Exact from django.utils import tree from django.utils.fun...
{ "content_hash": "445df33c93329ed633986545cba44a51", "timestamp": "", "source": "github", "line_count": 342, "max_line_length": 88, "avg_line_length": 36.187134502923975, "alnum_prop": 0.5889625080801552, "repo_name": "MarkusH/django", "id": "e2af46a30927763c578706d6afe3a5d5e3f66d54", "size": "1237...
''' This file holds all of the forms for the cleaning and validation of the parameters being used for friends. Created on Dec 20, 2013 @author: Andrew Oberlin, Jake Gregg ''' from django import forms from rememerme.friends.models import Friends from rememerme.friends.rest.exceptions import Friend...
{ "content_hash": "7c223558d56bb5234b2c6fdc0b9d61cf", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 99, "avg_line_length": 31.056338028169016, "alnum_prop": 0.6580498866213151, "repo_name": "rememerme/friends-api", "id": "20480ca045a6509189943227f656ab6f573e3a37", "size":...
import numpy as np import pyflux as pf noise = np.random.normal(0,1,200) data = np.zeros(200) for i in range(1,len(data)): data[i] = 1.0*data[i-1] + noise[i] countdata = np.random.poisson(3,200) def test_skewt_couple_terms(): """ Tests latent variable list length is correct, and that the estimated latent variab...
{ "content_hash": "eb1c847ff11a8025cd33799304365649", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 87, "avg_line_length": 33.429577464788736, "alnum_prop": 0.6928586475668843, "repo_name": "RJT1990/pyflux", "id": "0ff925beaf5ef2567704c3c1920f77502dc58969", "size": "4747...
from django.db import models class Organization(models.Model): owner = models.ForeignKey('auth.User',related_name="organizations") name = models.CharField(max_length=128) created = models.DateTimeField(auto_now_add=True) class Household(models.Model): organization = models.ForeignKey(Organization,related_name="ho...
{ "content_hash": "c98d58007dd90ef1c6cadcaaffad61c5", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 77, "avg_line_length": 39.70175438596491, "alnum_prop": 0.7843570481661511, "repo_name": "ryanrborn/lds-leader-tool-suite-backend", "id": "b7ac02e10cdec85afd4ab29eadd22673384...
from msrest.service_client import ServiceClient from msrest import Configuration, Serializer, Deserializer from .operations.byte import Byte from . import models class AutoRestSwaggerBATByteServiceConfiguration(Configuration): def __init__( self, base_url=None, filepath=None): if not base_ur...
{ "content_hash": "9729ed212e384422e59bfc87fe56a8c3", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 92, "avg_line_length": 30.5625, "alnum_prop": 0.6738241308793456, "repo_name": "vulcansteel/autorest", "id": "4b4f5b9727cb332a70d92897c36c4ed944ff5d4a", "size": "1452", "...
from pprint import pformat import netifaces from miniworld.errors import NetworkBackendErrorReset from miniworld.model.singletons.Singletons import singletons from miniworld.model.network.backends import AbstractSwitch from miniworld.model.network.backends.bridged.iproute2 import IPRoute2Commands from miniworld.model...
{ "content_hash": "5064ba3eae39526d54ddab48697e0eb0", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 86, "avg_line_length": 25.59259259259259, "alnum_prop": 0.566931982633864, "repo_name": "miniworld-project/miniworld_core", "id": "a86407a97391fea8ec18b2b3c5c04a249fb39576",...
from collections import deque from datetime import datetime import errno from functools import partial import os import operator import socket import ssl import sys import time from .. import http from ..http import wsgi from .. import util from . import base from .. import six try: import concurrent.futures as ...
{ "content_hash": "fdc1d6d0a814199d2492ff38d310f312", "timestamp": "", "source": "github", "line_count": 333, "max_line_length": 77, "avg_line_length": 31.075075075075077, "alnum_prop": 0.5373018940858136, "repo_name": "wong2/gunicorn", "id": "122d923e4df632ea4ba07abb5c52ef592ffdd13b", "size": "1077...
import os import sys from unittest import TestCase sys.modules.pop('twiggy', None) os.environ.pop('TWIGGY_UNDER_TEST', None) # we need globals!! from twiggy import logging_compat, add_emitters, log from twiggy.outputs import ListOutput from twiggy.logging_compat import (hijack, restore, basicConfig, ...
{ "content_hash": "5d8b379e60861c59e943cad59d9d60ec", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 83, "avg_line_length": 32.40677966101695, "alnum_prop": 0.6111401673640168, "repo_name": "alessandrod/twiggy", "id": "2bd0b95bec9bb7d3039d980016d8476dbfd6ef7e", "size": "3...
from setuptools import setup VERSION = '0.0.1' setup( name='pymarketo', version=VERSION, packages=['pymarketo'], install_requires=['requests>=2.8.1'], description='Python interface to the Marketo REST API', author='Jeremy Swinarton', author_email='[email protected]', license='MIT',...
{ "content_hash": "7c8ed2dd21e86adbee2c76462abf5846", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 59, "avg_line_length": 21.533333333333335, "alnum_prop": 0.6656346749226006, "repo_name": "jswinarton/pymarketo", "id": "6702142eed3efd1b07159cd8e7a70110602a6e8d", "size": ...
import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import ConvModule from mmcv.runner import BaseModule from ..builder import NECKS class Transition(BaseModule): """Base class for transition. Args: in_channels (int): Number of input channels. out_channels (int): Number of ou...
{ "content_hash": "24ef3b56b83a0e4bf9454f0a905a5e85", "timestamp": "", "source": "github", "line_count": 405, "max_line_length": 79, "avg_line_length": 40.34320987654321, "alnum_prop": 0.5288573352102331, "repo_name": "open-mmlab/mmdetection", "id": "a6a2a12ed415bbb517b056d01172a83f6e30833d", "size"...
from django.db import models from server.models import * # Create your models here. class Catalog(models.Model): machine_group = models.ForeignKey(MachineGroup) content = models.TextField() name = models.CharField(max_length=253) sha256hash = models.CharField(max_length=64) class Meta: orde...
{ "content_hash": "90ce5d8edc278dc55a2233e278d1dcce", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 51, "avg_line_length": 32.09090909090909, "alnum_prop": 0.7110481586402266, "repo_name": "erikng/sal", "id": "8558c737776ffc27b948a7551823ea7386474378", "size": "353", "b...
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2012-2014 Alex Forencich 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...
{ "content_hash": "9f28162442652a810b173a40b2ad63e2", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 86, "avg_line_length": 38.5, "alnum_prop": 0.7367178276269185, "repo_name": "getzze/python-ivi", "id": "8666bcdcdf64d097850854000fafc35af180dc64", "size": "1694", "binary...
from __future__ import unicode_literals import django.contrib.postgres.fields.jsonb from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0026_order_reimbursements_by_year_and_issue_date'), ] operations = [ migrations.AlterModelOption...
{ "content_hash": "dd9cbfa2e763c8c097d18b36ee8a0e86", "timestamp": "", "source": "github", "line_count": 392, "max_line_length": 140, "avg_line_length": 44.566326530612244, "alnum_prop": 0.6045792787635947, "repo_name": "datasciencebr/serenata-de-amor", "id": "74c8790f187db5467145776d77dca27e0cb5147b"...
"""HTML sanitizing service.""" import logging import urlparse import bleach from core.domain import rte_component_registry def filter_a(name, value): """Returns whether the described attribute of an anchor ('a') tag should be whitelisted. Args: name: str. The name of the attribute. val...
{ "content_hash": "4cdbf3d6646b8a87c996f976c0e5da5c", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 79, "avg_line_length": 23.591397849462364, "alnum_prop": 0.5870556061987238, "repo_name": "amgowano/oppia", "id": "42f8275d2db3fc5cb9abb32852172e8653f64348", "size": "2817"...
import os import argparse import django from datetime import datetime import arrow from django.contrib.auth import get_user_model from django.db.models import Count from django.utils import timezone def get_number_of_deliveries(from_datetime, to_datetime): """ Get the number of deliveries made. Simply c...
{ "content_hash": "95e7ba043e3506b95f42f39c8721fc7d", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 109, "avg_line_length": 37.339622641509436, "alnum_prop": 0.67988883274381, "repo_name": "devilry/devilry-django", "id": "bfc9ef3f91dcbef3f2127aea4d7573925368cb8c", "size"...
hiddenimports = ['k_exceptions', 'services', 'typeconv_naked', 'typeconv_backcompat', 'typeconv_23plus', 'typeconv_datetime_stdlib', 'typeconv_datetime_mx', 'typeconv_datetime_naked', 'typeconv_fixed_fixedpoint', 'typeconv_fixed_stdlib', 'typeconv_tex...
{ "content_hash": "7a3cd9edce37f4c371c300a00206254e", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 75, "avg_line_length": 68, "alnum_prop": 0.5931372549019608, "repo_name": "deandunbar/bitwave", "id": "bad5e65b3cf4297144b3a6fed7cbf7d4219ce76c", "size": "827", "binary": ...
"""Script that initializes the database.""" import datetime import os import sys import transaction from pyramid.paster import ( get_appsettings, setup_logging, ) from pyramid.scripts.common import parse_vars from ..models import ( get_engine, get_session_factory, get_tm_session, BlogPost ) fr...
{ "content_hash": "2870f50e8271eba9346edb7a2bc2256e", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 75, "avg_line_length": 24.78181818181818, "alnum_prop": 0.632428466617755, "repo_name": "amosboldor/Portfolio-Site", "id": "d79bb1fdf52c4903e05dd9f70ca9afbe18f0107b", "size...
from django.contrib import admin from .models import ThreadedComments @admin.register(ThreadedComments) class ThreadedCommentsAdmin(admin.ModelAdmin): pass # def save_model(self, request, obj, form, change): # super().save_model(request, obj, form, change)
{ "content_hash": "23eb148574ef716c2d9030a8a66ef8bf", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 59, "avg_line_length": 27.9, "alnum_prop": 0.7311827956989247, "repo_name": "hakancelik96/coogger", "id": "1dae2977c34e3f5121ede42164e43bc73b32095a", "size": "279", "bina...
#!/usr/bin/python # -*- coding: utf-8 -*- # # pip install CppHeaderParser ply # # # how to use api_reference.py # # 1. run `./tools/api_reference.py` # # 2. check documents # - documentation/PluginXX/api-reference-cpp.md # - documentation/PluginXX/api-reference-lua.md # - documentation/PluginXX/api-referen...
{ "content_hash": "4c31f2da6a6aad4ed378a6ebfc4b0aa6", "timestamp": "", "source": "github", "line_count": 328, "max_line_length": 166, "avg_line_length": 33.67987804878049, "alnum_prop": 0.512537340454422, "repo_name": "yinjimmy/en", "id": "3a14596aea39a4c5c9be87e599ea0f36b315a5d6", "size": "11047", ...
"""Functions that prepare GAE user code for running in a GCE VM.""" import functools import json import logging import math import os import re import typing import wsgiref.util from google.appengine.runtime import thread_hooks import six def GetTraceAndSpanId(): """Gets the Trace and Span ID for the given requ...
{ "content_hash": "ab288ec6b3a208e65930760be6ccaf04", "timestamp": "", "source": "github", "line_count": 167, "max_line_length": 80, "avg_line_length": 27.84431137724551, "alnum_prop": 0.6412903225806451, "repo_name": "GoogleCloudPlatform/appengine-python-standard", "id": "2306d2e82554286c50c61e0f3d8e...
import synapse.exc as s_exc import synapse.lib.stormlib.json as s_json import synapse.tests.utils as s_test class JsonTest(s_test.SynTest): async def test_stormlib_json(self): async with self.getTestCore() as core: self.eq(((1, 2, 3)), await core.callStorm('return($lib.json.load("[1, 2, 3]...
{ "content_hash": "07a35a1ee10102544e75fc283b79c9fc", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 111, "avg_line_length": 40.507246376811594, "alnum_prop": 0.5413237924865831, "repo_name": "vertexproject/synapse", "id": "78a48afbf2160151b332084a44215f993fb195a0", "size"...
import unittest import numpy as np from numpy.testing import assert_array_equal from graphs.base.pairs import EdgePairGraph, SymmEdgePairGraph PAIRS = np.array([[0,1],[0,2],[1,1],[2,1],[3,3]]) ADJ = [[0,1,1,0], [0,1,0,0], [0,1,0,0], [0,0,0,1]] class TestEdgePairGraph(unittest.TestCase): def s...
{ "content_hash": "a9e34b1e6f17165ad79db7797b91c4c5", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 71, "avg_line_length": 29.89189189189189, "alnum_prop": 0.6360759493670886, "repo_name": "all-umass/graphs", "id": "7a3348f76508425a2513d2f63adfb0dc813e8c90", "size": "2212...
""" Contains the protobufs for RTS communication. """
{ "content_hash": "a404b8e53a438a7b682e26dbc482d96a", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 45, "avg_line_length": 18, "alnum_prop": 0.7222222222222222, "repo_name": "SCAII/SCAII", "id": "7de4b66ca72a5228dbeb7e06053e09376b1f3a93", "size": "54", "binary": false, ...
from __future__ import print_function, division import numpy as np from ciabatta.meta import make_repr_str from ahoy import measurers from ahoy.dc_dx_measurers import TemporalDcDxMeasurer, dc_dx_factory class NoiseMeasurer(measurers.Measurer): def __init__(self, noise_0, *args, **kwargs): self.noise_0 = ...
{ "content_hash": "4ac6e55622c5b96a0fcd7ed7b4929fec", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 77, "avg_line_length": 32.54929577464789, "alnum_prop": 0.5612289052358287, "repo_name": "eddiejessup/ahoy", "id": "2c0a107e6a712ce8248332b15cbf81061a382a6a", "size": "2311...
import forwarding_buffer from units import node class ForwardingProtocol(object): def __init__(self): self.scheduling_policy = None self.test = None self.network = None def set_scheduling_policy(self, p): self.scheduling_policy = p def init(self, test): self.test =...
{ "content_hash": "fc6f04ce001d991ad76a78ee839e68b1", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 46, "avg_line_length": 21.82758620689655, "alnum_prop": 0.6287519747235387, "repo_name": "efectivo/network_sim", "id": "e0ba53d1009e4d2395680d7e6212f3ca6d035e42", "size": "...
class Grammar: def __init__(self, ast): ast = rewrite_sequences_with_labels(ast) self.ast = simplify(ast) self.rules = self.ast[1] self.rule_names = set(r[1] for r in self.rules) self.starting_rule = self.rules[0][1] def check_for_left_recursion(ast): """Returns a list ...
{ "content_hash": "f933f849a1fe5aa7219b4bfeaed3dbf2", "timestamp": "", "source": "github", "line_count": 311, "max_line_length": 80, "avg_line_length": 34.138263665594856, "alnum_prop": 0.5143637562399924, "repo_name": "dpranke/glop", "id": "1c599fd27b4862d21156feae2028a2f48bc278b4", "size": "11215"...
import pyowm import time import random import datetime import telepot import wikipedia import json import os from pyshorteners import Shortener import subprocess import bs4 import requests import youtube_dl import validators api = '' # API Key for OpenWaetherMap api_key = '' #API key for Google(Url shortening) owm ...
{ "content_hash": "f868143124ea03c4aca897a359f355b8", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 368, "avg_line_length": 43.65533980582524, "alnum_prop": 0.6218169687534749, "repo_name": "nsniteshsahni/telepy", "id": "d2d5ef50928fa525540bbd2788a82757c35b7266", "size":...
from api.src.base import Base from collections import defaultdict class Mapper(Base): #Global accumulator output = defaultdict(int) def handler(self, contents): ''' Perform mapping operation over one file with contents WRITE HERE YOUR OWN LOGIC :param contents: unparsed ...
{ "content_hash": "79775f3c447398c20dacf0b7156ba8b8", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 61, "avg_line_length": 23.434782608695652, "alnum_prop": 0.5677179962894249, "repo_name": "iwitaly/big-lambda-serverless", "id": "6daacda2ff39688da7113ae13638fbec48d628d9", ...
from django.conf.urls import patterns, url from robot_control import views urlpatterns = patterns('', url(r'^$', views.index, name='index'), url(r'^tutorial/$', views.tutorial, name='tutorial'), url(r'^blockly/$', views.blockly, name='blockly'), url(r'^quiz/$', views.quiz, name='quiz'), url(r'^joystick-stat...
{ "content_hash": "653c72a598d8c1d73038c84864aaf6d2", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 81, "avg_line_length": 44.88235294117647, "alnum_prop": 0.6815203145478375, "repo_name": "gmartinvela/RoMIE", "id": "566e72d8dc6dc7130cd69dea9d26052a259fd4a8", "size": "763...
def command(): return "edit-farm" def init_argument(parser): parser.add_argument("--farm-no", required=True) parser.add_argument("--comment", required=False) def execute(requester, args): farm_no = args.farm_no comment = args.comment parameters = {} parameters["FarmNo"] = farm_no if ...
{ "content_hash": "864cfe69850c0fab9a77780473407ca4", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 53, "avg_line_length": 24.11111111111111, "alnum_prop": 0.652073732718894, "repo_name": "primecloud-controller-org/pcc-cli", "id": "c60558c48de526aaf07f7af0d6dc76fa00b32623",...
from django.db import models from django.core.validators import RegexValidator from django.contrib.auth.models import ( BaseUserManager, AbstractUser ) from django.utils import timezone class UserManager(BaseUserManager): def _create_user(self, username, email, avatar, is_staff, is_superu...
{ "content_hash": "d11ecf26b806be7836e831722f524d91", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 77, "avg_line_length": 33.490566037735846, "alnum_prop": 0.5915492957746479, "repo_name": "ideal/bublfish", "id": "564ffca9a34f107567b709bd29696e655eacba62", "size": "1839"...
''' cocos.director.director is the singleton that creates and handles the main ``Window`` and manages the logic behind the ``Scenes``. Initializing ------------ The first thing to do, is to initialize the ``director``:: from cocos.director import director director.init( parameters ) This will in...
{ "content_hash": "e12fcbe1b998c860cd14a14678f24d1b", "timestamp": "", "source": "github", "line_count": 662, "max_line_length": 115, "avg_line_length": 37.240181268882175, "alnum_prop": 0.5946132316553766, "repo_name": "shadowmint/nwidget", "id": "f842e6eeadfadd4832c8e763c5d336765699381f", "size": ...
import argparse import logging import pathlib import sys from builder import Builder def main(): logging.basicConfig(format="%(levelname)s - %(message)s", level=logging.INFO) parser = argparse.ArgumentParser(description="Build HTML pages from RST sources") parser.add_argument( "--build-dir", ...
{ "content_hash": "3e37505143577b85e3c311ed452c8315", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 98, "avg_line_length": 27.24137931034483, "alnum_prop": 0.6569620253164556, "repo_name": "napnac/napnac.fr", "id": "3a723d344bba59e4997c82bcaef577df2a79fef9", "size": "814"...
from common.methods import set_progress from azure.common.credentials import ServicePrincipalCredentials from resourcehandlers.azure_arm.models import AzureARMHandler from azure.mgmt.sql import SqlManagementClient from msrestazure.azure_exceptions import CloudError import azure.mgmt.resource.resources as resources RE...
{ "content_hash": "c9ae4fb199c7efd9dd0993aa8c56f740", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 123, "avg_line_length": 37.84, "alnum_prop": 0.6178646934460887, "repo_name": "CloudBoltSoftware/cloudbolt-forge", "id": "7b4ede8ba4b615b3f49b57dc96816dcce4965c01", "size":...
''' It's a very simple example of a "text-based game", where you can go to one room or another. It uses classes, inheritance and composition. Of course, it can be improved or extended in the future. ''' class Game(object): def __init__(self): self.kitchen = Kitchen() self.living_room = LivingRoom() def st...
{ "content_hash": "9218f1c9432026de7b09e37f8a150fc2", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 56, "avg_line_length": 21.615384615384617, "alnum_prop": 0.6476868327402135, "repo_name": "pwittchen/learn-python-the-hard-way", "id": "1a276d0c4c81301f2dcbff6ddaeb7404767c75...
from tempest.api.identity import base from tempest.common.utils import data_utils from tempest.test import attr class PoliciesTestJSON(base.BaseIdentityAdminTest): _interface = 'json' def _delete_policy(self, policy_id): resp, _ = self.policy_client.delete_policy(policy_id) self.assertEqual(2...
{ "content_hash": "0df401955b038a9ae48090c089a4c281", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 74, "avg_line_length": 41.87692307692308, "alnum_prop": 0.6160911094783248, "repo_name": "eltonkevani/tempest_el_env", "id": "48f8fcd6af9730befcbf7e6dc1d6d5e9a117b2e6", "si...
""" ManagedInstanceGroup: describes a managed instance group """ from googleapiclient.http import HttpError from vm_network_migration.modules.instance_group_modules.instance_group import InstanceGroup class ManagedInstanceGroup(InstanceGroup): def __init__(self, compute, project, instance_group_name, network_nam...
{ "content_hash": "d2ffb50aaf580a99b3e6a5a570784184", "timestamp": "", "source": "github", "line_count": 322, "max_line_length": 93, "avg_line_length": 34.97826086956522, "alnum_prop": 0.5816389949391814, "repo_name": "googleinterns/vm-network-migration", "id": "c6f092427a9f447936d71e90201aaae11a45317...
import sys import os from django.conf import settings from s3upload import __version__ on_rtd = os.environ.get('READTHEDOCS', None) == 'True' settings.configure() # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative t...
{ "content_hash": "a0df0fc2d587045db97a4354ba2b6567", "timestamp": "", "source": "github", "line_count": 257, "max_line_length": 86, "avg_line_length": 31.51750972762646, "alnum_prop": 0.7075308641975309, "repo_name": "mattaustin/django-storages-s3upload", "id": "d1ddf85b075f1e0ffc3083ee590c8f9f64a1c9...
import requests from urllib.parse import urljoin from .base import BaseBankIdClient class OschadBankId(BaseBankIdClient): """ Oschadbank-specific BankID client. """ default_authorization_base_url = 'https://id.bank.gov.ua/v1/bank/oauth2/authorize' default_api_base_url = 'https://id.bank.gov.ua/...
{ "content_hash": "960c4212f05b42fa7daf608d9128a919", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 86, "avg_line_length": 31.535714285714285, "alnum_prop": 0.6013590033975085, "repo_name": "badparking/badparking.in.ua", "id": "646df2fd193de58f1ec6ebfb0f72ee240b814728", "...
import numpy as np def permutate(data,labels): # permutate the data indices = np.random.permutation(data.index) data = data.reindex(indices) labels = labels.reindex(indices) return (data,labels) def split_test_train(data,labels,percent_train): splitpoint = int(data.index.size * percent_train) ...
{ "content_hash": "3384199dc3f1edde18c838756792ee2c", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 78, "avg_line_length": 36.26923076923077, "alnum_prop": 0.6712619300106044, "repo_name": "joergsimon/gesture-analysis", "id": "75b7d151c574e7a79ae6abd066f9fe8a89f286f1", "s...
from flavorsync.openstack.openstack_manager import OpenStackManager from flavorsync.database_manager import DatabaseManager from flavorsync.model import FlavorCollection, Flavor, InfrastructureCollection from flavorsync.exceptions import FlavorNotFoundExceptionError,\ PromotedNotPublicFlavorBadRequestError, Unpubli...
{ "content_hash": "2259cda8e68a807f78b45ffcd5435b64", "timestamp": "", "source": "github", "line_count": 266, "max_line_length": 131, "avg_line_length": 39.86466165413534, "alnum_prop": 0.6675782723500566, "repo_name": "Atos-FiwareOps/flavor-sync", "id": "2711e43be235295e13039ed97bf958e72774cc1b", "...
import os import subprocess import tempfile import zipfile # Locate this script in the file system. startDir = os.path.dirname(os.path.abspath(__file__)) fileNum = 1 # Prepare two scratch zip files, one for the input data as-is and another with 256-byte padding. with tempfile.NamedTemporaryFile(suffix='primary.zip', ...
{ "content_hash": "703ffdbddc90d1500308e6e70f54ef22", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 96, "avg_line_length": 47.333333333333336, "alnum_prop": 0.5735035211267606, "repo_name": "aosp-mirror/platform_external_skia", "id": "5b641468b9cb92249cd7f042a110329fe1ec29a...
from __future__ import print_function import json import logging log = logging.getLogger() log.setLevel(logging.DEBUG) def handler(event, context): log.debug("Received event {}".format(json.dumps(event))) return { "hello" : event['name'] }
{ "content_hash": "ff8ccb115793d76d584ec7eb5af4acad", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 60, "avg_line_length": 22.818181818181817, "alnum_prop": 0.7051792828685259, "repo_name": "moee/lambda-hands-on", "id": "7ff6abd01d0ef73584c8dbea30a24a9b8c3aa00b", "size": ...
import unittest import twitter from twitter.twitter_utils import ( calc_expected_status_length, parse_media_file ) class ApiTest(unittest.TestCase): def setUp(self): self.api = twitter.Api( consumer_key='test', consumer_secret='test', access_token_key='test',...
{ "content_hash": "8ea58fe27c5681096ff9cd04bb3d7746", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 94, "avg_line_length": 36.986486486486484, "alnum_prop": 0.6160029229082937, "repo_name": "sinharrajesh/dbtools", "id": "b021e3476ede5b9209ca8560c8af06c118b55d99", "size": ...
from swgpy.object import * def create(kernel): result = Ship() result.template = "object/ship/shared_droid_fighter_tier2.iff" result.attribute_template_id = -1 result.stfName("","") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "e5180bc97d6e97d3a30ee16bc184e3d9", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 63, "avg_line_length": 20.846153846153847, "alnum_prop": 0.6678966789667896, "repo_name": "obi-two/Rebelion", "id": "0c086730bada8750cf7390ba00fbbc700c0dc055", "size": "416...
import unittest2 class Test__new_value_pb(unittest2.TestCase): def _callFUT(self, entity_pb, name): from gcloud.datastore.helpers import _new_value_pb return _new_value_pb(entity_pb, name) def test_it(self): from gcloud.datastore._generated import entity_pb2 entity_pb = enti...
{ "content_hash": "00edeceb1ef5f60ef3f5a3e14d774109", "timestamp": "", "source": "github", "line_count": 912, "max_line_length": 78, "avg_line_length": 33.7828947368421, "alnum_prop": 0.6095423563777994, "repo_name": "waprin/google-cloud-python", "id": "3cc7e6c6a26c0d1a6f08d39d5cd0ccd01c3498c9", "si...
""" vSphere Python SDK program for updating ESXi Advanced Settings Usage: python update_esxi_advanced_settings.py -s 192.168.1.200 \ -u '[email protected]' \ -p VMware1! -c VSAN-Cluster -k VSAN.ClomRepairDelay -v 120 """ from pyVmomi import vim, vmodl from tools import cli, service_instance, pch...
{ "content_hash": "2346266e4b3dec4210743efbcfb1b397", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 92, "avg_line_length": 32.07142857142857, "alnum_prop": 0.6085746102449888, "repo_name": "vmware/pyvmomi-community-samples", "id": "3720b61b60aae733dbe73846e1f7754a8770b443",...
""" This tool is Modis' embed API. It allows Modis modules to easily create fancy looking GUIs in the Discord client. """ import logging import discord from modis import main logger = logging.getLogger(__name__) URL = "https://musicbyango.com/modis/" ICON = "http://musicbyango.com/modis/dp/modis64t.png" # TODO Upd...
{ "content_hash": "658a6ff21cfc441e301dffa862107af0", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 106, "avg_line_length": 28.78102189781022, "alnum_prop": 0.5835658128328683, "repo_name": "Infraxion/modis", "id": "8f3e4a0ef172a38ccae54bed37a38a55c2511d18", "size": "394...
from setuptools import setup, find_packages SRC_DIR = 'src' def get_version(): import sys sys.path[:0] = [SRC_DIR] return __import__('easy_alert').__version__ setup( name='easy-alert', version=get_version(), description='Super Simple Process Monitoring Tool', author='mogproject', a...
{ "content_hash": "85475447fcd29809f50e022ee9bbd6aa", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 55, "avg_line_length": 21.2, "alnum_prop": 0.6064690026954178, "repo_name": "mogproject/easy-alert", "id": "6c70f7ef781aaea6854a456df978ba29657e91c1", "size": "742", "bin...
''' This module provides utilities to get the absolute filenames so that we can be sure that: - The case of a file will match the actual file in the filesystem (otherwise breakpoints won't be hit). - Providing means for the user to make path conversions when doing a remote debugging session in ...
{ "content_hash": "1cd3aa5a2e9882aa43b9970b628a4759", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 167, "avg_line_length": 44.33624454148472, "alnum_prop": 0.6108539347975968, "repo_name": "hinesmr/mica", "id": "bee4c18b7b7f223cdd0124d4f7badfd10e688f02", "size": "10153"...
""" Defines actions for the Godot plug-in. """ #------------------------------------------------------------------------------ # Imports: #------------------------------------------------------------------------------ from os.path import exists, dirname, join from enthought.io.api import File from enthought.pyface....
{ "content_hash": "85811120a86641ebfb8b16e69f3b58cd", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 79, "avg_line_length": 37.44318181818182, "alnum_prop": 0.43034901365705613, "repo_name": "rwl/godot", "id": "9595968d081cbdc25caa5ee7d2be36340b40fef3", "size": "4151", "...
import os.path as op import warnings import numpy as np from numpy.testing import assert_raises, assert_equal from nose.tools import assert_true from mne import read_events, Epochs, pick_types, read_cov from mne.channels import read_layout from mne.io import read_raw_fif from mne.utils import slow_test, run_tests_if_...
{ "content_hash": "15213db0616930ce5db20c6d9fa84683", "timestamp": "", "source": "github", "line_count": 177, "max_line_length": 79, "avg_line_length": 41.52542372881356, "alnum_prop": 0.5982312925170068, "repo_name": "jaeilepp/mne-python", "id": "d5a77076cb4f42cbdd5ab983e1291f6f53798543", "size": "...
import sys from datetime import datetime as dt try: import pymongo as M except ImportError: print >> sys.stderr, "This backend requires pymongo to be installed" from .storage_backend import StorageBackend class MongoBackend(StorageBackend): DEFAULT_HOST = 'localhost' DEFAULT_PORT = 27017 DEFAUL...
{ "content_hash": "95f9fa7650b023934c356fae02b56894", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 72, "avg_line_length": 29.280701754385966, "alnum_prop": 0.5494307968843619, "repo_name": "9b/pastycake", "id": "7216c164a502a888b177cad8bf82d979a04a7e7a", "size": "1669", ...
from __future__ import absolute_import, print_function from .events import * try: from .pyuv import PyUVEventLoop except ImportError: pass try: from .pyside import PySideEventLoop except ImportError: pass
{ "content_hash": "17a03da42ac68a4565dd53535c7e94f8", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 54, "avg_line_length": 17.23076923076923, "alnum_prop": 0.7366071428571429, "repo_name": "geertj/looping", "id": "41184b3515db90716839eff21ad0832d4638a258", "size": "525", ...
from distutils.core import setup setup( name="KegPi", version="0.1", author="Bradley Brockman", author_email="[email protected]", url="https://github.com/bradbrok/KegPi", license="MIT_License.txt", description="Keg control system built on a Raspberry Pi.", install_requires=[ ...
{ "content_hash": "5c4cf1b2548aac5931d7084544e525ed", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 62, "avg_line_length": 19.88888888888889, "alnum_prop": 0.6229050279329609, "repo_name": "bradbrok/KegPi", "id": "cbfbf1820525545e9d03319976a869d2de585684", "size": "358", ...
"""General train/eval loop for a single agent on a single train/test split. The script: * Finds all knows agents - all subclasses for offline_agents.Agent in the included files. * Loads train/dev or train/test task split for the specified seed and tier. By default a dev split is used. Set --use-test-split=...
{ "content_hash": "1f8061857261ba3d1b287402c035cd2a", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 80, "avg_line_length": 36.55191256830601, "alnum_prop": 0.5843922858424279, "repo_name": "facebookresearch/phyre", "id": "a445ef4e1d7f52636e7825ef8b5a3c116fc4e262", "size"...
<<<<<<< HEAD <<<<<<< HEAD """Core implementation of import. This module is NOT meant to be directly imported! It has been designed such that it can be bootstrapped into Python as the implementation of import. As such it requires the injection of specific modules and attributes in order to work. One should use importli...
{ "content_hash": "91721326a6d9f4e80f7fc1874a4805a0", "timestamp": "", "source": "github", "line_count": 7389, "max_line_length": 105, "avg_line_length": 35.25768033563405, "alnum_prop": 0.5904943593365551, "repo_name": "ArcherSys/ArcherSys", "id": "76326a04e6e1140907d21bee32ea83d18f533cf9", "size":...
from django.conf.urls import patterns, url from .views import PostListView, PostDetailView urlpatterns = patterns('', url(r'(?P<pk>\d+)/$', PostDetailView.as_view(), name='detail'), url(r'$', PostListView.as_view(), name='list'), )
{ "content_hash": "9870ae756c278a22c1ed591df9ebee47", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 67, "avg_line_length": 30.25, "alnum_prop": 0.6735537190082644, "repo_name": "mpachas/django-embed-video", "id": "122e7934f3c9cd786142f23659aa8eb9a2ab2be9", "size": "242", ...
from google.cloud import securitycenter_v1beta1 def sample_group_findings(): # Create a client client = securitycenter_v1beta1.SecurityCenterClient() # Initialize request argument(s) request = securitycenter_v1beta1.GroupFindingsRequest( parent="parent_value", group_by="group_by_value...
{ "content_hash": "d5048c8b88dd51c8d857f1d9128517d8", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 74, "avg_line_length": 27.142857142857142, "alnum_prop": 0.7157894736842105, "repo_name": "googleapis/python-securitycenter", "id": "ed1728b456c9091fa4ddc77e954d7140813a3663"...
""" Descargar y recorrer http://www.teoruiz.com/lemario/lemario-20101017.txt.gz Comprobar si una palabra está o no en el diccionario. Dada una palabra devolver una lista con todos los anagramas de esa palabra que pertenezcan al castellano. """ from Ejercicios.PrimTrim.Ejercicio47 import lista_anagra...
{ "content_hash": "fcd36c3f18ff7dcbd6eecfcc42846785", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 113, "avg_line_length": 32.27777777777778, "alnum_prop": 0.653184165232358, "repo_name": "IhToN/DAW1-PRG", "id": "7c8609e19e01279382cc4e5745d7d1922e990a65", "size": "1165",...
from actstream.tests.test_gfk import GFKManagerTestCase from actstream.tests.test_zombies import ZombieTest from actstream.tests.test_activity import ActivityTestCase from actstream.tests.test_feeds import FeedsTestCase from actstream.tests.test_views import ViewsTest
{ "content_hash": "ed424f6bbbe2a55cbdcae2dd717baa0a", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 58, "avg_line_length": 53.8, "alnum_prop": 0.8698884758364313, "repo_name": "jrsupplee/django-activity-stream", "id": "52c0ac82b111332e6e1b591a6b3b62446df5a3a4", "size": "26...
from congestion_approx import CongestionApprox from graph_util import EDGE_CAPACITY_ATTR class TreeCongestionApprox(CongestionApprox): def __init__(s, tree, tree_root, alpha): # TODO: node to index s.tree = tree.copy() s.root = tree_root s.cached_dfs_edges = list(s.recursive_dfs_edges(s.root, set(), Fal...
{ "content_hash": "31e537f57e5009ad99bf5a2a180a4f9d", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 91, "avg_line_length": 30.27027027027027, "alnum_prop": 0.6348214285714285, "repo_name": "weinstein/FastMaxFlow", "id": "8f27db1bd711261515d9303e865fa7102f295776", "size": ...
"""Set of methods aimed to merge all features of each feature cluster into one: > process_features(): Combine the lower intensity features into the most intense feature (peak centre) within each feature clusters. Wide peaks and leading and trailing tails that are indicative of contam...
{ "content_hash": "d74f3b4891583b29937a57a2064c74c9", "timestamp": "", "source": "github", "line_count": 480, "max_line_length": 80, "avg_line_length": 49.93958333333333, "alnum_prop": 0.5474114555087397, "repo_name": "cjbrasher/LipidFinder", "id": "2d9426d52477d0d588187a42f96da0ac16b49192", "size":...
from typing import Callable from unittest.mock import DEFAULT, Mock, call, patch import pytest from azure.ai.ml import load_registry from azure.ai.ml._scope_dependent_operations import OperationScope from azure.ai.ml.entities._registry.registry import Registry from azure.ai.ml.operations import RegistryOperations from...
{ "content_hash": "96d53e4e797dfc3851813dc61aed5f31", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 107, "avg_line_length": 43.32857142857143, "alnum_prop": 0.7171117705242335, "repo_name": "Azure/azure-sdk-for-python", "id": "40dd561470a79625c4b19eb965e74398e9748896", "s...
from __future__ import unicode_literals import win32api import win32con import win32file import pywintypes from winsys import constants, core, exc, utils class x_handles(exc.x_winsys): pass WINERROR_MAP = { } wrapped = exc.wrapper(WINERROR_MAP, x_handles) class Handle(core._WinSysObject): def __init__(sel...
{ "content_hash": "9e07bb8b8e6451b2047e01c7b73488c4", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 78, "avg_line_length": 24.79032258064516, "alnum_prop": 0.5803513337670787, "repo_name": "operepo/ope", "id": "01d8e28b6299c9d398dfed91432e965efd08183e", "size": "1561", ...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('form_designer_form', '0001_initial'), ] operations = [ migrations.AlterField( model_name='cmsformdefini...
{ "content_hash": "01739ead8ff27756120b04fc88a54ae5", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 229, "avg_line_length": 32, "alnum_prop": 0.6792763157894737, "repo_name": "martijn-maklu/django-form-designer", "id": "bff46bb68923c770a5151e43f595e77d6e74acc9", "size": "...
import os import re import sys import pytumblr import json from datetime import datetime, timedelta from PIL import Image class Scraper: #Constructors def cleanupImageFolder(self): os.system('rm -r ./images') os.system('mkdir images') def __init__(self): __init__(self,searchTerms) def __init__(self,s...
{ "content_hash": "11c900c1544a05270ef0980dc4033b59", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 128, "avg_line_length": 35.08910891089109, "alnum_prop": 0.6853837471783296, "repo_name": "JunHuang01/GrammerArtist", "id": "bcad8e7d3af6de14946d53289a0ff9203357e8da", "si...
from django.conf.urls import url from django.contrib.auth.views import logout, logout_then_login from .views import LoginView, LogoutView, ProfileView urlpatterns = [ url(r'^login/$', LoginView.as_view(), name='login'), url(r'^logout/$', LogoutView.as_view(), name='logout'), url(r'^logout-then-login/$',...
{ "content_hash": "7e34738085646a5b5c9c5eb3634644c5", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 30.928571428571427, "alnum_prop": 0.6859122401847575, "repo_name": "nicorellius/pdxpixel", "id": "503713dc017c198998b90092354d9b47479bc222", "size": ...
from core.config_loader import cur_conf import mwapi import user_config session = mwapi.Session(cur_conf["core"]["site"], user_agent="StabiliserBot/1.0", api_path=cur_conf["core"]["api_path"]) def login(): session.login(user_config.username, user_config.password) return True
{ "content_hash": "7ae432d9ead1de0b43cd541228eac3f9", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 120, "avg_line_length": 28.7, "alnum_prop": 0.7282229965156795, "repo_name": "4shadoww/stabilizerbot", "id": "5953d0562760179501010738d0f820355d0b739f", "size": "287", "b...
import arrayfire import numpy from .multiarray import ndarray from . import random from .core import * from .lib import * from . import linalg from .linalg import vdot, dot import ctypes def arrayfire_version(numeric = False): major = ctypes.c_int(0) minor = ctypes.c_int(0) patch = ctypes.c_int(0) arra...
{ "content_hash": "e9286bfae32599dc11ca3ae3e6918cf1", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 112, "avg_line_length": 34.46341463414634, "alnum_prop": 0.5955414012738853, "repo_name": "daurer/afnumpy", "id": "7481e34bab2ed3ca4fc2be14a94e7b0ea1acd73f", "size": "2826"...
""" Useful functions. """ import cPickle as pickle import errno import os import signal import sys def println(line): sys.stdout.write(line) sys.stdout.flush() def print_settings(settings, indent=3, title="=> settings"): """ Pretty print. """ print(title) maxlen = max([len(s) for s in se...
{ "content_hash": "72b77b0305b021fd3c8a1598f2f76260", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 79, "avg_line_length": 20.9811320754717, "alnum_prop": 0.5989208633093526, "repo_name": "xjwanglab/pycog", "id": "3a965f57ff5b2eda5a3c7ac897ff8e6d371a770a", "size": "1112",...
from solve import *
{ "content_hash": "a7877bc5e89741c45fc55a415b4b3a62", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 19, "avg_line_length": 19, "alnum_prop": 0.7894736842105263, "repo_name": "wathen/PhD", "id": "bf313677c71b298edce8fcbd6eb2066c10a1b5da", "size": "19", "binary": false, ...
"""Script to sort downloaded data (html and tsv) into folder structure automatically based on file names(form titles).""" __authors__ = ["Ole Herman Schumacher Elgesem"] __copyright__ = "Ole Herman Schumacher Elgesem" __credits__ = ["Erik Vesteraas"] __license__ = "MIT" # This file is subject to the terms an...
{ "content_hash": "dc870f7af7df5d9be885ea63f886de04", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 98, "avg_line_length": 36.70652173913044, "alnum_prop": 0.5318329878590465, "repo_name": "fui/fui-kk", "id": "00d061b29213d64c15ba860d8d6e1d151aa1e0bf", "size": "3400", "...
"""Support for Modbus.""" import logging import threading from pymodbus.client.sync import ModbusSerialClient, ModbusTcpClient, ModbusUdpClient from pymodbus.transaction import ModbusRtuFramer from homeassistant.const import ( ATTR_STATE, CONF_COVERS, CONF_DELAY, CONF_HOST, CONF_METHOD, CONF_N...
{ "content_hash": "56100d9a9bfeec54a3abcf7eedede49e", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 85, "avg_line_length": 32.49781659388646, "alnum_prop": 0.5799516259070142, "repo_name": "partofthething/home-assistant", "id": "21c6caa6fcccd43f9c8d788ea7f9b22654c1a84a", ...
from tibanna.lambdas import ( check_task_awsem, run_task_awsem, update_cost_awsem )
{ "content_hash": "6e2b8fac4208416d22a682d8622fc426", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 29, "avg_line_length": 19.2, "alnum_prop": 0.6770833333333334, "repo_name": "4dn-dcic/tibanna", "id": "e2d74252a63a0a651d87bed14ffa81f5b5993c5a", "size": "111", "binary": ...
import os from scipy.interpolate import CubicSpline import matplotlib.pyplot as plt import numpy as np import gdal import seaborn from jdcal import gcal2jd, jd2gcal # ============= local library imports =========================== def calculate_julian_date(year, julian_doy): """""" first_of_the_year = int(s...
{ "content_hash": "60416fd99357ea6b14f5f20814a26922", "timestamp": "", "source": "github", "line_count": 324, "max_line_length": 203, "avg_line_length": 33.17283950617284, "alnum_prop": 0.6104391514700409, "repo_name": "NMTHydro/Recharge", "id": "3bf2666e6ac9cd8f80789ba24ec509c67c6c08f6", "size": "1...
import contextlib import unittest import sys class TestMROEntry(unittest.TestCase): def test_mro_entry_signature(self): tested = [] class B: ... class C: def __mro_entries__(self, *args, **kwargs): tested.extend([args, kwargs]) return (C,) ...
{ "content_hash": "48075f13466e90a027e1626f49d1212f", "timestamp": "", "source": "github", "line_count": 288, "max_line_length": 100, "avg_line_length": 33.77777777777778, "alnum_prop": 0.4968133223684211, "repo_name": "da-woods/cython", "id": "1afc9d4617c6879890cd9ba08db373e420f8548c", "size": "981...
from Kamaelia.Internet.TCPClient import TCPClient from Kamaelia.Chassis.Pipeline import Pipeline from Kamaelia.File.Writing import SimpleFileWriter outputfile = "/tmp/received.raw" clientServerTestPort=1500 Pipeline(TCPClient("127.0.0.1",clientServerTestPort), SimpleFileWriter(outputfile) ).run()
{ "content_hash": "b65fbdd6a97aa290b90b433e6f38397e", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 53, "avg_line_length": 28.90909090909091, "alnum_prop": 0.7861635220125787, "repo_name": "bbc/kamaelia", "id": "a664cde68ee5309b5ed64e351d80ebfaed8622ca", "size": "1487", ...
"""Create initial tables Revision ID: 21b664b587ce Revises: Create Date: 2016-04-13 11:14:23.063513 """ # revision identifiers, used by Alembic. revision = '21b664b587ce' down_revision = None branch_labels = None depends_on = None from alembic import op from sqlalchemy import Column, String, Integer, ForeignKey fr...
{ "content_hash": "256da5dbe4cd9fbf3e4989b97f1dce1a", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 76, "avg_line_length": 26.333333333333332, "alnum_prop": 0.6022866476112699, "repo_name": "CanopyTax/toggle-meister", "id": "07c6bc4b55f3c10177b6975f593540f6d2620892", "siz...
"""finalize_c2c_23_upgrade Revision ID: 1cb8168b89d8 Revises: 84b558deac2 Create Date: 2018-10-18 09:48:12.655466 """ from alembic import op # revision identifiers, used by Alembic. revision = '1cb8168b89d8' down_revision = '84b558deac2' branch_labels = None depends_on = None def upgrade(): op.execute(""" ...
{ "content_hash": "e69d135af9507b90e9dc8b74f4d8a3b1", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 97, "avg_line_length": 29.795454545454547, "alnum_prop": 0.6536994660564455, "repo_name": "Geoportail-Luxembourg/geoportailv3", "id": "e1cf826143eb077a445525706f23190d313a07b...
"""Test for certbot_apache._internal.configurator.""" import copy import shutil import socket import tempfile import unittest try: import mock except ImportError: # pragma: no cover from unittest import mock # type: ignore from acme import challenges from certbot import achallenges from certbot import crypto_...
{ "content_hash": "5e5a031e63d1e8d9471e40e393e48f52", "timestamp": "", "source": "github", "line_count": 1842, "max_line_length": 107, "avg_line_length": 44.414223669924, "alnum_prop": 0.6198188507657895, "repo_name": "stweil/letsencrypt", "id": "84f9e205369b729bb5d729ae78c8e4c29399c14f", "size": "8...
import six import unittest from airflow import configuration, models from airflow.utils import db from mock import patch, call from airflow.contrib.hooks.spark_submit_hook import SparkSubmitHook class TestSparkSubmitHook(unittest.TestCase): _spark_job_file = 'test_application.py' _config = { 'conf'...
{ "content_hash": "86063f4e55758d587d2831ab3a339b81", "timestamp": "", "source": "github", "line_count": 447, "max_line_length": 90, "avg_line_length": 41.62639821029083, "alnum_prop": 0.5543612618906864, "repo_name": "yati-sagade/incubator-airflow", "id": "6c55ce28e0cc90929aabad683d04a6d6c8689467", ...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tourism', '0003_auto_20190306_1417'), ] operations = [ migrations.AlterModelOptions( name='touristiccontenttype1', options={'verbose_name': 'Type1', 'verbose_name_pl...
{ "content_hash": "91823db2a1f8a6d75569b62ce2d0289d", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 180, "avg_line_length": 39, "alnum_prop": 0.6215738284703802, "repo_name": "GeotrekCE/Geotrek-admin", "id": "f03a350395c6ef760026fa83bddfb5dc1f73f878", "size": "1182", "b...
import sys import os import re # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('./../')) # --...
{ "content_hash": "d035820e32a07b1eaa143be494143f70", "timestamp": "", "source": "github", "line_count": 270, "max_line_length": 81, "avg_line_length": 31.925925925925927, "alnum_prop": 0.6975638051044084, "repo_name": "suhasgaddam/deck-of-cards-python", "id": "b5952cef66199a561206774e3e8d500272aaf057...
import uuid from lxml import etree import mock from neutronclient.common import exceptions as n_exc from neutronclient.neutron import v2_0 as neutronv20 from oslo.config import cfg from oslo.serialization import jsonutils import webob from nova.api.openstack.compute.contrib import security_groups from nova.api.openst...
{ "content_hash": "b6b46b1a81b3bea4bf3ea3fd2fe502dd", "timestamp": "", "source": "github", "line_count": 892, "max_line_length": 79, "avg_line_length": 42.80156950672646, "alnum_prop": 0.5940962309122816, "repo_name": "badock/nova", "id": "95968f13a27df5af82800308608d1b6c293abcf7", "size": "38805", ...
import sys import os import time path = os.getcwd() if path not in sys.path: sys.path.append(path) from package_tracking.component.package_tracking import PackageTrackingComponentImpl if __name__ == '__main__': while True: package_tracking_impl = PackageTrackingComponentImpl(create_table=True, mojoq...
{ "content_hash": "a3134e033287dbc3abf876cf228de785", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 104, "avg_line_length": 24.764705882352942, "alnum_prop": 0.7149643705463183, "repo_name": "lyrl/package_tracking", "id": "a31138c5343516ff2da37a59f79f837899e2fd47", "size"...
from bespin.collector import Collector from bespin import helpers as hp from docutils.statemachine import ViewList from sphinx.util.compat import Directive from textwrap import dedent from docutils import nodes class ShowTasksDirective(Directive): """Directive for outputting all the default bespin tasks""" ha...
{ "content_hash": "7132b8eeccb5bc31e74efcf955aa9ae3", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 112, "avg_line_length": 34.48888888888889, "alnum_prop": 0.601159793814433, "repo_name": "delfick/bespin", "id": "3fc219fc1b5dadd37ed1db90d8802f6630324943", "size": "1552",...
import inspect from .base import DebugPanel __all__ = ['RoutesDebugPanel'] class RoutesDebugPanel(DebugPanel): """ A panel to display the routes used by your aiohttp application. """ name = 'Routes' has_content = True template = 'routes.jinja2' title = 'Routes' nav_title = title ...
{ "content_hash": "23d15c24f5e4e4b953709472f61d8b2a", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 67, "avg_line_length": 24.13888888888889, "alnum_prop": 0.5454545454545454, "repo_name": "realer01/aiohttp-debugtoolbar", "id": "096a8105bd98cfd77a2980ff8c8fa8a28551d3cb", ...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('jobs', '0019_job_submitted_by'), ] operations = [ migrations.AlterField( model_name='job', name='url', field=models.URLField(null=True, verbose_name='URL...
{ "content_hash": "7c01673e577e4cbc65c852871a1907a1", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 65, "avg_line_length": 21.3125, "alnum_prop": 0.5601173020527859, "repo_name": "proevo/pythondotorg", "id": "d6c9c26e981ee84a1a5f2ef2e9a049a9ecdb6e7b", "size": "391", "bi...
from __future__ import division, unicode_literals """ This module implements classes to perform bond valence analyses. """ __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2012, The Materials Project" __version__ = "0.1" __maintainer__ = "Shyue Ping Ong" __email__ = "[email protected]" __date__ = "Oct 26, 201...
{ "content_hash": "6fc53cbcb91aedca8a94e835286cd84c", "timestamp": "", "source": "github", "line_count": 535, "max_line_length": 80, "avg_line_length": 40.3607476635514, "alnum_prop": 0.5256796183948502, "repo_name": "tallakahath/pymatgen", "id": "4cfa17a036e31719b7b2f5d5cedac8c48d218c4e", "size": "...
""" Flip API Flip # noqa: E501 The version of the OpenAPI document: 3.1 Contact: [email protected] Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import unittest import datetime import telestream_cloud_flip from telestream_cloud_flip.models.e...
{ "content_hash": "c8948d1a372e9ef35bd546da68cffdf3", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 83, "avg_line_length": 26, "alnum_prop": 0.5927197802197802, "repo_name": "Telestream/telestream-cloud-python-sdk", "id": "e3eff68ffd86ffcb5f3dd134c25c0bac82e7e00e", "size"...
import cahal_tests import unittest import string import types class TestsCAHALAudioFormatDescription( unittest.TestCase ): def test_convert_cahal_audio_format_id_to_cstring( self ): cahal_tests.cahal_convert_audio_format_id_to_cstring( 0 ) cahal_tests.cahal_convert_audio_format_id_to_cstring ( \ int(...
{ "content_hash": "8c6c8b3afc8feaa15ab77795a8a3de6c", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 88, "avg_line_length": 44.9375, "alnum_prop": 0.3875753361149745, "repo_name": "bcarr092/CAHAL", "id": "061c4f3d898749ed34ab313e95ae238061c90fc8", "size": "4314", "binary...
import os, sys from setuptools import setup, find_packages def read(*path): return open(os.path.join(os.path.abspath(os.path.dirname(__file__)), *path)).read() setup( name = 'asgard-utils', version = '0.1', url = 'http://asgardproject.org/utils/', author = 'Myles Braithwaite', author_email = 'me@mylesbraithw...
{ "content_hash": "4a1d3bc171a8d11022e791a25e88c7c4", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 84, "avg_line_length": 23.28205128205128, "alnum_prop": 0.6541850220264317, "repo_name": "asgardproject/asgard-utils", "id": "99abc29b0ae66694590df78987c03efe8111aa63", "si...
from iptest.assert_util import * skiptest("silverlight") import sys import nt # This module tests operations on the builtin file object. It is not yet complete, the tests cover read(), # read(size), readline() and write() for binary, text and universal newline modes. def test_sanity(): for i in range(5): #...
{ "content_hash": "534daa1a377039c3b66cfb507c3b629c", "timestamp": "", "source": "github", "line_count": 842, "max_line_length": 135, "avg_line_length": 33.53800475059382, "alnum_prop": 0.5219023336520415, "repo_name": "tempbottle/ironpython3", "id": "771d88f35f14d99407380624bb73bd31429de711", "size...
from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand, CommandError from django.core import serializers from django.db import router, DEFAULT_DB_ALIAS from django.utils.datastructures import SortedDict from optparse import make_option class Command(BaseCommand): ...
{ "content_hash": "e5adddd3a488e8ed1e36a16dfc708dd5", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 171, "avg_line_length": 46.13265306122449, "alnum_prop": 0.5667993806679938, "repo_name": "cobalys/django", "id": "9059625dec2ece045e075f9e53bd004d3687321b", "size": "9042...
import sys import traceback import time import copy import math from diamond_game import * from diamond_game.model.models import Board import random class AI(MVCObject): def __init__(self, ev_manager): MVCObject.__init__(self, ev_manager, '[ai]') self.id = Conf.AI self.board = Board() ...
{ "content_hash": "fda3ee68a00b22b4ffc0da49dee5884f", "timestamp": "", "source": "github", "line_count": 249, "max_line_length": 106, "avg_line_length": 38.48192771084337, "alnum_prop": 0.5087664370695053, "repo_name": "batousik/Python2-Diamond", "id": "199f63ea52c3cb6e16363fab815b5ef991a71624", "si...