text stringlengths 4 1.02M | meta dict |
|---|---|
import requests, json, random, time, sys, pickle
from threading import Thread
from Queue import Queue
from psnlib import *
## Config
delay = 3 # Delay between messages (seconds)
comboList = "REDACTED_URL" # Userlist (page was a list of username/password combos)
threads = 2
debug = 1 # Use 1 or 0
## /Config
tokenb... | {
"content_hash": "353eadf24398e2a60bb827aeea0c6689",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 161,
"avg_line_length": 24.048275862068966,
"alnum_prop": 0.5379982793232004,
"repo_name": "denniskupec/odds-and-ends",
"id": "d9533e12722dba833e738021d2aac3dbf2ec42e8",
"... |
root = dict()
_end = '_end_'
def make_trie(word):
i = root
current_dict = i
for letter in word:
current_dict = current_dict.setdefault(letter, {})
current_dict[_end] = [word]
return i
#
def in_trie(trie, word):
current_dict = trie
for letter in word:
if letter in current_di... | {
"content_hash": "5c7f10020c47d724dea2d1a452e5e913",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 58,
"avg_line_length": 18.323529411764707,
"alnum_prop": 0.5457463884430177,
"repo_name": "vin0010/Hackerrank",
"id": "2758700bc6b1e21cd2660537bec8d6a93f210c8e",
"size": "6... |
from django.test import TestCase
from apps.processing.ala.models import SamplingFeature, Observation
from django.contrib.gis.geos import GEOSGeometry
from apps.common.models import Process, Property
from psycopg2.extras import DateTimeTZRange
from datetime import timedelta, datetime
from apps.ad.anomaly_detection impor... | {
"content_hash": "9bc7c0f1cab86d3888a48993dcfbf7ea",
"timestamp": "",
"source": "github",
"line_count": 312,
"max_line_length": 118,
"avg_line_length": 33.95192307692308,
"alnum_prop": 0.6225809496837534,
"repo_name": "gis4dis/poster",
"id": "6e6ab9520e26b74e9fbb85a3af34b24de10893a1",
"size": "1059... |
import os
import shutil
import six
import sys
import yaml
import zipfile
from murano.packages import exceptions
from murano.packages import package_base
from toscaparser.common import exception as csar_exception
from toscaparser.prereq import csar
from toscaparser.tosca_template import ToscaTemplate
from translator.ho... | {
"content_hash": "dec7c043389e8f15613df9aa5f3c5f7d",
"timestamp": "",
"source": "github",
"line_count": 524,
"max_line_length": 78,
"avg_line_length": 35.912213740458014,
"alnum_prop": 0.5078648102880221,
"repo_name": "DavidPurcell/murano_temp",
"id": "696bc1802b0361964449bf5c40e4a16d3586585f",
"si... |
'''
MirrorManager2 admin flask controller.
'''
import flask
from flask.ext.admin import BaseView, expose
try:
from flask.ext.admin.contrib.sqla import ModelView
except ImportError: # pragma: no cover
# The module was renamed in flask-admin
from flask.ext.admin.contrib.sqlamodel import ModelView
from mirr... | {
"content_hash": "9d2a8f0dc39b2fb3bdbd6df9a8ecfa32",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 79,
"avg_line_length": 39.54430379746835,
"alnum_prop": 0.7285531370038413,
"repo_name": "Devyani-Divs/mirrormanager2",
"id": "7068e1cbfb02b60dd717f781024fc2c48fab6874",
"s... |
from UnitTest import UnitTest
# XXX fails with a JavaScript error: "In application LibTest -
# undefined: set is not defined
# pyjslib.py, line 1484
# pyjslib.py, line 206
# SetTest.py, line 5
# try:
# # try to use the built-in set type
# Set = set
# except NameError:
# # fall back to sets module
# fro... | {
"content_hash": "ab7a93a2a824678cfe8e663ca098aafa",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 62,
"avg_line_length": 22.32894736842105,
"alnum_prop": 0.5586328815556865,
"repo_name": "lovelysystems/pyjamas",
"id": "1964ab226ab0d6b63cd5681404d0d4cfb9df3c9a",
"size": ... |
"""Request handler of the module."""
import copy
import aspell
import re
from ppp_datamodel import Sentence, Resource
from ppp_datamodel.communication import TraceItem, Response
from ppp_libmodule.exceptions import ClientError
class Word:
"""
A class to manipulate words.
"""
def __init__(self, str... | {
"content_hash": "7a4a4a658d8de57131dd81281840ff66",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 113,
"avg_line_length": 32.90909090909091,
"alnum_prop": 0.5768458061275741,
"repo_name": "ProjetPP/PPP-Spell-Checker",
"id": "30e97ee914d518a1a9afea65a69c9329847bfc34",
"... |
import mock
from xml2kinto.kinto import get_kinto_records
def test_get_kinto_records_try_to_create_the_bucket():
kinto_client = mock.MagicMock()
kinto_client.create_collection.return_value.status_code = 201
get_kinto_records(kinto_client, mock.sentinel.bucket,
mock.sentinel.collectio... | {
"content_hash": "b9c0d2874d15be038434b165127006ae",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 76,
"avg_line_length": 35.25925925925926,
"alnum_prop": 0.6016281512605042,
"repo_name": "mozilla-services/xml2kinto",
"id": "3539bdb94f4caa3d87b9396d0073f7bbc3ec7cee",
"s... |
from __future__ import division
from HTMLParser import HTMLParser
import os
import re
from .https_if_available import build_opener
re_url = re.compile(r'^(([a-zA-Z_-]+)://([^/]+))(/.*)?$')
def resolve_link(link, url):
m = re_url.match(link)
if m is not None:
if not m.group(4):
# http://... | {
"content_hash": "c22d8089d1ef3aa72dfca60fe1f4ba57",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 79,
"avg_line_length": 35.559322033898304,
"alnum_prop": 0.4974578964092787,
"repo_name": "VisTrails/VisTrails",
"id": "18b8d50899749d349fe8cba314739d62a49fcaa8",
"size": ... |
from .baselines import (
mean_on_fold,
random_on_fold,
xu_et_al_on_fold,
doench_on_fold,
sgrna_from_doench_on_fold,
SVC_on_fold,
)
from .ensembles import (
spearman_scoring,
adaboost_on_fold,
LASSOs_ensemble_on_fold,
randomforest_on_fold,
decisiontree_on_fold,
linear_stac... | {
"content_hash": "119945889c5639f3ae071ebc64cc5554",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 42,
"avg_line_length": 20.838709677419356,
"alnum_prop": 0.6547987616099071,
"repo_name": "pablocarderam/genetargeter",
"id": "61309e002081f50c544ecb8af0571db799f50edd",
"s... |
"""Markdown template filter."""
from django import template
from django.utils.safestring import mark_safe
import bleach
import markdown as markdown_
register = template.Library()
ADDITIONAL_TAGS = ['p', 'br', 'pre']
@register.filter(name='markdown')
def markdown_filter(value):
"""Convert markdown value to htm... | {
"content_hash": "7eaef0b62295b3f13d3b1142b226cf21",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 103,
"avg_line_length": 27.47826086956522,
"alnum_prop": 0.6962025316455697,
"repo_name": "ScorpionResponse/freelancefinder",
"id": "ba4c9d13ffb60d6f4008af55d655da1f2046cd57"... |
from __future__ import absolute_import, unicode_literals
import pytest
from case import Mock
from celery import uuid
from celery.app import control
from celery.exceptions import DuplicateNodenameWarning
from celery.five import items
from celery.utils.collections import LimitedSet
def _info_for_commandclass(type_):
... | {
"content_hash": "ca4d0a23d30197db64cbfbd9d20b4556",
"timestamp": "",
"source": "github",
"line_count": 500,
"max_line_length": 79,
"avg_line_length": 33.104,
"alnum_prop": 0.5776945384243596,
"repo_name": "kawamon/hue",
"id": "6406590b7e50b20cb014baf15ad747de83e7f82a",
"size": "16552",
"binary":... |
from collections import abc
from unittest import mock
import hashlib
import os.path
import oslo_config.cfg
from oslo_policy import policy as common_policy
import glance.api.policy
from glance.common import exception
import glance.context
from glance.policies import base as base_policy
from glance.tests.unit import ba... | {
"content_hash": "a0c084a7e939477154dc8bce4ef1454a",
"timestamp": "",
"source": "github",
"line_count": 560,
"max_line_length": 78,
"avg_line_length": 34.4125,
"alnum_prop": 0.5948316122671371,
"repo_name": "openstack/glance",
"id": "70ad783e7acae75f4c9b03d0fecb82882c782d41",
"size": "19934",
"bi... |
"""Storage backend for S3 or Storage Servers that follow the S3 Protocol"""
import hashlib
import httplib
import re
import tempfile
import urlparse
from oslo.config import cfg
from glance.common import exception
from glance.common import utils
import glance.openstack.common.log as logging
import glance.store
import ... | {
"content_hash": "283087289edee551b890122855df7556",
"timestamp": "",
"source": "github",
"line_count": 527,
"max_line_length": 78,
"avg_line_length": 38.04933586337761,
"alnum_prop": 0.5532615200478755,
"repo_name": "cloudbau/glance",
"id": "d9638212f01a119388f1bbac6715ec7d69585692",
"size": "2073... |
from beritest_tools import BaseBERITestCase
class test_raw_sw(BaseBERITestCase):
def test_a0(self):
'''Test unsigned load of stored word from double word'''
self.assertRegisterEqual(self.MIPS.a0, 0xfedcba98, "Unsigned load of word from double word failed")
def test_a1(self):
'''Test si... | {
"content_hash": "57d9a14f79dcb032e4b94e4423233874",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 112,
"avg_line_length": 45.46666666666667,
"alnum_prop": 0.6884164222873901,
"repo_name": "8l/beri",
"id": "676e66e282115718fce883a5f6cc8a11ab85a01e",
"size": "2502",
"bi... |
import newspaper
cnn_paper = newspaper.build('http://cnn.com')
# for article in cnn_paper.articles:
# print(article.url)
for category in cnn_paper.category_urls():
print(category)
article = cnn_paper.articles[0]
article.download()
print(article.html)
article.parse()
print(article.authors)
print(article.text... | {
"content_hash": "bb0f63be5f0f49c8e76662f9a993f51b",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 45,
"avg_line_length": 20.80952380952381,
"alnum_prop": 0.7551487414187643,
"repo_name": "Akagi201/learning-python",
"id": "97f6e3f677d5ff65e3db3980b765c783398daf1d",
"size... |
import math
from ctypes import byref, c_double, c_int, c_void_p
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.prototypes import raster as capi
from django.contrib.gis.shortcuts import numpy
from django.utils import six
from django... | {
"content_hash": "d29ec4c671ac085a789771db0792c346",
"timestamp": "",
"source": "github",
"line_count": 251,
"max_line_length": 104,
"avg_line_length": 32.286852589641434,
"alnum_prop": 0.5844027640671273,
"repo_name": "jscn/django",
"id": "878cc5aa4a660e4e50432fb552b6e2127edeb6cd",
"size": "8104",... |
from django.db import models
class OrderTransaction(models.Model):
order_number = models.CharField(max_length=128, db_index=True)
| {
"content_hash": "10cfcfd802a1093a6a04c6b283980ac0",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 66,
"avg_line_length": 22.833333333333332,
"alnum_prop": 0.7664233576642335,
"repo_name": "django-oscar/django-oscar-amazon-payments",
"id": "e8a6fa82750bdfdfcd1b2b6356f415219... |
"""Copyright 2008 Orbitz WorldWide
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 in writing, software... | {
"content_hash": "4b3aa8a3c85341b4430c643ef9280668",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 122,
"avg_line_length": 33.21666666666667,
"alnum_prop": 0.7420973406924235,
"repo_name": "johnseekins/graphite-web",
"id": "ecdb04059c10c2d51509c0a521e260862a5fef95",
"siz... |
import os
import sys
_SCRIPT_DIR = os.path.dirname(__file__)
_OUTPUT_FILE = os.path.join(_SCRIPT_DIR, 'apkanalyzer.output')
def main():
# Without a proguard mapping file, the last argument is the apk_path.
apk_path = sys.argv[-1]
assert os.path.exists(apk_path), 'Apk does not exist: {}'.format(apk_path)
wit... | {
"content_hash": "4621388f5ea38fed48fcf10f9bd924d2",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 76,
"avg_line_length": 23.38888888888889,
"alnum_prop": 0.6484560570071259,
"repo_name": "endlessm/chromium-browser",
"id": "79d149a7b2f8ca0913560721ba59723f79f2b262",
"siz... |
import sys
import numpy as np
from phonopy.units import Hbar, EV, THz
from phonopy.phonon.degeneracy import degenerate_sets
from phono3py.phonon3.triplets import get_triplets_integration_weights
from phono3py.phonon.func import bose_einstein
from phono3py.file_IO import (write_gamma_detail_to_hdf5,
... | {
"content_hash": "43f1b114e39c3d1a04d5d25ea22e5de8",
"timestamp": "",
"source": "github",
"line_count": 747,
"max_line_length": 81,
"avg_line_length": 40.32797858099063,
"alnum_prop": 0.5163153526970954,
"repo_name": "atztogo/phono3py",
"id": "4ecafff7f05b27bc32dfdc0d7426e7b1b4affc80",
"size": "317... |
"""Tests for TFGAN classifier_metrics."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tarfile
import tempfile
import numpy as np
from scipy import linalg as scp_linalg
from google.protobuf import text_format
from tensorflow.contrib.g... | {
"content_hash": "efa7d0f05e05d9535d9cc18672b16165",
"timestamp": "",
"source": "github",
"line_count": 322,
"max_line_length": 99,
"avg_line_length": 30.847826086956523,
"alnum_prop": 0.6505587435819994,
"repo_name": "dyoung418/tensorflow",
"id": "92e0a995748c1c4c2ddfff0daae59be5a6eaefb4",
"size":... |
from copy import copy
import pytest
from sovrin_node.test import waits
from stp_core.loop.eventually import eventually
from plenum.common.constants import VERSION
from sovrin_common.constants import ACTION, CANCEL, JUSTIFICATION
from sovrin_node.test.upgrade.helper import checkUpgradeScheduled, \
checkNoUpgradeSc... | {
"content_hash": "3aa61bebab34f3f9d4cf8aa0f8f4a55d",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 111,
"avg_line_length": 36.57142857142857,
"alnum_prop": 0.6689453125,
"repo_name": "keenondrums/sovrin-node",
"id": "1275d2b7c2dc58a0a91e25f05eec166ebacb0ddd",
"size": "5... |
import pytest
import sys
from os import path
test_dir = path.dirname(path.realpath(__file__))
sys.path.insert(0, path.dirname(test_dir))
if __name__ == '__main__':
raise SystemExit(pytest.main())
| {
"content_hash": "dc9add4307a401466831ee6cdf350e5f",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 48,
"avg_line_length": 20.3,
"alnum_prop": 0.6798029556650246,
"repo_name": "six8/python-clom",
"id": "854c6628ed650cfe521d251cfdec146ef84b0b9c",
"size": "225",
"binary":... |
from __future__ import unicode_literals
from django import template
# This will add the localsite tags as built-in tags, and override the existing
# {% url %} tag in Django.
template.add_to_builtins(__name__ + '.localsite')
| {
"content_hash": "fe19fa9aadbb7130033b67c833de4dd8",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 78,
"avg_line_length": 28.375,
"alnum_prop": 0.7268722466960352,
"repo_name": "1tush/reviewboard",
"id": "88c59d9ba5206bd70d73c677e8e2a17a0b55c994",
"size": "227",
"binary... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_tatooine_alkhara_champion.iff"
result.attribute_template_id = 9
result.stfName("theme_park_name","alkhara_champion")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return resul... | {
"content_hash": "74df77fcef23bfea06d4c81c025b53ba",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 79,
"avg_line_length": 24.692307692307693,
"alnum_prop": 0.7102803738317757,
"repo_name": "obi-two/Rebelion",
"id": "60971b68df8d298c086db486ef02ac42b8d6cf86",
"size": "466... |
"""
Beautiful Soup parses a (possibly invalid) XML or HTML document into a tree representation.
It provides methods and Pythonic idioms that make it easy to navigate, search, and modify the tree.
http://www.crummy.com/software/BeautifulSoup/
Beautiful Soup parses a (possibly invalid) XML or HTML document into a
tree ... | {
"content_hash": "ba72c426c9d266512e217ef1625238a7",
"timestamp": "",
"source": "github",
"line_count": 2000,
"max_line_length": 186,
"avg_line_length": 39.501,
"alnum_prop": 0.5737196526670211,
"repo_name": "sniemi/SamPy",
"id": "6a327212aa472628da8e5328adb3ac513c17e3c3",
"size": "79002",
"binar... |
"""Utilities for model tests."""
from flax import linen as nn
from jax import random
import jax.numpy as jnp
def get_common_model_test_inputs():
"""Get common inputs for model tests."""
rng = random.PRNGKey(0)
batch_size = 4
seq_len = 16
inputs = jnp.ones((batch_size, seq_len), dtype=jnp.int32)
shared_arg... | {
"content_hash": "6df8876cb153f0852e8902fa9f09172d",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 59,
"avg_line_length": 26.923076923076923,
"alnum_prop": 0.6192857142857143,
"repo_name": "google-research/pegasus",
"id": "c7aa39d33b8933762d33247d26860ea7037c60b9",
"size... |
"""
Primitive Operators (:mod:`qiskit.opflow.primitive_ops`)
========================================================
.. currentmodule:: qiskit.opflow.primitive_ops
Operators are defined to be functions which take State functions to State functions.
PrimitiveOps are the classes for representing basic Operators, back... | {
"content_hash": "958dfb3a5d9e4764b910e4bb7b1803a7",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 91,
"avg_line_length": 29.262295081967213,
"alnum_prop": 0.726610644257703,
"repo_name": "QISKit/qiskit-sdk-py",
"id": "1af6558935993023bcf8ef93f694ff2624dc97f7",
"size": "... |
import scipy.spatial as sptl
import scipy.sparse as sprs
import numpy as np
from openpnm._skgraph.generators import tools
from openpnm._skgraph.operations import trim_nodes
from openpnm._skgraph.tools import isoutside, conns_to_am
from openpnm._skgraph.queries import find_neighbor_nodes
def voronoi_delaunay_dual(poin... | {
"content_hash": "bd0b0bcf0d03d9a0a7e5292817540094",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 82,
"avg_line_length": 40.33566433566433,
"alnum_prop": 0.6437239944521498,
"repo_name": "PMEAL/OpenPNM",
"id": "fac3c1fd1bfff3b9b3b1cc9f2c4316374474baa8",
"size": "5768",... |
"""Camera control on a surface.
Camera is just a pygame surface, so treat it as such!
A camera allows you to have a viewport which is smaller than the size
of the surface you're hoping to pan that viewport around on. Think
about looking at a big painting through a paper towel tube.
Cameras have an output resolution ... | {
"content_hash": "fe5c8609b194785b169541a00798e92f",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 74,
"avg_line_length": 32.74193548387097,
"alnum_prop": 0.6394088669950739,
"repo_name": "lillian-lemmer/sappho",
"id": "8443b1485ffc22cdffc296bda91e0de05598a36d",
"size":... |
"""
Perm Store
author: Kevin Jamieson, [email protected]
last updated: 12/31/2014
Persistent storage solution. Database hierarchy is organized as: ::\n
PermStore[database_id][bucket_id][doc_uid] = {key1:value1,key2:value2,...}
Dependencies: next.constants to determine location of mongoDB server
Some com... | {
"content_hash": "3b3dc0b8127c2de2c20264b543488774",
"timestamp": "",
"source": "github",
"line_count": 849,
"max_line_length": 445,
"avg_line_length": 35.38398115429918,
"alnum_prop": 0.5641623115076063,
"repo_name": "crcox/NEXT",
"id": "fc6e74f208a6f245d588bf4f9c8c2a3e00933956",
"size": "30041",
... |
import os
from setuptools import setup, find_packages
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='recsys_data_pipeline',
version='1.0',
install_requires=[],
packages=find_packages(),
) | {
"content_hash": "610b15b3b1d7fe72ab7400908ec3fa13",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 70,
"avg_line_length": 22.583333333333332,
"alnum_prop": 0.6420664206642066,
"repo_name": "chrisbangun/dataflow-appengine",
"id": "9020850f43d33ba341d8cc862e505982a758c231",
... |
from urlparse import urlparse
import hmac
from hashlib import sha1
from base64 import urlsafe_b64encode
from .. import rpc
from .. import conf
class Mac(object):
access = None
secret = None
def __init__(self, access=None, secret=None):
if access is None and secret is None:
access, se... | {
"content_hash": "e38e5e4361e161b0dca89c75eb7e09e3",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 76,
"avg_line_length": 28.737704918032787,
"alnum_prop": 0.5653166001140901,
"repo_name": "davidvon/pipa-pay-server",
"id": "dcee6fbcfe6ad961d28b45938ef2931967a05933",
"siz... |
err_msg = """
Typical Usage:
raw2subtractlines.py [-norm] < coordinate_file
Coordinates read from one line of the file are subtracted from coordinates
from the next line of the file (if it contains coordinates) and printed to
the standard output. Blank lines in the input file are copied to the
standar... | {
"content_hash": "15f00cbc110a53e42f51a9d9c1a6af6a",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 80,
"avg_line_length": 27.859649122807017,
"alnum_prop": 0.575566750629723,
"repo_name": "jewettaij/moltemplate",
"id": "dd01e783d193f0b15b03d06faa19b2b3086e42b5",
"size":... |
import re
from datetime import datetime
from uuid import UUID
from enum import Enum, auto
from graphql.language.source import Source
from graphql.language.parser import parse
from graphql.language.ast import (
ObjectTypeDefinition,
NamedType,
NonNullType,
ListType,
InputObjectTypeDefinition,
E... | {
"content_hash": "8ca1fbfea13bd9c16c3aaf59161300a9",
"timestamp": "",
"source": "github",
"line_count": 559,
"max_line_length": 107,
"avg_line_length": 34.1788908765653,
"alnum_prop": 0.6438815031927143,
"repo_name": "schrockntemp/graphscaletemp",
"id": "f7695927f99f11ca454a30471704f2db88b0b417",
"... |
"""
.. module:: mpl_get_data_wuppe
:synopsis: Returns WUPPE spectral data as a JSON string through Randy's
mast_plot.pl service.
.. moduleauthor:: Scott W. Fleming <[email protected]>
"""
import collections
from operator import itemgetter
from data_series import DataSeries
import requests
#-------------------... | {
"content_hash": "1083c39bfb69aa4f3d5368075add1386",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 80,
"avg_line_length": 39.54,
"alnum_prop": 0.5424886191198786,
"repo_name": "openSAIL/MASTDataDelivery",
"id": "5f20a6a65cfe3e7121ec5d1e71272572f16dbeab",
"size": "3954",... |
import cgi
import multiprocessing
import os
import subprocess
import sys
import argparse
import python_utils.jobset as jobset
import python_utils.start_port_server as start_port_server
sys.path.append(
os.path.join(os.path.dirname(sys.argv[0]), '..', 'profiling',
'microbenchmarks', 'bm_diff'))
im... | {
"content_hash": "1e2272c32b218d0ba7136da69619af3a",
"timestamp": "",
"source": "github",
"line_count": 246,
"max_line_length": 84,
"avg_line_length": 35.32113821138211,
"alnum_prop": 0.5509264587409368,
"repo_name": "firebase/grpc",
"id": "4b9cd4bc8e85661f9a9cfeefbcc310b227710f5d",
"size": "9289",... |
import tomviz.operators
class LabelObjectDistanceFromPrincipalAxis(tomviz.operators.CancelableOperator):
def transform_scalars(self, dataset, label_value=1, principal_axis=0):
"""Computes the distance from the centroid of each connected component
in the label object with the given label_value to ... | {
"content_hash": "0b585aec869d2855f3cbac707fd67ec0",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 80,
"avg_line_length": 41.410526315789475,
"alnum_prop": 0.6263345195729537,
"repo_name": "mathturtle/tomviz",
"id": "f808de794a00368fdae049e047a1bc7067ac0ac4",
"size": "39... |
import pandas
import numpy as np
import scipy
import statsmodels.api as sm
import traceback
import logging
from time import time
from msgpack import unpackb, packb
from redis import StrictRedis
from settings import (
ALGORITHMS,
CONSENSUS,
FULL_DURATION,
MAX_TOLERABLE_BOREDOM,
MIN_TOLERABLE_LENGTH,... | {
"content_hash": "7f32df71c06c84c6aee7a28803908f17",
"timestamp": "",
"source": "github",
"line_count": 337,
"max_line_length": 127,
"avg_line_length": 31.49258160237389,
"alnum_prop": 0.6492980307170452,
"repo_name": "neo900/skyline",
"id": "f1c6d66e2e31c6179803737f234fab89cce406cd",
"size": "1061... |
from fabric.api import *
env.hosts = ['base102.net']
env.user = 'adewinter'
def push_local():
local('git push origin master') # runs the command on the local environment
def pull_remote():
with cd('/opt/www/bitpay-shopify'):
run('whoami')
run('git pull origin master') # runs the command o... | {
"content_hash": "3746357b3262ddf020f55a005cd98673",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 83,
"avg_line_length": 16.339622641509433,
"alnum_prop": 0.6397228637413395,
"repo_name": "adewinter/bitpay-shopify",
"id": "79606a5d7b4cc621d7272f25a4190d3495c087c0",
"siz... |
from django import forms
from django.utils.translation import ugettext_lazy as _
from student.apps.courses.tasks.models import Task
#Task form
class TaskForm(forms.Form):
text = forms.CharField(label=_("Text"), required=True)
explanation = forms.CharField(label=_("Explanation"), required=False)
note = fo... | {
"content_hash": "1fbd0c88c4f6ce70357bfa27237bd34b",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 73,
"avg_line_length": 34.13513513513514,
"alnum_prop": 0.5811559778305622,
"repo_name": "houssemFat/MeeM-Dev",
"id": "c526ace05115f453554cb3648ee19a312490038f",
"size": "1... |
"""
Implementation for rebalance, add, remove, stop rebalance.
"""
import time
import os
import sys
import util_cli as util
import socket
from usage import usage
from restclient import *
from listservers import *
# the rest commands and associated URIs for various node operations
rest_cmds = {
'rebalance' ... | {
"content_hash": "9b1ad58a1e966193aa73c6acff25ff51",
"timestamp": "",
"source": "github",
"line_count": 460,
"max_line_length": 85,
"avg_line_length": 35.14782608695652,
"alnum_prop": 0.4631370608609599,
"repo_name": "membase/membase-cli",
"id": "1e9800cb74bf4ba6d12b0cf90f4f7947dc6977a6",
"size": "... |
import sys
if sys.platform != 'darwin':
raise ValueError, "This test only leaks on Mac OS X"
def leak():
# taken from platform._mac_ver_lookup()
from gestalt import gestalt
import MacOS
try:
gestalt('sysu')
except MacOS.Error:
pass
| {
"content_hash": "9829ef75ddf5de16197a2a3d5cb45148",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 56,
"avg_line_length": 20.642857142857142,
"alnum_prop": 0.5986159169550173,
"repo_name": "babyliynfg/cross",
"id": "ac6522bcf21a34d3080e6ef18f3a1f0394603e37",
"size": "289... |
from hellosign_sdk.utils import HSRequest, HSException, NoAuthMethod, HSAccessTokenAuth, HSFormat, api_resource, api_resource_list
from hellosign_sdk.resource import Account, ApiApp, SignatureRequest, Template, Team, Embedded, UnclaimedDraft
from requests.auth import HTTPBasicAuth
import json
#
# The MIT License (MIT)... | {
"content_hash": "5ab5b846c49f06a0e196601f1dc10383",
"timestamp": "",
"source": "github",
"line_count": 2499,
"max_line_length": 331,
"avg_line_length": 42.43817527010804,
"alnum_prop": 0.6282613410275995,
"repo_name": "HelloFax/hellosign-python-sdk",
"id": "bdcdbcdcf78084c97d3cbdc0beb491fcb0d8b4fe",... |
"""Manages a graph of Trackable objects."""
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/license... | {
"content_hash": "2a777a612add02e476cc51603bd0ff7c",
"timestamp": "",
"source": "github",
"line_count": 431,
"max_line_length": 105,
"avg_line_length": 44.0046403712297,
"alnum_prop": 0.6612886217441738,
"repo_name": "ghchinoy/tensorflow",
"id": "ba2387870182cef6e578c7b947f07a4957fdf22c",
"size": "... |
import re
from django.utils.translation import ugettext_lazy as _
from base import (
ADDON_DICT, ADDON_EXTENSION, ADDON_LPAPP, ADDON_PERSONA, ADDON_PLUGIN,
ADDON_SEARCH, ADDON_STATICTHEME, ADDON_THEME)
from olympia.versions.compare import version_int as vint
class App(object):
@classmethod
def matc... | {
"content_hash": "99a97d18e103e05e581fa7c3aa0b2343",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 78,
"avg_line_length": 32.239583333333336,
"alnum_prop": 0.6411954765751212,
"repo_name": "harry-7/addons-server",
"id": "255578f4287b3efe14b56bf0527a06b27109297f",
"size"... |
"""Assorted commands.
"""
import os
import threading
import sublime
import sublime_plugin
from Vintageous.state import _init_vintageous
from Vintageous.state import State
from Vintageous.vi import settings
from Vintageous.vi import cmd_defs
from Vintageous.vi.dot_file import DotFile
from Vintageous.vi.utils import m... | {
"content_hash": "c0470cf05d169d017bb860d79b3ca3fe",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 78,
"avg_line_length": 32.1436170212766,
"alnum_prop": 0.597385404600364,
"repo_name": "vastcharade/Vintageous",
"id": "d183d123a999b015bfbb76065154e64996400405",
"size": ... |
"""
When given a :class:`BatchWriteItem`, the connection will return a :class:`BatchWriteItemResponse`:
>>> connection(
... BatchWriteItem().table(table).delete({"h": 0}, {"h": 1})
... )
<LowVoltage.actions.batch_write_item.BatchWriteItemResponse ...>
See also the :func:`.batch_put_item` and :func:`.batch_delete_it... | {
"content_hash": "a2861811844384b6641a112f3ca4d880",
"timestamp": "",
"source": "github",
"line_count": 491,
"max_line_length": 173,
"avg_line_length": 34.77393075356415,
"alnum_prop": 0.5197961813283355,
"repo_name": "jacquev6/LowVoltage",
"id": "f8a99dce11d7c1a7414ee4176bf7ebc3ce16f3c5",
"size": ... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'UserProfile.can_create'
db.add_column('website_userprofile', 'can_create',
self.gf('django.db.... | {
"content_hash": "f183c9de07bc4198875fb1c6094846ab",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 182,
"avg_line_length": 74.3625730994152,
"alnum_prop": 0.5518244731047499,
"repo_name": "UniShared/unishared",
"id": "f2d794ca48b4d4cda3f7a98b8bd9babc3f28cf71",
"size": "... |
import reversion
from django.contrib import admin
from base.admin import (MediaRemovalAdminMixin, DownloadMediaFilesMixin,
RestrictedCompetitionAdminMixin)
from .models import Leaflet
class LeafletAdmin(RestrictedCompetitionAdminMixin,
MediaRemovalAdminMixin,
... | {
"content_hash": "30dc816752ea31cf588c3f9a549102e5",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 76,
"avg_line_length": 21.29090909090909,
"alnum_prop": 0.5550811272416738,
"repo_name": "tbabej/roots",
"id": "ede63596afa3334f8adf6006d59155d76566ee90",
"size": "1171",
... |
import json
from unittest import TestCase
from unittest.mock import patch
from identity.views import (
ListUserRoleView, AddUserRoleView, DeleteUserRoleView)
from identity.tests.fakes import FakeToken, FakeResource
from vault.tests.fakes import fake_request, UserFactory
class BaseAjaxTestCase(TestCase):
vie... | {
"content_hash": "7d8ea2d15393560c555811375e58e035",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 84,
"avg_line_length": 31.86046511627907,
"alnum_prop": 0.6525547445255474,
"repo_name": "globocom/vault",
"id": "192de7fec9cb200b4ed873d31b806574eba6f860",
"size": "6874"... |
import json
import urlparse
from tempest.common.rest_client import RestClient
class EndPointClientJSON(RestClient):
def __init__(self, config, username, password, auth_url, tenant_name=None):
super(EndPointClientJSON, self).__init__(config,
username, pass... | {
"content_hash": "9cf92bd8c8224503f7c31056a300d821",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 79,
"avg_line_length": 39.44285714285714,
"alnum_prop": 0.5461789206809127,
"repo_name": "eltonkevani/tempest_el_env",
"id": "cf26d0a1e4aa5e096abb64d71dbc0c1c0c60425c",
"si... |
from collections import defaultdict
from datetime import datetime, timedelta
from itertools import islice
from math import ceil, floor, sqrt
from urlparse import urljoin
# project
from checks import AgentCheck
from utils.containers import hash_mutable
# 3p
import requests
# More information in https://www.consul.io... | {
"content_hash": "b5f0e61b946e73cd07a55cc2929e2295",
"timestamp": "",
"source": "github",
"line_count": 463,
"max_line_length": 142,
"avg_line_length": 46.60259179265659,
"alnum_prop": 0.5514668396904111,
"repo_name": "itsuugo/integrations-core",
"id": "0207d75cea4ff7a29950179cea2677832d6ebd81",
"s... |
from azure.identity import DefaultAzureCredential
from azure.mgmt.datamigration import DataMigrationManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-datamigration
# USAGE
python tasks_update.py
Before run the sample, please set the values of the client ID, tenant ... | {
"content_hash": "7fc271a33d69481eb8393df169aaa9c5",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 144,
"avg_line_length": 35.568627450980394,
"alnum_prop": 0.6085997794928335,
"repo_name": "Azure/azure-sdk-for-python",
"id": "28d46d756d2b260d947b001f689e297d31e10a1c",
"... |
"""The tests for NEW_NAME device actions."""
import pytest
from homeassistant.components import automation
from homeassistant.components.NEW_DOMAIN import DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry, entity_registry
from homeassistant.setup import async_setup_c... | {
"content_hash": "31e0d15d294b56be7fccd2d5423f7126",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 85,
"avg_line_length": 32.596330275229356,
"alnum_prop": 0.550520686743597,
"repo_name": "kennedyshead/home-assistant",
"id": "424fa0a9afd08ca281e3ee97f2504f20dc2c0f06",
"... |
from django import http
try:
from django.conf import settings
XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS
XS_SHARING_ALLOWED_METHODS = settings.XS_SHARING_ALLOWED_METHODS
XS_SHARING_ALLOWED_HEADERS = settings.XS_SHARING_ALLOWED_HEADERS
XS_SHARING_ALLOWED_CREDENTIALS = settings.... | {
"content_hash": "fe644a8cf07646afa88eb0ddcb82b65d",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 94,
"avg_line_length": 44.214285714285715,
"alnum_prop": 0.6882067851373183,
"repo_name": "ksiomelo/cubix",
"id": "77657be00729d733b0ccd73eaf5f2ea8db370a8b",
"size": "1857"... |
import unittest
from bulbs.config import Config
from bulbs.tests import BulbsTestCase, bulbs_test_suite
from bulbs.neo4jserver import Graph, Neo4jClient, NEO4J_URI, \
VertexIndexProxy, EdgeIndexProxy, ExactIndex
from bulbs.tests import GremlinTestCase
config = Config(NEO4J_URI)
BulbsTestCase.client = Neo4jClient(co... | {
"content_hash": "583b9f465c1075654b9e57f36e85b797",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 62,
"avg_line_length": 32.56521739130435,
"alnum_prop": 0.7823765020026703,
"repo_name": "windj007/bulbs",
"id": "de7e017a71504e24dbb498347aeb76688e500675",
"size": "749",
... |
from common_fixtures import * # NOQA
def test_zone_list(admin_client, client):
zones = admin_client.list_zone()
assert len(zones) > 0
zones = client.list_zone()
assert len(zones) >= 0
| {
"content_hash": "f796d23eac87f367890b33e65a4397f3",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 41,
"avg_line_length": 22.666666666666668,
"alnum_prop": 0.6519607843137255,
"repo_name": "alena1108/cattle",
"id": "b404a2cc273173f7f5864ebce63ad4e2fb82ef80",
"size": "204"... |
from ...attrs import LIKE_NUM
# fmt: off
_num_words = [
"zero", "one", "two", "three", "four", "five", "six", "seven", "eight",
"nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen",
"sixteen", "seventeen", "eighteen", "nineteen", "twenty", "thirty", "forty",
"fifty", "sixty", "seventy",... | {
"content_hash": "0dd309d6a8ae26c4e8690bfd06deaa6d",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 82,
"avg_line_length": 35.86363636363637,
"alnum_prop": 0.5754119138149556,
"repo_name": "spacy-io/spaCy",
"id": "fcc7c6bf2dbc0435f17f082165cbca55d286d6ed",
"size": "1579",... |
"""Tests for QueueRunner."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
import tensorflow as tf
class QueueRunnerTest(tf.test.TestCase):
def testBasic(self):
with self.test_session() as sess:
# CountUpTo will raise OUT_OF_RAN... | {
"content_hash": "4de577bce92379da59564115010987c3",
"timestamp": "",
"source": "github",
"line_count": 282,
"max_line_length": 79,
"avg_line_length": 38.61347517730496,
"alnum_prop": 0.6439526127284415,
"repo_name": "gibiansky/tensorflow",
"id": "9bc2c30285a9246d2e7b4947af866578bf8b4746",
"size": ... |
"""Fast R-CNN config system.
This file specifies default config options for Fast R-CNN. You should not
change values in this file. Instead, you should write a config file (in yaml)
and use cfg_from_file(yaml_file) to load it and override the default options.
Most tools in $ROOT/tools take a --cfg option to specify an... | {
"content_hash": "97ebc15a2fbed4a2795b0813e6e89fbe",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 80,
"avg_line_length": 30.029239766081872,
"alnum_prop": 0.6648490749756573,
"repo_name": "MichaelXin/fast-rcnn",
"id": "ee22d8e569f8bfcf0be3472c18f5d99e4cf4b465",
"size":... |
"""Pinpoint Service (Python 3)
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import six
if six.PY3:
import logging
import google.cloud.logging
google.cloud.logging.Client().setup_logging(log_level=logging.DEBUG)
from dashboard.pinpoint import ... | {
"content_hash": "e5ffab65eb1d0d3df6b95cc28fe63191",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 70,
"avg_line_length": 20.764705882352942,
"alnum_prop": 0.7592067988668555,
"repo_name": "catapult-project/catapult",
"id": "a7d2d573ce6a0f58766810ad1f5db281a765000e",
"si... |
import pytest
from pybind11_tests import ConstructorStats
def test_smart_ptr(capture):
# Object1
from pybind11_tests import (MyObject1, make_object_1, make_object_2,
print_object_1, print_object_2, print_object_3, print_object_4)
for i, o in enumerate([make_object_1(), mak... | {
"content_hash": "0d16e06920d767c2ee3dbab7fc14bff7",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 97,
"avg_line_length": 35.20967741935484,
"alnum_prop": 0.6368529546495648,
"repo_name": "ilyaraz/falconn_polygon",
"id": "144180d8ca97633e18111c5ab14b72edb2fc7b0b",
"size... |
from azure.identity import DefaultAzureCredential
from azure.mgmt.logic import LogicManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-logic
# USAGE
python enable_a_workflow.py
Before run the sample, please set the values of the client ID, tenant ID and client secre... | {
"content_hash": "ff39919cca2d1d86f7474a3342108aa1",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 123,
"avg_line_length": 32.666666666666664,
"alnum_prop": 0.7282003710575139,
"repo_name": "Azure/azure-sdk-for-python",
"id": "cf96b9cc4188ecc9c5498ba8ead4d132c6dcd7c4",
"... |
from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Tickfont(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout.scene.zaxis"
_path_str = "layout.scene.zaxis.tickfont"
_valid_props = {"color", ... | {
"content_hash": "1d043e7722075c095f84129e13d95780",
"timestamp": "",
"source": "github",
"line_count": 227,
"max_line_length": 84,
"avg_line_length": 37.242290748898675,
"alnum_prop": 0.5596167494677076,
"repo_name": "plotly/plotly.py",
"id": "bd3a918362a2a0e56e4279cf91484c7f53e340d7",
"size": "84... |
import eventlet
import uuid
from kombu.mixins import ConsumerMixin
from kombu import Connection
from oslo_config import cfg
from st2common import log as logging
from st2common.persistence.trigger import Trigger
from st2common.transport import reactor, publishers
LOG = logging.getLogger(__name__)
class TriggerWatche... | {
"content_hash": "a6624582100d354fc2fa941880152af4",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 95,
"avg_line_length": 38.51162790697674,
"alnum_prop": 0.6048711755233495,
"repo_name": "grengojbo/st2",
"id": "c57d4a79e5866c49b5a40c7601092eb732f26fb1",
"size": "5748",... |
from .tensorflow_constructions import leaky_relu
import scipy.sparse, networkx, tensorflow as tf, numpy as np, pandas as pd
# TODO(mmd): Use generators properly.
def split_into_components(X_df, G):
"""set(X_df.columns) must == set(G.nodes)"""
components = list(networkx.components.connected_components(G))
X_spl... | {
"content_hash": "e91ac38d1cb7f90f36f7fee4fa956d30",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 110,
"avg_line_length": 39.401162790697676,
"alnum_prop": 0.6175298804780877,
"repo_name": "mmcdermott/ml_toolkit",
"id": "8626e98cb92b8bc7d9556d24dbc5111ff058558b",
"size... |
"""Generates a saved model with tf.Pow to trigger placer and grappler."""
import shutil
from absl import app
from absl import flags
from tensorflow.python.client import session
from tensorflow.python.framework import dtypes
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import math_ops
from ten... | {
"content_hash": "2a6034a4478469f795706bf32defe2a7",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 77,
"avg_line_length": 32.361111111111114,
"alnum_prop": 0.7072961373390558,
"repo_name": "tensorflow/tensorflow-pywrap_tf_optimizer",
"id": "8825353cba9539db0b62d3a8961dc25f... |
import numpy as np
from .interfaces.dataset import Dataset
from .interfaces.model import Model
from .interfaces.loss import Loss
from .interfaces.optimizer import Optimizer
from .interfaces.batch_scheduler import BatchScheduler
class DummyDataset(Dataset):
def __init__(self):
super(DummyDataset, self).__... | {
"content_hash": "75a0d3272a35eff2197ec677ed9c6238",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 69,
"avg_line_length": 20.397260273972602,
"alnum_prop": 0.6165211551376762,
"repo_name": "havaeimo/smartlearner",
"id": "5edf1cec1875d5e1a1ea63c6f653830b0c541a67",
"size":... |
from typing import Any, Callable, Dict, Optional
from jira.resources import Issue, Resource
from airflow.providers.jira.operators.jira import JIRAError, JiraOperator
from airflow.sensors.base import BaseSensorOperator
class JiraSensor(BaseSensorOperator):
"""
Monitors a jira ticket for any change.
:par... | {
"content_hash": "32d1e935ec2aaeebc16a65c7a12c8dd8",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 110,
"avg_line_length": 38.75590551181102,
"alnum_prop": 0.6091019910605445,
"repo_name": "dhuang/incubator-airflow",
"id": "30e272758bfa04f9a0a44f63bcdb46a1482667bc",
"si... |
from django.db import models
from django.utils import timezone
from django.core.urlresolvers import reverse
class CodeMixin(models.Model):
code = models.CharField(max_length=255, unique=True)
class Meta:
abstract = True
class NameMixin(models.Model):
name = models.CharField(max_length=255, uniqu... | {
"content_hash": "3f5ea7487682feb0211d375c1bb3e4f7",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 97,
"avg_line_length": 31.41176470588235,
"alnum_prop": 0.6869538077403246,
"repo_name": "EliotBerriot/malepierre",
"id": "e2014d5359501b972b70c4ffcf2d05d8c9ea9fb3",
"size... |
import sys
import isodate
import datetime
from traceback import print_exc
from nose import SkipTest
from earl import add_test, report
from rdflib import BNode, Graph, ConjunctiveGraph
# TODO: make an introspective version (like this one) of
# rdflib.graphutils.isomorphic and use instead.
def crapCompare(g1, g2):
... | {
"content_hash": "9aa63c5f34734033307b40b4f0648c77",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 84,
"avg_line_length": 30.65979381443299,
"alnum_prop": 0.5706119704102219,
"repo_name": "dbs/rdflib",
"id": "6f97ea9d1ac8e90a27fc06fd87bfd29e4f69b0a5",
"size": "2975",
"... |
"""Common File System Utilities."""
import os
import shutil
def abspath(path):
"""
Return an absolute path, while also expanding the '~' user directory
shortcut.
:param path: The original path to expand.
:rtype: str
"""
return os.path.abspath(os.path.expanduser(path))
def backup(path,... | {
"content_hash": "d75999d2797ce37bfd1c5968551962fa",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 72,
"avg_line_length": 26.21818181818182,
"alnum_prop": 0.5575589459084604,
"repo_name": "akhilman/cement",
"id": "a96a52a01b987d41f6dfcbb74e4623b3578263e5",
"size": "1442"... |
from .. ndtypes import make_fn_type, Type
from expr import Expr
from stmt import block_to_str
################################################################################
#
# Constructs below here are only used in the typed representation
#
#####################################################################... | {
"content_hash": "830fe03da02a5cb20c8954fdd02dd612",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 102,
"avg_line_length": 28.427419354838708,
"alnum_prop": 0.5960283687943262,
"repo_name": "pombredanne/parakeet",
"id": "44a7a0a3e32b7f0d084b93ba023e608b5ae22207",
"size"... |
from azure.identity import DefaultAzureCredential
from azure.mgmt.batch import BatchManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-batch
# USAGE
python location_get_quotas.py
Before run the sample, please set the values of the client ID, tenant ID and client sec... | {
"content_hash": "adff4e05eca676663c601c957d91970a",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 124,
"avg_line_length": 31.1875,
"alnum_prop": 0.7284569138276553,
"repo_name": "Azure/azure-sdk-for-python",
"id": "25a2cd47e5be6b2ddc50522d17605ee572b11b82",
"size": "146... |
from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:9332")
else:
access = Ser... | {
"content_hash": "01a32b8fa2cdf31ca776735847431595",
"timestamp": "",
"source": "github",
"line_count": 324,
"max_line_length": 79,
"avg_line_length": 24.17283950617284,
"alnum_prop": 0.6615168539325843,
"repo_name": "wolske/dcoin",
"id": "760d028b9eb392bf5428f0a721b7fbe5c90f54a9",
"size": "7832",
... |
class PaystreamPipeline(object):
def process_item(self, item, spider):
return item
| {
"content_hash": "f61f99395228f0006f6f4ec34f82f55b",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 41,
"avg_line_length": 31.666666666666668,
"alnum_prop": 0.6947368421052632,
"repo_name": "munhitsu/paystream-scrap",
"id": "1ea160b3d97980aef90f144d0aed2950bc1b394f",
"size... |
"""
The LayerMapping class provides a way to map the contents of OGR
vector files (e.g. SHP files) to Geographic-enabled Django models.
This grew out of my personal needs, specifically the code repetition
that went into pulling geometries and fields out of an OGR layer,
converting to another coordinate system (e.... | {
"content_hash": "796213135201c47156cf05d098a77560",
"timestamp": "",
"source": "github",
"line_count": 676,
"max_line_length": 142,
"avg_line_length": 44.01627218934911,
"alnum_prop": 0.592135775499916,
"repo_name": "Shrews/PyGerrit",
"id": "40d2e97278459f5bde964f1b8eb1196bfd6f338b",
"size": "2981... |
"""
Copyright (c) 2014 Dan Obermiller
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 rights
to use, copy, modify, merge, publish, distribute,... | {
"content_hash": "2d271407b004d9b651240f96ea2bded0",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 78,
"avg_line_length": 37.34080717488789,
"alnum_prop": 0.5240782995076257,
"repo_name": "Dannnno/PyIRC",
"id": "3e100680aa8df065ac9cf8e71cf5dfcdff642656",
"size": "8327",... |
from decimal import Decimal, InvalidOperation
from datetime import datetime
import iso8601
def string(els):
if isinstance(els, basestring):
return els.strip()
return ''.join(el.text_content().strip() for el in els)
def integer_single(s):
s = s.strip().replace(',', '')
return int(s)
def in... | {
"content_hash": "1399a5abafcc4ead9043c5cd9e2054e6",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 70,
"avg_line_length": 21.36986301369863,
"alnum_prop": 0.5814102564102565,
"repo_name": "storborg/itsy",
"id": "ae9dd2eb730cf59fa260e4be74ad02f666da4336",
"size": "1560",
... |
import unittest
from cupy import testing
@testing.gpu
class TestElementwise(unittest.TestCase):
@testing.for_int_dtypes()
@testing.numpy_cupy_array_equal()
def check_unary_int(self, name, xp, dtype):
a = xp.array([-3, -2, -1, 0, 1, 2, 3], dtype=dtype)
return getattr(xp, name)(a)
@te... | {
"content_hash": "ece0e737db44ecacef958c5ed3a4c95a",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 59,
"avg_line_length": 27.342105263157894,
"alnum_prop": 0.6073147256977863,
"repo_name": "cupy/cupy",
"id": "eca12f948b75ed6f5188113081037743abcf173b",
"size": "1039",
"... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('djangocms_googlecalendar', '0002_googlecalendar_title'),
]
operations = [
migrations.AlterField(
model_... | {
"content_hash": "92aa3f7295d77c5a66109eb52fce2ea5",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 232,
"avg_line_length": 35.041666666666664,
"alnum_prop": 0.6611177170035671,
"repo_name": "c4sc/arividam",
"id": "af1388afcddfc22326fe6f7f00c987a66ed7c191",
"size": "913",... |
import numpy as np
import scipy.optimize as spo
def get_portfolio_value(prices, allocs, start_val=1):
"""
Compute the daily value of the portfolio with the given prices and initial allocations.
Parameters
----------
prices: DataFrame
the prices of the stocks
allocs: list
the a... | {
"content_hash": "15e701ef6edcb859eed662ae10d9de7c",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 113,
"avg_line_length": 27.441666666666666,
"alnum_prop": 0.6085636197995749,
"repo_name": "hchim/stockanalyzer",
"id": "0eaa6c35bbabb0b2f01607ec85991310c74e0409",
"size":... |
"""
Test ssh/channel.py.
"""
from twisted.conch.ssh import channel
from twisted.trial import unittest
class MockTransport(object):
"""
A mock Transport. All we use is the getPeer() and getHost() methods.
Channels implement the ITransport interface, and their getPeer() and
getHost() methods return ('S... | {
"content_hash": "b1c7ae8390ccb6d549d84ca60baf35fa",
"timestamp": "",
"source": "github",
"line_count": 276,
"max_line_length": 78,
"avg_line_length": 36.221014492753625,
"alnum_prop": 0.6135840752225667,
"repo_name": "bdh1011/wau",
"id": "dcb63570f1075e3c75bee58ffdf44b8864a7d951",
"size": "10078",... |
""" urls.py for flatpagewiki app
"""
from django.conf.urls.defaults import *
urlpatterns = patterns('flatpagewiki.views',
(r'^(?P<slug>[^/]+)/$', 'showpage'),
) | {
"content_hash": "25f585c6a9ee80098b8e9323f890ee09",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 44,
"avg_line_length": 15.727272727272727,
"alnum_prop": 0.6127167630057804,
"repo_name": "snowcloud/django-flatpagewiki",
"id": "2a82f5e4c1b606fae0fa42fc6259dec86e722a57",
... |
"""BCSR (Bached compressed row) matrix object and associated primitives."""
import operator
from typing import NamedTuple, Sequence, Tuple
import numpy as np
from jax import core
from jax.experimental.sparse._base import JAXSparse
from jax.experimental.sparse import bcoo
from jax.experimental.sparse.util import _br... | {
"content_hash": "727e00dcdbf6b5f0c7353e5fe1631e5a",
"timestamp": "",
"source": "github",
"line_count": 406,
"max_line_length": 111,
"avg_line_length": 37.39408866995074,
"alnum_prop": 0.6352259254380187,
"repo_name": "google/jax",
"id": "cde8024d2cc577a927ea81c1cbd002e5a05dd0ec",
"size": "15764",
... |
"""The virtual interfaces extension."""
import webob
from nova.api.openstack import api_version_request
from nova.api.openstack import common
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova import compute
from nova.i18n import _
from nova import network
from nova.policies impor... | {
"content_hash": "54c508e29d833556525d1ce19962f934",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 76,
"avg_line_length": 32.26744186046512,
"alnum_prop": 0.6497297297297298,
"repo_name": "rajalokan/nova",
"id": "6b59e9472246a56380e936b7898bcbc7a71ab13e",
"size": "3406",... |
from oslo_serialization import jsonutils as json
from tempest.lib.common import rest_client
class VersionsClient(rest_client.RestClient):
api_version = "v2"
def list_versions(self):
"""List API versions"""
version_url = self._get_base_version_url()
resp, body = self.raw_request(vers... | {
"content_hash": "75a5d416fe6be650b3ce21e0509e7203",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 60,
"avg_line_length": 32.142857142857146,
"alnum_prop": 0.6255555555555555,
"repo_name": "openstack/tempest",
"id": "98b4fb6209806dba6bc60313c17c18a9da7dc15d",
"size": "15... |
from __main__ import vtk, qt, ctk, slicer
from slicer.ScriptedLoadableModule import *
import os
import numpy
import pickle
import json
#
# Load Files
#
class EasyClip(ScriptedLoadableModule):
def __init__(self, parent):
ScriptedLoadableModule.__init__(self, parent)
parent.title = "Easy Clip"
... | {
"content_hash": "b12ea5210c6aebdb77fcc6d44e4d80c6",
"timestamp": "",
"source": "github",
"line_count": 651,
"max_line_length": 149,
"avg_line_length": 51.3778801843318,
"alnum_prop": 0.570185666875953,
"repo_name": "DCBIA-OrthoLab/EasyClip-Extension",
"id": "6f362532a78c55736584dae2637a806cc2acff5c"... |
"""
Created on Mon Jul 17 16:17:25 2017
@author: jorgemauricio
- Definir una clase llamada Circulo que pueda ser construida por el radio.
La clase Circulo debe de contener un método que pueda calcular el área
"""
class Circulo:
def __init__(self, r):
self.radius = r
def calcularArea(self):
... | {
"content_hash": "f8e671461c29302a3d53668c4e648e8c",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 75,
"avg_line_length": 23.533333333333335,
"alnum_prop": 0.6798866855524079,
"repo_name": "jorgemauricio/INIFAP_Course",
"id": "83cd0d35f911980045ce8ca504adc0eeb68e1fa5",
"... |
from __future__ import unicode_literals
import io
import os.path
import re
import shutil
import tempfile
import unittest
from datetime import datetime
from unittest.mock import patch
import pytest
import _pyjq
import pyjq
def test_compile_dot():
s = pyjq.compile(".")
assert isinstance(s, _pyjq.Script)
de... | {
"content_hash": "5286ea04b05f12d4b92100ec943b6c88",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 88,
"avg_line_length": 25.092198581560282,
"alnum_prop": 0.5356133408705483,
"repo_name": "doloopwhile/pyjq",
"id": "bacc0f4bbccdae2a8c71e24d9139450ec16f1efc",
"size": "35... |
import os, getpass, subprocess, socket, pty
import debug, eth_machinedata
from machines import Machine, MachineLockedError, MachineFactory,\
MachineOperations
from subprocess_timeout import wait_or_terminate
TFTP_PATH='/home/netos/tftpboot'
TOOLS_PATH='/home/netos/tools/bin'
RACKBOOT=os.path.join(TOOLS_PATH, 'rac... | {
"content_hash": "750ba27e5258b7162032720d251299bc",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 104,
"avg_line_length": 35.539603960396036,
"alnum_prop": 0.5915865719459534,
"repo_name": "kishoredbn/barrelfish",
"id": "f93b9c9bbd501f2c8b86edeb1d5c9be63d62d4b3",
"size... |
"""
tablelib.py
Parse, format, and manipulate tabular data.
--Example----------------------------------------------------
##types:string int
name num
mike 23
alex 12
matt 7
-------------------------------------------------------------
File is tab delimited.
Directives are on a single line and begin with two hashes... | {
"content_hash": "f6d0374ea355b332c379a29608889171",
"timestamp": "",
"source": "github",
"line_count": 1150,
"max_line_length": 89,
"avg_line_length": 27.74086956521739,
"alnum_prop": 0.5118174409127955,
"repo_name": "wutron/compbio",
"id": "b9aca5f81862f0a39205b2c16fed2c2253e311cb",
"size": "3190... |
"""Cryptographic protocols
Implements various cryptographic protocols. (Don't expect to find
network protocols here.)
Crypto.Protocol.KDF
A collection of standard key derivation functions.
Crypto.Protocol.SecretSharing
Distribute a secret amongst a group of participants.
"""
__all__ = ['KDF', 'SecretSharing']
| {
"content_hash": "f755c29fce9ce615177862a98b25c3eb",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 66,
"avg_line_length": 24.46153846153846,
"alnum_prop": 0.7767295597484277,
"repo_name": "marcuskelly/recover",
"id": "6a538ce31fc83ff427f84c9f9f230c729b2cfe04",
"size": "1... |
import random
print(random.randint(0,99))
| {
"content_hash": "6b565773b4923b109d7c762c8ffe953d",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 27,
"avg_line_length": 14.333333333333334,
"alnum_prop": 0.7674418604651163,
"repo_name": "WebClub-NITK/Hacktoberfest-2k17",
"id": "2af8a1b6074a1cfd3a560d92a3197b2656a1488c",
... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/lair/falumpaset/shared_lair_falumpaset_forest.iff"
result.attribute_template_id = -1
result.stfName("lair_n","falumpaset_forest")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return resul... | {
"content_hash": "cf8d8efad0d33edbd7818b76c1854a20",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 86,
"avg_line_length": 24.692307692307693,
"alnum_prop": 0.7071651090342679,
"repo_name": "obi-two/Rebelion",
"id": "0a2ce3018e9d234032163e00458ec84756f15218",
"size": "466... |
'''
Based on
Representing a chess set in Python
Part 2
Brendan Scott
https://python4kids.brendanscott.com/2013/04/28/a-different-view-on-our-chess-model/
'''
import Tkinter as tk
from Tkinter import PhotoImage
import os.path
import os
# column_reference = "1 2 3 4 5 6 7 8".split(" ")
column_reference = "a b c d e f... | {
"content_hash": "05a2ca464874cb9deecdc8ac81d72ab8",
"timestamp": "",
"source": "github",
"line_count": 368,
"max_line_length": 105,
"avg_line_length": 39.42934782608695,
"alnum_prop": 0.5809097174362509,
"repo_name": "xR86/ml-stuff",
"id": "df4ef9e2a50596a036499e2b8cfe901bd8c701a3",
"size": "14528... |
"""
Documint action factories.
Each public function produces a `dict` suitable for passing to the
`perform_action` session method.
"""
def _action(name, params):
"""
Convenience function for constructing an action `dict`.
"""
return {u'action': name,
u'parameters': params}
def render_ht... | {
"content_hash": "7ac0b3cbb61f9d1c8cf58f2797f1547d",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 79,
"avg_line_length": 30.636363636363637,
"alnum_prop": 0.622297583721916,
"repo_name": "fusionapp/txdocumint",
"id": "63770344f809e4772dd56f5beeb222b60c24bed8",
"size": ... |
import subprocess, os.path
from ..mesonlib import EnvironmentException
from .compilers import Compiler, swift_buildtype_args, clike_debug_args
swift_optimization_args = {'0': [],
'g': [],
'1': ['-O'],
'2': ['-O'],
... | {
"content_hash": "651d5a467850ce005d26655284c3807e",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 121,
"avg_line_length": 31.171717171717173,
"alnum_prop": 0.5832793259883344,
"repo_name": "MathieuDuponchelle/meson",
"id": "4d5dd0cfe2992251ee850d0b4c8f6e7f4eb9fa0a",
"si... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.