text stringlengths 4 1.02M | meta dict |
|---|---|
import sys
from nevow import tags
from nevow.livetrial.testcase import TestCase
from axiom.store import Store
from axiom.dependency import installOn
from xmantissa import people, ixmantissa
from xmantissa.liveform import FORM_INPUT
from xmantissa.webtheme import getLoader
from xmantissa.webapp import PrivateApplicat... | {
"content_hash": "636faa06ce57aba496a903c245975b06",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 84,
"avg_line_length": 35.35251798561151,
"alnum_prop": 0.6424501424501424,
"repo_name": "twisted/mantissa",
"id": "3adf9d45626c64ab0ba9e2308ffbdf5be1ea39f7",
"size": "491... |
import pdb
import argparse
import sys as sys
import logging as logging
import time as time
import oneapi as oneapi
import oneapi.models as models
import oneapi.dummyserver as dummyserver
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s')
parser = argparse.Argument... | {
"content_hash": "cfaec37f30a5c30707c723c7cac92a98",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 276,
"avg_line_length": 40.714285714285715,
"alnum_prop": 0.6513556618819777,
"repo_name": "jiceher/oneapi-python",
"id": "ad0dc9b0d63c9d0e1ffd6463d875bb04d0e40065",
"size"... |
from .base import RandomDistributionValidator
| {
"content_hash": "e0711171942ab825a628645493ed04fe",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 45,
"avg_line_length": 46,
"alnum_prop": 0.8913043478260869,
"repo_name": "INCF/lib9ML",
"id": "558c243a911bec7aa848cf86dbaffcccbcc34f9b",
"size": "46",
"binary": false,
... |
from __future__ import absolute_import
import atexit
import logging
import time
try:
from queue import Empty, Full, Queue # pylint: disable=import-error
except ImportError:
from Queue import Empty, Full, Queue # pylint: disable=import-error
from collections import defaultdict
from threading import Thread, ... | {
"content_hash": "7748cc3e9b8f592566144641220ddbb0",
"timestamp": "",
"source": "github",
"line_count": 505,
"max_line_length": 141,
"avg_line_length": 42.851485148514854,
"alnum_prop": 0.5987060998151571,
"repo_name": "gamechanger/kafka-python",
"id": "3e5b5264fcb8f2f54a5bab367a7550d7e995f8e6",
"s... |
"""
utils
=====
Low-level functionality NOT intended for users to EVER use.
"""
from __future__ import absolute_import
import json
import os.path
import re
import sys
import threading
import pytz
from . exceptions import PlotlyError
try:
import numpy
_numpy_imported = True
except ImportError:
_numpy_... | {
"content_hash": "77147165784b98551c3c7288402cde8e",
"timestamp": "",
"source": "github",
"line_count": 448,
"max_line_length": 79,
"avg_line_length": 30.613839285714285,
"alnum_prop": 0.5661684287276705,
"repo_name": "jeanfeydy/lddmm-ot",
"id": "841d9a9d3059cc203d73ed45ae0a68ca95385a26",
"size": "... |
"""SQLAlchemy storage backend."""
from oslo_config import cfg
from oslo_db import exception as db_exc
from oslo_db.sqlalchemy import session as db_session
from oslo_db.sqlalchemy import utils as db_utils
from oslo_utils import timeutils
from sqlalchemy.orm.exc import MultipleResultsFound
from sqlalchemy.orm.exc import... | {
"content_hash": "d94a087f6df6091b170592127f15c5a1",
"timestamp": "",
"source": "github",
"line_count": 927,
"max_line_length": 79,
"avg_line_length": 37.58252427184466,
"alnum_prop": 0.5966589167312495,
"repo_name": "jay-lau/magnum",
"id": "6e2f88c3c44ab0038d6aa41c6cabb780b89c9fa3",
"size": "35446... |
"""
api.py
"""
from tastypie.authorization import Authorization, DjangoAuthorization
from tastypie.resources import ALL
from tastypie.fields import DictField
from mongoengine.django.auth import User
from tastypie_mongoengine import resources
from bson.objectid import ObjectId
from hopscotch.mongo_tastypie.auth import... | {
"content_hash": "bd865c03835165668835f91fb495d76b",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 81,
"avg_line_length": 26.07792207792208,
"alnum_prop": 0.6110557768924303,
"repo_name": "jasonbartz/hopscotch",
"id": "b882c7fb004bb362a6cf8fd341a553b7802913fe",
"size": "... |
import os
import websocket
import json
from slack import post_slack, slack_event
EVENT_TYPES = ["stack", "service", "container", "node_cluster", "node", "action"]
def on_error(ws, error):
if VERBOSE:
print error
def on_close(ws):
r = post_slack("Tutum Stream connection closed.")
if VERBOSE:
... | {
"content_hash": "f04c2fe77e29a0f42ce6bde2225f278c",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 88,
"avg_line_length": 29.453333333333333,
"alnum_prop": 0.5559076505205975,
"repo_name": "alexdebrie/tutum-slack",
"id": "3f04ea50f1b238acf9b6df48b4f4cccc0045a665",
"size"... |
"""Make some HI related plots from the cosmo runs"""
from __future__ import print_function
import matplotlib
matplotlib.use('PDF')
import matplotlib.pyplot as plt
import plot_spectra as ps
import dla_data
import os.path as path
import myname
from save_figure import save_figure
outdir = path.join(myname.base,"plots/... | {
"content_hash": "805d279707131665c773ab11ea8c53b3",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 71,
"avg_line_length": 27.09090909090909,
"alnum_prop": 0.6157718120805369,
"repo_name": "sbird/vw_spectra",
"id": "deaae56879cacd17ce573483be0f7fda3f86efbe",
"size": "2408... |
"""
Micro-blog
~~~~~~~~~~
Microblog client for twitter
"""
import twitter
import datetime
import dateutil
from micro_blog_keys import twitter_consumer_key,twitter_consumer_secret,\
twitter_access_key,twitter_access_secret
import bgpranking
api = None
username = "bgpranking"
def __prepare():
... | {
"content_hash": "937e357b01913807f7a9519297284eb6",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 74,
"avg_line_length": 29.254901960784313,
"alnum_prop": 0.6166219839142091,
"repo_name": "CIRCL/bgpranking-redis-api",
"id": "382e6c889ba6892570616c91bb882b4424477e67",
"s... |
"""Utility functions."""
from contextlib import contextmanager
from io import StringIO
import json
import logging
import os
import os.path as op
import sys
import pypandoc
pandoc = pypandoc.convert
logger = logging.getLogger(__name__)
#-------------------------------------------------------------------------------... | {
"content_hash": "b981b2ec372c17c53f851f0be8d4bc23",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 98,
"avg_line_length": 29.734513274336283,
"alnum_prop": 0.4785714285714286,
"repo_name": "rossant/podoc",
"id": "8e7a5f1f6bc6814b85e5bff8c1a9e8fef8ade428",
"size": "6745"... |
from .fetchers import NUPermissionsFetcher
from .fetchers import NUMetadatasFetcher
from .fetchers import NUGlobalMetadatasFetcher
from bambou import NURESTObject
class NUDestinationurl(NURESTObject):
""" Represents a Destinationurl in the VSD
Notes:
destination URL under tier
"""
... | {
"content_hash": "9fe61f2e2b4ef7691c4a0da89534b4f4",
"timestamp": "",
"source": "github",
"line_count": 470,
"max_line_length": 296,
"avg_line_length": 29.397872340425533,
"alnum_prop": 0.5618441050879351,
"repo_name": "nuagenetworks/vspk-python",
"id": "57ae7e6a78added9fcd4b9a63ca3370ce7ce662e",
"... |
"""Script for generating html chart file (./html directory) based on local data files"""
import json
import fsutil
import timeutil
import wkhtmltoimage
from jinja2 import Environment
def get_daily_chart_path(config, time):
"""Returns full path of chart, by given time """
time_str = timeutil.format_to_date_st... | {
"content_hash": "26268afa31f0794530c98188c0549a81",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 101,
"avg_line_length": 35.785714285714285,
"alnum_prop": 0.6347305389221557,
"repo_name": "Pavel-Durov/pynetwork",
"id": "976e1b3923935d653c1476e87dd026d40ad1bf53",
"size"... |
from nipype.testing import assert_equal
from nipype.interfaces.freesurfer.model import Label2Vol
def test_Label2Vol_inputs():
input_map = dict(annot_file=dict(argstr='--annot %s',
copyfile=False,
mandatory=True,
requires=('subject_id', 'hemi'),
xor=('label_file', 'annot_file', 'seg_file', 'aparc_as... | {
"content_hash": "f4b64d0d428fcfe8396bbf066f04569a",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 78,
"avg_line_length": 28.40909090909091,
"alnum_prop": 0.5924,
"repo_name": "fprados/nipype",
"id": "2771245fbf97b83a29d192369b58e1eca29b03db",
"size": "2554",
"binary":... |
from awscli.customizations.emr import hbase
from awscli.customizations.emr import ssh
from awscli.customizations.emr.addsteps import AddSteps
from awscli.customizations.emr.createcluster import CreateCluster
from awscli.customizations.emr.addinstancegroups import AddInstanceGroups
from awscli.customizations.emr.created... | {
"content_hash": "84eebda4c17da13c6d1da4b68cd3210a",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 79,
"avg_line_length": 50.77358490566038,
"alnum_prop": 0.7699739873652918,
"repo_name": "mnahm5/django-estore",
"id": "fc42bfcecf3969a64f4067f1b26e24d2da0011e2",
"size": "... |
from setuptools import setup, Extension
from thumbor import __version__
import glob
import os
tests_require = [
"simplejson>=2.1.6,<2.2.0",
"redis==2.4.9",
"gevent",
"tornado-pyvows>=0.6.0",
"coverage",
"mock==1.0.1",
"raven",
"nose",
"nose-focus",
"colorama",
"numpy",
... | {
"content_hash": "dae3817d18dc8adc02c6235bd3ae56a6",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 119,
"avg_line_length": 31.508196721311474,
"alnum_prop": 0.5634755463059313,
"repo_name": "adeboisanger/thumbor",
"id": "e03ac347ea4c382d07d2c9f08a6aff3d15fcbcc8",
"size"... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('fcm_app', '0020_auto_20180618_1614'),
]
operations = [
migrations.CreateModel(
name='FCM_EDGES',
... | {
"content_hash": "08fd939247bdffa26341aea85a9bded2",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 114,
"avg_line_length": 30.529411764705884,
"alnum_prop": 0.5289017341040463,
"repo_name": "gtsapelas/TRANSrisk_fcm_project",
"id": "b3b4fe687e786299a0411f34313c195d2a01c334"... |
from os.path import join, basename
from functools import partial
from json import dumps
from future.utils import viewitems
from moi import r_client
from qiita_core.util import execute_as_transaction
from qiita_core.qiita_settings import qiita_config
from qiita_pet.handlers.api_proxy.util import check_access, check_fp... | {
"content_hash": "d9cfd9e0e384ee9b18bbd65749260211",
"timestamp": "",
"source": "github",
"line_count": 525,
"max_line_length": 79,
"avg_line_length": 35.476190476190474,
"alnum_prop": 0.5852348993288591,
"repo_name": "squirrelo/qiita",
"id": "553153a46a926e9d046e1238a6b5cab5800f7b5e",
"size": "189... |
import numpy as np
import os
import dynaphopy.interface.iofile as io
import dynaphopy
from dynaphopy.interface.phonopy_link import get_force_constants_from_file
import unittest
class TestDynaphopy(unittest.TestCase):
def setUp(self):
self.structure = io.read_from_file_structure_poscar('GaN_data/POSCAR')
... | {
"content_hash": "e181de3aa5d07a50b0fc1abb2b31fc87",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 119,
"avg_line_length": 47.75555555555555,
"alnum_prop": 0.5180704203505506,
"repo_name": "abelcarreras/DynaPhoPy",
"id": "d7b80dc7068dd617493eca7f8beeb2f5a68f62e8",
"size... |
import smtplib
import mimetypes
import sys, traceback
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
def send_mail(you, outFile, logFile):
COMMASPACE = ', '
# Create the container (outer) email message.
msg = MIMEMultipart()
msg['Subject'] = 'V-Wrap run result'
... | {
"content_hash": "5d5ee23c6ad7e84d1381967c756f7c30",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 80,
"avg_line_length": 27.095238095238095,
"alnum_prop": 0.6233157586408905,
"repo_name": "minatverma/pythonWorks",
"id": "bf2bb8bc7f71806c334afa4c3db12d6c2e76e2f8",
"size"... |
"""
OpenAPI spec version:
Generated by: https://github.com/swagger-api/swagger-codegen.git
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.a... | {
"content_hash": "4a8b2e571d22fada4be03ce8f1f6d347",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 83,
"avg_line_length": 25.705882352941178,
"alnum_prop": 0.7048054919908466,
"repo_name": "detiber/lib_openshift",
"id": "d7b8928ac32f6f264867d72a3ef5b2e27a33647a",
"size":... |
"""
Reorder the integer arguments to the commands in a LAMMPS input
file if these arguments violate LAMMPS order requirements.
We have to do this because the moltemplate.sh script will automatically
assign these integers in a way which may violate these restrictions
and the user has little control over t... | {
"content_hash": "3e753a6bfc4a54737b3c6de0efe28a2d",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 110,
"avg_line_length": 42.177215189873415,
"alnum_prop": 0.4690876350540216,
"repo_name": "smsaladi/moltemplate",
"id": "2050f2d020a782437a4a06f7922bd2260eb515fc",
"size"... |
from __future__ import print_function
import json
import textwrap
from gherkin.ast_builder import AstBuilder
from gherkin.parser import Parser
from gherkin.parser import Parser
from gherkin.errors import ParserError
from gherkin.pickles.compiler import Compiler
from gherkin.stream.id_generator import IdGenerator
def... | {
"content_hash": "89744bd70806df009466168af8a3cd97",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 75,
"avg_line_length": 25.75294117647059,
"alnum_prop": 0.4828688899040658,
"repo_name": "cucumber/cucumber",
"id": "a0ad633498cd541583b22569a9bc7d05f0180026",
"size": "220... |
"""Nearest Neighbor Classification"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck <L.J.Buitinck@uva.nl>
# Multi-output support by ... | {
"content_hash": "48f1bc8476c85c844ed5e61a6b6126f0",
"timestamp": "",
"source": "github",
"line_count": 391,
"max_line_length": 79,
"avg_line_length": 36.549872122762146,
"alnum_prop": 0.5898817437548107,
"repo_name": "treycausey/scikit-learn",
"id": "a2b86dd83c5f5efcebd1f48795d0afa1f6f4817c",
"siz... |
from PIL import Image
im = Image.open('cat.jpg')
print('im type is', im)
print('image size', im.size)
w, h = im.size
im.thumbnail((w // 2, h // 3))
print('resize image to', im.size)
im.save('thumbnail.jpg') | {
"content_hash": "319f5be95c4614a3bddba53e18eca2b3",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 33,
"avg_line_length": 18.416666666666668,
"alnum_prop": 0.6108597285067874,
"repo_name": "JShadowMan/package",
"id": "4f116921f44e5883744870761aec0a1816da897f",
"size": "2... |
import argparse
import logging
import os
import random
import requests
import re
import sys
import time
import urllib
# Add path for DIGITS package
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
import digits.config # noqa
from digits import utils, log # noqa
logger... | {
"content_hash": "2998ede74b3d3a416fbd79a7d2a6b3d2",
"timestamp": "",
"source": "github",
"line_count": 558,
"max_line_length": 110,
"avg_line_length": 33.598566308243726,
"alnum_prop": 0.5501920204821847,
"repo_name": "ethantang95/DIGITS",
"id": "fa7fd8dd310d331829e5f39b8144acd88e5f9ee2",
"size": ... |
from __future__ import annotations
import numpy as np
import pandas as pd
class TablePlotter:
"""
Layout some DataFrames in vertical/horizontal layout for explanation.
Used in merging.rst
"""
def __init__(
self,
cell_width: float = 0.37,
cell_height: float = 0.25,
... | {
"content_hash": "c9cb0f70a54c8c0f27f6585f62d52b36",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 88,
"avg_line_length": 34.49222797927461,
"alnum_prop": 0.5313204146011717,
"repo_name": "jorisvandenbossche/pandas",
"id": "0d90d9b2871d9b3695c4ca0cc1c840830e7fe021",
"si... |
import os
import argparse
import subprocess
import signal
import re
import sys
def arguments():
parser = argparse.ArgumentParser()
parser.add_argument('input_file', metavar='input-file',
help = 'source file (*.bpl or *.c)')
parser.add_argument('prop', metavar='property',
help = 'property to check (nul... | {
"content_hash": "4855af5122fcc3f049881c6e32ed56eb",
"timestamp": "",
"source": "github",
"line_count": 275,
"max_line_length": 149,
"avg_line_length": 29.316363636363636,
"alnum_prop": 0.6245348548747209,
"repo_name": "boogie-org/corral",
"id": "93e753da0c9f83c7fca1f2f8d0114f325a387a64",
"size": "... |
"""Change the current working directory.
"""
from __future__ import print_function
import argparse
import os
import sys
def main(args):
p = argparse.ArgumentParser(description=__doc__)
p.add_argument("dir", action="store", nargs="?", default=os.environ["HOME2"], help="the new working directory")
ns = p.... | {
"content_hash": "6500e98feb6dbb6b213507e2aafda7b4",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 115,
"avg_line_length": 27.92105263157895,
"alnum_prop": 0.5504241281809613,
"repo_name": "ywangd/stash",
"id": "5e341df7fccb8238cee6e8e47985b64d2087520c",
"size": "1107",
... |
import youtube_dl
from pymongo import MongoClient
from flask import Flask, request
import time
import json
app = Flask(__name__)
ydl_opts={}
client = MongoClient()
db = client.rXive
@app.route("/")
def index():
return "Hello, world"
@app.route("/getlink", methods=["POST","GET"])
def url_post_handle():
if req... | {
"content_hash": "5eac3dad49831bc735ac9b975c6a7b91",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 66,
"avg_line_length": 24,
"alnum_prop": 0.5566239316239316,
"repo_name": "zuik/stuff",
"id": "3e84cc1068601ab97c079d43639f6adbdfebdf39",
"size": "936",
"binary": false,
... |
from django.contrib import admin
from django.contrib.auth.views import LoginView, LogoutView
from django.urls import include, path
from ibms.views import SiteHomeView, HealthCheckView
urlpatterns = [
path('admin/', admin.site.urls),
path('login/', LoginView.as_view(template_name='login.html'), name='login'),
... | {
"content_hash": "65457837da938d8c4ae3279c59cebec0",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 88,
"avg_line_length": 43.642857142857146,
"alnum_prop": 0.6972176759410802,
"repo_name": "parksandwildlife/ibms",
"id": "24c8b5857617a9d5674e3db6b96e9a285bad5f32",
"size":... |
"""-"""
class Film(object):
"""-"""
def __init__(self, title, imgUrl, description, downloadUrl):
self.title = title
self.img_url = imgUrl
self.description = description
self.download_url = downloadUrl
| {
"content_hash": "b65e143acdf3290309cd154af9616f3d",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 64,
"avg_line_length": 30.125,
"alnum_prop": 0.5850622406639004,
"repo_name": "wenpengfei/python-crawl",
"id": "fc5d2c1609fe56c8de28515de11aa92cf4a04b39",
"size": "259",
"... |
"""
WSGI config for password-reset project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
from os.path import abspath, dirname
from sys import path
SITE_ROOT = dirname(di... | {
"content_hash": "574b471966d7e17e407b5dfb907efba0",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 78,
"avg_line_length": 25.476190476190474,
"alnum_prop": 0.7682242990654206,
"repo_name": "tritsio/password-reset",
"id": "c1f94dee5115aeff7357fda3c66815c9494929a8",
"size"... |
from __future__ import print_function
from mongoalchemy.py3compat import *
from mongoalchemy.util import classproperty, UNSET
def test_class_properties():
class A(object):
a = 1
b = 2
@classproperty
def c(cls):
return cls.a+cls.b
assert A.c == 3
def test_UNSET():
... | {
"content_hash": "211c5df665ba1bdd3e67138f04395e54",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 50,
"avg_line_length": 19.761904761904763,
"alnum_prop": 0.6120481927710844,
"repo_name": "jeffjenkins/MongoAlchemy",
"id": "10933367af32f167750f58c07018fe96b811417d",
"siz... |
from django.template import Library
from treebeard.templatetags import needs_checkboxes
from treebeard.admin import TO_FIELD_VAR
register = Library()
CHECKBOX_TMPL = ('<input type="checkbox" class="action-select" value="%d" '
'name="_selected_action" />')
def _line(context, node, request):
if T... | {
"content_hash": "c4cf6507a018d981abda2dca10cd53c6",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 79,
"avg_line_length": 31.94871794871795,
"alnum_prop": 0.6059390048154093,
"repo_name": "Venturi/oldcms",
"id": "ae2cd3e87aa83a14a89e7f39a3873d464fbc3fce",
"size": "1271",... |
def TestFunction():
print("TestFunction!")
return 0
| {
"content_hash": "47222cc70a661d65c6655fda26bf0f4d",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 26,
"avg_line_length": 20,
"alnum_prop": 0.65,
"repo_name": "subutai-io/launcher",
"id": "afe60d7e41a269c4f22ef156c5fb8bbada28d633",
"size": "60",
"binary": false,
"copi... |
class FormatSchemeResponse(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually."""
def __init__(self):
"""
Attributes:
swaggerTypes (dict): The key is attribute name and the value is attribute type.
attrib... | {
"content_hash": "508b1d793a8a8cea525319c15210dfe0",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 97,
"avg_line_length": 31.68,
"alnum_prop": 0.5669191919191919,
"repo_name": "farooqsheikhpk/Aspose_Slides_Cloud",
"id": "0c4ac95fdba9488d3c3d20a435aaab1909258619",
"size":... |
import json
import requests
from IPStreet.error import APIConnectionError, SendError
from IPStreet import query
class Client:
"""Basic IP Street API Client Object"""
def __init__(self, apikey, api_version):
self.debug = True
# credentials
self.apikey = apikey
self.headers ... | {
"content_hash": "1fe0b666bab36b596063508554245897",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 121,
"avg_line_length": 39.038709677419355,
"alnum_prop": 0.6144438935713106,
"repo_name": "IPStreet/PythonSDK",
"id": "78383042a57cd375765c0b115316464bcad86f8c",
"size": ... |
from odoo import api, fields, models
class MusicPreference(models.Model):
_name = "oomusic.preference"
_rec_name = "res_model"
_order = "id"
_description = "User Preferences"
res_model_id = fields.Many2one(
"ir.model",
"Related Document Model",
ondelete="cascade",
... | {
"content_hash": "b5a42d72580c3819c4a3c9d056b05cc2",
"timestamp": "",
"source": "github",
"line_count": 251,
"max_line_length": 99,
"avg_line_length": 35.12749003984064,
"alnum_prop": 0.5716230010207554,
"repo_name": "nicolasmartinelli/oomusic",
"id": "8b7d27ee9eba37901ffe424e9562bc58f60b6cdf",
"si... |
from installer import (HoneyInstaller, get_choice, get_version, Popen, check_output)
| {
"content_hash": "c6523f715cac046189e708a0e124f347",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 84,
"avg_line_length": 85,
"alnum_prop": 0.8,
"repo_name": "honeycombio/honey_installers",
"id": "02b60125b69b11b91699585fe92ed7b2e94f01de",
"size": "85",
"binary": false,... |
from typing import List, Optional
from games.saloon.game_object import GameObject
# <<-- Creer-Merge: imports -->> - Code you add between this comment and the end comment will be preserved between Creer re-runs.
# you can add additional import(s) here
# <<-- /Creer-Merge: imports -->>
class Tile(GameObject):
"""T... | {
"content_hash": "df9bf515ade5eeee3cf7d31321caebe9",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 149,
"avg_line_length": 36.01360544217687,
"alnum_prop": 0.6097468832640726,
"repo_name": "JacobFischer/Joueur.py",
"id": "8ffa279cefd9230d55e804eba9223bd5c38ec60d",
"size... |
"""Test Z-Wave config panel."""
from http import HTTPStatus
import json
from unittest.mock import MagicMock, patch
import pytest
from homeassistant.bootstrap import async_setup_component
from homeassistant.components import config
from homeassistant.components.zwave import DATA_NETWORK, const
from tests.mock.zwave i... | {
"content_hash": "70fbcee76a1dfb225cd051a0c0eba44c",
"timestamp": "",
"source": "github",
"line_count": 542,
"max_line_length": 87,
"avg_line_length": 30.367158671586715,
"alnum_prop": 0.6417157786013731,
"repo_name": "jawilson/home-assistant",
"id": "bc7f22c104f0b76e84fc26adb6e001b146e87e19",
"siz... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0004_auto_20160413_2234'),
]
operations = [
migrations.AddField(
model_name='provider',
name='status',
f... | {
"content_hash": "d41625ba5c577a0a860206dd33394292",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 188,
"avg_line_length": 28.5,
"alnum_prop": 0.5886939571150097,
"repo_name": "InternetSemLimites/PublicAPI",
"id": "41d7b368f08653cd6bbc8e417c38fbe3b69cd539",
"size": "588"... |
from pandac import PandaModules as PM
from direct.directnotify import DirectNotifyGlobal
from direct.showbase.PythonUtil import list2dict, uniqueElements
import string
import LevelConstants
import types
if __dev__:
import os
class LevelSpec:
notify = DirectNotifyGlobal.directNotify.newCategory('LevelSpec')
... | {
"content_hash": "5084b4c44017a1c10a61ed883db1276d",
"timestamp": "",
"source": "github",
"line_count": 422,
"max_line_length": 162,
"avg_line_length": 37.111374407582936,
"alnum_prop": 0.5310005746759466,
"repo_name": "ksmit799/Toontown-Source",
"id": "d5bd8672c6fe31af95abb4e2bcd7359d4196917f",
"s... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('special_coverage', '0006_auto_20151109_1708'),
]
operations = [
migrations.AddField(
model_name='specialcoverage',
name='end... | {
"content_hash": "e5322c0d06919a26e67c292853304594",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 62,
"avg_line_length": 25.391304347826086,
"alnum_prop": 0.5907534246575342,
"repo_name": "theonion/django-bulbs",
"id": "edd298a8eeb9636a96b2d19b1c56da1801cecec7",
"size":... |
"""Invenio Circulation custom transitions."""
from flask import current_app
from invenio_db import db
from invenio_circulation.proxies import current_circulation
from ..api import can_be_requested, get_available_item_by_doc_pid, \
get_document_pid_by_item_pid, get_pending_loans_by_doc_pid, \
is_item_at_desk_... | {
"content_hash": "2351b53d72aa01ede28c2851747909e9",
"timestamp": "",
"source": "github",
"line_count": 403,
"max_line_length": 79,
"avg_line_length": 36.903225806451616,
"alnum_prop": 0.6227138246369016,
"repo_name": "inveniosoftware/invenio-circulation",
"id": "094cc69aa76aa081681e72b4e51f748505e70... |
''' Models for various kinds of arrow heads that can be added to
Arrow annotations.
'''
#-----------------------------------------------------------------------------
# Boilerplate
#-----------------------------------------------------------------------------
from __future__ import absolute_import, division, print_fu... | {
"content_hash": "be50e2d0918f625e57e588cf9630db9b",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 82,
"avg_line_length": 26.712,
"alnum_prop": 0.42917041030248576,
"repo_name": "stonebig/bokeh",
"id": "9d737ad17439a52a6b383a02c2e95b1d21b123b4",
"size": "3670",
"binar... |
from openstack_dashboard.test.integration_tests import helpers
from openstack_dashboard.test.integration_tests.regions import messages
class TestRouters(helpers.TestCase):
ROUTER_NAME = helpers.gen_random_resource_name("router")
@property
def routers_page(self):
return self.home_pg.go_to_network_... | {
"content_hash": "dc2b6b5adc5ecb9dcac2ff254ad53cf9",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 79,
"avg_line_length": 42.376288659793815,
"alnum_prop": 0.675830190974334,
"repo_name": "Mirantis/mos-horizon",
"id": "bb3cfef212ed0bbdeb54dc3b099cad86533c6f42",
"size": ... |
from mock import Mock, MagicMock
from trove.versions import BaseVersion
from trove.versions import Version
from trove.versions import VersionDataView
from trove.versions import VersionsAPI
from trove.versions import VersionsController
from trove.versions import VersionsDataView
from trove.versions import VERSIONS
from ... | {
"content_hash": "5605c117abd47ec51d956936025c3f15",
"timestamp": "",
"source": "github",
"line_count": 310,
"max_line_length": 77,
"avg_line_length": 39.148387096774194,
"alnum_prop": 0.5786090969017799,
"repo_name": "citrix-openstack/build-trove",
"id": "0c7f7c1d7afc5ce036b8c278d68b57a22b59ada0",
... |
"""Test class for common methods used by iLO modules."""
import os
import shutil
import tempfile
import mock
from oslo_config import cfg
from oslo_utils import importutils
import six
from ironic.common import boot_devices
from ironic.common import exception
from ironic.common import images
from ironic.common import ... | {
"content_hash": "a2d2bd7a96843e3d91754213a7d65828",
"timestamp": "",
"source": "github",
"line_count": 761,
"max_line_length": 79,
"avg_line_length": 49.35479632063075,
"alnum_prop": 0.5873692057829015,
"repo_name": "hpproliant/ironic",
"id": "c4692d57e6ee8e66b0502c7aca3cbfbf07a944e2",
"size": "38... |
'''
Some custom classes I wrote to make Tk buttons, lists etc. that look pretty. Mostly changes in font, colors, style, etc.
Notably different stuff is for example the button class below, which actually is subclassed from Tkinter's Text object.
'''
import Tkinter as tk
import tkFont
import string
FONT_FAMILY = 'Deja... | {
"content_hash": "7728a1774d26d0c59f77007fe4f148eb",
"timestamp": "",
"source": "github",
"line_count": 743,
"max_line_length": 163,
"avg_line_length": 25.9650067294751,
"alnum_prop": 0.5341592369894257,
"repo_name": "GregDMeyer/PWman",
"id": "73ecb3fcd364ce3caf120b25fda347faae21c76f",
"size": "192... |
"""
The delta between sequences of tokens is represented by a sequence of
:class:`~deltas.operations.Operation`. The goal of difference algorithms is to
detect a sequence of :class:`~deltas.operations.Operation` that has desirable
properties. :func:`~deltas.apply` can be used with a sequence of
:class:`~deltas.operat... | {
"content_hash": "fd6dd8f936b2be06745a0591b3f72e79",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 79,
"avg_line_length": 30.568627450980394,
"alnum_prop": 0.6128928800513149,
"repo_name": "yuvipanda/deltas",
"id": "ce20fd2758b8c873248a4d890273c5fe73abeb00",
"size": "31... |
import numpy as np
from PIL import Image, ImageDraw
from scipy import interpolate, ndimage, stats, signal, integrate, misc
from astropy.io import ascii, fits
from astropy.wcs import WCS
from astropy.coordinates import SkyCoord
import astropy.units as u
import astropy.constants as c
import corner as triangle # formerly... | {
"content_hash": "c9cfa6f5bc2eae727f41900cb7ba1956",
"timestamp": "",
"source": "github",
"line_count": 846,
"max_line_length": 116,
"avg_line_length": 31.00709219858156,
"alnum_prop": 0.5591262580054894,
"repo_name": "johnarban/arban",
"id": "7904e32998681c19d1931c5a6a712a8fc6b22f7e",
"size": "262... |
'''
Serves as a lightweight PostgreSQL DB interface for other modules in this
project.
'''
#############
## LOGGING ##
#############
import logging
from astrobase import log_sub, log_fmt, log_date_fmt
DEBUG = False
if DEBUG:
level = logging.DEBUG
else:
level = logging.INFO
LOGGER = logging.getLogger(__name_... | {
"content_hash": "8c1a52cb429638fa5a7c964bcbccff46",
"timestamp": "",
"source": "github",
"line_count": 387,
"max_line_length": 80,
"avg_line_length": 26.979328165374678,
"alnum_prop": 0.5612489225170003,
"repo_name": "waqasbhatti/astrobase",
"id": "a0ce135d2b62f0717313da2df635adbe278682d2",
"size"... |
"""Additional non-userprofile fields used during registration.
Currently supported: recaptcha
"""
from flask_babelex import gettext as _
from flask_wtf import FlaskForm, Recaptcha, RecaptchaField
from wtforms import FormField, HiddenField
class RegistrationFormRecaptcha(FlaskForm):
"""Form for editing user profi... | {
"content_hash": "99b493bf8b1277e3e27320f3d0d338a8",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 75,
"avg_line_length": 27.59016393442623,
"alnum_prop": 0.6565656565656566,
"repo_name": "inspirehep/invenio-accounts",
"id": "bb6217d3f5440fcf66fd765d0512ebdbf93e06c2",
"s... |
"""
pydbgp -d localhost:9000 script.py [args]
-d hostname:port to debug a script
-k ide_key a IDE key used with proxies
-p script.py preload and execute script before debugging
-m modules comma deliminated list of modules to ignore
during debug session
... | {
"content_hash": "24bd27b19a8f02527562b7229a7c0108",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 94,
"avg_line_length": 34.935483870967744,
"alnum_prop": 0.5462834718374885,
"repo_name": "f304646673/PhpDebugger",
"id": "a6e2e043ae891b4d025902aef97654a62847761e",
"size... |
import sys, os
doc_dir = os.path.dirname(os.path.abspath(__file__))
project_dir = os.path.dirname(doc_dir)
version_filename = os.path.join(project_dir, 'VERSION')
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to... | {
"content_hash": "5691b0e6bfdcdbf20f3447e9b6192642",
"timestamp": "",
"source": "github",
"line_count": 236,
"max_line_length": 80,
"avg_line_length": 32.07203389830509,
"alnum_prop": 0.7007530717399921,
"repo_name": "makinacorpus/ionyweb",
"id": "c9bbc33fe398fd720b208c72ae9225dea3973cd1",
"size": ... |
import copy
import fnmatch
import logging
import os
from pylib import android_commands
from pylib import cmd_helper
from pylib import constants
from pylib import ports
from pylib.base import shard
from pylib.utils import emulator
from pylib.utils import report_results
from pylib.utils import xvfb
import gtest_config
... | {
"content_hash": "46709c29698d061b903ba08206ff6cab",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 79,
"avg_line_length": 32.25688073394495,
"alnum_prop": 0.676052332195677,
"repo_name": "wangscript/libjingle-1",
"id": "a2598cfcb64efe7fac7b7208306dffb962d257ae",
"size":... |
import datetime
from taiga.requestmaker import RequestMaker, RequestMakerException
from taiga.models.base import InstanceResource, ListResource
from taiga.models import UserStory
from taiga import TaigaAPI
import taiga.exceptions
import json
import requests
import unittest
from mock import patch
from .tools import crea... | {
"content_hash": "dee844383dd39c27503c99b9449f4365",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 79,
"avg_line_length": 45.11904761904762,
"alnum_prop": 0.7097625329815304,
"repo_name": "astagi/exp-api",
"id": "5dbc933edfb6fe8033a6effc3898a496b991a1c1",
"size": "1895",... |
from gpu_tests.gpu_test_expectations import GpuTestExpectations
# See the GpuTestExpectations class for documentation.
class ContextLostExpectations(GpuTestExpectations):
def SetExpectations(self):
# Sample Usage:
# self.Fail('ContextLost.WebGLContextLostFromGPUProcessExit',
# ['mac', 'amd', ('nvidi... | {
"content_hash": "d5ca9991e522cf6ef9bf202e95b6c5fb",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 79,
"avg_line_length": 42.348837209302324,
"alnum_prop": 0.6798462383305875,
"repo_name": "axinging/chromium-crosswalk",
"id": "b2aaa0a7d60f875f43afccfb83419ec039b1904f",
"... |
"""test unused argument
"""
__revision__ = 1
def function(arg=1):
"""ignore arg"""
class AAAA(object):
"""dummy class"""
def method(self, arg):
"""dummy method"""
print self
def __init__(self, *unused_args, **unused_kwargs):
pass
@classmethod
def selected(cls, *args... | {
"content_hash": "6056407f155ac5da68d65d059c4182bf",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 73,
"avg_line_length": 27,
"alnum_prop": 0.5573622402890696,
"repo_name": "Titulacion-Sistemas/PythonTitulacion-EV",
"id": "333699c9d304d48a3c0b4b35777e280b4a4e5746",
"size... |
from django.contrib import admin
from django.conf import settings
from django.conf.urls import patterns, include, url
import fancypages.urls
from fancypages import views
from blog.views import PostDetailView, PostListView
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^$', views.HomeView.as_view()... | {
"content_hash": "03778b64182ed7f0c13f5671fd810d14",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 69,
"avg_line_length": 25.4,
"alnum_prop": 0.6509186351706037,
"repo_name": "socradev/django-fancypages",
"id": "34b2fcd3fa64159e856c3502f9114ba73d6b830a",
"size": "762",
... |
from django import http
from django.contrib.messages import constants, get_level, set_level, utils
from django.contrib.messages.api import MessageFailure
from django.contrib.messages.constants import DEFAULT_LEVELS
from django.contrib.messages.storage import base, default_storage
from django.contrib.messages.stora... | {
"content_hash": "1352b413a5e2cb862823074c2e6f988c",
"timestamp": "",
"source": "github",
"line_count": 383,
"max_line_length": 94,
"avg_line_length": 38.130548302872064,
"alnum_prop": 0.5892221309230348,
"repo_name": "yephper/django",
"id": "b27264e1b57f1b685938fd3391da56dcf7341d23",
"size": "1460... |
from __future__ import print_function
import argparse
import logging
from trekipsum import dialog, markov
logger = logging.getLogger(__name__)
def positive(value):
"""Type check value is a natural number (positive nonzero integer)."""
value = int(value)
if value < 1:
raise ValueError()
retu... | {
"content_hash": "1748c85d89cdc0e986018d2df955de25",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 88,
"avg_line_length": 35.53030303030303,
"alnum_prop": 0.6204690831556503,
"repo_name": "infinitewarp/trekipsum",
"id": "3e4985aca6e145558a9b724568d5cec585adf11a",
"size":... |
''' This module provides common classes and utilities for opencce. '''
##
## Copyright (c) 2015 Stephan Klein (@privatwolke)
##
## Permission is hereby granted, free of charge, to any person obtaining
## a copy of this software and associated documentation files (the "Software"),
## to deal in the Software without res... | {
"content_hash": "a0162948d4c7c1d412d585618ee0d7e5",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 89,
"avg_line_length": 28.86,
"alnum_prop": 0.7027027027027027,
"repo_name": "privatwolke/opencce",
"id": "04c8fbe772b6166292bb87934e011f22392dab9e",
"size": "2925",
"bi... |
import os
import json
from sendgrid import SendGridAPIClient
from sendgrid.helpers.mail import *
# NOTE: you will need move this file to the root
# directory of this project to execute properly.
def build_hello_email():
## Send a Single Email to a Single Recipient
message = Mail(from_email=From('from@... | {
"content_hash": "657770e9a230d31840f8fa11448cb9c9",
"timestamp": "",
"source": "github",
"line_count": 382,
"max_line_length": 126,
"avg_line_length": 37.845549738219894,
"alnum_prop": 0.6433561596458462,
"repo_name": "sendgrid/sendgrid-python",
"id": "f6905787b1dbcf441e626b9b3de7c97719f681cc",
"s... |
"""
logtools._parse
Log format parsing programmatic and command-line utilities.
uses the logtools.parsers module
"""
import os
import re
import sys
import logging
from itertools import imap
from operator import and_
from optparse import OptionParser
import logtools.parsers
from _config import logtools_config, interpol... | {
"content_hash": "bc3708dd8595df9c9cb1e120b5dcbdc5",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 111,
"avg_line_length": 39.886792452830186,
"alnum_prop": 0.5986281929990539,
"repo_name": "shutterfly/logtools",
"id": "f3078db3382bbae39ac76bfd699d58d44f3447e1",
"size":... |
from django.conf.urls import *
from manabi.apps.subscriptions import api_views
urlpatterns = [
url(r'^purchasing_options/$', api_views.purchasing_options),
url(r'^manabi_reader_purchasing_options/$',
api_views.manabi_reader_purchasing_options),
url(r'^subscription_status/$', api_views.subscriptio... | {
"content_hash": "d1c99546cbd77eb4a6431e39386dd21b",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 67,
"avg_line_length": 35.46666666666667,
"alnum_prop": 0.6992481203007519,
"repo_name": "aehlke/manabi",
"id": "226523aa467dff9879848482002f9b01a6db448a",
"size": "532",
... |
from django.db import models
class Student(models.Model):
name = models.CharField(max_length=100)
| {
"content_hash": "4bebedf79c9ff6a701e3a361435c68e5",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 43,
"avg_line_length": 25.75,
"alnum_prop": 0.7572815533980582,
"repo_name": "agiliq/Django-parsley",
"id": "76d5e598818cdca6616f1279baad66ed1aa8c691",
"size": "146",
"bin... |
from django.conf.urls.defaults import patterns, url
import django.views.generic as gen_views
from main.models import *
urlpatterns = patterns('',
url(r'^$', 'main.views.home', name = 'home'),
)
| {
"content_hash": "3647a9b8bcf15e2cff698c75e01bbfee",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 51,
"avg_line_length": 33.166666666666664,
"alnum_prop": 0.7085427135678392,
"repo_name": "micrypt/django-valuate",
"id": "ac1c6b4cde54646ac696d8364d95964caa8a2f0a",
"size":... |
import unittest
from unittest import TestCase, mock
import vcr
from shapes import Rectangle, Cylinder
from twitter import list_twitter_repos
class RectangleTestCase(TestCase):
def setUp(self):
self.rectangle = Rectangle(width=7, height=8)
def test_rectangle_area(self):
"""
Test tha... | {
"content_hash": "79716d7578344be2d170878eddcf470d",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 68,
"avg_line_length": 24.304347826086957,
"alnum_prop": 0.6453488372093024,
"repo_name": "kevinharvey/the-testers-toolkit",
"id": "dcce2135425a26e9f8aa914906dadf6830c7cd3f",... |
"""Abstract class for collective groups."""
from abc import ABCMeta
from abc import abstractmethod
from ray.util.collective.types import AllReduceOptions, BarrierOptions, \
ReduceOptions, AllGatherOptions, BroadcastOptions, ReduceScatterOptions
class BaseGroup(metaclass=ABCMeta):
def __init__(self, world_siz... | {
"content_hash": "5762df5d74d2aa7e365f94b2c504643b",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 75,
"avg_line_length": 29,
"alnum_prop": 0.6291000841042893,
"repo_name": "pcmoritz/ray-1",
"id": "5289c562f22e7d4677c957c0ebf9cd60ef81bcba",
"size": "2378",
"binary": fa... |
import cv2
import numpy as np
import PostProcessing
from abc import ABCMeta, abstractmethod
"""
Author: Luqman A. M.
BackgroundSubtraction.py
Background Subtraction Algorithms Object Detection in Video Processing (Abstract Class)
Frame Difference, Running Average, Median, Online K-Means, 1-G, KDE
"""
class Backgroun... | {
"content_hash": "b6bd926cf9e7ba87b5e5de7ba90b8761",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 87,
"avg_line_length": 31.81111111111111,
"alnum_prop": 0.5602514844568635,
"repo_name": "umanium/trafficmon",
"id": "6b62dc88cb76c077e0352a84b61faf173329dac8",
"size": "28... |
"""Out of sample prediction
"""
import numpy as np
import statsmodels.api as sm
#Create some data
nsample = 50
sig = 0.25
x1 = np.linspace(0, 20, nsample)
X = np.c_[x1, np.sin(x1), (x1 - 5)**2, np.ones(nsample)]
beta = [0.5, 0.5, -0.02, 5.]
y_true = np.dot(X, beta)
y = y_true + sig * np.random.normal(size=nsample)
... | {
"content_hash": "fbe3b04548b1bbb23c6a25ac28e3dff0",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 78,
"avg_line_length": 24.275,
"alnum_prop": 0.678681771369722,
"repo_name": "yarikoptic/pystatsmodels",
"id": "b41504aaa782cab69ad0cab9e5b4f0cec5c5ae2a",
"size": "995",
... |
from __future__ import print_function
import os
from catkin.workspace import get_source_paths, get_workspaces
from catkin_pkg.packages import find_packages
def _get_valid_search_dirs(search_dirs, project):
"""
Compare param collection of search dirs with valid names, raises ValueError if invalid.
Main... | {
"content_hash": "68c37e371020be70dd45b5d8bad08042",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 231,
"avg_line_length": 47.75,
"alnum_prop": 0.612565445026178,
"repo_name": "ros/catkin",
"id": "ff796aa58e38ed882b9d1fdeb16a91b63c7fe1fa",
"size": "8290",
"binary": fa... |
import unittest
import random
import string
import functools
import sys
from bond_python_unit_test import Serialize, Deserialize, Marshal, Unmarshal, GetRuntimeSchema
import bond_python_unit_test as test
def atleast_python3():
return sys.version_info[0] >= 3
def random_string():
return ''.join(random.sample(s... | {
"content_hash": "6331c92a3fc083a46a69a329315655eb",
"timestamp": "",
"source": "github",
"line_count": 391,
"max_line_length": 94,
"avg_line_length": 36.8235294117647,
"alnum_prop": 0.6068898458119183,
"repo_name": "upsoft/bond",
"id": "7e47e9cc6e03a666278b15687768a3dc24a1f487",
"size": "14398",
... |
import numpy as np
from ..mbase import BaseModel
from ..pakbase import Package
from .mpsim import ModpathSim
from .mpbas import ModpathBas
import os
class ModpathList(Package):
"""
List package class
"""
def __init__(self, model, extension="list", listunit=7):
"""
Package constructor.... | {
"content_hash": "7e85abb2187f38d33b522e688207a886",
"timestamp": "",
"source": "github",
"line_count": 477,
"max_line_length": 107,
"avg_line_length": 35.38993710691824,
"alnum_prop": 0.45962916888809907,
"repo_name": "aleaf/flopy",
"id": "68b5199ec318dfa32f9f72cd90f5286103c77c76",
"size": "16881"... |
import os
from unittest import TestCase
from ..v2 import extract, get_parent_xpaths_and_textnodes, get_xpath_frequencydistribution
# Testdata file declarations
RE_SPLIT_VARIOUS_ENDINGS_FILENAME = os.path.join(os.path.dirname(__file__),'assets/regex_various_endings.html')
RE_SPLIT_DOT_ENDINGS_FILENAME = os.path... | {
"content_hash": "047beb2d2b3e27cf77e53b6594c39d9c",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 111,
"avg_line_length": 37.945945945945944,
"alnum_prop": 0.6517094017094017,
"repo_name": "rodricios/eatiht",
"id": "fad952683861d57e4428ae7bfe77227224402536",
"size": "14... |
from recipe_engine import recipe_api
INFRA_GO_PKG = 'go.skia.org/infra'
UPDATE_GO_ATTEMPTS = 5
UPLOAD_ATTEMPTS = 5
class InfraApi(recipe_api.RecipeApi):
@property
def goroot(self):
return self.m.vars.slave_dir.join('go', 'go')
@property
def go_bin(self):
return self.goroot.join('bin')
@property
... | {
"content_hash": "261de2611ca6e6ae429d2312aa9652cd",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 73,
"avg_line_length": 22.6,
"alnum_prop": 0.6209439528023599,
"repo_name": "endlessm/chromium-browser",
"id": "4af29ee18edd8552e347a2437e29a7c71ddf4587",
"size": "842",
... |
from rogerthat.dal.service import get_service_api_callback_records_query
from google.appengine.ext import db, deferred
def run(service_user, cursor=None):
query = get_service_api_callback_records_query(service_user)
query.with_cursor(cursor)
records = query.fetch(100)
put = list()
for rec in reco... | {
"content_hash": "4a20f900c8a8e9220e407f3b55753d3c",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 103,
"avg_line_length": 31.88235294117647,
"alnum_prop": 0.6900369003690037,
"repo_name": "rogerthat-platform/rogerthat-backend",
"id": "53fef1f8090736398f6bcbb6ab59451ca9f17... |
import numpy as np
from numba import cuda
from numba.cuda.testing import unittest, CUDATestCase
class TestCudaEvent(CUDATestCase):
def test_event_elapsed(self):
N = 32
dary = cuda.device_array(N, dtype=np.double)
evtstart = cuda.event()
evtend = cuda.event()
evtstart.recor... | {
"content_hash": "420de76b5bbd729aef55e1d57908a3c1",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 77,
"avg_line_length": 29.027027027027028,
"alnum_prop": 0.6126629422718808,
"repo_name": "sklam/numba",
"id": "c0927cae923e8bd015e24fb44941b565731b8a6c",
"size": "1074",
... |
"""
Utility functions related to strings.
"""
import random
import re
import string
import six
if six.PY2:
uppercase = string.uppercase
else:
uppercase = string.ascii_uppercase
def random_string(length, charset):
"""
Return a random string of the given length from the
given character set.
... | {
"content_hash": "e76a780a3e650323ef823b8a7d1a61fc",
"timestamp": "",
"source": "github",
"line_count": 456,
"max_line_length": 71,
"avg_line_length": 24.42324561403509,
"alnum_prop": 0.5647840531561462,
"repo_name": "cloudboss/friend",
"id": "a3fc6008297963b61cc421b78bd8aa168ec90baa",
"size": "122... |
import time
import serial
import wikiRead
# Create Serial object
port = 'COM5'
baudrate = 9600
ser = serial.Serial(port, baudrate, timeout = 1)
print('Trying to open serial communication on ' + ser.name)
# Make sure Serial port is open and give it time to reset the connection
if ser.isOpen():
time.sleep(3)
p... | {
"content_hash": "1ba77b45b8e181fea7537e8cb1c0dd49",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 72,
"avg_line_length": 21.56,
"alnum_prop": 0.7179962894248608,
"repo_name": "spencer501/dxarts_470_su17",
"id": "8e894e45135210d457a0f3bac48115fc25ee7953",
"size": "539",
... |
import fcntl
import logging
import logging.handlers
import os
import random
import time
import threading
_lock = threading.RLock()
class TimedRotatingFileHandlerSafe(logging.handlers.TimedRotatingFileHandler):
def __init__(self, filename, when='midnight', backupCount=30, **kwargs):
super(TimedRotatingFi... | {
"content_hash": "5734787537d23cfd1db2cc10ccd2876f",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 114,
"avg_line_length": 38.6605504587156,
"alnum_prop": 0.5811580446131941,
"repo_name": "cybergrind/safe_logger",
"id": "dc97230f085246356d1c91d3f646d8122ccf996c",
"size"... |
from django.contrib.auth.models import AnonymousUser, User
from django.test import TestCase, RequestFactory
from user_profile.views import profile,user_profile,update_profile
from user_profile.models import Profile
from django.contrib.sessions.middleware import SessionMiddleware
#https://lorinstechblog.wordpress.com/... | {
"content_hash": "b70780e33d2af7b1ea3947dc0eda921c",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 114,
"avg_line_length": 40.1437908496732,
"alnum_prop": 0.6608596548355584,
"repo_name": "grepme/cmput410-project",
"id": "18bbd82450a5c47ba4ddb28e40bc01fbf2b8ebca",
"size... |
from django import template
from apps.content.models import Article
register = template.Library()
@register.assignment_tag
def get_latest_articles(limit=5):
try:
limit = int(limit)
except ValueError:
limit = 5
articles = Article.objects.filter(status__is_live=True).order_by('-publish_da... | {
"content_hash": "d58aadfed9a91dabd612695af39bfceb",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 93,
"avg_line_length": 22.0625,
"alnum_prop": 0.6997167138810199,
"repo_name": "zniper/automag",
"id": "fb7f992bbf92aa880f757fddf61ccc7c62bfb871",
"size": "353",
"binary"... |
"""
.. module:: utilities
:platform: Unix
:synopsis: the top-level submodule of Dragonfire that holds the custom exceptions.
.. moduleauthor:: Mehmet Mert Yıldıran <mert.yildiran@bil.omu.edu.tr>
"""
class WikipediaNoResultsFoundError(Exception):
def __init__(self, message = "", errors = None):
sup... | {
"content_hash": "4150181c805664049e84e15d7c4ad08d",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 86,
"avg_line_length": 30.916666666666668,
"alnum_prop": 0.6738544474393531,
"repo_name": "mertyildiran/Dragonfire",
"id": "a42f961b75a742cb685680a252c808a5b5eaa11d",
"size... |
import re
import os
import httplib
from libsinan import encoder, output
class Handler:
DEFAULT_VALIDATOR = re.compile('\w+')
def ask_user(self, prompt, default = None, regexp = DEFAULT_VALIDATOR):
if default:
prompt += ' [default ' + default + ']'
prompt = prompt + "> "
... | {
"content_hash": "7aee82b5e52bad0bf8698ea33803f6e6",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 76,
"avg_line_length": 29.359375,
"alnum_prop": 0.5657264502394891,
"repo_name": "asceth/sinan",
"id": "b5fa3532a6ccbade23ca68809632dd6eddddb0df",
"size": "1879",
"binary... |
import sys, os, stat
from setuptools import setup
from setuptools.command.install import install
from distutils import log
import speech_recognition
if sys.version_info < (2, 6):
print("THIS MODULE REQUIRES PYTHON 2.6, 2.7, OR 3.3+. YOU ARE CURRENTLY USING PYTHON {0}".format(sys.version))
sys.exit(1)
FILES_... | {
"content_hash": "6cc4f4ee5ee5cf773f917b7284efe690",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 129,
"avg_line_length": 41.484848484848484,
"alnum_prop": 0.6154127100073046,
"repo_name": "smeeklai/masterThesis",
"id": "e9954f0378833053c93c7c2b85f20c9cc98d1414",
"size"... |
import random
from .wordlists import WordLists as WL
class SentenceSlug:
@classmethod
def makeslug(cls, digits=0, simple=False, delimiter=""):
adjective = WL.randomAdjective().title()
noun = WL.randomNoun().title()
if not simple:
verb = WL.randomVerb().title()
... | {
"content_hash": "345306a383c199afb8c2829ad78883cf",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 85,
"avg_line_length": 30.482142857142858,
"alnum_prop": 0.5887521968365553,
"repo_name": "jef79m/sentenceslug",
"id": "a16e4a0dff8658717c158d1c0a78b0286ef59c41",
"size": "... |
import logging
import sys
import tweepy
import ConfigParser
import urllib
import xml.etree.ElementTree as ET
import random
import time
import datetime
from tweepy.auth import OAuthHandler
from tweepy.api import API
from ConfigParser import NoSectionError, NoOptionError
from urllib2 import urlopen, URLError
import ywc... | {
"content_hash": "ad1609901704be2f30c3627f77b1d462",
"timestamp": "",
"source": "github",
"line_count": 275,
"max_line_length": 224,
"avg_line_length": 36.6,
"alnum_prop": 0.5855936413313463,
"repo_name": "ericoporto/Chove-Agora",
"id": "02747aeb1680165270c7ba1b329b5d7242d375a1",
"size": "10096",
... |
from robot_bases import XmlBasedRobot, MJCFBasedRobot, URDFBasedRobot
import numpy as np
import pybullet
import os
import pybullet_data
from robot_bases import BodyPart
class WalkerBase(MJCFBasedRobot):
def __init__(self, fn, robot_name, action_dim, obs_dim, power):
MJCFBasedRobot.__init__(self, fn, robot_name... | {
"content_hash": "fb2c7b36ec0b7c199c64cab693b651c8",
"timestamp": "",
"source": "github",
"line_count": 344,
"max_line_length": 152,
"avg_line_length": 40.20639534883721,
"alnum_prop": 0.6175258477333526,
"repo_name": "MTASZTAKI/ApertusVR",
"id": "43ff604ac6bdc76005caa53219f315aff935c0ab",
"size": ... |
"""Gradient tape utilites."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import contextlib
from tensorflow.python import pywrap_tensorflow
from tensorflow.python.util.lazy_loader import LazyLoader
# There is a circular dependency between this, ops.py... | {
"content_hash": "95c5e307325d9379c1729826cbf99f89",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 99,
"avg_line_length": 30.916030534351144,
"alnum_prop": 0.7283950617283951,
"repo_name": "jendap/tensorflow",
"id": "e5d6007b4892a739ed12e072738208880736ff23",
"size": "4... |
import unittest
from telemetry.core.timeline import event
class TimelineEventTest(unittest.TestCase):
def testChildrenLogic(self):
# [ top ]
# [ a ] [ b ]
# [x]
top = event.TimelineEvent('top', 0, 10)
a = event.TimelineEvent('a', 1, 2)
x = event.TimelineEvent('x', 1.... | {
"content_hash": "2b2f6c3fc10c360daacf7d7d01697a74",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 65,
"avg_line_length": 30.043478260869566,
"alnum_prop": 0.6164978292329957,
"repo_name": "espadrine/opera",
"id": "7c965f0bb6fca620e4f75de77c08b5d38380dddd",
"size": "858"... |
"""Wrapper functions for the f5-sdk network config"""
import logging
try:
from urllib import quote
except ImportError:
from urllib.parse import quote
LOGGER = logging.getLogger(__name__)
class PartitionNameError(Exception):
"""Exception type for F5 resource name."""
def __init__(self, msg):
... | {
"content_hash": "59e3fe5c7cccaf45c5622d4378a6b5b9",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 75,
"avg_line_length": 32.1744966442953,
"alnum_prop": 0.6070087609511889,
"repo_name": "richbrowne/f5-cccl",
"id": "8c013c4e38c50c6a6dfc326d95d7f5307fd04b45",
"size": "53... |
from .common import BaseTest
from c7n.provider import clouds
from c7n.exceptions import PolicyValidationError
from c7n.executor import MainThreadExecutor
from c7n.utils import local_session
from c7n.resources import account
from c7n.testing import mock_datetime_now
import datetime
from dateutil import parser
import js... | {
"content_hash": "dda099f76c2c09e4bb729644021d85ad",
"timestamp": "",
"source": "github",
"line_count": 1170,
"max_line_length": 99,
"avg_line_length": 36.276923076923076,
"alnum_prop": 0.4819291301479597,
"repo_name": "capitalone/cloud-custodian",
"id": "41bac555b7b1e6376f47080c7b5c6bccdb282cb4",
... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from textwrap import dedent
from pants.util.contextutil import temporary_dir
from pants_test.pants_run_integration_test import PantsRunIntegrationTest, ensu... | {
"content_hash": "4fa951645cef8bc171c0b7586511e631",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 99,
"avg_line_length": 41.8,
"alnum_prop": 0.605389070763032,
"repo_name": "areitz/pants",
"id": "2d71071841b051b647525e31427e13301b6e9c92",
"size": "4118",
"binary": fal... |
"""
Routines and classes for supporting and expressing IP address ranges using a
glob style syntax.
"""
from netaddr.core import AddrFormatError, AddrConversionError
from netaddr.ip import IPRange, IPAddress, IPNetwork, iprange_to_cidrs
from netaddr.compat import _is_str
def valid_glob(ipglob):
"""
:param ip... | {
"content_hash": "339c6f3610c9ce99ac3da4508654e82d",
"timestamp": "",
"source": "github",
"line_count": 307,
"max_line_length": 81,
"avg_line_length": 33.14657980456026,
"alnum_prop": 0.5390133647798742,
"repo_name": "braaen/netaddr",
"id": "2c6147f2f88cc650eb02631dc7ce4330f5c1677f",
"size": "10474... |
'''
@author: moloch
Copyright 2013
--------------------------------------------
Custom exception we throw when validating model data
'''
class ValidationError(Exception):
''' Maybe extend this later '''
def __init__(self, message):
Exception.__init__(self, message)
| {
"content_hash": "b3a61e97677e41ff0117857823f0ab60",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 52,
"avg_line_length": 16.333333333333332,
"alnum_prop": 0.5476190476190477,
"repo_name": "sigma-random/RootTheBox",
"id": "e9c003548695bfc5054a27130b5343ec6a7bdff5",
"size... |
from chainer import backend
from chainer import function_node
import chainer.functions
from chainer.utils import type_check
def _broadcast_to(xp, x, shape):
# xp: numpy, cupy, or chainer.functions
if hasattr(xp, 'broadcast_to'):
return xp.broadcast_to(x, shape)
else:
# numpy 1.9 doesn't su... | {
"content_hash": "935124812427d871ea8c88abc177687c",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 71,
"avg_line_length": 31.130434782608695,
"alnum_prop": 0.5662011173184358,
"repo_name": "ktnyt/chainer",
"id": "bfbb3d332b7db17478032a39d2e014b551431919",
"size": "3580"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.