text
stringlengths
4
1.02M
meta
dict
import time last = 0 def inittime(): global last last = time.time() def timecheck(label, echo=True): global last now = time.time() diff = now - last if echo: print(label, '%.2f ms' % (diff * 1000)) last = now return diff * 1000
{ "content_hash": "7e852e4e34289b374455b0ce5794c96a", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 47, "avg_line_length": 16.9375, "alnum_prop": 0.5682656826568265, "repo_name": "hughperkins/gpu-experiments", "id": "9290a36cde2ec0c541e7b291b0573c3c0933e0ed", "size": "271...
from .constant import Constant __NR_exit = Constant("__NR_exit", 1) __NR_fork = Constant("__NR_fork", 2) __NR_read = Constant("__NR_read", 3) __NR_write = Constant("__NR_write", 4) __NR_open = Constant("__NR_open", 5) __NR_close = Constant("__NR_close", 6) __NR_waitpid = Constant("__NR_waitpid", 7) __NR_creat = Consta...
{ "content_hash": "3cb990cd3980ebb37d45e298eb34f7f8", "timestamp": "", "source": "github", "line_count": 616, "max_line_length": 74, "avg_line_length": 46.37987012987013, "alnum_prop": 0.6855092754637732, "repo_name": "pwndbg/pwndbg", "id": "41223f87fb187a54a845d776fb9eb3d2aee3aa66", "size": "28570"...
from mock import patch, Mock import unittest2 as unittest from lib.controller import * from lib.view import * from lib.cluster import Cluster from lib.prefixdict import PrefixDict from lib.node import Node import lib import sys from cStringIO import StringIO real_stdout = sys.stdout def reset_stdout(): sys.stdout...
{ "content_hash": "fb16047587fb2106bc150bd06fd29ecd", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 80, "avg_line_length": 28.011494252873565, "alnum_prop": 0.6064833812064013, "repo_name": "PavanGupta01/aerospike-admin", "id": "0516d87d8d3e9d642cf0eb172de423f86a1b4b91", ...
"""Basic tools for workers that handle TransportMessages.""" import time import os import socket from twisted.internet.defer import ( inlineCallbacks, succeed, maybeDeferred, gatherResults) from twisted.python import log from vumi.service import Worker from vumi.middleware import setup_middlewares_from_config fr...
{ "content_hash": "63edfc5a8c919a1b8bb4a98c79dc4436", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 79, "avg_line_length": 36.24285714285714, "alnum_prop": 0.6237025358034424, "repo_name": "harrissoerja/vumi", "id": "3bc7d40a1ff3f95ca6bbd675bada6d5806be3718", "size": "76...
import colorsys import itertools import math import random import subprocess from pyfrax.canvas import * from pyfrax.model import * from pyfrax.rendertools import gif from pyfrax.common import base_dir class Canvas3DShaded(Canvas): def shade(self, z, c): W = self.image.shape[0] return tuple(c...
{ "content_hash": "ad7f5101704e59287dc248985e3bcf75", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 91, "avg_line_length": 30.944444444444443, "alnum_prop": 0.599640933572711, "repo_name": "fraxtil/pyfrax", "id": "4f2dd36e47c4f80eef436b73a683ed7250866cdb", "size": "1693",...
from typing import Optional, TYPE_CHECKING from cloudfoundry_client.v3.entities import EntityManager, Entity, ToOneRelationship if TYPE_CHECKING: from cloudfoundry_client.client import CloudFoundryClient class OrganizationManager(EntityManager): def __init__(self, target_endpoint: str, client: "CloudFoundry...
{ "content_hash": "4cf9b64ddc133d81f78dc346e21c342b", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 123, "avg_line_length": 43.18, "alnum_prop": 0.66512274201019, "repo_name": "antechrestos/cf-python-client", "id": "601cd8373f3d9cd7a2de9818802e44546fce4542", "size": "2159...
import os from pants.base.exceptions import TaskError from pants.process.xargs import Xargs from pants.contrib.go.tasks.go_task import GoTask class GoRun(GoTask): """Runs an executable Go binary.""" @classmethod def supports_passthru_args(cls): return True @classmethod def prepare(cls,...
{ "content_hash": "72ec8bbdadf0b523315baef5b55791b8", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 91, "avg_line_length": 32.266666666666666, "alnum_prop": 0.6332644628099173, "repo_name": "tdyas/pants", "id": "af3cbce700ad3c490571efaf9209dbb1065e3b47", "size": "1100", ...
from sqlalchemy import Column, Integer, String, TEXT, Date, INTEGER, NUMERIC from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker Base = declarative_base() Session = sessionmaker() class Contract(Base): # type: ignore __tablename__ = 'contracts' id = Column(Intege...
{ "content_hash": "fb9983407ce79a8697b386a2d3e915a9", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 101, "avg_line_length": 42.3125, "alnum_prop": 0.6887001477104875, "repo_name": "GoC-Spending/fuzzy-tribble", "id": "f61a751272a408b93b2079b53b9a0b7d6a5ee7a1", "size": "270...
from factory import Sequence, PostGenerationMethodCall from factory.alchemy import SQLAlchemyModelFactory from recruit_app.user.models import User from recruit_app.database import db class BaseFactory(SQLAlchemyModelFactory): """Base factory.""" class Meta: """Factory configuration.""" abst...
{ "content_hash": "b6634e21639e1ea9fc6e5da3b89bed44", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 66, "avg_line_length": 23.428571428571427, "alnum_prop": 0.6905487804878049, "repo_name": "tyler274/Recruitment-App", "id": "fb5f79445b7518ab2232a0afe0eba08ca510f749", "siz...
def parse_jar(flo): """Parse a Record-Jar from a file like object into a list of dictionaries. This method parses a file like object as described in "The Art of Unix Programming" <http://www.faqs.org/docs/artu/ch05s02.html#id2906931>. The records are divided by lines containing '%%'. Each record consi...
{ "content_hash": "235c3dcdc506d6126651ba750ad0054a", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 80, "avg_line_length": 34.2037037037037, "alnum_prop": 0.5489983757444504, "repo_name": "ActiveState/code", "id": "426595cc63c8a1bd42a1d7299fb4423d2def4b0c", "size": "2025"...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from froide.helper.auth_migration_util import USER_DB_NAME APP_MODEL, APP_MODEL_NAME = 'account.User', 'account.user' class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'FoiRe...
{ "content_hash": "114751e782414b49751d2175f16f8b3a", "timestamp": "", "source": "github", "line_count": 250, "max_line_length": 236, "avg_line_length": 89.596, "alnum_prop": 0.5578374034555114, "repo_name": "catcosmo/froide", "id": "4f683bfa276a535674c6fdb26e89f62b27edd588", "size": "22423", "bin...
"""Compressed Sparse Row matrix format""" __docformat__ = "restructuredtext en" __all__ = ['csr_matrix', 'isspmatrix_csr'] import numpy as np from .base import spmatrix from ._sparsetools import (csr_tocsc, csr_tobsr, csr_count_blocks, get_csr_submatrix) from .sputils import upcast, get_i...
{ "content_hash": "63bf971fac34bfbb2631d508d190c013", "timestamp": "", "source": "github", "line_count": 358, "max_line_length": 79, "avg_line_length": 32.44972067039106, "alnum_prop": 0.5397262632349143, "repo_name": "Eric89GXL/scipy", "id": "54774d62f93d9d93b07e18652e70f290b178cad5", "size": "1161...
from __future__ import absolute_import import sys from os.path import basename from . import maybe_patch_concurrency __all__ = ['main'] DEPRECATED_FMT = """ The {old!r} command is deprecated, please use {new!r} instead: $ {new_argv} """ def _warn_deprecated(new): print(DEPRECATED_FMT.format( old=ba...
{ "content_hash": "c29aaa8e139b7103446248346f14c235", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 62, "avg_line_length": 18.203703703703702, "alnum_prop": 0.6307222787385555, "repo_name": "sunze/py_flask", "id": "04448e239b30e743e4a749fb1ef3be946b1db02c", "size": "983",...
from ._settings_operations import SettingsOperations from ._patch import __all__ as _patch_all from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk __all__ = [ "SettingsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) ...
{ "content_hash": "b4f8b5e3b80c131cc8d885503d57a053", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 78, "avg_line_length": 30.272727272727273, "alnum_prop": 0.6876876876876877, "repo_name": "Azure/azure-sdk-for-python", "id": "0b0925b026d700f8a6fe2d0c2665aef2b23e258c", "s...
from django.db import models from django.utils.translation import ugettext_lazy as _ from mptt.models import MPTTModel from ..product.models import Product __all__ = ('Category', 'CategoryManager') class CategoryManager(models.Manager): def get_product_url(self, product, category): if not category: ...
{ "content_hash": "6449be63675f9ed24458ab4f9994a6aa", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 75, "avg_line_length": 37.0625, "alnum_prop": 0.5997751545812254, "repo_name": "fusionbox/satchless", "id": "ce5271eae0ac32bfd1b79229dc33d619ec5a9409", "size": "1779", "b...
"""Module for testing anything related to executors.""" import os from threading import Thread from django.test import TestCase from norc.core.models import Executor, DBQueue, CommandTask, Instance from norc.core.constants import Status, Request from norc.norc_utils import wait_until, log class ExecutorTest(TestCas...
{ "content_hash": "0f6da7466a394abb3c4b45d3f294a678", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 80, "avg_line_length": 42.657534246575345, "alnum_prop": 0.6705202312138728, "repo_name": "darrellsilver/norc", "id": "bc80a148a90d131413fc934ace4f4fbe9dfa3c55", "size": "3...
from django.db import models # Create your models here. class HouseRace(models.Model): state = models.CharField(max_length=2) district = models.IntegerField(help_text="they use integers for districts; at-large = 1") rating_id = models.IntegerField() rating_label = models.CharField(max_length=63) i...
{ "content_hash": "85694e5b9a5472a8194e220fc68a8a69", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 103, "avg_line_length": 41.86666666666667, "alnum_prop": 0.6942675159235668, "repo_name": "sunlightlabs/read_FEC", "id": "2d4b8fe941e55bf88320c2e52d1d55b0db2056e2", "size":...
from __future__ import absolute_import, print_function from django.contrib.auth import login from sentry import features from sentry.web.forms.accounts import AuthenticationForm from sentry.web.frontend.base import BaseView from sentry.utils.auth import get_auth_providers, get_login_redirect class AuthLoginView(Bas...
{ "content_hash": "5fc38554583bcf578c140b988a7ab3c9", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 97, "avg_line_length": 37.09756097560975, "alnum_prop": 0.6443129520052597, "repo_name": "jokey2k/sentry", "id": "12478c1cd4dc795f0c0d6e860d3dcc1de6e3b68d", "size": "1521",...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from future.moves.urllib.parse import urlparse import json import logging from collections import MutableSet import requests from requests import RequestException from fl...
{ "content_hash": "d9c63a7803063670b0323c9b63129dd9", "timestamp": "", "source": "github", "line_count": 288, "max_line_length": 120, "avg_line_length": 43.708333333333336, "alnum_prop": 0.5644264378773435, "repo_name": "OmgOhnoes/Flexget", "id": "6400aeacc754ce3f3b63456a96ba866dab8f8128", "size": "...
""" parser.mobile package (imdb package). This package provides the IMDbMobileAccessSystem class used to access IMDb's data for mobile systems. the imdb.IMDb function will return an instance of this class when called with the 'accessSystem' argument set to "mobile". Copyright 2005-2012 Davide Alberani <da@erlug.linux...
{ "content_hash": "7ec3aa8e5e4d712530464c04b1399519", "timestamp": "", "source": "github", "line_count": 838, "max_line_length": 81, "avg_line_length": 44.233890214797135, "alnum_prop": 0.4541113629006151, "repo_name": "logituit/Recbot", "id": "e7ab589d36f7b0d6db0293dba73fe5a8f6b00263", "size": "370...
""" Branching recursive sequence (~list or tuple like), except for downward & upward methods: .parent, .root, .map, and built-in support for recursion. History tracking (~paths), support for avoiding loops DirectoryTree: basic Tree, but __getitem__ populates .data via os.listdir Core class itself should be an ABC...
{ "content_hash": "3f0a981a7f1d042b82ffb3d5b5371b49", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 73, "avg_line_length": 29.6875, "alnum_prop": 0.7410526315789474, "repo_name": "OaklandPeters/recursor", "id": "512297bfdc4d8cee3fd2ab8cef7be4caba44e929", "size": "475", ...
"""Test script for ftplib module.""" # Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS # environment import ftplib import asyncore import asynchat import socket import StringIO import errno import os try: import ssl except ImportError: ssl = None from unittest import TestCase ...
{ "content_hash": "5452ca8b1ef788daf103a814eae3e846", "timestamp": "", "source": "github", "line_count": 778, "max_line_length": 85, "avg_line_length": 33.17737789203085, "alnum_prop": 0.5590423059042305, "repo_name": "ktan2020/legacy-automation", "id": "99d34e565c0d3cf2244fa016a7c938116033eebf", "s...
# Copyright 2015 Dejan D. M. Milosavljevic # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
{ "content_hash": "876bfbe306f816f519351bbc7c784230", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 131, "avg_line_length": 34.45783132530121, "alnum_prop": 0.6339160839160839, "repo_name": "dmilos/nucleotide", "id": "7f707e87bf67e0b3f1e1308e962329d3b09c7b68", "size": "28...
from PyObjCTools.TestSupport import * from Quartz.CoreGraphics import * try: unicode except NameError: unicode = str try: long except NameError: long = int class TestCGWindow (TestCase): def testConstants(self): self.assertEqual(kCGWindowIDCFNumberType, kCFNumberSInt32Type) self.a...
{ "content_hash": "8ec2ad16ac50889437f930c95bc3ef05", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 82, "avg_line_length": 38.72839506172839, "alnum_prop": 0.7054510678992668, "repo_name": "albertz/music-player", "id": "3182ceddfab4296d2136aae519446c2135778040", "size": "...
import time import math import random #setup for scooter unoPort = "COM6" i01 = Runtime.createAndStart("i01", "InMoov") # parallax propeller controller serial = Runtime.start("serial","Serial") serial.connect("COM3",115200, 8, 1, 0) #i01.setMute(True) # create parts rather than start them so that they may be custom...
{ "content_hash": "2ef87c6940903b99dedc281656b781ca", "timestamp": "", "source": "github", "line_count": 569, "max_line_length": 125, "avg_line_length": 32.757469244288224, "alnum_prop": 0.6506250335318419, "repo_name": "sstocker46/pyrobotlab", "id": "2f7dd536e9ec0da1eadddfe06549b703c7819d49", "size...
"""Python class that implements Sentencepiece tokenizer. It follows TF.text designers design. """ import tensorflow.compat.v2 as tf # pylint: disable=g-direct-tensorflow-import from tensorflow.python.ops.ragged import ragged_tensor # pylint: disable=g-direct-tensorflow-import from tensorflow_text.core.pybinds impor...
{ "content_hash": "4ac2c6b3007528ea8430b70b3ab4dc89", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 137, "avg_line_length": 44.345454545454544, "alnum_prop": 0.6849118491184912, "repo_name": "tensorflow/text", "id": "8bb767d63dfa1d4a9353183233eff11c59b8d865", "size": "61...
import inspect from sqlalchemy.types import \ BLOB, BOOLEAN, CHAR, CLOB, DATE, DATETIME, DECIMAL, FLOAT, INT, \ NCHAR, NUMERIC, SMALLINT, TEXT, TIME, TIMESTAMP, VARCHAR, \ Binary, Boolean, Date, DateTime, Float, Integer, Interval, Numeric, \ PickleType, SmallInteger, String, Text, Time, Unicode, Unicode...
{ "content_hash": "5134c412b7075c784be5aa312332c438", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 73, "avg_line_length": 41.107142857142854, "alnum_prop": 0.6985230234578628, "repo_name": "carlgao/lenga", "id": "2889a4cde1e2babeb53a45167d40b721bdc3707e", "size": "1374",...
from google.appengine.ext.appstats import recording appstats_CALC_RPC_COSTS = True def webapp_add_wsgi_middleware(app): app = recording.appstats_wsgi_middleware(app) return app
{ "content_hash": "fa84751b1d1723288297b18c59248761", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 51, "avg_line_length": 23.5, "alnum_prop": 0.7659574468085106, "repo_name": "sangwonl/audi", "id": "baf30fb0574472c80392605e9fcad7ea5456973d", "size": "188", "binary": fal...
from .dataObject import BaseDataObject CELL_RDF_TYPE = BaseDataObject.base_namespace.Cell
{ "content_hash": "58810d6dd87e667d141d72b455b3ce48", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 50, "avg_line_length": 30.333333333333332, "alnum_prop": 0.8351648351648352, "repo_name": "gsarma/PyOpenWorm", "id": "b77089e7edb6b9be0da2f6e6d9db2bff04c8c8d1", "size": "91"...
def register(model_or_iterable, **options): """ Registers the given model(s) with the given translation options. The model(s) should be Model classes, not instances. Fields declared for translation on a base class are inherited by subclasses. If the model or one of its subclasses is already re...
{ "content_hash": "f74e035e2da6f743c2a450b90250b259", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 82, "avg_line_length": 36.86363636363637, "alnum_prop": 0.7237977805178791, "repo_name": "tomdyson/wagtail-modeltranslation", "id": "873eab4c1693243426ac0d39bb63ec9d601e3a26"...
"""Code to support homekit_controller tests.""" from datetime import timedelta import json import os from unittest import mock from aiohomekit.model import Accessories, Accessory from aiohomekit.model.characteristics import CharacteristicsTypes from aiohomekit.model.services import ServicesTypes from aiohomekit.testin...
{ "content_hash": "54c82ad65c9c736abd7e3b4448703bb5", "timestamp": "", "source": "github", "line_count": 170, "max_line_length": 85, "avg_line_length": 34.311764705882354, "alnum_prop": 0.6835247728441626, "repo_name": "FreekingDean/home-assistant", "id": "c3c182c8b51e1befeb9405a0927d9b74e1c243b6", ...
import tangelo import cherrypy #just a sample to test the service is up @tangelo.restful def get(sz): tangelo.content_type("application/json") return { "echo" : sz } @tangelo.restful def post(*pargs, **kwargs): body = cherrypy.request.body.read() path = '.'.join(pargs) tangelo.content_type("applic...
{ "content_hash": "1c23ce033b46786f44f70c81c0a736b5", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 55, "avg_line_length": 25.933333333333334, "alnum_prop": 0.6580976863753213, "repo_name": "Sotera/track-communities", "id": "9d79169be30b7a6f38d8c52d55102fec7a2e4b2c", "siz...
from galaxy.web.base.controller import * from galaxy.model.orm import * from galaxy.datatypes import sniff from galaxy import util from galaxy.util.streamball import StreamBall import logging, tempfile, zipfile, tarfile, os, sys if sys.version_info[:2] < ( 2, 6 ): zipfile.BadZipFile = zipfile.error if sys.version_...
{ "content_hash": "c7150795cf8c786c45a0156d7eb1523b", "timestamp": "", "source": "github", "line_count": 1365, "max_line_length": 158, "avg_line_length": 68.52673992673992, "alnum_prop": 0.44183709468777727, "repo_name": "dbcls/dbcls-galaxy", "id": "95d114444378ab236bedc89f8589d1e9391dfb49", "size":...
from .kb_helper import * from .state_tracker import * from .dialog_manager import * from .dict_reader import * from .utils import *
{ "content_hash": "fece31bd0b0ab922da90ef2310f2c924", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 29, "avg_line_length": 27, "alnum_prop": 0.725925925925926, "repo_name": "MiuLab/TC-Bot", "id": "fecba3bb857cdfb105a8f3e16319b9e30a423bd2", "size": "135", "binary": false,...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('deal', '0004_remove_deal_features_benefits'), ] operations = [ migrations.AddField( model_name='deal', name='features_benefi...
{ "content_hash": "c29410e058db7fcd4677b1040d5cab4e", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 65, "avg_line_length": 23.31578947368421, "alnum_prop": 0.5959367945823928, "repo_name": "raytung/Slice", "id": "09a1145b34ff9a24fa577b26fadea34b7415be79", "size": "467", ...
import argparse import os import subprocess import sys ANDROID_LOG_CLASS = 'android.util.Log' FLUTTER_LOG_CLASS = 'io.flutter.Log' def main(): parser = argparse.ArgumentParser(description='Checks Flutter Android library for forbidden imports') parser.add_argument('--stamp', type=str, required=True) parser.add_a...
{ "content_hash": "5296fc21936eae7c1a4d907c58315c90", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 102, "avg_line_length": 24.94871794871795, "alnum_prop": 0.6485097636176773, "repo_name": "chinmaygarde/sky_engine", "id": "2a2d5ac1fbf1f7b85da7af852c1aae3ad00faf02", "size...
import shutil import tarfile from unittest import TestCase from ddsc.core.localstore import LocalFile, LocalFolder, LocalProject, KindType, LocalItemsCounter, ItemsToSendCounter from mock import patch, Mock INCLUDE_ALL = '' def get_file_or_folder_paths(item, prefix=""): results = [] item_path = "" if it...
{ "content_hash": "b8e7806559ddabd7221eec6bc16d8a22", "timestamp": "", "source": "github", "line_count": 276, "max_line_length": 118, "avg_line_length": 40.93840579710145, "alnum_prop": 0.6327108593680857, "repo_name": "Duke-GCB/DukeDSClient", "id": "e6de966a93e997a0fe3ee0bfc02ceff64fb09f62", "size"...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: avi_alertsyslogconfig author: Gaurav Rastogi (grastogi@avinetworks.com) short_description: Module for setup of AlertSyslogConfig Avi RESTful Object...
{ "content_hash": "aafebf258dc48775d7c387c890667d3c", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 84, "avg_line_length": 29.28125, "alnum_prop": 0.6125933831376734, "repo_name": "e-gob/plataforma-kioscos-autoatencion", "id": "584feb518cca72711a03b4f179d77e31ea43df1e", "...
import unittest from ctypes import * formats = "bBhHiIlLqQfd" formats = c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, \ c_long, c_ulonglong, c_float, c_double, c_longdouble class ArrayTestCase(unittest.TestCase): def test_simple(self): # create classes holding simple numeric type...
{ "content_hash": "093aeda45da7bb608904f373fd5d71b7", "timestamp": "", "source": "github", "line_count": 134, "max_line_length": 74, "avg_line_length": 32.85820895522388, "alnum_prop": 0.531910061321826, "repo_name": "ktan2020/legacy-automation", "id": "11c44c7c4b71277486e40cd1790d44b511563ff3", "si...
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="color", parent_name="histogram.legendgrouptitle.font", **kwargs, ): super(ColorValidator, self).__init__( plotly_name=plot...
{ "content_hash": "0f452951ea553c2318548b2b8d270c88", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 66, "avg_line_length": 28.375, "alnum_prop": 0.579295154185022, "repo_name": "plotly/plotly.py", "id": "e7081da9a71891debfca6f9eea0d048155926278", "size": "454", "binary"...
from __future__ import unicode_literals from django.shortcuts import redirect from django.utils.http import urlencode from django.utils.six import string_types from django_core.utils.loading import get_setting try: # python 3 from urllib.parse import urlparse from urllib.parse import parse_qsl except Imp...
{ "content_hash": "092dfecbe12848997c91650438166400", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 78, "avg_line_length": 27.9140625, "alnum_prop": 0.6328015673103834, "repo_name": "InfoAgeTech/django-core", "id": "4dc625edbc908a61e8fd80727ddd08fcec2bc9eb", "size": "357...
""" Write the pseudocode for a function which returns the highest perfect square which is less or equal to its parameter (a positive integer). Implement this in a programming language of your choice. """ def power(number): x = 1 """ check if every square number going up from 1 fits. """ while x * x < ...
{ "content_hash": "cce84c1738449daa765bcbdc164cf772", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 203, "avg_line_length": 29.84, "alnum_prop": 0.6260053619302949, "repo_name": "megasan/210-CT", "id": "c818f8692158f994102b0e27d94e25e4d344e460", "size": "746", "binary":...
"""Camera image classification demo code. Runs continuous image classification on camera frames and prints detected object classes. Example: image_classification_camera.py --num_frames 10 """ import argparse import contextlib from aiy.vision.inference import CameraInference from aiy.vision.models import image_classi...
{ "content_hash": "3824173e3a7370a022dc7583927be908", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 90, "avg_line_length": 34.3469387755102, "alnum_prop": 0.6761734997029115, "repo_name": "google/aiyprojects-raspbian", "id": "f70548590f17b2348d1c6961c358ea744b865263", "si...
from django import forms from django.forms.formsets import all_valid from django.core.urlresolvers import reverse from django.contrib.admin.exceptions import DisallowedModelAdminToField from django.contrib.admin import widgets, helpers from django.contrib.admin.utils import ( unquote, flatten_fieldsets, get_deleted...
{ "content_hash": "f420e5210310bbe7da1846e726aa349b", "timestamp": "", "source": "github", "line_count": 569, "max_line_length": 156, "avg_line_length": 41.065026362038665, "alnum_prop": 0.6140974064880595, "repo_name": "unixhot/opencmdb", "id": "ca293c7acb9b3ca7b0a61ef6b1ade2b6a9cc1e77", "size": "2...
from jedi.parser import Parser from jedi._compatibility import u def test_import_is_nested(): imp = Parser(u('import ')).module.imports[0] # should not raise an error, even if it's not a complete import assert not imp.is_nested()
{ "content_hash": "917adfedea2b180e55c621cfe9cabd72", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 67, "avg_line_length": 30.5, "alnum_prop": 0.7090163934426229, "repo_name": "blueyed/jedi", "id": "850f1e3bcf5859f15330af44c2b0aa04509b8921", "size": "244", "binary": fals...
"""Hierarchical Agglomerative Clustering These routines perform some hierarchical agglomerative clustering of some input data. Authors : Vincent Michel, Bertrand Thirion, Alexandre Gramfort, Gael Varoquaux License: BSD 3 clause """ from heapq import heapify, heappop, heappush, heappushpop import warnings im...
{ "content_hash": "aa749306190ba5a6a997f9821fda7e58", "timestamp": "", "source": "github", "line_count": 1009, "max_line_length": 81, "avg_line_length": 39.00594648166501, "alnum_prop": 0.6138679269253245, "repo_name": "ycaihua/scikit-learn", "id": "5e834a6c6dbed7d366a049b1b8bf90e12a1b3b98", "size":...
""" Stresstest the LCS algorithm. Result when I tried this on my laptop was that I had to go to 100_000_000 tokens before getting over 1s of processing time. So let's assume there are no computational arguments for limiting the input size. """ import sys import time import subprocess token_count = int(sys.argv[1]) ...
{ "content_hash": "1fcc84b34e4033b10c5d388a3a09c80a", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 80, "avg_line_length": 24.4375, "alnum_prop": 0.7225063938618926, "repo_name": "walles/riff", "id": "f2c0fded40b6e5798a7512c070af5ed1ae2e7540", "size": "806", "binary": f...
import random from six import moves from tempest.api.object_storage import base from tempest import clients from tempest.common import custom_matchers from tempest.common.utils import data_utils from tempest import config from tempest import exceptions from tempest import test CONF = config.CONF class AccountTest(...
{ "content_hash": "64d46a4ee87d9beb9ba7c1e84a8fceee", "timestamp": "", "source": "github", "line_count": 338, "max_line_length": 78, "avg_line_length": 43.75443786982248, "alnum_prop": 0.6375684630468591, "repo_name": "cloudbase/lis-tempest", "id": "d615374acb45a08a3b8d5aa65a7c464d7f6554b6", "size":...
"""This module contains the Site Model.""" from google.appengine.ext import db from django.utils.translation import ugettext import soc.models.presence_with_tos import soc.models.program class Site(soc.models.presence_with_tos.PresenceWithToS): """Model of a Site, which stores per site configuration. The Sit...
{ "content_hash": "59b22ede57ac776f2b95cb62e839bb7c", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 93, "avg_line_length": 42.34615384615385, "alnum_prop": 0.7238873751135332, "repo_name": "adviti/melange", "id": "8de5904a81271f8d903188e1c163fa2100af995b", "size": "6115"...
import asyncio import uuid import json import re from aiokafka import AIOKafkaConsumer, AIOKafkaProducer # local imports from nautilus.conventions.actions import serialize_action, hydrate_action class KafkaBroker: """ This class handles two way communication with the kafka server. Also allows for...
{ "content_hash": "04f5066844c618f3d19940624ef12ea7", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 90, "avg_line_length": 33.72636815920398, "alnum_prop": 0.5874022717214928, "repo_name": "AlecAivazis/nautilus", "id": "082c99656a1f6a28963bc3fd8f6d863d19fe51fd", "size": ...
from __future__ import unicode_literals from django.db import migrations from django.contrib.auth.models import Group def create_group(apps, schema_editor): Group.objects.get_or_create(name='Data Entry Users') return class Migration(migrations.Migration): dependencies = [ ('whats_fresh_api', '...
{ "content_hash": "fa2dce1430556cd94f48407f3c7138d8", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 56, "avg_line_length": 21.142857142857142, "alnum_prop": 0.6711711711711712, "repo_name": "osu-cass/whats-fresh-api", "id": "671027f8974886a726c7963fc9c2052ec63225ed", "siz...
"""OnscreenText module: contains the OnscreenText class""" __all__ = ['OnscreenText', 'Plain', 'ScreenTitle', 'ScreenPrompt', 'NameConfirm', 'BlackOnWhite'] from pandac.PandaModules import * import DirectGuiGlobals as DGG from direct.showbase.DirectObject import DirectObject import string,types ## These are the styl...
{ "content_hash": "d348f39615782611036e713d252a77ff", "timestamp": "", "source": "github", "line_count": 407, "max_line_length": 97, "avg_line_length": 33.85012285012285, "alnum_prop": 0.5553458662989039, "repo_name": "jjkoletar/panda3d", "id": "ed212d264322abf84f31b65f51b0bfd96d70af3a", "size": "13...
from oslo_log import log import re from vitrage.evaluator.actions.recipes.execute_mistral import INPUT from vitrage.evaluator.actions.recipes.execute_mistral import WORKFLOW from vitrage.evaluator.template_fields import TemplateFields from vitrage.evaluator.template_functions.function_resolver import is_function from ...
{ "content_hash": "a9d9717904cc121432aab0531c7cf0ec", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 78, "avg_line_length": 38.90909090909091, "alnum_prop": 0.7091121495327103, "repo_name": "openstack/vitrage", "id": "f77525f8331d3f422446d4a6bd164b22770b5b4a", "size": "228...
""" Submodule: defaluts Default parameters for all other submodules, including scf, fci, be and fbe """ from .default_params import *
{ "content_hash": "73d0d8ca3392ddbe0c6a5a3205002a1d", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 54, "avg_line_length": 15.666666666666666, "alnum_prop": 0.7163120567375887, "repo_name": "hongzhouye/frankenstein", "id": "b949607fc18ab7d7691cbbdfc440a6ce89ee75ae", "size"...
from utils import * import sys def format(propName, propList, version): return '// All code points with the `' + propName + '` derived core property as per Unicode v' + version + ':\n[\n\t' + ',\n\t'.join(propList) + '\n];' def main(sourceFile, version): dictionary = parseScriptsOrProps(sourceFile) for item in sor...
{ "content_hash": "7c966db163447cb8ec778e411d22cb7e", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 152, "avg_line_length": 36, "alnum_prop": 0.6666666666666666, "repo_name": "mathiasbynens/unicode-data", "id": "ee32b1dd48212ce96a0556c7da15714dc1c4a1bc", "size": "595", ...
from bs4 import BeautifulSoup import os import re import requests import subprocess import sys import tabulate class OutColors: DEFAULT = '\033[0m' BW = '\033[1m' LG = '\033[0m\033[32m' LR = '\033[0m\033[31m' SEEDER = '\033[1m\033[32m' LEECHER = '\033[1m\033[31m' def helper(): print(OutC...
{ "content_hash": "7e63690a0a98aecd1f0f524e9100b863", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 169, "avg_line_length": 33.675438596491226, "alnum_prop": 0.5319093513935921, "repo_name": "ActiveState/code", "id": "7989f674cb7331c4bc61870230c5b5f81a767950", "size": "4...
import base64 import datetime import decimal import unittest class Test_not_null(unittest.TestCase): def _call_fut(self, value, field): from google.cloud.bigquery._helpers import _not_null return _not_null(value, field) def test_w_none_nullable(self): self.assertFalse(self._call_fut(...
{ "content_hash": "1c3668c945969482fad585eb60de6e7f", "timestamp": "", "source": "github", "line_count": 890, "max_line_length": 88, "avg_line_length": 34.6561797752809, "alnum_prop": 0.5584554532486059, "repo_name": "dhermes/google-cloud-python", "id": "c2c4f9f7f7874e014d896d9b6b6306df07b9660a", "s...
""" Tests For Filter Scheduler. """ import mox from nova.compute import utils as compute_utils from nova.compute import vm_states from nova import context from nova import db from nova import exception from nova.scheduler import driver from nova.scheduler import filter_scheduler from nova.scheduler import host_manage...
{ "content_hash": "cc4ea87b0fd9964d7e85d471281a09b1", "timestamp": "", "source": "github", "line_count": 300, "max_line_length": 79, "avg_line_length": 38.943333333333335, "alnum_prop": 0.5850380895317984, "repo_name": "paulmathews/nova", "id": "12369ec10f8169b424a68a5b89c16d3301fd6ee1", "size": "12...
'''OpenGL extension ARB.framebuffer_object_DEPRECATED Automatically generated by the get_gl_extensions script, do not edit! ''' from OpenGL import platform, constants, constant, arrays from OpenGL import extensions from OpenGL.GL import glget import ctypes EXTENSION_NAME = 'GL_ARB_framebuffer_object' _DEPRECATED = Tru...
{ "content_hash": "6806adea817a5deb49f6831d57a5b072", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 84, "avg_line_length": 39.77777777777778, "alnum_prop": 0.7863128491620112, "repo_name": "Universal-Model-Converter/UMC3.0a", "id": "0c9cc1a622839e7531d5d4387db3eeb3c9fed9b9"...
from PyQt4 import QtGui from PyQt4 import QtCore class BrowserModel(QtGui.QAbstractItemModel) class Main(QtGui.QTreeView): def __init__(self): QtGui.QTreeView.__init__(self) model = QtGui.QFileSystemModel() model.setRootPath( QtCore.QDir.currentPath() ) self.setModel(model) QtCore.QObject....
{ "content_hash": "c266accf7bc410d200c2ac5b6bc8c5b2", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 127, "avg_line_length": 25.03448275862069, "alnum_prop": 0.6859504132231405, "repo_name": "Schizo/MediaBrowser", "id": "7a3c3d40cdddb1629346387363f772ca54f241af", "size": "...
from distutils.core import setup, Extension import os if 'BASE_TOOLS_PATH' not in os.environ: raise "Please define BASE_TOOLS_PATH to the root of base tools tree" BaseToolsDir = os.environ['BASE_TOOLS_PATH'] setup( name="EfiCompressor", version="0.01", ext_modules=[ Extension( 'Efi...
{ "content_hash": "c234b772312828950605fc04c0b09e46", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 84, "avg_line_length": 30.192307692307693, "alnum_prop": 0.5286624203821656, "repo_name": "egraba/vbox_openbsd", "id": "89ac07b91f8fb098b4a1021e7d94b3a276072f59", "size": "...
from __future__ import unicode_literals from django.apps import AppConfig class LinksConfig(AppConfig): name = 'links'
{ "content_hash": "635329fb29d13b04a2d4c1c5566ce5f5", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 39, "avg_line_length": 18, "alnum_prop": 0.746031746031746, "repo_name": "moshthepitt/product.co.ke", "id": "ec972f87e26c93b2b6b93fbb5fe1c4c46add1023", "size": "126", "bin...
"""Discover devices that implement the Ikea Tradfri platform.""" from . import MDNSDiscoverable # pylint: disable=too-few-public-methods class Discoverable(MDNSDiscoverable): """Add support for discovering Ikea Tradfri devices.""" def __init__(self, nd): """Initialize the Cast discovery.""" s...
{ "content_hash": "b2b3205fbe27030e2499765f581b6780", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 67, "avg_line_length": 34.45454545454545, "alnum_prop": 0.6886543535620053, "repo_name": "jules185/IoT_Hackathon", "id": "ea6ded53dc6d3d75395955b99a65f71a293c6629", "size":...
import Queue from threading import Thread from diamond_game import Conf class Event(object): """Generic event class, all Events should extend this class""" def __init__(self, name): self.name = name class TickEvent(Event): def __init__(self): Event.__init__(self, "Tick Event") class Qu...
{ "content_hash": "e9696371aae472f705fc4d7d699d7335", "timestamp": "", "source": "github", "line_count": 317, "max_line_length": 91, "avg_line_length": 29.0788643533123, "alnum_prop": 0.5834237361683663, "repo_name": "batousik/Python2-Diamond", "id": "d38fd78ddeefca993c4f1289bc37a129a0ce83d1", "size...
from argparse import ArgumentParser, FileType import time import warnings import os, sys, io import signal class ArgParser(object): def __init__(self, description, version): self.__description = description self.__version = version self.__parser = None self.__initialized...
{ "content_hash": "963c4bb65352058fcd3b8f6a2f29270c", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 217, "avg_line_length": 65.9009900990099, "alnum_prop": 0.6544471153846154, "repo_name": "holly/gistcli", "id": "f9625a8878d9b1eb5411e1357b4ee19334739a72", "size": "6704",...
""" #;+ #; NAME: #; utils #; Version 1.0 #; #; PURPOSE: #; Plotting utilities #; 24-Nov-2014 by JXP #;- #;------------------------------------------------------------------------------ """ from __future__ import print_function, absolute_import, division, unicode_literals import numpy as np import pdb #def se...
{ "content_hash": "9aed6ab34ebefa1a99e61f44f5160fca", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 82, "avg_line_length": 23.24, "alnum_prop": 0.5559380378657487, "repo_name": "nhmc/xastropy", "id": "c1457e834dbdd22aa62477343a06e1c9a8065c6d", "size": "1743", "binary": ...
"""The go plugin can be used for go projects using `go get`. This plugin uses the common plugin keywords, for more information check the 'plugins' topic. This plugin uses the common plugin keywords as well as those for "sources". For more information check the 'plugins' topic for the former and the 'sources' topic for ...
{ "content_hash": "5241ac53075304b1d78482c6d3ea9411", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 79, "avg_line_length": 35.55339805825243, "alnum_prop": 0.6004915346805024, "repo_name": "dz0ny/champ", "id": "e4bdf2f64dd2a93e9bbfd7b3f916ff06381f202a", "size": "4329", ...
from functools import reduce # from . import ast class Document(object): """Base class for documents to be pretty printed.""" pass class Text(Document): """Textual element in a document.""" def __init__(self, text): self._text = text def __str__(self): return "Text('%s')" % self...
{ "content_hash": "d0335b0b0921fba38aec58eac8b74495", "timestamp": "", "source": "github", "line_count": 379, "max_line_length": 79, "avg_line_length": 29.102902374670183, "alnum_prop": 0.5364460562103355, "repo_name": "robertjpayne/rethinkdb", "id": "40eac338b01e68502fe07597063727a7da4d1531", "size...
import json import logging import sys from logging.handlers import RotatingFileHandler from os.path import join, exists from shutil import rmtree def get_domain(): from .core.models import Configuration return Configuration.get('domain', 'company.com') def get_menu_links(): from .core.models import Con...
{ "content_hash": "ced11d78856a6692b72465bdec38f439", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 79, "avg_line_length": 26.093457943925234, "alnum_prop": 0.620702005730659, "repo_name": "tobyqin/testcube", "id": "7537b9ec16d62414687af0b7e2d3bf2bcab5b466", "size": "279...
import logging import smtplib from email.mime.text import MIMEText LOG = logging.getLogger('root') class notify(object): def email(self, to_list, message, subject="Notification", from_address="nobody@nowhere", smtp_server="pobox1663.lanl.gov"): LOG.debug("Sending an email.") email = MIMEText(m...
{ "content_hash": "a646d57562722ddd42c1a508edd48d1d", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 127, "avg_line_length": 24.5, "alnum_prop": 0.6292517006802721, "repo_name": "hpc/hypnotoad", "id": "fcde56790a3c4755ce3c80cccf5747b290d5c626", "size": "635", "binary": f...
"""This script is meant to be run on a Swarming slave.""" import os import sys def main(): print('Hello world: ' + sys.argv[1]) if len(sys.argv) == 3: # Write a file in ${ISOLATED_OUTDIR}. with open(os.path.join(sys.argv[2], 'happiness.txt'), 'wb') as f: f.write( 'is where you look %d/%d'...
{ "content_hash": "15d9902181f639667effbe50130075b8", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 69, "avg_line_length": 24.3, "alnum_prop": 0.5637860082304527, "repo_name": "Teamxrtc/webrtc-streaming-node", "id": "d8a49d7ed00aaea2cf770a70710073f6a4fde791", "size": "686...
import logging import unittest from ipaddress import IPv6Network import config import thread_cert # Test description: # This test verifies bi-directional connectivity between Thread end device # and infra host. # # Topology: # ----------------(eth)-------------------- # | | # ...
{ "content_hash": "17b1c8c06fd71e8a4aa604abae3f82ef", "timestamp": "", "source": "github", "line_count": 323, "max_line_length": 101, "avg_line_length": 41.23839009287926, "alnum_prop": 0.6360360360360361, "repo_name": "openthread/openthread", "id": "1028629dfdc12a18e61b8d30856307d52faac8d5", "size"...
""" :Author Patrik Valkovic :Created 01.08.2017 08:46 :Licence MIT Part of grammpy """ from .CannotConvertException import CannotConvertException class NotASingleSymbolException(CannotConvertException): """ More symbols defined at the place where one symbol is expected """ def __init_...
{ "content_hash": "9633d38a88dce92770b187d7a31103da", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 66, "avg_line_length": 21.823529411764707, "alnum_prop": 0.6900269541778976, "repo_name": "PatrikValkovic/grammpy", "id": "e783ae8cc1f5238dabc23821d6221621f286d98c", "size"...
import queue import random import time from collections import defaultdict import simplejson as json from google.protobuf.json_format import MessageToJson from pyqrllib.pyqrllib import bin2hstr, hstr2bin from twisted.internet import reactor from twisted.internet.protocol import ServerFactory from qrl.core import con...
{ "content_hash": "f9259754ad95856750781c983b5ee620", "timestamp": "", "source": "github", "line_count": 317, "max_line_length": 154, "avg_line_length": 36.1608832807571, "alnum_prop": 0.6099624880048853, "repo_name": "elliottdehn/QRL", "id": "727816cf5c939a0c43203f1afdd4e3935bec8612", "size": "1147...
""" Template MainWindowBase.py """ #Author: Miguel Molero <miguel.molero@gmail.com> import sys import os from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtCore import pyqtSignal as Signal import markdown2 import yaml import pprint #own components from pcloudpy.gui.reso...
{ "content_hash": "49baab245bdf98442046099a4ba307be", "timestamp": "", "source": "github", "line_count": 350, "max_line_length": 163, "avg_line_length": 33.714285714285715, "alnum_prop": 0.6441525423728813, "repo_name": "mmolero/pcloudpy", "id": "d71ad7bc63d605990df62c726642a9a0dfee3e2a", "size": "1...
import zxlolbot class helloworld(zxlolbot.zxLoLBoT): def __init__(self, username, password, region="NA"): zxlolbot.zxLoLBoT.__init__(self, username, password, region) @zxlolbot.botcommand def hello(self, sender, args): """Replies Hello world to the sender Usage: hello Example: hello""" self.message(sender...
{ "content_hash": "e9b898f6de15c54e8916e57e886b29a0", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 62, "avg_line_length": 30, "alnum_prop": 0.6952380952380952, "repo_name": "Mathzx/zxLoLBoT", "id": "bd70e7bc0902dfb78e9024eadf4d5d9be4b8635c", "size": "420", "binary": fa...
from holiday import * import utils import report_card import datetime import pytz import csv import cPickle as pickle import datetime import ephem # run `pip install pyephem` import os import collections import string import time import cPickle as pickle import numpy as np import pytz import datetim...
{ "content_hash": "620b6e95cd05376559e23901678da246", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 80, "avg_line_length": 21, "alnum_prop": 0.658008658008658, "repo_name": "dssg/energywise", "id": "cffa34a66d2940dc9327f4991eabfffd7609a06f", "size": "1155", "binary": fa...
import multiprocessing import os import random import select import socket import time from time import perf_counter as clock import numpy as np import tables as tb # create a PyTables file with a single int64 array with the specified number of # elements def create_file(array_size): array = np.ones(array_size, ...
{ "content_hash": "ec24b7789304a532373e652a4f483335", "timestamp": "", "source": "github", "line_count": 218, "max_line_length": 79, "avg_line_length": 39.091743119266056, "alnum_prop": 0.6406946726120629, "repo_name": "PyTables/PyTables", "id": "be7220263aebf8f0cf9faca60c4d2d594697cd2f", "size": "9...
""" configuration.py Created by Thomas Mangin on 2009-08-25. Copyright (c) 2009-2013 Exa Networks. All rights reserved. """ import os import sys import stat import time import socket from pprint import pformat from copy import deepcopy from struct import pack,unpack from exabgp.util.ip import isipv4 from exabgp.co...
{ "content_hash": "59daf80cbfc5e953a065240e101777ae", "timestamp": "", "source": "github", "line_count": 2682, "max_line_length": 487, "avg_line_length": 32.3214019388516, "alnum_prop": 0.6583646724961355, "repo_name": "mshahbaz/exabgp", "id": "5e66a597f94bd414da672195c91b7a38918c79dc", "size": "867...
# Hive Netius System # Copyright (c) 2008-2020 Hive Solutions Lda. # # This file is part of Hive Netius System. # # Hive Netius System is free software: you can redistribute it and/or modify # it under the terms of the Apache License as published by the Apache # Foundation, either version 2.0 of the License, o...
{ "content_hash": "adf9cccf5bde51286fff54f3d5ba5d2d", "timestamp": "", "source": "github", "line_count": 1360, "max_line_length": 90, "avg_line_length": 36.93382352941177, "alnum_prop": 0.5740792355166235, "repo_name": "hivesolutions/netius", "id": "25521560394c30051c50c2c7a1059b9d6a431fb2", "size":...
import json from django import forms from django.conf import settings from django.contrib.admin.utils import ( display_for_field, flatten_fieldsets, help_text_for_field, label_for_field, lookup_field, ) from django.core.exceptions import ObjectDoesNotExist from django.db.models.fields.related import ManyToMany...
{ "content_hash": "2019094f69f61f8926f290de766a62d9", "timestamp": "", "source": "github", "line_count": 407, "max_line_length": 117, "avg_line_length": 38.21375921375921, "alnum_prop": 0.5843245676075355, "repo_name": "simonw/django", "id": "0337c50010257f8a081fa5e0352efd8888619403", "size": "15553...
from django.contrib import messages from django.utils.translation import ugettext from registration import signals from registration.backends.simple import SimpleBackend from userprofile import utils class SimpleBackend(SimpleBackend): def get_form_class(self, request): return utils.get_profile_model()....
{ "content_hash": "25a11e2c083c567af087d13de82c9284", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 68, "avg_line_length": 31.34426229508197, "alnum_prop": 0.6365062761506276, "repo_name": "praekelt/django-userprofile", "id": "03dc26bbf63eb08eb9b0b48c322de3c2a672d943", "s...
"""Support for Z-Wave cover devices.""" from __future__ import annotations from typing import Any, cast from zwave_js_server.client import Client as ZwaveClient from zwave_js_server.const import TARGET_STATE_PROPERTY, TARGET_VALUE_PROPERTY from zwave_js_server.const.command_class.barrier_operator import BarrierState ...
{ "content_hash": "ad747fea659f3a23de5d1c599ff910aa", "timestamp": "", "source": "github", "line_count": 286, "max_line_length": 94, "avg_line_length": 35.50699300699301, "alnum_prop": 0.6415558838010832, "repo_name": "w1ll1am23/home-assistant", "id": "b3f3aeaf1c04814dffee2a1a48654d1098946828", "siz...
from urlparse import urljoin from urllib import urlencode, urlopen from django.db import models from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from cas.exceptions import CasTicketException, CasConfigException # Ed Crewe - add in signals to delete old tickets from django.db.model...
{ "content_hash": "0955105513fc22595a60cf56c510c7ac", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 77, "avg_line_length": 32.89333333333333, "alnum_prop": 0.6445074989866234, "repo_name": "divio/django-cas", "id": "480c8bb187eee3aeae1de19fd6720c238260625f", "size": "2467...
"""Example for aiohttp.web websocket server """ import asyncio import os from aiohttp.web import (Application, Response, WebSocketResponse, WSMsgType, run_app) WS_FILE = os.path.join(os.path.dirname(__file__), 'websocket.html') async def wshandler(request): resp = WebSocketResponse() ...
{ "content_hash": "ae61f0bc5914af1047cd931d294f3f31", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 77, "avg_line_length": 25.52542372881356, "alnum_prop": 0.5876494023904383, "repo_name": "esaezgil/aiohttp", "id": "6456230dc2d060b067f3ad49941db54b83dd9378", "size": "1529...
import argparse import socket import sys from socket import gethostbyaddr, gethostbyname_ex DESCRIPTION = \ "Queries for known hostnames/IP addresses of the given\ hostname/IP argument(s)\ " class memoize(object): """Decorator that caches a function's return value each time it is called. If cal...
{ "content_hash": "0c0ad1e324f8acb201576f7e8bb7f277", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 78, "avg_line_length": 28.251908396946565, "alnum_prop": 0.6052418265333693, "repo_name": "axtl/allookup", "id": "163744306482deab6be3400fa877f051addd4117", "size": "4876"...
from __future__ import absolute_import import sys from unittest import TestCase as BaseTestCase from uitools import trampoline from uitools.qt import QtCore, QtGui, Qt from uitools.trampoline import bounce, sleep, qpath from mayatools.test import requires_maya try: from maya import cmds, mel except ImportError:...
{ "content_hash": "915406ded7871daf630fd42f69a81071", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 51, "avg_line_length": 21.102564102564102, "alnum_prop": 0.6537059538274606, "repo_name": "westernx/mayatools", "id": "ecb1eb94e4ba8fe8d67d3dcfd758936bf3af5ff5", "size": "8...
""" Constants useful across modules. """ import pandas as pd # Record some data from the GTFS reference at # https://developers.google.com/transit/gtfs/reference/ columns = ["table", "table_required", "column", "column_required", "dtype"] rows = [ ["agency", True, "agency_id", False, "str"], ["agency", True, ...
{ "content_hash": "2e6324bd749a524863cd3f35206c7c0d", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 77, "avg_line_length": 40.825806451612905, "alnum_prop": 0.5756953223767383, "repo_name": "araichev/gtfstk", "id": "1a9d3b8a0b1dca017bfcb0d7edd84affb508953f", "size": "632...
from __future__ import annotations from collections.abc import Callable, Iterable, Iterator, Mapping from typing import AnyStr, BinaryIO, IO, Optional, TypeVar, overload import xml.etree.ElementTree as ET from xml.sax.saxutils import escape, quoteattr from .util import itemize T = TypeVar("T") @overload def load_xml...
{ "content_hash": "e17952252587e719343fd2d956fabba2", "timestamp": "", "source": "github", "line_count": 184, "max_line_length": 87, "avg_line_length": 40.22826086956522, "alnum_prop": 0.6590110780870035, "repo_name": "jwodder/javaproperties", "id": "17f6eda5c6f760cac59eaa86193cde52ae558d86", "size"...
import sys, paramiko, time, re, signal, os, getpass, argparse from subprocess import Popen, PIPE from ethip import ethip def stop(signal, frame): print exit(1) def host_exec(command, channel): if channel.recv_ready(): channel.recv(2048) channel.send('%s\n' % command) result = '' while ...
{ "content_hash": "07ae6dc232efc90db1e8585caaaaebe4", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 338, "avg_line_length": 40.27884615384615, "alnum_prop": 0.6068274051086178, "repo_name": "DavidMulder/vmsh", "id": "03879ece1cf901ebf8452c27f497e8565b544bc3", "size": "42...
""" Processing tools for main content. """ from urllib.parse import urlunsplit, urlparse from collections import namedtuple from bs4 import BeautifulSoup # Compatible with tuples form urllib.parse URL = namedtuple('URL', 'scheme netloc path query fragment') URL.__new__.__defaults__ = ('http', '', '', '', '', '') d...
{ "content_hash": "14856f72a47771904f8c2cc9a287b9c4", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 67, "avg_line_length": 34.10909090909091, "alnum_prop": 0.5772921108742004, "repo_name": "lsst-sqre/community_mailbot", "id": "efaa59ae843840c840521fa590c6fef309ab2ecd", "s...
from tastypie import fields from spa.api.v1.BaseResource import BaseResource from spa.models.release import ReleaseAudio class ReleaseAudioResource(BaseResource): release = fields.ToOneField('spa.api.v1.ReleaseResource.ReleaseResource', 'release') class Meta: queryset = ReleaseAudio.objects.al...
{ "content_hash": "60016a7aa064dd011af3bd96f4cc847a", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 88, "avg_line_length": 32.8235294117647, "alnum_prop": 0.6523297491039427, "repo_name": "fergalmoran/dss", "id": "55f25abbaba790dacfee798acb0cae7dee627944", "size": "558", ...
from unittest import TestCase, mock from airflow.providers.google.marketing_platform.sensors.search_ads import GoogleSearchAdsReportSensor API_VERSION = "api_version" GCP_CONN_ID = "google_cloud_default" class TestSearchAdsReportSensor(TestCase): @mock.patch( "airflow.providers.google.marketing_platform...
{ "content_hash": "495facd3ac7ceef3aedd2ddaa14f65c1", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 102, "avg_line_length": 35.48148148148148, "alnum_prop": 0.6837160751565762, "repo_name": "mtagle/airflow", "id": "898b8945023e8d42e936fe16d8ae7bd15051129e", "size": "1745"...
""" (c) Copyright 2016 Hewlett-Packard Enterprise Development Company, L.P. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applic...
{ "content_hash": "d7929aea017143c350dc517e2ce18b21", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 79, "avg_line_length": 32.794520547945204, "alnum_prop": 0.70843776106934, "repo_name": "szaher/freezer-api", "id": "95df53deaa05af5bf832a8d6708fe0b7e393cc66", "size": "239...
import unittest from unittest import mock from template import * class TestTemplate(unittest.TestCase): def test_create_concret_class(self): obj = FireFighter() self.assertIsInstance(obj,FireFighter) obj = Lumberjack() self.assertIsInstance(obj,Lumberjack) obj = Postman()...
{ "content_hash": "b12c91d388c3fe81ee68990cedcc42b5", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 87, "avg_line_length": 45.28395061728395, "alnum_prop": 0.6357688113413305, "repo_name": "AnhellO/DAS_Sistemas", "id": "c700f379b1c1bc9d963b46d0e6be1398efea9ed1", "size": "...
from sklearn2sql_heroku.tests.regression import generic as reg_gen reg_gen.test_model("LGBMRegressor" , "RandomReg_10" , "duckdb")
{ "content_hash": "eed55b0ffb8dd24eb557b731f1c69d67", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 66, "avg_line_length": 33.25, "alnum_prop": 0.7669172932330827, "repo_name": "antoinecarme/sklearn2sql_heroku", "id": "df86cd2215559cf75e39c570ca7c5cdbce1cdefc", "size": "13...
"""The task-based multi-process processing analysis engine.""" import collections import os import time from plaso.containers import counts from plaso.containers import events from plaso.containers import reports from plaso.containers import tasks from plaso.engine import processing_status from plaso.lib import defin...
{ "content_hash": "6946dbe31a6fa0802a85547570fd3fc4", "timestamp": "", "source": "github", "line_count": 695, "max_line_length": 80, "avg_line_length": 35.35107913669065, "alnum_prop": 0.6785786967316537, "repo_name": "log2timeline/plaso", "id": "f83e24ed622b928622db7d84ac2146657a4fbc52", "size": "2...
import threading import logging import random import time from termcolor import colored from concolica import emulator from concolica import interlocked from concolica import serialisation from concolica.vulnerabilities import * import smt.bitvector as bv _log = logging.getLogger('concolica') max_threads = 24 ac...
{ "content_hash": "e7e259e2514d30c622c1a37cba2a7bba", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 96, "avg_line_length": 31.061068702290076, "alnum_prop": 0.5001228803145736, "repo_name": "c01db33f/concolica", "id": "2644430f8f25b091c04a6860d1439c1003071456", "size": "...
import redis import random import string forSelect = string.ascii_letters + string.digits def generate_code(count, length): for x in range(count): Re = "" for y in range(length): Re += random.choice(forSelect) yield Re def save_code(): r = redis.Redis(host='127.0.0.1', p...
{ "content_hash": "197234ca7f6d647211d402a6790f5181", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 69, "avg_line_length": 20.25925925925926, "alnum_prop": 0.5850091407678245, "repo_name": "Yrthgze/prueba-sourcetree2", "id": "bb6f4480a9bffb217e1a143e750b44b4199238ed", "si...
from unittest import skipIf, skipUnless from django.contrib.gis.db.models import fields from django.contrib.gis.geos import MultiPolygon, Polygon from django.core.exceptions import ImproperlyConfigured from django.db import connection, migrations, models from django.db.migrations.migration import Migration from django...
{ "content_hash": "f94037d4d6dedca8936e9b78db1349e6", "timestamp": "", "source": "github", "line_count": 227, "max_line_length": 104, "avg_line_length": 40.99559471365639, "alnum_prop": 0.657317859445519, "repo_name": "theo-l/django", "id": "22bda55302696169a964bbe1dc03805bdce63eb2", "size": "9306",...