text
stringlengths
4
1.02M
meta
dict
import copy from api.jobs import gears # DISCUSS: this basically asserts that the log helper doesn't throw, which is of non-zero but questionable value. # Could instead be marked for pytest et. al to ignore coverage? Desirability? Compatibility? def test_fill_defaults(): gear_config = { 'key_one': {'...
{ "content_hash": "688fd031a61e3578a8ba95eca08e3c2f", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 113, "avg_line_length": 27.945454545454545, "alnum_prop": 0.5744957709824333, "repo_name": "scitran/api", "id": "75880407597dcdbbfebc4126b2cab8b06f8a8edd", "size": "1538", ...
"""This module is deprecated. Please use `airflow.providers.microsoft.mssql.hooks.mssql`.""" import warnings # pylint: disable=unused-import from airflow.providers.microsoft.mssql.hooks.mssql import MsSqlHook # noqa warnings.warn( "This module is deprecated. Please use `airflow.providers.microsoft.mssql.hooks.m...
{ "content_hash": "3c9319480ddf87201d1357712d5ace2e", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 93, "avg_line_length": 33.45454545454545, "alnum_prop": 0.7744565217391305, "repo_name": "wooga/airflow", "id": "2584ea76ee73fb6bf7705c54be35b0571c275ce0", "size": "1155", ...
from lib import action class EnableProject(action.JenkinsBaseAction): def run(self, name): return self.jenkins.enable_job(name)
{ "content_hash": "8cc35340e06de793d091f377a12df986", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 46, "avg_line_length": 23.666666666666668, "alnum_prop": 0.7323943661971831, "repo_name": "StackStorm/st2contrib", "id": "ef8de9cf63a9bac959a63e973743ea0ea7ef1eaa", "size": ...
from PyQt5 import Qt import numpy from zplib.curve import interpolate from zplib.image import resample from .. import shared_resources from . import base class FreeSpline(base.RWGeometryItemMixin, Qt.QGraphicsPathItem): QGRAPHICSITEM_TYPE = shared_resources.generate_unique_qgraphicsitem_type() def __init__(...
{ "content_hash": "b8a05010ab75afcc4ad8c1d9ddf5f324", "timestamp": "", "source": "github", "line_count": 255, "max_line_length": 149, "avg_line_length": 39.898039215686275, "alnum_prop": 0.6006487124041675, "repo_name": "zpincus/RisWidget", "id": "e18a3f0c937de96a5cc50d8525150a5c8af5a42e", "size": "...
from django.urls import path from netbox.views.generic import ObjectChangeLogView, ObjectJournalView from . import views from .models import * app_name = 'wireless' urlpatterns = ( # Wireless LAN groups path('wireless-lan-groups/', views.WirelessLANGroupListView.as_view(), name='wirelesslangroup_list'), ...
{ "content_hash": "5dfb47c698ae1fa740d4fe5b2f47d18f", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 154, "avg_line_length": 78.46666666666667, "alnum_prop": 0.7380345511186632, "repo_name": "digitalocean/netbox", "id": "cef96fd5e3c084399f8c6b0debe037e8345c2a15", "size": "...
from __future__ import with_statement import os import unittest import sys import signal import time from plumbum import local, LocalPath, FG, BG, ERROUT from plumbum.lib import six from plumbum import CommandNotFound, ProcessExecutionError, ProcessTimedOut from plumbum.fs.atomic import AtomicFile, AtomicCounterFile, P...
{ "content_hash": "7ae4c6cb2535e59252ef7e6f629a7af6", "timestamp": "", "source": "github", "line_count": 462, "max_line_length": 119, "avg_line_length": 35.34848484848485, "alnum_prop": 0.5684281427959096, "repo_name": "siemens/plumbum", "id": "00a6ccec5185dddfc019fe3aa06f5825ec969003", "size": "163...
""" Broadcast radiation levels to Twitter. Require the twython packages: https://github.com/ryanmcgrath/twython You'll also need a Twitter application credentials: https://apps.twitter.com Released under MIT License. See LICENSE file. By Yoan Tournade <yoan@ytotech.com> """ from PiPocketGeiger import Radiati...
{ "content_hash": "246362822f5d5426f4210ce35e0cf02e", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 77, "avg_line_length": 32.6530612244898, "alnum_prop": 0.58875, "repo_name": "MonsieurV/PiPocketGeiger", "id": "78da5a3dab24366815e073d00b9c7ba84981fece", "size": "1646", ...
""" Test suite for the docx.parts.styles module """ from __future__ import absolute_import, print_function, unicode_literals import pytest from docx.opc.constants import CONTENT_TYPE as CT, RELATIONSHIP_TYPE as RT from docx.opc.package import PartFactory from docx.opc.packuri import PackURI from docx.oxml.parts.styl...
{ "content_hash": "2de5d61e173e548436693449d12cc4a0", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 77, "avg_line_length": 32.5, "alnum_prop": 0.6006153846153847, "repo_name": "sk1tt1sh/python-docx", "id": "226fb2bdafb7a40279c944e86989a89331c74fa3", "size": "4894", "bi...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('bughouse', '0005_auto_20150211_2025'), ] operations = [ migrations.AddField( model_name='playerrating', name='key', ...
{ "content_hash": "9ba064ed4807b210e3bb96054ef606e6", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 63, "avg_line_length": 25.2, "alnum_prop": 0.5650793650793651, "repo_name": "simpleenergy/bughouse-ranking", "id": "6a8635df50765023997de3bd62590656ed3c2225", "size": "654"...
import ciscoconfparse from ciscoconfparse import CiscoConfParse cisco_cfg = CiscoConfParse("cisco.txt") cisco_cfg ''' intf = cisco_cfg.find_objects(r"^interface") for i in intf: print intf fa4 = intf[4] fa4 fa4.children ''' #search for 88 crypto map CRYPTO #crypto_map = cisco_cfg crypto_map = cisco_cfg.find_o...
{ "content_hash": "494e61cdb66d96278e2a81e2c12ef24d", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 59, "avg_line_length": 16.289473684210527, "alnum_prop": 0.7011308562197092, "repo_name": "tigerrabbit/pynet_gdw", "id": "b9a268423ccd1915e5238e81177a01b1bd9c1c5a", "size":...
import statistics import sys import time import pyperf from pyperf._formatter import (format_number, format_value, format_values, format_timedelta) from pyperf._utils import MS_WINDOWS, percentile, median_abs_dev MAX_LOOPS = 2 ** 32 # Parameters to calibrate and recalibrate warmups M...
{ "content_hash": "dd4a89bfe8fab2e6e2e076a63bcd35cd", "timestamp": "", "source": "github", "line_count": 350, "max_line_length": 88, "avg_line_length": 33.58571428571429, "alnum_prop": 0.5152700978307103, "repo_name": "haypo/perf", "id": "2ecba68eee1b715bc24747afd1ad56635b99ae68", "size": "11755", ...
import sublime, sublime_plugin import threading import sys import plistlib # import urllib #插件配置 SETTING_FILE = "PUIEditor.sublime-settings" #UI资源路径 CONFIG_PATH = "" #加载后的配置数据 SETTINGS = {} # UI同步接口 UI_SERVER_URL = "" # Confing Command class PuiConfigCommand(sublime_plugin.WindowCommand): def run(self): global S...
{ "content_hash": "716898b1f60fa162ad5ab22d61f92627", "timestamp": "", "source": "github", "line_count": 203, "max_line_length": 153, "avg_line_length": 26.72906403940887, "alnum_prop": 0.6940656100258017, "repo_name": "TgermPrj/UIEditor", "id": "b9496b5645432b84be6f95b5fdecbd1f2e45ba9a", "size": "5...
from django.contrib import admin from django.contrib.contenttypes import generic from statusbayes.models import SpamStatus class SpamStatusInline(generic.GenericTabularInline): model = SpamStatus
{ "content_hash": "565564d17219d13ec5dcd6feca05ad78", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 53, "avg_line_length": 28.857142857142858, "alnum_prop": 0.8415841584158416, "repo_name": "waylan/django-spambayes", "id": "d87cb49c70f756f08550cf6c6ece99ecb8330fc5", "size"...
import sys import getopt import re import requests import json import os from os import listdir from os.path import isfile, join from bs4 import BeautifulSoup # À spécifier user = { "login": "", # Nom d'utilisateur dans KI "password": "", # Mot de passe dans KI "id": 0 # Votre identifiant dans KI } root = "http...
{ "content_hash": "77f06583077e3912864028abc28b5451", "timestamp": "", "source": "github", "line_count": 426, "max_line_length": 227, "avg_line_length": 33.859154929577464, "alnum_prop": 0.6416389351081531, "repo_name": "ph--/ki", "id": "28c2bb5abe3f11663382d38179e1972eed1a2ed4", "size": "14553", ...
'''Utilities ============= ''' from kivy.compat import PY2 from kivy.utils import get_color_from_hex from kivy.properties import StringProperty, ObservableDict, ObservableList from kivy.factory import Factory from kivy.event import EventDispatcher from kivy.weakproxy import WeakProxy import json from io impor...
{ "content_hash": "6a4b4f62f4d3944ebdf88e6a1c12182d", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 79, "avg_line_length": 27.555, "alnum_prop": 0.5868263473053892, "repo_name": "matham/cplcom", "id": "4968ecf6220af8320cba76fbf3f64fcf4416f0cd", "size": "5511", "binary"...
from flask import Blueprint, redirect, render_template, session, url_for from app.utils import get_logger mod_notification = Blueprint('mod_notification', __name__, static_folder='../static', url_prefix='/notification') logger = get_logger(__name__) @mod_notification.route('/all', met...
{ "content_hash": "fea739cff9a7b145b80a7dacc2d46acc", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 85, "avg_line_length": 32.21052631578947, "alnum_prop": 0.6111111111111112, "repo_name": "hellock/labman", "id": "4b1b6dbb274647ca8903ae8fcc3a5ad30f9d9f97", "size": "612", ...
import click import webbrowser import sys import floyd from floyd.client.auth import AuthClient from floyd.manager.auth_config import AuthConfigManager from floyd.model.access_token import AccessToken from floyd.model.credentials import Credentials from floyd.log import logger as floyd_logger @click.command() @click...
{ "content_hash": "eef24aa58b3d2f0a3e84604e646c9f12", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 120, "avg_line_length": 36.857142857142854, "alnum_prop": 0.6387596899224807, "repo_name": "mckayward/floyd-cli", "id": "a33e89af76875eab7f35ba465d3dbb1f151b5b2b", "size": ...
"""Translation helper functions.""" from __future__ import unicode_literals from collections import OrderedDict import locale import os import re import sys import gettext as gettext_module from importlib import import_module from threading import local import warnings from django.utils.encoding import force_str, for...
{ "content_hash": "c30f176d66682e052e2f8a913347185f", "timestamp": "", "source": "github", "line_count": 679, "max_line_length": 143, "avg_line_length": 37.74521354933726, "alnum_prop": 0.5730617659682391, "repo_name": "ZhaoCJ/django", "id": "c7b41fa3734bd83db37bfddccec4992d0edf60b0", "size": "25629...
import main import robocup import constants ## Estimates the length of a path given a start and end point # @param start The start point of the path # @param end The end point of the path # @param blocking_robots The list of robots to dodge # @param dodge_dist The amount of distance to dodge left or right to miss...
{ "content_hash": "faddd8e8bc7064bc47d3f249bbc8c74f", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 103, "avg_line_length": 39.92741935483871, "alnum_prop": 0.6021005857402545, "repo_name": "JNeiger/robocup-software", "id": "5662b56a099fcf8f6b77da3719b50b817ece78e0", "si...
""" tools.fileio.py contains helper utilities for file reading and writing. """ import csv from collections import namedtuple from contextlib import contextmanager from io import BufferedReader from zipfile import ZipFile from foil.filters import create_indexer class TextReader: """Reads text file. Paramet...
{ "content_hash": "359e60664b444d7584150c86308de858", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 96, "avg_line_length": 29.838709677419356, "alnum_prop": 0.6342342342342342, "repo_name": "portfoliome/foil", "id": "3df5b1afca7365803d2e177524883f3480e422ac", "size": "55...
from __future__ import print_function import time import re import codecs import os import math import argparse import textwrap import sys from StringIO import StringIO import iso3166 import pyxb.binding.datatypes as xsd import pyxb as pyxb from pyxb.utils.six.moves.urllib import request as urllib_request from GeodesyM...
{ "content_hash": "3e191505d8cf05b5e425366a35fff481", "timestamp": "", "source": "github", "line_count": 1902, "max_line_length": 165, "avg_line_length": 40.34174553101998, "alnum_prop": 0.5743776879968722, "repo_name": "GeoscienceAustralia/GeodesyMLConverter", "id": "7fb3f9284fd2ac110a421b1e10b34fe52...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('ideascale', '0001_initial'), ] operations = [ migrations.CreateModel( name='Author', fields=[ ('id', models....
{ "content_hash": "268d37173d43177e94b1c15bd28337a2", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 114, "avg_line_length": 39.93396226415094, "alnum_prop": 0.5161823765650838, "repo_name": "joausaga/social-ideation", "id": "4187faffd686e9ee2f49b898b1ad11ba18742647", "si...
def extractMengmengmeng100WordpressCom(item): ''' Parser for 'mengmengmeng100.wordpress.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('mphcd', 'Meng Po’s Husband Chasing Diary', ...
{ "content_hash": "0dcdfd6bcc9c23fca496f19763c2c7ac", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 104, "avg_line_length": 31.238095238095237, "alnum_prop": 0.6189024390243902, "repo_name": "fake-name/ReadableWebProxy", "id": "85bfe011c31b0c759ebf39966eb8d0760393f8e3", "...
from __future__ import unicode_literals from datetime import date, datetime from functools import partial from flask import Blueprint from flask.ext.restplus import fields, Api from . import TestCase class FieldTestCase(TestCase): field_class = None def setUp(self): super(FieldTestCase, self).setU...
{ "content_hash": "14cf9a9eb90a0fddef78aa9538fbe1d0", "timestamp": "", "source": "github", "line_count": 675, "max_line_length": 113, "avg_line_length": 33.01037037037037, "alnum_prop": 0.593752804954672, "repo_name": "luminusnetworks/flask-restplus", "id": "121c88295e24bceaf1830950a487fef15264e8e8", ...
from model.contact import Contact from random import randrange def test_modify_first_contact(app): if app.contact.count() == 0: app.contact.create(Contact(firstname='test')) old_contacts = app.contact.get_contact_list() index = randrange(len(old_contacts)) contact = Contact(firstname="", lastn...
{ "content_hash": "42990e89a676a982f89a5c2ee4fac1be", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 124, "avg_line_length": 45.724137931034484, "alnum_prop": 0.6855203619909502, "repo_name": "trrigger/python_training", "id": "27cef9dc7af1a6e98309ea2ef43c480b5cfb7447", "si...
from PyQt4 import QtCore, QtGui from vistrails.core.system import get_vistrails_basic_pkg_id from vistrails.gui.theme import CurrentTheme from vistrails.gui.modules.utils import get_widget_class from vistrails.gui.modules.constant_configuration import ConstantWidgetMixin, \ StandardConstantWidget from vistrails.cor...
{ "content_hash": "09c4925c6a9cbbbe41397dae1ebec633", "timestamp": "", "source": "github", "line_count": 356, "max_line_length": 98, "avg_line_length": 38.82022471910113, "alnum_prop": 0.5704052098408104, "repo_name": "Nikea/VisTrails", "id": "810f4c4efa2ae861d4c96f3a2d454c7a86d2857a", "size": "1570...
from sys import maxsize class Group: def __init__(self,name=None,header=None,footer=None,id=None): self.name=name self.header=header self.footer=footer self.id=id def __repr__(self): return "%s:%s %s %s" % (self.id,self.name, self.header, self.footer) def __eq__...
{ "content_hash": "44253144f41a58a32888e9f762261132", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 103, "avg_line_length": 21.53846153846154, "alnum_prop": 0.5678571428571428, "repo_name": "wsszczecin/python_training", "id": "642c3c8cfe745dec1f55552e7b3edeab6cde0f24", "s...
try: import pydot_ng as pydot except ImportError: import pydot if not pydot.find_graphviz(): raise RuntimeError('Failed to import pydot. You must install pydot' ' and graphviz for `pydotprint` to work.') ''' I copied Keras Network Architecture Visualization Code here. Just add some ...
{ "content_hash": "f0700b694fc9be7baea7fc56385dd724", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 159, "avg_line_length": 40.48192771084337, "alnum_prop": 0.5577380952380953, "repo_name": "sjtudesigner/NeuralSight", "id": "3b7f6fb929c2a1ac26a2d97b58be0b5a485e31ca", "siz...
import time from indy import anoncreds, crypto, did, ledger, pool, wallet, blob_storage import json import logging import argparse import sys from ctypes import * from os.path import dirname from indy.error import ErrorCode, IndyError from src.utils import get_pool_genesis_txn_path, run_coroutine, PROTOCOL_VERSION...
{ "content_hash": "924697bb80dfb5357f556da1805ff24e", "timestamp": "", "source": "github", "line_count": 1183, "max_line_length": 148, "avg_line_length": 55.92307692307692, "alnum_prop": 0.5867104010157655, "repo_name": "peacekeeper/indy-sdk", "id": "a236946fc5faabf0a3961ccec396a10c586281c6", "size"...
from __future__ import print_function, division, absolute_import from contextlib import contextmanager import pytest pytest.importorskip('s3fs') import boto3 import moto from toolz import concat, valmap, partial from s3fs import S3FileSystem from dask import compute, get from dask.bytes.s3 import read_bytes, open_f...
{ "content_hash": "d744f3f7207b8c2c8486103c75810cb3", "timestamp": "", "source": "github", "line_count": 224, "max_line_length": 83, "avg_line_length": 35.25, "alnum_prop": 0.5982776089159068, "repo_name": "mikegraham/dask", "id": "0741f417ed5125528987329fc9ddddb1ec3c8dc6", "size": "7896", "binary...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import json import os import re from twitter.common.collections import maybe_list from pants.base.build_environment import get_buildroot from pants.build_graph.inter...
{ "content_hash": "b875992c964b644ca248abe0329e7774", "timestamp": "", "source": "github", "line_count": 264, "max_line_length": 111, "avg_line_length": 45.996212121212125, "alnum_prop": 0.6502511735156057, "repo_name": "foursquare/pants", "id": "10d9411d8f76b25ee783faa05338f761f451da43", "size": "1...
""" Commands for rendering various parts of the app stack. """ from glob import glob import os from fabric.api import local, task import app def _fake_context(path): """ Create a fact request context for a given path. """ return app.app.test_request_context(path=path) def _view_from_name(name): ...
{ "content_hash": "6b0db20e2b7c86034cbe5878b3c3beaf", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 100, "avg_line_length": 24.37007874015748, "alnum_prop": 0.5764135702746365, "repo_name": "sahilchinoy/public-trust", "id": "0697cbc147a105cfe67fc28fb60938531fe472a8", "si...
from __future__ import absolute_import import bpy import os sr_description_path = '/home/user/projects/shadow_robot/base_deps/src/sr_common/sr_description' file_names = ['forearm', 'forearm_muscle', 'forearm_muscle_disk', 'forearm_lite', 'wrist', 'palm', 'knuckle', 'lfmetacarpal', 'F1', 'F2', 'F3', 'TH1...
{ "content_hash": "ee67a9819f0d20f80ec5301ed222b5b5", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 114, "avg_line_length": 40.833333333333336, "alnum_prop": 0.6806122448979591, "repo_name": "shadow-robot/sr_common", "id": "3c11af0e3ce0850162822878e106ed112965a327", "size...
"""Support for RainMachine devices.""" import asyncio from datetime import timedelta import logging from regenmaschine import Client from regenmaschine.errors import RainMachineError import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT from homeassistant.const import ( ATTR_ATTRIBUTION,...
{ "content_hash": "4b00480a7a93b0bbfda62b7ef416ba17", "timestamp": "", "source": "github", "line_count": 459, "max_line_length": 88, "avg_line_length": 35.97821350762527, "alnum_prop": 0.6453917887852731, "repo_name": "titilambert/home-assistant", "id": "239878d02190e3a54f72177a60bfb35c5bae8221", "s...
""" aggregator.py Created by Thomas Mangin on 2012-07-14. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ from exabgp.bgp.message.open.asn import ASN from exabgp.protocol.ip import IPv4 from exabgp.bgp.message.update.attribute.attribute import Attribute # ============================================...
{ "content_hash": "59a5cfc88995d3500a8aa49720c82464", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 117, "avg_line_length": 26.6, "alnum_prop": 0.6300751879699248, "repo_name": "benagricola/exabgp", "id": "88137bde0ffb7a1fd547b15fe18f75834ab32450", "size": "2013", "bina...
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 'Team.connection_only' db.add_column(u'tickets_team', 'connection_only', ...
{ "content_hash": "4c80b6c64093d3e1e6c2cef304c3c407", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 187, "avg_line_length": 69.81203007518798, "alnum_prop": 0.5460420032310178, "repo_name": "desecho/tickets", "id": "ec41bc4631861f2ab3a7ad56ba6f6bf486184eb4", "size": "930...
"""Create interactive Leaflet web maps of graphs and routes via folium.""" import json from . import utils_graph # folium is an optional dependency for the folium plotting functions try: import folium except ImportError: # pragma: no cover folium = None def plot_graph_folium( G, graph_map=None, ...
{ "content_hash": "6cd460a591b9b151a7ce2f7607f7b0d9", "timestamp": "", "source": "github", "line_count": 188, "max_line_length": 97, "avg_line_length": 30.45212765957447, "alnum_prop": 0.639825327510917, "repo_name": "gboeing/osmnx", "id": "d33da4db642c9ee57fd97a43bef6e13508684ebe", "size": "5725", ...
import logging import regex from fuzzywuzzy import fuzz from fuzzywuzzy import process as fuzz_process from will import settings from will.decorators import require_settings from will.utils import Bunch from .base import GenerationBackend, GeneratedOption class FuzzyAllMatchesBackend(GenerationBackend): def _gen...
{ "content_hash": "e85915a78f11db5565f9fbd89bc83d1c", "timestamp": "", "source": "github", "line_count": 106, "max_line_length": 97, "avg_line_length": 41.91509433962264, "alnum_prop": 0.49966239027683995, "repo_name": "wontonst/will", "id": "b7773ebf1ab1d77239b00f20bde9b5c0f2e4aeb4", "size": "4443"...
import re import optparse from lib.networkutils import netcat VALUE_PARSING_RE = r'VAL=\"(.*?)\"' def _get_ganglia_metrics(hostname, port, file_): """ Returns string (xml) representation of ganglia metrics. If file_ is passed it will read the metrics from the file; otherwise, will ask ganglia running ...
{ "content_hash": "f6c3baba22bc18c6b6421f393f295c27", "timestamp": "", "source": "github", "line_count": 107, "max_line_length": 87, "avg_line_length": 36.7196261682243, "alnum_prop": 0.510307966403665, "repo_name": "daniyalzade/nagios-ganglia-plugin", "id": "d5ca56ffa5eb9a93ee1a39e4f584d2af4bfcfe8e",...
from datetime import timedelta from acouchbase.cluster import Cluster, get_event_loop from couchbase.auth import PasswordAuthenticator # **DEPRECATED**, use: from couchbase.options import DeltaValue, SignedInt64 # **DEPRECATED**, import ALL options from `couchbase.options` from couchbase.collection import (DecrementO...
{ "content_hash": "401c20136c6428ca4ea5eb1136e0bfbd", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 82, "avg_line_length": 36.619354838709675, "alnum_prop": 0.5847427766032417, "repo_name": "couchbase/couchbase-python-client", "id": "caa2ce0e581ad00b134e32f72f6829bb433d871...
from simplepyged.gedcom import * from LatexReport import * #g = Gedcom(os.path.abspath('../../test/mcintyre.ged')) #g = Gedcom(os.path.abspath('../../test/wright.ged')) g = Gedcom(os.path.abspath('/home/nick/slova/rodoslovlje/moje.ged')) l = LatexReport(g) #l.home_person = g.get_individual('@P405366386@') # mary #l....
{ "content_hash": "4d569a31df37b4ea5dcf6f8b08808877", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 76, "avg_line_length": 34.04545454545455, "alnum_prop": 0.678237650200267, "repo_name": "andersardo/gedMerge", "id": "623f46c7bd12656ba8661383d590a140c0a3a03d", "size": "74...
from agate.columns.base import Column class BooleanColumn(Column): """ A column containing :class:`bool` data. """ pass
{ "content_hash": "63500b0ac2ddb7021c24b71f3657c216", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 43, "avg_line_length": 19.571428571428573, "alnum_prop": 0.656934306569343, "repo_name": "TylerFisher/agate", "id": "b1a618c00197c21972a5ab9f2ad3e2c17941260b", "size": "160"...
from GenericRequest import GenericRequest from kol.manager import PatternManager from kol.util import ChatUtils from kol.util import Report from kol.util import StringUtils class GetChatMessagesRequest(GenericRequest): def __init__(self, session, lastTime=0): super(GetChatMessagesRequest, self).__init__(se...
{ "content_hash": "47bb1aa071de39ddc193d64817b3ad8e", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 97, "avg_line_length": 46.25, "alnum_prop": 0.7340540540540541, "repo_name": "KevZho/buffbot", "id": "e77e148e4b32a3ee75606430fb8460fde6dfc8b5", "size": "925", "binary": ...
import json import logging import traceback from google.appengine.api import users import webapp2 from shared import utils from shared.config import AUTO_TAGGED_FIELDS, CQ_BOT_PASSWORD_KEY from shared.parsing import ( parse_fields, parse_record_key, parse_request, parse_strings, ) from model.password import P...
{ "content_hash": "eb89d8add1aace1b198f51cd09497cef", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 77, "avg_line_length": 28.649350649350648, "alnum_prop": 0.6613780598368088, "repo_name": "nicko96/Chrome-Infra", "id": "7a57e7bb31b68679f0fe37fb568b5971f925f1fd", "size": ...
from django.conf.urls import patterns, include, url from gdelt.api import GDELTResource # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() gdelt_resource = GDELTResource() urlpatterns = patterns('', # Examples: url(r'^$', 'gdelt.views.home', name='hom...
{ "content_hash": "740c921b580cf22af3f340b0cceb716a", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 66, "avg_line_length": 25.789473684210527, "alnum_prop": 0.6979591836734694, "repo_name": "Berico-Technologies/CLAVIN-contrib", "id": "e898cef7f3f586608512a9cb910218118a7c18a...
import glumpy import numpy as np from glumpy import app, gl, gloo, glm vertex = """ #version 120 // Uniforms // -------- uniform sampler2D tex_data; uniform vec2 tex_size; uniform float char_width; uniform float char_height; uniform float rows; uniform float cols; uniform float scale; uniform vec4 foreground; uniform...
{ "content_hash": "36245da17b186a894dda5eba7d3db4a0", "timestamp": "", "source": "github", "line_count": 442, "max_line_length": 84, "avg_line_length": 29.941176470588236, "alnum_prop": 0.5320386882272934, "repo_name": "glumpy/glumpy", "id": "c793dbc948ec346e01bdb222e7ae0b55ba778575", "size": "13862...
""" @author: magic """ # -*- coding: utf-8 -*- from django.db import models from user import User class Tag(models.Model): name = models.CharField(max_length=30, verbose_name=u'标签名称') class Meta: verbose_name = u'标签' verbose_name_plural = verbose_name def __unicode__(self): retur...
{ "content_hash": "1087c8c199127a6ac5fda62c1d530c89", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 90, "avg_line_length": 31.415730337078653, "alnum_prop": 0.6605865522174535, "repo_name": "csunny/blog_project", "id": "d596e16212b61d2891f890dfc116daaaa96d97eb", "size": "...
""" Runs tests for the NoPress (All) Dataset Builder """ from diplomacy_research.models.policy.tests.policy_builder_test_setup import PolicyBuilderTestSetup from diplomacy_research.models.policy.token_based.dataset.no_press_all import DatasetBuilder from diplomacy_research.utils.process import run_in_separate_process ...
{ "content_hash": "2f85d383beacef8ef59fa6f099159bd9", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 99, "avg_line_length": 42.76923076923077, "alnum_prop": 0.7607913669064749, "repo_name": "diplomacy/research", "id": "ced7c221e23ce66ae4845a3541782f970ae5bcd3", "size": "13...
from django.db import models from django.db.models import Count class Users(models.Model): first_name = models.CharField(max_length=25) last_name = models.CharField(max_length=25) email_address = models.CharField(max_length=50) is_admin = models.SmallIntegerField(null=False, default=0) is_active =...
{ "content_hash": "a3b7690595ecb28d96d10c738684013e", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 98, "avg_line_length": 30.580645161290324, "alnum_prop": 0.6751054852320675, "repo_name": "Pshrub/office-poll-topic", "id": "3977d387a4c714795e93e8114f417a4489896e12", "siz...
import datetime import iso8601 import mock from oslo_utils import timeutils from jacket.objects import compute from jacket.tests.compute.unit.objects import test_objects from jacket.compute import utils NOW = timeutils.utcnow().replace(microsecond=0) fake_task_log = { 'created_at': NOW, 'updated_at': None, ...
{ "content_hash": "1e5a141f97685bfa65cde1ff3affec7f", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 79, "avg_line_length": 37.04724409448819, "alnum_prop": 0.5859723698193411, "repo_name": "HybridF5/jacket", "id": "1e406828ebebe05ceaee22f535c15cf2f9272fa6", "size": "5278...
import errno import json import os import os.path import requests import socket import sqlite3 import string import sys import time import urllib from zenchimes.utilities import logged_class from zenchimes import settings @logged_class class LMSCommandLineInterface(object): bufsize = 2048 def __init__(self, ...
{ "content_hash": "335ffa75060dce732d1763a79a22aa1d", "timestamp": "", "source": "github", "line_count": 272, "max_line_length": 82, "avg_line_length": 37.720588235294116, "alnum_prop": 0.5444444444444444, "repo_name": "eigenholser/squeezebox-zenchimes", "id": "c65f8a988a2a74a9193495b126fcdae0515bcadf...
from savanna.db import storage as s from savanna.openstack.common import uuidutils from savanna.tests.unit import base def _create_clusters(name="cluster-1", plugin_name="some_plugin", hadoop_version="1.2.3", **kwargs): cluster_dict = { "name": name, "plugin_name": plugin_name...
{ "content_hash": "5e7b2d89e28b25dba50c278774da4772", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 65, "avg_line_length": 31.857142857142858, "alnum_prop": 0.6322869955156951, "repo_name": "rnirmal/savanna", "id": "7ded8d908186c9789e10f528da1b1ec682755f76", "size": "1921...
from aquests.request_builder import make_http def test_make_http (): # method, url, params, auth, headers, meta, proxy, logger req = make_http ("get", "/index", None, None, [], None, None, None) assert req.headers ["accept"] == "*/*" req = make_http ("get", "/index", {"a": "b"}, None, [], None, No...
{ "content_hash": "497108e0ba83b4fc2b197d388a4d36d6", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 130, "avg_line_length": 50.875, "alnum_prop": 0.5884520884520884, "repo_name": "hansroh/skitai", "id": "13d63e69f45111d4189e9ae0169cdced532aa87e", "size": "1628", "binary...
from mygengo import MyGengo # Get an instance of MyGengo to work with... gengo = MyGengo( public_key = 'your_public_key', private_key = 'your_private_key', sandbox = True, # possibly false, depending on your dev needs ) # Grab a specific revision - you could liken this to querying version control # on the...
{ "content_hash": "20e8fe377f757850a42a5a41c9e24aea", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 77, "avg_line_length": 33.083333333333336, "alnum_prop": 0.7153652392947103, "repo_name": "fvbock/mygengo-python", "id": "ab955e76ab23bb89b16d4f4fc4ef37fd7f69a1f6", "size":...
from __future__ import (absolute_import, division, print_function) # Copyright 2018 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at you...
{ "content_hash": "858c880e7bf22f1df3e523a005bbfd81", "timestamp": "", "source": "github", "line_count": 381, "max_line_length": 100, "avg_line_length": 33.196850393700785, "alnum_prop": 0.43390259329538267, "repo_name": "SergeyCherepanov/ansible", "id": "19f9b03ed4287b436b12bebc198ffb153e40f02d", "...
from oslo_serialization import jsonutils as json from six.moves.urllib import parse as urllib from tempest.lib.common import rest_client class NamespaceObjectsClient(rest_client.RestClient): api_version = "v2" def list_namespace_objects(self, namespace, **kwargs): """Lists all namespace objects. ...
{ "content_hash": "838359b80304ab8d790214b467f0fa34", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 85, "avg_line_length": 39.723684210526315, "alnum_prop": 0.6515402451142762, "repo_name": "masayukig/tempest", "id": "0cae8169b59048c9d9632e518c430a9b94261031", "size": "36...
import sys import 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.insert(0, os.path.abspath('.')) # -- General conf...
{ "content_hash": "3d0c8e4593dbc06e78b1273c82399be8", "timestamp": "", "source": "github", "line_count": 275, "max_line_length": 83, "avg_line_length": 33.04, "alnum_prop": 0.7080123266563945, "repo_name": "CodeForAfricaLabs/Scrapengine", "id": "885b572d47005f46d1e0c4c7c948e0acb0b72cc4", "size": "95...
import cPickle import os import tarfile import PIL.Image from downloader import DataDownloader class Cifar100Downloader(DataDownloader): """ See details about the CIFAR100 dataset here: http://www.cs.toronto.edu/~kriz/cifar.html """ def urlList(self): return [ 'http://www.cs...
{ "content_hash": "2441f819fdda89e0465dbf0f41cc996b", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 118, "avg_line_length": 42.064516129032256, "alnum_prop": 0.5694018404907976, "repo_name": "gheinrich/DIGITS-GAN", "id": "8c17b95790697d4236c12247fbe618d0130aab21", "size"...
''' Write a Python program using ciscoconfparse that parses the 'cisco_ipsec.txt' config file. Note, this config file is not fully valid (i.e. parts of the configuration are missing). The script should find all of the crypto map entries in the file (lines that begin with 'crypto map CRYPTO') and print out the children...
{ "content_hash": "9b6ce33a7138c9d8bb99680d79062ca9", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 78, "avg_line_length": 29.7, "alnum_prop": 0.6801346801346801, "repo_name": "cb1234/pynet-test", "id": "2fdeb7c459df4257f7c1724877dac8f77d63fa6c", "size": "913", "binary"...
import pytest import numpy as np import scipy.sparse as sp from sklearn.datasets import make_regression from sklearn.linear_model import Ridge from sklearn.kernel_ridge import KernelRidge from sklearn.metrics.pairwise import pairwise_kernels from sklearn.utils._testing import ignore_warnings from sklearn.utils._test...
{ "content_hash": "2dc11c7bcc8e1c1719806c662bb44357", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 88, "avg_line_length": 32.59803921568628, "alnum_prop": 0.6736842105263158, "repo_name": "shyamalschandra/scikit-learn", "id": "b1fcb06eb2204da5957a50f9693ccb2d179cd505", ...
"""Unit tests for make_info.py.""" from __future__ import unicode_literals import unittest from batchupload.make_info import make_info_page class TestMakeInfoPage(unittest.TestCase): """Test the make_info_page method.""" def setUp(self): self.data = { 'info': '{{Infobox\n| param1 = value...
{ "content_hash": "81f6de6901bf6b843a320c0d2b9bd976", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 56, "avg_line_length": 30.192307692307693, "alnum_prop": 0.47091295116772824, "repo_name": "lokal-profil/BatchUploadTools", "id": "92c3d27166da53ce062ded7b4e432a8ff4c931ec", ...
from distutils.core import setup # perform the setup action setup( name = "pypi", version = '2005-08-01', description = "PyPI is the Python Package Index at http://pypi.python.org/", long_description = '''PyPI has a new home at <http://pypi.python.org/>. Users should need not need to change any...
{ "content_hash": "02cff3187bbb4ba04dda383274fed4a6", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 75, "avg_line_length": 35.878787878787875, "alnum_prop": 0.6613175675675675, "repo_name": "ericholscher/pypi", "id": "90508fcb9d4ea037af909269cff8a2e7213c0013", "size": "12...
"""Tests for gradient packer.""" import numpy as np import tensorflow as tf import tensor_list_util class GradientPackerTest(tf.test.TestCase): """Tests for packing and unpacking gradients.""" def _get_variables(self): x = tf.get_variable("x", initializer=tf.reshape( tf.range(0, 2, dtype=tf.float3...
{ "content_hash": "eba07fc9193d6191c5f0c7afa7f2734c", "timestamp": "", "source": "github", "line_count": 113, "max_line_length": 80, "avg_line_length": 32.796460176991154, "alnum_prop": 0.6600107933081489, "repo_name": "google/spectral-density", "id": "0987c32f4b08e23b85d2e4cc086eb1abffdaefca", "siz...
try: # python 3 from http.server import SimpleHTTPRequestHandler import socketserver except ImportError: # python 2 from SimpleHTTPServer import SimpleHTTPRequestHandler import SocketServer as socketserver ADDR = "127.0.0.1" PORT = 8000 httpd = socketserver.TCPServer( (ADDR, PORT), Si...
{ "content_hash": "2c3c5353201ae83aa9ff1b1f3f0ab6ce", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 57, "avg_line_length": 20.363636363636363, "alnum_prop": 0.7120535714285714, "repo_name": "jedie/pypyjs_test_compression", "id": "c206644429bad7034434c18b54699832b46279b8", ...
""" This file implements print functionality for the CPU. """ from llvmlite.llvmpy.core import Type from numba.core import types, typing, cgutils from numba.core.imputils import Registry, impl_ret_untracked registry = Registry('printimpl') lower = registry.lower # NOTE: the current implementation relies on CPython A...
{ "content_hash": "2751019febb219e888fae33a21c51e08", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 94, "avg_line_length": 30.36144578313253, "alnum_prop": 0.6464285714285715, "repo_name": "stuartarchibald/numba", "id": "0ec29b5561dca99be90e3ab72a30ffcf998b1e53", "size": ...
"""Tests for convolutional layers.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl.testing import parameterized import numpy as np from tensorflow.python import keras from tensorflow.python.eager import context from tensorflow.python.eager imp...
{ "content_hash": "73b6e6bdc2ad3511bd546dd879024935", "timestamp": "", "source": "github", "line_count": 1158, "max_line_length": 80, "avg_line_length": 37.85578583765112, "alnum_prop": 0.5762255628806716, "repo_name": "aldian/tensorflow", "id": "0bc869160ecfc2000072920aaad3611e4847005b", "size": "4...
import random import unittest from hearthbreaker.agents.basic_agents import DoNothingAgent, PredictableAgent from tests.agents.testing_agents import OneCardPlayingAgent, PlayAndAttackAgent, CardTestingAgent,\ SelfSpellTestingAgent, EnemyMinionSpellTestingAgent from tests.testing_utils import generate_game_for from...
{ "content_hash": "8397284ba3972dc787ed5ff1fe1c704a", "timestamp": "", "source": "github", "line_count": 722, "max_line_length": 116, "avg_line_length": 42.945983379501385, "alnum_prop": 0.6532718418421647, "repo_name": "jomyhuang/sdwle", "id": "da58ebe5bfe74762910b4bd471e9de21beac9905", "size": "31...
""" Testing for the gradient boosting module (sklearn.ensemble.gradient_boosting). """ import re import warnings import numpy as np from numpy.testing import assert_allclose from scipy.sparse import csr_matrix from scipy.sparse import csc_matrix from scipy.sparse import coo_matrix from scipy.special import expit impo...
{ "content_hash": "52b6c5de6c514f5c678be7d825c71a55", "timestamp": "", "source": "github", "line_count": 1325, "max_line_length": 88, "avg_line_length": 34.16075471698113, "alnum_prop": 0.6601197446037602, "repo_name": "TomDLT/scikit-learn", "id": "cbe56578e45c540ca64f6d565ffbd87ded564527", "size": ...
class MufCompileError(Exception): pass class MufRuntimeError(Exception): pass class MufBreakExecution(Exception): pass class ReloadAsMuvException(Exception): pass # vim: expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap
{ "content_hash": "7afd290de1fe9df9b907b626e037b6aa", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 60, "avg_line_length": 14.588235294117647, "alnum_prop": 0.7580645161290323, "repo_name": "revarbat/mufsim", "id": "3827809dece471ba89b8cacda9a98861fd727180", "size": "248"...
"""This file is only retained for backwards compatibility. It will be removed in the future. sre was moved to re in version 2.5. """ import warnings warnings.warn("The sre module is deprecated, please import re.", DeprecationWarning, 2) from re import * from re import __all__ # old pickles expect the...
{ "content_hash": "2f385280170dffa6820f5befa972fbce", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 70, "avg_line_length": 27.5, "alnum_prop": 0.7246753246753247, "repo_name": "ppyordanov/HCI_4_Future_Cities", "id": "14c484b9c098564bfd880aff3ad23dbf09add94f", "size": "385...
from __future__ import absolute_import import datetime from django.conf import settings from django.http import HttpResponse from django.test import TestCase from django.utils import timezone from mock import patch, MagicMock from zerver.lib.test_helpers import MockLDAP from confirmation.models import Confirmation f...
{ "content_hash": "79793549edfcbbd48763810a66884cd2", "timestamp": "", "source": "github", "line_count": 1410, "max_line_length": 114, "avg_line_length": 42.65673758865248, "alnum_prop": 0.5904798324078077, "repo_name": "dattatreya303/zulip", "id": "a54d65f57c8d4680bc6fee53d30145f9d3c230ed", "size":...
from rally.plugins.task.sla.iteration_time import * # noqa: F401,F403 from rally.plugins.task.sla import iteration_time as _new # import it as last item to be sure that we use the right module from rally.common import logging logging.log_deprecated_module( target=__name__, new_module=_new.__name__, release="3.0...
{ "content_hash": "9474c441bf55f33e03b3bdc968605164", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 70, "avg_line_length": 32.6, "alnum_prop": 0.7361963190184049, "repo_name": "openstack/rally", "id": "dc66970ed658bef306655f76b893e909cc99f4f7", "size": "924", "binary": ...
from __future__ import annotations from typing import Optional, Sequence from pydantic import BaseModel, root_validator, validator from datadog_checks.base.utils.functions import identity from datadog_checks.base.utils.models import validation from . import defaults, validators class SharedConfig(BaseModel): ...
{ "content_hash": "23d6e4fc940234bf57c96d47c96e42d1", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 108, "avg_line_length": 31.428571428571427, "alnum_prop": 0.6984848484848485, "repo_name": "DataDog/integrations-core", "id": "db701e907545595e119bd23ed31182f81450ae9e", "s...
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "Lag1Trend", cycle_length = 7, transform = "Difference", sigma = 0.0, exog_count = 20, ar_order = 12);
{ "content_hash": "4fa3df53ae3b3ae16168fcc485ea6944", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 167, "avg_line_length": 38.142857142857146, "alnum_prop": 0.7078651685393258, "repo_name": "antoinecarme/pyaf", "id": "a5ddfbf21e8f86dcb2c921afbd223eb846647811", "size": "26...
"""Tests for ops which manipulate lists of tensors.""" # pylint: disable=g-bad-name from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl.testing import parameterized import numpy as np # pylint: disable=unused-import from tensorflow.python.client imp...
{ "content_hash": "1546be37689a88946527c48a210267db", "timestamp": "", "source": "github", "line_count": 1394, "max_line_length": 80, "avg_line_length": 44.21520803443329, "alnum_prop": 0.6405347524174184, "repo_name": "apark263/tensorflow", "id": "3f340aa07d65d014e5f9c117c8ded3779e62aa4e", "size": ...
"""Provides device triggers for Z-Wave JS.""" from __future__ import annotations from typing import Any import voluptuous as vol from zwave_js_server.const import CommandClass from homeassistant.components.device_automation import DEVICE_TRIGGER_BASE_SCHEMA from homeassistant.components.device_automation.exceptions ...
{ "content_hash": "80d6558c4d6570fb7d1fe60d9ee2072a", "timestamp": "", "source": "github", "line_count": 549, "max_line_length": 88, "avg_line_length": 34.31147540983606, "alnum_prop": 0.6162340075383553, "repo_name": "mezz64/home-assistant", "id": "76a7f134d17a5dfdd4e6d0ccd074acfe73706da8", "size":...
import os import sys here = lambda *a: os.path.join(os.path.dirname(__file__), *a) try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() readme = open(here('README.md')).read() histor...
{ "content_hash": "080f66e4712e444ba57c9b0521e05826", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 78, "avg_line_length": 28.46969696969697, "alnum_prop": 0.5816923895689197, "repo_name": "iancmcc/ouimeaux", "id": "d3ef8b02366a3bb8662b7d98a7f47958b9c840b5", "size": "1926...
""" This module contains helper functions for controlling caching. It does so by managing the "Vary" header of responses. It includes functions to patch the header of response objects directly and decorators that change functions to do that header-patching themselves. For information on the Vary header, see: http...
{ "content_hash": "29d0e1c7bb1c5dca17c34eeb7ba0a72b", "timestamp": "", "source": "github", "line_count": 238, "max_line_length": 88, "avg_line_length": 40.65546218487395, "alnum_prop": 0.6710417527904092, "repo_name": "letolab/airy", "id": "8049e4d22eb774149c2f10ab8d32f94f61af5653", "size": "9676", ...
r"""Simple transfer learning with Inception v3 or Mobilenet models. With support for TensorBoard. This example shows how to take a Inception v3 or Mobilenet model trained on ImageNet images, and train a new top layer that can recognize other classes of images. The top layer receives as input a 2048-dimensional vecto...
{ "content_hash": "a349ad5db3a3219f4883aeb95ff379a1", "timestamp": "", "source": "github", "line_count": 1362, "max_line_length": 110, "avg_line_length": 40.91116005873715, "alnum_prop": 0.6670914018054235, "repo_name": "alistairlow/tensorflow", "id": "ebddfb20f4b60986fba1cdbfe3fcb184149b0a99", "siz...
""" libcloud provides a unified interface to the cloud computing resources. :var __version__: Current version of libcloud """ __all__ = ['__version__', 'enable_debug'] __version__ = '0.17.1-dev' import os import codecs try: import paramiko have_paramiko = True except ImportError: have_...
{ "content_hash": "139c70d024aed8776c044e0f0ad68872", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 79, "avg_line_length": 27.615384615384617, "alnum_prop": 0.616991643454039, "repo_name": "Hybrid-Cloud/badam", "id": "d3514f0d6a3b6645024dbf54baa8ab823db955c5", "size": "22...
from workalendar.core import WesternCalendar, ChristianMixin class Poland(WesternCalendar, ChristianMixin): "Poland" FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + ( (1, 6, 'Trzech Kroli'), (5, 1, 'Labour Day'), (5, 3, 'Constitution Day'), (11, 11, 'Independence Day'), )...
{ "content_hash": "e8f792819263551c103529497f378974", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 60, "avg_line_length": 30.789473684210527, "alnum_prop": 0.6547008547008547, "repo_name": "gregn610/workalendar", "id": "73278f6db34a5757f5ed1a362cbeae8b1b485e20", "size": ...
import hindkit as k import functools ODIA_STEMS = "K KH G GH NG C CH J JH NY TT TTH DD DDH NN T TH D DH N P PH B V BH M Y YY R LL L SH SS S H W".split() STEMS = k.constants.CONSONANT_STEMS # STEMS = ODIA_STEMS STEMS_AKHAND = ["K_SS", "J_NY"] ORDER = [] for stem in STEMS + STEMS_AKHAND: for i in ["A", "", "Ac2"]: ...
{ "content_hash": "08bcedaf9b9f27b6e6864e65bf2cb8e6", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 115, "avg_line_length": 24.912280701754387, "alnum_prop": 0.5669014084507042, "repo_name": "itfoundry/hindkit", "id": "3becd88fbbdf263fa3945bf6d990e24b34ba1d45", "size": "1...
import sys sys.path.append("../src") import pcs import pcs.packets.udp class udpv4(pcs.packets.udp.udp): _layout = pcs.Layout() _map = None def __init__(self, bytes = None, timestamp = None, **kv): """Initialize a UDP packet for IPv4""" pcs.packets.udp.udp.__init__(self, bytes, timestamp...
{ "content_hash": "e0e1f442232c7bf198dcd238d69a8223", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 71, "avg_line_length": 34.74418604651163, "alnum_prop": 0.6037483266398929, "repo_name": "gvnn3/PCS", "id": "b3b01f329b36d2fb7e78f0d0444f636564db3d87", "size": "3194", "b...
def cheese_and_crackers(cheese_count, boxes_of_crackers): print ("You have %d cheeses!" % cheese_count) print ("You have %d boxes of crackers!" % boxes_of_crackers) print ("Man that's enough for a party!") print ("Get a blanket.\n") print ("We can just give the function numbers directly:") cheese_and_...
{ "content_hash": "0f1cbd38a70c699535f6d8be1b3deadd", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 70, "avg_line_length": 29.541666666666668, "alnum_prop": 0.7023977433004231, "repo_name": "Paul-Haley/LPTHW_python3", "id": "6f33127301e77058737bb77f54407ac12923a6f6", "siz...
""" Client side of the cert manager RPC API. """ from oslo.config import cfg from oslo import messaging from nova import rpc rpcapi_opts = [ cfg.StrOpt('cert_topic', default='cert', help='The topic cert nodes listen on'), ] CONF = cfg.CONF CONF.register_opts(rpcapi_opts) rpcapi_ca...
{ "content_hash": "8f4cb00bbee8873b74c171d581fe0998", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 79, "avg_line_length": 33.42696629213483, "alnum_prop": 0.5956302521008403, "repo_name": "shakamunyi/nova", "id": "48cdd0ea211c34e5aec75d59663a785c59cb6182", "size": "3582"...
import unittest import os import tempfile from azure.cli.core.application import Application, Configuration, IterateAction from azure.cli.core.commands import CliCommand from azure.cli.core.util import CLIError class TestApplication(unittest.TestCase): def test_client_request_id_is_not_assigned_when_application...
{ "content_hash": "a2b200c1f4b559f4490d0395d7c7bd96", "timestamp": "", "source": "github", "line_count": 166, "max_line_length": 112, "avg_line_length": 36.71084337349398, "alnum_prop": 0.599442074171316, "repo_name": "QingChenmsft/azure-cli", "id": "76d3122cccad7123e1fbca43eee8024bfec92729", "size"...
from __future__ import absolute_import, division, with_statement from revolver import core as _core
{ "content_hash": "b78176bd247152881226a9e4df878b69", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 64, "avg_line_length": 33.666666666666664, "alnum_prop": 0.7821782178217822, "repo_name": "michaelcontento/revolver", "id": "6659d93a18ebcc862366cbac2bdb59fe717f42bc", "size...
import numpy as np from vizdoom import * from doom_instance import DoomInstance from doom_instance_cig import DoomInstanceCig from doom_instance_map import DoomInstanceMap from doom_instance_obj import DoomInstanceObj from doom_instance_oblige import DoomInstanceOblige from doom_instance_oblige_map import DoomInstanceO...
{ "content_hash": "47571b408bc717e6a6784bcba660e400", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 60, "avg_line_length": 31.52173913043478, "alnum_prop": 0.6820689655172414, "repo_name": "akolishchak/doom-net-pytorch", "id": "537b4eb853af11fb9fec5de9146a64d1a339d995", "...
import wx #---------------------------------------------------------------------- ID_CopyBtn = wx.NewId() ID_PasteBtn = wx.NewId() ID_BitmapBtn = wx.NewId() #---------------------------------------------------------------------- class ClipTextPanel(wx.Panel): def __init__(self, parent, log): ...
{ "content_hash": "84772b474c74aefefe244d2e44a8b5d0", "timestamp": "", "source": "github", "line_count": 263, "max_line_length": 103, "avg_line_length": 32.73384030418251, "alnum_prop": 0.5646416540829364, "repo_name": "dnxbjyj/python-basic", "id": "b1325143199b6d7a452849c0bfbe8c8dd8a3ce27", "size":...
from django.test import TestCase from django_dynamic_fixture import G from user_guide.models import Guide class GuideTest(TestCase): def test_guide_unicode(self): guide_obj = G(Guide, guide_name='test_name') self.assertEqual(str(guide_obj), 'test_name')
{ "content_hash": "16ee13bab98447df5f2e6d264ca01560", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 53, "avg_line_length": 25.272727272727273, "alnum_prop": 0.7158273381294964, "repo_name": "ambitioninc/django-user-guide", "id": "85414a148124153c4de6e441264d94d6acbb1355", ...
from google.cloud import dialogflow_v2 def sample_delete_context(): # Create a client client = dialogflow_v2.ContextsClient() # Initialize request argument(s) request = dialogflow_v2.DeleteContextRequest( name="name_value", ) # Make the request client.delete_context(request=reque...
{ "content_hash": "ff9808401337049fc0b296455fa2a430", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 59, "avg_line_length": 22.705882352941178, "alnum_prop": 0.7098445595854922, "repo_name": "googleapis/python-dialogflow", "id": "fc244f00a934050716f2b4b20cc123699f5083e7", ...
""" @file model_xml.py @brief model xml operations @author Josh Madden <cyrex562@gmail.com> """ import os from bs4 import BeautifulSoup from data_gateway import add_table_row from model_objects import User, App, Customer, Order, CartItem import utils XML_FILE = 'data.xml' load_data_handlers = [] store_data_handlers...
{ "content_hash": "a869571980d80d44e607757bb2cef3f9", "timestamp": "", "source": "github", "line_count": 178, "max_line_length": 80, "avg_line_length": 33.97191011235955, "alnum_prop": 0.580949231023648, "repo_name": "cyrex562/COMP461", "id": "7e7af361ce459cff60c7942304de061887aeccf2", "size": "6047...
from letsgetlouder.settings import * # You will need to get these from either Paul or Julia TWITTER_CONSUMER_KEY = '' TWITTER_CONSUMER_SECRET = '' FACEBOOK_APP_ID = '' FACEBOOK_API_SECRET = '' GITHUB_APP_ID = '' GITHUB_API_SECR...
{ "content_hash": "ce13eadfcf5e26e9d1ff165ad9ec3e10", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 55, "avg_line_length": 36.333333333333336, "alnum_prop": 0.5137614678899083, "repo_name": "paulsmith/letsgetlouder", "id": "49f6c0c1c6358598194e09e34a4667c553056439", "size"...
"""Command for describing target instances.""" from googlecloudsdk.compute.lib import base_classes class Describe(base_classes.ZonalDescriber): """Describe a target instance.""" @staticmethod def Args(parser): base_classes.ZonalDescriber.Args(parser) base_classes.AddFieldsFlag(parser, 'targetInstances'...
{ "content_hash": "0bfd553632434a68c11d662eef68ce3f", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 70, "avg_line_length": 24.714285714285715, "alnum_prop": 0.703757225433526, "repo_name": "ychen820/microblog", "id": "520cd58e0da279efc1daf8f198f3616c55ea1db2", "size": "74...
import BoostBuild import os t = BoostBuild.Tester(pass_toolset=0) t.write("link-target", "") os.symlink("link-target", "link") t.write("file.jam", """ ECHO [ READLINK link ] ; EXIT [ READLINK link-target ] : 0 ; """) t.run_build_system(["-ffile.jam"], stdout="""link-target """) t.cleanup()
{ "content_hash": "b8b7958bb17ed3db34f61bf0f73dfef0", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 56, "avg_line_length": 16.5, "alnum_prop": 0.6430976430976431, "repo_name": "davehorton/drachtio-server", "id": "ea120fd842c8f957211f1f8e11384f4b22aa275a", "size": "491", ...
from datetime import datetime, time, timedelta import hashlib def export_event(event, format='ical'): # Only ical format supported at the moment if format != 'ical': return # Begin event # VEVENT format: http://www.kanzaki.com/docs/ical/vevent.html ical_components = [ 'BEGIN:VCALE...
{ "content_hash": "98f66f0880081c87ca09b08bced92869", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 89, "avg_line_length": 29.26923076923077, "alnum_prop": 0.5295663600525624, "repo_name": "arvindram03/e-thagaval", "id": "dbfc64fa28b05477b9d6add119bc05379ec022cf", "size":...
from batch_isp import BatchISP if __name__ == '__main__': batchISP = BatchISP() exit(batchISP.run())
{ "content_hash": "32ae11b30e54359411e9199719fc9cbf", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 30, "avg_line_length": 22, "alnum_prop": 0.6090909090909091, "repo_name": "pinkavaj/batch_isp", "id": "9447b335a99075f4b91c96d9dedf593828b52c51", "size": "130", "binary": ...
print('Hello world!')
{ "content_hash": "167f0033072a0180992d63bbf0425e4c", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 21, "avg_line_length": 23, "alnum_prop": 0.6521739130434783, "repo_name": "alkryukov/sandbox", "id": "b7013b134d2010aefa6e2f19ed4b1d51d8dd098f", "size": "23", "binary": fa...
from __future__ import division import numpy as np import matplotlib.pyplot as plt import pyaudio from scipy.io import wavfile import preprocessing def plotWaveform(audio, samplingFreq, ax=plt.figure().add_subplot(111)): '''Plot the audio waveform in time domain.''' x_values = np.arange(0, audio.shape[0], 1) / ...
{ "content_hash": "8ee5718d2dff610871007d719c99d31c", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 77, "avg_line_length": 29.743243243243242, "alnum_prop": 0.6905951840072694, "repo_name": "liborutgers12/audiospeech", "id": "ffc9478bd544a24fc0cb5d0522f3469f302e7cb8", "si...
from typing import List, Sequence import itertools from e2e_test_framework.definitions import common_definitions, iree_definitions def generate_e2e_model_run_configs( module_generation_configs: Sequence[ iree_definitions.ModuleGenerationConfig], module_execution_configs: Sequence[iree_definitions.Mod...
{ "content_hash": "00f2830ca47b553742c683dd015d6021", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 79, "avg_line_length": 41.416666666666664, "alnum_prop": 0.7474849094567404, "repo_name": "google/iree", "id": "6df10397d50ab54e63cf8f68bdb4da4cf3c429a0", "size": "1213", ...