text
stringlengths
4
1.02M
meta
dict
"""napalm.junos package.""" # Import local modules from napalm.junos.junos import JunOSDriver # noqa
{ "content_hash": "92e6fe5e9e8c0e31b93020f1864acacc", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 50, "avg_line_length": 25.75, "alnum_prop": 0.7475728155339806, "repo_name": "napalm-automation/napalm", "id": "54364ef717d11356623f756555e6a20e2fb76ea2", "size": "728", "...
""" Support for an exposed aREST RESTful API of a device. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.arest/ """ import logging from datetime import timedelta import requests import voluptuous as vol from homeassistant.components.sensor impor...
{ "content_hash": "f5047192c2ef30c2552f2d8711215fd6", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 79, "avg_line_length": 34.34375, "alnum_prop": 0.6079769487412799, "repo_name": "JshWright/home-assistant", "id": "6edef785280e807b5870828e19a1ad2d0a869df2", "size": "6594...
import os try: import zlib binascii = zlib except ImportError: zlib = None import binascii from base64 import urlsafe_b64encode from auth import up as auth_up import conf _workers = 1 _task_queue_size = _workers * 4 _try_times = 3 _block_bits = 22 _block_size = 1 << _block_bits _block_mask = _block_si...
{ "content_hash": "1a469c421701a4447fa333dc32ecc462", "timestamp": "", "source": "github", "line_count": 176, "max_line_length": 95, "avg_line_length": 29.857954545454547, "alnum_prop": 0.6137012369172217, "repo_name": "jemygraw/qrsync-python", "id": "cc544b86ea3d219c80752fffb20ccfea6a3c33fd", "size...
def index(): response.flash = T('Welcome to my resume/cv.') response.title = T('KPW CV') #projects = db(db.project).select() projects = '' posts = '' courses = db(db.course).select(orderby=db.course.title) jobs = db(db.professional_experience.intern == False).select(orderby=~db.professional_...
{ "content_hash": "d745c327f9150fad192857eb1169d37c", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 218, "avg_line_length": 60.73684210526316, "alnum_prop": 0.733102253032929, "repo_name": "highlanderkev/kpw.org", "id": "032b727bb310cb753b39525d75a9148ee0c53a0e", "size": ...
import atexit import telemetry.internal.platform.power_monitor as power_monitor def _ReenableChargingIfNeeded(battery): if not battery.GetCharging(): battery.TieredSetCharging(True) class PowerMonitorController(power_monitor.PowerMonitor): """ PowerMonitor that acts as facade for a list of PowerMonitor ob...
{ "content_hash": "1091e3348652b9f97b1a5713bee97407", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 78, "avg_line_length": 31.95, "alnum_prop": 0.729264475743349, "repo_name": "googlearchive/big-rig", "id": "31c98180e4bb16676db1aec65476961bef003725", "size": "1441", "bi...
""" Created on Wed Dec 7 12:43:48 2016 @author: cristinamenghini """ """ -------------------------------------------------------------------------- This script contains helper functions for the parser. ----------------------------------------------------------------------------""" # Import useful libraries import r...
{ "content_hash": "15cd7cad090bc3a1a4f6267739967135", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 90, "avg_line_length": 33.96551724137931, "alnum_prop": 0.5903553299492386, "repo_name": "CriMenghini/Wikipedia", "id": "dc87db6d7f1d8b4aa6aee9b91f405c057652c344", "size": ...
from django.conf.urls import patterns, include, url from dashboard import views urlpatterns = patterns( '', url(r'^$', views.IndexView.as_view(), name='index'), )
{ "content_hash": "5426de3a7bea955016f5963afe05ed0f", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 56, "avg_line_length": 21.625, "alnum_prop": 0.6820809248554913, "repo_name": "simonv3/django-gulp-mithril-starter", "id": "7f51e72bcd4460db0a14157224de7f5cae9ef07d", "size"...
from ducktape.mark import parametrize from ducktape.mark.resource import cluster from kafkatest.tests.kafka_test import KafkaTest from kafkatest.services.streams import StreamsEosTestDriverService, StreamsEosTestJobRunnerService, \ StreamsComplexEosTestJobRunnerService, StreamsEosTestVerifyRunnerService, StreamsCom...
{ "content_hash": "58a4c38763100fd2d82745bd4a52a905", "timestamp": "", "source": "github", "line_count": 159, "max_line_length": 129, "avg_line_length": 54.44654088050314, "alnum_prop": 0.684301721150514, "repo_name": "Chasego/kafka", "id": "bf07cb41062464b2a4383cabf293659a614c641b", "size": "9438",...
from .statement import Statement from . import _import class AssumeStmt(Statement): def __init__(self, kwargs={}): super(AssumeStmt, self).__init__(kwargs) locs = _import() # Expression expr expr = kwargs.get(u'expr', {}) self._expr = locs[expr[u'@t']](expr) if exp...
{ "content_hash": "7fdb61c1a9a02fa7c41ef9b072525e1f", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 62, "avg_line_length": 24.9, "alnum_prop": 0.5602409638554217, "repo_name": "plum-umd/java-sketch", "id": "ba230b45682c94a66841e2a7ac5503b31f53fe21", "size": "521", "bina...
from django.forms import ModelForm, Textarea from questions.models import Answer, Question class AnswerForm(ModelForm): class Meta: model = Answer fields = ['answer_text'] widgets = { 'answer_text': Textarea(attrs={'id': 'answer-text', 'required': 'True', 'cols': 70, 'rows': 10...
{ "content_hash": "9ef56c2e209246a98fb594d32008ad7f", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 109, "avg_line_length": 29.03448275862069, "alnum_prop": 0.5973871733966746, "repo_name": "Kuzenkov/SimpleAnalogueStackOverflow", "id": "f488662d4ab99a441bc65fe151fe70bf197c7...
import os from IPython.lib import passwd #c = c # pylint:disable=undefined-variable c = get_config() c.NotebookApp.ip = '0.0.0.0' c.NotebookApp.port = int(os.getenv('PORT', 8888)) c.NotebookApp.open_browser = False # sets a password if PASSWORD is set in the environment if 'PASSWORD' in os.environ: password = os.e...
{ "content_hash": "fe6eef99544b07b222849d898fbf7d9e", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 55, "avg_line_length": 27.666666666666668, "alnum_prop": 0.7068273092369478, "repo_name": "mlperf/training_results_v0.7", "id": "bd5494812303bee0471d0d7d0a4d259da6fbed4e", ...
"""Undocumented Module""" __all__ = ['SfxPlayer'] import math from panda3d.core import * class SfxPlayer: """ Play sound effects, potentially localized. """ UseInverseSquare = 0 def __init__(self): # volume attenuates according to the inverse square of the # distance from the so...
{ "content_hash": "2d5c5671a129d2e2fd0a6d5c68626c92", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 81, "avg_line_length": 34.63, "alnum_prop": 0.579844065838868, "repo_name": "mgracer48/panda3d", "id": "2fb97eae322f4173834e41348872d1d48afae566", "size": "3463", "binar...
from marshmallow import EXCLUDE, fields, validate from polyaxon.api import STATIC_V1 from polyaxon.contexts import paths as ctx_paths from polyaxon.env_vars.keys import ( EV_KEYS_ARCHIVE_ROOT, EV_KEYS_DNS_BACKEND, EV_KEYS_DNS_CUSTOM_CLUSTER, EV_KEYS_DNS_PREFIX, EV_KEYS_DNS_USE_RESOLVER, EV_KEYS...
{ "content_hash": "d707268d332559fe7718aae5a7776e43", "timestamp": "", "source": "github", "line_count": 232, "max_line_length": 87, "avg_line_length": 38.98706896551724, "alnum_prop": 0.6595909342177999, "repo_name": "polyaxon/polyaxon", "id": "537871146857331f7bae8d83bf3fabed2198dd29", "size": "96...
import anki print anki.__all__
{ "content_hash": "c13584f2bfcdafaa59de2cb69168d82e", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 18, "avg_line_length": 10.666666666666666, "alnum_prop": 0.6875, "repo_name": "jlitven/vexer", "id": "6abb516e794fac0fbca1c05d07bbbeb84fac970b", "size": "32", "binary": fa...
""" Support for Ankuoo RecSwitch MS6126 devices. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/switch.recswitch/ """ import logging import voluptuous as vol from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchDevice from homeassistant....
{ "content_hash": "75df31f03f7ec9d34da5ac6deb250d56", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 75, "avg_line_length": 30.594059405940595, "alnum_prop": 0.6469255663430421, "repo_name": "tinloaf/home-assistant", "id": "636c302cea118d227a179a3ed7c3b448d789653c", "size...
import sys from qt5-base-5.4.03 import * app = QApplication(sys.argv) button = QPushButton("Hello world0",None) button.show() app.exec_()
{ "content_hash": "0a6aaf01aebb77ec1a938bb5743badee", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 41, "avg_line_length": 22.833333333333332, "alnum_prop": 0.7372262773722628, "repo_name": "WCP52/docs", "id": "60fd90d44c3b329b2ca6f7a455e3562ca1c56a8a", "size": "137", "b...
"""This API defines FeatureColumn abstraction. FeatureColumns provide a high level abstraction for ingesting and representing features. FeatureColumns are also the primary way of encoding features for canned `tf.estimator.Estimator`s. When using FeatureColumns with `Estimators`, the type of feature column you should ...
{ "content_hash": "1467ad60a62e91e3570e1ad4e4c4d8bd", "timestamp": "", "source": "github", "line_count": 4727, "max_line_length": 128, "avg_line_length": 40.067696213243075, "alnum_prop": 0.6746092925026399, "repo_name": "renyi533/tensorflow", "id": "7a6bb73d121ced2debd5c9c7993feff14c550eb5", "size"...
from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response from django.template import RequestContext from django.contrib.auth.models import User from hasi.gadgets.models import Gadget, GadgetSubdevice, UserGadget def gadgets(request): # Ladet Userspezifisch die Gadget...
{ "content_hash": "b0658309271e88895ac532953a9f550b", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 79, "avg_line_length": 43.74074074074074, "alnum_prop": 0.6875529212531752, "repo_name": "tscholze/py-hasi-home-analytical-system-interface", "id": "c238f1661bb41a88eb535ce25...
"""Diagnostics support for HomeKit Controller.""" from __future__ import annotations from typing import Any from aiohomekit.model.characteristics.characteristic_types import CharacteristicsTypes from homeassistant.components.diagnostics import REDACTED, async_redact_data from homeassistant.config_entries import Conf...
{ "content_hash": "1e8ad292783e2dec4859e50b4cd749d2", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 86, "avg_line_length": 33.27131782945737, "alnum_prop": 0.651910531220876, "repo_name": "GenericStudent/home-assistant", "id": "f83ce7604cf74643cf0cf210ec286890e0a4335a", ...
class error(Exception): pass import sys # at least we can count on this! def FileExists(fname): """Check if a file exists. Returns true or false. """ import os try: os.stat(fname) return 1 except os.error, details: return 0 def IsPackageDir(path, packageName, knownFil...
{ "content_hash": "fe81f82bef920021a19a2ed5efb2285f", "timestamp": "", "source": "github", "line_count": 517, "max_line_length": 182, "avg_line_length": 38.59574468085106, "alnum_prop": 0.6450836924927333, "repo_name": "Titulacion-Sistemas/PythonTitulacion-EV", "id": "b28848d8c98f641ea911eadfdd0199b02...
import tensorflow as tf import numpy as np trX = np.linspace(-1, 1, 101) trY = 2 * trX + np.random.randn(*trX.shape) * 0.33 # create a y value which is approximately linear but with some random noise X = tf.placeholder("float") # create symbolic variables Y = tf.placeholder("float") def model(X, w): return tf.m...
{ "content_hash": "2168df3bedd892e82a1a5cc2d1a63ea5", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 131, "avg_line_length": 33.38709677419355, "alnum_prop": 0.6879227053140097, "repo_name": "AdityaSoni19031997/Machine-Learning", "id": "5d93b5401027b9befd814e91728dc28c026985...
import os # import kivy import kivy kivy.require('1.9.1') from kivy.app import App from kivy.core.window import Window from kivy.uix.floatlayout import FloatLayout # import whole core managers from pocketthrone.managers.locator import L from pocketthrone.managers.eventmanager import EventManager from pocketthrone.man...
{ "content_hash": "e356686db90c5136303c3c6a17865330", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 65, "avg_line_length": 31.47787610619469, "alnum_prop": 0.7745290975541186, "repo_name": "herrschr/prey-game", "id": "a40257d4b797519af3e3d8a78ab5cba8f8c980d9", "size": "3...
""" Single VsOne Chip Match Interface For VsMany Interaction Interaction for looking at matches between a single query and database annotation Main development file CommandLine: python -m ibeis.viz.interact.interact_matches --test-show_coverage --show """ from __future__ import absolute_import, division, print_f...
{ "content_hash": "40380c148b28caab074d07f5aee8de87", "timestamp": "", "source": "github", "line_count": 373, "max_line_length": 114, "avg_line_length": 37.938337801608576, "alnum_prop": 0.5533177867288531, "repo_name": "SU-ECE-17-7/ibeis", "id": "7923c644fe8fc277146b8d6711ed96a300478532", "size": "...
"""EC-3PO EC Interpreter interpreter provides the interpretation layer between the EC UART and the user. It receives commands through its command pipe, formats the commands for the EC, and sends the command to the EC. It also presents data from the EC to either be displayed via the interactive console interface, or s...
{ "content_hash": "d0376593798d11bc1afe6b9b243b70a3", "timestamp": "", "source": "github", "line_count": 402, "max_line_length": 80, "avg_line_length": 38.191542288557216, "alnum_prop": 0.6631277274799714, "repo_name": "akappy7/ChromeOS_EC_LED_Diagnostics", "id": "23e896c640f86f5a3e69d92966555287bb296...
"""The influence of windowing of log. bandlimited sweep signals when using a Kaiser Window by fixing beta (=2) and fade_out (=0). fstart = 100 Hz fstop = 5000 Hz """ import sys sys.path.append('..') import measurement_chain import plotting import calculation import ir_imitation import generation import mat...
{ "content_hash": "8823fe60b5ab3438bca4b38bb355a699", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 76, "avg_line_length": 24.50574712643678, "alnum_prop": 0.6111632270168855, "repo_name": "spatialaudio/sweep", "id": "f08ef1568020e669eea3cf187fc1e4bcc22de873", "size": "21...
"""Domain objects related to Oppia improvement tasks.""" from __future__ import absolute_import # pylint: disable=import-only-modules from __future__ import unicode_literals # pylint: disable=import-only-modules from core.domain import user_services from core.platform import models import python_utils import utils ...
{ "content_hash": "95b9bd8dfdd65863af9bc81a9665c799", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 80, "avg_line_length": 47.37908496732026, "alnum_prop": 0.6116705752517588, "repo_name": "prasanna08/oppia", "id": "83ff15d9243ee7de817124b19a00ce80762bb2ef", "size": "787...
""" This package contains objects used by :class:`.Node`\ s, but that are not nodes themselves. This includes template parameters and HTML tag attributes. """ from .attribute import Attribute from .parameter import Parameter
{ "content_hash": "cb61f59e36b1e5663068f466f7d2b76c", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 79, "avg_line_length": 32.285714285714285, "alnum_prop": 0.7787610619469026, "repo_name": "hperala/kontuwikibot", "id": "2d90b4e07fc94f7b2f54ee4e53cf48c17178a8e7", "size": "...
from __future__ import unicode_literals import os os.environ['BOKEH_DOCS_MISSING_API_KEY_OK'] = 'yes' try: import limix_genetics version = limix_genetics.__version__ except ImportError: version = 'unknown' needs_sphinx = '1.5' extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 's...
{ "content_hash": "4d6eb1428c82216bbf6acd5d49adac15", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 70, "avg_line_length": 26.574074074074073, "alnum_prop": 0.6731707317073171, "repo_name": "glimix/limix-genetics", "id": "aa705701ac89826cb33a70e1c17ec102ce2eee92", "size":...
def extractDarkroadtalesBlogspotCom(item): ''' Parser for 'darkroadtales.blogspot.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('PRC', 'PRC', 'translated'), ('...
{ "content_hash": "709ee1ecdb6244ff2b95df366d1540bd", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 104, "avg_line_length": 26.80952380952381, "alnum_prop": 0.6376554174067496, "repo_name": "fake-name/ReadableWebProxy", "id": "2dd54d5c95dc7f647d40049b183b95d73a2f37ed", "s...
import multiprocessing from setuptools import setup setup(name='serf_master', version='0.4', description='helpers for writing manageable Serf handlers', classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', ...
{ "content_hash": "f419b5ac9aa4dcec271f3735ca8336b5", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 63, "avg_line_length": 28.62962962962963, "alnum_prop": 0.6170763260025873, "repo_name": "garethr/serf-master", "id": "047403ed2e2b2c34b5c2c32d1e4963ecef2539d4", "size": "7...
""" Unittests related to the mechanism module. """ import pytest from ctypes import cast, c_ulong, c_ubyte from mock import patch from six import integer_types from pycryptoki.conversions import from_hex, to_bytestring from pycryptoki.cryptoki import ( CK_RSA_PKCS_PSS_PARAMS, POINTER, CK_ULONG, CK_AES_...
{ "content_hash": "1ad1c98f2bbc5398918307a3073e9df0", "timestamp": "", "source": "github", "line_count": 218, "max_line_length": 100, "avg_line_length": 35.325688073394495, "alnum_prop": 0.5770679132580184, "repo_name": "gemalto/pycryptoki", "id": "ed7a59546d2a70c0c92ed4eb10afba1fc2192f09", "size": ...
from django.utils.timezone import utc from django.http import HttpResponse from django.core.exceptions import ValidationError from sis_provisioner.models.group import Group, GroupMemberGroup from sis_provisioner.models.course import Course from sis_provisioner.dao.group import valid_group_id from sis_provisioner.dao.co...
{ "content_hash": "9fb13bcfb4882c64f5ea5de1a1d2725c", "timestamp": "", "source": "github", "line_count": 190, "max_line_length": 79, "avg_line_length": 36.61578947368421, "alnum_prop": 0.5759666522926549, "repo_name": "uw-it-aca/canvas-sis-provisioner", "id": "99c4780b64b6a1f50594bb0f96debbee770e8e38"...
from django.urls import reverse from django.http import Http404 from django.test import TestCase, override_settings import mock from rest_framework.exceptions import APIException, PermissionDenied from rest_framework.request import Request from rest_framework.response import Response from rest_framework.routers impor...
{ "content_hash": "92b968c7736756c9851a1c6c4817b5cb", "timestamp": "", "source": "github", "line_count": 148, "max_line_length": 78, "avg_line_length": 41.45945945945946, "alnum_prop": 0.6465123859191656, "repo_name": "wagnerand/olympia", "id": "5da7ea3e1e64a2797b13f3b61c6cd6743dde3a35", "size": "61...
from pytest import fixture from mock import Mock, call from mailthon.middleware import TLS, Auth from .utils import tls_started @fixture def smtp(): return Mock() class TestTlsSupported: @fixture def conn(self, smtp): smtp.has_extn.return_value = True return smtp def test_no_force(s...
{ "content_hash": "ba54ba3770e93f3907353a264d317779", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 62, "avg_line_length": 20.32, "alnum_prop": 0.610236220472441, "repo_name": "ashgan-dev/mailthon", "id": "59913af527f5f34d81de97fa94488563ea0da346", "size": "1016", "bina...
from django.conf.urls import patterns, url from RouteFinder import views urlpatterns = patterns('', #User request submission views url(r'^$', views.RequestList.as_view(), name='request_list'), url(r'add/$', views.RequestCreate.as_view(), name='request_add'), url(r'(?P<pk>\d+)/$', views.RequestUpdate.a...
{ "content_hash": "454e66600efc8b1bdf27bdcd00864b7b", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 87, "avg_line_length": 38.05263157894737, "alnum_prop": 0.6791147994467497, "repo_name": "MatthewGWilliams/Staff-Transport", "id": "7b0d5c129764d04dd334f3ade78aa86e1e1874ad",...
"""WSGI support for the Tornado web framework. WSGI is the Python standard for web servers, and allows for interoperability between Tornado and other Python web frameworks and servers. This module provides WSGI support in two ways: * `WSGIAdapter` converts a `tornado.web.Application` to the WSGI application interf...
{ "content_hash": "8fc55e0aebcbf6df225a5718de94d8ce", "timestamp": "", "source": "github", "line_count": 342, "max_line_length": 81, "avg_line_length": 37.4766081871345, "alnum_prop": 0.616446906452368, "repo_name": "Lancher/tornado", "id": "22be7a897235080ac5805bb9cf638ab4a7d9af77", "size": "13392"...
import os BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'pf-@jxtojga)z+4s*uwb...
{ "content_hash": "257051bd77ae9901c354b643a8acd716", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 79, "avg_line_length": 30.696296296296296, "alnum_prop": 0.6124517374517374, "repo_name": "waprin/kubernetes_django_postgres_redis", "id": "b2ec69ffe6be4ca0b18a4a9705410d4b3...
import os import sys import pkg_resources # part of setuptools # If extensions (or modules to document with autodoc) are in another # directory, add these directories to sys.path here. If the directory is # relative to the documentation root, use os.path.abspath to make it # absolute, like shown here. # sys.path.ins...
{ "content_hash": "c7246c1e0b230bd95994e0885347add3", "timestamp": "", "source": "github", "line_count": 276, "max_line_length": 76, "avg_line_length": 30.206521739130434, "alnum_prop": 0.6910159529806885, "repo_name": "Tinche/cattrs", "id": "44b6cf68477732fcc786d62308743be444ef7094", "size": "8782"...
import unittest from twitter.common.app.modules.varz import VarsEndpoint, VarsSubsystem from twitter.common.http.server import request from twitter.common.quantity import Amount, Time from twitter.common.metrics import NamedGauge, RootMetrics import json import pytest class TestVarz(unittest.TestCase): def test_b...
{ "content_hash": "9f6b2153e671bd2e078dc6fba9ef41db", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 88, "avg_line_length": 36.57971014492754, "alnum_prop": 0.7087955625990491, "repo_name": "WCCCEDU/twitter-commons", "id": "271000931e2fd35e4a5b87d81cf15b7792b8515c", "size"...
import angr from angr.sim_type import SimTypeTop, SimTypeLength, SimTypeInt import logging l = logging.getLogger("angr.procedures.libc.memcmp") class memcmp(angr.SimProcedure): #pylint:disable=arguments-differ def run(self, s1_addr, s2_addr, n): # TODO: look into smarter types here self.argum...
{ "content_hash": "d5fd51138d11ec376d0a37013172d2b3", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 260, "avg_line_length": 53.75806451612903, "alnum_prop": 0.6150615061506151, "repo_name": "axt/angr", "id": "7f9f61ba9b5b0b50b060aab31889b997c279fb80", "size": "3333", "b...
""" Python interface to KrisLibrary nonlinear, multidimensional root finding routines """ from sys import version_info if version_info >= (2,6,0): def swig_import_helper(): from os.path import dirname import imp fp = None try: fp, pathname, description = imp.find_module...
{ "content_hash": "63b66d0f89c337fc9ee11e60aa74b562", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 90, "avg_line_length": 26.193103448275863, "alnum_prop": 0.641390205371248, "repo_name": "stevekuznetsov/Klampt", "id": "35750ef57d29810b600885e7b3095f05bc153ab4", "size":...
import sys import typing import coroutine @coroutine.corouine def grep(pattern:str) -> typing.Generator[str, str, None]: print(f"looking for {pattern}") try: while True: line = (yield) if pattern in line: print(line,) except GeneratorExit: print("Goin...
{ "content_hash": "ae2fb5d2fe6448c66ede849927691a07", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 64, "avg_line_length": 25.09090909090909, "alnum_prop": 0.5634057971014492, "repo_name": "ASMlover/study", "id": "50002ad9432a911125ccf7402b247a0eaa5470f6", "size": "1946",...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = ''' module: manageiq_user short_description: Management of users in Man...
{ "content_hash": "ecf37491ce0d37aaa55d2c758c8cb0a0", "timestamp": "", "source": "github", "line_count": 304, "max_line_length": 100, "avg_line_length": 29.473684210526315, "alnum_prop": 0.5852678571428571, "repo_name": "e-gob/plataforma-kioscos-autoatencion", "id": "cb680c0176600d533e7f33f11b418d208c...
from operator import attrgetter from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType from pyangbind.lib.yangtypes import RestrictedClassType from pyangbind.lib.yangtypes import TypedListType from pyangbind.lib.yangtypes import YANGBool from pyangbind.lib.yangtypes import YANGListType from pyangbind.lib.ya...
{ "content_hash": "e002d1fa76f56981569469a0ff546482", "timestamp": "", "source": "github", "line_count": 701, "max_line_length": 437, "avg_line_length": 41.80171184022824, "alnum_prop": 0.5869706173429342, "repo_name": "napalm-automation/napalm-yang", "id": "52255ad178458127ba1bc5e320248f7baed533bf", ...
from urllib import urlencode import oauth2 as oauth from django.contrib.auth.decorators import login_required from django.contrib.sites.models import RequestSite from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseRedirect from django.template import RequestContext from django.views.decorators.cs...
{ "content_hash": "06e96874bfb8b4a43f56569fcd1704ea", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 188, "avg_line_length": 43.666666666666664, "alnum_prop": 0.7081788440567066, "repo_name": "alejo8591/maker", "id": "ee44d6439a9472880f2fed025ead748c6c414a38", "size": "46...
import sphinx_rtd_theme # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext...
{ "content_hash": "b52a60c9c7d4be46fc88c950642db839", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 87, "avg_line_length": 32.426829268292686, "alnum_prop": 0.6350131628431741, "repo_name": "CMATHL/cml", "id": "b64462f9826eab4d7ad97383e6878b9013a26610", "size": "5950", ...
import bluetooth from ble_advertising import advertising_payload from micropython import const _IRQ_CENTRAL_CONNECT = const(1) _IRQ_CENTRAL_DISCONNECT = const(2) _IRQ_GATTS_WRITE = const(3) _UART_UUID = bluetooth.UUID("6E400001-B5A3-F393-E0A9-E50E24DCCA9E") _UART_TX = ( bluetooth.UUID("6E400003-B5A3-F393-E0A9-E5...
{ "content_hash": "9289a6819877a0e9c020f80e7af3e069", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 99, "avg_line_length": 29.901785714285715, "alnum_prop": 0.5962974022096148, "repo_name": "pramasoul/micropython", "id": "6d167a871a75e9b0ffddd34286fd687949d82ff9", "size"...
""" Amazon EC2 driver """ from libcloud.providers import Provider from libcloud.types import NodeState, InvalidCredsException from libcloud.base import Node, Response, ConnectionUserAndKey from libcloud.base import NodeDriver, NodeSize, NodeImage, NodeLocation import base64 import hmac from hashlib import sha256 import...
{ "content_hash": "bf143c927143bf009a4146c39544dddb", "timestamp": "", "source": "github", "line_count": 536, "max_line_length": 88, "avg_line_length": 34.026119402985074, "alnum_prop": 0.5785722118653361, "repo_name": "secondstory/dewpoint", "id": "d5092ed18749b6220bf9025ac0e13cc355c812fd", "size":...
"""urlconf for the base application""" from django.conf.urls import url, patterns urlpatterns = patterns('base.views', #url(r'^$', 'home', name='home'), )
{ "content_hash": "92dcea94c4b6159e8512a9d4066e3f23", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 42, "avg_line_length": 20.25, "alnum_prop": 0.6604938271604939, "repo_name": "jammons/prioritize", "id": "3638e1abafd17a78e26c644dd35d80630a8fa062", "size": "162", "binary...
"""Tests for question domain objects.""" from core.domain import exp_domain from core.domain import question_domain from core.tests import test_utils import utils class QuestionDomainTest(test_utils.GenericTestBase): """Tests for Question domain object.""" def test_to_dict(self): expected_object = {...
{ "content_hash": "631cbf614acf3e709acd1b20af0c6b8e", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 79, "avg_line_length": 36.605442176870746, "alnum_prop": 0.6056495075264821, "repo_name": "MAKOSCAFEE/oppia", "id": "5bc32df244c36e9ae122d8c1e6d1e95331ee2093", "size": "60...
from direct.distributed.DistributedObject import DistributedObject from toontown.catalog.CatalogItemList import CatalogItemList import time class CatalogManager(DistributedObject): notify = directNotify.newCategory('CatalogManager') neverDisable = 1 def __init__(self, cr): DistributedObject.__ini...
{ "content_hash": "19dedc0fb8e7cc9b8fb5e7723f832a70", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 114, "avg_line_length": 30.923076923076923, "alnum_prop": 0.6965174129353234, "repo_name": "Spiderlover/Toontown", "id": "6d9d51e2e0f0a57c565145665463b7edc3aa8299", "size":...
from __future__ import absolute_import, division, print_function, unicode_literals from botocore.client import ClientError from collections import Counter from concurrent.futures import as_completed from datetime import datetime, timedelta from dateutil.parser import parse from dateutil.tz import tzutc import loggi...
{ "content_hash": "a1b0be1d74ca63ad7e2fa7d8e4985918", "timestamp": "", "source": "github", "line_count": 1623, "max_line_length": 94, "avg_line_length": 33.8909426987061, "alnum_prop": 0.5485137714753204, "repo_name": "jimmyraywv/cloud-custodian", "id": "3b0ed2495afe1910d1bf5398a13c33d9482f4f2c", "s...
import gevent import os import sys import socket import errno import uuid import logging import coverage import cgitb cgitb.enable(format='text') import fixtures import testtools from testtools.matchers import Equals, MismatchError, Not, Contains from testtools import content, content_type, ExpectedException import u...
{ "content_hash": "475f393c0e4f65f4ec2f2b29e7755282", "timestamp": "", "source": "github", "line_count": 735, "max_line_length": 133, "avg_line_length": 40.83537414965986, "alnum_prop": 0.5864929699473579, "repo_name": "sajuptpm/contrail-controller", "id": "bf425b649beefe7d91974e13257657c4d21dfb30", ...
import hashlib import json import os import re import unittest from typing import List from urllib.error import HTTPError from urllib.parse import parse_qsl, urlparse from urllib.request import Request, urlopen import responses from auto_nag import logger MOCKS_DIR = os.path.join(os.path.dirname(__file__), "tests/mo...
{ "content_hash": "b70c7a2b062d85f4f5f2c257fb1f7605", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 86, "avg_line_length": 31.887931034482758, "alnum_prop": 0.5674506623411733, "repo_name": "mozilla/relman-auto-nag", "id": "75003140a4eafef22e0491b747d65f0c8c119908", "siz...
""" Integration tests for the Synapse Client for Python To run all the tests : nosetests -vs tests To run a single test suite: nosetests -vs tests/integration To run a single test set : nosetests -vs tests/integration/integration_test_Entity.py To run a single test : nosetests -vs tests/integration/integrat...
{ "content_hash": "c1de0f2e0ac1d1a7421af4c8296048fa", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 98, "avg_line_length": 31.76, "alnum_prop": 0.6263643996641478, "repo_name": "kkdang/synapsePythonClient", "id": "2992e21ca81841119dc8aeddc09d45cd378f48b5", "size": "2406",...
import re import fnmatch import sys import subprocess import datetime import os ################################################################################ # file filtering ################################################################################ EXCLUDE = [ # auto generated: 'src/qt/bitcoinstring...
{ "content_hash": "0ad8ee606fa5f35c6db8f638452e5e36", "timestamp": "", "source": "github", "line_count": 594, "max_line_length": 121, "avg_line_length": 36.611111111111114, "alnum_prop": 0.5675725387409758, "repo_name": "FeatherCoin/Feathercoin", "id": "67e77bc63de3205bdab3791b10a12acc9b46cd0e", "si...
from .campos import CampoData from .campos import CampoFixo from .campos import CampoRegex from .erros import CampoError from .erros import CampoInexistenteError class Registro(object): """ Classe abstrata para a manipulação dos registros. >>> class RegistroTest(Registro): ... campos = [CampoFixo...
{ "content_hash": "def91a7132a52908a51ad66bdecc7a9c", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 91, "avg_line_length": 31.236842105263158, "alnum_prop": 0.558270148834597, "repo_name": "odoo-brazil/python-sped", "id": "b8074e45963337030d12f57c4de29828f1a27245", "size...
from model.contact import Contact import re class ContactsHelper: def __init__(self,app): self.app = app def create(self, contact): wd = self.app.wd self.app.open_home_page() # init contact addition wd.find_element_by_link_text("add new").click() # fill contact...
{ "content_hash": "b6f980d5b95eb53926eae14e31dc3fd9", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 187, "avg_line_length": 42.241573033707866, "alnum_prop": 0.6065966218912089, "repo_name": "goeliv/python_training", "id": "6f316d36296a1a85d11e440709d539cc7c211256", "siz...
''' Copyright (C) 2014 Parrot SA 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 conditions and the following di...
{ "content_hash": "f564b4c701803ca982a42e8e722e07c4", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 107, "avg_line_length": 46.82222222222222, "alnum_prop": 0.6409587090650214, "repo_name": "2016-Capstone/PythonController", "id": "b671ebf4d926fc2fe80bd54cfcce7c028c0178b2", ...
from datetime import date from decimal import Decimal from ssl import SSLError from suds import WebFault from suds.client import Client from authorize.exceptions import AuthorizeConnectionError, \ AuthorizeInvalidError, AuthorizeResponseError PROD_URL = 'https://api.authorize.net/soap/v1/Service.asmx?WSDL' TEST...
{ "content_hash": "d9ac541897026bc3a86969c275ad860f", "timestamp": "", "source": "github", "line_count": 221, "max_line_length": 79, "avg_line_length": 43.49321266968326, "alnum_prop": 0.63722430295464, "repo_name": "jeffschenck/authorizesauce", "id": "d18f397e1d40ee9dcf6080d14ffcf201f07738c7", "siz...
USERNAME = "" # These tokens can be generated here: https://github.com/settings/tokens/new AUTH = "########################################" IGNORE_FILES = [ '.ipynb_checkpoints', '.gitignore' ]
{ "content_hash": "6ece02a922c2e2d37085815dd0a6534a", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 76, "avg_line_length": 25.5, "alnum_prop": 0.5294117647058824, "repo_name": "openconnectome/ndprojects", "id": "ba5a72547a32c4465ed9ba03a4824e4e6a4b8831", "size": "236", "...
class InvalidRepositoryError(ValueError): pass class InvalidContentFileEncoding(ValueError): pass
{ "content_hash": "8135961dd3256f5405c31a0ca68851b4", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 45, "avg_line_length": 18, "alnum_prop": 0.7962962962962963, "repo_name": "muffins-on-dope/bakery", "id": "bc530a32ae83ea81b679fe4992a1fc3eea7ad00a", "size": "134", "binar...
""" Code for splitting the terms. """ import string import logging logger = logging.getLogger('cfl.preprocessing') def tokenize(s): return s.split() def to_unicode(document, info=[]): document = document.replace('\x00', ' ') # remove nulls document = document.strip() if not isinstance(document, u...
{ "content_hash": "634682fa2a0de6060f7a6ed7118f2e14", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 86, "avg_line_length": 41.577777777777776, "alnum_prop": 0.6652414038838411, "repo_name": "cscorley/changeset-feature-location", "id": "7da1ca1c1f6596da38665e4bef8e9fc7d9b4a...
from bottle import * def print_log(): open_file = open("mydaily.log") log = open_file.read() return log @route('/text') def input(): return''' <form action="/text" method="post"> <p>请输入单行日记: <input type="text" name="fname" /></p> <input type="submit" value="确认" /> </fo...
{ "content_hash": "6c401f87059c733c30ffeb95680443d8", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 58, "avg_line_length": 20.857142857142858, "alnum_prop": 0.5582191780821918, "repo_name": "yangshaoshun/OMOOC2py", "id": "c110279d40472cda5996efae01288751d18868a4", "size":...
""" Example of train a 2-layers Neural Network classifier on CIFAR-10 dataset """ import numpy as np import sys sys.path.append("../../deuNet/") from deuNet.utils import np_utils from deuNet.datasets import cifar10 from deuNet.models import NN from deuNet.layers.core import AffineLayer, Dropout from deuNet.layers.con...
{ "content_hash": "533f8b907d785cfdedaf2029a5deb169", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 94, "avg_line_length": 29.365853658536587, "alnum_prop": 0.7196843853820598, "repo_name": "shenxudeu/deuNet", "id": "669e321b062f29cb19998029beac3c61de94394f", "size": "240...
import logging import os import shutil import subprocess from collections import namedtuple from os.path import basename log = logging.getLogger(__name__) class VCSVersion(object): """ Represents a Version (tag or branch) in a VCS. This class should only be instantiated in BaseVCS subclasses. It c...
{ "content_hash": "fa3ec98297fa8d26ef8260fd91739a95", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 79, "avg_line_length": 30.566666666666666, "alnum_prop": 0.5378407851690294, "repo_name": "cgourlay/readthedocs.org", "id": "fb3c7f7959bb2095728a1441bd02be91b9543395", "si...
import logging from IPython.display import display import numpy as np import pandas as pd logger = logging.getLogger() def cohort_view_table(df, category_label="category_label", category_order="category_order", flags=[], flag_...
{ "content_hash": "f4f630e3a4b7c4db0e6d6cf0f0486a19", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 128, "avg_line_length": 39.25, "alnum_prop": 0.5486594578580951, "repo_name": "cmap/cmapPy", "id": "0b28545c2ddffd08be482201e61a28e69d8fb2a8", "size": "6753", "binary": ...
import unittest import jpyutil jpyutil.init_jvm(jvm_maxmem='512M') import jpy class TestJavaArrays(unittest.TestCase): def test_diag_flags_constants(self): self.assertIsNotNone(jpy.diag) self.assertIsNotNone(jpy.diag.flags) self.assertEqual(jpy.diag.F_OFF, 0x00) self.assertEqual...
{ "content_hash": "9fb186c3ec3406d17face66952371217", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 57, "avg_line_length": 30.428571428571427, "alnum_prop": 0.6322378716744914, "repo_name": "bcdev/jpy", "id": "264e6ba5df18e5664df4515569840881f5757198", "size": "1278", "...
from django.db import models from django.conf import settings from django.core.exceptions import ValidationError from polymorphic import PolymorphicModel from django.db.models import F from django.contrib.admin.models import User from jenkins import get_job_status from .alert import send_alert from .calendar import ge...
{ "content_hash": "b9b725efa803f27c7ecd5ccf4f7a87a1", "timestamp": "", "source": "github", "line_count": 714, "max_line_length": 225, "avg_line_length": 33.84453781512605, "alnum_prop": 0.5980964204427892, "repo_name": "JensRantil/cabot", "id": "c86e7dbfc41b2454337ae3d1b46c226516dd7062", "size": "24...
from __future__ import unicode_literals from boxsdk.exception import BoxAPIException import csv import os from box_manage_users.scripts.script import Script class MassProvisionScript(Script): """ Script to create many users in an enterprise at once. """ _title = 'Provision Users & Create Personal Fold...
{ "content_hash": "9185290340b394a3148f56b0a7ca5be6", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 99, "avg_line_length": 32.42465753424658, "alnum_prop": 0.596958174904943, "repo_name": "box-samples/user-management", "id": "9a21d5e861ac606de89fe5f0ae4c3681fdb83615", "si...
''' api module ''' from .metrics import ( MetricsHandler, MetricsTimelineHandler ) from .topology import ( TopologyExceptionSummaryHandler, ListTopologiesJsonHandler, TopologyLogicalPlanJsonHandler, TopologyPhysicalPlanJsonHandler, TopologySchedulerLocationJsonHandler, TopologyExecution...
{ "content_hash": "bdc946972ef09b9ed5bc337e22544774", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 41, "avg_line_length": 23.894736842105264, "alnum_prop": 0.7731277533039648, "repo_name": "mycFelix/heron", "id": "c9e17e0f041296acd2714e534eb286fe81aa167f", "size": "1239"...
import argparse import os import unicodedata import fontforge class MergeType: """ Used for internal representation of the merge request: NONE: don't merge the Latin font at all, PLAIN: use fontforge.mergeFonts(), or DEEP: look inside the Latin font and cherry-pick the useful stuff. """ NONE, PLAI...
{ "content_hash": "ee59d3f3be9ab5c60f46ebca91b52775", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 118, "avg_line_length": 35.64, "alnum_prop": 0.6603067714178825, "repo_name": "bateni/qalam-tarash", "id": "847f2409ff6fdf14caf6409a609bd1a9446a9f79", "size": "2714", "bi...
"""\ Word count with stop words (i.e., words that should be ignored). """ # DOCS_INCLUDE_START STOP_WORDS_FN = 'stop_words.txt' try: with open(STOP_WORDS_FN) as f: STOP_WORDS = frozenset(l.strip() for l in f if not l.isspace()) except OSError: STOP_WORDS = frozenset() def mapper(_, value, writer): ...
{ "content_hash": "46578519fc8daf1c6e2f4447e355ad7a", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 71, "avg_line_length": 22.666666666666668, "alnum_prop": 0.6139705882352942, "repo_name": "crs4/pydoop", "id": "3eaa9eaa3c936c262db7364f4413b9d7ad7e7828", "size": "1155", ...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( find_xpath_attr, int_or_none, parse_duration, unified_strdate, ) class VideoLecturesNetIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?videolectures\.net/(?P<id>[^/#?]+)/' IE_NAME = '...
{ "content_hash": "9cd1639bd21c0150d507fcb5c638af64", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 83, "avg_line_length": 34.55714285714286, "alnum_prop": 0.5431996692848284, "repo_name": "Celthi/youtube-dl-GUI", "id": "ebd2a3dca3ac0e7bd812226c80c356a19b3677ab", "size": ...
from setuptools import setup, find_packages setup( name='django-waffle', version='2.2.0', description='A feature flipper for Django.', long_description=open('README.rst').read(), author='James Socol', author_email='me@jamessocol.com', url='http://github.com/django-waffle/django-waffle', ...
{ "content_hash": "457c49b735f98d72410ccd4bbb6c152f", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 71, "avg_line_length": 37.351351351351354, "alnum_prop": 0.5875542691751086, "repo_name": "willkg/django-waffle", "id": "489e7635b6e3fec9cb4f810339b0b5b9b9c7fe24", "size": ...
from .stage01_isotopomer_spectrumAccuracy_postgresql_models import * from SBaaS_base.sbaas_base_query_update import sbaas_base_query_update from SBaaS_base.sbaas_base_query_drop import sbaas_base_query_drop from SBaaS_base.sbaas_base_query_initialize import sbaas_base_query_initialize from SBaaS_base.sbaas_base_query_...
{ "content_hash": "1797ff32e744931ef4a439bd31c009c1", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 112, "avg_line_length": 54.064516129032256, "alnum_prop": 0.7356801909307876, "repo_name": "dmccloskey/SBaaS_isotopomer", "id": "f6c27418c64c814caafe06a3f940f065a9c77179", ...
import unittest from conans.util.files import load from conans.test.utils.tools import TestClient class ConfigTest(unittest.TestCase): def setUp(self): self.client = TestClient() def basic_test(self): # show the full file self.client.run("config get") self.assertIn("default_...
{ "content_hash": "9cc64560000d42768ee16f83ff78a983", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 91, "avg_line_length": 41.793103448275865, "alnum_prop": 0.6512651265126512, "repo_name": "luckielordie/conan", "id": "16db9dd1b02c85d9bfbe83c7a328733415601623", "size": "3...
import time import flask import mcbench.xpath from mcbench.models import Benchmark, Query from mcbench import querier from mcbench import app def redirect(url_name, *args, **kwargs): return flask.redirect(flask.url_for(url_name, *args, **kwargs)) def get_valid_query_or_throw(): xpath = flask.request.args....
{ "content_hash": "015f4da9789167a576e9095892f95cf1", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 72, "avg_line_length": 26.94871794871795, "alnum_prop": 0.6336822074215034, "repo_name": "isbadawi/mcbench", "id": "c186e7482ea69581bba38cb879e9626716ca1528", "size": "315...
""" line ~~~~ May the LINE be with you... :copyright: (c) 2014 by Taehoon Kim. :license: BSD, see LICENSE for more details. """ from .client import LineClient from .api import LineAPI from .models import LineGroup, LineContact, LineRoom, LineBase, LineMessage __copyright__ = 'Copyright 2014 by T...
{ "content_hash": "eede1b6e483ac36f5a5d7ffe25435aaa", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 75, "avg_line_length": 24.535714285714285, "alnum_prop": 0.6375545851528385, "repo_name": "bot1line1/test8", "id": "b7ab132a22090f194a9a83503fc60c17f7a2fc49", "size": "711"...
from django.conf import settings from django.contrib import auth import facebook import datetime class DjangoFacebook(object): """ Simple accessor object for the Facebook user. """ def __init__(self, user): self.user = user self.uid = user['uid'] self.graph = facebook.GraphAPI(user['ac...
{ "content_hash": "b768cfe97e773ca40268d1da0bd4e765", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 98, "avg_line_length": 39.57575757575758, "alnum_prop": 0.6571592649310873, "repo_name": "aidanlister/django-facebook", "id": "d46ad906de8136f0eacdc884892fc2629de2ebc3", "...
"""This module contains Splittable DoFn logic that is specific to DirectRunner. """ from threading import Lock from threading import Timer import apache_beam as beam from apache_beam import TimeDomain from apache_beam import pvalue from apache_beam.io.iobase import RestrictionTracker from apache_beam.pipeline import ...
{ "content_hash": "e48b0ff81c041d93ad50be8478617ed4", "timestamp": "", "source": "github", "line_count": 343, "max_line_length": 80, "avg_line_length": 40.565597667638485, "alnum_prop": 0.7113698433232716, "repo_name": "tgroh/beam", "id": "610664be9232f99911b77251fb0c9c1842962f32", "size": "14699", ...
class Sheet(object): """ sheet: Top level object. Models the entire music sheet """ def __init__(self, name): super(Sheet, self).__init__() self.name = name self.bars = list() class Bar(object): """ bar: Models a measure. Compose the sheet as the temporal layer => Where the notes are displayed on the s...
{ "content_hash": "9ec672187da48bc776e215fc7a99a727", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 53, "avg_line_length": 28.434782608695652, "alnum_prop": 0.6574923547400612, "repo_name": "ograndedjogo/tab-translator", "id": "8de8351086cfee1dafede2805874a1c1f786d11b", "...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "integration_test.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the # iss...
{ "content_hash": "56538417d097b77d1c396bf2029230c7", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 80, "avg_line_length": 37.714285714285715, "alnum_prop": 0.6237373737373737, "repo_name": "1024inc/django-rq", "id": "d3f364966d0ad736d94c40c4b7bfb25d370b2ebd", "size": "81...
import binascii import sys class ProtocolTreeNode(object): def __init__(self, tag, attributes = None, children = None, data = None): self.tag = tag self.attributes = attributes or {} self.children = children or [] self.data = data assert type(self.children) is list, "Childr...
{ "content_hash": "a820b2424fc850f4e2b4dce7b09eaad1", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 99, "avg_line_length": 29.296296296296298, "alnum_prop": 0.5004214075010536, "repo_name": "biji/yowsup", "id": "f6f1ce9daf6f2713c6276268b8e598c4da35ff2b", "size": "4746", ...
class coin_type: def __init__(self, name, symbol, public_magic, private_magic, bip32_code, public_key_version, address_prefix, wif_version): self.name = name self.symbol = symbol self.public_magic = public_magic self.private_magic = private_magic self.bip32_code = bip32_code self.public_key_v...
{ "content_hash": "db471c62742a722bc10369f505c89f7b", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 125, "avg_line_length": 25.333333333333332, "alnum_prop": 0.637719298245614, "repo_name": "gcnaccount/pywallet", "id": "6dc221b0394e28a4396e88f1f9504c6938c8151a", "size": "...
import logging import random from celery import Celery from celery._state import set_default_app from celery.task import task from django.conf import settings from django.utils import timezone celery = Celery(__name__) celery.config_from_object(settings) # Celery should set this app as the default, however the 'cele...
{ "content_hash": "895689ad1bc466e505c4a216a36e8e24", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 120, "avg_line_length": 34.473214285714285, "alnum_prop": 0.7184667184667185, "repo_name": "bonniejools/cabot", "id": "3fc4d857fc97dac04b446762443bb4612a75951d", "size": "...
import os import rrt LOG = rrt.get_log() LOG.info("Starting %s" % rrt.get_version()) from rrt.hpc import env ENV = env() from maya import cmds posix = lambda s: s.replace('\\', '/') proj = posix(ENV['PROJECT']) node_proj = posix(ENV['NODE_PROJECT']) map_pairs = [ (node_proj, proj), ] for na...
{ "content_hash": "1b1d411f5aa33b962365636c8cf5e578", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 60, "avg_line_length": 23.516129032258064, "alnum_prop": 0.6008230452674898, "repo_name": "RCAD/ringling-render-tools", "id": "f610821eec0fe6ab6f583e4c3a34cadd37c56d94", "s...
""" Evologics modem driver This is a ROS node which works as a bridge between the software and the Evologics devices. S2C product family is supported by this driver, both "normal" and "USBL" versions, both serial and tcp/ip connection protocols. """ # TODO: Test im, burst sending # TODO: Add documentation from __fut...
{ "content_hash": "ed49d4e6eb6719d8334e40ff825e1a83", "timestamp": "", "source": "github", "line_count": 553, "max_line_length": 149, "avg_line_length": 37.32911392405063, "alnum_prop": 0.6130891827738216, "repo_name": "oceansystemslab/evologics_driver", "id": "0b5fc0ae55c534b49d722c5ba2c1eb3ba9816c3e...
"""Generate Crosswalk Extension source files. If run itself, caches Jinja templates (and creates dummy file for build, since cache filenames are unpredictable and opaque). This module is *not* concurrency-safe without care: bytecode caching creates a race condition on cache *write* (crashes if one process tries to re...
{ "content_hash": "38d357d554f85d44ff548cfb240ab9c7", "timestamp": "", "source": "github", "line_count": 308, "max_line_length": 140, "avg_line_length": 42.95454545454545, "alnum_prop": 0.6710506424792139, "repo_name": "hgl888/crosswalk-android-extensions", "id": "29da8cc9a57dd1c869731042ac14e714a2ec0...
""" route bundles of port (river routing) """ from typing import Callable, List, Optional from numpy import float64, ndarray import numpy as np from pp.routing.connect import connect_strip from pp.routing.connect import connect_elec_waypoints from pp.routing.connect import connect_strip_way_points from pp.routing.manh...
{ "content_hash": "5727e5b942934bf148263c2945319d5d", "timestamp": "", "source": "github", "line_count": 1095, "max_line_length": 219, "avg_line_length": 29.804566210045664, "alnum_prop": 0.5294460105405074, "repo_name": "psiq/gdsfactory", "id": "9e5dc184d3970cc75ee6c9997c93168580f8a125", "size": "3...
from anki.hooks import wrap from aqt.editor import Editor, EditorWebView import os import sys from BeautifulSoup import BeautifulSoup from PyQt4.QtGui import * from PyQt4.QtCore import * REMOVE_ATTRIBUTES = [ 'color', 'background-color', ] def purgeAttributes(self, mime, _old): html = mime.html(...
{ "content_hash": "b7747ca44ac87a4d9602c4c495126128", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 88, "avg_line_length": 28.571428571428573, "alnum_prop": 0.5933333333333334, "repo_name": "searene/Anki-Addons", "id": "0c02c7ee20cd0a934dda946f1274ea8cee26d1ab", "size": "...
from readtagger.bam_io import BamAlignmentReader as Reader from readtagger.tagcluster import TagCluster from readtagger.tagcluster import TargetSiteDuplication INPUT = 'tagged_dm6.bam' def test_tsd(datadir_copy): # noqa: D103 cluster = get_cluster(datadir_copy) tsd = TargetSiteDuplication(cluster) asser...
{ "content_hash": "86081da4ecdead0a1aac8182865fa613", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 65, "avg_line_length": 34.0625, "alnum_prop": 0.7146788990825688, "repo_name": "bardin-lab/readtagger", "id": "ac93077fa4a74d38390ff1dc53f21ebd1316d277", "size": "1090", ...
""" Translation support for admin forms. *django-parler* provides the following classes: * Model support: :class:`TranslatableAdmin`. * Inline support: :class:`TranslatableInlineModelAdmin`, :class:`TranslatableStackedInline`, :class:`TranslatableTabularInline`. * Utilities: :class:`SortedRelatedFieldListFilter`. Ad...
{ "content_hash": "5ee914dbac645de5152e9cb4ed400507", "timestamp": "", "source": "github", "line_count": 715, "max_line_length": 143, "avg_line_length": 38.95384615384615, "alnum_prop": 0.632342381157547, "repo_name": "ellmetha/django-parler", "id": "6f42c78d64d2ab196524df5ef3f8f624cdbba891", "size"...
import os import sys import re from os.path import abspath, basename, join, isdir, isfile, islink from egginst.utils import rm_rf verbose = False executable = sys.executable hashbang_pat = re.compile(r'#!.+$', re.M) def write_exe(dst): from exe_data import cli as data rm_rf(dst) try: open(dst,...
{ "content_hash": "6166f07eda654ee2ff8ec201d9bb5029", "timestamp": "", "source": "github", "line_count": 181, "max_line_length": 78, "avg_line_length": 24.39779005524862, "alnum_prop": 0.5620471014492754, "repo_name": "ilanschnell/ironpkg", "id": "7efe7d11d9b808419f2b2a01b5b3fe3f2a47ca58", "size": "...
import struct from .connection import Connection, PacketCodec class AbridgedPacketCodec(PacketCodec): tag = b'\xef' obfuscate_tag = b'\xef\xef\xef\xef' def encode_packet(self, data): length = len(data) >> 2 if length < 127: length = struct.pack('B', length) else: ...
{ "content_hash": "861268dbbe75f5c95d7bbd51ca9bf908", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 68, "avg_line_length": 29.12121212121212, "alnum_prop": 0.6097814776274714, "repo_name": "expectocode/Telethon", "id": "171b1d8c89a11f1e5a863d0ac4b87324b7676f0b", "size": "...
from __future__ import division, unicode_literals """ #TODO: Write module doc. """ __author__ = 'Shyue Ping Ong' __copyright__ = 'Copyright 2013, The Materials Virtual Lab' __version__ = '0.1' __maintainer__ = 'Shyue Ping Ong' __email__ = 'ongsp@ucsd.edu' __date__ = '8/1/15' import warnings warnings.warn("pymatgen....
{ "content_hash": "b919c2e864403cd2caca83cde8a511a6", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 77, "avg_line_length": 25.5, "alnum_prop": 0.6557734204793029, "repo_name": "sonium0/pymatgen", "id": "2c76e7790201474f4b99cb022d2d518d6d90354f", "size": "591", "binary":...
""" Very basic estimator copied (nearly) wholesale from https://www.kaggle.com/zygmunt/rossmann-store-sales/predict-sales-with-pandas-py. This is mostly just for testing purposes, as pretty much anything we put together will exhibit better performance than this. Author: BWP """ import pandas as pd from sklearn.bas...
{ "content_hash": "8c11af6f113254c0eb3570d68fb2d18e", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 102, "avg_line_length": 38.98765432098765, "alnum_prop": 0.6010132995566815, "repo_name": "bwpriest/rossmannsales", "id": "8f49f165385340c03c17ad12a958627b31bee26f", "size"...
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Test use of ${TARGET.dir} to specify a CPPPATH directory in combination VariantDirs and a generated .h file. """ import TestSCons _exe = TestSCons._exe test = TestSCons.TestSCons() build1_foo = test.workpath('build1', 'foo' + _exe) build2_foo = test...
{ "content_hash": "9efca0e2957323c7c59828f59cfde0cd", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 61, "avg_line_length": 21.112676056338028, "alnum_prop": 0.6270847231487658, "repo_name": "timj/scons", "id": "9e99087896e64800237ec94463883787bc8705e0", "size": "2601", ...
import datetime import json import logging from typing import Any, Dict, Iterable, Tuple import pendulum from dateutil import relativedelta from sqlalchemy import TIMESTAMP, PickleType, and_, event, false, nullsfirst, or_, tuple_ from sqlalchemy.dialects import mssql, mysql from sqlalchemy.exc import OperationalError ...
{ "content_hash": "90d8d4a80eda77ae105aec4180f0ca3b", "timestamp": "", "source": "github", "line_count": 401, "max_line_length": 106, "avg_line_length": 34.99750623441396, "alnum_prop": 0.6502778965369816, "repo_name": "Acehaidrey/incubator-airflow", "id": "a6270ea0087bfd903cad35090d9b2845b6f6f46c", ...
from . import FixtureTest # test that features get assigned the correct collision rank. # # note that the collision rank system has been designed to make changing ranks # and re-arranging / re-ordering very easy. in turn, this might make these # tests very fragile because they check the exact number which is assigned...
{ "content_hash": "4b248a1d16b5f7d7b3f98ca76d217a1f", "timestamp": "", "source": "github", "line_count": 488, "max_line_length": 79, "avg_line_length": 31.366803278688526, "alnum_prop": 0.5055203501665905, "repo_name": "mapzen/vector-datasource", "id": "710a7dafa549a24c38071bb9b7ea56f2532babe0", "si...