text stringlengths 4 1.02M | meta dict |
|---|---|
from unittest import skipUnless
from django.forms import ValidationError
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.tests.utils import HAS_SPATIALREFSYS
from django.test import SimpleTestCase
from django.utils import six
from django.utils.html import escape
if HAS_SPATIALREFSYS:
from dja... | {
"content_hash": "93f49fb9d9b9c7307e6514749bb1d55d",
"timestamp": "",
"source": "github",
"line_count": 290,
"max_line_length": 106,
"avg_line_length": 46.01724137931034,
"alnum_prop": 0.5617085050580742,
"repo_name": "ericholscher/django",
"id": "ca28fb503c04382fe82db5b9b1da4694759ba127",
"size": ... |
import os
import logging
from .scm import git
from . import exceptions
from .python3_compat import basestring
from pkg_resources import parse_version
_all_exposed_sources = {}
_logger = logging.getLogger("pydeploy.sources")
def _exposed(thing):
_all_exposed_sources[thing.__name__] = thing
return thing
class ... | {
"content_hash": "d06aee602ea3cd76e4fd8eb8e6b4c04b",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 113,
"avg_line_length": 35.60112359550562,
"alnum_prop": 0.6204828783335964,
"repo_name": "vmalloc/pydeploy",
"id": "e0462d34a27d80a895d3b82f2751c6f1ec7847a7",
"size": "63... |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrest.polling import LROPoller, NoPolling
from msrestazure.polling.arm_polling import ARMPolling
from .. import models
class RoutesOperations(object):
"""RoutesOperations operations.
:param cl... | {
"content_hash": "9f4243361af742d94f0145cff23d1f96",
"timestamp": "",
"source": "github",
"line_count": 356,
"max_line_length": 185,
"avg_line_length": 47.05337078651685,
"alnum_prop": 0.6457524923885141,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "f159fb5fad517ed75f141231fca58afe4870b982",
... |
from .error import Error, ErrorException
from .auto_rest_swagger_bat_service_enums import (
Colors,
)
__all__ = [
'Error', 'ErrorException',
'Colors',
]
| {
"content_hash": "445b1be8442a6c68db61857cd2e90c8f",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 50,
"avg_line_length": 18.444444444444443,
"alnum_prop": 0.6506024096385542,
"repo_name": "csmengwan/autorest",
"id": "0652fe4bac9e45ff2705f9b4b50d2f328bcfba97",
"size": "64... |
from traits.api import Any, List
# ============= standard library imports ========================
# ============= local library imports ==========================
from pychron.core.helpers.strtools import to_bool
from pychron.core.ui.progress_dialog import myProgressDialog
from pychron.envisage.initialization.initia... | {
"content_hash": "87699687f978fec0388f9837bea405a0",
"timestamp": "",
"source": "github",
"line_count": 337,
"max_line_length": 86,
"avg_line_length": 31.24925816023739,
"alnum_prop": 0.5194188586079195,
"repo_name": "NMGRL/pychron",
"id": "dacc3684fa88c5c65b1c77dde5cb1b3d21cdd965",
"size": "11331"... |
import inspect
import logging
import weakref
import ray.ray_constants as ray_constants
import ray._raylet
import ray.signature as signature
import ray.worker
from ray.util.placement_group import PlacementGroup, \
check_placement_group_index
from ray import ActorClassID, Language
from ray._raylet import PythonFunc... | {
"content_hash": "e9324dfc4bf9be54dc629b61197528bf",
"timestamp": "",
"source": "github",
"line_count": 999,
"max_line_length": 79,
"avg_line_length": 40.34134134134134,
"alnum_prop": 0.5834842807870773,
"repo_name": "robertnishihara/ray",
"id": "a2a90d8738c2b3dc447546ed66595c6b69aecc0f",
"size": "... |
import progressbar
import re
import time
from utils import get_log
LOG = get_log(__name__)
# Maximum Bytes Per Packet
CHUNK_SIZE = 512 * 1024 # B
class FileLikeProxy:
def __init__(self, transfer_object, callback, speed_limit='1mb'):
self.__callback = callback if callback else lambda size, length, obj_... | {
"content_hash": "690ec9f86e71b233b39103983f2531ee",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 91,
"avg_line_length": 31.451612903225808,
"alnum_prop": 0.5305982905982906,
"repo_name": "roman-verchikov/CloudFerry",
"id": "584072f4cdbc4fed76361973b5b4f2239c694155",
"s... |
from Tkinter import *
class BoothDisplay:
root = None
font = "Courier"
font_size = 46
def __init__(self):
self.root = Tk()
self.root.configure(background="black")
self.parent = Frame(root)
self.root.overrideredirect(True)
self.root.geometry("{0}x{1}+0+0".format(... | {
"content_hash": "1bff3c133acf19636cab7b86597e3a03",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 101,
"avg_line_length": 30.035714285714285,
"alnum_prop": 0.5338882282996433,
"repo_name": "brookshire/rpi-photobooth",
"id": "2905767509009a1a26d7b438f619e2885e9a61b8",
"s... |
from import_export import fields, resources
class GamesPlayedResource(resources.Resource):
game = fields.Field(attribute='game__name', column_name='game')
time = fields.Field(attribute='time', column_name='time (hours)')
num_players = fields.Field(attribute='num_players', column_name='num_players')
... | {
"content_hash": "eebc128ad1d24447ab546b80d71458b1",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 82,
"avg_line_length": 30.95,
"alnum_prop": 0.6607431340872375,
"repo_name": "sergei-maertens/discord-bot",
"id": "f6ce91df7885060a3351415e76d916d6060d5cc9",
"size": "619",... |
"""Subclasses of information."""
from .models import Info
class Gene(Info):
"""A gene."""
__mapper_args__ = {"polymorphic_identity": "gene"}
class Meme(Info):
"""A meme."""
__mapper_args__ = {"polymorphic_identity": "meme"}
class State(Info):
"""A state."""
__mapper_args__ = {"polymorp... | {
"content_hash": "7d7b11752af81434d9f5944a16631dab",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 58,
"avg_line_length": 16.74074074074074,
"alnum_prop": 0.584070796460177,
"repo_name": "Dallinger/Dallinger",
"id": "fdcce33a439ad4de5a820414afcca5b859ec7270",
"size": "45... |
import numpy as np
import pandas as pd
from keras.models import Model
from keras.layers import Dense, Embedding, Input
from keras.layers import LSTM, Bidirectional, GlobalMaxPool1D, Dropout, Conv1D, MaxPooling1D, Flatten
from keras.preprocessing import text, sequence
max_features = 2000
maxlen = 450
train = pd.read_... | {
"content_hash": "1eae16d3c5f2a83a49edcf9c72ce76e8",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 101,
"avg_line_length": 33.535714285714285,
"alnum_prop": 0.7140575079872205,
"repo_name": "AhmedHani/Kaggle-Machine-Learning-Competitions",
"id": "8ed607e4f9cd71c0d366d0ff42... |
from __future__ import division
import chainer
import chainer.functions as F
import chainer.links as L
import numpy as np
from chainercv.experimental.links.model.fcis import FCIS
from chainercv.functions import ps_roi_average_pooling_2d
from chainercv.links import Conv2DBNActiv
from chainercv.links.model.faster_rcnn.... | {
"content_hash": "baca248824dce6c4407366d6601d6bee",
"timestamp": "",
"source": "github",
"line_count": 402,
"max_line_length": 79,
"avg_line_length": 40.12686567164179,
"alnum_prop": 0.5919657801748187,
"repo_name": "yuyu2172/chainercv",
"id": "cf7a7883e322f9caabadbbc069030b9f76ddf6c6",
"size": "1... |
"""
WSGI config for base springstertestapp.
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.6/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault(
"D... | {
"content_hash": "c5d93202fcff00af3bfe2782b2abb101",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 26.4375,
"alnum_prop": 0.7754137115839244,
"repo_name": "Mitso/springstertestapp",
"id": "35abbc9807444c082d44d9b78480a4e0adfbdba1",
"size": "423",
... |
"""Python sample demonstrating use of the Google Genomics Pipelines API.
This sample demonstrates a pipeline that uses Bioconductor to analyze
files in Google Cloud Storage.
This pipeline is run in an "ephemeral" manner; no call to pipelines.create()
is necessary. No pipeline is persisted in the pipelines list.
"""
... | {
"content_hash": "98044e4160a784ed0a90b334c2e668bc",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 217,
"avg_line_length": 37.101190476190474,
"alnum_prop": 0.6613187871009145,
"repo_name": "mbookman/pipelines-api-examples",
"id": "40f3f7d2d55e9b0433f41f20c23e2baf14e8b12f... |
from absl import app, flags
from easydict import EasyDict
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
from datasets import MNISTDataset
from cleverhans.torch.attacks.fast_gradient_method import fast_gradient_method
from cleverhans.torch.attacks.projected_gra... | {
"content_hash": "c85b400ba9af69f7d8fc42784b8546f7",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 95,
"avg_line_length": 32.26373626373626,
"alnum_prop": 0.5696525885558583,
"repo_name": "cleverhans-lab/cleverhans",
"id": "559b5a4aec27eb9f8c67c8e25549e7e2c3d6bfec",
"si... |
'''
Created on 17.09.2014
Utility classes for datapoints and converters to ROOT graphics objects
@author: markusfasel
'''
from ROOT import TGraph, TGraphAsymmErrors
import math
class Datapoint:
"""
Representation of data for a single point
"""
def __init__(self, x, y, dx):
"""
Co... | {
"content_hash": "0d7951f502098eb06fc8c0403e42b814",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 147,
"avg_line_length": 29.132653061224488,
"alnum_prop": 0.5353765323992995,
"repo_name": "matplo/rootutils",
"id": "6f29fee1b13c655905164d7b2ae2c6d18e353b04",
"size": "5... |
"""
Simple utility for setting configuration values from the command line.
Sample usage:
$ setconfig FOO_SUPPORT=y BAR_BITS=8
Note: Symbol names should not be prefixed with 'CONFIG_'.
The exit status on errors is 1.
The default input/output configuration file is '.config'. A different filename
can be passed in t... | {
"content_hash": "e96eb57d7f1088d548b4d706e6d8d867",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 79,
"avg_line_length": 29.563218390804597,
"alnum_prop": 0.5940902021772939,
"repo_name": "gem5/gem5",
"id": "f9cf5cd314da242b5d8827065fa40601a89b581c",
"size": "2664",
"... |
import jinja2
import jingo
from tower import ugettext as _
from access import acl
from reviews.models import ReviewFlag
from . import forms
@jingo.register.filter
def stars(num, large=False):
# check for 0.0 incase None was cast to a float. Should
# be safe since lowest rating you can give is 1.0
if num... | {
"content_hash": "4900b60ae838c76a1ed902413edca310",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 76,
"avg_line_length": 32.145833333333336,
"alnum_prop": 0.6672067401166558,
"repo_name": "Witia1/olympia",
"id": "cbe4866714d7786dd2846dacdbb2a36f98cddea1",
"size": "3086"... |
from . import rman_ui_base
from . import rman_ui_txmanager
from . import rman_ui_aovs
from . import rman_ui_viewport
from . import rman_ui_light_handlers
from . import rman_ui_render_panels
from . import rman_ui_object_panels
from . import rman_ui_mesh_panels
from . import rman_ui_curve_panels
from . import rman_ui_mat... | {
"content_hash": "fa87b0f4bd0b640282dc51f60afbd34a",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 44,
"avg_line_length": 34.59701492537314,
"alnum_prop": 0.7286453839516824,
"repo_name": "adminradio/RenderManForBlender",
"id": "717517138a7e49812824b9be1f33c06273183c8a",
... |
from __future__ import with_statement
import os
import sys
from trac.env import open_environment
from trac.ticket.model import Priority, Severity
priority_mapping = {
'highest': 'blocker',
'high': 'critical',
'normal': 'major',
'low': 'minor',
'lowest': 'trivial'
}
def main():
... | {
"content_hash": "8c1dd6a7b61a42c764775eb22720c301",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 60,
"avg_line_length": 24.852941176470587,
"alnum_prop": 0.5692307692307692,
"repo_name": "dinhkhanh/trac",
"id": "bf4a099d08717bb40e7a785a865cf16886767eb1",
"size": "1269"... |
"""
.. module:: dj-stripe.tests.test_contrib.test_views
:synopsis: dj-stripe Rest views for Subscription Tests.
.. moduleauthor:: Philippe Luickx (@philippeluickx)
"""
from __future__ import unicode_literals
from decimal import Decimal
from django.utils import timezone
from django.conf import settings
from dja... | {
"content_hash": "46e7a48fde4f36633e90c3a278627ef7",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 173,
"avg_line_length": 38.98701298701299,
"alnum_prop": 0.6665556295802798,
"repo_name": "cjrh/dj-stripe",
"id": "8089f854fc465303a0276fd4d2b169c58a1eecac",
"size": "6004... |
import os
import shutil
git_path = os.path.join('.git')
hooks_path = os.path.join(git_path, 'hooks')
commitmsg_hook_path = os.path.join(hooks_path, 'commit-msg')
def install():
check_git_path()
if not os.path.isdir(hooks_path):
os.makedirs(hooks_path, mode=0o755, exist_ok=True)
uninstall()
c... | {
"content_hash": "19866f6e271d2ee023d9a6a973a7953f",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 60,
"avg_line_length": 25.233333333333334,
"alnum_prop": 0.6869220607661823,
"repo_name": "ngouzy/commitmsg",
"id": "4dcad0d0e718dd416b7e1494c275931491a02780",
"size": "757... |
__docformat__='restructuredtext'
# Migration number: 011
# Last update - Account
migration = [
("""\
ALTER TABLE accounts ALTER COLUMN user_id SET NOT NULL;
ALTER TABLE accounts ALTER COLUMN service_id SET NOT NULL;
""",
"""\
ALTER TABLE accounts ALTER COLUMN service_id DROP NOT... | {
"content_hash": "67e5695f03a7161184fd285510997bcf",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 67,
"avg_line_length": 25.375,
"alnum_prop": 0.6330049261083743,
"repo_name": "santisiri/popego",
"id": "bcf203e14ecb1a5e99ca9b3e1299e9635ff86de6",
"size": "429",
"binary... |
"""
Varnish Plugin for NewRelic
"""
from xml.etree import ElementTree
import helper
import logging
import subprocess
import json
import time
import requests
class NewRelicVarnishPlugin(helper.Controller):
"""
The NewRelicVarnish plugin polls varnishstat utility for stats and reports to NewRelic
"""
def __ini... | {
"content_hash": "2224a14c3ba576cea7aff5532a6545f8",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 88,
"avg_line_length": 26.103174603174605,
"alnum_prop": 0.6245059288537549,
"repo_name": "syrgak/newrelic-plugin-varnish",
"id": "364282132760c836b948e7f9666f418af282d6eb",... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('disease', '0006_allelecolor'),
]
operations = [
migrations.AddField(
model_name='allelecolor',
name='snp_marker',
... | {
"content_hash": "77b4a9a0d1d2747245131930536a485f",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 72,
"avg_line_length": 22.94736842105263,
"alnum_prop": 0.5963302752293578,
"repo_name": "jiivan/genoomy",
"id": "e40311e29489beb504792476f37a3a7dd72e5cce",
"size": "460",
... |
"""
I wrote this script to explore the usage and limitations of parameters
and expression objects in Pyomo. I thought they were interchangable, but
when I converted a parameter to an expression I got an error where it
was being used later in an if statement as part of a test for data
validity.
The punchline is that e... | {
"content_hash": "da2e203d02a2c75ede918bd95053a0fc",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 83,
"avg_line_length": 46.40217391304348,
"alnum_prop": 0.7383462169126259,
"repo_name": "mseaborn/switch_py",
"id": "ccd34ef2eec1e027f075c040fb9e407f7479a22b",
"size": "44... |
import unittest
from test_helper import test_is_not_empty, get_file_output
class TestCase(unittest.TestCase):
def test_not_empty(self):
self.assertTrue(test_is_not_empty(), 'The output is empty')
def test_output(self):
output = get_file_output(path='task.py')
answers = [
... | {
"content_hash": "408ddaf07691bdb84934e944bca17eca",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 110,
"avg_line_length": 34.55,
"alnum_prop": 0.6396526772793053,
"repo_name": "apache/beam",
"id": "82d22c59ddd1aac330ce9690ea044f96760dd262",
"size": "1480",
"binary": f... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "RecomendadorUD.settings")
#os.environ.setdefault('DJANGO_CONFIGURATION', 'Dev')
os.environ.setdefault('DJANGO_CONFIGURATION', 'Prod')
#from django.core.management import execute_from_command_line
from ... | {
"content_hash": "a3652ed702b4b20e43720d345e4dc21d",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 78,
"avg_line_length": 32.38461538461539,
"alnum_prop": 0.7315914489311164,
"repo_name": "camilortte/RecomendadorUD",
"id": "4214dbee67aabaabaa39cad3a5346d90d0ab6f39",
"siz... |
from .base import *
DEBUG = True
| {
"content_hash": "f2711cc2a786a044e4e99fbedd142e40",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 19,
"avg_line_length": 8.75,
"alnum_prop": 0.6571428571428571,
"repo_name": "iAmMrinal0/Taskbuster",
"id": "f04354e07ef195bd83520822d50576f9559e032a",
"size": "35",
"binar... |
"""Utilities for determining application-specific dirs.
See <https://github.com/ActiveState/appdirs> for details and usage.
"""
# Dev Notes:
# - MSDN on where to store app data files:
# http://support.microsoft.com/default.aspx?scid=kb;en-us;310294#XSLTH3194121123120121120120
# - Mac OS X: http://developer.apple.com... | {
"content_hash": "9073a2d8688c90b86e174652fa135371",
"timestamp": "",
"source": "github",
"line_count": 606,
"max_line_length": 122,
"avg_line_length": 39.44884488448845,
"alnum_prop": 0.6195934075127583,
"repo_name": "timcera/tsgettoolbox",
"id": "2edfdd556c17c8e560b8a00a822a20a819311878",
"size":... |
from redash.models import db
from redash.devspark.custom_models.favourites import Favourite
if __name__ == '__main__':
with db.database.transaction():
Favourite.create_table()
db.close_db(None)
| {
"content_hash": "32773474aa8e54070ee50896f6caba84",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 62,
"avg_line_length": 27.375,
"alnum_prop": 0.6712328767123288,
"repo_name": "jmvasquez/redashtest",
"id": "c507f679241cb3a9d726e35cca3863df6dadbe52",
"size": "219",
"bin... |
from . import handlers
from firenado import tornadoweb
from firenado.launcher import ProcessLauncher
import os
class LauncherComponent(tornadoweb.TornadoComponent):
def __init__(self, name, application):
super(LauncherComponent, self).__init__(name, application)
self.launcher_path = os.path.abspa... | {
"content_hash": "302dd41680686b22e1e97f17eca61e79",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 78,
"avg_line_length": 30.945945945945947,
"alnum_prop": 0.6279475982532751,
"repo_name": "piraz/firenado",
"id": "386784e03a3f094d0d332cdb24253012d09df370",
"size": "1145"... |
__author__ = 'privat'
class FiniteStateMachine:
def __init__(self):
self.handlers = {}
self.start_state = None
self.end_states = []
def add_state(self, name, handler=None):
"""
Add new state to machine.
If handler is None state will be set to an end_state
... | {
"content_hash": "a080efefc323ef8636e2d390253ae81a",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 112,
"avg_line_length": 30.054545454545455,
"alnum_prop": 0.5601935874168179,
"repo_name": "sem23/roslab_ide",
"id": "6abe78cc99740026db074cb7b86673aeeba3ca49",
"size": "16... |
import os
import io
import codecs
import yaml
import jenkins
from jenkins_jobs import cmd
from jenkins_jobs.errors import JenkinsJobsException
from tests.cmd.test_cmd import CmdTestsBase
from tests.base import mock
os_walk_return_values = {
'/jjb_projects': [
('/jjb_projects', ('dir1', 'dir2', 'dir3'), ... | {
"content_hash": "b7aea982be9e5eb85ebfa7deb2b91409",
"timestamp": "",
"source": "github",
"line_count": 238,
"max_line_length": 78,
"avg_line_length": 38.91596638655462,
"alnum_prop": 0.537680846469445,
"repo_name": "michalvanco/jenkins-job-builder",
"id": "c59f5ae73e8609f2ba1a6dd34f9be9c10c82d815",
... |
"""Unit tests for ace model."""
import unittest
import os
from ace import model
from ace.samples import breiman85
from ace.samples import wang04
# pylint: disable=protected-access, missing-docstring
class TestModel(unittest.TestCase):
def setUp(self):
self.model = model.Model()
def tearDown(self):... | {
"content_hash": "e54c95577dd4f7f4aecd9e9579b5e5c3",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 78,
"avg_line_length": 29.305084745762713,
"alnum_prop": 0.6188548293811452,
"repo_name": "partofthething/ace",
"id": "541f195a0cb9cfe627162af24e5d342843b6aac6",
"size": "1... |
import argparse
import csv
import json
import math
import time
import numpy as np
import torch
import torch.nn.functional as F
import torch.optim as optim
import torch.utils.data as data
from nltk.tokenize.treebank import TreebankWordDetokenizer
from torchtext import data as torchtext_data
from torchtext import datase... | {
"content_hash": "dc6a1ac4184ed4ebf623c3fc7caf8d04",
"timestamp": "",
"source": "github",
"line_count": 505,
"max_line_length": 117,
"avg_line_length": 35.92277227722772,
"alnum_prop": 0.5737831431563861,
"repo_name": "huggingface/pytorch-transformers",
"id": "51cdb5677324dead3ebe265e075c01ac1870404e... |
"""A wrapper of Session API which runs hooks."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import abc
import sys
import six
from tensorflow.core.protobuf import config_pb2
from tensorflow.python.distribute import distribute_coordinator_context
from ... | {
"content_hash": "3accd1ce0021aa6dbe5f486d0e9ae760",
"timestamp": "",
"source": "github",
"line_count": 1354,
"max_line_length": 103,
"avg_line_length": 38.438700147710485,
"alnum_prop": 0.6552280674787688,
"repo_name": "xodus7/tensorflow",
"id": "0e0125a9566208109a7eb595554f37be06cabe03",
"size": ... |
def get_index_of_rightmost_set_bit(number: int) -> int:
"""
Take in a positive integer 'number'.
Returns the zero-based index of first set bit in that 'number' from right.
Returns -1, If no set bit found.
>>> get_index_of_rightmost_set_bit(0)
-1
>>> get_index_of_rightmost_set_bit(5)
0
... | {
"content_hash": "ecebe224c84012fd473eb6fe9d0567ba",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 78,
"avg_line_length": 27.675,
"alnum_prop": 0.6214995483288166,
"repo_name": "TheAlgorithms/Python",
"id": "eb52ea4e63e38ebed0434f65a3e55aac7c83efeb",
"size": "1183",
"b... |
"""Sluice Flask App."""
from __future__ import absolute_import
import os
from celery import Celery
from flask import (
Flask,
abort,
flash,
render_template,
redirect,
request,
session,
url_for,
)
from flask.ext.bootstrap import Bootstrap
from flask.ext import breadcrumbs
from flask_ex... | {
"content_hash": "df600429d3f452a66a052c2b52ead8e7",
"timestamp": "",
"source": "github",
"line_count": 179,
"max_line_length": 76,
"avg_line_length": 26.39664804469274,
"alnum_prop": 0.6323809523809524,
"repo_name": "christabor-incubator/sluice",
"id": "53a338235d57a59e946974ca7d6dba0673bb7724",
"... |
import time
from behave import step
from atip.web import web
@step(u'I wait for {timeout:d} seconds')
def wait_for_timeout(context, timeout):
time.sleep(timeout)
@step(u'launch "{app_name}"')
def launch_app_by_name(context, app_name):
web.launch_webapp_by_name(context, app_name)
@step(u'I launch "{app_name}... | {
"content_hash": "7c7a6c53795dbbb1773b92872b13855f",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 82,
"avg_line_length": 35.5625,
"alnum_prop": 0.6968365553602812,
"repo_name": "jacky-young/crosswalk-test-suite",
"id": "646bba18f691a8756b47645307d9e6d8f89d2ef1",
"size":... |
import serial
import unilog
from . import misc, excepts
from .compat import unicode, xrange, str_compat
from .handlers import commands as hc
STX = bytearray((0x02, )) # START OF TEXT - начало текста
ENQ = bytearray((0x05, )) # ENQUIRY - запрос
ACK = bytearray((0x06, )) # ACKNOWLEDGE - положительное подтверждение
... | {
"content_hash": "c1bbe1fef39c8ffcd827e41b0cccad36",
"timestamp": "",
"source": "github",
"line_count": 311,
"max_line_length": 115,
"avg_line_length": 29.758842443729904,
"alnum_prop": 0.5324689357104267,
"repo_name": "juliadolgova/pyshtrih",
"id": "5e90670f5320f21e0edd175a350ee016fd1873a2",
"size... |
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""
Alter one or more models' tables with the registered attributes
"""
help = "Alter the tables for all registered models, or just specified models"
args = "[appname ...]"
can_import_settings = True
requires_m... | {
"content_hash": "b05a54731aac9e6a3841ac6481960cef",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 81,
"avg_line_length": 28.8,
"alnum_prop": 0.6069444444444444,
"repo_name": "miceno/django-categories",
"id": "53daf580caf91674f23bcf76bc48826ede9299b1",
"size": "720",
"... |
from CPWeb.BibtexTools import getCitationOrAlternative, getBibtexParser
from CPWeb.SphinxTools import FluidGenerator
import os.path
import CoolProp
web_dir = os.path.abspath(os.path.join(os.path.dirname(__file__),'..'))
root_dir = os.path.abspath(os.path.join(web_dir, '..'))
csvfile = os.path.join(web_dir,'fluid_prop... | {
"content_hash": "d17affedfe25edccfbe7d95af7d1f825",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 100,
"avg_line_length": 32.91566265060241,
"alnum_prop": 0.5845534407027818,
"repo_name": "DANA-Laboratory/CoolProp",
"id": "2d6aaa0701038bc32614f84806a8d1ae83bae664",
"siz... |
import cherrypy
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import rsa
import json
import os
import re
from urllib.parse import urlparse, urlunparse, parse_qs
from urllib.request import urlopen
import va... | {
"content_hash": "4c6df3f4632604757238bac50303b854",
"timestamp": "",
"source": "github",
"line_count": 326,
"max_line_length": 90,
"avg_line_length": 36.77300613496933,
"alnum_prop": 0.570653987320654,
"repo_name": "data-exp-lab/girder_ythub",
"id": "4ad2c7f082fd66022cf94e76aa7efa405c7c72e5",
"siz... |
from cloudbaseinit.osutils import base
from subprocess import CalledProcessError
import subprocess
import datetime
import os
import os.path
class FreeBSDUtils(base.BaseOSUtils):
def reboot(self):
if ( os.system('reboot') != 0 ):
raise Exception('Reboot failed')
def user_exists(self, usern... | {
"content_hash": "468f36eacb1656c34bd7621661baf369",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 155,
"avg_line_length": 36.71808510638298,
"alnum_prop": 0.5796030711284949,
"repo_name": "bincentvaret/bsd-cloudinit",
"id": "3ac10e1b39d50a0b543ecb124be896767247d97c",
"... |
from unittest import TestCase
import math
import torch
from pose_format.torch.masked.tensor import MaskedTensor
from pose_format.torch.representation.point_line_distance import PointLineDistanceRepresentation
representation = PointLineDistanceRepresentation()
class TestPointLineDistanceRepresentation(TestCase):
... | {
"content_hash": "7827d46ef0068e312f85d746709e9f52",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 96,
"avg_line_length": 46,
"alnum_prop": 0.6722408026755853,
"repo_name": "AmitMY/pose-format",
"id": "3e28ab09a48b2a5a7028de9a074690ba78f1737b",
"size": "1196",
"binary"... |
"""
Functionality for converting Tuskar domain models into their Heat-acceptable
formats.
These functions are written against the HOT specification found at:
http://docs.openstack.org/developer/heat/template_guide/hot_spec.html
"""
import yaml
from tuskar.templates.heat import Resource
def compose_template(templat... | {
"content_hash": "62fcf3672aeb79faedcb0bef609aef4a",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 79,
"avg_line_length": 27.68617021276596,
"alnum_prop": 0.6184438040345821,
"repo_name": "rdo-management/tuskar",
"id": "41864d4cbf82485fa35ebfa36274707ce87e1027",
"size":... |
'''
With this recipe, you can control pan/tilt and preset of Sony VISCA Color Video Camera.
'''
# <!-- parameters
param_disabled = Parameter({'desc': 'Disables this node?', 'schema': {'type': 'boolean'}})
param_ipAddress = Parameter({'schema': {'type': 'string'}})
_port = 52381
param_port = Parameter({'schema': {'t... | {
"content_hash": "c657c53746503e9bddea4095c0a8058f",
"timestamp": "",
"source": "github",
"line_count": 400,
"max_line_length": 195,
"avg_line_length": 39.6175,
"alnum_prop": 0.6134915125891336,
"repo_name": "museumsvictoria/nodel-recipes",
"id": "e6ecff140c3a3fd45381b8626ff49f3ae0a2d206",
"size": ... |
__author__ = 'scooper'
import sys
import os
import glob
import re
import shlex
from voltcli import utility
re_voltdb_jar = re.compile('^voltdb(client)?-[.0-9]+[.]jar$')
# Filled in during startup.
standalone = None
version = None
command_dir = None
command_name = None
voltdb_jar = None
classpath = None... | {
"content_hash": "34eb0f18c87d8f9ad41b3d7474920860",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 99,
"avg_line_length": 42.855172413793106,
"alnum_prop": 0.6037978757644029,
"repo_name": "vtorshyn/voltdb-shardit-src",
"id": "f377f574e13a2fff541a560853861ba8031f7f0d",
... |
import arcpy
from arcpy import env
# Set environment settings
env.workspace = "C:\Users\Ewan\Desktop\SFTPDST5\MapFiles"
try:
# Set the local variable
in_Table = "Topography.csv"
x_coords = "x"
y_coords = "y"
out_Layer = "Topography_Layer"
saved_Layer = "c:\Users\Ewan\Desktop\SFTPDS... | {
"content_hash": "00fb9c7f23342a0b4483ba2f60652901",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 144,
"avg_line_length": 31.8,
"alnum_prop": 0.720125786163522,
"repo_name": "harryfb/DST5",
"id": "7b6dc04605dc68fc2fa8829afd9dadd74280c59e",
"size": "1297",
"binary": fa... |
"""
Pygments regex lexer tests
~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import time
import unittest
from pygments.token import String
from pygments.lexers.perl import PerlLexer
class RunawayRegexTest(un... | {
"content_hash": "3f6c3a962fdd5f0cb6d0825e62d52cf1",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 78,
"avg_line_length": 39.05882352941177,
"alnum_prop": 0.6242469879518072,
"repo_name": "zmughal/pygments-mirror",
"id": "26b2d0a71e37c1fe0d6c18342772bc9d8bfe87e4",
"size... |
"""The definitions."""
DATA_TYPE_BOOLEAN = 'boolean'
DATA_TYPE_BINARY_DATA = 'binary_data'
DATA_TYPE_DOUBLE = 'double'
DATA_TYPE_FAT_DATE_TIME = 'fat_date_time'
DATA_TYPE_FILETIME = 'filetime'
DATA_TYPE_FLOAT = 'float'
DATA_TYPE_FLOATINGTIME = 'floatingtime'
DATA_TYPE_HFS_TIME = 'hfs_time'
DATA_TYPE_GUID = 'guid'
DAT... | {
"content_hash": "15790e88cdda0bc90a974669e21a63a8",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 53,
"avg_line_length": 29.217391304347824,
"alnum_prop": 0.7172619047619048,
"repo_name": "libyal/libyal",
"id": "cca475a0f1db09cd3099ae3d9181b8fd8152afaf",
"size": "1368",... |
"""
Test model using model engine, this model has two int values and
a boolean value
"""
from mongoengine import Document, IntField, BooleanField
class ModelOne(Document):
""" A sample model class """
int_value1 = IntField()
int_value2 = IntField()
boolean_value = BooleanField(required=True, default=... | {
"content_hash": "42454df5d1c04a77e24697f4ff1067e4",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 64,
"avg_line_length": 29.08695652173913,
"alnum_prop": 0.680119581464873,
"repo_name": "mbanton/nose-mongoengine",
"id": "b4ec5980456b165f8d8682abe030ec1801735e40",
"size"... |
import numpy as np
import matplotlib.pyplot as plt
import pyart
cmap_list = ["pyart_" + m for m in pyart.graph.cm.datad
if not m.endswith("_r")]
nrows = len(cmap_list)
gradient = np.linspace(0, 1, 256)
gradient = np.vstack((gradient, gradient))
# borrows from colormaps_reference matplotlib example
fig, a... | {
"content_hash": "691127081eb579a3d36826959700a250",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 79,
"avg_line_length": 31.742857142857144,
"alnum_prop": 0.6642664266426642,
"repo_name": "nguy/artview",
"id": "cf2dbd461849a85e2910485765e4a5942c884d0e",
"size": "1111",
... |
import json
import os
from manager import OVERWATCH_DIR
from pyow.casc import CASCManager
from pyow.dll_loader import load_dll
import time
load_dll()
# noinspection PyUnresolvedReferences
from PyOWLib import Utils
# noinspection PyUnresolvedReferences
from System.Collections.Generic import Dictionary
if __name__ ==... | {
"content_hash": "d3847fb22db918eb2e0057fd92155ca2",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 92,
"avg_line_length": 30,
"alnum_prop": 0.6426666666666667,
"repo_name": "ZingBallyhoo/OverwatchDataManager",
"id": "264cfbf79f3aa4c84eec11f940b21e4d9b87b74b",
"size": "15... |
"""
Deprecated! Use WebHdfs instead.
Only some utils and Hdfs are still used.
Interfaces for Hadoop filesystem access via the HADOOP-4707 Thrift APIs.
"""
import errno
import logging
import os
import posixpath
import random
import stat as statconsts
import subprocess
import urlparse
import threading
from thrift.tran... | {
"content_hash": "f393d682eabace95a9187a29d7edac28",
"timestamp": "",
"source": "github",
"line_count": 1050,
"max_line_length": 106,
"avg_line_length": 31.805714285714284,
"alnum_prop": 0.6424721523535752,
"repo_name": "2013Commons/hue",
"id": "1a2480e2af37b4f608b8788a62986181ac42491c",
"size": "3... |
from celery import Celery
BROKER_URL = 'redis://localhost:6379/0'
app = Celery('tasks', broker=BROKER_URL)
@app.task
def add(x, y):
return x + y
| {
"content_hash": "5de7cd796b8b4033fd27787d545cdc3d",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 40,
"avg_line_length": 15.3,
"alnum_prop": 0.6666666666666666,
"repo_name": "ybrs/single-beat",
"id": "cafc29ea783b088569de73f2f35ec0b511e5f438",
"size": "153",
"binary":... |
import numpy as np
from keras.datasets import reuters
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.layers.normalization import BatchNormalization
from keras.utils import np_utils
from keras.preprocessing.text import Tokenizer
'''
Train and evaluate a simp... | {
"content_hash": "d8afbc838facc82aa30aa39f8e6f1573",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 108,
"avg_line_length": 33.6031746031746,
"alnum_prop": 0.7439773264052905,
"repo_name": "seba-1511/gsoc15-demo",
"id": "d081ca06cfa13f1e4b4c30cc5fcf6d0b78ba99ea",
"size": ... |
"""
SDoc
Copyright 2016 Set Based IT Consultancy
Licence MIT
"""
# ----------------------------------------------------------------------------------------------------------------------
from sdoc.SDoc import SDoc
from sdoc.command.BaseCommand import BaseCommand
from sdoc.style.SdocStyle import SdocStyle
class SDoc2... | {
"content_hash": "d591c3d9badc3f82582eee63b9b752a2",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 120,
"avg_line_length": 28.06382978723404,
"alnum_prop": 0.39651250947687644,
"repo_name": "OlegKlimenko/py-sdoc",
"id": "4f0e26e0bf3beecd0e8323a7ac2f6428f7a163c4",
"size":... |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import unittest
import mock
from google.appengine.ext import ndb
from dashboard.common import testing_common
from dashboard.common import utils
from dashboard.models import anomaly_config
class AnomalyConf... | {
"content_hash": "462420fa063910f3c74d51f516bc985e",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 78,
"avg_line_length": 33.67796610169491,
"alnum_prop": 0.6844489179667841,
"repo_name": "endlessm/chromium-browser",
"id": "fbd3e7dd3b49c9ea285ca41d010d6c4765e27722",
"siz... |
import re
import sys
import eventlet
eventlet.monkey_patch()
from oslo_concurrency import lockutils
from oslo_config import cfg
from oslo_log import log as logging
import oslo_messaging
from neutron.agent.common import config
from neutron.agent.linux import ip_lib
from neutron.agent.linux import utils
from neutron.... | {
"content_hash": "fd59f0d186e22f80b86ef19c50699bf7",
"timestamp": "",
"source": "github",
"line_count": 329,
"max_line_length": 79,
"avg_line_length": 36.14589665653495,
"alnum_prop": 0.5782038345105953,
"repo_name": "cisco-openstack/networking-cisco",
"id": "68beaa797955cd9db0e16b3df10a770a3f0d926e"... |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import collections
import logging
import os
import sys
import tempfile
from flexget import plugin
from flexget.event import event
log = logging.getLogger('subtitles')
try:
... | {
"content_hash": "652d77ba898134c1fae046ff3b46acb1",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 120,
"avg_line_length": 48.74025974025974,
"alnum_prop": 0.5554667377209344,
"repo_name": "tarzasai/Flexget",
"id": "071987ac59a87f2dda87de96212d27e8bcff982c",
"size": "11... |
from collections import namedtuple
import itertools
import operator
import re
import processing.comparators.base_comparator as base_comparator
from models.match_singlet import MatchHalf
import processing.comparators.match_concatenator as concatenator
from utilities.suffix_array import matcher as suffix_apps
from proce... | {
"content_hash": "8f79779199c4f9f00a06dbad77f9125a",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 78,
"avg_line_length": 35.05,
"alnum_prop": 0.5728551049521092,
"repo_name": "gnarph/DIRT",
"id": "3d6591d75bca132a5d36be7c42a43c35459ea703",
"size": "4907",
"binary": f... |
"""Demo of the tfdbg curses UI: A TF network computing Fibonacci sequence."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from six.moves import xrange # pylint: disable=redefined-builtin
import tensorflow as tf
from tensorflow.python... | {
"content_hash": "28772b093fbcc7881b6c9d0472a39790",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 77,
"avg_line_length": 28.790697674418606,
"alnum_prop": 0.6591276252019386,
"repo_name": "juharris/tensorflow",
"id": "18eb0a4fa306f304415df2cc777f67912b23a9bd",
"size": "... |
import numpy
from scipy.optimize import minimize_scalar
from scipy.stats import norm
def lhs( n_factors, n_samples, genepool=10000, random_in_cell=True ):
"""
Parameters
----------
n_factors : int
The number of columns to sample
n_samples : int
The number of Latin hypercube samples (rows)
genepool : int
T... | {
"content_hash": "6c8cfb0ce6627482b5f40ba44ab7db03",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 90,
"avg_line_length": 25.70175438596491,
"alnum_prop": 0.6748577929465301,
"repo_name": "jpn--/pines",
"id": "08592db1bc4326c1dda2086e4246d0609558bc83",
"size": "4396",
... |
import ort_flatbuffers_py.experimental.fbs as fbs
class FbsTypeInfo:
"Class to provide conversion between ORT flatbuffers schema values and C++ types"
tensordatatype_to_string = {
fbs.TensorDataType.TensorDataType.FLOAT: 'float',
fbs.TensorDataType.TensorDataType.UINT8: 'uint8_t',
fbs.... | {
"content_hash": "b412e5a47328ed86dbc387baac3533b2",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 119,
"avg_line_length": 52.064935064935064,
"alnum_prop": 0.6729857819905213,
"repo_name": "ryfeus/lambda-packs",
"id": "76e69615b403f380a0921fa8c22155589e9ea556",
"size": ... |
from __future__ import unicode_literals, print_function
import os
import pathspec
from pathlib2 import PurePath, Path
from gcdt.gcdt_logging import getLogger
log = getLogger(__name__)
# based on: https://github.com/finklabs/botodeploy/blob/master/botodeploy/utils_static.py
def glob_files(root_dir, includes=None,... | {
"content_hash": "155c7af95ac806f54aa68b4f7ee714ff",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 126,
"avg_line_length": 34.05102040816327,
"alnum_prop": 0.6152232544201378,
"repo_name": "glomex/gcdt-bundler",
"id": "7c1823cbb887b5039d6955b5c51ea3fc3ba41035",
"size": "... |
'''Unit tests for grit.tool.rc2grd'''
from __future__ import print_function
import os
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os.path.dirname(__file__), '../..'))
import re
import unittest
from six import StringIO
from grit import grd_reader
from grit import util
from grit.node import ... | {
"content_hash": "35b41996080a9e939b941065c0802cf2",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 256,
"avg_line_length": 36.765822784810126,
"alnum_prop": 0.6316061284214151,
"repo_name": "ric2b/Vivaldi-browser",
"id": "c599032f2ec05fc690268efffe8c97afa5e75f23",
"size... |
import lda
import itertools
import numpy as np
import codecs
from temporal import doc_topic_strengths_over_periods
from sklearn.feature_extraction.text import CountVectorizer
from mynlp.preprocess import (transform, ALL_PIPELINE_NAMES)
from util import load_line_corpus
def main():
# parameters
collection_na... | {
"content_hash": "72e132fb688e5560d5078ef816d954d9",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 77,
"avg_line_length": 31.263157894736842,
"alnum_prop": 0.5892255892255892,
"repo_name": "xiaohan2012/temporal-topic-mining",
"id": "1660c863212350b52715cca7f13e3dfa16e7485c... |
import zof
from ..http import HttpServer
from ..pktview import pktview_from_list, pktview_to_list
APP = zof.Application('rest_api')
APP.http_endpoint = '127.0.0.1:8080'
WEB = HttpServer(logger=APP.logger)
# WEB.define_var('dpid', _parse_dpid)
@APP.event('start')
async def start(_):
await WEB.start(APP.http_endp... | {
"content_hash": "7ad027b99c18c35eaf774533cb638f66",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 87,
"avg_line_length": 26.61214953271028,
"alnum_prop": 0.6035118525021949,
"repo_name": "byllyfish/pylibofp",
"id": "5d5a99737b57e2e342f6d03239815500f490000b",
"size": "5... |
import json
import os
import re
import time
from urlparse import urlparse
from proboscis.asserts import fail
from troveclient.compat.client import TroveHTTPClient
from trove.tests.config import CONFIG
print_req = True
def shorten_url(url):
parsed = urlparse(url)
if parsed.query:
method_url = parsed... | {
"content_hash": "f4d42f6fa0093ae7ffae1699b2af5d3b",
"timestamp": "",
"source": "github",
"line_count": 268,
"max_line_length": 79,
"avg_line_length": 39.9365671641791,
"alnum_prop": 0.5355507801550967,
"repo_name": "cp16net/trove",
"id": "f8fa1a019e2696d5d40678b81c4bbf4bb7b72d1d",
"size": "11308",... |
from .action_py3 import Action
class ImageAction(Action):
"""Defines an image action.
You probably want to use the sub-classes and not this class directly. Known
sub-classes are: ImageEntityAction, ImageModuleAction, ImageRecipesAction,
ImageRelatedSearchesAction, ImageShoppingSourcesAction
Vari... | {
"content_hash": "88a72c84b52b5ac53eaa0b44ffdc1760",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 265,
"avg_line_length": 43.043103448275865,
"alnum_prop": 0.6212697776887642,
"repo_name": "Azure/azure-sdk-for-python",
"id": "535a934682ee739c6ba9c398edb8341575128609",
... |
from __future__ import unicode_literals
from django.db import migrations, models
import main.models
class Migration(migrations.Migration):
dependencies = [
('main', '0016_auto_20161204_1654'),
]
operations = [
migrations.AlterField(
model_name='lan',
name='paytyp... | {
"content_hash": "f9f44b03b1d934e631211becabe0d39a",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 197,
"avg_line_length": 33.62068965517241,
"alnum_prop": 0.598974358974359,
"repo_name": "bomjacob/htxaarhuslan",
"id": "d108d446b310fce66748a1c29c4c00ced38a019a",
"size": ... |
from myhdl import *
from pihdf import *
from myhdl_lib import *
#--- Custom code begin ---#
#--- Custom code end ---#
def TIncr_rtl(rst, clk, mode, inc_out, rdy_en, rdy_buff, DELAY_BITS):
'''|
| Top-level MyHDL description. This is converted to RTL velilog...
|________'''
""" Interface signals """
... | {
"content_hash": "14281e0dd23a9d1768e96194b5b6d67d",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 99,
"avg_line_length": 31.47457627118644,
"alnum_prop": 0.5794291868605277,
"repo_name": "hnikolov/pihdf",
"id": "090a3cd8cea466328f84b334a4953edfb0ada6f3",
"size": "1857",... |
"""Small example showing the use of nested types in PyTables.
The program creates an output file, 'nested-tut.h5'. You can view it
with ptdump or any HDF5 generic utility.
:Author: F. Alted
:Date: 2005/06/10
"""
from __future__ import print_function
import numpy
import tables
#'-**-**-**-**- The sample nested cl... | {
"content_hash": "e8462212e563e1cb39a5f383c189ac28",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 77,
"avg_line_length": 27.834586466165412,
"alnum_prop": 0.6323608860075635,
"repo_name": "jack-pappas/PyTables",
"id": "9d5ec9ca9753dfdda8a498e78a4d9ef741e05bcf",
"size":... |
from msrest.serialization import Model
class Policy(Model):
"""A Policy.
:param description: The description of the policy.
:type description: str
:param status: The status of the policy. Possible values include:
'Enabled', 'Disabled'
:type status: str or :class:`PolicyStatus
<azure.mgm... | {
"content_hash": "7d425384f0a0ed7e61786131b9b799cf",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 229,
"avg_line_length": 43.861111111111114,
"alnum_prop": 0.6409119696010133,
"repo_name": "rjschwei/azure-sdk-for-python",
"id": "843303c337d14648e8676815f12cd4fd3a574b75",
... |
from __future__ import absolute_import, print_function, division
import unittest
from theano.compat import izip
from six import iteritems
import numpy
import theano
import theano.tensor as T
from theano.tensor import TensorType
from theano.tensor.basic import alloc
# Don't import test classes otherwise they get test... | {
"content_hash": "36fa7cbd935f3fd93025adafa01fff80",
"timestamp": "",
"source": "github",
"line_count": 447,
"max_line_length": 89,
"avg_line_length": 38.24384787472036,
"alnum_prop": 0.5638490786779761,
"repo_name": "JazzeYoung/VeryDeepAutoEncoder",
"id": "20aa2d09fbe37ca2730f9c8175c1401a22fdfbb6",
... |
import textwrap
from datetime import date
import os
from collections import OrderedDict
# Custom modules.
from weather_config_ghcnd import *
from weather_config_mshr import *
from weather_download_files import *
class WeatherConvertToXML:
STATES = OrderedDict({
'AK': 'Alaska',
'AL': 'Alabama'... | {
"content_hash": "429b34e4ad21c6f987c14bdda7b52f31",
"timestamp": "",
"source": "github",
"line_count": 538,
"max_line_length": 227,
"avg_line_length": 41.446096654275095,
"alnum_prop": 0.5500044847071486,
"repo_name": "shivani1494/vxquery",
"id": "5db090a5171acc421dac81b31889b5c3c2b8fe2a",
"size":... |
from __future__ import annotations
import json
import os
import unittest
import uuid
from contextlib import closing
from unittest import mock
import MySQLdb.cursors
import pytest
from parameterized import parameterized
from airflow.models import Connection
from airflow.models.dag import DAG
from airflow.providers.my... | {
"content_hash": "f3ae5bbd2cfce94d2fcf5b979dbbd91b",
"timestamp": "",
"source": "github",
"line_count": 452,
"max_line_length": 107,
"avg_line_length": 35.389380530973455,
"alnum_prop": 0.5873343335833958,
"repo_name": "nathanielvarona/airflow",
"id": "d7270dafdd8adf4988602442eb74fc52207ea8c3",
"si... |
from __future__ import unicode_literals
from django.db import models
class AuthGroup(models.Model):
id = models.IntegerField(primary_key=True)
name = models.CharField(unique=True, max_length=80)
class Meta:
managed = False
db_table = 'auth_group'
class AuthGroupPermissions(models.Model):
... | {
"content_hash": "762efd7117ed3fd04ae0fdb47fb860a0",
"timestamp": "",
"source": "github",
"line_count": 269,
"max_line_length": 136,
"avg_line_length": 38.20817843866171,
"alnum_prop": 0.6942985016540183,
"repo_name": "fcgravalos/CEES-API-v1.0",
"id": "5d5d6df38fbf8f5858a677f235aaa67bc77ddf39",
"si... |
import sys
import os
# -- General configuration ------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.doctest',
'sphinx.ext.todo',
'sphi... | {
"content_hash": "effbc22aaabf12e49788d9941b625aca",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 79,
"avg_line_length": 33.25471698113208,
"alnum_prop": 0.7109219858156028,
"repo_name": "FastFeed/FastFeed",
"id": "7453517a1a6ece13eccd4f415a5adcaccebde999",
"size": "35... |
import mock
import webob.exc
from neutron.api import extensions as neutron_extensions
from neutron.api.v2 import attributes
from neutron import context
import neutron.db.api as db
from neutron.extensions import portbindings
from neutron import manager
from neutron.plugins.cisco.common import cisco_constants as c_const... | {
"content_hash": "9dc55fdc0a9a9c2cc1455c46728c29ae",
"timestamp": "",
"source": "github",
"line_count": 1277,
"max_line_length": 79,
"avg_line_length": 50.32263116679718,
"alnum_prop": 0.5410662599981326,
"repo_name": "kongseokhwan/kulcloud-iitp-neutron",
"id": "b388e083fc9f935ce5d4391ba39f7840195d85... |
from heatclient.common import http
from heatclient import exc
from heatclient.openstack.common import jsonutils
from keystoneclient.v2_0 import client as ksclient
def script_keystone_client(token=None):
if token:
ksclient.Client(auth_url='http://no.where',
insecure=False,
... | {
"content_hash": "ea4bcd33cdfa984904bda9d8576acbbd",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 73,
"avg_line_length": 29.548387096774192,
"alnum_prop": 0.5316593886462883,
"repo_name": "jasondunsmore/python-heatclient",
"id": "5e8c4416ffb84be6cff77e73bcd07204a060ba9e"... |
import unittest
import os
os.environ['MIAMI_ENV'] = 'test'
import miami
from miami.models import Task, TimeSlot, User, Team, Burning
from datetime import datetime
from mockito import when, unstub
def create_entity(entity):
miami.db.session.add(entity)
miami.db.session.commit()
class JobTest(unittest.TestCas... | {
"content_hash": "c3dd49c315f414aa8ec3d46ca5f087bc",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 154,
"avg_line_length": 35.96296296296296,
"alnum_prop": 0.6436663233779608,
"repo_name": "archiechen/miami",
"id": "50945e4dd450054ab13d9c5966f6e730a7f04e13",
"size": "194... |
import sys, os, subprocess
ADDR2LINE = "addr2line"
NULL_DEREF_READ = 0
NULL_DEREF_WRITE = 1
MISALIGN_READ = 2
MISALIGN_WRITE = 3
WRITE_OOB = 4
READ_OOB = 5
READ_UNINIT = 6
UNBOUND_MALLOC = 7
msg2code = [("Possible NULL ptr dereference (read)", NULL_DEREF_READ),
("Possible NULL ptr dereference (write)", N... | {
"content_hash": "a15527b53df93db8b12ec860ec81d638",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 102,
"avg_line_length": 35.79775280898876,
"alnum_prop": 0.5834902699309479,
"repo_name": "bitblaze-fuzzball/d-s-se-directed-tests",
"id": "edfa5638d49b91818608422ec75a9eedc6... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^signup/$', views.SignupUserView.as_view(), name='signup'),
url(r'^login/$', views.LoginUserView.as_view(), name='login'),
url(r'^logout/$', 'django.contrib.auth.views.logout',
{'next_page': '/'}, name='log... | {
"content_hash": "484e3eae33a371a0ba7625e2d3e12061",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 69,
"avg_line_length": 32.8,
"alnum_prop": 0.5975609756097561,
"repo_name": "tuanquanghpvn/bideox",
"id": "d8ecb22760d0b30e4ba49bd07bce7b249d208f6b",
"size": "328",
"bina... |
from setuptools import setup
setup(name='mousedb',
version='1.1.1',
description="MouseDB is a data management and analysis system for experimental animals",
long_description=open('README.rst').read(),
author='Dave Bridges',
author_email='[email protected]',
license='BSD 2-Claus... | {
"content_hash": "254a0349839ceda686cc6662027ab6ff",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 94,
"avg_line_length": 31.27777777777778,
"alnum_prop": 0.5896980461811723,
"repo_name": "davebridges/mousedb",
"id": "7fd355471df2c293fec5534748aaf8518ddc2e0b",
"size": "5... |
"""
This is a TiddlyWeb plugin which extends the TiddlyWeb filter syntax
to add 'oom' (One Of Many) which matches if the named attribute is any
of those named in the provided list. It is similar to
tiddlywebplugins.mselect but only matches the named attribute against
many values, not many possible attributes.
This wi... | {
"content_hash": "c33fd42df969e91ff9907832e88177b7",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 76,
"avg_line_length": 27.397260273972602,
"alnum_prop": 0.6375,
"repo_name": "tiddlyweb/tiddlywebplugins.oom",
"id": "81c998847a743010f3bab4b8a254c747060f3a02",
"size": "2... |
"""
Test scaffold utilities.
"""
import unittest
from oe_utils.chem.scaffold import Scaffold
from openeye.oechem import *
class TestScaffold(unittest.TestCase):
"""
Test Scaffold.
"""
def setUp(self):
"""
Set up tests.
"""
smiles = 'C[C@@]1(C(=O)NC(=O)N(C1=O)C)C2=CCCCC... | {
"content_hash": "e91621d16649bd1842890eb35ddfeb6b",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 73,
"avg_line_length": 24.266666666666666,
"alnum_prop": 0.592032967032967,
"repo_name": "skearnes/color-features",
"id": "3c36866f8debd41844f9daaae3175ca6908a84a1",
"size"... |
"""Italian dictionary"""
it = {
"LANGUAGE": "Italiano",
# Client notifications
"config-cleared-notification": "Impostazioni iniziali ripristinate. I cambiamenti saranno memorizzati quando salverai una configurazione valida.",
"relative-config-notification": "Caricato i file di configurazione relativi... | {
"content_hash": "f049b43161a5f66bf671a4d93efcdddf",
"timestamp": "",
"source": "github",
"line_count": 504,
"max_line_length": 703,
"avg_line_length": 76.93849206349206,
"alnum_prop": 0.7316192588390025,
"repo_name": "NeverDecaf/syncplay",
"id": "ee18fbda39abe0c0face17be6835f088f8aa9fa0",
"size": ... |
"""
Blei's LDA-C format.
"""
from __future__ import with_statement
from os import path
import logging
from gensim import interfaces, utils
from gensim.corpora import IndexedCorpus
from six.moves import xrange
logger = logging.getLogger('gensim.corpora.bleicorpus')
class BleiCorpus(IndexedCorpus):
"""
Cor... | {
"content_hash": "f1bfc5624ab8ba01f4d41f5b7d1066b2",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 85,
"avg_line_length": 33.8,
"alnum_prop": 0.5694674556213017,
"repo_name": "ChenglongChen/topical_word_embeddings",
"id": "4290951e7f25ac41d62320d1a7d8c422eedea4e8",
"siz... |
"""The LBFGS attack
"""
import numpy as np
import tensorflow as tf
from cleverhans.attacks.attack import Attack
from cleverhans.compat import reduce_sum, softmax_cross_entropy_with_logits
from cleverhans.model import CallableModelWrapper, Model, wrapper_warning
from cleverhans import utils
from cleverhans import util... | {
"content_hash": "37cddcf37057d60393601b6907bccd9e",
"timestamp": "",
"source": "github",
"line_count": 319,
"max_line_length": 88,
"avg_line_length": 38.28526645768025,
"alnum_prop": 0.5550642757717187,
"repo_name": "cleverhans-lab/cleverhans",
"id": "3e7231915cd7b8b57292fd04fdce19328470770f",
"si... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('djangocms_tonicdev', '0003_auto_20160509_1538'),
]
operations = [
migrations.AddField(
model_name='tonicnotebookpluginmodel',
... | {
"content_hash": "f0ebb92d101d4f5c21158cbfaa7743c1",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 199,
"avg_line_length": 35.78260869565217,
"alnum_prop": 0.6415552855407047,
"repo_name": "TigerND/djangocms-tonicdev",
"id": "69b432dfb8ad4de14a57f5e4ddf66414f4484d98",
"s... |
import shutil
import sys
import os
import path
binDir = path.path("C:/Users/haggi/coding/lux/windows/Projects/luxrender/x64")
binDirA = path.path("C:/Users/haggi/coding/lux/windows/Projects/luxrays/x64")
binDest = path.path("C:/Users/haggi/coding/OpenMaya/src/mayaToLux/devkit/luxsdk/bin")
libDest = path.path("C:/User... | {
"content_hash": "8bfac4733f7f061d0eb217b1f1595bbf",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 87,
"avg_line_length": 37.76923076923077,
"alnum_prop": 0.6568228105906314,
"repo_name": "haggi/OpenMaya",
"id": "1c2083ec1de6d900357da8750a6a404a66a58499",
"size": "982",
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from abc import ABCMeta
from collections import MutableMapping
import sys
try:
from collections import UserDict
except ImportError:
from UserDict import UserDict
... | {
"content_hash": "824fe32b4e2e9d868f8f602da9a6162a",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 97,
"avg_line_length": 31.023952095808383,
"alnum_prop": 0.6014282956958116,
"repo_name": "AtomLinter/linter-pylama",
"id": "8fcdce40464de84002e81f17e47917ce1cc414ef",
"si... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import sys
from abc import abstractmethod
from contextlib import contextmanager
from six.moves import range
from twitter.common.collections import OrderedSe... | {
"content_hash": "9e40050df874dc835cc7710ed7b5a383",
"timestamp": "",
"source": "github",
"line_count": 556,
"max_line_length": 100,
"avg_line_length": 45.87589928057554,
"alnum_prop": 0.6700121535264829,
"repo_name": "ericzundel/pants",
"id": "cddb8d916edfeeeeacbe8f8b656dc028fed4cf0f",
"size": "25... |
import re
from typing import Dict, Iterable, Iterator, Mapping
from pants.option.config import Config
from pants.option.option_tracker import OptionTracker
from pants.option.parser import Parser
from pants.option.scope import GLOBAL_SCOPE, ScopeInfo
class InvalidScopeError(Exception):
pass
_empty_scope_compone... | {
"content_hash": "269d64d8d19dbd48e09f73ac707fb5a8",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 97,
"avg_line_length": 33.625,
"alnum_prop": 0.6520446096654275,
"repo_name": "tdyas/pants",
"id": "892311eef714f44b6a6f361de919054b0e06a0e8",
"size": "2822",
"binary": f... |
# Software License Agreement (BSD License) #
# #
# Copyright 2014 University of Utah #
# Scientific Computing and Imaging Institute #
... | {
"content_hash": "348ab9913cab51b6964b64c94a01f32c",
"timestamp": "",
"source": "github",
"line_count": 1253,
"max_line_length": 184,
"avg_line_length": 42.740622505985634,
"alnum_prop": 0.6438548007618479,
"repo_name": "joshua-cogliati-inl/raven",
"id": "a76b60cffbf932f0fbe64e9c3dd3dd5073b7d2b6",
... |
from django.conf.urls import include
from django.conf.urls import patterns
from django.conf.urls import url
from django.shortcuts import HttpResponse
from django.conf import settings
from tastypie.api import Api
from api.resources import UserResource
from api.resources import UserProfileResource
from api.resources i... | {
"content_hash": "727ada34b300fa400af08fa749da4a7d",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 96,
"avg_line_length": 42.44642857142857,
"alnum_prop": 0.5557425326041229,
"repo_name": "haystack/eyebrowse-server",
"id": "b1f25b657f11a555fc9ddddb617f30ccc00065cb",
"si... |
from ..token import Token
from .node import Node
from .identifier import Identifier
class IdentifierList(list, Node):
"""
Parse a list of identifiers.
"""
def __init__(self):
"""
Create a list of identifiers.
"""
super(IdentifierList, self).__init__()
@classmetho... | {
"content_hash": "181fb656ca2d5641fcd13086e3f5f12b",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 62,
"avg_line_length": 23.29787234042553,
"alnum_prop": 0.5360730593607306,
"repo_name": "CtrlC-Root/cse3341",
"id": "1154fda878cb5fdcf6cf772355ce270da16f7ff5",
"size": "10... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.