text stringlengths 4 1.02M | meta dict |
|---|---|
"""
Attributes:
SNAP_WIDTH (int): Description
"""
import logging
import random
from PyQt5.QtCore import (
QLineF,
QPointF,
Qt,
QRectF
)
from PyQt5.QtWidgets import (
QGraphicsItem,
QGraphicsEllipseItem,
QGraphicsSimpleTextItem,
QGraphicsSceneMouseEvent
)
from cadnano.views.pathview... | {
"content_hash": "d049043cc9a00e3ee6dc8f8f54f7ae4a",
"timestamp": "",
"source": "github",
"line_count": 448,
"max_line_length": 119,
"avg_line_length": 33.921875,
"alnum_prop": 0.6120286898730013,
"repo_name": "scholer/cadnano2.5",
"id": "dcfcdd27eaa7dc56f042ba5aba4286a7084301ed",
"size": "15221",
... |
__author__ = """Chris Tabor (dxdstudio@gmail.com)"""
if __name__ == '__main__':
from os import getcwd
from os import sys
sys.path.append(getcwd())
from MOAL.helpers.display import Section
from MOAL.helpers.display import print_h4
from MOAL.helpers.display import annotate
from MOAL.helpers.display import p... | {
"content_hash": "daf14134391cb19456725474a30ec27f",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 78,
"avg_line_length": 23.456,
"alnum_prop": 0.5890177353342428,
"repo_name": "christabor/MoAL",
"id": "a86abd8ace147679331418176e4dafccb9514ac5",
"size": "2957",
"binar... |
"""Support for Zigbee Home Automation devices."""
import asyncio
import logging
import voluptuous as vol
from zhaquirks import setup as setup_quirks
from zigpy.config import CONF_DEVICE, CONF_DEVICE_PATH
from homeassistant import config_entries, const as ha_const
import homeassistant.helpers.config_validation as cv
... | {
"content_hash": "b2fd90eb79f85c447040853c7db3160c",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 88,
"avg_line_length": 31.593220338983052,
"alnum_prop": 0.6797210300429185,
"repo_name": "adrienbrault/home-assistant",
"id": "707e0292c4516659ce946f0463d44167f3cb3bd5",
... |
import salt.config
_MINION_CONFIG_FILE = '/etc/salt/minion'
minion_config = salt.config.minion_config(_MINION_CONFIG_FILE)
print 'Master: {0}'.format(minion_config.get('master'))
| {
"content_hash": "3c8dca48fade3e7b7ec9cb15b08db22d",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 62,
"avg_line_length": 26,
"alnum_prop": 0.7362637362637363,
"repo_name": "craig5/salt-essentials-utils",
"id": "07a4f9cd7d139faebdf9bd21c2e010f39208a46c",
"size": "205",
... |
from __future__ import unicode_literals
import datetime
import itertools
import os
import re
from importlib import import_module
from django.apps import apps
from django.conf import settings
from django.contrib.admin.models import LogEntry
from django.contrib.auth import REDIRECT_FIELD_NAME, SESSION_KEY
from django.c... | {
"content_hash": "22dc4547415a933dd42714ba032f0d1c",
"timestamp": "",
"source": "github",
"line_count": 1020,
"max_line_length": 119,
"avg_line_length": 43.430392156862744,
"alnum_prop": 0.6206460642452426,
"repo_name": "AltSchool/django",
"id": "f3593d46c5be3f3b97f463f725fd24558fab9a5c",
"size": "... |
"""
Sample application that demonstrates various aspects of App Engine's request
handling.
"""
import os
import time
import webapp2
# [START request_timer]
class TimerHandler(webapp2.RequestHandler):
def get(self):
from google.appengine.runtime import DeadlineExceededError
try:
time... | {
"content_hash": "8fb15eeb433fe0ab2c7596353f0b53c7",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 76,
"avg_line_length": 26.75,
"alnum_prop": 0.6441409058231489,
"repo_name": "clarko1/Cramd",
"id": "5064b5b937e762cc892e623c09c0ca0c163c2215",
"size": "1988",
"binary": ... |
"""Extracts features for different models."""
import functools
import tensorflow as tf
from deeplab.core import resnet_v1_beta
from deeplab.core import xception
from tensorflow.contrib.slim.nets import resnet_utils
from nets.mobilenet import mobilenet_v2
slim = tf.contrib.slim
# Default end point for MobileNetv2.
_... | {
"content_hash": "b9592616d17e88069880cae6c93d32f9",
"timestamp": "",
"source": "github",
"line_count": 315,
"max_line_length": 80,
"avg_line_length": 36.62539682539683,
"alnum_prop": 0.6584033977637167,
"repo_name": "cshallue/models",
"id": "da89dfe938d66e0844fca7205de0e2fd791054bd",
"size": "1222... |
import GafferUI
import GafferVDB
GafferUI.Metadata.registerNode(
GafferVDB.PointsGridToPoints,
'description',
"""Converts a points grid in a VDB object to a points primitive.""",
plugs={
'grid' : [
'description',
"""
Name of the points grid in the VDB to create a points primitive from.
"""
],
"n... | {
"content_hash": "bcbc293e89aee55fa2cacba3ee5536d3",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 77,
"avg_line_length": 21.4,
"alnum_prop": 0.671562082777036,
"repo_name": "GafferHQ/gaffer",
"id": "d946ae082ed77f005eb1463c7b0a78785a8d7837",
"size": "2564",
"binary": ... |
"""
Tasks module for use within the integration tests.
"""
from invoke import task
@task
def print_foo(c):
print("foo")
@task
def print_name(c, name):
print(name)
@task
def print_config(c):
print(c.foo)
| {
"content_hash": "c35ed7d55addd9725d55526ede497324",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 50,
"avg_line_length": 12.222222222222221,
"alnum_prop": 0.6545454545454545,
"repo_name": "mkusz/invoke",
"id": "70ce5afd074c49bf6a7493fb89a0bb8e7af38cc6",
"size": "220",
... |
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request
from product_spiders.items import Product, ProductLoader
from product_spiders.utils import extract_price2uk
from decimal import Decimal
import logging
class RefrinclimaItSpider(BaseSpider):
name = ... | {
"content_hash": "534b5ecea6599c21fa6ff26c178e2354",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 104,
"avg_line_length": 35.0625,
"alnum_prop": 0.5984848484848485,
"repo_name": "0--key/lib",
"id": "1efc3a75f5c071479e80fb035dcd450ed6e545a8",
"size": "2244",
"binary": ... |
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.header import Header
from email.generator import Generator
from random import randint
from time import sleep
from credentials import GMAI... | {
"content_hash": "c9f469d815a527e3b2bf9c100ad6606a",
"timestamp": "",
"source": "github",
"line_count": 543,
"max_line_length": 770,
"avg_line_length": 36.55064456721915,
"alnum_prop": 0.6932030029727415,
"repo_name": "PythonSanSebastian/pyper_the_bot",
"id": "6d68c1e7421c5f7e190f636d41d783fcf20814b7... |
import getpass
import importlib.util
import importlib.machinery
import itertools
import json
import os
import io
import subprocess
import sys
import time
from contextlib import contextmanager, redirect_stdout
from typing import Callable
import yaml
from datetime import datetime, timedelta
import consts
SELF_ABS_PATH... | {
"content_hash": "0bae28d208cde96dedcc8e490928cdef",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 113,
"avg_line_length": 25.358974358974358,
"alnum_prop": 0.6180485338725986,
"repo_name": "avitalyahel/autolite",
"id": "f37f711a94399b2d90445f08cfe49dec81443ed0",
"size"... |
"""
提供props常见操作支持,需要对应的类支持get_uuid, 目前是IData
"""
import types
import datetime
import copy
from david.lib.cache import lc
from david.lib.store import redis_store as db
class PropsMixin(object):
def get_uuid(self):
if not self.id:
raise RuntimeError('PropsMixin must have an id')
retur... | {
"content_hash": "5f5075c1ff93150a4ccd9efe2fe0a14d",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 99,
"avg_line_length": 27.017241379310345,
"alnum_prop": 0.5701978302488833,
"repo_name": "ktmud/david",
"id": "7d5a58882337122830229d6e8326230c8edc03e3",
"size": "3199",
... |
from trac.core import Component, implements, ExtensionPoint
from trac.util.text import empty
from trac.config import Option, BoolOption, ListOption
from trac.ticket.api import ITicketChangeListener
from trac.attachment import IAttachmentChangeListener
import datetime
import os
import re
from itertools import chain
im... | {
"content_hash": "1297de059147658e7e7bd04f2555689a",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 94,
"avg_line_length": 40.82539682539682,
"alnum_prop": 0.5958398133748056,
"repo_name": "CGI-define-and-primeportal/trac-plugin-feedrabbitmq",
"id": "10a8dd1acec6913cb11a0e... |
"""SCons.Tool.link
Tool-specific initialization for the generic Posix linker.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# Permission is hereby grant... | {
"content_hash": "fd3e5cc1d422434ce17a6a72d2e43a74",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 146,
"avg_line_length": 41.18627450980392,
"alnum_prop": 0.6227088788383718,
"repo_name": "smandy/d_c_experiment",
"id": "3871e8d46f7c5800c140834ac57f96426120d60a",
"size"... |
"""
********************************************************************************
* Name: utilities.py
* Author: Nathan Swain
* Created On: 2014
* Copyright: (c) Brigham Young University 2014
* License: BSD 2-Clause
********************************************************************************
"""
import logging
i... | {
"content_hash": "682e25007362f9aed8b120505aeea2d4",
"timestamp": "",
"source": "github",
"line_count": 413,
"max_line_length": 191,
"avg_line_length": 37.96125907990315,
"alnum_prop": 0.614300293404771,
"repo_name": "CI-WATER/tethys",
"id": "ae0f98268a304ba94ce64513947547e581ef978f",
"size": "1567... |
"""
Tests for the Crazy Egg template tags and filters.
"""
from django.http import HttpRequest
from django.template import Context
from django.test.utils import override_settings
from analytical.templatetags.crazy_egg import CrazyEggNode
from analytical.tests.utils import TagTestCase
from analytical.utils import Anal... | {
"content_hash": "9f4bab4a5c9d790346f655deef0caf16",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 77,
"avg_line_length": 34.62,
"alnum_prop": 0.6632004621606008,
"repo_name": "machtfit/django-analytical",
"id": "66e6d56d8a2de27fb359247224be7d235a683401",
"size": "1731",... |
DIFF_TEST_DATA = '''diff --git a/WebCore/layout/style/StyleFlexibleBoxData.h b/WebCore/layout/style/StyleFlexibleBoxData.h
index f5d5e74..3b6aa92 100644
--- a/WebCore/layout/style/StyleFlexibleBoxData.h
+++ b/WebCore/layout/style/StyleFlexibleBoxData.h
@@ -47,7 +47,6 @@ public:
unsigned align : 3; // EBoxAlignme... | {
"content_hash": "44b5eec2408a1d67ceb15ec217d80f98",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 162,
"avg_line_length": 39.78431372549019,
"alnum_prop": 0.7274519467718088,
"repo_name": "sgraham/nope",
"id": "6d25d43ec9e6ac05f3f767fa505ce2066ecc891b",
"size": "3637",
... |
from django.conf.urls import url
from registration import views
import django.contrib.auth.views as auth_views
urlpatterns = [
url(r'^register/$', views.register, name='register'),
url(r'^login/$', views.user_login, name='login'),
url(r'^logout/$', views.user_logout, name='logout'),
url(r'^profile/$', ... | {
"content_hash": "2b73eea9f9f73e913647d1ce546c9f3d",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 133,
"avg_line_length": 45.72727272727273,
"alnum_prop": 0.6918489065606361,
"repo_name": "sdrogers/ms2ldaviz",
"id": "c9d50497a5c35c836161f8b0d2f0c8695d917f80",
"size": "5... |
""" Provides the configuration for the weather module. """
from configparser import ConfigParser
import os
import sys
import errno
class Config():
"""
Reads the default configuration from config file. If file doesn't exist
then it is created.
:param config_file: Location of config file
"""
... | {
"content_hash": "124b63ef62a2984299499823e3cc165e",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 76,
"avg_line_length": 31.256410256410255,
"alnum_prop": 0.5467596390484003,
"repo_name": "paris3200/wunderapi",
"id": "91a75698ec577fdf041f5ae115cc81fd74fc00a1",
"size": "... |
import pygame
from toast.math import lerp
class Gradient(object):
@staticmethod
def createVerticalGradient(dimension, *stops):
surf = pygame.Surface(dimension)
width, height = dimension
num_stops = len(stops)
for h in range(height):
step = float(h) ... | {
"content_hash": "2fdef42518f279d05a5c73f1e80b06d4",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 75,
"avg_line_length": 33.72549019607843,
"alnum_prop": 0.488953488372093,
"repo_name": "JSkelly/Toast",
"id": "3f6cedc717421a2345053a96bf16159f6df40023",
"size": "1720",
... |
import sys
from uxie.utils import lazy_func
from inspect import cleandoc
def test_lazy_func(tmpdir):
package = tmpdir.mkdir('package')
package.join('__init__.py').write('')
package.join('func.py').write(cleandoc('''
def func():
return 10
'''))
package.join('test.py').write(cle... | {
"content_hash": "6071b94d6422214dff4c43ee338190f2",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 46,
"avg_line_length": 23.405405405405407,
"alnum_prop": 0.5392609699769053,
"repo_name": "baverman/uxie",
"id": "9b5580f0a02327dbb8b59c71961bf2871ac8da47",
"size": "866",
... |
import glob
import json
import math
import os
import re
import time
from base64 import b64decode
from subprocess import check_call, CalledProcessError
import six
from charmhelpers.fetch import (
apt_install,
filter_installed_packages,
)
from charmhelpers.core.hookenv import (
config,
is_relation_made,... | {
"content_hash": "0911f9a312faec1066911115454f22cf",
"timestamp": "",
"source": "github",
"line_count": 1657,
"max_line_length": 79,
"avg_line_length": 35.88292094146047,
"alnum_prop": 0.5290288943455885,
"repo_name": "konono/equlipse",
"id": "ea93159d8632449ff908baa0bd48cd3ed21b518a",
"size": "600... |
import calendar
import requests
import xmltodict
import logging
import module.collector.config as config
import module.common.const as const
from datetime import datetime
from module.common.topologydb import *
from module.common.md import post_md
from module.common.sdn_md import create_monitoring_data_xml,DBUploader
fr... | {
"content_hash": "daf7b6218a3a8dfa491bc92f5ac963bd",
"timestamp": "",
"source": "github",
"line_count": 340,
"max_line_length": 121,
"avg_line_length": 38.726470588235294,
"alnum_prop": 0.5597326649958229,
"repo_name": "ict-felix/stack",
"id": "357532986b2bad179d94cb47295bbff4df370521",
"size": "13... |
"""
Classes, functions and utilties related to hyde layouts
"""
import os
from fswrap import File, Folder
HYDE_DATA = "HYDE_DATA"
LAYOUTS = "layouts"
class Layout(object):
"""
Represents a layout package
"""
@staticmethod
def find_layout(layout_name='basic'):
"""
Find the layou... | {
"content_hash": "463d7bff83b86db7aff00660edff40f7",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 68,
"avg_line_length": 27.325581395348838,
"alnum_prop": 0.6042553191489362,
"repo_name": "jd/hyde",
"id": "31defe1e635eef625dc4b657f814a50a20e6ee5d",
"size": "1199",
"bi... |
angle = radians(10.)
patches = radians(360.)/angle
theta = np.arange(0,radians(360.),angle)
count = [0]*patches
for i, item in enumerate(some_array_of_azimuth_directions):
temp = int((item - item%angle)/angle)
count[temp] += 1
width = angle * np.ones(patches)
# force square figure and square axes looks better ... | {
"content_hash": "5560aa47b88a0b8972ca366b326d69e3",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 89,
"avg_line_length": 33.89655172413793,
"alnum_prop": 0.5696846388606307,
"repo_name": "Leviyu/Maligaro",
"id": "4934797129039e5d756d0b2a7bfdb094d395f752",
"size": "1966"... |
"""music.py
Joint AoD AoA estimation using 2D music Algorithm
using raw.dat file as Input
Naoufal Mahfoudi (c) 2016 mohamed-naoufal.mahfoudi@inria.fr
"""
from numpy import linalg as ln
from numpy import *
from detect_peaks import *
from phase_correction import *
from mpl_toolkits.mplot3d import Axes3D
import matplot... | {
"content_hash": "c447efb66471d66327bb4c8ec3382932",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 99,
"avg_line_length": 31.953703703703702,
"alnum_prop": 0.6041727035641843,
"repo_name": "naoufal51/Orion",
"id": "42144d8be2aaccb40a6317374a5062e7c7ebd440",
"size": "345... |
from __future__ import unicode_literals
from .responses import KmsResponse
url_bases = ["https?://kms.(.+).amazonaws.com"]
url_paths = {"{0}/$": KmsResponse.dispatch}
| {
"content_hash": "cfc1d6653ca59b15e00901a8a3c42c77",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 47,
"avg_line_length": 28.166666666666668,
"alnum_prop": 0.6923076923076923,
"repo_name": "william-richard/moto",
"id": "97e1a37204f13d6467b4e5d3f89824ddf70a3c33",
"size": "... |
import json
import random
from django.conf import settings
from django.contrib.messages import constants
from django.contrib.messages.storage.base import Message
from django.contrib.messages.storage.cookie import (
CookieStorage, MessageDecoder, MessageEncoder,
)
from django.test import SimpleTestCase, override_se... | {
"content_hash": "afd5bbfed934e3081ebab14647dbcccd",
"timestamp": "",
"source": "github",
"line_count": 179,
"max_line_length": 114,
"avg_line_length": 40.910614525139664,
"alnum_prop": 0.6431790249897583,
"repo_name": "ar4s/django",
"id": "53cf693f61c86807cb9d706f40d39bcfbc78e290",
"size": "7323",... |
import datetime
import csv
import logging
import re
from django.contrib.postgres.search import SearchQuery, SearchRank
from django.shortcuts import render, redirect
from django.core.paginator import PageNotAnInteger, EmptyPage, InvalidPage
from django.http import Http404, HttpResponse
from rest_framework.renderers imp... | {
"content_hash": "00a74f54d75445349de8b8e4ac3116ef",
"timestamp": "",
"source": "github",
"line_count": 271,
"max_line_length": 109,
"avg_line_length": 28.45018450184502,
"alnum_prop": 0.5876783398184177,
"repo_name": "aniversarioperu/django-manolo",
"id": "6252e6687554e78ce68bf31d653f77873c304a7f",
... |
from __future__ import unicode_literals
import json
from django.template import Library
from django.template.base import Node, NodeList, TextNode, VariableNode
from django.core.exceptions import ImproperlyConfigured
from django.utils.safestring import mark_safe
from djng.core.urlresolvers import get_all_remote_methods,... | {
"content_hash": "108860b0d99d0df259d4b278ba32ca13",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 108,
"avg_line_length": 37.867924528301884,
"alnum_prop": 0.6644245142002989,
"repo_name": "adrienbrunet/django-angular",
"id": "52da9b480cf0c8a563701ed69979b57444402820",
... |
from msrest.serialization import Model
class OperationDisplay(Model):
"""The object that represents the operation.
:param provider: Service provider: Microsoft.ResourceProvider
:type provider: str
:param resource: Resource on which the operation is performed: Profile,
endpoint, etc.
:type re... | {
"content_hash": "edd782f8c70b3dc17dcb6c89a3b8aef4",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 87,
"avg_line_length": 34.833333333333336,
"alnum_prop": 0.6392344497607656,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "39eab11883f391844c015afac1611f1a99c901aa",
... |
from Tkinter import *
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
class SeesawApp:
def __init__(self, master):
self.frame = Frame(master)
self.frame.pack()
self.number_of_groups = 5
self.bar_wi... | {
"content_hash": "491fc2016d005c316ef2fc27ba7aa826",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 108,
"avg_line_length": 35.661654135338345,
"alnum_prop": 0.6019397006114273,
"repo_name": "nhs-seesaw/seesaw",
"id": "aa21fc0365d03bfd343e8517ee429f6356040730",
"size": "... |
from flask.ext.sqlalchemy import SQLAlchemy
db = SQLAlchemy()
| {
"content_hash": "7dd1db4aa037986442e31e90e48d50c0",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 43,
"avg_line_length": 16,
"alnum_prop": 0.78125,
"repo_name": "ednapiranha/detour",
"id": "2fe63be0ec210a5d2b6ac093bcfdccc60cee9acb",
"size": "64",
"binary": false,
"co... |
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
from django.core.urlresolvers import reverse
from django.contrib.st... | {
"content_hash": "00c93ecfbbd5c52c5cd19c23822d0e43",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 73,
"avg_line_length": 38.74576271186441,
"alnum_prop": 0.6657917760279966,
"repo_name": "andri-ch/incling",
"id": "2a9f9338f8b4dcccc80d27199dd08cd3a4471bc9",
"size": "2310... |
class ChecksumMismatchException(Exception):
""" A checksum check has failed """
pass
class ConfigurationException(Exception):
""" Configuration exception """
pass
class HookExecutionException(Exception):
""" Failed to execute a hook """
pass
class InvalidTemplateException(Exception):
"... | {
"content_hash": "d0e684a34ac1f85cb08c3c824e35f595",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 66,
"avg_line_length": 21.17391304347826,
"alnum_prop": 0.7104722792607803,
"repo_name": "skymill/cumulus",
"id": "f356b81100ff9a4e6a5dda3a9cd77ff2402c1072",
"size": "487",... |
import argparse
from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings
ALL_SPIDERS = {"small": ["infinitefpv", "voodooquads", "shendrones", "demonframes", "lizardrc", "miniquadfpv", "hoverthings", "impulserc", "fpvreconn", "armattan", "dronematters", "flitetest", "boltrceu", "... | {
"content_hash": "95bfed8a9a59fd89b07a3a16ef0bdb13",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 221,
"avg_line_length": 41.15384615384615,
"alnum_prop": 0.697196261682243,
"repo_name": "rcbuild-info/scrape",
"id": "c1d1230e25b50e07426d84f5dea6fc764b78e2f3",
"size": "1... |
from django.contrib.admin import SimpleListFilter
from django.utils.translation import ugettext_lazy as _
from django.contrib.sites.models import get_current_site
from django.db.models import Max, Count
from django.utils import timezone
from django.contrib.auth import get_user_model
from opps.channels.models import Ch... | {
"content_hash": "49338fff80055feaefe85eb6d5e3f81b",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 79,
"avg_line_length": 35.6448087431694,
"alnum_prop": 0.5949716388164955,
"repo_name": "jeanmask/opps",
"id": "f2001f32108b94a881ffabec2baac7bfbcb013b9",
"size": "6539",
... |
"""Orthogonal matching pursuit algorithms
"""
# Author: Vlad Niculae
#
# License: BSD 3 clause
import warnings
from math import sqrt
import numpy as np
from scipy import linalg
from scipy.linalg.lapack import get_lapack_funcs
from joblib import Parallel
from ._base import LinearModel, _pre_fit, _deprecate_normalize... | {
"content_hash": "2bcb8170d79928f91c20cdb23e228c6a",
"timestamp": "",
"source": "github",
"line_count": 1049,
"max_line_length": 84,
"avg_line_length": 33.00095328884652,
"alnum_prop": 0.5977815009532613,
"repo_name": "huzq/scikit-learn",
"id": "c4bdbb6248726558d84ae66daaadf1eb7fa3f776",
"size": "3... |
"""DQN Agent with time input."""
import collections
import functools
from typing import Tuple
from dopamine.jax import losses
from dopamine.jax import networks
from dopamine.jax.agents.dqn import dqn_agent
from dopamine.replay_memory import prioritized_replay_buffer
from flax import linen as nn
import gin
import jax
i... | {
"content_hash": "80cadcd862ffd0dc8848e6018c125593",
"timestamp": "",
"source": "github",
"line_count": 350,
"max_line_length": 81,
"avg_line_length": 37.10857142857143,
"alnum_prop": 0.647828765013859,
"repo_name": "google-research/google-research",
"id": "723f12b0ebbb3259f16f716ec5341980520399cf",
... |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
"""
Test the --install-sandbox commandline option for Install() and InstallAs().
"""
import os.path
import TestSCons
test = TestSCons.TestSCons()
test.subdir('install', 'subdir')
target = 'destination'
destdir = test.workpath( target )
_SUBDIR_file3_ou... | {
"content_hash": "2203a20481782b0fea2a9c05db5ed9b4",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 76,
"avg_line_length": 30.086206896551722,
"alnum_prop": 0.6349570200573066,
"repo_name": "andrewyoung1991/scons",
"id": "020cd3acd55e3e351f19e1a9ae26fa24c9acc559",
"size":... |
"""
aliases so that a real error message is displayed if someone
uses the old class named
"""
from .pageobject import Page, Element, Elements, ElementMap
from .testcase import TestCase
# pylint: disable=invalid-name
# pylint: disable=too-few-public-methods
# pylint: disable=no-member
class Deprecated(object):
"""... | {
"content_hash": "a431a0e35311140e93dabd9ef623999e",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 71,
"avg_line_length": 28.682926829268293,
"alnum_prop": 0.6641156462585034,
"repo_name": "tjlee/holmium.core",
"id": "1e8c5bc8bd267cdab9a180bc91ceb2b4bd7ae2b0",
"size": "1... |
from collections import OrderedDict
import numpy as np
def getNames():
names = []
# 8
# sum quadrants
names.append('orders_longs_above')
names.append('orders_shorts_above')
names.append('positions_longs_above')
names.append('positions_shorts_above')
names.append('orders_longs_below')
... | {
"content_hash": "556f4124a3f8ac03b94def7d5d622c4b",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 118,
"avg_line_length": 27.067307692307693,
"alnum_prop": 0.5403197158081705,
"repo_name": "Tjorriemorrie/trading",
"id": "620f50571543c1753d4704a8b372354ea4a8680c",
"size... |
from django.core.management.base import BaseCommand, CommandError
from conference import models
from conference import utils
from optparse import make_option
class Command(BaseCommand):
def add_arguments(self, parser):
# Positional arguments
parser.add_argument('conference')
# Named (o... | {
"content_hash": "9fbae0ed7ac4411194848018be0c8ed0",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 113,
"avg_line_length": 37.09090909090909,
"alnum_prop": 0.5681372549019608,
"repo_name": "EuroPython/epcon",
"id": "9e9bbf54772ee38f802306945ae7cfd98f1a115d",
"size": "204... |
from trt_layer_auto_scan_test import TrtLayerAutoScanTest
from program_config import TensorConfig, ProgramConfig
import numpy as np
import paddle.inference as paddle_infer
from functools import partial
from typing import List
import unittest
class TrtConvertHardSigmoidTest_dim_2(TrtLayerAutoScanTest):
def is_prog... | {
"content_hash": "544bb1c31d6145e62a976fcee54120db",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 80,
"avg_line_length": 39.89,
"alnum_prop": 0.48383053396841313,
"repo_name": "luotao1/Paddle",
"id": "3c8cd8948f4153d01987ab36cf40ebf23633fa30",
"size": "4600",
"binary... |
"""
Views for managing Neutron Routers.
"""
from django.core.urlresolvers import reverse_lazy
from django.utils.datastructures import SortedDict
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 hor... | {
"content_hash": "28cd584f7e4e9b6879fa384aa2581732",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 79,
"avg_line_length": 38.76521739130435,
"alnum_prop": 0.5975773889636609,
"repo_name": "JioCloud/horizon",
"id": "68977115d00f16bd03727a4c863cd56f7afe9ae0",
"size": "512... |
import sys
import os
import shlex
import sphinx_rtd_theme
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.... | {
"content_hash": "dc1f0822ed70ff391e83e543046e41c5",
"timestamp": "",
"source": "github",
"line_count": 369,
"max_line_length": 80,
"avg_line_length": 31.127371273712736,
"alnum_prop": 0.7032909629113704,
"repo_name": "jrising/computer",
"id": "45d2e02c3cce868f885f6b52de549e327c544b0d",
"size": "11... |
import sys
import logging
import random
from time import sleep
logging.basicConfig(filename='random_delay_middleware.log', level=logging.DEBUG)
logging.debug('Random delay middleware is called')
# set delay to random value less than one second
SLEEP_SECS = random.random()
def main():
data = sys.stdin.readlines... | {
"content_hash": "3ac621c5c5f72669bdc85845e16395ba",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 80,
"avg_line_length": 23.615384615384617,
"alnum_prop": 0.7052117263843648,
"repo_name": "SpectoLabs/hoverfly",
"id": "be14d352cb5bdec3df2d5ed511099268909d71f1",
"size": "... |
from functools import wraps
from flask import abort
from flask.ext.login import current_user
from .models import Permission
def permission_required(permission):
def decorator(f):
@wraps(f)
def decorated_function(*args,**kwargs):
if not current_user.can(permission):
abort(403)
return f(*args,*... | {
"content_hash": "bea28d571e7a33016ea5985fb0da7a1a",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 53,
"avg_line_length": 27,
"alnum_prop": 0.7363834422657952,
"repo_name": "HeathKang/flasky",
"id": "5abb15eefa68c959bb82f9d489896d2a2603a834",
"size": "503",
"binary": f... |
"""HTTP server base class.
Note: the class in this module doesn't implement any HTTP request; see
SimpleHTTPServer for simple implementations of GET, HEAD and POST
(including CGI scripts). It does, however, optionally implement HTTP/1.1
persistent connections, as of version 0.3.
Contents:
- BaseHTTPRequestHandler: ... | {
"content_hash": "777d26e966c8cc5cd6377c67a528f46a",
"timestamp": "",
"source": "github",
"line_count": 614,
"max_line_length": 87,
"avg_line_length": 37.30456026058632,
"alnum_prop": 0.6037982973149967,
"repo_name": "nelmiux/CarnotKE",
"id": "4e7ef9338fe77f110316df75d309a49a73e0985f",
"size": "229... |
from app import globvars
from app.entity.human.behavior.health_behavior import HealthBehavior
from app.entity.human.behavior.simple_behavior import SimpleBehavior
from app.entity.human.behavior.temperature_behavior import TemperatureBehavior
from app.entity.human.human import Human
from app.entity.human.human_body impo... | {
"content_hash": "8308e396d0c004081d34c5ef3ac4ee4d",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 78,
"avg_line_length": 31.666666666666668,
"alnum_prop": 0.6625386996904025,
"repo_name": "Diralf/evolution",
"id": "65b699600ed0e89220e2cd77e04a6d3c9b1190b1",
"size": "161... |
import os
# try/except added for compatibility with python < 3.8
try:
from unittest import mock
from unittest.mock import AsyncMock # pragma: NO COVER
except ImportError: # pragma: NO COVER
import mock
import math
from google.api_core import gapic_v1, grpc_helpers, grpc_helpers_async, path_template
fro... | {
"content_hash": "57848211bcda8ab7795a44f8aac515d3",
"timestamp": "",
"source": "github",
"line_count": 2087,
"max_line_length": 112,
"avg_line_length": 35.69477719214183,
"alnum_prop": 0.6165380226860863,
"repo_name": "googleapis/python-billing",
"id": "830e11c3133d45250f158d5c1f0a8f99e1b56fc5",
"... |
import order
import report_lunch_order
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
| {
"content_hash": "65ff8491fb4a9aa45218312e33de1dc6",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 65,
"avg_line_length": 26.5,
"alnum_prop": 0.8207547169811321,
"repo_name": "ntiufalara/openerp7",
"id": "4a56869bf832a0720c9d85fe000e731c64d35dca",
"size": "1087",
"binar... |
def _jupyter_labextension_paths():
return [{"src": "labextension", "dest": "jupyterlab-plotly"}]
def _jupyter_nbextension_paths():
return [
{
"section": "notebook",
"src": "nbextension",
"dest": "jupyterlab-plotly",
"require": "jupyterlab-plotly/extensio... | {
"content_hash": "996a6c09231d1e1347bf6b92c939415d",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 65,
"avg_line_length": 26.153846153846153,
"alnum_prop": 0.5323529411764706,
"repo_name": "plotly/plotly.py",
"id": "9dbaebe9b17264cd5fa9e3950ccddd2cd8612a4d",
"size": "340... |
import os
import sys
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_settings")
if __name__ == "__main__":
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "d061af367be5db59271aca46b82a63e2",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 64,
"avg_line_length": 27.5,
"alnum_prop": 0.7227272727272728,
"repo_name": "mozilla/mozilla-badges",
"id": "574a065cd5688e3bf25c60a802d9bcb533286daa",
"size": "242",
"bin... |
"""Tests for the Config Entry Flow helper."""
import pytest
from homeassistant import config_entries, data_entry_flow, setup
from homeassistant.config import async_process_ha_core_config
from homeassistant.helpers import config_entry_flow
from tests.async_mock import Mock, patch
from tests.common import (
MockCon... | {
"content_hash": "95c08284941f74d6fe7fa563360630ce",
"timestamp": "",
"source": "github",
"line_count": 317,
"max_line_length": 88,
"avg_line_length": 35.17981072555205,
"alnum_prop": 0.6705523672883787,
"repo_name": "titilambert/home-assistant",
"id": "7893650d420824e6e1f4467cbae52aa1f40cd679",
"s... |
"""
sentry.tasks.store
~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from django.conf import settings
from sentry.tasks.base import instrumented_task
from sentry.utils.safe import... | {
"content_hash": "c8d1c4798fcab2d996735f901b199108",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 95,
"avg_line_length": 27.477272727272727,
"alnum_prop": 0.6443341604631927,
"repo_name": "camilonova/sentry",
"id": "9a09a27ffc3d76a9b924c51159e9c17103f2336e",
"size": "24... |
from __future__ import absolute_import
import os
import itertools
from copy import deepcopy
from mock import Mock, patch
from pickle import loads, dumps
from kombu import Exchange
from celery import shared_task, current_app
from celery import app as _app
from celery import _state
from celery.app import base as _app... | {
"content_hash": "ceea35b058666762d8ccd9eff3aa6fac",
"timestamp": "",
"source": "github",
"line_count": 660,
"max_line_length": 78,
"avg_line_length": 32.49545454545454,
"alnum_prop": 0.5744393155219845,
"repo_name": "sivaprakashniet/push_pull",
"id": "49b9fdd037e7d122735901961f7ca4e6940b1890",
"si... |
"""Support for UK Met Office weather service."""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
ATTR_ATTRIBUTION,
CONF_API_KEY,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_MONITORED_CONDIT... | {
"content_hash": "6c186f11fa6cb936acf2715a751e5af1",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 87,
"avg_line_length": 30.192118226600986,
"alnum_prop": 0.6040137053352912,
"repo_name": "Cinntax/home-assistant",
"id": "3ca55533ce31c5639db17defb8177d6b50c4016f",
"size... |
import sys
sys.path.append("../Sketcher")
from Whiteboard.Canvas import Canvas
import pygame
from Pen import *
from PreProcessing import *
from Analyser import *
from Grammar import *
from Kamaelia.Chassis.Graphline import Graphline
from Kamaelia.Chassis.Pipeline import Pipeline
def StrokeRecogniser():
return G... | {
"content_hash": "8bc677523d818f4b56be37333fc9a45e",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 76,
"avg_line_length": 35.06896551724138,
"alnum_prop": 0.4591937069813176,
"repo_name": "sparkslabs/kamaelia",
"id": "efa8025cf9ac34974f90003c808f4a775d3f0471",
"size": "3... |
"""
Migrate contacts to custom_roles
Create Date: 2017-04-26 22:01:48.029793
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=invalid-name
from ggrc.migrations.utils.migrate_contacts import migrate_contacts
# revision identifiers, used by Alembic.
revision = '1ac5... | {
"content_hash": "da5a2099588296d417052e4e40ac30d1",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 79,
"avg_line_length": 29.771929824561404,
"alnum_prop": 0.6075427224513847,
"repo_name": "AleksNeStu/ggrc-core",
"id": "c01669cfd26777417c207a192cf2d655499be2a3",
"size": ... |
from empymod.scripts import tmtemod, fdesign
__all__ = ['tmtemod', 'fdesign']
| {
"content_hash": "352096c448cbc77604e0b7d89937e501",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 44,
"avg_line_length": 26.333333333333332,
"alnum_prop": 0.6962025316455697,
"repo_name": "prisae/empymod",
"id": "096e5bdf4fa0ab75e36f6176038fc0d907954d80",
"size": "706",
... |
import os
import time
import traceback
import boto.ec2
ec2_instance_types = [
't1.micro',
'm1.small',
'm1.medium',
'm1.large',
'm1.xlarge',
'm3.xlarge',
'm3.2xlarge',
'm2.xlarge',
'm2.2xlarge',
'm2.4xlarge',
'c1.medium',
... | {
"content_hash": "088fa5d1fc804a23e4456b99b678b753",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 114,
"avg_line_length": 31.630252100840337,
"alnum_prop": 0.47901168969181723,
"repo_name": "Scalr/perf-benchmarks",
"id": "c50837cc1a77a0031234719b135642241a15f1dd",
"siz... |
'''
Covenant Add-on
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the... | {
"content_hash": "27578bb4d960d531720d63c1e82728e8",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 193,
"avg_line_length": 39.63414634146341,
"alnum_prop": 0.4916923076923077,
"repo_name": "TheWardoctor/Wardoctors-repo",
"id": "e41b59721059f192d26e678ad6ff072102b69b64",
... |
from tests.providers.google.cloud.utils.gcp_authenticator import GOOGLE_CAMPAIGN_MANAGER_KEY
from tests.providers.google.marketing_platform.operators.test_campaign_manager_system_helper import (
GoogleCampaignManagerTestHelper,
)
from tests.test_utils.gcp_system_helpers import provide_gcp_context, skip_gcp_system
f... | {
"content_hash": "d78238638c15cad302d8c414cfc3f092",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 108,
"avg_line_length": 37.5625,
"alnum_prop": 0.7504159733777038,
"repo_name": "wileeam/airflow",
"id": "adb4817c3cc4bcf3c0d1d2ab743061ccbc179b84",
"size": "1990",
"bina... |
import os
import sys
import string
from optparse import OptionParser
PROG_ROOT = os.path.dirname(os.path.abspath( __file__ ))
from file_system import File, Folder
def main(argv):
parser = OptionParser(usage="usage: %prog [options]", version="%prog 0.1a")
parser.add_option("-... | {
"content_hash": "973b2798bbc3cc43acd31f88fa6b35f0",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 117,
"avg_line_length": 32.651162790697676,
"alnum_prop": 0.5662393162393162,
"repo_name": "lakshmivyas/conche",
"id": "122e34bd71ce40c7e4e12f50bd32594024bc5088",
"size": "... |
"""URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
"""
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from fastsitemaps import views as sitemap_views... | {
"content_hash": "cf71d5f776482d2b94c45ccc17448130",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 88,
"avg_line_length": 31.93975903614458,
"alnum_prop": 0.6427763108261033,
"repo_name": "arxiv-vanity/arxiv-vanity",
"id": "b3ad77cbe2aab36332e85650f8a68612120ffa17",
"siz... |
from thrift.Thrift import *
from ttypes import *
EDAM_NOTE_SOURCE_WEB_CLIP = "web.clip"
EDAM_NOTE_SOURCE_MAIL_CLIP = "mail.clip"
EDAM_NOTE_SOURCE_MAIL_SMTP_GATEWAY = "mail.smtp"
| {
"content_hash": "c70b511cb33f45237912515c2474e4d5",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 48,
"avg_line_length": 20.22222222222222,
"alnum_prop": 0.7307692307692307,
"repo_name": "vinodc/evernote",
"id": "55727a22299885edc5620a9a031148414ca85062",
"size": "282",
... |
"""
Unit Tests for `pdb_selelem`.
"""
import os
import sys
import unittest
from config import data_dir
from utils import OutputCapture
class TestTool(unittest.TestCase):
"""
Generic class for testing tools.
"""
def setUp(self):
# Dynamically import the module
name = 'pdbtools.pdb_se... | {
"content_hash": "d46120cf2d112c93734d70d60a362586",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 82,
"avg_line_length": 28,
"alnum_prop": 0.5639478764478765,
"repo_name": "haddocking/pdb-tools",
"id": "8923bdd2105358f7e0c8c69a6e7d9a269f589400",
"size": "4777",
"bina... |
import rumps
window = rumps.Window('Nothing...', 'ALERTZ')
window.title = 'WINDOWS jk'
window.message = 'Something.'
window.default_text = 'eh'
response = window.run()
print (response)
window.add_buttons('One', 'Two', 'Three')
print (window.run())
| {
"content_hash": "36b50c0c6121d34beb3ef17d3c293f7a",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 45,
"avg_line_length": 19.384615384615383,
"alnum_prop": 0.6865079365079365,
"repo_name": "jaredks/rumps",
"id": "1eb0b0cf59b7f98ce38d6b9baae8fffd64c1174b",
"size": "252",
... |
from colorsys import hsv_to_rgb
from muntjac.addon.colorpicker.color import Color
from muntjac.ui.custom_component import CustomComponent
from muntjac.ui.vertical_layout import VerticalLayout
from muntjac.ui.select import Select
from muntjac.data.property import IValueChangeListener
from muntjac.addon.colorpicker.c... | {
"content_hash": "4ce13a65186610741c51354a757688ac",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 79,
"avg_line_length": 29.07537688442211,
"alnum_prop": 0.5629104735568614,
"repo_name": "rwl/muntjac",
"id": "27cc6564a561e0a114fb4ddb0c9d4a34be51294a",
"size": "5829",
... |
from flask import send_from_directory, render_template, request
import logging
import os
from project.application import create_app
from project.bl import init_resource_registry
init_resource_registry()
app = create_app()
@app.route('/media/<path:path>')
def get_file(path):
return send_from_directory(app.config[... | {
"content_hash": "8876a9353f8eb5a9dcd0d59c5ef125f7",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 73,
"avg_line_length": 32.13953488372093,
"alnum_prop": 0.7011577424023154,
"repo_name": "uaprom-summer-2015/Meowth",
"id": "f6a0bb17455d4d4383b4ab3a1b2c73237aacc4bb",
"siz... |
import io
import json
import os
import urllib.request as url_lib
import zipfile
from packaging.version import parse as version_parser
EXTENSION_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DEBUGGER_DEST = os.path.join(EXTENSION_ROOT, "pythonFiles", "lib", "python")
DEBUGGER_PACKAGE = "debugpy"
D... | {
"content_hash": "ffb544df54c88b15ec58c42ac576b365",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 115,
"avg_line_length": 31.904761904761905,
"alnum_prop": 0.645273631840796,
"repo_name": "DonJayamanne/pythonVSCode",
"id": "593580d6a211a317a8f672c7c2c1b8a7d0108788",
"si... |
import Queue
import threading
import time
import json
import commands
import sys, os
sys.path.insert(1, os.path.join(sys.path[0], '..'))
from nbNet.nbNet import *
ff_conf = []
num = 0
def cmdRunner(input):
return str(num += 1)
class execThread(threading.Thread):
def __init__(self, host, port):
th... | {
"content_hash": "67a15880d6a6127cea10a5f5d1456216",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 55,
"avg_line_length": 19.78787878787879,
"alnum_prop": 0.6079632465543645,
"repo_name": "selboo/simpleMon",
"id": "a0c42ea4c5ed29ff0b38fdfc81604d3076ce9a92",
"size": "671"... |
import os
import re
import six
import jsonschema
from st2common import log as logging
from st2common.constants.meta import ALLOWED_EXTS
from st2common.bootstrap.base import ResourceRegistrar
from st2common.persistence.action import Action
from st2common.models.api.action import ActionAPI
from st2common.models.system.... | {
"content_hash": "945ffa1e9cf45028b58cc93ad6108da3",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 97,
"avg_line_length": 36.20855614973262,
"alnum_prop": 0.5950376606114312,
"repo_name": "emedvedev/st2",
"id": "3ea2cc9ca702d8a1a2aa61ebdc0e39bb1f08e3d6",
"size": "7551",... |
"""Identity v3 Domain action implementations"""
import six
import sys
from keystoneauth1 import exceptions as ks_exc
from eclcli.common import command
from eclcli.common import utils
from eclcli.i18n import _ # noqa
class CreateDomain(command.ShowOne):
"""Create new domain"""
def get_parser(self, prog_na... | {
"content_hash": "ecffc75ad0b6abe785e1da6cfb1943a3",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 74,
"avg_line_length": 30.245714285714286,
"alnum_prop": 0.5446816550160589,
"repo_name": "nttcom/eclcli",
"id": "a6976a7467889c1d59a64c5f621f6dae0463d15a",
"size": "5906"... |
import vim
import re
from glob import glob
from os import walk
from os.path import join, getmtime, isfile, isdir, exists
from subprocess import Popen, PIPE
from vim_pad.utils import get_save_dir
from vim_pad.pad import PadInfo
from vim_pad.timestamps import natural_timestamp
# globals (caches) {{{1
cached_data = []
ca... | {
"content_hash": "8aa53e34c81b2d39cb20c8e0e5baafd7",
"timestamp": "",
"source": "github",
"line_count": 338,
"max_line_length": 135,
"avg_line_length": 40.31065088757396,
"alnum_prop": 0.5546422018348623,
"repo_name": "vim-scripts/vim-pad",
"id": "ca92abf5b2145ff8df2f09f958ba5684d06f320a",
"size": ... |
"""Contains the sound config player class"""
from collections import namedtuple
from copy import deepcopy
from typing import Dict, List
from mpfmc.core.mc_config_player import McConfigPlayer
SoundBlock = namedtuple("SoundBlock", ["priority", "context"])
class McSoundPlayer(McConfigPlayer):
"""Base class for the ... | {
"content_hash": "f9f658c37aae2249f71315313db90d8f",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 112,
"avg_line_length": 36.051587301587304,
"alnum_prop": 0.5608145294441387,
"repo_name": "missionpinball/mpf-mc",
"id": "26685d96db6ae3123a380871934a6978eddd0572",
"size... |
import kivy
kivy.require('1.7.0')
from kivy.core.window import Window
from kivy.app import App
import codecs
from kivy.uix.floatlayout import FloatLayout
from kivy.factory import Factory
from kivy.uix.scrollview import ScrollView
from kivy.uix.label import Label
from kivy.properties import ObjectProperty, StringProper... | {
"content_hash": "58b2480b08c3f81953dee70b675b25fe",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 95,
"avg_line_length": 27.97752808988764,
"alnum_prop": 0.6730923694779116,
"repo_name": "guihknx/pyHGEditor",
"id": "6513cbadd78c771d65613e8cf534ce0cdf75a3ec",
"size": "25... |
import shortuuid
import six
import sys
from django.db.models import CharField
class ShortUUIDField(CharField):
"""
A field which stores a Short UUID value in base57 format. This may also have
the Boolean attribute 'auto' which will set the value on initial save to a
new UUID value (calculated using sh... | {
"content_hash": "bfa52fad4ea3954ad38ce88268f062c3",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 119,
"avg_line_length": 37.041666666666664,
"alnum_prop": 0.6456692913385826,
"repo_name": "nebstrebor/django-shortuuidfield",
"id": "c10c7df2d1299eade1875a982a771ba75a359d77... |
from zerver.lib.test_classes import WebhookTestCase
from zerver.webhooks.gosquared.view import CHAT_MESSAGE_TEMPLATE
class GoSquaredHookTests(WebhookTestCase):
STREAM_NAME = "gosquared"
URL_TEMPLATE = "/api/v1/external/gosquared?stream={stream}&api_key={api_key}"
WEBHOOK_DIR_NAME = "gosquared"
# Note... | {
"content_hash": "06e123284beebf8dd82cb3658a459565",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 97,
"avg_line_length": 34.648648648648646,
"alnum_prop": 0.6201248049921997,
"repo_name": "hackerkid/zulip",
"id": "8a8bb851fa46c62a1b4d4ba0bf377dcf367e4ae4",
"size": "1282... |
import json
import posixpath
import string
import uuid
from copy import copy
from datetime import datetime
from django.apps import apps
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
import commonware.log
import jinja2
from tower import ugettext as _
import... | {
"content_hash": "d69800d0295cf0254b2154139cd70a82",
"timestamp": "",
"source": "github",
"line_count": 517,
"max_line_length": 79,
"avg_line_length": 34.8936170212766,
"alnum_prop": 0.6005543237250555,
"repo_name": "tsl143/zamboni",
"id": "94623ab0bdaf38dd9c2d65d0e436426e45756a78",
"size": "18040"... |
__author__ = 'gca'
import os
import DNSaaSClient
class ImsDnsClient():
def __init__(self):
self.dns_api_ip = os.environ['DNSAAS_IP']
self.dns_ip = os.environ['DNS_IP']
DNSaaSClient.DNSaaSClientCore.apiurlDNSaaS='http://%s:8080' %self.dns_api_ip
self.tokenID = os.environ['OS_AUTH_... | {
"content_hash": "43fcf3b70d665a3ce30515e52f4d51c9",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 183,
"avg_line_length": 81.94805194805195,
"alnum_prop": 0.706973058637084,
"repo_name": "MobileCloudNetworking/maas",
"id": "10905104f708f23349d254756c593e62a13315d2",
"si... |
import tensorflow as tf
hello = tf.constant('Hello, World!')
# Start tensorflow session
with tf.Session() as sess:
# Run the operation
print(sess.run(hello))
| {
"content_hash": "8385b43382b556ebb8eb292b5df4af52",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 36,
"avg_line_length": 23.857142857142858,
"alnum_prop": 0.7065868263473054,
"repo_name": "Wonjuseo/Project101",
"id": "a576ca642a0750a1c2bd59d741f6d50b51d0c10e",
"size": "1... |
from django import forms
from django.contrib.auth.models import User
from django.core.validators import RegexValidator
from reddit.models import Submission
from users.models import RedditUser
class UserForm(forms.ModelForm):
alphanumeric = RegexValidator(r'^[0-9a-zA-Z_]*$',
'Thi... | {
"content_hash": "b22d3c653b99aa2f129eabfc7dcb7ad3",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 73,
"avg_line_length": 28.5609756097561,
"alnum_prop": 0.5351551380586393,
"repo_name": "Nikola-K/django_reddit",
"id": "94901f56031d4ee9b6566bd7af60f55ec8b0131f",
"size":... |
from os import path
from time import time
import subprocess
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from create import Create, FULL_MODE
base_path="/home/root/go/web_control/http/"
ip_address="192.168.0.109"
jquery='https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js' #'jquery.js' # ... | {
"content_hash": "3561dd65336f53f7c19a25c384f17ab2",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 260,
"avg_line_length": 32.827586206896555,
"alnum_prop": 0.6519607843137255,
"repo_name": "squirly/turtlecore-web-controller",
"id": "4f5d2e023ebb9662b7a95628ef4a00c6ce96a89... |
__author__ = 'danny'
import csv
import logging
import tablib
from datetime import datetime
from django.db.models import Model
from django.db.models.fields.files import FieldFile
from unicodedata import normalize
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse
from django.templat... | {
"content_hash": "00eec184c14678aa1528cf42fb3aa3ca",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 97,
"avg_line_length": 32.21666666666667,
"alnum_prop": 0.6125193998965339,
"repo_name": "daatrujillopu/Sfotipy",
"id": "b5d647482d6ab236d5edac0e18eb18c9551d366b",
"size": ... |
"""
This module implements multioutput regression and classification.
The estimators provided in this module are meta-estimators: they require
a base estimator to be provided in their constructor. The meta-estimator
extends single output estimators to multioutput estimators.
"""
# Author: Tim Head <betatim@gmail.com>... | {
"content_hash": "2b969ba8741c2786346e625c7cd6cb6a",
"timestamp": "",
"source": "github",
"line_count": 367,
"max_line_length": 84,
"avg_line_length": 35.82016348773842,
"alnum_prop": 0.5969876768598813,
"repo_name": "Vimos/scikit-learn",
"id": "bdb85ad890a97358db79d0a9eebf964afbc92e81",
"size": "1... |
"""All methods needed to bootstrap a Home Assistant instance."""
from __future__ import annotations
import asyncio
from collections.abc import Awaitable, Generator, Iterable
import contextlib
import logging.handlers
from timeit import default_timer as timer
from types import ModuleType
from typing import Callable
fro... | {
"content_hash": "e3f0c68c6a9a5bfbaea23af0a79d718e",
"timestamp": "",
"source": "github",
"line_count": 488,
"max_line_length": 88,
"avg_line_length": 32.31967213114754,
"alnum_prop": 0.6354298757291402,
"repo_name": "sander76/home-assistant",
"id": "95bb29c4b9d5e2f819cfe87909dc37e798cbc87c",
"size... |
from django.test import TestCase
from restclients.mock_http import MockHTTP
from myuw.util.cache_implementation import MyUWCache
from restclients.models import CacheEntryTimed
from datetime import timedelta
CACHE = 'myuw.util.cache_implementation.MyUWCache'
class TestCustomCachePolicy(TestCase):
def test_sws_de... | {
"content_hash": "771cc1e16b0bc81c9d78b81699f9fabe",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 79,
"avg_line_length": 42.65873015873016,
"alnum_prop": 0.5696744186046512,
"repo_name": "fanglinfang/myuw",
"id": "cb429ddf6cee6e783b8052274e648301a4c166d9",
"size": "537... |
from django import template
from django.contrib.staticfiles.templatetags import staticfiles
register = staticfiles.register
| {
"content_hash": "209cedd76f4da13b5f62cc27a26a3ed7",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 63,
"avg_line_length": 31.25,
"alnum_prop": 0.864,
"repo_name": "localmed/django-assetfiles",
"id": "ed1111846604ed126c9d4c0bd72fba3fc47324d5",
"size": "125",
"binary": fa... |
import pygtk
pygtk.require('2.0')
import gtk
import gobject
import pango
import pangocairo
from gettext import gettext as _
try:
import gst
_GST_AVAILABLE = True
except ImportError:
# Turtle Art should not fail if gst is not available
_GST_AVAILABLE = False
import os
import subprocess
import errno
f... | {
"content_hash": "8443d86ce88a4cfb504e516314313382",
"timestamp": "",
"source": "github",
"line_count": 4596,
"max_line_length": 79,
"avg_line_length": 42.29852045256745,
"alnum_prop": 0.494495998024732,
"repo_name": "walterbender/turtleartmini",
"id": "5b0c3e076d1a8f66d2c9ea2e8bf6ef65ba102828",
"s... |
"""Config flow for NEW_NAME integration."""
from __future__ import annotations
import logging
from typing import Any
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from .const import DOMAIN
_LOGG... | {
"content_hash": "1e4647d6a1a12e35e0a3753d20cc70e3",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 90,
"avg_line_length": 30.49514563106796,
"alnum_prop": 0.6545686087233366,
"repo_name": "adrienbrault/home-assistant",
"id": "eea7d73b54c1752541cbeef294517ce3ad24fb88",
"... |
import os
import ssl
import time
import datetime
import ipaddress
import sys
from pyasn1.type import univ, constraint, char, namedtype, tag
from pyasn1.codec.der.decoder import decode
from pyasn1.error import PyAsn1Error
import OpenSSL
from mitmproxy.types import serializable
# Default expiry must not be too long: h... | {
"content_hash": "6e55c01862ff3808598e5adec340ce34",
"timestamp": "",
"source": "github",
"line_count": 481,
"max_line_length": 119,
"avg_line_length": 30.83783783783784,
"alnum_prop": 0.5714959886739028,
"repo_name": "dwfreed/mitmproxy",
"id": "4b939c80593c4adce0b45a487760e6dc5edbea6e",
"size": "1... |
import socket
import sys
__all__ = ['Nest']
class Nest(object):
def __init__(self, **settings):
self._clients = {}
# Bind settings
host = settings.get('host', '0.0.0.0')
port = settings.get('port', 8000)
self.addr = (host, port)
self.sock = socket.socket()
... | {
"content_hash": "516f1eecbe8bba0912c4c849d80740ef",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 76,
"avg_line_length": 27.28301886792453,
"alnum_prop": 0.5643153526970954,
"repo_name": "drongo-framework/drongo-nest",
"id": "139e8774bfeb05e837ef4f8e1198540cfb07b3ac",
"... |
from os import walk, utime, makedirs
from os.path import (
getmtime, getctime, expanduser, join, abspath, splitext, isdir, exists
)
from re import compile as re_compile
from shutil import copyfile
DEFAULT_IPATH = '.' #: default input directory path.
DEFAULT_OPATH = 'organized' #: default output directory path.... | {
"content_hash": "65185cbb0e577e0cbbce7a7e65e0cccb",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 79,
"avg_line_length": 34.51162790697674,
"alnum_prop": 0.6027628032345014,
"repo_name": "b3j0f/stap",
"id": "a217ee10ef880b841e3911b49a5f710fda7fc225",
"size": "4288",
"... |
from __future__ import print_function
import os
import sys
import time
import boto
from boto.s3.key import Key
from pymongo import MongoClient
from pymongo.cursor import Cursor
from pymongo.errors import AutoReconnect
# Monkey-patch PyMongo to avoid throwing AutoReconnect
# errors. We try to reconnect a couple times... | {
"content_hash": "463f7bc0d307f4c0f7182c01a9731f15",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 92,
"avg_line_length": 36.20338983050848,
"alnum_prop": 0.6165730337078652,
"repo_name": "rmcgibbo/mongo-task",
"id": "dbe7499d25e5826f2387d8fe33e3fb89d0fca6f6",
"size": "2... |
import codecs
import os
from setuptools import setup
grlc_base = 'src'
grlc_base_dir = os.path.join(grlc_base, '')
grlc_data = []
for root,dirs,files in os.walk(grlc_base):
if root != grlc_base:
root_dir = root.replace(grlc_base_dir, '')
data_files = os.path.join(root_dir, '*')
grlc_data.ap... | {
"content_hash": "01f5651bcbd821b9b19e8fee4a60e990",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 71,
"avg_line_length": 31.678571428571427,
"alnum_prop": 0.636978579481398,
"repo_name": "c-martinez/grlc",
"id": "21f524a2bd94172efcfe94c5c7a32b07124e7ff5",
"size": "1829"... |
"""Demo for hosting a Concurrence application within a Syncless process."""
__author__ = 'pts@fazekas.hu (Peter Szabo)'
# It would work even with and without these imports, regardless of the import
# order.
#from syncless.best_stackless import stackless
#from syncless import coio
import sys
import socket
from concu... | {
"content_hash": "3d30d741ffde2e8010518080aa73fbfe",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 77,
"avg_line_length": 30.75,
"alnum_prop": 0.6660162601626016,
"repo_name": "tectronics/syncless",
"id": "8bc609dd32299ca894cbb0f926162d883867876f",
"size": "3160",
"bi... |
import pytest
from datetime import time, timedelta
import numpy as np
import pandas as pd
import pandas.util.testing as tm
from pandas.util.testing import assert_series_equal
from pandas import (Series, Timedelta, to_timedelta, isnull,
TimedeltaIndex)
from pandas._libs.tslib import iNaT
class Te... | {
"content_hash": "276e0cd738572325d932ad7bcab801ca",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 79,
"avg_line_length": 37.67164179104478,
"alnum_prop": 0.590729001584786,
"repo_name": "mbayon/TFG-MachineLearning",
"id": "a991b7bbe140a72ad9dd6f550a848c000511fb5d",
"si... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.