text
stringlengths
4
1.02M
meta
dict
"""Operators that interact with Google Cloud Life Sciences service.""" from __future__ import annotations from typing import TYPE_CHECKING, Sequence from airflow.exceptions import AirflowException from airflow.models import BaseOperator from airflow.providers.google.cloud.hooks.life_sciences import LifeSciencesHook f...
{ "content_hash": "edb3398862081977d326ab5a3126c15d", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 100, "avg_line_length": 38.63953488372093, "alnum_prop": 0.6602467649714113, "repo_name": "apache/airflow", "id": "b549d2f786e66bf6797a3c9d904da70fae693638", "size": "4110"...
import subprocess import shutil, sys, os import xml.etree.ElementTree as ET sys.path.append(os.getcwd()) from mesonbuild import coredata from packaging.createmsi import get_modules class PkgGenerator: def __init__(self): self.pkg_dir = 'macpkg' self.sharedir = os.path.join(self.pkg_dir, 'usr/lo...
{ "content_hash": "75b9e6901543406115a4fd43c7f7919d", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 98, "avg_line_length": 45.00990099009901, "alnum_prop": 0.5415750109986801, "repo_name": "QuLogic/meson", "id": "ab3c51c6e6553e6ee7613e25f1eb44ab9483dade", "size": "5166",...
import discord from discord.ext import commands import time import asyncio import unicodedata import cogs.emojis as Emojis import cogs.glyphs as Glyphs import inflect import upsidedown import datetime from collections import Counter class Fun(): def __init__(self, bot): self.bot = bot def texttoemoji(...
{ "content_hash": "d9a52b94177388693692783d18888882", "timestamp": "", "source": "github", "line_count": 353, "max_line_length": 160, "avg_line_length": 35.84985835694051, "alnum_prop": 0.5623073883840379, "repo_name": "OrangutanGaming/OG_SelfBot", "id": "e40497c4f57e5df15cf64dfb7fe0d6a92468c33e", "...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Text.status' db.add_column(u'text_text', 'status', self.gf(...
{ "content_hash": "840046808c1498898e06dad4e7437b07", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 195, "avg_line_length": 65.20547945205479, "alnum_prop": 0.5529411764705883, "repo_name": "blumug/texapi", "id": "8750f74b737b817c47947ed0d8bd491ef896e071", "size": "4784",...
"""Qiskit pulse scheduling tests."""
{ "content_hash": "3d7149ad8b2a00c99a1cfbae5b0e4052", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 36, "avg_line_length": 37, "alnum_prop": 0.7027027027027027, "repo_name": "QISKit/qiskit-sdk-py", "id": "b56983c88a1e9b33dbcfc60199c782542cb89028", "size": "554", "binary"...
"""This module provides a pretty printer for lucene query tree. """ from .tree import BaseOperation, BaseGroup, SearchField class _StickMarker: """Use in list between two elements that must stick together """ def __len__(self): return 0 # a marker to avoid a new line between two elements _STICK...
{ "content_hash": "fbc8cc7e57e8754be1dafc5074646869", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 91, "avg_line_length": 37.95070422535211, "alnum_prop": 0.5646687697160884, "repo_name": "adsabs/object_service", "id": "ceb76ec539f1688c205110251b6ad4d2d97fba27", "size":...
import datetime import os import signal import urllib from tempfile import NamedTemporaryFile from typing import List, Optional, Union, cast from unittest import mock from unittest.mock import call, mock_open, patch import pendulum import pytest from freezegun import freeze_time from airflow import models, settings f...
{ "content_hash": "565584d996989b783e13d65a299900c4", "timestamp": "", "source": "github", "line_count": 2304, "max_line_length": 110, "avg_line_length": 37.39366319444444, "alnum_prop": 0.5826011258777785, "repo_name": "mistercrunch/airflow", "id": "e11594f75fcc0d171281f7ed0217020aec5637df", "size"...
from sh import Command from functools import wraps def kwargs_spec(command, arguments, schema): def kwargs_spec_decorator(f): @wraps(f) def wrapper(*args, **kwargs): kwargs = schema(kwargs) for k, v in kwargs.items(): if k.startswith('--'): ...
{ "content_hash": "49db9f073ba37e0e08229b4ccfa79035", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 87, "avg_line_length": 37.470588235294116, "alnum_prop": 0.5416012558869702, "repo_name": "rominf/salt_kwargs", "id": "e0b613d98d3c4e23e9fd8691ff3bf25d8c218e18", "size": "6...
""" fourch (stylised as 4ch) is an easy-to-implement Python wrapper for 4chan's JSON API, as provided by moot. It uses the documentation of the 4chan API located at: https://github.com/4chan/4chan-API This is based off of the API last updated Aug 12, 2014. (4chan-API commit: 1b2bc7858afc555127...
{ "content_hash": "e5eba43a1ddaea2a8c1ca7cfdad9c229", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 75, "avg_line_length": 27.976744186046513, "alnum_prop": 0.6309226932668329, "repo_name": "sysr-q/4ch", "id": "ba1306d0fab01909d5a16f52cd61d53c5681ea46", "size": "1250", ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('billing', '0008_order_rfidcard'), ] operations = [ migrations.AlterField( model_name='order', name='rfidcard', f...
{ "content_hash": "a4543aa896e04b7142e25707b149748d", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 135, "avg_line_length": 25.555555555555557, "alnum_prop": 0.6195652173913043, "repo_name": "Inter-Actief/alexia", "id": "83bef29202a18a934b82e5382265fb9e871c8b55", "size": ...
from django.conf.urls import patterns, url from .views import TestView urlpatterns = patterns( '', url(r'^', TestView.as_view()), )
{ "content_hash": "d093a08cb01bd446c77d29c444dba450", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 42, "avg_line_length": 17.75, "alnum_prop": 0.6690140845070423, "repo_name": "arsham/django-cachedpaginator", "id": "1340b70d53a9631bbf29c58c5a9620b392a4b836", "size": "142"...
import os from django.conf import settings from django.core.files.storage import FileSystemStorage DIRECTORY = getattr(settings, 'FILEMANAGER_DIRECTORY', 'uploads') MEDIA_ROOT = getattr(settings, "FILEMANAGER_MEDIA_ROOT", os.path.join(settings.MEDIA_ROOT, DIRECTORY)) MEDIA_URL = getattr(settings, "FILEMANAGER_MEDI...
{ "content_hash": "b09bf7a6a3b06a9e55f85862e8377fa6", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 110, "avg_line_length": 37.30769230769231, "alnum_prop": 0.7876288659793814, "repo_name": "byteweaver/django-filemanager", "id": "9375c2de71c3a8fcaf8c777eb0bbed4e924b13d3", ...
from panda3d.core import * from utils import * from objparser import * class ObjLoader(ObjListener): def __init__(self, nodeName): ObjListener.__init__(self) self.vdataFormat = GeomVertexFormat.getV3n3t2() self.node = PandaNode(nodeName) self.triangles = None self.object("object") def object(self, name)...
{ "content_hash": "634528f9f680768edc0a7807dcc2ece7", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 71, "avg_line_length": 25.423357664233578, "alnum_prop": 0.6933677863910422, "repo_name": "codistmonk/burdenofproof", "id": "f9a6df951211ae5ce5bb7a674cc74d96ab917096", "si...
import base64 import gzip import mock import shutil import tempfile from oslo_concurrency import processutils from oslotest import base as test_base import requests from ironic_lib import disk_partitioner from ironic_lib import disk_utils from ironic_lib import exception from ironic_lib import utils @mock.patch.ob...
{ "content_hash": "938093718c9ccb314cfa61fe6e9c69ee", "timestamp": "", "source": "github", "line_count": 428, "max_line_length": 79, "avg_line_length": 45.89252336448598, "alnum_prop": 0.568272070053966, "repo_name": "faizan-barmawer/elytics", "id": "e1c8db8986fea4e7dac85d4f68f580950151e143", "size"...
import ps_list import ps_form #.apidoc title: Printscreen Support """ A special report, that is automatically formatted to look like the screen contents of Form/List Views. """ # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
{ "content_hash": "616867b222c6757391f7781098d1e200", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 70, "avg_line_length": 22.818181818181817, "alnum_prop": 0.7609561752988048, "repo_name": "chjw8016/GreenOdoo7-haibao", "id": "e940a7e467c6ea63ccca8846621722acadf02c88", "s...
import datetime import getpass import glob import logging import multiprocessing import os import platform import subprocess import sys import tempfile import time # Reconsider before importing Buck modules # Timeout in sec for filesystem-related system calls _FS_TIMEOUT_S = 10 def _te(q, f, args): try: ...
{ "content_hash": "7cb80f8226beb43737ffdb6944656ae9", "timestamp": "", "source": "github", "line_count": 418, "max_line_length": 90, "avg_line_length": 32.8732057416268, "alnum_prop": 0.5297285495960993, "repo_name": "JoelMarcey/buck", "id": "ffd74909d1c497d0b6d04d18e1ec2e78fa602f64", "size": "14339...
"""Support for Xiaomi Mi Air Quality Monitor (PM2.5).""" from dataclasses import dataclass import logging from miio import AirQualityMonitor # pylint: disable=import-error from miio import DeviceException from miio.gateway import ( GATEWAY_MODEL_AC_V1, GATEWAY_MODEL_AC_V2, GATEWAY_MODEL_AC_V3, GATEWAY...
{ "content_hash": "93091cf0d90e4bdbc582458f737db4cc", "timestamp": "", "source": "github", "line_count": 329, "max_line_length": 88, "avg_line_length": 30.975683890577507, "alnum_prop": 0.602983024237072, "repo_name": "turbokongen/home-assistant", "id": "821fe164ea97f56269d63660cbe70fddc13cb2cd", "s...
from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-i...
{ "content_hash": "fbcdb194672ba3a36f6399303f621b8b", "timestamp": "", "source": "github", "line_count": 59, "max_line_length": 125, "avg_line_length": 47.59322033898305, "alnum_prop": 0.7104700854700855, "repo_name": "Azure/azure-sdk-for-python", "id": "3001ed6a9b0d83bd9419817cb047b83aeb7dda61", "s...
import mock from oslo_config import cfg from oslo_serialization import jsonutils from oslo_utils.fixture import uuidsentinel as uuids from oslo_utils import timeutils import six import webob from nova.api.openstack.compute import server_metadata \ as server_metadata_v21 from nova.compute import vm_states impor...
{ "content_hash": "b1c3da5d72eb7df30ba216d0682c51f6", "timestamp": "", "source": "github", "line_count": 800, "max_line_length": 79, "avg_line_length": 39.13125, "alnum_prop": 0.5790768247883724, "repo_name": "gooddata/openstack-nova", "id": "a03a42aeb6e288b1a10045654cf48ed57558bce4", "size": "31941...
""" So why would we use a decorator? This example is fairly contrived, but it puts some control flow into a decorator to catch extra input that the sample() function isn't written to accept. """ def mydecorator(func): """ A decorator that simply passes through a function. """ print "Decorator is go!" ...
{ "content_hash": "befa08001a9f7b1952e21c701f43cbdf", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 72, "avg_line_length": 28.55263157894737, "alnum_prop": 0.6516129032258065, "repo_name": "razzius/PyClassLessons", "id": "f5be97589c1adc9c0d2d5f0c33cea15b2946912c", "size":...
""" This program is not to be executed from the command line. It is exec'd by mpdman to support mpigdb. """ # workaround to suppress deprecated module warnings in python2.6 # see https://trac.mcs.anl.gov/projects/mpich2/ticket/362 for tracking import warnings warnings.filterwarnings('ignore', '.*the popen2 module is...
{ "content_hash": "8775dd83951d1dc0a7e867b90e142064", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 120, "avg_line_length": 44.676991150442475, "alnum_prop": 0.49767257601267706, "repo_name": "gnu3ra/SCC15HPCRepast", "id": "9bc71ad1b421d3d20d918fc82333d0475d13ec8c", "siz...
from __future__ import absolute_import, division, print_function import textwrap from distutils.version import LooseVersion from collections import Iterator import sys import traceback from contextlib import contextmanager import warnings import numpy as np import pandas as pd import pandas.util.testing as tm from p...
{ "content_hash": "79b6518bc82111284f2908109b18fce9", "timestamp": "", "source": "github", "line_count": 538, "max_line_length": 79, "avg_line_length": 33.45353159851301, "alnum_prop": 0.5615623958217579, "repo_name": "jeffery-do/Vizdoombot", "id": "b57fcdcb161b70c298336c9b00d21382d22134b3", "size":...
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', # Examples: url(r'^profile/$', 'userprofile.views.profile', name='profile'), # Uncomment the admin/doc line below to...
{ "content_hash": "da7afa5d66a44dc2f4014e258f60c3cf", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 71, "avg_line_length": 32.5625, "alnum_prop": 0.6986564299424184, "repo_name": "The-WebOps-Club/example", "id": "25226184f673be7cb66d22e278e9b7abfdd6f489", "size": "521", ...
""" Tests For Scheduler """ import mock from oslo_config import cfg from oslo_log import log as logging from cinder import context from cinder import db from cinder import exception from cinder.scheduler import driver from cinder.scheduler import filter_scheduler from cinder.scheduler import manager from cinder impor...
{ "content_hash": "362419881646250a3229add41107b3e3", "timestamp": "", "source": "github", "line_count": 344, "max_line_length": 79, "avg_line_length": 45.48255813953488, "alnum_prop": 0.5701776811964719, "repo_name": "julianwang/cinder", "id": "288f4ccc777221fd194cada6e23f4fc41cb213a5", "size": "16...
from __future__ import unicode_literals from django.db import migrations, models import uuid import hypermap.aggregator.models class Migration(migrations.Migration): dependencies = [ ('aggregator', '0007_remove_uuid_null'), ] operations = [ migrations.AlterField( model_name=...
{ "content_hash": "113691f6788550c51eab7c776126f43a", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 135, "avg_line_length": 32.51428571428571, "alnum_prop": 0.6133567662565905, "repo_name": "cga-harvard/hypermap", "id": "d41830b6f40b27d832ffe054e100b9f74e21b3c6", "size": ...
from __future__ import absolute_import, division, print_function from tempfile import mkdtemp import os from shutil import rmtree import numpy as np from ..export_d3po import make_data_file from ...core import Data, Subset from ...tests.helpers import requires_astropy @requires_astropy def test_make_data_file(): ...
{ "content_hash": "3d70050704328a26bb4ed5274fc3c978", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 69, "avg_line_length": 27.970588235294116, "alnum_prop": 0.6393270241850684, "repo_name": "JudoWill/glue", "id": "2533556f7edcb34594835b64dbd71d7585730cd6", "size": "951", ...
import sys, os, random, gc, time, warnings from twisted.internet import defer from twisted.application import app from twisted.python import usage, reflect, failure from twisted import plugin from twisted.python.util import spewer from twisted.python.compat import set from twisted.trial import runner, itrial, reporter...
{ "content_hash": "0d94c7ec7632da49ef104b8c2b2210fa", "timestamp": "", "source": "github", "line_count": 364, "max_line_length": 89, "avg_line_length": 37.49175824175824, "alnum_prop": 0.5755843775188686, "repo_name": "jxta/cc", "id": "a454d170e1efa5da3181fd006717f29bf7d41ff8", "size": "13789", "b...
from __future__ import absolute_import import cgi import email.utils import getpass import json import logging import mimetypes import os import platform import re import shutil import sys import tempfile try: import ssl # noqa HAS_TLS = True except ImportError: HAS_TLS = False from pip._vendor.six.move...
{ "content_hash": "a34b88bdab37a252e84598e6a7c73e52", "timestamp": "", "source": "github", "line_count": 906, "max_line_length": 79, "avg_line_length": 35.48896247240618, "alnum_prop": 0.6002239293378534, "repo_name": "Code-In-Action/python-in-action", "id": "039e55aed191a582628db880b0b6f3ea4b30abb7",...
""" This script parse and download the attachments of an email """ # coding:utf-8 import os import poplib import email import time from datetime import datetime from email._parseaddr import parsedate_tz import util from Preprocess import main as predo import const __author__ = "Aiden" __date__ = "2016-12-28" __copyrig...
{ "content_hash": "6df9041b0facacd638be7aab3b157119", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 92, "avg_line_length": 39.25, "alnum_prop": 0.5229144011185335, "repo_name": "Macchiatto/mail-attachments-downloader", "id": "bf06ef4f9d15e4feadaf295dc26a3cf720152398", "s...
""" Base class for all nodes in the scene graph. It is implemented using the composite pattern. Responsibilities: - Hold the relative position to its parent. - Blit itself on the parent. - Dirty flag itself to trigger regeneration of surface. """ class Component(object): def __init__(self): self._position...
{ "content_hash": "ea730b3111c3e2e30c7b7899fcaa8f32", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 62, "avg_line_length": 25.045454545454547, "alnum_prop": 0.6370235934664247, "repo_name": "sirmar/tetris", "id": "18f854d981f76690887454dc23d04a53ca8373a5", "size": "1102",...
"""Init and utils.""" from zope.i18nmessageid import MessageFactory _ = MessageFactory('newe.sitetheme') def initialize(context): """Initializer called when used as a Zope 2 product."""
{ "content_hash": "b3c87169661072928b92fa0fa05b4e58", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 59, "avg_line_length": 21.555555555555557, "alnum_prop": 0.7216494845360825, "repo_name": "a25kk/newe", "id": "ed4477324f3bd48b980036e892a38bb02ae553fc", "size": "218", "b...
from django.conf.urls import patterns, url from profiles import views urlpatterns = patterns('', url(r'^(?P<name>\w+)$', views.show_user, name='show_user'), )
{ "content_hash": "bd29c208f9f5788b238748a7d01b83cf", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 63, "avg_line_length": 23.571428571428573, "alnum_prop": 0.6787878787878788, "repo_name": "SolusOS-discontinued/RepoHub", "id": "18312cd0269f45a420e8f3c062ce518085c88ab8", "...
from .node import Function, Variable, Add from .model import Model import numpy as np import logging class Individual(object): """Object to store in individual on prefix notation""" def __init__(self, ind, classifier=True, labels=None): self._ind = ind self._pos = 0 self._classifier =...
{ "content_hash": "0551a800b7cbf75d66690df5e246e2c3", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 79, "avg_line_length": 33.722627737226276, "alnum_prop": 0.5445887445887446, "repo_name": "mgraffg/EvoDAG", "id": "e63db38bb913fde125407a2bd7617111e3e1e30c", "size": "5203...
from channels.generic.websocket import JsonWebsocketConsumer from ..models import Post class LiveblogConsumer(JsonWebsocketConsumer): def _get_post(self, kwargs): apphook = kwargs.get("apphook") lang = kwargs.get("lang") slug = kwargs.get("post") try: return Post.objec...
{ "content_hash": "7f8cf876daa07e2cf1971c5026a8ef43", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 102, "avg_line_length": 31.035714285714285, "alnum_prop": 0.61795166858458, "repo_name": "nephila/djangocms-blog", "id": "27d2bd89f0aa5cfc0c7d5e5c2a741954a9816935", "size":...
from .logging_handler import LoggingHandler class Pin(LoggingHandler): def __init__(self, header, pinNumber): super(Pin, self).__init__() self._header = header self._pin_number = int(pinNumber) @property def pin_number(self): return self._pin_number
{ "content_hash": "925587dc4f2ca081f4e2236b81c4d91d", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 43, "avg_line_length": 21.357142857142858, "alnum_prop": 0.6220735785953178, "repo_name": "omni-resources/fof-motor-controller", "id": "63a1f9c63d539ec343e0614d6e715c4a971d9a...
from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from django.utils.translation import ugettext_lazy as _ from models import MenuPlugin class Menu(CMSPluginBase): model = MenuPlugin name = _("Menu") render_template = "menu.html" def render(self, context, instance, place...
{ "content_hash": "3852cbc545d8b5a2b144ee8b0f78819b", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 72, "avg_line_length": 32.121212121212125, "alnum_prop": 0.5858490566037736, "repo_name": "sophilabs/pyconuy-site", "id": "a15ef14f384bf443ac5781c1af1d167dcaad27b9", "size"...
import datetime from oslo.config import cfg from nova.api.ec2 import cloud from nova.api.ec2 import ec2utils from nova.compute import utils as compute_utils from nova import context from nova import db from nova import exception from nova.openstack.common import rpc from nova.openstack.common import timeutils from no...
{ "content_hash": "25b26a160c03e94edf7356f9cf5a9a1f", "timestamp": "", "source": "github", "line_count": 252, "max_line_length": 78, "avg_line_length": 40.79761904761905, "alnum_prop": 0.5817527477871802, "repo_name": "qwefi/nova", "id": "3a8d8b5a9dceb4749c0f0e2105a37dafe7465503", "size": "11005", ...
import clr import System from System.Collections.Generic import * clr.AddReference('RevitAPI') from Autodesk.Revit.DB import * clr.AddReference("RevitNodes") import Revit clr.ImportExtensions(Revit.Elements) clr.ImportExtensions(Revit.GeometryConversion) clr.AddReference("RevitServices") import RevitServices from R...
{ "content_hash": "d19ed6959dfceb005e1885c49031c6cd", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 118, "avg_line_length": 30, "alnum_prop": 0.7991228070175439, "repo_name": "CAAD-RWTH/ClockworkForDynamo", "id": "4895b09b06bee5399fee7c7f9c6fda40bde37855", "size": "1140",...
from django.apps import AppConfig class SugarConfig(AppConfig): name = 'sugar'
{ "content_hash": "b87f35091aedcf133e7add625cf81e59", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 33, "avg_line_length": 17, "alnum_prop": 0.7411764705882353, "repo_name": "kensonman/mansonsolutions.sugar", "id": "6cec5f6dbb2917d8b4a432580693c4da7c69c84c", "size": "85", ...
import socket import subprocess # get hostname hostname = socket.gethostname() # get IP via shell ip = subprocess.check_output(['hostname', '-I']) # find first space and cut string at this index ip4 = ip[:ip.index(" ")] # show it print("Running on host %s.", hostname) print("IP4 address is %s.", ip4)
{ "content_hash": "9c37c0648e65ba80d1914890a87104be", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 48, "avg_line_length": 20.4, "alnum_prop": 0.6928104575163399, "repo_name": "markusk/minibot", "id": "0bb5d00feb2893982ad46fc21e2fdecabb40ddab", "size": "404", "binary": ...
""" Revision ID: 147da617670 Revises: None Create Date: 2015-12-08 23:17:08.754842 """ # revision identifiers, used by Alembic. revision = '147da617670' down_revision = None from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - please adjust! ### op.create_...
{ "content_hash": "80891b410e637623cd43d4167a91054a", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 63, "avg_line_length": 22.266666666666666, "alnum_prop": 0.6676646706586826, "repo_name": "imbstack/pasquino", "id": "7421397f3942ab91f49a46f51cb48c4591285f15", "size": "66...
import getopt import os import re import sys from subprocess import Popen, PIPE, call def usage(): u = ['Usage: cstyle [-w] [rev|rev1..rev2]', '', 'By default, checks working tree against HEAD, or checks changes in', 'HEAD if the working tree is clean. With a revision option, checks', ...
{ "content_hash": "1e5015f1193f9f7b4e0bc20611edc8de", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 78, "avg_line_length": 32.67283950617284, "alnum_prop": 0.5664084640090686, "repo_name": "gerritjvv/cryptoplayground", "id": "7c45335b09df28967d2244a32d3f176d8def445c", "s...
from __future__ import print_function from __future__ import division import time import numpy as np from pyqtgraph.Qt import QtGui import pyqtgraph as pg from pyqtgraph.dockarea import * class GUI: plot = [] curve = [] def __init__(self, width=800, height=450, title=''): # Create GUI window ...
{ "content_hash": "7d000f8c994bcbf1d6ad24300e780d3d", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 74, "avg_line_length": 27.862745098039216, "alnum_prop": 0.5967628430682618, "repo_name": "joeybab3/audio-reactive-led-strip", "id": "869d5c09ad35c2345e2bdda3b5d6dcc107082b73...
from copy import deepcopy from typing import Any, Awaitable from msrest import Deserializer, Serializer from azure.core import AsyncPipelineClient from azure.core.rest import AsyncHttpResponse, HttpRequest from .. import models from ._configuration import SIPRoutingServiceConfiguration from .operations import SIPRou...
{ "content_hash": "699745fa7d17c754d175b8e144076534", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 116, "avg_line_length": 38.27272727272727, "alnum_prop": 0.67119104173736, "repo_name": "Azure/azure-sdk-for-python", "id": "2f2b9c446a36370a58e86f7eac55e8e70cf4a4c0", "siz...
""" Uses lsof to collect data on number of open files per user per type #### Config Options Check Options table below *** Priority Explanation *** This is an explanation of the priority in which users, groups, and uid, are evaluated. EXCLUDE ALWAYS OVERRULES INCLUDE within the same level (ie within users o...
{ "content_hash": "005aeed0d4daecc7f274e0d78c297cd6", "timestamp": "", "source": "github", "line_count": 265, "max_line_length": 80, "avg_line_length": 42.21132075471698, "alnum_prop": 0.5180582871446451, "repo_name": "zoidbergwill/Diamond", "id": "a7016f9b66583d77aee81229cae2d4d3daad5e90", "size": ...
from django.contrib.syndication.feeds import Feed from django.core.urlresolvers import reverse from basic.blog.models import Settings from django_proxy.models import Proxy from tagging.models import Tag, TaggedItem class AllEntries(Feed): _settings = None @property def settings(self): if self._se...
{ "content_hash": "87fcb3798c8c9adbe379838374f9a223", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 82, "avg_line_length": 27.256410256410255, "alnum_prop": 0.6222953904045155, "repo_name": "azizmb/django-mingus", "id": "c5acf882ca32e31e52c3f9f6975a9d72f0fc0533", "size": ...
""" OneResume - data-driven resume generation Usage: one_resume single -t <template-file> -y <yaml-file> -o <output-file> -f <format> [-v|-d] one_resume batch -c <config-file> [-v|-d] one_resume -h | --help one_resume --version Options: -h --help Show th...
{ "content_hash": "ee07d24ea015416bfcbc085f749bc697", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 125, "avg_line_length": 36.63779527559055, "alnum_prop": 0.5359982806791317, "repo_name": "virantha/one_resume", "id": "d1b626fb28e723e1d5356a0279e7b306c0835ea8", "size": ...
from __future__ import unicode_literals import django.core.validators from django.db import migrations, models import zerver.models class Migration(migrations.Migration): dependencies = [ ('zerver', '0093_subscription_event_log_backfill'), ] operations = [ migrations.AlterField( ...
{ "content_hash": "250891eaacd30c9f9adc52ff3ac1fd8c", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 126, "avg_line_length": 26.65, "alnum_prop": 0.6679174484052532, "repo_name": "vabs22/zulip", "id": "b9af3bc83ff497c6455234b035533ee96d3431e5", "size": "606", "binary": f...
"""This module contains the Student Model.""" __authors__ = [ '"Todd Larsen" <tlarsen@google.com>', '"Sverre Rabbelier" <sverre@rabbelier.nl>', '"Lennard de Rijk" <ljvderijk@gmail.com>', ] from google.appengine.ext import db from django.utils.translation import ugettext from soc.models import countries impo...
{ "content_hash": "f9c733371368a91349e5adaf489cbcee", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 80, "avg_line_length": 44.26923076923077, "alnum_prop": 0.7103967564436722, "repo_name": "jamslevy/gsoc", "id": "caaeeb32e7927ec446ce0f234c9b4ce15bbefba7", "size": "4061", ...
from builtins import str import re try: unicode = unicode except NameError: # 'unicode' is undefined, must be Python 3 str = str unicode = str bytes = bytes basestring = (str,bytes) else: # 'unicode' exists, must be Python 2 str = str unicode = unicode bytes = str basestring...
{ "content_hash": "c7ed3b5461fa7fa7470e30c49dfbb804", "timestamp": "", "source": "github", "line_count": 286, "max_line_length": 79, "avg_line_length": 32.13986013986014, "alnum_prop": 0.5938859878154917, "repo_name": "datadesk/p2p-python", "id": "8287973440c36b584bc0b557921b522efd48c75d", "size": "...
import os import sys import subprocess import shutil from setuptools import setup def _read(fn): path = os.path.join(os.path.dirname(__file__), fn) return open(path).read() # Build manpages if we're making a source distribution tarball. if 'sdist' in sys.argv: # Go into the docs directory and build the ma...
{ "content_hash": "0e6f67dc9be3f3caaf2906d94751aea2", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 66, "avg_line_length": 27.985915492957748, "alnum_prop": 0.5636638147961751, "repo_name": "aspidites/beets", "id": "df48b94aa5a57d16d3bc2c50a6bbb25c6c054d9d", "size": "2658...
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import logging import os import click from django.core.management.base import BaseCommand from django.core.management.base import CommandError import kolibri from ...utils import dbrestore from ...uti...
{ "content_hash": "3015c2b4d94baef79b7f33e3efadfc75", "timestamp": "", "source": "github", "line_count": 146, "max_line_length": 88, "avg_line_length": 33.11643835616438, "alnum_prop": 0.5607032057911066, "repo_name": "mrpau/kolibri", "id": "b1aa1faa1dca2daa6a0d34cea32e523612579cdd", "size": "4835",...
import pytest from bst import Bst def test_constructor(): instance = Bst() assert type(instance) is Bst def test_insert(empty_tree): a = empty_tree a.insert(5) a.insert(7) assert 7 is a.top.right.data a.insert(8) a.insert(6) a.insert(9) assert a.top.data == 5 assert a.siz...
{ "content_hash": "760f38ce846fddbb7e5ac110573f8bf5", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 64, "avg_line_length": 21.97530864197531, "alnum_prop": 0.625, "repo_name": "edpark13/data_structure2", "id": "564a00c52aa7f5381280e2a375dff0ff39156e05", "size": "3584", ...
import sys from restorm.examples.mock.api import LibraryApiClient def main(argv): """ Start with:: python -m restorm.examples.mock.library_serv [port or address:port] """ ip_address = '127.0.0.1' port = 8000 # This is an example. Your should do argument checking. if len(arg...
{ "content_hash": "7d4d5e21e17817907a4f880cb84d8c54", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 88, "avg_line_length": 27.153846153846153, "alnum_prop": 0.5967894239848914, "repo_name": "josesanch/restorm", "id": "262ac80ea4e05635ca7e18fdce672f345d178251", "size": "10...
from construct import ( Struct, ) from distance.bytes import Magic, Section from distance.construct import ( BaseConstructFragment, Bytes, DstString, Remainder, ) from distance.classes import CollectorGroup from .levelsettings_base import BaseLevelSettings Classes = CollectorGroup() @Classes.level_...
{ "content_hash": "4824f735bccddc13b0c9292b492b4cf4", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 65, "avg_line_length": 21.836734693877553, "alnum_prop": 0.6551401869158878, "repo_name": "ferreum/distanceutils", "id": "2ee26707a5afccaf8696705b288dc2ff54350526", "size":...
"""Console script for ABR.""" import click @click.command() def main(args=None): """Console script for ABR.""" click.echo("Replace this message by putting your code into " "ABR.cli.main") click.echo("See click documentation at http://click.pocoo.org/") if __name__ == "__main__": main...
{ "content_hash": "d9bbdbb10a87f779f285446cffba59ac", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 68, "avg_line_length": 21.533333333333335, "alnum_prop": 0.6099071207430341, "repo_name": "BlackPoint-CX/ABR", "id": "3e74eb3a412fece9c3852a65e2ec47f41a877958", "size": "34...
import csv import json import os import sys import re from tqdm import tqdm import time import git import shutil import os.path as osp from utils import * import requests from connect import * from db_op import * V_CLASS = sys.argv[1] #Top 10 OSWAP 2013 # injection (sql,ldap,xpath,xquery,xml,html,os commands). injec ...
{ "content_hash": "b5f15293d5cb6b1a917d865d833b0922", "timestamp": "", "source": "github", "line_count": 217, "max_line_length": 264, "avg_line_length": 34.806451612903224, "alnum_prop": 0.5975109228121276, "repo_name": "TQRG/secbench", "id": "f88bc08f2b39208066e3284216272d12072faa09", "size": "7553...
from llvmlite import ir from llvmlite.ir.transforms import Visitor, CallVisitor class FastFloatBinOpVisitor(Visitor): """ A pass to add fastmath flag to float-binop instruction if they don't have any flags. """ float_binops = frozenset(['fadd', 'fsub', 'fmul', 'fdiv', 'frem', 'fcmp']) def __i...
{ "content_hash": "3014905650ac2df2a35d6fe005af690d", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 78, "avg_line_length": 27.522727272727273, "alnum_prop": 0.6267547481420314, "repo_name": "sklam/numba", "id": "d6dd1b89c20cb78cd9b819663aa21ce270ce4bbe", "size": "1211", ...
'''------------------------------------------------------------------------- Copyright IBM Corp. 2015, 2015 All Rights Reserved 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/...
{ "content_hash": "6f0cb1b0d08619ae5cb26d69af9c8a0d", "timestamp": "", "source": "github", "line_count": 349, "max_line_length": 79, "avg_line_length": 36.6189111747851, "alnum_prop": 0.5442879499217528, "repo_name": "os-cloud-storage/openstack-workload-disaster-recovery", "id": "687896b07a68ce115b081...
""" Created on 2015-05-19 @author: Danny<manyunkai@hotmail.com> DannyWork Project """ from __future__ import unicode_literals from django import forms from .models import ImageItem class ImageItemForm(forms.ModelForm): """ 图片对象 Form """ class Meta: model = ImageItem fields = ['tit...
{ "content_hash": "1eeb11839efa936b7f8b7e573708d340", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 71, "avg_line_length": 18.44, "alnum_prop": 0.6052060737527115, "repo_name": "manyunkai/dannysite4", "id": "896b79fc54d70549c608e5d2cad27b3563261a57", "size": "491", "bin...
from distutils.core import setup setup( name="rimage", version = "0.1", description = "Generic framework to associate a profile image with mongo documents.", author = "Manas Garg", author_email = "manasgarg@gmail.com", license = "BSD License", url = "https://github.com/manasgarg/rimage", pa...
{ "content_hash": "93049b96f5110f9fd8f874d41cd719d2", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 89, "avg_line_length": 28.46153846153846, "alnum_prop": 0.654054054054054, "repo_name": "manasgarg/rimage", "id": "fc44ef141d18459181ff189110a03f3b9ecc7c5a", "size": "393",...
import os import shutil import build_utils def get_supported_targets(platform): if platform == 'win32': return ['win32'] elif platform == 'darwin': return ['macos'] elif platform == 'linux': return ['linux'] else: return [] def get_dependencies_for_target(target): ...
{ "content_hash": "f22ed074771373d833ea2eeaf4d75e98", "timestamp": "", "source": "github", "line_count": 130, "max_line_length": 75, "avg_line_length": 31.146153846153847, "alnum_prop": 0.6599160286490492, "repo_name": "dava/dava.engine", "id": "22dc801a16935ff397630634a7727c81fba20f16", "size": "40...
import csv import os import glob import argparse import numpy as np def merge_csv_files(src_dir, dst_dir): ''' Takes a list of csv files (full file path) and merges them into a single output. ''' # Create a list of all the md files in the given directory csv_list = glob.glob(os.path.join(src_d...
{ "content_hash": "f5b06596a67e6ddc7e8cfd58f22e780f", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 79, "avg_line_length": 28.29245283018868, "alnum_prop": 0.5658552850950317, "repo_name": "NeoGeographyToolkit/Tools", "id": "fb7b42e8538824d0f54817b51c461bc8ac30b4df", "si...
from core import geo, pmap import numpy as np from datetime import timedelta import glob import os from netcdf import netcdf as nc from cache import Cache, Loader from helpers import short import logging class Heliosat2(object): def __init__(self, config, strategy_type): self.config = config self...
{ "content_hash": "d27ff2cd07a5dee18bc6da4083c2af25", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 79, "avg_line_length": 40.00595238095238, "alnum_prop": 0.6168724892129147, "repo_name": "scottlittle/solar_radiation_model", "id": "3f0ca3814d16a097ee4f74b31f4c167f1619f2bc...
"""Support for providing temporary directories to test functions.""" import os import re import sys import tempfile from pathlib import Path from shutil import rmtree from typing import Dict from typing import Generator from typing import Optional from typing import TYPE_CHECKING from typing import Union from _pytest....
{ "content_hash": "9d5e01ea546a21982f3de654934214d8", "timestamp": "", "source": "github", "line_count": 326, "max_line_length": 118, "avg_line_length": 36.33435582822086, "alnum_prop": 0.6268467707893626, "repo_name": "pytest-dev/pytest", "id": "3fd8168b6d28570f7aa6cab89ba2df35e014ecee", "size": "1...
from AccessControl import getSecurityManager from Products.Archetypes.config import REFERENCE_CATALOG from Products.CMFCore.utils import getToolByName from bika.lims.browser import BrowserView from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile from bika.lims import bikaMessageFactory as _ from bika...
{ "content_hash": "ae78cfdc591aec91c0105a6d037d8871", "timestamp": "", "source": "github", "line_count": 415, "max_line_length": 111, "avg_line_length": 41.262650602409636, "alnum_prop": 0.4842910534921747, "repo_name": "hocinebendou/bika.gsoc", "id": "cdfabacd409fb5968035238b86f7c010010ce978", "siz...
from django.conf.urls import patterns, include, url from django.contrib import admin urlpatterns = patterns('', # Examples: # url(r'^$', 'django_python3_ldap_test.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^admin/', include(admin.site.urls)), )
{ "content_hash": "c79e0cff0ea38ed79759739bb7c5ffca", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 69, "avg_line_length": 29.3, "alnum_prop": 0.6518771331058021, "repo_name": "sol33t/django-python3-ldap", "id": "03a0a44c0e1eaeba164794dc905dce053d9dc673", "size": "293", ...
from nose.tools import * from dateutil.parser import parse as time_parse import yawhois class TestWhoisWildwestdomainsComStatusRegistered(object): def setUp(self): fixture_path = "spec/fixtures/responses/whois.wildwestdomains.com/status_registered.txt" host = "whois.wildwestdomains.com" ...
{ "content_hash": "f9451c8ee3065cea9e8556c92f8de7ad", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 96, "avg_line_length": 53.3304347826087, "alnum_prop": 0.6536768302625142, "repo_name": "huyphan/pyyawhois", "id": "9b2363b5dfaabc77ab32b1d91f176ef1bf2885b2", "size": "640...
from __future__ import unicode_literals import json from gensim.models.phrases import Phrases from textblob import TextBlob # from gensim: threshold represents a threshold for forming the phrases (higher means fewer phrases). # A phrase of words a and b is accepted if (cnt(a, b) - min_count) * N / (cnt(a) * cnt(b)) >...
{ "content_hash": "b4e5aef8fa608d848190089243b2211d", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 141, "avg_line_length": 31.302083333333332, "alnum_prop": 0.5876871880199668, "repo_name": "jonroberts/nasaMining", "id": "a5822c5b64c619a42d7183ccb76e8c48aca54e0e", "size"...
""" Stub functions that are used by the Amazon Rekognition unit tests. """ from test_tools.example_stubber import ExampleStubber class RekognitionStubber(ExampleStubber): """ A class that implements stub functions used by Amazon Rekognition unit tests. The stubbed functions expect certain parameters to ...
{ "content_hash": "ea99c1c34bfd9e114ae8d7619e6f918e", "timestamp": "", "source": "github", "line_count": 287, "max_line_length": 91, "avg_line_length": 43.30313588850174, "alnum_prop": 0.5963147730930157, "repo_name": "awsdocs/aws-doc-sdk-examples", "id": "c95080e35b254f2d8ad3dc62884625f1f3c2ef7e", ...
import sys PATH_INSTALL = "./" sys.path.append(PATH_INSTALL) from androguard.core.bytecodes import dvm from androguard.core.bytecodes import apk from androguard.core.analysis import analysis from androguard.core import androconf import hashlib TEST = "examples/android/TestsAndroguard/bin/TestsAndroguard.apk" andr...
{ "content_hash": "c9dfa596792d28b031482f36bf452b38", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 65, "avg_line_length": 20.333333333333332, "alnum_prop": 0.726775956284153, "repo_name": "subho007/androguard", "id": "cb6d70097227ab0b221b0248f25563489902ebaa", "size": "5...
import types import inspect import traceback class _MyAttributeError(Exception): pass def convert_attribute_error(f): def f_(*args, **kwargs): try: return f(*args, **kwargs) except AttributeError, e: print "~" * 78 traceback.print_exc() print...
{ "content_hash": "8c7afffe47ad253ec87bed8dc6400a22", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 76, "avg_line_length": 30.941747572815533, "alnum_prop": 0.5080012550988391, "repo_name": "PuZheng/lejian-backend", "id": "697b9563d4a69bd5cfd89778448fec2832ee2361", "size...
from PlaceHoldMachine import PlaceHoldMachine #import class i = PlaceHoldMachine() #create class instance i.log_level = 2 #set log level to 2, so we can see errors # set directories list, where all images will be replaced with placeholders dirs = [ 'C:/MyTemplate/images/demo', 'C:/MyTemplate/images/ads', 'C:/MyTem...
{ "content_hash": "270492da0269827e13fcc9215d9ff408", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 75, "avg_line_length": 32.142857142857146, "alnum_prop": 0.7666666666666667, "repo_name": "Priler/PlaceHoldMachine", "id": "e0e9ccfc441651f30464e22d3a8dce4e9153e76e", "size...
""" Find a few eigenvectors and eigenvalues of a matrix. Uses ARPACK: http://www.caam.rice.edu/software/ARPACK/ """ # Wrapper implementation notes # # ARPACK Entry Points # ------------------- # The entry points to ARPACK are # - (s,d)seupd : single and double precision symmetric matrix # - (s,d,c,z)neupd: single,do...
{ "content_hash": "5da9f789201672969fea8651e3aead51", "timestamp": "", "source": "github", "line_count": 1691, "max_line_length": 89, "avg_line_length": 39.7806031933767, "alnum_prop": 0.5359080705822891, "repo_name": "grlee77/scipy", "id": "80d7465500443c2f800738738526950ba4f327a8", "size": "67269"...
import sys, os # 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.append(os.path.abspath('.')) # -- General configuration...
{ "content_hash": "0530a8a75504a3b18236206b48f76252", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 80, "avg_line_length": 32.94535519125683, "alnum_prop": 0.7072482998838945, "repo_name": "tabo/numconv", "id": "1f1abfb15e261d9ccecb4bdeb163351ee7f02939", "size": "6447", ...
class FileManager: def HasFile(self, filename): return filename in self.files def GetFile(self, filename): return self.files[filename] def main(): ... assert fm.HasFile(opts.prefix + 'calendar/events/2012-01-02-foo.html') text = fm.GetFile(opts.prefix + 'calendar/events/2012-01-02-foo.html') ...
{ "content_hash": "ce4389512db88be7957f9dff60ce88c7", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 86, "avg_line_length": 29.476190476190474, "alnum_prop": 0.6623586429725363, "repo_name": "starpow971/Stanford-Humanities-Center-Updater", "id": "6dccb939a2db28e6234aed603ab9...
import fastq_index import sys from fastq_lookup import DictionaryLookup, BinaryLookup lookup1 = DictionaryLookup("test/test_index", "test/PE-173.40k.fastq") lookup2 = BinaryLookup("test/test_index", "test/PE-173.40k.fastq") to_lookup = [] count = 0 for line in open("test/PE-173.40k.fastq", 'r'): if count % 4 ==0:...
{ "content_hash": "c487aba879bc0671f2244c1f7e0b8fd9", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 70, "avg_line_length": 26.103448275862068, "alnum_prop": 0.6129458388375165, "repo_name": "hillst/FastqIndex", "id": "cfa3a598e6ec0642bb1e554a8c38fc5a0db24b5f", "size": "75...
'''sample usage of exchrate package''' import exchrate # import package from exchrate import exrateparse # import parse module from exchrate.exrateparse import ExchangeRateParse # import class directly from pprint import pprint # set parameters exratesrc = 'NBU-json' # exchange rate source exratedate = ('2016-12-01',...
{ "content_hash": "94b2009e636e943fd90b87a1af8928d2", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 86, "avg_line_length": 32.40845070422535, "alnum_prop": 0.6162538026944807, "repo_name": "anton-shestakov/exchrate", "id": "2bf5760a10f9c19b79a880c8f1c754227c470a0a", "size...
import inspect import json from contextlib import ExitStack from typing import Iterable import base58 from plenum.common.constants import REQACK, TXN_ID, DATA from stp_core.common.log import getlogger from plenum.common.signer_simple import SimpleSigner from plenum.common.util import getMaxFailures, runall from plenum...
{ "content_hash": "1d01b655c866f8c6172da542be46fa64", "timestamp": "", "source": "github", "line_count": 406, "max_line_length": 79, "avg_line_length": 35.33990147783251, "alnum_prop": 0.6021745190967382, "repo_name": "keenondrums/sovrin-node", "id": "aaeaf4143b74e8a33858f913c3b7159596788168", "size...
from . import cmake_product from . import earlyswiftdriver class CMark(cmake_product.CMakeProduct): @classmethod def is_build_script_impl_product(cls): """is_build_script_impl_product -> bool Whether this product is produced by build-script-impl. """ return False @classme...
{ "content_hash": "b074e59c4384ab065650bb9772d4db0b", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 84, "avg_line_length": 33.99029126213592, "alnum_prop": 0.61753784632962, "repo_name": "ahoppen/swift", "id": "bde199b37e0de49cca889f9e2f0b355d76720b98", "size": "4008", ...
import sys import os import json import ConfigParser import logging import argparse import struct sys.path.insert(0, os.path.abspath(os.getcwd())) from modulos.Collection import Collection from modulos.Indexer import Indexer from modulos.PicklePersist import PicklePersist from modulos.Postings import SequentialPosting...
{ "content_hash": "f47e07f598e3fc3db76d65c02949b88d", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 124, "avg_line_length": 34.845360824742265, "alnum_prop": 0.7281065088757397, "repo_name": "Juancard/parallel-and-distributed-IR", "id": "fed55348b00d500df57a4fb81e55eb83d199...
from setuptools import setup, find_packages setup( name='mp3fm', version='1.0.3', author='Akshit Agarwal', author_email='akshit.jiit@gmail.com', url='https://github.com/Aki92/mp3fm', packages=find_packages(), entry_points = { 'console_scripts': ['mp3f...
{ "content_hash": "b1e3fe6d45f963351661ad04d4c16ce5", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 85, "avg_line_length": 41.208333333333336, "alnum_prop": 0.6440849342770475, "repo_name": "Aki92/mp3fm", "id": "0566e6af42c6b5e5b8989daabbef6a07de95962f", "size": "989", ...
""" Commands for telling a worker to load tests or run tests. @since: 12.3 """ from twisted.protocols.amp import Command, String, Boolean class Run(Command): """ Run a test. """ arguments = [('testCase', String())] response = [('success', Boolean())] class Start(Command)...
{ "content_hash": "c67c95b752551980558860db5d89046c", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 60, "avg_line_length": 18.73076923076923, "alnum_prop": 0.5749486652977412, "repo_name": "timkrentz/SunTracker", "id": "775da2cf78e2c1563a82b26562659b479b0bae43", "size": "...
import json import random import re import itertools from collections import Counter from qanta.ingestion.classifier import Classifier from qanta.util.constants import ( GUESSER_TRAIN_FOLD, BUZZER_TRAIN_FOLD, GUESSER_DEV_FOLD, BUZZER_DEV_FOLD, GUESSER_TEST_FOLD, BUZZER_TEST_FOLD, ) def try_pa...
{ "content_hash": "98742cf9dc4896e4a754669071d70a85", "timestamp": "", "source": "github", "line_count": 349, "max_line_length": 113, "avg_line_length": 35.939828080229226, "alnum_prop": 0.5455632623774217, "repo_name": "miyyer/qb", "id": "112fd2463043c23d87d1df0b79c49779a8197462", "size": "12549", ...
from __future__ import absolute_import from __future__ import with_statement import anyjson import warnings from celery import registry from celery.app import app_or_default from celery.task import Task from celery.task.sets import subtask, TaskSet from celery.tests.utils import unittest from celery.tests.compat imp...
{ "content_hash": "3ec404fbfd0ae36a5b2e8efac5f8ad18", "timestamp": "", "source": "github", "line_count": 183, "max_line_length": 79, "avg_line_length": 34.240437158469945, "alnum_prop": 0.5134056814554739, "repo_name": "softak/webfaction_demo", "id": "ffb35ba7e02ed8722c0a5342a1326f595480fb3a", "size...
from urllib.parse import urljoin, urlparse from ...app import models from ...app.types import AppExtensionTarget from ...core.jwt import ( create_access_token_for_app, create_access_token_for_app_extension, ) from ..core.utils import from_global_id_or_error from .enums import AppTypeEnum def resolve_apps_ins...
{ "content_hash": "fce025d1afa4c56c25451691c5aab59a", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 85, "avg_line_length": 28.67142857142857, "alnum_prop": 0.6796213253612357, "repo_name": "mociepka/saleor", "id": "b4e5decf4fad148c11afc51887c8f53cea3837db", "size": "2007"...
"""Cloud browser template tags.""" import os from django import template from django.template import TemplateSyntaxError, Node from django.template.defaultfilters import stringfilter from cloud_browser.app_settings import settings register = template.Library() # pylint: disable=C0103 @register.filter @stringfilte...
{ "content_hash": "b26a62d078d2eba54ccc1892648cea68", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 79, "avg_line_length": 27.886363636363637, "alnum_prop": 0.623879380603097, "repo_name": "lantip/aws-filemanager", "id": "5b7377d614bf487db2bda37384dd6c491e631770", "size":...
from itertools import product class Interval: """Generate intervals from lower to upper of size delta, last interval will be smaller if needed >>> from dstools.pipeline.util import Interval >>> from datetime import date >>> from dateutil.relativedelta import relativedelta >>> Interval(date(ye...
{ "content_hash": "0d356ede7aa675167dc106e39f41ec01", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 74, "avg_line_length": 25.977777777777778, "alnum_prop": 0.5162532078699743, "repo_name": "edublancas/dstools", "id": "cf9fbd3431cc6b54c91737d20de77762cf3c3f6b", "size": "2...
import argparse import redis if __name__ == '__main__':
{ "content_hash": "dcc568cad250f1ded6ad25b1729ae476", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 26, "avg_line_length": 12.4, "alnum_prop": 0.5645161290322581, "repo_name": "jbfavre/dynomite", "id": "8590ba11fac4d7eb3a080f1a5e126bcd9fb5ef5f", "size": "165", "binary": ...
''' This script is a check for lookup at disks consumption ''' import os import sys # Ok try to load our directory to load the plugin utils. my_dir = os.path.dirname(__file__) sys.path.insert(0, my_dir) try: import schecks except ImportError: print "ERROR : this plugin needs the local schecks.py lib. Please ...
{ "content_hash": "e4cee59cdc3c7b4b72ae5a0bccc5cb36", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 177, "avg_line_length": 33.24277456647399, "alnum_prop": 0.5470352982090071, "repo_name": "ovh/check-linux-by-ssh", "id": "147812f5bfc2a5c62c9f90cebd09cafc676d9d92", "size...
"""Class that computes the Wasserstein distance in tensorflow. The implementation follows Algorithm 2 in [Genevay Aude, Marco Cuturi, Gabriel Peyre, Francis Bach, "Stochastic Optimization for Large-scale Optimal Transport", NIPS 2016], which compares a distribution to a fixed set of samples. Internally, ba...
{ "content_hash": "13daabd1e21393a828a70d96ff0f6d3e", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 83, "avg_line_length": 41.386861313868614, "alnum_prop": 0.6513227513227513, "repo_name": "google/wasserstein-dist", "id": "9d65a2162d8d2423d039e05632999685783c6a9c", "siz...
from flask import Blueprint, request from flask import current_app as app import models import flask editable = Blueprint("editable", __name__, template_folder="templates", static_folder="static") @editable.route("/", methods=["GET", "POST"]) @editable.route("/<path:url>", methods=["GET", "POST"]) def editor(url = ""...
{ "content_hash": "a60b3823910b6cf8f9325b143ebc7593", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 95, "avg_line_length": 42, "alnum_prop": 0.6262939958592133, "repo_name": "SmileyJames/flask-editable", "id": "62114e75973188ffb6545d226fe516b8dbab73b9", "size": "966", "...
__author__ = 'hydezhang' from utils.db_base import * from collections import OrderedDict def initialise_tenants_mapping(): """function to create the tenant table which is used to record tenant that has been migrated """ table_name = "tenants" if not check_table_exist(table_name): co...
{ "content_hash": "11c32f20630e027f9e2bbda65dd8a8ab", "timestamp": "", "source": "github", "line_count": 121, "max_line_length": 82, "avg_line_length": 34.247933884297524, "alnum_prop": 0.5644305019305019, "repo_name": "Phoenix1708/OpenAcademy_OpenStack_Flyway", "id": "f1dd78da22e23b7bd2770a900cf7f63c...
import os import time import contextlib import selenium.common from selenium import webdriver @contextlib.contextmanager def new_auto(*args, **kwargs): b = new(*args, **kwargs) yield b b.quit() def new(url=None, size=None): PATH_CHROMIUM = "/Applications/Chromium.app/Contents/MacOS/Chromium" ...
{ "content_hash": "6b2b2a97fd49eb7bac6661be5c988010", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 86, "avg_line_length": 27.16923076923077, "alnum_prop": 0.6132502831257078, "repo_name": "alobbs/webest", "id": "31b09be79950b2fbb53faa74c7d38bc2f0f6955e", "size": "1766", ...
"""Support for Wink lights.""" from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_HS_COLOR, SUPPORT_BRIGHTNESS, SUPPORT_COLOR_TEMP, SUPPORT_COLOR, Light) from homeassistant.components.wink import DOMAIN, WinkDevice from homeassistant.util import color as color_util from homeassi...
{ "content_hash": "bfe7415744638c0e47aa94718689c1c9", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 76, "avg_line_length": 34.301886792452834, "alnum_prop": 0.6105610561056105, "repo_name": "nugget/home-assistant", "id": "14a983154f82f5ee3273aec10efaa259ee74e521", "size"...
from lib.aws import AmazonWebServices from .common import * # NOQA k8s_version = "v1.10.1-rancher1" rke_config = {"authentication": {"type": "authnConfig", "strategy": "x509"}, "ignoreDockerVersion": False, "type": "rancherKubernetesEngineConfig"} RANCHER_CLEANUP_CLUSTER = os.environ.get(...
{ "content_hash": "8f96451741efb92927775923920f4f12", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 77, "avg_line_length": 34.72727272727273, "alnum_prop": 0.6234729493891797, "repo_name": "sabiodelhielo/rancher-validation", "id": "dfa46003999311ac99d4a18c5149dc6f7b512bf7",...
import unittest import numpy as np import sys sys.path.append("..") from op_test import OpTest import paddle import paddle.fluid as fluid from paddle.fluid import compiler, Program, program_guard from paddle.fluid import core paddle.enable_static() np.random.seed(10) # Situation 1: repeat_times is a list (without t...
{ "content_hash": "c3dae821112098abce86fb190559d370", "timestamp": "", "source": "github", "line_count": 247, "max_line_length": 80, "avg_line_length": 28.20242914979757, "alnum_prop": 0.5829744473155326, "repo_name": "luotao1/Paddle", "id": "e8003f82aa950c47307c68a8644b6b4144cae71b", "size": "7579"...
from __future__ import absolute_import import sys from .eccodes import * from .eccodes import __version__ if sys.version_info >= (2, 6): from .high_level.gribfile import GribFile from .high_level.gribmessage import GribMessage from .high_level.gribindex import GribIndex from .high_level.bufr import Bu...
{ "content_hash": "fbbc759542d272df84da9774cb24a767", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 54, "avg_line_length": 30.90909090909091, "alnum_prop": 0.7441176470588236, "repo_name": "0x1mason/GribApi.XP", "id": "42006b9f08a12ba0f63528253e1717b6609fc5ea", "size": "3...
""" Created on Fri Apr 8 12:46:55 2016 @author: Manojkumar Parmar VirKrupa @Github Repo : Modified on : Version : Remarks: """ class Node(object): def __init__(self, name): self.name = str(name) def getName(self): return self.name def __str__(self): return self.name class Edge...
{ "content_hash": "ea159f26ec71c54a41305d70010356e7", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 62, "avg_line_length": 25.2, "alnum_prop": 0.5710835058661146, "repo_name": "parmarmanojkumar/MITx_Python", "id": "c868bf2b17455836b5419a10fc57297beaf3e219", "size": "2922...
"""pred.py Usage: pred.py <model_dir> [--evaluation=<DATA>] [--debug] Options: --evaluation=<DATA> [default: kbp_eval] """ import os from docopt import docopt import numpy as np from utils import np_softmax from pprint import pprint from configs.config import Config from data.dataset import Dataset, Split fro...
{ "content_hash": "9813d97a6a0edbb82946f83ce032dfe6", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 166, "avg_line_length": 40.18279569892473, "alnum_prop": 0.6507894032646507, "repo_name": "vzhong/sent2rel", "id": "e29b85d48a6b23cbb948d3d400fba77bdb4dd3f3", "size": "3801...