text stringlengths 4 1.02M | meta dict |
|---|---|
def make_model(model_name: str, new_display_name: str) -> google.cloud.aiplatform_v1beta1.types.model.Model:
model = model
model = {
'name': model_name,
'display_name': new_display_name
}
return model
def make_update_mask() -> google.protobuf.field_mask_pb2.FieldMask:
update_mask ... | {
"content_hash": "379765120f0d718cf867c7cba80872b8",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 108,
"avg_line_length": 21.63157894736842,
"alnum_prop": 0.5888077858880778,
"repo_name": "sasha-gitg/python-aiplatform",
"id": "fff76e2ac5b9558a7949991d72b8bda0df2d8dde",
... |
from django.utils.translation import ugettext_lazy as _
from desktop.lib.conf import Config, coerce_bool
MAX_SNAPPY_DECOMPRESSION_SIZE = Config(
key="max_snappy_decompression_size",
help=_("Max snappy decompression size in bytes."),
private=True,
default=1024*1024*25,
type=int)
ARCHIVE_UPLOAD_TEMPDIR = Co... | {
"content_hash": "44093f8639ec0ed530ab23dfe036ca49",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 91,
"avg_line_length": 27.027027027027028,
"alnum_prop": 0.731,
"repo_name": "xq262144/hue",
"id": "0a23fdbec9e1f0ae18c2884feaf2c844b1c72aa3",
"size": "1792",
"binary": f... |
from pandas import read_csv
from numpy import array
from sys import argv
from sys import exit
from numpy import random
trainFile = argv[1]
testFile = argv[2]
classOptions = argv[3].split(",")
algorithm = argv[4]
def readData(inFilePath):
return read_csv(inFilePath, sep='\t', index_col=0)
def predict(algorithm, t... | {
"content_hash": "fe95e998fd353eeac2bf9dcdb5b8351b",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 99,
"avg_line_length": 40.09708737864078,
"alnum_prop": 0.6852300242130751,
"repo_name": "srp33/ShinyLearner",
"id": "890dbb66ab2251e4bb5cc5ff7c85cc9590e22824",
"size": "4... |
from qutebrowser.config.configfiles import ConfigAPI
config: ConfigAPI = config
class Colors:
black = "#282a36"
light_black = "#686868"
red = "#ff5c57"
green = "#5af78e"
yellow = "#f3f99d"
blue = "#57c7ff"
magenta = "#ff6ac1"
cyan = "#9aedfe"
white = "#eff0eb"
class Fonts:
s... | {
"content_hash": "5d3aaf139b62a718ef5a30321dc376dd",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 93,
"avg_line_length": 38.95073891625616,
"alnum_prop": 0.7361831288731504,
"repo_name": "ethan605/dotfiles",
"id": "816dd6beedcd5ec37c9c446a697d9175d7df8ee6",
"size": "79... |
from rdmo.core.plugins import get_plugins, get_plugin
def get_widgets():
widgets = get_plugins('QUESTIONS_WIDGETS')
return widgets.values()
def get_widget_types():
widgets = get_plugins('QUESTIONS_WIDGETS')
return [widget.key for widget in widgets.values()]
def get_widget_type_choices():
widge... | {
"content_hash": "90ba7366c097536c25ccd7e9019ca02a",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 70,
"avg_line_length": 25.666666666666668,
"alnum_prop": 0.7068645640074211,
"repo_name": "rdmorganiser/rdmo",
"id": "95f793d88498e201e2fec530f89b9f9dc8bdfd4b",
"size": "53... |
from dppy.beta_ensembles import GinibreEnsemble
ginibre = GinibreEnsemble() # beta must be 2 (default)
ginibre.sample_full_model(size_N=40)
ginibre.plot(normalization=True)
ginibre.sample_full_model(size_N=1000)
ginibre.hist(normalization=True)
| {
"content_hash": "1be8bb44671b571a6614f0bf1f4a1a66",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 55,
"avg_line_length": 25,
"alnum_prop": 0.792,
"repo_name": "guilgautier/DPPy",
"id": "cfc3c046d3b404411dc2100adca1dbc533963982",
"size": "250",
"binary": false,
"copi... |
"""Manages watermarks of PCollections and AppliedPTransforms."""
from __future__ import absolute_import
import threading
from apache_beam import pipeline
from apache_beam import pvalue
from apache_beam.utils.timestamp import MAX_TIMESTAMP
from apache_beam.utils.timestamp import MIN_TIMESTAMP
class WatermarkManager... | {
"content_hash": "df9c8f154152acd3e652889f979bbc2d",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 80,
"avg_line_length": 36.66985645933014,
"alnum_prop": 0.6970250521920668,
"repo_name": "dhalperi/beam",
"id": "3a135397e12f0a2c7b1a1733b3602ad6840c89f6",
"size": "8449",... |
import urllib2
from google.appengine.api.images import Image
def downloadFile(url):
data = urllib2.urlopen(url).read()
return data
def getImageDimensions(file):
img = Image(file)
return img.width, img.height
def refreshImageDimensions(obj):
# obj can be either Author or Quote
if obj.img_url:
... | {
"content_hash": "93ff5dc15551cdd62371bdd448988301",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 85,
"avg_line_length": 26.11764705882353,
"alnum_prop": 0.6959459459459459,
"repo_name": "pmylund/haveabit",
"id": "f1b109dbd3c3d889edc513fb3b688c12ccd561b7",
"size": "444"... |
"""Home of the Sequential model, and the `save_model`/`load_model` functions.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import json
import os
import numpy as np
from tensorflow.python.framework import ops
from tensorflow.python.keras.... | {
"content_hash": "ceb9a8980d3b2155b5fa3f880f058936",
"timestamp": "",
"source": "github",
"line_count": 1445,
"max_line_length": 117,
"avg_line_length": 35.80968858131488,
"alnum_prop": 0.6270557541791477,
"repo_name": "tornadozou/tensorflow",
"id": "fce86dd565b463e080fed32d496a1169ce2afd49",
"size... |
import os
import sys
import sysconfig
import copy
import ctypes
import ctypes.util
import warnings
from functools import wraps
import numpy
from numpy.ctypeslib import ndpointer
from scipy import interpolate
from galpy.util import multi, galpyWarning
from galpy.potential_src.Potential import Potential
_DEBUG= False
#Fi... | {
"content_hash": "6820516f3c0fb9a2ecca6451aa380ddf",
"timestamp": "",
"source": "github",
"line_count": 696,
"max_line_length": 164,
"avg_line_length": 43.52729885057471,
"alnum_prop": 0.5090278923914837,
"repo_name": "followthesheep/galpy",
"id": "6075ba15629d8bf6fc9a3e31bc9e844a50424f22",
"size":... |
from pyboleto.data import BoletoData, CustomProperty
class BoletoBanrisul(BoletoData):
conta_cedente = CustomProperty('conta_cedente', 6)
nosso_numero = CustomProperty('nosso_numero', 8)
def __init__(self):
BoletoData.__init__(self)
self.codigo_banco = "041"
self.logo_image = "log... | {
"content_hash": "9aea34154e379bd772256b0c3027a022",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 77,
"avg_line_length": 35.064516129032256,
"alnum_prop": 0.5712971481140754,
"repo_name": "eduardocereto/pyboleto",
"id": "9f82573494658440432d3bc80e9ac20afcbc53f5",
"size"... |
from __future__ import absolute_import, division, print_function
from collections import defaultdict, MutableMapping
from operator import getitem, add
from datetime import datetime
from time import time
from ..core import istask, ishashable
class Store(MutableMapping):
""" Store - A storage of data and computat... | {
"content_hash": "3e460b61f473eb4dcb43ecf7c4a5490b",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 76,
"avg_line_length": 25.212389380530972,
"alnum_prop": 0.5605475605475605,
"repo_name": "pombredanne/dask",
"id": "4a7efe85ea65370483f5177710bb4633c681c9d9",
"size": "28... |
from .component_classes import Health, Velocity
def test_reset(game, entity, entity2):
game.add_component_to_entity(Health(), entity)
game.add_component_to_entity(Velocity(), entity)
game.add_component_to_entity(Health(), entity2)
game.reset()
assert game.uid == 0
assert len(game.entities) =... | {
"content_hash": "7550d6853c80c09722d9932520b3d2e0",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 52,
"avg_line_length": 27.76923076923077,
"alnum_prop": 0.6897506925207756,
"repo_name": "Remolten/galena",
"id": "f8733bb964bed7d2b4438421341005c459b06969",
"size": "361",... |
from __future__ import unicode_literals
import logging
from django.utils.translation import ugettext as _
from djblets.markdown import iter_markdown_lines
from pygments.lexers import TextLexer
from reviewboard.reviews.chunk_generators import MarkdownDiffChunkGenerator
from reviewboard.reviews.ui.text import TextBase... | {
"content_hash": "fb09e40abd37c19e80f1d5802c291766",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 75,
"avg_line_length": 32.020833333333336,
"alnum_prop": 0.6623292127521145,
"repo_name": "chipx86/reviewboard",
"id": "c3767e1aef4f10b2af7bed69bec00f9231d8ade8",
"size": "... |
from random import randint, uniform, gauss
from numpy import asarray
from sklearn.ensemble import RandomForestClassifier
from sklearn.cross_validation import cross_val_score
num_chairs = num_tables = 5000
data = [[randint(0, 5), # Possible colors for chairs
uniform(2, 5), # Possible leg lengths for chairs
... | {
"content_hash": "2ea1a2d41a6355d247343ee11a91be5a",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 68,
"avg_line_length": 38.91304347826087,
"alnum_prop": 0.6737430167597765,
"repo_name": "koverholt/random-forest-example",
"id": "f38db5a5b10d6c5b8807a366eccfc8fc4c220fd8",
... |
from __future__ import division, unicode_literals
"""
FIXME: Proper module docstring
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "[email protected]"
__date__ = "Nov 9, 2012"
import unittest2 as unittest
im... | {
"content_hash": "57a0ea9f9f5cc5316e33e7e25c573bf5",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 73,
"avg_line_length": 30.025,
"alnum_prop": 0.6161532056619484,
"repo_name": "aykol/pymatgen",
"id": "8736604106598cf23b1175b32af87d31523ccee1",
"size": "1311",
"binary"... |
"""
flask_oauthlib.provider.oauth2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Implemnts OAuth2 provider support for Flask.
:copyright: (c) 2013 - 2014 by Hsiaoming Yang.
"""
import os
import logging
import datetime
from functools import wraps
from flask import request, url_for
from flask import redirect, abort
f... | {
"content_hash": "d609ba9fa866cda91c5019d02a1f8307",
"timestamp": "",
"source": "github",
"line_count": 880,
"max_line_length": 79,
"avg_line_length": 37.3625,
"alnum_prop": 0.5879740868031266,
"repo_name": "RealGeeks/flask-oauthlib",
"id": "d931ab4d684ece70e502ed710cb75ea3b3eb1f67",
"size": "32895... |
"""
Differ classes
"""
__author__ = "André Malo"
__docformat__ = "epytext en"
__all__ = ["InternalDiffer", "ExternalDiffer"]
class InternalDiffer(object):
""" Differ without an external program call (uses difflib) """
def __init__(self):
""" Initialization """
pass
def getStrin... | {
"content_hash": "dc3a222dca1525810238c0849f171b28",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 74,
"avg_line_length": 27.76284584980237,
"alnum_prop": 0.5269077448747153,
"repo_name": "danielshahaf/svnmailer-debian",
"id": "d712d83a470cb131101aa6d103765d987fe9c763",
... |
import ShareYourSystem as SYS
#Define
MyPredicter=SYS.PredicterClass(
).predict(
#PredictingUnitsInt
10,
#PredictingSensorsInt
1,
#PredictingDecoderWeightFloat
10.,
#PredictingCostFloat
0.,
#PredictingNormalisationInt
0.5,
#PredictingPerturbativeWeightFloat
0.1
)
#print
print('MyPredicter is... | {
"content_hash": "db21aba346e322d28e49d732592e809c",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 36,
"avg_line_length": 15.772727272727273,
"alnum_prop": 0.7579250720461095,
"repo_name": "Ledoux/ShareYourSystem",
"id": "5347249efa6051dab8108518d4e62fd14426f3f2",
"size"... |
from hippy.module.spl.funcs import *
import hippy.module.spl.arrayiter
import hippy.module.spl.iterator
| {
"content_hash": "1378a63cef81cfdb6a8ea60ec0407cb9",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 36,
"avg_line_length": 34.666666666666664,
"alnum_prop": 0.8269230769230769,
"repo_name": "hippyvm/hippyvm",
"id": "1a46df242117ff51572a224941f3113d11c8642c",
"size": "104",... |
from kivy.app import App
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.properties import ObjectProperty, NumericProperty, ReferenceListProperty, StringProperty, ListProperty, BooleanProperty
from kivy.uix.popup import Popup
from kivy.graphics import Color, Line
from kivy.uix.widget import Widg... | {
"content_hash": "c883f457c6d01aac4a265207982b6f91",
"timestamp": "",
"source": "github",
"line_count": 323,
"max_line_length": 144,
"avg_line_length": 33.81733746130031,
"alnum_prop": 0.5071866703286643,
"repo_name": "georgk10/Whiteboard-Master",
"id": "a30695080c27f1a50ddfab46706efd07df23a131",
"... |
"""
Understanding NiftiMasker and mask computation
==================================================
In this example, the Nifti masker is used to automatically compute a mask.
For data that has already been masked, the default strategy works out of
the box.
However, for raw EPI, as in resting-state time series, we ... | {
"content_hash": "8411a1d96874efbd471794e33b932a8a",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 80,
"avg_line_length": 32.69421487603306,
"alnum_prop": 0.6531850353892821,
"repo_name": "ainafp/nilearn",
"id": "643f5ce482810cbe8bbf40ea28306fc52ac661cd",
"size": "3956"... |
import sys
import tkinter as tk
from datetime import datetime as dt
from datetime import timedelta
from math import floor
from tkinter import filedialog as fd
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import statsmodels.api as sm
from scipy.interpolate import interp1d
from at... | {
"content_hash": "c5c4837732e1b805ec5bff05bc93c11b",
"timestamp": "",
"source": "github",
"line_count": 535,
"max_line_length": 118,
"avg_line_length": 39.609345794392524,
"alnum_prop": 0.5259308196876032,
"repo_name": "lo-co/atm-py",
"id": "8838424fb03c982cc5a5d352d7cd06ec70857e9b",
"size": "21191... |
from azure.identity import DefaultAzureCredential
from azure.mgmt.cdn import CdnManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-cdn
# USAGE
python origins_get.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of th... | {
"content_hash": "6b7e7814bf2eafc5dd69115756616c83",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 114,
"avg_line_length": 30.685714285714287,
"alnum_prop": 0.7057728119180633,
"repo_name": "Azure/azure-sdk-for-python",
"id": "4fd90004ad9f25d1ab856662002515d42e7e6d85",
"... |
import os
import ConfigParser
# 3rd party
import requests
from fabric.api import *
from fabric import colors
import fabtools
# local
import exceptions
def fabfile_root():
return os.path.dirname(os.path.abspath(__file__))
def fabfile_templates_root():
return os.path.join(fabfile_root(), "templates")
def pro... | {
"content_hash": "89dcdc17dc8f9df513c3f940a8b4b7ca",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 62,
"avg_line_length": 21.875,
"alnum_prop": 0.7071428571428572,
"repo_name": "bjlange/revenge",
"id": "8ea542e9159dd9dc334b47c71544158c3dfa4fe6",
"size": "719",
"binary"... |
import markovify
import nltk
import re
import numpy as np
import urllib
import oauth2 as oauth
from settings import conn, db, auth, post_tags, blogName
class POSifiedText(markovify.Text):
def word_split(self, sentence):
words = re.split(self.word_split_pattern, sentence)
if words[0] != "":
... | {
"content_hash": "6883722ba3503dc91d361e6a68997c0b",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 77,
"avg_line_length": 26.145454545454545,
"alnum_prop": 0.6258692628650904,
"repo_name": "veggiedefender/miraculousladybot",
"id": "f55036f06d6f44bf01d1567b6498c49d083b7b80"... |
import os
import shutil
import glob
import time
import sys
import subprocess
import string
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PKG_NAME = os.path.basename(SCRIPT_DIR)
PARAMETERS = None
#XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/500... | {
"content_hash": "794bc430c0c23aff9d818b5e355cf9e0",
"timestamp": "",
"source": "github",
"line_count": 237,
"max_line_length": 101,
"avg_line_length": 29.88607594936709,
"alnum_prop": 0.5444020895100946,
"repo_name": "JianfengXu/crosswalk-test-suite",
"id": "5b1a0ea21e740d8fdf2cad0725e86a07440cb8a2"... |
"""
Copyright (c) 2004-Present Pivotal Software, Inc.
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
http://www.apache.... | {
"content_hash": "77c381ab1f01aad41bb99ad82d070ce3",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 72,
"avg_line_length": 32.8,
"alnum_prop": 0.6933797909407665,
"repo_name": "janebeckman/gpdb",
"id": "b77d897f9106b772186185a8a7abe27044a42692",
"size": "1148",
"binary"... |
"""Android automated build script.
This script may be used for builds of LiquidFun Paint.
Optional environment variables:
ANDROID_SDK_HOME = Path to the Android SDK. Required if it is not passed on the
command line.
NDK_HOME = Path to the Android NDK. Required if it is not passed on the
command line.
MAKE_FLAGS = St... | {
"content_hash": "cf20489aec67bdb741495cc5483fc96e",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 79,
"avg_line_length": 36.0948275862069,
"alnum_prop": 0.6472414616670648,
"repo_name": "luiseduardohdbackup/LiquidFunPaint",
"id": "39e72c1dc0a4f2c2d540f96a175a17409fec5919... |
import _plotly_utils.basevalidators
class TicktextsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="ticktextsrc",
parent_name="layout.polar.angularaxis",
**kwargs,
):
super(TicktextsrcValidator, self).__init__(
plotly_... | {
"content_hash": "df4b4388a8298c569c1b8d12b12aa1ad",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 70,
"avg_line_length": 28.875,
"alnum_prop": 0.5865800865800865,
"repo_name": "plotly/plotly.py",
"id": "31a4de19d0ed1f94d12866206ee6a299b22e8125",
"size": "462",
"binary... |
"""MongoDB storage backend"""
from oslo.config import cfg
import pymongo
from ceilometer.alarm.storage import pymongo_base
from ceilometer.openstack.common import log
from ceilometer import storage
from ceilometer.storage.mongo import utils as pymongo_utils
cfg.CONF.import_opt('time_to_live', 'ceilometer.storage',
... | {
"content_hash": "5657d84f91251dd9f900945cfc6b330c",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 76,
"avg_line_length": 36.229166666666664,
"alnum_prop": 0.6687751581368603,
"repo_name": "froyobin/ceilometer",
"id": "19fff006174b15d74af9757c7e3282f913ef7460",
"size": "... |
"""
This file is part of the TheLMA (THe Laboratory Management Application) project.
See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information.
Molecule design gene table.
"""
from sqlalchemy import Column
from sqlalchemy import ForeignKey
from sqlalchemy import Integer
from sqlalchemy import Table
... | {
"content_hash": "1d3e54403c2e4e3bfadfa6441e0dd3d4",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 80,
"avg_line_length": 33.241379310344826,
"alnum_prop": 0.6493775933609959,
"repo_name": "helixyte/TheLMA",
"id": "229e5b1dc1bd8379b11677aa02853f64b2c56150",
"size": "964"... |
import threading
import time
class myThread(threading.Thread):
def __init__(self, threadID, name, counter):
threading.Thread.__init__(self)
self.threadID = threadID
self.name = name
self.counter = counter
def run(self):
print('Starting ' + self.name)
calculateM... | {
"content_hash": "9d1f88503590a0fa4b4cb4e1b1a8c3b3",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 87,
"avg_line_length": 27.58490566037736,
"alnum_prop": 0.6484268125854993,
"repo_name": "UALR-ACM/Practice-Problems",
"id": "f66d82c5509c01c1b9342b771ade39f9e9b97ac4",
"si... |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pandas.io.data as web
from math import sqrt
import math
#############################
# FINANCIAL HELPER ROUTINES #
#############################
def compute_nyears(x) :
return np.double((x.index[-1] - x.index[0]).days) / 365.
def com... | {
"content_hash": "dce86d44b9ea777c4d9d2d02168b46b2",
"timestamp": "",
"source": "github",
"line_count": 612,
"max_line_length": 147,
"avg_line_length": 40.923202614379086,
"alnum_prop": 0.5274905170692753,
"repo_name": "scubamut/SIT-Python",
"id": "fbe554e08f4cb6bb17534c35e3e8ef3b262a13cb",
"size":... |
"""
Autopsy Forensic Browser
Copyright 2019-2020 Basis Technology Corp.
Contact: carrier <at> sleuthkit <dot> org
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/licenses... | {
"content_hash": "54c18a0bc1c36f6b3c4ca15db6756fd4",
"timestamp": "",
"source": "github",
"line_count": 453,
"max_line_length": 166,
"avg_line_length": 46.18984547461368,
"alnum_prop": 0.5810074555534315,
"repo_name": "wschaeferB/autopsy",
"id": "908a7da451564a6cb9c0cb9b24db0ee9abc0f2d4",
"size": "... |
"""
Copy of gi.py with recolor changed to fast recolor
"""
from basicgraphs import graph # , GraphError, vertex, edge
import permgrputil
from permv2 import permutation
from basicpermutationgroup import Orbit
# deprecated
def color_gradient(bg_1, bg_2, colors):
# types correct?
if not (isinstance(bg_1, graph... | {
"content_hash": "35f5c2c07c2b1407fd35e6503139b91a",
"timestamp": "",
"source": "github",
"line_count": 322,
"max_line_length": 151,
"avg_line_length": 33.45031055900621,
"alnum_prop": 0.57023488998236,
"repo_name": "Walnoot/graph-isomorphism",
"id": "20f793895d94fcd688ecd15c84764b2e56cd702d",
"siz... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('orders', '0007_usercheckout_braintree_id'),
]
operations = [
migrations.AddField(
model_name='order',
name='order_id',
... | {
"content_hash": "502771d3e27fa90b98f901b1f9ddfb4e",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 153,
"avg_line_length": 28.73913043478261,
"alnum_prop": 0.5809379727685325,
"repo_name": "DiptoDas8/Biponi",
"id": "04ce1d9f135238c400a092db4ffa49f7b2bfad5c",
"size": "685... |
import json
from jsonobject.exceptions import BadValueError
from corehq.apps.reports_core.filters import DatespanFilter, ChoiceListFilter, Choice, DynamicChoiceListFilter, \
NumericFilter, PreFilter, QuarterFilter
from corehq.apps.userreports.exceptions import BadSpecError
from django.utils.translation import ugett... | {
"content_hash": "42eb7586edc81db9e476a676caef6a1d",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 113,
"avg_line_length": 33.6328125,
"alnum_prop": 0.6720092915214867,
"repo_name": "qedsoftware/commcare-hq",
"id": "6dacf26e7947437c9a37f0a2f9f58b37e9137a44",
"size": "43... |
from django.contrib.postgres.fields import JSONField
from django.db import models
class Character(models.Model):
name = models.CharField(max_length=200)
data = JSONField()
other_data = JSONField()
def __str__(self): # __unicode__ on Python 2
return self.name
| {
"content_hash": "90580d9d558b469715c94f9277f73264",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 52,
"avg_line_length": 26.09090909090909,
"alnum_prop": 0.686411149825784,
"repo_name": "jmrivas86/django-json-widget",
"id": "4b75cdad1619b31c55015d66dd619f13fcc4f502",
"s... |
"""Unit tests."""
import mock
import pytest
from google.api import metric_pb2 as api_metric_pb2
from google.api import monitored_resource_pb2
from google.cloud import monitoring_v3
from google.cloud.monitoring_v3 import enums
from google.cloud.monitoring_v3.proto import common_pb2
from google.cloud.monitoring_v3.prot... | {
"content_hash": "98a3dacce681f3b7ca91ab95ec3e060e",
"timestamp": "",
"source": "github",
"line_count": 425,
"max_line_length": 88,
"avg_line_length": 37.169411764705885,
"alnum_prop": 0.6412609989238462,
"repo_name": "tseaver/google-cloud-python",
"id": "dd5e692eb4138269739077060f8b1d88bce5f90e",
... |
import os.path
import shutil
import sublime
import sublime_plugin
import subprocess
SETTINGS_FILE = "BeautifyRust.sublime-settings"
def which(program):
def is_exe(fpath):
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
fpath, fname = os.path.split(program)
if fpath:
if is_exe(p... | {
"content_hash": "dcde20f8a99bf918f44840c4cb9b7d96",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 107,
"avg_line_length": 37.964285714285715,
"alnum_prop": 0.6180620884289746,
"repo_name": "vincenting/BeautifyRust",
"id": "e8121ce7c7a5e9d6601ebd6efc656e218793675d",
"siz... |
__author__ = 'Stephen P. Henrie'
import unittest
from mock import Mock
from pyon.util.unit_test import PyonTestCase
from pyon.util.int_test import IonIntegrationTestCase
from nose.plugins.attrib import attr
from pyon.core.exception import BadRequest, NotFound
from pyon.public import RT, IonObject
from interface.ser... | {
"content_hash": "1b09312af1947b5d90bc476eba21f7f3",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 91,
"avg_line_length": 36.83040935672515,
"alnum_prop": 0.6770403302635757,
"repo_name": "ooici/coi-services",
"id": "5532c9e6978b0c0773cf06f1fff9f15c21da2976",
"size": "6... |
import copy
from unittest import TestCase
import TestResults
__author__ = 'zthomae'
class TestArgumentParser(TestCase):
def setUp(self):
self.parser = TestResults.make_parser()
def test_type_should_not_be_optional(self):
try:
TestResults.parse_args(self.parser, '--input foo --res... | {
"content_hash": "bb90378a4f9551cd0d33aa7fe59c5fac",
"timestamp": "",
"source": "github",
"line_count": 265,
"max_line_length": 116,
"avg_line_length": 40.86037735849057,
"alnum_prop": 0.6048208348725527,
"repo_name": "uwgraphics/Ubiqu-Ity",
"id": "444a190a1b95aaf1953da26833ea09f6dfc98b31",
"size":... |
"""
"""
# This file is part of zasim. zasim is licensed under the BSD 3-clause license.
# See LICENSE.txt for details.
from .bases import CellLoop
from .compatibility import one_dimension, two_dimensions, activity, random_generator
from .utils import offset_pos
from itertools import product, izip
import numpy as np
... | {
"content_hash": "623d06f6e1295bba58b0521646ff9257",
"timestamp": "",
"source": "github",
"line_count": 239,
"max_line_length": 115,
"avg_line_length": 39.87866108786611,
"alnum_prop": 0.5254432903158116,
"repo_name": "timo/zasim",
"id": "3d75f5cfd9008f83e1523ea0fc3f8f6083ea9df4",
"size": "9531",
... |
import os
import sys
import time
import unittest
import pytest
from _pydev_bundle.pydev_stdin import StdIn
from _pydev_bundle.pydev_localhost import get_localhost
from _pydev_comm.pydev_rpc import make_rpc_client
from _pydevd_bundle import pydevd_io
from pydev_console.pydev_protocol import PythonConsoleFrontendServic... | {
"content_hash": "b371e76772b75eac0d3a05ecdcc1e3a2",
"timestamp": "",
"source": "github",
"line_count": 307,
"max_line_length": 167,
"avg_line_length": 40.62866449511401,
"alnum_prop": 0.5863064218712419,
"repo_name": "siosio/intellij-community",
"id": "8a1b63d7381ab184ac2d3414b5d90cbf0be379c9",
"s... |
def extractToffeedragontlCom(item):
'''
Parser for 'toffeedragontl.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
('Loiterous', 'Lo... | {
"content_hash": "f7d78c18037adf146bd91a1715fbe161",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 104,
"avg_line_length": 26.095238095238095,
"alnum_prop": 0.6295620437956204,
"repo_name": "fake-name/ReadableWebProxy",
"id": "ddb3cb0b6559b715176914c409076cc736534e7a",
"... |
"""Tool to automatically perform volumetric meshing prior to
executing a Glossia Python Container Module simulation. Updates
region YAML files to note mesh labels for specific regions."""
import sys
import asyncio
import click
import os
import shutil
import yaml
import traceback
import lxml.etree
import mesher_gssf
i... | {
"content_hash": "a4c6a3138b341f2d15302ad7ec08bb6e",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 90,
"avg_line_length": 26.71523178807947,
"alnum_prop": 0.6249380267724343,
"repo_name": "go-smart/glossia-container-fenics",
"id": "a6162bb5465b4c3576a6b7bef69d809f9d03d6ec... |
"""\
Tests if install_as_pyqrcode works
"""
from __future__ import absolute_import, unicode_literals
import segno_mimos
import pytest
import io
def test_install_segno_as_pyqrcode():
segno_mimos.install_as_pyqrcode()
import pyqrcode
qr = pyqrcode.create('Hello')
out = io.BytesIO()
qr.png(out)
o... | {
"content_hash": "4a1adcb9ce80eb0fecb6b1a12ffcdb32",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 58,
"avg_line_length": 21.285714285714285,
"alnum_prop": 0.6554809843400448,
"repo_name": "heuer/segno-mimos",
"id": "9110f41a3602b548523c4820a43ce5005a4a4cf2",
"size": "60... |
from hashlib import md5
from flask_mongoengine.documents import DynamicDocument
from mongoengine import signals, EmbeddedDocument
from mongoengine.fields import StringField, ListField, IntField, EmbeddedDocumentField
from mongoengine.queryset.manager import queryset_manager
from mpcontribs.api.contributions.document i... | {
"content_hash": "31b331e4a6ce2751e5820746a50599d1",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 96,
"avg_line_length": 42.94117647058823,
"alnum_prop": 0.7178082191780822,
"repo_name": "materialsproject/MPContribs",
"id": "dc52876df12b8de493e3037f2ae2657c8761240c",
"s... |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | {
"content_hash": "8871c0e0e2fe32d6a01c567663268f9a",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 60,
"avg_line_length": 30.076923076923077,
"alnum_prop": 0.7297527706734868,
"repo_name": "lathama/Adynaton",
"id": "206a41c5de1c103777e0d683c272efd7fd98f1f6",
"size": "117... |
import logging
import os
import sys
import time
from .settings import Settings
class Logger:
def __init__(self):
self.logfolder = Settings.log_location + os.path.sep
self.loggerobj = self.get_logger(Settings.log_output_toconsole)
def set_logfolder(self):
if not os.path.exists(self.lo... | {
"content_hash": "e90218fc2d782260f11ef38e1df6b033",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 120,
"avg_line_length": 31.954545454545453,
"alnum_prop": 0.586533902323376,
"repo_name": "timgrossmann/instagram-profilecrawl",
"id": "532bac518802be8212afe5a7a0dac1cf2f3e3e... |
import copy
import os
import mock
from cinder import exception
from cinder.image import image_utils
from cinder import test
from cinder.volume.drivers import smbfs
class SmbFsTestCase(test.TestCase):
_FAKE_SHARE = '//1.2.3.4/share1'
_FAKE_MNT_BASE = '/mnt'
_FAKE_VOLUME_NAME = 'volume-4f711859-4928-4cb7... | {
"content_hash": "8bd816a85113ba5bceef8964a369f28e",
"timestamp": "",
"source": "github",
"line_count": 610,
"max_line_length": 80,
"avg_line_length": 42.10819672131147,
"alnum_prop": 0.5751382075838979,
"repo_name": "tmenjo/cinder-2015.1.0",
"id": "df04f9d3c8559f896378f799ddf02f3c57280ebf",
"size"... |
"""Stop Entity."""
import mzgeohash
import geom
import util
import errors
from entity import Entity
class Stop(Entity):
"""Transitland Stop Entity."""
onestop_type = 's'
def init(self, **data):
self.timezone = data.pop('timezone', None)
def geohash(self):
"""Return 10 characters of geohash."""
... | {
"content_hash": "f0086271db41e9a417a43b9a3d33fd02",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 101,
"avg_line_length": 25.14864864864865,
"alnum_prop": 0.6190220311660397,
"repo_name": "srthurman/transitland-python-client",
"id": "c70de641ae98dc858c030805f13192405a5475... |
from click.testing import CliRunner
from pyskel.scripts.cli import cli
def test_cli_count():
runner = CliRunner()
result = runner.invoke(cli, ['3'])
assert result.exit_code == 0
assert result.output == "False\nFalse\nFalse\n"
| {
"content_hash": "f5c55b5beba1458c569f8ba8250ffb8a",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 51,
"avg_line_length": 24.5,
"alnum_prop": 0.689795918367347,
"repo_name": "mapbox/pyskel",
"id": "924cc90ee67e70a429deb803c0c84d018232b81a",
"size": "245",
"binary": fal... |
"""The Gumbel distribution class."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import op... | {
"content_hash": "9f2d108511ddea6efd58eaa531f7f5b8",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 80,
"avg_line_length": 33.0622009569378,
"alnum_prop": 0.6589001447178003,
"repo_name": "Xeralux/tensorflow",
"id": "8d05ad6b8032fb8bada99389959091fb1c28beda",
"size": "75... |
"""This module contains functions for fetching and extracting archived builds.
The builds may be stored in different places by different types of builders;
for example, builders on tryserver.chromium.perf stores builds in one place,
while builders on chromium.linux store builds in another.
This module can be either i... | {
"content_hash": "041985ab0da5d6c88ef90cbf7eca7f4b",
"timestamp": "",
"source": "github",
"line_count": 360,
"max_line_length": 80,
"avg_line_length": 34.34444444444444,
"alnum_prop": 0.6895017793594306,
"repo_name": "Jonekee/chromium.src",
"id": "4aaee54fbbfc13d36e51a4955205a8497abff5c3",
"size": ... |
import threading
from rpyc.utils.authenticators import SSLAuthenticator
from rpyc.utils.server import ThreadPoolServer
from . import PupyService
import textwrap
import pkgutil
import modules
import logging
from .PupyErrors import PupyModuleExit, PupyModuleError
from .PupyJob import PupyJob
try:
import ConfigParser as ... | {
"content_hash": "523023fadcd00980f7412dccf012569c",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 241,
"avg_line_length": 27.212669683257918,
"alnum_prop": 0.655470568673096,
"repo_name": "paran0ids0ul/pupy",
"id": "66c8431f834ff0b09ecd11ca380d87ef21c9df83",
"size": "7... |
from setuptools import setup
setup(
name = 'localbitcoins',
version = "0.1dev",
license = "GPL3",
description = "trade bitcoins locally",
long_description = open('README').read(),
author = "dinosaur",
author_email = "[email protected]",
package_dir = { '' : 'src' },
packages = [ 'l... | {
"content_hash": "ace89c564f25c9098923f0c0445243d5",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 60,
"avg_line_length": 31.105263157894736,
"alnum_prop": 0.5685279187817259,
"repo_name": "ahdinosaur/localbitcoins",
"id": "54653e0b03f1cb22fe22e09cff26ce538f936148",
"siz... |
"""
This module contains class for representing base json object
"""
import json
import copy
__all__ = ['BaseJsonObject']
class BaseJsonObject:
"""
Every Codeforces Json object should extend this class
"""
def __init__(self, data):
"""
:param data: Data in JSON format
:type... | {
"content_hash": "402dc225af3d6c6cdaec0a66ef28e258",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 101,
"avg_line_length": 26.824074074074073,
"alnum_prop": 0.597859855022437,
"repo_name": "soon/CodeforcesAPI",
"id": "70d3dbe41783fd9cd5b19ca5e8959b0d79391805",
"size": "... |
from flask import Flask, url_for, request, session, redirect, render_template
from flask_oauth import OAuth
FACEBOOK_APP_ID = '293823757717281'
FACEBOOK_APP_SECRET = '49b409de34973230b046a4a091cea4a6'
app = Flask(__name__)
app.secret_key = '9ujYZLNmd6NIdPdlTSVJ'
oauth = OAuth()
facebook = oauth.remote_app('facebook',... | {
"content_hash": "46eb9d8cdd81007f5e6110dcaca62b8e",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 77,
"avg_line_length": 29.344827586206897,
"alnum_prop": 0.6880141010575793,
"repo_name": "adwalvekar/FacebookAppTest",
"id": "e793558c92adc86ff1bb7817d48369c82fd64f8e",
"s... |
class QWeiboError(Exception):
"""basic weibo error class"""
pass
def assertion(condition, msg):
try:
assert condition, msg
except AssertionError as e:
raise QWeiboError(e.message)
| {
"content_hash": "a25f6ae53385c480d786d2ad72889eb6",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 36,
"avg_line_length": 19.545454545454547,
"alnum_prop": 0.6558139534883721,
"repo_name": "2014/qqweibo",
"id": "c151eb172d4dbd99cd51f1b34d8e80c6d790f932",
"size": "371",
... |
from BeautifulSoup import BeautifulSoup
# for each file in folder
import glob
files = glob.glob("amazonproducts/*.html")
# find all the products
for fileName in files :
with open(fileName) as f:
text = BeautifulSoup(f)
print text.findAll(class="productTitle")
# write out file for later
| {
"content_hash": "9e3dae1e9346572d8204137678933740",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 44,
"avg_line_length": 21.5,
"alnum_prop": 0.7375415282392026,
"repo_name": "dgonzo/bmdc_skullcandy",
"id": "bf02fbc9f63f296e7ca852555c87bb4f59d36ac2",
"size": "301",
"bi... |
from __future__ import (unicode_literals, absolute_import,
division, print_function)
import logging
from snisi_core.models.Projects import Domain
from snisi_sms.common import test, echo, change_passwd, ask_for_help
logger = logging.getLogger(__name__)
def snisi_sms_handler(message):
# m... | {
"content_hash": "bb315ed3ccfd02c69c2e1be7f52e67df",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 68,
"avg_line_length": 30.771428571428572,
"alnum_prop": 0.627669452181987,
"repo_name": "yeleman/snisi",
"id": "1836e0e3681620d8fc4eb0183ed92b15a1e39f67",
"size": "1156",
... |
import mimeo
import argparse
import os
import sys
import shutil
def mainArgs():
parser = argparse.ArgumentParser(description='Find all high-identity segments shared between genomes.',
prog='mimeo-map')
# Input options
parser.add_argument('--adir',type=str,default=None,... | {
"content_hash": "a21863c85b71d327915ac84e6d2a2e89",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 179,
"avg_line_length": 59.34313725490196,
"alnum_prop": 0.6489344126879233,
"repo_name": "Adamtaranto/mimeo",
"id": "460d2420ab3a949af8a7d2566760172627633104",
"size": "6... |
from .auth import auth
| {
"content_hash": "41a7766c8e789c5c5a4cc0bb4c1082a3",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 22,
"avg_line_length": 12,
"alnum_prop": 0.75,
"repo_name": "najce/freebook",
"id": "f683fb30744044b3e47aefcf35670530fb528393",
"size": "24",
"binary": false,
"copies": ... |
from subconscious.model import RedisModel, Column, InvalidModelDefinition, UnexpectedColumnError
from uuid import uuid1
from .base import BaseTestCase
import enum
class StatusEnum(enum.Enum):
ACTIVE = 'active'
class TestUser(RedisModel):
id = Column(primary_key=True)
name = Column(index=True)
age = ... | {
"content_hash": "09b8f16b89634b98b9cbf1a213374e22",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 96,
"avg_line_length": 31.044444444444444,
"alnum_prop": 0.6800286327845383,
"repo_name": "paxos-bankchain/subconscious",
"id": "14988f88c8c8903f5d5120e03bb6bb4347d00f78",
... |
from typing import Tuple
from typing import List
from typing import Any
from matplotlib.patches import Circle
from matplotlib.transforms import ScaledTranslation
from compas.geometry import Point
from compas.artists import PrimitiveArtist
from .artist import PlotterArtist
Color = Tuple[float, float, float]
class P... | {
"content_hash": "239885342b714c924e796c12c0fb4aac",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 93,
"avg_line_length": 26.158333333333335,
"alnum_prop": 0.5931825422108952,
"repo_name": "compas-dev/compas",
"id": "30ec854e1f65f269b36c183dc52b19019562f480",
"size": "3... |
from email.message import Message
import os
import tempfile
from tests.BaseTestClasses import Email2PDFTestCase
class TestBasic(Email2PDFTestCase):
def setUp(self):
super(TestBasic, self).setUp()
self.msg = Message()
def test_simple(self):
self.addHeaders()
(rc, output, erro... | {
"content_hash": "a565d30a2e61320caa99529daacfd907",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 115,
"avg_line_length": 44.333333333333336,
"alnum_prop": 0.6681318681318681,
"repo_name": "andrewferrier/email2pdf",
"id": "5a27e23280dfd3e653f024476c85156179f29670",
"si... |
class ChannelApplicator(object):
def __init__(self,):
super(ChannelApplicator, self).__init__()
self.target_channel = None
def set_target_channel(self, target_channel):
assert self.target_channel is None
self.target_channel = target_channel
# Check that everything that... | {
"content_hash": "7bb2b19665246b43e03d6493243e4e24",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 174,
"avg_line_length": 41.083333333333336,
"alnum_prop": 0.6709939148073022,
"repo_name": "mikehulluk/morphforge",
"id": "f3c5c8dd9a663a834c6e870880a0318c8749de9e",
"size"... |
"""A helper module to work with metadata associated with the dataset.
The metadata is a JSON file containing a single dictionary with key/value
pairs.
The module contains both helper functions to work with the metadata and
constants for fields that are expected to be included.
"""
import json
import logging
import os... | {
"content_hash": "5ada4a6e1ca3a542a12dff28991b9bd9",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 80,
"avg_line_length": 32.81012658227848,
"alnum_prop": 0.7291666666666666,
"repo_name": "verilylifesciences/classifaedes",
"id": "127208bae3fc7810692648de8581f40c2f6872d8",
... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('geo', '0022_auto_20210129_0951'),
('time_based', '0054_auto_20210129_0951'),
]
operations = [
migrations.Ad... | {
"content_hash": "4e6ebfa4466955719550505f035ad775",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 210,
"avg_line_length": 36.46666666666667,
"alnum_prop": 0.6188299817184644,
"repo_name": "onepercentclub/bluebottle",
"id": "7f818516d10f9d0ba4ae6e01ba57cf5259f58ce3",
"si... |
from designate.objects import base
class Server(base.DictObjectMixin, base.PersistentObjectMixin,
base.DesignateObject):
FIELDS = {
'name': {
'schema': {
'type': 'string',
'description': 'Zone name',
'format': 'domainname',
... | {
"content_hash": "41d9c8eb0bac060da74527a4e4b2a042",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 62,
"avg_line_length": 23.04,
"alnum_prop": 0.5017361111111112,
"repo_name": "ramsateesh/designate",
"id": "b2d9cfb7f9ee0c7a1c6728ea53d886f706b066cb",
"size": "1212",
"bi... |
import sys, time, random, math, pygame
# Class
# class Point
class Point(object):
def __init__(self, x, y):
self.__x = x
self.__y = y
# X property
def getx(self):
return self.__x
def setx(self, x):
self.__x = x
x = property(getx, setx)
# Y property
def... | {
"content_hash": "0e8be5888fe999fe2ef613969813918b",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 85,
"avg_line_length": 31.585858585858585,
"alnum_prop": 0.5481291973137192,
"repo_name": "sun1218/Pygames",
"id": "47dffe40df70f38eabd521c575b37634ddab066c",
"size": "3127... |
"""
Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved.
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including withou... | {
"content_hash": "0d032fdc3da0e305a4ecbd7378456ab7",
"timestamp": "",
"source": "github",
"line_count": 425,
"max_line_length": 121,
"avg_line_length": 35.66823529411765,
"alnum_prop": 0.6958242628141698,
"repo_name": "lclchen/open-hackathon",
"id": "235336b816335dce91601509dfc0ae97127dbad2",
"size... |
import sys
from setuptools import setup, find_packages
install_requires = ['redis']
print find_packages()
setup(
name='twiceredis',
version='2.0.0',
author='Trey Morris',
author_email='[email protected]',
description='sentinel pool backed read and write redis client',
long_description=open... | {
"content_hash": "dcbad6d5095647efe500ab57b2a728ef",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 71,
"avg_line_length": 30,
"alnum_prop": 0.6833333333333333,
"repo_name": "tr3buchet/twiceredis",
"id": "19d80d3969a823114a320a464cb24a372b20ee10",
"size": "1279",
"binar... |
"""Unit tests for the raised exception documentation checking in the
`DocstringChecker` in :mod:`pylint.extensions.check_docs`
"""
# pylint: disable=too-many-public-methods
import astroid
from pylint.extensions.docparams import DocstringParameterChecker
from pylint.testutils import CheckerTestCase, Message, set_conf... | {
"content_hash": "12f4d6d9297277c8d9aafffec32a208b",
"timestamp": "",
"source": "github",
"line_count": 886,
"max_line_length": 83,
"avg_line_length": 28.159142212189618,
"alnum_prop": 0.49232434165698025,
"repo_name": "ruchee/vimrc",
"id": "7ed7c405cf69857e50c03877298bf4c0a8ec39ce",
"size": "25733... |
'''Display positioned, scaled and rotated images.
A sprite is an instance of an image displayed on-screen. Multiple sprites can
display the same image at different positions on the screen. Sprites can also
be scaled larger or smaller, rotated at any angle and drawn at a fractional
opacity.
The following complete ex... | {
"content_hash": "ac8d928ac65370eecd7658f0255938ff",
"timestamp": "",
"source": "github",
"line_count": 534,
"max_line_length": 89,
"avg_line_length": 31.803370786516854,
"alnum_prop": 0.5562621444974386,
"repo_name": "Codlydodly/python-client",
"id": "f160b1eff4b31d62ddbe83d3f9530a94e430cf1d",
"si... |
from functools import wraps
from json import loads
from datetime import datetime, timedelta
from time import mktime
try:
from urllib import urlencode
from urllib2 import Request, urlopen
from urlparse import urlsplit, urlunsplit, parse_qsl
# monkeypatch httpmessage
from httplib import HTTPMessage
... | {
"content_hash": "a7e02dca69ad453806fcc885949657a0",
"timestamp": "",
"source": "github",
"line_count": 224,
"max_line_length": 79,
"avg_line_length": 37.620535714285715,
"alnum_prop": 0.5932122938174914,
"repo_name": "demianbrecht/sanction",
"id": "a4946d7f450cbe3be67e36392baaaa33e1f7d748",
"size"... |
from app.auth.models import Role
def run():
Role.insert_roles()
| {
"content_hash": "c5d6adbb3e225175e5add6b3c24c35d4",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 32,
"avg_line_length": 14,
"alnum_prop": 0.6857142857142857,
"repo_name": "teracyhq/flask-boilerplate",
"id": "3362370e803cb2dcc2d43d4e0292e70207b1cad5",
"size": "70",
"bi... |
"""
Ensure that we can use pathlib.Path objects in all relevant IO functions.
"""
import sys
from pathlib import Path
import numpy as np
import scipy.io
import scipy.io.wavfile
from scipy._lib._tmpdirs import tempdir
import scipy.sparse
class TestPaths:
data = np.arange(5).astype(np.int64)
def test_savemat... | {
"content_hash": "b3cd30890c08683494b3147861a28eb7",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 81,
"avg_line_length": 34.47872340425532,
"alnum_prop": 0.5871644554149954,
"repo_name": "pizzathief/scipy",
"id": "4ba6dc312dcc7b573669e662546a4f3b3c1f7214",
"size": "3241... |
import json
import urllib
BASE_URL = 'https://blockchain.info/'
def query(call):
return urllib.urlopen(BASE_URL + call).read()
def block_count():
"""Return blockchain.info's most recent block count. This is
useful in comparison with the local blockcount, which may be
lagging behind."""
return int(query('q/getb... | {
"content_hash": "a5f83381bc7df8ad2f6f7e970b813d41",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 62,
"avg_line_length": 25.058823529411764,
"alnum_prop": 0.7183098591549296,
"repo_name": "dasmithii/Stone",
"id": "a66f0be7db921909eab836ba9f321fb27f52c6f4",
"size": "426"... |
"""
fMRIprep base processing workflows
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. autofunction:: init_fmriprep_wf
.. autofunction:: init_single_subject_wf
"""
import sys
import os
from collections import OrderedDict
from copy import deepcopy
from nipype import __version__ as nipype_ver
from nipype.pipeline import engine... | {
"content_hash": "7279a449fd73253a28a2148918b7e9f2",
"timestamp": "",
"source": "github",
"line_count": 642,
"max_line_length": 99,
"avg_line_length": 37.78971962616822,
"alnum_prop": 0.5955236799802152,
"repo_name": "oesteban/preprocessing-workflow",
"id": "bd4b977dc641d39e594d80df833167d5d0719686",... |
"""NApp responsible for installing a DROP ipv6 flow on switch setup."""
from kytos.core import KytosEvent, KytosNApp, log
from kytos.core.helpers import listen_to
from pyof.v0x01.common.flow_match import Match
from pyof.v0x01.controller2switch.flow_mod import FlowMod, FlowModCommand
class Main(KytosNApp):
"""Mai... | {
"content_hash": "6be4c2f6f816c258c510ad0c12ee013d",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 79,
"avg_line_length": 35.854166666666664,
"alnum_prop": 0.6130156885531668,
"repo_name": "kytos/kyco-core-napps",
"id": "4ffd3d24c14ff6a1db8eb85ba3f8aa366ff7cec7",
"size":... |
"""Tests for epi_forecast_stat_mech.evaluation.run_on_data."""
import functools
from absl.testing import absltest
from epi_forecast_stat_mech import sir_sim
from epi_forecast_stat_mech.evaluation import run_on_data
import numpy as np
def create_synthetic_dataset(
seed=0,
num_epidemics=50,
num_important_... | {
"content_hash": "cd27285f48a345207258cb660aa81b05",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 73,
"avg_line_length": 31.6875,
"alnum_prop": 0.6811308349769888,
"repo_name": "HopkinsIDD/EpiForecastStatMech",
"id": "19cc6ed23243a6ed87eff5dab491691137a50690",
"size": "... |
import argparse
import tkinter as tk
import math
import numpy
import PIL.ImageTk
import PIL.Image
from colormath.color_objects import sRGBColor, LabColor, HSVColor
from colormath.color_conversions import convert_color
from colormath.color_diff import delta_e_cie2000
IMAGE_SIZE = (600, 400)
def cap_number(number, m... | {
"content_hash": "05c10921b6a958bb5054d39fc31a4360",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 80,
"avg_line_length": 30.590673575129532,
"alnum_prop": 0.5523373983739838,
"repo_name": "CG2016/barkovsky_3",
"id": "db68b1236dd99e831dee8cbfcf4c9ca5ad9e0086",
"size": "... |
"""This example gets the current network that you can make requests against."""
__author__ = ('Nicholas Chen',
'Joseph DiLallo')
# Import appropriate modules from the client library.
from googleads import dfp
def main(client):
# Initialize appropriate service.
network_service = client.GetService('... | {
"content_hash": "9314a1057254334345a0b08a81ce8de1",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 79,
"avg_line_length": 29.875,
"alnum_prop": 0.6903765690376569,
"repo_name": "cctaylor/googleads-python-lib",
"id": "52138ce9354106078805c1235622594b43f69265",
"size": "13... |
"""Test Home Assistant yaml loader."""
import io
import os
import unittest
from unittest.mock import patch
from homeassistant.exceptions import HomeAssistantError
from homeassistant.util import yaml
from homeassistant.config import YAML_CONFIG_FILE, load_yaml_config_file
from tests.common import get_test_config_dir, p... | {
"content_hash": "ed009e2af15321a5954fa989c64cf7d0",
"timestamp": "",
"source": "github",
"line_count": 387,
"max_line_length": 79,
"avg_line_length": 39.48837209302326,
"alnum_prop": 0.5240151812589975,
"repo_name": "eagleamon/home-assistant",
"id": "79fd994ce86c221b216d525c00657d123e74fdf9",
"siz... |
"""MPEG audio stream information and tags."""
import os
import struct
from ._compat import endswith
from mutagen import StreamInfo
from mutagen._util import MutagenError
from mutagen.id3 import ID3FileType, BitPaddedInt, delete
__all__ = ["MP3", "Open", "delete", "MP3"]
class error(RuntimeError, MutagenError):
... | {
"content_hash": "37cd5147958e0829ecd2389698516a4d",
"timestamp": "",
"source": "github",
"line_count": 281,
"max_line_length": 78,
"avg_line_length": 35.405693950177934,
"alnum_prop": 0.5358327470097497,
"repo_name": "jwayneroth/mpd-touch",
"id": "afbfd9535ee1b76dc00d02fbd6edbdaf0c840c73",
"size":... |
import time
from utils.cu_io import IO
from utils.cu_config import config
from managers.products import Products
from managers.listings import Listings
from managers.rates import Rates
from collections import OrderedDict
__author__ = 'Stone'
# Module 'match' -- common domain service
"""service for common records link... | {
"content_hash": "9d6d340fe39aba5bfd6af2c3545f80e9",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 119,
"avg_line_length": 38.44117647058823,
"alnum_prop": 0.5837796480489671,
"repo_name": "alpenliebe/Sortable",
"id": "ef3d0842fae09e6616cb17428e6b847d7a55ddc4",
"size": ... |
def install_dependencies_ode():
from biokit.rtools import package
pm = package.RPackageManager()
if "Rsge" not in pm.installed.index:
#rtools.install_packages("http://cran.r-project.org/src/contrib/Archive/Rsge/Rsge_0.6.3.tar.gz")
pm.install("Rsge")
#pm.install_packages(["snowfall... | {
"content_hash": "cd5602cdb6be52f5cec561793db3ad53",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 104,
"avg_line_length": 33.8125,
"alnum_prop": 0.6654343807763401,
"repo_name": "cellnopt/cellnopt",
"id": "9b76de4809efadbed4a0fcb901a850536f3b6eca",
"size": "543",
"bin... |
if __name__ == '__main__':
import module1
print(module1.sys)
print(module1.name)
print(module1.func)
print(module1.klass)
| {
"content_hash": "c7a1e320c711830987d8af7aaaeae986",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 26,
"avg_line_length": 20.428571428571427,
"alnum_prop": 0.6083916083916084,
"repo_name": "ordinary-developer/education",
"id": "a3668ccbee1bf89d1303a28ed637041c6708806b",
"... |
"""Provides a :class:`.Key` for Google Cloud Datastore.
.. testsetup:: *
from google.cloud import ndb
A key encapsulates the following pieces of information, which together
uniquely designate a (possible) entity in Google Cloud Datastore:
* a Google Cloud Platform project (a string)
* a list of one or more ``(k... | {
"content_hash": "256dcec00c48258b0e67f25fc0f7a868",
"timestamp": "",
"source": "github",
"line_count": 1233,
"max_line_length": 83,
"avg_line_length": 34.850770478507705,
"alnum_prop": 0.5808568569500361,
"repo_name": "jonparrott/gcloud-python",
"id": "b9fc411c7c9ca00ab1f551ce30ec002caedc30c2",
"s... |
from distutils.core import setup
# pylint: enable=import-error
import os
import sys
# pylint: disable=import-error
# pylint: disable=unused-import
import py2exe
# pylint: enable=unused-import
# pylint: enable=import-error
import zmq
import zmq.libzmq
def tree(root_dir, dest):
"""
Create a list with all files... | {
"content_hash": "d041a9964fdf657d728fd2c811d24c4d",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 73,
"avg_line_length": 28.734939759036145,
"alnum_prop": 0.5006289308176101,
"repo_name": "STRML/OpenBazaar",
"id": "114b94162132fcb9cf9f1117810cebfd95f2a03f",
"size": "241... |
import logging
import fixtures
class SetLogLevel(fixtures.Fixture):
"""Override the log level for the named loggers, restoring their
previous value at the end of the test.
To use::
from oslo_log import fixture as log_fixture
self.useFixture(log_fixture.SetLogLevel(['myapp.foo'], logging.DE... | {
"content_hash": "1da9fdc8c4b83cb5e5e2778ac28a2d21",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 76,
"avg_line_length": 31.37142857142857,
"alnum_prop": 0.6311475409836066,
"repo_name": "openstack/oslo.log",
"id": "d3e2e2c15e41624e080a4bc3cb39dc0774df25ab",
"size": "16... |
import os
from ingenico.connect.sdk.factory import Factory
class GetFileExample(object):
def example(self):
with self.__get_client() as client:
headers, chunks = client.merchant("merchantId").files().get_file("fileId")
# make sure all chunks are read
for chunk in chun... | {
"content_hash": "1fc606d95cef55af08c665b6520a1362",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 100,
"avg_line_length": 42.5,
"alnum_prop": 0.5689839572192513,
"repo_name": "Ingenico-ePayments/connect-sdk-python3",
"id": "c52bcf3245527d2d5c7bb768dbba28d9b6f6ae55",
"si... |
import os
# Add parent directory for imports
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.sys.path.insert(0, parentdir)
import boto.swf
import log
import json
import random
from optparse import OptionParser
"""
Amazon SWF LensArticlePublish starter
"""
class starter_LensArticlePublish()... | {
"content_hash": "321e65b4b012f04592a1f1768cc577cd",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 99,
"avg_line_length": 34.5625,
"alnum_prop": 0.5669077757685352,
"repo_name": "gnott/elife-bot",
"id": "96aa33751e4325c4027224f14b50dc2c74cac96c",
"size": "3318",
"binar... |
import sys
import argparse
import math
import numpy as np
def parseArgument():
# Parse the input
parser=argparse.ArgumentParser(description=\
"Convert a matrix of continuous-valued TF peaks to a file in the format for HDP")
parser.add_argument("--continuousMatFileName", required=True,\
help='File with continu... | {
"content_hash": "83099219200842ed8cf1318b6a78b768",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 114,
"avg_line_length": 41.94117647058823,
"alnum_prop": 0.7288452547919588,
"repo_name": "imk1/IMKTFBindingCode",
"id": "2f6269b0aedd56f22ccf4ec86ff9d34f1aa4d6e2",
"size":... |
import os, sys
lib = os.path.abspath(os.path.join(os.path.dirname( __file__ ),'..','hownewspaperswrite'))
sys.path.append(lib)
from django.core.exceptions import ObjectDoesNotExist
from termcolor import colored
class SaveDataInDatabase:
def __init__(self,):
""""""
def dropTable(request, table_na... | {
"content_hash": "3f41f08b0cb5d9cef072d0341c1164af",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 159,
"avg_line_length": 35.175879396984925,
"alnum_prop": 0.5128571428571429,
"repo_name": "andrea-f/hownewspaperswrite",
"id": "b7b2ba78250cf62f864e7cc44e44541a7faab9fa",
... |
import json
import os
import uuid
folder, fname = os.path.split(__file__)
def contents_of(f):
with open(f, 'r') as ins_file:
contents = ' '.join(ins_file.readlines())
return contents
DEBUG = bool(int(os.environ.get('SOWING_DEBUG', 1))) # True
CSRF_SECRET = 'mysecretsRsaf3' if DEBUG else uuid.uuid4().... | {
"content_hash": "b136e47754bd8e92fa8cc42c83781232",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 100,
"avg_line_length": 28.411214953271028,
"alnum_prop": 0.5210526315789473,
"repo_name": "blakev/sowing-seasons",
"id": "d1d3e13e9cdc43c8b51dcc811db25033cfaf0a10",
"size... |
from django.views.generic import TemplateView
class DirectTemplateView(TemplateView):
extra_context = None
def get_context_data(self, **kwargs):
context = super(self.__class__, self).get_context_data(**kwargs)
if self.extra_context is not None:
for key, value in self.extra_con... | {
"content_hash": "d8276032d126df6186f42214080bdf19",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 72,
"avg_line_length": 31.25,
"alnum_prop": 0.572,
"repo_name": "DarioGT/docker-carra",
"id": "7e11f25df20d992753f7fb951e1d224e874df5cc",
"size": "542",
"binary": false,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.