text stringlengths 4 1.02M | meta dict |
|---|---|
import os
import shutil
from setuptools import find_packages
from setuptools import setup
if not os.path.exists('build'):
os.mkdir('build')
shutil.copyfile('imageroller/main.py', 'build/imageroller')
setup(
name='imageroller',
version='0.10.1',
description='Rackspace Server Image Creator',
long_d... | {
"content_hash": "f6a50359bb1bd1eb991018f3c9cc17af",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 63,
"avg_line_length": 28.9811320754717,
"alnum_prop": 0.6243489583333334,
"repo_name": "leeclemens/imageroller",
"id": "715d2e413fb79600e6767a2717a31829e12369ba",
"size": ... |
"""
This module provides JVMs to run programs.
.. moduleauthor:: Michael Markert <markert.michael@googlemail.com>
:copyright: PenchY Developers 2011-2012, see AUTHORS
:license: MIT License, see LICENSE
"""
import itertools
import logging
import os
import shlex
import subprocess
from hashlib import sha1
from tempfi... | {
"content_hash": "a991a03781502b9f40525af53b87f6fb",
"timestamp": "",
"source": "github",
"line_count": 480,
"max_line_length": 89,
"avg_line_length": 31.047916666666666,
"alnum_prop": 0.5759914111252767,
"repo_name": "fhirschmann/penchy",
"id": "d766b991d4529bf65c4b4bc602f4e26521a8d84f",
"size": "... |
import multiprocessing
import time,os
def func(msg):
for i in xrange(3):
print msg + ' ' + str(os.getpid())
time.sleep(1)
return "done " + msg
if __name__ == "__main__":
pool = multiprocessing.Pool(processes=4)
result = []
for i in xrange(10):
msg = "hello %d" %(i)
... | {
"content_hash": "42dba2eb57a4b6ff2dc42857d31d6aa2",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 54,
"avg_line_length": 24.15,
"alnum_prop": 0.5527950310559007,
"repo_name": "pelucky/python-test",
"id": "3f7038dbbc1b0d17ec937010ef6e65e48a56d62d",
"size": "515",
"bina... |
import threading
from concurrent import futures
from taskflow.engines.action_engine import graph_action
from taskflow.engines.action_engine import task_action
from taskflow.engines import base
from taskflow import exceptions as exc
from taskflow.openstack.common import excutils
from taskflow.openstack.common import ... | {
"content_hash": "f3e2137fced92f1adbd8f92f9ae1f5b1",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 78,
"avg_line_length": 37.914529914529915,
"alnum_prop": 0.6157574391343553,
"repo_name": "ntt-sic/taskflow",
"id": "f104dac28576c2165f23e72ea2eb33e1678137f8",
"size": "95... |
"""Inception - reduced version of keras/applications/inception_v3.py ."""
from kws_streaming.layers import modes
from kws_streaming.layers import speech_features
from kws_streaming.layers.compat import tf
import kws_streaming.models.model_utils as utils
def model_parameters(parser_nn):
"""Inception model parameters... | {
"content_hash": "30fa40be6e5068cc27e91cf5699d5e83",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 79,
"avg_line_length": 31.99290780141844,
"alnum_prop": 0.651961870982044,
"repo_name": "google-research/google-research",
"id": "690c15338446150dd17384a1bd1b6af78000c75b",
... |
"""Commands that can be used to operate on explorations.
All functions here should be agnostic of how ExplorationModel objects are
stored in the database. In particular, the various query methods should
delegate to the Exploration model class. This will enable the exploration
storage model to be changed without affect... | {
"content_hash": "8c392c9722ec0c4c84979ab8d7356dcd",
"timestamp": "",
"source": "github",
"line_count": 1396,
"max_line_length": 84,
"avg_line_length": 41.15186246418338,
"alnum_prop": 0.661589611474725,
"repo_name": "amitdeutsch/oppia",
"id": "b84f587a70bb2901c226d743409a60e2fd9d4190",
"size": "58... |
import argparse
import base64
import json
import cv2
import numpy as np
import socketio
import eventlet
import eventlet.wsgi
import time
from PIL import Image
from PIL import ImageOps
from flask import Flask, render_template
from io import BytesIO
import scipy.misc
from keras.models import model_from_json
from keras... | {
"content_hash": "1d2765469dfbb5d80b1884bea14515ad",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 142,
"avg_line_length": 30.440944881889763,
"alnum_prop": 0.6652871184687015,
"repo_name": "alanswx/udacity-hw-cloning",
"id": "8d1f794ad8f00047b23c05e6a1f3e378a06a4f3a",
... |
import sys
from contextlib import contextmanager
from PySide.QtGui import *
class Window(QWidget):
def __init__(self, parent=None):
super(Window, self).__init__(parent)
@contextmanager
def application():
"""Enable running from within and outside host"""
if not QApplication.instance(): # or u... | {
"content_hash": "6f59945c5d663ab912d257d55b54e6b3",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 53,
"avg_line_length": 18.037037037037038,
"alnum_prop": 0.6344969199178645,
"repo_name": "madoodia/codeLab",
"id": "3d83d9aa09c714e3a8d24778453e65078fb4dd55",
"size": "487... |
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
import uuid
from .. import models
class TopicsOperations(object):
"""TopicsOperations operations.
:param client: Client for service requests.
:param config: Configuration of service client.
:param seria... | {
"content_hash": "3c082affb99dc654652ea67ec56e70db",
"timestamp": "",
"source": "github",
"line_count": 708,
"max_line_length": 217,
"avg_line_length": 49.259887005649716,
"alnum_prop": 0.6545762128684482,
"repo_name": "rjschwei/azure-sdk-for-python",
"id": "ac2a435d9efea59384d6c173311b63edc9f88072",... |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2016 Alex Forencich
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 without limitation the... | {
"content_hash": "01976ffc7e8b4ef7be0af275caedbded",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 77,
"avg_line_length": 34.78,
"alnum_prop": 0.6716503737780334,
"repo_name": "Diti24/python-ivi",
"id": "5c980abfe9ca94b1ecc9fd067d7d84a1041d6aa3",
"size": "1739",
"binar... |
import gzip
import logging
import os
import pathlib
import urllib.request
import pandas as pd
import requests
from google.cloud import storage
def main(
source_url: str,
source_file: pathlib.Path,
target_file: pathlib.Path,
target_gcs_bucket: str,
target_gcs_path: str,
):
logging.info("NOAA ... | {
"content_hash": "c7fb9c64c18bf853144a7d5151bdbe3b",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 88,
"avg_line_length": 31.625,
"alnum_prop": 0.6143774703557312,
"repo_name": "llooker/public-datasets-pipelines",
"id": "2244a729da78583e092d33757187066d2b2bb598",
"size"... |
from __future__ import unicode_literals
from django.dispatch import Signal
__all__ = ['hook', ]
class Hook(object):
"""
A dynamic-signal dispatcher.\
Should be used through :py:data:`hook`
thread-safety: it's not thread safe, this may change\
in the future if a RLock is added around _registry ... | {
"content_hash": "76ea761213ce66816385ec0140d97b63",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 74,
"avg_line_length": 32.07954545454545,
"alnum_prop": 0.6110520722635494,
"repo_name": "nitely/django-hooks",
"id": "2e2017cd9bad722a7b60ed55688e91041878be9b",
"size": "2... |
import datetime
import json
from django import forms
from django.conf import settings
import pyblog
from publisher.models import Post, KeyStore
class PostForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(PostForm, self).__init__(*args, **kwargs)
self.fields['title'].widget.a... | {
"content_hash": "8ca75dccd05012d443548fea233bbee6",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 136,
"avg_line_length": 39.81818181818182,
"alnum_prop": 0.5589041095890411,
"repo_name": "charlesmastin/django-wordpress-publisher",
"id": "1a337bfc5981b581c5f31b4184d166d3... |
import logging
import config
import redis
from rq import Queue
from modules.metadata.metadata import upload_metadata
from modules.loggingFunctions import initialize_logging
# logging
log_file = initialize_logging()
log = logging.getLogger(__name__)
redis_url = config.REDIS_URL
redis_conn = redis.from_url(redis_url)
m... | {
"content_hash": "3829037249fc1cea388352e58a9319bf",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 95,
"avg_line_length": 31.736842105263158,
"alnum_prop": 0.7562189054726368,
"repo_name": "superphy/backend",
"id": "015537b4ee1326f93f367939971c9d31ed99e07e",
"size": "603... |
import collections
import json
import operator
from datetime import datetime
from django.conf import settings
from . import app_settings
from .exceptions import ACPCalendarException
# noinspection PyPep8Naming
def load_data(apps, schema_editor):
HolidayType = apps.get_model("acp_calendar", "HolidayType")
fo... | {
"content_hash": "fecc94dbcd6d985fb720dfe1b0701f81",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 854,
"avg_line_length": 53.86666666666667,
"alnum_prop": 0.7022277227722772,
"repo_name": "luiscberrocal/django-acp-calendar",
"id": "18a1f6060b8a448f3961555bfea96e7115dda9ed... |
from __future__ import unicode_literals
import os
from setuptools import setup, find_packages
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
REQUIREMENTS = open(os.path.join(os.path.dirname(__file__), 'requirements.txt')).read()
# allow setup.py to be run from any path
os.chdir(os.path.n... | {
"content_hash": "d4a2322f1ea9c6c0c91e768295b4ff73",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 110,
"avg_line_length": 33.75,
"alnum_prop": 0.6977777777777778,
"repo_name": "beedesk/django-trusts",
"id": "7d74ac633f768d97244f51afa13112a35b98264b",
"size": "1397",
"... |
from . import AsyncTestCase, read_fixture, AsyncContext
from notifier import translate
from notifier.model import *
class TestGoogleTranslate(AsyncTestCase):
maxDiff = None
def setUp(self):
super().setUp()
self.client = translate.GoogleTranslateClient('API_KEY')
fixture = read_fixtur... | {
"content_hash": "32343b012bd2088de4dcc00eaf40b988",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 107,
"avg_line_length": 46.41379310344828,
"alnum_prop": 0.6953937592867756,
"repo_name": "KeepSafe/translation-real-time-validaton",
"id": "6b6635ef15a10bed082c98dc65257de84... |
"""Helpers for batch requests to the Google Cloud Firestore API."""
from google.cloud.firestore_v1 import _helpers
class WriteBatch(object):
"""Accumulate write operations to be sent in a batch.
This has the same set of methods for write operations that
:class:`~google.cloud.firestore_v1.document.Docum... | {
"content_hash": "21f36ec672d5a6bfdc515019e7525e85",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 88,
"avg_line_length": 39.04109589041096,
"alnum_prop": 0.6128070175438597,
"repo_name": "tswast/google-cloud-python",
"id": "56483af10c7270a509940be1e5235495fd2dbf33",
"s... |
import sys
import subprocess
import os
import time
import json
orig="original/"
convert1="convert -resize 256x256! "
convert2="convert -resize 50x50! "
train="train/"
thumb="thumbnail/"
path=sys.argv[1]
savepath=sys.argv[2]
iname=sys.argv[3]
path=path.replace(' ','\\ ')
pos=path.rfind(".")
dir=path[:pos]
ext=path[pos:... | {
"content_hash": "f192a7f035a9605483daebb7b6e894dc",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 89,
"avg_line_length": 28.873684210526317,
"alnum_prop": 0.6419978126139264,
"repo_name": "vgene/Image-Management-NodeJS",
"id": "12b5ff17b5424abb53bc43e9d8cb4ed58e483609",
... |
""" S3 Person Registry, controllers
@author: nursix
"""
module = request.controller
# -----------------------------------------------------------------------------
# Options Menu (available in all Functions" Views)
def shn_menu():
response.menu_options = [
[T("Search for a Person"), False, URL(r=req... | {
"content_hash": "883445808b504e5d174f8f781429fd82",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 92,
"avg_line_length": 36.3515625,
"alnum_prop": 0.44315495379325165,
"repo_name": "luisibanez/SahanaEden",
"id": "12626b6b75d12949135fbeb77bfaec9d68315ed9",
"size": "9331... |
import ast
import codecs
import os
import sys
# on_rtd is whether we are on readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
class VersionFinder(ast.NodeVisitor):
def __init__(self):
self.version = None
def visit_Assign(self, node):
if getattr(node.targets[0], 'id', No... | {
"content_hash": "4649ffa0e430a90e1bf9ec56141a6252",
"timestamp": "",
"source": "github",
"line_count": 337,
"max_line_length": 79,
"avg_line_length": 30.373887240356083,
"alnum_prop": 0.6507424775302852,
"repo_name": "d0ugal-archive/home",
"id": "09fb34184aff90ba1416bfedab74905e4aab6a1a",
"size": ... |
import settings
import nltk
import os
import re
from langdetect import detect
def fix_file(year, month, day, subject, source):
date = year + "-" + month + "-" + day
try:
output_file_path = settings.DOWNLOADS_NEWS + "/final/" + subject + "/news-" + subject + "-" + year + "-" + month + "-" + day + "-... | {
"content_hash": "0b576cc5d4b4cdd5e5b4f4b77302621b",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 147,
"avg_line_length": 30.258064516129032,
"alnum_prop": 0.5223880597014925,
"repo_name": "bromjiri/Presto",
"id": "3bc92e654d5f58c35f2d635f4ccdcfa9e9bf4f22",
"size": "189... |
import os
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy import create_engine
from slamon_afm.settings import Settings
engine = None
session_maker = sessionmaker()
create_session = scoped_session(session_maker)
Base = declarative_base()... | {
"content_hash": "ad225a266e5621f262b4cfb8c0b39d80",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 117,
"avg_line_length": 37.275862068965516,
"alnum_prop": 0.6947271045328399,
"repo_name": "jjonek/slamon-agent-fleet-manager",
"id": "6080508abe5e68f969b0b642fd17c93d3a43b90... |
__author__ = 'David Maxwell <maxwelld90@gmail.com>'
__date__ = '2012-10-31'
from ConfigParser import ConfigParser
from ifind.seeker.common_helpers import file_exists
from base_exception import Error as BaseError
class AbstractConfigReader(object):
'''
The abstract config file reader. Do NOT instantiate this c... | {
"content_hash": "c383a0245d05e5d3bb9705d283a41aca",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 342,
"avg_line_length": 52.76056338028169,
"alnum_prop": 0.6457554725040042,
"repo_name": "leifos/ifind",
"id": "fd0bfa80d5d632723022c07ee8fa3a448bb693cb",
"size": "7626",... |
import os
def genconfig() :
from SCons.Script import SCons
PreProcessor = SCons.cpp.PreProcessor()
try:
f = file('rtconfig.h', 'r')
contents = f.read()
f.close()
except :
print("Open rtconfig.h file failed.")
PreProcessor.process_contents(contents)
options = P... | {
"content_hash": "e31e4ff6dd929d05b9e3e0b7484c244a",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 56,
"avg_line_length": 26.6875,
"alnum_prop": 0.5175644028103045,
"repo_name": "yongli3/rt-thread",
"id": "de8681e1f8804343294f6c8308167bb0dd7ae336",
"size": "854",
"bina... |
if __name__ == '__main__':
import argparse
import os
from ard.main import ARD, readInput
# Set up parser for reading the input filename from the command line
parser = argparse.ArgumentParser(description='Automatic Reaction Discovery')
parser.add_argument('file', type=str, metavar='infile', hel... | {
"content_hash": "4282143cf525f4caffcc39a5f3e1f255",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 108,
"avg_line_length": 31.636363636363637,
"alnum_prop": 0.6752873563218391,
"repo_name": "cgrambow/AutomaticReactionDiscovery",
"id": "cd89237990ba996c494a1c9b712af1d5cfd24... |
import sys
import svm
import svmutil
from svmutil import *
import os
import time
import mygrid
from multiprocessing import Pool
from scipy import *
from numpy import *
import matplotlib
#matplotlib.use("Agg")
from pylab import *
from matplotlib.backends.backend_pdf import PdfPages
#from numpy import mean,cov,double... | {
"content_hash": "c713ae4146cee1688818235913bdb0cf",
"timestamp": "",
"source": "github",
"line_count": 574,
"max_line_length": 206,
"avg_line_length": 37.66202090592334,
"alnum_prop": 0.6293366638912018,
"repo_name": "MD2Korg/memphis-dataprocessingframework",
"id": "a56ef7bb21f16e2a68cbbbc8db845f170... |
import numpy as n
import numpy.random as nr
import random as r
from python_util.util import *
from python_util.data import *
from python_util.options import *
from python_util.gpumodel import *
import sys
import math as m
import layer as lay
from convdata import ImageDataProvider, CIFARDataProvider, DummyConvNetLogRegD... | {
"content_hash": "2a4992f5985d055ca420f1ece2d2bbad",
"timestamp": "",
"source": "github",
"line_count": 307,
"max_line_length": 209,
"avg_line_length": 53.876221498371336,
"alnum_prop": 0.5918379685610641,
"repo_name": "elhuhdron/emdrp",
"id": "5bae29b6da2e9d523c3093249183c79697e4990d",
"size": "17... |
from .services.quota_controller import QuotaControllerAsyncClient, QuotaControllerClient
from .services.service_controller import (
ServiceControllerAsyncClient,
ServiceControllerClient,
)
from .types.check_error import CheckError
from .types.distribution import Distribution
from .types.http_request import Http... | {
"content_hash": "1ec0febfc4f90532c1761b5537fe4896",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 88,
"avg_line_length": 26.95744680851064,
"alnum_prop": 0.7434885556432518,
"repo_name": "googleapis/python-service-control",
"id": "a214a2eb43a778f199aac1744ae62d76c1e12609"... |
import json
import os
import sys
import getopt
from jupyter_client.kernelspec import KernelSpecManager
from IPython.utils.tempdir import TemporaryDirectory
kernel_json = {"argv":[sys.executable,"-m","kdbq_kernel", "-f", "{connection_file}"],
"display_name":"Kdb/Q",
"language":"q",
"codemirror_mode":"Q",
"env":{"P... | {
"content_hash": "3a7a4f37eb2ca84eb590f116d56c38dd",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 99,
"avg_line_length": 28.574468085106382,
"alnum_prop": 0.6120625465376024,
"repo_name": "newtux/KdbQ_kernel",
"id": "c80ed2f79561e8396c3d1c02c7f267409012e049",
"size": "1... |
import datetime
# Django
import django
from django import forms
from django.db import models
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
SECS_PER_DAY=3600*24
class TimedeltaField(models.Field):
u'''
Store Python's datetime.timedelta in an integer col... | {
"content_hash": "9d71d97d7d7b31e57bd36524e59697bf",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 141,
"avg_line_length": 38.33701657458563,
"alnum_prop": 0.6189652687707162,
"repo_name": "wpjesus/codematch",
"id": "234b670d8bdf53af60db56917751fa0262efcd44",
"size": "7... |
from __future__ import print_function, division, absolute_import, unicode_literals
from ufo2ft.fontInfoData import getAttrWithFallback
from ufo2ft.filters import BaseFilter
from cu2qu.ufo import DEFAULT_MAX_ERR, CURVE_TYPE_LIB_KEY
from cu2qu.pens import Cu2QuPointPen
import logging
logger = logging.getLogger(__name... | {
"content_hash": "b601654a4b74618674a8bfdb79b8221a",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 88,
"avg_line_length": 33.13333333333333,
"alnum_prop": 0.5907444668008048,
"repo_name": "jamesgk/ufo2ft",
"id": "6347f4db664b52d3b11a74c861d3e5e2a8a87fa9",
"size": "2485",... |
from django.apps import AppConfig
from django.db.backends.mysql.base import DatabaseWrapper
from django.db.migrations.recorder import MigrationRecorder
from core import Core
from core.libs.install import get_installation_status, install_database
class Initialize(Core, AppConfig):
name = 'core'
def ready(sel... | {
"content_hash": "2d2a50dcd65e112b578df622e642df5a",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 127,
"avg_line_length": 35.8,
"alnum_prop": 0.7332402234636871,
"repo_name": "jat001/JADB",
"id": "4aef833abac84b0cedad486a55b93304e4a3c9cc",
"size": "797",
"binary": fal... |
from __future__ import unicode_literals
import ipaddress
from django.conf import settings
class UseXForwardedFor(object):
def process_request(self, request):
"""
Update request.META['REMOTE_ADDR'] to use the address from the X-Forwarded-For header
"""
if getattr(settings, 'USE_X_F... | {
"content_hash": "050bf41a2a486b0ba64a18e7c6cb2dac",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 93,
"avg_line_length": 32.15384615384615,
"alnum_prop": 0.507177033492823,
"repo_name": "kellengreen/django-use_x_forwarded_for",
"id": "d4b648ae47b6279429f29c679bdc00547339e... |
"""Installation script for setuptools."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from setuptools import setup
EXTRA_PACKAGES = {
'tf': ['tensorflow>=1.14'],
'tf_gpu': ['tensorflow-gpu>=1.14'],
}
setup(
name='multi_object_datasets',
... | {
"content_hash": "0be06d43b75e08cb8c616f754a030de0",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 76,
"avg_line_length": 35,
"alnum_prop": 0.6408163265306123,
"repo_name": "deepmind/multi_object_datasets",
"id": "b14f7b207dc6023b6456b8b41f665137e2277bcf",
"size": "2164"... |
from sfc_models.objects import *
from sfc_models.examples.Quick2DPlot import Quick2DPlot
register_standard_logs('output', __file__)
mod = Model()
country = Country(mod, 'CO')
Household(country, 'HH')
ConsolidatedGovernment(country, 'GOV')
FixedMarginBusiness(country, 'BUS', profit_margin=.025)
Market(country, 'GOOD')... | {
"content_hash": "a868713e1bfa301c2462ff6af1739dad",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 113,
"avg_line_length": 36.38709677419355,
"alnum_prop": 0.6985815602836879,
"repo_name": "brianr747/SFC_models",
"id": "d4fd04698f7477aacd1d458ba68e94970c4579ef",
"size": ... |
import unittest
import logging
import tkp.db.model
from tkp.testutil.alchemy import gen_band, gen_dataset, gen_skyregion,\
gen_lightcurve
import tkp.db
import tkp.db.alchemy
from tkp.steps.varmetric import execute_store_varmetric
logging.basicConfig(level=logging.INFO)
logging.getLogger('sqlalchemy.engine').s... | {
"content_hash": "8807082e6545b6147bb3b3dc8e0472fd",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 76,
"avg_line_length": 26.789473684210527,
"alnum_prop": 0.6944990176817288,
"repo_name": "mkuiack/tkp",
"id": "796476466929755a1a44ccfe2f22da6431e45448",
"size": "1018",
... |
"""
Local file system storage.
"""
import errno
from hashlib import md5
import io
import os
from ._compat import urlopen
from .thumb import Thumb
def make_dirs(path):
try:
os.makedirs(os.path.dirname(path))
except (OSError) as e:
if e.errno != errno.EEXIST:
raise
return path
... | {
"content_hash": "87bb4675737beca741083f7b3653bc3e",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 78,
"avg_line_length": 29.095588235294116,
"alnum_prop": 0.5569876168814759,
"repo_name": "lucuma/moar",
"id": "ee34342bcd5ff88b5029e7fa8ab2862b937645ba",
"size": "3972",
... |
"""Cloudpipe interface."""
from novaclient import base
class Cloudpipe(base.Resource):
"""A cloudpipe instance is a VPN attached to a project's VLAN."""
def __repr__(self):
return "<Cloudpipe: %s>" % self.project_id
def delete(self):
"""
Delete the own cloudpipe instance
... | {
"content_hash": "f7ecfbbdfce830cfbae73dff771740a3",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 70,
"avg_line_length": 29.96,
"alnum_prop": 0.6054739652870494,
"repo_name": "xuweiliang/Codelibrary",
"id": "cf8040b1764cc5a62f2059c1925673f9e8cf7d0e",
"size": "2134",
"... |
from __future__ import unicode_literals
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
class Company(models.Model):
name = models.CharField(max_length=30)
public = models.BooleanField(default=False)
cl... | {
"content_hash": "b38d32bbfd30886e20278e6bb78f7c3d",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 80,
"avg_line_length": 32.72222222222222,
"alnum_prop": 0.7495755517826825,
"repo_name": "rsinger86/drf-flex-fields",
"id": "df01d9d339a30978632622ca62ad32437c07fd60",
"siz... |
from __future__ import (unicode_literals, absolute_import,
division, print_function)
import logging
from django.http import Http404
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from snisi_core.permissions import provider_allowed_or_denied
from s... | {
"content_hash": "022a74272dc0e6f63f0722db943d42f9",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 78,
"avg_line_length": 32.80099502487562,
"alnum_prop": 0.6103443045654482,
"repo_name": "yeleman/snisi",
"id": "d030ad11b454947423a67df0f732fc2f1c84029f",
"size": "6677",... |
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_pdq', [dirname(__file__)])
except ImportError:
import _pdq
... | {
"content_hash": "93ad7dc48a4304779629fa19472d28cf",
"timestamp": "",
"source": "github",
"line_count": 451,
"max_line_length": 135,
"avg_line_length": 38.70509977827051,
"alnum_prop": 0.6701993583868011,
"repo_name": "evelynmitchell/pdq",
"id": "838cec04176a70b973d492923729673eff3615c6",
"size": "... |
import requests
import sys
import json
URL = "http://openpayments.us/data?query=%s"
query = sys.argv[1]
r = requests.get(URL % query)
jsondata = r.text
#print jsondata # raw json
data = json.loads(jsondata) # dictionary version
print(json.dumps(data, indent=4))
| {
"content_hash": "f72c37d92577a9a38dfba798fb96d683",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 60,
"avg_line_length": 19.0625,
"alnum_prop": 0.6327868852459017,
"repo_name": "parrt/msan692",
"id": "05460565336dde993759b0499a3793440eb580c0",
"size": "352",
"binary":... |
"""
This module handles sending static content such as in-memory data or
files. At this time it has cache helpers and understands the
if-modified-since request header.
"""
import os, time, mimetypes, zipfile, tarfile
from paste.httpexceptions import *
from paste.httpheaders import *
CACHE_SIZE = 4096
BLOCK_SIZE = 40... | {
"content_hash": "c5b58f9902bae6e7d2b0715c21be86fb",
"timestamp": "",
"source": "github",
"line_count": 308,
"max_line_length": 81,
"avg_line_length": 37.91883116883117,
"alnum_prop": 0.5854097097354225,
"repo_name": "santisiri/popego",
"id": "e72db7f08691e3d9242a0a8301872b78a57b86ec",
"size": "120... |
from typing import Optional
from tableauserverclient import WorkbookItem
from airflow.exceptions import AirflowException
from airflow.models import BaseOperator
from airflow.providers.tableau.hooks.tableau import TableauHook
class TableauRefreshWorkbookOperator(BaseOperator):
"""
Refreshes a Tableau Workboo... | {
"content_hash": "b3f8352c9f9fe5a52848c3b36f8096ba",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 110,
"avg_line_length": 39.18987341772152,
"alnum_prop": 0.6385658914728682,
"repo_name": "sekikn/incubator-airflow",
"id": "cca01e7b451d0b64cef1e19d88ec0d71b97fee4c",
"siz... |
"""Functions to plot epochs data."""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
# Jaakko Leppakangas <jaeilepp@student.jyu.fi>
# ... | {
"content_hash": "e666dd491680e66f465031dec869069f",
"timestamp": "",
"source": "github",
"line_count": 2041,
"max_line_length": 79,
"avg_line_length": 43.29642332190103,
"alnum_prop": 0.5586071881223973,
"repo_name": "cjayb/mne-python",
"id": "cce5a80dc4aa4bf6c663f56031402333b0be757d",
"size": "88... |
from tests.test_helper import *
from distutils.version import LooseVersion
import platform
import braintree
import requests
class TestHttp(unittest.TestCase):
if LooseVersion(requests.__version__) >= LooseVersion('1.0.0'):
SSLError = requests.exceptions.SSLError
else:
SSLError = requests.models... | {
"content_hash": "c10cae3921e86082d087a92c0d11899c",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 146,
"avg_line_length": 37.744680851063826,
"alnum_prop": 0.6457158962795941,
"repo_name": "braintree/braintree_python",
"id": "b87218a01b97d732bdf6133745bdd028de07cffa",
"... |
"""
Predict memory usage on parallelized runs.
"""
import argparse
import redmapper
parser = argparse.ArgumentParser(description="Predict memory usage when running in parallel.")
parser.add_argument('-c', '--configfile', action='store', type=str, required=True,
help='YAML config file')
parser.a... | {
"content_hash": "cc4d27099f57368b67168a000468d90c",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 94,
"avg_line_length": 32.541666666666664,
"alnum_prop": 0.6888604353393086,
"repo_name": "erykoff/redmapper",
"id": "512a3a00f02f58df6b5f0d89e4993dc388f80519",
"size": "80... |
import wx
import PanelData
import PanelAnalysis
import Calculation
class MainFrame(wx.Frame):
"""
Initiation of MainFrame with PanelData, PanelOption and ButtonStart
"""
def __init__(self):
wx.Frame.__init__(self, None, wx.ID_ANY, title="STEN 1.0",
pos... | {
"content_hash": "5189c5a3a84aeaa4f5b7fdc738e8722e",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 79,
"avg_line_length": 39.16447368421053,
"alnum_prop": 0.548966907441626,
"repo_name": "jknebel/STEN",
"id": "ee8a6d06419ff992d3bf3b6acb31c3245ec56c6d",
"size": "5953",
... |
from enum import Enum
LEARN_DUMMY = None
LEARN_RYTHM_MULTIPLIER = '2'
LEARN_BASE_RYTHM = '2'
LEARN_MAX_WORDS = '5'
available_settings = Enum('available_settings', 'LEARN_RYTHM_MULTIPLIER LEARN_BASE_RYTHM LEARN_MAX_WORDS')
| {
"content_hash": "9e639d0fbf0ab88e4be2c3de72401548",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 106,
"avg_line_length": 28,
"alnum_prop": 0.7455357142857143,
"repo_name": "Aigrefin/py3learn",
"id": "f55d5982f0cc0c5a9ae830671d6557f515258573",
"size": "224",
"binary": ... |
import unittest
from os.path import abspath, dirname, join
import sys
DIR_TESTS = abspath(dirname(__file__))
DIR_LIB = join(dirname(DIR_TESTS), 'b2tob3')
sys.path.insert(0, DIR_LIB)
from b2tob3.b2tob3 import make_replacements
def get_replacement(fname):
with open(join(DIR_TESTS, fname), 'r') as f:
cont... | {
"content_hash": "bfab048b1264611fc4fc1e38381da13d",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 56,
"avg_line_length": 25.464285714285715,
"alnum_prop": 0.6774193548387096,
"repo_name": "yaph/b2tob3",
"id": "f652e657c35ab128e3e56535791923edcd15de62",
"size": "737",
... |
def cheese_and_crackers(cheese_count, boxes_of_crackers):
print "You have %d cheeses!" % cheese_count
print "You have %d boxes of crackers1" % boxes_of_crackers
print "Man that's enough for a party!"
print "Get a blanket.\n"
print "We can just give the function numbers directly:"
cheese_and_crackers(20... | {
"content_hash": "2c002141a5562cb51f9448564d39902a",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 70,
"avg_line_length": 34.35,
"alnum_prop": 0.7234352256186317,
"repo_name": "1uk/LPTHW",
"id": "7687838950d91da8d56daac168e53659f9297cd3",
"size": "687",
"binary": false... |
import logging
import threading
import eventlet
from eventlet import greenpool
from conveyor.common import loopingcall
LOG = logging.getLogger(__name__)
def _thread_done(gt, *args, **kwargs):
"""Callback function to be passed to GreenThread.link() when we spawn()
Calls the :class:`ThreadGroup` to notify i... | {
"content_hash": "afa7dad60fe22e00ce1c638e25fb0f92",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 79,
"avg_line_length": 31.066176470588236,
"alnum_prop": 0.5798816568047337,
"repo_name": "Hybrid-Cloud/conveyor",
"id": "9281a79540c637a6a47effa0e2a00e882d5e8a70",
"size"... |
from collections.abc import Iterable, Mapping
from numbers import Real, Integral
from pathlib import Path
import subprocess
from xml.etree import ElementTree as ET
import numpy as np
import openmc
import openmc.checkvalue as cv
from ._xml import clean_indentation, reorder_attributes
from .mixin import IDManagerMixin
... | {
"content_hash": "e1c9f3026a4cb1b1e37af65207ab9086",
"timestamp": "",
"source": "github",
"line_count": 849,
"max_line_length": 88,
"avg_line_length": 33.64193168433451,
"alnum_prop": 0.5640711434773475,
"repo_name": "amandalund/openmc",
"id": "0abff20d7b3ffc2d220e62663c7f6ae3523e209a",
"size": "28... |
import datetime
import json
import lib.pushdata
import lib.getconfig
import lib.commonclient
import lib.puylogger
jolokia_url = lib.getconfig.getparam('Cassandra', 'jolokia')
cluster_name = lib.getconfig.getparam('SelfConfig', 'cluster_name')
check_type = 'cassandra'
reaction = -3
def runcheck():
local_vars = []
... | {
"content_hash": "a84b880527fcaca9abd6b66f1cac0a1b",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 190,
"avg_line_length": 55.22754491017964,
"alnum_prop": 0.5435324731649138,
"repo_name": "net-angels/puypuy",
"id": "3f1d4ee29b79bc501097cf12f4eee99227a31386",
"size": "9... |
from src.PincherArm import PincherArm
from time import sleep
# set up arm
arm = PincherArm()
# move arm straight up
arm.init_arm()
# wait 3 seconds
sleep(3)
# move arm to shutdown position
arm.shutdown_position()
# kill power to arm
arm.servos.turn_off()
| {
"content_hash": "dcc73824a0ce0c1a697f404535a154f9",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 37,
"avg_line_length": 19.692307692307693,
"alnum_prop": 0.75,
"repo_name": "nick-zanobini/nick-zanobini.github.io",
"id": "1c5fc0a3a33d5990433286968cc28fe7a9137c41",
"size... |
'''
This script reads data from various sources to process and store in MongoDB.
'''
import os
import pyexcel
import logging
import json
import models
from transform_date import *
from accent_remover import *
logging.basicConfig(filename='logs/manuscritos.info.txt', level=logging.INFO)
logger = logging.getLogger(__na... | {
"content_hash": "2893b4bb871247b430d1f70bf46ce6ed",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 77,
"avg_line_length": 25.205882352941178,
"alnum_prop": 0.5414235705950992,
"repo_name": "scieloorg/journals-catalog",
"id": "f00f90e1c7f8a7649da69f6c8dfe0e6c32285d6c",
"s... |
import tensorflow as tf
import numpy as np
from trainer_nn import TrainerNN
class RepslyFF(TrainerFF):
| {
"content_hash": "8f282de5277708e9d5715901db6dcfb2",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 32,
"avg_line_length": 17.5,
"alnum_prop": 0.8095238095238095,
"repo_name": "wecliqued/deep_learning",
"id": "fe3ca4e28ff74290136fd466d787c76bf7688f7d",
"size": "105",
"bi... |
from mock import PropertyMock, MagicMock, patch
from workflow.steps.util.database import (StopIfRunning, StopSlaveIfRunning,
StopIfRunningAndVMUp)
from workflow.steps.tests.base import StepBaseTestCase
class StopIfRunningTestCase(StepBaseTestCase):
step_class = StopIfRun... | {
"content_hash": "560ca67d123782c820ff80f4c72b0752",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 76,
"avg_line_length": 40.78666666666667,
"alnum_prop": 0.6953252696959791,
"repo_name": "globocom/database-as-a-service",
"id": "01f6546f58bb12d93ce549eed3b9dce82e446c19",
... |
"""
dyn_pages/feeds.py
Author: Kord Campbell
Date Added: 1/1/07
Builds RSS and ATOM feeds for the various pages on the site - cool, isn't it?
"""
## STD LIBS
from time import mktime
from xml.dom import minidom
from pprint import pformat
import datetime, xml
## OUR LIBS
from decorators import stack
import utils
## ... | {
"content_hash": "52a85458ded107df6aba3027ab4f3726",
"timestamp": "",
"source": "github",
"line_count": 618,
"max_line_length": 319,
"avg_line_length": 38.24595469255664,
"alnum_prop": 0.6599255373159587,
"repo_name": "kordless/zoto-server",
"id": "a09a80f9a855bee397ca025659b09586553f4903",
"size":... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='NoteText',
fields=[
('id', models.AutoField(auto_cr... | {
"content_hash": "e55048bb96197d0217ef0accb6995a0c",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 114,
"avg_line_length": 29.517241379310345,
"alnum_prop": 0.5549065420560748,
"repo_name": "kokopelli314/hydronote",
"id": "0da60563fa016387bd069d113fff085a4bc42e49",
"size... |
import sys
import pandas as pd
import matplotlib.pyplot as plt
def main():
# Assign variables
input_file = sys.argv[1]
output_file = sys.argv[2]
# Load the data
data = pd.read_csv(input_file, delimiter=',')
# Apply the plot function to the loaded data
plt.plot(data)
# Save the plot
plt.savefig(output_fi... | {
"content_hash": "5d8d3a151b40d562300841576297d3e2",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 46,
"avg_line_length": 14.153846153846153,
"alnum_prop": 0.6793478260869565,
"repo_name": "jonahgolden/assignment_9",
"id": "9c1f44be800fed56657cac09e97cf65f70f9887f",
"siz... |
""" Cisco_IOS_XR_asr9k_netflow_oper
This module contains a collection of YANG definitions
for Cisco IOS\-XR asr9k\-netflow package operational data.
This module contains definitions
for the following management objects\:
net\-flow\: NetFlow operational data
Copyright (c) 2013\-2015 by Cisco Systems, Inc.
All righ... | {
"content_hash": "f70aca7eb2f70b8d8ee73eb65c0e5514",
"timestamp": "",
"source": "github",
"line_count": 2317,
"max_line_length": 298,
"avg_line_length": 42.01337936987484,
"alnum_prop": 0.38417997842724333,
"repo_name": "abhikeshav/ydk-py",
"id": "9c09a0e5ed913a456084bedf69d57132cdbd2e83",
"size": ... |
import traceback
import numpy as np
from ..external.qt.QtCore import Qt, Signal
from ..external.qt.QtGui import (QMainWindow, QWidget,
QHBoxLayout, QTabWidget,
QComboBox, QFormLayout, QPushButton,
QAction, QTextEdit, QF... | {
"content_hash": "52d35046912140b0e03a19d8cd6cd8d1",
"timestamp": "",
"source": "github",
"line_count": 700,
"max_line_length": 79,
"avg_line_length": 31.117142857142856,
"alnum_prop": 0.5659719034064824,
"repo_name": "bsipocz/glue",
"id": "c339f198d6a523aa8a882bcbc75148a99e6c9bdd",
"size": "21782"... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'supported_by': 'community',
'status': ['preview']
}
DOCUMENTATION = r'''
---
module: postgresql_membership
short_description: Add or remove PostgreSQL roles from groups
... | {
"content_hash": "178a64daf4ae93d30c99c7595b3916fd",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 98,
"avg_line_length": 28.601895734597157,
"alnum_prop": 0.6647887323943662,
"repo_name": "thaim/ansible",
"id": "31a781e0210ed88e412605f499633b14510bbeff",
"size": "6248"... |
import sys
import unittest
import os
import tempfile
from netCDF4 import Dataset, CompoundType
import numpy as np
from numpy.testing import assert_array_equal, assert_array_almost_equal
# test compound data types.
FILE_NAME = tempfile.NamedTemporaryFile(suffix='.nc', delete=False).name
DIM_NAME = 'phony_dim'
GROUP_NA... | {
"content_hash": "37aa1410a7cff5e0ce9ffa32ff632f3a",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 87,
"avg_line_length": 42.33098591549296,
"alnum_prop": 0.580934952586924,
"repo_name": "Unidata/netcdf4-python",
"id": "72b6892063a1c4e02a9b10ed225e8f29bf2ec30e",
"size":... |
"""Views for Zinnia tags"""
from django.http import Http404
from django.views.generic.list import ListView
from django.views.generic.list import BaseListView
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext as _
from tagging.utils import get_tag
from tagging.models impor... | {
"content_hash": "2acf54e2747751a96392f3a79596a126",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 76,
"avg_line_length": 34.301886792452834,
"alnum_prop": 0.682068206820682,
"repo_name": "westinedu/similarinterest",
"id": "af302fa2517f29adf1c98886cfa1c41cb4d84635",
"siz... |
"""
Django settings for sc_project project.
Generated by 'django-admin startproject' using Django 1.11.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import... | {
"content_hash": "a5b0f0c9b5eacce2ac7516617075f73a",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 91,
"avg_line_length": 27.20625,
"alnum_prop": 0.6898690558235699,
"repo_name": "shovalsa/shecodes_website",
"id": "5d9e47c8e0ab5268168e9b838b039a80cf91156e",
"size": "435... |
"""
homeassistant.components.alarm_control_panel.verisure
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Interfaces with Verisure alarm control panel.
"""
import logging
import homeassistant.components.verisure as verisure
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.const im... | {
"content_hash": "96c51593c14983b8667c50ca56620c37",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 76,
"avg_line_length": 30.627659574468087,
"alnum_prop": 0.6036818339701285,
"repo_name": "pottzer/home-assistant",
"id": "9e0475592bd6250053d251368e258eacb136805e",
"size"... |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Album.public'
db.add_column(u'photoapp_album', 'public',
se... | {
"content_hash": "4a861d796eced9fadb86379ba4083280",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 195,
"avg_line_length": 67.5632183908046,
"alnum_prop": 0.5527390268798911,
"repo_name": "markcharyk/django-photos",
"id": "2461157879b31a095966ce9c2efaab1cc175d345",
"size... |
from traits.api import Bool, Enum, Tuple
from drag_tool import DragTool
class MoveTool(DragTool):
""" Generic tool for moving a component's position relative to its container
"""
drag_button = Enum("left", "right")
# Should the moved component be raised to the top of its container's
# list of c... | {
"content_hash": "fce24bafcae5d68c559724376a797e0e",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 80,
"avg_line_length": 33.509803921568626,
"alnum_prop": 0.593329432416618,
"repo_name": "tommy-u/enable",
"id": "db053c16d3b38cef60f1908cfc969e22688c511b",
"size": "1710",... |
"""
Tests here shouldn't be run with sqlite backend.
"""
from django.test import TestCase
from django.test.client import Client
from django.core.urlresolvers import reverse
from projector.tests.base import test_concurrently
class ThreadedProjectTest(TestCase):
def test_list(self):
url = reverse('project... | {
"content_hash": "973bd17f380666323dc86b007eb7c6d2",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 50,
"avg_line_length": 21.772727272727273,
"alnum_prop": 0.6764091858037579,
"repo_name": "lukaszb/django-projector",
"id": "d96f4989f302a6582e65374c5d6b9119354bb2ea",
"siz... |
"""Setup script for hiiguid."""
from setuptools import setup, find_packages
from hiiguid import VERSION
version = '.'.join(map(str, VERSION))
# some trove classifiers:
# License :: OSI Approved :: MIT License
# Intended Audience :: Developers
# Operating System :: POSIX
setup(
name='hiiguid',
version=versi... | {
"content_hash": "a6e4c0fbca2be19a3c710c53f14680ce",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 77,
"avg_line_length": 26.7,
"alnum_prop": 0.6338951310861424,
"repo_name": "hiidef/hiiguid",
"id": "9b9d736bd9dd4f7da491e60fc809e1fbf2261d42",
"size": "1115",
"binary": ... |
"""Pull out station metadata."""
from collections import ChainMap, namedtuple
from collections.abc import Mapping
from functools import cached_property
import numpy as np
import pandas as pd
from ..cbook import get_test_data
from ..package_tools import Exporter
from ..units import units
exporter = Exporter(globals()... | {
"content_hash": "d886c26088290e3bae2726926d2308ea",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 93,
"avg_line_length": 36.75369458128079,
"alnum_prop": 0.5617209489344592,
"repo_name": "Unidata/MetPy",
"id": "4db0f2ec5e11312b7a93deea08f2ad34c2bfa68e",
"size": "7599",... |
from azure.cli.testsdk import ScenarioTest
from azure.cli.testsdk.scenario_tests import AllowLargeResponse
class SecurityCenterLocationsTests(ScenarioTest):
def test_security_locations(self):
locations = self.cmd('az security location list').get_output_in_json()
assert len(locations) == 1
... | {
"content_hash": "a034d38ad597a03b4b287b995c6a847f",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 93,
"avg_line_length": 31.53846153846154,
"alnum_prop": 0.724390243902439,
"repo_name": "yugangw-msft/azure-cli",
"id": "9c9cb468ca233ecd1b8c31c68803d3a0fb3508ed",
"size": ... |
from django.shortcuts import render
from rest_framework import viewsets
from rest_framework.generics import get_object_or_404
from apps.articles.models import Article
from apps.articles.serializers import ArticleSerializer
class ArticleViewSet(viewsets.ModelViewSet):
queryset = Article.objects.all().order_by('-c... | {
"content_hash": "7002f9c8a7cdea711fcf9b1522f5c619",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 83,
"avg_line_length": 31.583333333333332,
"alnum_prop": 0.7598944591029023,
"repo_name": "sardred/andlarweb",
"id": "8fb9416b1c6b59b529e2b9ccbdab4df83023f822",
"size": "75... |
from artchem.ReactionVessel import *
class Disperser:
def __init__( self ):
""" create networked topology inside single reaction vessel:
multiple vessels are mimicked via different groups of molecular
species
"""
topo = [ [1, 2], [1, 3], [1, 4], [2, 3] ]
(ca... | {
"content_hash": "f557e81cef1087c6c3225b7d4a371019",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 75,
"avg_line_length": 34.15068493150685,
"alnum_prop": 0.5086241476133173,
"repo_name": "danielrcardenas/ac-course-2017",
"id": "f6a59788c16d6c2426ff63aae9c03266f7f814bf",
... |
''' Creates a merchant_id on the testbed.
This is intended to script some work that today is manual on the testbed.
'''
import requests
import json
import random
import sys
import httplib
def create_merchant(testbed_token, integrator_name):
'''creates a merchant and returns the merchant_id'''
url_base =... | {
"content_hash": "a530cd6092bd19ed17ddc4d299f7cdf5",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 81,
"avg_line_length": 31,
"alnum_prop": 0.667741935483871,
"repo_name": "mcash/merchant-api-python-sdk",
"id": "1e545bbe88378542b323fb03a832f5a1d5aaa119",
"size": "930",
... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('trackbuild', '0001_initial'),
]
operations = [
migrations.AlterUniqueTogether(
name='build',
unique_together=set([('release'... | {
"content_hash": "b3ffb6756ea923e4e195097656cceaea",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 58,
"avg_line_length": 20.764705882352942,
"alnum_prop": 0.5949008498583569,
"repo_name": "miraculixx/trackbuild",
"id": "510cf8526ca0ffd014e3a09b9c5a760db1106106",
"size":... |
import json
from . Utils.MongoRouter import MongoRouter
from django.http import JsonResponse
from django.views.decorators.http import require_http_methods
from django.views.decorators.csrf import csrf_exempt
INDEX_HTML = 'index.html'
router = MongoRouter()
def get_user_board(email):
last_visited = router.rou... | {
"content_hash": "0312d76cff1e60a2317ff0f44e8f450d",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 107,
"avg_line_length": 27.23170731707317,
"alnum_prop": 0.5902373488580385,
"repo_name": "1729org/Hadron",
"id": "91874dfe4b25f0f7c08f74a933ed29c9d8894043",
"size": "2233"... |
import time #For sleeping
import datetime #For logging timestamps
import os #For reading contents of directories, symlinks and similar
import json #For parsing the config file
import subprocess #For calling external programs, such as "mount"
import signal #For reloading daemon
import re #For "label-regex" option handli... | {
"content_hash": "9aaa15e075045415152c19e549e5c1af",
"timestamp": "",
"source": "github",
"line_count": 414,
"max_line_length": 318,
"avg_line_length": 44.85990338164251,
"alnum_prop": 0.6564182640534137,
"repo_name": "CRImier/pautomount",
"id": "dbe7c5e31a3d3480d0bab1395ef5bf7d6391a2d7",
"size": "... |
"""Utilities for reading and writing sentences in dragnn."""
import tensorflow as tf
from syntaxnet.ops import gen_parser_ops
class ConllSentenceReader(object):
"""A reader for conll files, with optional projectivizing."""
def __init__(self, filepath, batch_size=32,
projectivize=False, morph_to_po... | {
"content_hash": "a693711ec091a9b6b3cbf34546db33a6",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 75,
"avg_line_length": 30.734375,
"alnum_prop": 0.5693950177935944,
"repo_name": "hang-qi/models",
"id": "444e621cfab0066f333aef84fca33d8f78d5318d",
"size": "1967",
"bina... |
import json
from typing import Optional
from rivr.http import Request, Response
class ProblemResponse(Response):
def __init__(self, status: int, title: Optional[str] = None):
content = json.dumps({'title': title})
super(ProblemResponse, self).__init__(
content=content, status=status, ... | {
"content_hash": "7955618ddd7c1e5c3c08a69574b54efd",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 83,
"avg_line_length": 31.9,
"alnum_prop": 0.664576802507837,
"repo_name": "cocodelabs/api.palaverapp.com",
"id": "a57348ed2ed730600dced6953aa01be3877c6f94",
"size": "638",... |
import lmdb
import os
import tensorflow as tf
import random
import numpy as np
import cv2
def ascii2Label(ascii):
if ascii >= 48 and ascii <=57:
c = ascii - 48
elif ascii >= 65 and ascii <=90:
c = ascii - 65 +10
elif ascii >=97 and ascii <=122:
c = ascii - 97 +10
return c
def str2intLable(strs):
assert typ... | {
"content_hash": "4ea52f08f2f8ca72238c154c0cedc300",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 96,
"avg_line_length": 28.580645161290324,
"alnum_prop": 0.6887697516930023,
"repo_name": "wcy940418/CRNN-end-to-end",
"id": "ba80d7cbd2c77aa56336f132f12b4407a9d76bb9",
"s... |
import logging
import queue
import socket
import sys
import threading
from . import Client
from . import Room
import shelve
logging.basicConfig(filename='logs.log',
level=logging.DEBUG,
format='%(levelname)s %(asctime)-15s %(message)s')
class Server(threading.Thread):
def ... | {
"content_hash": "cf04da40ea9cc9ffd9e509d91cb0444f",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 84,
"avg_line_length": 25.97241379310345,
"alnum_prop": 0.5270844397238449,
"repo_name": "AThom0x7cc/SimpleMultiplayerGame",
"id": "47ba00b0211f4ef7f988e6442c615bd13dc488f3"... |
import unittest
from flowy.exception import SuspendTask, TaskError, TaskTimedout
class ResultTest(unittest.TestCase):
def test_placeholder(self):
from flowy.result import Placeholder
res = Placeholder()
self.assertRaises(SuspendTask, res.result)
def test_error(self):
from fl... | {
"content_hash": "6ab55e6e28dc0b6c84b0d48e41177a51",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 64,
"avg_line_length": 25.413793103448278,
"alnum_prop": 0.6648575305291723,
"repo_name": "severb/flowy-website",
"id": "93d516c2fb38eff4b2b3187c80ed9efea68f005a",
"size": ... |
import threading
import pytest
from tartpy.runtime import behavior, SimpleRuntime
from tartpy.eventloop import EventLoop
from tartpy.tools import Wait
runtime = SimpleRuntime()
def test_runtime_error():
err = False
class TestRuntime(SimpleRuntime):
def throw(self, message):
nonlocal ... | {
"content_hash": "4b3e8df4c1c417fc79e2643228ead13d",
"timestamp": "",
"source": "github",
"line_count": 228,
"max_line_length": 76,
"avg_line_length": 20.82894736842105,
"alnum_prop": 0.5902295220046325,
"repo_name": "waltermoreira/tartpy",
"id": "7f0bceba052848ab9c192e1208d2c85d74e4449b",
"size": ... |
import os
import requests as r
from env2config.interface import LineOriented
DEFAULT_URL = \
"https://raw.githubusercontent.com/apache/kafka/{version}/config/{filename}"
class KafkaDefinition(LineOriented):
service_name = 'kafka'
def get_tags(self):
return {
'scala': self.tags.get(... | {
"content_hash": "37894c74ecf29c7b62990668a831dd79",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 80,
"avg_line_length": 29.337209302325583,
"alnum_prop": 0.5814506539833532,
"repo_name": "dacjames/env2config",
"id": "11b83e0a2934fd3303ae5d57496490535bcf6f26",
"size": "... |
import sys
import os
sys.setrecursionlimit(15000)
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
# sys.path.insert(0, os.path.a... | {
"content_hash": "7366be3839641fe14e44aa6cdc4621f7",
"timestamp": "",
"source": "github",
"line_count": 328,
"max_line_length": 82,
"avg_line_length": 31.298780487804876,
"alnum_prop": 0.6968634326904345,
"repo_name": "AndrewAnnex/SpiceyPy",
"id": "a81978ab98cc2acf8d082bcbe17490b7825ea2a2",
"size":... |
from flask import Flask, redirect, url_for, request, Response, render_template
import wikipedia
app = Flask(__name__)
@app.route('/')
def student():
return render_template('index.html')
@app.route('/search/<name>')
def success(message):
return '%s' % message
@app.route('/search',methods = ['POST', 'GET'])
def... | {
"content_hash": "b5ee807b4cd3ee33a7c25d87020000b3",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 189,
"avg_line_length": 36.75257731958763,
"alnum_prop": 0.6350631136044881,
"repo_name": "csbenk/flash-experiment",
"id": "6048c30e61b2cc746476ffb22b002fd931646ead",
"size... |
"""
Copyright 2016 Brocade Communications Systems, Inc.
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/LICENSE-2.0
Unless required by applicable law or agreed to i... | {
"content_hash": "5bdbde47d064450df6e396914f23973b",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 72,
"avg_line_length": 39.607142857142854,
"alnum_prop": 0.7168620378719567,
"repo_name": "StackStorm/st2contrib",
"id": "8c9c077be1b0ecc0e78b28b509f2485a976d0b80",
"size":... |
"""
SDoc
Copyright 2016 Set Based IT Consultancy
Licence MIT
"""
# ----------------------------------------------------------------------------------------------------------------------
from sdoc.sdoc2.NodeStore import NodeStore
from sdoc.sdoc2.node.Node import Node
class CaptionNode(Node):
"""
SDoc2 node f... | {
"content_hash": "a0d0a8f5c419c211e918a540c31fa410",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 120,
"avg_line_length": 30.92982456140351,
"alnum_prop": 0.33862733976176973,
"repo_name": "OlegKlimenko/py-sdoc",
"id": "d2ad74adafe295adcbaa04e8f473b6f5296152f6",
"size":... |
import pytest
import pandas as pd
import random
from test.zoo.pipeline.utils.test_utils import ZooTestCase
from zoo.chronos.data.repo_dataset import get_public_dataset
class TestRepoDataset(ZooTestCase):
def setup_method(self, method):
pass
def teardown_method(self, method):
pass
def te... | {
"content_hash": "b3a4e4d3de2b241b9015a779a9e13ccc",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 65,
"avg_line_length": 30.466666666666665,
"alnum_prop": 0.649890590809628,
"repo_name": "intel-analytics/analytics-zoo",
"id": "f07a0d14a8d82ed8b5110660f5e257b576a5e147",
... |
from django.forms import widgets
from django.forms.fields import BooleanField, CharField, ChoiceField, MultipleChoiceField
from django.utils.html import format_html
from django.utils.translation import gettext_lazy as _
from entangled.forms import EntangledModelFormMixin
from cms.plugin_pool import plugin_pool
from cms... | {
"content_hash": "2239a0acc830cffa22e83369d7545b15",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 118,
"avg_line_length": 36.34615384615385,
"alnum_prop": 0.6111866969009826,
"repo_name": "jrief/djangocms-cascade",
"id": "0e8e1e4c19e8b9159eca56e8a5607aec6f86da53",
"siz... |
"""Response parsers for the various protocol types.
The module contains classes that can take an HTTP response, and given
an output shape, parse the response into a dict according to the
rules in the output shape.
There are many similarities amongst the different protocols with regard
to response parsing, and the cod... | {
"content_hash": "6516dd9cfe972a2ef667dd7d38a5de72",
"timestamp": "",
"source": "github",
"line_count": 738,
"max_line_length": 79,
"avg_line_length": 40.082655826558266,
"alnum_prop": 0.5764511003684798,
"repo_name": "rest-of/the-deck",
"id": "9b9e1f19700573bd45874f38f02b0dc01ee36c33",
"size": "30... |
import pygame
import random
import sortalgorithm
import threading
class SortDemo:
Margin = 20
TitleHeight = 40
Colors = {
'normal': (pygame.Color(0xAA,0xAA,0xAA), pygame.Color(0x88,0x88,0x88)),
'write': (pygame.Color(0xFF,0x88,0x88), pygame.Color(0xAA,0x44,0x44)),
... | {
"content_hash": "fea8558c1cbf1cf990d36aaf66eadb77",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 171,
"avg_line_length": 39.285714285714285,
"alnum_prop": 0.573475935828877,
"repo_name": "spalladino/algoritmos-gcba",
"id": "729905ab2e3cabd104e03fd8db9a9398b8606d08",
"... |
import sys
import os
import datetime
import time
import subprocess
import signal
#Global settings
port = 2000
iphead = "10.10"
dagsamples = 10 * 1000 * 1000
dagtimeout = 120 #seconds
sm = 5
nwepoch = int(sys.argv[1]) #11 #((3*4000) + (240 * 256 * 8 * .1)) / 1000 #us
... | {
"content_hash": "62bd2c810c066dc27cbd88b7e859b0df",
"timestamp": "",
"source": "github",
"line_count": 224,
"max_line_length": 199,
"avg_line_length": 29.959821428571427,
"alnum_prop": 0.5990165400089406,
"repo_name": "camsas/qjump-expr-tools",
"id": "0aea05401c1d0d7fdc7c206f522175effb8b39db",
"si... |
"""
IMPORTANT NOTE!
To use this module on Mac OS X, you need the PyObjC module installed.
For Python 3, run:
sudo pip3 install pyobjc-core
sudo pip3 install pyobjc
For Python 2, run:
sudo pip install pyobjc-core
sudo pip install pyobjc
(There's some bug with their installer, so install pyobjc-core firs... | {
"content_hash": "86e189a5ce5a99d59eb7b6ea613fe7b5",
"timestamp": "",
"source": "github",
"line_count": 1033,
"max_line_length": 164,
"avg_line_length": 36.594385285575996,
"alnum_prop": 0.6381408391090418,
"repo_name": "RPing/input-paste",
"id": "9ab1d735b0583fb6de252c7635168079365a5199",
"size": ... |
from __future__ import print_function
import os
import sys
import time
from subprocess import Popen, PIPE
__doc__ = """
pfa2txt v2.0 - Feb 03 2016
This script takes a path to a folder as input, finds all the Type 1 fonts
(.pfa files) inside that folder and its subdirectories, and converts them
to plain text Type 1 f... | {
"content_hash": "ea60fc40f31df66d658f19ae08e8396f",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 76,
"avg_line_length": 27.22222222222222,
"alnum_prop": 0.6068027210884354,
"repo_name": "adobe-type-tools/python-scripts",
"id": "4336fedebcda6befb9bcb45d52d64f1b5123d9d4",... |
import numpy as np
import matplotlib.pyplot as plt
from vespa.utils import get_station_coordinates
def fk_analysis(st, smax, fmin, fmax, tmin, tmax, stat='power'):
'''
Performs frequency-wavenumber space (FK) analysis on a stream of time series data for a given slowness range, frequency band and time window.
... | {
"content_hash": "0d3f0c11c7e694ed0172f17f249ba59c",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 196,
"avg_line_length": 41.148648648648646,
"alnum_prop": 0.647400109469075,
"repo_name": "NeilWilkins/vespa",
"id": "c4ffa8c52b591879282fb80fdb84244d879fe4d3",
"size": "9... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.