text stringlengths 4 1.02M | meta dict |
|---|---|
"""Model Analyzer.
Analyze model, including shape, params, time, memory, structure, etc.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.tfprof.python.tools.tfprof import pywrap_tensorflow_print_model_analysis_lib as print_mdl
fr... | {
"content_hash": "68d082c4d1be62ba2542b465b218ff17",
"timestamp": "",
"source": "github",
"line_count": 336,
"max_line_length": 113,
"avg_line_length": 33.36309523809524,
"alnum_prop": 0.639964317573595,
"repo_name": "jhaux/tensorflow",
"id": "b640fa75931fecd53fe196029c97b4c10e313981",
"size": "118... |
"""empty message
Revision ID: 465785295fcb
Revises: 40f2531a009a
Create Date: 2016-10-14 16:33:36.961293
"""
# revision identifiers, used by Alembic.
revision = '465785295fcb'
down_revision = '40f2531a009a'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... | {
"content_hash": "f2ca2e861de917c1482e8629bca434ed",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 78,
"avg_line_length": 33.833333333333336,
"alnum_prop": 0.6785714285714286,
"repo_name": "agileronin/skills-api",
"id": "863e3869269aa01d53a6d1c7c105c6972feb2152",
"size":... |
import datetime
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models.signals import post_init, post_save
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from symposion.con... | {
"content_hash": "d4fffa7b91c1eeb1334d20ab8802108c",
"timestamp": "",
"source": "github",
"line_count": 212,
"max_line_length": 116,
"avg_line_length": 37.27358490566038,
"alnum_prop": 0.6223740825107568,
"repo_name": "mbrochh/symposion",
"id": "24a12d31728397c86e83ebd261b0e708d81d1b4e",
"size": "7... |
from django.shortcuts import render
# Create your views here.
def aefat(request):
return render(request, 'aefat_pages/home.html')
def home(request):
return render(request, 'aefat_pages/home.html') | {
"content_hash": "99cdf33f02218fac63b29a1141c10e29",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 51,
"avg_line_length": 26.625,
"alnum_prop": 0.7183098591549296,
"repo_name": "ouedraog/aefat",
"id": "cc4a518aa9e3df0b31756ffcf609dc0e8106e93e",
"size": "213",
"binary": ... |
from test_framework.mininode import *
from test_framework.test_framework import AureusTestFramework
from test_framework.util import *
from test_framework.blocktools import create_block, create_coinbase
'''
SendHeadersTest -- test behavior of headers messages to announce blocks.
Setup:
- Two nodes, two p2p connectio... | {
"content_hash": "47319a3530d3ff3266ca2fe7a2cd1b73",
"timestamp": "",
"source": "github",
"line_count": 511,
"max_line_length": 115,
"avg_line_length": 42.342465753424655,
"alnum_prop": 0.6046124693811527,
"repo_name": "hideoussquid/aureus-12-bitcore",
"id": "861e8d7a8daecf66e8cd390635875166aec23ab6"... |
"""Filename globbing utility."""
import sys
import os
import re
import fnmatch
try:
_unicode = unicode
except NameError:
# If Python is built without Unicode support, the unicode type
# will not exist. Fake one.
class _unicode(object):
pass
__all__ = ["glob", "iglob"]
def gl... | {
"content_hash": "08b5c29831ec137ddaa1c3aa3f58d0a8",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 78,
"avg_line_length": 32.14,
"alnum_prop": 0.6113876789047915,
"repo_name": "kubaszostak/gdal-dragndrop",
"id": "b50e24ae640bfadc6fa053d688d908c1c3c76001",
"size": "3214"... |
"""
Created on Mon Dec 14 11:37:39 2014
@author: sm1fg
"""
##============================================================================
##option parameters
##============================================================================
def set_options(model, l_mpi, l_gdf=True):
"""This module assigns the logica... | {
"content_hash": "510953605aa226e420013b72b97f5d8b",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 79,
"avg_line_length": 47.064516129032256,
"alnum_prop": 0.5204477952935801,
"repo_name": "SWAT-Sheffield/pysac",
"id": "6c0c0ccb19102085e475e314ef51ec616ed75fd3",
"size": ... |
__author__ = "TOSUKUi"
from . import steam_initialize
| {
"content_hash": "41c998274bf90ab406d97b2351db6927",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 30,
"avg_line_length": 14,
"alnum_prop": 0.6785714285714286,
"repo_name": "TOSUKUi/yasukagiCrawler",
"id": "91b34c30df36c93e4539f31e43d1474facaa9def",
"size": "56",
"binar... |
__author__ = 'cgomezfandino@gmail.com'
import datetime as dt
import v20
from configparser import ConfigParser
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn
# Create an object config
config = ConfigParser()
# Read the config
config.read("../API_Connection_Oanda/pyalgo.cfg")
ac... | {
"content_hash": "4ec97ac2ac803ce1fddbe86f7580dc7e",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 83,
"avg_line_length": 30.871559633027523,
"alnum_prop": 0.5521545319465082,
"repo_name": "cgomezfandino/Project_PTX",
"id": "714418981c11ac301b7a10e496e7ccc47a04e342",
"s... |
def givetimes(schedarr, times):
import datetime
now_time = datetime.datetime.now() #Get time
x = 0 #Counter variable
hn = now_time.hour
mn = now_time.minute
commin = (hn * 60) + mn #Minutes from start of day by now
try: #Try to ensure you don't fall out of array boundaries
while int(schedarr[x][0])<hn :
x +... | {
"content_hash": "df12c6de23bf774c5fd79b801ca0717d",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 68,
"avg_line_length": 24.82608695652174,
"alnum_prop": 0.5989492119089317,
"repo_name": "CRImier/RSEasy",
"id": "385a3f6fd5221cd5b4b4586ef6627f30699006bd",
"size": "586",
... |
import wx
import armid
from BasePanel import BasePanel
from Borg import Borg
from ThreatEnvironmentPanel import ThreatEnvironmentPanel
class ThreatPanel(BasePanel):
def __init__(self,parent):
BasePanel.__init__(self,parent,armid.THREAT_ID)
b = Borg()
self.dbProxy = b.dbProxy
self.theLikelihoods = sel... | {
"content_hash": "6b2ad4533ddce210ca165c21b5d12f1b",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 110,
"avg_line_length": 43.794871794871796,
"alnum_prop": 0.7587822014051522,
"repo_name": "RobinQuetin/CAIRIS-web",
"id": "ce298eadaad14db8688cb88f1c34c3f67e17e990",
"size... |
from oslo.config import cfg
from examples.webhooks import version
api_opts = [
cfg.StrOpt('host', default='0.0.0.0', help='Simple-app API server host'),
cfg.IntOpt('port', default=8988, help='Simple-app API server port')
]
CONF = cfg.CONF
CONF.register_opts(api_opts, group='api')
def parse_args(args=None,... | {
"content_hash": "b4e8cbabdf9cc9956a97fe5c7d8a99e1",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 77,
"avg_line_length": 25.7,
"alnum_prop": 0.6731517509727627,
"repo_name": "nmakhotkin/mistral-extra",
"id": "eeb3e78caed1daa8060909cb66abf7743cbee769",
"size": "1148",
... |
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""
Test file created by XlsxWriter against a file created by Excel.
"""
def setUp(self):
self.set_filename('autofilter07.xlsx')
self.set_text_fi... | {
"content_hash": "61da58603cf47168830c255741d47352",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 75,
"avg_line_length": 29.2987012987013,
"alnum_prop": 0.5695921985815603,
"repo_name": "jmcnamara/XlsxWriter",
"id": "fcc9ac6d1ad4c0ac09571db8d3737eec45f5c2d2",
"size": "2... |
from typing import Dict, List, Set, Callable, Optional
import numpy as np
import tensorflow as tf
from typeguard import check_argument_types
from neuralmonkey.decoders.sequence_regressor import SequenceRegressor
from neuralmonkey.model.model_part import ModelPart
from neuralmonkey.runners.base_runner import (
Bas... | {
"content_hash": "a98a5216769cb054c78d409147820d5f",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 76,
"avg_line_length": 33,
"alnum_prop": 0.6254107338444688,
"repo_name": "juliakreutzer/bandit-neuralmonkey",
"id": "4da6df67c3ccbf23b94a19f351597b4059275978",
"size": "27... |
from django.conf import settings
from django.contrib.auth import models
from django.contrib.auth.decorators import login_required, permission_required
# Trigger CustomUser perm creation:
from django.contrib.auth.tests.custom_user import CustomUser
from django.contrib.auth.tests.test_views import AuthViewsTestCase
from ... | {
"content_hash": "676be35a8019f4e70e8d5379572829d6",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 128,
"avg_line_length": 36.055045871559635,
"alnum_prop": 0.660559796437659,
"repo_name": "ericholscher/django",
"id": "35a2203ba9b62528c3b5fba19b4b9c9ffb30131d",
"size": ... |
import psycopg2
from optparse import OptionParser
tables = {
'history':'daily',
'history_sync':'daily',
'history_uint':'daily',
'history_uint_sync':'daily',
'history_str':'daily',
'history_str_sync':'daily',
'history_log':'daily',
'history_text':'daily',
'trends':'monthly',
'trends_uint':'monthl... | {
"content_hash": "f80d87e5b34283b4408f1c225f3194db",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 106,
"avg_line_length": 22.836734693877553,
"alnum_prop": 0.6657730116175157,
"repo_name": "lesovsky/uber-scripts",
"id": "3ab5e2bb4f738700520514a9707a3aebe2d067f6",
"size"... |
import unittest
from test import support
from test import test_urllib
import os
import io
import socket
import array
import sys
import urllib.request
# The proxy bypass method imported below has logic specific to the OSX
# proxy config data structure but is testable on all platforms.
from urllib.request import (Reque... | {
"content_hash": "73bc1a220d4d2731d3fd19999b0e6776",
"timestamp": "",
"source": "github",
"line_count": 1782,
"max_line_length": 83,
"avg_line_length": 39.67732884399551,
"alnum_prop": 0.5706102821582633,
"repo_name": "ms-iot/python",
"id": "d1423ccc486e1c50bb135ab87c724597ae6fec3d",
"size": "70705... |
import pytest
@pytest.fixture(scope="function")
def workspace():
from structurizr import Workspace
return Workspace("Name", "Description")
| {
"content_hash": "29d47d6986ad5db7926ceb724a4e93c6",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 43,
"avg_line_length": 18.75,
"alnum_prop": 0.7333333333333333,
"repo_name": "sixty-north/structurizr-python",
"id": "1bb1db2b82bbde807aed282851b11d8ddc7f082a",
"size": "150... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'VKAuction.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
)
| {
"content_hash": "4a3e6d5e5ca69a5152db4b5ae528ce97",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 54,
"avg_line_length": 25,
"alnum_prop": 0.6533333333333333,
"repo_name": "immzz/VKAuction",
"id": "288d07c97f68ce287734e934b4db9008403c4153",
"size": "300",
"binary": fa... |
import socket
import logging
class Run:
def __init__(self, sshClient):
self._sshClient = sshClient
self._logger = logging.getLogger('ssh')
def script(self, bashScript, outputTimeout=20 * 60):
self._logger.debug("Running bash script:\n\n%(bashScript)s\n", dict(bashScript=bashScript))
... | {
"content_hash": "9a3818248f4dc7cd76e450422b43fcd6",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 101,
"avg_line_length": 37.76119402985075,
"alnum_prop": 0.5035573122529644,
"repo_name": "noam-stratoscale/rackattack-api",
"id": "83b1dc46445e4951a06c68dc91a9b2de422be0ea",... |
from pyjamas.ui.Sink import Sink, SinkInfo
from pyjamas.ui.ListBox import ListBox
from pyjamas.ui.HorizontalPanel import HorizontalPanel
from pyjamas.ui.VerticalPanel import VerticalPanel
from pyjamas.ui import HasAlignment
from pyjamas.ui.Label import Label
from pyjamas.ui.Widget import Widget
class Lists(Sink):
... | {
"content_hash": "014ef98a1602f377d56370fe684eef79",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 74,
"avg_line_length": 31.2987012987013,
"alnum_prop": 0.6012448132780083,
"repo_name": "Hasimir/pyjs",
"id": "e1bd23dbbe5c11befc291c0841d73799a3760cce",
"size": "2410",
... |
"""
Base settings file for development.
"""
import os
from webassets import Bundle
DEBUG = True
PROJECT_DIR = os.path.normpath(
os.path.join(
os.path.abspath(os.path.dirname(__file__)),
"..",
)
)
# Common site name and domain to use available in templates
SITE_NAME = "{{ cookiecutter.project_... | {
"content_hash": "3e79d6a356f8441be1eb1fda9382a954",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 79,
"avg_line_length": 30.283333333333335,
"alnum_prop": 0.7006053935057788,
"repo_name": "sveetch/Optimus",
"id": "9843a4237ed145df78464afc7305a96adef3c3c1",
"size": "1841... |
import gevent.monkey
gevent.monkey.patch_all()
import multiprocessing
#bind = 'unix:/path/to/june.sock'
bind = '127.0.0.1:8000'
workers = multiprocessing.cpu_count() * 2 + 1
worker_class = 'egg:gunicorn#gevent'
# you should change this
user = 'lepture'
# maybe you like error
accesslog = '-'
loglevel = 'warning'
erro... | {
"content_hash": "32901448ac6141ef03efa2b247df1fff",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 45,
"avg_line_length": 21.916666666666668,
"alnum_prop": 0.6711026615969582,
"repo_name": "lepture/june",
"id": "05cf75ed8d92ea3e738f152b0809c91d146ddae3",
"size": "549",
... |
"""
Created on Thu Jun 23 09:45:44 2016
@author: Arturo
"""
import signal
import sys
import time
import pyupm_grove as grove
import pyupm_i2clcd as lcd
def interruptHandler(signal, frame):
sys.exit(0)
if __name__ == '__main__':
signal.signal(signal.SIGINT, interruptHandler)
myLcd = ... | {
"content_hash": "54ffd74434b4d9934132fec525a01cab",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 63,
"avg_line_length": 21.294117647058822,
"alnum_prop": 0.6298342541436464,
"repo_name": "pasc-04/CursoGalileo",
"id": "1a5abcefcd67523991b3bb1f96b62146ee3e30a5",
"size": ... |
import unittest
from conans.search.binary_html_table import RowResult, Headers, Results
class RowResultTestCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
data = {'id': '1234',
'outdated': True,
'extra': 'never used',
'settings': {'os': 'Wind... | {
"content_hash": "dba3bbb5e3f54dba031595c731553d2b",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 101,
"avg_line_length": 40.75238095238095,
"alnum_prop": 0.485627483056789,
"repo_name": "conan-io/conan",
"id": "c78f62ebd556ff9328a27529c6bf81d369a5af64",
"size": "4279"... |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
from telemetry import decorators
from telemetry.core import exceptions
from telemetry.core import forwarders
from telemetry.core im... | {
"content_hash": "a345a64c1240909b1a6dcf3d069edeb8",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 80,
"avg_line_length": 36.47085201793722,
"alnum_prop": 0.6648223287839665,
"repo_name": "CTSRD-SOAAP/chromium-42.0.2311.135",
"id": "a5c14c33cba8e4ffcfd2c59486c89e7924c9eb5... |
from collections import OrderedDict
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseForbidden, JsonResponse, HttpResponse, HttpResponseBadRequest
from django.shortcuts import render, get_object_or_404
from django.template import loader
f... | {
"content_hash": "1b47f53681646fb84ae7bfae01b39a98",
"timestamp": "",
"source": "github",
"line_count": 402,
"max_line_length": 138,
"avg_line_length": 36.669154228855724,
"alnum_prop": 0.6173936639305339,
"repo_name": "porksmash/swarfarm",
"id": "fcec86e791645f78ab32ed415280de9107414e12",
"size": ... |
from .elements import element_line, element_rect, element_text, element_blank
from .theme import theme
from .theme_gray import theme_gray
class theme_linedraw(theme_gray):
"""
A theme with only black lines of various widths on white backgrounds
Parameters
----------
base_size : int, optional
... | {
"content_hash": "3b02647a5c35c44fda45a4f12db86986",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 79,
"avg_line_length": 40.75757575757576,
"alnum_prop": 0.6178438661710037,
"repo_name": "has2k1/plotnine",
"id": "d560bd5f40b865ea48daad20c5e4ec3e8da14803",
"size": "1345"... |
import os
from twitter.pants.targets.exportable_jvm_library import ExportableJvmLibrary
class JavaProtobufLibrary(ExportableJvmLibrary):
"""Defines a target that builds java stubs from a protobuf IDL file."""
def __init__(self,
name,
sources,
provides = None,
... | {
"content_hash": "057e70a1cab2900cb642cd8e433708a8",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 100,
"avg_line_length": 39.16326530612245,
"alnum_prop": 0.6039603960396039,
"repo_name": "foursquare/commons-old",
"id": "5191aeaf87adafa7e85d12914d20219041c6ce0a",
"size"... |
"""
Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, INC
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of condi... | {
"content_hash": "18d50012cf4b0d690115db2dea2e9a3f",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 76,
"avg_line_length": 34.06930693069307,
"alnum_prop": 0.6730601569311246,
"repo_name": "tnadeau/pybvc",
"id": "1c644e5ac5950f79856e10b06af8bee53b5e73c0",
"size": "3460",... |
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.insert(0, os.path.abspath('..'))
# -- General c... | {
"content_hash": "38abc60b018d1a6d958a42ff66a2fcfd",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 103,
"avg_line_length": 33.55555555555556,
"alnum_prop": 0.6847106248200403,
"repo_name": "gulopine/steel",
"id": "0556c53551de4a9e3e4f309d11bfec2585a3c50a",
"size": "7373... |
from test import test_support
import unittest
import sys
import difflib
# A very basic example. If this fails, we're in deep trouble.
def basic():
return 1
basic.events = [(0, 'call'),
(1, 'line'),
(1, 'return')]
# Armin Rigo's failing example:
def arigo_example():
x = 1
... | {
"content_hash": "c2dacecc1757103a8fadd46b6063b706",
"timestamp": "",
"source": "github",
"line_count": 607,
"max_line_length": 76,
"avg_line_length": 29.40362438220758,
"alnum_prop": 0.532328552218736,
"repo_name": "loongson-community/EFI-MIPS",
"id": "7f866fbcf539ddbc2d7472e9abca07fd6e3d8766",
"s... |
from zirkon.program_config import ModuleConfig
CONF = ModuleConfig("""\
opt0 = Int(default=10)
opt1 = Float(default=1.0)
""")
| {
"content_hash": "6fa7fe8f16eba3d0b9b393eabd562b5e",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 46,
"avg_line_length": 18.285714285714285,
"alnum_prop": 0.7109375,
"repo_name": "simone-campagna/daikon",
"id": "71e4b2b6b077c41b1c28a6fb50cb524a604b3b3d",
"size": "128",
... |
from ..groups import *
from ...models import Statistic, State, Timer, Sequence, UUID, StatisticBarPlot
TRACKABLES = {'Statistic': Statistic, 'State': State, 'Timer': Timer, 'Sequence': Sequence}
@app.route('/usage/plots', methods=['GET', 'POST'])
@flask_login.login_required
def usage_plots():
group = flask_login... | {
"content_hash": "a8dce9b93dff316ec087768bd0a12593",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 100,
"avg_line_length": 46.526315789473685,
"alnum_prop": 0.6583710407239819,
"repo_name": "lobocv/crashreporter_hq",
"id": "0bb4ed778ff36368cfc9a27b544ff6b265ae3ea0",
"siz... |
from exceptions import Exception
class Eclipse2017Exception(Exception):
pass
class CloudStorageError(Eclipse2017Exception):
pass
class CouldNotObtainCredentialsError(Eclipse2017Exception):
pass
class FailedToRenameFileError(Eclipse2017Exception):
pass
class FailedToSaveToDatastoreError(Eclipse... | {
"content_hash": "7e8c33c50c6759e8c71ca51db5ea7285",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 59,
"avg_line_length": 16.756756756756758,
"alnum_prop": 0.8064516129032258,
"repo_name": "google/eclipse2017",
"id": "9629b74e7d4db88194287e57b53be32e7c494107",
"size": "1... |
"""Prototype decorator for defining legacy-graph-mode functions."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import weakref
from tensorflow.python.eager import def_function
from tensorflow.python.eager import function
from tensorflow.python.eager im... | {
"content_hash": "6d937b4cce2118fd3810fd3f74a60db5",
"timestamp": "",
"source": "github",
"line_count": 463,
"max_line_length": 88,
"avg_line_length": 38.8768898488121,
"alnum_prop": 0.6851666666666667,
"repo_name": "kevin-coder/tensorflow-fork",
"id": "ec7ecf8985b08b78ea2d8c1f092177f2ada2c555",
"s... |
"""Search API module."""
from search import AddDocumentError
from search import AddDocumentResult
from search import AtomField
from search import DateField
from search import DeleteDocumentError
from search import DeleteDocumentResult
from search import Document
from search import DocumentOperationResult
from search i... | {
"content_hash": "dce15cb064282dbef1ee0dd1a67580ca",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 42,
"avg_line_length": 31.26923076923077,
"alnum_prop": 0.8671586715867159,
"repo_name": "adviti/melange",
"id": "11e69a2dd11c0a30fdf3f75a583cdd7002682a81",
"size": "1418",... |
__profile__ = {
"id": "test_versioning",
"driver": "nose",
"test_path": "fuel_plugin/tests/functional/dummy_tests/test_versioning.py",
"description": "Test suite that contains fake tests for versioning check",
"deployment_tags": ["releases_comparison"],
"test_runs_ordering_priority": 13,
"ex... | {
"content_hash": "4c24ca08bed119f084e57b0b29fde56b",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 79,
"avg_line_length": 31.647058823529413,
"alnum_prop": 0.6282527881040892,
"repo_name": "mcloudv/fuel-ostf",
"id": "3a53cb6e9f23c4e2d65092021ee226acad0256ec",
"size": "16... |
from PyQt4 import QtGui, QtCore
from core.domainobjects import MovieModel
import core.Constants as Constants
import ui.DefaultComponents
SAVE_BUTTON_LABEL = " Save "
UPDATE_BUTTON_LABEL = " Update "
class AddMovieRequest(QtGui.QFrame):
def __init__(self, mainWindow):
super(AddMovieRequest, self)... | {
"content_hash": "069fdeae9957c78f3b37e5611897b226",
"timestamp": "",
"source": "github",
"line_count": 212,
"max_line_length": 117,
"avg_line_length": 33.43396226415094,
"alnum_prop": 0.6058126410835214,
"repo_name": "vshandubey/movie-database",
"id": "2620353fe247d62454000dc216205ebc6c4e6ad5",
"s... |
from tempest.api.network import base
from tempest.common.utils import data_utils
from tempest import config
from tempest import exceptions
from tempest import test
CONF = config.CONF
class VPNaaSTestJSON(base.BaseNetworkTest):
_interface = 'json'
"""
Tests the following operations in the Neutron API usi... | {
"content_hash": "08a08d59c145a147e3ef94ececcbcc68",
"timestamp": "",
"source": "github",
"line_count": 229,
"max_line_length": 79,
"avg_line_length": 45.427947598253276,
"alnum_prop": 0.5974238200519081,
"repo_name": "vmahuli/tempest",
"id": "d1fe15c25bd276117c71172c6cb3ee236b7811b7",
"size": "110... |
from urllib import urlencode
import urllib2
from wham.httmock import urlmatch
from os.path import join
from os import listdir
from os.path import isfile, join
from urlparse import urlparse, parse_qs, parse_qsl
# def mock_function_builder(scheme, netloc, url_name, settings, responses_dir):
# url_path = settings['u... | {
"content_hash": "d8d30c10f9eac7b18ee05f8e1eadfd1b",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 99,
"avg_line_length": 35.714285714285715,
"alnum_prop": 0.616,
"repo_name": "mbylstra/django-wham",
"id": "69bc0fd3ad7646875c140cf0b5eb868259f127e8",
"size": "2250",
"bi... |
import datetime
import errno
import os
import os.path
import re
import subprocess
import sys
import time
def mkdir_p(directory):
"""Make the directory, and all its ancestors as required. Any of the
directories are allowed to already exist."""
if directory == "":
# We're being asked to make the c... | {
"content_hash": "d8183b29ed996abe6b85b9bf9dc1e8e8",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 81,
"avg_line_length": 34.452991452991455,
"alnum_prop": 0.6187050359712231,
"repo_name": "endlessm/chromium-browser",
"id": "321de74bdcf8147c00dd7ba39a68f3cad7086810",
"s... |
import logging
from desktop.lib.python_util import force_dict_to_strings
from exception import SqoopException
from form import Form
class Connection(object):
"""
Sqoop connection object.
Example of sqoop connection dictionary received by server: {
"id": -1,
"updated": 1371245829436,
"created": 13... | {
"content_hash": "7c029f6ea888cd8ea6cafacb3873e7ef",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 169,
"avg_line_length": 29.95876288659794,
"alnum_prop": 0.5874053682037165,
"repo_name": "yongshengwang/builthue",
"id": "2c90f240c41edc1138099fd0bacaa402e300d0c0",
"size... |
"""
A GTK+ implementation for a user interface. PhotoInfo window
"""
__program__ = "photoplace"
__author__ = "Jose Riguera Lopez <jriguera@gmail.com>"
__version__ = "0.6.1"
__date__ = "Dec 2014"
__license__ = "Apache 2.0"
__copyright__ ="(c) Jose Riguera"
import os
import codecs
import xml.dom.minidom
import StringIO... | {
"content_hash": "4a6ac7c481ea9600caba82c14de49617",
"timestamp": "",
"source": "github",
"line_count": 572,
"max_line_length": 102,
"avg_line_length": 36.86188811188811,
"alnum_prop": 0.5475456485653308,
"repo_name": "jriguera/photoplace",
"id": "669cf21bd358c84c5518a532c43fa085d6eb9d43",
"size": ... |
import os, shutil
import tempfile
from io import StringIO
from pathlib import Path, PurePath
from sys import executable
from collections.abc import Iterable
import pytest
from doit.exceptions import TaskError
from doit.exceptions import BaseFail
from doit import action
from doit import task
from doit.task import Stre... | {
"content_hash": "65cbe486d190abee00251908a34ce01e",
"timestamp": "",
"source": "github",
"line_count": 694,
"max_line_length": 87,
"avg_line_length": 35.17579250720461,
"alnum_prop": 0.5543175487465181,
"repo_name": "pydoit/doit",
"id": "b31f64e7d8587c50f574af181d230cfa09a870ae",
"size": "24416",
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tempfile
import numpy as np
from six.moves import range
import tensorflow as tf
from tensorflow import flags
from tensorflow.examples.tutorials.mnist import input_data
from tensorflow.lite.experimental.... | {
"content_hash": "a6b5486cbfb6fe0d6cf2c63eaebf83b1",
"timestamp": "",
"source": "github",
"line_count": 360,
"max_line_length": 84,
"avg_line_length": 33.480555555555554,
"alnum_prop": 0.6470588235294118,
"repo_name": "adit-chandra/tensorflow",
"id": "606f969b92a32b2b3ea9955d8dc26bce27119ea7",
"siz... |
from kazoo.client import KazooClient, KazooState
from kazoo.exceptions import ZookeeperError, KazooException
from threading import Thread
import argparse
import sys
from time import sleep
class ZookeeperWatcher():
zoo_client = None # The KazooClient to manage the config
point_path = None # Zookeeper path to... | {
"content_hash": "5702139cfdd47063f70d1646bcdaa425",
"timestamp": "",
"source": "github",
"line_count": 376,
"max_line_length": 80,
"avg_line_length": 36.630319148936174,
"alnum_prop": 0.5600087126987584,
"repo_name": "quixey/scrapy-cluster",
"id": "07832e82ed217974c8b9411798fac8bcf6ca9912",
"size"... |
from flask import (
render_template,
redirect,
url_for,
request,
session,
current_app,
g)
from flask.ext.login import (
login_user,
logout_user,
current_user,
login_required)
from flask.ext.principal import (
identity_changed,
identity_loaded,
AnonymousIdentity,
... | {
"content_hash": "c54aac9d9125c285ec037771d1afe364",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 79,
"avg_line_length": 30.412587412587413,
"alnum_prop": 0.6084157277535066,
"repo_name": "mweb/flask-starter",
"id": "becffd513ccf36fef0cde61aa5ad18fdc8218f48",
"size": "... |
from morsel.entities import Vector
from morsel.quad_field import Field
from morsel.pathfinder import Pathfinder
import matplotlib.pyplot as plt
import networkx as nx
def print_samples(samples):
for sample in samples:
print sample.get_json_string()
sample_field = Field(
Vector(1, 6),
Vector(6, 11.... | {
"content_hash": "bfddd7554bc8d50cac05eb294b1ed5e7",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 65,
"avg_line_length": 27.6,
"alnum_prop": 0.7072463768115942,
"repo_name": "NickTikhonov/morsel",
"id": "08b5152cac41165a8054ec4871c6adfe9d3552ed",
"size": "710",
"binar... |
import os
import sys
import unittest
from test.support import run_unittest, import_module
# Skip tests if we don't have threading.
import_module('threading')
# Skip tests if we don't have concurrent.futures.
import_module('concurrent.futures')
def suite():
tests = unittest.TestSuite()
loader = unittest.TestL... | {
"content_hash": "90507582aeb5cc772549b1f758ba76a7",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 63,
"avg_line_length": 27.344827586206897,
"alnum_prop": 0.6090794451450189,
"repo_name": "ArcherCraftStore/ArcherVMPeridot",
"id": "82158af77ddcb6b3f44630f4f3d88bbb57c99820"... |
import logging
from django.http import Http404
from rest_framework import status
from rest_framework.generics import get_object_or_404
from rest_framework.mixins import CreateModelMixin, UpdateModelMixin, DestroyModelMixin
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_f... | {
"content_hash": "edff325807dd640f48fadaebd5bc8d20",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 116,
"avg_line_length": 38.11363636363637,
"alnum_prop": 0.6046511627906976,
"repo_name": "blstream/CaptureTheFlag",
"id": "9bc89c1a6e56edeb2dab34f39f0695b3df71d97b",
"siz... |
"""Elementary Rules of Usage.
---
layout: post
source: Strunk & White
source_url: ???
title: Elementary Principles of Composition
date: 2014-06-10 12:31:19
categories: writing
---
Strunk & White say:
1. Choose a suitable design and hold to it.
* MDPNB: Sounds like a principle of `consistency`.
... | {
"content_hash": "1689b6ff5505005857f94142e07683cf",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 79,
"avg_line_length": 41.5,
"alnum_prop": 0.6012621916236374,
"repo_name": "amperser/proselint",
"id": "9f8b744127069cb73724b452e6a97f3748cdcc2d",
"size": "3486",
"binar... |
from datetime import datetime
import glob
from itertools import groupby
import os
import re
import sys
import time
import traceback
# project
from checks import LaconicFilter
import modules
from util import windows_friendly_colon_split
from utils.tailfile import TailFile
def partition(s, sep):
pos = s.find(sep)
... | {
"content_hash": "bc1a4ff486db8e2d7f84fd5bba5d6f4c",
"timestamp": "",
"source": "github",
"line_count": 418,
"max_line_length": 127,
"avg_line_length": 35.303827751196174,
"alnum_prop": 0.5258521379684218,
"repo_name": "gphat/dd-agent",
"id": "ddbd7642e33704405674ac1af03c5897a5d8fb3d",
"size": "148... |
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import IsAdminUser
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework import status
from seaserv import seafile_api
from .utils import check_time_period_valid, \
g... | {
"content_hash": "76bbbdcd9a64d035e4e68b064fae1f4a",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 75,
"avg_line_length": 36.50877192982456,
"alnum_prop": 0.6444017299375301,
"repo_name": "saukrIppl/seahub",
"id": "03870c9af383c52e272817e145b54582fffcbbf5",
"size": "2081... |
from .bugzilla import Bugzilla, parse_bug_id, parse_bug_id_from_changelog
# Unclear if Bug and Attachment need to be public classes.
from .bug import Bug
from .attachment import Attachment
| {
"content_hash": "86352351cd9ee41efd2ed6b66a8a6b72",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 73,
"avg_line_length": 47.25,
"alnum_prop": 0.798941798941799,
"repo_name": "mogoweb/webkit_for_android5.1",
"id": "bde67c6d5d5627b06f3de396381e3efae6daf56d",
"size": "341",... |
from django.shortcuts import render
from django.http import HttpResponse
from django.views.generic import View
from django.shortcuts import redirect
from .scripts.data_management import create_new_user, update_cache, remove_picture_cache, load_user, load_links, get_page
from models import User
# Create your views her... | {
"content_hash": "ed1e39d0fae79db1f360337e71b95084",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 128,
"avg_line_length": 34.707070707070706,
"alnum_prop": 0.6239813736903376,
"repo_name": "Lord-Phoenix/Instam",
"id": "03efb2bf59210158d86e3679e1f860363c5b3de5",
"size": ... |
"""Runs YCSB against Cloud Bigtable.
Cloud Bigtable (https://cloud.google.com/bigtable/) is a managed NoSQL database
with an HBase-compatible API.
Compared to hbase_ycsb, this benchmark:
* Modifies hbase-site.xml to work with Cloud Bigtable.
* Adds the Bigtable client JAR.
* Adds alpn-boot-7.0.0.v20140317.jar t... | {
"content_hash": "2353ebb9c624abe425a6d59c42b91cb8",
"timestamp": "",
"source": "github",
"line_count": 287,
"max_line_length": 79,
"avg_line_length": 34.390243902439025,
"alnum_prop": 0.6728470111448834,
"repo_name": "mateusz-blaszkowski/PerfKitBenchmarker",
"id": "cc656fd16a028f07b2ff6a671b25dc6389... |
"""
A multi-heart Heartbeat system using PUB and ROUTER sockets. pings are sent out on the PUB,
and hearts are tracked based on their DEALER identities.
"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import time
import uui... | {
"content_hash": "b7c7ba49a28906257fbae0cc590a89cf",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 128,
"avg_line_length": 37.96875,
"alnum_prop": 0.6262002743484225,
"repo_name": "wolfram74/numerical_methods_iserles_notes",
"id": "3692e5ee6049002e40b6bb89bf174c91e01fbedb... |
from __future__ import generators
if __name__ == '__main__':
import sys
import os
pkg_dir = os.path.split(os.path.abspath(__file__))[0]
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == 'tests' and
os.path.split(parent_dir)[1] == 'pygame')
if not i... | {
"content_hash": "91ad08e614bb3132fbfec61b87ee31fd",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 80,
"avg_line_length": 29.22222222222222,
"alnum_prop": 0.5944233206590621,
"repo_name": "sumpfgottheit/pdu1800_data_provider",
"id": "31d3ea2e2d4c6471d54ced79b72725a9ed51481... |
from __future__ import absolute_import
from google.cloud.speech_v1.gapic import speech_client
from google.cloud.speech_v1.gapic import enums
from google.cloud.speech_v1.helpers import SpeechHelpers
from google.cloud.speech_v1 import types
class SpeechClient(SpeechHelpers, speech_client.SpeechClient):
__doc__ = ... | {
"content_hash": "be5c82ef739ebb80f1272d15dfbd2f48",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 62,
"avg_line_length": 22.65,
"alnum_prop": 0.7218543046357616,
"repo_name": "tseaver/gcloud-python",
"id": "272b623c510dd2551db967acbda0b077fe4236da",
"size": "1028",
"b... |
"""Instance Metadata information."""
import base64
import json
import os
import posixpath
from oslo.config import cfg
from nova.api.ec2 import ec2utils
from nova.api.metadata import password
from nova import block_device
from nova.compute import flavors
from nova import conductor
from nova import context
from nova i... | {
"content_hash": "45f1a6ebf41e392cc1b4507b608b5c85",
"timestamp": "",
"source": "github",
"line_count": 534,
"max_line_length": 79,
"avg_line_length": 34.734082397003746,
"alnum_prop": 0.5738084968729782,
"repo_name": "spring-week-topos/nova-week",
"id": "90e8c27a47e188e6120da73e5c84dc73d0aa1afd",
... |
from jupyter_core.paths import jupyter_config_dir, jupyter_data_dir
import os
import sys
import glob
import shutil
data_dir = jupyter_data_dir()
dest_templates = os.path.join(data_dir, 'templates')
src_templates = os.path.join(data_dir, 'nbextensions', 'templates')
dest_extensions = os.path.join(data_dir,... | {
"content_hash": "112b399bdca02e7a75701bd0b88ec1a6",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 68,
"avg_line_length": 32.84615384615385,
"alnum_prop": 0.7306791569086651,
"repo_name": "benvarkey/IPython-notebook-extensions",
"id": "dcca9c9e04e19e345253013b91ff0aae54e8f... |
from typing import List, NamedTuple
from marshmallow import Schema, fields
from airflow.api_connexion.schemas.common_schema import (
ClassReferenceSchema,
ColorField,
TimeDeltaSchema,
WeightRuleField,
)
from airflow.api_connexion.schemas.dag_schema import DAGSchema
from airflow.models.baseoperator imp... | {
"content_hash": "04cedb03a65c7636828f6b459b559015",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 93,
"avg_line_length": 34.46875,
"alnum_prop": 0.7234814143245694,
"repo_name": "airbnb/airflow",
"id": "d87123fb5d8d4e1c6d7b31ff7c9d2df1e0278148",
"size": "2992",
"binar... |
from .auth import basic_auth_opener
from .site import SharePointSite
class ExitCodes(object):
MISSING_ACTION = 1
NO_SUCH_ARGUMENT = 2
NO_SUCH_LIST = 3
MISSING_ARGUMENT = 4
MISSING_CREDENTIALS = 5
INVALID_CREDENTIALS = 6
NO_SUCH_ACTION = 7
def main():
from optparse import OptionParser... | {
"content_hash": "420e5a5f5343928f04269be8d5466bb9",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 120,
"avg_line_length": 47.91216216216216,
"alnum_prop": 0.5975179805387111,
"repo_name": "ox-it/python-sharepoint",
"id": "4c50b3b8d13c6fec0976388b0aefcb0abe256e05",
"siz... |
'''
Author: alexc89@mit.edu
IRB140LCMWrapper
This is a script connecting OPEN ABB Driver with LCM. It publishes IRB140's joint position in IRB140Pos LCM Channel and listens IRB140Input to control IRB140's joint.
Please note that the unit of the joint state and command is dependent on the setting on the IRB140, this sc... | {
"content_hash": "8f9f09b4f7897c77350aa0f9165b7e95",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 176,
"avg_line_length": 33.62921348314607,
"alnum_prop": 0.6795856999665887,
"repo_name": "WeirdCoder/ABB-IRB140",
"id": "50e765418b062d9a1d9ca099b95af46cd9365741",
"size":... |
"""Helpers for overriding numpy functions.
We override numpy functions in `~astropy.units.Quantity.__array_function__`.
In this module, the numpy functions are split in four groups, each of
which has an associated `set` or `dict`:
1. SUBCLASS_SAFE_FUNCTIONS (set), if the numpy implementation
supports Quantity; we ... | {
"content_hash": "b60410a9913c1918afd5eee67d9dac49",
"timestamp": "",
"source": "github",
"line_count": 840,
"max_line_length": 79,
"avg_line_length": 33.37023809523809,
"alnum_prop": 0.6388641147301202,
"repo_name": "bsipocz/astropy",
"id": "b9d363abf1887aae82fba50531eaff672fd1cfd5",
"size": "2825... |
from block import *
from BeautifulSoup import BeautifulSoup
from logging import ERROR, WARN, INFO, DEBUG
import urlparse
class bookmark_query(Block):
def on_load(self, config):
self.config = config
self.add_port("list", Port.QUERY, Port.UNNAMED, [])
self.add_port("restore", Port.QUERY, Port.UNNAMED, ["u... | {
"content_hash": "f1cddf28f1e3e3da82ddf1aa88eaeae9",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 118,
"avg_line_length": 36.594202898550726,
"alnum_prop": 0.6,
"repo_name": "mpi-sws-rse/datablox",
"id": "18fadffed328fb5d4ae5d7840ae738ad319c6669",
"size": "5050",
"bi... |
import numpy as np
from bs4 import BeautifulSoup
from docluster.core import Model
from docluster.utils.constants import Language
from nltk import sent_tokenize, word_tokenize
from .token_filter import TokenFilter
class Preprocessor(Model):
def __init__(self, language=Language.english, lower=True, parse_html=Tru... | {
"content_hash": "1856bedcb60f7291b5fe92cb5c213a37",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 167,
"avg_line_length": 31.24561403508772,
"alnum_prop": 0.6445816956765862,
"repo_name": "metinsay/docluster",
"id": "b607905719fee8bdd9c82a5a3248eeb8fd4f6099",
"size": "1... |
"""
Read a wiggle track and print out a series of lines containing
"chrom position score". Ignores track lines, handles bed, variableStep
and fixedStep wiggle lines.
"""
import psyco_full
import sys
import bx.wiggle
if len( sys.argv ) > 1: in_file = open( sys.argv[1] )
else: in_file = sys.stdin
if len( sys.argv ) >... | {
"content_hash": "1b1c4f345c7d16a0e61d6f5fa3c93ef9",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 70,
"avg_line_length": 23.045454545454547,
"alnum_prop": 0.6824457593688363,
"repo_name": "poojavade/Genomics_Docker",
"id": "d8c4f57d0d3e5faed89daa2d6df136786441cc2c",
"si... |
class something(object):
def __init__(self):
pass
def ppp(self):
print("Great, you can see this now, in ppp function")
def ppp2(self, x, y, z=0):
return x+y+z
class something2(object):
def __init__(self, mm, nn, oo, pp='pp', qq='qq'):
self.value = mm + nn + oo
... | {
"content_hash": "ec4b41720adb0acf89612bd9d74a153d",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 61,
"avg_line_length": 21.583333333333332,
"alnum_prop": 0.5386100386100386,
"repo_name": "steven004/pytest_oot",
"id": "6074d189e0485ef24b982a532578806b5177b3f0",
"size": ... |
import os
assert 'THOR_HOME' in os.environ, 'please first set env_var THOR_HOME as the absolute path of DRL/THOR'
# open display
display = False
# size of the input image to the network
net_input_width=224
net_input_height=224
THOR_HOME = os.environ['THOR_HOME']
# OSX / Linux
binary_build = THOR_HOME + '/thor_binar... | {
"content_hash": "e4ed39fcc6ee9cc6a57e27cc5b5e06c8",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 118,
"avg_line_length": 32.91935483870968,
"alnum_prop": 0.7329740323370897,
"repo_name": "YuMao1993/DRL",
"id": "3754a4c9ea5df7e7326f9bf17c313fbe1d724aaa",
"size": "2069",... |
"""
Created on Tue Aug 11 11:44:38 2015
@author: Kevin
"""
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import os
import sys
import scipy
data_path = 'C:\Users\Kevin\Desktop\workStuff\LDA\data' + "\\"
def createDataFrame(vbfMEList, ttbarMEList, path = data_path):
da... | {
"content_hash": "8c8668629a0179ab8635b3b28a266c33",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 164,
"avg_line_length": 34.455882352941174,
"alnum_prop": 0.6517285531370038,
"repo_name": "kvmu/SFU-workterm",
"id": "7a7c8a9bf3ee2e1d53cfb15e292e0281d77f2364",
"size": "... |
import numpy as np
from utils.grabscreen import grab_screen
from utils.directkeys import PressKey,ReleaseKey,A,W,S,D
from matplotlib import pyplot as plt
from utils.grabkeys import key_check
import cv2
import time
import sys
import os
def draw_lines(img,lines):
try:
for l in lines:
coords=l[0]
... | {
"content_hash": "5f9262a609d074550aca77e47f3a739f",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 93,
"avg_line_length": 29.748387096774195,
"alnum_prop": 0.5827369334200824,
"repo_name": "AlwaysLearningDeeper/OpenAI_Challenges",
"id": "8621078a2782dd91c652ee7ed0ad9312bf... |
from models import Content
def delete_all_contents():
for content in get_contents():
delete_content(content._type)
def get_contents():
return Content.get_contents()
def delete_content(_type):
return Content.delete_content(_type)
def add_content(data, _type):
content = Content(data, _type... | {
"content_hash": "5aafe643f79252d72b3ba887f64b7b50",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 48,
"avg_line_length": 17.885714285714286,
"alnum_prop": 0.65814696485623,
"repo_name": "pygamebrasil/pygame-site",
"id": "34ced7e228abac56650ef65094ce8cf5b6154e04",
"size"... |
import re
import sys
import json
import requests
from time import sleep
from bs4 import BeautifulSoup
class NckuCrawler(object):
def __init__(self):
self.l =[]
self.start = int(sys.argv[1])
self.end = int(sys.argv[2])
#自定清除格式1
def format(self,unformat):
try:
format = unformat.encode('raw_unicode_esc... | {
"content_hash": "c2a17298ff2755565979fc639c31e568",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 119,
"avg_line_length": 24.14516129032258,
"alnum_prop": 0.633934535738143,
"repo_name": "wy36101299/nckuCrawler",
"id": "ac2e32f96d8fbaefac4f13213a894a50f47b747c",
"size":... |
from optparse import make_option
import sys
from django.conf import settings
from django.core.management.base import NoArgsCommand
from django.core.management.color import no_style
from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal
from django.db import connections, router, trans... | {
"content_hash": "715169a179cf84ca71e5fd2aefbd1f01",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 121,
"avg_line_length": 50.640243902439025,
"alnum_prop": 0.556532209512342,
"repo_name": "rimbalinux/MSISDNArea",
"id": "a821340eec793c0ccabb32c8ec3a1edb28e89ef7",
"size"... |
import multiprocessing
import sys
_is_pypy = hasattr(sys, 'pypy_version_info')
# falcon only implements json and plain. Not wait DB.
workers = multiprocessing.cpu_count()
bind = "0.0.0.0:8080"
keepalive = 120
if _is_pypy:
worker_class = "tornado"
else:
worker_class = "meinheld.gmeinheld.MeinheldWorker"
... | {
"content_hash": "81b83bb6d7b23fd7e41325f12cac6115",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 54,
"avg_line_length": 23,
"alnum_prop": 0.6956521739130435,
"repo_name": "seem-sky/FrameworkBenchmarks",
"id": "6380907ffcbf726cbc10a881b216a5fb867b8e99",
"size": "460",
... |
"""BreezeBlocks Python Querying package."""
from .database import Database
from .sql import Table
from .query_builder import QueryBuilder
from .dml_builders import InsertBuilder, UpdateBuilder, DeleteBuilder
__version__ = "0.3.2"
| {
"content_hash": "fe4af35d568ca0b17d292b9b844da79e",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 69,
"avg_line_length": 33,
"alnum_prop": 0.7835497835497836,
"repo_name": "modimore/BreezeBlocks",
"id": "ede17988278e5774f22e685f392ae33930f54017",
"size": "231",
"binary... |
'''
Given a string, find out if its characters can be rearranged to form a palindrome.
Example
For inputString = "aabb", the output should be
palindromeRearranging(inputString) = true.
We can rearrange "aabb" to make "abba", which is a palindrome.
'''
from collections import Counter
def palindromeRearranging(inputSt... | {
"content_hash": "84c5d2d88fc04ddae00f7b6e1fdf5121",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 82,
"avg_line_length": 23.939393939393938,
"alnum_prop": 0.5860759493670886,
"repo_name": "mayababuji/MyCodefights",
"id": "4df79f7ea0032044b2b2f107ae5165f326b574af",
"size... |
"""Tests for subclasses of IIncludes."""
import unittest
from musicbrainz2.model import Release
from musicbrainz2.webservice import (
ArtistIncludes, ReleaseIncludes, TrackIncludes, LabelIncludes)
class ArtistIncludesTest(unittest.TestCase):
def testReleases(self):
inc1 = ArtistIncludes(aliases=True, releaseRelat... | {
"content_hash": "853ae003c5808b2f6ed8d4257547e5c4",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 69,
"avg_line_length": 30.397260273972602,
"alnum_prop": 0.7399729607931501,
"repo_name": "mineo/python-musicbrainz2",
"id": "30cd873ae05ce87e0e344ecfd54e26df104df5e1",
"si... |
"""This module contains a collection of unit tests which
validate the ..async_actions module.
"""
import unittest
import uuid
import mock
import tor_async_util
from ..async_actions import AsyncCrawlCreator
from ..async_actions import SpidersAsyncHealthCheck
from cloudfeaster_services.tests import AsyncPublishMessage... | {
"content_hash": "758df92c50f486d415299028fb56c1a3",
"timestamp": "",
"source": "github",
"line_count": 246,
"max_line_length": 91,
"avg_line_length": 35.520325203252035,
"alnum_prop": 0.5779354543373769,
"repo_name": "simonsdave/cloudfeaster_infrastructure",
"id": "b53f112915759b3a161d55564e38ebd5ad... |
import sys
from typing import Any, Callable, Dict, IO, List, Optional, TypeVar, Union, overload
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure.core.pipeline import Pi... | {
"content_hash": "31cba0a04b83ef7ad7636d3410a70643",
"timestamp": "",
"source": "github",
"line_count": 438,
"max_line_length": 183,
"avg_line_length": 42.34018264840183,
"alnum_prop": 0.6458344567268806,
"repo_name": "Azure/azure-sdk-for-python",
"id": "5c5c60e7e4f9067e084dbb6e776fda11eac508d8",
"... |
import unittest
import sqlite3 as sqlite
class CollationTests(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def CheckCreateCollationNotCallable(self):
con = sqlite.connect(":memory:")
try:
con.create_collation("X", 42)
self.fail... | {
"content_hash": "1804ac2fcbc3512253a4cac30b06dc1d",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 91,
"avg_line_length": 35.71296296296296,
"alnum_prop": 0.5767435830956702,
"repo_name": "MalloyPower/parsing-python",
"id": "3dc44f6110c3bde9fb84d2eb9e61d3801d82f2f8",
"s... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'commute_together.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^meeting/new/', 'commute_to... | {
"content_hash": "e29e89f1c2aaada624453ce3ebb02de7",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 122,
"avg_line_length": 51.76190476190476,
"alnum_prop": 0.6798528058877645,
"repo_name": "DimaWittmann/commute-together",
"id": "ff8b5a7cdbb1270cf6f16c0d77334fcda3fabe72",
... |
__author__ = 'jbjohnso'
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2014 Lenovo Corporation
#
# 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/license... | {
"content_hash": "a94b65fa28ce662e1b417b30d6a6f031",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 74,
"avg_line_length": 32.44117647058823,
"alnum_prop": 0.6128739800543971,
"repo_name": "jjohnson42/confluent",
"id": "0b3b0d16ef6673822cc4f0b12451dbc05237f35b",
"size": "... |
import os.path
import tornado
import tornado.auth
import markdown
import re
from gblog import config
from gblog import utils
from gblog.handlers.basehandler import BaseHandler
class HomeHandler(BaseHandler):
"""Handle URL '/'.
Subclass of BaseHandler and RequestHandler, support standard GET/POST
metho... | {
"content_hash": "485424ca8cce358b9929e252348053d2",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 80,
"avg_line_length": 33.71078431372549,
"alnum_prop": 0.5471862730841937,
"repo_name": "waterdrinker/gblog",
"id": "e37849d8d96a128f24e129fc9d48de03a1a8d7f6",
"size": "6... |
from common_fixtures import * # NOQA
from test_services_lb_ssl_balancer import validate_lb_services_ssl
UPGRADE_SUBDIR = os.path.join(os.path.dirname(os.path.realpath(__file__)),
'resources/upgrade')
pre_upgrade_stack_name = os.environ.get('PRE_UPGRADE_STACK_NAME')
post_upgrade_stack_na... | {
"content_hash": "91f1e5df55f954d1741ea2a30f570fa1",
"timestamp": "",
"source": "github",
"line_count": 440,
"max_line_length": 79,
"avg_line_length": 38.43636363636364,
"alnum_prop": 0.641438032166509,
"repo_name": "rancherio/validation-tests",
"id": "b74ca3057278af65f30c5affb71139e5b69d19b4",
"si... |
"""
WSGI config for wedding project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "wedding.settings")
from django.core.w... | {
"content_hash": "add4eaaba63ee197a0be6d2868667667",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 78,
"avg_line_length": 28.294117647058822,
"alnum_prop": 0.7920997920997921,
"repo_name": "jbinney/wedding",
"id": "e9f6877f9f6cdd674afdcfdabaf7c0ff6dea3315",
"size": "481"... |
"""simplest class chapter 27
"""
def list_attrs(item):
return [attr for attr in item.__dict__ if not attr.startswith('__')]
class rec: pass
rec.name = "Bob"
rec.age = 45
print(rec.name)
x = rec()
y = rec()
print(x.name, y.name)
x.name = "Sue"
print(rec.name, x.name, y.name)
print(list_attrs(rec))
print(list_... | {
"content_hash": "6086aa6a672bf373cd257306b5301667",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 72,
"avg_line_length": 16.125,
"alnum_prop": 0.6531007751937985,
"repo_name": "skellykiernan/pylearn",
"id": "418ff762c630a7cce8035793081615fb1323399e",
"size": "516",
"b... |
from time import sleep
def test_beta0():
sleep(5)
assert True
def test_beta1():
sleep(5)
assert True
def test_beta2():
sleep(5)
assert True
def test_beta3():
sleep(5)
assert True
def test_beta4():
sleep(5)
assert True
def test_beta5():
sleep(5)
assert True
d... | {
"content_hash": "99b8feb96259074c2278910c748250f5",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 22,
"avg_line_length": 10.058823529411764,
"alnum_prop": 0.5828460038986355,
"repo_name": "pytest-dev/pytest-xdist",
"id": "6782b19ea52a0633e54f3463be24665144e4ebb7",
"size... |
import sys
from xml.sax import make_parser, handler
class categoryHandler(handler.ContentHandler):
def __init__(self):
self.document = None
self.in_importants = False
def startElement(self, name, attrs):
if name=="document":
self.document = Document(attrs)
if name==... | {
"content_hash": "53a15499399d996acff6ebfe003ddf97",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 100,
"avg_line_length": 29.25,
"alnum_prop": 0.5837606837606838,
"repo_name": "mollstam/UnrealPy",
"id": "f9181f8f19670d99eb946ca26fd1500d41c60493",
"size": "2340",
"bina... |
"""Transformer pass that removes empty moments from a circuit."""
from typing import Optional, TYPE_CHECKING
from cirq.transformers import transformer_api, transformer_primitives
if TYPE_CHECKING:
import cirq
@transformer_api.transformer
def drop_empty_moments(
circuit: 'cirq.AbstractCircuit', *, context: O... | {
"content_hash": "202e8414515ab9094ff11d71681be014",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 98,
"avg_line_length": 31.066666666666666,
"alnum_prop": 0.6920600858369099,
"repo_name": "quantumlib/Cirq",
"id": "889dfe842530099a31c31d3dd8fad45e8b0d0a05",
"size": "1517... |
"""A menu item that opens a submenu."""
from typing import TYPE_CHECKING, Any, Optional
from cursesmenu.items.menu_item import MenuItem
if TYPE_CHECKING:
from cursesmenu.curses_menu import CursesMenu
else:
CursesMenu = Any
class SubmenuItem(MenuItem):
"""
A menu item that opens a submenu.
:par... | {
"content_hash": "7b4aebec0b0e1cca194ef60973639239",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 77,
"avg_line_length": 31.066666666666666,
"alnum_prop": 0.6051502145922747,
"repo_name": "pmbarrett314/curses-menu",
"id": "37a779cd170c218a6a7765eb7c7721f8e4e0b002",
"siz... |
"""
Organize a mess of dicoms by exam and series.
This is non-destructive regardless of the operation.
Example
-------
sort ./mess/of/dicoms into ./sort/path, and creates tarfiles of each in ./tar/path
.. code-block::bash
dicomsort.py tarsort ./mess/of/dicoms ./sort/path ./tar/path
get usage help
.. code-ex... | {
"content_hash": "fec5bffc6b7d0919cec7979417c14112",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 126,
"avg_line_length": 36.9080459770115,
"alnum_prop": 0.6431018374338212,
"repo_name": "scitran/utilities",
"id": "73e60f4af32325e1fbc987597bdfee1d1f29d822",
"size": "64... |
import os
def createHeaderDTOEntity(entity, directory):
fileName = entity.name + 'DTO.h'
file = open(os.path.join(directory, fileName), 'w+')
file.write('#import <CoreData/CoreData.h>')
file.write('\n')
for r in entity.relationships:
file.write('@class {en}DTO;'.format(en = r.entity.name))
... | {
"content_hash": "01f3fb4249fb529d5e298cadab1c8c3a",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 124,
"avg_line_length": 34.370370370370374,
"alnum_prop": 0.5589080459770115,
"repo_name": "denmorozov/DataTransferORM",
"id": "c8d76f8f1033f29debcc1699af53c259cee2b636",
"... |
import unittest
from tests import testlib
from splunklib import results
class TestCSC(testlib.SDKTestCase):
def test_eventing_app(self):
app_name = "eventing_app"
self.assertTrue(app_name in self.service.apps, msg="%s is not installed." % app_name)
# Fetch the app
app = self.ser... | {
"content_hash": "9de8e8faeb345477ccb2415c0295b2c0",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 109,
"avg_line_length": 37.412556053811656,
"alnum_prop": 0.6201606136881218,
"repo_name": "splunk/splunk-sdk-python",
"id": "b15574d1c8e1ca079d56f49cdff76629625d953b",
"s... |
from __future__ import print_function
import re
import sys
from operator import lt, gt, eq, le, ge
from os.path import (
abspath,
dirname,
join,
)
from distutils.version import StrictVersion
from setuptools import (
Extension,
find_packages,
setup,
)
class LazyCythonizingList(list):
cytho... | {
"content_hash": "0822a4fe4202ca4fc88f3bb339a562c1",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 79,
"avg_line_length": 28.375,
"alnum_prop": 0.5709251101321586,
"repo_name": "wubr2000/zipline",
"id": "1bcca3596005fe892438306354161997ed5da3ac",
"size": "6279",
"bina... |
import sys
import atrshmlog
result = atrshmlog.attach()
count = atrshmlog.get_prealloc_buffer_count()
print('prealloc count : ' + str(count) + ' : ')
oldid = atrshmlog.set_prealloc_buffer_count(42)
print('prealloc count : ' + str(oldid) + ' : ')
count = atrshmlog.get_prealloc_buffer_count()
print('prealloc count... | {
"content_hash": "ffa6e5e78357704401bf530f85683700",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 48,
"avg_line_length": 18.15625,
"alnum_prop": 0.6523235800344234,
"repo_name": "atrsoftgmbh/atrshmlog",
"id": "18a1184c4f40f2cbe3dfeff39137d707e03b07a2",
"size": "711",
... |
import _plotly_utils.basevalidators
class HovertemplatesrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="hovertemplatesrc", parent_name="funnelarea", **kwargs
):
super(HovertemplatesrcValidator, self).__init__(
plotly_name=plotly_name,
... | {
"content_hash": "136469bf3ee58ee0055ffc9b0edc890b",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 80,
"avg_line_length": 33.69230769230769,
"alnum_prop": 0.6255707762557078,
"repo_name": "plotly/plotly.py",
"id": "c0d020c9efecde4b7ab1178f32d4dca3c42df42a",
"size": "438"... |
try:
from my_func import print_hello
print_hello()
except ImportError as e:
print "Module my_func could not be found."
| {
"content_hash": "95e9552ad693635cb803f048f903e9a9",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 43,
"avg_line_length": 24.6,
"alnum_prop": 0.7398373983739838,
"repo_name": "LinuxFlyGuy/PFNE",
"id": "6af3cf5994f052c1f3572a54a57c8ea25a31ddf9",
"size": "146",
"binary": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.