text stringlengths 4 1.02M | meta dict |
|---|---|
"""Generated class for configuration_endpoint.json"""
class ObjectA90DCC28:
"""Generated schema class"""
def __init__(self):
self.basic = None
self.jwt = None
@staticmethod
def from_dict(source):
if not source:
return None
result = ObjectA90DCC28()
result.basic = source.get('basic'... | {
"content_hash": "16c701462041215ed66e2930ae4edf2f",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 80,
"avg_line_length": 26.1981981981982,
"alnum_prop": 0.6365199449793673,
"repo_name": "faucetsdn/udmi",
"id": "b5f1e96f5a45deaed7e9f450f9c1536caaea31ba",
"size": "2908",... |
import logging
import os
import sys
import yaml
from os.path import abspath, dirname, exists, join
from ob2.config.assignment import Assignment
from ob2.config.cli import parse_args
LOG = logging.getLogger(__name__)
class _ConfigModule(object):
def __init__(self, mode):
# A dictionary of configuration v... | {
"content_hash": "8f90639b2e083263b88f7caefb811b08",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 100,
"avg_line_length": 38.98290598290598,
"alnum_prop": 0.5792589344442008,
"repo_name": "octobear2/ob2",
"id": "bae80ca280bb69e497364c1944535e525dd4abee",
"size": "4561"... |
"""
Tests for utility
"""
import unittest
if __name__ == '__main__':
unittest.main()
| {
"content_hash": "a1be4fa089dfaa21490d63d1d463d704",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 26,
"avg_line_length": 11,
"alnum_prop": 0.5151515151515151,
"repo_name": "systempuntoout/buckethandle",
"id": "8340544e96af5df6114c9c38d95087ac9fe53a93",
"size": "124",
"... |
import proto # type: ignore
from google.cloud.automl_v1beta1.types import text_segment as gca_text_segment
__protobuf__ = proto.module(
package="google.cloud.automl.v1beta1",
manifest={
"TextExtractionAnnotation",
"TextExtractionEvaluationMetrics",
},
)
class TextExtractionAnnotation(p... | {
"content_hash": "db3fe195fb0c4ad05f38724ecd39661b",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 136,
"avg_line_length": 29.72641509433962,
"alnum_prop": 0.5963186290066645,
"repo_name": "googleapis/python-automl",
"id": "ca2e13df18d5ee3d8b0896cfd29c749554f93ba8",
"si... |
import sys
def note_error(strE):
return ["Bad start: "+strE]
def check_compiler(strC):
lstErrors = list()
lstC = strC[1:].strip().split("=")
lstKnownCompilers = ["file_title","gdbot_syntax_version","log_file","log_email"]
if lstC[0].strip() in lstKnownCompilers:
# gdbot version
if ... | {
"content_hash": "1c4278da3c685e964dd19d3c118da1a1",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 105,
"avg_line_length": 39.25,
"alnum_prop": 0.5069002123142251,
"repo_name": "MartinHvidberg/gdbot",
"id": "fd7c188ce3eba0cb34679cfdcbee56f0f2808aae",
"size": "3768",
"b... |
"""This file defines functions to generated different splits of
the data for federated simulations.
"""
from collections import OrderedDict, defaultdict
import numpy as np
import tensorflow as tf
from data_utils import create_masks
def gather_indices(idxs, in_data, slot_inputs, padding_masks, look_ahead_masks,
... | {
"content_hash": "7f50968b073118d89ec81b69be1cca0d",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 93,
"avg_line_length": 36.41747572815534,
"alnum_prop": 0.6095707811250334,
"repo_name": "googleinterns/fednsp",
"id": "2db8344c07a173d4caf43bcffa80ce4e672d0f86",
"size": ... |
import proto # type: ignore
__protobuf__ = proto.module(
package="google.ads.googleads.v12.enums",
marshal="google.ads.googleads.v12",
manifest={"ListingGroupFilterProductTypeLevelEnum",},
)
class ListingGroupFilterProductTypeLevelEnum(proto.Message):
r"""Level of the type of a product offer.
"... | {
"content_hash": "d6bcafc5cd87991c35962d690b567778",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 72,
"avg_line_length": 24.73076923076923,
"alnum_prop": 0.640746500777605,
"repo_name": "googleads/google-ads-python",
"id": "e6bff861dacc02cf65066443fde3639980812573",
"si... |
from ..utils import _make_pseudo_id
from .base import BaseModel, SourceMixin, AssociatedLinkMixin, LinkMixin
from .schemas.event import schema
class EventAgendaItem(dict, AssociatedLinkMixin):
event = None
def __init__(self, description, event):
super(EventAgendaItem, self).__init__({
"de... | {
"content_hash": "e1ee903d3dd4ada83350bed709be5af4",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 95,
"avg_line_length": 37.6,
"alnum_prop": 0.5613747954173486,
"repo_name": "datamade/pupa",
"id": "451d7357764dc2bef46bd94f917bea26d83fa160",
"size": "4888",
"binary": ... |
"""Tests for google3.third_party.py.madi.datasets.forestcover_dataset."""
import os
from absl import logging
from madi.datasets import forestcover_dataset
import tensorflow as tf
_DATA_FILE_IN = os.path.join(
os.path.dirname(__file__), 'test_data/covtype.test.data')
_DATA_FILE_TEST = 'covtype.data'
_COL_NAMES_SE... | {
"content_hash": "d5e6f5bdc220ba27297544b9e40a9f41",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 73,
"avg_line_length": 32.27272727272727,
"alnum_prop": 0.7154929577464789,
"repo_name": "google/madi",
"id": "1595f44bea46415805ec63c03b655f5254207e42",
"size": "1699",
... |
import os
import urlparse
from redis import Redis
from rq import Worker, Queue, Connection
listen = ['default']
redis_url = os.getenv('REDIS_URL')
if not redis_url:
raise RuntimeError('Set up Redis To Go first.')
urlparse.uses_netloc.append('redis')
url = urlparse.urlparse(redis_url)
conn = Redis(host=url.hostna... | {
"content_hash": "56bea96a081150e76bb75c2adafd5ae8",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 75,
"avg_line_length": 25,
"alnum_prop": 0.7288888888888889,
"repo_name": "jms/compress_service",
"id": "719e1a858193eb478f328d31085003028b968aa5",
"size": "450",
"binary... |
import gc
import easydict
import numpy as np
import tensorflow as tf
from luminoth.models.base.base_network import (
BaseNetwork, _R_MEAN, _G_MEAN, _B_MEAN, VALID_ARCHITECTURES
)
class BaseNetworkTest(tf.test.TestCase):
def setUp(self):
self.config = easydict.EasyDict({
'architecture': '... | {
"content_hash": "3174b98655b88e81c7a518fe0b83fb7e",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 77,
"avg_line_length": 31.186274509803923,
"alnum_prop": 0.5488839987425338,
"repo_name": "tryolabs/luminoth",
"id": "cf5ee29167dd797e4745a51b17df1c22bad01979",
"size": "3... |
import sys, time
# numpy and scipy
import numpy as np
from scipy.ndimage import filters
# OpenCV
import cv2, cv
# Ros libraries
import roslib
import rospy
# Ros Messages
from sensor_msgs.msg import Image, CompressedImage
from cv_bridge import CvBridge, CvBridgeError
class image_converter:
def __init__(self... | {
"content_hash": "fdb7bc073b5bcc7c6f0c94640cf4a465",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 100,
"avg_line_length": 26.03174603174603,
"alnum_prop": 0.6426829268292683,
"repo_name": "sameeptandon/sail-car-log",
"id": "404e59b801faa4cf58ced1efc515ce6601cdf503",
"si... |
"""
Copydog syncs Redmine and Trello.
Usage:
runner.py --config=<yaml> [options]
runner.py (start|stop|restart) --config=<yaml> [options]
runner.py (debug_storage|flush_storage) [options]
Options:
--config=<yaml> Config file.
-f --fullsync Full sync (all issues, opposed to date range delta sync). Needed... | {
"content_hash": "9c8f01dc9bcbda53e75808b316c5da96",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 97,
"avg_line_length": 27.23076923076923,
"alnum_prop": 0.6528954802259888,
"repo_name": "coagulant/copydog",
"id": "21b778cc9bfbd49a16fc63634113d07473ec03fa",
"size": "28... |
import threading
import Queue
from multiprocessing import Manager
from multiprocessing import Process
import os
from splunktalib.common import log
logger = log.Logs().get_logger("main")
import splunktalib.event_writer as ew
import splunktalib.timer_queue as tq
import splunktalib.common.util as scutil
import splunktal... | {
"content_hash": "320e634f485cd504b767f8570dc3de10",
"timestamp": "",
"source": "github",
"line_count": 232,
"max_line_length": 80,
"avg_line_length": 28.28448275862069,
"alnum_prop": 0.6132276744894849,
"repo_name": "chenziliang/google",
"id": "8e84954e13367b7ed4a23654330cd1303dbeb7d3",
"size": "6... |
__author__ = 'Neil Butcher'
from PyQt4 import QtCore, QtGui
from PyQt4.QtCore import pyqtSignal
from Rota_System.UI.Roles.commands_role_compatibility import CommandChangeCompatibilityRole
class RoleCompatibilitiesSettingModel(QtCore.QAbstractTableModel):
"""
used to manipulate the relative compatibilities b... | {
"content_hash": "ab4b9b402437b2ce2f9857ae8d9604d1",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 99,
"avg_line_length": 37.220588235294116,
"alnum_prop": 0.6835242986961675,
"repo_name": "ergoregion/Rota-Program",
"id": "c7e1e3a995817853c9fec4849acbc59997a98225",
"size... |
from pecan import rest
from wsme import types as wtypes
import wsmeext.pecan as wsme_pecan
from mistral.openstack.common import log as logging
from mistral.api.controllers import resource
from mistral.db import api as db_api
from mistral.utils import rest_utils
LOG = logging.getLogger(__name__)
class Event(resource... | {
"content_hash": "72c2945dd3c57c63041410c91450e80c",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 79,
"avg_line_length": 30.295454545454547,
"alnum_prop": 0.6699174793698425,
"repo_name": "dmitryilyin/mistral",
"id": "2bd12a80a2321ad19e7c705546978ab3533d7f8f",
"size": "... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blog', '0004_comment_excerpt'),
]
operations = [
migrations.AlterModelOptions(
name='comment',
options={'ordering': ['-updated', '-c... | {
"content_hash": "27e2d33895a27309bad9fa517fb4dab8",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 121,
"avg_line_length": 24.11764705882353,
"alnum_prop": 0.6,
"repo_name": "amaozhao/blogular",
"id": "7922a8ee8d1623c6707e68e697c859a6b4065597",
"size": "482",
"binary":... |
"""In this file tests for Crawler scripts are gathered."""
import pytest
from crawler import Crawler
class TestCrawler:
"""Crawler class unit tests."""
@pytest.mark.parametrize('url,expected,server_name', [
('www.test.com', 'http://www.test.com', 'www.test.com'),
('http://www.test.com', 'htt... | {
"content_hash": "542169683910cd712448f2e805b7bb8a",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 94,
"avg_line_length": 37.10294117647059,
"alnum_prop": 0.6214823622671423,
"repo_name": "jkaluzka/siteMapGen",
"id": "9b7efeda557ce75cf7c0b019c73d9bb174d9aee1",
"size": "2... |
"""
Wrappers for doing binary IO on file-like objects
"""
import numpy
import struct
import sys
## Standard size:
## short is 8 bits
## int and long are 32 bits
## long long is 64 bits
class BadMagicNumber( IOError ):
pass
class BinaryFileReader( object ):
"""
Wrapper for doing binary reads on any file ... | {
"content_hash": "a532fb5510537b04a2e4b8d409b0da9c",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 103,
"avg_line_length": 31.05325443786982,
"alnum_prop": 0.5377286585365854,
"repo_name": "kensugino/jGEM",
"id": "7d7eed332cc89208263feabc4161992b9c4e131e",
"size": "5248... |
import os
import subprocess
import shutil
try:
import argparse as ap
except ImportError:
import pyne._argparse as ap
absexpanduser = lambda x: os.path.abspath(os.path.expanduser(x))
def check_windows_cmake(cmake_cmd):
if os.name == 'nt':
files_on_path = set()
for p in os.environ['PATH'].s... | {
"content_hash": "74a7adca1d199d26557bccb64bbe3b8f",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 104,
"avg_line_length": 37.118110236220474,
"alnum_prop": 0.6224013576580398,
"repo_name": "Baaaaam/cyBaM",
"id": "baa29a2891765df1fd1834c253864995aac962e8",
"size": "4738... |
from django.db import models
from apps.dc_algorithm.models import Area, Compositor, Satellite
from apps.dc_algorithm.models import (Query as BaseQuery, Metadata as BaseMetadata, Result as BaseResult, ResultType as
BaseResultType, UserHistory as BaseUserHistory, AnimationType as
... | {
"content_hash": "e55e82034110317f9bae2fcc61b0ddcb",
"timestamp": "",
"source": "github",
"line_count": 213,
"max_line_length": 119,
"avg_line_length": 38.51173708920188,
"alnum_prop": 0.6523223211020358,
"repo_name": "ceos-seo/data_cube_ui",
"id": "167d3838ad681424b185b251a78af5bb504e87f2",
"size"... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cvmfsweb.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "fab1035045c135e332d80332508c079b",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 72,
"avg_line_length": 25.444444444444443,
"alnum_prop": 0.7117903930131004,
"repo_name": "cernvm/cvmfs-monitor",
"id": "923525e2e1c0dda81efa53c89c258a5956677568",
"size": "... |
import tensorflow as tf
class VBN(object):
"""
Virtual Batch Normalization
(modified from https://github.com/openai/improved-gan/ definition)
"""
def __init__(self, x, name, epsilon=1e-5):
"""
x is the reference batch
"""
assert isinstance(epsilon, float)
... | {
"content_hash": "b88d83e1478e90e5b48874a0ab060994",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 83,
"avg_line_length": 38.983870967741936,
"alnum_prop": 0.5399255275134465,
"repo_name": "santi-pdp/segan",
"id": "a659c5b588f931fa6dea3bdb8f4f87035bc312b1",
"size": "2417... |
__version__ = "1.1.0"
"""
:mod:`spaghetti` --- Spatial Graphs: Networks, Topology, & Inference
====================================================================
"""
from .network import Network, PointPattern, SimulatedPointPattern, SortedEdges
from .analysis import NetworkBase, NetworkG, NetworkK, NetworkF
from .an... | {
"content_hash": "c5d35087a9469cabcb4592463fd15f18",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 78,
"avg_line_length": 45.916666666666664,
"alnum_prop": 0.6860254083484574,
"repo_name": "lixun910/pysal",
"id": "5a247790d1abda7352a586486da98a8cf91b626f",
"size": "551",... |
from __future__ import absolute_import
from datetime import timedelta
from django.db import models
from django.utils import timezone
from sentry.utils.cache import cache
from sentry.db.models import BoundedPositiveIntegerField, FlexibleForeignKey, Model, sane_repr
class ReleaseProjectEnvironment(Model):
__core_... | {
"content_hash": "37d78b1f09ed86318910a4ee896e8111",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 94,
"avg_line_length": 39.285714285714285,
"alnum_prop": 0.6640909090909091,
"repo_name": "mvaled/sentry",
"id": "4620a84bc73621b61deab5811ae22417b3773394",
"size": "2200",... |
from __future__ import absolute_import
import sys
import json
from r5d4.mapping_functions import MEASURING_FUNCTIONS_MAP,\
DIMENSION_PARSERS_MAP, CONDITION_KEYS
TOP_KEYS = ["name", "description", "query_dimensions", "slice_dimensions",
"data_db", "measures", "mapping"]
class Analytics:
def __init... | {
"content_hash": "73676df0a5f6a7ab19d658f36d3e4915",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 79,
"avg_line_length": 41.38255033557047,
"alnum_prop": 0.5376256892637041,
"repo_name": "practo/r5d4",
"id": "28c0c2d98eb48c4c1574830473c04ea696e8c464",
"size": "6188",
... |
from django import template
from django.conf import settings
from pCMS.fpg.models import Flatpage, Menu
register = template.Library()
class FpgNode(template.Node):
def __init__(self, context_name, starts_with=None, user=None):
self.context_name = context_name
if starts_with:
self.sta... | {
"content_hash": "315481f22d9737d7b2369fd96c1cedf9",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 126,
"avg_line_length": 35.29457364341085,
"alnum_prop": 0.6202503843619591,
"repo_name": "sv1jsb/pCMS",
"id": "b863f3bd3ba3d2eaf99443b25cfafddbf0ed7b05",
"size": "4553",
... |
from django.db import models
from OctaHomeCore.models import *
class ButtonInputDevice(InputDevice):
ButtonOneAction = models.ForeignKey('OctaHomeCore.TriggerEvent', related_name="oneButtonActions", blank=True, null=True, on_delete=models.SET_NULL)
ButtonTwoAction = models.ForeignKey('OctaHomeCore.TriggerEvent', rel... | {
"content_hash": "4aec94ba6202dbcc1ad36a74e6d83c39",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 150,
"avg_line_length": 48.285714285714285,
"alnum_prop": 0.7948717948717948,
"repo_name": "Tomcuzz/OctaHomeAutomation",
"id": "d0e08368eb5eb7a5935068a5572685d80c1baedb",
"... |
"""Utility functions of the cli."""
import datetime
import json
import os
import re
import random
import string
import sys
import time
import click
import requests
import tabulate
from keep import about
# Directory for Keep files
dir_path = os.path.join(os.path.expanduser('~'), '.keep')
# URL for the API
api_url = 'h... | {
"content_hash": "5ef4a433917a6fb90e2cce4ac46f57f4",
"timestamp": "",
"source": "github",
"line_count": 293,
"max_line_length": 92,
"avg_line_length": 33.29692832764505,
"alnum_prop": 0.5788232882328823,
"repo_name": "paci4416/keep",
"id": "6a8b713676e473069e2071c2ccc3fc8f827853c3",
"size": "9756",... |
from twisted.internet import defer
from ipd.libvirt import error, constants
from structlog import get_logger
logger = get_logger()
class ProcedureBase(object):
id = None
name = None
args = None
ret = None
def __init__(self, program):
self._program = program
self._pending = defer.... | {
"content_hash": "f33dd269ccd5540ae46c95deae59f4c3",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 77,
"avg_line_length": 32.3448275862069,
"alnum_prop": 0.6375266524520256,
"repo_name": "GaretJax/ipd",
"id": "fea942ed665fd0917c687edb769a48c4e2e11964",
"size": "1876",
... |
import roslib
import rospy
import math
import tf
from geometry_msgs.msg import Pose
if __name__ == '__main__':
rospy.init_node('tf_box_pose_footprint')
pub = rospy.Publisher('/box_pose_footprint', Pose, queue_size=10)
listener = tf.TransformListener()
pose = Pose()
rate = rospy.Rate(10.0)
whil... | {
"content_hash": "49ff277cc08a40e18bf4b99dc1189112",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 92,
"avg_line_length": 26.666666666666668,
"alnum_prop": 0.6284090909090909,
"repo_name": "matteopantano/youbot-thesis",
"id": "bd337824c30c9bb717c518d0f0cedfee48a395f2",
"... |
def extractGlitchditchHomeBlog(item):
'''
Parser for 'glitchditch.home.blog'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('Lonely Attack on the Different World', 'Lonely Attack on the Di... | {
"content_hash": "182d223fdf26fad3e5dd2b7a74b26ca0",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 124,
"avg_line_length": 32.19047619047619,
"alnum_prop": 0.6227810650887574,
"repo_name": "fake-name/ReadableWebProxy",
"id": "7a7ce87a8c112fa946b4c3e527514aab11be8184",
"s... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.codegen.register import build_file_aliases as register_codegen
from pants.backend.codegen.targets.java_wire_library import JavaWireLibrary
from pant... | {
"content_hash": "6025772eb5780458f7af280a01f3c16a",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 94,
"avg_line_length": 46.357142857142854,
"alnum_prop": 0.6350429231785164,
"repo_name": "jtrobec/pants",
"id": "321ecf38050aa0931541c8b618dc9fb304829e0a",
"size": "4690",... |
"""
Created on Jun 01, 2012
@author: Bilel Msekni
@contact: bilel.msekni@telecom-sudparis.eu
@author: Houssem Medhioub
@contact: houssem.medhioub@it-sudparis.eu
@organization: Institut Mines-Telecom - Telecom SudParis
@license: Apache License, Version 2.0
"""
import pyocni.pyocni_tools.config as config
import pyocni.... | {
"content_hash": "887c9a28d7ae49430635484310381d61",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 118,
"avg_line_length": 40.43715846994535,
"alnum_prop": 0.5781081081081081,
"repo_name": "jordan-developer/pyOCNI",
"id": "5c152b110a7b496a25169276fdad1629429ab206",
"siz... |
"""
Collect gene statistics based on gff file:
Exon length, Intron length, Gene length, Exon count
"""
import os.path as op
import sys
import logging
from jcvi.utils.cbook import SummaryStats, percentage, human_size
from jcvi.utils.range import range_interleave
from jcvi.utils.table import tabulate
from jcvi.formats.... | {
"content_hash": "2892faddb5266815acf7973196aacd0c",
"timestamp": "",
"source": "github",
"line_count": 354,
"max_line_length": 89,
"avg_line_length": 35.26553672316384,
"alnum_prop": 0.5819448894585069,
"repo_name": "sgordon007/jcvi_062915",
"id": "56925cc1b19d035e53a65549be9e23037e8f7fdd",
"size"... |
"""Component to configure Home Assistant via an API."""
import asyncio
import importlib
import os
import voluptuous as vol
from homeassistant.components.http import HomeAssistantView
from homeassistant.const import (
CONF_ID,
EVENT_COMPONENT_LOADED,
HTTP_BAD_REQUEST,
HTTP_NOT_FOUND,
)
from homeassista... | {
"content_hash": "cc6f3383cb69f51f5aaf690c0bc323a8",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 83,
"avg_line_length": 29.440613026819925,
"alnum_prop": 0.6029411764705882,
"repo_name": "robbiet480/home-assistant",
"id": "d7a257b1d9b5af44df3c8b5fee29e07340edf840",
"s... |
import tweetpony
import Event.models as ev
def send_tweet(event_id):
CONSUMER_KEY = "vbu0rPw39tCEtIEDfZK5g"
CONSUMER_SECRET = "gB235sqx1GrJZKHde5y4ZaNyVawQ0oaGolQTRVEz0"
ACCESS_TOKEN = "137592952-RGzgPZu4lRUegsMZEHv6DzXQGOuXtZ8SCqLRUS3m"
ACCESS_TOKEN_SECRET = "RX51tm1UihA889TtW4rARKROuYV4sPgoInnB3Qwqx... | {
"content_hash": "9422d2bbd1d579b43c1faed31be4b63a",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 123,
"avg_line_length": 37.254901960784316,
"alnum_prop": 0.6263157894736842,
"repo_name": "kaflesudip/jootau",
"id": "56b4eff9f732b8e2a0d6cbb981acceb9c119cc2c",
"size": "1... |
__author__ = 'Neil Butcher'
from PyQt4 import QtGui
class CommandChangeRole(QtGui.QUndoCommand):
def __init__(self, role, key, value, *__args):
QtGui.QUndoCommand.__init__(self, *__args)
self.role = role
self.key = key
self.setText('Changed the ' + key + ' of a role')
self... | {
"content_hash": "1f31479d01224a7e4fad2c3d1a730cab",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 57,
"avg_line_length": 31.642857142857142,
"alnum_prop": 0.5790067720090294,
"repo_name": "ergoregion/Rota-Program",
"id": "6aa87e842edb54f9bd99f3f226f05d0d406416a7",
"size... |
import uuid
import tornado
class ListScenariosHandler(tornado.web.RequestHandler):
#web server instance
_ws = None
def initialize(self, ws):
self._ws = ws
def get(self):
self.finish({"list": [name for name, scenario in self._ws.action_processor.list_all() if scenario.published]})
... | {
"content_hash": "9498b6a02183127e5d6c5e6600729788",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 118,
"avg_line_length": 26.4,
"alnum_prop": 0.6309523809523809,
"repo_name": "Cirreth/shome",
"id": "bfffefdab87b82358815f14953440891f8e7b776",
"size": "924",
"binary": f... |
"""Test segwit transactions and blocks on P2P network."""
from binascii import hexlify
import math
import random
import struct
import time
from test_framework.blocktools import create_block, create_coinbase, add_witness_commitment, get_witness_script, WITNESS_COMMITMENT_HEADER
from test_framework.key import CECKey, CP... | {
"content_hash": "10b263f2d7f8572d0aa3c8e23c3b4c22",
"timestamp": "",
"source": "github",
"line_count": 2071,
"max_line_length": 220,
"avg_line_length": 46.2892322549493,
"alnum_prop": 0.6314713399050749,
"repo_name": "rawodb/bitcoin",
"id": "52f6482d5682db8e9bc55caa8e84e8b365e03374",
"size": "9607... |
from __future__ import unicode_literals
default_app_config = 'spirit.user.admin.apps.SpiritUserAdminConfig'
from django.contrib import admin
from ..models import UserProfile, UserSuspensionLog
class UserProfileAdmin(admin.ModelAdmin):
search_fields = ('user__username',)
list_display = ('__str__', 'last_see... | {
"content_hash": "9aad7e8861d3a9c341c5850877f016be",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 94,
"avg_line_length": 29.08,
"alnum_prop": 0.7221458046767538,
"repo_name": "alesdotio/Spirit",
"id": "b18cea3a975c7a01bf3c839abc0438805debc6a4",
"size": "752",
"binary"... |
"""
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": "050dd62f5f875de25b7d994ef4dff45e",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 129,
"avg_line_length": 43.526315789473685,
"alnum_prop": 0.7623941958887546,
"repo_name": "zouzhberk/ambaridemo",
"id": "093ea38947349af803b1e81abf720e105d68ac94",
"size":... |
from django import shortcuts
from django.views import generic as generic_views
class HTTP401Exception(Exception):
pass
class ForcedAuthenticationMixin(object):
def check_user(self):
if not self.request.user.is_authenticated():
raise HTTP401Exception("Unauthorized")
return
def ... | {
"content_hash": "4ab5ba80b3161c64e258318ea6c934ff",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 88,
"avg_line_length": 31.8,
"alnum_prop": 0.7064989517819706,
"repo_name": "smadacm/TimeManagement",
"id": "9245f3343bfc1bda1106bd26c7ebd1c89a9b9a5f",
"size": "477",
"bi... |
import _plotly_utils.basevalidators
class CustomdataValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="customdata", parent_name="funnel", **kwargs):
super(CustomdataValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,... | {
"content_hash": "c7fad6001cfd401f60136b56a6c3e348",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 81,
"avg_line_length": 37.09090909090909,
"alnum_prop": 0.6323529411764706,
"repo_name": "plotly/plotly.py",
"id": "18d87b1b232c093737283c18a7e31c153ddfc6a3",
"size": "408"... |
"""Weak reference support for Python.
This module is an implementation of PEP 205:
http://www.python.org/dev/peps/pep-0205/
"""
# Naming convention: Variables named "wr" are weak reference objects;
# they are called this instead of "ref" to avoid name collisions with
# the module-global ref() function imported from ... | {
"content_hash": "7346cefc0e3b299e92bb2b1d94aae480",
"timestamp": "",
"source": "github",
"line_count": 377,
"max_line_length": 79,
"avg_line_length": 28.246684350132625,
"alnum_prop": 0.5547938773593765,
"repo_name": "bkillenit/AbletonAPI",
"id": "84d81a27347b55fe922f63f096dd656be1e98cf2",
"size":... |
"""Sources for numpy arrays and pandas DataFrames."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.learn.python.learn.dataframe import transform
from tensorflow.contrib.learn.python.learn.dataframe.queues import feeding_functions
... | {
"content_hash": "301c631c66a279fdff165e8320c816bf",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 84,
"avg_line_length": 28.925233644859812,
"alnum_prop": 0.6494345718901454,
"repo_name": "EvenStrangest/tensorflow",
"id": "e5880b065c76de12ad8d0a961d44c399b8bf2ca9",
"si... |
import sys
from appvalidator import validate_app, validate_packaged_app
path = sys.argv[1]
if path.endswith(".webapp"):
print validate_app(path, format="json")
else:
print validate_packaged_app(path, format="json")
| {
"content_hash": "7aa9467d828c13521560290226e940b4",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 60,
"avg_line_length": 28,
"alnum_prop": 0.7366071428571429,
"repo_name": "mattbasta/perfalator",
"id": "581c48e5a510a7871bc550797f12acdf93c62cb9",
"size": "224",
"binary"... |
"""
pyexcel.plugins.sources.output_to_memory
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Representation of output file sources
:copyright: (c) 2015-2017 by Onni Software Ltd.
:license: New BSD License
"""
from pyexcel.internal import RENDERER
from pyexcel.source import AbstractSource, MemorySourceMi... | {
"content_hash": "1f10b8005a01e8608c0e84b00176bdff",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 75,
"avg_line_length": 30.595238095238095,
"alnum_prop": 0.6311284046692607,
"repo_name": "caspartse/QQ-Groups-Spider",
"id": "e3c516ee59602605e32563e859bc40861536d137",
"s... |
"""
filename: test_members.py
description: Tests for Membership.
created by: Omar De La Hoz
created on: 10/05/17
"""
import pytest
import config
from app import app, db, socketio
from mock import patch, MagicMock
from app.users.models import Users
from app.members.models import Members, Roles
from app.committees.model... | {
"content_hash": "56cf3fa63cf341c925e693d3923bb6bb",
"timestamp": "",
"source": "github",
"line_count": 306,
"max_line_length": 87,
"avg_line_length": 38.51633986928105,
"alnum_prop": 0.6398269132869506,
"repo_name": "ritstudentgovernment/chargeflask",
"id": "e3206c4c615a5d0590851fe40df88403018e67cb"... |
class Const(object):
'''
Bibliography:
[1] VideoRay Example Code [Online]
Available: https://github.com/videoray/Thruster/blob/master/thruster.py
'''
# VRCSR protocol defines
sync_request = 0x5ff5
sync_response = 0x0ff0
protocol_vrcsr_header_size = 6
protocol_vrc... | {
"content_hash": "68d6d53bec8eef8e4dbbf9eda2051a9a",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 83,
"avg_line_length": 33.714285714285715,
"alnum_prop": 0.6765536723163842,
"repo_name": "pemami4911/Sub8",
"id": "f83b0a8fe4b3a4592c08ccbb44db4b645a389b9a",
"size": "708"... |
import os
import math
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--run', type=str, required=True,
help='The command to run.')
parser.add_argument('--scanner', type=str, required=False,
help='The path of the virtual_scanner')
parser.add_argument('--... | {
"content_hash": "e6ef79a85f09464dc0a8ff045af6d48e",
"timestamp": "",
"source": "github",
"line_count": 233,
"max_line_length": 80,
"avg_line_length": 35.502145922746784,
"alnum_prop": 0.6381769825918762,
"repo_name": "microsoft/O-CNN",
"id": "555e52acc3cfba599cf2908e25928787890e6822",
"size": "827... |
from django import forms
from django.contrib.admin.widgets import RelatedFieldWidgetWrapper
from django.utils.translation import ugettext_lazy as _
from mptt.forms import TreeNodeChoiceField
from .models import Category
class CategoryAdminForm(forms.ModelForm):
"""
Form for Category's Admin.
"""
pare... | {
"content_hash": "302054cf8dd9dd228c3152eb335ad959",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 66,
"avg_line_length": 30.5,
"alnum_prop": 0.6112412177985949,
"repo_name": "am1tyadava/amityadav_blog",
"id": "4f18c3811cca145be79e0375deb48c0f1a63bd20",
"size": "1281",
... |
'''
synbiochem (c) University of Manchester 2017
All rights reserved.
@author: neilswainston
'''
# pylint: disable=invalid-name
import re
import sys
import pandas as pd
def analyse(df):
'''analyse.'''
result_df = df.groupby(['plasmid',
'strain',
'trea... | {
"content_hash": "ad98cd8db43ed0fbeb8ac1aceb00e51f",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 73,
"avg_line_length": 22.216666666666665,
"alnum_prop": 0.4988747186796699,
"repo_name": "neilswainston/development-py",
"id": "e035af7b68a189520e8e362be31f3986eafc4ee6",
... |
username = 'admin'
email = 'admin@example.com'
#####
import airflow
from airflow import models, settings
from airflow.contrib.auth.backends.password_auth import PasswordUser
# https://stackoverflow.com/questions/3854692/generate-password-in-python
import string
from random import sample, choice
chars = string.letters... | {
"content_hash": "227f763ca36fd69dacacb469a8a00f37",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 73,
"avg_line_length": 23.666666666666668,
"alnum_prop": 0.755868544600939,
"repo_name": "teamclairvoyant/hadoop-deployment-bash",
"id": "1853e1497434a3a498ff1a5ba2fc0b93c0d1... |
"""
Methods for accessing Bag entities, GET the
tiddlers in the bag, list the available bags,
PUT a Bag as a JSON object.
These need some refactoring.
"""
from tiddlyweb.model.bag import Bag
from tiddlyweb.model.collections import Tiddlers
from tiddlyweb.model.policy import create_policy_check
from tiddlyweb.store im... | {
"content_hash": "7230b7ad799c43f8b5cc4dbeee9f062f",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 77,
"avg_line_length": 31.053571428571427,
"alnum_prop": 0.6731838221199923,
"repo_name": "funkyeah/tiddlyweb",
"id": "1cc6e260e3b2c14dddb9fd49c7a7d0c20c540490",
"size": "... |
from oslo_config import cfg
from oslo_db import api
CONF = cfg.CONF
_BACKEND_MAPPING = {'sqlalchemy': 'bilean.db.sqlalchemy.api'}
IMPL = api.DBAPI.from_config(CONF, backend_mapping=_BACKEND_MAPPING)
def get_engine():
return IMPL.get_engine()
def get_session():
return IMPL.get_session()
def db_sync(eng... | {
"content_hash": "a4e3b241f68fbb03f1537f802410a8ab",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 77,
"avg_line_length": 31.39156626506024,
"alnum_prop": 0.6252158894645942,
"repo_name": "lvdongbing/bilean",
"id": "49e7a1a52a884085389b90a4c6ed5d1c9bb84750",
"size": "57... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cpro', '0016_auto_20171216_1606'),
]
operations = [
migrations.AddField(
model_name='card',
name='leader_skill_apply',
... | {
"content_hash": "7069ce70a4f14fb27167896d59d91daf",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 577,
"avg_line_length": 57,
"alnum_prop": 0.6062831497348021,
"repo_name": "SchoolIdolTomodachi/CinderellaProducers",
"id": "62184e3aedc16f6193bbe1ff41bf99a405021b2d",
"siz... |
"""UserUpdateHandlerFunction
Updates a user's profile attributes.
"""
from __future__ import print_function
import os
import json
import boto3
import botocore
from apigateway_helpers.exception import APIGatewayException
from apigateway_helpers.headers import get_response_headers
cognito_idp_client = boto3.client("... | {
"content_hash": "2e4eaf9d6fd63a2d87a86509eda483ed",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 104,
"avg_line_length": 29.71951219512195,
"alnum_prop": 0.6011489536315141,
"repo_name": "moduspwnens/boa-chat",
"id": "06b154d8ed6b2d55cddbcca7cbaaf26a9c4019b6",
"size": ... |
import sys
from test import regrtest
regrtest.main_in_temp_cwd()
| {
"content_hash": "258e8ce8ac4470be1d0c36ecc4e2ff8e",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 27,
"avg_line_length": 21.666666666666668,
"alnum_prop": 0.8,
"repo_name": "ms-iot/python",
"id": "09125aa0def08bd39f1461d3f1ea2b76bec8dd8e",
"size": "89",
"binary": false... |
from random import randint
class Stand:
def __init__(self,balance,lemons,name,coords):
self.balance = balance
self.lemons = lemons
self.name = name
self.stand_coords = coords
self.ads = set()
def sell(self, cost):
if self.lemons == 0:
raw_i... | {
"content_hash": "992fc5bfa42d4237799e360dd274beeb",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 82,
"avg_line_length": 30.055555555555557,
"alnum_prop": 0.4596426370918053,
"repo_name": "ProgramQ/lemonator",
"id": "9389f783550e0a9fd06ff9c7bbefd5399badb004",
"size": "1... |
import pytest
@pytest.mark.benchmark(
group="ModelSerializer get_fields",
warmup=True
)
def test_serializer_get_fields(serializer_class, data, benchmark):
serializer = serializer_class(data=data)
@benchmark
def result():
return serializer.get_fields()
@pytest.mark.benchmark(
group="... | {
"content_hash": "5cafae84bac1471f270d5b56bd7d75c2",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 93,
"avg_line_length": 24.470588235294116,
"alnum_prop": 0.7067307692307693,
"repo_name": "thedrow/drf-benchmarks",
"id": "ed2be4c7f5e5fc59a8ab1877fee1e9064a9342e2",
"size"... |
from setuptools import find_packages
from setuptools import setup
from cvmchain import config
setup(name='cvmchain',
version=config.APP_VERSION,
description='',
author=config.AUTHOR,
author_email=config.AUTHOR_EMAIL,
setup_requires='setuptools',
packages=['cvmchain', 'cvmchain.network', 'cvmchain.chain', 'cvmcha... | {
"content_hash": "64612b84934b81d11403fa31f233deca",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 80,
"avg_line_length": 28.473684210526315,
"alnum_prop": 0.7319778188539742,
"repo_name": "dakk/cvmchain",
"id": "0c871bd146c9d53216535bf9ad9878690d078d04",
"size": "718",
... |
from ggame import App, RectangleAsset, ImageAsset, Sprite, LineStyle, Color, Frame
from random import randrange
black = Color(0x000000, 1.0)
blue = Color(0x2D9FC2,1.0)
white = Color(0xFFFFFF, 1.0)
red = Color(0xFC5D5D,1.0)
grey = Color(0x858585,1.0)
thinline = LineStyle(1, black)
celld = 35
rectangle3 = RectangleAsset(... | {
"content_hash": "644b980bb0913c86b29dd23c09bee99f",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 105,
"avg_line_length": 35.532407407407405,
"alnum_prop": 0.5439739413680782,
"repo_name": "glenpassow/Final-Project",
"id": "24af9f1d7df9e13ae53546a7ca298beba3fd2eca",
"s... |
import os
import os.path
import io
from operator import itemgetter
import logging
import SPARQLWrapper
from .constants import DEFAULT_TEXT_LANG
from .utils import KrnlException, is_collection
# Maximum number of nestes magic files
MAX_RECURSE = 10
# The list of implemented magics with their help, as a pair [param... | {
"content_hash": "e574bd0a074246c5b64887ebee493b46",
"timestamp": "",
"source": "github",
"line_count": 265,
"max_line_length": 146,
"avg_line_length": 36.06415094339623,
"alnum_prop": 0.5177356911164591,
"repo_name": "paulovn/sparql-kernel",
"id": "8f4a01c2a2f58ad1ef6c98c4f48775b76a2d6c33",
"size"... |
from JumpScale import j
from time import sleep
app = j.tools.cuisine._getBaseAppClass()
class CuisineOwncloud(app):
NAME = 'owncloud'
def __init__(self, executor, cuisine):
self._executor = executor
self._cuisine = cuisine
def install(self, start=True):
"""
install ownc... | {
"content_hash": "da699d013544a52a20ca9fe7b6fdbc7a",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 75,
"avg_line_length": 21.303030303030305,
"alnum_prop": 0.5803698435277382,
"repo_name": "Jumpscale/jumpscale_core8",
"id": "364950a5560091e73ebe6fd8a2aa2d8c3e66fe33",
"si... |
import numpy as np
# import accelerate.cuda as cuda
from data_prep import features, targets, features_test, targets_test
# useGPU = cuda.cuda_compatible()
np.random.seed(21)
def sigmoid(x):
# calculate sigmoid
return 1 / (1+np.exp(-x))
#Hyper parameters
n_hidden = 2 # number of hidden units
epocs = 900
lea... | {
"content_hash": "43fd12f5d1b9403314504608003dbc9a",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 76,
"avg_line_length": 32.407407407407405,
"alnum_prop": 0.6434285714285715,
"repo_name": "morphean/deep-learning",
"id": "9ffec10295b68524d67398e24ef7ea117ddac352",
"size"... |
import contextlib
import json
import io
import logging
import handler
import models
import transaction
models.init()
queries_log = []
logger = logging.getLogger('peewee')
logger.setLevel(logging.DEBUG)
logger.addHandler(handler.ListHandler(queries_log))
out = io.StringIO()
with contextlib.redirect_stdout(out):
... | {
"content_hash": "44b79762a4ee193604048552d3dbbe84",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 58,
"avg_line_length": 17.428571428571427,
"alnum_prop": 0.735655737704918,
"repo_name": "omaraboumrad/djanground",
"id": "4674f591a6badf2a820068b276994530ea573a10",
"size"... |
from datetime import datetime
import time
# htmlentitydefs was renamed as html.entities in python3
try:
import html.entities as htmlentitydefs
except ImportError:
try:
import htmlentitydefs
except ImportError:
raise ImportError("Import error. There is no html.entities or htmlentitydefs modul... | {
"content_hash": "49104ad549b8e9b7e4d252a01180bb98",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 93,
"avg_line_length": 26.523809523809526,
"alnum_prop": 0.5960502692998204,
"repo_name": "felHR85/Tweepy-3",
"id": "e759f6a9177918bb6c1e9e365e63920e7f404489",
"size": "28... |
from keystone.auth import controllers
def append_v3_routers(mapper, routers):
auth_controller = controllers.Auth()
mapper.connect('/auth/tokens',
controller=auth_controller,
action='authenticate_for_token',
conditions=dict(method=['POST']))
mapper.... | {
"content_hash": "b018dba45c64ad249be32b6f8ab2a130",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 54,
"avg_line_length": 39.84615384615385,
"alnum_prop": 0.5386100386100386,
"repo_name": "kwss/keystone",
"id": "52466f348ef330f05042244aacd764bf8519bc8d",
"size": "1660",
... |
import six
class SymbolsMeta(type):
def __new__(cls, name, bases, attrs):
syms = {}
reverse = {}
for k, v in attrs.items():
if not k.startswith('_') and isinstance(v, int):
syms[k] = v
reverse[v] = k
attrs['_symbols'] = syms
attrs... | {
"content_hash": "209463047d6b082271700e7d2100a950",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 60,
"avg_line_length": 27.791666666666668,
"alnum_prop": 0.5337331334332833,
"repo_name": "lodevil/cpy",
"id": "0b159faa112cb050fef393a0b563753609b4dd36",
"size": "667",
... |
"""
switchboard.admin
~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2015 Kyle Adams.
:license: Apache License 2.0, see LICENSE for more details.
"""
from datetime import datetime
import logging
from operator import attrgetter
from bottle import Bottle, request, mako_view as view
import datastore.core
from webob.exc import H... | {
"content_hash": "80529b634a3eebad9f099a23bd90dcfd",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 76,
"avg_line_length": 27.286324786324787,
"alnum_prop": 0.6043852779953015,
"repo_name": "kadams54/switchboard",
"id": "1233fedad8607d69f0a2ee304cc6c0782d3c4c8b",
"size":... |
# Process [link](<to> "stuff")
from ..common.utils import isSpace, normalizeReference
from .state_inline import StateInline
def link(state: StateInline, silent: bool):
href = ""
title = ""
label = None
oldPos = state.pos
maximum = state.posMax
start = state.pos
parseReference = True
... | {
"content_hash": "582b414d602aeab8a8bd94e1d069eab9",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 88,
"avg_line_length": 29.086666666666666,
"alnum_prop": 0.5014898005959202,
"repo_name": "executablebooks/markdown-it-py",
"id": "2394d6c307cb39f8c0a62130809c746b3153404c",... |
"""
InformationMachineAPILib.Models.GetUOMsWrapper
"""
from InformationMachineAPILib.APIHelper import APIHelper
from InformationMachineAPILib.Models.UOMInfo import UOMInfo
from InformationMachineAPILib.Models.MetaBase import MetaBase
class GetUOMsWrapper(object):
"""Implementation of the 'GetUOMsWrapper'... | {
"content_hash": "2ce29866d4ac77f6c4aa543ffed3e3a4",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 75,
"avg_line_length": 34.19047619047619,
"alnum_prop": 0.592966573816156,
"repo_name": "information-machine/information-machine-api-python",
"id": "8241346c41effb617c2109656... |
import tensorflow as tf
def run():
output = None
logit_data = [2.0, 1.0, 0.1]
logits = tf.placeholder(tf.float32)
# Calculate the softmax of the logits
softmax = tf.nn.softmax(logit_data)
with tf.Session() as sess:
# Feed in the logit data
output = sess.run(softmax... | {
"content_hash": "ecdc858f7e7ca09896f32b10e7b7b09a",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 66,
"avg_line_length": 22.764705882352942,
"alnum_prop": 0.6098191214470284,
"repo_name": "mmaraya/nd101",
"id": "7d92e4f58c7bd13a135b2b4f2ef748be00509b09",
"size": "465",
... |
SECRET_KEY = 'cat'
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'channels',
'channels.delay',
'tests',
)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
}
CHANNEL_LAYERS = {... | {
"content_hash": "fe976872d768a2a15872a0fb8bc2b3d0",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 60,
"avg_line_length": 18.633333333333333,
"alnum_prop": 0.5635062611806798,
"repo_name": "Coread/channels",
"id": "bebbd2a876579035da0b44c814ce5532bf25652e",
"size": "559"... |
from __future__ import unicode_literals
from django.db import migrations, models
import mgw7510.models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='WebUser',
fields=[
('id', models.AutoField(verbos... | {
"content_hash": "4174d300e368e53438a43d34bcd442fb",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 120,
"avg_line_length": 57.95238095238095,
"alnum_prop": 0.6117502054231717,
"repo_name": "gter1216/mgw7510-web",
"id": "9a7047f3a4c39ee7471ebbb070401854803b6dd3",
"size": ... |
from __future__ import absolute_import
import logging
from functools import wraps
from celery import chain, chord, states
from kombu.utils import uuid
from django.contrib.auth.models import AnonymousUser
from roll_engine.utils.log import get_logger
from roll_engine.celery import app
from roll_engine import constant... | {
"content_hash": "5f3578349cb64096c6589609b430d974",
"timestamp": "",
"source": "github",
"line_count": 271,
"max_line_length": 79,
"avg_line_length": 35.22140221402214,
"alnum_prop": 0.5875327396542692,
"repo_name": "ctripcorp/tars",
"id": "d02ae89fa45069718f6767ea5dd7d27cddb5d0df",
"size": "9545"... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('avalonline', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='player',
name='role',
field=mo... | {
"content_hash": "eab9eb304a192414e93b9255e4abb670",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 123,
"avg_line_length": 24.5,
"alnum_prop": 0.5873015873015873,
"repo_name": "fako/avalonline",
"id": "fa8b44193a1482657dac7064a9affae1cb16b540",
"size": "465",
"binary":... |
from __future__ import division, unicode_literals
"""
A module to perform diffusion analyses (e.g. calculating diffusivity from
mean square displacements etc.). If you use this module, please consider
citing the following papers::
Ong, S. P., Mo, Y., Richards, W. D., Miara, L., Lee, H. S., & Ceder, G.
(2013).... | {
"content_hash": "731a4300fd65aa4874e7aa32234acdf5",
"timestamp": "",
"source": "github",
"line_count": 772,
"max_line_length": 80,
"avg_line_length": 44.21761658031088,
"alnum_prop": 0.5725333958284509,
"repo_name": "sonium0/pymatgen",
"id": "9c07a7e9eae7942240a0cce462f1dc423b8081d1",
"size": "342... |
class SerializerInt(object):
def dumps(self,obj):
return str(obj)
def loads(self,s):
return int(s) | {
"content_hash": "1dd087f8c210bf70fdae4af5046e0c45",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 28,
"avg_line_length": 24.4,
"alnum_prop": 0.6065573770491803,
"repo_name": "Jumpscale/jumpscale6_core",
"id": "39d69168100c1e5c72cfb1a569e563062c09d5af",
"size": "124",
"... |
from flask import (
Blueprint,
redirect,
render_template,
url_for
)
from flask.ext.login import current_user
from flask.ext.security import login_required
from application.skills.forms import AuditForm
from application.skills.models import Audit
skills = Blueprint('skills', __name__, template_folder=... | {
"content_hash": "e4f9598201ca473b5227c232b5aacb08",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 82,
"avg_line_length": 25.272727272727273,
"alnum_prop": 0.6690647482014388,
"repo_name": "crossgovernmentservices/csdigital-prototype",
"id": "51cef6da6d98cde86fce15faddf2e5... |
import weakref
# Based on: https://stackoverflow.com/a/2022629
# By Longpoke (https://stackoverflow.com/users/80243)
class Event(list):
"""Event subscription.
A list of callable objects. Calling an instance of this will cause a
call to each item in the list in ascending order by index.
The list can a... | {
"content_hash": "143df9d64f8d6971d5a9d273f1a44316",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 135,
"avg_line_length": 31.639344262295083,
"alnum_prop": 0.5683937823834196,
"repo_name": "fyookball/electrum",
"id": "24b162d76f5680ce22f92b5fe53fcee6b730117b",
"size": "... |
"""Init file for HassIO addons git."""
import asyncio
import logging
from pathlib import Path
import shutil
import git
from .util import get_hash_from_repository
from ..const import URL_HASSIO_ADDONS
_LOGGER = logging.getLogger(__name__)
class GitRepo(object):
"""Manage addons git repo."""
def __init__(se... | {
"content_hash": "1d95bcddf2b2d5da2e17d2980c7fd1ec",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 74,
"avg_line_length": 30.878504672897197,
"alnum_prop": 0.5562953995157385,
"repo_name": "pvizeli/hassio",
"id": "5e9c02618c1b51d115890ba6272c2f11705c06da",
"size": "3304... |
from django import template
from django.core.urlresolvers import reverse
from ..thumbs import DEFAULT_SIZE
#
register = template.Library()
#
@register.simple_tag
def preview(media,templatedir="mediafiles",*args,**kwargs ):
try:
t,sub = media.mimetype.split('/')
return template.loader.get_... | {
"content_hash": "3f98298018c9449abbb743b4c76aa53f",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 85,
"avg_line_length": 33.125,
"alnum_prop": 0.6842767295597484,
"repo_name": "hdknr/django-mediafiles",
"id": "1dec7587a1c34d8b7464b165f0b9d5dfb27d4da9",
"size": "1614",
... |
import argparse
import sys
from typing import Any
from django.core import validators
from django.core.exceptions import ValidationError
from django.core.management.base import CommandError
from django.db.utils import IntegrityError
from zerver.lib.actions import do_create_user
from zerver.lib.initial_password import ... | {
"content_hash": "844f9bb4dca69241cda9e1f08715616e",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 103,
"avg_line_length": 43.77319587628866,
"alnum_prop": 0.5376825247291569,
"repo_name": "brainwane/zulip",
"id": "d1f6a129d70fe01f82ea276c4d272513d231767e",
"size": "4246... |
from __future__ import absolute_import
import json
import pickle
class JSON(object):
@staticmethod
def encode(item):
return json.dumps(item)
@staticmethod
def decode(item):
if isinstance(item, bytes):
item = item.decode()
return json.loads(item)
class String(obj... | {
"content_hash": "d5cc727488604cfd547bbf7434faae3f",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 38,
"avg_line_length": 17.708333333333332,
"alnum_prop": 0.6094117647058823,
"repo_name": "mylokin/redisext",
"id": "61f1dca17e3da2e33d8a568a4f70f66763b5f538",
"size": "850... |
import types
#class Type:
# @property
# def name ( self ):
# return self.m_name
#
# @property
# def modifiers ( self ):
#
# def __init__ ( self, _name, _type ):
# self.m_name = _name
# self.m_type = _type
class Parameter:
@property
def name ( sel... | {
"content_hash": "e934ba88f0611b5d8721585d178cc750",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 61,
"avg_line_length": 24.522222222222222,
"alnum_prop": 0.5111010421386497,
"repo_name": "micronpn/sequanto-automation",
"id": "b05bf912bc2bd35f44e6890e49c377d4f1d9b71c",
... |
"""
HTTP server that returns a fixed string.
"""
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
class Handler(BaseHTTPRequestHandler):
def do_GET(s):
s.wfile.write(b"hi")
s.wfile.close()
httpd = HTTPServer((b"0.0.0.0", 8080), Handler)
httpd.serve_forever()
| {
"content_hash": "6bed95b6b797217c46bc7085389f6601",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 61,
"avg_line_length": 19.8,
"alnum_prop": 0.6902356902356902,
"repo_name": "1d4Nf6/flocker",
"id": "d831a2ec42c6f3c8294287d68c199d46b509ada1",
"size": "297",
"binary": f... |
import copy
import re
import signal
import warnings
from datetime import datetime
from functools import reduce
from itertools import filterfalse, tee
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Generator,
Iterable,
List,
MutableMapping,
Optional,
Tuple,
TypeVar,
... | {
"content_hash": "820c5da3db6c434c488d09e5e3478b06",
"timestamp": "",
"source": "github",
"line_count": 340,
"max_line_length": 108,
"avg_line_length": 33.75588235294118,
"alnum_prop": 0.6405855188638145,
"repo_name": "mistercrunch/airflow",
"id": "c75a017e2b165180d547c20295076b4aedd04986",
"size":... |
import unittest
import numpy as np
import pycqed as pq
import os
import matplotlib.pyplot as plt
from pycqed.analysis_v2 import measurement_analysis as ma
from pycqed.analysis_v2 import readout_analysis as ra
# Add test: 20180508\182642 - 183214
class Test_SSRO_auto_angle(unittest.TestCase):
@classmethod
de... | {
"content_hash": "497a7622dd0c9665576b341e4bbc4723",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 80,
"avg_line_length": 44.07798165137615,
"alnum_prop": 0.5365802893121032,
"repo_name": "DiCarloLab-Delft/PycQED_py3",
"id": "30c82230ea4a2d233e75e332e9f2cc05a85c1126",
"... |
import logging
__all__ = [
'base',
'data_mining',
'database',
'model_selection',
'models',
'network_analysis',
'predict'
]
logger = logging.getLogger("pyppi")
logger.setLevel(logging.INFO)
logger.propagate = False
handler = logging.StreamHandler()
formatter = logging.Format... | {
"content_hash": "d0c2d4b2ef451526b9c7f3679e1188db",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 66,
"avg_line_length": 20.87878787878788,
"alnum_prop": 0.6386066763425254,
"repo_name": "daniaki/pyPPI",
"id": "04b2d8ef823b3287c861f64099ef3167767191b7",
"size": "706",
... |
""" ISOBUS description """
# isobus imports:
from isobus.vt.client import VTClient
from isobus.common import IBSException
| {
"content_hash": "a685223485898a467d1106b46515b12b",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 38,
"avg_line_length": 24.6,
"alnum_prop": 0.7804878048780488,
"repo_name": "jboomer/python-isobus",
"id": "699bb9331140aeb26f14a0a6670a13bcc212584b",
"size": "123",
"bina... |
"""Init file for HassIO rest api."""
import logging
from pathlib import Path
from aiohttp import web
from .addons import APIAddons
from .homeassistant import APIHomeAssistant
from .host import APIHost
from .network import APINetwork
from .supervisor import APISupervisor
from .security import APISecurity
_LOGGER = lo... | {
"content_hash": "326ff9bbaa2f60ab9dacd1906fd01fce",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 79,
"avg_line_length": 39.88721804511278,
"alnum_prop": 0.6390197926484449,
"repo_name": "pvizeli/hassio",
"id": "856f8aabfce50cffafa6d4297b4c518e21329df3",
"size": "5305"... |
import logging
import shutil
import json
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotAllowed, Http404
fro... | {
"content_hash": "96aca13071fa91afde44ce1f29511d53",
"timestamp": "",
"source": "github",
"line_count": 666,
"max_line_length": 129,
"avg_line_length": 35.87687687687688,
"alnum_prop": 0.6421277308110823,
"repo_name": "cgourlay/readthedocs.org",
"id": "4ea742dc78135735ca1a4499bd714b6b671d9a9a",
"si... |
'''
Created on Feb 20, 2010
@author: ctoscano
'''
from slique.html.element import element
from slique.html.html import new
class table(element):
'''
classdocs
'''
def __init__(self, **attrs):
'''
Constructor
'''
super(table, self).__init__('table', **attrs)
se... | {
"content_hash": "e1c8991dc9a9629739a87bd05ebd21e7",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 72,
"avg_line_length": 23.654761904761905,
"alnum_prop": 0.5153497735279315,
"repo_name": "ctoscano/SliqueHTML",
"id": "0496bfdabf02827fd26eea2f454f67cf1fb9304c",
"size": "... |
from .api.v2 import ClientV2
| {
"content_hash": "93ef097815cee73ffd84985e09085db2",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 28,
"avg_line_length": 29,
"alnum_prop": 0.7931034482758621,
"repo_name": "valerylisay/digitalocean-api",
"id": "a6c4086631b1bb36aad0e1b1ae73848af988cdf9",
"size": "46",
"... |
import hyperopt
from hyperopt import fmin, tpe, hp
from hyperopt.mongoexp import MongoTrials
import sys
import task
space = hp.uniform('x', -10, 10)
trials = MongoTrials('mongo://localhost:27017/razlaw/jobs', exp_key=sys.argv[2])
if sys.argv[1] == "search":
best = fmin(task.objective,
space=space,
trials... | {
"content_hash": "c20f6ebc1997a01d70092f3411c1ddef",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 80,
"avg_line_length": 28.384615384615383,
"alnum_prop": 0.7168021680216802,
"repo_name": "temporaer/hyperopt_minimal",
"id": "84188f706d3b2c82ddef66a3180cefd7bcf48937",
"s... |
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 RouteTablesOperations(object):
"""RouteTablesOperations operations.
... | {
"content_hash": "827c14171e758c5d132bb45e447c3f32",
"timestamp": "",
"source": "github",
"line_count": 411,
"max_line_length": 166,
"avg_line_length": 46.2676399026764,
"alnum_prop": 0.6419856962557846,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "e82d56d6ad5445fcfff26f77277b1a29ad852b9f",
... |
import copy
from oslotest import mockpatch
from tempest.lib import exceptions as lib_exc
from tempest.lib.services.compute import images_client
from tempest.tests.lib import fake_auth_provider
from tempest.tests.lib.services.compute import base
class TestImagesClient(base.BaseComputeServiceTest):
# Data Diction... | {
"content_hash": "24816f1427dcaf460a3734adc6f500a3",
"timestamp": "",
"source": "github",
"line_count": 251,
"max_line_length": 76,
"avg_line_length": 37.1394422310757,
"alnum_prop": 0.5495601802188371,
"repo_name": "nuagenetworks/tempest",
"id": "28757c39fa2d82f5e63ae7689417d0efd5fc2cae",
"size": ... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('events', '0030_brandingperiod_override_listings_root'),
]
operations = [
migrations.AlterField(
model_name='event',
name='ticket_type',
field=models.Char... | {
"content_hash": "d3277944b0eb892c85e912b07d90ab85",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 179,
"avg_line_length": 30.5,
"alnum_prop": 0.5573770491803278,
"repo_name": "sussexstudent/falmer",
"id": "f7d76238b0effcfd8ed14b357d772ca4cd902f86",
"size": "537",
"bin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.