text stringlengths 4 1.02M | meta dict |
|---|---|
import numpy as np
import pytest
from ..algorithms.segment.trained_model import calculate_volume
@pytest.fixture
def centroids(scope='session'):
yield [
{'x': 0, 'y': 0, 'z': 0},
{'x': 32, 'y': 32, 'z': 28},
{'x': 45, 'y': 45, 'z': 12}]
@pytest.fixture
def centroids_alt(scope='session')... | {
"content_hash": "9816be662fa6fb24a5375af9d9e13db1",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 96,
"avg_line_length": 31.47826086956522,
"alnum_prop": 0.6567679558011049,
"repo_name": "vessemer/concept-to-clinic",
"id": "7f342d23bfe7481dfa564d929e04a4103f4c4ac9",
"si... |
"""
The ACLHound command-line client assists in ACL management.
Usage: aclhound [-d] [-j] [--version] [--help] <command> [<args>...]
Options:
-h --help Show this screen
-d --debug Enable debugging output
-j --jenkins Use jenkins environmental variables like WORKSPACE
--version Show... | {
"content_hash": "1bb99a2049845c74f0d667a74a177792",
"timestamp": "",
"source": "github",
"line_count": 454,
"max_line_length": 96,
"avg_line_length": 36.559471365638764,
"alnum_prop": 0.5390408482949753,
"repo_name": "job/aclhound",
"id": "4465963b9d0366c4a8ebfeb573c541635a37985a",
"size": "17983"... |
import argparse
import md5
import os
import pymongo
import re
import requests
import sys
import unicodedata
import urllib
MimeExtensions = {
'image/gif': '.gif',
'image/jpeg': '.jpg',
'image/png': '.png',
}
UsedMD5Sums = {}
def safe_path(value, noperiods=False):
"""
Make sure a string is a safe ... | {
"content_hash": "ee8d97297ae8da1d133b20e19fdb2477",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 79,
"avg_line_length": 36.94078947368421,
"alnum_prop": 0.6105075690115761,
"repo_name": "XDATA-Year-3/EntityAlignLarge",
"id": "8f71cdb240a16fe13b41bf41db48a237be53809b",
... |
from __future__ import with_statement
import errno
import mimetypes
import os
import re
import rfc822
import StringIO
import base64
import binascii
import math
import urllib
import boto.utils
from boto.exception import BotoClientError
from boto.exception import StorageDataError
from boto.exception import PleaseRetryExc... | {
"content_hash": "8b5f0ecef165860ee67d140a3d505531",
"timestamp": "",
"source": "github",
"line_count": 1786,
"max_line_length": 89,
"avg_line_length": 42.23908174692049,
"alnum_prop": 0.5755245960312305,
"repo_name": "donny/mako-mori",
"id": "d16352fd95856dfd675ce670cfbbcd1791af6053",
"size": "766... |
import logging
import random
import string
import sys
import unittest
from time import time, sleep
import apiritif
import os
import re
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException, TimeoutException
from selenium.webdriver.common.by import By
from selenium.webdriver.comm... | {
"content_hash": "87cb14cab6f85fe388b28ba81b91145a",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 163,
"avg_line_length": 42.289655172413795,
"alnum_prop": 0.5459882583170255,
"repo_name": "Blazemeter/taurus",
"id": "3a1027f513a5d22dd1254f416ce33bab7db8350a",
"size": "... |
"""
kombu.entity
================
Exchange and Queue declarations.
"""
from __future__ import absolute_import
import numbers
from .abstract import MaybeChannelBound
from .exceptions import ContentDisallowed
from .five import string_t
from .serialization import prepare_accept_content
TRANSIENT_DELIVERY_MODE = 1
PER... | {
"content_hash": "c913933c61bdb2040e745a324b104ce3",
"timestamp": "",
"source": "github",
"line_count": 749,
"max_line_length": 79,
"avg_line_length": 36.257676902536716,
"alnum_prop": 0.5676252899804839,
"repo_name": "tkanemoto/kombu",
"id": "a482e90aa01e2c0d25ac77e23ce93634a7e1697d",
"size": "271... |
from sqlalchemy import and_, or_
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.declarative import declared_attr
from ggrc import db
from ggrc.models.person import Person
from ggrc.models.mixins import Mapping
from ggrc.models.reflection import PublishOnly
class ObjectOwner(Mapping... | {
"content_hash": "e79f97f497dd7c0613e8499363ad2377",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 79,
"avg_line_length": 27.49056603773585,
"alnum_prop": 0.6458476321207962,
"repo_name": "NejcZupec/ggrc-core",
"id": "9ddc01d62e37f98aba470c39ff90778c86e88752",
"size": "... |
"""nova HACKING file compliance testing
built on top of pep8.py
"""
import fnmatch
import inspect
import logging
import os
import re
import subprocess
import sys
import tokenize
import warnings
import pep8
# Don't need this for testing
logging.disable('LOG')
#N1xx comments
#N2xx except
#N3xx imports
#N4xx docstrin... | {
"content_hash": "660453b0edb381307769adf51da110d1",
"timestamp": "",
"source": "github",
"line_count": 466,
"max_line_length": 79,
"avg_line_length": 33.802575107296136,
"alnum_prop": 0.5670391061452514,
"repo_name": "tylertian/Openstack",
"id": "096cf778621e0e4ba6ea70bac9043a944cf96691",
"size": ... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('newsletters', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='StoreEmailsClass',
fields=[
('... | {
"content_hash": "72d0bbd69871cc502d339740b53b1447",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 114,
"avg_line_length": 26.217391304347824,
"alnum_prop": 0.572139303482587,
"repo_name": "Juanvulcano/gci15_email",
"id": "e22bbce64508fe5565071dd949ee291ff40146e6",
"size... |
"""Special-case field selection functions.
All functions should take
the current astropy.time.Time
an ObsLogger instance
a dictionary of other observing programs field_ids and field_selection_functions
a Fields object (for efficiency)
and return a list of field_ids.
Note that any cadence cuts should... | {
"content_hash": "32e7280aa68667e97ed004a4edf5c7ba",
"timestamp": "",
"source": "github",
"line_count": 443,
"max_line_length": 272,
"avg_line_length": 47.89164785553047,
"alnum_prop": 0.6268853695324283,
"repo_name": "ZwickyTransientFacility/ztf_sim",
"id": "aa09e1cd0e221003d3e5278e5de7c1824c7cf2f9"... |
from flask import Flask, render_template
app = Flask(__name__)
app.config['TEMPLATES_AUTO_RELOAD'] = True
@app.route("/")
def index():
return render_template("index.html")
if __name__ == "__main__":
app.run() | {
"content_hash": "a11095ed31b43b1bca93678dd23d9be5",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 42,
"avg_line_length": 17,
"alnum_prop": 0.6289592760180995,
"repo_name": "xiao-ming-team/xiao-ming",
"id": "cb8515e97a54e7bacc3d4f3908ae027a4df8cd49",
"size": "221",
"bi... |
"""
Tests for geography support in PostGIS
"""
import os
from django.contrib.gis.db import models
from django.contrib.gis.db.models.functions import Area, Distance
from django.contrib.gis.measure import D
from django.db import NotSupportedError, connection
from django.db.models.functions import Cast
from django.test i... | {
"content_hash": "b96e9abc85beb5abd98ebf8123eea339",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 111,
"avg_line_length": 44.70322580645161,
"alnum_prop": 0.6345793043729254,
"repo_name": "elena/django",
"id": "53852517e86424da0b0620de3382ecf670c28d0f",
"size": "6929",... |
import tweepy
import pandas as pd
import matplotlib.pyplot as plt
import csv
import time
pd.options.display.max_columns = 50
pd.options.display.max_rows= 50
pd.options.display.width= 120
auth = tweepy.auth.OAuthHandler('mEnkTsYmvFGgzjV73SPOz084K', 'YnQxTyFhTCG5KSGBeRq1qeVwUkxOhZ99amm6uauy8ett51UE3t')
auth.set_access... | {
"content_hash": "9606edeb1f9a9c5cdcc45c057369a4a4",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 193,
"avg_line_length": 36.86666666666667,
"alnum_prop": 0.6003616636528029,
"repo_name": "Searil/big_data_politics",
"id": "455f05720a2a775c9ed18ad409291ef1e1a57ade",
"siz... |
import logging
from osp_classifier.classifiers import SyllabusClassifier
from pyspark import SparkContext
from pyspark.sql import types as T
from pyspark.sql.functions import array, col, lit, struct, udf, when
from osp_pipeline import PICKLE_PATH
from osp_pipeline.classifier.models import DocumentSyllabus
from osp_pi... | {
"content_hash": "88dc9e533ee11ce7af5272701884c604",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 76,
"avg_line_length": 31.584745762711865,
"alnum_prop": 0.6570968607459082,
"repo_name": "opensyllabus/osp-pipeline",
"id": "926681a8f372d27d3a63a3efb4c47567d5f112c2",
"s... |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Prospectus.stars'
db.add_column(u'campaign_prospectus', 'stars',
... | {
"content_hash": "cba8117731774b621ba7a82986ad8b94",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 195,
"avg_line_length": 68.1590909090909,
"alnum_prop": 0.5541847282427476,
"repo_name": "tdphillips/campaigns",
"id": "66e2dab0ae14864486fc734bff31ea3d643926f5",
"size": "... |
import sys, os
# If your extensions are in another directory, add it here.
#sys.path.append('some/directory')
# General configuration
# ---------------------
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ... | {
"content_hash": "8567d0bc6bbd68e4611dd6358ea3b979",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 85,
"avg_line_length": 29.80952380952381,
"alnum_prop": 0.7039403620873269,
"repo_name": "Delwddrylliwr/pebl-project",
"id": "d6bf8f13dfb101804a10d32955dbc53e8ee20a3c",
"s... |
import bpy, sys, os, re, struct, traceback
ARGS_PATTERN = re.compile(r'''(?:"([^"]+)"|'([^']+)'|(\S+))''')
# Background mode seems to require quit() in some 2.80 builds
def _quitblender():
bpy.ops.wm.quit_blender()
quit()
MIN_BLENDER_MAJOR = 2
MIN_BLENDER_MINOR = 83
# Extract pipe file descriptors from argum... | {
"content_hash": "88b0ad577213348d7fba0ff9b1148107",
"timestamp": "",
"source": "github",
"line_count": 590,
"max_line_length": 121,
"avg_line_length": 34.391525423728815,
"alnum_prop": 0.533241338524469,
"repo_name": "AxioDL/PathShagged",
"id": "7af8a934fe8816d85b9a6bae83bd1d4619da1aa6",
"size": "... |
"""
Contains tests class for convert.py
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#--------... | {
"content_hash": "6268a6f0685aa68d32d6219eeb89257a",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 84,
"avg_line_length": 34.88405797101449,
"alnum_prop": 0.5143331948483589,
"repo_name": "Lightmatter/django-inlineformfield",
"id": "9eb45ad2a8c5e4a52e8577f6535aef1aeba8faf5... |
class Base:
def __init__(self):
print "object of type Base initialized."
return
def baseMethod(self):
print "baseMethod invoked."
return
class Delegate:
def __init__(self, base):
print "object of type Delegate initialized."
# save a reference to 'base'
... | {
"content_hash": "20ea46ddeaa552178df269161d6438f9",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 73,
"avg_line_length": 24.893617021276597,
"alnum_prop": 0.5914529914529915,
"repo_name": "egustafson/sandbox",
"id": "a7919388e0c0d43cb6dcda317f24dcacceaa635d",
"size": "2... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
name: aws_ec2
plugin_type: inventory
short_description: EC2 inventory source
requirements:
- boto3
- botocore
extends_documentation_fragment:
- inventory_cache
... | {
"content_hash": "d2f0caa358a479430c43134f2ae9b192",
"timestamp": "",
"source": "github",
"line_count": 656,
"max_line_length": 155,
"avg_line_length": 45.86280487804878,
"alnum_prop": 0.6279664960446719,
"repo_name": "thaim/ansible",
"id": "5f757956162d05da00f7b54e4130357b8933dbc3",
"size": "30217... |
"""Utility to display flash messages.
To add a flash message:
flash('Login successful!', category='info')
To display flash messages in a template:
$ for flash in get_flashed_messages():
<div class="$flash.type">$flash.message</div>
Note: This should be added with web.py or become an independent mod... | {
"content_hash": "f27aa7ed704a79ff135aa08d04729591",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 71,
"avg_line_length": 28.173076923076923,
"alnum_prop": 0.6266211604095563,
"repo_name": "anandology/broadgauge",
"id": "beb708a07763af9888af7642130de4f490b3246e",
"size":... |
import ast
import datetime
import jinja2
class Option:
"""An option to be used in a report
Attributes:
type (str): the type of the option of the form 'gnc:make-number-range-option'
section (str): the section/tab where the option should appear in the option dialog
sort_tag (str): a st... | {
"content_hash": "2c209fb6c572ddcdec36099a34ec2dc8",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 114,
"avg_line_length": 33.93684210526316,
"alnum_prop": 0.5955334987593052,
"repo_name": "sdementen/gnucash-utilities",
"id": "a58afb842fd9a0e9fd0e36cd289e40ee4cec2e75",
"... |
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.getcwd(), "..")))
from common.FileHelper import writeFile
from datetime import datetime
import shutil
import json
def loadStockList(fileName):
dictData = {}
for line in open(fileName):
line = line.strip().zfill(6)
if line... | {
"content_hash": "05a7531d2cbbb6f888697afb02e49fa0",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 110,
"avg_line_length": 25.61111111111111,
"alnum_prop": 0.6518438177874186,
"repo_name": "zwffff2015/stock",
"id": "d0256a094f1e21577e8aae64271aacd99eea6098",
"size": "938... |
"""Test for exporters.
Note that we actually train and export models within these tests.
"""
import os
import numpy as np
import tensorflow as tf
from tensorflow_model_analysis.eval_saved_model import exporter
from tensorflow_model_analysis.eval_saved_model import load
from tensorflow_model_analysis.eval_saved_model ... | {
"content_hash": "f6e30914b036ab414483f088ef4393bc",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 98,
"avg_line_length": 38.76875,
"alnum_prop": 0.6967596324359181,
"repo_name": "tensorflow/model-analysis",
"id": "cf0dd46955de98d600fa18387bd3511eec16f466",
"size": "677... |
"""
Kolibri Webpack hooks
---------------------
To manage assets, we use the webpack format. In order to have assets bundled in,
you should put them in ``yourapp/assets/src``.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import codecs
import ... | {
"content_hash": "0d8a1e2c8dfa2809fd2d6beb0eb00b28",
"timestamp": "",
"source": "github",
"line_count": 449,
"max_line_length": 109,
"avg_line_length": 36.478841870824056,
"alnum_prop": 0.5685328774650467,
"repo_name": "indirectlylit/kolibri",
"id": "5eb34a64057c9293bd61fd91345e03a6bd371348",
"size... |
import os
import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
from data_dir import DATA_DIR
# Where the output boxplots will go:
AUTHORS_PDF = 'authors-box.pdf'
CREATORS_PDF = 'creators-box.pdf'
DATA_FILE = os.path.join(DATA_DIR,'authors.txt')
SEP = '&'
#############################... | {
"content_hash": "0ba514dcc680170fb458a49a6f974a4b",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 101,
"avg_line_length": 35.35443037974684,
"alnum_prop": 0.5760830648048694,
"repo_name": "MalloyPower/python-compliance",
"id": "5c10d4337e6eb36bd5f3e146587fa31d2ef8e826",
... |
a = input("insert first number ")
b = input("insert second number")
if set(a) == set(b):
print (a, " and " , b , " have the P property!")
else:
print (a, " and " , b , " does NOT have the P property!")
| {
"content_hash": "ae0f78a18a37d09af3f78101460abef5",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 58,
"avg_line_length": 25.75,
"alnum_prop": 0.5825242718446602,
"repo_name": "rusucosmin/courses",
"id": "5a0e3cb3c958d92857468b8984b8b8c47ae7eb56",
"size": "206",
"binary... |
'''
The MIT License (MIT)
Copyright (c) <2014> <Mathias Lesche>
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, ... | {
"content_hash": "df24fedeb12f5f418f3ff70fe0bb48fd",
"timestamp": "",
"source": "github",
"line_count": 244,
"max_line_length": 174,
"avg_line_length": 35.16803278688525,
"alnum_prop": 0.6548187856893136,
"repo_name": "mlesche/deep_seq_pipeline",
"id": "2828564b92f78559096608a1ead53c3677516283",
"s... |
""" Classification using the WEKA experimenter
A WEKA classification process consists of executing a certain
WEKA experiment. The results of all these processes are stored in a temporary
directory and after the completion of all processes of the operation,
the consolidate method of the *WekaClassificationOperation* i... | {
"content_hash": "8d19c760f5f1699a9654eebfdc61cb79",
"timestamp": "",
"source": "github",
"line_count": 262,
"max_line_length": 87,
"avg_line_length": 47.17175572519084,
"alnum_prop": 0.5815195404158913,
"repo_name": "pyspace/pyspace",
"id": "6176bd8116389eb8882009b3a84d602ec381de40",
"size": "1235... |
print "I'm a python"
| {
"content_hash": "d9a1e41a9032ec0d09d77c830eafd3d9",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 20,
"avg_line_length": 21,
"alnum_prop": 0.6666666666666666,
"repo_name": "rcaught/todos_export",
"id": "8ae20230dfa90c469fb758a8c4e3e87a4bf3877e",
"size": "41",
"binary":... |
from subprocess import run, PIPE
from west import log
# Given a path to the applicable C compiler, a C source file, and the
# corresponding TargetCompileGroup, determine which include files would
# be used.
# Arguments:
# 1) path to applicable C compiler
# 2) C source file being analyzed
# 3) TargetCompileGroup... | {
"content_hash": "aa8bf5421ac97eba0cc9b5a0780a2247",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 87,
"avg_line_length": 36.868852459016395,
"alnum_prop": 0.666073810582481,
"repo_name": "finikorg/zephyr",
"id": "c1060e661786d201831235944aee96438aa4ece8",
"size": "2332"... |
import json
import logging
import os
import time
from autobahn.twisted import websocket
from universe.twisty import reactor
from twisted.internet import endpoints
logger = logging.getLogger(__name__)
class RewardServerClient(websocket.WebSocketClientProtocol, object):
def __init__(self):
super(RewardServ... | {
"content_hash": "34bd68d8331bff21bde853c92950208d",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 173,
"avg_line_length": 40.26600985221675,
"alnum_prop": 0.6181795938341081,
"repo_name": "openai/universe",
"id": "472c702ffda91a62d2363af22f5ebc6a4880c8a4",
"size": "817... |
'''
Monitor the Windows Event Log
'''
# stdlib
import calendar
from datetime import datetime, timedelta
# project
from checks.wmi_check import WinWMICheck, to_time, from_time
from utils.containers import hash_mutable
from utils.timeout import TimeoutException
SOURCE_TYPE_NAME = 'event viewer'
EVENT_TYPE = 'win32_log_... | {
"content_hash": "91784b26afac1caa9b6d0fd24847b5ba",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 98,
"avg_line_length": 35.265765765765764,
"alnum_prop": 0.540937539915698,
"repo_name": "mderomph-coolblue/dd-agent",
"id": "3264bcd5beaa6323bf972b1e57547a53e70d13c2",
"s... |
"""Detection Engine used for detection tasks."""
from collections import Counter
from collections import defaultdict
from edgetpu.basic.basic_engine import BasicEngine
import numpy as np
from PIL import Image
class EmbeddingEngine(BasicEngine):
"""Engine used to obtain embeddings from headless mobilenets."""
def... | {
"content_hash": "7acbe909cce7bf304cb7d2a252c693a7",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 78,
"avg_line_length": 34.56153846153846,
"alnum_prop": 0.6708212775428444,
"repo_name": "google-coral/project-teachable",
"id": "03951e9ca94bf9318f1504d8a46622720d9accff",
... |
from __future__ import unicode_literals
from django.test import TestCase
from django.contrib.auth import get_user_model
from django.contrib.auth import authenticate
from tiny_rest.models import Token
User = get_user_model()
class TestToken(TestCase):
def test_create_model(self):
user = User.objects.cr... | {
"content_hash": "a15c35434812902905188cc3374dc197",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 75,
"avg_line_length": 31.105263157894736,
"alnum_prop": 0.7258883248730964,
"repo_name": "allisson/django-tiny-rest",
"id": "6652633d468091ae45253432e96404a8095786ae",
"si... |
try:
import unittest2 as unittest
except ImportError:
import unittest # noqa
import mock
from cassandra import timestamps
import time
from threading import Thread, Lock
class _TimestampTestMixin(object):
@mock.patch('cassandra.timestamps.time')
def _call_and_check_results(self,
... | {
"content_hash": "c52a24f2d84a96aac29424fe23b61669",
"timestamp": "",
"source": "github",
"line_count": 264,
"max_line_length": 99,
"avg_line_length": 32.86363636363637,
"alnum_prop": 0.6038497003227293,
"repo_name": "coldeasy/python-driver",
"id": "50c0ba92ecb4d246fa218ed99b6433fd8a7631a6",
"size"... |
"""
AmazonScrape
Usage: amazon_scrape.py [--number=<count>] [--output=output.xlsx]
Select and scrape a given number of Amazon book listings.
"""
from docopt import docopt
from api_key import *
import requests
from bs4 import BeautifulSoup
import json
import time
import bottlenose
from openpyxl import Workbook
... | {
"content_hash": "39dbdde1191ff1bf4bce381bc0e3a0c0",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 223,
"avg_line_length": 31.333333333333332,
"alnum_prop": 0.6178191489361702,
"repo_name": "markperdomo/amazon_scrape",
"id": "33a6152e69e53f593b70eca1faa4a6b6352b40dd",
"... |
import collections
import sys
import mock
from six import moves
from cinderclient import exceptions
from cinderclient import utils
from cinderclient import base
from cinderclient.tests.unit import utils as test_utils
UUID = '8e8ec658-c7b0-4243-bdf8-6f7f2952c0d0'
class FakeResource(object):
NAME_ATTR = 'name'
... | {
"content_hash": "7369af7b00e8e0a6737ca85dfb326e47",
"timestamp": "",
"source": "github",
"line_count": 227,
"max_line_length": 76,
"avg_line_length": 27.47136563876652,
"alnum_prop": 0.5423348300192431,
"repo_name": "scottdangelo/cinderclient-api-microversions",
"id": "2d2ebd1498b8129412c6f442205c81... |
"""Script to parse Protein files
"""
import sys
from metadata_updates import update_metadata_data_list
def parse_file(project_id, bq_dataset, bucket_name, file_data, filename, outfilename, metadata, cloudsql_tables, config, logger):
logger.log_text('uduprocessor: Begin low-level processing {0}'.format(filename)... | {
"content_hash": "4ea4b4ea6f7a1cb95f11a51056fd238b",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 129,
"avg_line_length": 35.4,
"alnum_prop": 0.6567796610169492,
"repo_name": "isb-cgc/User-Data-Processor",
"id": "fb5fb58bf588f36f49696f9de08e5cc2b026d40f",
"size": "2034"... |
from __future__ import unicode_literals
from .responses import SecretsManagerResponse
url_bases = ["https?://secretsmanager.(.+).amazonaws.com"]
url_paths = {"{0}/$": SecretsManagerResponse.dispatch}
| {
"content_hash": "ec442ceb47a7c59146c0546c4dfd0b6a",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 58,
"avg_line_length": 33.666666666666664,
"alnum_prop": 0.7425742574257426,
"repo_name": "william-richard/moto",
"id": "57cbac0e401400289fbfcf56cb4302ff84cdaf50",
"size": "... |
from wptserve.utils import isomorphic_encode
def get_response(raw_headers, filter_value, filter_name):
result = b""
# raw_headers.raw_items() returns the (name, value) header pairs as
# tuples of strings. Convert them to bytes before comparing.
# TODO: Get access to the raw headers, so that whitespace ... | {
"content_hash": "aa53843f9bd86762b5f0b6c8864823de",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 100,
"avg_line_length": 44.416666666666664,
"alnum_prop": 0.6397748592870544,
"repo_name": "nwjs/chromium.src",
"id": "123d637134dc624f0e9f0b3ddfe35d07e62920a3",
"size": "1... |
import time
from typing import TYPE_CHECKING, List, Optional, Union, Dict, Any
from decimal import Decimal
import attr
from .json_db import StoredObject
from .i18n import _
from .util import age, InvoiceError
from .lnaddr import lndecode, LnAddr
from . import constants
from .bitcoin import COIN, TOTAL_COIN_SUPPLY_LIM... | {
"content_hash": "6fb1a2e24e1a833707290bae64a93285",
"timestamp": "",
"source": "github",
"line_count": 280,
"max_line_length": 132,
"avg_line_length": 34.73571428571429,
"alnum_prop": 0.6009664815957229,
"repo_name": "pooler/electrum-ltc",
"id": "04d908cb1ee331ea00c2ce237ecd82e5a865af25",
"size": ... |
DATABASE = 'postgresql://postgres:postgres@localhost/bible'
| {
"content_hash": "f5516cb7b44bbefb15ae013b62271940",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 59,
"avg_line_length": 60,
"alnum_prop": 0.8,
"repo_name": "tulustul/BibleReader",
"id": "73cdb6260932e8fc6aa2af0b0af4e105186130dc",
"size": "60",
"binary": false,
"copi... |
import random
def xor_encode(data, seed_key=None):
"""
Encode data using the XOR algorithm. This is not suitable for encryption
purposes and should only be used for light obfuscation. The key is
prepended to the data as the first byte which is required to be decoded
py the :py:func:`.xor_decode` function.
:para... | {
"content_hash": "a49a2aec8d7c2f6014e73fa2d2680abe",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 73,
"avg_line_length": 29.186046511627907,
"alnum_prop": 0.6972111553784861,
"repo_name": "xujun10110/king-phisher",
"id": "4e64ca2d62d01fb8eba66941f8e8a4a1d817c27e",
"size... |
import mock
from heat.common import exception
from heat.engine import properties
from heat.engine import resource
from heat.engine.resources.openstack.keystone import role_assignments
from heat.engine import stack
from heat.engine import template
from heat.tests import common
from heat.tests import utils
RESOURCE_TYP... | {
"content_hash": "930bf1253504adbfb0b171b6f5326acf",
"timestamp": "",
"source": "github",
"line_count": 377,
"max_line_length": 78,
"avg_line_length": 31.368700265251988,
"alnum_prop": 0.49661762218839844,
"repo_name": "rh-s/heat",
"id": "f78236f5d8802b6d82b52278391d4e8b32f44e7a",
"size": "12401",
... |
import six
from six.moves import urllib
from keystone.tests import unit
from keystone.token import provider
class TestRandomStrings(unit.BaseTestCase):
def test_strings_are_url_safe(self):
s = provider.random_urlsafe_str()
self.assertEqual(s, urllib.parse.quote_plus(s))
def test_strings_can_... | {
"content_hash": "25636fe6fef921272a8555966663d0e5",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 56,
"avg_line_length": 30.38888888888889,
"alnum_prop": 0.7038391224862889,
"repo_name": "takeshineshiro/keystone",
"id": "be831484dedc63eae50e233ddb777cdbd9a06d19",
"size"... |
import json
from unittest import TestCase
from nose.tools import assert_equal, assert_raises
from couchforms.geopoint import GeoPoint
from corehq.apps.es.es_query import HQESQuery
from corehq.apps.es.queries import geo_distance, match
class TestQueries(TestCase):
def assertHasQuery(self, es_query, desired_que... | {
"content_hash": "0e7a7585b011b21abf9ad58cc36bbe88",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 77,
"avg_line_length": 32.01136363636363,
"alnum_prop": 0.5470358537451189,
"repo_name": "dimagi/commcare-hq",
"id": "bbede1b5786ccdc3c049812f002d350a908f2d48",
"size": "28... |
import media
import fresh_tomatoes
"""Movie definition
media.Movie contains Title, Story Line, Poster Image,Trailer in Youtube
From Movie class: (movie_title, movie_storyline,
poster_image,trailer_youtube)"""
godfather = media.Movie('The Godfather',
'American mafia is born',
... | {
"content_hash": "da6c57549067b1fb83d9a1c999fff418",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 75,
"avg_line_length": 37.84848484848485,
"alnum_prop": 0.5708566853482786,
"repo_name": "spicyramen/movie",
"id": "9979758a50cb750fe092dfb7f8a30e64f42ee475",
"size": "1249... |
from __future__ import with_statement
import os
import sys
import shutil
import unittest
import tempfile
import mock
from libcloud.common.types import LibcloudError
from libcloud.storage.base import Container
from libcloud.storage.types import ContainerDoesNotExistError
from libcloud.storage.types imp... | {
"content_hash": "43ff4e4794b643de53501615e11a7e1a",
"timestamp": "",
"source": "github",
"line_count": 320,
"max_line_length": 79,
"avg_line_length": 34.896875,
"alnum_prop": 0.5895047909017641,
"repo_name": "Hybrid-Cloud/badam",
"id": "6e534dfb11cbf6787b20a2084b76aae0591a328c",
"size": "11962",
... |
import base64
import logging
from typing import Dict, List, Optional, Union
from django.conf import settings
from django.contrib.auth import get_user_model, logout
from django.contrib.auth.mixins import LoginRequiredMixin
from django.core.exceptions import (ImproperlyConfigured, ObjectDoesNotExist,
... | {
"content_hash": "c5ff7e2e6ac3a01ceb859021d4458efc",
"timestamp": "",
"source": "github",
"line_count": 431,
"max_line_length": 160,
"avg_line_length": 43.77262180974478,
"alnum_prop": 0.6556238736351108,
"repo_name": "OTA-Insight/djangosaml2idp",
"id": "401ca764c26f05d942d61b12ab7ae1b655075f8f",
"... |
import markdown
from markdown.blockprocessors import BlockProcessor
import re
from markdown import util
class AlignProcessor(BlockProcessor):
""" Process Align. """
def __init__(self, parser):
BlockProcessor.__init__(self, parser)
exprs = (("->", "right"), ("<-", "center"))
self.RES... | {
"content_hash": "0aa561085b64ea04d6d22a33ed1255a4",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 119,
"avg_line_length": 38.1965811965812,
"alnum_prop": 0.5701499216827031,
"repo_name": "Situphen/Python-ZMarkdown",
"id": "3dd930a6358960ea87573be6b1ce528115821b6b",
"si... |
import os
from recaptcha_config import *
# NOTICE: Remove this on production
DEBUG = True
# change base directory to get templates correctly
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
UPLOADS_PATH = os.path.join(BASE_DIR, "uploads")
# General flask stuff
SECRET_KEY = "blahblahblah"
# CSRF_SESSION_KEY... | {
"content_hash": "189241804f21088e9e628e3e130092cd",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 82,
"avg_line_length": 20.821428571428573,
"alnum_prop": 0.7101200686106347,
"repo_name": "undeadpixel/overlapy_web",
"id": "1cb9dc023358dfe52c88e2d784614b78888b7be1",
"siz... |
from AbstractManager import AbstractManager
class ActionManager(AbstractManager):
def __init__(self):
self._itemList = [] #a list of all items
def addItem(self, newItem): #adds an item to the item list
for existingItem in self._itemList: ... | {
"content_hash": "c03955073d11c7d0340f782006663341",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 95,
"avg_line_length": 52.206896551724135,
"alnum_prop": 0.4953764861294584,
"repo_name": "paulydboy/Quad-Vision",
"id": "a21924d59c85c009ce176f4a9dc767dbcb7a1991",
"size":... |
import sys, time
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
def scan(yourIP, targetIP, startPort, endPort):
# construct layers 3 and 4
lyrThree=IP()
lyrFour=TCP()
lyrThree.src = yourIP
lyrThree.dst = targetIP
if endPort == 0:
endPort = startPor... | {
"content_hash": "4ca84c440ac78a55708f6cd156de6155",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 131,
"avg_line_length": 25.939393939393938,
"alnum_prop": 0.6477803738317757,
"repo_name": "bartcone/syn-stealth-portscanner",
"id": "d76807fc10d09a61ed12de0dc11a1d81f6d521e3... |
import time
import datetime
import os
from docplex.mp.model import Model
from ticdat import TicDatFactory, Progress, LogFile, Slicer, standard_main
# ------------------------ define the input schema --------------------------------
# There are three input tables, with 4 primary key fields and 4 data fields.
dataFacto... | {
"content_hash": "6ae2dee12ceba16f5d186725c54f725b",
"timestamp": "",
"source": "github",
"line_count": 208,
"max_line_length": 108,
"avg_line_length": 44.35096153846154,
"alnum_prop": 0.5482926829268293,
"repo_name": "opalytics/opalytics-ticdat",
"id": "9d44d4a1d50f614855a0b2c39ec3233bf232c01b",
"... |
from qiita_client import QiitaCommand
from .trim import trim
__all__ = ['trim']
# Define the trim command
req_params = {'input': ('artifact', ['per_sample_FASTQ'])}
opt_params = {
# 3' adapter
'Fwd read adapter': ['string', 'GATCGGAAGAGCACACGTCTGAACTCCAGTCAC'],
# 3' adapter for rev
'Rev read adapter'... | {
"content_hash": "bdb0e2e29921b31d38fd27e13c44795a",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 73,
"avg_line_length": 37.58695652173913,
"alnum_prop": 0.6396761133603239,
"repo_name": "antgonza/qp-shotgun",
"id": "cf640d1a189028a4cc9052ed4294d2c967027426",
"size": "2... |
'''
ghmiles unit tests
:copyright: Copyright 2011 Barthelemy Dagenais
:license: BSD, see LICENSE for details
'''
import unittest
import ghmiles
class TestMilestonesModel(unittest.TestCase):
def test_key_label(self):
self.assertEqual(ghmiles.label_key('1.0'),'00001.00000')
self.assertEqual(... | {
"content_hash": "beeec6f4e02958b0ecaefdb47e188b6a",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 92,
"avg_line_length": 37.61904761904762,
"alnum_prop": 0.6206751054852321,
"repo_name": "bartdag/ghmiles",
"id": "5806b3fd86e33af53e945c30d1704f241647c470",
"size": "2370"... |
from oauth import OAuth
class Fitbit(OAuth):
def __init__(self, consumer_key, consumer_secret):
self.request_token_url = "http://api.fitbit.com/oauth/request_token"
self.authorize_url = "http://www.fitbit.com/oauth/authorize"
self.access_token_url = "http://api.fitbit.com/oauth/access_token"
self.consumer_k... | {
"content_hash": "9de84d28f79fdf5066071fb4d4a902da",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 70,
"avg_line_length": 34.45454545454545,
"alnum_prop": 0.7335092348284961,
"repo_name": "joushx/OAuth.py",
"id": "b9e4bbff867bebc652681e65d1486ef86e4426a0",
"size": "379",... |
from decimal import Decimal
import logging
from django.core.management.base import LabelCommand
from corehq.apps.accounting.models import Currency
from corehq.apps.sms.models import INCOMING, OUTGOING
from corehq.apps.sms.test_backend import TestSMSBackend
from corehq.apps.smsbillables.models import SmsGatewayFee, Sm... | {
"content_hash": "5de8ad7af2fe71cfc44ac0912d50a91c",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 112,
"avg_line_length": 30.595744680851062,
"alnum_prop": 0.7107093184979137,
"repo_name": "puttarajubr/commcare-hq",
"id": "6186968becdfbeba283324f2497bc3a6dc524ebc",
"siz... |
from __future__ import unicode_literals
from django.contrib.contenttypes.management import update_all_contenttypes
from django.contrib.contenttypes.models import ContentType
from django.db import models, migrations
def migrate_therapy(apps, schema_editor):
update_all_contenttypes(interactive=False)
ct = Con... | {
"content_hash": "267e63bd12b0c3697723c0426a0f1f28",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 149,
"avg_line_length": 38.31818181818182,
"alnum_prop": 0.6079478054567022,
"repo_name": "fragaria/BorIS",
"id": "566209441a573594893d7d9e2e02a2323db74f93",
"size": "3396"... |
"""Interface to GNU Privacy Guard (GnuPG)
!!! This was renamed to gpginterface.py.
Please refer to duplicity's README for the reason. !!!
gpginterface is a Python module to interface with GnuPG which based on
GnuPGInterface by Frank J. Tobin.
It concentrates on interacting with GnuPG via filehandles,
providing a... | {
"content_hash": "3b4d9c6df624b22eec0c682dab4256c8",
"timestamp": "",
"source": "github",
"line_count": 689,
"max_line_length": 95,
"avg_line_length": 33.61828737300436,
"alnum_prop": 0.6080386823813841,
"repo_name": "yasoob/PythonRSSReader",
"id": "351ccd5115aa8e306ee6fd4d38bac1f3308c36ee",
"size"... |
from __future__ import unicode_literals
import frappe, unittest
from frappe.model.db_query import DatabaseQuery
from frappe.desk.reportview import get_filters_cond
class TestReportview(unittest.TestCase):
def test_basic(self):
self.assertTrue({"name":"DocType"} in DatabaseQuery("DocType").execute(limit_page_lengt... | {
"content_hash": "a58299d0d2fc492a21548d90cbf3f63f",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 97,
"avg_line_length": 36.68888888888889,
"alnum_prop": 0.6856450635978195,
"repo_name": "rmehta/frappe",
"id": "5451ce263b130b848ffe2d09e5e5d9ee81e78784",
"size": "3402",
... |
"""A server that runs FFmpeg on files in Google Cloud Storage.
"""
from concurrent import futures
import logging
import os
import signal
import subprocess
import sys
import tempfile
import threading
import time
from typing import Iterator
from typing import List
from google.protobuf.duration_pb2 import Duration
impor... | {
"content_hash": "f6d26ca2951333ec56a70333d6c1d258",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 102,
"avg_line_length": 37.42948717948718,
"alnum_prop": 0.5632813837985956,
"repo_name": "googleinterns/ffmpeg-on-cloud",
"id": "9de73247b1d3ad9e90d3cd658259c5d4016db1f7",
... |
import unittest
from provider.base import BaseProvider
from nose.tools import eq_, ok_
class TestBaseProvider(unittest.TestCase):
def test_base_init(self):
base = BaseProvider('client_id', 'client_secret', 'authorize_url', 'access_token_url', 'base_url', 'name', 'redirect_uri', state='test')
eq_(b... | {
"content_hash": "9d165b5ad4d21f3a569c5691e11d0fda",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 144,
"avg_line_length": 46.95652173913044,
"alnum_prop": 0.6314814814814815,
"repo_name": "marinewater/pyramid-social-auth",
"id": "cd3cd7d2051662bf52fbf257db9f007596f1fe7d",... |
import csv
import matplotlib.pyplot as plt
## local modules ##
import functions as fxn
### data structures ###
### called/local plotting parameters ###
ps = fxn.pseasons
sl = fxn.gp_seasonlabels
fs = 24
fssml = 16
fw = fxn.gp_fluweeks
wklab = fxn.gp_weeklabels
### functions ###
### data files ###
incidin = open(... | {
"content_hash": "0d1bc868510534034a9359deb5079ed5",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 176,
"avg_line_length": 38.72727272727273,
"alnum_prop": 0.7057902973395931,
"repo_name": "eclee25/flu-SDI-exploratory-age",
"id": "9d4c482de28fc2226779902ba93d20019100e5a9",... |
import os
import re
from unittest import mock
from xmlrpc import client as xmlrpc_client
from flexget.plugins.clients.rtorrent import RTorrent
torrent_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'private.torrent')
torrent_url = 'file:///%s' % torrent_file
torrent_info_hash = '09977FE761B8D293AD8A... | {
"content_hash": "b82ae2aff7830b89b557ba4ca42ba028",
"timestamp": "",
"source": "github",
"line_count": 391,
"max_line_length": 98,
"avg_line_length": 34.15601023017903,
"alnum_prop": 0.5508798202920254,
"repo_name": "crawln45/Flexget",
"id": "38b0dae6b6394d6d14e9213b8076f95d8d004abe",
"size": "133... |
import sys, os
from glob import glob
# Install setuptools if it isn't available:
try:
import setuptools
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from distutils.command.install import INSTALL_SCHEMES
from distutils.command.install_headers import install_headers
from setuptoo... | {
"content_hash": "fb8d781cf173a592d199790aa711c74e",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 107,
"avg_line_length": 32.48051948051948,
"alnum_prop": 0.6313474610155938,
"repo_name": "neurokernel/antenna",
"id": "b3557e78f4458537b642b8d9ecc61746c564f3f8",
"size": "... |
"""
Openstack Heat
--------------
Due to the strange nature of the OpenStack compatability layer, some values
that should be integers fail to validate and need to be represented as
strings. For this reason, we duplicate the AWS::AutoScaling::AutoScalingGroup
and change these types.
"""
# Copyright (c) 2012-2013, Mark ... | {
"content_hash": "e545c4cbf562b1d703ec54d5465b003a",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 78,
"avg_line_length": 35.26923076923077,
"alnum_prop": 0.5752453653217012,
"repo_name": "ikben/troposphere",
"id": "1b3bc80c78c8ffbf0f3e9c0c56a5142c620d1b1f",
"size": "185... |
'''
Created on Feb 2, 2011
@author: bolme
'''
import pyvision as pv
import cv
def surf(im,mask=None,extended=False,hessianThreshold=500, nOctaves=3, nOctaveLayers=4):
'''
Keypoints contain a
0: center point
1 sign of laplacian (-1,0,+1)
2 scale - diameter or radius
3 angle
4 res... | {
"content_hash": "e32ad84c46b47d37d2b25ced7fceea81",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 131,
"avg_line_length": 27.82758620689655,
"alnum_prop": 0.6877323420074349,
"repo_name": "tigerking/pyvision",
"id": "bc73434d7448dfb109cfd9590b41870c2d260ebe",
"size": "8... |
"""Deployment tests for ipmi driver.
These require an actual HIL setup with a real node, and are
somewhat particular to the MOC's development environment. They may be
difficult to run in other contexts.
"""
from hil.test_common import config_testsuite, fresh_database, \
fail_on_log_warnings, with_request_context,... | {
"content_hash": "86ad9abf63d3df6e310700ee55eddf9b",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 79,
"avg_line_length": 36.141176470588235,
"alnum_prop": 0.6123046875,
"repo_name": "SahilTikale/haas",
"id": "3a66a6679eefd3f48cf9cad41e6bf48e3d3a9849",
"size": "3072",
... |
"""
A helper script used to create files for new linter
"""
from __future__ import print_function
import logging
import re
import sys
logging.basicConfig(
level=logging.DEBUG,
format='%(levelname)-8s %(message)s',
)
def add_linter(linter_id, linter_name):
"""
:type linter_id int
:type linter_nam... | {
"content_hash": "2461cf1aedb8b3a443b737c7d0d591b1",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 92,
"avg_line_length": 32.54545454545455,
"alnum_prop": 0.5083798882681564,
"repo_name": "macbre/index-digest",
"id": "c66ebfb20ab57308e4705781e2f3ecdfab27b557",
"size": "... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.HomeView.as_view(), name='home'),
]
| {
"content_hash": "58278a5e0f9dadcdf7be4adb76cb8deb",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 54,
"avg_line_length": 18.285714285714285,
"alnum_prop": 0.65625,
"repo_name": "Candihub/pixel",
"id": "ed42f576f77e4e6883466ecef759cd083985394c",
"size": "128",
"binary":... |
from django.conf.urls.defaults import patterns, include, url
from django.conf import settings
urlpatterns = patterns('',
(r'^', include('shared.apps.base.urls')),
(r'^account/', include('shared.apps.account.urls')),
(r'^client/', include('myresource.apps.client.urls')),
(r'^oauth2/', include('myresourc... | {
"content_hash": "12af48f1194840adeef44583ac2118b3",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 60,
"avg_line_length": 39.8,
"alnum_prop": 0.6708542713567839,
"repo_name": "pingali/aadhaar-oauth2-server",
"id": "2fe9618f078adfb0d2ea4408be8cfb964fe45364",
"size": "398"... |
"""Module containing the various stages that a builder runs."""
import json
import logging
import os
from chromite.cbuildbot import commands
from chromite.cbuildbot import failures_lib
from chromite.cbuildbot import cbuildbot_run
from chromite.cbuildbot.stages import artifact_stages
from chromite.lib import cros_buil... | {
"content_hash": "16717dec8ace793ac8f8f0b0c9e5d4b6",
"timestamp": "",
"source": "github",
"line_count": 388,
"max_line_length": 80,
"avg_line_length": 37.71907216494845,
"alnum_prop": 0.6649812094294499,
"repo_name": "bpsinc-native/src_third_party_chromite",
"id": "245c5c42b8beb25b49f2d072165f8e49942... |
from django.conf.urls import include, url
from django_jinja import views
from .views import BasicTestView
from .views import I18nTestView, I18nTestViewDTL
from .views import StreamingTestView
from .views import PipelineTestView
from .views import CreateTestView, DeleteTestView, DetailTestView, UpdateTestView
from .vie... | {
"content_hash": "a5d43ba41ea5d7dc2e341acce9674511",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 165,
"avg_line_length": 60.083333333333336,
"alnum_prop": 0.680998613037448,
"repo_name": "akx/django-jinja",
"id": "4552800e073ad267d2da0ca84db556a5ae85135e",
"size": "216... |
"""
The Plaid API
The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from plaid.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal... | {
"content_hash": "9ddcc2344e14de6ac80a82a4688c28f1",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 199,
"avg_line_length": 40.93063583815029,
"alnum_prop": 0.5592430447676882,
"repo_name": "plaid/plaid-python",
"id": "356a2c78637ecbbc57144b9dcb09d78d4aa5f3c6",
"size": "... |
"""
test_djangocms-instagram
------------
Tests for `djangocms-instagram` models module.
"""
import os
import shutil
from django.test import TestCase
from djangocms_instagram import models
class TestDjangoCMS_Instagram(TestCase):
def setUp(self):
pass
def test_something(self):
pass
... | {
"content_hash": "f2c9a1f7dfd83786d0d45323ab075238",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 46,
"avg_line_length": 14.08,
"alnum_prop": 0.6704545454545454,
"repo_name": "mishbahr/djangocms-instagram",
"id": "6c2830f5b3048ab2752f56b13d8f00efb30f9ae6",
"size": "399"... |
from datetime import datetime
from time import sleep
from django import db
from django.core.management import BaseCommand
import pytz
from psycopg2._psycopg import InterfaceError
from dimagi.utils.logging import notify_exception
from pillow_retry.api import process_pillow_retry
from pillow_retry.models import Pillow... | {
"content_hash": "ef067c4164c2a7f2cd0c86fae1a04621",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 84,
"avg_line_length": 30.423728813559322,
"alnum_prop": 0.6763231197771588,
"repo_name": "dimagi/commcare-hq",
"id": "ea63f5c2a9379ce2215b2260f1b23c2f25f79ddb",
"size": "1... |
from __future__ import unicode_literals, print_function
no_cache = 1
base_template_path = "templates/www/desk.html"
import os, re
import frappe
from frappe import _
import frappe.sessions
def get_context(context):
if frappe.session.user == "Guest":
frappe.throw(_("Log in to access this page."), frappe.PermissionE... | {
"content_hash": "9630122aa2c64777a5dbe2d798a0889a",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 89,
"avg_line_length": 30.95505617977528,
"alnum_prop": 0.6631578947368421,
"repo_name": "adityahase/frappe",
"id": "c6bce850a52d1b4b23e2f6b8c0aa35c22f2d6484",
"size": "285... |
import socket
import uuid
from oslo.config import cfg
from heat.openstack.common import context
from heat.openstack.common.gettextutils import _ # noqa
from heat.openstack.common import importutils
from heat.openstack.common import jsonutils
from heat.openstack.common import log as logging
from heat.openstack.common... | {
"content_hash": "0ebeac1ad4f4bba1724b9ce0f22a92e6",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 79,
"avg_line_length": 30.79746835443038,
"alnum_prop": 0.6095355528154541,
"repo_name": "varunarya10/heat",
"id": "cd1e7b4bf98b2b4e4e64ffcfed8398969b0208d0",
"size": "550... |
import logging
import os
from . import config
class DummyMPLogHandler(logging.Handler):
"""DummyMP logging handler to allow multiprocess logging.
This class is a custom logging handler to allow spawned processes
(from :py:mod:`multiprocessing`) to log without any issues. This
works by intercept... | {
"content_hash": "1291968c22ee1236717d352de47f763b",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 88,
"avg_line_length": 38.125,
"alnum_prop": 0.6537704918032787,
"repo_name": "alberthdev/dummymp",
"id": "b4c3f4d7fddd01281843294be1c460e479fcf0a5",
"size": "2322",
"bin... |
from framework import auth
from website import settings
from osf.models import Contributor
from addons.osfstorage.models import Region
from website.filters import profile_image_url
from osf.utils.permissions import READ
from osf.utils import workflows
from api.waffle.utils import storage_i18n_flag_active
def get_pro... | {
"content_hash": "c5ca7468a26a948198712dffe06e7e84",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 132,
"avg_line_length": 35.88780487804878,
"alnum_prop": 0.5755063205110779,
"repo_name": "mfraezz/osf.io",
"id": "92c3d5846205f90567ba1df804e9001765b11352",
"size": "7381... |
"""
Seismic: 2D finite difference simulation of scalar wave propagation.
Difraction example in cylindrical wedge model. Based on:
R. M. Alford, K. R. Kelly and D. M. Boore -
Accuracy of finite-difference modeling of the acoustic wave equation.
Geophysics 1974
"""
import numpy as np
from matplotlib import animation
fr... | {
"content_hash": "a89b3af8bf9e335159174a8355bfecf4",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 69,
"avg_line_length": 32.68333333333333,
"alnum_prop": 0.6884242733299337,
"repo_name": "eusoubrasileiro/fatiando",
"id": "2640c125cfecb9019e1880158030d063a86501ad",
"size... |
def matrix_challenge(arr):
for i, row in enumerate(arr):
arr[i] = [c for c in row]
rows = len(arr)
cols = len(arr[0])
possible, visited_start = search((0, 0), (rows-1, cols-1), arr)
if possible:
return True
_, visited_end = search((rows-1, cols-1), (0, 0), arr)
neighbors_start = get_all_neighbo... | {
"content_hash": "96b1b475604afa4f7a32149b6ee63cb9",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 70,
"avg_line_length": 24.671875,
"alnum_prop": 0.6238125395820139,
"repo_name": "saisankargochhayat/algo_quest",
"id": "0bbabde336976eba66ca34b140ac6ddafcb7a1bf",
"size": ... |
import pytest
from tg import tmpl_context as c
from bson import ObjectId
from allura.lib.helpers import set_context
from allura.lib.exceptions import NoSuchProjectError, NoSuchNeighborhoodError
from allura.tests.unit import WithDatabase
from allura.tests.unit import patches
from allura.tests.unit.factories import (cre... | {
"content_hash": "2e68a5e65244366d53008d88693ac84b",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 78,
"avg_line_length": 34.33,
"alnum_prop": 0.6536556947276435,
"repo_name": "apache/allura",
"id": "171cf4425626059b81ca6254c69ea5ecf24fc566",
"size": "4303",
"binary":... |
""" This file implements linking semantics common to all unixes. On unix, static
libraries must be specified in a fixed order on the linker command line. Generators
declared there store information about the order and use it properly.
"""
import builtin
from b2.build import generators, type
from b2.util.utilit... | {
"content_hash": "ff91d605695fa4cc801f9a51c349d6c4",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 115,
"avg_line_length": 32.28472222222222,
"alnum_prop": 0.6588513658851366,
"repo_name": "bureau14/qdb-benchmark",
"id": "681a872027a249aab2274fa039d30bebd64a8ff6",
"size... |
import sys
class Bracket:
def __init__(self, bracket_type, position):
self.bracket_type = bracket_type
self.position = position
def Match(self, c):
if self.bracket_type == '[' and c == ']':
return True
if self.bracket_type == '{' and c == '}':
return Tru... | {
"content_hash": "963b35230800eb00c706ac32058251a9",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 59,
"avg_line_length": 28.333333333333332,
"alnum_prop": 0.5105882352941177,
"repo_name": "xunilrj/sandbox",
"id": "f9fca1867d5584a573f8cd0aa4252271e50f53fc",
"size": "861"... |
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class V1Initial... | {
"content_hash": "f5fcdf57bcb398ef037c92d08efee3ba",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 105,
"avg_line_length": 26.700854700854702,
"alnum_prop": 0.5220870678617158,
"repo_name": "sebgoa/client-python",
"id": "3190a2e77777eabf093cadcf529b94135b672577",
"size"... |
from .base import CodeGenerator
| {
"content_hash": "5d35f02dc0f0d3f1e098ee018d2d6008",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 31,
"avg_line_length": 32,
"alnum_prop": 0.84375,
"repo_name": "tclose/PyPe9",
"id": "73f307b9bf53708ff2e6b8b407d13cc78112a4d5",
"size": "32",
"binary": false,
"copies":... |
import os
import logging
import slugify
from ovbpclient.models import oteams as oteams_models
from ovbpclient.json import json_dump
def sanitize_name(name):
# https://newbedev.com/regular-expression-for-valid-filename
return slugify.slugify(name, regex_pattern=r"[^\w\-.\s]")
logger = logging.getLogger(__n... | {
"content_hash": "6b6f38f9233e0b20541d0cbb76124926",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 112,
"avg_line_length": 38.61176470588235,
"alnum_prop": 0.6587446678854357,
"repo_name": "openergy/openergy",
"id": "4bc10d985418dd7b73704c9617f589cd42e68bf5",
"size": "32... |
import urllib
import urllib2
import re
#loosely based on http://stackoverflow.com/questions/16011497/youtube-stream-fmt-stream-map-quality
def getYoutubeMovie(url):
try:
conn = urllib2.urlopen(url)
encoding = conn.headers.getparam('charset')
content = conn.read().decode(encoding)
#get available streams
s = ... | {
"content_hash": "a9ff449fa4f3e89ffc746153aa83cb09",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 100,
"avg_line_length": 28.97222222222222,
"alnum_prop": 0.6241610738255033,
"repo_name": "strainu/plugins.video.cinepub",
"id": "8e3fa49a3e0c78559494309b645529caa2a088c4",
... |
import unittest
import numpy as np
import sys
sys.path.append("..")
import paddle
import paddle.fluid as fluid
from op_test import OpTest
paddle.enable_static()
class TestSizeOp(OpTest):
def setUp(self):
self.set_npu()
self.place = paddle.NPUPlace(0)
self.op_type = "size"
self.c... | {
"content_hash": "0a0dc4355106cc0b447d7c0bbaf4fbd6",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 76,
"avg_line_length": 28.34090909090909,
"alnum_prop": 0.5565356856455493,
"repo_name": "luotao1/Paddle",
"id": "1e768a5dd185a4d0acb8970f26a47f58a3f7075e",
"size": "4354"... |
from rh_aligner.stitching.match_sift_features_and_filter_cv2 import match_single_sift_features_and_filter, match_multiple_sift_features_and_filter
import os
import time
import argparse
import re
def wait_after_file(filename, timeout_seconds):
if timeout_seconds > 0:
cur_time = time.time()
mod_time ... | {
"content_hash": "a182ccec4454bfdbdfdc71aef3d28919",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 244,
"avg_line_length": 59.27160493827161,
"alnum_prop": 0.6104978129556342,
"repo_name": "Rhoana/rh_aligner",
"id": "60ba45cb3b29b08310dc0bc66230e9a8bd2f709b",
"size": "48... |
import imp
from .authorization import Authorization
from .card import Card
from .combatant import Combatant
from .combatant_authorization import CombatantAuthorization
from .combatant_warrant import CombatantWarrant
from .discipline import Discipline
from .marshal import Marshal
from .privacy_acceptance import Privacy... | {
"content_hash": "e44cc56c6330bb4e7ec5702c8fda3e8b",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 59,
"avg_line_length": 36.30769230769231,
"alnum_prop": 0.8580508474576272,
"repo_name": "lrt512/emol",
"id": "4eefee49cd888026b91e6c436f03069e54a3acd3",
"size": "472",
"... |
"""
The MIT License (MIT)
Copyright (c) 2014 Cuble Desarrollo S.L.
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, modif... | {
"content_hash": "e1aad2591e129f21ee839aa874b82c1b",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 92,
"avg_line_length": 28.526315789473685,
"alnum_prop": 0.6785977859778598,
"repo_name": "cubledesarrollo/cubledotes",
"id": "e60adb83c6fb12e012b385e9045692b1fd31c172",
"s... |
import unittest
import warnings
from unittest import mock
from airflow.utils.log.logging_mixin import StreamLogWriter, set_context
class TestLoggingMixin(unittest.TestCase):
def setUp(self):
warnings.filterwarnings(action='always')
def test_set_context(self):
handler1 = mock.MagicMock()
... | {
"content_hash": "9f68563c5130a445b77e1f66a3b42b56",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 72,
"avg_line_length": 23.59550561797753,
"alnum_prop": 0.5923809523809523,
"repo_name": "dhuang/incubator-airflow",
"id": "7d19b9d5632a0b49e603e9b36079f55b72b4fc6c",
"size... |
import base64
import copy
import glob
import json
import logging
import os
import socket
import sys
import threading
import time
import traceback
import urllib2
import urlparse
import yaml
DEFAULT_REGISTRY_DIR = '/opt/spinnaker-monitoring/registry'
# pylint: disable=invalid-name
_cached_registry_catalog = None
_cach... | {
"content_hash": "b60fe5c338a24493400abfbe2e6219cb",
"timestamp": "",
"source": "github",
"line_count": 376,
"max_line_length": 82,
"avg_line_length": 34.17553191489362,
"alnum_prop": 0.6211673151750973,
"repo_name": "okoye/spinnaker-monitoring",
"id": "5dd2254a1dac15489e8d717bd2a2f4c4f1bf041d",
"s... |
import numpy as np
from Orange.data import Table, Domain, ContinuousVariable, DiscreteVariable
from Orange.widgets.data.owoutliers import OWOutliers
from Orange.widgets.tests.base import WidgetTest
class TestOWOutliers(WidgetTest):
def setUp(self):
self.widget = self.create_widget(OWOutliers)
sel... | {
"content_hash": "0cf9d3133f784febb9b15c0285df5955",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 75,
"avg_line_length": 42.714285714285715,
"alnum_prop": 0.6280936454849498,
"repo_name": "cheral/orange3",
"id": "2783d97a930cbbded80859fd23a538ead6ec19c2",
"size": "1595"... |
cubes = [x**3 for x in range(10)]
odd_cubes1 = filter(lambda cube: cube % 2, cubes)
odd_cubes2 = (cube for cube in cubes if cube % 2)
| {
"content_hash": "72c5bfd89b59f4d942c50de6893ab30d",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 49,
"avg_line_length": 33.75,
"alnum_prop": 0.6592592592592592,
"repo_name": "mkhuthir/learnPython",
"id": "14386402e91c04adb23f07aa68d5f8bec8c64084",
"size": "135",
"bina... |
""" Utility functions for sparse matrix module
"""
from __future__ import division, print_function, absolute_import
__all__ = ['upcast','getdtype','isscalarlike','isintlike',
'isshape','issequence','isdense']
import numpy as np
# keep this list syncronized with sparsetools
#supported_dtypes = ['int8', '... | {
"content_hash": "9673be684f5aa886097510e866f14813",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 75,
"avg_line_length": 27.93076923076923,
"alnum_prop": 0.5877168824015423,
"repo_name": "Universal-Model-Converter/UMC3.0a",
"id": "7898fb8d6f23e1b3a2febcc7efb2df85c4538725... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.