text stringlengths 4 1.02M | meta dict |
|---|---|
from homie.main import *
| {
"content_hash": "8fc77d6f06b51d577e048e3eacdae05b",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 24,
"avg_line_length": 25,
"alnum_prop": 0.76,
"repo_name": "MrBramme/Mqtt-Hyperion-Remote",
"id": "a947c1f888a33acec482d58d5898078d5d98f7da",
"size": "47",
"binary": fals... |
import os
import pickle
import requests
import click
from git import Repo
API_AI_HEADERS = None
BASE_URL = 'https://api.api.ai/v1/'
DEV_KEY = None
DEV_TOKEN_ENV_NAME = 'API_AI_DEV_TOKEN'
API_AI_HISTORY_DIR = 'api_ai_history'
API_AI_REPO = '{}/{}'.format(os.getcwd(), API_AI_HISTORY_DIR)
@click.group()
def cli():
p... | {
"content_hash": "923323b6f1073fd4313086592aef4d0e",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 125,
"avg_line_length": 38.67977528089887,
"alnum_prop": 0.639360929557008,
"repo_name": "CamelCaseNotation/api-ai-git",
"id": "5ac30fa325a7cd55d5294892be1cced2dc78966f",
... |
import pytest, py, os
from _pytest.core import PluginManager
from _pytest.core import MultiCall, HookRelay, varnames
class TestBootstrapping:
def test_consider_env_fails_to_import(self, monkeypatch):
pluginmanager = PluginManager()
monkeypatch.setenv('PYTEST_PLUGINS', 'nonexisting', prepend=",")
... | {
"content_hash": "144fb7e2c0be203239d5a17f211827bb",
"timestamp": "",
"source": "github",
"line_count": 671,
"max_line_length": 85,
"avg_line_length": 32.80923994038748,
"alnum_prop": 0.560390642743584,
"repo_name": "lotaku/pytest-2.3.5",
"id": "0a18a8efc5e687f0743e2c8639bb14ddf140eafc",
"size": "2... |
"""
WSGI config for septimoarte project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... | {
"content_hash": "ab5e97053bfb24eab9aa15318d94a97b",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 24.9375,
"alnum_prop": 0.7744360902255639,
"repo_name": "malon/septimoarte",
"id": "c7e323b445068ca5ccc56c5390483e00682f9801",
"size": "399",
"bina... |
"""Pibooth utilities.
"""
import os
import sys
import time
import os.path as osp
import logging
import psutil
import functools
from fnmatch import fnmatchcase
import contextlib
import errno
import subprocess
try:
from itertools import zip_longest, islice
except ImportError:
# Python 2.x fallback
from itert... | {
"content_hash": "58c2f0b3d402e7126d0c25eaf29116ed",
"timestamp": "",
"source": "github",
"line_count": 283,
"max_line_length": 104,
"avg_line_length": 29.480565371024735,
"alnum_prop": 0.5975068920052738,
"repo_name": "werdeil/pibooth",
"id": "aeab1c6e2a5fad4d5ec371163056a1ce8be7d508",
"size": "83... |
import rospy
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import actionlib
import strands_emails.msg
class emailServer(object):
_feedback = strands_emails.msg.SendEmailFeedback()
_result = strands_emails.msg.SendEmailResult()
def __init__(self, n... | {
"content_hash": "65a4dd33c9af0342ce10df893e79f539",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 157,
"avg_line_length": 30.323943661971832,
"alnum_prop": 0.6196005573618207,
"repo_name": "cburbridge/strands_apps",
"id": "fa15f1ec09e65bc38232b141331f078f34ab332d",
"siz... |
import copy
import sys
import traceback
from oslo.config import cfg
import six
from designate.openstack.common.gettextutils import _
from designate.openstack.common import importutils
from designate.openstack.common import jsonutils
from designate.openstack.common import local
from designate.openstack.common import l... | {
"content_hash": "f54fa21c828c9e62c9a7589ae08182a3",
"timestamp": "",
"source": "github",
"line_count": 491,
"max_line_length": 79,
"avg_line_length": 36.30346232179226,
"alnum_prop": 0.6412903225806451,
"repo_name": "NeCTAR-RC/designate",
"id": "8c7ff1f3855dad690fa67466a6874330bc174d3e",
"size": "... |
import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
setup(
name = 'django-localflavor-si',
version = '1.0',
description = 'Country-specific Django helpers for Slovenia.',
long_description = README,
author = 'Django Software Foundation'... | {
"content_hash": "59c44ef66d492e890b7e6d1c8853703b",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 75,
"avg_line_length": 31.655172413793103,
"alnum_prop": 0.6252723311546841,
"repo_name": "klemensavli/django-localflavor-si",
"id": "b86d9c2d4edb03567b5e189d0486f5e4780f579a... |
'''
Rotation Example
================
This example rotates a button using PushMatrix and PopMatrix. You should see
a static button with the words 'hello world' rotated at a 45 degree angle.
'''
from kivy.app import App
from kivy.lang import Builder
kv = '''
FloatLayout:
Button:
text: 'hello world'
... | {
"content_hash": "c630d092fbcaa253ed4bd6fde98fc37f",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 76,
"avg_line_length": 19.457142857142856,
"alnum_prop": 0.580029368575624,
"repo_name": "bionoid/kivy",
"id": "68bf0fbba398ded61abfc18e33727dbf48ed2465",
"size": "681",
... |
"""The tests for the heat control thermostat."""
import unittest
from unittest import mock
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
STATE_ON,
STATE_OFF,
TEMP_CELCIUS,
)
from homeassistant.components import thermostat
import homeassistant.com... | {
"content_hash": "b2e0d7805588ac725bb53c784b9166f6",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 78,
"avg_line_length": 38.09950248756219,
"alnum_prop": 0.626926090363019,
"repo_name": "luxus/home-assistant",
"id": "cb75c72f8ca9fea8746bf87f55e4cdfd5541dd09",
"size": "... |
import importlib.machinery
SUFFIXES = [
('Source:', importlib.machinery.SOURCE_SUFFIXES),
('Debug:',
importlib.machinery.DEBUG_BYTECODE_SUFFIXES),
('Optimized:',
importlib.machinery.OPTIMIZED_BYTECODE_SUFFIXES),
('Bytecode:', importlib.machinery.BYTECODE_SUFFIXES),
('Extension:', importlib... | {
"content_hash": "03999685adf554e8672172be90aed517",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 59,
"avg_line_length": 25.2,
"alnum_prop": 0.6448412698412699,
"repo_name": "gaufung/PythonStandardLibrary",
"id": "1104619caa5ff0d6a634e495bbd055e076e9d2b0",
"size": "504"... |
"""
Given an array of non-negative integers, you are initially positioned at the
first index of the array.
Each element in the array represents your maximum jump length at that
position.
Your goal is to reach the last index in the minimum number of jumps.
For example:
Given array A = [2,3,1,1,4]
The minimum number ... | {
"content_hash": "793e48bca46ff527c3a51306111ee42b",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 76,
"avg_line_length": 25.09090909090909,
"alnum_prop": 0.5226449275362319,
"repo_name": "shichao-an/leetcode-python",
"id": "391b909efc6d8f3996ad7ada419b9de11567195d",
"si... |
from __future__ import unicode_literals
from django.db import migrations
from django import VERSION as DJANGO_VERSION
def populate_static_pages(apps, schema_editor):
RawHTMLPage = apps.get_model('cms_pages.RawHTMLPage')
ContentType = apps.get_model('contenttypes.ContentType')
HomePage = apps.get_model('c... | {
"content_hash": "4d74558a88be341cb1f0d6aafff20f2b",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 75,
"avg_line_length": 25.83132530120482,
"alnum_prop": 0.6072761194029851,
"repo_name": "dchaplinsky/garnahata.in.ua",
"id": "4de9166907f21d4f4ae5cd3c8b50748aae93d6c5",
"s... |
import trollius as asyncio
import boto3
from concurrent.futures import ThreadPoolExecutor
from poll import Poll
from update_and_delete import UpdateAndDelete
import logging
logging.getLogger(
'botocore.vendored.requests.packages.urllib3.connectionpool'
).setLevel(logging.CRITICAL)
logging.getLogger('boto3.resour... | {
"content_hash": "1615e7c29c5fa638350d0821d8c0e886",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 78,
"avg_line_length": 30.12727272727273,
"alnum_prop": 0.7272178636089318,
"repo_name": "yxd-hde/lambda-poll-update-delete",
"id": "b3b2bfec36f67e2dcd641e18424d141248427f60"... |
"""Test suite.
Copyright 2010-2015 Brandon Rhodes. Licensed as free software under the
Apache License, Version 2.0 as detailed in the accompanying README.txt.
"""
from unittest import TestCase
from adventure import load_advent_dat
from adventure.game import Game
class CommandTest(TestCase):
def setUp(self):
... | {
"content_hash": "0ae2e751dafe1d6e64763c36474ae79d",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 78,
"avg_line_length": 33.55882352941177,
"alnum_prop": 0.6222611744084137,
"repo_name": "devinmcgloin/advent",
"id": "beaba30a2884f06d8f5678006758f2095889e294",
"size": "1... |
"""Tests for voot application."""
from unittest import TestCase
from django.test import TestCase as DjangoTestCase
class TestSuiteTestCase(TestCase):
"""General test to make sure that the setup works."""
def test_test_suite_can_be_run(self):
self.assertTrue(True)
class ExampleTestCase(DjangoTestCas... | {
"content_hash": "838db65026f15304dad8d70437de88da",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 57,
"avg_line_length": 28.05,
"alnum_prop": 0.6898395721925134,
"repo_name": "berggren/django-voot",
"id": "5b4e6f8428bedfbc4683eddfabb8c753ed49f413",
"size": "561",
"bin... |
"""engine.SCons.Variables.ListVariable
This file defines the option type for SCons implementing 'lists'.
A 'list' option may either be 'all', 'none' or a list of names
separated by comma. After the option has been processed, the option
value holds either the named list elements, all list elemens or no
list elements a... | {
"content_hash": "3ae8bc77a2bdd06b4e569b09386f5d39",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 114,
"avg_line_length": 33.266666666666666,
"alnum_prop": 0.6432865731462926,
"repo_name": "angad/libjingle-mac",
"id": "0763b29c465ccc570dbec74f3b462e5c5c553d00",
"size":... |
"""Weather component that handles meteorological data for your location."""
from datetime import datetime
import logging
from typing import Any, Callable, Dict, List, Optional
from homeassistant.components.weather import (
ATTR_FORECAST_CONDITION,
ATTR_FORECAST_PRECIPITATION,
ATTR_FORECAST_PRECIPITATION_PR... | {
"content_hash": "426b637939de7e8c5fd9ea2c7525a82f",
"timestamp": "",
"source": "github",
"line_count": 300,
"max_line_length": 93,
"avg_line_length": 33.263333333333335,
"alnum_prop": 0.6094799078063934,
"repo_name": "partofthething/home-assistant",
"id": "e5a24197d6bad12df9257d026a5597b6d98a47a0",
... |
"""ARM inline assembler.
This module allows creation of new functions in ARM assembler
(machine language) which can be directly called from Python.
The assembler syntax parsed by this module follows as closely as practical
the offical ARM syntax
"""
from functools import partial as _partial
import re as _re
import c... | {
"content_hash": "aa4d2043b31d05c41e1e5a9fe91a5c1e",
"timestamp": "",
"source": "github",
"line_count": 832,
"max_line_length": 134,
"avg_line_length": 35.90625,
"alnum_prop": 0.5745129544085158,
"repo_name": "stephanh42/armasm",
"id": "6967e72200a777a5aacc3d6d2a072579718a000c",
"size": "29874",
... |
"""
Tool to take a region of a VCF, cut it out, and re-assign all its coordinates to
a new contig name and starting offset.
Only rewrites schom and start columns; doesn't deal with any references to
positions that may occur in INFO or FORMAT values.
Variants only partially overlapping the specified range will be drop... | {
"content_hash": "fb311988a0e63a2e78fceed268fbf5e9",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 80,
"avg_line_length": 34.9327731092437,
"alnum_prop": 0.6199182102477748,
"repo_name": "BD2KGenomics/hgvm-graph-bakeoff-evalutations",
"id": "11e30c0735a75a186eee3ce4ff911e... |
import unittest
from telemetry import benchmark
from telemetry.core import browser_options
from telemetry.core.backends.chrome import android_browser_finder
from telemetry.unittest import system_stub
class LoggingStub(object):
def __init__(self):
self.warnings = []
def info(self, msg, *args):
pass
de... | {
"content_hash": "38cc308d8cdde3a5a07af4cafaffc7d0",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 76,
"avg_line_length": 32.325842696629216,
"alnum_prop": 0.6798748696558915,
"repo_name": "ondra-novak/chromium.src",
"id": "de9e72a83d9a0b10147346aefadeeaf1800af0c4",
"siz... |
import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="size", parent_name="histogram2dcontour.contours", **kwargs
):
super(SizeValidator, self).__init__(
plotly_name=plotly_name,
parent_nam... | {
"content_hash": "3c97570aef3e21d40dc8a81444cc79c3",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 85,
"avg_line_length": 36,
"alnum_prop": 0.5962962962962963,
"repo_name": "plotly/plotly.py",
"id": "e65320a576201eddcaaf0d741b18a0ab191c6a47",
"size": "540",
"binary": f... |
"""Provides device automations for Kodi."""
from __future__ import annotations
import voluptuous as vol
from homeassistant.components.device_automation import DEVICE_TRIGGER_BASE_SCHEMA
from homeassistant.const import (
ATTR_ENTITY_ID,
CONF_DEVICE_ID,
CONF_DOMAIN,
CONF_ENTITY_ID,
CONF_PLATFORM,
... | {
"content_hash": "30b1f42f543c7aabff2f3c2bad470c5c",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 85,
"avg_line_length": 29.89,
"alnum_prop": 0.6122448979591837,
"repo_name": "nkgilley/home-assistant",
"id": "07fcf11c0771e5cd00335b802c04a88a43757bdf",
"size": "2989",
... |
"""Class for bitcoind node under test"""
import contextlib
import decimal
import errno
from enum import Enum
import http.client
import json
import logging
import os
import re
import subprocess
import tempfile
import time
import urllib.parse
import collections
import shlex
import sys
from .authproxy import JSONRPCExce... | {
"content_hash": "e9b18052d4e1f2507aa82a6cbd02a56d",
"timestamp": "",
"source": "github",
"line_count": 578,
"max_line_length": 207,
"avg_line_length": 43.08477508650519,
"alnum_prop": 0.6101272939003333,
"repo_name": "ahmedbodi/vertcoin",
"id": "53bc5ca9e7a15db56b851383b84393e5c278e66d",
"size": "... |
"""
Notes: In LDA, time complexity is proportional to (n_samples * iterations).
"""
#####################################################################
# Imports
#####################################################################
from __future__ import print_function # Not necessary for Python 3
from time import ... | {
"content_hash": "c335fe0b254898aae7440f9cf489ecde",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 107,
"avg_line_length": 37.2093023255814,
"alnum_prop": 0.565625,
"repo_name": "CommerceDataService/recordtagger",
"id": "a148b6dd64ede92a4e98721ed294036dde2e6f8f",
"size"... |
from . import base
| {
"content_hash": "123e81593bbb9185b6e4f5d8cdf3bb2f",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 18,
"avg_line_length": 19,
"alnum_prop": 0.7368421052631579,
"repo_name": "pl8787/MatchPyramid-TensorFlow",
"id": "0e44449338cf3ff3bb3d124ef22c8f7bbca760a5",
"size": "19",
... |
import sys
import django
from django.conf import settings, global_settings as default_settings
from django.core.management import execute_from_command_line
if not settings.configured:
settings.configure(
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
... | {
"content_hash": "54cbd30b1b35644479c9d5f9d8d0bed4",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 132,
"avg_line_length": 37.39506172839506,
"alnum_prop": 0.5985473753714097,
"repo_name": "jpotterm/django-fluent-contents",
"id": "d7a00b5561629e6e5dee0961610102375f58cdc3",... |
import hail as hl
from .java import Env, info
from .misc import new_temp_file, local_path_uri, new_local_temp_dir
import os
import zipfile
from urllib.request import urlretrieve
from hailtop.utils import sync_retry_transient_errors
__all__ = [
'get_1kg',
'get_hgdp',
'get_movie_lens'
]
resources = {
'1... | {
"content_hash": "070a012e3617d3923824da7e2c53adaf",
"timestamp": "",
"source": "github",
"line_count": 258,
"max_line_length": 130,
"avg_line_length": 39.674418604651166,
"alnum_prop": 0.6285658460336069,
"repo_name": "hail-is/hail",
"id": "9bf58d18f3c93dd4af22b5faae1cc904cdde2f0c",
"size": "10236... |
"""Support for iCloud sensors."""
from __future__ import annotations
from typing import Any
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import PERCENTAGE
from homeassistant.core import HomeAssistant, callback... | {
"content_hash": "820f4366fc752e3f2579922f0588fad8",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 84,
"avg_line_length": 31.23076923076923,
"alnum_prop": 0.6603721948549535,
"repo_name": "home-assistant/home-assistant",
"id": "bf5ff5860e3b6d9d01d8296aa8e86caa494a443e",
... |
import ctypes
import struct
import sys
from eventlet import patcher
from nova.i18n import _
from oslo_log import log as logging
from oslo_utils import units
from hyperv.nova import constants
from hyperv.nova import vmutils
LOG = logging.getLogger(__name__)
Queue = patcher.original('Queue')
if sys.platform == 'win3... | {
"content_hash": "d2bccf54e28e649a5eac7b2c80b820aa",
"timestamp": "",
"source": "github",
"line_count": 263,
"max_line_length": 77,
"avg_line_length": 37.08365019011407,
"alnum_prop": 0.575207628422024,
"repo_name": "adelina-t/compute-hyperv",
"id": "bde10254e578afe2e2fefc18d61ef5eee8fdb015",
"size... |
import _plotly_utils.basevalidators
class ExponentformatValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name="exponentformat",
parent_name="barpolar.marker.colorbar",
**kwargs,
):
super(ExponentformatValidator, self).__init__(
... | {
"content_hash": "4ab1a2d64665df0c20531bae489d26ff",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 80,
"avg_line_length": 33.1764705882353,
"alnum_prop": 0.5797872340425532,
"repo_name": "plotly/plotly.py",
"id": "ded52c3fb65e7be5741f07d1be33a55e8129dbc5",
"size": "564",... |
import bottle
from os import environ
from bottle import route, post, run, request, view
from instagram import client, subscriptions
bottle.debug(True)
CONFIG = {
'client_id': '27e229137db647e7a4af91f1d1ba6105',
'client_secret': 'f8900228cca14a72a41fbd2a02d9f0f8',
'redirect_uri': 'http://instacerberus.hero... | {
"content_hash": "ace7600941794dab99f93e28e923c4e6",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 83,
"avg_line_length": 30.46268656716418,
"alnum_prop": 0.6731994120529152,
"repo_name": "bearprada/instagram-tag-monitor",
"id": "908493c66b6323abf9162be8f002f106d5fb9338",
... |
"""
Test lldb data formatter subsystem.
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class SyntheticFilterRecomputingTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
# Call super's se... | {
"content_hash": "9862d6004c4d530ee85cddc8bd367f7f",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 85,
"avg_line_length": 35.10843373493976,
"alnum_prop": 0.6228551818805765,
"repo_name": "endlessm/chromium-browser",
"id": "e9e570eda5862791717147317f07cda2f2df2e6a",
"siz... |
from django.core.management import find_management_module, find_commands, load_command_class
from django.core.management.base import handle_default_options
from django.conf import settings
from django.http import HttpResponse, Http404, HttpResponsePermanentRedirect, HttpResponseRedirect
from django.template import Con... | {
"content_hash": "5ea6a9748283474b4c327e07f1800180",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 138,
"avg_line_length": 34.63559322033898,
"alnum_prop": 0.6459505749938831,
"repo_name": "danpetrikin/djangoappengine_rdbms",
"id": "b482bddeaaa337b75a297b9069c669735f41f97... |
class NoSSLEnvironment:
ssl_enabled = False
def __init__(self, *args, **kwargs):
pass
def __enter__(self):
return self
def __exit__(self, *args, **kwargs):
pass
def host_cert_path(self, hosts):
return None, None
def ca_cert_path(self, hosts):
return N... | {
"content_hash": "9f1c91ffdec6a18bf53f154fa7d267f8",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 40,
"avg_line_length": 19.058823529411764,
"alnum_prop": 0.5493827160493827,
"repo_name": "chromium/chromium",
"id": "d5f913735a5dd073ea40c6153dde8a29e9e1ca51",
"size": "35... |
"""Base testing class for strategies that require multiple nodes."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import contextlib
import copy
import threading
import numpy as np
_portpicker_import_error = None
try:
import portpicker # pylint: disab... | {
"content_hash": "9714e6e86ae612e2a5e0c7db82aa3d22",
"timestamp": "",
"source": "github",
"line_count": 291,
"max_line_length": 80,
"avg_line_length": 34.13745704467354,
"alnum_prop": 0.6550231528085363,
"repo_name": "hehongliang/tensorflow",
"id": "8eec3dc0f6ec0676353c7434d203e017b9aab80d",
"size"... |
import os
import sys
from os.path import dirname, join
from setuptools import setup, find_packages, Command
# Hack because logging + setuptools sucks.
import multiprocessing
def fread(fn):
with open(join(dirname(__file__), fn), 'r') as f:
return f.read()
if sys.version_info[0] == 3:
tests_require =... | {
"content_hash": "97d717420fe9d80d2ddb717f6850fb02",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 104,
"avg_line_length": 26.56756756756757,
"alnum_prop": 0.6744659206510681,
"repo_name": "gautamk/oauthlib",
"id": "f9013c029a78cedaa1dd393672e361cd8a347d75",
"size": "100... |
from chalice.config import Config
from chalice.policy import PolicyBuilder, AppPolicyGenerator
from chalice.policy import diff_policies
from chalice.utils import OSUtils # noqa
class OsUtilsMock(OSUtils):
def file_exists(self, *args, **kwargs):
return True
def get_file_contents(selfs, *args, **kwarg... | {
"content_hash": "08ecdbafaa56732813acbce50ac5015d",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 74,
"avg_line_length": 27.07734806629834,
"alnum_prop": 0.5207100591715976,
"repo_name": "awslabs/chalice",
"id": "b0c3d54f15e7edb2573c94ba7dd16cfb2d651e2c",
"size": "4901... |
from rally import consts
from rally import objects
from tests.unit import test
class EndpointTestCase(test.TestCase):
def test_to_dict(self):
endpoint = objects.Endpoint("foo_url", "foo_user", "foo_password",
tenant_name="foo_tenant",
... | {
"content_hash": "9514b5429c11e4df6ecc68d5e88cdf66",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 79,
"avg_line_length": 50.41538461538462,
"alnum_prop": 0.42691486115349403,
"repo_name": "shdowofdeath/rally",
"id": "b2c929baee58b6885976339453001b199a6b0997",
"size": "3... |
"""
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
This file is part of the Smart Developer Hub Project:
http://www.smartdeveloperhub.org
Center for Open Middleware
http://www.centeropenmiddleware.com/
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=... | {
"content_hash": "072812b6be05658a0b44ab7fd239dba9",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 92,
"avg_line_length": 31.193548387096776,
"alnum_prop": 0.5855739400206825,
"repo_name": "fserena/agora-stoa",
"id": "4ded2bfd5eadc82bda23b4ee5611f9f725eddcae",
"size": "... |
from oslo_utils import uuidutils
from ironic.common import network
from ironic.conductor import task_manager
from ironic.tests.unit.conductor import mgr_utils
from ironic.tests.unit.db import base as db_base
from ironic.tests.unit.db import utils as db_utils
from ironic.tests.unit.objects import utils as object_utils
... | {
"content_hash": "280133561a917e9b26b33f2d6c0074f9",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 78,
"avg_line_length": 46.25925925925926,
"alnum_prop": 0.525487056311716,
"repo_name": "devananda/ironic",
"id": "8a318f2b86357840a99af78eaee20c03c9b34b44",
"size": "4376"... |
import sys
import cPickle
from time import strftime
from ACEStream.Core.Overlay.SecureOverlay import OLPROTO_VER_FIFTEENTH
from ACEStream.Core.BitTornado.BT1.MessageID import CRAWLER_USEREVENTLOG_QUERY
from ACEStream.Core.CacheDB.sqlitecachedb import SQLiteCacheDB
from ACEStream.Core.Utilities.utilities import show_per... | {
"content_hash": "ab1cf148acb7ba52d1f1760b1ef4816f",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 131,
"avg_line_length": 40.44,
"alnum_prop": 0.6079788987800857,
"repo_name": "aplicatii-romanesti/allinclusive-kodi-pi",
"id": "390e611b6241e13656d449ee66625bbc2546fdb2",
... |
import msvcrt
#inicio
titulo="Encuesta Deportes\n".capitalize()
print titulo.center(50," ")
entrada= "Clasificacion de deportes que practican las personas\n"
print entrada.upper()
#-------------------------------------------------------------------------------
#pregunta
pregunta=0
c1=1
ajedrez=0
atletismo=0
futbol=0
ba... | {
"content_hash": "59bb5fa4d750d6e7915f1b2af6ca7765",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 80,
"avg_line_length": 18.117117117117118,
"alnum_prop": 0.599204375932372,
"repo_name": "rubbenrc/uip-prog3",
"id": "cbff876e5df80b212b146c0b7eb0f64595430f44",
"size": "2... |
import logging
import socket
from httplib import HTTPConnection, HTTPSConnection, HTTPException
from Queue import Queue, Empty, Full
from select import select
from socket import error as SocketError, timeout as SocketTimeout
from .packages.ssl_match_hostname import match_hostname, CertificateError
try:
import s... | {
"content_hash": "24b43886045b43e8d1da0f19bf617a27",
"timestamp": "",
"source": "github",
"line_count": 546,
"max_line_length": 80,
"avg_line_length": 34.88278388278388,
"alnum_prop": 0.5833770870523994,
"repo_name": "clofresh/xbmc-vhx",
"id": "c1ebed495299c31ab2e70d782d39127c04305809",
"size": "19... |
"""Settings that need to be set in order to run the tests."""
import os
DEBUG = True
SITE_ID = 1
APP_ROOT = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..'))
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
ROOT_URLCONF = 'booking... | {
"content_hash": "4a927a7cee1fedba1edd30da3604acb5",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 65,
"avg_line_length": 23.446153846153845,
"alnum_prop": 0.6456692913385826,
"repo_name": "bitmazk/django-booking",
"id": "c76f699a9ea94f2a595ab519b9fa849c5551b149",
"size"... |
import numpy as np
import random
rng = random.SystemRandom()
from cmath import rect
from collections import deque
def point_aabb(points):
"""Returns the axis-aligned bounding box of the input set of points as (SW corner, NE corner) (lowest and highest parts respectively)."""
preal, pimag = np.real(points), np.... | {
"content_hash": "7c5fc28b45ddd5debb3f0795e6696afc",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 144,
"avg_line_length": 50.666666666666664,
"alnum_prop": 0.5651774785801713,
"repo_name": "Parclytaxel/Kinross",
"id": "9b4d5e6f9113fe3ed23ac127a13c8c3815894a0c",
"size":... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hypnobox', '0002_auto_20160909_1835'),
]
operations = [
migrations.AlterField(
model_name='lead',
name='product_id',
... | {
"content_hash": "6f9f4ad99a57bd6640d46514560a656f",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 90,
"avg_line_length": 23.38888888888889,
"alnum_prop": 0.6057007125890737,
"repo_name": "fgmacedo/hypnobox-django",
"id": "6d87043a813dd1ae9e7eb2e5fab82a2d969f0b52",
"size... |
"""Tests around project's distribution and packaging."""
import os
import unittest
tests_dir = os.path.dirname(os.path.abspath(__file__))
project_dir = os.path.dirname(tests_dir)
class VersionTestCase(unittest.TestCase):
"""Various checks around project's version info."""
def get_project_name(self):
... | {
"content_hash": "57df7b373443ef71af778ac824468a2b",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 78,
"avg_line_length": 44.66197183098591,
"alnum_prop": 0.5629139072847682,
"repo_name": "novapost/django-plainpasswordhasher",
"id": "acbf2b88cfc00d496f735da45c1e4d76cf878c6... |
import urllib2
import re
import random
from bs4 import BeautifulSoup
from client import app_utils
from semantic.numbers import NumberService
WORDS = ["HACKER", "NEWS", "YES", "NO", "FIRST", "SECOND", "THIRD"]
PRIORITY = 4
URL = 'http://news.ycombinator.com'
class HNStory:
def __init__(self, title, URL):
... | {
"content_hash": "be924e4cd5132409cad7c87bba4dd40c",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 78,
"avg_line_length": 35.1294964028777,
"alnum_prop": 0.5130043006348556,
"repo_name": "brad999/nikita-client",
"id": "d62ff56fa848afe7c781728bc457aa20bd3c9ad0",
"size": ... |
"""
phishing.py: Phishing HTTP server (phishing)
Author: Vladimir Ivanov
License: MIT
Copyright 2020, Raw-packet Project
"""
# endregion
# region Import
from raw_packet.Utils.base import Base
from http.server import BaseHTTPRequestHandler, HTTPServer
from socketserver import ThreadingMixIn
from typing import List, Dic... | {
"content_hash": "b9902aa81bdeb1fa24542fc519bb82c1",
"timestamp": "",
"source": "github",
"line_count": 448,
"max_line_length": 114,
"avg_line_length": 38.145089285714285,
"alnum_prop": 0.5471941014687811,
"repo_name": "Vladimir-Ivanov-Git/raw-packet",
"id": "347a2556c3135a2b027ebd856872f17d5a5fb46a"... |
"""empty message
Revision ID: 3088dcf95e92
Revises: 0a0bf059f762
Create Date: 2017-02-25 21:24:25.752377
"""
# revision identifiers, used by Alembic.
revision = '3088dcf95e92'
down_revision = '0a0bf059f762'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... | {
"content_hash": "d67c3a0052669a251c9fa62b1b35c5d1",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 92,
"avg_line_length": 24.46153846153846,
"alnum_prop": 0.6933962264150944,
"repo_name": "whittlbc/jarvis",
"id": "03b1c0ac73f4189a3907a2c9dfa9529efab7eb1f",
"size": "636",... |
from __future__ import absolute_import
from pyarrow.lib import benchmark_PandasObjectIsNull
| {
"content_hash": "8b8be787b61fb52f7fbcf4e4b1c81f8a",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 52,
"avg_line_length": 31,
"alnum_prop": 0.8279569892473119,
"repo_name": "renesugar/arrow",
"id": "e8e38a42f4cabc8de2a71098f05ae52ee3c56473",
"size": "895",
"binary": fal... |
class ScrapyGlancePipeline(object):
def process_item(self, item, spider):
return item
| {
"content_hash": "26a2487b359a792e21b6535eb23c45cb",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 41,
"avg_line_length": 32.666666666666664,
"alnum_prop": 0.7040816326530612,
"repo_name": "tgl-dogg/BCC-2s14-PI4-SteampunkSpider",
"id": "b3e83be99a374eb36a1febebbf567e920806a... |
from rest_framework import permissions, viewsets, status
from rest_framework.response import Response
from .models import Account
from .permissions import IsAccountOwner
from .serializers import AccountSerializer
class AccountViewSet(viewsets.ModelViewSet):
lookup_field = 'username'
queryset = Account.objec... | {
"content_hash": "4cee8a821d8aac538a22941d6db11b3c",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 97,
"avg_line_length": 33.666666666666664,
"alnum_prop": 0.7020702070207021,
"repo_name": "quaest-io/quaest-io",
"id": "29a368776fabc818ed5d8fed83732bfdb1cf7ef2",
"size": "... |
from msrest.serialization import Model
class ContainerServiceCredentials(Model):
"""Information about the Azure Container Registry which contains the images
deployed to the cluster.
Variables are only populated by the server, and will be ignored when
sending a request.
:ivar acs_kube_config: The... | {
"content_hash": "4e9da01717738e600de2e02d42dbb33f",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 122,
"avg_line_length": 38.36842105263158,
"alnum_prop": 0.6831275720164609,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "17a92a26e1f2299973c9d6f85b460014db41fcba",
... |
import logging
from eventkit_cloud.utils.services.errors import MissingLayerError, UnsupportedFormatError, ServiceError
from eventkit_cloud.utils.services.ows import OWS
logger = logging.getLogger(__name__)
class WMS(OWS):
def __init__(self, *args, **kwargs):
super(WMS, self).__init__(*args, *... | {
"content_hash": "53e2e4d9021099edfd118245a5c0c8b0",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 109,
"avg_line_length": 38.62820512820513,
"alnum_prop": 0.5784931961500166,
"repo_name": "venicegeo/eventkit-cloud",
"id": "145f7e26808f71436d6d7137926ab29d63b163fc",
"siz... |
__author__ = 'vialette'
class ItemEvent(object):
REQUEST_ADD_ITEM = 0
START_ADD_ITEM = 1
END_ADD_ITEM = 2
def __init__(self, event_type, timestamp, item):
self._event_type = event_type
self._timestamp = timestamp
self._item = item
@property
def event_type(self):
... | {
"content_hash": "cf2754d7dd2d1ff3adfffa468d904286",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 108,
"avg_line_length": 27.333333333333332,
"alnum_prop": 0.5708841463414634,
"repo_name": "vialette/ultrastorage",
"id": "c151f07c0a632ddbc1cf5c424053d1d0701867b7",
"size"... |
import binascii
import os
from stat import ST_INO, ST_SIZE
class TailFile(object):
CRC_SIZE = 16
def __init__(self, logger, path, callback):
self._path = path
self._f = None
self._inode = None
self._size = 0
self._crc = None
self._log = logger
self._ca... | {
"content_hash": "69bdd9742eea19374d649901c238578a",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 93,
"avg_line_length": 32.78431372549019,
"alnum_prop": 0.4880382775119617,
"repo_name": "indeedops/dd-agent",
"id": "ed9abdd9b9c64a75fe045d6e8a26cfa2013250f7",
"size": "3... |
def human_layout_to_computer(human_layout):
computer_layout = {}
for row_num, row in enumerate(human_layout):
for col_num, char in enumerate(row):
computer_layout[char] = {
'x': col_num,
'y': row_num
}
return computer_layout | {
"content_hash": "67db0b2facb27d4f24ee6b204c93203c",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 48,
"avg_line_length": 33.333333333333336,
"alnum_prop": 0.54,
"repo_name": "hbaughman/softKey",
"id": "c3279d8cac4b48a38744209ee87e5e3a99e55ca1",
"size": "300",
"binary":... |
import cv2
import numpy as np
import matplotlib.pyplot as plt
def referTemplate(iFrame, threshold):
img_gray = cv2.cvtColor(iFrame, cv2.COLOR_BGR2GRAY)
template = cv2.imread('train.jpg',0)
w, h = template.shape[::-1]
res = cv2.matchTemplate(img_gray,template,cv2.TM_CCOEFF_NORMED)
loc = np.wh... | {
"content_hash": "23a6203f8d5b579a6f4e23882fc003fe",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 74,
"avg_line_length": 24.136363636363637,
"alnum_prop": 0.6393596986817326,
"repo_name": "Gobind03/Gesture-Recognition",
"id": "a8a961e11622e6c2182a3f9a825de3a08f385c21",
... |
{
'name': 'Initial Setup Tools',
'version': '1.0',
'category': 'Hidden',
'description': """
This module helps to configure the system at the installation of a new database.
================================================================================
Shows you a list of applications features to inst... | {
"content_hash": "1a668694b583ef8528c8d40a48bbb1ee",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 121,
"avg_line_length": 33.629629629629626,
"alnum_prop": 0.5594713656387665,
"repo_name": "ntiufalara/openerp7",
"id": "e74238ba59cc20dede38715a28adcd20edad754d",
"size": ... |
import os
import re
from oslo.config import cfg
from cinder.brick.remotefs import remotefs
from cinder import exception
from cinder.i18n import _
from cinder.image import image_utils
from cinder.openstack.common import log as logging
from cinder.openstack.common import processutils as putils
from cinder.openstack.com... | {
"content_hash": "ce46a3caa2b7c468715bd08cb968d5f3",
"timestamp": "",
"source": "github",
"line_count": 582,
"max_line_length": 79,
"avg_line_length": 41.197594501718214,
"alnum_prop": 0.5815156191350044,
"repo_name": "jumpstarter-io/cinder",
"id": "d824e8127eed1ce503b07772b7d6f69595509ee0",
"size"... |
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.contrib.auth.models import User
from django.db.models.signals import post_save, pre_save
from django.dispatch import receiver
from django.core.exceptions import PermissionDenied
# Create your models here.
@python_2_... | {
"content_hash": "9a06eb027452332afb921712ee887df4",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 97,
"avg_line_length": 33.45192307692308,
"alnum_prop": 0.6335153779821788,
"repo_name": "CRUx-BPHC/crux-judge",
"id": "b17d1f93f2ed9b875a879b94b7fed7307ef4c1b6",
"size": ... |
"""
filename: controllers.py
description: Controller for Users.
created by: Omar De La Hoz ([email protected])
created on: 09/07/17
"""
from flask_socketio import emit
from app.decorators import ensure_dict, get_user
from app import socketio, db
from app.users.models import Users, Roles
from app.users.users_response imp... | {
"content_hash": "0f234d2b05d5160473ddcfad1465e2a0",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 105,
"avg_line_length": 28.316384180790962,
"alnum_prop": 0.580806065442937,
"repo_name": "ritstudentgovernment/chargeflask",
"id": "75c5c6a1e4c7ff364c127a4a4c45b312ec04df70... |
import copy
class SerializableObject(object):
def __init__(self):
pass
def update(self, **kwargs):
for k, v in kwargs.items():
setattr(self, k, v)
def as_dict(self):
# use deepcopy so that changing this dictionary later won't affect the SerializableObject
d = ... | {
"content_hash": "13a873d4862fc2537a0f7e407c82ef05",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 97,
"avg_line_length": 32.13333333333333,
"alnum_prop": 0.48858921161825725,
"repo_name": "4dn-dcic/tibanna",
"id": "4f9af45f4a8419f5d8144fc8955e3ca8505bb98a",
"size": "964... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('markets', '0057_auto_20170228_1530'),
]
operations = [
migrations.AlterModelOptions(
name='market',
options={'permissions': (('can_p... | {
"content_hash": "10f0a0b7aad1709195ded5e616a5c382",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 120,
"avg_line_length": 24.352941176470587,
"alnum_prop": 0.6086956521739131,
"repo_name": "uktrade/navigator",
"id": "e840914258fc123b16de99cb719fead346028959",
"size": "4... |
from decimal import Decimal, getcontext
from vector import Vector
import random
getcontext().prec = 30
class Line(object):
NO_NONZERO_ELTS_FOUND_MSG = 'No nonzero elements found'
def __init__(self, normal_vector=None, constant_term=None):
self.dimension = 2
if not normal_vector:
... | {
"content_hash": "e1ece0efcd09028c50479e151f220521",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 101,
"avg_line_length": 30.957142857142856,
"alnum_prop": 0.5546838947854176,
"repo_name": "jortizcs/machine-learning",
"id": "47f3e1cfb6d3ddb73fb1aaafc30590f8641d2717",
"... |
import os
import yaml
from pkg_resources import resource_filename
PERSIST_SETTINGS = [
'ansible_ssh_user',
'ansible_config',
'ansible_log_path',
'master_routingconfig_subdomain',
'variant',
'variant_version',
'version',
]
DEFAULT_REQUIRED_FACTS = ['ip', 'public_ip', 'hostname', 'public_... | {
"content_hash": "31c6ecd1958b8d0fe70c8dc7605c6fcf",
"timestamp": "",
"source": "github",
"line_count": 261,
"max_line_length": 93,
"avg_line_length": 36.24904214559387,
"alnum_prop": 0.5681217630271641,
"repo_name": "BlueShells/openshift-ansible",
"id": "c9498542f7e292d4c9ac8df8dcb36c4d09faa394",
... |
"""
Portable file locking utilities.
Based partially on an example by Jonathan Feignberg in the Python
Cookbook [1] (licensed under the Python Software License) and a ctypes port by
Anatoly Techtonik for Roundup [2] (license [3]).
[1] http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203
[2] http://sourceforg... | {
"content_hash": "944137ba4020bfa3967d854cc12cf22d",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 89,
"avg_line_length": 31.079646017699115,
"alnum_prop": 0.5945330296127562,
"repo_name": "treyhunner/django",
"id": "63c7fda9bbb7f865ed2482bc6621fc278e2bd9ce",
"size": "3... |
import ursgal
import os
def main():
"""
Script to compare Percolator versions 2.08 and 3.2 using MSFragger as
search engine
"""
engine_list = [
"xtandem_vengeance",
]
params = {
"database": os.path.join(
os.pardir,
"example_data",
"Crei... | {
"content_hash": "226c769be0135c7572fd8ea2c3787e05",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 123,
"avg_line_length": 33.666666666666664,
"alnum_prop": 0.5784463061690784,
"repo_name": "ursgal/ursgal",
"id": "b56a4b606ef39ec13d0b2dc2ee54c1beef74156a",
"size": "2668"... |
def main(j,jp):
recipe=jp.getCodeMgmtRecipe()
recipe.commit()
| {
"content_hash": "5f4200e632955e658abfd222713b026b",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 33,
"avg_line_length": 17.75,
"alnum_prop": 0.6619718309859155,
"repo_name": "Jumpscale/jumpscale6_core",
"id": "6faf358b717dd7c40300b487620b290f1feed803",
"size": "141",
... |
"""
Django settings for shop_lite project.
Generated by 'django-admin startproject' using Django 1.8.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build pa... | {
"content_hash": "b73c9babb9931f3311ff8c63c45a77a5",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 71,
"avg_line_length": 26.680473372781066,
"alnum_prop": 0.6801951652251054,
"repo_name": "sidja/Django_Shop_Lite",
"id": "1ee58bca7df287ced6b4f281c8c86aa7d948dfc9",
"size... |
from copy import copy
from tornado.testing import gen_test
from tornado.web import Application
from . import RESTTestHandler
from .server import AsyncRESTTestCase
class Handler(RESTTestHandler):
COOKIES = [
(('foo', 'baz'), dict(expires_days=20)),
(('bar', '*'), dict(expires_days=20)),
(('... | {
"content_hash": "0a8ab1f793b304f4ee075efa526aa415",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 59,
"avg_line_length": 23.97826086956522,
"alnum_prop": 0.5747960108794198,
"repo_name": "mosquito/rest-client",
"id": "03a5cd7cc7f3d472c5b9a123eb3bea073da17fb4",
"size": "... |
from __future__ import absolute_import, division, print_function, unicode_literals
from amaascore.corporate_actions.corporate_action import CorporateAction
class Split(CorporateAction):
def __init__(self, asset_manager_id, corporate_action_id, record_date, ratio, corporate_action_status='Open',
... | {
"content_hash": "2d6141cb8618b382bcf2ab98646b3ac6",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 118,
"avg_line_length": 48.470588235294116,
"alnum_prop": 0.6122572815533981,
"repo_name": "amaas-fintech/amaas-core-sdk-python",
"id": "7e7e5bd60945097fc16f38bc5cd38546382b7... |
from trainer_config import TrainerConfig
from config import GeneralConfig | {
"content_hash": "a734e82e3aecb5bd41b2e726d5631005",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 40,
"avg_line_length": 36.5,
"alnum_prop": 0.8904109589041096,
"repo_name": "uaca/deepy",
"id": "e9fcda1f17d18bd993d4fa7ca0b7419ea736cbf4",
"size": "120",
"binary": false,... |
"""Saves a SavedModel after TensorRT conversion.
The saved model is loaded and executed by tests to ensure backward
compatibility across TF versions.
The script may not work in TF1.x.
Instructions on how to use this script:
- Execute the script as follows:
python gen_tftrt_model
- Rename tftr... | {
"content_hash": "53c0a9ea36433b6b10170b5e89c02763",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 80,
"avg_line_length": 33.72222222222222,
"alnum_prop": 0.704165686043775,
"repo_name": "frreiss/tensorflow-fred",
"id": "40b0e6ac29640908a3182d5169f835fa80694ef0",
"size"... |
from libraries import db_helper
from localsys.storage import db
class pw_policy_model:
# Notice that the values provided here are for password policy only.
# Values for other policies are available in models\policies.py
ranges = {"plen": [0, 6, 8, 10, 12],
"psets": [1, 2, 3, 4],
... | {
"content_hash": "ec6049e188dffc3e8f2b4d8832a3a3f4",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 105,
"avg_line_length": 37.095238095238095,
"alnum_prop": 0.5214377406931964,
"repo_name": "mapto/sprks",
"id": "b845acf257f39ed8b43e1c1b01e587ff4c8d3df4",
"size": "3895",... |
"""
This file tests and ensures that all tutorials notebooks run
without warning or exception.
env variable MXNET_TUTORIAL_TEST_KERNEL controls which kernel to use
when running the notebook. e.g:
`export MXNET_TUTORIAL_TEST_KERNEL=python2`
env variable MXNET_TUTORIAL_TEST_NO_CACHE controls whe... | {
"content_hash": "5aa67368c517acee321b7d41c2c53e49",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 105,
"avg_line_length": 30.468599033816425,
"alnum_prop": 0.7146028222609798,
"repo_name": "larroy/mxnet",
"id": "2ebd2f8e92cac92712f5d228b511f5a4661982c4",
"size": "7261"... |
import os
import time
import google.auth
from google.api import monitored_resource_pb2
from google.cloud import logging_v2
from google.cloud.logging_v2.proto import log_entry_pb2
from google.cloud.logging_v2.proto import logging_pb2
class TestSystemLoggingServiceV2(object):
def test_write_log_entries(self):
... | {
"content_hash": "21b813dc37c96402db4818071d5f2aba",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 78,
"avg_line_length": 31.181818181818183,
"alnum_prop": 0.6807580174927114,
"repo_name": "dhermes/gcloud-python",
"id": "d574de7785f71233c9490fc1777da2afd60d5e54",
"size":... |
from datetime import timedelta
from glob import glob
import numpy as np
from .GribModelGrid import GribModelGrid
class HREFv2ModelGrid(GribModelGrid):
"""
Extension of the ModelGrid class for interfacing with the HREFv2 ensemble.
Args:
member (str): Name of the ensemble member
run_date ... | {
"content_hash": "075566e869a28d6c1c0f4945b2108e1e",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 119,
"avg_line_length": 44.94642857142857,
"alnum_prop": 0.5288041319030592,
"repo_name": "djgagne/hagelslag",
"id": "de6d5ace5ca2341f73213764266159413a02a637",
"size": "25... |
"""Helper methods to help with platform discovery.
There are two different types of discoveries that can be fired/listened for.
- listen/discover is for services. These are targetted at a component.
- listen_platform/discover_platform is for platforms. These are used by
components to allow discovery of their plat... | {
"content_hash": "0c1d0e99ec6fe32623e72d5748e56f1c",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 79,
"avg_line_length": 32.30769230769231,
"alnum_prop": 0.6489795918367347,
"repo_name": "robjohnson189/home-assistant",
"id": "de16a0b907dcdbb118fb1dcb95312ce116c3c0a2",
... |
import StringIO
import mock
import unittest
from tavrida import discovery
from tavrida import exceptions
class LocalDiscoveryTestCase(unittest.TestCase):
def test_register_remote_service(self):
disc = discovery.LocalDiscovery()
service_name = "some_service"
exchange_name = "some_exchan... | {
"content_hash": "14e7e6db95cc5b7827a0a0c5ee11b929",
"timestamp": "",
"source": "github",
"line_count": 242,
"max_line_length": 70,
"avg_line_length": 37.12396694214876,
"alnum_prop": 0.6194345503116652,
"repo_name": "sbunatyan/tavrida",
"id": "1934a9a0b71525224cfe6cce05f2f8977cfa9d56",
"size": "89... |
import os
import sys
from rdr_service.dao.hpo_dao import HPODao
from rdr_service.model.hpo import HPO
from tests.helpers.unittest_base import BaseTestCase
class TestEnvironment(BaseTestCase):
"""
Test our python environment
"""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kw... | {
"content_hash": "5cf48177ab1aa066ed04878cc117e0ee",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 81,
"avg_line_length": 34.42857142857143,
"alnum_prop": 0.6271487848251334,
"repo_name": "all-of-us/raw-data-repository",
"id": "511f7a80f285d80120b4f1d4a0b685c6dd6acc0e",
... |
dubliners_stories = ['The Sisters',
'An Encounter',
'Araby',
'Eveline',
'After the Race',
'Two Gallants',
'The Boarding House',
'A Little Cloud',
'Count... | {
"content_hash": "5c0c965614c544f540d09dfdb8e22f2c",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 87,
"avg_line_length": 26.880597014925375,
"alnum_prop": 0.5308162132148806,
"repo_name": "charlesreid1/wordswordswords",
"id": "3c9cd492fc5115c76403751fd7542808ec23e6ce",
... |
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | {
"content_hash": "5f323f7df69c02bec1e28f17bc3583eb",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 124,
"avg_line_length": 39.86666666666667,
"alnum_prop": 0.7244147157190636,
"repo_name": "sekikn/ambari",
"id": "5826fc1e8abbc38492bf031e07d25f6875c9f537",
"size": "3012",... |
import contextlib
from unittest import TestCase
from unittest.mock import patch
from io import StringIO
from onelogin_aws_cli.userquery import user_choice, user_role_prompt
class TestUser_choice(TestCase):
def test_user_choice(self):
mock_stdout = StringIO()
with patch('builtins.input', side_e... | {
"content_hash": "0892dc57d9af9ddb3154b76b0ac04c23",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 79,
"avg_line_length": 32.97530864197531,
"alnum_prop": 0.593036315986522,
"repo_name": "healthcoda/onelogin-aws-cli",
"id": "4b4d5d1ac0d41554ab473eee0a530e37d35e986f",
"si... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class DeleteListen(Choreography):
def __init__(self, temboo_session):
"""
Create a ... | {
"content_hash": "6c220fa6cc9571c56d2036301398bf06",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 153,
"avg_line_length": 38.80327868852459,
"alnum_prop": 0.7051119560625264,
"repo_name": "lupyuen/RaspberryPiImage",
"id": "3d8890ac8f3e833512f0483025eb64e0e8dcfaae",
"siz... |
import time
import pytest
import asyncio
from paco import wait
from .helpers import run_in_loop
@asyncio.coroutine
def coro(num):
yield from asyncio.sleep(0.1)
return num * 2
def test_wait(limit=0):
done, pending = run_in_loop(wait([coro(1), coro(2), coro(3)], limit=limit))
assert len(done) == 3
... | {
"content_hash": "967a731d1aa82b83eeecfe584be8876e",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 79,
"avg_line_length": 21.6,
"alnum_prop": 0.6100823045267489,
"repo_name": "h2non/paco",
"id": "dd71d32d6c81123679f1f9f46e98d6ce7f95f30d",
"size": "996",
"binary": false... |
"""Support for esphome devices."""
from __future__ import annotations
from collections.abc import Callable
import functools
import logging
import math
from typing import Any, Generic, NamedTuple, TypeVar, cast, overload
from aioesphomeapi import (
APIClient,
APIConnectionError,
APIIntEnum,
APIVersion,... | {
"content_hash": "4c10a7f485e6d8d73957b254654601d9",
"timestamp": "",
"source": "github",
"line_count": 776,
"max_line_length": 105,
"avg_line_length": 34.49226804123711,
"alnum_prop": 0.6150713591870283,
"repo_name": "mezz64/home-assistant",
"id": "23b6a6550e4889d99e89fa595e7ab8f1e7da864f",
"size"... |
"""Test the Logitech Harmony Hub activity switches."""
from datetime import timedelta
from homeassistant.components.harmony.const import DOMAIN
from homeassistant.components.switch import (
DOMAIN as SWITCH_DOMAIN,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
)
from homeassistant.const import (
ATTR_ENTITY_ID,
... | {
"content_hash": "7941c5eba754741c3921a753ddd00780",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 78,
"avg_line_length": 35.19642857142857,
"alnum_prop": 0.7128361237950279,
"repo_name": "sander76/home-assistant",
"id": "1940c54e1123a5601330939138515264143f7280",
"size... |
"""Run Cuffdiff 2.2."""
import os
from pathlib import Path
from plumbum import TEE
from resolwe.process import (
BooleanField,
Cmd,
DataField,
FileField,
FloatField,
JsonField,
ListField,
Persistence,
Process,
SchedulingClass,
StringField,
)
class Cuffdiff(Process):
"... | {
"content_hash": "a8844a62ba30e19f5cc9a85da037274c",
"timestamp": "",
"source": "github",
"line_count": 353,
"max_line_length": 99,
"avg_line_length": 37.756373937677054,
"alnum_prop": 0.5481692677070829,
"repo_name": "genialis/resolwe-bio",
"id": "617b303379ff1e13970bd36f0854c2b0186b9a03",
"size":... |
import sys
import os
import re
import scipy.stats as stats
from matplotlib.pyplot import *
from numpy import *
# Goal: follow the jitter of some nodes (ideal case, massive join/departure, presence of colluders)
print "Usage: ./7_log_size.py dir"
def roundId_jitteredList(dir):
''' Compute the jitter of nodes betw... | {
"content_hash": "45aa922db928384579e65a46dc01ad96",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 99,
"avg_line_length": 30.527027027027028,
"alnum_prop": 0.6489597166888004,
"repo_name": "jdecouchant/PAG",
"id": "a9b963b1afb4c50023b3b7c7a876648f7e11b983",
"size": "2277... |
from typing import Container, Dict, Type
from pydantic import BaseModel, create_model
from sqlalchemy.inspection import inspect
from sqlalchemy.orm.properties import ColumnProperty
def sqlalchemy_to_pydantic(
db_model: Type, *, include: Dict[str, type] = None, exclude: Container[str] = None
) -> Type[BaseModel]:... | {
"content_hash": "8b0816bd651d4384a67bb3b0dce2f96d",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 86,
"avg_line_length": 33.78378378378378,
"alnum_prop": 0.5872,
"repo_name": "isislab/CTFd",
"id": "cd3ed4f6f19656dc2865b3c2638b3e200f510da2",
"size": "1250",
"binary": f... |
from django import template
from django.conf import settings
from GChartWrapper import Sparkline
from camo import CamoClient
from ...comments.models import Comment
register = template.Library()
@register.simple_tag
def graph(professor):
scores = []
comments = Comment.objects.filter(
professor=prof... | {
"content_hash": "86a5e8373d334de5b4c9057bf7ce98eb",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 69,
"avg_line_length": 24.3,
"alnum_prop": 0.6399176954732511,
"repo_name": "Jpadilla1/notaso",
"id": "79340cd1078653969c4e71b7a6f67fc3cd0cd4b5",
"size": "972",
"binary":... |
"""
The QueuedDomainRequestServer handles incoming scan_task requests.
"""
"""
################################################################################
Messages:
DomainSearchScanner -> QueuedDomainRequestServer:
"request": "task"
QueuedDomainRequestServer -> DomainSearchScanner: scan reques... | {
"content_hash": "f2e7415520d85ce3f80e6385483f0535",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 82,
"avg_line_length": 29.390625,
"alnum_prop": 0.4733297891192628,
"repo_name": "andreas-kowasch/DomainSearch",
"id": "72074dba31cd6f67a8515f22393c88ea1c674811",
"size": ... |
import random
def random_data(points=50, maximum=100):
return [random.random() * maximum for a in xrange(points)]
def random_colour(min=20, max=200):
func = lambda: int(random.random() * (max-min) + min)
r, g, b = func(), func(), func()
return '%02X%02X%02X' % (r, g, b)
| {
"content_hash": "291f0f8c0ab044106b469ec9ec55b988",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 62,
"avg_line_length": 29,
"alnum_prop": 0.6172413793103448,
"repo_name": "gregdingle/genetify",
"id": "2bedf6e49e22d95f4772405ac275936518f16aea",
"size": "290",
"binary"... |
from __future__ import with_statement
import unittest
import sys
import os
import IECore
import IECoreScene
class TestPDCReader( unittest.TestCase ) :
def testConstruction( self ) :
r = IECore.Reader.create( "test/IECore/data/pdcFiles/particleShape1.250.pdc" )
self.assert_( r.isInstanceOf( "ParticleReader" ) ... | {
"content_hash": "a60f03801301b6800508b70a5b568c26",
"timestamp": "",
"source": "github",
"line_count": 314,
"max_line_length": 134,
"avg_line_length": 36.44904458598726,
"alnum_prop": 0.7075578855395369,
"repo_name": "appleseedhq/cortex",
"id": "5682199b30e07d786461288db05a8e0ce3a5c5db",
"size": "... |
from .Module import Module
from beacon8.init import const, xavier
from beacon8.utils import create_param_and_grad
import numpy as _np
import theano as _th
class Linear(Module):
def __init__(self, nin, nout, with_bias=True, initW=xavier(), initB=const(0)):
Module.__init__(self)
self.nin = nin
... | {
"content_hash": "7fded291a862fa23a6d004648356415b",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 135,
"avg_line_length": 28.24137931034483,
"alnum_prop": 0.6214896214896215,
"repo_name": "VisualComputingInstitute/Beacon8",
"id": "7743a8c343e0093759cdcf1f4c4067ec39f87061"... |
from msrest.paging import Paged
class UserPaged(Paged):
"""
A paging container for iterating over a list of User object
"""
_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[User]'}
}
def __init__(self, *args, **kwa... | {
"content_hash": "692cb5cd9c47dabf8516eb67589b84a1",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 63,
"avg_line_length": 24,
"alnum_prop": 0.5546875,
"repo_name": "SUSE/azure-sdk-for-python",
"id": "e14d6e48f7109bb921cfe6fee46885e590f66833",
"size": "858",
"binary": f... |
import frappe
from frappe.model.document import Document
class NoteSeenBy(Document):
pass
| {
"content_hash": "d3819c77d6726fd876ca04305b508878",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 42,
"avg_line_length": 18.4,
"alnum_prop": 0.8260869565217391,
"repo_name": "almeidapaulopt/frappe",
"id": "01bee05a9fee8a0ce6a005777ade237b37b68e90",
"size": "204",
"bina... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.