text stringlengths 4 1.02M | meta dict |
|---|---|
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0015_auto_20170105_1917'),
]
operations = [
migrations.AddField(
model_name='teamstatus',
name='systemic_vision... | {
"content_hash": "199c4031ede70c46f2bcb8ce332c9a68",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 213,
"avg_line_length": 33.17391304347826,
"alnum_prop": 0.6028833551769331,
"repo_name": "jarifibrahim/ashoka-dashboard",
"id": "5e2985cdc5e43ecd25c99fb0d8c1469bfd114f2c",
... |
from django.contrib.auth.models import User
from django.conf import settings
from timestack import facebook
from timestack.models import *
class FacebookBackend:
supports_object_permissions = False
supports_anonymous_user = False
supports_inactive_user = False
def authenticate(self, token... | {
"content_hash": "2e570d30497909102c73d3f15a1e7a79",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 121,
"avg_line_length": 39,
"alnum_prop": 0.4883190883190883,
"repo_name": "flashycud/timestack",
"id": "bc3c619d934bf526aa67fd511220c0e002350909",
"size": "1755",
"binar... |
from repo import Repo
from Phone import Phone
from exceptions import StoreException
import sys
class UI:
def __init__(self):
"""
Creates the UI class
"""
self.repo = Repo()
def handleAddNewPhone(self):
"""
Adds a phone to the repository
Inpu... | {
"content_hash": "e484e6fa8c565d66ee8f241a35f5ba25",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 114,
"avg_line_length": 31.24561403508772,
"alnum_prop": 0.5042111173498035,
"repo_name": "Zephyrrus/ubb",
"id": "894599f425608fc4c76ca4cde3f1ea8b27b5bcdd",
"size": "3562"... |
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from past.builtins import basestring
from future.utils import text_to_native_str
import logging
import subprocess
from flexget import plugin
from flexget.entry import Entr... | {
"content_hash": "20b515c37f1429011f321a0e5963a4a3",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 116,
"avg_line_length": 38.69911504424779,
"alnum_prop": 0.49702721243997255,
"repo_name": "tobinjt/Flexget",
"id": "ad20bb8661b716a0d1c33171eabba408d4397dcf",
"size": "87... |
"""
Django settings for tournament_registration_project project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
# Build paths inside the project like this: os.pat... | {
"content_hash": "ef22c82c0bed7c4717b5441e679bf8bf",
"timestamp": "",
"source": "github",
"line_count": 277,
"max_line_length": 102,
"avg_line_length": 33.061371841155236,
"alnum_prop": 0.6583315134308801,
"repo_name": "eldruz/tournament_registration",
"id": "52f90fc131f6ead46803c77cf6cc4b8c3b130cd7"... |
from base64 import b64decode
import binascii
import codecs
from io import BytesIO
import struct
import re
from Crypto.Cipher import AES
from Crypto.Util import number
from Crypto.PublicKey import RSA
from .account import Account
from .chunk import Chunk
# OpenSSL constant
RSA_PKCS1_OAEP_PADDING = 4
# Secure note t... | {
"content_hash": "d65d795988d71cfa5b4780772995b679",
"timestamp": "",
"source": "github",
"line_count": 284,
"max_line_length": 111,
"avg_line_length": 29.535211267605632,
"alnum_prop": 0.6325703385789223,
"repo_name": "dhercher/lastpass-python",
"id": "5020854f891dc36795567e1121251e599b9dcea9",
"s... |
import json
import base64
from moto.core.responses import BaseResponse
from typing import Dict, List, Tuple, Union
from .models import acm_backends, AWSCertificateManagerBackend
from .exceptions import AWSValidationException
GENERIC_RESPONSE_TYPE = Union[str, Tuple[str, Dict[str, int]]]
class AWSCertificateManager... | {
"content_hash": "4bce64a089b9034c2efe9bffa6932a75",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 103,
"avg_line_length": 35.16600790513834,
"alnum_prop": 0.578397212543554,
"repo_name": "spulec/moto",
"id": "8194cd5a573a5ebd19f380fa487354497f2c96d3",
"size": "8897",
... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('warehouse', '0006_message_message_id'),
]
operations = [
migrations.AddField(
model_name='message',
name='import_job',
... | {
"content_hash": "e55de6c91ae4f10776a57a6e0af11b99",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 184,
"avg_line_length": 31.387096774193548,
"alnum_prop": 0.5775950668036999,
"repo_name": "smn/goggles",
"id": "b2c3a441c0ecf6ad68748994a27f0508319828b3",
"size": "997",
... |
from os import path
from pkg_resources import Requirement, ResolutionError, parse_version, require
from pyinfra import __version__, state
from .exceptions import PyinfraError
class ConfigDefaults:
# % of hosts which have to fail for all operations to stop
FAIL_PERCENT = None
# Seconds to timeout SSH co... | {
"content_hash": "e7f065eec0a4fb3de05f1d55a9470889",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 97,
"avg_line_length": 29.285714285714285,
"alnum_prop": 0.634403080872914,
"repo_name": "Fizzadar/pyinfra",
"id": "cd221bd0a259d90f439247e51bdb998ded1f8ae0",
"size": "389... |
"""Provide configuration end points for Groups."""
from homeassistant.components.group import DOMAIN, GROUP_SCHEMA
from homeassistant.config import GROUP_CONFIG_PATH
from homeassistant.const import SERVICE_RELOAD
import homeassistant.helpers.config_validation as cv
from . import EditKeyBasedConfigView
async def asyn... | {
"content_hash": "0ef1d90d06a93b7b640415b354591bcd",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 66,
"avg_line_length": 28.88888888888889,
"alnum_prop": 0.6615384615384615,
"repo_name": "leppa/home-assistant",
"id": "d95891af6556c16f6b44a398497a4872ea4878a3",
"size": "... |
import sys
sys.path.append('../../')
from proximal.utils.utils import *
from proximal.halide.halide import *
from proximal.lin_ops import *
import numpy as np
from scipy import signal
from scipy.misc import face
import matplotlib.pyplot as plt
############################################################
# Load imag... | {
"content_hash": "9e36a174ac2ef490fd0c0442a4692f4f",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 73,
"avg_line_length": 24.185185185185187,
"alnum_prop": 0.6232771822358346,
"repo_name": "comp-imaging/ProxImaL",
"id": "3bc9057a1fa240499f945dda4d883a7b57cb1e06",
"size":... |
import json, sublime, webbrowser
from ..completions import CompletionList
from ..inline_documentation import Documentation
from .. import utils
DOC_STYLES = {
"side_color": "#336B81",
"header_color": "#379AC1",
"header_bg_color": "#E1E1E1",
"text_color": "#585B31"
}
testbox = {"completions": {}, "documentation": ... | {
"content_hash": "98eb7ce975b0fd072fc6b27d3b9ea1e2",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 166,
"avg_line_length": 39.84033613445378,
"alnum_prop": 0.7144062434085636,
"repo_name": "jcberquist/SublimeText-Lucee",
"id": "ecc2e15a94f3164bfe24bdc1225692fd824ec4f1",
... |
from mldb import mldb, ResponseException
import unittest
class myTest(unittest.TestCase):
def test_sequence(self):
with self.assertRaisesRegex(ResponseException, "Executing builtin function exp: Can't convert value 'a' of type 'ASCII_STRING' to double") as re:
query = "SELECT exp('a')"
... | {
"content_hash": "0a8e6833c125f55d21895beca65dea7d",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 153,
"avg_line_length": 37.06666666666667,
"alnum_prop": 0.6762589928057554,
"repo_name": "mldbai/mldb",
"id": "415b70d378805e64b32a5e52c13a3977b36bc3dd",
"size": "636",
... |
from __future__ import print_function
import sys
import getopt
import pywintypes
from win32cred import *
ERROR_NOT_FOUND = 0x490
ERROR_NO_SUCH_LOGON_SESSION = 0x520
ERROR_INVALID_FLAGS = 0x3ec
CRED_TYPE_DOMAIN_EXTENDED = 0x6
CRED_ENUMERATE_ALL_CREDENTIALS = 0x1
Cre... | {
"content_hash": "a68437b3fc08ec44a994df8b143d9940",
"timestamp": "",
"source": "github",
"line_count": 234,
"max_line_length": 92,
"avg_line_length": 33.23076923076923,
"alnum_prop": 0.5299639917695473,
"repo_name": "grawity/hacks",
"id": "c0b08562b730ea41d11d078b187ace4317416a1c",
"size": "7837",... |
import json
import requests
from requests.auth import HTTPBasicAuth
from db import app
class apiApp:
def __init__(self,url,user,token):
self.url = url
self.user = user
self.token = token
self.response = None
self.appDB = app() # Objeto de tipo db, que nos ayudar... | {
"content_hash": "ff5905afbd2e2c6f63d8e3830093e909",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 115,
"avg_line_length": 32.833333333333336,
"alnum_prop": 0.5764241398759166,
"repo_name": "AnhellO/DAS_Sistemas",
"id": "e1b8ff53126ff81cfe55a3a33f2487f7f97f4bf2",
"size":... |
import pytest
from fixture.application import Application
fixture = None
@pytest.fixture(scope="session")
def app(request):
global fixture
if fixture is None:
fixture = Application()
fixture.session.login(username="admin", password="secret")
else:
if not fixture.is_valid():
... | {
"content_hash": "a6b4144d31d81abb9976d26b591702f7",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 70,
"avg_line_length": 24.26923076923077,
"alnum_prop": 0.6608557844690967,
"repo_name": "AndriiL/python_training",
"id": "8de36042ac71a00f6d6a7db80201ad0ea2555800",
"size"... |
from __future__ import unicode_literals
from simpbot import control
from hashlib import new
from . import capab
class admins(control.control):
def __init__(self, network, user, hash, algm, logins, maxlogins, ison, conf,
path, timeout, verbose, account):
super(admins, self).__init__('.'.join(['si... | {
"content_hash": "fb418e5e37bed2b8610616c57155ec12",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 80,
"avg_line_length": 31.414893617021278,
"alnum_prop": 0.5895699288858788,
"repo_name": "IsmaelRLG/simpbot",
"id": "0105558b52a200587fbb67cf96bafc1697a62e82",
"size": "30... |
""" Standard plug-in to make dill module work for compiled stuff.
"""
from nuitka.plugins.PluginBase import NuitkaPluginBase
class NuitkaPluginDillWorkarounds(NuitkaPluginBase):
"""This is to make dill module work with compiled methods."""
plugin_name = "dill-compat"
@staticmethod
def isAlwaysEnab... | {
"content_hash": "5fb4b99937fb393ad32f5703764bbea2",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 134,
"avg_line_length": 32.6,
"alnum_prop": 0.5932515337423313,
"repo_name": "kayhayen/Nuitka",
"id": "8e94e2d4daf24d697129bf1d1a4b2ea9f48b6fa0",
"size": "5670",
"binary... |
palavra = input('Digite uma palavra: ')
if palavra == palavra[::-1]:
print('A palavra "%s" é palindrome' % palavra) #palavra invertida igual
else:
print('A palavra "%s" nao e palindrome' % palavra)
| {
"content_hash": "26f514130a5b60e90d1266c78d70ae91",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 75,
"avg_line_length": 35.666666666666664,
"alnum_prop": 0.6401869158878505,
"repo_name": "kidchenko/playground",
"id": "be4204be804b36afc2b33723ccf5337c023f9ac1",
"size": "... |
'''
Test bundled filters
'''
import unittest, tempfile, shutil
from ansible import playbook, inventory, callbacks
INVENTORY = inventory.Inventory(['localhost'])
BOOK = '''
- hosts: localhost
vars:
var: { a: [1,2,3] }
tasks:
- template: src=%s dest=%s
'''
SRC = '''
-
{{ var|to_json }}
-
{{ var|to_nice_json... | {
"content_hash": "56d0f90da8e8b78f73aa112f5504ed82",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 97,
"avg_line_length": 18.270588235294117,
"alnum_prop": 0.5325177076625885,
"repo_name": "dlab-berkeley/collaboratool-archive",
"id": "4bd5b32fa8dcefe0a345080dfccc1ca211883a... |
"""Support for Apple HomeKit."""
import ipaddress
import logging
from zlib import adler32
import voluptuous as vol
from homeassistant.components import cover
from homeassistant.components.media_player import DEVICE_CLASS_TV
from homeassistant.const import (
ATTR_DEVICE_CLASS,
ATTR_ENTITY_ID,
ATTR_SUPPORTE... | {
"content_hash": "104be40a982774e80da91d3726be1857",
"timestamp": "",
"source": "github",
"line_count": 402,
"max_line_length": 88,
"avg_line_length": 30,
"alnum_prop": 0.5961028192371476,
"repo_name": "qedi-r/home-assistant",
"id": "bb525271cec3e77dc62eafc5c186ac67a650cd7c",
"size": "12060",
"bi... |
import sqlite3
import urllib
import re
from urllib.request import urlopen
from bs4 import BeautifulSoup
from phyllo.phyllo_logger import logger
# this works!
def getBooks(soup):
siteURL = 'http://www.thelatinlibrary.com'
textsURL = []
# get links to books in the collection
for a in soup.find_all('a', ... | {
"content_hash": "5be851e4e6ea0917f9ed3a5bcae7f664",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 115,
"avg_line_length": 40.97986577181208,
"alnum_prop": 0.43137897150343923,
"repo_name": "oudalab/phyllo",
"id": "ee2c75a4076da86e85de5b70478ecaf9da0caddf",
"size": "610... |
"""idx requests by status, completed
Revision ID: 7f4a3b8c55d
Revises: 4b96dd9974bb
Create Date: 2014-03-31 17:39:40.858182
"""
# revision identifiers, used by Alembic.
revision = '7f4a3b8c55d'
down_revision = '4b96dd9974bb'
from alembic import op
def upgrade():
op.create_index('idx_status_complete', 'request... | {
"content_hash": "5915099df62e1600836f5e23d264b401",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 89,
"avg_line_length": 20.523809523809526,
"alnum_prop": 0.7215777262180975,
"repo_name": "holmes-app/holmes-api",
"id": "8dba792a09be4e60c427faccb75b0363a19b447f",
"size":... |
from __future__ import absolute_import, unicode_literals
import datetime
from django.conf import settings
from django.test.signals import setting_changed
from rest_framework.settings import APISettings
USER_SETTINGS = getattr(settings, "REST_FRAMEWORK_SSO", None)
DEFAULTS = {
"CREATE_SESSION_PAYLOAD": "rest_fr... | {
"content_hash": "37820b7b136c097473d0fbd9adade7ee",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 92,
"avg_line_length": 31.75438596491228,
"alnum_prop": 0.7027624309392265,
"repo_name": "namespace-ee/django-rest-framework-sso",
"id": "6c3710eca70397e9a93611600e0ac0724f1d... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from collections import namedtuple
from pants.backend.jvm.subsystems.jvm_tool_mixin import JvmToolMixin
from pants.backend.jvm.subsystems.zinc_language_mixin import Z... | {
"content_hash": "b6538acc75adb1dff87ecc75692a68e3",
"timestamp": "",
"source": "github",
"line_count": 197,
"max_line_length": 100,
"avg_line_length": 42.055837563451774,
"alnum_prop": 0.6484007242003621,
"repo_name": "peiyuwang/pants",
"id": "b4103d9ba34e25c43bc2b3a2e3c57e0bc332bdee",
"size": "84... |
from django import forms
class SupportForm(forms.Form):
def __init__(self, user, *args, **kwargs):
self.user = user
super(SupportForm, self).__init__(*args, **kwargs)
email = forms.EmailField(
widget=forms.TextInput(attrs={'placeholder': 'Required'}),
required=False)
subj... | {
"content_hash": "3fa0236996a356221f10a358af69729e",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 67,
"avg_line_length": 30.766666666666666,
"alnum_prop": 0.6273022751895991,
"repo_name": "chop-dbhi/varify",
"id": "a3e86665a36af91e25796f06c08f47a51fdc640d",
"size": "923... |
"""
.. module:: pytfa
:platform: Unix, Windows
:synopsis: Thermodynamics-based Flux Analysis
.. moduleauthor:: pyTFA team
JSON serialization
"""
import json
import numpy
from .dict import model_from_dict, model_to_dict
class MyEncoder(json.JSONEncoder):
"""
We define an encoder t... | {
"content_hash": "a02d217174f01b92f988854f8089e215",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 77,
"avg_line_length": 21.443037974683545,
"alnum_prop": 0.6038961038961039,
"repo_name": "EPFL-LCSB/pytfa",
"id": "d863ba67cc492687ec1a384bbceb0e515df35bed",
"size": "1719... |
from hashlib import md5
import time
#from sys import stdout
start = time.time()
def part1():
global start
word = 'ffykfhsq'
intdex = 0
password = ""
# While we have not found our 8 length password
while len(password) is not 8:
# Encode our word plus our index and output hexadecimal rep... | {
"content_hash": "e25eb1c255ec14428408fbceaaf69a5b",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 130,
"avg_line_length": 35.11538461538461,
"alnum_prop": 0.572289156626506,
"repo_name": "ChbShoot/advent-of-code",
"id": "d164023b17a36ad4c5945c7278302052cdfcbbaf",
"size"... |
import sys
import os
import random
import getpass
import subprocess
REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
REPO_NAME = os.path.basename(REPO_ROOT)
def _replace_in_file(prj_root, file_name, dict):
fpath = prj_root+"/"+file_name
with open(fpath) as f:
s = f.read()
fo... | {
"content_hash": "5f4f09f8426a8d1fb5624b4d5c142e8c",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 152,
"avg_line_length": 47.188235294117646,
"alnum_prop": 0.5991024682124159,
"repo_name": "b-dev/b-light-base-project",
"id": "f39dee8369760552ba7c7bdc040a5b2c0afcf291",
"... |
"""
Sensor for checking the status of Hue sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.hue/
"""
import asyncio
import async_timeout
import logging
import threading
from datetime import timedelta
from homeassistant.components.sensor imp... | {
"content_hash": "c0b49422963501c4545efbf4f1ea14ac",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 87,
"avg_line_length": 29.07421875,
"alnum_prop": 0.5641542388821712,
"repo_name": "shire210/Shire-HA",
"id": "3f369fddac93fbd89e2691efca81ba76b9cba033",
"size": "7443",
... |
"""
Copyright 2015 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... | {
"content_hash": "532dbd23c3a7255fa2318faf1c8cf1a5",
"timestamp": "",
"source": "github",
"line_count": 462,
"max_line_length": 541,
"avg_line_length": 39.85497835497836,
"alnum_prop": 0.6440558301200239,
"repo_name": "danielfrg/jupyterhub-kubernetes_spawner",
"id": "7e19de8117f26369e5306b0f5ab04fa27... |
"""Python binding of SPI wrapper of LetMeCreate library."""
import ctypes
_LIB = ctypes.CDLL('libletmecreate_core.so')
# SPI_SPEED
SPI_680K = 680000
SPI_1M36 = 1360000
SPI_2M73 = 2730000
SPI_5M46 = 5460000
SPI_10M93 = 10930000
SPI_21M87 = 21870000
SPI_43M75 = 43750000
def init():
"""Initialise SPI on all mikro... | {
"content_hash": "c182c72e4b8f9c9e7091320be67e2e9b",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 82,
"avg_line_length": 27.3781512605042,
"alnum_prop": 0.6626764886433395,
"repo_name": "francois-berder/PyLetMeCreate",
"id": "decd39fbe4e08f9574f520b96ef6ee999c956491",
... |
"""Test for Nest events for the Smart Device Management API.
These tests fake out the subscriber/devicemanager, and are not using a real
pubsub subscriber.
"""
import datetime
from google_nest_sdm.device import Device
from google_nest_sdm.event import EventMessage
from homeassistant.helpers import device_registry a... | {
"content_hash": "76138f4593d9f597503c17ebcdbd3529",
"timestamp": "",
"source": "github",
"line_count": 448,
"max_line_length": 87,
"avg_line_length": 31.408482142857142,
"alnum_prop": 0.5967592921611826,
"repo_name": "home-assistant/home-assistant",
"id": "4a6259991554eab6ab28f6e0d95860f1a5c1524d",
... |
import sys
sys.path.append('/ebio/ag-neher/share/users/rneher/FluPrediction_code/flu/src')
sys.path.append('../../src')
import test_flu_prediction as test_flu
import predict_flu as flu
import tree_utils
import numpy as np
from scipy import stats
import glob,pickle,gzip,os,argparse
from datetime import date
analysis_fo... | {
"content_hash": "b3eb2a289adf054a1762eb019e111fe9",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 136,
"avg_line_length": 43.86666666666667,
"alnum_prop": 0.6957446808510638,
"repo_name": "rneher/FitnessInference",
"id": "93d72ed0f187216af9b0aa9f2214f4e7a304e1d6",
"size... |
import sys
import zmq
import time
import pickle
import signal
import numpy as np
def xsrc(port):
context = zmq.Context()
socket = context.socket(zmq.PUB)
socket.connect('tcp://localhost:{}'.format(port))
print(socket)
i = 0
while True:
name = b'foo'
body = i
print((nam... | {
"content_hash": "aaf4e787952d8516eeddcebc9f1a5bdf",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 57,
"avg_line_length": 18,
"alnum_prop": 0.5729166666666666,
"repo_name": "rxa254/MoodCube",
"id": "77bd0f85c3db3d3fd54916401ea9d65fa6d79f75",
"size": "600",
"binary": fa... |
"""TF: Tensorflow frontend."""
from __future__ import absolute_import as _abs
from __future__ import print_function
import logging
import warnings
from collections import defaultdict
# Numpy support
import numpy as np
import tvm
from topi.util import get_const_tuple
from .. import analysis
from .. import transform as... | {
"content_hash": "3ec570b201f151088f040653b273fb36",
"timestamp": "",
"source": "github",
"line_count": 2407,
"max_line_length": 99,
"avg_line_length": 39.498130452845864,
"alnum_prop": 0.5209104678559408,
"repo_name": "mlperf/training_results_v0.7",
"id": "6fff40a922940ad6cdd0c4e8f8746689e94bb5e7",
... |
from .node import Node
class Numeral(Node):
'''
For \arabic{chapter} etc
'''
def __init__(self):
Node.__init__(self)
def chars(self, nobrackets=False, **kwargs):
s = []
for child in self.children:
s.append(child.chars())
if nobrackets:
ret... | {
"content_hash": "80a321e060d5a6d1c813133ed620a321",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 48,
"avg_line_length": 19.75,
"alnum_prop": 0.4936708860759494,
"repo_name": "dimbyd/latextree",
"id": "08b1dca33ec5c0ce0bfe4861f666085c99fbe003",
"size": "409",
"binary"... |
from distutils.core import setup
from txbert import __version__ as version
setup(
name = 'txbert',
version = version,
description = 'Twisted BERT-RPC Library',
author = 'Jonathan Stoppani',
author_email = '[email protected]',
url = 'http://garetjax.info',
packages = ['txbert'],
... | {
"content_hash": "489b469a511c439ba9019b055404386b",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 71,
"avg_line_length": 28.5,
"alnum_prop": 0.6263157894736842,
"repo_name": "GaretJax/txBERT-RPC",
"id": "e7affe2e7ddbaf1be5f5711626891329ee82e953",
"size": "593",
"binar... |
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.viewcode',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix ... | {
"content_hash": "d1d84db09a71b09742b8d77b8e6b0a59",
"timestamp": "",
"source": "github",
"line_count": 315,
"max_line_length": 80,
"avg_line_length": 28.193650793650793,
"alnum_prop": 0.6895619862628083,
"repo_name": "lordmauve/chopsticks",
"id": "21c2b537d5ab761e0b72455f950e3090918bbaba",
"size":... |
import numpy as np
def predict(features, weights):
return np.dot(features ,weights)
def Ridge_Regression_gradient_descent(features, output, initial_weights, step_size, l2_penalty, tolerance, max_iterations=100):
converged = False
weights = np.array(initial_weights)
weights_scaler = np.ones(len(weigh... | {
"content_hash": "5bbc5da2563808b094456ee8800eb629",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 127,
"avg_line_length": 33.8936170212766,
"alnum_prop": 0.6559949780288763,
"repo_name": "nonlining/SimpleML",
"id": "9162d52a1b683a5de954efcb0554d92e5faa07af",
"size": "19... |
import time
import random
import sys
from urllib import FancyURLopener
from jinja2 import Environment, PackageLoader
from bs4 import BeautifulSoup
# Fancy User-Agent string
class MyOpener(FancyURLopener):
version = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safar... | {
"content_hash": "96ebfd511849cecfa48fbb4d0d010c85",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 139,
"avg_line_length": 36.535714285714285,
"alnum_prop": 0.6663408276311502,
"repo_name": "vince-stark/grab-zakupki-gov",
"id": "b2aaccf45db7ad9728ed6b0e0ae2c217be0c23bf",
... |
from setuptools import setup, find_packages
VERSION = '0'
long_description = ''
setup(name='banzai',
py_modules=['banzai'],
version=VERSION,
packages=find_packages(exclude="tests"),
author='Thom Neale',
author_email='[email protected]',
license='BSD',
url='http://github.co... | {
"content_hash": "f1e48a795cd167f6bb8ceb92d223eeec",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 79,
"avg_line_length": 24.4,
"alnum_prop": 0.6536885245901639,
"repo_name": "twneale/banzai",
"id": "a5c3c1527c013f3295859ca5eba6ac08904dc8c7",
"size": "510",
"binary": f... |
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from board.models import UserProfile
def create_user_profile(sender, instance, created, **kwargs):
if created and not UserProfile.objects.filter(user=instance).exists():
print "USER CREATED"
UserProfile.obje... | {
"content_hash": "54bf84de15fa78e20a0e05c7fa552632",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 87,
"avg_line_length": 39.54545454545455,
"alnum_prop": 0.767816091954023,
"repo_name": "cypreess/PyrateDice",
"id": "f45748afaeab339dfce123e4ec95195251965340",
"size": "43... |
"""
regobj: Pythonic object-based access to the Windows Registry
This module provides a thin wrapper around the standard _winreg module,
allowing easier and more pythonic access to the Windows Registry.
All access to the registry is done through Key objects, which (surprise!)
represent a specific registry key. T... | {
"content_hash": "3b1311ab6ef45a0d4a6f92feccee0f47",
"timestamp": "",
"source": "github",
"line_count": 584,
"max_line_length": 93,
"avg_line_length": 33.138698630136986,
"alnum_prop": 0.6156668216813931,
"repo_name": "EhsanKia/keypirinha-plugins",
"id": "6fe12a5b3b7ca60d64708d664e4febb99cab1af4",
... |
from JumpScale import j
import lzma
import JumpScale.baselib.gitlab
class ChangeTrackerClient():
def __init__(self, MDPath,namespace="backup"):
self.errors=[]
self.excludes=["*.pyc"]
self.MDPath = MDPath
if cachePath=="":
cachePath="/opt/backup/CACHE"
self.... | {
"content_hash": "8bcbe72a2fb6c4b05dd9b7041fe29f63",
"timestamp": "",
"source": "github",
"line_count": 592,
"max_line_length": 218,
"avg_line_length": 37.932432432432435,
"alnum_prop": 0.5620769504809405,
"repo_name": "Jumpscale/jumpscale6_core",
"id": "b06c58c34bbd9f50880fddf530404e222e826f0a",
"... |
u"""
Warn about features that are not present in Python 2.5, giving a message that
points to the earliest version of Python 2.x (or 3.x, if none) that supports it
"""
from .feature_base import Feature, Features
from lib2to3 import fixer_base
FEATURES = [
#(FeatureName,
# FeaturePattern,
# FeatureMinVer... | {
"content_hash": "56cca2c32591abbf40f704df472992a5",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 89,
"avg_line_length": 30.804597701149426,
"alnum_prop": 0.533955223880597,
"repo_name": "jrialland/python-brain",
"id": "b8e98c9b8663942aa31cfcd0a7aebd1ef92805bd",
"size":... |
import json
import logging
import sys
import click
from click import Context
from click.testing import CliRunner
import pytest
import rasterio
from rasterio.rio import info
from rasterio.rio.main import main_group
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
def test_edit_nodata_err(data):
runn... | {
"content_hash": "042174d6661689a8e02ea26613c88683",
"timestamp": "",
"source": "github",
"line_count": 659,
"max_line_length": 80,
"avg_line_length": 27.22610015174507,
"alnum_prop": 0.5889532939471631,
"repo_name": "perrygeo/rasterio",
"id": "eb4e1f3cef2a5b11e43becc1923f0127d70fba0b",
"size": "17... |
from PyQt5.QtCore import Qt, QEvent, QPoint, QPointF, QTimer
from PyQt5.QtGui import QMouseEvent, QKeyEvent
from PyQt5.QtTest import QTest
from cntestcase import CNTestApp
from cadnano import initAppWithGui
class GUITestApp(CNTestApp):
def __init__(self):
argv = None
self.app = initAppWithGui(arg... | {
"content_hash": "9a6ea957904dd3b0ba61b52bd1185978",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 88,
"avg_line_length": 31.169082125603865,
"alnum_prop": 0.5361128332300062,
"repo_name": "scholer/cadnano2.5",
"id": "dda71bb598a0db08417f15c1f1a692d678a700fd",
"size": "... |
import re
import os
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, HtmlResponse
from scrapy.utils.url import urljoin_rfc
from scrapy.utils.response import get_base_url
import csv, codecs, cStringIO
from product_spiders.items import Product, Product... | {
"content_hash": "9a268737fe9301e00183967785f7f245",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 113,
"avg_line_length": 41.76190476190476,
"alnum_prop": 0.6077537058152793,
"repo_name": "ddy88958620/lib",
"id": "3a73390251d6b3fc9f31a67f185a35c8f03fe794",
"size": "2631... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='FileStorage',
fields=[
... | {
"content_hash": "00ac3fe23774c4a9fad3f32d9e798231",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 114,
"avg_line_length": 32.42857142857143,
"alnum_prop": 0.552863436123348,
"repo_name": "kaleissin/django-multipageforms",
"id": "c985d64b3aec9e1f4a94666ac272111ecd5640ff",
... |
from django import forms
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
class GoogleMapsWidget(forms.HiddenInput):
"""
Widget for Google Maps object to be displayed
inline in a form
"""
def render(self, name, value,country=None, attrs=None, c... | {
"content_hash": "d22aee4ef5ace844ff6a91d0e691ab08",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 160,
"avg_line_length": 47.970588235294116,
"alnum_prop": 0.4613733905579399,
"repo_name": "mercycorps/TolaActivity",
"id": "cb391f3c44a73105a49322628f8747a54a62245d",
"si... |
import xbmcgui
import sys
class SyncProgressBarBG(object):
"class to handle the background progressbar"
_pDialog = None
_addon_name = None
def __init__(self, heading):
"create the DialogProgressBG "
self.language = sys.modules["__main__"].language
self._addon_name = heading
... | {
"content_hash": "1c94d111411ed493f3844fd14fa41e85",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 184,
"avg_line_length": 29.952380952380953,
"alnum_prop": 0.6399046104928457,
"repo_name": "Panfloss/xbmc-script-ftpretriever",
"id": "89046f9be4cd8f715667c80deebcfd2b03b95a6... |
import sys
from optparse import OptionParser
import importlib
if __name__ == '__main__':
_version = '0.1'
parser = OptionParser(
usage="%prog [options] result.json output_file",
version=_version
)
parser.add_option("-f", "--format", choices=['html', 'pdf'])
(options, args) = parser... | {
"content_hash": "d956e4f8a63baf6c8a583f92af302c1c",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 103,
"avg_line_length": 28.956521739130434,
"alnum_prop": 0.5818318318318318,
"repo_name": "vdjagilev/desefu-export",
"id": "db08a2215c89508e7a2a33845c241eb4f6fe254a",
"siz... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('menu', '0002_auto_20161217_1726'),
]
operations = [
migrations.AlterModelOptions(
name='element',
options={'ordering': ['pos... | {
"content_hash": "3c0c6ed545224fe64dba3c62a98002a8",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 109,
"avg_line_length": 26.90909090909091,
"alnum_prop": 0.589527027027027,
"repo_name": "watchdogpolska/watchdog-kj-kultura",
"id": "13b46d53ba2d99dba7272d2e1014a3b0b6b41eb6... |
from __future__ import unicode_literals
from __future__ import print_function
from . import pathlib
PREDEFINED_VARIABLE_TABLE = {
'HOME': pathlib.HomePath()(),
'MYDOC': pathlib.MyDocumentPath()(),
}
| {
"content_hash": "c58ad95cb1399af5912099e38840a472",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 40,
"avg_line_length": 23.22222222222222,
"alnum_prop": 0.69377990430622,
"repo_name": "if1live/easylinker",
"id": "cb0f496cbd9b184d438e75a65ba325035903a019",
"size": "233",... |
"""
Usage:
watch_psutil.py [options]
Options:
--delay <int> Seconds delay inbetween loop runs [default: 4]
--loop Loop the execution infinitely
--carbon-host <str> Host to send carbon stats to [default: carbon.service.consul]
Generic Options:
--loglevel, -L=<str> ... | {
"content_hash": "f6ed7e04900e8165e42188a6b4d46a21",
"timestamp": "",
"source": "github",
"line_count": 300,
"max_line_length": 99,
"avg_line_length": 32.026666666666664,
"alnum_prop": 0.48844712739383844,
"repo_name": "ChristianKniep/docker-terminal",
"id": "bc2e64cb477470d044a66936a6da4c36f12c326e"... |
from nougat import Nougat
app = Nougat()
async def middleware(response):
response.content = 'Hello world'
app.use(middleware)
app.manager.up()
| {
"content_hash": "a2a754f75798d42bf6cb869e13e01bb0",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 36,
"avg_line_length": 11.846153846153847,
"alnum_prop": 0.7142857142857143,
"repo_name": "Kilerd/nougat",
"id": "b11f400e59b53b73bdad045ca5089a01a47a3906",
"size": "154",
... |
import logging
from apps.atencion.forms.ConsultaForm import ConsultaForm
from apps.atencion.forms.DetalleRecetaForm import DetalleRecetaForm
from apps.atencion.forms.TratamientoForm import TratamientoForm
from apps.atencion.models import Consulta, AntecedenteMedico, DiagnosticoConsulta, Tratamiento, DetalleReceta
log... | {
"content_hash": "ffc94da2d7674ec957d11358cad8c02a",
"timestamp": "",
"source": "github",
"line_count": 1427,
"max_line_length": 121,
"avg_line_length": 34.73791170287316,
"alnum_prop": 0.6069879566682133,
"repo_name": "upeu-jul-20161-epis-ads2/MedicFast",
"id": "5fa7776e304499a8961fb1bd5e5502a1de6dd... |
from scrapy import signals
class CrawrcourseSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# scrapy acts as if the spider middleware does not modify the
# passed objects.
@classmethod
def from_crawler(cls, crawler):
# This method is used by Scr... | {
"content_hash": "32113b20bcdb50e60cb585002dee04af",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 78,
"avg_line_length": 35.48979591836735,
"alnum_prop": 0.6595744680851063,
"repo_name": "qrsforever/workspace",
"id": "519c05e4ad34b65c57a028d2f1759afa2ab279f9",
"size": "... |
import os
import sys
if __name__ == "__main__":
# CHANGED manage.py will use development settings by
# default. Change the DJANGO_SETTINGS_MODULE environment variable
# for using the environment specific settings file.
# os.environ.setdefault("DJANGO_SETTINGS_MODULE", "wishlister.settings.development")... | {
"content_hash": "e6310216e416d8068d2f89113cd70461",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 88,
"avg_line_length": 35.666666666666664,
"alnum_prop": 0.7383177570093458,
"repo_name": "DustinHolden/wishlister",
"id": "6a4836cf49f2a400cabc76ed9a25f680495e5a4d",
"size... |
from tempest.api.identity import base
from tempest.lib.common.utils import data_utils
from tempest.lib import decorators
from tempest.lib import exceptions as lib_exc
class ServicesTestJSON(base.BaseIdentityV3AdminTest):
"""Test keystone services"""
def _del_service(self, service_id):
# Used for dele... | {
"content_hash": "8aa51518ce0daefe1c1b74a37b21b064",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 79,
"avg_line_length": 45.86363636363637,
"alnum_prop": 0.6479187314172448,
"repo_name": "cisco-openstack/tempest",
"id": "a649d2757021ee5df2b1983d8ea6920398103d1f",
"size"... |
import sys
import pytest
from fs import open_fs
from organize.filters import MacOSTags
@pytest.mark.skipif(sys.platform != "darwin", reason="runs only on macOS")
def test_macos_filter():
import macos_tags
tags = MacOSTags("Invoice (red)", "* (green)")
with open_fs("temp://", writeable=True, create=True)... | {
"content_hash": "3c82f397880a0148a7488541191580c5",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 84,
"avg_line_length": 36.68421052631579,
"alnum_prop": 0.6456241032998565,
"repo_name": "tfeldmann/organize",
"id": "26c5197fab580d5ee029dd034b07372d6e1ad672",
"size": "13... |
import sublime
from sublime_plugin import WindowCommand
from ..tools import sampy_manager
class upiotSampyHelpCommand(WindowCommand):
def run(self):
sublime.set_timeout_async(sampy_manager.help, 0)
| {
"content_hash": "87afe7232c9135fd48e466b14bde1892",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 56,
"avg_line_length": 21.4,
"alnum_prop": 0.7663551401869159,
"repo_name": "gepd/uPiotMicroPythonTool",
"id": "c0556a81636e21390295f4379e557af886dbb369",
"size": "1389",
... |
from JumpScale import j
from JumpScale.portal.portal import exceptions
from JumpScale.servers.serverbase.Exceptions import RemoteException
import urllib.request
import urllib.parse
import urllib.error
import requests
class PortalRest():
def __init__(self, webserver):
self.ws = webserver
self.logg... | {
"content_hash": "0aa8c96d5f57dcd9156d3cae7b176490",
"timestamp": "",
"source": "github",
"line_count": 359,
"max_line_length": 140,
"avg_line_length": 42.250696378830085,
"alnum_prop": 0.522745253164557,
"repo_name": "Jumpscale/jumpscale_portal8",
"id": "4ec96e1d7bf48a85479caa4ae3219968c0d915f0",
... |
import sys
import json
import archive_api
argl = len(sys.argv)
if argl > 3:
print "null"
else:
query = archive_api.archive(sys.argv[1],sys.argv[2])
query = json.dumps(query)
print query | {
"content_hash": "e20a9fc99c7e4453272c3b3b556728e4",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 56,
"avg_line_length": 16.833333333333332,
"alnum_prop": 0.6732673267326733,
"repo_name": "alexjstubbs/ignition-dev",
"id": "0c361389dd344b99753c36d773e0b2752b121f1f",
"siz... |
import inspect
import os
import jinja2
import licenses
from class_definition import ClassDefinition, AttrDefinition, PackageDefinition, FunctionDefinition
from mcfw.consts import MISSING
from mcfw.properties import simple_types, get_members, object_factory
from .custom import filters, csharp_filters, java_filters, ob... | {
"content_hash": "17e88f89ddff39fb355c1e62aeed4071",
"timestamp": "",
"source": "github",
"line_count": 212,
"max_line_length": 127,
"avg_line_length": 34.990566037735846,
"alnum_prop": 0.6528713939067134,
"repo_name": "rogerthat-platform/rogerthat-backend",
"id": "8b05c3e69a031cae8f2703cb3b8aa2f8682... |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Entity'
db.create_table(u'bazar_entity', (
(u'id', self.gf('django.db... | {
"content_hash": "77834c33cd5d6c0fef02eb3db0705de9",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 187,
"avg_line_length": 67.82352941176471,
"alnum_prop": 0.5608970387808202,
"repo_name": "emencia/emencia-django-bazar",
"id": "70311f36ad9ee3855a7995eed62cc700d2720f90",
... |
note1 = float(input('primeira nota'))
note2 = float(input('segunda nota'))
average = (note1*2 + note2*3) / 5
print(average)
| {
"content_hash": "2f511e4e9d70ddc3b6e1e2bad79b7e13",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 37,
"avg_line_length": 26,
"alnum_prop": 0.6538461538461539,
"repo_name": "jucimarjr/IPC_2017-1",
"id": "7c6ce1f995faf902700a5d9eacfc62c9e757358b",
"size": "864",
"binary"... |
""" 1d array of prediction values with properties (labels, reference to the predictor)
"""
import numpy
from pySPACE.resources.data_types import base
class PredictionVector(base.BaseData):
""" Represents a prediction vector
It contains a label, a prediction and a reference to the predictor.
I doesn... | {
"content_hash": "efa7757d00fd6b736043ee7c3bd3274c",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 93,
"avg_line_length": 42.58918918918919,
"alnum_prop": 0.6062952151288235,
"repo_name": "pyspace/pyspace",
"id": "814fc48a425306f4ad27028e9ef96893a4c09a89",
"size": "7879... |
"""A filled polygon component"""
# Major package imports.
from numpy import array
# Enthought library imports.
from kiva.constants import EOF_FILL_STROKE, FILL, FILL_STROKE
from kiva.agg import points_in_polygon
from traits.api import Any, Event, Float, HasTraits, Instance, List, \
Prope... | {
"content_hash": "3bbdff9c8f4a2f0fe6b9cc5f3086b6d9",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 85,
"avg_line_length": 33.45959595959596,
"alnum_prop": 0.4892075471698113,
"repo_name": "tommy-u/enable",
"id": "25bd10c88ff5357f5851cdef24e581d5435f24ce",
"size": "6625"... |
from datetime import datetime, timezone, tzinfo, timedelta
class TaipeiTimeZone(tzinfo):
offset = timedelta(hours=8)
def utcoffset(self, dt):
return self.offset
def tzname(self, dt):
return "台北標準時間"
def dst(self, dt):
return self.offset
def fromutc(self, dt):
dtoff =... | {
"content_hash": "17fcb2aa45d711392d6afcdd98b8d238",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 73,
"avg_line_length": 29.24,
"alnum_prop": 0.6032831737346102,
"repo_name": "leVirve/lol-uccu",
"id": "0a18e8b10de551f7e0b0a5fbbbd5c58998346645",
"size": "1486",
"binary... |
__all__ = ["DefaultPool", "InterruptiblePool", "JoblibPool"]
from .default import DefaultPool
from .interruptible import InterruptiblePool
from .jl import JoblibPool
| {
"content_hash": "6c31670e42a098eda729ed4ae7248e47",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 60,
"avg_line_length": 33.4,
"alnum_prop": 0.7844311377245509,
"repo_name": "jellis18/emcee3",
"id": "d6cce8f8bf1bdc625820c1077bca3bc2b836998d",
"size": "192",
"binary": f... |
"""
"""
import sympy
from Chapter2.themes.lisp_list_structured_data import car, cdr, lisp_list, nil
from Chapter2.themes.mapping_over_lists import map
def quote(symbols):
"""Python does not support symbolic data by design so we use sympy to
emulate the behaviour"""
if isinstance(symbols, str):
tr... | {
"content_hash": "26d20cf8bd4e048a2e941791ea286592",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 78,
"avg_line_length": 21.515151515151516,
"alnum_prop": 0.5232394366197183,
"repo_name": "aoyono/sicpy",
"id": "afc62aa9fe45d223465be96ee3334eaa8e22c5e9",
"size": "1444",
... |
"""
homeassistant.components.sensor.tellduslive
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Shows sensor values from Tellstick Net/Telstick Live.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.tellduslive/
"""
import logging
from datetime import ... | {
"content_hash": "05ca5ec287d41e2fc56397d7f2a8efc9",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 74,
"avg_line_length": 30.203007518796994,
"alnum_prop": 0.6333084391336818,
"repo_name": "nnic/home-assistant",
"id": "001d20ee79222e39966f8f33f48c1f9f1250ef7f",
"size": ... |
import roslib; roslib.load_manifest('ar_mapping_base')
import rospy
from geometry_msgs.msg import PointStamped
import tf
from tf.transformations import euler_from_quaternion
import numpy
from ar_mapping_base.mapping_kf import *
from ar_track_alvar_msgs.msg import AlvarMarkers
class RoverMapping:
def __init__(s... | {
"content_hash": "5175606fa9f034327f1262704d2ff398",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 122,
"avg_line_length": 38.0655737704918,
"alnum_prop": 0.6270456503014643,
"repo_name": "cedricpradalier/vrep_ros_ws",
"id": "4228ad0b3a7bb88d4ccb7b34d507c9d1e87defc5",
"s... |
"""!
The main file with the class definitions
Core
==============
This file contains all of the classes for the module.
"""
from contextlib import contextmanager
import os.path as p
import re
from six import string_types
from builtins import int
import numpy as np
from scipy.io import FortranFile
from dask import... | {
"content_hash": "8eb41eedadca797c85825a53c0e9214d",
"timestamp": "",
"source": "github",
"line_count": 467,
"max_line_length": 173,
"avg_line_length": 34.942184154175585,
"alnum_prop": 0.597867385709033,
"repo_name": "edoddridge/aronnax",
"id": "1d017dfa0a288b320b732a5d3f01fd35780990a8",
"size": "... |
"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource i... | {
"content_hash": "a37ee299eeeb75d5fb60de55cb47f104",
"timestamp": "",
"source": "github",
"line_count": 646,
"max_line_length": 94,
"avg_line_length": 30.758513931888544,
"alnum_prop": 0.5873678912934072,
"repo_name": "angadpc/Alexa-Project-",
"id": "bea1201b3fa10d3e3e68e0f630aca8d0b8fea853",
"size... |
from Bot import Bot
from State import Move, State
import random
class RandomBot(Bot):
def __init__(self, name):
self.name = name
def get_name(self):
return self.name
def move(self, state, symbol):
while True:
x,y = random.randint(0, 8),random.randint(0, 8)
... | {
"content_hash": "253421709242312b5bb949784143c92f",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 102,
"avg_line_length": 25.444444444444443,
"alnum_prop": 0.5698689956331878,
"repo_name": "m3rik/nn",
"id": "7b6175da34c0765081e45df943d43b8971177c54",
"size": "458",
"b... |
import numpy as np
import cv2
from .trans_tform import trans_tform
from .uvMat_from_uvMap import uvMat_from_uvMap
from .check_valid_uv import check_valid_uv
from .prep_source_patch import prep_source_patch
from .patch_cost import patch_cost
from .update_uvMap import update_uvMap
from .src_domain_tform import src_domai... | {
"content_hash": "6045dd8e88a35388963a85cb10b9c930",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 113,
"avg_line_length": 40.231884057971016,
"alnum_prop": 0.6101104707012488,
"repo_name": "takahiromorita/heroku-python-flask5",
"id": "37f4191b541f15fd44c1424df244981cfa53... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import with_statement
from ..base import ServerFrame
class Connected(ServerFrame):
# pylint: disable=no-init
abstract = True
class Connected10... | {
"content_hash": "a616e954afab9f0c3b61ee46c2ad13e3",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 39,
"avg_line_length": 21.233333333333334,
"alnum_prop": 0.6907378335949764,
"repo_name": "skippyprime/stimpi",
"id": "a6d48706bfa206b65c5081f40ebef67a3c4785de",
"size": "1... |
from supriya.tools.ugentools.PureUGen import PureUGen
class Filter(PureUGen):
r'''Abstract base class for filter ugens.
'''
### CLASS VARIABLES ###
__documentation_section__ = 'Filter UGens'
__slots__ = ()
### PRIVATE METHODS ###
def _validate_inputs(self):
self._check_rate_sa... | {
"content_hash": "14275386b8745028e254b271fcc321aa",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 53,
"avg_line_length": 20.235294117647058,
"alnum_prop": 0.627906976744186,
"repo_name": "andrewyoung1991/supriya",
"id": "54b44a592106fc55ef939b122b031f77ed2e0260",
"size"... |
"""add post
Revision ID: f661af5e4d2a
Revises: 49c5959628c4
Create Date: 2017-07-01 11:14:18.714676
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f661af5e4d2a'
down_revision = '49c5959628c4'
branch_labels = None
depends_on = None
def upgrade():
# ### c... | {
"content_hash": "b9e7542b1decad5a6c681358cbdb91af",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 85,
"avg_line_length": 28.45945945945946,
"alnum_prop": 0.6628679962013295,
"repo_name": "keer2345/flasky",
"id": "f72d53d9337d5a2321f3d4fc6c781e88052de61f",
"size": "1053"... |
import argparse
import sys
import logging
import os
import gzip
import subprocess
DEBUG=False
NotDEBUG=not DEBUG
parser = argparse.ArgumentParser(description="Combine gCNV from GATK4 cohort pipeline",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_arg... | {
"content_hash": "1f7cb87935997d875bee150a175107dc",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 203,
"avg_line_length": 38.576470588235296,
"alnum_prop": 0.6001829826166514,
"repo_name": "shengqh/ngsperl",
"id": "4d3b057ff87ced704765eb219b0bff0566cd284f",
"size": "65... |
import pathlib
import re
from typing import Any, BinaryIO, cast, Dict, List, Optional, Tuple, Union
import numpy as np
from torchdata.datapipes.iter import Demultiplexer, Filter, IterDataPipe, IterKeyZipper, LineReader, Mapper
from torchvision.prototype.datasets.utils import Dataset, EncodedImage, HttpResource, Online... | {
"content_hash": "a067ce9aaafa77dcf9524cd6816d6cc1",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 118,
"avg_line_length": 34.644171779141104,
"alnum_prop": 0.570391358243315,
"repo_name": "pytorch/vision",
"id": "01dd1d888f5bcb7acb3c717e940d6e8b192fd0f4",
"size": "5647... |
import random
from collections import defaultdict
from giant.giant_base.giant_base import GiantError
def raise_(ex):
raise ex
swagger_to_csharp_enum_example_map = {
'string': defaultdict(lambda: lambda enum: '"' + random.choice(enum) + '";',
{
'guid': lambda enum: 'new Guid(' + random.choi... | {
"content_hash": "1de3c086db23af4642736103c5b75902",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 133,
"avg_line_length": 41.140845070422536,
"alnum_prop": 0.5809654228004109,
"repo_name": "lixar/giant",
"id": "a657d3e0eb2647f88f53c91cb00f82cb8f4e7c5b",
"size": "2944",
... |
"""empty message
Revision ID: f6eab383c7de
Revises: None
Create Date: 2016-07-22 11:01:28.783123
"""
# revision identifiers, used by Alembic.
revision = 'f6eab383c7de'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###... | {
"content_hash": "5319e280168c614df3348c3e102bc148",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 63,
"avg_line_length": 31.854545454545455,
"alnum_prop": 0.6478310502283106,
"repo_name": "leonardowolf/bookfree",
"id": "819fe017a56431f82b495f3ddf7ca385e6bfda37",
"size":... |
from contextlib import contextmanager
import logging
from robot.utils import get_error_details, safe_str
from . import librarylogger
LEVELS = {'TRACE': logging.NOTSET,
'DEBUG': logging.DEBUG,
'INFO': logging.INFO,
'WARN': logging.WARNING,
'ERROR': logging.ERROR}
@contextman... | {
"content_hash": "7542200459252a46c2f70a91a0d1d787",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 75,
"avg_line_length": 27.863013698630137,
"alnum_prop": 0.6170108161258604,
"repo_name": "HelioGuilherme66/robotframework",
"id": "fdccb16329dd920a1dfd74058a9d4edecbf5761d",... |
"""
GOOGLE PLUS APP
This module describes the GooglePlusUser model.
Classes:
GooglePlusUser
Functions:
n/a
Created on 08 Nov 2013
@author: michael
"""
from django.conf import settings
from django.db import models
class GooglePlusUser(models.Model):
"""Returns the GooglePlusUser fields."""
user ... | {
"content_hash": "a0258dc379afecebdcecce7e26eb10eb",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 79,
"avg_line_length": 27.543478260869566,
"alnum_prop": 0.665351223362273,
"repo_name": "unomena/tunobase",
"id": "be614c2985ced64e19be5ca91bb458a3d356116a",
"size": "1267... |
import os
import logging
import hiplogging
# Set up a standard logger
logger = logging.getLogger('hipchat')
logger.setLevel(logging.DEBUG)
# Add the standard logging to stderr
logger.addHandler(logging.StreamHandler())
# Add the hipchat handler
# Get an access token from: https://<YOUR_HIPCHAT_NAME>.hipchat.com/admin... | {
"content_hash": "fcac0e361208d1c348ade804bdfc6e96",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 79,
"avg_line_length": 41.03125,
"alnum_prop": 0.7281035795887281,
"repo_name": "invernizzi/hiplogging",
"id": "2d34ee2e15e3eee9d18071a020618d7447247252",
"size": "1313",
... |
class BasePermission(object):
def has_permission(self, user, action, pk):
pass
class AllowAny(BasePermission):
def has_permission(self, user, action, pk):
return True
class IsAuthenticated(BasePermission):
def has_permission(self, user, action, pk):
return user.pk and user.is_... | {
"content_hash": "ff3e9a28ac6e021a120d46bd2962c41e",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 48,
"avg_line_length": 20.875,
"alnum_prop": 0.688622754491018,
"repo_name": "linuxlewis/channels-api",
"id": "19904665cad9566d0afcf447e7b89f850993914b",
"size": "336",
"... |
import rospy
import actionlib
import sys
#move_base_msgs
from move_base_msgs.msg import *
def simple_move(x,w):
rospy.init_node('simple_move')
#Simple Action Client
sac = actionlib.SimpleActionClient('move_base', MoveBaseAction )
#create goal
goal = MoveBaseGoal()
#use self?
#set goal... | {
"content_hash": "19405c5598e95cba96242e6c8aec1a85",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 68,
"avg_line_length": 19.25925925925926,
"alnum_prop": 0.6442307692307693,
"repo_name": "Rayal/ROS_proov",
"id": "887d35f8e079dc59230cb791573c5edfc0f33897",
"size": "1063"... |
"""Test case and runner for :func:`aglyph._importable`."""
__author__ = "Matthew Zipay <[email protected]>"
import logging
import unittest
from aglyph import _importable, __version__
from test import assertRaisesWithMessage, dummy
__all__ = [
"ImportableTest",
"suite",
]
# don't use __name__ here; can ... | {
"content_hash": "33f0665965fcf979e772d042a2ccffc0",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 68,
"avg_line_length": 27.47457627118644,
"alnum_prop": 0.6952498457742134,
"repo_name": "mzipay/Aglyph",
"id": "479d8a284345cfdeff7902bde44323103d59dd90",
"size": "2763",
... |
import os
from time import time
from time import sleep
import datetime
from optparse import OptionParser
import pickle
from threading import Thread, Lock
import numpy as np
from scipy.misc import imresize
import led
#import keras
import keras.backend as K
import model_keras
import tensorflow as tf
try:
import c... | {
"content_hash": "88df2178e1e39274d42db4088ac30d3d",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 167,
"avg_line_length": 36.54883720930233,
"alnum_prop": 0.5754644947823874,
"repo_name": "Bleyddyn/malpi",
"id": "e709708e5cdd09bc899ea3e2e96490578184d496",
"size": "7858... |
""" namedtuple""" | {
"content_hash": "a7ee812ca3195c401dbbebf994906083",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 17,
"avg_line_length": 17,
"alnum_prop": 0.5882352941176471,
"repo_name": "Aneesh540/python-projects",
"id": "672bdafc2c2500dd0e99f43b937e03e1a208a570",
"size": "17",
"bin... |
from django.conf.urls import url
from django.contrib.admindocs import views
urlpatterns = [
url(r'^$',
views.BaseAdminDocsView.as_view(template_name='admin_doc/login.html'),
name='django-admindocs-docroot'),
url(r'^bookmarklets/$',
views.BookmarkletsView.as_view(),
name='django-... | {
"content_hash": "03f93d09e2fea53dd7aabbdb9ae6ee86",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 78,
"avg_line_length": 37.25,
"alnum_prop": 0.6124161073825504,
"repo_name": "scifiswapnil/Project-LoCatr",
"id": "bff0222df7ff2511dc9fc6a9c7fc8777ca821d56",
"size": "1192"... |
__author__ = 'ray'
__date__ = '4/10/15'
import re
import uuid
from collections import OrderedDict
import six
from stonemason.pyramid import Pyramid
from stonemason.formatbundle import MapType, TileFormat, FormatBundle
from stonemason.renderer import MasonRenderer
from stonemason.storage.tilestorage import NullCluste... | {
"content_hash": "2670ef62ecd991e0bc56801a3c39f734",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 88,
"avg_line_length": 32.30065359477124,
"alnum_prop": 0.6371914204775394,
"repo_name": "Kotaimen/stonemason",
"id": "086a8e5d39e3a8bc0a39bd38193670578ca0d5bc",
"size": "... |
"""Implements contact form forms"""
from __future__ import unicode_literals
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.conf import settings as django_settings
try:
import bleach
except ImportError:
raise 'django-cbv-contact-form application required bleach p... | {
"content_hash": "0dde418d291dcaeb9133e636c431d7b7",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 115,
"avg_line_length": 38.23776223776224,
"alnum_prop": 0.5312728602779809,
"repo_name": "joebos/django-cbv-contact-form",
"id": "f34d7b5b6edb53400f4cc2fc24d85efe4a5c3a7d",... |
import itertools
def minmax(data):
'Computes the minimum and maximum values in one-pass using only 1.5*len(data) comparisons'
it = iter(data)
try:
lo = hi = next(it)
except StopIteration:
raise ValueError('minmax() arg is an empty sequence')
for x, y in itertools.izip_longest(it, it... | {
"content_hash": "b5168c56d5a4331d6752df0a91536839",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 94,
"avg_line_length": 26.90909090909091,
"alnum_prop": 0.5523648648648649,
"repo_name": "ActiveState/code",
"id": "9da30a10c04bd576bcfcab637074e0a1269ad5cb",
"size": "592"... |
from KMCLib import *
import numpy
# Define the unit cell. We're going for hcp here, with c/a set for sphere-packing ratio for now.
cell_vectors = [[1.0,0.0,0.0],
[0.0,1.0,0.0],
[0.0,0.0,1.0]]
# I've set these up so that the Titaniums sit on the 1st and 3rd basis points, and the Oxygens... | {
"content_hash": "a82169ae870317042a286d1bcc0d8ff8",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 119,
"avg_line_length": 35.275,
"alnum_prop": 0.6293408929836996,
"repo_name": "joshuahellier/PhDStuff",
"id": "c5aa0251967d66a06e4e38545bae105286e68207",
"size": "1411",
... |
import time
import string
import hashlib
import binascii
import logging.handlers
import codecs
import os.path
import datetime
import random
import mimetypes
import re
import magic
from itertools import groupby
import tg
import pylons
import webob.multidict
from formencode import Invalid
from tg.decorators import befor... | {
"content_hash": "18c8a76131dd5c1f62cc6fc9c28eb906",
"timestamp": "",
"source": "github",
"line_count": 448,
"max_line_length": 93,
"avg_line_length": 34.533482142857146,
"alnum_prop": 0.5920754960894576,
"repo_name": "pombredanne/SourceForge-Allura",
"id": "38383c507b0b78c5ef82d64975185f1360d38065",... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.