text stringlengths 4 1.02M | meta dict |
|---|---|
import json
import os
import praw
import urllib.request
class RedditScraper():
def __init__(self, output_folder="output"):
self.check_words = ['jpg']
self.output_folder = output_folder
credFile = open('credentials.json', 'r+')
credentials = json.load(credFile)
... | {
"content_hash": "20031917f984fe880246a480d55ede72",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 107,
"avg_line_length": 37.471698113207545,
"alnum_prop": 0.5478348439073515,
"repo_name": "debkbanerji/super-mem",
"id": "50a54da96a96b3c4ed4681245adedc846b319192",
"size"... |
"""
Salt Edge Account Information API
API Reference for services # noqa: E501
OpenAPI spec version: 5.0.0
Contact: support@saltedge.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class DuplicateTransactionsRequestBody(o... | {
"content_hash": "fe1f3bce90ccb22b780265bf1d37b325",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 90,
"avg_line_length": 30.431192660550458,
"alnum_prop": 0.5688875489900512,
"repo_name": "ltowarek/budget-supervisor",
"id": "efad15c3dc869d8455de41244ff6e6e0a2483014",
"... |
__author__ = 'Taio'
import json, collections
tree = lambda: collections.defaultdict(tree)
root = tree()
root['menu']['id'] = 'file'
root['menu']['value'] = 'File'
root['menu']['menuitems']['new']['value'] = 'New'
root['menu']['menuitems']['new']['onclick'] = 'new();'
root['menu']['menuitems']['open']['value'] = 'Ope... | {
"content_hash": "1db3ed4b6a04ed8a854798c584ffb5bb",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 72,
"avg_line_length": 35.375,
"alnum_prop": 0.598939929328622,
"repo_name": "jiasir/python-examples",
"id": "49d11b66d6f1b175f94090ed798db2255fbd6afd",
"size": "566",
"b... |
import requests
from spyjam import settings
import os
class ImageDownloadPipeline(object):
def process_item(self, item, spider):
if 'image_urls' in item:
images = []
dir_path = '%s/%s' % (settings.IMAGES_STORE, spider.name)
if not os.path.exists(dir_path):
... | {
"content_hash": "a9667bb048bc23d84c20bddfd21376b0",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 69,
"avg_line_length": 33.16129032258065,
"alnum_prop": 0.4883268482490272,
"repo_name": "ttslj/spyjam",
"id": "a32c8c5ce9a9ddb32a68df06f60d7586612524f2",
"size": "1222",
... |
"""Generate CloudPrint Proxy Config File.
Given a Google Account email and password, generates a config file for the
CloudPrint proxy to use. For instructions on how to use this file, see:
"Install Google Cloud Print on a Linux server"
http://support.google.com/chromeos/a/bin/answer.py?&answer=2616503.
"""
import get... | {
"content_hash": "fef3b04755e102fab86782287ae2b440",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 84,
"avg_line_length": 26.123595505617978,
"alnum_prop": 0.5995698924731183,
"repo_name": "amacie/cups-cloud-print",
"id": "3d04646a3e7c0de1ad8c8cdd8a4417f0522e3fa1",
"size... |
"""
install_examples.py
Dialogs that installs scripts to a desired directory. Simple front end to
sfc_models.examples.install_example_scripts
Migrated to sfc_models.examples
License/Disclaimer
------------------
Copyright 2017 Brian Romanchuk
Licensed under the Apache License, Version 2.0 (the "License");
you may... | {
"content_hash": "44a6c96091f8abd6b7e703a2018ab515",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 161,
"avg_line_length": 31.33823529411765,
"alnum_prop": 0.7301736274049742,
"repo_name": "brianr747/sfc_gui",
"id": "dbd7f75334f9c3cc0d1c327fac2a0721b4c93e8a",
"size": "21... |
from mpi4py import MPI
import mpiunittest as unittest
_basic = [
None,
True, False,
-7, 0, 7, 2**31,
-2**63+1, 2**63-1,
-2.17, 0.0, 3.14,
1+2j, 2-3j,
'mpi4py',
]
messages = list(_basic)
messages += [
list(_basic),
tuple(_basic),
dict((f'k{k}', v) for k, v in enumerate(_basic)),
... | {
"content_hash": "f0728f4f377e18647e7db2dac6293ced",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 64,
"avg_line_length": 27.133858267716537,
"alnum_prop": 0.5856065002901916,
"repo_name": "mpi4py/mpi4py",
"id": "b57b5173ed60da89cd1b5cf9782380a3dda9c49c",
"size": "3446"... |
from twilio.rest import TwilioRestClient
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)
call = client.calls.create(
url="http://demo.twilio.com/docs/voice.xml",
... | {
"content_hash": "e721e7cbfb14bb29b7403d254b7d4c0a",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 68,
"avg_line_length": 32.76470588235294,
"alnum_prop": 0.718132854578097,
"repo_name": "teoreteetik/api-snippets",
"id": "d514f6cca2b4f73f164fa1672266370910d838cd",
"size"... |
import copy
import mock
from oslo.serialization import jsonutils
import webob
from nova.api.openstack.compute import image_metadata
from nova.api.openstack.compute.plugins.v3 import image_metadata \
as image_metadata_v21
from nova import exception
from nova import test
from nova.tests.unit.api.openstack import f... | {
"content_hash": "d66eacd095fd269f1720725db383643b",
"timestamp": "",
"source": "github",
"line_count": 361,
"max_line_length": 79,
"avg_line_length": 44.75623268698061,
"alnum_prop": 0.5993068020053228,
"repo_name": "shakamunyi/nova",
"id": "8eac0d65f3cc4779afe3a84c946ebd92b2914ec8",
"size": "1679... |
"""A component that allows one to place colored and scaled glyphs at
input point data.
"""
# Author: Prabhu Ramachandran <prabhu_r@users.sf.net>
# KK Rai (kk.rai [at] iitb.ac.in)
# R. Ambareesha (ambareesha [at] iitb.ac.in)
# Copyright (c) 2005-2007, Enthought, Inc.
# License: BSD Style.
# Enthought li... | {
"content_hash": "309b199e2a20e74d80fb120cffa733cc",
"timestamp": "",
"source": "github",
"line_count": 289,
"max_line_length": 88,
"avg_line_length": 38.50865051903114,
"alnum_prop": 0.5163087429238925,
"repo_name": "alexandreleroux/mayavi",
"id": "904301031539336632715e16f8d6533afd1b45ab",
"size"... |
from pycast.common.timeseries import TimeSeries
from pycast.common.pycastobject import PyCastObject
class BaseMethod(PyCastObject):
"""Baseclass for all smoothing and forecasting methods."""
_interval_definitions = { True: ["[", "]"], False: ["(", ")"]}
def __init__(self, requiredParameters=None, hasToB... | {
"content_hash": "040ef4f19a7b8663ec57e9e8c754fd70",
"timestamp": "",
"source": "github",
"line_count": 298,
"max_line_length": 141,
"avg_line_length": 40.513422818791945,
"alnum_prop": 0.6399403627930091,
"repo_name": "T-002/pycast",
"id": "03e67368e4f17956d62778dfda2458caea41dbcd",
"size": "13226... |
"""Commands for the peristaltic pump"""
import math
from typing import Optional, Any
from PyQt5 import QtCore
from PyQt5.QtCore import pyqtSignal as Signal, pyqtSlot as Slot
import time
import logging
from .command import Command, InstantCommand
from .commandargument import FloatArgument, StringArgument, IntArgument
... | {
"content_hash": "d1603d591b7098880e5306cc3cc9b2be",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 122,
"avg_line_length": 43.26470588235294,
"alnum_prop": 0.6274643099932019,
"repo_name": "awacha/cct",
"id": "f4b3da230cd7fca68f928a180ac3d23225d00d10",
"size": "7372",
... |
def myblock(tw, x): # ignore second argument
''' Load journal stats to heap (Sugar only) '''
import os
import glob
_DIROFINTEREST = 'datastore'
class ParseJournal():
''' Simple parser of datastore for turtle art entries '''
def __init__(self):
self._score = []
... | {
"content_hash": "5e273394c41dbb3ecc5fb108259ca335",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 79,
"avg_line_length": 42.63225806451613,
"alnum_prop": 0.47866222760290555,
"repo_name": "walterbender/turtleartmini",
"id": "9a80c046968ef86927b17e69bc6acdeb76e6dd86",
"... |
"""
Module to set up run time parameters for Clawpack.
The values set in the function setrun are then written out to data files
that will be read in by the Fortran code.
"""
import os
import numpy as np
#------------------------------
def setrun(claw_pkg='geoclaw'):
#------------------------------
"""
Def... | {
"content_hash": "8af9ff9f5dcd099a5c4e7a90b43416a0",
"timestamp": "",
"source": "github",
"line_count": 404,
"max_line_length": 92,
"avg_line_length": 30.923267326732674,
"alnum_prop": 0.5960938125350196,
"repo_name": "xinshengqin/tsunami_benchmarks",
"id": "d648faa3865b7453cd1a8916b5732a4b2cf57513",... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Job',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=Fal... | {
"content_hash": "1aa2ca77a8600739d7669509ab91b6af",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 198,
"avg_line_length": 47.291666666666664,
"alnum_prop": 0.5533039647577093,
"repo_name": "gpjt/jobsboard",
"id": "664a30610514e43b5b75e726be74006ab85ea287",
"size": "2294... |
import mock
from oslo.serialization import jsonutils
import webob
from cinder import context
from cinder import exception
from cinder import test
from cinder.tests.api import fakes
# This list of fake volumes is used by our tests. Each is configured in a
# slightly different way, and includes only the properties th... | {
"content_hash": "9b321c9d31b98f05380ec553988177ba",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 79,
"avg_line_length": 39.94444444444444,
"alnum_prop": 0.6110917941585535,
"repo_name": "hguemar/cinder",
"id": "c80c00d48af0320af4412abe02018f795f6608ee",
"size": "6346"... |
from django.conf import settings
from experiments.models import Experiment
from modeldict import ModelDict
class LazyAutoCreate(object):
"""
A lazy version of the setting is used so that tests can change the setting and still work
"""
def __nonzero__(self):
return self.__bool__()
def __bo... | {
"content_hash": "6af43983d4e56a21ed5d825ef16a2d83",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 123,
"avg_line_length": 30.846153846153847,
"alnum_prop": 0.6870324189526185,
"repo_name": "mixcloud/django-experiments",
"id": "f0807d696000c4c8bc23b1d442081f8d6c747eb4",
... |
"""
Support for ``typing`` py3.9+ features while min version is py3.8.
"""
from typing import * # noqa: F401
try: # py 3.9+
from typing import Annotated
except (ImportError, ModuleNotFoundError): # optional dependency
try:
from typing_extensions import Annotated
except (ImportError, ModuleNotFo... | {
"content_hash": "c4ac014c03541971d1ea41ffa3b77c57",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 66,
"avg_line_length": 26.31578947368421,
"alnum_prop": 0.696,
"repo_name": "larrybradley/astropy",
"id": "9ae93becf632de0b25949d8aa0e974f2080c44f7",
"size": "564",
"bina... |
import threading
import mock
import netaddr
from neutron_lib.api.definitions import floating_ip_port_forwarding as apidef
from neutron_lib.callbacks import exceptions as c_exc
from neutron_lib import exceptions as lib_exc
from neutron_lib.exceptions import l3 as lib_l3_exc
from oslo_utils import uuidutils
from six.mov... | {
"content_hash": "7433c1b5745de5a506006f2a6819bc49",
"timestamp": "",
"source": "github",
"line_count": 375,
"max_line_length": 79,
"avg_line_length": 44.157333333333334,
"alnum_prop": 0.5648891841294764,
"repo_name": "huntxu/neutron",
"id": "7ff316916706003e024ca2836b778e1da2b29fc7",
"size": "1713... |
import pygame
import screens.credits as credits
import screens.highscores as highscores
import screens.settings as settings
import screens.experience as exp
import screens.instructions as instructions
import screens.sound as sound
import screens.termination as termination
class MainScreen:
def __init__(self, canv... | {
"content_hash": "953a9c47848cd388da1a8b3a0901ffa7",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 97,
"avg_line_length": 42.53703703703704,
"alnum_prop": 0.6060078363082281,
"repo_name": "sinoz/boat-wars",
"id": "146935af1b88fa7bfcd13563734cfba1d7ae1aa6",
"size": "2297"... |
import unittest
from ctree.jit import *
from ctree import CONFIG
from fixtures.sample_asts import *
import ctypes
from ctree.transformations import PyBasicConversions
class TestTranslator(LazySpecializedFunction):
def args_to_subconfig(self, args):
return {'arg_typesig': tuple(type(get_ctype(a)) for a in ... | {
"content_hash": "54aada9940b03a7708d388e6f24ee4a1",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 112,
"avg_line_length": 40.132075471698116,
"alnum_prop": 0.5937940761636107,
"repo_name": "ucb-sejits/ctree",
"id": "f4d452ac5c25d5022a7634794ec49181218db2ac",
"size": "4... |
"""
TCP support for IOCP reactor
"""
import socket, operator, errno, struct
from zope.interface import implements, classImplements
from twisted.internet import interfaces, error, address, main, defer
from twisted.internet.abstract import _LogOwner, isIPAddress, isIPv6Address
from twisted.internet.tcp import _SocketC... | {
"content_hash": "1e2c44486092ddee45ce3cc347cd46b8",
"timestamp": "",
"source": "github",
"line_count": 575,
"max_line_length": 83,
"avg_line_length": 31.63478260869565,
"alnum_prop": 0.5960417811984607,
"repo_name": "normanmaurer/autobahntestsuite-maven-plugin",
"id": "d34f698d9a5d07038a96f6ddd10d26... |
""" Ontology attributes
:Author: Jonathan Karr <karr@mssm.edu>
:Date: 2019-01-14
:Copyright: 2019, Karr Lab
:License: MIT
"""
from . import core
import pronto
import wc_utils.workbook.io
import wc_utils.util.ontology
class OntologyAttribute(core.LiteralAttribute):
""" Ontology attribute
Attributes:
... | {
"content_hash": "6d7ce84ec931480c7569013465fb27f4",
"timestamp": "",
"source": "github",
"line_count": 285,
"max_line_length": 131,
"avg_line_length": 40.31578947368421,
"alnum_prop": 0.5732811140121845,
"repo_name": "KarrLab/obj_model",
"id": "407293c7ebbbc20398a31fed243ccccd2c5c93f8",
"size": "1... |
'''
Routines for outputting latex.
David Duvenaud
Nov 2012
'''
from datetime import datetime
def clean(string):
'''Prepare a string for latex'''
return string.replace('_', '').strip('1234567890')
def table(filename, rownames, colnames, entries, label=None):
if label == None:
label = filenam... | {
"content_hash": "1e39993e0373383041ae1e9ca6325890",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 73,
"avg_line_length": 30.291666666666668,
"alnum_prop": 0.5316368638239339,
"repo_name": "jamesrobertlloyd/gp-structure-search",
"id": "e2b61ca29e914eda618d24ff9a03354c2e45c... |
"""Build a language detector model
The goal of this exercise is to train a linear classifier on text features
that represent sequences of up to 3 consecutive characters so as to be
recognize natural languages by using the frequencies of short character
sequences as 'fingerprints'.
"""
# Author: Olivier Grisel <olivie... | {
"content_hash": "02aab3248da3ecaab7608778c23e7d29",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 78,
"avg_line_length": 32.274193548387096,
"alnum_prop": 0.7521239380309845,
"repo_name": "xyguo/scikit-learn",
"id": "51649840d9049040e0af4cf2fe5ba779e37dcd0b",
"size": "2... |
from marshmallow import (Schema, fields, post_dump)
from webargs import fields as fs
page_args = {
'page': fs.Int(missing=1, validate=lambda val: val > 0),
'per_page': fs.Int(missing=10, validate=lambda val: val > 0)
}
class BaseSchema(Schema):
SKIP_VALUES = {None, }
@post_dump
def remove_skip_... | {
"content_hash": "96caadff80ca512eb6c62990819bca92",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 64,
"avg_line_length": 22.96078431372549,
"alnum_prop": 0.6618274978650726,
"repo_name": "alexcc4/flask_restful_backend",
"id": "de2c914688fcccb393f73cfd2cc581d1e6238eb1",
... |
import types
import fixtures
from oslo.config import cfg
from neutron import manager
from neutron.openstack.common import log as logging
from neutron.plugins.common import constants
from neutron.tests import base
from neutron.tests.unit import dummy_plugin
LOG = logging.getLogger(__name__)
DB_PLUGIN_KLASS = 'neutr... | {
"content_hash": "5e0d83d1cbcd54bd6bb6434afbd15394",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 77,
"avg_line_length": 44.07751937984496,
"alnum_prop": 0.6227576503693282,
"repo_name": "vbannai/neutron",
"id": "4a8eb0e6dcc342da7d810a41d8501db9858d3962",
"size": "6372... |
"""
TEST FILE 3
"""
from zope.interface import implements, Interface, Attribute
from twisted.python.reflect import namedAny
from twisted.python import components
from twisted.internet import defer
from twisted.persisted import sob
from twisted.plugin import IPlugin
class IServiceMaker(Interface):
"""
An obje... | {
"content_hash": "50dd880f673b16113c58decc48e82138",
"timestamp": "",
"source": "github",
"line_count": 397,
"max_line_length": 80,
"avg_line_length": 27.740554156171285,
"alnum_prop": 0.6171796967220557,
"repo_name": "wkwan/Markus",
"id": "3e0da56541987d6df3116e8f4185fe446d5f4ae5",
"size": "11096"... |
import sys
import unittest
import appleseed as asr
import IECore
import Gaffer
import GafferScene
import GafferTest
import GafferAppleseed
from AppleseedTest import appleseedProjectSchemaPath
@unittest.skipIf( sys.platform == 'darwin', "Unknown segfault on Mac see #3234" )
class AppleseedCapsuleTest( GafferTest.Te... | {
"content_hash": "0fc006cd05cd31bb77b06214a5c8a9d1",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 81,
"avg_line_length": 32.87837837837838,
"alnum_prop": 0.6962597616111796,
"repo_name": "appleseedhq/gaffer",
"id": "9e79f5fc416331b3a41fc2231edf63401626297b",
"size": "42... |
"""
Create service files
"""
def main():
"""
main
"""
from pymod.csf import CreateServiceFiles
CreateServiceFiles().run()
if __name__ == '__main__':
import sys
sys.exit(main())
| {
"content_hash": "f4f65d8b29fc9799fcfcf21503d8e654",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 44,
"avg_line_length": 12.352941176470589,
"alnum_prop": 0.5523809523809524,
"repo_name": "MyRequiem/comfortablePlayingInGW",
"id": "72e832309624ee3fe0afbf9978703577cf555d6c"... |
from dimod.binary.binary_quadratic_model import BinaryQuadraticModel
from dimod.vartypes import Vartype
__all__ = ['anti_crossing_clique', 'anti_crossing_loops']
def anti_crossing_clique(num_variables: int) -> BinaryQuadraticModel:
"""Generate an anti-crossing problem with a single clique.
Let ``N = num_var... | {
"content_hash": "7afcd3f9289ce89f4b0ddff642375059",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 82,
"avg_line_length": 32.205882352941174,
"alnum_prop": 0.6316590563165906,
"repo_name": "dwavesystems/dimod",
"id": "445be507ef08da47e82319393d9a3b0a73b626d2",
"size": "... |
from google.cloud import datalabeling_v1beta1
def sample_search_evaluations():
# Create a client
client = datalabeling_v1beta1.DataLabelingServiceClient()
# Initialize request argument(s)
request = datalabeling_v1beta1.SearchEvaluationsRequest(
parent="parent_value",
)
# Make the req... | {
"content_hash": "e945dcc6782d754d3903db41617e575f",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 81,
"avg_line_length": 27.65,
"alnum_prop": 0.7359855334538878,
"repo_name": "googleapis/python-datalabeling",
"id": "35aaba2d84d6932b48b0f0d3c0258b94bf13712c",
"size": "19... |
"""
Some reimplementation of Henkelman's Transition State Analysis utilities,
which are originally in Perl. Additional features beyond those offered by
Henkelman's utilities will be added.
This allows the usage and customization in Python.
"""
import glob
import os
import numpy as np
from monty.json import MSONable,... | {
"content_hash": "ba4d581cf334692f81dd50ac763c1440",
"timestamp": "",
"source": "github",
"line_count": 387,
"max_line_length": 104,
"avg_line_length": 41.049095607235145,
"alnum_prop": 0.5711947626841244,
"repo_name": "vorwerkc/pymatgen",
"id": "0e1dd91e16219b8452396d85534dd716e1adf8b7",
"size": "... |
from __future__ import absolute_import
# Import Salt Testing libs
from salttesting import TestCase, expectedFailure
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../')
class SimpleTest(TestCase):
def test_success(self):
assert True
@expectedFailure
def test_fail(self):
... | {
"content_hash": "ef12c74a610172f7a97b9728550c8f77",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 49,
"avg_line_length": 22.55,
"alnum_prop": 0.70509977827051,
"repo_name": "stephane-martin/salt-debian-packaging",
"id": "fd7c43051a3d60e309a8412e1fcd19e4ea0fd13a",
"size"... |
import rpm
import os
import sys
import utils
from AbstractRPM.Package import PackageFactory
from AbstractRPM.SourceManager import SourceManager
from AbstractRPM.Configurations import ConfigurationManager
rpmtsCallback_fd = None
def install(packageNames, sourcePaths, readConfsPaths, refConfPath, writeConfPath, forced... | {
"content_hash": "fa1d623bb89cb9bdb0f9265027d74eb9",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 99,
"avg_line_length": 37.391891891891895,
"alnum_prop": 0.5908926635345139,
"repo_name": "adriengentil/ConfMgr",
"id": "d4ddb73581c3879c517a42f15303e7a4bf2d518f",
"size": ... |
'''
'''
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License");... | {
"content_hash": "c4748312d831589373278d6ff8dbd800",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 332,
"avg_line_length": 38.96078431372549,
"alnum_prop": 0.7141419224962254,
"repo_name": "rahmalik/trafficserver",
"id": "679209ca840ae09ac22f1a1557cfc51471d33cd4",
"size... |
"""Sphinx ReadTheDocs theme.
From https://github.com/ryan-roemer/sphinx-bootstrap-theme.
"""
import os
VERSION = (0, 1, 5)
__version__ = ".".join(str(v) for v in VERSION)
__version_full__ = __version__
def get_html_theme_path():
"""Return list of HTML theme paths."""
cur_dir = os.path.abspath(os.path.dir... | {
"content_hash": "1b17803c8b74b9b60f00b21eea21ca7d",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 75,
"avg_line_length": 22.058823529411764,
"alnum_prop": 0.64,
"repo_name": "ajose1024/Code_Igniter_Extended",
"id": "47c5e26cc540f0274a6138a9dbf8958af4470dcb",
"size": "37... |
from slack_sdk.errors import BotUserAccessError # noqa
from slack_sdk.errors import SlackApiError # noqa
from slack_sdk.errors import SlackClientError # noqa
from slack_sdk.errors import SlackClientNotConnectedError # noqa
from slack_sdk.errors import SlackObjectFormationError # noqa
from slack_sdk.errors import S... | {
"content_hash": "9cc2d21da83bba7b414bcd31341c7963",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 65,
"avg_line_length": 43.2,
"alnum_prop": 0.8125,
"repo_name": "slackapi/python-slackclient",
"id": "7d5f130903ad6b18b088b552c09e86e76f75dc3f",
"size": "432",
"binary": ... |
"""optparse - a powerful, extensible, and easy-to-use option parser.
By Greg Ward <gward@python.net>
Originally distributed as Optik; see http://optik.sourceforge.net/ .
If you have problems with this module, please do not file bugs,
patches, or feature requests with Python; instead, use Optik's
SourceForge project ... | {
"content_hash": "a51515a4dc2950a79c127c2a52ab1063",
"timestamp": "",
"source": "github",
"line_count": 1417,
"max_line_length": 79,
"avg_line_length": 36.403669724770644,
"alnum_prop": 0.5623642990074442,
"repo_name": "google-code-export/django-hotclub",
"id": "c21663c555b27e62b5d1f8f8b126a9bd979f23... |
import unittest
from telemetry.internal.platform import system_info
from telemetry.page import page as page_module
from telemetry.story import story_set
from gpu_tests import gpu_test_expectations
VENDOR_NVIDIA = 0x10DE
VENDOR_AMD = 0x1002
VENDOR_INTEL = 0x8086
VENDOR_STRING_IMAGINATION = 'Imagination Technologies'... | {
"content_hash": "d95e1a3febdcc8c1558a66f7197f13ae",
"timestamp": "",
"source": "github",
"line_count": 180,
"max_line_length": 80,
"avg_line_length": 43.62777777777778,
"alnum_prop": 0.6643321023812556,
"repo_name": "js0701/chromium-crosswalk",
"id": "23bad2c94896a376666da251114d512acf339604",
"si... |
import math
import common.config
import common.util as util
import common.messaging as messaging
from common.geo import Line, LineSet
from common.objects import Object
from tree.common.server import Server
import tree.common.protocol.client_configuration_pb2 as client_config_protocol
import tree.common.coordinator_m... | {
"content_hash": "dd43f93e44843205f66ab422ce959a88",
"timestamp": "",
"source": "github",
"line_count": 431,
"max_line_length": 119,
"avg_line_length": 33.51276102088167,
"alnum_prop": 0.56597895319856,
"repo_name": "kaimast/inanutshell",
"id": "2789632d4c169edfcb89124a5babc35ec91f2f72",
"size": "1... |
from WorkingWithWorksheets import RemovingWorksheetsusingSheetName
import jpype
import os.path
asposeapispath = os.path.join(os.path.abspath("../../../"), "lib/")
dataDir = os.path.join(os.path.abspath("./"), "data/")
print "You need to put your Aspose.Cells for Java APIs .jars in this folder:\n"+asposeapispath
#pri... | {
"content_hash": "71f8d1f7ca992d0d2c4bcbfb088aff80",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 94,
"avg_line_length": 33.5,
"alnum_prop": 0.7569296375266524,
"repo_name": "asposecells/Aspose_Cells_Java",
"id": "79ffd38acd67d3fc8e93713f362478b189840f0c",
"size": "699"... |
import sys
from rpg import app
if __name__ == "__main__":
game = app.Game()
sys.exit(game.run())
| {
"content_hash": "c90ef4fc69b961a9963e56b3925dfc49",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 26,
"avg_line_length": 17.666666666666668,
"alnum_prop": 0.5660377358490566,
"repo_name": "tvarney/txtrpg",
"id": "6a5658d2e54078573791a3b094a0f7c0e2da8853",
"size": "130",
... |
import sys
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, overload
import urllib.parse
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifiedError,
map_error,
)
from azure... | {
"content_hash": "6e286b5cb9ee0923581c82e46bb97017",
"timestamp": "",
"source": "github",
"line_count": 576,
"max_line_length": 219,
"avg_line_length": 44.90625,
"alnum_prop": 0.6510477074151396,
"repo_name": "Azure/azure-sdk-for-python",
"id": "d396851be5a4b1e1fde492d626c3696fcbab6b65",
"size": "2... |
"""Check if a number of different objects exist.
This whole module is a big workaround to avoid circular imports.
This should probaby be cleaned up in some way.
"""
from typing import Optional, Iterable
from irisett.sql import DBConnection
async def _object_exists(dbcon: DBConnection, query: str, query_args: Option... | {
"content_hash": "5f1790d3e1efb94c96e41cc4ae0b9259",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 98,
"avg_line_length": 37.205128205128204,
"alnum_prop": 0.6891798759476223,
"repo_name": "beebyte/irisett",
"id": "1c98b911577ad6bb7b291c1b08914c3ac883c63d",
"size": "1451... |
from mainTools import main
def create_results(doc):
yield {
'correctedText': doc['correctedText'].encode('utf-8'),
'isCorrected': str(doc['corrected']),
'isDiacritized': str(doc['diacritized'])
}
def csv_header():
return ['correctedText', 'isCorrected', 'isDiacritized']
if __name_... | {
"content_hash": "a3a0ccb9a73204c0c511467acb7e4aa6",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 62,
"avg_line_length": 27.857142857142858,
"alnum_prop": 0.6230769230769231,
"repo_name": "Geneea/keboola-connection",
"id": "e9bd2e2f48d86ed45040d71299e3993e3cc1eaf6",
"si... |
from copy import copy, deepcopy
from textwrap import dedent
try:
import cPickle as pickle
except ImportError:
import pickle
try:
import dask.array as da
except ImportError:
pass
import numpy as np
import pandas as pd
from xray import (align, concat, conventions, backends, Dataset, DataArray,
... | {
"content_hash": "1c0a2a2f71620aead4446308e9a8d2d4",
"timestamp": "",
"source": "github",
"line_count": 2142,
"max_line_length": 88,
"avg_line_length": 40.58309990662932,
"alnum_prop": 0.5515305594220571,
"repo_name": "cpaulik/xray",
"id": "68a8e6baa15dea8c5887b51ee6281a20eb8096ce",
"size": "86929"... |
"""
This module will directly access to functions,
to verify cases not easly testable through cli commands
"""
import os
import re
import tempfile
from datetime import datetime
from pathlib import Path
from typing import Dict, Union
import pytest
from faker import Faker
from packaging.version import Version
from con... | {
"content_hash": "13a65cbe586db2f1d573f512bebb49fe",
"timestamp": "",
"source": "github",
"line_count": 547,
"max_line_length": 86,
"avg_line_length": 30.718464351005483,
"alnum_prop": 0.6503600547521275,
"repo_name": "rapydo/do",
"id": "d42c9ec0925725896961f4c56c37877f8d1e8234",
"size": "16803",
... |
__all__ = [
'Imshow_Slider',
'Imshow_Slider_Array',
'NonUniformImage',
'NonUniformImage_axes',
'RectangleSelector',
'addlabel',
'axesfontsize',
'colorbar',
'contour',
'figure',
'hist',
'hist2d',
'imshow',
'imshow_batch',
'latexfig',
'less_labels',
'pco... | {
"content_hash": "83336d937ac7b9761bff29237fa7f668",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 56,
"avg_line_length": 25.29032258064516,
"alnum_prop": 0.7104591836734694,
"repo_name": "joelfrederico/SciSalt",
"id": "263eb70c7c6c395d56a00cb8adb491384ac304c2",
"size": ... |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
import json
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.core.urlre... | {
"content_hash": "25311e526479f792cd9e1c2a04aaa374",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 117,
"avg_line_length": 46.2,
"alnum_prop": 0.5665223665223665,
"repo_name": "jaycrossler/geo-events",
"id": "a59048a2d099ea7e79b3bcff6cd1bb342391b4ab",
"size": "3672",
"... |
from errors import ServerError
import urllib
import json
class Request():
ALLOWED_METHODS = ['HEAD', 'GET', 'POST', 'PUT', 'DELETE']
def __init__(self, request_text):
request_text = request_text.split('\r\n\r\n', 1)
if len(request_text) > 1:
self.body = request_text[1].strip()
... | {
"content_hash": "b635ab1ac5499e393f9e5b9bad1bf2e9",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 93,
"avg_line_length": 37.45,
"alnum_prop": 0.5456163773920784,
"repo_name": "rockwotj/PieServer",
"id": "c7805db6237f4a1cc8956d0e66ec0884d225d448",
"size": "2247",
"bina... |
from pycoin.coins.bitcoin.Solver import BitcoinSolver
from .SolutionChecker import GroestlcoinSolutionChecker
class GroestlcoinSolver(BitcoinSolver):
SolutionChecker = GroestlcoinSolutionChecker
| {
"content_hash": "16eb7173d8f55e21f1a243464eab4870",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 55,
"avg_line_length": 33.5,
"alnum_prop": 0.8656716417910447,
"repo_name": "richardkiss/pycoin",
"id": "849faacf271637d2d882e1a92224eb27693ac110",
"size": "201",
"binary"... |
"""
Thinkful Python Unit 1 Lesson 6 Assignment 4
Implement Bicycle in Python using Classes
Qasim Ijaz
"""
import random
#import bicycle classes
from bicycle import *
#create 3 wheel types
road_wheel = Wheels(21, 40, "Road")
bmx_wheel = Wheels(18, 50, "BMX")
mountain_wheel = Wheels(24, 60, "Mountain")
#print(bmx_whee... | {
"content_hash": "4cc249c46460e05527aaa243e111b605",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 114,
"avg_line_length": 35.67407407407408,
"alnum_prop": 0.6216777408637874,
"repo_name": "qasimchadhar/thinkful",
"id": "9e64fec8fc9b16f5b193bd70dbd2015e4b1b2a75",
"size"... |
from __future__ import unicode_literals
from future.builtins import str
import re
import unicodedata
from django.core.exceptions import ObjectDoesNotExist
from django.urls import resolve, reverse, NoReverseMatch, get_script_prefix
from django.shortcuts import redirect
from django.utils.encoding import smart_text
fro... | {
"content_hash": "b573d249c6b92555f9823d223454f29e",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 77,
"avg_line_length": 29.272727272727273,
"alnum_prop": 0.6244624940277114,
"repo_name": "frankier/mezzanine",
"id": "e71a063845fec9b36d272e6ccc69d48e511a378f",
"size": "... |
"""Metaprogramming functions for introspection and manipulation of objects."""
from copy import copy
from importlib import import_module
from inspect import getmembers, getmro, isclass, Parameter, signature
def get_param_names(func):
"""Get the argument names of a function."""
return list(func.__code__.co_var... | {
"content_hash": "7466e8d1515968ef6ecf61ca12c36bd9",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 78,
"avg_line_length": 29.666666666666668,
"alnum_prop": 0.5991407799074686,
"repo_name": "fennerm/fmbiopy",
"id": "3e6a9cfabf08244c22074c5f78f715e5a32410d7",
"size": "302... |
"""
TestCases for python DB Btree key comparison function.
"""
import sys, os, re
import test_all
from cStringIO import StringIO
import unittest
try:
# For Pythons w/distutils pybsddb
from bsddb3 import db, dbshelve
except ImportError:
# For Python 2.3
from bsddb import db, dbshelve
lexical_cmp = cmp... | {
"content_hash": "311532746c8175fa2cd0b11a9925766a",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 90,
"avg_line_length": 33.06024096385542,
"alnum_prop": 0.5665694849368319,
"repo_name": "kmod/icbd",
"id": "59a45ec502a672a07a3727e8d81de3a1e37fccbd",
"size": "8232",
"... |
import networkx as nx
import settings
import sys
sys.path.append('./graphparser/')
from graphparser import GraphParser
from meter_graph import MeterGraph
import logging,sys
import re
import phonemes
# create digraph of meters (DG) using networkx
# each node has a type (=,-, and 0 [for the first one])
# the node at th... | {
"content_hash": "38e5a28849a49c5548dd349ca2bdf490",
"timestamp": "",
"source": "github",
"line_count": 493,
"max_line_length": 178,
"avg_line_length": 39.099391480730226,
"alnum_prop": 0.5227744345299855,
"repo_name": "seanpue/chicago2015",
"id": "f0a9f3bce67f835196b386a133f61534a4f6b00d",
"size":... |
from axiom.test.historic import stubloader
from xquotient.quotientapp import QuotientPreferenceCollection
class PrefsUpgradeTest(stubloader.StubbedTest):
def testUpgrade(self):
pc = self.store.findUnique(QuotientPreferenceCollection)
# in version 3, all the prefs have either moved to a different
... | {
"content_hash": "8846410b405e56c5e9c67975e2fe2247",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 72,
"avg_line_length": 41.6,
"alnum_prop": 0.7548076923076923,
"repo_name": "twisted/quotient",
"id": "8eb509cae081ba65f9f11e3da486729bc4dc98e4",
"size": "416",
"binary":... |
class PID:
def get_control(error, time):
delta_error = error - previous_error
# calculate the proportional term
proportional = error
# calculate the integral term
integral += error * time
# calculate the derivative term
derivative = delta_error / time
... | {
"content_hash": "4932ec4a7a18f832e35e4d7e0c849c53",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 87,
"avg_line_length": 27.5625,
"alnum_prop": 0.6099773242630385,
"repo_name": "essoplerck/Arduino-Drone",
"id": "762caa21014f044c20b999e6f9e20a6ca588114b",
"size": "441",
... |
input_name = '../examples/linear_elasticity/linear_elastic_up.py'
output_name = 'test_linear_elastic_up.vtk'
from testsBasic import TestInput
class Test( TestInput ):
pass
| {
"content_hash": "5e726ff25f5b73c07c0b9e9241f8243c",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 65,
"avg_line_length": 29.5,
"alnum_prop": 0.751412429378531,
"repo_name": "olivierverdier/sfepy",
"id": "84e66602a28f5908b03288834959c7ec9e4420fb",
"size": "177",
"binary... |
from nose import SkipTest
from kombu.tests.utils import redirect_stdouts
from funtests import transport
class test_django(transport.TransportCase):
transport = "django"
prefix = "django"
event_loop_max = 10
def before_connect(self):
@redirect_stdouts
def setup_django(stdout, stderr... | {
"content_hash": "ede0756ca9a34a7a95ed259df0730799",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 64,
"avg_line_length": 29.79310344827586,
"alnum_prop": 0.5752314814814815,
"repo_name": "WoLpH/kombu",
"id": "0c0a410d9c490b71d83e2da78365c54ebc615a5e",
"size": "864",
"... |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.pr... | {
"content_hash": "2c98c19d87ccdfdda023527df588b9da",
"timestamp": "",
"source": "github",
"line_count": 160,
"max_line_length": 763,
"avg_line_length": 39.50625,
"alnum_prop": 0.7370669197911723,
"repo_name": "unnikrishnankgs/va",
"id": "8f20780fcb24600a42deef6e4e5cc67973745862",
"size": "6437",
... |
from datetime import date
import os
import sys
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspat... | {
"content_hash": "ddee76d08b4b6b88b3ac60928334fb11",
"timestamp": "",
"source": "github",
"line_count": 245,
"max_line_length": 98,
"avg_line_length": 32.98367346938775,
"alnum_prop": 0.7005321123623314,
"repo_name": "CanalTP/flask-restful",
"id": "8679debe99bfbf977b63ddac3a6c5c7bbf6f3f7b",
"size":... |
from django.conf import settings
from geocamUtil import loader
class ExporterInfo(object):
def __init__(self, formatCode, extension, exporterClass, customLabel=None):
self.formatCode = formatCode
self.extension = extension
self.exporterClass = exporterClass
if customLabel:
... | {
"content_hash": "c892ff65ec446f8714b35f5c691da553",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 79,
"avg_line_length": 35,
"alnum_prop": 0.6366071428571428,
"repo_name": "xgds/xgds_planner2",
"id": "e48f98d4f31ed5e749f9e3468de185ad5930b96e",
"size": "1880",
"binary"... |
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'achivement_tracker.views.home', name='home'),
# url(r'^achivement_tracker/', include('achiv... | {
"content_hash": "2dc11b27a4274a676db564dfb65b9477",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 75,
"avg_line_length": 34.8235294117647,
"alnum_prop": 0.6908783783783784,
"repo_name": "roberto-robles/achivement_tracker",
"id": "f0648bcb1d9d6a9dccf99e556c96031f66a1a957",... |
"""Utilities for working with and creating SaveableObjects."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
from tensorflow.python.eager import context
from tensorflow.python.framework import device as pydev
from tensorflow.python.framework im... | {
"content_hash": "075d367ef376d794968080774e073bfe",
"timestamp": "",
"source": "github",
"line_count": 326,
"max_line_length": 78,
"avg_line_length": 39.466257668711656,
"alnum_prop": 0.660267371366392,
"repo_name": "Bismarrck/tensorflow",
"id": "fa88d2c6ebd2f29c2d2de7583a918dcbc6b28b51",
"size": ... |
from __future__ import print_function
__title__ = 'pif.commands.get_public_ip'
__author__ = 'Artur Barseghyan'
__copyright__ = 'Copyright (c) 2013 Artur Barseghyan'
__license__ = 'GPL 2.0/LGPL 2.1'
__all__ = ('main',)
import argparse
from pif.utils import get_public_ip
def main():
"""
Get public IP.
:e... | {
"content_hash": "476c15f0bb9ee3772a5caabee6cd52b8",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 114,
"avg_line_length": 23.75,
"alnum_prop": 0.582995951417004,
"repo_name": "djabber/Dashboard",
"id": "1d647eff4f48e0772c58db6e1424983ba621fda1",
"size": "1235",
"binar... |
from test_module import (module_func_2 as oar,)
module_func() | {
"content_hash": "d55b771699876e9940e90973b2e72a06",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 47,
"avg_line_length": 30.5,
"alnum_prop": 0.7540983606557377,
"repo_name": "DinoV/PTVS",
"id": "f8a93e1f718004ccbb3ef472450fe6b5bed1a090",
"size": "61",
"binary": false,
... |
import sys
import six
import testscenarios
from oslo import messaging
from oslo.messaging._drivers import common as exceptions
from oslo.messaging.openstack.common import jsonutils
from tests import utils as test_utils
load_tests = testscenarios.load_tests_apply_scenarios
EXCEPTIONS_MODULE = 'exceptions' if six.PY2... | {
"content_hash": "e8473a92bcbde1c58f1e87a7d179c789",
"timestamp": "",
"source": "github",
"line_count": 292,
"max_line_length": 78,
"avg_line_length": 36.386986301369866,
"alnum_prop": 0.4883764705882353,
"repo_name": "redhat-openstack/oslo.messaging",
"id": "2665b5ef7b5235082fa51dd3e87f9ca3893fe2d6"... |
"""All functions return a Component so you can easily pipe or compose them.
There are two types of functions:
- decorators: return the original component
- containers: return a new component
"""
from functools import lru_cache, partial
import numpy as np
from omegaconf import OmegaConf
from pydantic import validate... | {
"content_hash": "35f8bbd0ddfaf4cd2eba6d65a97ee9fe",
"timestamp": "",
"source": "github",
"line_count": 307,
"max_line_length": 86,
"avg_line_length": 25.94788273615635,
"alnum_prop": 0.6550338940497112,
"repo_name": "gdsfactory/gdsfactory",
"id": "c26b2d6f0d312da256ad9c84acfdd56df74c5738",
"size":... |
import os
os.system('date')
os.system('hostname')
os.system("matlab -nodesktop -nosplash -r 'genLoads(PARAM_STRING)'")
os.system('qstat -j %s' % os.environ['JOB_ID'])
| {
"content_hash": "2b6d9f84287afeee0e76557148ec3e53",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 68,
"avg_line_length": 21.25,
"alnum_prop": 0.6823529411764706,
"repo_name": "Guokr1991/cervix",
"id": "6dd49549f06af8d31149396f4d7f5a23eedc22cf",
"size": "170",
"binary":... |
"""
Module for inventory management tests
"""
from hamcrest import assert_that
from pyherc.test.cutesy import (carrying, Dagger, drop, Goblin, has_dropped,
Level, make, middle_of, place)
class TestDroppingItems():
"""
Tests for dropping items
"""
def __init__(self):
... | {
"content_hash": "b3bfaf27f588b907dbfd68e2e3955610",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 76,
"avg_line_length": 24.344827586206897,
"alnum_prop": 0.5651558073654391,
"repo_name": "tuturto/pyherc",
"id": "db23865642265d5b54cdd8d76130480ea53170c5",
"size": "1832"... |
"""
This features module provides access to features of the bytes of content in
revisions.
.. autodata:: revscoring.features.wikitext.revision
Represents the base revision of interest. Implements this a basic structure:
* revision: :class:`~revscoring.features.wikitext.Revision`
* parent: :class:`~r... | {
"content_hash": "3fe5308ca50bc012f535c55e54dac546",
"timestamp": "",
"source": "github",
"line_count": 371,
"max_line_length": 81,
"avg_line_length": 43.23180592991914,
"alnum_prop": 0.5901240725731031,
"repo_name": "wiki-ai/revscoring",
"id": "46a28d2330b41f7cb49dde9d6067843e36b4513c",
"size": "1... |
import theano
import theano.tensor as T
import treeano
import treeano.nodes as tn
import treeano.sandbox.utils
@treeano.register_node("clip_scaling")
class ClipScalingNode(treeano.NodeImpl):
hyperparameter_names = ("learnable",
"mins",
"maxs")
def com... | {
"content_hash": "9aa64f24ba275e3c3cbc3bca43147d2e",
"timestamp": "",
"source": "github",
"line_count": 233,
"max_line_length": 69,
"avg_line_length": 31.88412017167382,
"alnum_prop": 0.5255081437609369,
"repo_name": "jagill/treeano",
"id": "6e078372ce6e00ce3b828a85404f835ac068cc02",
"size": "7429"... |
import sys
import jinja2
import glob
import os
import argparse
from collections import OrderedDict
import abc
from shutil import copyfile, rmtree
EXTENSIONS = {'python' : 'py', 'documentation' : 'html'}
TYPES = ["boolean", "float", "long", "string", "int", "double", "array"]
class Constant(object):
def __init__(sel... | {
"content_hash": "4669482cfa0665cadd5b65a6742fa72e",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 139,
"avg_line_length": 36.63768115942029,
"alnum_prop": 0.689873417721519,
"repo_name": "ezbake/ezbake-configuration",
"id": "5646f06dd835c5d1bd46738de151875e28f6aade",
"... |
import socket
import Axon
from Kamaelia.Apps.JMB.WSGI import WSGIFactory
from Kamaelia.Chassis.ConnectedServer import ServerCore
from Kamaelia.Protocol.HTTP import ErrorPages
from Kamaelia.Support.Protocol.HTTP import HTTPProtocol
port=8080
#This is just a configuration dictionary for general WSGI stuff. This needs... | {
"content_hash": "4db8d80bb2b60056989b863908d5c672",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 115,
"avg_line_length": 33.53333333333333,
"alnum_prop": 0.6832339297548045,
"repo_name": "bbc/kamaelia",
"id": "f7ebf08e6c233c910c6be3aeb6647c1436f63300",
"size": "2471",
... |
"""Pushbullet platform for notify component."""
import logging
import mimetypes
import voluptuous as vol
from homeassistant.const import CONF_API_KEY
import homeassistant.helpers.config_validation as cv
from homeassistant.components.notify import (
ATTR_DATA, ATTR_TARGET, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM... | {
"content_hash": "7305462573cf24977845a6aa8c6a1ad4",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 78,
"avg_line_length": 37.53939393939394,
"alnum_prop": 0.5666774297707459,
"repo_name": "jnewland/home-assistant",
"id": "d1d9a6449ef2a30bb9e6df65d02166a3bd00c415",
"size... |
"""
Django settings.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
import sys
f... | {
"content_hash": "c4046bc3a53439bf1baa0a60a336fcd0",
"timestamp": "",
"source": "github",
"line_count": 485,
"max_line_length": 99,
"avg_line_length": 33.863917525773196,
"alnum_prop": 0.5868241597661958,
"repo_name": "fortyMiles/my-family",
"id": "9b61c7cfbfe32dea770ee878c941bbfec5821715",
"size":... |
import os
from cuttsum.resources import MultiProcessWorker
import cuttsum.judgements
from sklearn.ensemble import GradientBoostingRegressor
import pandas as pd
import numpy as np
import regex as re
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LogisticRegression
from sklea... | {
"content_hash": "42f0e9e48dc510de4391f17582b59f97",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 102,
"avg_line_length": 29.548022598870055,
"alnum_prop": 0.5531548757170172,
"repo_name": "kedz/cuttsum",
"id": "889cf22b624a8ce65acc165c5386862af6ee484b",
"size": "5230"... |
"""This code example gets all companies that are advertisers.
To create companies, run create_companies.py.
The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file in your home
directory. For more information, see the "Caching authentication in... | {
"content_hash": "733b9437218e3dcc41c8e0ffbc96d25e",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 80,
"avg_line_length": 30.58490566037736,
"alnum_prop": 0.674892041949414,
"repo_name": "dietrichc/streamline-ppc-reports",
"id": "bba89452cdd3cace6de942875af26e28a30b30b0",
... |
from datetime import datetime
from pretty_timedelta import pretty_timedelta
__author__ = 'gautam'
def pretty_time(datetime_value):
now = datetime.now()
delta = datetime_value - now
return pretty_timedelta(delta)
| {
"content_hash": "36e6c4ba562d3e9dedc97dc8254f749f",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 45,
"avg_line_length": 25.22222222222222,
"alnum_prop": 0.7268722466960352,
"repo_name": "gautamk/private-journal",
"id": "0c9159f93640d1e3ac687e449984922f647cb423",
"size":... |
from setuptools import setup
setup(
name="idealreport",
packages=["idealreport"],
version="0.15",
description="Ideal Prediction reporting framework",
author="Ideal Prediction",
author_email="info@idealprediction.com",
url="https://github.com/idealprediction/idealreport",
download_url="h... | {
"content_hash": "f6528cf3424f263d8dc32f73aca6b651",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 79,
"avg_line_length": 35,
"alnum_prop": 0.6841269841269841,
"repo_name": "idealprediction/idealreport",
"id": "3e3fb9d56554137a78f5a777366b6a18f058ab98",
"size": "630",
... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_gavyn_sykes.iff"
result.attribute_template_id = 9
result.stfName("npc_name","human_base_male")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "8491552ddfb5dca661eb23c80db86862",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 65,
"avg_line_length": 23,
"alnum_prop": 0.6923076923076923,
"repo_name": "obi-two/Rebelion",
"id": "c72292fd3e293784ff3902052a6ae1ad8e5582d9",
"size": "444",
"binary": f... |
import tempfile
from smartcrop import smart_crop
class Cropper:
def __init__(self):
self.crop_x = 1280
self.crop_y = 800
def crop(self, image_path):
smart_crop(image_path, self.crop_x, self.crop_y, tempfile.gettempdir() + "/_working_image_.jpeg", False)
return tempfile.gettem... | {
"content_hash": "7c62d4c59a739c8f31485181805f442b",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 112,
"avg_line_length": 27.153846153846153,
"alnum_prop": 0.6373937677053825,
"repo_name": "MtnFranke/rpi-photo-frame",
"id": "54511e34cfa01f1d0b2ceb6650f598bc48a7bc90",
"s... |
from __future__ import absolute_import, unicode_literals
from django_localflavor_mx.forms import (MXZipCodeField, MXRFCField,
MXStateSelect, MXCURPField)
from django.test import SimpleTestCase
from .forms import MXPersonProfileForm
class MXLocalFlavorTests(SimpleTestCase):
def setUp(self):
self.for... | {
"content_hash": "9fe2757150c77af6d605066e25b06d6c",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 131,
"avg_line_length": 39.263959390862944,
"alnum_prop": 0.6360698125404007,
"repo_name": "andres-torres-marroquin/django-localflavor-mx",
"id": "4dcb8edca4506e6346c46b9f2c... |
from django.contrib import admin
from treasure_hunt.models import Level, UserProfile
admin.site.register(Level)
admin.site.register(UserProfile) | {
"content_hash": "6e338aef919ae74cab9930dddb49ef5f",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 51,
"avg_line_length": 29,
"alnum_prop": 0.8413793103448276,
"repo_name": "code-haven/Django-treasurehunt-demo",
"id": "2320eacd63d4a41afc699215a854b7203684374e",
"size": "1... |
"""
RenderPipeline
Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com>
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... | {
"content_hash": "bfe20ebb149e569f7ae029677062b64c",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 94,
"avg_line_length": 39.55844155844156,
"alnum_prop": 0.6943532501641497,
"repo_name": "eswartz/RenderPipeline",
"id": "03d89869e53c588243c85282fa169916e58d7c85",
"size":... |
from __future__ import print_function
import time
import fixtures
from botocore.exceptions import ClientError as BotoClientError
from botocore import session as botocore_session
from glanceclient import client as glance_client
from keystoneauth1.identity import v3 as identity_v3
from keystoneauth1 import session
from ... | {
"content_hash": "78caa067344f0df4a626196ca650cb98",
"timestamp": "",
"source": "github",
"line_count": 436,
"max_line_length": 79,
"avg_line_length": 37.89908256880734,
"alnum_prop": 0.5913217138707335,
"repo_name": "openstack/sahara-scenario",
"id": "28b718f3d3d7b793bd59437b82af313f58efd9f4",
"si... |
from csv_unicode import UnicodeReader
#def open_if_filename(f):
def csv_gen(f=None, headers=None):
"""Attempts to act on the filelike object f."""
reader = UnicodeReader(f)
if not headers:
# Assume first row is headers
headers = reader.next()
for row in reader:
yield dict(zip(h... | {
"content_hash": "53a8b69bb14d964c695689a3d1526853",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 62,
"avg_line_length": 26.676470588235293,
"alnum_prop": 0.5788313120176406,
"repo_name": "marcharper/pyhelpers",
"id": "3e58f64fad5f1280c7c041b86f1ecda451b91ed2",
"size": ... |
from Xlib.display import Display
from Xlib import X
class Workarea(object):
'''
This class contains some utils methods to simplify setting the Extended Window Manager Hints (EWMH).
Especially the property "_NET_WORKAREA" is important, as it fetches the size of the current desktop,
without status bars ... | {
"content_hash": "e2f743e0f3a1270dfaa3d32ec8fa0825",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 119,
"avg_line_length": 32.264,
"alnum_prop": 0.6226134391272006,
"repo_name": "gillesB/azulejo",
"id": "3e46a0d0722e8eb8949d272fdb751dac3bfd5fb9",
"size": "4033",
"bina... |
"""Compute v2 Server action implementations"""
from osc_lib.command import command
from osc_lib import exceptions
from osc_lib import utils
from oslo_utils import importutils
from openstackclient.i18n import _
class CreateServerBackup(command.ShowOne):
_description = _("Create a server backup image")
IMAGE... | {
"content_hash": "168f1a85b4f0ea208925fbc52beee85d",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 78,
"avg_line_length": 30.81896551724138,
"alnum_prop": 0.5267132867132868,
"repo_name": "dtroyer/python-openstackclient",
"id": "1d560dc0c70abac456380e693ca95b081bad6009",
... |
from django.apps import AppConfig
class WebsiteConfig(AppConfig):
name = 'WebSite'
| {
"content_hash": "14f6773df92be13c39c86330ff174de1",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 33,
"avg_line_length": 17.8,
"alnum_prop": 0.7528089887640449,
"repo_name": "MassyMeniche/Project_Y",
"id": "d106dc5a51d45fac54b785036482a239f4408b24",
"size": "89",
"bina... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Question.qtemplate'
db.delete_column('website_question', 'qtemplate_id')
def backwards(self, orm):
#... | {
"content_hash": "635d523ce27785e0e8abaa06cbf01337",
"timestamp": "",
"source": "github",
"line_count": 545,
"max_line_length": 200,
"avg_line_length": 93.36330275229358,
"alnum_prop": 0.5474716506495293,
"repo_name": "solarpermit/solarpermit",
"id": "24ea86d96886070cfb17460d213b034686b01741",
"siz... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import logging
from math import ceil
import sys
import numpy as np
import tensorflow as tf
VGG_MEAN = [103.939, 116.779, 123.68]
class FCN8VGG:
def __init__(self, vgg16_npy_path=None):
... | {
"content_hash": "c1cee525671f1c8b0a65373b5a04c682",
"timestamp": "",
"source": "github",
"line_count": 489,
"max_line_length": 79,
"avg_line_length": 40.8241308793456,
"alnum_prop": 0.5187096127836498,
"repo_name": "MarvinTeichmann/tensorflow-fcn",
"id": "834b32473a15edee9b36811ce3b890879104b301",
... |
"""This module is deprecated. Please use `airflow.providers.amazon.aws.hooks.emr`."""
import warnings
# pylint: disable=unused-import
from airflow.providers.amazon.aws.hooks.emr import EmrHook # noqa
warnings.warn(
"This module is deprecated. Please use `airflow.providers.amazon.aws.hooks.emr`.",
Deprecatio... | {
"content_hash": "d7bb382f300b009bc90e8517474b983d",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 86,
"avg_line_length": 31.363636363636363,
"alnum_prop": 0.7594202898550725,
"repo_name": "spektom/incubator-airflow",
"id": "a8cadcb6f727adb33e9abc4295f6e350324d28e9",
"si... |
from django.core.urlresolvers import reverse_lazy
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from hack4lt.forms import (
Task1Form,
Task2Form,
)
from hack4lt.models import TaskResult
def index_view(request):
r... | {
"content_hash": "e141bdeaf0cbcfe5959d6c53d49908b0",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 84,
"avg_line_length": 29.79245283018868,
"alnum_prop": 0.681443951868271,
"repo_name": "niekas/Hack4LT",
"id": "a2d58b7a0d89015928c97eca303e44ddd62b6e22",
"size": "1579",
... |
"""empty message
Revision ID: 7a4526a1eb30
Revises: 352cb746332a
Create Date: 2019-02-10 18:47:14.300006
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = '7a4526a1eb30'
down_revision = '352cb746332a'
branch_labels = None
depe... | {
"content_hash": "2137a0557b8ed103b85a487f935c2f88",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 75,
"avg_line_length": 28.529411764705884,
"alnum_prop": 0.6453608247422681,
"repo_name": "cosanlab/cosanlab_website",
"id": "92a7f48c147e405beb84529744b21ea3fa73ca17",
"si... |
import os
import sys
import re
import datetime
import socket
import traceback
from .WatchDogBase import WatchDogBase
from pandajedi.jedicore.MsgWrapper import MsgWrapper
from pandajedi.jedicore.ThreadUtils import ListWithLock, ThreadPool, WorkerThread
# logger
from pandacommon.pandalogger.PandaLogger import PandaLog... | {
"content_hash": "712bcfac000d4f1e42c0fccf96c64ee6",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 126,
"avg_line_length": 43.333333333333336,
"alnum_prop": 0.5293447293447293,
"repo_name": "PanDAWMS/panda-jedi",
"id": "4c151254bd6fccbe12a86ee8dcc6d59eeede3b09",
"size":... |
"""This module contains a Google Cloud Vertex AI hook."""
from typing import Dict, List, Optional, Sequence, Tuple, Union
from google.api_core.operation import Operation
from google.api_core.retry import Retry
from google.cloud.aiplatform import (
CustomContainerTrainingJob,
CustomPythonPackageTrainingJob,
... | {
"content_hash": "e75b7b481441a0c72f658f47998eb0e0",
"timestamp": "",
"source": "github",
"line_count": 2034,
"max_line_length": 133,
"avg_line_length": 53.140609636184855,
"alnum_prop": 0.633678114129228,
"repo_name": "bolkedebruin/airflow",
"id": "cd73da149aa0e647d47522869e1a69f3618fc6e3",
"size"... |
import tensorflow as tf
from tensorboard.backend.event_processing import reservoir
class ReservoirTest(tf.test.TestCase):
def testEmptyReservoir(self):
r = reservoir.Reservoir(1)
self.assertFalse(r.Keys())
def testRespectsSize(self):
r = reservoir.Reservoir(42)
self.assertEqu... | {
"content_hash": "b8484e91fc65bd6e6d585363430122ae",
"timestamp": "",
"source": "github",
"line_count": 267,
"max_line_length": 84,
"avg_line_length": 35.27715355805243,
"alnum_prop": 0.590508546554836,
"repo_name": "tensorflow/tensorboard",
"id": "0db2a41625644a58c82652c9081ea07483175e85",
"size":... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.