text stringlengths 4 1.02M | meta dict |
|---|---|
from __future__ import absolute_import, division, print_function
import click
import os
import datetime
from incremental import Version
from twisted.python.filepath import FilePath
_VERSIONPY_TEMPLATE = '''"""
Provides %s version information.
"""
# This file is auto-generated! Do not edit!
# Use `python -m incremen... | {
"content_hash": "2bb50314ad7e6dc4c2896160e5044298",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 78,
"avg_line_length": 29.5,
"alnum_prop": 0.5655751193022873,
"repo_name": "EricMuller/mynotes-backend",
"id": "bc10d3768382ea235a16bde905e01f84c96eeeeb",
"size": "6150",... |
import os
import Queue
import sys
import subprocess
import threading
import unittest
import urllib2
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
TOOLS_DIR = os.path.dirname(SCRIPT_DIR)
CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(TOOLS_DIR)))
sys.path.append(TOOLS_DIR)
import httpd
from mo... | {
"content_hash": "63eaab1278c5e38996224e854f249512",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 78,
"avg_line_length": 30.50467289719626,
"alnum_prop": 0.6602328431372549,
"repo_name": "chromium/chromium",
"id": "2b95875898de969fd92e17239185b66d30930b58",
"size": "34... |
import typing as t
from contextlib import contextmanager
from contextlib import ExitStack
from copy import copy
from types import TracebackType
import werkzeug.test
from click.testing import CliRunner
from werkzeug.test import Client
from werkzeug.urls import url_parse
from werkzeug.wrappers import Request as BaseRequ... | {
"content_hash": "ee7ffc841df373decc9512ddaea968b0",
"timestamp": "",
"source": "github",
"line_count": 286,
"max_line_length": 86,
"avg_line_length": 37.04895104895105,
"alnum_prop": 0.6006983767459418,
"repo_name": "pallets/flask",
"id": "ec9ebb9def2bc981f11da4384507260986e172e6",
"size": "10596"... |
import matplotlib.pyplot as plt
import numpy as np
import pymc
import theano.tensor as T
np.random.seed(42)
theta_true = (25, 0.5)
xdata = 100 * np.random.random(20)
ydata = theta_true[0] + theta_true[1] * xdata
# add scatter to points
xdata = np.random.normal(xdata, 10)
ydata = np.random.normal(ydata, 10)
data = {'... | {
"content_hash": "70ec2fd4f72a0a7e0db5ae120e372c5a",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 89,
"avg_line_length": 30.47872340425532,
"alnum_prop": 0.6178010471204188,
"repo_name": "nmmarquez/pymc",
"id": "bb50417eba3bf4d61c564536f724abacc22b5e0f",
"size": "3251",... |
"""
Brushing Scatter Plot to show data on a table
---------------------------------------------
A scatter plot of the cars dataset, with data tables for horsepower, MPG, and origin.
The tables update to reflect the selection on the scatter plot.
"""
# category: scatter plots
import altair as alt
from vega_da... | {
"content_hash": "bc544a8e526d2376a92abbac58c7e75f",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 86,
"avg_line_length": 27.816326530612244,
"alnum_prop": 0.6647101980924431,
"repo_name": "jakevdp/altair",
"id": "3073f3397927072c05fefbf870b989e4c75401e8",
"size": "1363"... |
import re
from knack.util import CLIError
from knack.log import get_logger
from .custom import get_docker_command
from ._docker_utils import _get_aad_token
from .helm import get_helm_command
from ._utils import get_registry_by_name, resolve_identity_client_id
from ._errors import ErrorClass
from ._format import add_tim... | {
"content_hash": "a025df26d0752fcae6f29dcd7d518a94",
"timestamp": "",
"source": "github",
"line_count": 425,
"max_line_length": 156,
"avg_line_length": 41.548235294117646,
"alnum_prop": 0.652848567221656,
"repo_name": "yugangw-msft/azure-cli",
"id": "54ddc7ca2a070f0a023f3211c36b44cbe025cf5c",
"size... |
# -*- coding: utf-8 -*-
import collections
import itertools
import json
import os
import posixpath
import re
import time
from django.conf import settings
from django.core.cache import cache
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.core.files.storage import default_storage as s... | {
"content_hash": "b21f6fe77b7a54855473f5987c3e3f97",
"timestamp": "",
"source": "github",
"line_count": 2352,
"max_line_length": 79,
"avg_line_length": 37.79506802721088,
"alnum_prop": 0.5887123990370554,
"repo_name": "Witia1/olympia",
"id": "c605a0c6e9001c7bfc777be0fabf4b5f88aefbcd",
"size": "8889... |
"""
Liquid Web DNS Driver
"""
try:
import simplejson as json
except ImportError:
import json
from libcloud.common.liquidweb import LiquidWebResponse, LiquidWebConnection
from libcloud.common.liquidweb import APIException
from libcloud.dns.base import DNSDriver, Zone, Record
from libcloud.dns.types import Prov... | {
"content_hash": "f7cdcfc927079471c30872cb29a82bcc",
"timestamp": "",
"source": "github",
"line_count": 366,
"max_line_length": 79,
"avg_line_length": 33.131147540983605,
"alnum_prop": 0.49488701962724724,
"repo_name": "Kami/libcloud",
"id": "15a8295455cde354121f162df68c8ea40be0ec08",
"size": "1290... |
from django.core.urlresolvers import reverse
from pyquery import PyQuery as pq
from olympia.addons.models import Addon
from olympia.abuse.models import AbuseReport
from olympia.amo.tests import TestCase, user_factory
from olympia.users.models import UserProfile
class TestAbuse(TestCase):
fixtures = ['base/addon... | {
"content_hash": "963cd7016745e7f8437a186a83737bff",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 75,
"avg_line_length": 36.146341463414636,
"alnum_prop": 0.6518218623481782,
"repo_name": "harikishen/addons-server",
"id": "89650417a029602638095fe5c3ab4cb4f0f3eb57",
"siz... |
import threading
import urllib
class MultiUrl(threading.Thread):
def __init__(self, url):
threading.Thread.__init__(self)
self.url = url
def run(self):
urllib.urlopen(self.url).read()
background = MultiUrl('http://slashdot.org')
background.start()
print 'main continues'
background.join... | {
"content_hash": "a809092b4878cb3bbe397b69023637d2",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 44,
"avg_line_length": 23,
"alnum_prop": 0.6695652173913044,
"repo_name": "beqa2323/learntosolveit",
"id": "26309e578be174bee823d5dfaab17b199810c6eb",
"size": "345",
"bin... |
import logging
import endpoints
from protorpc import messages
from protorpc import remote
from google.appengine.api import users
from models import UserModel
from kenix.core.api import kenix_core_api
log = logging.getLogger(__name__)
class AuthRequest(messages.Message):
email = messages.StringField(1)
pass... | {
"content_hash": "7d8e19aaa33fe9ac53762898da53e9c7",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 74,
"avg_line_length": 26,
"alnum_prop": 0.5575539568345323,
"repo_name": "knoguchi/kenix-scm",
"id": "bf1c5a1cdad1ecdcd62e709e8ca9c1fdbddf80b3",
"size": "3614",
"binary... |
from flask_restful import Api
from flask import Blueprint
from .views import UeditorView
ueditor = Blueprint('ueditor', __name__)
ueditor_wrap = Api(ueditor)
ueditor_wrap.add_resource(UeditorView, '/api/ueditor/')
| {
"content_hash": "53a588061b24f8993eb36aa0e356678c",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 55,
"avg_line_length": 21.8,
"alnum_prop": 0.7614678899082569,
"repo_name": "iceihehe/easy-note",
"id": "c59684d034a05d820250c691781bc5c879337e19",
"size": "243",
"binary... |
import sys
verbose = False
def count_syllables(word):
vowels = ['a', 'e', 'i', 'o', 'u']
on_vowel = False
in_diphthong = False
minsyl = 0
maxsyl = 0
lastchar = None
word = word.lower()
for c in word:
is_vowel = c in vowels
if on_vowel == None:
on_vowel = ... | {
"content_hash": "a77dcc9992924aefc4327977941cf16d",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 75,
"avg_line_length": 25.145833333333332,
"alnum_prop": 0.4971002485501243,
"repo_name": "hyperreality/Poetry-Tools",
"id": "8c4a011763d00108f9f34bc6f99fff3d29d1b4ed",
"si... |
from blog.orm import db
from blog.security.models import user_datastore
from blog.application import create_app
from argparse import ArgumentParser
def main(email, password, role_name, alias):
app = create_app()
with app.app_context():
user = user_datastore.create_user(email=email, password=password... | {
"content_hash": "f5b6f396bf434d70a812acd203eae9b5",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 86,
"avg_line_length": 32.96153846153846,
"alnum_prop": 0.691948658109685,
"repo_name": "pbecotte/devblog",
"id": "bc51dc22f64e52a986f9c4b4ccc9cb32a32993dd",
"size": "857",... |
from fabric.api import task, local
import build
__all__ = ['upload', 'register']
@task
def upload():
"""upload the dist to pypi"""
build.sdist()
local("python setup.py sdist upload")
@task
def register():
"""register with pypi. Needs only to be done once."""
local("python setup.py register")
| {
"content_hash": "37fa624d3331714db446e088093cef58",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 57,
"avg_line_length": 18.705882352941178,
"alnum_prop": 0.6446540880503144,
"repo_name": "rajpushkar83/cloudmesh",
"id": "3da75916d411a377c1d341b79eaae4f714b5fa84",
"size"... |
from gi.repository import GLib
import dbus
import dbus.service
from dbus.mainloop.glib import DBusGMainLoop
import json
import os
import crypt
import subprocess
import signal
import re
import random
import socket
class System_DBus(dbus.service.Object):
def __init__(self):
bus_name = dbus.service.BusName('... | {
"content_hash": "51861596481dd3db31d04dfcafe2df47",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 169,
"avg_line_length": 46.13513513513514,
"alnum_prop": 0.5489162272993556,
"repo_name": "alexanderlaw/sqlfiddle2",
"id": "1cc3f0b354d2d5c8c368ee9e1f0f34cd107e8701",
"siz... |
import datetime
from bottle import Bottle, request, response, HTTPResponse
from bottle.ext import sqlalchemy
from bottle import static_file
from gisela.model import engine, Base, Tag, Timelog, Timer
from gisela.response import Response
# --------------------------------
# Add SQLAlchemy app
# ------------------------... | {
"content_hash": "720cccb0a274cd9b26c9ffe21bb6e41d",
"timestamp": "",
"source": "github",
"line_count": 271,
"max_line_length": 117,
"avg_line_length": 29.088560885608857,
"alnum_prop": 0.5879741215273373,
"repo_name": "toirl/gisela",
"id": "27df5e5db350f26375a0dc9a32d5cba02f84e894",
"size": "7883"... |
import traceback, types
class pyloader(object):
def __init__(self, log):
self.log = log
def load(self, name, path):
try:
m = types.ModuleType(name)
exec open(path).read() in m.__dict__
m.__file__ = path
return m
except:
self... | {
"content_hash": "003008797bb6fc1a91a6e1d9dcb10ef4",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 83,
"avg_line_length": 26.555555555555557,
"alnum_prop": 0.48326359832635984,
"repo_name": "AlexWoo/pyed",
"id": "93c5199f66bd4d2e253e91760de64855e4136b6c",
"size": "478",
... |
"""
Setup file for django-errordite.
"""
import os
from os.path import join, dirname, normpath, abspath
from setuptools import setup
# allow setup.py to be run from any path
os.chdir(normpath(join(abspath(__file__), os.pardir)))
# we can't import errordite as it hasn't been installed yet, so instead
# read informatio... | {
"content_hash": "0aa7bd72be3892263b8247782005056c",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 97,
"avg_line_length": 36.355555555555554,
"alnum_prop": 0.6289731051344744,
"repo_name": "yunojuno/django-errordite",
"id": "ba6a15e3d54cd5781db4bce84569718aa41080d2",
"si... |
"""
<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>
The Meteorers helps ...
"""
#<DefineConcept>
import ShareYourSystem as SYS
SYS.setConceptModule(globals())
#</DefineConcept>
| {
"content_hash": "55a20561f5cced5eabb13446b9b96d6f",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 35,
"avg_line_length": 13.529411764705882,
"alnum_prop": 0.7,
"repo_name": "Ledoux/ShareYourSystem",
"id": "7d458c1c3ece9b1035940cf85dbec9f91932ae3a",
"size": "254",
"bin... |
from django.http import FileResponse
from django.core.files.base import ContentFile
from rest_framework import generics
from rest_framework import permissions as drf_permissions
from rest_framework.exceptions import NotFound, PermissionDenied, ValidationError
from framework.auth.oauth_scopes import CoreScopes
from o... | {
"content_hash": "b370e80debed52e49644738449162a81",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 151,
"avg_line_length": 37.125,
"alnum_prop": 0.7003367003367004,
"repo_name": "mattclark/osf.io",
"id": "f0a33b32450a6393afacad5efe2c144efd395b41",
"size": "9504",
"bin... |
import sublime, sys, os
from ArcticTypescript.lib.ArcticTestCase import ArcticTestCase
from sublime_unittest import TestCase
from unittest.mock import MagicMock as MM
Project = sys.modules["ArcticTypescript.lib.system.Project"]
class test_project_opening(ArcticTestCase):
def setUp(self):
# No settings o... | {
"content_hash": "4c5ae4611a99880b7bb5c4ed4027040a",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 81,
"avg_line_length": 28.366336633663366,
"alnum_prop": 0.6387434554973822,
"repo_name": "nimzco/Environment",
"id": "88fa5b897a22bc52dda81190fd5c0938be922908",
"size": "... |
from setuptools import setup, find_packages
setup(name='Rpi-Central',
version='0.0.1',
description='Python project for Raspberry Pi',
author='Julian Kaltenhofer',
author_email='julian.kaltenhofer@gmail.com',
url='https://github.com/kajuten/rpi-central',
license='MIT',
packages... | {
"content_hash": "33e1edd99d8616f76edf9e90725bdad2",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 52,
"avg_line_length": 29.666666666666668,
"alnum_prop": 0.647191011235955,
"repo_name": "kajuten/rpi-central",
"id": "68610fcfb63545301ee407af5be440f423c7a292",
"size": "4... |
def do_not_use_static_url(request):
def exception():
raise Exception(
"Do not use STATIC_URL in templates. Use the {% static %} templatetag (or {% versioned_static %} within admin templates) instead."
)
return {
"STATIC_URL": lambda: exception(),
}
| {
"content_hash": "4942cbaae39cd5a8cc575ed4804186c7",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 142,
"avg_line_length": 33.111111111111114,
"alnum_prop": 0.5973154362416108,
"repo_name": "zerolab/wagtail",
"id": "6d8f37bb2cc64d042eb0d87dbded3b1c01d8009b",
"size": "298"... |
__author__ = "Markus Gumbel"
__copyright__ = "The authors"
__license__ = "Apache 2"
__email__ = "m.gumbel@hs-mannheim.de"
__status__ = "Test"
from Core.ExecConfig import ExecConfig
from Test.Scalability.VerifyGrowth import VerifyGrowth
class VerifyGrowthT1000D4(VerifyGrowth):
def __init__(self, sim, simthread):
... | {
"content_hash": "da3ca72b7ea4a6ff62e9b41c019a739b",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 62,
"avg_line_length": 32,
"alnum_prop": 0.6375,
"repo_name": "informatik-mannheim/Moduro-CC3D",
"id": "d7c2c7eeb560e7f9198683ac51906b245479fbfa",
"size": "1254",
"binary... |
from model.group import Group
class GroupHelper:
def __init__(self,app):
self.app = app
def open_groups_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("/groups.php") and len(wd.find_elements_by_name("new")) > 0):
wd.find_element_by_link_text("groups").click()
... | {
"content_hash": "cf2c0ae056b4ed6df13a196e090df397",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 101,
"avg_line_length": 31.79020979020979,
"alnum_prop": 0.5948086229652442,
"repo_name": "Manolaru/Python_Study",
"id": "cedcf5eacf44745fdd4a4c36931f601b6354d245",
"size"... |
import pytest
import os
from statico.utils import sorted_list_dir, parse_metadata
@pytest.mark.utils
class TestUtils:
def test_sorted_list_dir(self, tmpdir):
for i in range(50):
f = tmpdir.join('file' + str(i) + '.txt')
f.write('test')
srtd = [f.stat().st_mtime for f in s... | {
"content_hash": "e2957d97b8b4ab1b868e2138340a1e20",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 100,
"avg_line_length": 32.9,
"alnum_prop": 0.5828267477203647,
"repo_name": "oss6/statico",
"id": "df5296fd64df3bb7b796008825ab05dd95cd6cb6",
"size": "1341",
"binary": f... |
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,re,shlex,sys
from waflib import Build,Utils,Task,Options,Logs,Errors,ConfigSet,Runner
from waflib.TaskGen import after_method,feature
from waflib.Configure import co... | {
"content_hash": "48b538e9dc41bc5cfdf94a6caba091cb",
"timestamp": "",
"source": "github",
"line_count": 728,
"max_line_length": 430,
"avg_line_length": 30.428571428571427,
"alnum_prop": 0.6517695919104369,
"repo_name": "pipsiscool/audacity",
"id": "e6d3b5d4d81a47de6dba471319900cc7973b391b",
"size":... |
import warnings
import functools
def deprecated(func):
'''This is a decorator which can be used to mark functions
as deprecated. It will result in a warning being emitted
when the function is used.'''
@functools.wraps(func)
def new_func(*args, **kwargs):
warnings.warn_explicit(
... | {
"content_hash": "790da91e18ed78d1f237b45d1c06a969",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 68,
"avg_line_length": 31,
"alnum_prop": 0.6366723259762309,
"repo_name": "hamaxx/uasparser2",
"id": "a35ed77f56574ec417dcc5314f4ce27684f3651c",
"size": "589",
"binary": ... |
import unittest
__author__ = 'Dirk Dittert'
CONTENT = """\
-------------------------------------------------------------------------------
PdId: 1
Model Number: Hitachi HDS72302
Drive Type: SATA
SMART Status: Enable
SMART Health Status: OK
SCT Status Version: 3
SCT Version (vendor specific): 2... | {
"content_hash": "87259efd823757f4653939d90e7bb1e1",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 101,
"avg_line_length": 43.92857142857143,
"alnum_prop": 0.5742793791574279,
"repo_name": "dittert/pyprobe",
"id": "12aaa8b561b16ed8767fe8b2d3cba9c95cc68583",
"size": "678... |
import ssl
import tempfile
import pytest
from ...utils.data import get_pkg_data_filename
from ..hub import SAMPHubServer
from ..integrated_client import SAMPIntegratedClient
from ..errors import SAMPProxyError
# By default, tests should not use the internet.
from .. import conf
from .test_helpers import random_par... | {
"content_hash": "8b93bd8a913234890de81b516d1e1e80",
"timestamp": "",
"source": "github",
"line_count": 235,
"max_line_length": 97,
"avg_line_length": 36.5531914893617,
"alnum_prop": 0.6011641443538999,
"repo_name": "kelle/astropy",
"id": "758ee9e6484762999bc5a1a321e1f95763ffefbc",
"size": "8590",
... |
import os
from neupy import storage, architectures
from imagenet_tools import (CURRENT_DIR, FILES_DIR, load_image,
print_top_n, download_file)
RESNET50_WEIGHTS_FILE = os.path.join(FILES_DIR, 'resnet50.hdf5')
DOG_IMAGE_PATH = os.path.join(CURRENT_DIR, 'images', 'german-shepherd.jpg')
de... | {
"content_hash": "3550d23708581cdfea89b77b69004aaa",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 89,
"avg_line_length": 30.657894736842106,
"alnum_prop": 0.663519313304721,
"repo_name": "itdxer/neupy",
"id": "056cdeec0443c7457997a3233ebab49d48640220",
"size": "1165",
... |
"""This code example gets all active placements by using a statement. To create
a placement, run create_placements.py."""
__author__ = 'api.shamjeff@gmail.com (Jeff Sham)'
# Locate the client library. If module was installed via "setup.py" script, then
# the following two lines are not needed.
import os
import sys
sy... | {
"content_hash": "4681d87b01a8947656f71ccf80e46226",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 80,
"avg_line_length": 30.8,
"alnum_prop": 0.6724386724386724,
"repo_name": "krux/adspygoogle",
"id": "9c4367cc0e7f7d855af43029b8cdfb501e7bd3ca",
"size": "2004",
"binary"... |
"""Misc. useful functionality used by the rest of this package.
This module provides common functionality used by the other modules in
this package.
"""
import sys
import os
import subprocess
# Whether or not to show debug messages
DEBUG = False
def notify(msg, *args):
"""Print a message to stderr."""
pri... | {
"content_hash": "6abe50d6776e54693ad892680157ba54",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 78,
"avg_line_length": 32.864583333333336,
"alnum_prop": 0.5949286846275753,
"repo_name": "racker/omnibus",
"id": "dce83e60660825ba115c503ce0776955d90c1a44",
"size": "6333... |
import sys
import os
sys.path.append("../tools")
import mergejs
import optparse
def build(config_file = None, output_file = None, options = None):
have_compressor = []
try:
import jsmin
have_compressor.append("jsmin")
except ImportError:
print "No jsmin"
try:
# tools/clo... | {
"content_hash": "87f6f333c2d313f77692173643e3d1ea",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 481,
"avg_line_length": 43.234042553191486,
"alnum_prop": 0.6389435695538058,
"repo_name": "boundlessgeo/openlayers",
"id": "da539a29ab4514ebfc812a11961fd8c4e1ca8bea",
"si... |
import binascii
import collections
import json
def formating():
string = "Number 1: {0}, Number 2: {1:+012b}, Number 3: {2:010d}"
string = string.format(4, 6, -9)
assert string == "Number 1: 4, Number 2: +00000000110, Number 3: -000000009"
## The `str.encode()` method doesn't seem to have made it's way f... | {
"content_hash": "4871bce2deb39a32652106cf35a0ebd1",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 80,
"avg_line_length": 29.240506329113924,
"alnum_prop": 0.606926406926407,
"repo_name": "holycrap872/til",
"id": "b021d43a5e9aace54623d10131b89ce02d9c10bb",
"size": "2330"... |
"""Parse web services description language to get SOAP methods.
Rudimentary support."""
ident = '$Id: WSDL.py 1467 2008-05-16 23:32:51Z warnes $'
from version import __version__
import wstools
import xml
from Errors import Error
from Client import SOAPProxy, SOAPAddress
from Config import Config
import urllib
class... | {
"content_hash": "d3eae120bb6e43b4defeea0966e81b94",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 123,
"avg_line_length": 37.22627737226277,
"alnum_prop": 0.5798039215686275,
"repo_name": "wpa/jirash",
"id": "84f7d3f5c85b9dda001f59a923a7a846ef86dac4",
"size": "5100",
... |
import os
import sqlite3
import re
from flask import Flask
from flask import send_from_directory
from flask import render_template
from flask import request
from flask import redirect
from flask import url_for
DATABASE = './dream.db'
app = Flask(__name__)
@app.route('/')
def go_home():
return redirect(url_for('han... | {
"content_hash": "a656d15ae14dccaab10867969aaabf55",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 98,
"avg_line_length": 33.114285714285714,
"alnum_prop": 0.6617773943054357,
"repo_name": "GitHubdeWill/teamyourdreams",
"id": "fc7bf86a3872d387eb39cea07ea44f52845beb04",
... |
from nipype.testing import assert_equal
from nipype.interfaces.fsl.maths import UnaryMaths
def test_UnaryMaths_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=True,
),
in_file=dict(argst... | {
"content_hash": "d216a567c2e4d7b6c1e70348c0c72ae7",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 78,
"avg_line_length": 24.555555555555557,
"alnum_prop": 0.6184012066365008,
"repo_name": "rameshvs/nipype",
"id": "540decac1ce1f8cd58929ddda98d1ef9eb6bbaee",
"size": "1380... |
from AccessControl import ClassSecurityInfo
from Products.Archetypes.public import *
from bika.lims import bikaMessageFactory as _
from bika.lims.utils import t
from bika.lims.config import PROJECTNAME
from bika.lims.interfaces import IReportFolder, IHaveNoBreadCrumbs
from plone.app.folder.folder import ATFolder, ATFol... | {
"content_hash": "bc6f0bf17a2e8c75687bcab98cb95740",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 66,
"avg_line_length": 33.77777777777778,
"alnum_prop": 0.8223684210526315,
"repo_name": "hocinebendou/bika.gsoc",
"id": "83c7621926813583b6d47b1d770d965e8ce92c5b",
"size":... |
import nova.conf
from nova.tests.functional.api_sample_tests import api_sample_base
CONF = nova.conf.CONF
class FlavorManageSampleJsonTests(api_sample_base.ApiSampleTestBaseV21):
ADMIN_API = True
extension_name = 'flavor-manage'
def _get_flags(self):
f = super(FlavorManageSampleJsonTests, self).... | {
"content_hash": "d247bd9c271433839134a9bfa317dc70",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 77,
"avg_line_length": 36.55769230769231,
"alnum_prop": 0.599158337716991,
"repo_name": "bigswitch/nova",
"id": "aee25d13fc3dc311ace8f113d55bc733ae900d55",
"size": "2533",
... |
from __future__ import absolute_import, unicode_literals
from django.conf.urls import include, url
from wagtail.api.v2 import urls as wagtailapi2_urls
from wagtail.contrib.wagtailapi import urls as wagtailapi_urls
from wagtail.contrib.wagtailsitemaps.views import sitemap
from wagtail.tests.testapp import urls as test... | {
"content_hash": "2afba4670f0723054905a4f600d7f0c3",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 73,
"avg_line_length": 40.5,
"alnum_prop": 0.7569444444444444,
"repo_name": "hamsterbacke23/wagtail",
"id": "b1d4a5198be2b17dd4701ce8d7f1365842685514",
"size": "1296",
"b... |
from TwitterSearch import *
import time
import requests
from tweet2geoJSON import format2geoJSON
# see: https://dev.twitter.com/rest/reference/get/search/tweets
# BASE_URL = "https://api.twitter.com/1.1/search/tweets.json"
# and https://github.com/ckoepp/TwitterSearch
from API_KEYS import consumer_key, consumer_secre... | {
"content_hash": "9a750aa7c7ab9c1d40e7b7fce5a8be83",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 211,
"avg_line_length": 42.315384615384616,
"alnum_prop": 0.57607707689511,
"repo_name": "passiweinberger/passiweinberger.github.io",
"id": "4796b1f02c2797a386d1203113c2c52c... |
import sys
class InvalidDocumentTree(Exception):
pass
class InternalError(Exception):
pass
class UnexpectedMethodCall(InternalError):
def __init__(self, cls, method_name=None):
super(UnexpectedMethodCall, self).__init__()
# If no method name is supplied, then
# assume it is from... | {
"content_hash": "587387198220a729667a42156dc2224b",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 86,
"avg_line_length": 27.74074074074074,
"alnum_prop": 0.6328437917222964,
"repo_name": "mikehulluk/mredoc",
"id": "daebf0c0dd999572e5654764e3413a44e556baf9",
"size": "248... |
import asyncio
import atexit
import codecs
import contextlib
import io
import os
import subprocess
import sys
import traceback
from .error import PrintableError
# Prior to Python 3.8 (which switched to the ProactorEventLoop by default on
# Windows), the default event loop on Windows doesn't support subprocesses, so
... | {
"content_hash": "9d26885a800f345e00018f01152e740a",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 86,
"avg_line_length": 38.626126126126124,
"alnum_prop": 0.652128279883382,
"repo_name": "buildinspace/peru",
"id": "06099064d315ec59325572d580c685f56982f056",
"size": "85... |
from copy import deepcopy
from django.contrib import admin
from mezzanine.core.admin import TabularDynamicInlineAdmin
from mezzanine.pages.admin import PageAdmin
from .models import Event, EventType, EventImage
event_fieldsets = deepcopy(PageAdmin.fieldsets)
event_fieldsets[0][1]['fields'].remove('in_menus')
event_... | {
"content_hash": "8251cb461547225d6451be369b2e3e2c",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 83,
"avg_line_length": 33,
"alnum_prop": 0.7036215816703622,
"repo_name": "shurik/mezzanine.calendar",
"id": "03ced7e54f19dedae5890305eeb76515115aca40",
"size": "1353",
"... |
import string
import random
from django import forms
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from django.contrib.auth.forms import PasswordChangeForm, SetPasswordForm
from django.utils.timezone import now
from django.utils.translation import ugettext_lazy as _
from... | {
"content_hash": "7e19d564403170c47c4c951dfc17d6d7",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 98,
"avg_line_length": 30.85,
"alnum_prop": 0.6144246353322529,
"repo_name": "Hedde/fabric-bolt",
"id": "eae80c77bde93613c10ff0a4e9dd0f93ec5e2648",
"size": "6170",
"bina... |
"""
This module redefines ``str`` on Python 2.x to be a subclass of the Py2
``unicode`` type that behaves like the Python 3.x ``str``.
The main differences between ``newstr`` and Python 2.x's ``unicode`` type are
the stricter type-checking and absence of a `u''` prefix in the representation.
It is designed to be used... | {
"content_hash": "f857d2f75fd2f5eead2391c1420f5e92",
"timestamp": "",
"source": "github",
"line_count": 426,
"max_line_length": 95,
"avg_line_length": 36.990610328638496,
"alnum_prop": 0.5940474679527858,
"repo_name": "4shadoww/usploit",
"id": "8ca191f97867d8efefab951f55eaf0caacb3d7ad",
"size": "15... |
from dice.operators import Multiply
import pytest
def test_init():
operator = Multiply(5, 1)
assert operator.original_operands == (5, 1)
assert operator.operands == (5, 1)
def test_repr():
"""
Test that the string representation of the operator is what is
expected.
Given an instance of ... | {
"content_hash": "caf107be745256c305701fd951e3a298",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 68,
"avg_line_length": 24.666666666666668,
"alnum_prop": 0.6607642124883504,
"repo_name": "extesla/dice-python",
"id": "972a6b72fa269306d04188ecd23c1f88c2e22b6f",
"size": "... |
import os
from unittest import TestCase
from requirements_detector.detect import from_requirements_txt, from_requirements_dir, \
from_requirements_blob, from_setup_py, CouldNotParseRequirements
from requirements_detector.requirement import DetectedRequirement
class DependencyDetectionTest(TestCase):
def _exp... | {
"content_hash": "295b314c83ec36cfa3f1b07f0a81e58b",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 110,
"avg_line_length": 39.74193548387097,
"alnum_prop": 0.6423160173160173,
"repo_name": "pombredanne/requirements-detector",
"id": "58d088c941e632b22d8a4c20eb9001ef8fdc42ed... |
cfg={} # Will be updated by CK (meta description of this module)
work={} # Will be updated by CK (temporal data)
ck=None # Will be updated by CK (initialized CK kernel)
# Local settings
import copy
##############################################################################
# Initialize module
def init(i):
"... | {
"content_hash": "1b6f7b6dfae7357e27c1296b64af7052",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 78,
"avg_line_length": 27.194805194805195,
"alnum_prop": 0.4918815663801337,
"repo_name": "ctuning/ck",
"id": "716b45152795966b66a3b76da657008c322ab841",
"size": "2386",
... |
import unittest
import subprocess32 as subprocess
import extraction.utils as utils
import os
class TestUtils(unittest.TestCase):
def setUp(self):
pass
def test_external_process_works(self):
(status, out, err) = utils.external_process(['grep', '3'], input_data='Line 1\nLine 2\nLine 3\n')
self.a... | {
"content_hash": "9c3ce8bc3af65d491a017c8d0c88e3ee",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 103,
"avg_line_length": 34.513513513513516,
"alnum_prop": 0.6656225528582616,
"repo_name": "Tiger66639/extractor-framework",
"id": "5c047145584f07a876f9ba4081abcd38c7395381",... |
import uuid
import ldappool
from oslo_config import cfg
from keystone.common.ldap import core as ldap_core
from keystone.identity.backends import ldap
from keystone.tests import unit as tests
from keystone.tests.unit import fakeldap
from keystone.tests.unit import test_backend_ldap_pool
from keystone.tests.unit impor... | {
"content_hash": "e2f3526e460e78586aa3202a183b0a16",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 79,
"avg_line_length": 40.95744680851064,
"alnum_prop": 0.5990909090909091,
"repo_name": "jamielennox/keystone",
"id": "a8776e5b05cc19c69d14f1bb07d1580539f89e9d",
"size": ... |
"""
Coderbits2PDF - Convert your coderbits profile to pdf.
Added option of adding your github repos.
Usage -
python coderbits2pdf.py --make username # create resume
python coderbits2pdf.py --add username # add user
python coderbits2pdf.py --del username # delete user
python coderbits2pdf.py --add-repo... | {
"content_hash": "82dee0f2885a277718e14d0ef2b2dd3e",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 132,
"avg_line_length": 34.52857142857143,
"alnum_prop": 0.6068128533995311,
"repo_name": "elssar/coderbits2pdf",
"id": "5fe0e1667aa7126dce770c7693586e1a6e3e88c8",
"size":... |
import glob
import time
import os
import numpy as np
import hickle as hkl
from proc_load import crop_and_mirror
def proc_configs(config):
if not os.path.exists(config['weights_dir']):
os.makedirs(config['weights_dir'])
print "Creat folder: " + config['weights_dir']
return config
def unpa... | {
"content_hash": "5ee8a56b39efe7c78314b65f37976830",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 90,
"avg_line_length": 34.03030303030303,
"alnum_prop": 0.5732858414959929,
"repo_name": "myt00seven/svrg",
"id": "0f314f5be169c293ad1e6b34edd5d24e8a7037d8",
"size": "5615... |
import os
import sys
import re
__all__ = ['WrapperBase','WrapperCPPMacro','WrapperCCode']
class WrapperBase:
def __init__(self):
self.srcdir = os.path.join(os.path.dirname(__file__),'src')
return
def warning(self, message):
print >> sys.stderr, message
def info(self, message):
... | {
"content_hash": "f38493972fa0f60c7e4e7b27fc7502ac",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 100,
"avg_line_length": 34.70224719101124,
"alnum_prop": 0.5152986886838271,
"repo_name": "santisiri/popego",
"id": "3164e817f055fe42de516d23ca4f7386d0958117",
"size": "61... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('userena', '0002_auto_20170214_1529'),
]
operations = [
migrations.AddField(
model_name='userenasignup',
name='invitation_key... | {
"content_hash": "06b5b79885dafcd16668724edb82ae32",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 196,
"avg_line_length": 32.56521739130435,
"alnum_prop": 0.6088117489986649,
"repo_name": "RDXT/django-userena",
"id": "85f15ec497bd1a2e8e57edc86b20edb45a185937",
"size": "... |
from pkgutil import iter_modules
import os
import os.path
__all__ = []
def global_import(name):
p = __import__(name, globals(), locals(), level=1)
lst = p.__all__ if '__all__' in dir(p) else []
del globals()[name]
for k in lst:
globals()[k] = p.__dict__[k]
__all__.append(k)
_CURR_DI... | {
"content_hash": "09814754f292a851a977da70cb10a38f",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 58,
"avg_line_length": 24.25925925925926,
"alnum_prop": 0.566412213740458,
"repo_name": "haamoon/tensorpack",
"id": "b76820cf99b2d2023add5065cdce6084c129588a",
"size": "743... |
"""Tests for workers __init__."""
from __future__ import unicode_literals
import json
import os
import tempfile
import unittest
import mock
from turbinia import evidence
from turbinia import TurbiniaException
from turbinia.workers import TurbiniaTask
from turbinia.workers import TurbiniaTaskResult
from turbinia.work... | {
"content_hash": "a3eee448817fdcdefdd1db547264aa0e",
"timestamp": "",
"source": "github",
"line_count": 427,
"max_line_length": 80,
"avg_line_length": 40.91803278688525,
"alnum_prop": 0.7128548534798534,
"repo_name": "google/turbinia",
"id": "39cefd97dd1d78637ce61497f67042ed8b760d89",
"size": "1807... |
from collections import defaultdict
import datetime
import logging
import urllib
from xml.sax.saxutils import escape
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.cache import cache
from django.core.exceptions import ValidationError
from django.db import tr... | {
"content_hash": "b3dd7286a0da97b81ea2295031434cf7",
"timestamp": "",
"source": "github",
"line_count": 916,
"max_line_length": 120,
"avg_line_length": 40.180131004366814,
"alnum_prop": 0.6482814834940904,
"repo_name": "harvard-vpal/bridge-adaptivity",
"id": "ac5ae33cf4505f57400d9f8df9d46024c127fba1"... |
import random
class Node:
data = left = right = None
def __init__(self, data=None):
self.data = data
def generateTreeFromArray(data):
return generateTreeHelper(data, 0, len(data))
def generateTreeHelper(data, root, right):
if root < right:
r = Node(data[root])
r.left = gen... | {
"content_hash": "0c1c2e10917f6b282883a41be156d617",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 63,
"avg_line_length": 19.92753623188406,
"alnum_prop": 0.5534545454545454,
"repo_name": "baiyubin/python_practice",
"id": "5ef83838c593b63092bc29d480e4cdb7a9819d6a",
"size... |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('job... | {
"content_hash": "8fce716e397c8750e66b8283738e98dd",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 147,
"avg_line_length": 34.69230769230769,
"alnum_prop": 0.6274944567627494,
"repo_name": "Santiago-vdk/jabbs",
"id": "0ce9573c34e42ed6ffe9d199ec49a3cac92701d9",
"size": "1... |
""" Functions useful to directives and roles contained in
the ``bokeh.sphinxext`` package.
"""
import os
from os.path import exists
def out_of_date(original, derived):
""" Test whether a derived file is newer than its original.
Args:
original (str) : full path to original file
derived (str) :... | {
"content_hash": "50b6b2238e578ff4b743180ab5c5fc9f",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 65,
"avg_line_length": 23.866666666666667,
"alnum_prop": 0.6410614525139665,
"repo_name": "almarklein/bokeh",
"id": "9b5cb05001dcafb1d1a7a379f1523fa8c167aa7f",
"size": "716... |
"""A client interface for TensorFlow."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import re
import threading
import numpy as np
from tensorflow.core.protobuf import config_pb2
from tensorflow.python import pywrap_tensorflow as tf_session
from tenso... | {
"content_hash": "824f2ea6ecc99020285da8be6ff074d9",
"timestamp": "",
"source": "github",
"line_count": 1265,
"max_line_length": 114,
"avg_line_length": 37.33280632411067,
"alnum_prop": 0.6554863846186423,
"repo_name": "juharris/tensorflow",
"id": "c139f87c323dab7049e92da562deed15f68adc91",
"size":... |
import json
import time, datetime, os, sys
from pyvcloud.vcloudair import VCA
from pyvcloud.cluster import Cluster
from pyvcloud.helper.CommonUtils import convertPythonObjToStr
def print_vca(vca):
if vca:
print 'vca token: ', vca.token
if vca.vcloud_session:
print 'vcloud ses... | {
"content_hash": "9e3fe89befbfffd8a63a3b89e9591d41",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 107,
"avg_line_length": 32.666666666666664,
"alnum_prop": 0.6554160125588697,
"repo_name": "h-medjahed/pyvcloud",
"id": "df1e70add294121dc8b8c60f39917c2d84a65a90",
"size": ... |
from django.apps import apps
from wagtail.contrib.frontend_cache.utils import purge_page_from_cache
from wagtail.core.signals import page_published, page_unpublished
def page_published_signal_handler(instance, **kwargs):
purge_page_from_cache(instance)
def page_unpublished_signal_handler(instance, **kwargs):
... | {
"content_hash": "e9eeb059382eee02dab9b49a0dae820b",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 86,
"avg_line_length": 35.91304347826087,
"alnum_prop": 0.7506053268765133,
"repo_name": "kaedroho/wagtail",
"id": "b537bf6e0dfa422c85f0f4508e635a2ee647a425",
"size": "826"... |
import os
from tornado.web import authenticated, removeslash
from handlers.basehandlers import BaseHandler
import logging
import json
class StatisticsHandler(BaseHandler):
role = "admin"
@authenticated
@removeslash
def get(self):
self.render("admin/statistics.html", title="Cloud Setuper", us... | {
"content_hash": "a7bdd003ff138f9eea6a2a3ade6702c4",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 95,
"avg_line_length": 23.066666666666666,
"alnum_prop": 0.7543352601156069,
"repo_name": "dragondjf/CloudSetuper",
"id": "2be9965972a2c83b13b087113d11a4bbafabf179",
"size"... |
from .http_client import HttpClient
# Assign all the api classes
from .api.result import Result
from .api.variables import Variables
from .api.experiment import Experiment
from .api.settings import Settings
from .api.users import Users
from .api.results import Results
from .api.suggest import Suggest
from .api.experim... | {
"content_hash": "be829e361001d7499918254c5ea85b57",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 79,
"avg_line_length": 24.80597014925373,
"alnum_prop": 0.7478941034897714,
"repo_name": "schevalier/Whetlab-Python-Client",
"id": "73cdb4e9f3dc313bbe1c3e1509183a1e195bd4fe",... |
from functools import partial
import logging
import math
from numbers import Number
from operator import add
import os
from bokeh.layouts import column, row
from bokeh.models import (
ColumnDataSource,
DataRange1d,
HoverTool,
ResetTool,
PanTool,
WheelZoomTool,
TapTool,
OpenURL,
Rang... | {
"content_hash": "abe6a98899f614fab704b0d792cdf1d9",
"timestamp": "",
"source": "github",
"line_count": 1703,
"max_line_length": 103,
"avg_line_length": 32.670581327069875,
"alnum_prop": 0.5100470901182645,
"repo_name": "mrocklin/distributed",
"id": "3332f4fc27b1db741d59154c77aeae64dd5d8548",
"size... |
"""
Test running processes.
"""
import gzip
import os
import sys
import signal
import StringIO
import errno
import gc
import stat
import operator
try:
import fcntl
except ImportError:
fcntl = process = None
else:
from twisted.internet import process
from zope.interface.verify import verifyObject
from tw... | {
"content_hash": "c5ad13acef65c69af1f9b44934aaa5af",
"timestamp": "",
"source": "github",
"line_count": 2542,
"max_line_length": 114,
"avg_line_length": 32.14791502753737,
"alnum_prop": 0.5793930494371023,
"repo_name": "normanmaurer/autobahntestsuite-maven-plugin",
"id": "acfa108cb092c44857a2246c0130... |
import theano
from theano import tensor as T
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
from theano.tensor.signal import pool
from theano.tensor.nnet import conv3d2d
from theano.printing import Print
try:
from theano.tensor.nnet.nnet import softsign as T_softsign
except ImportError:
f... | {
"content_hash": "6abc24b9a94f06c15ebd40ac8e9e100d",
"timestamp": "",
"source": "github",
"line_count": 1304,
"max_line_length": 118,
"avg_line_length": 31.73926380368098,
"alnum_prop": 0.5698511645887697,
"repo_name": "relh/keras",
"id": "f1383eab250fb27a6e5e10c92a51025fc3649189",
"size": "41388",... |
from django.test import TestCase
from django.urls import reverse
from core.models import Transformation, OAIEndpoint, ValidationScenario, \
RecordIdentifierTransformation, DPLABulkDataDownload, FieldMapper
from tests.utils import TestConfiguration
class ConfigurationTestCase(TestCase):
@classmethod
def s... | {
"content_hash": "e1e85b41b4aba1b5fddaa0b8c10cf0d7",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 91,
"avg_line_length": 46.979166666666664,
"alnum_prop": 0.6585365853658537,
"repo_name": "WSULib/combine",
"id": "0130c20d9d94b04696cd1f695e26e982f9fd284b",
"size": "2255"... |
''' Fvtk module implements simple visualization functions using VTK.
The main idea is the following:
A window can have one or more renderers. A renderer can have none, one or more actors. Examples of actors are a sphere, line, point etc.
You basically add actors in a renderer and in that way you can visualize the fore... | {
"content_hash": "dc37232d370f8e9897aeca36e8bf4a98",
"timestamp": "",
"source": "github",
"line_count": 1849,
"max_line_length": 191,
"avg_line_length": 28.758788534342887,
"alnum_prop": 0.592872590503056,
"repo_name": "demianw/dipy",
"id": "dd34ee8ba2acede5e2ceabc968a4e01fcdb59e87",
"size": "53175... |
from pyhmsa.type.xrayline import xrayline, NOTATION_SIEGBAHN
line = xrayline('Ka1', NOTATION_SIEGBAHN, 'K-L3')
from pyhmsa.spec.condition.elementalid import ElementalIDXray
condition = ElementalIDXray(29, line, (8047.82, 'eV'))
print(condition) # Returns: <ElementalIDXray(atomic_number=29, energy=8047.82 eV, line=Ka1)... | {
"content_hash": "eb9eeaf40cf6e373629acc3877f84a04",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 92,
"avg_line_length": 53.5,
"alnum_prop": 0.778816199376947,
"repo_name": "pyhmsa/pyhmsa",
"id": "b1747fc053fc9529e8cf6a77f8c024f4424e94c1",
"size": "344",
"binary": fals... |
import frappe
import json
def get_email_accounts(user=None):
if not user:
user = frappe.session.user
email_accounts = []
accounts = frappe.get_all("User Email", filters={ "parent": user },
fields=["email_account", "email_id", "enable_outgoing"],
distinct=True, order_by="idx")
if not accounts:
return {
... | {
"content_hash": "f2f695264508323f4d3700280034da61",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 103,
"avg_line_length": 29.418079096045197,
"alnum_prop": 0.6854234684079125,
"repo_name": "mbauskar/frappe",
"id": "a3847dc0e625d68c120e7a72b8c17749db250b0c",
"size": "52... |
bl_info = {
"name": "SinGED Client",
"author": "Will Cassella",
"version": (0, 1),
"blender": (2, 78, 0),
"description": "SinGE editor client for Blender",
"warning": "",
"wiki_url": "",
"category": "Development",
}
# If we're reloading the module
if "bpy" in locals():
# Close the a... | {
"content_hash": "0be144d0372d6d6698eb17092cbf8380",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 70,
"avg_line_length": 36.93333333333333,
"alnum_prop": 0.73971119133574,
"repo_name": "willcassella/SinGE",
"id": "b6323c00e5cab5ff6a1fdb887b5e5ec8790e870b",
"size": "2801... |
import logging
import warnings
from typing import Dict, Set
from great_expectations.core.id_dict import BatchKwargs
logger = logging.getLogger(__name__)
class BatchKwargsGenerator:
r"""
BatchKwargsGenerators produce identifying information, called "batch_kwargs" that datasources
can use to get i... | {
"content_hash": "1f570d8b3efaf3a09062f847507a6082",
"timestamp": "",
"source": "github",
"line_count": 359,
"max_line_length": 120,
"avg_line_length": 43.598885793871865,
"alnum_prop": 0.6160235113723486,
"repo_name": "great-expectations/great_expectations",
"id": "44ebf2bb006afa0ae0217e565d26af2cb6... |
"""Common utilities for the various process_* implementations.
This file is only meant to be imported by the platform-specific implementations
of subprocess utilities, and it contains tools that are common to all of them.
"""
#-----------------------------------------------------------------------------
# Copyright ... | {
"content_hash": "88397cca909bcca0a68ea6acdbc5bef1",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 81,
"avg_line_length": 32.925233644859816,
"alnum_prop": 0.595799034913426,
"repo_name": "marcoantoniooliveira/labweb",
"id": "926721cb113bfa2a68b8e25b7e5fe7a5ffbc47ab",
"... |
from __future__ import print_function
import tempfile
from pyspark.sql import SparkSession
spark = SparkSession.builder.appName('Shakespeare WordCount').getOrCreate()
table = 'bigquery-public-data.samples.shakespeare'
df = spark.read.format('bigquery').load(table)
# Only these columns will be read
df = df.select('wor... | {
"content_hash": "3fb791cbc7a43eec973d2c6f8b8fbcc5",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 75,
"avg_line_length": 35.32142857142857,
"alnum_prop": 0.7441860465116279,
"repo_name": "GoogleCloudDataproc/spark-bigquery-connector",
"id": "d75a482694f153c972ce35d8afcf11... |
from mininode import *
from blockstore import BlockStore, TxStore
from util import p2p_port
'''
This is a tool for comparing two or more vcoinds to each other
using a script provided.
To use, create a class that implements get_tests(), and pass it in
as the test generator to TestManager. get_tests() should be a pyth... | {
"content_hash": "0b4550725d13ab52e748f8066ca66e9d",
"timestamp": "",
"source": "github",
"line_count": 410,
"max_line_length": 145,
"avg_line_length": 44.37073170731707,
"alnum_prop": 0.5829485488126649,
"repo_name": "vcoin-project/v",
"id": "def4036a8597f76b412af3d371f623a9cd8a993b",
"size": "183... |
""" Basic functions for manipulating 2d arrays
"""
from __future__ import division, absolute_import, print_function
from numpy.core.numeric import (
absolute, asanyarray, arange, zeros, greater_equal, multiply, ones,
asarray, where, int8, int16, int32, int64, empty, promote_types, diagonal,
nonzero
)
... | {
"content_hash": "3c04fe98c55dd1dc14faa83e2180cc00",
"timestamp": "",
"source": "github",
"line_count": 954,
"max_line_length": 79,
"avg_line_length": 27.370020964360588,
"alnum_prop": 0.5439852935544407,
"repo_name": "ryfeus/lambda-packs",
"id": "98efba1911e13515737e21a385eb004924c3d283",
"size": ... |
import datetime
import copy
import random
from collections import namedtuple
import mock
import testtools
from testtools.matchers import GreaterThan
from oslo_config import cfg
from oslo_log import log as logging
from oslo_db import exception as db_exception
from oslo_messaging.notify import notifier
from designate i... | {
"content_hash": "95d3a3da5bee359e97f3569687f8d274",
"timestamp": "",
"source": "github",
"line_count": 3372,
"max_line_length": 79,
"avg_line_length": 37.46708185053381,
"alnum_prop": 0.619911507927085,
"repo_name": "muraliselva10/designate",
"id": "204e1d219e2f2b3e4b5a0e768e924aa1a91c7499",
"size... |
import mock
from testtools import matchers
from neutron.common import exceptions as exc
import neutron.db.api as db
from neutron.plugins.common import constants as p_const
from neutron.plugins.ml2 import driver_api as api
from neutron.plugins.ml2.drivers import type_vlan
from neutron.tests import base
PROVIDER_NET = ... | {
"content_hash": "91d46ccda91ef580083bb2bca9a1076e",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 75,
"avg_line_length": 42.98255813953488,
"alnum_prop": 0.6157175706749628,
"repo_name": "gopal1cloud/neutron",
"id": "deb86c0afcb50b52ee05f6d2f9bff0c790b6bd95",
"size": "... |
import os, sys, random
files = os.listdir('readable')
root = os.getcwd()
def isheader(line):
header = True
linelen = len(line)
if linelen > 5:
linelen = 5
for i in range(linelen):
char = line[i]
if char.islower():
header = False
break
return header
... | {
"content_hash": "b6e01f57da63ece5e24c7394e426a973",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 63,
"avg_line_length": 22.29090909090909,
"alnum_prop": 0.5106035889070146,
"repo_name": "tedunderwood/GenreProject",
"id": "633362c086fb26b5945f44e24f24294456c08407",
"siz... |
"""
Check that all of the certs on all service endpoints validate.
"""
import unittest
import boto.cloudsearch
class CertVerificationTest(unittest.TestCase):
cloudsearch = True
ssl = True
def test_certs(self):
for region in boto.cloudsearch.regions():
c = region.connect()
... | {
"content_hash": "cca661dd1dd404c1c65d55fef134925e",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 62,
"avg_line_length": 20.176470588235293,
"alnum_prop": 0.6647230320699709,
"repo_name": "Timus1712/boto",
"id": "679f8706556db7f911bc807655f2d68d966706a3",
"size": "1522"... |
from test.test_support import TestFailed, have_unicode
class base_set:
def __init__(self, el):
self.el = el
class set(base_set):
def __contains__(self, el):
return self.el == el
class seq(base_set):
def __getitem__(self, n):
return [self.el][n]
def check(ok, *args):
if not... | {
"content_hash": "ffe8ad0252ae43709fd80bdafaac5343",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 63,
"avg_line_length": 23.13533834586466,
"alnum_prop": 0.5680857978550536,
"repo_name": "MalloyPower/parsing-python",
"id": "e6f5cf727273ebdbcf486cb07bb5c78194eea872",
"s... |
import os
import json
curr_path = os.path.abspath(__file__)
curr_dir = os.path.split(curr_path)[0]
def list_examples():
files = os.listdir(os.path.join(curr_dir, "..", "examples"))
return [filename.replace('.json', '') for filename in files]
def get_example(example_name):
with open(os.path.join(curr_di... | {
"content_hash": "7f268a8c67daddc7b7ec850ebcec8917",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 92,
"avg_line_length": 27.333333333333332,
"alnum_prop": 0.6439024390243903,
"repo_name": "ALU-CloudBand/yaqluator",
"id": "8d44c01aee28adc2eb4c0605ed5b1970d8c5cdd9",
"size... |
"""Miscellaneous file manipulation functions
"""
import os
import re
import shutil
from glob import glob
import logging
from nipype.utils.misc import isdefined
# The md5 module is deprecated in Python 2.6, but hashlib is only
# available as an external package for versions of python before 2.6.
# Both md5 algorithms a... | {
"content_hash": "525f1ba6e1ba916632029def7ad98f39",
"timestamp": "",
"source": "github",
"line_count": 327,
"max_line_length": 79,
"avg_line_length": 26.31498470948012,
"alnum_prop": 0.5937245787332947,
"repo_name": "satra/NiPypeold",
"id": "c746a1902db611755a6f56844685c6cc7acec7f9",
"size": "8719... |
'''
Set up the version of Salt
'''
# Import python libs
from __future__ import absolute_import, print_function
import re
import sys
import platform
# pylint: disable=invalid-name,redefined-builtin
# Import 3rd-party libs
from salt.ext import six
from salt.ext.six.moves import map
# Don't rely on external packages in... | {
"content_hash": "7fef73f91f1edfc90c0ad113e2206c7a",
"timestamp": "",
"source": "github",
"line_count": 668,
"max_line_length": 118,
"avg_line_length": 35.0059880239521,
"alnum_prop": 0.48503250085528565,
"repo_name": "stephane-martin/salt-debian-packaging",
"id": "d02a49eb775603bf48be3225bb3fe674796... |
"""Problem 16 of https://projecteuler.net"""
def problem_16():
"""Solution to problem 16."""
answer = sum([int(x) for x in str(2 ** 1000)])
return answer
| {
"content_hash": "6c10008907d272c8c41fe6d12223615f",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 50,
"avg_line_length": 24,
"alnum_prop": 0.6011904761904762,
"repo_name": "hjheath/ProjectEuler",
"id": "3219d789783f4566f6229c24277c82c82d5da6af",
"size": "168",
"binary"... |
from __future__ import print_function
import os
import shutil
import getpass
# from fabric.contrib.files import append
from fabric.api import settings
import burlap
from burlap.common import env, Satchel
from burlap.tests.base import TestCase
from burlap.project import project
from burlap.context import set_cwd
from... | {
"content_hash": "93eee3a31341cd100ef868fde06193c6",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 148,
"avg_line_length": 43.43023255813954,
"alnum_prop": 0.5243641231593039,
"repo_name": "chrisspen/burlap",
"id": "6db733718d65e8d03107053c6abf9ec3e435c667",
"size": "74... |
from mod_base import*
class Nick(Hybrid):
"""Change the nick of the bot. If nick isn't available, the nick will be reclaimed when it becomes available."""
def init(self):
self.events = [IRC_EVT_INTERVAL, IRC_EVT_USER_NICK_CHANGE, IRC_EVT_USER_QUIT]
def event(self, event):
desired = self.bo... | {
"content_hash": "c51a004f7e7a3bb9cce86f2c7175768a",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 116,
"avg_line_length": 32.86842105263158,
"alnum_prop": 0.5628502802241794,
"repo_name": "richrd/bx",
"id": "5c772f4a3236a0fc65fb943b8b176b3acee08932",
"size": "1249",
"... |
import pytest
def pytest_addoption(parser):
parser.addoption("--runslow", action="store_true", help="run slow tests")
def pytest_runtest_setup(item):
if "slow" in item.keywords and not item.config.getoption("--runslow"):
pytest.skip("need --runslow option to run")
| {
"content_hash": "b949ad2a4aa9a5a59cc0783a1f77b3ad",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 77,
"avg_line_length": 28.5,
"alnum_prop": 0.6947368421052632,
"repo_name": "GeoscienceAustralia/eo-datasets",
"id": "3171bdd753addfb8ab8d6902bc7caedd5a67342e",
"size": "37... |
import copy
import glob
import json
import logging
import os
import pickle
import re
import shutil
import signal
import time
import urllib.parse
import uuid
import xml.etree.ElementTree as ET
from concurrent import futures
from distutils import dir_util
from functools import reduce
from operator import itemgetter
from ... | {
"content_hash": "bda923d8c3ec23415580c3b1f45d61fb",
"timestamp": "",
"source": "github",
"line_count": 1329,
"max_line_length": 120,
"avg_line_length": 40.24153498871332,
"alnum_prop": 0.6324676053177765,
"repo_name": "terranodo/eventkit-cloud",
"id": "7d7a136d7e847c1a92d400c4841d2b079aa7b6b2",
"s... |
from msrest.serialization import Model
class PyTorchSettings(Model):
"""Specifies the settings for pyTorch job.
All required parameters must be populated in order to send to Azure.
:param python_script_file_path: Required. The path and file name of the
python script to execute the job.
:type py... | {
"content_hash": "7cd80cfc7535654942357cd285e09060",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 83,
"avg_line_length": 44.38636363636363,
"alnum_prop": 0.6717869943676396,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "a765cafdae9ccc2e233b1440e51fd72f94d0fd2a",
"... |
""" Sahana Eden Staff Module Automated Tests
@copyright: 2011-2012 (c) Sahana Software Foundation
@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
res... | {
"content_hash": "1a3de8c1eddfcf38ee6f5b8573c256f4",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 69,
"avg_line_length": 39.1,
"alnum_prop": 0.7116368286445013,
"repo_name": "mrGeen/eden",
"id": "233e4e82f6f73c55bc2ceda80c3a6edb630471f4",
"size": "1589",
"binary": fal... |
fhand = open("mbox_short.txt")
for line in fhand:
line = line.rstrip()
if not line.startswith('From'):
continue
print (line)
| {
"content_hash": "8bbf04cafee325323024084c132e3b43",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 32,
"avg_line_length": 19,
"alnum_prop": 0.6691729323308271,
"repo_name": "ttruongdc/py-Learning",
"id": "19b6cfebccc04b2b5ff4d9d57322ab9c1bf44528",
"size": "133",
"binary... |
from rest_framework import serializers
class BooleanField(serializers.BooleanField):
TRUE_VALUES = ('true', 't', 'True', '1')
FALSE_VALUES = ('false', 'f', 'False', '0')
def to_internal_value(self, value):
if value in self.TRUE_VALUES:
return True
if value in self.FALSE_VALUE... | {
"content_hash": "e8d374a4f105062aec8da78a3be0b85d",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 47,
"avg_line_length": 24.666666666666668,
"alnum_prop": 0.6027027027027027,
"repo_name": "awemulya/fieldsight-kobocat",
"id": "0238f7f14c93cfd12a4d1b412eee0e18e5a8556a",
"... |
from typing import Optional
from pytest import raises
from graphql.error import GraphQLSyntaxError
from graphql.language import Lexer, Source, TokenKind, parse
from graphql.utilities import strip_ignored_characters
from ..fixtures import kitchen_sink_query, kitchen_sink_sdl # noqa: F401
from ..utils import dedent
... | {
"content_hash": "56803820dab59fb44526e521d876dee9",
"timestamp": "",
"source": "github",
"line_count": 229,
"max_line_length": 85,
"avg_line_length": 35.54585152838428,
"alnum_prop": 0.5511056511056511,
"repo_name": "graphql-python/graphql-core",
"id": "2e026af8ae3164ea4bad3fa98341001623cdbc32",
"... |
import socketio
import asyncio
import json
import os
class PlaylistList:
def __init__(self, _config, _socketio, _loop, _processor):
self.config = _config
self.socketio = _socketio
self.loop = _loop
self.processor = _processor
if not os.path.isfile('savedPlaylists.json'):
... | {
"content_hash": "abb75ccb717ab36c8294d20a168729e3",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 106,
"avg_line_length": 30.739837398373982,
"alnum_prop": 0.5604337476857975,
"repo_name": "8BitJosh/JukeBot",
"id": "fea1fe5963252709a18291a5c13125d18c9025dc",
"size": "3... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.