text stringlengths 4 1.02M | meta dict |
|---|---|
import os
from util import run
from deepy.utils import GaussianInitializer
model_path = os.path.join(os.path.dirname(__file__), "models", "gaussian1.gz")
if __name__ == '__main__':
# I have to set std to be 0.1 in this case, or it will not convergence
run(GaussianInitializer(deviation=0.1), model_path) | {
"content_hash": "6081f72fd61f3339c9a69f80d98fad10",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 78,
"avg_line_length": 34.77777777777778,
"alnum_prop": 0.7028753993610224,
"repo_name": "dlacombejr/deepy",
"id": "fbf7d7bbb0028b7e6fcb0959c8a77a77e17b3793",
"size": "360",... |
from __future__ import unicode_literals
import io
import os
import re
import types
from datetime import datetime, timedelta
from unittest import TestCase
from django.core.exceptions import ValidationError
from django.core.validators import (
BaseValidator, EmailValidator, MaxLengthValidator, MaxValueValidator,
... | {
"content_hash": "3b19ea7dcc37fda461a54b6b047174f0",
"timestamp": "",
"source": "github",
"line_count": 360,
"max_line_length": 111,
"avg_line_length": 39.58888888888889,
"alnum_prop": 0.6230704462531574,
"repo_name": "marqueedev/django",
"id": "4be4b9de4f6577d4dbb7206e5e67eed36f072547",
"size": "1... |
'''
@author: rmahfoud
'''
import UrbanOperationsResearchBook.settings as settings
import UrbanOperationsResearchBook as uor
import os, re, shutil
import logging
logger = logging.getLogger(__name__)
class UORProblemsGenerator():
MISSING_CONTENT_FILE = "#"
current_indent = 0
def __init__(self, book, *args... | {
"content_hash": "204e2dafada2bd1081baa5cdc1adc532",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 106,
"avg_line_length": 44.35294117647059,
"alnum_prop": 0.5937223695844386,
"repo_name": "rmahfoud/UrbanOperationsResearchBook",
"id": "fde7bdeff2786676884114fbc29fcc97e57b2... |
import logging
logger = logging.getLogger("tdldk")
def set_log_level(level, handler=None):
""" Set both tdldk and Bambou log level to the given level
Args:
level (logging.level): a logging level
handler (logging.Handler): a logging handler
Notes:
if no handler ... | {
"content_hash": "7522cd17e76b050afcd50a4fb54b3e04",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 88,
"avg_line_length": 27.454545454545453,
"alnum_prop": 0.6534216335540839,
"repo_name": "little-dude/monolithe",
"id": "b2ccb0e81e7cf10a6f6ae1512b73e3a17c7e5be7",
"size":... |
"""
Memento pattern
http://code.activestate.com/recipes/413838-memento-closure/
The memento pattern is great for transaction-like processing. Having a handy implementation around might not be the worst thing.
"""
import copy
def Memento(obj, deep=False):
state = (copy.copy, copy.deepcopy)[bool(deep)](obj.__dict__)
... | {
"content_hash": "b877346d581b026b19cee6ba67a83b7c",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 128,
"avg_line_length": 22.482758620689655,
"alnum_prop": 0.6595092024539877,
"repo_name": "PoisonBOx/design-patterns",
"id": "3fdad76369e03b81657debbbcee041a2e1cf404f",
"s... |
from unittest.mock import patch, Mock
from remote_host_event_logging.public import RemoteHostEventLogger
from ..filesystem_mounting import FilesystemMountCommand
from ..device_identification import DeviceIdentificationCommand
from .utils import MigrationCommanderTestCase
class TestFilesystemMountCommand(MigrationC... | {
"content_hash": "b219cc5bdc8bc6c95ce4646e0c65c52d",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 88,
"avg_line_length": 35.310344827586206,
"alnum_prop": 0.5989583333333334,
"repo_name": "jdepoix/goto_cloud",
"id": "80ed64fdce9e1b564ee1842e39bc09c80184b169",
"size": "3... |
import boto.swf
import settings as settingsLib
import log
import json
import random
import os
import importlib
import time
import newrelic.agent
from provider import process
from optparse import OptionParser
import activity
from activity.activity import activity as activitybase
# Add parent directory for imports, so a... | {
"content_hash": "9167aa226d84236feb4e39443004a6ae",
"timestamp": "",
"source": "github",
"line_count": 245,
"max_line_length": 149,
"avg_line_length": 39.21632653061224,
"alnum_prop": 0.5678601165695254,
"repo_name": "jhroot/elife-bot",
"id": "4955f2c8d44f9d10690cb6e2c85912704c61b17d",
"size": "96... |
import os
import ycm_core
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-DMUDUO_STD_STRING'
'-Wall',
'-Wextra',
#'-Werror',
#'-Wc++98-compat',
'-Wn... | {
"content_hash": "4fa25024671b91d9397b25ef3969593d",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 80,
"avg_line_length": 33.25547445255474,
"alnum_prop": 0.6830553116769096,
"repo_name": "liuluheng/levmu",
"id": "8f9ec3f586cc79f9fe453c840df719274b4198a1",
"size": "5956... |
import re
import json
import requests
from datetime import date
from bs4 import BeautifulSoup
class SorosCrawler(object):
'''This object is a crawler that
-opens the website
-gets all links from it
-picks out the links that have "soros" in them
To instantiate the object provide a n... | {
"content_hash": "8419806bf0c8c63c6442835544189941",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 93,
"avg_line_length": 34.666666666666664,
"alnum_prop": 0.5558510638297872,
"repo_name": "analphagamma/SorosTracker9000",
"id": "49af1ea769c43dab6e9bbf552d605d52e90120a7",
... |
"""
Various utilities.
"""
import bz2, gzip
def open_compressed( filename, mode='r' ):
if filename.endswith( ".bz2" ):
return bz2.BZ2File( filename, mode )
elif filename.endswith( ".gz" ):
return gzip.GzipFile( filename, mode )
else:
return file( filename, mode )
| {
"content_hash": "2ab4a286a91511732004d7acea9c00f3",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 46,
"avg_line_length": 23.23076923076923,
"alnum_prop": 0.6158940397350994,
"repo_name": "bxlab/HiFive_Paper",
"id": "94a3b1341901484c8677fe940dce9cd0b3690028",
"size": "30... |
""" --- Day 6: Probably a Fire Hazard ---
Because your neighbors keep defeating you in the holiday house
decorating contest year after year,
you've decided to deploy one million lights in a 1000x1000 grid.
Furthermore, because you've been especially nice this year,
Santa has mailed you instructions
on how to display ... | {
"content_hash": "d5159ea276c4882248f6e9a9f8d09a41",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 75,
"avg_line_length": 35.84375,
"alnum_prop": 0.7058994478349317,
"repo_name": "coolharsh55/advent-of-code",
"id": "62b738ee108794b8ea8731d15407b7272826b1ec",
"size": "348... |
from django.db import models
from tests.default_app.models import BaseType
class Type(BaseType):
code = models.SlugField()
| {
"content_hash": "1fad00e8d47d3aa3f5f3fccb10406aa6",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 45,
"avg_line_length": 21.5,
"alnum_prop": 0.7674418604651163,
"repo_name": "jproffitt/django-swappable-models",
"id": "b704e64fc3789c5e6ef2f790fde52dfa6a943d61",
"size": "1... |
import unittest
import os
import stat
import random
import shutil
import sys
import py_compile
import warnings
import marshal
import imp
from test.test_support import (unlink, TESTFN, unload, run_unittest,
check_warnings, TestFailed)
def remove_files(name):
for f in (name + os.extsep + "py",
nam... | {
"content_hash": "ed51f640eda22bb3ade33c0dfce903e2",
"timestamp": "",
"source": "github",
"line_count": 438,
"max_line_length": 84,
"avg_line_length": 36.42009132420091,
"alnum_prop": 0.5576730190571715,
"repo_name": "DecipherOne/Troglodyte",
"id": "60346ab9fc82f38d9f55a888f7e1550deda14a2e",
"size"... |
from .user_base import UserBase
class UserUpdateParameters(UserBase):
"""Request parameters for updating an existing work or school account user.
:param immutable_id: This must be specified if you are using a federated
domain for the user's userPrincipalName (UPN) property when creating a new
user ... | {
"content_hash": "910e75842e46edc9f673c240e80b7116",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 220,
"avg_line_length": 52.672413793103445,
"alnum_prop": 0.6762684124386252,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "1c2ac71132a79951ae12521bc9411ab95f904ecf"... |
import json
import pathlib
import pytest
from ..figshare import extract_data
FIXTURES_DIR = '{}/fixtures'.format(pathlib.Path(__file__).parent)
@pytest.fixture
def json_content():
with open('{}/figshare_1.json'.format(FIXTURES_DIR)) as f:
content = f.read()
return json.loads(content)
def test_ext... | {
"content_hash": "0dd9a77eeead02fbc50aefd87af871b5",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 88,
"avg_line_length": 25.633333333333333,
"alnum_prop": 0.647594278283485,
"repo_name": "TailorDev/pauling",
"id": "ee591644c40e0f63c0e0999ebc9c0519953d2581",
"size": "769... |
import logging
import urllib
from flask import redirect, g, abort
from flask import Blueprint
from google.appengine.api import urlfetch
from sparkprs import app
from sparkprs.models import Issue
jenkins = Blueprint('jenkins', __name__)
@jenkins.route("/trigger-jenkins/<int:number>", methods=['GET', 'POST'])
def t... | {
"content_hash": "f257f53687cb60150536961979dac708",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 128,
"avg_line_length": 46.53703703703704,
"alnum_prop": 0.6768802228412256,
"repo_name": "databricks/spark-pr-dashboard",
"id": "90bfa939f11853374fa229ce00b8bda11de59d10",
... |
from __future__ import division
from datetime import datetime
from vistrails.core.system import strftime, time_strptime
from vistrails.db.domain import DBMashupActionAnnotation
class ActionAnnotation(DBMashupActionAnnotation):
def __init__(self, id, action_id, key=None, value=None, user=None, date=None):
... | {
"content_hash": "10f919830d856973d712cbcc7b2e276f",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 82,
"avg_line_length": 36.83561643835616,
"alnum_prop": 0.5583860171067311,
"repo_name": "hjanime/VisTrails",
"id": "0be6a3661e1f40fea9581381f0c7f9d3221fa082",
"size": "72... |
import unittest
from troposphere import Join
from troposphere.apigateway import GatewayResponse, Model
class TestModel(unittest.TestCase):
def test_schema(self):
# Check with no schema
model = Model(
"schema",
RestApiId="apiid",
)
model.validate()
... | {
"content_hash": "8ce57556405c2d223a7be1c2471d72b5",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 67,
"avg_line_length": 27.01388888888889,
"alnum_prop": 0.5295629820051414,
"repo_name": "cloudtools/troposphere",
"id": "56f703caa6125e5d9dc56ddace428dbf13cd0960",
"size":... |
import os
from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager
from flask_httpauth import HTTPTokenAuth
from flask.ext.cors import CORS
app = Flask(__name__, static_folder='static')
cors = CORS(app, resources={r"/api/*": {"origins":"*"}})
app.config.from_object('... | {
"content_hash": "42baf30337f93f3ac5c6549819c1cb97",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 56,
"avg_line_length": 28.4375,
"alnum_prop": 0.7472527472527473,
"repo_name": "cmput404wi16/metablog-project",
"id": "04162af9e075badd1313bc962b861af24a489615",
"size": "4... |
from __future__ import absolute_import
import string
from telemetry.internal.actions import page_action
# Map from DOM key values
# (https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) to
# Windows virtual key codes
# (https://cs.chromium.org/chromium/src/third_party/WebKit/Source/platform/WindowsKey... | {
"content_hash": "f373fccdcd0055722ea87ef08d7c802b",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 98,
"avg_line_length": 31.1981981981982,
"alnum_prop": 0.6635864857060352,
"repo_name": "catapult-project/catapult",
"id": "34262885306cb10b5adceb46f3ec39e0461a3a9c",
"siz... |
import ConfigParser
import os
import sys
import string
import optparse
import traceback
import collections
import copy
from operator import attrgetter
try:
import bzrlib
except:
import platform
if platform.uname()[0] == 'Darwin':
sys.path.append('/Library/Python/2.6/site-packages')
import bz... | {
"content_hash": "9e3d98a61bccf7fcaaae7213d96b116e",
"timestamp": "",
"source": "github",
"line_count": 846,
"max_line_length": 191,
"avg_line_length": 40.28605200945626,
"alnum_prop": 0.5858811102634822,
"repo_name": "perfectsearch/sandman",
"id": "c0a35be00acbce57eb1425a60619a6de05d8924b",
"size"... |
import warnings
from typing import Callable, Dict, Optional, Sequence, Tuple, Union
from google.api_core import grpc_helpers
from google.api_core import operations_v1
from google.api_core import gapic_v1
import google.auth # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from googl... | {
"content_hash": "e676731891e5a3123409dd9878428764",
"timestamp": "",
"source": "github",
"line_count": 555,
"max_line_length": 108,
"avg_line_length": 44.34234234234234,
"alnum_prop": 0.6229175132060139,
"repo_name": "googleapis/python-dialogflow",
"id": "0e230676b8d26016874e8b6c7156f04712aa24ef",
... |
import sphinx_rtd_theme
from sqlitebiter import __author__, __copyright__, __name__, __version__
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as ... | {
"content_hash": "9565b46b740932bca8c9400f7c040874",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 80,
"avg_line_length": 32.51459854014598,
"alnum_prop": 0.7027724772701762,
"repo_name": "thombashi/sqlitebiter",
"id": "b65dae145d3725d0c72d74b029b349a97edfba40",
"size":... |
from __future__ import unicode_literals
import re
from yepes.utils.minifier import minify_css, minify_js
__all__ = ('HtmlMinifier', 'minify')
PLACEHOLDER = '~({{[{0}]}})~'
COMMENTS_RE = re.compile(r'<!--.*?-->', re.DOTALL)
CONDITIONAL_COMMENTS_RE = re.compile(r'(<!--\[[^\]]+\]>)(.*?)(<!\[[^\]]+\]-->)', re.DOTALL)... | {
"content_hash": "fda7adeb5eac611a60d3491fe401afdb",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 91,
"avg_line_length": 32.43037974683544,
"alnum_prop": 0.5901639344262295,
"repo_name": "samuelmaudo/yepes",
"id": "7dd02a3e19494c166252e0d8b488b0dff014b6c5",
"size": "51... |
import paramiko
import io
import socket
import stat
import threading
from .. import base
from girder.api import sftp
from girder.models.collection import Collection
from girder.models.folder import Folder
from girder.models.upload import Upload
from girder.models.user import User
server = None
TEST_PORT = 10551
TEST_... | {
"content_hash": "2d19176ab79123710eed50dd9114083b",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 98,
"avg_line_length": 40.1566265060241,
"alnum_prop": 0.6745674567456745,
"repo_name": "RafaelPalomar/girder",
"id": "e7683f563aaee42a2a46657d6b0180f873245345",
"size": "... |
import sys
from pybindgen import param, retval
from dune.pymor.core import prepare_python_bindings, inject_lib_dune_pymor, finalize_python_bindings
from dune.pymor.discretizations import inject_StationaryDiscretizationImplementation
def inject_Example(module):
'''injects the user code into the module'''
name... | {
"content_hash": "bd2f2b4b488ad55a533f11e85811635b",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 125,
"avg_line_length": 49.810810810810814,
"alnum_prop": 0.7173087357569181,
"repo_name": "pymor/dune-pymor",
"id": "60d4e30e49b2d1bfd76fe040a00bb6e35675e11b",
"size": "20... |
from quantum.api.v2 import attributes
from quantum.common import exceptions as qexception
class PortSecurityPortHasSecurityGroup(qexception.InUse):
message = _("Port has security group associated. Cannot disable port "
"security or ip address until security group is removed")
class PortSecurityA... | {
"content_hash": "efddd14863dcd88aad2727576b6e7480",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 74,
"avg_line_length": 29.936507936507937,
"alnum_prop": 0.6214209968186638,
"repo_name": "tpaszkowski/quantum",
"id": "85b83ccbdf5cadeb753c6a5bc0af9bfeddc7fd4a",
"size": "... |
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from toontown.battle.BattleProps import *
from direct.distributed.ClockDelta import *
from direct.showbase.PythonUtil import Functor
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from direct.fsm import FSM
from direct.... | {
"content_hash": "2cd5bdec68d0cf3ee6f8f3fc45b927e6",
"timestamp": "",
"source": "github",
"line_count": 1284,
"max_line_length": 325,
"avg_line_length": 42.835669781931465,
"alnum_prop": 0.640733804839912,
"repo_name": "ksmit799/Toontown-Source",
"id": "09c05b132b55184b8e0672c07ecab5541f3cbed3",
"s... |
from __future__ import print_function
import sys
import vtk
from vtk.test import Testing
def load_geojson(input_string, feature_properties={}):
'''Parses input_string with vtkGeoJSONReader, returns vtkPolyData
feature_properties is a dictionary of name-default_values
to attach as cell data in the ret... | {
"content_hash": "a6bd86a38a53d9fd5ccbcd20f10921e6",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 77,
"avg_line_length": 31.04724409448819,
"alnum_prop": 0.585087496829825,
"repo_name": "hlzz/dotfiles",
"id": "2313c61d532a3c71f5d5111af8cec43746ecd768",
"size": "3943",
... |
"""
Base object supporting the storage of custom fields as attributes
"""
from __future__ import unicode_literals
import sys
class TroveboxObject(object):
""" Base object supporting the storage of custom fields as attributes """
_type = "None"
def __init__(self, client, json_dict):
self.id = None
... | {
"content_hash": "cf8ce7f9f4ef79510ce3fdd76801f535",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 77,
"avg_line_length": 30.772727272727273,
"alnum_prop": 0.5376661742983752,
"repo_name": "photo/openphoto-python",
"id": "bd525822a4452dd3503fcde00acb63c0852d44e9",
"size"... |
import requests
from bs4 import BeautifulSoup
import processor
from datetime import datetime
def parse( url ):
r = requests.get( url )
if r.status_code == 404:
return processor.create_dictionary('', url, r.status_code, [u''], [u''], u'', u'', u'', u'', [u''], [u''])
r.encoding = 'UTF-8'
soup = BeautifulSoup( r... | {
"content_hash": "e136510da9fddd4e27f200b7f24babcb",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 196,
"avg_line_length": 47.44736842105263,
"alnum_prop": 0.6860787576261785,
"repo_name": "HIIT/mediacollection",
"id": "805f83fecffdb8d384b92ae1fc2420eb8c1602a5",
"size": ... |
"""
AAFigure directive for reStructuredText.
This is open source software under the BSD license. See LICENSE.txt for more
details.
"""
from aafigure import process, render, UnsupportedFormatError, AsciiArtImage
| {
"content_hash": "c74694addec27586e2100fdab74e2449",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 76,
"avg_line_length": 26.625,
"alnum_prop": 0.8028169014084507,
"repo_name": "garyvdm/aafigure",
"id": "81e72dc4fd781476e91a8b5dfe3b185d6f9c469b",
"size": "213",
"binary"... |
'''
I really hate repeating myself. These are helpers that avoid typing the
whole thing over and over when implementing additional template tags
They help implementing tags of the following forms::
{% tag as var_name %}
{% tag of template_var as var_name %}
{% tag of template_var as var_name arg1,arg2,kwa... | {
"content_hash": "8f6c73949d2c16310ca78d16fa32909a",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 117,
"avg_line_length": 31.91860465116279,
"alnum_prop": 0.5876138433515483,
"repo_name": "hgrimelid/feincms",
"id": "2e4a849f9f63dcb2c9a3815ffcc9edc38e49871a",
"size": "5... |
from test import support
import unittest
import xdrlib
class XDRTest(unittest.TestCase):
def test_xdr(self):
p = xdrlib.Packer()
s = b'hello world'
a = [b'what', b'is', b'hapnin', b'doctor']
p.pack_int(42)
p.pack_uint(9)
p.pack_bool(True)
p.pack_bool(Fals... | {
"content_hash": "89246a97c926ef6db5ed1f49b9f9dd9d",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 72,
"avg_line_length": 27.232142857142858,
"alnum_prop": 0.5875409836065574,
"repo_name": "MalloyPower/parsing-python",
"id": "073448ccee7588bd91c10f369f93126a170c6435",
"s... |
"""
cclib (http://cclib.sf.net) is (c) 2006, the cclib development team
and licensed under the LGPL (http://www.gnu.org/copyleft/lgpl.html).
gmagoon 4/5/10-4/6/10 (this notice added 4/29/10): Gregory Magoon modified this file from cclib 1.0
"""
__revision__ = "$Revision: 863 $"
# These import statements are a... | {
"content_hash": "0f0a0e1a4ba2b7b52dacd5770cb68c2c",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 99,
"avg_line_length": 31.20689655172414,
"alnum_prop": 0.7325966850828729,
"repo_name": "connie/RMG-Java",
"id": "8ebbfcf82b8b976d59b03768e12ea6087984097a",
"size": "905",... |
"""
The sequence of triangle numbers is generated by adding the natural numbers.
So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be:
1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...
Let us list the factors of the first seven triangle numbers:
1: 1
3: 1,3
6: 1,2,3,6
10: 1,2,5,... | {
"content_hash": "4db9f75d54dcbabaf407d902d0ba41ed",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 97,
"avg_line_length": 26.508474576271187,
"alnum_prop": 0.5927109974424553,
"repo_name": "hickeroar/project-euler",
"id": "fb9707cb2e3b896dae4dba49648518330b4a84e6",
"size... |
import maya.cmds as cmds
import maya.mel as mel
import maya.OpenMayaUI as OpenMayaUI
import os
from PySide import QtGui
import cvwrap.bindui
NAME_WIDGET = 'cvwrap_name'
RADIUS_WIDGET = 'cvwrap_radius'
NEW_BIND_MESH_WIDGET = 'cvwrap_newbindmesh'
BIND_FILE_WIDGET = 'cvwrap_bindfile'
MENU_ITEMS = []
def create_menuitem... | {
"content_hash": "fd7081cf6ae9ed9a3538d6dbc3b80a05",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 99,
"avg_line_length": 42.7551867219917,
"alnum_prop": 0.6134510869565217,
"repo_name": "AtonLerin/cvwrap",
"id": "c7678b02e9189edd22fe913feec83ca1e7583f29",
"size": "1030... |
import time
import secret
from datetime import datetime
from evernote.edam.notestore import NoteStore
from evernote.api.client import EvernoteClient
from evernote.edam.limits import constants
class Post(object):
"""A blog post's meta
Attributes:
title:
created:
updated:
guid:... | {
"content_hash": "f4a393986abe8ef9afb14d93e7c7d91b",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 94,
"avg_line_length": 31.202380952380953,
"alnum_prop": 0.5940480732544831,
"repo_name": "ccreimondo/sweets",
"id": "a9a6604eece4627319d59ffe49f3a1ba0db5aefc",
"size": "5... |
"""Base Entity for all TelldusLive entities."""
from datetime import datetime
import logging
from tellduslive import BATTERY_LOW, BATTERY_OK, BATTERY_UNKNOWN
from homeassistant.const import (
ATTR_BATTERY_LEVEL,
ATTR_MANUFACTURER,
ATTR_MODEL,
ATTR_VIA_DEVICE,
DEVICE_DEFAULT_NAME,
)
from homeassist... | {
"content_hash": "b33c9b890927823c2ca7efb947a2d1c7",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 72,
"avg_line_length": 30.528985507246375,
"alnum_prop": 0.6154759079041063,
"repo_name": "home-assistant/home-assistant",
"id": "9e0bf7e96932eb4caa579bfe440c4b21f9661b27",
... |
from __future__ import absolute_import
from sunpy.data._sample import download_sample_data
__author__ = "Steven Christe"
__email__ = "steven.christe@nasa.gov"
| {
"content_hash": "b47f2f4c2b6cd5733480881ebb9bea0b",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 51,
"avg_line_length": 23.142857142857142,
"alnum_prop": 0.7222222222222222,
"repo_name": "Alex-Ian-Hamilton/sunpy",
"id": "223a28530bf93c0233b27d89a07bd218765c45f1",
"size"... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('frog', '0013_siteconfig_squashed_0016_remove_siteconfig_site_url'),
]
operations = [
migrations.AlterField(
model_name='siteconfig',
... | {
"content_hash": "70e4fc30d8557f4aa9a261f7cc410f6a",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 77,
"avg_line_length": 26.652173913043477,
"alnum_prop": 0.5889070146818923,
"repo_name": "theiviaxx/Frog",
"id": "c96d873f21f920b23c194b612c1719cbb168fff8",
"size": "687",... |
import re
import os.path
import _common
from _common import unittest
import helper
from helper import control_stdin
from beets.mediafile import MediaFile
class TestHelper(helper.TestHelper):
def tagged_copy_cmd(self, tag):
"""Return a conversion command that copies files and appends
`tag` to the... | {
"content_hash": "b98d0718e6ece5278a44655965b1ebf2",
"timestamp": "",
"source": "github",
"line_count": 212,
"max_line_length": 80,
"avg_line_length": 35.2122641509434,
"alnum_prop": 0.5795043536503683,
"repo_name": "bj-yinyan/beets",
"id": "8b3ec279a409334f8e1a1a55864ad371d0b3bb93",
"size": "8113"... |
import os, re, tempfile, subprocess #, sys, datetime, zipfile
# Location of the source file that defines the current version
VERSION_FILE = '../src/com/caverock/androidsvg/SVG.java'
# Version regex
VERSION_RE = '\sVERSION\s*=\s*"([\d.]+)"'
# Source pom file
ORIG_POM_FILE = 'src-pom.xml'
# Regex for finding the pl... | {
"content_hash": "9425cde96fdd858c91a73b40264aa876",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 83,
"avg_line_length": 23.61061946902655,
"alnum_prop": 0.6731634182908546,
"repo_name": "abid-mujtaba/fetchheaders-android",
"id": "baf79944c148c25f2de16f551bbaea90a27ba48a... |
from PyCA.Core import *
import PyCA.Common as common
import PyCA.Display as display
import numpy as np
import matplotlib.pyplot as plt
import os, errno
def GreedyReg\
(I0Orig, \
I1Orig, \
scales = [1], \
nIters = [1000], \
ustep = [0.25], \
fluidParams = [0.1, 0.... | {
"content_hash": "a70326915fa623c41cc1c8a26dadb0bd",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 69,
"avg_line_length": 26.689839572192515,
"alnum_prop": 0.5301542776998598,
"repo_name": "rkwitt/quicksilver",
"id": "506005c840065b1eebdc94dad0fb10c76b2bf355",
"size": "... |
"""
@brief test log(time=12s)
"""
import os
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.ipythonhelper import test_notebook_execution_coverage
from pyquickhelper.pycode import add_missing_development_version, ExtTestCase
import ensae_teaching_cs
class TestNotebookCov_Session9_1a(Ex... | {
"content_hash": "b6ce587fa46a9720ce53c8c4691a76e0",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 89,
"avg_line_length": 33,
"alnum_prop": 0.5909090909090909,
"repo_name": "sdpython/ensae_teaching_cs",
"id": "4b96470cbc9c948bcf4e7ca803c242656ddd3e96",
"size": "1080",
... |
from .statement import Statement
from .signature import Signature
| {
"content_hash": "866cd656d65329cccb20ca76ed67ebf3",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 32,
"avg_line_length": 22.333333333333332,
"alnum_prop": 0.835820895522388,
"repo_name": "akfork/ChatterBot",
"id": "f7789a019fa29fd04ceff1809f5374565e70f0a6",
"size": "67",... |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_... | {
"content_hash": "c2c6ed3649b937e8e698a7f824bc8dba",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 113,
"avg_line_length": 27.143939393939394,
"alnum_prop": 0.6857382082054144,
"repo_name": "benfinke/ns_python",
"id": "0620cfab75b4e5795a2418175de67b5c989f9283",
"size": ... |
"""Tests for the creator dashboard and the notifications dashboard."""
from core.controllers import creator_dashboard
from core.domain import event_services
from core.domain import exp_services
from core.domain import feedback_domain
from core.domain import feedback_services
from core.domain import rating_services
fro... | {
"content_hash": "74a9dfe068055d3eb44cce8b2946a800",
"timestamp": "",
"source": "github",
"line_count": 695,
"max_line_length": 79,
"avg_line_length": 41.325179856115106,
"alnum_prop": 0.6455206991400021,
"repo_name": "AllanYangZhou/oppia",
"id": "99f5225395b52110e078a3885395240f8c95cbd4",
"size": ... |
"""Google Cloud Dataproc Authenticator for Sparkmagic"""
import json
import os
import subprocess
import re
import random
import urllib3.util
from hdijupyterutils.ipythondisplay import IpythonDisplay
import ipyvuetify as v
from google.cloud import dataproc_v1beta2
import google.auth.transport.requests
from google.auth... | {
"content_hash": "6604fd22afe5b778f104e84e523956ea",
"timestamp": "",
"source": "github",
"line_count": 534,
"max_line_length": 122,
"avg_line_length": 45.00561797752809,
"alnum_prop": 0.605126284691882,
"repo_name": "GoogleCloudDataproc/dataprocmagic",
"id": "09758b3b66adec674566ed6835d1b4e256cfb765... |
import gzip
import protolib
import sys
# Import the packet proto definitions. If they are not found, attempt
# to generate them automatically. This assumes that the script is
# executed from the gem5 root.
try:
import packet_pb2
except:
print "Did not find packet proto definitions, attempting to generate"
... | {
"content_hash": "327c3cc7502d65622129c238639796eb",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 80,
"avg_line_length": 30.474747474747474,
"alnum_prop": 0.5777262180974478,
"repo_name": "bxshi/gem5",
"id": "e6f36c295afa0cc562a37a098b2568bcd5131c9a",
"size": "5582",
... |
import datetime
from django.db import models
from django.contrib.auth.models import User
from django import forms
from django.conf import settings
def sign(i):
if i > 0: return 1
elif i < 0: return -1
return 0
class Userdata(models.Model):
user = models.OneToOneField(User)
team = models.CharFiel... | {
"content_hash": "df788920c43ddb0785a0e098eeddc3d7",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 109,
"avg_line_length": 33.12244897959184,
"alnum_prop": 0.5567878414458821,
"repo_name": "ugoertz/tippspiel",
"id": "daa18a4ebc0e12f90f693905aef586e9288bf3b8",
"size": "4... |
import contextlib
import dataclasses
import re
import os
from typing import Any, Callable, List, Optional, Sequence, Tuple
from absl.testing import absltest
from absl import logging
import jax
from jax import dtypes
from jax import numpy as jnp
from jax._src import test_util as jtu
from jax import tree_util
from ja... | {
"content_hash": "79cba0f54ef5375bd055f63dcbb50d33",
"timestamp": "",
"source": "github",
"line_count": 470,
"max_line_length": 134,
"avg_line_length": 41.86808510638298,
"alnum_prop": 0.629992885455839,
"repo_name": "google/jax",
"id": "cdf8cc07561598515808f7d2140572b1a5948a19",
"size": "20260",
... |
import unittest
import os
from test.aiml_tests.client import TestClient
from programy.config.brain import BrainFileConfiguration
class UtiltyTestClient(TestClient):
def __init__(self):
TestClient.__init__(self)
def load_configuration(self, arguments):
super(UtiltyTestClient, self).load_confi... | {
"content_hash": "a29528714c7b07e49bb3ff43a6f2561a",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 126,
"avg_line_length": 35.083333333333336,
"alnum_prop": 0.7268408551068883,
"repo_name": "CHT5/program-y",
"id": "6e6b86427531635c6b6ef299bbcac004a7e2bb17",
"size": "842"... |
import 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 'Request.current'
db.add_column('server_request', 'current',
self.gf('django.db.models.fields.B... | {
"content_hash": "c69a5feb74a5ca6fde9c66248208b79f",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 182,
"avg_line_length": 67.6219512195122,
"alnum_prop": 0.5538322813345357,
"repo_name": "eahrold/Crypt-Server",
"id": "6c5140991ba95a3d9b2d15e3d214682693795f35",
"size": "... |
import logging
import os
from pants.backend.codegen.protobuf.subsystems.protoc import Protoc
from pants.base.workunit import WorkUnitLabel
from pants.scm.git import Git
from pants.subsystem.subsystem import Subsystem, SubsystemError
from pants.util.dirutil import safe_mkdir
from pants.util.memo import memoized_method
... | {
"content_hash": "dcf50369db63ee77b3cd23dfd1c97c1f",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 89,
"avg_line_length": 33,
"alnum_prop": 0.6209987195902689,
"repo_name": "wisechengyi/pants",
"id": "92a58b14a1633c0f9119a5cfa6af829edd070f4a",
"size": "2475",
"binary":... |
from __future__ import absolute_import
import django.test
from django import template
try:
from django.utils import unittest
except ImportError: # Django >= 1.9
import unittest
from ..templatetags import faqtags
from ..models import Topic
class FAQTagsSyntaxTests(unittest.TestCase):
"""
Tests for the... | {
"content_hash": "f75a888cccd8cbee6a561e777df2b85e",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 95,
"avg_line_length": 41.16438356164384,
"alnum_prop": 0.5760399334442595,
"repo_name": "revsys/django-fack",
"id": "fc711314dbfb6dbd76b1143abfd8b582b1f7f7a5",
"size": "6... |
from tools.load import LoadMatrix
from numpy import random
lm=LoadMatrix()
random.seed(17)
ground_truth = lm.load_labels('../data/label_train_multiclass.dat')
predicted = lm.load_labels('../data/label_train_multiclass.dat') * 2
parameter_list = [[ground_truth,predicted]]
def evaluation_multiclassaccuracy (ground_tru... | {
"content_hash": "536807b92c5695f7e51c83aac45579fa",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 68,
"avg_line_length": 27.48148148148148,
"alnum_prop": 0.7735849056603774,
"repo_name": "besser82/shogun",
"id": "aef31f603920f134b5e0a034202ceafa834469d0",
"size": "764",... |
from __future__ import print_function
from bcc import BPF
from time import sleep, strftime
import argparse
# arguments
examples = """examples:
./zfsdist # show operation latency as a histogram
./zfsdist -p 181 # trace PID 181 only
./zfsdist 1 10 # print 1 second summaries, 10 times
... | {
"content_hash": "464684e434885fec0f4c8f520ae93c78",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 76,
"avg_line_length": 28.335260115606935,
"alnum_prop": 0.653406772745818,
"repo_name": "mcaleavya/bcc",
"id": "6b29b99baddf8cee4bdc30dc993b35e34f807aa4",
"size": "5258",... |
"""Enum backports from standard lib."""
from __future__ import annotations
from enum import Enum
from typing import Any, TypeVar
T = TypeVar("T", bound="StrEnum")
class StrEnum(str, Enum):
"""Partial backport of Python 3.11's StrEnum for our basic use cases."""
def __new__(cls: type[T], value: str, *args: ... | {
"content_hash": "78df15421ba00252cf300d1ac943cf29",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 112,
"avg_line_length": 34.09090909090909,
"alnum_prop": 0.6151111111111112,
"repo_name": "GenericStudent/home-assistant",
"id": "21302fe9f7ba4f15e6b306c7b85997b19a77fb12",
... |
from __future__ import unicode_literals
import weakref
import logging
from ..transport import Transport
from ..exceptions import NotFoundError, TransportError
from ..compat import string_types, urlparse
from .indices import IndicesClient
from .cluster import ClusterClient
from .cat import CatClient
from .nodes import ... | {
"content_hash": "0d42f74ba16e3f6870bcb599608bf3f5",
"timestamp": "",
"source": "github",
"line_count": 1365,
"max_line_length": 103,
"avg_line_length": 51.372893772893775,
"alnum_prop": 0.6394101876675603,
"repo_name": "control-center/serviced",
"id": "304e11cd71f181e85e497c5bdf4be5829072970c",
"s... |
from slippymapper import *
from layer import SlippyLayer
| {
"content_hash": "3368d75eba3f96f8d8fedf2797ab458b",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 29,
"avg_line_length": 28.5,
"alnum_prop": 0.8421052631578947,
"repo_name": "awmartin/spatialpixel",
"id": "6364ca493fb79da7ed0d36a233373955242d7ec8",
"size": "57",
"binar... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'ModuleStat.value'
db.alter_column('bigbrother_modulestat', 'value', self.gf('django.db.models.fields.Decim... | {
"content_hash": "982be976bb986eefa3ffae2c034a61cb",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 139,
"avg_line_length": 37.06666666666667,
"alnum_prop": 0.6097122302158273,
"repo_name": "anderspetersson/django-bigbrother",
"id": "3521e1d4685ac7fa93c59429a3b887d52ef549ff... |
__author__ = 'briannelson'
from SID.Utilities import ConfigUtility
from SIDClient.Controllers import SendToSidWatchServerController
config = ConfigUtility.load('./Config/sidwatch.cfg')
controller = SendToSidWatchServerController(config)
controller.start()
| {
"content_hash": "4d125318e32e7f28ebd308eba21270a2",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 64,
"avg_line_length": 23.727272727272727,
"alnum_prop": 0.8160919540229885,
"repo_name": "SidWatch/pySIDWatch",
"id": "38abcf3dd2684bcab03a68090450ac61474ed10c",
"size": "... |
from google.cloud import aiplatform
# [START aiplatform_sdk_endpoint_predict_sample]
def endpoint_predict_sample(
project: str, location: str, instances: list, endpoint: str
):
aiplatform.init(project=project, location=location)
endpoint = aiplatform.Endpoint(endpoint)
prediction = endpoint.predict... | {
"content_hash": "08bd182c86b276a36b6f257703b984a7",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 63,
"avg_line_length": 25.647058823529413,
"alnum_prop": 0.7522935779816514,
"repo_name": "sasha-gitg/python-aiplatform",
"id": "98b7450c5109f337c77803c3b92caaaf10cab153",
... |
import datetime
import time
import random
import pickle
from datetime import date
import json
from collections import deque
import torch
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
from tensorboard_logger import configure, log_value
from loveletter.env import Lov... | {
"content_hash": "2351bf4471cf7291c78f4f61e783ab37",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 100,
"avg_line_length": 36.81203007518797,
"alnum_prop": 0.5680147058823529,
"repo_name": "user01/love-letter",
"id": "ab4959e7a6f85e486bef2aa3a05ce55dbcad3209",
"size": "... |
from __future__ import print_function
import numpy as np
import imutils
import cv2
import sys
def main(passwd):
cap = cv2.VideoCapture('rtsp://admin:'+passwd+'@192.168.1.100:554')
cap.set(cv2.CAP_PROP_FPS,10)
print("video", cap.isOpened())
while(cap.isOpened()):
# Capture frame-by-frame
... | {
"content_hash": "864bc216ed53ad9db673a5a8a8e102c0",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 71,
"avg_line_length": 25.555555555555557,
"alnum_prop": 0.592391304347826,
"repo_name": "squeakus/motiontracker",
"id": "9ca3e8490531fe18dd1f0eb047d7cd151a29a571",
"size":... |
"""this is a version of the fileserver that works with wsgi (eg. gunicorn)"""
import os
import os.path
import urllib
import urlparse
import sys
import logging
from random import choice, randint
import string
import fcntl
logger = logging.getLogger("gunicorn.error")
DEBUG=True
# if we're debugging stuff, we log stack... | {
"content_hash": "c25361f8148878b48910bdd1a90a3e6a",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 88,
"avg_line_length": 29.203389830508474,
"alnum_prop": 0.6584445734184562,
"repo_name": "mpi-sws-rse/datablox",
"id": "2cbda0e104b69355967974f1e0368016680b2402",
"size":... |
"""
display all images in a directory as thumbnail image buttons that display
the full image when clicked; requires PIL for JPEGs and thumbnail image
creation; to do: add scrolling if too many thumbs for window!
"""
import os, sys, math
from Tkinter import *
from PIL import Image # <== req... | {
"content_hash": "56ad145ad60fc12de02254f07125c4cc",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 82,
"avg_line_length": 43.44318181818182,
"alnum_prop": 0.5932513732670678,
"repo_name": "gmnamra/python-image-utils",
"id": "88c973b4597f6545a49e5837bbe030d0d919a956",
"si... |
import sys
import numpy as np
import ast
import inspect
import operator
import types as pytypes
from contextlib import contextmanager
from copy import deepcopy
import numba
from numba import njit, stencil
from numba.core.utils import PYVERSION
from numba.core import types, registry
from numba.core.compiler import comp... | {
"content_hash": "3b45cfaeb1b607c4930ba9f456afeb73",
"timestamp": "",
"source": "github",
"line_count": 2793,
"max_line_length": 94,
"avg_line_length": 34.58575008950949,
"alnum_prop": 0.4722250978281124,
"repo_name": "stuartarchibald/numba",
"id": "264508ce5debdedaea5f8db0102406b0eeb698f2",
"size"... |
"""
Demos for basic time encoding and decoding algorithms that use
IAF neurons.
"""
# Copyright (c) 2009-2015, Lev Givon
# All rights reserved.
# Distributed under the terms of the BSD license:
# http://www.opensource.org/licenses/bsd-license
import sys
import numpy as np
# Set matplotlib backend so that plots can b... | {
"content_hash": "e5cffd6c17d6a9a93d18169fda308453",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 70,
"avg_line_length": 27.97222222222222,
"alnum_prop": 0.6752730883813307,
"repo_name": "bionet/ted.python",
"id": "4375265d350c92780a14c399f48722995444397c",
"size": "30... |
"""
tests.integration.test_index
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Integration tests for the search index.
"""
import copy
from datetime import timedelta
import pytest
from jobber.core.models import Location, Company, Job
from jobber.core.search import Index
@pytest.fixture(scope='function')
def location():
return... | {
"content_hash": "ca17457f1f26f22058dd4b7b34cbc0c2",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 77,
"avg_line_length": 25.339622641509433,
"alnum_prop": 0.5722263588979896,
"repo_name": "hackcyprus/jobber",
"id": "30369f3121b784a7d783dd8135c4d911d0393d1a",
"size": "2... |
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
setup(
name = "mpass",
version = "0.0.2",
packages = find_packages(),
scripts = ['scripts/mpass'],
url = "https://github.com/Pringley/mpass-python",
author = "Ben Pringle",
author_email = ... | {
"content_hash": "f789c58fbadfc1ebd0693bd46c9dcce6",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 53,
"avg_line_length": 25.705882352941178,
"alnum_prop": 0.6498855835240275,
"repo_name": "Pringley/mpass-python",
"id": "ec0fe3e9955c061b329bf0868ac3c6153bd1ccf6",
"size":... |
class Rectangle:
# Functions that begin and end with __ are "magic methods" reserved by Python.
# The init function is used to initialize and return an instance of your Rectangle class.
# self refers to the current instance of Rectangle.
# (self is just a naming convention. In reality, the first param... | {
"content_hash": "a207597209491fdf94833df472cadf84",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 116,
"avg_line_length": 43.588235294117645,
"alnum_prop": 0.7031039136302294,
"repo_name": "JonTheBurger/python_class",
"id": "4fe566cf3ca2b75417119434e311f609b660b49c",
"s... |
from setuptools import setup, find_packages
import django_cassandra_engine as meta
DESCRIPTION = 'Django Cassandra Engine - the Cassandra backend for Django'
LONG_DESCRIPTION = None
try:
LONG_DESCRIPTION = open('README.rst').read()
except IOError:
pass
setup(
name='django-cassandra-engine',
version=... | {
"content_hash": "e5f19e395e60fffee26b81908e54ce70",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 82,
"avg_line_length": 33.26,
"alnum_prop": 0.6265784726398076,
"repo_name": "slurms/django-cassandra-engine",
"id": "dd5965f93e37f9236ebfdd23301719f7ead69f4a",
"size": "16... |
from azure.identity import DefaultAzureCredential
from azure.mgmt.azurestackhci import AzureStackHCIClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-azurestackhci
# USAGE
python delete_cluster.py
Before run the sample, please set the values of the client ID, tenant ID and c... | {
"content_hash": "43b6e28aadb410253323c7088e0c5fad",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 136,
"avg_line_length": 33.24242424242424,
"alnum_prop": 0.7329079307201458,
"repo_name": "Azure/azure-sdk-for-python",
"id": "2d965236d7f95fbaf7ca509c434e7efaacf2b82c",
"s... |
"""A module for the Runner base class."""
import cr
class Runner(cr.Action, cr.Plugin.Type):
"""Base class for implementing target runners.
Runner implementations must implement the Kill, Run and Test methods.
"""
SELECTOR_ARG = '--runner'
SELECTOR = 'CR_RUNNER'
SELECTOR_HELP = 'Sets the runner to use... | {
"content_hash": "e706340dc60880846b72cdfa666c8f16",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 71,
"avg_line_length": 26.53012048192771,
"alnum_prop": 0.662125340599455,
"repo_name": "nwjs/chromium.src",
"id": "923d9ac0276a29c0d7ef7d36f96cbea3fc87b9e0",
"size": "2343... |
import posixpath
from urllib.parse import urlsplit
from urllib.parse import urlunsplit
def urljoin(base, *args):
"""Helper function to join an arbitrary number of url segments together."""
scheme, netloc, path, query, fragment = urlsplit(base)
path = path if len(path) else "/"
path = posixpath.join(p... | {
"content_hash": "c5e74c51b5a874055ae02e5a22b83361",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 79,
"avg_line_length": 28.516129032258064,
"alnum_prop": 0.6244343891402715,
"repo_name": "chassing/aionap",
"id": "216600457e2699ba1ed6217b1a9be736137f5ea4",
"size": "885"... |
"""
MoinMoin - migration from base rev 1050500
Nothing to do, we just return the new data dir revision.
@copyright: 2006 by Thomas Waldmann
@license: GNU GPL, see COPYING for details.
"""
def execute(script, data_dir, rev):
return 1050600
| {
"content_hash": "c8c4d49420473496a9bdf342d6a9966a",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 60,
"avg_line_length": 21.916666666666668,
"alnum_prop": 0.6844106463878327,
"repo_name": "RealTimeWeb/wikisite",
"id": "847d1da260591cad489b2afdf0cc4d7683b5d7ac",
"size": ... |
import os
import fixtures
import testtools
from diskimage_builder import element_dependencies
data_dir = os.path.abspath(
os.path.join(os.path.dirname(__file__), 'test-elements'))
def _populate_element(element_dir, element_name, element_deps=[]):
element_home = os.path.join(element_dir, element_name)
... | {
"content_hash": "d569a862b8ad52207df4abc90f504a70",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 79,
"avg_line_length": 38.526315789473685,
"alnum_prop": 0.6226092896174863,
"repo_name": "citrix-openstack-build/diskimage-builder",
"id": "fc99f0ba00f406541381564231578413e... |
import xarray as xr
import numpy as np
# This import is only for
from .vegetation import EVI as _EVI_orig, EVI2 as _EVI2_orig, NDVI as _NDVI_orig
def EVI(*args, **kwargs):
"""
Instead of this function, please use the EVI() function in vegetation.py.
"""
return _EVI_orig(*args, **kwargs)
def EVI2(*ar... | {
"content_hash": "46327bb088c17bb0c0e016093de0d5f8",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 167,
"avg_line_length": 39.19230769230769,
"alnum_prop": 0.661432777232581,
"repo_name": "ceos-seo/data_cube_utilities",
"id": "f8b23c3b3a3635153279df3b7fbc72193a0854dd",
"... |
"""Configuration and hyperparameter sweeps."""
from lra_benchmarks.listops.configs import base_listops_config
def get_config():
"""Get the default hyperparameter configuration."""
config = base_listops_config.get_config()
config.model_type = "synthesizer"
return config
def get_hyper(hyper):
return hyper.... | {
"content_hash": "b4471d32c5e420ee00a94add4702753e",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 62,
"avg_line_length": 23.714285714285715,
"alnum_prop": 0.7409638554216867,
"repo_name": "google-research/long-range-arena",
"id": "c1bd080113cda97bf7315d62e871fe53ff1cfe5d"... |
import csv
import codecs
import cStringIO
class Writer(object):
"""
A CSV writer which will write rows to CSV file "f",
which is encoded in the given encoding.
"""
def __init__(self, f, dialect=csv.excel, encoding="utf-8", **kwds):
# Redirect output to a queue
self.queue = cString... | {
"content_hash": "ee949c83bd6f77ae967bc3af679bd487",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 80,
"avg_line_length": 29.93617021276596,
"alnum_prop": 0.5813788201847904,
"repo_name": "maxdl/PointDensitySyn.py",
"id": "a7e80b923b439f501629f3db8d3b65a9b036280f",
"size... |
"""
Extract the files from phonondb2017
http://phonondb.mtl.kyoto-u.ac.jp/ph20170621/index.html
and calculate the path using seekpath
"""
import os
import multiprocessing
from phononweb.phonopyphonon import PhonopyPhonon
def calculate_bs(material_id):
"""
go inside the folder and calculate the band-structure... | {
"content_hash": "093b8c33133b857bda40d2daf5315603",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 102,
"avg_line_length": 26.79245283018868,
"alnum_prop": 0.6845070422535211,
"repo_name": "henriquemiranda/phononwebsite",
"id": "c82993ad2475f3a24c9287b16b7c4efa68bdd89f",
... |
"""
.. autoclass:: revscoring.scorer_models.rf.RF
:members:
:member-order:
"""
import logging
from sklearn.ensemble import RandomForestClassifier
from .scorer_model import ScikitLearnClassifier
logger = logging.getLogger("revscoring.scorers.rf")
class RF(ScikitLearnClassifier):
"""
Implements a Rand... | {
"content_hash": "72a0724288e2a6e2331cea07942f415b",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 84,
"avg_line_length": 32.2,
"alnum_prop": 0.6716947648624667,
"repo_name": "eranroz/revscoring",
"id": "39cb0d9d40d96691b4d8f294e615987991901c9a",
"size": "1127",
"binar... |
import logging
from django.core import urlresolvers
from django.template import defaultfilters as filters
from django.utils import http
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy
from horizon import tables
from openstack_dashboard.api import sahara as ... | {
"content_hash": "c7320cf103995abde93e36cd9382284a",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 73,
"avg_line_length": 33,
"alnum_prop": 0.600640551860064,
"repo_name": "froyobin/horizon",
"id": "0ef599d6778a8d6ec9f5e7cc7d974ac76e70d44e",
"size": "4605",
"binary": ... |
import sys
import datetime
from twisted.python import log
from twisted.internet import reactor
from twisted.internet.defer import Deferred, \
inlineCallbacks, \
returnValue
from twisted.internet.endpoints import serverFromString
from autobahn.twist... | {
"content_hash": "1a339ab8475de5980301ff559e984600",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 93,
"avg_line_length": 29.82236842105263,
"alnum_prop": 0.6558570483123759,
"repo_name": "rafzi/WAMP_POCO",
"id": "2a8a1ed76017c158028d1afb3564e0c1c0b6b7cf",
"size": "5303... |
from CIM14.CPSM.Equipment.Core.IdentifiedObject import IdentifiedObject
class OperationalLimitType(IdentifiedObject):
"""A type of limit. The meaning of a specific limit is described in this class.
"""
def __init__(self, direction="high", acceptableDuration=0.0, *args, **kw_args):
"""Initialises ... | {
"content_hash": "a92b11bc3f74c9dec10eeaeb2dce5673",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 307,
"avg_line_length": 58.44444444444444,
"alnum_prop": 0.7097591888466414,
"repo_name": "rwl/PyCIM",
"id": "7640f65def08e116f2c056ad44b03dcdba56a757",
"size": "2678",
"... |
from swgpy.object import *
def create(kernel):
result = Building()
result.template = "object/building/poi/shared_tatooine_dim_u_medium.iff"
result.attribute_template_id = -1
result.stfName("poi_n","base_poi_building")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "46d650dd3a7f9282fbfa7f09b5de5ca9",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 73,
"avg_line_length": 23.615384615384617,
"alnum_prop": 0.6905537459283387,
"repo_name": "obi-two/Rebelion",
"id": "18272390ddcb2db4a95479223b54980d2fd1fc7f",
"size": "452... |
"""Exceptions and return codes used internally.
External libraries should not used exceptions defined here.
"""
# Return codes from Robot and Rebot.
# RC below 250 is the number of failed critical tests and exactly 250
# means that number or more such failures.
INFO_PRINTED = 251 # --help or --version
DATA_ERRO... | {
"content_hash": "710a337718f444b9f27d88d7b0391ed1",
"timestamp": "",
"source": "github",
"line_count": 240,
"max_line_length": 85,
"avg_line_length": 32.3625,
"alnum_prop": 0.6438779451525686,
"repo_name": "fingeronthebutton/RIDE",
"id": "efad55f8b8eca166a750e1c9fe5fb91dafe18837",
"size": "8375",
... |
def words_to_count(words):
"""str -> str"""
result = ""
words = words.strip().split()
for word in range(len(words)):
result += str(len(words[word])) + " "
return result.strip()
# py.test exercise_11_4_16.py --cov=exercise_11_4_16.py --cov-report=html
def test_words_to_count():
assert w... | {
"content_hash": "87ea3ba28e790fb0bfec870b2f7b5e47",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 73,
"avg_line_length": 31.333333333333332,
"alnum_prop": 0.5881458966565349,
"repo_name": "JSBCCA/pythoncode",
"id": "c3e10ced20e65b10cd9e4f60c3843fb237f7e454",
"size": "70... |
from collections import deque
from django.db import transaction
import logging
from satori.ars import perf
from satori.core.models import *
from satori.events import Event, Client2
from dispatchers import dispatchers
from aggregators import aggregators
serial = 1
class CheckingMaster(Client2):
queue = 'checking... | {
"content_hash": "88b27c16a97f9c1129439d8eab460ebb",
"timestamp": "",
"source": "github",
"line_count": 454,
"max_line_length": 167,
"avg_line_length": 52.06828193832599,
"alnum_prop": 0.6326832776344177,
"repo_name": "zielmicha/satori",
"id": "8fbc129859a5d426c70fedf9d184cb358c027599",
"size": "23... |
"""
Enable Gtk3 to be used interacive by IPython.
Authors: Thomi Richards
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COP... | {
"content_hash": "e70244249e3d4f8613f68a504390b3ab",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 78,
"avg_line_length": 32.94117647058823,
"alnum_prop": 0.3776785714285714,
"repo_name": "SlicerRt/SlicerDebuggingTools",
"id": "7c19235a39fc1c635eb697b814d0808b0c6845f8",
... |
from django_markdown.admin import MarkdownModelAdmin
from django.contrib import admin
from . import models
from django_markdown.widgets import AdminMarkdownWidget
from django.db.models import TextField
class EntryAdmin(MarkdownModelAdmin):
list_display = ("title", "created")
prepopulated_fiel... | {
"content_hash": "427044f09b44363d8df6ddd2f7381d28",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 76,
"avg_line_length": 32.9375,
"alnum_prop": 0.7191650853889943,
"repo_name": "moertoe1/moertoe123.github.io",
"id": "775ab70de28e76e6fb9cf5b05bb44aaf71a3953b",
"size": "5... |
import pytest
import demistomock as demisto
from ServiceDeskPlus import Client, create_request_command, update_request_command, list_requests_command, \
linked_request_command, get_resolutions_list_command, delete_request_command, assign_request_command, \
pickup_request_command, modify_linked_request_command, ... | {
"content_hash": "db2e22304417f2bf09457d95a00ddfc8",
"timestamp": "",
"source": "github",
"line_count": 432,
"max_line_length": 121,
"avg_line_length": 59.594907407407405,
"alnum_prop": 0.6341425519518353,
"repo_name": "VirusTotal/content",
"id": "6e2978a84ee6a6142d29210b25f130068e9ba997",
"size": ... |
"""Linux specific tests."""
from __future__ import division
import collections
import contextlib
import errno
import glob
import io
import os
import pprint
import re
import shutil
import socket
import struct
import tempfile
import textwrap
import time
import warnings
import psutil
from psutil import LINUX
from psutil... | {
"content_hash": "9f804ed6b51d1c43e6aff292e746b4f6",
"timestamp": "",
"source": "github",
"line_count": 1475,
"max_line_length": 79,
"avg_line_length": 40.774915254237285,
"alnum_prop": 0.5489749430523918,
"repo_name": "jules185/IoT_Hackathon",
"id": "2d37b46467ec4084462d337ee6a713d7a9dc8b14",
"siz... |
from setuptools import find_packages, setup
setup(
name = "acos-client",
version = "1.4.6",
packages = find_packages(),
author = "A10 Networks",
author_email = "mdurrant@a10networks.com",
description = "A10 Networks ACOS API Client",
license = "Apache",
keywords = "a10 axapi acos adc s... | {
"content_hash": "c1e2d6ff1c0f79474bb0b6898768d66b",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 70,
"avg_line_length": 35.578947368421055,
"alnum_prop": 0.6057692307692307,
"repo_name": "mdurrant-b3/acos-client",
"id": "2a15633653eb852e805e53e8854e808af61b1e89",
"size... |
"""Python client for todo list organization using todo.txt format.
This is currently pre-alpha code but the parser in the `todotxt` module is
already able to parse `todo.txt`_ files.
.. _todo.txt: https://github.com/ginatrapani/todo.txt-cli/wiki/The-Todo.txt-Format
"""
name = 'PyDoDo'
version = '0.1a1'
description ... | {
"content_hash": "a9a0a6a31e239327c48c46f1f786f2bb",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 82,
"avg_line_length": 32.674418604651166,
"alnum_prop": 0.7138790035587189,
"repo_name": "SpotlightKid/pydodo",
"id": "75e9c45cdc18d50e21d5fd52ace38e563caab44a",
"size": "... |
from wsgiref.simple_server import make_server
import sys
import json
import traceback
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, ServerError, InvalidRequestError
from os import environ
from Confi... | {
"content_hash": "a31c5f096b06bd5d2ee10ac43dff6384",
"timestamp": "",
"source": "github",
"line_count": 491,
"max_line_length": 92,
"avg_line_length": 36.61303462321792,
"alnum_prop": 0.537853924459031,
"repo_name": "sjyoo/loader",
"id": "a226258adf5e7432cdd696e779b9343e5e297c47",
"size": "17999",
... |
"""
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... | {
"content_hash": "2d97fc501ffea333ef24480fb29f3632",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 72,
"avg_line_length": 34.18518518518518,
"alnum_prop": 0.7562296858071506,
"repo_name": "CraigHarris/gpdb",
"id": "fa6c276ce279222664effffc021024ed64b48411",
"size": "923"... |
from __future__ import unicode_literals
__author__ = 'Filipe Ximenes'
__email__ = 'filipeximenes@gmail.com'
__version__ = '1.0'
from .adapters import (
generate_wrapper_from_adapter,
TapiocaAdapter,
FormAdapterMixin, JSONAdapterMixin)
| {
"content_hash": "3106093016d65cd9c95efe8e3ab89262",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 39,
"avg_line_length": 22.727272727272727,
"alnum_prop": 0.7,
"repo_name": "era/tapioca-wrapper",
"id": "010531914802add6bc3e2bbca9f1164e4bb6a349",
"size": "267",
"binary... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.