text
stringlengths
4
1.02M
meta
dict
from xd.tool.os import * from case import * import unittest import os import tempfile class tests(TestCase): def setUp(self): super(tests, self).setUp() self.cwd = self.restore['cwd'] os.chdir(self.cwd) def test_pushd(self): self.assertEqual(os.getcwd(), self.cwd) wi...
{ "content_hash": "55d7dc854ce4fba8cafe1ea2524fb82d", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 68, "avg_line_length": 32.10344827586207, "alnum_prop": 0.5848549946294307, "repo_name": "esben/xd-tool", "id": "8c0bdb7f41aa95d9508a39c31419d3cc97396cd5", "size": "1862", ...
""" Mutated Conway rules. One random gene of each cell mutated. Maze-like structures growing, then devoured by the 'sea', from where crystalline landscape begin to form. """ import numpy as np import random DEATH_SPEED = 1 BIRTH_COST = 3 MAX_GENES = 14 FIELD_WIDTH = 1280 FIELD_HEIGHT = 720 SAVE_FRAMES = False DOWNS...
{ "content_hash": "21fd0c5051a7519894f40c7f17e40b00", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 182, "avg_line_length": 30.48, "alnum_prop": 0.6824146981627297, "repo_name": "a5kin/evolife", "id": "974c65393b26963d7ac72a5a9490447c27136c86", "size": "762", "binary": ...
from spindrift.database.dao import DAO from spindrift.database.field import Field, coerce_int class Parent(DAO): TABLENAME = 'parent' id = Field(coerce_int, is_primary=True) foo = Field(coerce_int) bar = Field(coerce_int, is_nullable=True) def test_save(db): def on_save(rc, result): a...
{ "content_hash": "57d4e7fb0e53d372503b987138277fdd", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 64, "avg_line_length": 20.93069306930693, "alnum_prop": 0.5860927152317881, "repo_name": "robertchase/spindrift", "id": "750e980226cd0c6c5815f25e7056eb281af31371", "size":...
import os from enum import Enum, auto from .gn import GnBuilder class Cyw30739App(Enum): LIGHT = auto() LOCK = auto() OTA_REQUESTOR = auto() def ExampleName(self): if self == Cyw30739App.LIGHT: return "lighting-app" elif self == Cyw30739App.LOCK: return "lock-...
{ "content_hash": "cfffe9799f173f7b535f275e0f4e1766", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 77, "avg_line_length": 27.9873417721519, "alnum_prop": 0.5843509724106739, "repo_name": "nestlabs/connectedhomeip", "id": "5d4470fef1753540877ee6103fef421ca6feb106", "size"...
from trove.common.views import create_links from trove.common import cfg CONF = cfg.CONF class FlavorView(object): def __init__(self, flavor, req=None): self.flavor = flavor self.req = req def data(self): # If the flavor id cannot be cast to an int, we simply return # no id...
{ "content_hash": "e884e075c464ba49cf4aa26899767466", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 77, "avg_line_length": 26.037735849056602, "alnum_prop": 0.5572463768115942, "repo_name": "daizhengy/RDS", "id": "88ba141608a890082751cd2f0a3c189e71a15e28", "size": "2022",...
import datetime import uuid from oslo_serialization import jsonutils from oslo_utils import netutils from oslo_utils import timeutils import routes import six from six.moves import range import webob import webob.dec import webob.request from nova.api import auth as api_auth from nova.api import openstack as openstac...
{ "content_hash": "c9a66a62101253e5df636cd8ed5d62ff", "timestamp": "", "source": "github", "line_count": 708, "max_line_length": 79, "avg_line_length": 32.76836158192091, "alnum_prop": 0.5853879310344827, "repo_name": "devendermishrajio/nova_test_latest", "id": "a56228cd8d9dc4b7f8f4e97448e1af7f4a5839e...
''' unit tests for conary facade ''' from rbuild_test import rbuildhelp from testutils import mock import os from rbuild.facade import conaryfacade from rbuild import errors from conary import conarycfg from conary import conaryclient from conary import checkin from conary import errors as conaryerrors from conary ...
{ "content_hash": "3106ed76bed3ce6c2cdb0144d8659889", "timestamp": "", "source": "github", "line_count": 1065, "max_line_length": 91, "avg_line_length": 44.15023474178404, "alnum_prop": 0.612292641429179, "repo_name": "sassoftware/rbuild", "id": "e79f86c4d3168f1fdc698f5f91eaedcd70cb4947", "size": "4...
"""Fichier contenant le module primaire salle.""" from math import sqrt import re from random import random, randint from datetime import datetime from abstraits.module import * from primaires.format.fonctions import format_nb, supprimer_accents from primaires.vehicule.vecteur import Vecteur from .bonhomme_neige impo...
{ "content_hash": "e7850dbbb3c543dcfe446cca1c9fa09e", "timestamp": "", "source": "github", "line_count": 905, "max_line_length": 80, "avg_line_length": 37.392265193370164, "alnum_prop": 0.5745271867612293, "repo_name": "stormi/tsunami", "id": "58c26b13e2ee0045c7229ccd43a64eee71367695", "size": "3559...
"""y/Page is a enterprise-grade y/OS runtime"""
{ "content_hash": "9ee734b9ddd3a089f96ebbe318942d55", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 47, "avg_line_length": 47, "alnum_prop": 0.7021276595744681, "repo_name": "piotrmaslanka/systemy", "id": "0f8949fcc74c4e96b8a62ad027b650f06f151b20", "size": "47", "binary"...
import logging from appengine_django.db.base import DatabaseWrapper from appengine_django.db.base import destroy_datastore from appengine_django.db.base import get_test_datastore_paths def create_test_db(*args, **kw): """Destroys the test datastore. A new store will be recreated on demand""" destroy_test_db() ...
{ "content_hash": "6a4e6a4309982073c4ab4440c0d05b64", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 76, "avg_line_length": 32.55, "alnum_prop": 0.7572964669738863, "repo_name": "pfeilbr/qik", "id": "18e669a17d4d904f17fc5a6f0b51ab186a145da3", "size": "1251", "binary": fa...
__author__ = 'Dima Potekihin' class DotNetSystemLib(object): def __init__(self, name, framework): self._name = name self._framework = framework @property def name(self): return self._name @property def framework(self): return self._framework
{ "content_hash": "43ace19f073e59444fa882b7c7595b12", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 40, "avg_line_length": 19.866666666666667, "alnum_prop": 0.6006711409395973, "repo_name": "open-epicycle/epicycle.derkonfigurator-py", "id": "5d125a378762062d2471f78b19f5b9da...
import pytest from unittest import mock import io import json import time import hashlib import furl import aiohttp import aiohttp.multidict import aiohttpretty from waterbutler.core import streams from waterbutler.core import exceptions from waterbutler.core.path import WaterButlerPath from waterbutler.providers....
{ "content_hash": "4aac8afcd20b609352f2f67a6b5e0753", "timestamp": "", "source": "github", "line_count": 552, "max_line_length": 123, "avg_line_length": 33.833333333333336, "alnum_prop": 0.5980938102377382, "repo_name": "chrisseto/waterbutler", "id": "b6b3d14deb334c0208be81d9c63d08d300206b8f", "size...
import os import pprint import json from google.appengine.api import memcache from google.appengine.api import mail from google.appengine.api import urlfetch from google.appengine.ext import db pprint.pprint(os.environ.copy()) from github.models import GithubWebhook for i in range(10): dictionnary = { '...
{ "content_hash": "c3ab92c4ed50d86f16c0e1adb1d396be", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 121, "avg_line_length": 28.714285714285715, "alnum_prop": 0.6616915422885572, "repo_name": "ThomasMarcel/selection-naturelle", "id": "d1e4c5428c43050613c88e69d79bee0daebac34f...
"""Matplotlib style system. See the main style user's guide for more information. """ __version__ = "$Revision: #1 $" #=========================================================================== from .MplStyle import MplStyle from .MplSubStyle import MplSubStyle from .MplStyleManager import MplStyleManager # Sub-St...
{ "content_hash": "c74d39f3cd139c534dc721204c76d979", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 76, "avg_line_length": 29.59375, "alnum_prop": 0.6906019007391764, "repo_name": "nasa/mplStyle", "id": "64647dbceb2ad71ed6617224d03d03e012d01a2b", "size": "2749", "binary...
"""Cover for Shelly.""" from __future__ import annotations from typing import Any, cast from aioshelly import Block from homeassistant.components.cover import ( ATTR_POSITION, DEVICE_CLASS_SHUTTER, SUPPORT_CLOSE, SUPPORT_OPEN, SUPPORT_SET_POSITION, SUPPORT_STOP, CoverEntity, ) from homeas...
{ "content_hash": "25e70d5a9cd74c90d77a893049ce2fad", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 83, "avg_line_length": 32.63247863247863, "alnum_prop": 0.642744892613934, "repo_name": "Danielhiversen/home-assistant", "id": "73b8b1baae3585be476ebbaf8a01868ab8b71447", ...
import numpy import math execfile(os.path.join(os.path.dirname(__file__), 'rotations.py')) addPlot(timeWindow=15, yLimits=[-1, 1]) addSignal('EST_ROBOT_STATE', msg.utime, msg.force_torque.l_foot_force_z) addSignal('EST_ROBOT_STATE', msg.utime, msg.force_torque.r_foot_force_z) addPlot(timeWindow=15, yLimits=[-1, 1]) ...
{ "content_hash": "40120e2d67e7bc7ead4c5e8c53550c9e", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 73, "avg_line_length": 36.411764705882355, "alnum_prop": 0.7382875605815832, "repo_name": "openhumanoids/oh-distro", "id": "58d6c675721394f87ea83dec7f75d89424ab469b", "size...
import demistomock as demisto # noqa: F401 from CommonServerPython import * # noqa: F401 def test_module(client) -> str: result = client._http_request('GET', '/usage') if result: return 'ok' else: return 'Test failed: ' + str(result) def run_command(client, data: Dict[str, str], endpoi...
{ "content_hash": "9b3b2179505f84d59b6f7d78ca0d47d7", "timestamp": "", "source": "github", "line_count": 85, "max_line_length": 103, "avg_line_length": 38.88235294117647, "alnum_prop": 0.6033282904689864, "repo_name": "demisto/content", "id": "48b50d806492d4fceaed0b239087fa6cf6681d10", "size": "3305...
""" Sample from low-discrepancy sequences. """ # future imports from __future__ import division from __future__ import absolute_import from __future__ import print_function # local imports from ._sobol import i4_sobol_generate # global imports import numpy as np # exported symbols __all__ = ['rstate', 'uniform', 'l...
{ "content_hash": "00be3048bf3180dbf942ef14e1313cdc", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 79, "avg_line_length": 27.69158878504673, "alnum_prop": 0.6176172797840027, "repo_name": "mwhoffman/mwhutils", "id": "c445b3e85a35080ab23d16273c4b420bbf778873", "size": "2...
from django.shortcuts import render, get_object_or_404 from django.contrib.auth.decorators import login_required from django.http import HttpResponseRedirect from django.utils import timezone from django.contrib import messages from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.views i...
{ "content_hash": "ee5187328ef3da7b4b8a248f652e7604", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 160, "avg_line_length": 40.955882352941174, "alnum_prop": 0.5870736086175943, "repo_name": "mattr555/AtYourService", "id": "d96edbc10f7b31cc3eac72bc60f6ec00f8d15dfb", "siz...
from __future__ import unicode_literals from .common import InfoExtractor class EbaumsWorldIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?ebaumsworld\.com/videos/[^/]+/(?P<id>\d+)' _TEST = { 'url': 'http://www.ebaumsworld.com/videos/a-giant-python-opens-the-door/83367677/', 'info_dict'...
{ "content_hash": "65bca6347810b6ea962bd8572d00266f", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 91, "avg_line_length": 32.90909090909091, "alnum_prop": 0.5377532228360957, "repo_name": "lodemo/CATANA", "id": "c97682cd367edebfd9fc6a476ad073cb03240054", "size": "1086", ...
import pygame from pygame.locals import * import button from consts import * class MessageBox(object): def __init__(self, surface, MenuInfo): self.surface = surface self.colour = MenuInfo['colour1'] self.light_colour = MenuInfo['colour2'] self.caption = MenuInfo['caption'] ...
{ "content_hash": "5d717f914e42196de77975bf15686099", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 79, "avg_line_length": 35.20754716981132, "alnum_prop": 0.5385852090032154, "repo_name": "FireBl0w/breakout-clone", "id": "f6993afb66bb8116ab6e3dfc2351925f2799d686", "size...
import os import sys sys.path.append("../../../../") import swhlab import matplotlib.pyplot as plt import matplotlib.mlab as mlab import numpy as np import time class ABF2(swhlab.ABF): def phasicTonic(self,m1=None,m2=None,chunkMs=50,quietPercentile=10, histResolution=.5,plotToo=False,rmsExpect...
{ "content_hash": "36befa587426c55256ed321b1ad27f70", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 88, "avg_line_length": 39.208333333333336, "alnum_prop": 0.6331030818278427, "repo_name": "swharden/SWHLab", "id": "4d16505039e1c4e10ab702fc1687767fc31fc1cf", "size": "3764...
from actstream.actions import follow, unfollow from actstream.models import Follow from django.conf import settings from django.contrib.auth import get_user_model from django.contrib.auth.models import Group from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ObjectDoesNotExist...
{ "content_hash": "b132695301a6a0507189880832d5158a", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 80, "avg_line_length": 37.87564766839378, "alnum_prop": 0.6493844049247606, "repo_name": "comic/comic-django", "id": "62139393168f2d911a4d8d7d4a5504b9fe64a809", "size": "7...
""" WSGI config for lakalici project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lakalici.settings") from django.core...
{ "content_hash": "80bab2191feab93553e51323e26ebe1d", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 27.928571428571427, "alnum_prop": 0.7749360613810742, "repo_name": "yeleman/lakalici", "id": "032e21141de741445cb0b68b5f774ccbb49a312f", "size": "391...
from django.core.urlresolvers import reverse from django.conf.urls import url, include from django.views.generic import ( CreateView, DeleteView, DetailView, ListView, UpdateView, ) from django.forms.models import model_to_dict class DedalGenericTemplatesMixin(object): def get_template_names(s...
{ "content_hash": "92743e526a268f4cca128d38171c4874", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 80, "avg_line_length": 29.717241379310344, "alnum_prop": 0.5223949872360176, "repo_name": "vi4m/django-dedal", "id": "218630413d9521a61f93f57e8e5501ec9357a6d5", "size": "4...
from direct.directnotify import DirectNotifyGlobal from direct.distributed.DistributedObjectAI import DistributedObjectAI from direct.distributed.ClockDelta import globalClockDelta import time class TimeManagerAI(DistributedObjectAI): notify = DirectNotifyGlobal.directNotify.newCategory("TimeManagerAI") def r...
{ "content_hash": "224203ba195b5a27dc21e15471d68443", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 161, "avg_line_length": 36.30952380952381, "alnum_prop": 0.6649180327868852, "repo_name": "silly-wacky-3-town-toon/SOURCE-COD", "id": "1d8d020199486ae403e71244f0f14e00bbc9eaa...
'''This module provides a class for Balances calls to the CC API''' from currencycloud.http import Http from currencycloud.resources import PaginatedCollection, Balance, MarginBalanceTopUp class Balances(Http): '''This class provides an interface to the Balances endpoints of the CC API''' def for_currency(s...
{ "content_hash": "69ad3111e91e66b00366b18bc6d0e0df", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 98, "avg_line_length": 39.24242424242424, "alnum_prop": 0.6548262548262548, "repo_name": "CurrencyCloud/currencycloud-python", "id": "3c6721f94b95f6af44d07e7ac7a29cfc73daf12c...
import os from setuptools import setup # Utility function to read the README file. # Used for the long_description. It's nice, because now 1) we have a top level # README file and 2) it's easier to type in the README file than to put a raw # string in below ... def read(fname): return open(os.path.join(os.path.di...
{ "content_hash": "2eab801a1612870dc452083a6446a87b", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 141, "avg_line_length": 41.18518518518518, "alnum_prop": 0.6807553956834532, "repo_name": "akrause2014/dispel4py", "id": "b66a2bb0b470548bbb49e41c73ffc9593180ce49", "size":...
from django.contrib import admin from django.contrib.auth.views import LoginView from django.urls import include, path, re_path from . import views from .models import NonAsciiRepr urlpatterns = [ re_path( r"^resolving1/(.+)/(.+)/$", views.resolving_view, name="positional-resolving" ), re_path(r"^...
{ "content_hash": "4c438ed8fd6a1dded2cc9f6badda34bd", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 85, "avg_line_length": 45.03703703703704, "alnum_prop": 0.6513157894736842, "repo_name": "spookylukey/django-debug-toolbar", "id": "c12fc744afdcbd21408ed4dd18dbda91841fd5da",...
from whacked4 import config, utils from whacked4.ui import editormixin, windows import wx class SoundsFrame(editormixin.EditorMixin, windows.SoundsFrameBase): """ Sounds editor window. """ # The colour used for color-coding priorities. PRIORITY_COLOUR = wx.Colour(red=255, green=48, blue=0) U...
{ "content_hash": "eea4ae740773a6164cf405d5de9f72c8", "timestamp": "", "source": "github", "line_count": 308, "max_line_length": 104, "avg_line_length": 30.155844155844157, "alnum_prop": 0.5871016365202412, "repo_name": "GitExl/WhackEd4", "id": "74234799d76eb79f2d9f49dd6d0d0bf74738f3f2", "size": "93...
""" felix.actor ~~~~~~~~~~~ A queue-based Actor framework that supports efficient handling of batches of messages. Each Actor instance has its own greenlet and a queue of pending messages. Messages are sent by making calls to methods decorated by the @actor_message decorator. When an actor_message-decorated method ...
{ "content_hash": "29fd197829ac292d647edabfe54a9e58", "timestamp": "", "source": "github", "line_count": 713, "max_line_length": 79, "avg_line_length": 38.87938288920056, "alnum_prop": 0.6006276829840194, "repo_name": "TrimBiggs/calico", "id": "49d716fbed4407b6147b7e5a4d676727138a91f5", "size": "283...
from __future__ import absolute_import, unicode_literals import datetime import django from django.contrib.admin.templatetags.admin_list import ResultList, result_headers from django.contrib.admin.utils import display_for_field, display_for_value, lookup_field from django.core.exceptions import ObjectDoesNotExist fro...
{ "content_hash": "8187209dd41c8b7b5cae405446d7182c", "timestamp": "", "source": "github", "line_count": 196, "max_line_length": 89, "avg_line_length": 35.54081632653061, "alnum_prop": 0.5970427792133218, "repo_name": "chrxr/wagtail", "id": "c216a82940ed1d4470a8e484a6e59d54bc4858d6", "size": "6966",...
from msrest.serialization import Model from msrest.exceptions import HttpOperationError class ErrorResponse(Model): """The error object. :param error: Error. :type error: ~azure.mgmt.resource.managementgroups.models.ErrorDetails """ _attribute_map = { 'error': {'key': 'error', 'type': 'E...
{ "content_hash": "1cea87edd169f394f10b678c53ae0cc7", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 99, "avg_line_length": 27.633333333333333, "alnum_prop": 0.6755126658624849, "repo_name": "AutorestCI/azure-sdk-for-python", "id": "d4af1d388d68ee2114db0e15d458065bc421a7b0",...
import proto # type: ignore from google.protobuf import wrappers_pb2 # type: ignore __protobuf__ = proto.module( package="google.cloud.bigquery.v2", manifest={ "EncryptionConfiguration", }, ) class EncryptionConfiguration(proto.Message): r""" Attributes: kms_key_name (google....
{ "content_hash": "9776210d914d212be090129611662dbc", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 64, "avg_line_length": 24.21212121212121, "alnum_prop": 0.6382978723404256, "repo_name": "googleapis/python-bigquery", "id": "9f57acb7c1f5b94b85b222e7dbf1bc8c3b71ac3a", "si...
''' These files were generated from the spinn3r protobuf spec used in their custom "protostream" format '''
{ "content_hash": "22265d11592a4c921418ed4f1e8ab19b", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 65, "avg_line_length": 27, "alnum_prop": 0.7685185185185185, "repo_name": "trec-kba/streamcorpus-pipeline", "id": "42b973a58beca089f97a9ca0ae39ce1a727b32f7", "size": "108", ...
"""Run the main function""" if __name__ == '__main__': main() def main(): """The main function""" print nicks_add(10, 3) def nicks_add(number_one, number_two): """Adds a and b together number_one -- a number number_two -- another number return -- number_one + number_two """ return ...
{ "content_hash": "6556ff26e2f9f38ce377a8fe22ed0e9a", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 38, "avg_line_length": 22.933333333333334, "alnum_prop": 0.5872093023255814, "repo_name": "UFSEC/vim-tutorial", "id": "acaca263a2eafe5e7bf3f6e5cc50189779c4736f", "size": "3...
import datetime import json import logging import sys import string, random import types from hashlib import md5 from django.http import HttpResponse from django.forms.models import model_to_dict from django.core.cache import cache import decimal import re reload(sys) sys.setdefaultencoding("utf-8") Logger = logging.ge...
{ "content_hash": "6a61cd9b30c7f071c53c3f6cc25dbbc4", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 145, "avg_line_length": 27.410404624277458, "alnum_prop": 0.6244200759173345, "repo_name": "llfccc/weekly", "id": "39d187488a388039c2f8951c8dab8e2966c1a4ef", "size": "5162...
""" This module brings together a variety of NLTK functionality for text analysis, and provides simple, interactive interfaces. Functionality includes: concordancing, collocation discovery, regular expression search over tokenized strings, and distributional similarity. """ from __future__ import print_function, divisi...
{ "content_hash": "07841bbe6125ac27846f7225d9620a84", "timestamp": "", "source": "github", "line_count": 609, "max_line_length": 108, "avg_line_length": 37.00985221674877, "alnum_prop": 0.5715870269310972, "repo_name": "xiaozhuchacha/OpenBottle", "id": "6fb9fc44e3cd457d00209cc6ad8ca5c400d76ad1", "si...
def extractYamiTranslations(item): """ """ vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol or frag) or 'preview' in item['title'].lower(): return None if 'Tensei Shoujo no Rirekisho' in item['tags']: return buildReleaseMessageWithType(item, 'Tensei Shoujo no Rireki...
{ "content_hash": "3fcfe09a40befa2f660ca52cfcd0b2b6", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 131, "avg_line_length": 54.388888888888886, "alnum_prop": 0.7487231869254342, "repo_name": "fake-name/ReadableWebProxy", "id": "b64e121644bfa90dfd88fb6b927a0f8b21267136", "...
import re from django.template import Library, Node, TemplateSyntaxError from django.template.base import token_kwargs from django.urls import Resolver404, resolve from django.utils.html import format_html register = Library() class MenuItemNode(Node): def __init__(self, nodelist, pattern, kwargs): self...
{ "content_hash": "d6a2e196fc22ecb1470eb006501512b6", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 112, "avg_line_length": 29.754716981132077, "alnum_prop": 0.6201648700063411, "repo_name": "Inter-Actief/alexia", "id": "3a081670c8619a8dbe9b2b1bb3b4d9935ec6801d", "size": ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os.path import numpy as np from numpy.testing import assert_allclose, assert_equal import pytest from freediscovery.text import FeatureVectorizer from freediscovery.cluster import _ClusteringWrapper, se...
{ "content_hash": "8094a12dd581e0adeedbb7aa50ed26c6", "timestamp": "", "source": "github", "line_count": 187, "max_line_length": 127, "avg_line_length": 34.101604278074866, "alnum_prop": 0.5960482985729967, "repo_name": "kcompher/FreeDiscovUI", "id": "879768afee2c5dbc520d25ac3e5e78beb404142f", "size...
import sqlalchemy as sa from sqlalchemy import orm from sqlalchemy.orm import exc as sa_orm_exc from webob import exc as web_exc from neutron.api.v2 import attributes from neutron.api.v2 import base from neutron.common import exceptions from neutron.db import model_base from neutron.db import models_v2 from neutron.o...
{ "content_hash": "45cd22b40cb18771d28b92ac4ccea79f", "timestamp": "", "source": "github", "line_count": 470, "max_line_length": 79, "avg_line_length": 47.9531914893617, "alnum_prop": 0.5839914810542195, "repo_name": "yamahata/neutron", "id": "6a1c3c21b3c5d6b3d17fd0190ad019b3d80e16ad", "size": "2316...
import unittest import sys from unittest.mock import Mock, MagicMock, _magics class TestMockingMagicMethods(unittest.TestCase): def test_deleting_magic_methods(self): mock = Mock() self.assertFalse(hasattr(mock, '__getitem__')) mock.__getitem__ = Mock() self.assertTrue(hasattr(m...
{ "content_hash": "2d760257e3a3bca036b9dd23f3ce1062", "timestamp": "", "source": "github", "line_count": 468, "max_line_length": 79, "avg_line_length": 30.792735042735043, "alnum_prop": 0.5627645548539311, "repo_name": "mindbender-studio/setup", "id": "24569b532ded9d014c96c9e4c46ba49dbfdc6773", "siz...
#!/usr/bin/python # # Copyright (C) 2009 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of...
{ "content_hash": "dec26a27ddc3345d351a26a4d1080e5d", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 111, "avg_line_length": 32.85795454545455, "alnum_prop": 0.6913366764655023, "repo_name": "Xperia-Nicki/android_platform_sony_nicki", "id": "c9c5bf5c31859729bdca54ecebc92712...
DEBUG = False USE_EMBEDDED_PYSERIAL = True BAUD = 115200 if USE_EMBEDDED_PYSERIAL: from os import sys, path thisdir = path.dirname(path.abspath(__file__)) sys.path.append(thisdir) import serial #----- PORTSCAN ---------------------------------------------------------------- # This will check for the po...
{ "content_hash": "ac8911c99c0cb165f4f98dd73da71e3b", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 83, "avg_line_length": 25.394160583941606, "alnum_prop": 0.5972980741592412, "repo_name": "whaleygeek/mb_sdcard", "id": "5c59d2bf8c070d48ab5b3d3d35c2bd184cfd87f8", "size":...
"""Implementation of SQLAlchemy backend.""" import collections import copy import datetime import functools import sys import threading import time import uuid from oslo.config import cfg from oslo.db import exception as db_exc from oslo.db.sqlalchemy import session as db_session from oslo.db.sqlalchemy import utils ...
{ "content_hash": "e32e2211f139072b070d784657712d3a", "timestamp": "", "source": "github", "line_count": 6328, "max_line_length": 79, "avg_line_length": 36.3013590391909, "alnum_prop": 0.5808501839235575, "repo_name": "projectcalico/calico-nova", "id": "343cb351714a1e38fc06537e0aa232c62f31bfef", "si...
from collections import namedtuple ############### # Structs # ############### # Request payloads ProduceRequest = namedtuple("ProduceRequest", ["topic", "partition", "messages"]) FetchRequest = namedtuple("FetchRequest", ["topic", "partition", "offset", "max...
{ "content_hash": "0458bb8ff5f9a723b4d745996fe321ce", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 78, "avg_line_length": 38.979166666666664, "alnum_prop": 0.5617316942811331, "repo_name": "duanhongyi/kakfa", "id": "00df05a69f811130b1285157cc989ad0ffb45e52", "size": "187...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import copy import itertools import logging import threading import random import string from functools import wraps, total_ordering from sqlalchemy import Column, Integer...
{ "content_hash": "724e09b7fe4b22b0be3963986de82f6b", "timestamp": "", "source": "github", "line_count": 702, "max_line_length": 116, "avg_line_length": 36.67948717948718, "alnum_prop": 0.592527865159812, "repo_name": "OmgOhnoes/Flexget", "id": "f240bf57daa8e97cdb8e0e976388d1f80acd46e5", "size": "25...
import ansible from ansible import utils from ansible.utils import template from ansible.runner.return_data import ReturnData class ActionModule(object): ''' Print statements during execution ''' TRANSFERS_FILES = False def __init__(self, runner): self.runner = runner self.basedir = runn...
{ "content_hash": "6621bfde0abe2fea7a24d2ac8538864c", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 93, "avg_line_length": 33.51162790697674, "alnum_prop": 0.5981956974323387, "repo_name": "ygol/dotfiles", "id": "eaf1364c3f39ac1bf5e6eaa0746419f35ab94518", "size": "2142", ...
from os import path, system import re import requests from bs4 import BeautifulSoup from getpass import getpass un = 'veritas' pw = getpass(prompt="enter pword") page_url = "https://veritas.sao.arizona.edu/wiki/index.php/Advanced_Analysis_Test_Samples" response = requests.get(page_url, auth=(un,pw)) pass # do nothing ...
{ "content_hash": "7e024ead0ec4b99649672cf38ccb42f7", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 99, "avg_line_length": 30.45, "alnum_prop": 0.6584564860426929, "repo_name": "mbuchove/notebook-wurk-b", "id": "59f0ed8d7721c0cd5620f87cba397fe03848eff2", "size": "1237", ...
from setuptools import setup from setuptools.command.sdist import sdist as _sdist import re import sys import time import codecs import subprocess if sys.version < "2.2.3": from distutils.dist import DistributionMetadata DistributionMetadata.classifiers = None DistributionMetadata.download_url = None # Wor...
{ "content_hash": "36cc4dc70fc4fac1eb12cd87911bbdf3", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 84, "avg_line_length": 31.938144329896907, "alnum_prop": 0.6113621691413815, "repo_name": "0dataloss/pyrax", "id": "3cc3c4ffb1590dca5a5e5172263acb541696c1d1", "size": "3121...
from behave import * import urllib2 import urllib import json import jsonpath_rw ## The basic and critical remote collector. ## It defines: ## context.code ## context.content_type ## context.content ## context.content_length @given('I collect data at URL "{url}"') def step_impl(context, url): ## Build request...
{ "content_hash": "156eda585f665aa395471a7467aa59a2", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 77, "avg_line_length": 30.460176991150444, "alnum_prop": 0.6263800116211505, "repo_name": "ValWood/go-site", "id": "68f4c9c542e72a7225c1de08bc36bf8b03b5a0a1", "size": "351...
import line_style import pychart_util import chart_object import fill_style import legend import range_plot_doc from pychart_types import * from types import * from scaling import * class T(chart_object.T): __doc__ = range_plot_doc.doc keys = { "data" : (AnyType, None, pychart_util.data_desc), ...
{ "content_hash": "b8934426a586bb3cfbf37140463e6ab3", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 76, "avg_line_length": 32.94656488549618, "alnum_prop": 0.4932808155699722, "repo_name": "nzavagli/UnrealPy", "id": "eed79462ef5cada54ca929fa53e3d010c5b05e85", "size": "48...
"""Class for starwelsd node under test""" import decimal import errno import http.client import json import logging import os import re import subprocess import time from .authproxy import JSONRPCException from .util import ( assert_equal, delete_cookie_file, get_rpc_proxy, rpc_url, wait_until, ...
{ "content_hash": "0e6ab36ce49f3c6d0cb982233eaabce9", "timestamp": "", "source": "github", "line_count": 279, "max_line_length": 248, "avg_line_length": 38.66308243727599, "alnum_prop": 0.6134235654027996, "repo_name": "starwels/starwels", "id": "dd4c955bdcf57801867607c0298d6e5fbd036e68", "size": "1...
import argparse import inspect import logging import json import base64 from docstring_parser import parse from collections import namedtuple from flask import Flask, request from flask_restx import Api, Resource, fields, abort from flask_cors import CORS from indra import get_config from indra.sources import trips, ...
{ "content_hash": "548142db16f34960cf882a008c7bcb66", "timestamp": "", "source": "github", "line_count": 1332, "max_line_length": 80, "avg_line_length": 32.7957957957958, "alnum_prop": 0.5870341543814669, "repo_name": "johnbachman/belpy", "id": "b50fefcc5f01d02d53e7d2f542a89a838d44f20c", "size": "43...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('sitio', '0025_auto_20170612_2133'), ] operations = [ migrations.RemoveField( model_name='comentariosdenunciados', name='url_comentar...
{ "content_hash": "541d74b966acecc75afbc1357e545334", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 48, "avg_line_length": 22.333333333333332, "alnum_prop": 0.5906183368869936, "repo_name": "giocastagno/I.W._Delpuppo_Kopech_Castagno", "id": "2947590e938a6e1b539e0bdb97295197...
import flatbuffers # an example documentation comment: monster object class Monster(object): __slots__ = ['_tab'] @classmethod def GetRootAsMonster(cls, buf, offset): n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) x = Monster() x.Init(buf, n + offset) r...
{ "content_hash": "a07230302026c2660eafca814dece2ac", "timestamp": "", "source": "github", "line_count": 685, "max_line_length": 200, "avg_line_length": 43.198540145985405, "alnum_prop": 0.6712851880639383, "repo_name": "bjtaylor1/osrm-backend", "id": "5baf64d44a7bfded5815a5a784c197faca49cef4", "siz...
from google.cloud import compute_v1 # <INGREDIENT create_custom_shared_core_instance> def create_custom_shared_core_instance( project_id: str, zone: str, instance_name: str, cpu_series: CustomMachineType.CPUSeries, memory: int, ) -> compute_v1.Instance: """ Create a new VM instance with a ...
{ "content_hash": "2e5b4686129347df652c92f2e12cdc46", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 110, "avg_line_length": 36.525, "alnum_prop": 0.6844626967830253, "repo_name": "googleapis/python-compute", "id": "a29193438ff93a0587499c9ed368a61e11653aee", "size": "2310"...
from .base.errors import *
{ "content_hash": "cdad3f86bdbf05c0a58a5504338242a9", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 26, "avg_line_length": 27, "alnum_prop": 0.7407407407407407, "repo_name": "DataDog/integrations-core", "id": "a1e6700230b6ddca6f63ce66a0baf6fadc7f95cd", "size": "157", "bi...
import datetime from six import moves from tempest.api.compute import base from tempest import exceptions from tempest import test class ListServersNegativeV3Test(base.BaseV3ComputeTest): force_tenant_isolation = True @classmethod @test.safe_setup def setUpClass(cls): super(ListServersNegat...
{ "content_hash": "2b7cdfb7f5222ae83d4610b311077b12", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 79, "avg_line_length": 44.513333333333335, "alnum_prop": 0.6305226898307623, "repo_name": "Mirantis/tempest", "id": "18e5c677c3aad5f14661af423d3d853d625f9ffc", "size": "73...
import itertools import re JNINativeInterface = """ test (JNICALL *foo)(int a, int* b); jint (JNICALL *GetVersion)(JNIEnv *env); jclass (JNICALL *DefineClass) (JNIEnv *env, const char *name, jobject loader, const jbyte *buf, jsize len); jclass (JNICALL *FindClass) (JNIEnv *env, con...
{ "content_hash": "08409a324633ae097f0ce488fcbfe5bd", "timestamp": "", "source": "github", "line_count": 677, "max_line_length": 100, "avg_line_length": 40.55391432791728, "alnum_prop": 0.6563831724640321, "repo_name": "phihag/jippy", "id": "0b174425114ad8e65c51badbc3923614c349c95e", "size": "27478"...
import os import gevent import logging import kazoo.client import kazoo.exceptions import kazoo.handlers.gevent import kazoo.recipe.election from kazoo.client import KazooState from kazoo.retry import KazooRetry, ForceRetryError from kazoo.recipe.counter import Counter from bitarray import bitarray from cfgm_common.ex...
{ "content_hash": "ad08b441da1f94476d94298b9471c33c", "timestamp": "", "source": "github", "line_count": 575, "max_line_length": 83, "avg_line_length": 36.11826086956522, "alnum_prop": 0.5514734206471494, "repo_name": "nischalsheth/contrail-controller", "id": "f61829f829a9570d8a5d06c73bf918b795ce37b2"...
import json import os import unittest from nose.plugins.attrib import attr import cloudferry_devlab.tests.config as config from cloudferry_devlab.tests import functional_test class VmMigration(functional_test.FunctionalTest): def setUp(self): super(VmMigration, self).setUp() src_vms = self.filt...
{ "content_hash": "79dc856394fedc48ce96067e754c5b3c", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 78, "avg_line_length": 48.80357142857143, "alnum_prop": 0.5525064032199049, "repo_name": "mgrygoriev/CloudFerry", "id": "64378ffd16602aee3cb2a86a5b15257a1ce4d071", "size":...
from azure.cli.testsdk import (ScenarioTest, ResourceGroupPreparer, StorageAccountPreparer) from azure.cli.testsdk.scenario_tests.decorators import AllowLargeResponse class NWFlowLogScenarioTest(ScenarioTest): @ResourceGroupPreparer(name_prefix='test_nw_flow_log_', location='centraluseuap') @StorageAccountPr...
{ "content_hash": "f1cdb3d5a63b7bbe79174b3921c054f7", "timestamp": "", "source": "github", "line_count": 565, "max_line_length": 117, "avg_line_length": 46.571681415929206, "alnum_prop": 0.5590772621897921, "repo_name": "yugangw-msft/azure-cli", "id": "2b7fbf09c377350770847e85e9cd15174c7bc638", "siz...
from debian_tools.command_process import CommandProcess def main(): process = CommandProcess([ 'flake8', '--exclude', '.venv,.git,.idea,.tox', '--verbose', '--max-complexity', '5' ]) process.print_output() if __name__ == '__main__': main()
{ "content_hash": "5d76bb6a9f935225e5ce670752f265b0", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 55, "avg_line_length": 19.466666666666665, "alnum_prop": 0.5376712328767124, "repo_name": "FunTimeCoding/debian-tools", "id": "34358e0f37b898f95e25d6781c9ef7d67d7c5afd", "s...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models # Safe User import for Django < 1.5 try: from django.contrib.auth import get_user_model except ImportError: from django.contrib.auth.models import User else: User = g...
{ "content_hash": "f0c0a0ed9d9c66e6f90b4a3da79fcbbb", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 182, "avg_line_length": 56.845360824742265, "alnum_prop": 0.5614798694232862, "repo_name": "moreati/django-two-factor-auth", "id": "f102a6f740c4d40bbdf22886f5aaf02ba3a39b31",...
""" The MIT License (MIT) Copyright (c) 2013 Niko Skrypnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge...
{ "content_hash": "9b33187c65e6992d1988b8d63510559f", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 77, "avg_line_length": 32.926829268292686, "alnum_prop": 0.737037037037037, "repo_name": "KeyWeeUsr/kivy3", "id": "a7780181f46a1d6c6387cebd9a4b07ef6ae07626", "size": "1350"...
from django.core.urlresolvers import reverse class Breadcrumb(object): def __init__(self, name, url=None): self.name = name self.url = url def get_absolute_url(self): if not isinstance(self.url, basestring): if len(self.url) > 1: #hack return reverse(sel...
{ "content_hash": "3d32d099667610fbfa5c92946c24da07", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 81, "avg_line_length": 30.785714285714285, "alnum_prop": 0.5893271461716937, "repo_name": "zbyte64/django-dockit", "id": "7b333995fb0213c7eed53d89c40d5d69232c9a7a", "size":...
from string import punctuation import operator import pandas as pd def WordCount(dataframe, country, column_str): ''' This function do word count for a dataframe. It first group the dataframe based on the column with the country name, and then cat all the str stored in that country together, and perfo...
{ "content_hash": "0a85dc18c97483c76200ff75b5145e13", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 78, "avg_line_length": 38.285714285714285, "alnum_prop": 0.6216417910447761, "repo_name": "ManushiM/infoviz_refugee_project", "id": "49610a991e0c0b44dd0b1ba7af1dab68cf0dd8a3"...
from qdb_cache.cache import QdbCache
{ "content_hash": "f0b683cc9977b9bfb912ff3033dcfa41", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 36, "avg_line_length": 37, "alnum_prop": 0.8378378378378378, "repo_name": "holys/django-qdb-cache", "id": "a10aea25c7f6ce29476f56448d530375943e5281", "size": "37", "binary...
"""Offer sun based automation rules.""" from datetime import timedelta import logging import voluptuous as vol from homeassistant.core import callback from homeassistant.const import ( CONF_EVENT, CONF_OFFSET, CONF_PLATFORM, SUN_EVENT_SUNRISE, ) from homeassistant.helpers.event import async_track_sunr...
{ "content_hash": "53655c0188695ed8dfde7af3c882d518", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 86, "avg_line_length": 27.955555555555556, "alnum_prop": 0.6820349761526232, "repo_name": "joopert/home-assistant", "id": "66892784a54d1d02925d52e6120fd01953ea0308", "size"...
from .base import * # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS.append('testserver') ALLOWED_HOSTS.append('127.0.0.1') DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': get_env_variable('DATABASE_NAME'), 'USER':...
{ "content_hash": "50eb1eb78ee28f1c999cf686a43d27df", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 65, "avg_line_length": 24.36842105263158, "alnum_prop": 0.6047516198704104, "repo_name": "swpease/Flavify", "id": "740399aa5d28d73b23badd62c392ff873b4287d9", "size": "463",...
import os,json,serial,socket import subprocess,sys,time spectro_config = os.environ['SPECTROCONFIG'] configFilePath = os.path.join(spectro_config,'hardware.json') json_text=open(configFilePath).read() hardware_config = json.loads(json_text) class Serial: def __init__(self,device,timeout=1): print(f"Seria...
{ "content_hash": "9f750232057a379fb9116dcad2df139d", "timestamp": "", "source": "github", "line_count": 139, "max_line_length": 114, "avg_line_length": 35.56115107913669, "alnum_prop": 0.6073234877604694, "repo_name": "tlemoult/spectroDb", "id": "79ab434c4c30fdbf37234d13cb236747fe4614cf", "size": "...
from django import forms class ContactForm(forms.Form): contact_name = forms.CharField(max_length=100) contact_email = forms.EmailField() message_subject = forms.CharField(max_length=100) message_body = forms.CharField(widget=forms.Textarea) cc_myself = forms.BooleanField(required=False)
{ "content_hash": "16dc10f6f82049c99ed5f7bbb5e40d57", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 57, "avg_line_length": 34.55555555555556, "alnum_prop": 0.7459807073954984, "repo_name": "vacoj/MINDBODY-Django", "id": "1f3903b3f8607b99c71c7622948dd07408ccda1f", "size": "...
from corehq.apps.domain.models import Domain from corehq.apps.sms.api import send_sms_to_verified_number def fallback_handler(v, text, msg): domain_obj = Domain.get_by_name(v.domain, strict=True) if domain_obj.use_default_sms_response and domain_obj.default_sms_response: send_sms_to_verified_number(v, ...
{ "content_hash": "0a4dbdb455f9b8a16d5c7e006995cb5e", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 79, "avg_line_length": 41.111111111111114, "alnum_prop": 0.7486486486486487, "repo_name": "SEL-Columbia/commcare-hq", "id": "a831770ad34d6e935cbcbe4e5227fd97a9930c9d", "size...
"""Add CCS admin data controller role Revision ID: 1270 Revises: 1260 Create Date: 2018-11-22 14:51:03.013362 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '1270' down_revision = '1260' def upgrade(): op.execute("COMMIT") # See: http://stackoverflow.co...
{ "content_hash": "a3872ff2ae89c52acc123cdea7e6cdfb", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 129, "avg_line_length": 22.208333333333332, "alnum_prop": 0.7204502814258912, "repo_name": "alphagov/digitalmarketplace-api", "id": "4b24762f42607c649803e92254b48c806f62a36a"...
from setuptools import setup, find_packages setup(name='PyFL593FL', version='0.0.1', author='Ronny Eichler', author_email='ronny.eichler@gmail.com', url='https://github.com/wonkoderverstaendige/PyFL593FL', download_url='https://github.com/wonkoderverstaendige/PyFL593FL', descriptio...
{ "content_hash": "b66b3770f49a1c8048e325d83134e4b6", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 109, "avg_line_length": 39.48717948717949, "alnum_prop": 0.5733766233766234, "repo_name": "wonkoderverstaendige/PyFL593FL", "id": "67115f5628abbaaac3a812457a8b9a47d7f8e1b5", ...
<<<<<<< HEAD <<<<<<< HEAD # # This file is for everybody to add tests for bugs that aren't # fixed yet. Please add a test case and appropriate bug description. # # When you fix one of the bugs, please move the test to the correct # test_ module. # import unittest from test import support # # No test cases for outstan...
{ "content_hash": "76fb4ca1a9b1d13d363231afa859251d", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 68, "avg_line_length": 20.833333333333332, "alnum_prop": 0.6944, "repo_name": "ArcherSys/ArcherSys", "id": "ad86e71ed0d1d57ae601feac3dbd7fd507a6a29d", "size": "1250", "bi...
'''Un acortador de URLs pero que permite: * Editar adonde apunta el atajo más tarde * Eliminar atajos * Definir tests para saber si el atajo es válido ''' import os import string import datetime from twill.commands import go, code, find, notfind, title def minitwill(url, script): '''Dada una URL y un script en ...
{ "content_hash": "e8db31dd295f7dcf8bf409c5dec05008", "timestamp": "", "source": "github", "line_count": 351, "max_line_length": 72, "avg_line_length": 29.05982905982906, "alnum_prop": 0.5812745098039216, "repo_name": "rst2pdf/rst2pdf", "id": "038e742c818ca0d0bd85869c42f8467c845a1886", "size": "1026...
"""Iris Classification Model. Iris problem was first introduced by Fisher's 1936 paper, The Use of Multiple Measurements in Taxonomic Problems. This is a classification model with 3 possible output classes and 4 numeric input features. One of the classes is linearly separable, but the other two are not. This sample...
{ "content_hash": "d8a4f05461916a6514f85ad6f7cba7be", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 78, "avg_line_length": 30.711111111111112, "alnum_prop": 0.7069464544138929, "repo_name": "obulpathi/cloud", "id": "b7220dffa06d33c5b34a8f1798957fc373d4ee96", "size": "1979...
import traceback import unittest from tt.tables import TruthTable class TruthTableTestCase(unittest.TestCase): """An extended TestCase with helpers for testing truth tables.""" def helper_test_truth_table(self, expr, expected_table_str=None, **kwargs): """Helper to test the creation of truth tables...
{ "content_hash": "db9cfc5f9185a951848692c571a27ac8", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 79, "avg_line_length": 34.68807339449541, "alnum_prop": 0.5866172970113727, "repo_name": "welchbj/tt", "id": "843293d6193a1cd6507b23dd9f24e5fff5bdad34", "size": "3781", ...
"""Classes and functions used to construct graphs.""" # pylint: disable=g-bad-name from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import contextlib import copy import linecache import re import sys import threading import six from tensor...
{ "content_hash": "cd5d1e432a5ad236d277a627fb9d34df", "timestamp": "", "source": "github", "line_count": 4262, "max_line_length": 98, "avg_line_length": 35.619427498826845, "alnum_prop": 0.6596205783545221, "repo_name": "AsimmHirani/ISpyPi", "id": "5669878b7417bb308e0bf0f7447814603ecd9b76", "size": ...
with open("Brown-Retagged.txt") as fp: for line in fp: line = line.strip().split() for tuple in line: word, _, pos = tuple.partition('_') print '{}\t{}'.format(word, pos) print ''
{ "content_hash": "177d14688774e474b40a1f4b0dfa4b23", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 47, "avg_line_length": 33, "alnum_prop": 0.5021645021645021, "repo_name": "Sentimentron/Dracula", "id": "0ae1dd859187db590a1e4018565b35497599d42b", "size": "231", "binary"...
from ..pakbase import Package class mfaddoutsidefile(Package): """ Add a file for which you have a MODFLOW input file """ def __init__(self, model, name, extension, unitnumber): # call base package constructor super().__init__( model, extension, name, unitnumber, allowDupl...
{ "content_hash": "718f4af31df457cc998487627eedaf8e", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 68, "avg_line_length": 24.2, "alnum_prop": 0.6053719008264463, "repo_name": "jentjr/flopy", "id": "b9935cd24f05502137459c55d8c7452f0362609d", "size": "484", "binary": fal...
import sys from PIL import Image files = sys.argv[1:len(sys.argv)] print("Frame Count: {}".format(len(files))) data = [] for f in files: im = Image.open(f) # Can be many different formats. pix = im.load() if im.size != (8, 8): exit("Image ({}) with incorrect dimensions".format(f)) for y in ...
{ "content_hash": "89b4b15825f7afff7dc113d29a3d781f", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 62, "avg_line_length": 24.565217391304348, "alnum_prop": 0.5752212389380531, "repo_name": "cujomalainey/Smiley-Pack", "id": "2d5907289222667ec2d078d79c8668f642750724", "siz...
""" __init__.py - Just allows lib to be imported Created by William Woodall on 2010-10-13. """ __author__ = "William Woodall" __copyright__ = "Copyright (c) 2010 John Harrison, William Woodall" ### Imports ### # Standard Python Libraries import sys import os try: # try to catch any missing dependancies # <PKG> fo...
{ "content_hash": "4a0284f4ce7538eb83d0e85bd53ec06a", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 123, "avg_line_length": 20.166666666666668, "alnum_prop": 0.6322314049586777, "repo_name": "wjwwood/open-robotics-platform", "id": "1633524e6e0720451bd4e9a6ff2b100818230fb9",...
from datetime import datetime, timedelta from airflow.models import DAG from airflow.operators.dummy_operator import DummyOperator DEFAULT_DATE = datetime(2016, 1, 1) # DAG tests backfill with pooled tasks # Previously backfill would queue the task but never run it dag1 = DAG( dag_id='test_start_date_scheduling',...
{ "content_hash": "a787af287766522df175ab93dfb96943", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 59, "avg_line_length": 24.806451612903224, "alnum_prop": 0.7022106631989596, "repo_name": "sid88in/incubator-airflow", "id": "94e6f8216d226dfea77423b9e248598df56fa5b2", "si...
''' Designs oligos for a pre RNA-seq selection method ''' ### imports ### import sys import os import numpy as np def readFastaFile(fastaFilePath): ''' Given a path to a multiline fasta file, reads the file, returning two lists - one containing the sequences, the other containing the headers inputs: path to a fas...
{ "content_hash": "f8bae895c1ae46ed3ef008876a30fb09", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 141, "avg_line_length": 29.86842105263158, "alnum_prop": 0.7083700440528634, "repo_name": "jenhantao/preRNA-seq_OligoDesigner", "id": "9b79dccaccf94536120a6fb87c1b727639187e2...
BOT_NAME = 'jtr_scrapper' SPIDER_MODULES = ['jtr_scrapper.spiders'] NEWSPIDER_MODULE = 'jtr_scrapper.spiders' ITEM_PIPELINES = { 'jtr_scrapper.elasticsearchPipeline.ElasticSearchPipeline':100 } ELASTICSEARCH_HOST = 'elasticsearch' ELASTICSEARCH_PORT = 9200 ELASTICSEARCH_FLUSH_LIMIT = 1000 # Crawl responsibly by ...
{ "content_hash": "be5d39d45503d00694a1002e2c4a77b8", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 109, "avg_line_length": 33.9390243902439, "alnum_prop": 0.7786561264822134, "repo_name": "hikhvar/jtr_scrapper", "id": "30aa0cf50f3ba980edb42b7e6176f7a20b7afbc6", "size": "...
"""This component provides HA sensor support for Ring Door Bell/Chimes.""" from __future__ import annotations from dataclasses import dataclass from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntity, SensorEntityDescription, ) from homeassistant.config_entries import ConfigEntry fro...
{ "content_hash": "f4d1c6b606636b1f8e0e445f494f6f44", "timestamp": "", "source": "github", "line_count": 261, "max_line_length": 93, "avg_line_length": 31.153256704980844, "alnum_prop": 0.6266141925962366, "repo_name": "w1ll1am23/home-assistant", "id": "1aaa073064f8189370255bfbb963fc32779d3518", "si...
from . import asciiTable class table_T_S_I_P_(asciiTable.asciiTable): pass
{ "content_hash": "1cb13544657124ce4d50efa5e4ef9fe1", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 44, "avg_line_length": 15.6, "alnum_prop": 0.7435897435897436, "repo_name": "googlei18n/TachyFont", "id": "e34a18c997337619789460bf5c9600a7f2619c0f", "size": "78", "binary...
from pyxb_114.bundles.opengis.citygml.raw.landUse import *
{ "content_hash": "159593d092f3fcb658e8221148358251", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 58, "avg_line_length": 59, "alnum_prop": 0.8135593220338984, "repo_name": "msherry/PyXB-1.1.4", "id": "92764eb07290909285c7abfb5ba3ca81d53567d5", "size": "59", "binary": f...
''' Created on Feb 3, 2013 @author: bpurgaso ''' from twisted.words.protocols import irc from twisted.internet import protocol from twisted.internet import reactor from twisted.internet import threads from ConfigManager import ConfigManager from Authenticator import Authenticator from subprocess import PIPE, STDOUT, ...
{ "content_hash": "c181e81ba69ee9bc96a7fbb2d3b6dd3d", "timestamp": "", "source": "github", "line_count": 265, "max_line_length": 79, "avg_line_length": 37.70943396226415, "alnum_prop": 0.5065545882117483, "repo_name": "bpurgaso/hydra-ircbot", "id": "715a4796b8c6931758d4eaebe578d13178d94e13", "size":...
import logging logging.getLogger("requests").setLevel(logging.WARNING) logging.getLogger("urllib3").setLevel(logging.WARNING) # import the queues from portality.tasks.redis_huey import main_queue # now import the tasks that will bind to those queues # these are the ones which bind to the main_queue from portality.ta...
{ "content_hash": "e670c3d7bc591d5b438c44ff180bab91", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 107, "avg_line_length": 54.75, "alnum_prop": 0.8378995433789954, "repo_name": "DOAJ/doaj", "id": "527ee368cf7743d9678738df0bac4d78a455c877", "size": "1543", "binary": fal...
from grid import * import time count = int(input("How many times to use item: ")) input("Place mouse over center of inventory item to use and press enter.") x, y = Mouse.get_position() for i in range(count): Mouse.click(x, y) time.sleep(0.100) Mouse.click(x + 50, y + 15) time.sleep(0.100)
{ "content_hash": "d6ad930c4ca343eae1fed5195a0fdcf1", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 74, "avg_line_length": 20.733333333333334, "alnum_prop": 0.6559485530546624, "repo_name": "jshumaker/LoA", "id": "dcaf90ff863601d57cf942ee53ddf1dc45eff308", "size": "311", ...
'''Test that mouse cursor can be set to a platform-dependent image. Expected behaviour: One window will be opened. Press the left and right arrow keys to cycle through the system mouse cursors. The current cursor selected will be printed to the terminal. Note that not all cursors are unique on each ...
{ "content_hash": "b963306293bc33335f6c357f2f754b39", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 88, "avg_line_length": 33.225352112676056, "alnum_prop": 0.5875370919881305, "repo_name": "oktayacikalin/pyglet", "id": "aed027c43a7227c5530bd0135b263c6bc281cf1f", "size": ...
import pmxbot from pmxbot.core import regexp, contains, command from pmxbot.core import ContainsHandler import httplib2 import json import re import logging import six import random log = logging.getLogger(__name__) class RegexpFindHandler(ContainsHandler): class_priority = 4 def __init__(self, *args, **kwa...
{ "content_hash": "439166f2de39948ddd9816400530a279", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 83, "avg_line_length": 33.41463414634146, "alnum_prop": 0.5598540145985401, "repo_name": "cryptk/pmxbot_redmine", "id": "c97ebfd24bac12e6c0be826c8bc6bd674fb8982d", "size":...
import pytest from .common import * # NOQA from rancher import ApiError namespace = {"p_client": None, "ns": None, "cluster": None, "project": None} RBAC_ROLES = [CLUSTER_OWNER, PROJECT_MEMBER, PROJECT_OWNER, PROJECT_READ_ONLY, CLUSTER_MEMBER] WORKLOAD_TYPES = ["daemonSet", "statefulSet", "cronJob", "j...
{ "content_hash": "929641b8cca77ce6bc2c6c1d2a09645c", "timestamp": "", "source": "github", "line_count": 1143, "max_line_length": 84, "avg_line_length": 42.332458442694666, "alnum_prop": 0.5931261108585127, "repo_name": "rancherio/rancher", "id": "a332fc211b940aa87ea3bb81987d4fc5920a7db4", "size": "...
from thrift.Thrift import TType, TMessageType, TException, TApplicationException from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol, TProtocol try: from thrift.protocol import fastbinary except: fastbinary = None class SharedStruct: """ Attributes: - key - value """ ...
{ "content_hash": "a326d8085d9926ec4a127e64a374e901", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 188, "avg_line_length": 28.902439024390244, "alnum_prop": 0.6303797468354431, "repo_name": "radical-cybertools/aimes.swiftrp", "id": "92dca6d9d31e746cb3f8e5a5bd7b9b074d083618...
size = int(input('Insert size of array:')) # size of random array array = [] for i in range(size): n=int(input('Insert Number:')) array.append(n) anum = int(input('Insert Number to search:')) # number to search for # array = random.sample(list(range(1, 20)), size) # get some random numbers a...
{ "content_hash": "684aa8b611fd3e00c9f0ae9d66105fbd", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 86, "avg_line_length": 37, "alnum_prop": 0.5996621621621622, "repo_name": "WebClub-NITK/Hacktoberfest-2k17", "id": "ae089ed1aac317eb4523b3e2b91d6938f35d6db2", "size": "1185...