text
stringlengths
4
1.02M
meta
dict
from __future__ import print_function, unicode_literals __author__ = 'Miroslav Shubernetskiy' __email__ = 'miroslav@miki725.com' __version__ = '0.1.5'
{ "content_hash": "c50db6c217c1f387c8188f90b9519049", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 55, "avg_line_length": 25.5, "alnum_prop": 0.6797385620915033, "repo_name": "pombredanne/django-rest-framework-braces", "id": "0dac0a8a28105d71fd2de1c66d283e73bcbdd4ec", "si...
from covata.delta import Client, FileSystemKeyStore key_store = FileSystemKeyStore("~/keystore/", "passPhrase") client = Client(key_store) # option 1: via identity object identity = client.get_identity("8e91cb8c-1ea5-4b69-bedf-9a14940cce44") secret_1 = identity.create_secret("here is my secret") # option 2: via clie...
{ "content_hash": "ad0b9615921379368c7300a7c86a4bde", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 71, "avg_line_length": 37.916666666666664, "alnum_prop": 0.7120879120879121, "repo_name": "Covata/delta-sdk-python", "id": "181b23fbf728414d380162f6e35a1d0e38cd7e4d", "size...
from __future__ import print_function import sys import os import tempfile import time import multiprocessing as mp import unittest import random import mxnet as mx import numpy as np import unittest import math from nose.tools import assert_raises from mxnet.test_utils import check_consistency, set_default_context, as...
{ "content_hash": "1eddac55a742af2615c5335ece33687b", "timestamp": "", "source": "github", "line_count": 414, "max_line_length": 162, "avg_line_length": 41.40338164251208, "alnum_prop": 0.6184003267020594, "repo_name": "mlperf/training_results_v0.6", "id": "febadf8a071a64c84a5cdf8ab908cf0e9b99ff03", ...
"""A Folder Resource.""" from google.cloud.security.common.gcp_type import resource # TODO: The next editor must remove this disable and correct issues. # pylint: disable=missing-type-doc class FolderLifecycleState(resource.LifecycleState): """Represents the Folder's LifecycleState.""" pass class Folder(...
{ "content_hash": "9454529658a84072e810f0ef0eb56d17", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 68, "avg_line_length": 28.166666666666668, "alnum_prop": 0.5959425190194421, "repo_name": "cschnei3/forseti-security", "id": "3b8a240ad57e921ce3d4fb585d1b31be025dc47b", "si...
""" Tests the LDAP-specific principal search adapter functionality. """ __version__ = "$Revision-Id:$"
{ "content_hash": "17f384a1b78c34f4787fec23e1665451", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 63, "avg_line_length": 14.625, "alnum_prop": 0.6153846153846154, "repo_name": "DLR-SC/DataFinder", "id": "9fb457fd479a0f957f0fe2f90966c40fb0a5ea28", "size": "1811", "binar...
from __future__ import unicode_literals from django.utils.translation import ugettext as _ from django.utils.html import mark_safe from ..core.tags.registry import register from .poll.utils.render import render_polls from .forms import CommentForm from .models import MOVED, CLOSED, UNCLOSED, PINNED, UNPINNED @regis...
{ "content_hash": "bb08320e5962138d19e0c629d84a74b5", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 72, "avg_line_length": 33.282051282051285, "alnum_prop": 0.697226502311248, "repo_name": "alesdotio/Spirit", "id": "7cf53ed360e6fa4e185f7d051008592a0a7584cc", "size": "1323...
import grpc from grpc.framework.common import cardinality from grpc.framework.interfaces.face import utilities as face_utilities import simple_test_pb2 as simple__test__pb2 class SimpleTestStub(object): def __init__(self, channel): """Constructor. Args: channel: A grpc.Channel. """ self.Get...
{ "content_hash": "83872bafb3f73a5a4b393f1c2b46ed9a", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 79, "avg_line_length": 39.23255813953488, "alnum_prop": 0.7131001778304683, "repo_name": "ada-wang/grpc-py-helloworld", "id": "f62b5138daafa7dda5dac3d9a2f59afb95cd3e97", "s...
"""Unit tests for local command-line-interface debug wrapper session.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import shutil import tempfile from tensorflow.core.protobuf import config_pb2 from tensorflow.python.client import session fro...
{ "content_hash": "2237668cb3baf0bcf8077446e33359dd", "timestamp": "", "source": "github", "line_count": 607, "max_line_length": 88, "avg_line_length": 39.56177924217463, "alnum_prop": 0.6774798034479886, "repo_name": "mavenlin/tensorflow", "id": "f65ffc95d756e59ea35bb6a6c5745ac6abde7a3d", "size": "...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json import difflib import warnings from copy import deepcopy from ansible import constants as C from ansible.module_utils._text import to_text from ansible.utils.color import stringc from ansible.vars import strip_internal...
{ "content_hash": "0f1f4c65c722e42eb41267cbee32ab95", "timestamp": "", "source": "github", "line_count": 345, "max_line_length": 147, "avg_line_length": 35.6, "alnum_prop": 0.5711610486891385, "repo_name": "abtreece/ansible", "id": "d02e5ac3bebe56498176b6ab5269a0747a31424c", "size": "13027", "bina...
"""Tests for emql.cm_sketch.""" from language.emql import cm_sketch import numpy as np import tensorflow.compat.v1 as tf class CmSketchTest(tf.test.TestCase): def setUp(self): super(CmSketchTest, self).setUp() self.xs = np.arange(100) self.cm_context = cm_sketch.CountMinContext(width=1000, depth=17) ...
{ "content_hash": "dbddd3a9c9670f7572ad185ba1ba0b36", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 71, "avg_line_length": 36.17948717948718, "alnum_prop": 0.7193479801559178, "repo_name": "google-research/language", "id": "48c90ff32bbc2b39f3bb9b6d71b5b35e714af11e", "size...
from model.group import Group def test_group_list(app,db): ui_list = app.group.get_group_list() def clean(group): return Group(id=group.id, name=group.name.strip()) db_list = map(clean, db.get_group_list()) assert sorted(ui_list, key=Group.id_or_max) == sorted(db_list, key=Group.id_or_max)
{ "content_hash": "b4c3a9ef17a8aded906e725a067c3d6e", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 87, "avg_line_length": 35.111111111111114, "alnum_prop": 0.6677215189873418, "repo_name": "olga121/python_training", "id": "899184b09c8d480ad0e75fb1aeed3f49d12daf98", "size"...
""" This module is the interface to the bayesian_structural_analysis (bsa) module It handles the images provided as input and produces result images. """ import numpy as np import os.path as op from nipy.io.imageformats import load, save, Nifti1Image from nipy.neurospin.utils.mask import intersect_masks import nipy.n...
{ "content_hash": "2294ba68e62318706883e7116aa9aa2b", "timestamp": "", "source": "github", "line_count": 316, "max_line_length": 88, "avg_line_length": 37.300632911392405, "alnum_prop": 0.5674047679647068, "repo_name": "yarikoptic/NiPy-OLD", "id": "dcbc29dc75f9c993825ee5acff06fb478b0cdc04", "size": ...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "neighbors.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "b9f67f09eb48dd90ddd5473d7f721717", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 73, "avg_line_length": 25.555555555555557, "alnum_prop": 0.7130434782608696, "repo_name": "pabulumm/neighbors", "id": "47e79149633f10ad1bbd7b9535367c87759a1d59", "size": "25...
"""configure script to get build parameters from user.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import errno import os import platform import re import subprocess import sys # pylint: disable=g-import-not-at-top try: from shutil...
{ "content_hash": "6f5c57223bc496a7a5215c20dad27b40", "timestamp": "", "source": "github", "line_count": 1667, "max_line_length": 93, "avg_line_length": 37.2255548890222, "alnum_prop": 0.6415276770606719, "repo_name": "girving/tensorflow", "id": "b564da27227ec07713f91e925ea292b35f0f02df", "size": "6...
from django.contrib import admin from .models import Message # Register your models here. admin.site.register(Message)
{ "content_hash": "1817501fc32064d25a04ee38ef13279c", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 32, "avg_line_length": 20, "alnum_prop": 0.8083333333333333, "repo_name": "lyubomir1993/AlohaServer", "id": "a45176be271cbbc190103636e028da945be9d30f", "size": "120", "bin...
from flask import * from config import app import scrapers as scraper from utils import * jobs = Blueprint('jobs', __name__, template_folder = 'views') #Exclusions, Skills, Position-type (PM, software dev), Field (AI, Medicine, sports), Experience Level @jobs.route('/jobs', methods = ['GET']) def jobs_route_get(): ...
{ "content_hash": "943b99f919a956a25269a449a3609ccc", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 378, "avg_line_length": 41.279411764705884, "alnum_prop": 0.6134663341645885, "repo_name": "preetsmohan/check-ai", "id": "48dbcbc6e49dd53cc0091dc85f5d6a8156abeae0", "size":...
import re import copy import random import os, sys import MySQLdb import requests from time import sleep from threading import Thread from bs4 import BeautifulSoup reload(sys) sys.setdefaultencoding('utf-8') clade = 'http://dblp.uni-trier.de/db/conf/mobisys/' months = { 'January': '01', 'February': '02', 'Ma...
{ "content_hash": "28aafbb67852bf95ab5f38e225622305", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 98, "avg_line_length": 24.985185185185184, "alnum_prop": 0.6406759561221465, "repo_name": "dcclogin/TextGenerator", "id": "3115bd62c0516881ac275d0d2ba4fce8919d2dbf", "size...
''' Created on 11 août 2014 @author: Marc-Antoine ''' from django.apps import AppConfig from django.db.models.signals import post_migrate class RefAppConfig(AppConfig): name='ref' verbose_name = u'Gestion du référentiel' def ready(self): import ref.cache from ref.management import po...
{ "content_hash": "b2ed04c185976649ddf256c75275ad48", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 63, "avg_line_length": 23.31578947368421, "alnum_prop": 0.6952595936794582, "repo_name": "marcanpilami/MAGE", "id": "bde64b052e66eb98514c29f474b054236b214931", "size": "463...
""" Use scikit-learn regressor interface with GPU histogram tree method =================================================================== """ from dask import array as da from dask.distributed import Client # It's recommended to use dask_cuda for GPU assignment from dask_cuda import LocalCUDACluster import xgboost...
{ "content_hash": "198a8df15d5ce6f6acb310056e57b3d3", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 73, "avg_line_length": 30.022222222222222, "alnum_prop": 0.6543301258327165, "repo_name": "dmlc/xgboost", "id": "4c544e4e88c4f5f9cc0a5409f93b14f7a4cab07c", "size": "1351", ...
from __future__ import division import time import math import smbus class Hat: address = 0x40 mode1 = 0x00 mode2 = 0x01 prescale = 0xFE bus = smbus.SMBus(1) def __init__(self): self.set_all_pwm(0, 0) self.bus.write_byte_data(self.address, self.mode2, 0x04) self.bu...
{ "content_hash": "8b2bc5a7b01ff9afcd46b54fd44e8002", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 82, "avg_line_length": 34.60344827586207, "alnum_prop": 0.6203288490284006, "repo_name": "romaneckert/robot", "id": "c0a76f7239c96ee9b69509bb06829fcec0f0266b", "size": "203...
import inspect import json import logging import os import re import shutil from collections import OrderedDict from traceback import print_exc from cave.__version__ import __version__ as version from cave.html.html_helpers import figure_to_html from cave.utils.tooltips import get_tooltip __author__ = "Marius Lindaue...
{ "content_hash": "1c0d06d53d55eede9ed4b263b7f4cfe5", "timestamp": "", "source": "github", "line_count": 320, "max_line_length": 118, "avg_line_length": 38.84375, "alnum_prop": 0.53266291230893, "repo_name": "automl/SpySMAC", "id": "4a55ee83f85d6fb3e04f5a446b926d913839f113", "size": "12430", "bina...
import argparse import re import tempfile import os import util logger = util.get_logger("MF") def finish (i, o, p): i.close() os.close(o) os.rename(p,i.name) util.wrote(i.name,logger) def run (rex, main, others): util.reading(main.name,logger) mainH,mainP = tempfile.mkstemp(dir=os.path.dirnam...
{ "content_hash": "8df86120773c174db99700e0a3fef954", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 77, "avg_line_length": 31.966101694915253, "alnum_prop": 0.5768822905620361, "repo_name": "Magnetic/proficiency-metric", "id": "bfe0b98ae6c7cef92a6db6763458646ced3090be", "...
import time def test_within_timeout(): time.sleep(0.001) def test_exceeds_timeout(): time.sleep(1000)
{ "content_hash": "bd16b500bbbe8de7cf6a2740521fdaaf", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 27, "avg_line_length": 12.666666666666666, "alnum_prop": 0.6754385964912281, "repo_name": "tdyas/pants", "id": "d9abffb6edf2602a035602899491181237d870d0", "size": "246", "...
import os from jinja2 import Environment, FileSystemLoader DIR = os.path.abspath(os.path.dirname(__file__)) PRODUCTION = int(os.environ.get("PRODUCTION", "1")) KG_PORT = 10100 deployments = {} for deployment in os.environ.get("DEPLOYMENTS", "ml:10002").split(","): name, db, s3, tm, api_port = deployment.split(":...
{ "content_hash": "a2886acacbf6788d10ac1555314fc648", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 98, "avg_line_length": 35.351351351351354, "alnum_prop": 0.6590214067278287, "repo_name": "materialsproject/MPContribs", "id": "9451e26235946b01fd088514da7056fd241e386e", "...
from rdmo.core.renderers import BaseXMLRenderer from rdmo.core.utils import get_languages class TasksRenderer(BaseXMLRenderer): def render_task(self, xml, task): xml.startElement('task', {'dc:uri': task['uri']}) self.render_text_element(xml, 'uri_prefix', {}, task['uri_prefix']) self.rend...
{ "content_hash": "1af326173ad8614b9d782355cbc2f090", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 101, "avg_line_length": 42.30434782608695, "alnum_prop": 0.6022610483042138, "repo_name": "rdmorganiser/rdmo", "id": "d618eba3f44cd6ecc8bd34ae90bab550aa316d0c", "size": "19...
__author__ = 'User' from telnetlib import Telnet class JamesHelper: def __init__(self, app): self.app = app def unsure_user_exists(self, username, password): james_config = self.app.config['james'] session = JamesHelper.Session( james_config['host'], james_config['port'],...
{ "content_hash": "ee4c28f2b58a6a4f611c763826eb6989", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 107, "avg_line_length": 34.56, "alnum_prop": 0.5729166666666666, "repo_name": "SvetlanaPopova/python_mantis", "id": "081dc05bb00916c9d3732f64ef49eddd79fa84cb", "size": "172...
"""Count number of features in all building dataset""" import codecs import os import sys sys.path.insert(0, os.path.abspath('.')) import catatom2osm import download import layer import setup from osmxml import etree baseurl = "http://www.catastro.minhap.es/INSPIRE/Buildings/" fh = codecs.open('count_buildings.csv', ...
{ "content_hash": "8d64193ff36cfe4c3dfd0ea5c2d4a6bb", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 98, "avg_line_length": 35.68181818181818, "alnum_prop": 0.5898089171974522, "repo_name": "javiersanp/CatAtom2Osm", "id": "c2dc4daaaf4c02085579ca99ee2661b7eabacce9", "size":...
import base64 from datetime import datetime import hashlib import hmac import time from hashlib import sha256 try: import simplejson as json except ImportError: import json from libcloud.utils.py3 import ET from libcloud.common.base import ConnectionUserAndKey, XmlResponse, BaseDriver from libcloud.common.bas...
{ "content_hash": "9e459e3a91fa3a854cef07044720f389", "timestamp": "", "source": "github", "line_count": 412, "max_line_length": 79, "avg_line_length": 37.8252427184466, "alnum_prop": 0.5251540041067762, "repo_name": "Scalr/libcloud", "id": "2f7a1c5d3ca993376ddd69496589bf9013a5d3bc", "size": "16366"...
"""Project class representing a project directory.""" from __future__ import absolute_import from copy import deepcopy, copy import os from conda_kapsel.env_spec import (EnvSpec, _anaconda_default_env_spec, _find_importable_spec, _find_out_of_sync_importable_spec) from conda_kapsel....
{ "content_hash": "c332445717d93742ede7adc2d0bce10d", "timestamp": "", "source": "github", "line_count": 1104, "max_line_length": 120, "avg_line_length": 44.52445652173913, "alnum_prop": 0.5734309836232326, "repo_name": "conda/kapsel", "id": "a5b86288fcdeb95747ae01be73d8e8cb85a68c1e", "size": "49486...
from cryptography.fernet import Fernet from girder.utility import config from girder.utility.model_importer import ModelImporter from girder.exceptions import AccessException from girder.plugins.minerva.constants import PluginSettings def findNamedFolder(currentUser, user, parent, parentType, name, create=False, ...
{ "content_hash": "8323f2354983c699712d2ffe4803f073", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 87, "avg_line_length": 35.44761904761905, "alnum_prop": 0.6386351423965609, "repo_name": "Kitware/minerva", "id": "efed1b56f1a5609be49cb3cd2660ce631aadf3cd", "size": "8232...
def test_simple(qibuild_action, record_messages): # More complex tests should be written at a lower level qibuild_action.create_project("world") qibuild_action.create_project("hello", build_depends=["world"]) qibuild_action("depends", "hello")
{ "content_hash": "f8e3567873f47044c40206c780181fef", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 67, "avg_line_length": 52, "alnum_prop": 0.7230769230769231, "repo_name": "dmerejkowsky/qibuild", "id": "a6e84472a3c5278d3240b3d4cfdaaea70fbdf8dc", "size": "432", "binary"...
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'opensourcedjango.views.home', name='home'), # url(r'^opensourcedjango/', include('opensourc...
{ "content_hash": "d8794c41184988940e49e2996df49fa4", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 71, "avg_line_length": 34.470588235294116, "alnum_prop": 0.6928327645051194, "repo_name": "juliomenendez/opensourcedjango.com", "id": "82eab6f0c0ba12a53788835691b1b9b35a3008e...
import sys import pytest def supported(): import django.test.testcases return hasattr(django.test.testcases, 'LiveServerThread') class LiveServer(object): """The liveserver fixture This is the object which is returned to the actual user when they request the ``live_server`` fixture. The fixtu...
{ "content_hash": "c397131409d86af5215a1bdfaff2e713", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 81, "avg_line_length": 34.42056074766355, "alnum_prop": 0.5848493076296497, "repo_name": "blueyed/pytest_django", "id": "ed03a1a405dd1a4d851315adb875603251e3dbd8", "size":...
"""Implementation of JSONEncoder """ import re try: _speedups = __import__('simplejson._speedups')._speedups c_encode_basestring_ascii = _speedups.encode_basestring_ascii c_make_encoder = _speedups.make_encoder except ImportError: c_encode_basestring_ascii = None c_make_encoder = None ESCAPE = re....
{ "content_hash": "4c9351b4d61fdfc98f3f31b153804663", "timestamp": "", "source": "github", "line_count": 432, "max_line_length": 136, "avg_line_length": 36.4537037037037, "alnum_prop": 0.5254000508001015, "repo_name": "SRabbelier/Melange", "id": "a33f4730a46d24c66aa5ba1e5e06829d62d8cb09", "size": "1...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: gce version_added: "1.4" short_description: create or termi...
{ "content_hash": "4c4f7676989881d8e7ab78b467e40114", "timestamp": "", "source": "github", "line_count": 774, "max_line_length": 150, "avg_line_length": 36.33204134366925, "alnum_prop": 0.6070907862451549, "repo_name": "e-gob/plataforma-kioscos-autoatencion", "id": "9aab4cf6ca00eae21d0e52366e354925e07...
""" ====================================== Plotting sensor layouts of MEG systems ====================================== In this example, sensor layouts of different MEG systems are shown. """ # Author: Eric Larson <larson.eric.d@gmail.com> # # License: BSD (3-clause) import os.path as op from mayavi import mlab im...
{ "content_hash": "4d71ee9a24b0851cc6dd751c0c842d03", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 73, "avg_line_length": 36.375, "alnum_prop": 0.5895925380461463, "repo_name": "teonlamont/mne-python", "id": "8a1bbee0a2bf3bb63e445e175d8ed8befdd93f41", "size": "2037", "...
from datetime import date from datetime import datetime from unittest import TestCase from unittest.mock import patch import dateutil.relativedelta as rd import pandas from . import CoreCalendarTest, GenericCalendarTest from ..core import Holiday from ..core import ( MON, TUE, THU, FRI, WED, SAT, SUN, ISO_TUE...
{ "content_hash": "225416e800e844b04a4fd104d56122fb", "timestamp": "", "source": "github", "line_count": 947, "max_line_length": 79, "avg_line_length": 33.24498416050687, "alnum_prop": 0.5920020328431217, "repo_name": "jaraco/calendra", "id": "8ba14c7a06da012cfeba5d860660c46ef5a688e3", "size": "3148...
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from .StarFile import StarBlock,StarFile,StarList,StarDict from io import StringIO # An alternative specification for the Cif Parser, based on Yapps2 # by Amit Patel (htt...
{ "content_hash": "1ea103d0acd427ea64c6c49c063f6df9", "timestamp": "", "source": "github", "line_count": 288, "max_line_length": 254, "avg_line_length": 49.28472222222222, "alnum_prop": 0.5896153304213048, "repo_name": "heprom/pymicro", "id": "02225c927ee23d706a2d7c558d93ca96c010e0cc", "size": "1423...
import os import numpy as np import tensorflow as tf from tensorflow.python.framework import test_util from tensorflow.python.platform import resource_loader from tensorflow.python.platform import test from tflite_micro.tensorflow.lite.micro.python.interpreter.src import tflm_runtime from tflite_micro.tensorflow.lite...
{ "content_hash": "bb788785c6c5bfb03c6d3b0561fc761e", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 131, "avg_line_length": 39.23684210526316, "alnum_prop": 0.7116029510395707, "repo_name": "google/CFU-Playground", "id": "24d288042b030342e4650732734823d5487e4929", "size":...
import unittest import mock import sys import os sys.path.append(os.path.join('..\..', 'src')) from backend.game import Game from backend.menus.menus import GameMenu, StartGameMenu, PauseGameMenu class GameMenuTest(unittest.TestCase): @mock.patch('backend.game.Game') def setUp(self, mock_game): self...
{ "content_hash": "adac1083339672a5be2f5c87d68ab0d2", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 70, "avg_line_length": 28.512820512820515, "alnum_prop": 0.5953237410071942, "repo_name": "tsvetelina-aleksandrova/Spacekatz", "id": "4fb432848b2fbd4526bc0798e50cefaa2985881b...
""" Handles basic connections to AWS """ from datetime import datetime import errno import os import random import re import socket import sys import time import xml.sax import copy from boto import auth from boto import auth_handler import boto import boto.utils import boto.handler import boto.cacerts from boto impo...
{ "content_hash": "0fd0bb539d89d5f3ac6b7947539b0d7a", "timestamp": "", "source": "github", "line_count": 1186, "max_line_length": 108, "avg_line_length": 41.30016863406408, "alnum_prop": 0.5699236454207668, "repo_name": "felix-d/boto", "id": "cfd0fff4d61dddde289ad6f3a0a627be4dbfd078", "size": "51006...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('core', '0002_auto_20170308_1026'), ] operations = [ migrations.CreateModel( name='Amis', fi...
{ "content_hash": "25cf46bd24eb6fa7ed235f8a7c2dca55", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 130, "avg_line_length": 34.35897435897436, "alnum_prop": 0.5671641791044776, "repo_name": "batebates/L3ProjetWeb", "id": "beac3b6a9c9cb7259a3c286648401593f9a4fa40", "size":...
import six import sys import os from unittest import TestCase from unittest.mock import patch from msgiver.configure import Configure Configure.CONF_FILE_PATH = "._test_msgiver.yml" class TestSlack(TestCase): @classmethod def tearDownClass(self): os.remove(Configure.CONF_FILE_PATH) def test_load_...
{ "content_hash": "0372249d5327469be4c69a00e939b9b4", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 142, "avg_line_length": 30.75862068965517, "alnum_prop": 0.647982062780269, "repo_name": "kitaro-tn/msgiver", "id": "df7218d30e6e8021af4f4159eb51f58eb41ba25b", "size": "917...
""" [12/11/13] Challenge #144 [Easy] Nuts & Bolts https://www.reddit.com/r/dailyprogrammer/comments/1sob1e/121113_challenge_144_easy_nuts_bolts/ # [](#EasyIcon) *(Easy)*: Nuts & Bolts You have just been hired at a local home improvement store to help compute the proper costs of inventory. The current prices are out o...
{ "content_hash": "6a8eea83635382346094a8a18f41e2fe", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 119, "avg_line_length": 34.54716981132076, "alnum_prop": 0.7127252867285636, "repo_name": "DayGitH/Python-Challenges", "id": "a236f68bd7730c27113e3bc4169559b21b024b79", "si...
from conan.packager import ConanMultiPackager import os, platform if __name__ == "__main__": builder = ConanMultiPackager(args="--build missing") builder.add_common_builds() filtered_builds = [] for settings, options, env_vars, build_requires in builder.builds: if not (settings["arch"] == "x86"...
{ "content_hash": "8cff8280eeb754f9f1708357ee5e7725", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 81, "avg_line_length": 38.333333333333336, "alnum_prop": 0.6717391304347826, "repo_name": "DiligentGraphics/DiligentCore", "id": "43b1b55a2730f89eb7bc44a3f6d6ca957444e1ca", ...
import numpy from PyQt5 import Qt class Property(property): """A convenience class for making properties that have a default value and a change Qt-signal. An example of a class with two Property attributes, with the default value of the "bar" Property depending on the value of "foo" (if .foo is None, .bar...
{ "content_hash": "0e1bfc44576460037187837e71ab89cd", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 146, "avg_line_length": 44.2, "alnum_prop": 0.6127320954907162, "repo_name": "erikhvatum/RisWidget", "id": "f1af8b532ed4a4f99a5d7d1613d12f989e20309a", "size": "7572", "b...
import os try: from setuptools import setup, find_packages except ImportError: from distutils.core import setup, find_packages VERSION = '0.10.0' PATH = os.path.dirname(os.path.abspath(__file__)) try: LONG_DESC = '\n===='+open(os.path.join(PATH, 'README.rst'), 'r').read().split('====', 1)[-1] except IOErro...
{ "content_hash": "59f7a384a90eadabaa394f1177cda0c3", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 96, "avg_line_length": 31.26923076923077, "alnum_prop": 0.5836408364083641, "repo_name": "zbyte64/django-hyperadmin", "id": "b88232f972e85542be5a2f384d0dbae4a2204181", "siz...
__revision__ = "test/MSVC/pch-basics.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog" """ Verify PCH works to build a simple exe and a simple dll. """ import time import TestSCons test = TestSCons.TestSCons(match = TestSCons.match_re) test.skip_if_not_msvc() test.write('Main.cpp', """\ #includ...
{ "content_hash": "096700125850f775ecd2581512affe03", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 97, "avg_line_length": 16.428571428571427, "alnum_prop": 0.6478260869565218, "repo_name": "EmanueleCannizzaro/scons", "id": "37effb10f8f1104b1947bef9b43d8bcfd5d51465", "siz...
from __future__ import division #for training part in classification from misc import partitionSampleByMetadatumValue from randomSampling import randomChoice import numpy as np from multiDimList import MultiDimList #@dataArray = [samplesInfoList,infoList,idSequences,sampleList,matchingNodes] #Computes classes accord...
{ "content_hash": "c3bd2374bad28f738640a99aed826f76", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 133, "avg_line_length": 47.67883211678832, "alnum_prop": 0.6722290263319045, "repo_name": "kuredatan/taxoclassifier", "id": "e1afeb65521ae1afa79a810d1fe4e3b56d86f35c", "si...
import os import sys import ray from ray.streaming import StreamingContext def test_union_stream(): ray.init(job_config=ray.job_config.JobConfig(code_search_path=sys.path)) ctx = StreamingContext.Builder() \ .option("streaming.metrics.reporters", "") \ .build() sink_file = "/tmp/test_unio...
{ "content_hash": "7d9acb8b6077f21476236800bf8ff0b9", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 76, "avg_line_length": 27.6875, "alnum_prop": 0.5568096313017307, "repo_name": "pcmoritz/ray-1", "id": "bab75e624ac00ea46e64b3020e0e5bfc5467847a", "size": "1329", "binary...
import uasyncio as asyncio from gui.core.lcd160_gui import Screen, IFont from gui.core.constants import * from gui.widgets.buttons import Button, RadioButtons from gui.widgets.label import Label from gui.widgets.textbox import Textbox import font10 import font6 font3 = IFont(3) from lcd_local import setup # **** ST...
{ "content_hash": "31a3c4b5cce46c615254c95bcbcb772c", "timestamp": "", "source": "github", "line_count": 169, "max_line_length": 104, "avg_line_length": 31.047337278106507, "alnum_prop": 0.5829998094149037, "repo_name": "peterhinch/micropython-lcd160cr-gui", "id": "b1840d995480cd84320b2b9efd85c2881e96...
''' -------------------------------------------------------------------- This file is part of the raster object recognition project. https://github.com/woodbri/raster-object-recognition MIT License. See LICENSE file for details. Copyright 2017, Stephen Woodbridge -------------------------------------...
{ "content_hash": "d52bd3b335ae990598e2dbb7db034806", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 149, "avg_line_length": 27.398058252427184, "alnum_prop": 0.5249822820694543, "repo_name": "woodbri/raster-object-recognition", "id": "10609b29df4b8ff696181425f3dd560320e0e9...
import logging import os import random import time from webkitpy.port.server_process import ServerProcess from webkitpy.port.driver import Driver _log = logging.getLogger(__name__) class WestonDriver(Driver): @staticmethod def check_driver(port): weston_found = port.host.executive.run_command(['whic...
{ "content_hash": "923af9c04dc64a780aadd88b7044ec2b", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 157, "avg_line_length": 44.333333333333336, "alnum_prop": 0.6655769859431186, "repo_name": "klim-iv/phantomjs-qt5", "id": "7fdffd3a12dbea92c74aa6c789c540bca8e0a0bd", "size"...
from __future__ import unicode_literals import pytest from .. import idfn, assert_eq, assert_in from rakuten_ws.compat import callable def assert_response(params, result, callback=None): assert 'error' not in result, result['error_description'] assert len(result['Items']) > 0 if callable(callback): ...
{ "content_hash": "6e6ed32681032627ec41c9137796e34e", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 115, "avg_line_length": 43.06730769230769, "alnum_prop": 0.6068318821165438, "repo_name": "alexandriagroup/rakuten-ws", "id": "4af43f4596e7d4975d189f0bb04365c37c0bf6fb", "...
""" Copyright (c) 2009 John Markus Bjoerndalen <jmb@cs.uit.no>, Brian Vinter <vinter@nbi.dk>, Rune M. Friborg <rune.m.friborg@gmail.com>. See LICENSE.txt for licensing details (MIT License). """ from pycsp_import import * # Based on the exercise q7.occ from the source distribution of kroc-1.4 # # This is an e...
{ "content_hash": "259274a08b74193d95cf53fce85178b3", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 114, "avg_line_length": 28.636363636363637, "alnum_prop": 0.5301587301587302, "repo_name": "runefriborg/pycsp", "id": "821a3e91e11d9af050b61e61ba42498e713f8e6a", "size": "2...
def linkEndFromDefCode(defCode): """ returns a Param representing the entry on a link into a NodeType. This allows the Nodes to have their own internal names for their inputs and outputs that are seperate from the names of Links. The types should match though! """ t=defCode.split() ...
{ "content_hash": "ab95eb5437aee81c0dca1c5a748dbd62", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 124, "avg_line_length": 32.04615384615385, "alnum_prop": 0.6178588574171867, "repo_name": "Craig-Macomber/Panda3D-Shader-Generator", "id": "723c81423d84ff79f86e8ea915557c3bfb...
import os import sys import contextlib import subprocess import argparse import smtplib from datetime import datetime def sendEmail(starttime, usr, pw, fromaddr, toaddr, i, idx_start, idx_end): """ Sends an email message through Gmail once the script is completed. Developed to be used with AWS so that i...
{ "content_hash": "76669ee09bd7d8335cdf2b6e82ac1660", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 134, "avg_line_length": 29.4, "alnum_prop": 0.6794217687074829, "repo_name": "ensley/thesis", "id": "bab727aaa98f3b2c81ebb28d5c85eece1eda5cec", "size": "2352", "binary": ...
import csv import os from os.path import join import sys filePath1 = str(sys.argv[1]) filePath2 = str(sys.argv[2]) filePath3 = str(sys.argv[3]) filePath4 = str(sys.argv[4]) assetDict = {} dupeDict = {} with open(filePath1, newline = '', encoding='utf-8') as f: assetData = csv.reader(f, dialect='excel', delimiter=',...
{ "content_hash": "163176c3158d0cbbe9fe66fbbd43995c", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 102, "avg_line_length": 35.12149532710281, "alnum_prop": 0.5231506120276743, "repo_name": "CarnegieHall/metadata-matching", "id": "68066f8c377c2e9e21dae67df8c07b11bdaea14e",...
"""Command-line flag library. Emulates gflags by wrapping cfg.ConfigOpts. The idea is to move fully to cfg eventually, and this wrapper is a stepping stone. """ import socket from oslo_config import cfg from oslo_log import log as logging from oslo_middleware import cors from jacket.common import config CONF = ...
{ "content_hash": "369bf32e4da3392410c167a7fc6204f3", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 76, "avg_line_length": 32.55357142857143, "alnum_prop": 0.4267690619857378, "repo_name": "HybridF5/jacket", "id": "c4a74b8aad79eb07dbd0ee686142a1c10402fa85", "size": "2613"...
import pytest from django.conf import settings from django_docutils.lib.fixtures.publisher import publish_post @pytest.mark.django_db(transaction=True) def test_publish_post_from_source_file(tmpdir): test_file = tmpdir.join("test.rst") test_file.write( """ === moo === :Author: anonymous :Slug_Id: t...
{ "content_hash": "136cf654df5c49cff48eff785e25a4db", "timestamp": "", "source": "github", "line_count": 380, "max_line_length": 84, "avg_line_length": 19.276315789473685, "alnum_prop": 0.4289419795221843, "repo_name": "tony/django-docutils", "id": "8261b8a7e5d8d714ebe891e7e177a6b79ebba7ae", "size":...
from robotide.lib.robot.errors import DataError from robotide.lib.robot.utils import (get_error_details, is_string, split_args_from_name_or_path, type_name, Importer) from .visitor import SuiteVisitor class ModelModifier(SuiteVisitor): def __init__(self, visitors, empty_suite_ok, logger...
{ "content_hash": "a21531a8c086c8eae6ac34d7aa5c9dc4", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 78, "avg_line_length": 39.78378378378378, "alnum_prop": 0.5652173913043478, "repo_name": "robotframework/RIDE", "id": "94c3c88503b33a67503e25e0ff4558eff5b557a1", "size": "2...
from collections import OrderedDict from django import template from django.db import models from django.db.models import Q from tola.util import getCountry from indicators.models import Indicator from workflow.models import Program, Country register = template.Library() @register.inclusion_tag('workflow/tags/progr...
{ "content_hash": "3467ec0d3bbb74a30c3bb4d1da180eb2", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 100, "avg_line_length": 37.955555555555556, "alnum_prop": 0.6715456674473068, "repo_name": "mercycorps/TolaActivity", "id": "9b91d0c8c48bfe252d750955da84d19b1f422700", "siz...
"""Provide a (g)dbm-compatible interface to bsdhash.hashopen.""" import bsddb error = bsddb.error # Exported for anydbm def open(file, flag, mode=0666): return bsddb.hashopen(file, flag, mode)
{ "content_hash": "db7d2d49a2f954d6285af5e08524a137", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 64, "avg_line_length": 27.5, "alnum_prop": 0.6590909090909091, "repo_name": "MalloyPower/parsing-python", "id": "ff51630bb338eac23ac4ee3a4f240be6e6563a83", "size": "220", ...
"""Test flash_air_music.setup_logging functions/classes.""" import logging import logging.handlers import time from io import StringIO import pytest from flash_air_music import setup_logging @pytest.mark.parametrize('mode', ['', 'rem file', 'bad file', 'dup file', 'rem con', 'bad con', 'dup out', 'dup err']) def t...
{ "content_hash": "4847a108074c8cba1c943019d7adf5f2", "timestamp": "", "source": "github", "line_count": 199, "max_line_length": 118, "avg_line_length": 32.28643216080402, "alnum_prop": 0.6314396887159534, "repo_name": "Robpol86/FlashAirMusic", "id": "c9d11fc7367a2f76ca2d6cd9b4757f270f8022de", "size...
from django.conf.urls import include from django.contrib import admin from django.urls import path, reverse_lazy from django.views.generic import RedirectView urlpatterns = [ path(r'^$', RedirectView.as_view( url=reverse_lazy('list_index'), permanent=True)), path(r'postorius/', include('postori...
{ "content_hash": "04882c06f25d6bb38f4880a1171bfcce", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 51, "avg_line_length": 32.6, "alnum_prop": 0.6809815950920245, "repo_name": "maxking/docker-mailman", "id": "6a9bbafc2c4c01dae0c27656c3fe2e6f2d2d6e5b", "size": "1241", "b...
import imp import sys import os import unittest import subprocess from test import test_support # This little helper class is essential for testing pdb under doctest. from test_doctest import _FakeInput class PdbTestInput(object): """Context manager that makes testing Pdb in doctests easier.""" def __init__...
{ "content_hash": "cd9245d10a038f6daa8bf01589fd7c62", "timestamp": "", "source": "github", "line_count": 313, "max_line_length": 92, "avg_line_length": 30.4185303514377, "alnum_prop": 0.5799810944228547, "repo_name": "azoft-dev-team/imagrium", "id": "bd1ae508e7b0584fee25d7d10a4bf5383549c4b9", "size"...
"""Tests for TPUEstimator with model parallelism.""" from absl import flags import numpy as np import tensorflow as tf from tensorflow.python.tpu import tpu_feed from tensorflow.python.tpu.device_assignment import device_assignment from tensorflow.python.tpu.topology import Topology from tensorflow.python.training imp...
{ "content_hash": "c2c2a0a75fba52f0f2769fed97c02160", "timestamp": "", "source": "github", "line_count": 362, "max_line_length": 89, "avg_line_length": 35.693370165745854, "alnum_prop": 0.6568377060599024, "repo_name": "tensorflow/estimator", "id": "d276004b329cd4713d405ad3c42c3f7c3c2c37bc", "size":...
from cloudferry_devlab.tests import test_exceptions class Blacklisted(object): def __init__(self, config, glanceclient): self.config = config self.glanceclient = glanceclient def get_blacklisted_img_ids(self): """Get Blacklisted Image IDs.""" blacklisted_img_ids = [] ...
{ "content_hash": "2ae9ed10fadf939030cee8b6af8435a3", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 77, "avg_line_length": 35.42857142857143, "alnum_prop": 0.5556451612903226, "repo_name": "SVilgelm/CloudFerry", "id": "a1863cd66f3a2a07f76281ea7c7e814fe9b0652a", "size": "1...
from .Code import SExpression, Atom, StringLiteral, Syntax from .Closure import Closure from .SymbolTable import SymbolTable from .Continuation import ( TopCont, IfCont, SeqCont, DefineCont, TryCont, LetCont, ForCont, UnaryOpCont, BinaryOpCont, TernaryOpCont, Ambi1OpCont, ...
{ "content_hash": "a6e79b15cfd0980f0ac0ba10452c4c72", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 122, "avg_line_length": 45.38970588235294, "alnum_prop": 0.4994330147416167, "repo_name": "SRI-CSL/PLambda", "id": "eaec4e39b224fe68c8ee144fb85a93cd00c22a27", "size": "617...
import json import os import sys from multiprocessing.dummy import Pool as ThreadPool from typing import Iterable, Optional from license_grep.deduction import deduce_license_from_dir from license_grep.models import PackageInfo from license_grep.utils import is_excluded_dir def find_js_manifests(base_path): for p...
{ "content_hash": "677d4ec91811d48311bff2e1cf33af84", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 114, "avg_line_length": 36.35632183908046, "alnum_prop": 0.5940562756876383, "repo_name": "akx/license-grep", "id": "671eb4018d3d2982fef5c287dce5ce7faa38d40f", "size": "316...
import os from django.conf import settings from __future__ import absolute_import, unicode_literals from celery import shared_task from celery.task.schedules import crontab from celery.decorators import periodic_task from celery.utils.log import get_task_logger logger = get_task_logger(__name__) @periodic_task(run_ev...
{ "content_hash": "ca8d28785db037d49e63d5f2caf2dec9", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 92, "avg_line_length": 34.0625, "alnum_prop": 0.7651376146788991, "repo_name": "Yeasayer/YoutubeVideoPage", "id": "e793a4129d4f04317f93ed9b215707aa47dd86bc", "size": "545",...
r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource ...
{ "content_hash": "b33c2800c4a30c9b44817f50b47380e3", "timestamp": "", "source": "github", "line_count": 526, "max_line_length": 107, "avg_line_length": 34.14448669201521, "alnum_prop": 0.6284521158129176, "repo_name": "twilio/twilio-python", "id": "ae5c09614fb6e23bdea81a899a298cee4a782d6e", "size":...
''' The following code requires python-stix v1.1.0.4 or greater installed. For installation instructions, please refer to https://github.com/STIXProject/python-stix. ''' from stix.core import STIXPackage from stix.exploit_target import ExploitTarget,Vulnerability def main(): pkg = STIXPackage() vuln = Vulner...
{ "content_hash": "2448e072fef1ce004016f158cae2b8aa", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 90, "avg_line_length": 24.91304347826087, "alnum_prop": 0.68760907504363, "repo_name": "johnwunder/johnwunder.github.io", "id": "c4a1dd7744e3e0dbfc183a680fd539afd3a4afd2", ...
from hidparser.Item import ItemType, Item from hidparser.enums import CollectionType, ReportFlags, ReportType from hidparser.DeviceBuilder import DeviceBuilder class InputItem(Item): flags = None # type: ReportFlags def visit(self, descriptor: DeviceBuilder): descriptor.add_report(ReportType.INPUT, s...
{ "content_hash": "59f12682e22880681ed81c1d3009283a", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 83, "avg_line_length": 25.053571428571427, "alnum_prop": 0.6261582323592302, "repo_name": "NZSmartie/PyHIDParser", "id": "4fca8ce70dc07e62e2403d378336236e4d51b2cc", "size"...
""" Django settings for forocacao project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ from __future__ import absolute_import, unicode_literals import environ ...
{ "content_hash": "f68f55184298ff9c640aaa978576262f", "timestamp": "", "source": "github", "line_count": 301, "max_line_length": 127, "avg_line_length": 35.63787375415282, "alnum_prop": 0.6087442901090706, "repo_name": "javierwilson/resilienciacafe", "id": "222ce3458cf598fb299386ec4703fb35f7475928", ...
import logging import sys import subprocess from threading import Thread import time import fcntl import os from socketio.namespace import BaseNamespace from socketio.mixins import RoomsMixin, BroadcastMixin from socketio.sdjango import namespace from views import get_fabfile_path, fabric_special_options from fabric_...
{ "content_hash": "d61a7bb89f46d5847be87e79ef096f02", "timestamp": "", "source": "github", "line_count": 122, "max_line_length": 134, "avg_line_length": 32.68852459016394, "alnum_prop": 0.6176028084252758, "repo_name": "Hedde/fabric-bolt", "id": "49c626a1bbaa08a0d9bc80537bd5584206afe8a6", "size": "3...
""" kombu.messaging =============== Sending and receiving messages. """ from __future__ import absolute_import from itertools import count from .compression import compress from .connection import maybe_channel, is_connection from .entity import Exchange, Queue, DELIVERY_MODES from .five import int_types, text_t, v...
{ "content_hash": "aceb94e1a9172de119bbf80744576dc5", "timestamp": "", "source": "github", "line_count": 556, "max_line_length": 78, "avg_line_length": 35.92805755395683, "alnum_prop": 0.6190929114937925, "repo_name": "mathom/kombu", "id": "c1e0f7decca692a144bc36d271e7a8fb4581056a", "size": "19976",...
import names import random names_list = [] #generate a list of random names print "sender, receiver, num_texts_sent" for i in range(1,31): names_list.append(names.get_full_name()) #remove duplicates unique_names = set(names_list) senders_names = [] for name in unique_names: senders_names.append(name) r...
{ "content_hash": "baee8fb1418b59a13d3a1ebd0086e878", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 76, "avg_line_length": 26.52173913043478, "alnum_prop": 0.6311475409836066, "repo_name": "rajivjk/data.scripts", "id": "a54a8ec49e5b02cd343d7c45d99a2193b0bb9f7f", "size": "...
import re import shlex import threading import time from oslo_log import log as logging from oslo_service import loopingcall from oslo_utils import excutils from oslo_utils import units import six from cinder import exception from cinder import utils from cinder.volume.drivers.hitachi import hbsd_basiclib as basic_li...
{ "content_hash": "fcbc545dd0a4c960e5d83d4ce8c54da4", "timestamp": "", "source": "github", "line_count": 1140, "max_line_length": 79, "avg_line_length": 37.73508771929824, "alnum_prop": 0.48637779534148495, "repo_name": "eharney/cinder", "id": "14a9905791cb222b99ac84a20a28b67edeed746c", "size": "436...
from cms.api import add_plugin from cms.utils.copy_plugins import copy_plugins_to from cms.utils.plugins import downcast_plugins from copy import deepcopy from django.contrib import admin from django.contrib.auth.models import AnonymousUser from django.contrib.messages.middleware import MessageMiddleware from django.co...
{ "content_hash": "88f027b2b887316ca09671c4d26dc104", "timestamp": "", "source": "github", "line_count": 316, "max_line_length": 114, "avg_line_length": 46.37658227848101, "alnum_prop": 0.6060047765267826, "repo_name": "DjangoBeer/djangocms-blog", "id": "a06fbda98302d6f335143519a3b6bb025a764d39", "s...
from __future__ import absolute_import, print_function, unicode_literals import argparse import sys from thesis.processors import SemevalTrainCorpusReader, SemevalTestCorpusReader from tqdm import tqdm if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("corpus", ...
{ "content_hash": "09efccad02a8ab5d83b669b0dee57fc0", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 87, "avg_line_length": 36.11363636363637, "alnum_prop": 0.632473253618628, "repo_name": "crscardellino/thesis", "id": "d95c44af65b4c19870b19636df2bece5fa00233e", "size": "1...
""" Example use: cat ls_data.csv | python3 linear_search_recursive.py > lsr.csv """ import sys sys.path.append('..') from util import benchmark_search, test_search alg = "linear_search" kind = "recursive" def linear_search(arr, x): return linear_search_rec(arr, 0, x) def linear_search_rec(arr, cur, x): if c...
{ "content_hash": "72bbdc500f0f83684a2432b66802de4f", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 62, "avg_line_length": 22.037037037037038, "alnum_prop": 0.5983193277310924, "repo_name": "kraemerd17/algorithm-benchmarking-analysis", "id": "b2aac7ca0aab7ac2efd916be2c42527...
__author__ = 'phoetrymaster' import os
{ "content_hash": "ad4513359d51d6c5783e9e5ebf22166d", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 28, "avg_line_length": 7.166666666666667, "alnum_prop": 0.627906976744186, "repo_name": "jkeifer/pyHytemporal", "id": "477840cdbf3376226430a608c4fd72dac99893b9", "size": "43...
""" test_transifex ~~~~~~~~~~~~~~ Test functions that implements transifex related features. :copyright: Copyright 2019 by Takayuki SHIMIZUKAWA. :license: BSD, see LICENSE for details. """ import re from textwrap import dedent import pytest from sphinx_intl import transifex def test_create_tra...
{ "content_hash": "6dd710d438556f45e94d197f00b47c1c", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 97, "avg_line_length": 30.827067669172934, "alnum_prop": 0.631219512195122, "repo_name": "sphinx-doc/sphinx-intl", "id": "7ae93f380737543a6d6e55454a34ab1c0eb8b755", "size"...
"""Test suite for XenAPI.""" import ast import base64 import contextlib import copy import functools import mox import os import re import mock import mox from oslo.config import cfg from nova.compute import api as compute_api from nova.compute import flavors from nova.compute import power_state from nova.compute im...
{ "content_hash": "b3cd0d7a3c2d5a3ebeab4aa1e4b45fb5", "timestamp": "", "source": "github", "line_count": 4041, "max_line_length": 79, "avg_line_length": 42.33754021281861, "alnum_prop": 0.5632255123154437, "repo_name": "ycl2045/nova-master", "id": "61ecbdd4b35ad4bc6276fe3c4972a7f5d3105dde", "size": ...
import collections import contextlib import os import re import shlex import shutil import string import subprocess import textwrap from bloggertool.str_util import Template, NamespaceFormatter class Executor(object): def __init__(self, blog_cmd, regr_folder): self.blog_cmd = blog_cmd self.regr_f...
{ "content_hash": "19418c5b24dacc32b4f04b2bc7ffd2a7", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 79, "avg_line_length": 28.728070175438596, "alnum_prop": 0.5383206106870229, "repo_name": "asvetlov/bloggertool", "id": "ceade30a41594daf1d8852a5e1de668f476912c7", "size":...
""" Run Regression Test Suite This module calls down into individual test cases via subprocess. It will forward all unrecognized arguments onto the individual test scripts, other than: - `-extended`: run the "extended" test suite in addition to the basic one. - `-win`: signal that this is running in a Windows...
{ "content_hash": "0b08801def1aabb96f72c499a81ec489", "timestamp": "", "source": "github", "line_count": 346, "max_line_length": 133, "avg_line_length": 32.115606936416185, "alnum_prop": 0.5971022318214543, "repo_name": "martindale/elements", "id": "4631983e8a581a58c3ea772d6f23cb66123790d4", "size":...
from .clientInterface import generate_address from .clientInterface import generate_transaction from .clientInterface import send_transaction from .client import EsseClient
{ "content_hash": "34d493f22600a47dd949ea200ba0c175", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 49, "avg_line_length": 43, "alnum_prop": 0.872093023255814, "repo_name": "DigitalHills/Esse", "id": "5f2958fccd1dffd3c41c342c14f48482152294b3", "size": "173", "binary": fa...
import threading from subprocess import Popen, PIPE import time, datetime import shlex import uuid import json import collections import urllib2, urllib from os.path import expanduser from reporting.parsers import MatchParser, SplitParser, DummyParser, JsonGrepParser from reporting.utilities import getLogger, get_host...
{ "content_hash": "913bad62943c3bfd46da827446222e47", "timestamp": "", "source": "github", "line_count": 244, "max_line_length": 133, "avg_line_length": 43.59426229508197, "alnum_prop": 0.5387797311271976, "repo_name": "eResearchSA/reporting-producers", "id": "9da7dea09845df5e5f16843bab9be2586a76b8b5"...
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'migration_manager_test.views.home', name='home'), # url(r'^migration_manager_test/', includ...
{ "content_hash": "dbd2de29611ff4a9c4b0df9af99bdfdc", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 83, "avg_line_length": 35.529411764705884, "alnum_prop": 0.6920529801324503, "repo_name": "jbzdak/migration_manager", "id": "39da74324634f6fe1588c084aa6c9f09b1b8e886", "siz...
"""Implements vlans, bridges, and iptables rules using linux utilities.""" import calendar import inspect import netaddr import os from nova import db from nova import exception from nova import flags from nova import log as logging from nova import utils LOG = logging.getLogger("nova.linux_net") def _bin_file(sc...
{ "content_hash": "6966c85c98818417180ac44280933905", "timestamp": "", "source": "github", "line_count": 985, "max_line_length": 79, "avg_line_length": 38.4497461928934, "alnum_prop": 0.537902991577113, "repo_name": "xushiwei/nova", "id": "712db32dbc8d8501678023ad22323996d09f57ed", "size": "38650", ...
import collections import functools import json import os import sys import time import traceback import uuid from django import http from django.core.exceptions import PermissionDenied from django.core.files.storage import default_storage as storage from django.conf import settings from django import forms as django_...
{ "content_hash": "d08f05052f7eeda7ee9d8e9e7d2eaa7d", "timestamp": "", "source": "github", "line_count": 1818, "max_line_length": 79, "avg_line_length": 38.200770077007704, "alnum_prop": 0.5979207763970683, "repo_name": "robhudson/zamboni", "id": "731dfbee3e0473e99d9ed58f534b798f29b96250", "size": "...
from __future__ import unicode_literals import re from django.core.exceptions import FieldDoesNotExist from django.db.models.constants import LOOKUP_SEP from django.db.models.expressions import Col, Expression from django.db.models.lookups import Lookup from django.utils import six gis_lookups = {} cl...
{ "content_hash": "b435b3aa6496d1cc74121c24e947c2a6", "timestamp": "", "source": "github", "line_count": 355, "max_line_length": 98, "avg_line_length": 33.42535211267606, "alnum_prop": 0.6400640485420529, "repo_name": "yephper/django", "id": "d00d457629b4ca09dbdc67ea53b9435e9a8e03e9", "size": "11866...
"""Tools for deserializing `Function`s.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import re from tensorflow.core.framework import function_pb2 from tensorflow.python.eager import def_function from tensorflow.python.eager import ...
{ "content_hash": "404ca6de3984f751b3fe351c93471749", "timestamp": "", "source": "github", "line_count": 402, "max_line_length": 108, "avg_line_length": 39.524875621890544, "alnum_prop": 0.7107432815155139, "repo_name": "alsrgv/tensorflow", "id": "1993babfb3cec16f3bb5c38d05357ed8ede12a54", "size": "...
""" __ExitPoint.py_____________________________________________________ Automatically generated AToM3 syntactic object (DO NOT MODIFY DIRECTLY) Author: gehan Modified: Sat Aug 30 18:23:40 2014 ___________________________________________________________________ """ from ASGNode import * from ATOM3Type import * from A...
{ "content_hash": "341e29414ac91da6260e619524752e0d", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 189, "avg_line_length": 40.78378378378378, "alnum_prop": 0.5681466755025403, "repo_name": "levilucio/SyVOLT", "id": "d814647bf71693aee93a5920d9f38f9d13775ee5", "size": "45...
import os, sys, re from Bio import SeqIO from Bio.SeqIO.QualityIO import PairedFastaQualIterator from optparse import OptionParser def read_midfile(midfile): # Here we read in the mid tagfile. The expected format is # mid-name in col1, mid in col2, the rest is not used fh = open(midfile, "r") mids = {...
{ "content_hash": "00678cfce39403e0736e29d09a1d14de", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 106, "avg_line_length": 39.645161290322584, "alnum_prop": 0.609113100081367, "repo_name": "karinlag/karinlag_utils", "id": "74bfec74d2fd99f1d3ed8983665acc3c6b5351dc", "siz...
''' Extract _("...") strings for translation and convert to Qt stringdefs so that they can be picked up by Qt linguist. ''' from __future__ import division,print_function,unicode_literals from subprocess import Popen, PIPE import operator import os import sys OUT_CPP="qt/trollcoinstrings.cpp" EMPTY=['""'] def parse_p...
{ "content_hash": "c54885e9860b10dcd8736112efa81ab3", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 108, "avg_line_length": 29.50588235294118, "alnum_prop": 0.6124401913875598, "repo_name": "gautes/TrollCoinCore", "id": "62e356dc14d51c1175ea07d8a259f9a743bcdd47", "size": ...
import _plotly_utils.basevalidators class ColoraxisValidator(_plotly_utils.basevalidators.SubplotidValidator): def __init__( self, plotly_name="coloraxis", parent_name="scattergl.marker.line", **kwargs ): super(ColoraxisValidator, self).__init__( plotly_name=plotly_name, ...
{ "content_hash": "463d59e027ad20d520bee9ba6481f212", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 84, "avg_line_length": 36.86666666666667, "alnum_prop": 0.5840867992766727, "repo_name": "plotly/plotly.py", "id": "3b9952080bcd87b6e06c03f1cfd773f320cf6d12", "size": "553"...
import numpy as np import pytest import umap # Globals, used for all the tests SEED = 189212 # 0b101110001100011100 np.random.seed(SEED) try: from umap import plot IMPORT_PLOT = True except ImportError: IMPORT_PLOT = False plot_only = pytest.mark.skipif(not IMPORT_PLOT, reason="umap plot not found.") ...
{ "content_hash": "e73f22aca5ca20fea247afed99735e02", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 87, "avg_line_length": 36.12, "alnum_prop": 0.7347729789590255, "repo_name": "lmcinnes/umap", "id": "effcbc1054c9944eaa44ca4854db2ee74edc37ee", "size": "1806", "binary": ...
from aiocache.plugins import BasePlugin from collections import deque class LRUPlugin(BasePlugin): """ Implements a Least Recently Used policy with max_keys. The policy does the following: - When a key is retrieved get, keys are moved to the beginning of the queue - When a key is added (set), ...
{ "content_hash": "c669f33d54762a7bda0d98d893142100", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 97, "avg_line_length": 42.357142857142854, "alnum_prop": 0.6278808319280494, "repo_name": "dpanin/lesson-rest", "id": "c1a5799e05b0eaad496e746f1aa6658d5d49a498", "size": "1...