text
stringlengths
4
1.02M
meta
dict
from setuptools import setup setup( name='smlib', version='0.1', description='Quick and easy to use library for sending emails', license='BSD', author='Grzegorz Blach', author_email='grzegorz@blach.pl', packages=['smlib'], test_suite='test.smlib_test', )
{ "content_hash": "f9d737e85ef6a6c811de90ee09407d76", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 67, "avg_line_length": 24, "alnum_prop": 0.65625, "repo_name": "MagikBSD/smlib", "id": "d81e18fe627307015b3592a0633ff2cd16f74e1a", "size": "311", "binary": false, "copi...
""" pybitcoin ~~~~~ :copyright: (c) 2014 by Halfmoon Labs :license: MIT, see LICENSE for more details. """ from .blockchain_client import BlockchainClient from blockcypher import BlockcypherClient from blockchain_info import BlockchainInfoClient from chain_com import ChainComClient from bitcoind impor...
{ "content_hash": "fb886f7745660e912e5f73f61740e7b3", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 66, "avg_line_length": 24.666666666666668, "alnum_prop": 0.7882882882882883, "repo_name": "blockstack/pybitcoin", "id": "c23214e3eaedff0c67743a68759c161eecd6d9c4", "size": ...
from typing import Text, List, Any, Tuple, Callable, Dict, Optional import dataclasses import numpy as np import pytest from rasa.engine.graph import ExecutionContext from rasa.engine.storage.resource import Resource from rasa.engine.storage.storage import ModelStorage from rasa.nlu.featurizers.sparse_featurizer.rege...
{ "content_hash": "01c7ec2c6aa5666a986ec53639b20aa4", "timestamp": "", "source": "github", "line_count": 615, "max_line_length": 88, "avg_line_length": 34.78048780487805, "alnum_prop": 0.5905563347358579, "repo_name": "RasaHQ/rasa_nlu", "id": "384de53a76d435823bbf51a4697cf7f745146462", "size": "2156...
from __future__ import absolute_import, print_function __all__ = ['DeletionTaskManager'] class DeletionTaskManager(object): def __init__(self, default_task=None): self.tasks = {} self.default_task = default_task def get(self, task=None, **kwargs): if task is None: model =...
{ "content_hash": "315ae79ab97608b9a27c7cb57291f516", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 54, "avg_line_length": 27.80952380952381, "alnum_prop": 0.571917808219178, "repo_name": "jean/sentry", "id": "e4a5073a732d266ce83df67958c25f832e5f376e", "size": "584", "b...
from django.conf.urls import patterns, url from django.views.generic import RedirectView from . import views def redirect_doc(uri): return RedirectView.as_view( url='https://developer.mozilla.org/docs%s' % uri) redirect_patterns = patterns('', url('^docs/firefox_os_guideline$', redirect_doc(...
{ "content_hash": "b3137eed695670433736a884f214c5c7", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 74, "avg_line_length": 42.294117647058826, "alnum_prop": 0.6418636995827538, "repo_name": "jinankjain/zamboni", "id": "b50bbbcf4ff7a7146c5189b665cb3bd0c736b2be", "size": "...
import os LOCAL = lambda x: os.path.join(os.path.sep.join( os.path.abspath( os.path.dirname(__file__)).split(os.path.sep)[:-1]), x)
{ "content_hash": "3a6ae6b475f644cb7d8d68c867e58655", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 75, "avg_line_length": 33.8, "alnum_prop": 0.5266272189349113, "repo_name": "arruda/riddles", "id": "9a0cfababc24f0f55daf0fe708e1ba767876a28c", "size": "170", "binary": fa...
from __future__ import unicode_literals import pytest @pytest.mark.parametrize('text,tokens', [ ('"deserve,"--and', ['"', "deserve", ',"--', "and"]), ("exception;--exclusive", ["exception", ";--", "exclusive"]), ("day.--Is", ["day", ".--", "Is"]), ("refinement:--just", ["refinement", ":--", "just"]),...
{ "content_hash": "175033e80ef2c3faa85ff295c34e05af", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 69, "avg_line_length": 39.888888888888886, "alnum_prop": 0.5431754874651811, "repo_name": "Gregory-Howard/spaCy", "id": "3d83e707b8b64280c850929983cf50fcded9ef9e", "size": ...
import os, tempfile from nose import SkipTest from nose.tools import assert_raises, assert_true, assert_false import networkx as nx from networkx.generators.classic import barbell_graph,cycle_graph,path_graph class TestConvertNumpy(object): @classmethod def setupClass(cls): global np, sp, sparse ...
{ "content_hash": "b60819bdc64ec60368e9f1c2e3667554", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 84, "avg_line_length": 33.293577981651374, "alnum_prop": 0.6059520529071369, "repo_name": "rainest/dance-partner-matching", "id": "6fe3274892152ced4e7843616a90b289c3898174",...
print("Hello Python World...\nI'm component C :-)")
{ "content_hash": "6fce32d0baa1c07f3603b6dbb93295f2", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 51, "avg_line_length": 52, "alnum_prop": 0.6538461538461539, "repo_name": "Azure/azure-sdk-for-python", "id": "6c45697c748ec097a1d7b1e3679789468514618f", "size": "52", "bi...
import os from pyvivado import builder, interface, signal, utils from rfgnocchi import config #minimum_2inputs_builder = builder.make_simple_builder( # filenames=[os.path.join(config.basedir, 'maths', 'minimum_2inputs.vhd')], #)({}) #minimum_stage_builder = builder.make_simple_builder( # filenames=[os.path.jo...
{ "content_hash": "3e08efb35636994e7fd91541293e3ce1", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 79, "avg_line_length": 31.38961038961039, "alnum_prop": 0.6218452627223832, "repo_name": "benreynwar/rfgnocchi", "id": "7b467071603ce2fe8ea5bb5c3a815b279a9d8b7b", "size": "...
"""Tests for liveness module.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.autograph.pyct import anno from tensorflow.python.autograph.pyct import cfg from tensorflow.python.autograph.pyct import naming from tensorflow.python.au...
{ "content_hash": "e30b93ae944de6979b3b5a1273e4026f", "timestamp": "", "source": "github", "line_count": 474, "max_line_length": 76, "avg_line_length": 23.689873417721518, "alnum_prop": 0.5793035889215424, "repo_name": "gunan/tensorflow", "id": "90bcc67301a1e8682237cd6db616c763b4abee1d", "size": "11...
try: import cPickle as pickle except ImportError: import pickle import gtk from twisted.words.im.gtkcommon import GLADE_FILE, SETTINGS_FILE, autoConnectMethods,\ openGlade from twisted.words.im import gtkchat ### This generic stuff uses the word "account" in a very different way -- chat ### accounts ar...
{ "content_hash": "aabaf5273f87265fdcec4f71cc5a9576", "timestamp": "", "source": "github", "line_count": 220, "max_line_length": 99, "avg_line_length": 35.268181818181816, "alnum_prop": 0.615414357520299, "repo_name": "hortonworks/hortonworks-sandbox", "id": "61b52d74dea8b377e53e7568b83b8b2da4354c8e",...
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'click2pass.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^admin/', include(admin.site.urls)), url(r'^service/$'...
{ "content_hash": "943f0455fe370ce3d52c1340006fe2f0", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 87, "avg_line_length": 36.9375, "alnum_prop": 0.6531302876480541, "repo_name": "iwagaki/click2pass", "id": "7ca3931b9650d9797c29a29015669eb0ad053a2d", "size": "591", "bin...
import json from flask import request from flask import render_template from flask import abort from flask import jsonify from flask import current_app from flask.views import MethodView from rados import Rados from rados import Error as RadosError from app.base import ApiResource class CephClusterProperties(dict)...
{ "content_hash": "d39d8162d3522784270f49b05d0ac8fc", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 99, "avg_line_length": 32.8978102189781, "alnum_prop": 0.557577102285334, "repo_name": "Crapworks/ceph-dash", "id": "4d9e8677de5b27547a0d622322de92fdbf05a26d", "size": "45...
import argparse import logging from dvc.command import completion from dvc.command.base import CmdBaseNoRepo, append_doc_link from dvc.command.ls.ls_colors import LsColors from dvc.exceptions import DvcException from dvc.ui import ui logger = logging.getLogger(__name__) def _prettify(entries, with_color=False): ...
{ "content_hash": "565d2c48e15e8d1a44ee70f6691166e9", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 78, "avg_line_length": 28.011363636363637, "alnum_prop": 0.5768762677484787, "repo_name": "dmpetrov/dataversioncontrol", "id": "d8bfe02413e2799dce5835cc9cbcdd7be09f4c32", "...
from setuptools import setup, find_packages setup( name='django-simple-captcha', version=__import__('captcha').get_version(), description='A very simple, yet powerful, Django captcha application', author='Marco Bonetti', author_email='mbonetti@gmail.com', url='http://code.google.com/p/django-sim...
{ "content_hash": "efec9509b41c7d7589ece0a4be280b0d", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 74, "avg_line_length": 34.57692307692308, "alnum_prop": 0.6151279199110122, "repo_name": "andela-bojengwa/django-simple-captcha", "id": "3d69000df4756572e1c09fd9c6f8c91027025...
from __future__ import (unicode_literals, division, absolute_import, print_function) import gc import sys from types import FrameType from itertools import chain # From http://code.activestate.com/recipes/523004-find-cyclical-references/ def print_cycles(objects, outstream=sys.stdout, show_progress=False): '''Find...
{ "content_hash": "74278077d6cd7651991fe5a2116f8067", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 106, "avg_line_length": 31.083333333333332, "alnum_prop": 0.6578418230563002, "repo_name": "magus424/powerline", "id": "478b9ed8e1e05734251d7f7a39d9d764102ee11f", "size": "...
"""HTML utilities suitable for global use.""" from __future__ import unicode_literals import re try: from urllib.parse import quote, urlsplit, urlunsplit except ImportError: # Python 2 from urllib import quote from urlparse import urlsplit, urlunsplit from django.utils.safestring import SafeData, mar...
{ "content_hash": "0952c6329dcbf233610a8be967b775e3", "timestamp": "", "source": "github", "line_count": 313, "max_line_length": 147, "avg_line_length": 39.236421725239616, "alnum_prop": 0.5897728198029476, "repo_name": "makinacorpus/django", "id": "4893b6b18a759c407317416716d15b2b8b499c7f", "size":...
import cassiopeia.type.dto.common import cassiopeia.type.core.common if cassiopeia.type.dto.common.sqlalchemy_imported: import sqlalchemy import sqlalchemy.orm @cassiopeia.type.core.common.inheritdocs class RunePages(cassiopeia.type.dto.common.CassiopeiaDto): """ pages list<RunePage> coll...
{ "content_hash": "865a6587d960d2220a0de83d5610f5b2", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 245, "avg_line_length": 39.1078431372549, "alnum_prop": 0.6504136375031336, "repo_name": "MakersF/cassiopeia", "id": "8103358f3648c4e348de91f154a424f105f314a5", "size": "7...
from oslo_log import log as logging from tempest import clients from tempest import config from tempest import test LOG = logging.getLogger(__name__) CONF = config.CONF CONF_FLAVORS = None CONF_IMAGES = None CONF_NETWORKS = [] CONF_PRIV_NETWORK_NAME = None CONF_PUB_NETWORK = None CONF_PUB_ROUTER = None CONF_TENANTS ...
{ "content_hash": "b907b4654316a1b1b3c7bab937eb32d9", "timestamp": "", "source": "github", "line_count": 1118, "max_line_length": 78, "avg_line_length": 30.292486583184257, "alnum_prop": 0.571411698703753, "repo_name": "eggmaster/tempest", "id": "eb6f1437ddcb392dfb15343971e86ad4512032b3", "size": "3...
import subprocess subprocess.call(['pwd'])
{ "content_hash": "f34007fbaf07948ad7374f20eb839667", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 24, "avg_line_length": 21.5, "alnum_prop": 0.7674418604651163, "repo_name": "Knln/COMP2041", "id": "ec34dca28d488c1da41a887c444834b6f4d9c580", "size": "67", "binary": fals...
from datapackage_pipelines.wrapper import process import datetime, logging kns_knessetdates = [] def process_row(row, row_index, spec, resource_index, parameters, stats): if spec['name'] == 'kns_knessetdates': kns_knessetdates.append((row['KnessetNum'], row['Assembly'], row['Plenum'], ...
{ "content_hash": "4694575fde0634a66ba41d5459e44467", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 109, "avg_line_length": 46.06, "alnum_prop": 0.531480677377334, "repo_name": "hasadna/knesset-data-pipelines", "id": "fbda6a4462eb04f2b62a3f68e2ed71cabbcb6167", "size": "4...
from ..registry_tools import iso_register from .core import UnitedStates @iso_register('US-NH') class NewHampshire(UnitedStates): """New Hampshire""" include_thanksgiving_friday = True martin_luther_king_label = "Martin Luther King, Jr. Civil Rights Day"
{ "content_hash": "d0453270732787ad4318faff8f01b974", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 73, "avg_line_length": 29.88888888888889, "alnum_prop": 0.7360594795539034, "repo_name": "novapost/workalendar", "id": "51739ad9daaae38ec70ec38ceb29935897d8019e", "size": "2...
from muntjac.api import \ (VerticalLayout, Form, HorizontalLayout, Button, Alignment, ComboBox, PasswordField) from muntjac.ui.themes import BaseTheme from muntjac.ui import button from muntjac.data.validator import IValidator, InvalidValueException from muntjac.demo.sampler.ExampleUtil import ExampleUtil fr...
{ "content_hash": "5564fa6b4026a76fcea49e3387f81638", "timestamp": "", "source": "github", "line_count": 246, "max_line_length": 80, "avg_line_length": 32.207317073170735, "alnum_prop": 0.6290546510160293, "repo_name": "rwl/muntjac", "id": "37749fb621015e9b6c9806b9870966fedd09574f", "size": "7924", ...
try: from tkinter import * except ImportError: from Tkinter import * from PIL import Image, ImageTk import sys # # an image viewer class UI(Frame): def __init__(self, master, im, value=128): Frame.__init__(self, master) self.image = im self.value = value self.canvas = C...
{ "content_hash": "45f4c5c76ed61b5dda357ed9ba5bc02b", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 74, "avg_line_length": 25.076923076923077, "alnum_prop": 0.5674846625766872, "repo_name": "neerajvashistha/pa-dude", "id": "adba3e9e9adf9430138ef3910a702d00a7f1375c", "size...
"""Tests for the toolchain sub-system""" import sys import os from string import printable from copy import deepcopy from mock import MagicMock, patch from hypothesis import given, settings from hypothesis.strategies import text, lists, fixed_dictionaries, booleans ROOT = os.path.abspath(os.path.join(os.path.dirname(_...
{ "content_hash": "9dd1da189ddd5bd5007aabe18abac9e7", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 79, "avg_line_length": 43.50344827586207, "alnum_prop": 0.5829105897273303, "repo_name": "fanghuaqi/mbed", "id": "01a684fae8aa883256c087c3ed0e278f440851ed", "size": "6308"...
''' Conversion of basis sets to deMon2K format ''' from .. import lut, manip, sort, misc, printing def write_demon2k(basis): '''Converts a basis set to deMon2K format ''' if 'gto_spherical' in basis['function_types']: s = '# This basis set uses spherical components\n\n' else: s = '# ...
{ "content_hash": "e536dced2ab34c90570b22ccd844900a", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 116, "avg_line_length": 36.854166666666664, "alnum_prop": 0.5398530243075184, "repo_name": "MOLSSI-BSE/basis_set_exchange", "id": "0d5e485bb9c75b9b0973f15e447f0e1a2428fbf4", ...
""" remove everthing top of the first msgid line (PIs destroyed by gettext), prepend some processing instructions to a .po file to be able to put it onto moinmaster wiki, letting it get processed by gettext parser """ master_url = "http://master19.moinmo.in/?action=xmlrpc2" user = "ThomasWaldmann" #...
{ "content_hash": "24c5c4e07d249429186463c028b139cf", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 76, "avg_line_length": 26.203125, "alnum_prop": 0.6249254621347644, "repo_name": "Glottotopia/aagd", "id": "fdf16d999707612ba13e4127bd0e2e7327a56a4a", "size": "1696", "bi...
''' @author: sheng @license: ''' import unittest from meridian.acupoints import zutonggu213 class TestZutonggu213Functions(unittest.TestCase): def setUp(self): pass def test_xxx(self): pass if __name__ == '__main__': unittest.main()
{ "content_hash": "493f938bd99b77a3dafcd58873a8ef86", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 50, "avg_line_length": 13.45, "alnum_prop": 0.6356877323420075, "repo_name": "sinotradition/meridian", "id": "8b1c4f8d326382c1facd32168e04084a95f25532", "size": "303", "b...
import datetime from unittest import mock from oslo_utils import timeutils from oslo_utils import uuidutils from magnum.api.controllers.v1 import nodegroup as api_nodegroup from magnum.conductor import api as rpcapi import magnum.conf from magnum import objects from magnum.tests import base from magnum.tests.unit.api...
{ "content_hash": "c08339b2bcea1dd94f1a696183ee5ae4", "timestamp": "", "source": "github", "line_count": 752, "max_line_length": 79, "avg_line_length": 47.3218085106383, "alnum_prop": 0.6204687236553701, "repo_name": "openstack/magnum", "id": "a6f73d54b2c9389cdb2c6d9a44dc5dd730f72427", "size": "3624...
import hashlib import binascii import random import time from Crypto.Cipher import AES from Crypto.Util import Counter rng = random.SystemRandom() def init_key_generation(keylengthbits): if keylengthbits < 8: keylengthbits = 8 elif keylengthbits % 8 != 0: keylengthbits += ( 8 - keylengt...
{ "content_hash": "444e62f5463b40ef7815b55d6e56bc62", "timestamp": "", "source": "github", "line_count": 480, "max_line_length": 155, "avg_line_length": 45.78958333333333, "alnum_prop": 0.6548978570453615, "repo_name": "fabrizziop/test-encryption", "id": "224aaedcd1d3a7be415e2a1ef786fbf1f8861ef6", "...
import argparse import unittest from gluon import current from gluon.storage import Storage current.data = Storage() # @ToDo: Load these only when running Selenium tests # (shouldn't be required for Smoke tests) # (means removing the *) from selenium import webdriver from tests.asset import * from tests.inv import *...
{ "content_hash": "7a3e5b67e1874f6a4a54e04f0bd7a98c", "timestamp": "", "source": "github", "line_count": 292, "max_line_length": 123, "avg_line_length": 36.9041095890411, "alnum_prop": 0.6055122494432071, "repo_name": "sahildua2305/eden", "id": "00219cfe12ab690e2e6d4a823e79677ddfda407e", "size": "11...
from __future__ import absolute_import from itertools import chain from six.moves import range, reduce import os import re import numpy as np import tensorflow as tf import codecs import sys from tqdm import tqdm import pickle import logging class Dataset(): def __init__(self, data='data/tasks_1-20_v1-2/en/',ts_num...
{ "content_hash": "0aa36501585ceadf501f7b736d0bd4e7", "timestamp": "", "source": "github", "line_count": 247, "max_line_length": 114, "avg_line_length": 37.31578947368421, "alnum_prop": 0.579364218292286, "repo_name": "andreamad8/QDREN", "id": "5db8cef90ee691c29fadcc67224bbad81b6fe03f", "size": "921...
from functools import update_wrapper from collections import Iterable __author__ = 'y.gavenchuk aka murminathor' __all__ = ['data_provider', ] def _get_data_source(data_set_source): if callable(data_set_source): data_source = data_set_source() elif isinstance(data_set_source, Iterable): data...
{ "content_hash": "66f5734d514f5c7a35496c2e6265bcd8", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 76, "avg_line_length": 31.475609756097562, "alnum_prop": 0.5393258426966292, "repo_name": "ygavenchuk/test-tools", "id": "fd298f9cd0393b8117ef7f720f70b26bc9efd897", "size":...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('payments', '0002_auto_20160718_2345'), ] operations = [ migrations.CreateModel( nam...
{ "content_hash": "525dde0f253272b38d3e6625eaef1232", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 194, "avg_line_length": 45.833333333333336, "alnum_prop": 0.5750649350649351, "repo_name": "onepercentclub/bluebottle", "id": "f709e9abdda917983a56be8d0236370b06343eef", "s...
from var_plots import plot_input plot_input()
{ "content_hash": "5efabdc020261e9c4a016b8baa8dcca6", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 32, "avg_line_length": 15.666666666666666, "alnum_prop": 0.7659574468085106, "repo_name": "josef-pkt/statsmodels", "id": "969f238eb309b780d9a944391f6f9230b5bf48db", "size": ...
"""Tests that show Distribute Coordinator works with Estimator.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import glob import json import os import sys import tempfile import threading from absl.testing import parameterized import numpy as np import...
{ "content_hash": "56d7fb4cf57b26e9f65bbc52e83ee721", "timestamp": "", "source": "github", "line_count": 645, "max_line_length": 80, "avg_line_length": 35.674418604651166, "alnum_prop": 0.6452846588439809, "repo_name": "AnishShah/tensorflow", "id": "5348512016efc504f92e5a956d627698b93b209a", "size":...
from django import forms import voxel_globe.meta.models as models class CreateSiteForm(forms.Form): name = forms.CharField(label="Site Name") south_d = forms.FloatField(label="South Latitude", help_text="degrees") west_d = forms.FloatField(label="West Longitude", help_text="degrees") bottom_d = forms.FloatFie...
{ "content_hash": "ecbe2f505cdbd3737d79e773f5f9411d", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 74, "avg_line_length": 45.73684210526316, "alnum_prop": 0.714614499424626, "repo_name": "VisionSystemsInc/voxel_globe", "id": "3a908809f8916bde1c83ae449b5bd96efa7e75fa", "s...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('admin_ddjj_app', '0024_auto_20150713_1554'), ] operations = [ migrations.AlterField( model_name='ddjj', name='obs', ...
{ "content_hash": "a83e82733314a2a124bc742b6fe7a340", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 89, "avg_line_length": 23.894736842105264, "alnum_prop": 0.6035242290748899, "repo_name": "lanacioncom/ddjj_admin_lanacion", "id": "a976274464b464a155141055cd58bc145cbef531",...
from tempest.api.compute import base class BaseSecurityGroupsTest(base.BaseV2ComputeTest): @classmethod def setUpClass(cls): # A network and a subnet will be created for these tests cls.set_network_resources(network=True, subnet=True) super(BaseSecurityGroupsTest, cls).setUpClass()
{ "content_hash": "7a7a58f4cbd1c1bc0f4964b346b7b7df", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 64, "avg_line_length": 31.8, "alnum_prop": 0.7327044025157232, "repo_name": "ntymtsiv/tempest", "id": "6838ce1e324aaff1fd37dc0a3142f1e874207623", "size": "954", "binary":...
import json import webob from lxml import etree from nova.api.openstack import wsgi from nova.api.openstack.compute.contrib import keypairs from nova import db from nova import exception from nova import test from nova.tests.api.openstack import fakes def fake_keypair(name): return {'public_key': 'FAKE_KEY', ...
{ "content_hash": "ac0bae404c5424ac323817ee41c3742a", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 77, "avg_line_length": 36.47659574468085, "alnum_prop": 0.5748950069995333, "repo_name": "gyang/nova", "id": "fa962dd15eb66a38ce1080ad05a0781b6bea01a6", "size": "9200", ...
"""Tests for the compute pollsters. """ import mock import time from ceilometer.compute import pollsters from ceilometer.compute import manager from ceilometer.compute.virt import inspector as virt_inspector from ceilometer.tests import base as test_base class TestPollsterBase(test_base.TestCase): def setUp(se...
{ "content_hash": "709508d914694077ee080bed54eca84e", "timestamp": "", "source": "github", "line_count": 171, "max_line_length": 76, "avg_line_length": 41.36257309941521, "alnum_prop": 0.6000282765446062, "repo_name": "dreamhost/ceilometer", "id": "34518546d1d77fb20975f4107ab3b40b44cdf006", "size": ...
import sys import six AUTH_TOKEN = "foobar" AUTH_URL = "http://0.0.0.0" class FakeStdout(object): def __init__(self): self.content = [] def write(self, text): self.content.append(text) def make_string(self): result = '' for line in self.content: result = re...
{ "content_hash": "b58b7c22a355ed0adec92aaf4c69229f", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 76, "avg_line_length": 24, "alnum_prop": 0.5435606060606061, "repo_name": "openstack/python-congressclient", "id": "94184276c65a68ca871bdb93c3e1cf3df2684e34", "size": "2183...
import requests import discord def getSupportedCurrencies(): return {"AED": "United Arab Emirates Dirham", "AFN": "Afghan Afghani", "ALL": "Albanian Lek", "AMD": "Armenian Dram", "ANG": "Netherlands Antillean Guilder", "AOA": "Angolan Kwanza", "ARS": "Argentine Peso", "AUD": "Australian Dollar", "AWG": "...
{ "content_hash": "b511d9cfae144db8a520d5f85ca04d25", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 153, "avg_line_length": 89.87301587301587, "alnum_prop": 0.6305192511480042, "repo_name": "cmsart/Satoshi", "id": "5cf1f11875144c9f1bb35efd06d7cbb7ec0ec63c", "size": "5662"...
import base64 import hashlib import logging import os import random import re import sys import time import traceback from functools import lru_cache, wraps from typing import ( TYPE_CHECKING, Any, Callable, Dict, Iterable, List, Optional, Sequence, Tuple, TypeVar, cast, ) f...
{ "content_hash": "4e5266afae7c97d639e928979de25a5f", "timestamp": "", "source": "github", "line_count": 731, "max_line_length": 103, "avg_line_length": 38.36662106703147, "alnum_prop": 0.6580617556870855, "repo_name": "brainwane/zulip", "id": "c95473134d56a72b9cdf5811621791baf5d79fed", "size": "281...
from django.contrib import admin from resume.models import Resume, Topic, Experience # Register your models here. admin.site.register(Resume) admin.site.register(Topic) admin.site.register(Experience)
{ "content_hash": "aee26465cdcc2b380f3b1aadf51884ec", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 51, "avg_line_length": 25.375, "alnum_prop": 0.812807881773399, "repo_name": "jxnl/jxnlco-django", "id": "cbe6eba37c1a1605d5160f11369a7998c61ce057", "size": "203", "binary...
from __future__ import unicode_literals import os from django.conf import settings as django_settings from django.utils.functional import cached_property from django_vest.fields import get_field class Simple(object): """ Simple wrapper around settings file. """ source = django_settings def __getatt...
{ "content_hash": "3fe03840f3c249a9125f1029a263a18c", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 76, "avg_line_length": 24.53448275862069, "alnum_prop": 0.6416022487702038, "repo_name": "zerc/django-vest", "id": "ff1f8f26d031a5b9a90273fa491dc71a7c3e07b4", "size": "1439...
import pickle from datetime import datetime from loguru import logger from sqlalchemy import Column, DateTime, Index, Integer, String, Unicode, select from flexget import db_schema, plugin from flexget.entry import Entry from flexget.event import event from flexget.utils import json, serialization from flexget.utils....
{ "content_hash": "2d3a6f8f375c7771fbc3930f93b8476e", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 115, "avg_line_length": 35.02614379084967, "alnum_prop": 0.5947005038253406, "repo_name": "crawln45/Flexget", "id": "4e65b1ce58d9868a977a2a30b19710ead21e6810", "size": "53...
''' Test for deleting vm image check vm resize data volume. @author: SyZhao ''' import os import apibinding.inventory as inventory import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_state as test_state import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.operations.resource_ope...
{ "content_hash": "dfbc4653f655da85f913e92a77c3a10f", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 95, "avg_line_length": 33.196969696969695, "alnum_prop": 0.7133728890917389, "repo_name": "zstackio/zstack-woodpecker", "id": "ea749d9ce57ff2629938a664ea8c8a67552cc0ae", "s...
''' Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.) You have the following 3 operations permitted on a word: a) Insert a character b) Delete a character c) Replace a character ''' class Solution: # @return an integer ...
{ "content_hash": "9d7db3227210700243eb5fb0a9bd433c", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 146, "avg_line_length": 38.833333333333336, "alnum_prop": 0.5743919885550787, "repo_name": "shub0/algorithm-data-structure", "id": "d1e1055856f8e8a7c763e521c0321a668b2eaf6e",...
import argparse import os import sys sys.path.append(os.path.dirname(__file__)) from gerrit import GerritChange, argparse_gerrit_change_type # noqa: E402 def main(): parser = argparse.ArgumentParser( description='Get a Gerrit change attribute') parser.add_argument('change', type=argparse_gerrit_chan...
{ "content_hash": "5d3398234357476c722de9ad56004d58", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 78, "avg_line_length": 31.821428571428573, "alnum_prop": 0.5757575757575758, "repo_name": "SUSE-Cloud/automation", "id": "c2181b9fe441e99d29801ee7f57b9275d9059afd", "size":...
"""Tests for StructuredTensorSpec.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl.testing import parameterized from tensorflow.python.framework import tensor_shape from tensorflow.python.framework import tensor_spec from tensorflow.python.fra...
{ "content_hash": "18108a6173b6615b74a424c6ec9ea264", "timestamp": "", "source": "github", "line_count": 231, "max_line_length": 83, "avg_line_length": 41.14718614718615, "alnum_prop": 0.6094687006838506, "repo_name": "aldian/tensorflow", "id": "4637a1a51e5c0118fbabf88e15768297f07ef43b", "size": "10...
from .__cmd_group import * from ._create import * from ._delete import * from ._list import * from ._search import * from ._show import * from ._update import *
{ "content_hash": "ec12b3775f8acbc479b3b39f0e5bdc71", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 26, "avg_line_length": 23, "alnum_prop": 0.6832298136645962, "repo_name": "yugangw-msft/azure-cli", "id": "10a024b2268bc60b8014c8969891fd81cd12fb6c", "size": "579", "binar...
try: from django_hasher import check_password, make_password except ImportError: import bcrypt def make_password(password): return bcrypt.hashpw(password, bcrypt.gensalt()) def check_password(password, hashed): return bcrypt.hashpw(password, hashed) == hashed
{ "content_hash": "f7319803888696e09223d808d35d8226", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 59, "avg_line_length": 29.4, "alnum_prop": 0.7108843537414966, "repo_name": "ymero/workin", "id": "7b4233fa989ef7638f344326086cc9dc2af75f63", "size": "341", "binary": fal...
from django.conf.urls.defaults import * from osmp.views import payment urlpatterns = patterns('', url(r'^payment/$', payment, name='osmp-payment'), )
{ "content_hash": "9483ec37579d76870142d3463fbcfb95", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 53, "avg_line_length": 22.285714285714285, "alnum_prop": 0.7051282051282052, "repo_name": "oxyum/django-payment-osmp", "id": "7d5a00adfa3618865e92360069e29968874ad385", "siz...
import os import threading from multiprocessing import Queue import multiprocessing import time import sys from fuse import FUSE, FuseOSError, Operations from optparse import OptionParser from Queue import Empty from fusecache import LoopBack from fusecache import AccessInfo from ..config import DiscoveryConst as Dis...
{ "content_hash": "8699596cf10c2fa0025d5bb4580b678d", "timestamp": "", "source": "github", "line_count": 212, "max_line_length": 89, "avg_line_length": 31.891509433962263, "alnum_prop": 0.6024256766750481, "repo_name": "OpenEdgeComputing/elijah-discovery-basic", "id": "a9aa6270ed29b7f7d0b15ce1ed348df9...
import numpy as np import pandas as pd import pytest from pytest import mark, param import ibis.expr.datatypes as dt from ibis import _ from ibis import literal as L from ibis.udf.vectorized import reduction @reduction(input_type=[dt.double], output_type=dt.double) def mean_udf(s): return s.mean() aggregate_te...
{ "content_hash": "40e74dbc3053d35066081807ea8f808a", "timestamp": "", "source": "github", "line_count": 883, "max_line_length": 86, "avg_line_length": 30.032842582106454, "alnum_prop": 0.4855386703872695, "repo_name": "ibis-project/ibis", "id": "a5561b3bc7258e2e5d04cf459e4f6d3b0302cc31", "size": "2...
"""Control Spotify with i3.""" import sys from subprocess import Popen import gi if True: gi.require_version('Playerctl', '2.0') from gi.repository import Playerctl try: player = Playerctl.Player.new('spotify') except: # noqa # pylint:disable=bare-except try: player = Playerctl.Player.new('...
{ "content_hash": "3b1cd730d431dbf68430763937e9fad8", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 80, "avg_line_length": 23.818181818181817, "alnum_prop": 0.6590330788804071, "repo_name": "petobens/dotfiles", "id": "8ad7063e314246effeedd8365bfeabf4cc9b8f47", "size": "81...
import logging ### memory对象最简单就是本模块的一个记录 ### 或者redis数据库 memory = {} class memorized_property(property): def __init__(self,*args,**kwargs): super(memorized_property,self).__init__(*args,**kwargs) def __get__(self, obj, objtype=None): if obj is None: return self ...
{ "content_hash": "55089e6d014eeeb52ac17fee95ea9d75", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 70, "avg_line_length": 29.413793103448278, "alnum_prop": 0.5070339976553341, "repo_name": "a358003542/expython", "id": "b69f82316249f88d8e914623345549b8626c7864", "size": "...
from libsaas.services import base from .resource import ReadonlyResource from .calendar import CalendarLists, CalendarList class SettingResource(ReadonlyResource): path = 'settings' class User(ReadonlyResource): path = 'users/me' def get(self, *args, **kwargs): raise base.MethodNotSupported() ...
{ "content_hash": "68fef8b8912fee81af34a6f353489beb", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 67, "avg_line_length": 25.86046511627907, "alnum_prop": 0.6573741007194245, "repo_name": "livingbio/libsaas", "id": "444a28168f8db2bdd86aa4cc08e47a953253b839", "size": "111...
from . import TweetAdapter from ttp import ttp import re def breakMessage(messageToBreak, tweetId, userId, userDataStrategy): if len(messageToBreak) <= 140: return [ messageToBreak ] username = TweetAdapter.getUsernameForTweet(tweetId, userId, userDataStrategy) splitMessageList = [] urls = getUr...
{ "content_hash": "b160a0315fdb7ebf1af8f3cea037ed77", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 115, "avg_line_length": 41.42, "alnum_prop": 0.6837276677933366, "repo_name": "kiriappeee/reply-later", "id": "336ac49e3808895a9f2dfe24a051946caf8835ce", "size": "2071", ...
import unittest import openrtb import openrtb.base BRQ = { 'id': u'testbrqid', 'tmax': 100, 'at': 2, 'app': { 'id': u'appid', 'name': u'appname', 'cat': [u'IAB1', u'IAB2-2'], 'publisher': { 'id': u'pubid', 'cat': [u'IAB3'] }, 'con...
{ "content_hash": "5e38fcdcc2f30181d013f24353a5417e", "timestamp": "", "source": "github", "line_count": 358, "max_line_length": 125, "avg_line_length": 33.69553072625698, "alnum_prop": 0.5604741772361768, "repo_name": "anossov/openrtb", "id": "29fbe29d6edc2dc99ea1ece5fdabf66bc9cc96a0", "size": "120...
import os from setuptools import setup, find_packages NAME = 'djangae' PACKAGES = find_packages() DESCRIPTION = 'Django integration with Google App Engine' URL = "https://github.com/potatolondon/djangae" LONG_DESCRIPTION = open(os.path.join(os.path.dirname(__file__), 'README.md')).read() AUTHOR = 'Potato London Ltd.'...
{ "content_hash": "c9e3a917280b32f3fd259ea5fd929496", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 84, "avg_line_length": 26.25581395348837, "alnum_prop": 0.62533215234721, "repo_name": "kirberich/djangae", "id": "41bc131a1b179c26c5d510575ff5f50191f8c903", "size": "1129"...
from tornado.options import _LogFormatter as TornadoLogFormatter import logging, logging.handlers import os.path import types import dictconfig # Pulled from commonware.log we don't have to import that, which drags with # it Django dependencies. class RemoteAddressFormatter(logging.Formatter): """Formatter that m...
{ "content_hash": "03e9bb20203008f92e35772154591c21", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 79, "avg_line_length": 32, "alnum_prop": 0.5337752525252525, "repo_name": "peplin/trinity", "id": "4907964a63c7ac01ddcda9578de8e66f7f93a39a", "size": "3168", "binary": fa...
""" Classes for generating random values for thrift types """ from __future__ import absolute_import, division, print_function, unicode_literals import collections import random import sys import six import six.moves as sm from thrift import Thrift from thrift.util.type_inspect import get_spec, ThriftPyTypeSpec IN...
{ "content_hash": "80ea4f631ad0324e5f3ad1dce4c85e7d", "timestamp": "", "source": "github", "line_count": 1020, "max_line_length": 84, "avg_line_length": 33.5735294117647, "alnum_prop": 0.6156227186450577, "repo_name": "facebook/fbthrift", "id": "71cfddcf4fe4ae2cb06691fea291237e25e49ec7", "size": "34...
""" Herald HTTP transport implementation :author: Thomas Calmant :copyright: Copyright 2014, isandlaTech :license: Apache License 2.0 :version: 0.0.3 :status: Alpha .. Copyright 2014 isandlaTech Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in complianc...
{ "content_hash": "f2bc32133729e18d256f4e2e90d7ff81", "timestamp": "", "source": "github", "line_count": 343, "max_line_length": 95, "avg_line_length": 33.19825072886297, "alnum_prop": 0.5676648810046544, "repo_name": "librallu/cohorte-herald", "id": "c2c7c6b323b25552a0fdde6fa673c8665ce4766e", "size...
from django.db import models from django.db.models import signals from composition import CompositionField D = dict class CommentCountField(CompositionField): def __init__(self, verbose_name=None, editable=False): def _do(host, comment, signal): from turbion.bits.blogs.models import Comment ...
{ "content_hash": "3808c7af76779bfb0de45706629fb117", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 79, "avg_line_length": 32.18181818181818, "alnum_prop": 0.512241054613936, "repo_name": "strogo/turbion", "id": "9f6fe81a504d8599d2b3f0ecd0b505ebf24ced3c", "size": "2124", ...
import os #For creating folder import urllib #For accessing the web import re #For regex from urllib.request import urlopen, URLopener import threading #For downloading multiple files at once import queue #To create a queue for the threads to pull data from import time #For timing operations #Returns list of lists th...
{ "content_hash": "5b63dda03c9a2d788f6393f2e1f64bf9", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 141, "avg_line_length": 36.43333333333333, "alnum_prop": 0.6906286759900666, "repo_name": "mitchtz/Imgur_Album_Downloader", "id": "705fd88d4a09bfa0ea6d5f17ff607bf92ba9621b",...
from __future__ import absolute_import from datetime import datetime import mock from django.core.cache import cache from ..extensions.rq import livewatch_update_rq_task from ..tasks import livewatch_update_celery_task class TestRqTask: key = 'livewatch_rq' def teardown(self): cache.delete(self.ke...
{ "content_hash": "6ce11961a33c8cae3666efb80ea9d791", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 70, "avg_line_length": 27.46153846153846, "alnum_prop": 0.6918767507002801, "repo_name": "moccu/django-livewatch", "id": "99ab47f33a3977443f090a146cb0a34a2d69bc55", "size":...
from setuptools import setup import os rootdir = os.path.abspath(os.path.dirname(__file__)) with open("README.md", "r", encoding="utf8") as file: long_description = file.read() # Write a versions.py file for class attribute VERSION = "0.0.6" def write_version_py(filename=None): doc = ("\"\"\"\n" + ...
{ "content_hash": "38399772eed1b7811dfea4046d0b7c49", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 73, "avg_line_length": 30.26086956521739, "alnum_prop": 0.6149425287356322, "repo_name": "QuantEcon/rvlib", "id": "46064dcfc78b202d6b5f291edc0b07ac54bd468d", "size": "1392"...
import types from botocore import session from oslo_log import log as logging LOG = logging.getLogger(__name__) class BotocoreClientBase(object): def __init__(self, region, access, secret): self.region = region self.connection_data = { 'config_file': (None, 'AWS_CONFIG_FILE', None),...
{ "content_hash": "f5fa59e5aac2be42a0511054c4210f39", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 73, "avg_line_length": 30.173076923076923, "alnum_prop": 0.5933715742511153, "repo_name": "MayankGo/ec2-api", "id": "49baa2963e2bdd2c0b8c7fc00d65fb89940bd8f7", "size": "220...
from .models import xray_backends from ..core.models import base_decorator from .mock_client import MockXrayClient, XRaySegment # noqa xray_backend = xray_backends["us-east-1"] mock_xray = base_decorator(xray_backends) mock_xray_client = MockXrayClient()
{ "content_hash": "3b215288abb1b0268e922ccd56ad491d", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 60, "avg_line_length": 36.714285714285715, "alnum_prop": 0.7821011673151751, "repo_name": "spulec/moto", "id": "e47d7642b617d56e11797a1ed5df66898a06a155", "size": "257", "...
import os import shutil, errno def read_file(file_path): f = open(file_path, 'r') contents = f.read() f.close() return contents #unused def write_file(file_path, contents): f = open(file_path, 'w+') f.write(contents) f.close() def copydir(src, dest): try: shutil.copytree(src,...
{ "content_hash": "5dcb0b1c12583d48fb914875b892d42d", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 64, "avg_line_length": 25.716666666666665, "alnum_prop": 0.5793907971484121, "repo_name": "mcmlxxxiii/chooh", "id": "7c3cb7330c5fcd9cc15b1fad927e1a047377ef58", "size": "156...
"""Exceptions modules for all plugins.""" class NagiosCritical(Exception): """ Raise to fire a CRITICAL event to Nagios and stop plugin execution. :param msg: Output message in Nagios :type msg: string """ def __init__(self, msg): print "CRITICAL - %s" % msg raise SystemExit(...
{ "content_hash": "374c5f5c4ae9e1d9261a702ef5e33e79", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 71, "avg_line_length": 23.281690140845072, "alnum_prop": 0.6146400483968542, "repo_name": "bigbrozer/monitoring.nagios", "id": "b682712d1cf764c76405b26928ed44d78d4b497a", "...
import mechanize import random import time import httplib import urllib import json # nested dictionnaries in URL are not implemented in urllib def recursive_urlencode(data): def r_urlencode(data, parent=None, pairs=None): if pairs is None: pairs = {} if parent is None: par...
{ "content_hash": "56725feac7416c18d6bc0b13f8cd5ef5", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 106, "avg_line_length": 31.90990990990991, "alnum_prop": 0.5810276679841897, "repo_name": "be-oi/beoi-contest-platform", "id": "5859b6f595706478d15524adc5cbd238dce36ff9", ...
"""This example gets all alerts for all clients of an MCC account. This example assumes the email and password belong to an MCC. Tags: AlertService.get Api: AdWordsOnly """ __author__ = 'api.kwinter@gmail.com (Kevin Winter)' import os import sys sys.path.insert(0, os.path.join('..', '..', '..', '..', '..')) # Impor...
{ "content_hash": "4e8b3cb558953f436f550b21c16db026", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 80, "avg_line_length": 33.57746478873239, "alnum_prop": 0.5750838926174496, "repo_name": "nearlyfreeapps/python-googleadwords", "id": "279cfc231490a9c3132d91efcf30f63fe70aaa1...
from .base import * # NOQA import logging.config # For security and performance reasons, DEBUG is turned off DEBUG = False # Must mention ALLOWED_HOSTS in production! ALLOWED_HOSTS = ['172.16.0.66','cellexpress.cgm.ntu.edu.tw'] # Cache the templates in memory for speed-up loaders = [ ( 'djan...
{ "content_hash": "691a8c5a8a7c3ead9a730341b90e1baf", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 63, "avg_line_length": 26.10810810810811, "alnum_prop": 0.5700483091787439, "repo_name": "LeeYiFang/Carkinos", "id": "29876bbb24ceecbd5f72ed884ecfeb44b4a032bc", "size": "3...
from scientifica import Scientifica
{ "content_hash": "9fff6a741716378060f0c88998ebc55c", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 35, "avg_line_length": 36, "alnum_prop": 0.8888888888888888, "repo_name": "mgraupe/acq4", "id": "589e21367d1e3bf55f23d1e78d8eade6a0087601", "size": "36", "binary": false, ...
import os from django.core.handlers.wsgi import WSGIHandler os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") application = WSGIHandler()
{ "content_hash": "e41a3e9ef309ea140be6eef487365cd7", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 59, "avg_line_length": 29.6, "alnum_prop": 0.8108108108108109, "repo_name": "antofik/Wartech", "id": "409c16a9b7838ff801d4312e25df3cff671ebc22", "size": "148", "binary": f...
"""Collect macro definitions from header files. """ # Copyright The Mbed TLS Contributors # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www...
{ "content_hash": "901acbe64a6e7cde76e20c3940260278", "timestamp": "", "source": "github", "line_count": 550, "max_line_length": 91, "avg_line_length": 43.341818181818184, "alnum_prop": 0.595477808540985, "repo_name": "Mbed-TLS/mbedtls", "id": "3cad2a3f6238590ce2748508697c4f8a1422731d", "size": "238...
from copy import deepcopy from typing import Any, Awaitable, TYPE_CHECKING from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from .. import models from .._serialization import Deserializer, Serializer from ._configuration import PrivateDnsManagementClientCon...
{ "content_hash": "d33bfa7f50543508b8586cea3471c85c", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 115, "avg_line_length": 48.215053763440864, "alnum_prop": 0.715878679750223, "repo_name": "Azure/azure-sdk-for-python", "id": "812013baff831d2931588f2e8fdb01b0a926eb9b", "s...
import json import copy import collections class QueryError(Exception): '''Query error base class''' def __init__(self, message, status_code=None): super(QueryError, self).__init__(message) if status_code: self.status_code = status_code class QueryResourceDoesNotExist(QueryError...
{ "content_hash": "2700811a74df9f62bb0057fda4207501", "timestamp": "", "source": "github", "line_count": 174, "max_line_length": 119, "avg_line_length": 31.666666666666668, "alnum_prop": 0.570961887477314, "repo_name": "felix-dumit/campusbot", "id": "c363ebcbb4c4accd52c29c7951cad7f4aa14cb13", "size"...
from mlabns.db import model from mlabns.util import constants from mlabns.util import message import logging import os import socket import sys sys.path.insert(1, os.path.abspath(os.path.join( os.path.dirname(__file__), '../third_party/pygeoip'))) import pygeoip class GeoRecord: def __init__(self, city=Non...
{ "content_hash": "114147be1bc4554300d085e8434fd680", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 80, "avg_line_length": 35.6796875, "alnum_prop": 0.6522881541493322, "repo_name": "fernandalavalle/mlab-ns", "id": "0a6c3b338f12f3e53767425051a082cd6ef75318", "size": "456...
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 'Coupon' db.create_table('coupons_coupon', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_...
{ "content_hash": "a07397e61aef4f565117539bcbd8574e", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 182, "avg_line_length": 65.97402597402598, "alnum_prop": 0.5604330708661417, "repo_name": "byteweaver/django-coupons", "id": "1bdeb637c44a1a879aff3bc5c8b2e683b06c693d", "si...
import numpy as np from scipy import linalg from distutils.version import LooseVersion from .mixin import TransformerMixin class CSP(TransformerMixin): """M/EEG signal decomposition using the Common Spatial Patterns (CSP) This object can be used as a supervised decomposition to estimate spatial filters ...
{ "content_hash": "809156588e19a61c7ea58eb527ae634b", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 78, "avg_line_length": 39.22380952380952, "alnum_prop": 0.5298045404880417, "repo_name": "agramfort/mne-python", "id": "fce9cfab4e52bd0daf257cf23b4112c89acb56a0", "size": ...
""" JSON def: HandlerEnvironment.json [{ "name": "ExampleHandlerLinux", "seqNo": "seqNo", "version": "1.0", "handlerEnvironment": { "logFolder": "<your log folder location>", "configFolder": "<your config folder location>", "statusFolder": "<your status folder location>", "heartbeatFile": "<your...
{ "content_hash": "2f7c77b78523b1d5ee24c6feb3c967ff", "timestamp": "", "source": "github", "line_count": 785, "max_line_length": 636, "avg_line_length": 45.480254777070066, "alnum_prop": 0.5986219259425243, "repo_name": "Azure/azure-linux-extensions", "id": "8942ed8f147623fd8848bc967915c5db339b5ed9", ...
from django.conf.urls import url from . import views urlpatterns = [ # eg. /POInvoice/ url(r'^$', views.index, name='index'), # eg. /POInvoice/customer/5/ url(r'^customer/(?P<customer_id>[0-9]+)/$', views.customer_index ), # eg. /POInvoice/purchorder/7 url(r'^purchorder/(?P<purchorder_id>[0-9]+...
{ "content_hash": "c7bebde017c34f648bbfbcd4af5761ef", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 76, "avg_line_length": 36.86666666666667, "alnum_prop": 0.6238698010849909, "repo_name": "JasonL888/POInvoiceTracker", "id": "58c9c2122cae8c6a87f5b667456290248ebd805f", "si...
from fbchat import log, Client # Subclass fbchat.Client and override required methods class EchoBot(Client): def onMessage(self, author_id, message_object, thread_id, thread_type, **kwargs): self.markAsDelivered(author_id, thread_id) self.markAsRead(author_id) log.info("{} from {} in {}".f...
{ "content_hash": "6a994a8df87f231dbe2c4a9181a34638", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 88, "avg_line_length": 36.9375, "alnum_prop": 0.6700507614213198, "repo_name": "Bankde/fbchat", "id": "a89b2f9a5657ea9ad846e82136dbca993a194c19", "size": "616", "binary":...
"""Run tests in parallel.""" from __future__ import print_function import argparse import ast import collections import glob import itertools import json import logging import multiprocessing import os import os.path import pipes import platform import random import re import socket import subprocess import sys impor...
{ "content_hash": "9d97946c3723b6203ea878301487f86e", "timestamp": "", "source": "github", "line_count": 1802, "max_line_length": 135, "avg_line_length": 35.1542730299667, "alnum_prop": 0.5458262297152239, "repo_name": "geffzhang/grpc", "id": "bd5b8644b396c655305e2db58bda3c05e8c5789e", "size": "6394...
"""Fixer for exec. This converts usages of the exec statement into calls to a built-in exec() function. exec code in ns1, ns2 -> exec(code, ns1, ns2) """ # Local imports from .. import pytree from .. import fixer_base from ..fixer_util import Comma, Name, Call class FixExec(fixer_base.BaseFix): PATTERN = """ ...
{ "content_hash": "7935b6fdd5ac1e2aa26dbe80416fc0a4", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 67, "avg_line_length": 24.333333333333332, "alnum_prop": 0.5547945205479452, "repo_name": "fkolacek/FIT-VUT", "id": "121431c0c272c88da2a8332c91289cb7bd132afc", "size": "977...
from tddspry.noseplugins.djangoplugin import *
{ "content_hash": "5b86c6b6d5126880cefa105e1940d103", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 46, "avg_line_length": 47, "alnum_prop": 0.851063829787234, "repo_name": "playpauseandstop/tddspry", "id": "455c8eba7754731f3a78c317f0b5b86239456e3d", "size": "47", "binar...
from gerencianet import Gerencianet from ...credentials import credentials gn = Gerencianet(credentials.CREDENTIALS) headers = { 'x-skip-mtls-checking': 'false' } params = { 'chave': '' } body = { 'webhookUrl': '' } response = gn.pix_config_webhook(params=params, body=body, headers=headers) print(resp...
{ "content_hash": "b04f6a2215551a90e99e5206a336c30c", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 76, "avg_line_length": 17.157894736842106, "alnum_prop": 0.6932515337423313, "repo_name": "gerencianet/gn-api-sdk-python", "id": "2290596b86e9d594722b2e366c918457a467a2dc", ...
""" lunaport.domain ~~~~~~~~~~~~~~~ Data domain related object contains most of business logic. """
{ "content_hash": "90783bfaaa93ee12c7f4ae48148aa606", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 59, "avg_line_length": 16.833333333333332, "alnum_prop": 0.6336633663366337, "repo_name": "greggyNapalm/lunaport_server", "id": "2a594e445e38686a654bb0d123978dac97a733a5", "...
import threading, datetime, time, ast import udpserver, tcpfilesocket, udpbroadcaster, messages from constants import * groupManager = None startup = True class GroupManager(): def __init__(self, config): self.groupName = config["group"] self.memberCount = 0 self.groupMasterName = config["...
{ "content_hash": "9698b05ee34b91e93f2c0872771bdee5", "timestamp": "", "source": "github", "line_count": 270, "max_line_length": 135, "avg_line_length": 41.525925925925925, "alnum_prop": 0.5758116303960042, "repo_name": "peter9teufel/raspmedia", "id": "0b053f8769111dd23e02dba6076e428a4f382202", "siz...
from os import system from tota.game import Drawer from tota import settings from termcolor import colored def make_bar(length, life, max_life): """Create a small unicode bar.""" life = max(life, 0) life_chars_count = int(life / (max_life / length)) life_chars = life_chars_count * '\u2588' no_li...
{ "content_hash": "8f9d76eb3caa2c293efd3c63acb36093", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 78, "avg_line_length": 37.44117647058823, "alnum_prop": 0.497643362136685, "repo_name": "fisadev/tota", "id": "64eef361c7188a45f88b22c334ea77e00f66b353", "size": "5092", ...
from djangotoolbox.fields import ListField from django.db import models from student.models import Student from random import random OPERATION_CHOICES = ( ('0',u'addition'), ('1',u'subtraction'), ('2',u'multiplication'), ('3',u'division'), ) ASK_CHANCE = 0.1 def ask_anyway(): return random < ASK_CHANCE class Q...
{ "content_hash": "089b4c1cdb1b0c8b8a2fde2ab309f054", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 79, "avg_line_length": 30.333333333333332, "alnum_prop": 0.7371794871794872, "repo_name": "bernardokyotoku/skillplant", "id": "d4fc194abf2374357c94f8e72a02a71e9fc67f03", "s...
from typing import List, Tuple from corehq.extensions import extension_point, ResultFormat @extension_point(result_format=ResultFormat.FLATTEN) def uitab_dropdown_items(tab_name, tab, domain, request) -> List[dict]: """Add dropdown items to UI Tabs. Parameters: :param tab_name: Name of the tab that ...
{ "content_hash": "00f97171fa3a8dfa206376bbeff186da", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 88, "avg_line_length": 26.93103448275862, "alnum_prop": 0.6402048655569782, "repo_name": "dimagi/commcare-hq", "id": "1f09e308388b9d06d530507ac8151f6d2ec40542", "size": "15...
from __future__ import unicode_literals from django.conf import settings from django.conf.urls import patterns, include, url from django.conf.urls.static import static from django.contrib import admin from django.contrib.sitemaps.views import sitemap from django.views.generic import TemplateView from .sitemaps import S...
{ "content_hash": "43c63ebbc0d6e343e110984faea66870", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 87, "avg_line_length": 41.11538461538461, "alnum_prop": 0.7287184284377923, "repo_name": "Korkki/django-base-template", "id": "8d1faaebf3195f99165f849d7a0e3bdeda9c82cc", "s...
from __future__ import print_function import os import select from subprocess import PIPE from subprocess import Popen from subprocess import STDOUT def run_command(cmd, cwd=None): p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=STDOUT, cwd=cwd) left_over = b'' while p.poll() is None: incomming...
{ "content_hash": "1184bf8994a80c8a389bf8ba8ce68c88", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 67, "avg_line_length": 28.142857142857142, "alnum_prop": 0.5421319796954315, "repo_name": "davetcoleman/catkin_tools", "id": "3d02de124b1dc0419959d5e5ff42f1b6e368e6ab", "si...
import logging from django.utils.translation import ugettext_lazy as _ from horizon import api from horizon import tables LOG = logging.getLogger(__name__) class DeleteKeyPairs(tables.DeleteAction): data_type_singular = _("Keypair") data_type_plural = _("Keypairs") def delete(self, request, obj_id): ...
{ "content_hash": "214c2822d328cb3de19c64ab12d00de0", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 77, "avg_line_length": 27.155555555555555, "alnum_prop": 0.6783960720130933, "repo_name": "gyang/horizon", "id": "8a9345c32624dda3b66427821b92364dc1a1e585", "size": "1872",...