text stringlengths 4 1.02M | meta dict |
|---|---|
import codecs
import functools
import os
import threading
import types
import typing
from importlib.abc import InspectLoader
from cauldron import environ
from cauldron import templating
from cauldron.cli import threads
from cauldron.render import stack as render_stack
from cauldron.session import projects
class User... | {
"content_hash": "b28f4013c14beb7a3cdcc6508fa6709b",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 79,
"avg_line_length": 30.603846153846153,
"alnum_prop": 0.6444639939675757,
"repo_name": "sernst/cauldron",
"id": "6736f973ea50d6f0f94ab37f4af22e18415b0900",
"size": "795... |
import datetime as dt
import re
from flask import flash
from flask_wtf import Form
from wtforms import TextField
from wtforms.fields import(
SelectMultipleField,
SelectField,
IntegerField,
DateField,
TextAreaField,
)
from wtforms.validators import InputRequired, Length, Optional, ValidationErro... | {
"content_hash": "791d25319091a7a0d94e59964016fa40",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 79,
"avg_line_length": 40.6651376146789,
"alnum_prop": 0.5607445008460237,
"repo_name": "brotherjack/Rood-Kamer",
"id": "187f77392bd776a1b8751ef24cc36da4eef3ab11",
"size":... |
import unittest
from tests.server import TestServer
from vscphelper.vscplib import vscp, vscpEvent
from vscphelper.exception import *
from vscphelper import VSCPConstant as constant
from time import sleep
class vscplibMalfunctionTests(unittest.TestCase):
def test_seedNotSent(self):
a = TestServer(port=808... | {
"content_hash": "f21419ab04957d9f90647679a46ed85a",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 101,
"avg_line_length": 40.28346456692913,
"alnum_prop": 0.6182564503518374,
"repo_name": "nos86/VSCP-Helper-for-Python",
"id": "774a16e3bd8ae305232c7754e0fac8aa59bd326f",
... |
import wgAPI
import telebot
import config
from loggerFunc import log
def polling():
bot = telebot.TeleBot(config.telegramToken)
@bot.message_handler(commands=['start', 'help'])
def send_welcome(message):
bot.send_message(message.chat.id, "Здарова, танкист! Давай, пиши ник своего товарища...")
... | {
"content_hash": "2413b5ec86d6bc331d34eaed2bee68b5",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 97,
"avg_line_length": 33.15625,
"alnum_prop": 0.6173421300659755,
"repo_name": "rvgorlov/WotStatomerTelegramBot",
"id": "b8740020abb19bd0ffd5a75ff5ff9ab91c604ca4",
"size":... |
from .client import RegionNotificationEndpointsClient
__all__ = ("RegionNotificationEndpointsClient",)
| {
"content_hash": "41b8a17f5049463cb14ed6d775053d4f",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 53,
"avg_line_length": 34.666666666666664,
"alnum_prop": 0.8173076923076923,
"repo_name": "googleapis/python-compute",
"id": "749cc698c25fb94c0c39e220432ca89003ed45de",
"siz... |
import datetime
import hashlib
from cli_tools.flakiness_cli import api
from cli_tools.flakiness_cli import frames
def GetBuilders():
"""Get the builders data frame and keep a cached copy."""
def make_frame():
data = api.GetBuilders()
return frames.BuildersDataFrame(data)
return frames.GetWithCache(
... | {
"content_hash": "3c9f69d516ec80adcc81e241fd6b87f2",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 79,
"avg_line_length": 31.5,
"alnum_prop": 0.7264957264957265,
"repo_name": "chromium/chromium",
"id": "2d4d48a8534b03dd7656f2a8644c9ffce1d56832",
"size": "960",
"binary"... |
"""
HypermediaRequest is the base class for the Common CRUD CCML client, a dictionary driven interface
to http and CoAP requesters and response handlers to be used by clients and server request processors
Requests and their associated responses are exposed in a dictionary interface for processing by proxies and resour... | {
"content_hash": "ac302e32bd9d708de54e07e896c44223",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 122,
"avg_line_length": 34.84615384615385,
"alnum_prop": 0.6549668874172185,
"repo_name": "connectIOT/MachineHypermediaToolkit",
"id": "31a920cc3bc47e94506430b5953277ddba2a7... |
import numpy as np
import argparse
import time
import cv2
import os
# construct the argument parser and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--image", required=True, help="path to input image")
ap.add_argument("-o", "--output",help="path to output image")
ap.add_argument("-y", "--y... | {
"content_hash": "28849e23910bdebe87d7ff1bfb0ca11e",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 116,
"avg_line_length": 38.15714285714286,
"alnum_prop": 0.7077873455634593,
"repo_name": "grycap/scar",
"id": "6867c84896ab362bbdd1e2f2ef6ea1a16157b9b2",
"size": "5370",
... |
"""Stores various configuration options and constants for Oppia."""
import copy
import os
# Whether to unconditionally log info messages.
DEBUG = False
# The platform for the storage backend. This is used in the model-switching
# code in core/platform.
PLATFORM = 'gae'
# Whether we should serve the development or p... | {
"content_hash": "a85b8cc61ac362c4ceb0de1e49e89fc7",
"timestamp": "",
"source": "github",
"line_count": 438,
"max_line_length": 79,
"avg_line_length": 34.52739726027397,
"alnum_prop": 0.6764530847054155,
"repo_name": "directorlive/oppia",
"id": "5a8b8e561f284619a6306abc6bd5c4d68d4fd6b7",
"size": "1... |
from src.circular.utils.events import EventMixin
from src.circular.template.context import Context
class MockAttr:
def __init__(self, name, val=None):
self.name = name
self.value = val
def clone(self):
return MockAttr(self.name, self.value)
def __repr__(self):
return "<Mo... | {
"content_hash": "77544723ec785dd44b31c6e3ef754c50",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 127,
"avg_line_length": 28.3,
"alnum_prop": 0.5342419653373717,
"repo_name": "jonathanverner/circular",
"id": "fa34c9e119db2f68600b84dd869e2ad69283d2c6",
"size": "5943",
... |
"""Fichier chargé de lancer les tests unitaires.
Ne pas utiliser 'python -m unittest' mais exécutez ce script. La
raison est simple : ce script est un script de boostrap. Il charge
l'importeur et les modules. La sauvegarde des enregistrements
n'est cependant ni chargée, ni écrasée.
"""
import os
import sys
import un... | {
"content_hash": "dfaccd1b35308929b1b9736d18fc2179",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 78,
"avg_line_length": 31.041095890410958,
"alnum_prop": 0.7118270079435128,
"repo_name": "stormi/tsunami",
"id": "7788fdeccc8e8ac7599572c65f6bfc57af0e0986",
"size": "3836"... |
from .constants import CONSTANTS
from .game import PTI__game
from .thing import PTI__Thing
from .world import PTI__World
from .events import PTI_decorator__event
from .collisions import PTI_decorator__collision
from .color import PTI__Color
from .picture import PTI__Picture, PTI__open_picture, PTI__text_to_picture
f... | {
"content_hash": "0c88911677c1722045faaede63fbc09e",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 74,
"avg_line_length": 25.178571428571427,
"alnum_prop": 0.7333333333333333,
"repo_name": "syslo/gaminator",
"id": "c1bcdb6ad7278c1e635420f26e2ded0f6dc483ad",
"size": "730"... |
from typing import Tuple
from sklearn.model_selection import train_test_split
import scipy.io
import scipy.stats
import scipy.fftpack
import numpy as np
from decision_trees.datasets.dataset_base import DatasetBase
from decision_trees.gridsearch import perform_gridsearch
from decision_trees.utils.constants import Class... | {
"content_hash": "2deb0d4982c442dd5978e7a961c865ff",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 111,
"avg_line_length": 36.05263157894737,
"alnum_prop": 0.5474452554744526,
"repo_name": "PUTvision/decision_tree",
"id": "2474dd05427acca3f8f5d52797d5c3d44093e3f5",
"siz... |
"""
WSGI config for tutorial project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION``... | {
"content_hash": "6c2ffedc8237d27e1ff0eb8d5b4234c4",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 79,
"avg_line_length": 44.6875,
"alnum_prop": 0.7944055944055944,
"repo_name": "mburst/gevent-socketio-starterkit",
"id": "8632088c8b792c85f70a0fc7f348957688b1af18",
"size"... |
from operator import itemgetter, attrgetter
from wand.image import Image
from config import DEVELOP_MODE
from datetime import datetime, timedelta
from libs import doubandb, doubanfs, Employee, doubanmc, store, User
from webapp.models.consts import *
from webapp.models.notify import Notify
from webapp.models.profile imp... | {
"content_hash": "8107b584fe9c8a575cbe45cb70aa15b8",
"timestamp": "",
"source": "github",
"line_count": 760,
"max_line_length": 217,
"avg_line_length": 36.64078947368421,
"alnum_prop": 0.5338456566236938,
"repo_name": "leonsim/me",
"id": "8cb6550c7d2d132a252b24efd1aadd6b3f1cb0cf",
"size": "28108",
... |
import simplegui
# Import module, which contains functions that involve
# randomness.
import random
# Import module that contains additional mathematical
# operations.
import math
#---------------------------------------------------------
# Define and initialize global constants.
# Initialize global constants that wi... | {
"content_hash": "16e9270ce45713eb28ac9d4c12ca5a4e",
"timestamp": "",
"source": "github",
"line_count": 379,
"max_line_length": 116,
"avg_line_length": 41.34564643799472,
"alnum_prop": 0.5960433950223357,
"repo_name": "aristotelis-metsinis/ArcadeGames",
"id": "f5e12e644fda9ba3afe7eb296b178dcfa3bc13a4... |
import os.path
import posixpath
import re
import urllib
from docutils import nodes
from sphinx import addnodes, util
from sphinx.locale import admonitionlabels
def _parents(node):
while node.parent:
node = node.parent
yield node
class BootstrapTranslator(nodes.NodeVisitor, object):
head_pref... | {
"content_hash": "30c8cca15007e56f9d1cd5af06c28f66",
"timestamp": "",
"source": "github",
"line_count": 690,
"max_line_length": 127,
"avg_line_length": 39.392753623188405,
"alnum_prop": 0.5776829402891726,
"repo_name": "vileopratama/vitech",
"id": "48c5e901f28195fc1f3d238135f9ed0bd2516abc",
"size":... |
from setuptools import setup, find_packages
setup(
name='django-rosetta',
version="0.4.7",
description='A Django application that eases the translation of Django projects',
author='Marco Bonetti',
author_email='mbonetti@gmail.com',
url='https://github.com/mbi/django-rosetta',
license='MIT',
... | {
"content_hash": "f1142f89e9abf86bc36f6bc200f507c6",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 85,
"avg_line_length": 35.208333333333336,
"alnum_prop": 0.6378698224852071,
"repo_name": "grangier/django-rosetta",
"id": "4e0c22d7582c93ff1610fb1f339c0ebd890a1b9e",
"size... |
"""The tests for the logbook component."""
# pylint: disable=protected-access
from datetime import timedelta
import unittest
from unittest.mock import patch
from homeassistant.components import sun
import homeassistant.core as ha
from homeassistant.const import (
EVENT_STATE_CHANGED, EVENT_HOMEASSISTANT_START, EVE... | {
"content_hash": "8e7a687324bc417a5b37a87a5d380b4e",
"timestamp": "",
"source": "github",
"line_count": 546,
"max_line_length": 79,
"avg_line_length": 42.108058608058606,
"alnum_prop": 0.591013874994563,
"repo_name": "keerts/home-assistant",
"id": "b6583ba35364cfb99650bb28cdf265d6edabd104",
"size":... |
from ceph_deploy.exc import ExecutableNotFound
from ceph_deploy.util import system, versions
from ceph_deploy.lib import remoto
class Ceph(object):
"""
Determine different aspects of the Ceph package, like ``version`` and path
``executable``. Although mostly provide a version object that helps for
par... | {
"content_hash": "882bb7d336f8aec69a210c82253abe19",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 78,
"avg_line_length": 28.824324324324323,
"alnum_prop": 0.6085325832161275,
"repo_name": "osynge/ceph-deploy",
"id": "4c638040ad828ac6e419e12f68fe67cd75c8e22b",
"size": "2... |
import os
import sys
import subprocess
from zoo.util.utils import get_node_ip
# Assumption:
# 1. All hosts has oneCCL installed
# 2. The driver can ssh all hosts without password
# 3. All hosts have the same working directory.
# 4. All hosts have the same Python environment in the same location.
class MPIRunner:
... | {
"content_hash": "cb796f4a2f58053b30a23bd5d1738946",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 91,
"avg_line_length": 40.81578947368421,
"alnum_prop": 0.5559853857726198,
"repo_name": "intel-analytics/analytics-zoo",
"id": "da9f565af0de244151c6fb1b40c55dc464220856",
... |
from django.conf import settings
class ChoiceSetMeta(type):
"""
Metaclass for ChoiceSet
"""
def __new__(mcs, name, bases, attrs):
# Extend static choices with any configured choices
if key := attrs.get('key'):
assert type(attrs['CHOICES']) is list, f"{name} has a key defin... | {
"content_hash": "0f667850073c3a7ccc61659f66bfbe83",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 115,
"avg_line_length": 28.77386934673367,
"alnum_prop": 0.5316101990918617,
"repo_name": "digitalocean/netbox",
"id": "c5b5bafb9e5d76cffda1186bd090b3160e702814",
"size": ... |
"""
Locking functionality when launching things from the command line.
Uses a pidfile.
This prevents multiple identical workflows to be launched simultaneously.
"""
from __future__ import print_function
import errno
import hashlib
import os
import sys
from subprocess import Popen, PIPE
from luigi import six
def get... | {
"content_hash": "9c0d081b912c83b88516b7aa16177df5",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 99,
"avg_line_length": 33.053333333333335,
"alnum_prop": 0.5865268253327954,
"repo_name": "foursquare/luigi",
"id": "e1a604f540a2561d8720de341efe49b0ff137361",
"size": "55... |
"""
hyper
~~~~~~
A module for providing an abstraction layer over the differences between
HTTP/1.1 and HTTP/2.
"""
__version__ = '0.4.0'
from .common.connection import HTTPConnection
from .http20.connection import HTTP20Connection
from .http20.response import HTTP20Response, HTTP20Push
from .http11.connection import ... | {
"content_hash": "ae64f8ebc0b30da9290b281128693bf5",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 81,
"avg_line_length": 26.40625,
"alnum_prop": 0.7325443786982249,
"repo_name": "masaori335/hyper",
"id": "379843f87ee1fc378ce9513525afb80a731deea9",
"size": "869",
"bina... |
import mraa
import time
from rgb import rgb
# This just wraps the rgb class for a simple demo
class tadpole(rgb):
def __init__(self):
rgb.__init__(self, 82, 83, 84, True, True, True)
| {
"content_hash": "6ebc7f2fb742febfadc9519619e2e609",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 56,
"avg_line_length": 24.5,
"alnum_prop": 0.6581632653061225,
"repo_name": "steelee/minnow_max_maker",
"id": "6e3052b888b389463fb9e5272d995f88b4052bb7",
"size": "196",
"b... |
"""
Frequency counting with Tektronix RSA3408A Spectrum Analyzer
"""
##### Imports
import sys
import time
try:
import configparser as ConfigParser
except ImportError:
import ConfigParser
# Own modules
sys.path.append("../../")
sys.path.append("../../drivers/")
import rsa3408a
import lablib.logfi... | {
"content_hash": "2cd54914ea11c98588aad358db447698",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 81,
"avg_line_length": 23.639344262295083,
"alnum_prop": 0.6255201109570042,
"repo_name": "imrehg/labhardware",
"id": "82d49ad592bfa137302cef9215c6314657baf1a1",
"size": "1... |
import ctypes
import os
import time
import argparse
import subprocess
import scipy.sparse as sp
import mxnet as mx
import numpy as np
import numpy.random as rnd
from mxnet.test_utils import rand_ndarray, set_default_device, assert_almost_equal, get_bz2_data
from mxnet.base import check_call, _LIB
from util import est... | {
"content_hash": "ffeea5d64a75fab5ce8cc6a4d074d9c1",
"timestamp": "",
"source": "github",
"line_count": 449,
"max_line_length": 123,
"avg_line_length": 44.766146993318486,
"alnum_prop": 0.5244278606965174,
"repo_name": "DickJC123/mxnet",
"id": "a2dfd03a6bd343a1ce5c38b97795235bd6ce70ac",
"size": "20... |
from couchdbkit import ResourceNotFound
from django.conf import settings
from corehq.util.quickcache import quickcache
from dimagi.utils.couch.database import get_db
@quickcache([], timeout=60)
def get_indicator_config():
try:
doc = get_db().open_doc('INDICATOR_CONFIGURATION')
except ResourceNotFound:... | {
"content_hash": "d8c533c4049a532c2ee09dc8f7950a91",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 67,
"avg_line_length": 26.794871794871796,
"alnum_prop": 0.6995215311004784,
"repo_name": "puttarajubr/commcare-hq",
"id": "6ea001c57566f73d1c5a026e56e656fb4bf0312a",
"size... |
import twitter
from django.apps import AppConfig
from django.db.models.signals import post_save
def truncate_headline(headline, n_char):
last = headline[-n_char - 3]
headline = headline[:-n_char -3]
i = len(headline)
while last not in " ,.;:" and i:
i -= 1
last = headline[i]
if i ... | {
"content_hash": "e240c38314352f3cb1ced20fa2cabece",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 122,
"avg_line_length": 37.939189189189186,
"alnum_prop": 0.642386464826358,
"repo_name": "barrachri/epcon",
"id": "4339b8089473e5c97b8746dfaba46e517fed69a2",
"size": "561... |
import mock
from rally import consts
from rally import exceptions
from rally.plugins.openstack.wrappers import network
from tests.unit import test
from neutronclient.common import exceptions as neutron_exceptions
from novaclient import exceptions as nova_exceptions
SVC = "rally.plugins.openstack.wrappers.network."
... | {
"content_hash": "a8c24a25ddb22100bf4b660a5906e354",
"timestamp": "",
"source": "github",
"line_count": 533,
"max_line_length": 79,
"avg_line_length": 47.65478424015009,
"alnum_prop": 0.5543307086614173,
"repo_name": "aplanas/rally",
"id": "db29374f782362c74333bce7fdbabf915cc244b5",
"size": "26030"... |
"""
Web Interface Session Mapper
"""
import datetime
import uuid
from sqlalchemy import Boolean
from sqlalchemy import Column
from sqlalchemy import DateTime
from sqlalchemy import Text
from apiary.types import JSONEncodedValue
from apiary.types import IPAddress
from apiary.types import UUID
from apiary.mappers imp... | {
"content_hash": "ad6d05f526afb5c087f833300c5ddd06",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 75,
"avg_line_length": 28.21951219512195,
"alnum_prop": 0.6853932584269663,
"repo_name": "gmr/apiary",
"id": "6fc66ec723a6faf37ecfe8cfa52642a1fd3db072",
"size": "1157",
"... |
def define_tables():
# Copied from git commit 96b9f1419453d8079dd1631c329f04d6e005baae from
# git://hforge.org/itools.git
config_uri = 'urn:oasis:names:tc:opendocument:xmlns:config:1.0'
dc_uri = 'http://purl.org/dc/elements/1.1/'
form_uri = 'urn:oasis:names:tc:opendocument:xmlns:form:1.0'
meta_u... | {
"content_hash": "f9ab9cb44c5b3c4fb6c94097f036d06f",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 79,
"avg_line_length": 33.3780487804878,
"alnum_prop": 0.5369017172086226,
"repo_name": "staranjeet/fjord",
"id": "b32139ef7a5069429cd79fbf7b15e3a675af26e9",
"size": "6238... |
from __future__ import division
softwareVersion = '0.4.4'
verbose = 1
maximumAgeOfAnObjectThatIAmWillingToAccept = 216000 # This is obsolete with the change to protocol v3 but the singleCleaner thread still hasn't been updated so we need this a little longer.
lengthOfTimeToHoldOnToAllPubkeys = 2419200 # Equals 4 wee... | {
"content_hash": "20a3c4c837d62dc16b51683c6ef863e0",
"timestamp": "",
"source": "github",
"line_count": 879,
"max_line_length": 533,
"avg_line_length": 47.833902161547215,
"alnum_prop": 0.6933120867621176,
"repo_name": "metamarcdw/PyBitmessage-I2P",
"id": "74fb65f18fc04304a13bb9a0cd186bf79ab7ae86",
... |
from concurrent.futures import ThreadPoolExecutor
from concurrent import futures
import contextlib
import datetime
import functools
import socket
import subprocess
import sys
import threading
import time
import types
from unittest import mock
import unittest
from tornado.escape import native_str
from tornado import ge... | {
"content_hash": "2c9f9166bc6e7593855277a2b6c5b591",
"timestamp": "",
"source": "github",
"line_count": 719,
"max_line_length": 88,
"avg_line_length": 35.24478442280946,
"alnum_prop": 0.6002525551477842,
"repo_name": "NoyaInRain/tornado",
"id": "293ea3562a2520e3b6cf66680a1de4cbb48e49da",
"size": "2... |
"""
Management class for Storage-related functions (attach, detach, etc).
"""
from oslo_log import log as logging
from oslo_utils import excutils
from oslo_utils import strutils
from nova import exception
from nova.virt.xenapi import vm_utils
from nova.virt.xenapi import volume_utils
LOG = logging.getLogger(__name_... | {
"content_hash": "c665928b3fd1a8c800cf0eb08a01ac17",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 79,
"avg_line_length": 42.08056872037915,
"alnum_prop": 0.56751886473702,
"repo_name": "jianghuaw/nova",
"id": "9195be10a73e97796da6ae34eeb80ed89a74a426",
"size": "9538",
... |
"""Tests for Keras callbacks."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import csv
import json
import os
import re
import shutil
import sys
import threading
import time
import unittest
from absl.testing import parameterized
impo... | {
"content_hash": "757ebf247f13c78122972e4cae4b4b12",
"timestamp": "",
"source": "github",
"line_count": 1965,
"max_line_length": 80,
"avg_line_length": 34.250381679389314,
"alnum_prop": 0.6131615702356542,
"repo_name": "arborh/tensorflow",
"id": "46c11a148386a9cacb8047ffa042b7d2c7fcbda1",
"size": "... |
from __future__ import print_function
import os,sys,sip,time
from datetime import datetime,timedelta
from qtpy.QtWidgets import QTreeWidgetItem,QMenu,QApplication,QAction,QMainWindow
from qtpy import QtGui,QtWidgets
from qtpy.QtCore import Qt,QUrl,QDate
from Graph import graphpage
from layout import Ui_MainWindow
from ... | {
"content_hash": "9260765587bfe5d60494cd62d0863813",
"timestamp": "",
"source": "github",
"line_count": 373,
"max_line_length": 128,
"avg_line_length": 45.847184986595174,
"alnum_prop": 0.5872755979182503,
"repo_name": "Seedarchangel/TuChart",
"id": "30ed89e67168349855b84e451319ff4c7d616199",
"size... |
from girder import events
from girder.models.model_base import ValidationException
from . import rest, constants
def validateSettings(event):
key, val = event.info['key'], event.info['value']
if key == constants.PluginSettings.GOOGLE_CLIENT_ID:
if not val:
raise ValidationException(
... | {
"content_hash": "9be39e0f790950ef4967ad5133598172",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 68,
"avg_line_length": 34.56521739130435,
"alnum_prop": 0.6666666666666666,
"repo_name": "chrismattmann/girder",
"id": "7bfe27d598598c389ccb33b6de7eefbd48d82edd",
"size": "... |
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import sys
from multiprocessing import Process
ERR_SLEEP = 15
MAX_NONCE = 1000000L
settings = {}
pp = pprint.PrettyPrinter(indent=4)
class BitcoinRPC:
OBJID = 1
def __init__(self, host, port, username, passwo... | {
"content_hash": "b5029ac11a72fd58519e580a040d91af",
"timestamp": "",
"source": "github",
"line_count": 245,
"max_line_length": 84,
"avg_line_length": 25.416326530612245,
"alnum_prop": 0.6452545366950377,
"repo_name": "neo7530/wabcoin",
"id": "b5b039f9346c4f94c920bc2352e7a8076d42776e",
"size": "643... |
"""
Expose public exceptions & warnings
"""
from pandas._libs.tslibs import OutOfBoundsDatetime
class PerformanceWarning(Warning):
"""
Warning raised when there is a possible performance impact.
"""
class UnsupportedFunctionCall(ValueError):
"""
Exception raised when attempting to call a numpy ... | {
"content_hash": "77fb07977afe55ee3a691d57a549ae23",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 79,
"avg_line_length": 30.647368421052633,
"alnum_prop": 0.6409067490984028,
"repo_name": "MJuddBooth/pandas",
"id": "7d5a7f1a99e41ed3b5c8dd24a4ce8a18fae68bb9",
"size": "5... |
from OpenGLCffi.GLES2 import params
@params(api='gles2', prms=['index', 'divisor'])
def glVertexAttribDivisorNV(index, divisor):
pass
| {
"content_hash": "4b9183d3d387952d93703d47a4cfb283",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 47,
"avg_line_length": 22.833333333333332,
"alnum_prop": 0.7518248175182481,
"repo_name": "cydenix/OpenGLCffi",
"id": "f6fb81bbdcaddcca43fd34c9bb9b812230b0ff68",
"size": "13... |
from setuptools import setup
fn = 'lino/setup_info.py'
exec(compile(open(fn, "rb").read(), fn, 'exec'))
# above line is equivalent to the line below, except that it works
# also in Python 3:
# execfile(fn)
if __name__ == '__main__':
setup(**SETUP_INFO)
| {
"content_hash": "9b85dfb1311c1751186a3b4c8ff8928e",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 66,
"avg_line_length": 25.9,
"alnum_prop": 0.6563706563706564,
"repo_name": "khchine5/lino",
"id": "182070960d62b008df5c09c2f51b42c56fffcb96",
"size": "259",
"binary": fa... |
import base
class Action(base.BaseV30):
def write_memory(self, **kwargs):
payload = {
"memory": {
"primary": True
}
}
self._post("/write/memory/", payload, **kwargs)
| {
"content_hash": "57a9a1db805d76459def1298b239c53f",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 55,
"avg_line_length": 19.75,
"alnum_prop": 0.47257383966244726,
"repo_name": "dkiser/acos-client",
"id": "727e224c23b5027495b9bc3ccd7f6bd77c9c5454",
"size": "860",
"bina... |
from google.cloud import dialogflow_v2beta1
def sample_get_version():
# Create a client
client = dialogflow_v2beta1.VersionsClient()
# Initialize request argument(s)
request = dialogflow_v2beta1.GetVersionRequest(
name="name_value",
)
# Make the request
response = client.get_vers... | {
"content_hash": "d742a4651d31e2eefd903fdedc84aba4",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 61,
"avg_line_length": 23.736842105263158,
"alnum_prop": 0.7095343680709535,
"repo_name": "googleapis/python-dialogflow",
"id": "aa77130f379c8bcffeda7a357ecaf65f39fab93b",
... |
set_a = set(
map(int, input().split())
)
set_count = int(input())
result = True
for _ in range(set_count):
current_set = set(
map(int, input().split())
)
if not set_a >= current_set:
result = False
break
print(result)
| {
"content_hash": "e45ee28e12d35e984302239c0f5130d4",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 33,
"avg_line_length": 14.833333333333334,
"alnum_prop": 0.5318352059925093,
"repo_name": "avenet/hackerrank",
"id": "41e372c503f45bc8cb1c71e9223a8b360e4ddc42",
"size": "26... |
import sys
from networking_mlnx.plugins.mlnx.agent import mlnx_eswitch_neutron_agent
from oslo_config import cfg
from neutron.i18n import _LE, _LI
from neutron.common import config as common_config
from neutron.common import utils
from neutron.openstack.common import log as logging
from neutron.plugins.mlnx.agent imp... | {
"content_hash": "f035bed8f24668c0f85ce7a5e29d9f9a",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 73,
"avg_line_length": 28.88372093023256,
"alnum_prop": 0.6537842190016103,
"repo_name": "cloudbase/neutron-virtualbox",
"id": "19c610640fe6d604c096d7be2928cefeecc6d769",
"... |
from django.conf.urls import patterns, url
urlpatterns = patterns(
'',
url(r'^$', 'what_profile.views.profile'),
url(r'^part/buffer_up_down_data$', 'what_profile.parts.buffer_up_down_data'),
url(r'^part/profile_history', 'what_profile.parts.profile_history'),
)
| {
"content_hash": "bb153117f4e88ebf91746253d86a7bc4",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 81,
"avg_line_length": 34.875,
"alnum_prop": 0.6774193548387096,
"repo_name": "MADindustries/WhatManager2",
"id": "ef83267230b365ffd247166465f7c51a47086e51",
"size": "279",
... |
import re
# Python-LDAP
import ldap
# Django
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
__all__ = ['validate_ldap_dn', 'validate_ldap_dn_with_user',
'validate_ldap_bind_dn', 'validate_ldap_filter',
'validate_ldap_filter_with_user',... | {
"content_hash": "c9ce77d4c77ae61b71d274bb58206e9b",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 104,
"avg_line_length": 32.23529411764706,
"alnum_prop": 0.5994525547445255,
"repo_name": "GoogleCloudPlatform/sap-deployment-automation",
"id": "7e89958236d1c891a8a37c8cdc16... |
"""
Determine if your browser is detectable by anti-bot services.
Some sites use scripts to detect Selenium and then block you.
To evade detection, add --uc as a pytest command-line option.
"""
from seleniumbase import BaseCase
class UndetectedTest(BaseCase):
def test_browser_is_undetected(self):
... | {
"content_hash": "8f3b1910c5f46e5c8e7a570b28299c59",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 72,
"avg_line_length": 40.8235294117647,
"alnum_prop": 0.6498559077809798,
"repo_name": "seleniumbase/SeleniumBase",
"id": "00b0a6ddd612c2bbb4089984df045cc0d66bce23",
"size... |
""" Provides adding dns_evironment functionality """
from aquilon.utils import validate_nlist_key
from aquilon.worker.broker import BrokerCommand
from aquilon.aqdb.model import DnsEnvironment
class CommandAddDnsEnvironment(BrokerCommand):
required_parameters = ["dns_environment"]
def render(self, session, ... | {
"content_hash": "926bfe80cea2608991dc017d5bf53bfc",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 75,
"avg_line_length": 33.578947368421055,
"alnum_prop": 0.7335423197492164,
"repo_name": "guillaume-philippon/aquilon",
"id": "be16801378b2402e4410e2ec271b1c0682f2463e",
"... |
from . import chart
from warnings import warn
class ChartScatter(chart.Chart):
"""
A class for writing the Excel XLSX Scatter charts.
"""
###########################################################################
#
# Public API.
#
###################################################... | {
"content_hash": "fa65b389dd0404e8a28a85c462c41c1e",
"timestamp": "",
"source": "github",
"line_count": 312,
"max_line_length": 79,
"avg_line_length": 30.134615384615383,
"alnum_prop": 0.4969155498830036,
"repo_name": "jmcnamara/XlsxWriter",
"id": "941a886bd6b600251e579b2ca11ceab6f143eff9",
"size":... |
from functools import wraps
from contextlib import AbstractContextManager, ExitStack, contextmanager
from abc import ABC, abstractmethod
from enum import Enum
from operator import *
from funklib.core.prelude import flip, const
from functools import wraps,partial
from collections import namedtuple
def from_context(cm)... | {
"content_hash": "51dab097b841abf8e23e6327bc6c07cb",
"timestamp": "",
"source": "github",
"line_count": 417,
"max_line_length": 104,
"avg_line_length": 24.810551558752998,
"alnum_prop": 0.5920162381596752,
"repo_name": "DrPyser/python-multimethods",
"id": "0afc4328c2ebb01d3c2e93b6d702ee1438d19e08",
... |
from numpy import asarray, kron, zeros
from optimix import Function, Vector
from glimix_core._util import unvec, vec
class KronMean(Function):
"""
Kronecker mean function, (A⊗X)vec(B).
Let
- n be the number of samples;
- p the number of traits; and
- c the number of covariates.
The mat... | {
"content_hash": "dc0e28db9a9b2c85211b322ff63e4a41",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 86,
"avg_line_length": 21.517857142857142,
"alnum_prop": 0.4817427385892116,
"repo_name": "glimix/limix-inference",
"id": "828df95ab76ce6d9811ba4f73e256551d0a60ad4",
"size... |
from supplychainpy.reporting.blueprints.bot.views import bot
| {
"content_hash": "2d589b81cb127d0078ebc24d996dbb4d",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 60,
"avg_line_length": 21,
"alnum_prop": 0.8412698412698413,
"repo_name": "KevinFasusi/supplychainpy",
"id": "5acaa268b2f27c4c1c3bdcfa5fadd486ea1774a7",
"size": "63",
"bin... |
import azure.common.credentials
import azure.mgmt.network
import azure.mgmt.resource
subscription_id = 'get_me'
group = 'get_me'
client_id = 'get_me',
secret = 'get_me',
tenant = 'get_me'
# Connect to azure
credentials = azure.common.credentials.ServicePrincipalCredentials(client_id, secret, tenant)
rmc = azure.mgm... | {
"content_hash": "844e489961cb843fa073162457421845",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 93,
"avg_line_length": 25.428571428571427,
"alnum_prop": 0.7046548956661316,
"repo_name": "movicha/dcos",
"id": "03a8ec9d9e608224e99239cae4041c81970d2a06",
"size": "1246",
... |
"""
Copyright (c) 2012 - 2016, Ernesto Ruge
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the follow... | {
"content_hash": "fb79cfe7363a6d7b0264ddfee7c2d195",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 755,
"avg_line_length": 64.01851851851852,
"alnum_prop": 0.7674284061324849,
"repo_name": "ruhrmobil-E/mobilitaet-finden",
"id": "05b568312c0958e3bd7a791797289f0f12b52607",
... |
import os
import django
# Make filepaths relative to settings.
ROOT = os.path.dirname(os.path.abspath(__file__))
path = lambda *a: os.path.join(ROOT, *a)
DEBUG = True
TEMPLATE_DEBUG = True
if django.VERSION < (1, 6):
TEST_RUNNER = 'discover_runner.DiscoverRunner'
else:
TEST_RUNNER = 'django.test.runner.Disco... | {
"content_hash": "3fad288b5080d8b62c6daaf19ab9597c",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 62,
"avg_line_length": 21.28,
"alnum_prop": 0.6760651629072681,
"repo_name": "mark-adams/django-waffle",
"id": "07c6c24bd989ab1528310b00da96cddcb646fa6f",
"size": "1596",
... |
from __future__ import unicode_literals
from django.db import models, migrations
import jsonfield.fields
from decimal import Decimal
import shop.util.fields
import django.db.models.deletion
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_re... | {
"content_hash": "8500d602a26222f180fc439953420ea9",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 206,
"avg_line_length": 52.483870967741936,
"alnum_prop": 0.5652822899288787,
"repo_name": "chriscauley/django-shop",
"id": "cd97c523ba3fedee9a6eec7e3e7a3d3c8bf52d06",
"si... |
from django.shortcuts import render, redirect
from models import User, Photo, Album, Tag
def front_view(request):
return render(request, 'front.html')
def home_view(request):
return render(request, 'home.html', {'albums': Album.objects.all()})
def album_view(request, albumid):
myalbum = Album.objects.... | {
"content_hash": "4103c3ca335715c58f7644c4f45ced6e",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 78,
"avg_line_length": 29.192307692307693,
"alnum_prop": 0.6982872200263505,
"repo_name": "sniboboof/djangophotos",
"id": "5e04e5032343c24218588b7df29ccae682328285",
"size"... |
"""Setuptools configuration for aitertools."""
from setuptools import setup
from setuptools import find_packages
with open('README.rst', 'r') as readmefile:
README = readmefile.read()
setup(
name='aitertools',
version='0.1.0',
url='https://github.com/asyncdef/aitertools',
description='Async ver... | {
"content_hash": "087365ba1090df25e967443e6587af34",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 71,
"avg_line_length": 22.9,
"alnum_prop": 0.6521106259097526,
"repo_name": "asyncdef/aitertools",
"id": "2d5cc3b6375f12bbfb85eb670109be0c8ad81e92",
"size": "687",
"binar... |
"""A plugin that gather extension IDs from Chrome history browser."""
import re
import requests
from plaso.analysis import interface
from plaso.analysis import logger
from plaso.analysis import manager
class ChromeExtensionPlugin(interface.AnalysisPlugin):
"""Convert Chrome extension IDs into names, requires Int... | {
"content_hash": "6c209b4d74dd88d9b5646160334a76a1",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 80,
"avg_line_length": 30.542713567839197,
"alnum_prop": 0.6600855544587035,
"repo_name": "Onager/plaso",
"id": "5c2c37a3141a2323cc296f93df3d267a5648e07f",
"size": "6102",... |
import tempfile
from zipfile import ZipFile
from datetime import date
from wsgiref.util import FileWrapper
from django.http import HttpResponse
from collections import defaultdict
from explorer.utils import csv_report
_ = lambda x: x
def generate_report_action(description="Generate CSV file from SQL query",):
d... | {
"content_hash": "fd439adeffd50e70da3f8da0b96735c4",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 135,
"avg_line_length": 36.266666666666666,
"alnum_prop": 0.6703431372549019,
"repo_name": "grantmcconnaughey/django-sql-explorer",
"id": "1997e54b997d8603d44782c786b17788e4a... |
import json
import nbformat
from nbformat.v4 import new_notebook, new_code_cell
import os
import pytest
import requests
from subprocess import Popen
import sys
from tempfile import mkstemp
from testpath.tempdir import TemporaryDirectory
import time
from urllib.parse import urljoin
from selenium.webdriver import Firefo... | {
"content_hash": "1e9e5ef797f7452f5610a4bc8524ec8b",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 78,
"avg_line_length": 34.16783216783217,
"alnum_prop": 0.61563651248465,
"repo_name": "sserrot/champion_relationships",
"id": "64cdfa23bda4d2a0ba01e0dd912415755d5e1f57",
... |
from synapse.storage.pdu import PduStore
from synapse.storage.signatures import SignatureStore
from synapse.storage._base import SQLBaseStore
from synapse.federation.units import Pdu
from synapse.crypto.event_signing import (
add_event_pdu_content_hash, compute_pdu_event_reference_hash
)
from synapse.api.events.uti... | {
"content_hash": "57400357e1da2e2cbe97629636d02fb8",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 117,
"avg_line_length": 39.333333333333336,
"alnum_prop": 0.6484893146647015,
"repo_name": "iot-factory/synapse",
"id": "616d6a10e733db74e7dbc94d19c1700726e972d0",
"size": ... |
"""List of directories which are known issues for Android WebView.
There are a number of directories in the Chromium tree which should be removed
when merging into Android. Some are for licensing reasons; others are to ensure
that the build inside the Android tree does not accidentally include the wrong
headers.
This... | {
"content_hash": "81e4856c79f2a99198f3208545f7dd14",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 80,
"avg_line_length": 38.91803278688525,
"alnum_prop": 0.7000842459983151,
"repo_name": "cvsuser-chromium/chromium",
"id": "e1098a14ed377f5ca070758ab70fb2e94c8c0a8d",
"siz... |
class InvalidGlob(Exception):
"""The glob passed is invalid."""
pass
class PathNotFound(Exception):
"""One or more elements of the requested path did not exist in the object"""
pass
class InvalidKeyName(Exception):
"""This key contains the separator character or another invalid character"""
pa... | {
"content_hash": "58edfa1889d4ef1034c994cd8d190648",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 80,
"avg_line_length": 28.666666666666668,
"alnum_prop": 0.7116279069767442,
"repo_name": "benthomasson/dpath-python",
"id": "4ab39169fedd07f33d0d57537644112ef77cd9e3",
"si... |
from django.urls import reverse
from django.http import Http404
from django.test import TestCase, override_settings
from unittest import mock
from rest_framework.exceptions import APIException, PermissionDenied
from rest_framework.request import Request
from rest_framework.response import Response
from rest_framework... | {
"content_hash": "fe4e13ffdecb6fa107ebd339cef943af",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 78,
"avg_line_length": 40.90066225165563,
"alnum_prop": 0.6450777202072538,
"repo_name": "bqbn/addons-server",
"id": "2561f66ec0e29da82acf9027a06422a6295b1961",
"size": "6... |
import sys
import os
import Cyberoam
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import qrc_icon
from base64 import *
GREEN = ':/icons/ball-green.png'
RED = ':/icons/ball-red.png'
YELLOW = ':/icons/ball-yellow.png'
lck_file = '.sam.lck'
if "linux2" in sys.platform:
def set_proc_name(newname):
from ctypes... | {
"content_hash": "c13481f11fde1245342d0297b6dd8fbd",
"timestamp": "",
"source": "github",
"line_count": 604,
"max_line_length": 168,
"avg_line_length": 36.41225165562914,
"alnum_prop": 0.6944027645159824,
"repo_name": "viranch/sam",
"id": "aff438039867078682017925b4e0fff9b085cdde",
"size": "22172",... |
import logging
import os
from ...utils import paths
from ...utils import transfer
from kolibri.core.tasks.management.commands.base import AsyncCommand
logger = logging.getLogger(__name__)
class Command(AsyncCommand):
def add_arguments(self, parser):
parser.add_argument("channel_id", type=str)
pa... | {
"content_hash": "dffb7275eade4584596908c8653c583a",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 84,
"avg_line_length": 32.30434782608695,
"alnum_prop": 0.5693135935397039,
"repo_name": "indirectlylit/kolibri",
"id": "75c50d4dc3988907a6aa2722191a90367d22f520",
"size": ... |
from django.http import HttpResponse
from cars.models import Car
from tastypie.resources import ModelResource
class CarResource(ModelResource):
def dispatch_list(self, request, **kwargs):
# TODO: Refactor this
if request.method == "POST":
return HttpResponse(True)
return super(... | {
"content_hash": "52654ec08ee63f7571a0b7be2c31f7a4",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 72,
"avg_line_length": 33.111111111111114,
"alnum_prop": 0.6560402684563759,
"repo_name": "Alexx-G/tastypie-example",
"id": "8acb92aa095138991de70efe90a4bcfacbba7507",
"siz... |
import six
from math import copysign
import numpy as np
import mceq_config as config
from MCEq.misc import info, print_in_rows, getAZN
from particletools.tables import PYTHIAParticleData
info(5, 'Initialization of PYTHIAParticleData object')
_pdata = PYTHIAParticleData()
backward_compatible_namestr = {
'nu_mu': '... | {
"content_hash": "584344345390dfdbe8e2171ea6823306",
"timestamp": "",
"source": "github",
"line_count": 1170,
"max_line_length": 91,
"avg_line_length": 39.30940170940171,
"alnum_prop": 0.5606627239519917,
"repo_name": "afedynitch/MCEq",
"id": "5f4437b97a79e1d400351ee08449bd0440d6b771",
"size": "459... |
"""The Amplification problem class."""
from typing import Optional, Callable, Any, Union, List
from qiskit.circuit import QuantumCircuit
from qiskit.circuit.library import GroverOperator
from qiskit.quantum_info import Statevector
class AmplificationProblem:
"""The amplification problem is the input to amplitud... | {
"content_hash": "2a869f354491fd0d12e4e61d964191a0",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 99,
"avg_line_length": 39.381188118811885,
"alnum_prop": 0.6231301068510371,
"repo_name": "QISKit/qiskit-sdk-py",
"id": "c2908a86aa906584fad3c54c611c620a8187f744",
"size":... |
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/bio_engineer/dna_template/shared_dna_template_bolma.iff"
result.attribute_template_id = -1
result.stfName("string_id_table","")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
retur... | {
"content_hash": "c6c1c439c6d47fbdd26bce61016c1b9e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 99,
"avg_line_length": 25.23076923076923,
"alnum_prop": 0.7042682926829268,
"repo_name": "obi-two/Rebelion",
"id": "00ed7c7dc810ec9426aa7f06e2a2f6fd53177e30",
"size": "473"... |
structDict = {}
#用户登录请求
CThostFtdcReqUserLoginField = {}
CThostFtdcReqUserLoginField["accountID"] = "string"
CThostFtdcReqUserLoginField["loginType"] = "int"
CThostFtdcReqUserLoginField["memberID"] = "string"
CThostFtdcReqUserLoginField["password"] = "string"
CThostFtdcReqUserLoginField["tradeDate"] = "st... | {
"content_hash": "c03bda02c82abe482744ddf7f67cbbbd",
"timestamp": "",
"source": "github",
"line_count": 416,
"max_line_length": 85,
"avg_line_length": 39.25,
"alnum_prop": 0.8051812836844684,
"repo_name": "smther/vnpy",
"id": "60d722a81ba0c3e2c8e6c3ef689709fc23240d12",
"size": "16537",
"binary": ... |
"""Tests for open_spiel.python.utils.file_logger."""
import os
import tempfile
from absl.testing import absltest
from open_spiel.python.utils import file_logger
class FileLoggerTest(absltest.TestCase):
def test_file_logger(self):
tmp_dir = tempfile.mkdtemp()
try:
log_name = "test"
log_file_n... | {
"content_hash": "b168dd526b04322636cc548fd5cd6dc6",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 74,
"avg_line_length": 25.4390243902439,
"alnum_prop": 0.6212847555129435,
"repo_name": "deepmind/open_spiel",
"id": "a99ce32b2116a7b538a4f2bdb594a5ba27f76c75",
"size": "16... |
"""
Django settings for xtimr project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
impo... | {
"content_hash": "2ee9cc44282476620de6969971af1c2e",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 71,
"avg_line_length": 22.159574468085108,
"alnum_prop": 0.7119539126260201,
"repo_name": "zhy0216/xtimr",
"id": "356d5c54a4b481bebf1acf00e9bf8f7aff5b54d4",
"size": "2083",... |
import datetime
import json
#import MySQLdb
import traceback
import sys
import os
import TestRig
import UserInterface
import Config
class FileSink():
def __init__(self, fileName):
self.fileName = fileName
print "Logging to logfile: %s" % self.fileName
try:
self.logFile = open(self.fileName, 'a')
... | {
"content_hash": "1b1598b549fd178583c4d07cade43ea3",
"timestamp": "",
"source": "github",
"line_count": 229,
"max_line_length": 189,
"avg_line_length": 36.148471615720524,
"alnum_prop": 0.6274462430538778,
"repo_name": "Blinkinlabs/BlinkyTape",
"id": "46cfae5154b0f956e3396f99e83a917e43a1f8eb",
"siz... |
'''
============================================
TGrep search implementation for NLTK trees
============================================
This module supports TGrep2 syntax for matching parts of NLTK Trees.
Note that many tgrep operators require the tree passed to be a
``ParentedTree``.
External links:
- `Tgrep tuto... | {
"content_hash": "a1b5708a97b1060767d5c53d0771ca0f",
"timestamp": "",
"source": "github",
"line_count": 927,
"max_line_length": 103,
"avg_line_length": 41.66019417475728,
"alnum_prop": 0.5510241073046945,
"repo_name": "nkcr/WebIndex",
"id": "11fa8cfa96f587a92e92d84fa9aad740471c7dc3",
"size": "38866... |
from __future__ import absolute_import, unicode_literals
from wechatpy.client.api.base import BaseWeChatAPI
class WeChatTag(BaseWeChatAPI):
def create(self, name):
return self._post(
'tag/create',
data={
'tagname': name
}
)
def update(self,... | {
"content_hash": "ecf3cdd88e2fc043c8e6c9f453d6386a",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 56,
"avg_line_length": 22.283333333333335,
"alnum_prop": 0.42408376963350786,
"repo_name": "chenjiancan/wechatpy",
"id": "c6be27338c3a063cb7cbe885db2ec7c2807d6be3",
"size":... |
'''
@author: FangSun
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.operations.primarystorage_operations as ps_ops
import apibindin... | {
"content_hash": "b7fcc9f357dc7ab73030608cff28383f",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 155,
"avg_line_length": 41.98684210526316,
"alnum_prop": 0.6530868066436853,
"repo_name": "zstackio/zstack-woodpecker",
"id": "21e4f76055d793899e5f27b17dab6eccb94ee6c4",
"s... |
"""Archives a parser given the config ID."""
from typing import AnyStr
import click
from common import api_utility
from common import chronicle_auth
from common import exception_handler
from common import options
from common.constants import key_constants as common_constants
from common.constants import status
from ... | {
"content_hash": "9ca7730026ec41f5e089e3143147b30f",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 96,
"avg_line_length": 38.7625,
"alnum_prop": 0.7226701064172848,
"repo_name": "chronicle/cli",
"id": "c61a309064ca4849ed076a74da9048729f7074e7",
"size": "3677",
"binary"... |
class HTTPError(Exception):
status_code = 400
def __init__(self, message, status_code=None, payload=None):
Exception.__init__(self)
if status_code is not None:
self.status_code = status_code
self.payload = payload
def to_dict(self):
rv = dict(self.payload or ())... | {
"content_hash": "1239010dbeb6383f3d271e855f2bdbe6",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 64,
"avg_line_length": 25.136363636363637,
"alnum_prop": 0.6347197106690777,
"repo_name": "jisantuc/tour_de_taco_bell_api",
"id": "fc8949b0f0a36b09e55119f45b96d793ed8733d3",
... |
import numpy as np
import theano
import theano.tensor as T
from theano.ifelse import ifelse
class HiddenLayer(object):
def __init__(self, rng, input, n_in, n_out, training_mode, dropout_prob, activation, weights_variance):
self.input = input
if activation == 'tanh':
activation_function... | {
"content_hash": "d99aca36825efe4e80c5163bf65dadb1",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 107,
"avg_line_length": 42.775,
"alnum_prop": 0.5739333722969024,
"repo_name": "IraKorshunova/kaggle-seizure-prediction",
"id": "ec89e442ab9522c23afe79ea118c8ba27a624efa",
... |
import argparse
import os
import sys
# chdir to ~/.nefi2 before local imports
# uncomment this for compiling builds
if not (sys.platform == 'win32' or sys.platform == 'win64'):
os.chdir(os.path.dirname(os.path.realpath(__file__)))
from nefi2.main import Main
def runner(args):
"""
Load all available catego... | {
"content_hash": "5def31f227c3b5f00729a7b65a15d2d3",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 78,
"avg_line_length": 35.25581395348837,
"alnum_prop": 0.5956464379947229,
"repo_name": "LumPenPacK/NetworkExtractionFromImages",
"id": "d5d9d8210c85565d8356a388e91c37020a9c... |
"""
byceps.blueprints.admin.attendance.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from flask import abort
from ....services.brand import service as brand_service
from ....services.party import service as party_service... | {
"content_hash": "94aa487d88e42f3ce43874e6cdc4973a",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 78,
"avg_line_length": 32,
"alnum_prop": 0.690625,
"repo_name": "m-ober/byceps",
"id": "ac144d7c53e0cc1d4073d60379841ecd44c5b644",
"size": "1600",
"binary": false,
"cop... |
from .csv2LaTeX import *
import doctest
import sys
if __name__=="__main__":
args=sys.argv
if len(args)>1:
if args[1].upper()=="TEST":
doctest.testfile("test.py",verbose=True)
else:
print("Bad Input")
else:
check_update()
print(signature())
list... | {
"content_hash": "60622027d7763910c82cce9a9de5ef76",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 90,
"avg_line_length": 31.48148148148148,
"alnum_prop": 0.5117647058823529,
"repo_name": "sepandhaghighi/csv2latex",
"id": "887f7d4fd8eb2f756c12319fad6d477bdcf25cd6",
"size... |
import os
from traits.api import HasTraits, Button, Str, Any, List
from traitsui.api import View, UItem, HGroup, VGroup, Controller, TabularEditor
# ============= standard library imports ========================
# ============= local library imports ==========================
from traitsui.editors.api import TextEd... | {
"content_hash": "360b786afca3a37e4021f112553e7db5",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 87,
"avg_line_length": 28.472602739726028,
"alnum_prop": 0.5056531152273274,
"repo_name": "USGSDenverPychron/pychron",
"id": "c3a4855e6478a67588ebe3693b6aac02f2b58219",
"s... |
from oslo.config import cfg
from neutron.common import constants
from neutron.extensions import portbindings
from neutron.i18n import _LE, _LW
from neutron.openstack.common import log
from neutron.plugins.common import constants as p_const
from neutron.plugins.ml2 import driver_api as api
LOG = log.getLogger(__name_... | {
"content_hash": "c5f0b4eb514ae9abaf3457852dd96de8",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 78,
"avg_line_length": 43,
"alnum_prop": 0.5871749002339343,
"repo_name": "vveerava/Openstack",
"id": "577ba57bda8f2c5e489826d6478d3d68a8eebf54",
"size": "7860",
"binary... |
from . import *
Build = Method("Build")
@Build.implementation(Months)
def build(month_filter, dsl_aggregation_node):
month_numbers = list(month_filter.month_numbers)
month_numbers.sort()
dsl_aggregation_node.set_months(month_numbers)
@Build.implementation(FromDate)
def build(from_date, dsl_aggregation_no... | {
"content_hash": "b3da73622521a8f619173ae045f9f36f",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 78,
"avg_line_length": 32.111111111111114,
"alnum_prop": 0.7554786620530565,
"repo_name": "flavour/helios",
"id": "7fd2043ba076153bb32724d9c1956ddd103457d9",
"size": "1736"... |
from raggregate.models import DBSession
from raggregate.models.motd import MOTD
from raggregate.queries import motd as motd_queries
from raggregate.queries import general
from pyramid.view import view_config
from pyramid.httpexceptions import HTTPFound
from pyramid.httpexceptions import HTTPNotFound
@view_config(rende... | {
"content_hash": "6f1d4ae13232fd014f1144c995a8eb43",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 83,
"avg_line_length": 39.611111111111114,
"alnum_prop": 0.5820476858345021,
"repo_name": "sjuxax/raggregate",
"id": "82b6919facab87c114eea454daa17d533a667578",
"size": "21... |
"""Provide access to Python's configuration information.
"""
import sys
import os
from os.path import pardir, realpath
_INSTALL_SCHEMES = {
'posix_prefix': {
'stdlib': '{base}/lib/python{py_version_short}',
'platstdlib': '{platbase}/lib/python{py_version_short}',
'purelib': '{ba... | {
"content_hash": "2881845c07a5cce647a7e3ee5ab1c996",
"timestamp": "",
"source": "github",
"line_count": 636,
"max_line_length": 79,
"avg_line_length": 36.19496855345912,
"alnum_prop": 0.5566029539530842,
"repo_name": "kleientertainment/ds_mod_tools",
"id": "e55c834213e31bdeaf4c3e2cb79fceead723bfbc",
... |
"""
demo_sample_uf_faculty.py -- Generate a random sample of current UF faculty
Version 0.1 MC 2013-12-27
-- Initial version
Version 0.2 MC 2014-08-30
-- Updated for vivofoundation, code formatting for PEP 8
"""
__author__ = "Michael Conlon"
__copyright__ = "Copyright 2014, University of Florida... | {
"content_hash": "3dc8f087e38e97cccf09105537ecc62a",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 79,
"avg_line_length": 27.65,
"alnum_prop": 0.6808318264014467,
"repo_name": "mconlon17/vivo-1.5-improvement",
"id": "c89681c628231d6b7e50e89b808441a963f70fcc",
"size": "11... |
import os
import re
def remove_duplicates_preserve_order(items):
found = set([])
keep = []
for item in items:
if item not in found:
found.add(item)
keep.append(item)
return keep
def check_dir(element, final_list):
#replace all "\\ " with " " as os.path cannot check escaped spaces
elementP... | {
"content_hash": "ec55747636e1271820813eedfa95d212",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 68,
"avg_line_length": 27.574468085106382,
"alnum_prop": 0.6550925925925926,
"repo_name": "apexdatasolutions/VistA",
"id": "8130556a9203141907529cc02ab1d7c117602094",
"size... |
import collections
from supriya import CalculationRate
from supriya.ugens.PureUGen import PureUGen
class BufAllpassL(PureUGen):
"""
A buffer-based linear-interpolating allpass delay line unit generator.
::
>>> buffer_id = 0
>>> source = supriya.ugens.In.ar(bus=0)
>>> supriya.uge... | {
"content_hash": "926a57071e682ae25c27cd4b840fc09f",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 79,
"avg_line_length": 23.37837837837838,
"alnum_prop": 0.5549132947976878,
"repo_name": "Pulgama/supriya",
"id": "d4a124ccfcd95dbf7a9660fd27db11556587c6fc",
"size": "865",... |
"""Showcases *ATD (1995)* colour appearance model computations."""
import numpy as np
import colour
from colour.appearance.atd95 import CAM_ReferenceSpecification_ATD95
from colour.utilities import message_box
message_box('"ATD (1995)" Colour Appearance Model Computations')
XYZ = np.array([19.01, 20.00, 21.78])
XYZ... | {
"content_hash": "403c2cdfd5f97f5d7d26c5eb90eb91fb",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 76,
"avg_line_length": 31.85,
"alnum_prop": 0.7009419152276295,
"repo_name": "colour-science/colour",
"id": "8dd8f928bccd415562dc5ff3b723edc316c95680",
"size": "1274",
"b... |
from optparse import make_option
import django
from evostream.default import api
from evostream.management.base import BaseEvoStreamCommand
class Command(BaseEvoStreamCommand):
help = 'Stop the stream and remove the corresponding configuration entry.'
requires_system_checks = False
silent_keys = 'conf... | {
"content_hash": "cf994439ef16a0638255822db436c56e",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 78,
"avg_line_length": 40.09756097560975,
"alnum_prop": 0.551094890510949,
"repo_name": "tomi77/django-evostream",
"id": "91c7de43437ba94979b0345b8cb8f4a4981698d5",
"size":... |
"""
The render job watch panel allows you to
1. setup filters to automatically load jobs. (defaults to loading your jobs)
2. individually add jobs you want to watch.
"""
import os
import logging
from functools import partial
import plow.client
from plow.client import JobState, TaskState
from plow.gui import co... | {
"content_hash": "b0e616b81b1e66669528be50f7a13efb",
"timestamp": "",
"source": "github",
"line_count": 370,
"max_line_length": 106,
"avg_line_length": 33.38648648648649,
"alnum_prop": 0.6039018861814943,
"repo_name": "Br3nda/plow",
"id": "132832d7f15529bf5e07d73b366839491502b0f9",
"size": "12353",... |
from lxml import etree
import webob
from nova.compute import flavors
from nova.openstack.common import jsonutils
from nova import test
from nova.tests.api.openstack import fakes
FAKE_FLAVORS = {
'flavor 1': {
"flavorid": '1',
"name": 'flavor 1',
"memory_mb": '256',
"root_gb": '10',... | {
"content_hash": "62a1cd205f7193a3d98c37fa09397ace",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 78,
"avg_line_length": 28.29824561403509,
"alnum_prop": 0.573775573465592,
"repo_name": "saleemjaveds/https-github.com-openstack-nova",
"id": "8324147cfd25b61f2d1b76c58eac2f... |
"""This example updates user team associations.
It updates a user team association by setting the overridden access type to read
only for all teams that the user belongs to. To determine which users exists,
run get_all_users.py.
The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" ... | {
"content_hash": "00aeba4dbc49977d3c0f8022d4690a6a",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 80,
"avg_line_length": 35.28767123287671,
"alnum_prop": 0.702251552795031,
"repo_name": "ya7lelkom/googleads-python-lib",
"id": "0ad6b3145b6cc73b933062efda34bf4000b0ed16",
... |
import datetime
import ujson
import re
import mock
from email.utils import parseaddr
from django.conf import settings
from django.http import HttpResponse
from django.conf import settings
from mock import patch
from typing import Any, Dict, List, Union, Mapping
from zerver.lib.actions import (
do_change_is_admin,... | {
"content_hash": "8c5e734316a2beb09991869dfa57e0bf",
"timestamp": "",
"source": "github",
"line_count": 607,
"max_line_length": 118,
"avg_line_length": 46.084019769357496,
"alnum_prop": 0.6543095127444322,
"repo_name": "jackrzhang/zulip",
"id": "7ecd61cebbda200d57a156302571c1b0763f7858",
"size": "2... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.