text stringlengths 4 1.02M | meta dict |
|---|---|
from __future__ import print_function
try:
import ConfigParser
except ImportError:
import configparser as ConfigParser
import mock
import os
import subprocess
from helpers import unittest
from luigi import six
import luigi
import luigi.cmdline
from luigi.mock import MockTarget
class SomeTask(luigi.Task):
... | {
"content_hash": "80325f63ca5f8cd302390e8437243021",
"timestamp": "",
"source": "github",
"line_count": 329,
"max_line_length": 151,
"avg_line_length": 42.209726443769,
"alnum_prop": 0.6297256426874055,
"repo_name": "edx/luigi",
"id": "feaea5db62b842f6b28e7205e960b246866341b0",
"size": "14490",
"... |
"""
* Copyright 2007,2008,2009 John C. Gunther
* Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
*
* Licensed under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http:#www.apache.org/lic... | {
"content_hash": "7c5ba57c9539dbadfc48e115927524b1",
"timestamp": "",
"source": "github",
"line_count": 3865,
"max_line_length": 195,
"avg_line_length": 36.32833117723157,
"alnum_prop": 0.6478929413356693,
"repo_name": "Hasimir/pyjs",
"id": "60b4e299b9d0a77c767967130b569af448983d8b",
"size": "14040... |
import sys
import random
lines = []
for line in sys.stdin:
lines.append(line)
#lines.sort()
length = len(lines)
for l in range(0,length):
choice = random.randint(0,len(lines)-1)
#print str(choice) + ' of ' + str(len(lines))
print lines.pop(choice),
| {
"content_hash": "a3135872517cbd846f208f1273684369",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 48,
"avg_line_length": 18.857142857142858,
"alnum_prop": 0.6590909090909091,
"repo_name": "timrdf/csv2rdf4lod-automation",
"id": "38bc1c66150621c019a345187666eb462d462299",
... |
from toontown.safezone import DGPlayground
from toontown.safezone import SafeZoneLoader
class DGSafeZoneLoader(SafeZoneLoader.SafeZoneLoader):
def __init__(self, hood, parentFSM, doneEvent):
SafeZoneLoader.SafeZoneLoader.__init__(self, hood, parentFSM, doneEvent)
self.playgroundClass = DGPlaygroun... | {
"content_hash": "958645060ac3f100f3e8761de146d2a8",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 83,
"avg_line_length": 47.43478260869565,
"alnum_prop": 0.6223648029330889,
"repo_name": "Spiderlover/Toontown",
"id": "7b5870a79d8b4254aeb1b7afb006e233576b8ef9",
"size": "... |
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListType
from pyangbind.lib.ya... | {
"content_hash": "2f00321e283a0d9c3c82353d04ee2de6",
"timestamp": "",
"source": "github",
"line_count": 519,
"max_line_length": 603,
"avg_line_length": 42.86897880539499,
"alnum_prop": 0.5935547665063599,
"repo_name": "napalm-automation/napalm-yang",
"id": "ea9b6405ab2269e679a8da87d9b69958e7dcaa91",
... |
from collections import abc
import itertools
import re
import sys
from neutron_lib.api import attributes
from neutron_lib.api.definitions import network as net_apidef
from neutron_lib import constants
from neutron_lib import context
from neutron_lib import exceptions
from neutron_lib.plugins import directory
from neut... | {
"content_hash": "cc2476fdce7b295a261f4a9eaefe21f1",
"timestamp": "",
"source": "github",
"line_count": 530,
"max_line_length": 112,
"avg_line_length": 42.8188679245283,
"alnum_prop": 0.6135101789019124,
"repo_name": "openstack/neutron",
"id": "dca079b3c980e378c1a5b92fc95fd93a458c8f60",
"size": "23... |
from __future__ import print_function
import subprocess
from simlammps import read_data_file
from simlammps.cuba_extension import CUBAExtension
from simphony.core.cuba import CUBA
lammps_script = """# example of creating lammps data file (to be then used by SimPhoNy"
dimension 2
atom_style atomic
# create geometry... | {
"content_hash": "e960d24c4955ba3b89273ed52518b381",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 87,
"avg_line_length": 27.135135135135137,
"alnum_prop": 0.7166334661354582,
"repo_name": "simphony/simphony-lammps-md",
"id": "24b2435717e16e2b744d392ca919ab596eff6357",
"... |
from pydevd_constants import * #@UnusedWildImport
try:
import cStringIO as StringIO #may not always be available @UnusedImport
except:
try:
import StringIO #@Reimport
except:
import io as StringIO
if USE_LIB_COPY:
import _pydev_threading as threading
else:
import threading
import ... | {
"content_hash": "3f3b579c0fe5da432abbbfca146d0251",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 107,
"avg_line_length": 33.41111111111111,
"alnum_prop": 0.6361822414366478,
"repo_name": "akiokio/centralfitestoque",
"id": "7c197efc2002cc9f74b385d90e0d981c36766701",
"si... |
from __future__ import print_function, division, absolute_import
from marvin.api.base import BaseView
import pytest
@pytest.fixture(autouse=True)
def baseview():
baseview = BaseView()
yield baseview
class TestBase(object):
def test_reset_results(self, baseview):
baseview.results = {'key1': 'val... | {
"content_hash": "ff7d2928e34dc166fe642cdd5feb19f9",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 98,
"avg_line_length": 36.4,
"alnum_prop": 0.6236263736263736,
"repo_name": "albireox/marvin",
"id": "1f48aec6a89dc4c49f44aa958b4e345358a362dd",
"size": "2051",
"binary":... |
import xadmin
from .models import Address, City, Country
xadmin.site.register(Address)
xadmin.site.register(City)
xadmin.site.register(Country)
| {
"content_hash": "85acd4533ca7b9eb50867ece87fd8ef2",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 42,
"avg_line_length": 18.375,
"alnum_prop": 0.8027210884353742,
"repo_name": "glasslion/django-sakila",
"id": "605ae2568f0fa470ece98a0cfa7f06c887626fe4",
"size": "147",
"... |
""" Classes to handle HTMLText and Catalogues in PubTal.
Copyright (c) 2004 Colin Stewart (http://www.owlfish.com/)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source c... | {
"content_hash": "302ca2bc0de30e56b221b899693a9e66",
"timestamp": "",
"source": "github",
"line_count": 360,
"max_line_length": 135,
"avg_line_length": 41.58611111111111,
"alnum_prop": 0.7207267383608309,
"repo_name": "owlfish/pubtal",
"id": "1bdc4211059e0df2ee210ac9c42464b89c04625c",
"size": "1497... |
"""Pyhole Entertainment Plugin"""
import re
from BeautifulSoup import BeautifulSoup
from pyhole import plugin
from pyhole import utils
class Entertainment(plugin.Plugin):
"""Provide access to entertaining sites"""
@plugin.hook_add_command("grouphug")
@utils.spawn
def grouphug(self, params=None, **... | {
"content_hash": "3c882d9944d9c75f63b8bca840900787",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 73,
"avg_line_length": 31.88095238095238,
"alnum_prop": 0.6109036594473488,
"repo_name": "rconradharris/pyhole",
"id": "14e6abcfae3fdd8cd6b185a3624dc6661aa7bfe5",
"size": "... |
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, p... | {
"content_hash": "c9e72d872cf6642b2b4eace9ddbd9bd8",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 299,
"avg_line_length": 52.4,
"alnum_prop": 0.7251908396946565,
"repo_name": "cernops/CloudMan",
"id": "d47073cec3bb406edd140047e4501eb267202b52",
"size": "524",
"binary"... |
""" Transform Python code by omitting strings, comments, and/or code.
"""
from cStringIO import StringIO
import os
import shlex
import string
import sys
import tokenize
import grin
__version__ = '1.2'
class Transformer(object):
""" Transform Python files to remove certain features.
"""
def __init__(se... | {
"content_hash": "9aec32b7e186d56fe0322124d981c4f8",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 79,
"avg_line_length": 32.58064516129032,
"alnum_prop": 0.5782178217821782,
"repo_name": "lecheel/grin",
"id": "31e23ee4e3e5fc6e4ae2bbfcb06754a8d84c48e9",
"size": "4086",
... |
"""
Execute tasks through strace to obtain dependencies after the process is run. This
scheme is similar to that of the Fabricate script.
To use::
def configure(conf):
conf.load('strace')
WARNING:
* This will not work when advanced scanners are needed (qt4/qt5)
* The overhead of running 'strace' is significan... | {
"content_hash": "d446f629a5fd841f2fbb5889022432bb",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 127,
"avg_line_length": 23.735294117647058,
"alnum_prop": 0.6537794299876084,
"repo_name": "MarekIgnaszak/econ-project-templates",
"id": "37d82cbb724b14f4068415f2d49d3e9f60d... |
"""
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"); you may not use this ... | {
"content_hash": "f4bf50c6ed1827246a3af397bce00403",
"timestamp": "",
"source": "github",
"line_count": 268,
"max_line_length": 138,
"avg_line_length": 33.406716417910445,
"alnum_prop": 0.660895789120965,
"repo_name": "radicalbit/ambari",
"id": "ee950e83cf7b68c7efd3dfa70f14c358304cfef2",
"size": "8... |
from mock import patch
from channel_facebook.channel import TriggerType
from core.channel import (NotSupportedTrigger, ConditionNotMet)
from core.models import Channel, Trigger
from .test_base import FacebookBaseTestCase
class ChannelTriggerTestCase(FacebookBaseTestCase):
def test_fire_trigger_post(self):
... | {
"content_hash": "894d699c40a0c6c81d88a65f48328efe",
"timestamp": "",
"source": "github",
"line_count": 426,
"max_line_length": 128,
"avg_line_length": 50.04929577464789,
"alnum_prop": 0.5289151540734487,
"repo_name": "daisychainme/daisychain",
"id": "876126f198a057bc9aa5631aea9de915e88942bd",
"siz... |
import json
import os
import sys
root_dir = sys.argv[1]
answer_path = sys.argv[2]
file_names = os.listdir(root_dir)
num_correct = 0
num_wrong = 0
with open(answer_path, 'r') as fh:
id2answer_dict = json.load(fh)
for file_name in file_names:
if not file_name.endswith(".question"):
continue
with o... | {
"content_hash": "20f3a764bd97ee2edb10b858db6956e1",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 60,
"avg_line_length": 25.842105263157894,
"alnum_prop": 0.5488798370672098,
"repo_name": "allenai/bi-att-flow",
"id": "33d99363ec31ba8ac7a79a4d4a4c1f4b4bf1530e",
"size": "... |
import cStringIO
import logging
logger = logging.getLogger(__name__)
# import volatility.plugins.gui.messagehooks as messagehooks
LOPHI_TIMEOUT = 100
LOPHI_RETRIES = 5
pil_installed = True
try:
from PIL import Image, ImageDraw
except ImportError:
pil_installed = False
class VolatilityWrapper:
... | {
"content_hash": "36c96ab1e6034d5e68951f23127b0b7a",
"timestamp": "",
"source": "github",
"line_count": 604,
"max_line_length": 112,
"avg_line_length": 38.061258278145694,
"alnum_prop": 0.48979946931140983,
"repo_name": "mit-ll/LO-PHI",
"id": "afdcabbb58083c69574f88e6ba69983514440adb",
"size": "229... |
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
class Book(models.Model):
title = models.CharField(max_length=50)
year = models.PositiveIntegerField(null=True, blank=True)
author = models.ForeignKey(User, verbose_name="Verbose Author", rela... | {
"content_hash": "ff52bbf941f49eef32921c4b6394e2bf",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 141,
"avg_line_length": 38.1875,
"alnum_prop": 0.7242225859247136,
"repo_name": "paulproteus/django",
"id": "371c67061f2435e7dd0b4b2d4ad3773f2ca386e9",
"size": "1222",
"b... |
from django.contrib import admin
from import_export.admin import ExportMixin
from models import (Poll, PollComment, RadioPoll, RadioPollChoice,
RangePoll, RangePollChoice, Vote)
class RangePollChoiceInline(admin.StackedInline):
"""Poll Range Votes Inline."""
model = RangePollChoice
e... | {
"content_hash": "33b382744f5ca2d1611017a9e1f0cc57",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 73,
"avg_line_length": 27,
"alnum_prop": 0.6976229961304589,
"repo_name": "johngian/remo",
"id": "5934a4dbf44ee1c339cb45c5607285147e6584ef",
"size": "1809",
"binary": fal... |
"""Tests for the T9 model."""
from pynini.examples import t9
from absl.testing import absltest
class T9Test(absltest.TestCase):
t9: t9.T9
@classmethod
def setUpClass(cls):
super().setUpClass()
lexicon = [
"the", "cool", "warthog", "escaped", "easily", "from", "baltimore",
"zoo", "col... | {
"content_hash": "9cd3ec31a5360b3a9fe102026140589e",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 75,
"avg_line_length": 21.03448275862069,
"alnum_prop": 0.6360655737704918,
"repo_name": "kylebgorman/pynini",
"id": "3257ac269ef456c1d9c04717b4c56f5463c056ad",
"size": "12... |
from swgpy.object import *
def create(kernel):
result = Static()
result.template = "object/static/space/debris/shared_death_star_debris_f.iff"
result.attribute_template_id = -1
result.stfName("obj_n","unknown_object")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "7f0a652702aa367a26aba6da9d319e7c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 78,
"avg_line_length": 23.615384615384617,
"alnum_prop": 0.6905537459283387,
"repo_name": "obi-two/Rebelion",
"id": "3262df0347889b464ed89f940627950e22998d6b",
"size": "452... |
from __future__ import unicode_literals, print_function, division, absolute_import
from pprint import pprint
import threading
import string
import logging
import multiprocessing
from six.moves import queue
import six
import errors
import settings
import taskq
import webservice
import notifier
logger = logging.getLo... | {
"content_hash": "ea3ac577c4e3cc5c922853709db76a92",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 134,
"avg_line_length": 35.93103448275862,
"alnum_prop": 0.5937300063979527,
"repo_name": "bisphon/pontiac",
"id": "eacb80d63cd06412fcb44e898d63aec359b568a2",
"size": "625... |
"""mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-base... | {
"content_hash": "9ec9e90112dca57b658ce92a499343c7",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 77,
"avg_line_length": 36.22727272727273,
"alnum_prop": 0.6938519447929736,
"repo_name": "mishka28/NYU-Python",
"id": "80e7b0447250710397a6ecae103cb13aa21341e8",
"size": "7... |
from greetings import greet
def test_greet_the_world():
assert greet("world") == "Hello, world!"
| {
"content_hash": "5ac8d2d1f528f6babc44bf745f09d2d6",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 44,
"avg_line_length": 20.6,
"alnum_prop": 0.6796116504854369,
"repo_name": "PPPoSD-2017/greetings",
"id": "68dea7cdf284a80805f2b1258b5706a7b275eb44",
"size": "103",
"bina... |
import os
from oslo.serialization import jsonutils as json
from daisy.common import client as base_client
from daisy.common import exception
from daisy import i18n
_ = i18n._
class CacheClient(base_client.BaseClient):
DEFAULT_PORT = 9292
DEFAULT_DOC_ROOT = '/v1'
def delete_cached_image(self, image_id... | {
"content_hash": "170723030a1aa446c91e233f51a18f5b",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 78,
"avg_line_length": 30.04237288135593,
"alnum_prop": 0.5847672778561354,
"repo_name": "OpenDaisy/daisy-api",
"id": "f3c2a2828f9486b83ad288693fddb4893698d581",
"size": "... |
"""
__graph_StateMachineElement.py___________________________________________________________
Automatically generated graphical appearance ---> MODIFY DIRECTLY WITH CAUTION
_________________________________________________________________________________________
"""
import tkFont
from graphEntity import *
from Gr... | {
"content_hash": "de8a5a667452bbce03a332e6a21f0a67",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 215,
"avg_line_length": 45.97014925373134,
"alnum_prop": 0.6038961038961039,
"repo_name": "levilucio/SyVOLT",
"id": "9da2e04b691b0d51c343ac38612412c40e3265fd",
"size": "308... |
import functools
import numpy as np
from scipy.stats import norm as ndist
import regreg.api as rr
from selection.tests.instance import gaussian_instance
from selection.learning.utils import (partial_model_inference,
pivot_plot,
lee_inference)
fr... | {
"content_hash": "77158e0a48355b2fe9ec2c4f35f647e8",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 136,
"avg_line_length": 33.425925925925924,
"alnum_prop": 0.4700831024930748,
"repo_name": "selective-inference/selective-inference",
"id": "d81ff4cb1b3a0dc7afba52483bf38fb0... |
from django.views.generic import TemplateView
class ExampleView(TemplateView):
def get_context_data(self, **kwargs):
context = super(self, ExampleView).get_context_data(**kwargs)
# context['form'] = form | {
"content_hash": "23a0ad311960bbcaa08d822b93208860",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 69,
"avg_line_length": 32.142857142857146,
"alnum_prop": 0.6977777777777778,
"repo_name": "un33k/django-dropzone",
"id": "6ef3f13806e13274a081f2615f307af504365fd0",
"size": ... |
import requests
import json
from conf import appid, apikey, sender, receivers, content
url = 'https://api.bluehouselab.com/smscenter/v1.0/sendsms'
params = {
'sender' : sender,
'receivers' : receivers,
'content' : content,
}
headers = {'Content-type': 'application/json; charset=utf-8',}
r = request... | {
"content_hash": "fd54fd192e4332bfb65aceffe18e1c30",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 62,
"avg_line_length": 28.647058823529413,
"alnum_prop": 0.6632443531827515,
"repo_name": "BlueHouseLab/sms-openapi",
"id": "1f3f7a2de8cba2a589cbf34d2f53fd51bba6e1d7",
"siz... |
"""matplotlib_kit package driver file.
Inserts the following modules in sys.modules: matplotlib, pylab.
@author: Charl P. Botha <http://cpbotha.net/>
"""
import os
import re
import sys
import types
# you have to define this
VERSION = ''
def init(theModuleManager, pre_import=True):
if hasattr(sys, 'frozen') an... | {
"content_hash": "cc44d592364385b685eccdeaa684107a",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 81,
"avg_line_length": 34.94736842105263,
"alnum_prop": 0.6863704819277109,
"repo_name": "zhangfangyan/devide",
"id": "54499ba91041c1406c4e3c5706dbe2d5e6e2bf88",
"size": "2... |
import uuid
import types
from traitlets import (
HasTraits,
Instance,
default
)
def issue(self, message, exc=None):
"""Accepts a message that will be logged with an additional reference
code for easy log lookup.
The identifier will be returned for inclusion in user-visible
error messages... | {
"content_hash": "d065f5bdd41cf859e0d444d96fa9dadc",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 78,
"avg_line_length": 22.88372093023256,
"alnum_prop": 0.6239837398373984,
"repo_name": "simphony/simphony-remote",
"id": "fddc6f688246c29e383eac125a071a172a6a0855",
"size... |
"""Unit tests for Superset"""
import json
import pytest
import prison
from sqlalchemy.sql import func
import tests.integration_tests.test_app
from superset import db
from superset.models.annotations import Annotation, AnnotationLayer
from tests.integration_tests.base_tests import SupersetTestCase
from tests.integrat... | {
"content_hash": "9deb0bf589fdcf603211d2b3338f09eb",
"timestamp": "",
"source": "github",
"line_count": 732,
"max_line_length": 97,
"avg_line_length": 36.78825136612022,
"alnum_prop": 0.5853912139329348,
"repo_name": "zhouyao1994/incubator-superset",
"id": "61f6b2ff678295c85dc0326a2306ef29bc4bb5c3",
... |
from Signal import Signal
import numpy as np
class LMSAdaptiveFilter:
"""
The LMS Adaptive Filter.
"""
def __init__(self, order, damping=0.5):
self.order = order
self.damping = damping
self.X = Signal(order)
self.Y = Signal(order)
self.weights = [0] * order
... | {
"content_hash": "1dfd6a3ef1f6c92bf8f6048af7b0744c",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 64,
"avg_line_length": 26.933333333333334,
"alnum_prop": 0.5433168316831684,
"repo_name": "111t8e/h2o-2",
"id": "f38e98bc1a93082dd91db0c9a92240ea44e11e22",
"size": "808",
... |
from pyface.qt import QtGui
# Enthought library imports.
from traits.api import Bool, provides, Unicode
# Local imports.
from pyface.i_directory_dialog import IDirectoryDialog, MDirectoryDialog
from dialog import Dialog
@provides(IDirectoryDialog)
class DirectoryDialog(MDirectoryDialog, Dialog):
""" The toolkit... | {
"content_hash": "ff5b36eb0296eea8aa9c4fb3aea10bf4",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 79,
"avg_line_length": 29.97142857142857,
"alnum_prop": 0.47283126787416585,
"repo_name": "brett-patterson/pyface",
"id": "4c6336275ab7422ea0ab7333aaf62f858cd3b6dd",
"size"... |
'''
Affine invariant feature-based image matching sample.
This sample is similar to find_obj.py, but uses the affine transformation
space sampling technique, called ASIFT [1]. While the original implementation
is based on SIFT, you can try to use SURF or ORB detectors instead. Homography RANSAC
is used to reject outli... | {
"content_hash": "27f62bdd7e8ef5f51be44f4561efd3cb",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 101,
"avg_line_length": 32.838509316770185,
"alnum_prop": 0.5969358804615094,
"repo_name": "zzjkf2009/Midterm_Astar",
"id": "f2b0e7999535df29dd4e1c3c1221d3f04f13db61",
"si... |
from __future__ import absolute_import, unicode_literals
from functools import wraps
import time
import celery
from celery.schedules import crontab
from elasticsearch.helpers import scan
from elasticsearch.exceptions import NotFoundError
from oclubs.access import done, database, elasticsearch, redis
from oclubs.acce... | {
"content_hash": "9691816b40833af0feee559ad5dd4a95",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 78,
"avg_line_length": 28.725225225225227,
"alnum_prop": 0.5220323035910303,
"repo_name": "SHSIDers/oclubs",
"id": "e88045cbe6feba07da0ddf6f65d7a9d8342e8ad0",
"size": "642... |
"""This module contains methods to produce a formatted string to be sent through the Telegram API.
"""
import math
import html
import itertools
import logging
import exceptions
import constants
from objects.answer import TelegramAnswer
from objects.answer import TelegramCallbackAnswer
from objects.answer import Telegr... | {
"content_hash": "ab90914d2145803ff8b9b304991a1fbc",
"timestamp": "",
"source": "github",
"line_count": 248,
"max_line_length": 139,
"avg_line_length": 36.53629032258065,
"alnum_prop": 0.6447411985432071,
"repo_name": "crash-g/BoardGameBot",
"id": "9909c766685c047fbfdbfa77371849e33e2cd34c",
"size":... |
from django.contrib.gis import forms
from django.contrib.gis.db.models.lookups import gis_lookups
from django.contrib.gis.db.models.proxy import SpatialProxy
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geometry.backend import Geometry, GeometryException
from django.core.exceptions import I... | {
"content_hash": "769c26983b4b2d3ead0b9a924c553d15",
"timestamp": "",
"source": "github",
"line_count": 444,
"max_line_length": 117,
"avg_line_length": 39.86486486486486,
"alnum_prop": 0.6248587570621469,
"repo_name": "yephper/django",
"id": "20b6a50687e68059ccbc6ac8d0811d5dd49d6e54",
"size": "1770... |
from flask import _app_ctx_stack
from flask import current_app as app
from flask import Flask, request, session, url_for, redirect, \
render_template, abort, g, flash, _app_ctx_stack
from sqlite3 import dbapi2 as sqlite3
from hashlib import md5
from datetime import datetime
def get_db():
"""Opens a new databa... | {
"content_hash": "67eba6559bd22efa73f741226b1286a9",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 76,
"avg_line_length": 32.25,
"alnum_prop": 0.6501937984496124,
"repo_name": "bridgetnoelleee/project2",
"id": "e2b3a92eba2fe4c95b358c2246d3622aa8572d97",
"size": "2064",
... |
import django_admin_blocks
from linkcheck.views import get_status_message
"""Legacy internal helper"""
def notification():
return get_status_message()
django_admin_blocks.register({
'errors': (notification,),
})
| {
"content_hash": "f856ba1cf70948710fa90a0af1e5adbe",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 46,
"avg_line_length": 16.142857142857142,
"alnum_prop": 0.7212389380530974,
"repo_name": "claudep/django-linkcheck",
"id": "e800fb31bbb144caf4c3e4aaacc2709d606dcf06",
"siz... |
"""Ops to manipulate lists of tensors."""
# pylint: disable=g-bad-name
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.core.framework import types_pb2
from tensorflow.python.framework import cpp_shape_inference_pb2
from t... | {
"content_hash": "19466454f1249a77cde4a9c48d489efe",
"timestamp": "",
"source": "github",
"line_count": 399,
"max_line_length": 81,
"avg_line_length": 35.478696741854634,
"alnum_prop": 0.6876236224922294,
"repo_name": "freedomtan/tensorflow",
"id": "f4da26ccb949cd83a6630879140779d51c64bd4e",
"size"... |
import copy
import mock
import six
from heat.common import exception
from heat.common import grouputils
from heat.common import template_format
from heat.engine import resource
from heat.engine.resources.openstack.heat import instance_group as instgrp
from heat.engine import rsrc_defn
from heat.engine import schedule... | {
"content_hash": "cbfc985384c417185a2ebbdf2c60bca6",
"timestamp": "",
"source": "github",
"line_count": 367,
"max_line_length": 79,
"avg_line_length": 40.76021798365122,
"alnum_prop": 0.5896116050538137,
"repo_name": "rh-s/heat",
"id": "81099ad931e79bc6d1fe2fc80cc7be1e39f6f0c0",
"size": "15534",
... |
"""EmPOWER cell pool and cell classes."""
from empower.core.serialize import serializable_dict
class CellPool(list):
"""Cell pool.
Extends the list in order to add a few filtering and sorting methods
"""
def sort_by_rsrp(self, ue_id):
"""Return list sorted by rsrp for the specified address.... | {
"content_hash": "5dd5c237046300ce254d308385d901a5",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 72,
"avg_line_length": 27.19298245614035,
"alnum_prop": 0.5590322580645162,
"repo_name": "rriggio/empower-runtime",
"id": "23f33be5d7d6fce6738ea6b8225e13cfed4cfe4e",
"size... |
"""Tools to work with checkpoints."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
from tensorflow.python.ops import io_ops
from tensorflow.python.ops import state_ops
from tensorflow.python.ops import variable_scope as vs
from tensorflow.pyt... | {
"content_hash": "ed06d7f30cdd00d65a5c2f31c9c37a4a",
"timestamp": "",
"source": "github",
"line_count": 314,
"max_line_length": 102,
"avg_line_length": 39.554140127388536,
"alnum_prop": 0.6485507246376812,
"repo_name": "vrv/tensorflow",
"id": "ffa39b77930ca42c735caf4bc76c4bdcf783a8dd",
"size": "131... |
"""Node classes for the AST for a Mojo IDL file."""
# Note: For convenience of testing, you probably want to define __eq__() methods
# for all node types; it's okay to be slightly lax (e.g., not compare filename
# and lineno). You may also define __repr__() to help with analyzing test
# failures, especially for more c... | {
"content_hash": "af48331556017e8e95aec9764bf77081",
"timestamp": "",
"source": "github",
"line_count": 414,
"max_line_length": 80,
"avg_line_length": 35.28502415458937,
"alnum_prop": 0.6645673603504929,
"repo_name": "endlessm/chromium-browser",
"id": "c9b6605cf43a4a1a25efefbbbb4ce52ac3477f8e",
"si... |
"""
(c) Copyright 2016 Hewlett-Packard Enterprise Development Company, L.P.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applic... | {
"content_hash": "b94c46d8d2ea610d4943804150dec01b",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 72,
"avg_line_length": 29.785714285714285,
"alnum_prop": 0.6510791366906474,
"repo_name": "szaher/freezer-api",
"id": "ba40e97b0773421195b9390864b2e64c0500ea97",
"size": "1... |
from __future__ import print_function
from builtins import str
import sys
import os
from vmrunner import vmrunner
import socket
# Get an auto-created VM from the vmrunner
vm = vmrunner.vms[0]
def UDP_test():
print("<Test.py> Performing UDP tests")
HOST, PORT = "10.0.0.55", 4242
sock = socket.socket
# SOCK_DGR... | {
"content_hash": "5f14a29b5e7985980153bd332ef47376",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 74,
"avg_line_length": 30.14423076923077,
"alnum_prop": 0.6669856459330143,
"repo_name": "AnnikaH/IncludeOS",
"id": "c54983496ec661a763e20c172925247bf3c68e69",
"size": "31... |
from .models import Place, Location, Activity
from django.core import serializers
from django.http import HttpResponse
from collections import Counter
from json import dumps
# Create your views here.
def get_locations(request):
location = request.GET.get('id')
locations = Location.objects.filter(activites_id=... | {
"content_hash": "c7027cd7bfaec80d2bb72a6f12ca3b2b",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 66,
"avg_line_length": 31.542857142857144,
"alnum_prop": 0.6512681159420289,
"repo_name": "silentninja/trippal",
"id": "7af34513f79d318e03bf8ead3e1d575333604b48",
"size": "... |
"""Treadmill Tenant REST api.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import flask
import flask_restplus as restplus
from flask_restplus import fields
# Disable E0611: No 'name' in module
from treadmill i... | {
"content_hash": "d5d87ed3a80f5c5418046f9594914e3d",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 78,
"avg_line_length": 32.074074074074076,
"alnum_prop": 0.5800615858352579,
"repo_name": "captiosus/treadmill",
"id": "fae63938c6752ccf991e7912f04f19cd62f01fe1",
"size": "... |
import time
def main(request, response):
response.add_required_headers = False # Don't implicitly add HTTP headers
response.writer.write_status(200)
response.writer.write_header("Content-Type", "text/html")
response.writer.end_headers()
response.writer.write(b'<!DOCTYPE html><script src="script.py... | {
"content_hash": "843461145b20685d89c347c9390b443a",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 129,
"avg_line_length": 43.90909090909091,
"alnum_prop": 0.6977225672877847,
"repo_name": "nwjs/chromium.src",
"id": "c72c469ce3cd23580f88713cefcc2799fed8ad66",
"size": "48... |
from tkinter import *
"""/*
Class: ArenaPanel
Abstract super class for all <Panel> objects to be used as children in
the <ArenaGUI>.
Provides an interface for panel specific methods, and some helper
methods
*/"""
class ArenaPanel(LabelFrame):
"""/*
Group: Constructors
*/"""
""... | {
"content_hash": "6f671cdefbad3d1d376c30ab67e06c91",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 77,
"avg_line_length": 28.72222222222222,
"alnum_prop": 0.5838168923275306,
"repo_name": "ExceptionalVoid/Arena",
"id": "c7416412b198cd6e34208a09aa9f09a49b94aede",
"size":... |
import pyxb.binding.generate
import pyxb.utils.domutils
from xml.dom import Node
import os.path
xsd='''<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="a"/>
<xs:element name="b"/>
<xs:element name="c"/>
<xs:element name="d"/>
<xs:element name="e... | {
"content_hash": "24ad1f6c6ae46d4917ab93f07d8e8123",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 60,
"avg_line_length": 25.07,
"alnum_prop": 0.5907459114479457,
"repo_name": "jonfoster/pyxb1",
"id": "1fa7177178ff60827682b1376ca2af7b1212daee",
"size": "2507",
"binary... |
__all__ = ('config', 'logger', )
from hotqueue import HotQueue
from ConfigParser import ConfigParser
from os.path import dirname, join, exists
from redis import Redis
import json
# configuration
config = ConfigParser()
config.add_section('www'),
config.set('www', 'baseurl', 'http://android.kivy.org/')
config.set('www... | {
"content_hash": "958c1d43d65b704e6e6ef8750e103e84",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 56,
"avg_line_length": 23.6,
"alnum_prop": 0.6661016949152543,
"repo_name": "kivy/p4a-cloud",
"id": "8af2cf12151a9f9eafb13f8d0f95f77ec7dded22",
"size": "1180",
"binary": ... |
import logging
from framework.celery_tasks.handlers import enqueue_task
from website import settings
logger = logging.getLogger(__name__)
if settings.SEARCH_ENGINE == 'elastic':
import elastic_search as search_engine
else:
search_engine = None
logger.warn('Elastic search is not set to load')
def requir... | {
"content_hash": "f9457fdb6c2febe42ef1487aa847da68",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 111,
"avg_line_length": 33.968,
"alnum_prop": 0.6938294865756006,
"repo_name": "caseyrollins/osf.io",
"id": "b49d2ee4dc90e77956d7b4cc7029aa7a5fa37a48",
"size": "4246",
"... |
"""Package loc."""
| {
"content_hash": "24dd88bdae48be2a9db22633e67fec70",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 18,
"avg_line_length": 19,
"alnum_prop": 0.5263157894736842,
"repo_name": "Nachtfeuer/pipeline",
"id": "620e10ea52bb5b463e8fed39a45291c4340541c1",
"size": "19",
"binary": ... |
class Solution(object):
def maxProfit(self, prices, fee):
"""
:type prices: List[int]
:type fee: int
:rtype: int
"""
hold, not_hold = None, 0
for p in prices:
hold, not_hold = max(hold, not_hold - p - fee), max(not_hold, None if hold is None else h... | {
"content_hash": "3951c59b33307cc0218adf30feead9c2",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 109,
"avg_line_length": 33.09090909090909,
"alnum_prop": 0.5247252747252747,
"repo_name": "ckclark/leetcode",
"id": "be308ed80dab3a60b42aa4b10814f2d675614187",
"size": "364... |
from django.core.urlresolvers import reverse
from django.core.urlresolvers import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms
from horizon import tables
from horizon import tabs
from horizon.utils import memoized
from horizon import work... | {
"content_hash": "541ec4a3391fe4d8ccb68eebc9f93108",
"timestamp": "",
"source": "github",
"line_count": 308,
"max_line_length": 79,
"avg_line_length": 38.90584415584416,
"alnum_prop": 0.5940081782525244,
"repo_name": "kogotko/carburetor",
"id": "954b5e4a1bbfedf33154a3bf474005b5796684e6",
"size": "1... |
"""Replay buffer that performs relabeling."""
import gin
import numpy as np
import tensorflow as tf
from tf_agents.replay_buffers import tf_uniform_replay_buffer
from tf_agents.utils import common
@gin.configurable
class RelabellingReplayBuffer(tf_uniform_replay_buffer.TFUniformReplayBuffer):
"""A replay buffer th... | {
"content_hash": "94d7166c28ba5335584f26ee557b5e2f",
"timestamp": "",
"source": "github",
"line_count": 298,
"max_line_length": 80,
"avg_line_length": 44.84228187919463,
"alnum_prop": 0.631519868293048,
"repo_name": "google-research/google-research",
"id": "54716e6008a390eb643f7a60244110c0f0e4131b",
... |
"""
kinto
Kinto is a minimalist JSON storage service with synchronisation and sharing abilities. It is meant to be easy to use and easy to self-host. **Limitations of this OpenAPI specification:** 1. Validation on OR clauses is not supported (e.g. provide `data` or `permissions` in patch operations). 2.... | {
"content_hash": "67a23858cf93082e79a80373a4aba0f0",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 973,
"avg_line_length": 61.23076923076923,
"alnum_prop": 0.7283291457286433,
"repo_name": "gabisurita/kinto-codegen-tutorial",
"id": "a094f2ec051d01ba496489b2bddbc6472c2e6bcf... |
import json
from dojo.models import Finding
class SemgrepParser(object):
def get_scan_types(self):
return ["Semgrep JSON Report"]
def get_label_for_scan_types(self, scan_type):
return scan_type # no custom label for now
def get_description_for_scan_types(self, scan_type):
retu... | {
"content_hash": "b83c70f58ac964667b35ce8d662044f3",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 107,
"avg_line_length": 32.411764705882355,
"alnum_prop": 0.5078039927404718,
"repo_name": "rackerlabs/django-DefectDojo",
"id": "684000da70f2c4d83e245f32294aaf89f5b5ebe7",
... |
"""
sentry.runner.commands.init
~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2015 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import os
import click
@click.command()
@click.argument('directory', required=Fal... | {
"content_hash": "1bde408776522c9b6863025b980f4cf5",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 106,
"avg_line_length": 32.6530612244898,
"alnum_prop": 0.67625,
"repo_name": "nicholasserra/sentry",
"id": "98ece4d40b797013ab8d6958e0514cdb9e0437b0",
"size": "1600",
"b... |
"""Prefix DAG permissions.
Revision ID: 849da589634d
Revises: 45ba3f1493b9
Create Date: 2020-10-01 17:25:10.006322
"""
from flask_appbuilder import SQLA
from flask_appbuilder.security.sqla.models import Permission, PermissionView, ViewMenu
from airflow import settings
from airflow.security import permissions
# rev... | {
"content_hash": "caed6ef651778b158e0703bd85362495",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 100,
"avg_line_length": 32.046052631578945,
"alnum_prop": 0.7039622254157257,
"repo_name": "dhuang/incubator-airflow",
"id": "fbbaa3adc3a3e809a20b8c2992463f1d35214fd1",
"s... |
from .base import NewRelicBaseClient
from .exceptions import ItemAlreadyExistsError, ItemNotFoundError
from .synthetics import SyntheticsClient
class AlertClient(NewRelicBaseClient):
def __init__(
self, api_key,
base_url='https://api.newrelic.com',
timeout=10
):
super(AlertClie... | {
"content_hash": "ec2ce80cc528f9ef379d0ba1cf618e0f",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 78,
"avg_line_length": 34.229268292682924,
"alnum_prop": 0.5178851360980476,
"repo_name": "NativeInstruments/newrelic-cli",
"id": "fa7c34dbeabcfcba1e467b470f0416747ce0a2a6",... |
from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import (Net, RealApplianceSource,
BLSTMLayer, DimshuffleLayer,
Bidirectio... | {
"content_hash": "f8b03abcbc3004796ea02a2a0d2110de",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 86,
"avg_line_length": 31.00995024875622,
"alnum_prop": 0.5725974651050858,
"repo_name": "mmottahedi/neuralnilm_prototype",
"id": "8d27f232604f49dc75f6c2a0ac6c57117e57c4c8",... |
"""This module exports the jscs plugin class."""
from SublimeLinter.lint import Linter
class Jscs(Linter):
"""Provides an interface to jscs."""
syntax = ('javascript', 'html')
cmd = 'jscs -r checkstyle'
version_args = '--version'
version_re = r'(?P<version>\d+\.\d+\.\d+)'
version_requiremen... | {
"content_hash": "4bcadf0fb54d11d64874858ae11d6391",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 78,
"avg_line_length": 30.8,
"alnum_prop": 0.574025974025974,
"repo_name": "Raynos/SublimeLinter-jscs",
"id": "5499b3ae747142c092a884029755d320c6b5564d",
"size": "948",
"... |
from blaze.interactive import Data, compute, concrete_head, expr_repr, to_html
import datetime
from odo import into, append
from odo.backends.csv import CSV
from blaze import discover, transform
from blaze.compute.core import compute
from blaze.compute.python import compute
from blaze.expr import symbol
from datashape... | {
"content_hash": "1beadb826e02c28f946a1afca05be7a6",
"timestamp": "",
"source": "github",
"line_count": 409,
"max_line_length": 94,
"avg_line_length": 25.278728606356967,
"alnum_prop": 0.581971177096431,
"repo_name": "caseyclements/blaze",
"id": "fb36543b58b6665f37ac252369c4f4902d30c254",
"size": "... |
import logging
from django.conf import settings
from django.utils.translation import gettext_lazy as _
import horizon
LOG = logging.getLogger(__name__)
class Aggregates(horizon.Panel):
name = _("Host Aggregates")
slug = 'aggregates'
policy_rules = (("compute", "compute_extension:aggregates"),)
per... | {
"content_hash": "b5e316e24f82b5830896c181c817a470",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 65,
"avg_line_length": 26.545454545454547,
"alnum_prop": 0.666095890410959,
"repo_name": "openstack/horizon",
"id": "315bef2e05ab8c784e54b1a0c016ec21d93bb342",
"size": "115... |
'''
Test Cases for DocumentConverter Class for WordCloud Project
Daniel Klein
Computer-Based Honors Program
The University of Alabama
9.27.2013
'''
import unittest
import os, os.path
from src.core.python.SupremeCourtOpinionFileConverter import SupremeCourtOpinionFileConverter
##### Here are all the global variables ... | {
"content_hash": "4372e8f01ac83998fff5895ca2a1c2ff",
"timestamp": "",
"source": "github",
"line_count": 371,
"max_line_length": 101,
"avg_line_length": 50.35309973045822,
"alnum_prop": 0.690594721909962,
"repo_name": "dmarklein/WordCloud",
"id": "87123ba6391e24dd49f979cc6f67422fac8c5782",
"size": "... |
"""wikisource.
Usage:
dasem.wikisource get <title>
dasem.wikisource list
Example:
$ python -m dasem.wikisource get Mogens
"""
from __future__ import print_function
import re
from bs4 import BeautifulSoup
import requests
from six import u
from .wikidata import query_to_dataframe
SPARQL_QUERY = """
SELE... | {
"content_hash": "a6b449a5fd9b5a9dec362b2fa6ab980a",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 79,
"avg_line_length": 24.47887323943662,
"alnum_prop": 0.6101841196777905,
"repo_name": "fnielsen/dasem",
"id": "e33432e08fe82ad7aa2af92e5d86c25d4b605d9a",
"size": "3476"... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence, PackedSequence
from sklearn.metrics import confusion_matrix
from utils import create_emb_layer
def accuracy(pred, label):
correct = []
for i in range(len(pred)):
... | {
"content_hash": "a2eed6f9cfcf94586bea18ce35cd87c7",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 121,
"avg_line_length": 41.84736842105263,
"alnum_prop": 0.48132310401207395,
"repo_name": "prakhar2b/Weekend-Projects",
"id": "134355699b05aacc960f2c1c81e861b80dc292d6",
... |
from django.conf.urls import patterns, url
urlpatterns = patterns(
'wagtail.wagtaildocs.views',
url(r'^(\d+)/(.*)$', 'serve.serve', name='wagtaildocs_serve'),
)
| {
"content_hash": "9283af09bc468161d3b1a67a58894ea9",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 66,
"avg_line_length": 28.333333333333332,
"alnum_prop": 0.6588235294117647,
"repo_name": "h2oloopan/easymerge",
"id": "5f8ddaf0398ec4dea20853470e3e8cfea80bc3fb",
"size": "1... |
import statsmodels.api as sm
from scipy.stats import norm
import numpy as np
import pytest
import scipy
import sys
import os
from respy.python.solve.solve_auxiliary import get_predictions
from codes.auxiliary import write_interpolation_grid
from codes.random_init import generate_init
from respy.python.shared.shared_... | {
"content_hash": "b8d4a9dde1cd3de6590b9105732b15cb",
"timestamp": "",
"source": "github",
"line_count": 539,
"max_line_length": 222,
"avg_line_length": 40.0556586270872,
"alnum_prop": 0.6320055581287634,
"repo_name": "restudToolbox/package",
"id": "d50fce3896f401d2fcd35f2a8ed61e500e0ab82e",
"size":... |
import os
class Config(object):
DEBUG = False
TESTING = False
CSRF_ENABLED = True
SECRET_KEY = 'this-really-needs-to-be-changed'
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
class DevelopmentConfig(Config):
DEVELOPMENT = True
DEBUG = True
| {
"content_hash": "0079d777bb6d7870bd2763fb33cd7872",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 56,
"avg_line_length": 23.083333333333332,
"alnum_prop": 0.6859205776173285,
"repo_name": "jwestgard/elk",
"id": "239459cc146bea6f1127f5bd85bfb9a398897be9",
"size": "277",
... |
"""Sort current config.json alphabetically. """
import json
import os
import re
import sys
ORIG_CWD = os.getcwd() # Checkout changes cwd
def test_infra(*paths):
"""Return path relative to root of test-infra repo."""
return os.path.join(ORIG_CWD, os.path.dirname(__file__), '..', *paths)
def sort():
"""S... | {
"content_hash": "439d8a1fa671fdfa74e9c3db8a367009",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 74,
"avg_line_length": 32.666666666666664,
"alnum_prop": 0.5338345864661654,
"repo_name": "dchen1107/test-infra",
"id": "7b482a0ba89cb570d751d5a753cc3e09ced3b34d",
"size": ... |
"""
A few bits of helper functions for comment views.
"""
import textwrap
try:
from urllib.parse import urlencode
except ImportError: # Python 2
from urllib import urlencode
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response, resolve_url
from django.template import ... | {
"content_hash": "8e1283a96b84654325ce65be32a1560a",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 86,
"avg_line_length": 26.894736842105264,
"alnum_prop": 0.6056751467710372,
"repo_name": "Maplecroft/django-contrib-comments",
"id": "32e73def5e1efc7ed74e3106bdbe21972d66be5... |
from __future__ import absolute_import
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
'supported_by': 'community',
'metadata_version': '1.1'}
DOCUMENTATION = '''
---
module: zfs_delegate_admin
short_description: Manage ZFS delegated administration (user admin ... | {
"content_hash": "b726ed0997c45ec2208f52eaf493563d",
"timestamp": "",
"source": "github",
"line_count": 243,
"max_line_length": 118,
"avg_line_length": 36.641975308641975,
"alnum_prop": 0.5889487870619946,
"repo_name": "galaxyproject/ansible-common-roles",
"id": "749dba5b5a178e2d5df6d116a0cb0cfea666f... |
from django.conf.urls import url
from api import views
urlpatterns = [
url(r'^search/$', views.package_search, name='package_search'),
url(r'^info/$', views.package_info, name='package_info'),
url(r'^register/$', views.package_register, name='package_register'),
url(r'^remove/$', views.package_remove,... | {
"content_hash": "1e1887fb0a854903621dca6b64870071",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 76,
"avg_line_length": 48.529411764705884,
"alnum_prop": 0.6654545454545454,
"repo_name": "colajam93/aurpackager",
"id": "741d45cb7412725b9f06bd0839f9ac31bb10a5ed",
"size":... |
'''
pb_statsfofn_ucd.py
generate read stats from pacbio fofn file
fofn format input, one line per fasta file
/share/dnat/rs2/161028_448/D02_1/Analysis_Results/m161031_221844_42145_c101058752550000001823247401061784_s1_p0.2.subreads.fasta
/share/dnat/rs2/161028_448/D02_1/Analysis_Results/m161031_221844_42145_c10105875... | {
"content_hash": "1c0064fd3e30507751b645f6f047a8c3",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 141,
"avg_line_length": 32.844919786096256,
"alnum_prop": 0.5695213285574732,
"repo_name": "ucdavis-bioinformatics-training/Bioinformatics-Genome-Assembly-and-Analysis-Worksho... |
"""Metrics to assess performance on regression task.
Functions named as ``*_score`` return a scalar value to maximize: the higher
the better.
Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize:
the lower the better.
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# ... | {
"content_hash": "a055faad58d6e3bd381010e4bd1e6764",
"timestamp": "",
"source": "github",
"line_count": 1108,
"max_line_length": 88,
"avg_line_length": 34.66335740072202,
"alnum_prop": 0.6139766188455229,
"repo_name": "sergeyf/scikit-learn",
"id": "ffa2b0b8218aaa0821d9fe1979f180295abd4f69",
"size":... |
import six
from sahara.api import acl
from sahara.service.api import v10 as api
from sahara.service import validation as v
from sahara.service.validations import cluster_template_schema as ct_schema
from sahara.service.validations import cluster_templates as v_ct
from sahara.service.validations import clusters as v_c
... | {
"content_hash": "d9a08d0eed5b240b71b99a020fb43ab6",
"timestamp": "",
"source": "github",
"line_count": 265,
"max_line_length": 79,
"avg_line_length": 37.033962264150944,
"alnum_prop": 0.7381292031791319,
"repo_name": "tellesnobrega/sahara",
"id": "e4e5730c45489bcfdd3059089b44ca7d0bec638b",
"size":... |
import piglow
from multiprocessing import Process, Queue
from Queue import Full, Empty
from time import sleep
#
# Piglow UI utils for piglow-sys library.
#
def start(clear=True):
""" Start PiGlow UI updates """
if _enabled:
return
if clear:
_change_task("_clear_all")
_change_task("_e... | {
"content_hash": "6c0ac8c81eba9d786ea880b44d94dbfa",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 73,
"avg_line_length": 24.48611111111111,
"alnum_prop": 0.5802609188882587,
"repo_name": "deanydean/py-piglow-sys",
"id": "37a1f41b8202995a02a239b975ab1754c6252166",
"size... |
"""Integration with the Rachio Iro sprinkler system controller."""
from abc import abstractmethod
from contextlib import suppress
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.switch import SwitchEntity
from homeassistant.const import ATTR_ENTITY_ID, ATTR_ID
from... | {
"content_hash": "155cdeb952408d66c151ce294d0b1879",
"timestamp": "",
"source": "github",
"line_count": 549,
"max_line_length": 93,
"avg_line_length": 34.05464480874317,
"alnum_prop": 0.6043538724860933,
"repo_name": "adrienbrault/home-assistant",
"id": "8d87b688aa47e701fc40d90b639d91ed42628d4e",
"... |
from siuba.siu import CallTreeLocal, FunctionLookupError, ExecutionValidatorVisitor
from .groupby import SeriesGroupBy
from .translate import (
forward_method,
not_implemented,
method_agg_op,
method_win_op_agg_result
)
from siuba.experimental.pd_groups.groupby import SeriesGrou... | {
"content_hash": "3cea890606aef8858671334137be6fcc",
"timestamp": "",
"source": "github",
"line_count": 269,
"max_line_length": 104,
"avg_line_length": 29.74721189591078,
"alnum_prop": 0.6295926018495376,
"repo_name": "machow/siuba",
"id": "1697e5ac54fa98c0695a552af0fdfb19fc99802e",
"size": "8002",... |
from os.path import dirname as _dn, join as _j
class MainFunc:
def __init__(self):
pass
def run(self, filename):
code = None
with open(_j(_dn(__file__), "main_func_template.py"), 'r') as f:
code = f.read()
out_file = filename
with open(out_file, 'w'... | {
"content_hash": "9cdf60b57eb33219693d331448dd8b39",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 72,
"avg_line_length": 19.666666666666668,
"alnum_prop": 0.5028248587570622,
"repo_name": "amol9/redcmd",
"id": "f448ced5b6860bd1a097fb8df6c58e1b1d86e380",
"size": "354",
... |
from .catalog_item import CatalogItem
class USqlPackage(CatalogItem):
"""A Data Lake Analytics catalog U-SQL package item.
:param compute_account_name: the name of the Data Lake Analytics account.
:type compute_account_name: str
:param version: the version of the catalog item.
:type version: str
... | {
"content_hash": "dbbb079bfe037b95ffd186b618c1588d",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 130,
"avg_line_length": 41.02777777777778,
"alnum_prop": 0.6445497630331753,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "bcb62ae92f1352e91f06e5fed8dd64edef0ce2e1",
... |
import random
import pprint as pp
import logging as log
import ctpy
log.basicConfig(level=log.DEBUG, format='%(asctime)s %(levelname)s: %(message)s')
def build_even_dimension(simconfig, num_modes):
mode_boundaries = []
mode_width = float(simconfig.MAXALLELES) / float(num_modes)
lower_val = 0.0
upper_... | {
"content_hash": "b5cc145e0ccd748b4dcdc956cd578caa",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 121,
"avg_line_length": 32.3587786259542,
"alnum_prop": 0.6301014390186365,
"repo_name": "mmadsen/CTPy",
"id": "62849a69842ce7dbee2c5ee40a4976ff010dba01",
"size": "4963",
... |
from vitrage.common.constants import VertexProperties as VProps
class PropsConverter(object):
PROPS_CONVERSION = {
'category': VProps.VITRAGE_CATEGORY,
'type': VProps.VITRAGE_TYPE,
'resource_id': VProps.VITRAGE_RESOURCE_ID,
'sample_timestamp': VProps.VITRAGE_SAMPLE_TIMESTAMP,
... | {
"content_hash": "c7d5ac9034726f43cfb9bd5ad9aee206",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 67,
"avg_line_length": 39.2,
"alnum_prop": 0.6574344023323615,
"repo_name": "openstack/vitrage",
"id": "c18dda51d93a0335f3a5b23dd1d454c01729cfe2",
"size": "1945",
"binary... |
from django.views.generic.base import TemplateView
class HomePageView(TemplateView):
template_name = "home.html"
| {
"content_hash": "2730c53abd4a94764912fee03e62403b",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 50,
"avg_line_length": 29.5,
"alnum_prop": 0.788135593220339,
"repo_name": "tomp/food_pantry",
"id": "b4f1ee8eebccd76afe08d366469127d8a4b2e7a9",
"size": "118",
"binary": f... |
from django.utils import timezone
from django.shortcuts import render, get_object_or_404, redirect
from .models import Post, Comment, Notice
from .forms import PostForm, CommentForm, NoticeForm
from django.contrib.auth.decorators import login_required
from django.contrib.admin.views.decorators import staff_member_requi... | {
"content_hash": "2a4d9f6a7f6c1ecb3ed70ec24069208a",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 123,
"avg_line_length": 35.37162162162162,
"alnum_prop": 0.6389684813753582,
"repo_name": "RachellCalhoun/cathotel",
"id": "e44c690f21d3715e3cfd8ea9b6a890312066a8b0",
"siz... |
import os
import sys
import getpass
from functools import wraps
import ldap
import ldap.modlist as modlist
import cog.directory as dir
import cog.util.passwd as passwd
from cog.util.misc import loop_on
from cog.objects.group import Group
from cog.config.settings import Profiles
from cog.config.templates import Templa... | {
"content_hash": "08add296ff6b02b813ce2d025d68b7bc",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 146,
"avg_line_length": 32.30769230769231,
"alnum_prop": 0.5947619047619047,
"repo_name": "jubalfh/cog",
"id": "4a4929ad38202ff3ec26785cec8d6d267fc934e9",
"size": "4500",
... |
from tkinter import TclError
class WidgetRedirector:
"""Support for redirecting arbitrary widget subcommands.
Some Tk operations don't normally pass through tkinter. For example, if a
character is inserted into a Text widget by pressing a key, a default Tk
binding to the widget's 'insert' operation i... | {
"content_hash": "3b3a6d4006341b33f45882d2e9546a14",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 79,
"avg_line_length": 39.43181818181818,
"alnum_prop": 0.6321325648414986,
"repo_name": "sharhar/USB-Thing",
"id": "67d7f61e623b4289bf55de2c641affd63b60e681",
"size": "69... |
from GroundedScan.dataset import GroundedScan
from GroundedScan.grammar import Derivation
from GroundedScan.world import Situation
from GroundedScan.world import Position
from GroundedScan.world import Object
from GroundedScan.world import INT_TO_DIR
from GroundedScan.world import PositionedObject
from GroundedScan.hel... | {
"content_hash": "17da3717f7b50ae84b76c43d95d8aea2",
"timestamp": "",
"source": "github",
"line_count": 809,
"max_line_length": 121,
"avg_line_length": 60.58961681087763,
"alnum_prop": 0.6309647673256217,
"repo_name": "LauraRuis/groundedSCAN",
"id": "b2a65f4fa6f094c996c527515c6b18195577f403",
"size... |
from __future__ import absolute_import, division, print_function
# Import standard modules
import copy
import numpy as np
# Import astronomical modules
from astropy.stats import sigma_clip, sigma_clipped_stats
# Import the relevant PTS classes and modules
from . import general
from ..basics.mask import Mask
# -----... | {
"content_hash": "02828f0c15e262d49b502255de53a08a",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 100,
"avg_line_length": 26.692682926829267,
"alnum_prop": 0.5778508771929824,
"repo_name": "Stargrazer82301/CAAPR",
"id": "28a575ee13d515782b2f7d4ab760baf7046b9194",
"size... |
from __future__ import unicode_literals
import copy
import os
import pickle
import warnings
from django.core.exceptions import SuspiciousOperation
from django.http import (QueryDict, HttpResponse, HttpResponseRedirect,
HttpResponsePermanentRedirect, HttpResponseNotAllowed,
... | {
"content_hash": "4791c2c88d2a89661d268a658f321075",
"timestamp": "",
"source": "github",
"line_count": 589,
"max_line_length": 95,
"avg_line_length": 39.49575551782682,
"alnum_prop": 0.5927868288698792,
"repo_name": "chrisfranzen/django",
"id": "2d172ad0e0aa1faec2009dfd8f5ea083e716593a",
"size": "... |
import pika, json
from config import config
f = open("sample_queue_message.json", "r")
sample_data = json.load(f)
connection = pika.BlockingConnection(pika.ConnectionParameters(
host=config["server"]))
channel = connection.channel()
channel.queue_declare(queue=config["queue"])
channel.basic_publish(exchang... | {
"content_hash": "e8126db38a50b247c6f85e0e998edf9a",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 63,
"avg_line_length": 25.94736842105263,
"alnum_prop": 0.6673427991886409,
"repo_name": "adrianchifor/Flipcam-Backend",
"id": "a6648fd60cef1b5842ca7f11a044d41748abb559",
"... |
import uuid
import requests
from modularodm import Q
from modularodm.exceptions import ModularOdmException
from framework.auth import Auth
from website import security
from website import settings
from website.project import new_node
from website.models import User, Node, MailRecord
def record_message(message, cre... | {
"content_hash": "5469b915ed9d2f03a1aa81bf6bd97b6b",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 94,
"avg_line_length": 27.64864864864865,
"alnum_prop": 0.6539589442815249,
"repo_name": "himanshuo/osf.io",
"id": "5360c49beccfaef409433677f6f06c85f2c53271",
"size": "309... |
import logging
import goaway.globalvars as globalvars
logger = logging.getLogger(__name__)
DATA_STORE_HANDLE_KIND_ATTR = "__store"
NAME_ATTR = "__name"
class ObjectHandle(object):
"""
Represents a shared object in a datstore.
Instances of this class are returned by object handle constructors.
Applic... | {
"content_hash": "31a95cfc220e43fd59d061f2a4cd6ab5",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 85,
"avg_line_length": 30.934782608695652,
"alnum_prop": 0.617709065354884,
"repo_name": "anpere/goaway",
"id": "820f6582610d4d6536ed231e35188f8098b4410b",
"size": "1423",
... |
import codecs, logging, os, random
import GlobalStore
logger = logging.getLogger('DideRobot')
def isAllowedPath(path):
#This function checks whether the provided path is inside the bot's data folder
# To prevent people adding "../.." to some bot calls to have free access to the server's filesystem
if not os.path... | {
"content_hash": "7a8e3ea905d49ea7ef3eb33226b9a3b9",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 119,
"avg_line_length": 36.896103896103895,
"alnum_prop": 0.7504399859204506,
"repo_name": "Didero/DideRobot",
"id": "0ebfa0a20369797d933d3b201c2f1fb26d45ee43",
"size": "28... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.