text stringlengths 4 1.02M | meta dict |
|---|---|
from . import gxapi_cy
from geosoft.gxapi import GXContext, float_ref, int_ref, str_ref
### endblock ClassImports
### block Header
# NOTICE: The code generator will not replace the code in this block
### endblock Header
### block ClassImplementation
# NOTICE: Do not edit anything here, it is generated code
class GX... | {
"content_hash": "fe5fb9730b32c08a2aa89deb0b0e0f4f",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 175,
"avg_line_length": 31.858156028368793,
"alnum_prop": 0.6351291184327693,
"repo_name": "GeosoftInc/gxpy",
"id": "3828435b80337b9b3753f6c4bc90065a6b07a077",
"size": "46... |
import pytest
from sqldoc import sqldoc
from sqldoc.parser.parser import Parser
from sqldoc.renderer.renderer import Renderer
@pytest.fixture
def mock_load_plugins(mocker):
mocker.patch('sqldoc.sqldoc.load_plugins')
sqldoc.load_plugins.return_value = [
Plugin('parser_plugin', ParserPlugin),
Pl... | {
"content_hash": "32eae8805e46086d08fe0a163e7d6c56",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 66,
"avg_line_length": 26.625,
"alnum_prop": 0.6889671361502347,
"repo_name": "korhner/sqldoc",
"id": "b0768b86aced4891e0840681544a163343b1a986",
"size": "2603",
"binary"... |
"""
User interface Controls for the layout.
"""
import time
from abc import ABCMeta, abstractmethod
from typing import (
TYPE_CHECKING,
Callable,
Dict,
Hashable,
Iterable,
List,
NamedTuple,
Optional,
Union,
)
from prompt_toolkit.application.current import get_app
from prompt_toolkit... | {
"content_hash": "722d744b82919d126759cd258aa80ad0",
"timestamp": "",
"source": "github",
"line_count": 939,
"max_line_length": 92,
"avg_line_length": 37.33759318423855,
"alnum_prop": 0.5952082144894466,
"repo_name": "sserrot/champion_relationships",
"id": "75c51753619b0af202dcec2364f324471c5f3a45",
... |
"""Definition and setup of the Omnilogic Sensors for Home Assistant."""
from typing import Any
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONCENTRATION_PARTS_PER_MILLION,
ELECTRIC_POTENTIAL_M... | {
"content_hash": "cd1e5fbf086ffe108599dcda717b157f",
"timestamp": "",
"source": "github",
"line_count": 360,
"max_line_length": 84,
"avg_line_length": 29.183333333333334,
"alnum_prop": 0.5242718446601942,
"repo_name": "nkgilley/home-assistant",
"id": "04bb1abf3e8cb5d0dbb2d4db3eb833bbf0f75064",
"siz... |
from numpy import mean
from numpy import std
from ml.GradientDescent import *
from logic import DataConvertor, Parser
URL_COPYPASTE_AVTOVAZ_TEST = 'http://spb.am.ru/all/search/?p465=87&p1009=1602&p1129ge=1900&p1129le=2014&p2le=9000000&p1145[]=13,29'
def feature_normalize(data):
mileage_mean = mean([int(x) for x ... | {
"content_hash": "994572a586248bf57604fe8755acf05f",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 131,
"avg_line_length": 41.17948717948718,
"alnum_prop": 0.6569115815691158,
"repo_name": "YuriShporhun/TheCarMonitor",
"id": "c53c6d699887d1de462b06d304cdd05f46e56554",
"s... |
"""
Standalone file utils.
Nothing in this module should have an knowledge of config or the layout
and structure of the site and pages in the site.
"""
from __future__ import unicode_literals
import logging
import markdown
import os
import pkg_resources
import shutil
import re
import sys
import yaml
import fnmatch
... | {
"content_hash": "e01736f437656f31722f65d7f5c97c78",
"timestamp": "",
"source": "github",
"line_count": 482,
"max_line_length": 96,
"avg_line_length": 29.605809128630707,
"alnum_prop": 0.6124036440084093,
"repo_name": "lukfor/mkdocs",
"id": "eb9f7a42dae7b3897d349343f91bf8240aae95ee",
"size": "14287... |
from urlmapper import settings
from .models import URLMap
def get_mapped_url(key, request=None):
"""
Return the URL for a given key, or None if one does not exist.
"""
if key not in settings.URLMAPPER_KEYS:
if settings.URLMAPPER_RAISE_EXCEPTION:
raise KeyError(
"Ke... | {
"content_hash": "bcaa1dcc9a515d3c926503d7c864fb6c",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 79,
"avg_line_length": 26.361702127659573,
"alnum_prop": 0.5544794188861986,
"repo_name": "TwigWorld/django-url-mapper",
"id": "7fa84e3799006bf74e10d70e9bd02573c8da1751",
"... |
"""
Machine arithmetics - determine the parameters of the
floating-point arithmetic system
Author: Pearu Peterson, September 2003
"""
from __future__ import division, absolute_import, print_function
__all__ = ['MachAr']
from numpy.core.fromnumeric import any
from numpy.core._ufunc_config import errstate
from numpy.... | {
"content_hash": "ca79bfee3dbb2d7fbb1e1e2b86d5522f",
"timestamp": "",
"source": "github",
"line_count": 344,
"max_line_length": 88,
"avg_line_length": 31.569767441860463,
"alnum_prop": 0.49806629834254146,
"repo_name": "jorisvandenbossche/numpy",
"id": "202580bdb0649a6f3995c126f081df97f8423c41",
"s... |
from chainer.backends import cuda
from chainer.backends import intel64
from chainer import optimizer
_default_hyperparam = optimizer.Hyperparameter()
_default_hyperparam.lr = 0.01
_default_hyperparam.momentum = 0.9
class MomentumSGDRule(optimizer.UpdateRule):
"""Update rule for the classical momentum SGD.
... | {
"content_hash": "3572a779f095dbfd761771d5fbedbdc0",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 78,
"avg_line_length": 31.119565217391305,
"alnum_prop": 0.5990220048899756,
"repo_name": "aonotas/chainer",
"id": "b1b298fd767713e2df49ab932bf38914527a9790",
"size": "2863... |
"""empty message
Revision ID: 1667a11b3a01
Revises: None
Create Date: 2015-12-09 14:42:40.773000
"""
# revision identifiers, used by Alembic.
revision = '1667a11b3a01'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###... | {
"content_hash": "816bbac6a9f042cdbdcdb9b672b31713",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 63,
"avg_line_length": 24.129032258064516,
"alnum_prop": 0.6764705882352942,
"repo_name": "devopsec/threatdetectionservice",
"id": "b81090c8cc74f05b770025646d2610a7da2026ca",... |
from itertools import count
from collections import defaultdict
import logging
from typing import List, Optional
import networkx
import ailment
from ailment import Block
from ...utils.graph import dfs_back_edges, subgraph_between_nodes, dominates, shallow_reverse
from .. import Analysis, register_analysis
from ..cfg... | {
"content_hash": "4a22e88012c90fe7d57001a06c6af30b",
"timestamp": "",
"source": "github",
"line_count": 924,
"max_line_length": 130,
"avg_line_length": 40.416666666666664,
"alnum_prop": 0.5391886464051413,
"repo_name": "angr/angr",
"id": "7749d5dc93fdba9f105ea19e89173414f77a75fa",
"size": "37345",
... |
import json
import sys
import requests
# tested with python 3.6 and requests 2.13.0
if len(sys.argv) != 2:
sys.stderr.write('usage: program <milestone-number>\n')
sys.stderr.write('Provide the github milestone number, not name. (e.g., 19 instead of 0.10.1)\n')
sys.exit(1)
milestone_num = sys.argv[1]
done = F... | {
"content_hash": "020d8a765262bb91bbb98168d8566f80",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 149,
"avg_line_length": 30,
"alnum_prop": 0.7105263157894737,
"repo_name": "dkhwangbo/druid",
"id": "88b4e49dfe24bded27aaba309559d5e3832ffe9d",
"size": "1164",
"binary": ... |
'''
Created on 22 avr. 2016
@author: aidturith
'''
# https://docs.python.org/3/howto/logging.html
import logging
logging.basicConfig(format='[%(asctime)s] - %(levelname)s - %(message)s',
datefmt='%m/%d/%Y %I:%M:%S',
level=logging.DEBUG,
filename='temp\examp... | {
"content_hash": "79ce79e9be0bcacf93eeac31162fd18d",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 97,
"avg_line_length": 25.178571428571427,
"alnum_prop": 0.5829787234042553,
"repo_name": "Aidturith/python-training",
"id": "c75ab4f1b08a3c959eac9d78c3b54388fb69ec7f",
"si... |
__author__ = 'matthieu'
import argparse
from cStringIO import StringIO
from docker import Client
dcl = Client()
parser = argparse.ArgumentParser(description='PGXL startpack')
parser.add_argument('--ip', dest="ip", action="store_true", help="print container IP")
parser.add_argument('--ncontainers', dest="ncontainers... | {
"content_hash": "b543124370e335bded8a223c2a1ff1de",
"timestamp": "",
"source": "github",
"line_count": 226,
"max_line_length": 122,
"avg_line_length": 28.513274336283185,
"alnum_prop": 0.6579764121663563,
"repo_name": "postmind-net/pgxl-docker",
"id": "d693d2c79f34b5bf3d0d0a0ebfa138abe96013bd",
"s... |
import bcrypt
def generate_password(password, rounds=10, encoding='utf-8'):
"""Generate a new password based on a random salt.
Args:
password (string): The password to generate the hash off
rounds (int): The complexity of the hashing
Returns:
mixed: The generated password and the... | {
"content_hash": "67e587282cd7a539453d5b077aacdeab",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 76,
"avg_line_length": 33.666666666666664,
"alnum_prop": 0.6872937293729373,
"repo_name": "watsonpy/watson-auth",
"id": "cee21d8d21cf411255137426fe71d6518125c2dd",
"size": ... |
from datetime import datetime
from django.conf import settings
from oauth_tokens.api import ApiAbstractBase, Singleton
from oauth_tokens.models import AccessToken
from tweepy import TweepError as TwitterError
import tweepy
__all__ = ['api_call', 'TwitterError']
TWITTER_CLIENT_ID = getattr(settings, 'OAUTH_TOKENS_TWI... | {
"content_hash": "aeaecaa4398b309844eadf2e2354af57",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 126,
"avg_line_length": 41.036144578313255,
"alnum_prop": 0.6212566059894304,
"repo_name": "manoranjanp/django-twitter-api",
"id": "b514e7368fbb39b5fea2229938e2b494308b4881",... |
from PySide import QtGui
import sys
class DialogGUIBox(QtGui.QWidget):
def __init__(self, build_plot_display):
super(DialogGUIBox, self).__init__()
# Callback for bgsub plotting function
self.build_plot_display = build_plot_display
QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', ... | {
"content_hash": "7c1f8d94791bfe69d8a2550797cb3ac9",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 74,
"avg_line_length": 33.675324675324674,
"alnum_prop": 0.6378711916698805,
"repo_name": "danushkana/pyspectrum",
"id": "d0c84c45d52ed30ec971242b0de25105fbac6d71",
"size":... |
import os
import numpy.testing as npt
import numpy as np
import pytest
from scipy import stats
from statsmodels.distributions.mixture_rvs import mixture_rvs
from statsmodels.nonparametric.kde import KDEUnivariate as KDE
import statsmodels.sandbox.nonparametric.kernels as kernels
import statsmodels.nonparametric.bandw... | {
"content_hash": "04c49f89ca379b0effe7c4fde690a6e0",
"timestamp": "",
"source": "github",
"line_count": 390,
"max_line_length": 83,
"avg_line_length": 32.88974358974359,
"alnum_prop": 0.6214235596788025,
"repo_name": "jseabold/statsmodels",
"id": "fc1e31676640c4df1e27e3bc2f5f03f2a04fefd4",
"size": ... |
class Target:
def __init__(self,tName,tEffectiveness,tRat):
self.theName = tName
self.theEffectiveness = tEffectiveness
self.theRationale = tRat
def name(self): return self.theName
def effectiveness(self): return self.theEffectiveness
def rationale(self): return self.theRationale
def __getitem_... | {
"content_hash": "d09668de5110a3cdcfa370b2fb751a8b",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 55,
"avg_line_length": 28.058823529411764,
"alnum_prop": 0.6855345911949685,
"repo_name": "RobinQuetin/CAIRIS-web",
"id": "463e6c81e5dab953778dde528cf1949b6ecdef4a",
"size"... |
from django.conf import settings
from django.db import transaction
from django.http import Http404, HttpResponse
from django.shortcuts import render, redirect, get_object_or_404
from django.views import static
from django.contrib.auth.decorators import login_required
from .models import Page, File
from .forms import P... | {
"content_hash": "494e3f0d8439e36c15b2702efc661df4",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 91,
"avg_line_length": 24.96923076923077,
"alnum_prop": 0.6050523721503389,
"repo_name": "euroscipy/symposion",
"id": "2f58381a077c219122d207515cd6c4d8e113bc5a",
"size": "... |
import sys
PY2 = sys.version_info[0] == 2
if PY2:
from urllib import quote, unquote, urlencode
from urllib2 import URLError, urlopen
from urlparse import ParseResult, urlparse, parse_qsl
bytes_ = str
str_ = unicode
cmp = cmp
else:
from urllib.error import URLError
from urllib.request... | {
"content_hash": "2cde2e9af632da01db7e52e1dfe2c906",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 88,
"avg_line_length": 22.448275862068964,
"alnum_prop": 0.6774193548387096,
"repo_name": "elliterate/capybara.py",
"id": "a70948cbe4a29a05f4a573a0843135b81b50468b",
"size"... |
import logging
from typing import List, Optional
from sqlalchemy.exc import SQLAlchemyError
from superset.dao.base import BaseDAO
from superset.dao.exceptions import DAODeleteFailedError
from superset.extensions import db
from superset.models.sql_lab import SavedQuery
from superset.queries.saved_queries.filters impor... | {
"content_hash": "259d2a12d84241f6fc78d746687ef652",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 85,
"avg_line_length": 32.03225806451613,
"alnum_prop": 0.6817724068479355,
"repo_name": "airbnb/superset",
"id": "cd20fe60de583fb2aef461fa44e84b1464c2da6f",
"size": "1778"... |
import sys
import os.path
import unittest
sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), "..")))
from gnomeread import AboutGnomereadDialog
class TestExample(unittest.TestCase):
def setUp(self):
self.AboutGnomereadDialog_members = [
'AboutDialog', 'AboutGnomereadDialog... | {
"content_hash": "2ca7678d483c91b3985707089fd1c1b3",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 83,
"avg_line_length": 34.3,
"alnum_prop": 0.685131195335277,
"repo_name": "vrutkovs/LightRead",
"id": "7cf97fbb4521291ecd64d7e382e89ee9470c9a32",
"size": "2528",
"binary... |
from django.conf.urls import url
from returntoclinic.views import ReturnToClinicView
urlpatterns = [
url(r'^$', ReturnToClinicView.as_view()),
url(r'^([0-9]+)/$', ReturnToClinicView.as_view()),
]
| {
"content_hash": "ea008dffaf10abc5369a87ee8454330f",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 54,
"avg_line_length": 29.285714285714285,
"alnum_prop": 0.697560975609756,
"repo_name": "slogan621/tscharts",
"id": "89597c2c28143a26e84573ecb7b5a07e03263f18",
"size": "816... |
from pathlib import Path
from typing import Union
from ..base import ParametrizedValue
class Logger(ParametrizedValue):
args_joiner = ','
def __init__(self, alias, *args):
self.alias = alias or ''
super().__init__(*args)
class LoggerFile(Logger):
"""Allows logging into files."""
... | {
"content_hash": "66aed3f2ef8e7ec0d771d4f8fb4d3bc1",
"timestamp": "",
"source": "github",
"line_count": 212,
"max_line_length": 109,
"avg_line_length": 22.410377358490567,
"alnum_prop": 0.5704062302673122,
"repo_name": "idlesign/uwsgiconf",
"id": "207d330b029ec5116621f5606cef9a80872b5bbc",
"size": ... |
import logging
try:
import Queue as queue
except ImportError:
import queue
from .templates import AttributeDict
logger = logging.getLogger('itchat')
class Queue(queue.Queue):
def put(self, message):
queue.Queue.put(self, Message(message))
class Message(AttributeDict):
def down... | {
"content_hash": "49db1dbec8f76788e1d9d828fa49e350",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 80,
"avg_line_length": 31.8125,
"alnum_prop": 0.5176817288801572,
"repo_name": "tongxindao/shiyanlou",
"id": "db814b906f3b0f9940ca13c0213f3b10b5e3ca8a",
"size": "1018",
"... |
class Solution:
# @param root, a tree node
# @return a list of integers
def inorderTraversal(self, root):
ret = []
if root:
self.traversal(root, ret)
return ret
def traversal(self, root, ret):
if root is None:
return
self.traversal(root.le... | {
"content_hash": "de2de8d946978674d149972c26448f16",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 39,
"avg_line_length": 26.533333333333335,
"alnum_prop": 0.5603015075376885,
"repo_name": "Fity/2code",
"id": "5025a6a5afd1f8353ce4a9e56a1ff1fb415af299",
"size": "585",
"... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/food/foraged/shared_edible_jar_berries.iff"
result.attribute_template_id = 5
result.stfName("food_name","edible_berries")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "6d57febdae2509a8b47c4df6f4f5c18f",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 79,
"avg_line_length": 24.076923076923077,
"alnum_prop": 0.7028753993610224,
"repo_name": "obi-two/Rebelion",
"id": "ca3b2b1954c6bf6bfe90303c9e3692242eb05054",
"size": "458... |
from haystack import indexes
from test_haystack.discovery.models import Foo, Bar
class FooIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, model_attr='body')
def get_model(self):
return Foo
class BarIndex(indexes.SearchIndex, indexes.Indexable):
text = inde... | {
"content_hash": "fdef1998039c4fecc88c5d23e7e2e6d7",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 62,
"avg_line_length": 24.625,
"alnum_prop": 0.7284263959390863,
"repo_name": "kybi/django-haystack",
"id": "498884b20a81ecfc5e48eecc42709d75848f49ea",
"size": "394",
"bi... |
"""
A library for working with BackendInfoExternal records, describing backends
configured for an application. Supports loading the records from backend.yaml.
"""
# WARNING: This file is externally viewable by our users. All comments from
# this file will be stripped. The docstrings will NOT. Do not put sensitive... | {
"content_hash": "d6a2da1148757206e144f20a5c802da5",
"timestamp": "",
"source": "github",
"line_count": 219,
"max_line_length": 80,
"avg_line_length": 29.91780821917808,
"alnum_prop": 0.6874236874236874,
"repo_name": "GoogleCloudPlatform/appengine-config-transformer",
"id": "1e8cfea20a0e73ee11c44fdde... |
"""
STK500v2 protocol implementation for programming AVR chips.
The STK500v2 protocol is used by the ArduinoMega2560 and a few other Arduino platforms to load firmware.
"""
__copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License"
import os, struct, sys, time
from serial import Seri... | {
"content_hash": "6cab2ff9d32711d0a7d063e3bdbb027c",
"timestamp": "",
"source": "github",
"line_count": 208,
"max_line_length": 162,
"avg_line_length": 31.326923076923077,
"alnum_prop": 0.6629834254143646,
"repo_name": "0x000000FF/yocto-edison-meta",
"id": "5f8969cbc83754e7c3bd8b6910dc4f66b7c361ee",
... |
BOT_NAME = 'datacollecter'
SPIDER_MODULES = ['datacollecter.spiders']
NEWSPIDER_MODULE = 'datacollecter.spiders'
# Crawl responsibly by identifying yourself (and your website) on the user-agent
#USER_AGENT = 'datacollecter (+http://www.yourdomain.com)'
# Configure maximum concurrent requests performed by Scrapy (de... | {
"content_hash": "7f861085f27490ba2d7ff596dc4f2b1e",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 109,
"avg_line_length": 34.62820512820513,
"alnum_prop": 0.7804516845612736,
"repo_name": "Comp4710AprioriTextIllustrator/TextIllustrator",
"id": "1e6060f9c8bca618875ece72bd0... |
import pandas as pd
from bs4 import BeautifulSoup
import requests
# website path for zip codes in Nevada
path = 'https://www.incomebyzipcode.com/'
# zip_code list
# zip_codes = pd.read_csv('geo_data_location.csv')
zip_codes = pd.read_csv('zip_info.csv')
cols = [c for c in zip_codes.columns if c.lower()[:4] != 'unna... | {
"content_hash": "86070358fe70687e1698da36cfd4317f",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 112,
"avg_line_length": 33.186440677966104,
"alnum_prop": 0.6128702757916241,
"repo_name": "dgvisnadi/us_income_map_and_scrap",
"id": "4ba1c49606e5515c78bbed2ee772f86423821d1... |
import datetime
import numpy as np
import pytest
from pandas import (
DataFrame,
Series,
_testing as tm,
)
from pandas.tests.io.pytables.common import ensure_clean_store
pytestmark = pytest.mark.single_cpu
def test_store_datetime_fractional_secs(setup_path):
with ensure_clean_store(setup_path) as ... | {
"content_hash": "085440a8b90f89e285e6f93084f3c25e",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 76,
"avg_line_length": 29.575757575757574,
"alnum_prop": 0.6219262295081968,
"repo_name": "datapythonista/pandas",
"id": "6625984961c116917aab7a15a91f062dc5b56832",
"size":... |
"""Support for Broadlink switches."""
from __future__ import annotations
from abc import ABC, abstractmethod
import logging
from typing import Any
from broadlink.exceptions import BroadlinkException
import voluptuous as vol
from homeassistant.components.switch import (
PLATFORM_SCHEMA,
SwitchDeviceClass,
... | {
"content_hash": "25b2d5baf0b6f0abbdfbfcfa6d4cb57f",
"timestamp": "",
"source": "github",
"line_count": 295,
"max_line_length": 83,
"avg_line_length": 31.040677966101693,
"alnum_prop": 0.6271704706781697,
"repo_name": "w1ll1am23/home-assistant",
"id": "009536a9adb1b5e2acc90ebe49efde750745f612",
"si... |
from django.db import models
class Blog(models.Model):
message = models.CharField(max_length=200)
update_time = models.DateField(auto_now=True) | {
"content_hash": "679ca7a2ba705d8f4e254dbae7190395",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 49,
"avg_line_length": 30.4,
"alnum_prop": 0.75,
"repo_name": "mattjmorrison/django-appengine-playground",
"id": "ce01cd13b9bc29734b945ea78040a874fa4c9033",
"size": "152",
... |
"""empty message
Revision ID: 3b4fa74ecad
Revises: 2afb44ff17b
Create Date: 2015-06-10 03:07:17.438247
"""
# revision identifiers, used by Alembic.
revision = '3b4fa74ecad'
down_revision = '2afb44ff17b'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
def upgrade():
###... | {
"content_hash": "edeb3290e7a6ae204a703645c5beacfe",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 94,
"avg_line_length": 45.645669291338585,
"alnum_prop": 0.6612040710712438,
"repo_name": "podhub-io/website",
"id": "609d93fa68dda97946468089a75a2f8a812e387e",
"size": "5... |
from __future__ import unicode_literals
import re
from indico.core.db import db
from indico.core.plugins import plugin_engine
from indico.modules.events.payment import PaymentPluginMixin
from indico.modules.events.payment.models.transactions import PaymentTransaction, TransactionStatus
from indico.modules.events.regi... | {
"content_hash": "e21ec660088a0c48c175c642d38b7ede",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 104,
"avg_line_length": 45.816326530612244,
"alnum_prop": 0.7006681514476615,
"repo_name": "mic4ael/indico",
"id": "65d7dcd76f0e19f95693ad1f68330cf15701eba4",
"size": "2459... |
from ctypes import *
from comtypes import IUnknown, COMMETHOD, GUID, HRESULT, dispid
_GUID = GUID
class tagCONNECTDATA(Structure):
_fields_ = [
('pUnk', POINTER(IUnknown)),
('dwCookie', c_ulong),
]
CONNECTDATA = tagCONNECTDATA
########################################################... | {
"content_hash": "73973b5e624baa83b2977d284359fc4a",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 81,
"avg_line_length": 34.58510638297872,
"alnum_prop": 0.523838818824977,
"repo_name": "ezarko/cfn-init",
"id": "2108231350ed2f178ddbeaf114b3d7ebbc7741c3",
"size": "3251",... |
'''
Defines objects for managing communication between Clique and an underlying GUI.
@author: Peter Parente <[email protected]>
@copyright: Copyright (c) 2008 Peter Parente
@license: BSD License
All rights reserved. This program and the accompanying materials are made
available under the terms of The BSD License whi... | {
"content_hash": "16d39087b2a583bb23782cf925bffe4a",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 80,
"avg_line_length": 33.58064516129032,
"alnum_prop": 0.7857829010566763,
"repo_name": "parente/clique",
"id": "5d902237dbb5b3ca7a1dd86eee4ee29ca51b9cbf",
"size": "1041",... |
import configparser
import json
import logging
import os
import signal
import collections
from .requesthandlers.vt_request import make_request_to_vt
from . import urls
from . import config
from .scheduler import Scheduler
from .dispatcher import Dispatcher
from .receptionist import Receptionist
class Server:
def... | {
"content_hash": "ebe4d88699fb470a902fc85de68c0b27",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 109,
"avg_line_length": 34,
"alnum_prop": 0.5803727431566686,
"repo_name": "mwalercz/virus-total-helper",
"id": "18748767babfbdab3dca4e08f50f45cfa3b521c0",
"size": "3434",... |
"""Dummy no-op test to be used in the webdriver test."""
import logging
import sys
import unittest
class DummyTest(unittest.TestCase):
def test_dummy(self):
logging.info('Dummy output.')
if __name__ == '__main__':
logging.getLogger().setLevel(logging.INFO)
del sys.argv[1:]
unittest.main()
| {
"content_hash": "2f0980d4222e08e03b94a70afec1b95b",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 56,
"avg_line_length": 18.11764705882353,
"alnum_prop": 0.685064935064935,
"repo_name": "theskyinflames/bpulse-go-client",
"id": "9f779ed4ca4a5ba608584dd508026dd0868f08e3",
... |
from setuptools import setup, find_packages
setup(
name='typogrify-hyde',
version='1.0.1a',
packages=find_packages(),
author='Christian Metts',
author_email='[email protected]',
license='BSD',
description='Typography related template filters for Django & Jinja2 applications',
url='htt... | {
"content_hash": "4326fc4d021f92cd55f7b676e9b56ad1",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 87,
"avg_line_length": 30.6,
"alnum_prop": 0.6352941176470588,
"repo_name": "hyde/typogrify",
"id": "d2b21a1f7e3a520f1dda0647ccfcb0492e86d830",
"size": "765",
"binary": f... |
__author__ = 'olesya'
import api_request
import logging
import json
import datetime
import time
class EventbriteApi(api_request.ApiRequest):
def __init__(self):
self.source = "eventbrite"
self.settings = self.get_settings(self.source)
def request_events(self, city=None, category=... | {
"content_hash": "437f772609de8d49bdd3f3803acadfff",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 121,
"avg_line_length": 43.2375,
"alnum_prop": 0.5059265683723619,
"repo_name": "denbedilov/ATTENDER",
"id": "e5f1b6badde19e0004cbf11c5b3dc42af9fae476",
"size": "3459",
"... |
import random
class Chromosome:
def __init__(self, chain):
self.chain = chain
self.length = len(chain)
@classmethod
def cross(cls, parent1, parent2, mutation_rate):
switch_point = random.choice(range(parent1.length))
chains = [parent1.chain[:switch_point] + parent2.chain[switch_point:], parent2.chain[:swit... | {
"content_hash": "ad28e125256a8ca958613cd0e12dd348",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 133,
"avg_line_length": 29.011111111111113,
"alnum_prop": 0.6924549980850249,
"repo_name": "aleknaui/py-genetic",
"id": "6d9ba12d59e1fcf09e71f0e48cbf1e308f35225b",
"size": ... |
"""Provides device automations for Media player."""
from __future__ import annotations
import voluptuous as vol
from homeassistant.components.automation import (
AutomationActionType,
AutomationTriggerInfo,
)
from homeassistant.components.device_automation import (
DEVICE_TRIGGER_BASE_SCHEMA,
entity,
... | {
"content_hash": "5c2b5bd6691ecaba5e351d5b161fc904",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 88,
"avg_line_length": 30.76984126984127,
"alnum_prop": 0.6572091823574929,
"repo_name": "toddeye/home-assistant",
"id": "e0c88489841dfc5119cd77d5c41a53d6bb20ab8d",
"size"... |
import pika
connection = pika.BlockingConnection(pika.ConnectionParameters(
host='localhost'))
channel = connection.channel()
channel.queue_declare(queue='hello')
print ' [*] Waiting for messages. To exit press CTRL+C'
def callback(ch, method, properties, body):
print " [x] Received %r" % (body,)
channel... | {
"content_hash": "492e5ab38a67487635faf88ae8fe47c0",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 63,
"avg_line_length": 22.15,
"alnum_prop": 0.654627539503386,
"repo_name": "theofilis/tutorial-rabbitMQ",
"id": "ffa099186e00016eac269097d9ddb547a4dcdaf7",
"size": "465",
... |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 0, transform = "Quantization", sigma = 0.0, exog_count = 0, ar_order = 0); | {
"content_hash": "622d36a1d0da318fb7b7406e6c2b76e6",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 167,
"avg_line_length": 38.142857142857146,
"alnum_prop": 0.7078651685393258,
"repo_name": "antoinecarme/pyaf",
"id": "3f8213b3bb10f4e8a4d44b4410e2e07c5450ba1f",
"size": "26... |
from django.test import TestCase
from keywords.forms import KeywordCreateForm
class KeywordCreateFormTest(TestCase):
def test_KeywordCreateForm_allows_blank_items(self):
form = KeywordCreateForm(data={"keyword": ""})
self.assertTrue(form.is_valid())
| {
"content_hash": "3e9f7a844433c48f00e9484d94d95e33",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 56,
"avg_line_length": 27.4,
"alnum_prop": 0.7408759124087592,
"repo_name": "patcurry/WebGIS",
"id": "303f6e4d00bd07786657a480e35976085d70acdb",
"size": "274",
"binary": ... |
"""
The GPO Reference Aggregate Manager v2, showing how to implement
the GENI AM API version 2. This AggregateManager has only fake resources.
Invoked from gcf-am.py
The GENI AM API is defined in the AggregateManager class.
"""
import base64
import datetime
import dateutil.parser
import logging
import os
import uuid
i... | {
"content_hash": "02d6d17cb2c109e53b53148281f088ba",
"timestamp": "",
"source": "github",
"line_count": 675,
"max_line_length": 183,
"avg_line_length": 45.83259259259259,
"alnum_prop": 0.5897145812457575,
"repo_name": "EICT/C-BAS",
"id": "33a4fe598edf5f5be85b6b9ffeb440d814c0e974",
"size": "32149",
... |
activate_this_file = "{{ os_loganalyze_venv_path }}/bin/activate_this.py"
execfile(activate_this_file, dict(__file__=activate_this_file))
import threading
from os_loganalyze import wsgi
ROOT_PATH = '{{ os_loganalyze_root_dir }}'
WSGI_CONFIG = '/etc/os_loganalyze/wsgi.conf'
def create_application():
def applic... | {
"content_hash": "4dc099c94bfd46fdd1fb41c0900c303c",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 73,
"avg_line_length": 26.608695652173914,
"alnum_prop": 0.6176470588235294,
"repo_name": "BonnyCI/hoist",
"id": "3aacb2a3a77b3d64db63fa1d2806de97a865a8ea",
"size": "1202",... |
class StencilDataDataListener(object):
"""Listen to any changes of the data of the StencilData object.
"""
def data_changed(self):
"""Data has changed.
"""
raise NotImplementedError
class StencilDataStencilListListener(object):
"""Listen to changes in the stencil list of the S... | {
"content_hash": "51b10f8d3e8de840789aec0caa9be38e",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 99,
"avg_line_length": 27.560439560439562,
"alnum_prop": 0.5921052631578947,
"repo_name": "havogt/serialbox2",
"id": "3133b43f928c71c453fdf6fe9b35ebc147808a9d",
"size": "29... |
"""Test multisig RPCs"""
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_raises_rpc_error,
assert_equal,
)
from test_framework.key import ECPubKey
import binascii
import decimal
import itertools
class RpcCreateMultiSigTest(BitcoinTestFramework):
def... | {
"content_hash": "fe82082a589b1148412c5cbc21bda5a2",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 160,
"avg_line_length": 40.91095890410959,
"alnum_prop": 0.6289971538590323,
"repo_name": "ledvina/zencoin",
"id": "c561f72b42a8c669bad403750e3066894ea2e05e",
"size": "618... |
import collections
import re
import sys
import warnings
from bs4.dammit import EntitySubstitution
DEFAULT_OUTPUT_ENCODING = "utf-8"
PY3K = (sys.version_info[0] > 2)
whitespace_re = re.compile("\s+")
def _alias(attr):
"""Alias one attribute name to another for backward compatibility"""
@property
def alias... | {
"content_hash": "d103b25da70dc5f9feb8d6f66e9f497a",
"timestamp": "",
"source": "github",
"line_count": 1355,
"max_line_length": 104,
"avg_line_length": 36.6649446494465,
"alnum_prop": 0.5646826754694954,
"repo_name": "kevlar1818/mipster",
"id": "88e7460f9172fa852cdcf8834b7fa2173211035e",
"size": "... |
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.utils.datastructures import SortedDict
from django.utils.translation import... | {
"content_hash": "c44980ac5d676d73401ed8ae0e0f57d5",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 146,
"avg_line_length": 36.75974025974026,
"alnum_prop": 0.6740858505564388,
"repo_name": "alex/pinax",
"id": "1248dd0f780b5084278e1093e36d1b10bfbe2658",
"size": "5661",
... |
'''
Created on 2013-1-10
@author: [email protected]
@version: 1.0
'''
import sys, logging, util.ApiUtil as util, xml.dom as dom, xml.dom.minidom as minidom
import traceback, base64
from .util.ApiUtil import BaseResult
X_CNC_REQUEST_ID = 'x-cnc-request-id'
X_CNC_DATE = 'x-cnc-date'
X_CNC_LOCATION = 'location'
X... | {
"content_hash": "9d2dc3572e8a8b6a357c1ef660436783",
"timestamp": "",
"source": "github",
"line_count": 791,
"max_line_length": 158,
"avg_line_length": 38.80530973451327,
"alnum_prop": 0.5923440299723082,
"repo_name": "kendazheng/wizcloud2",
"id": "f7d3449f167ca05cc81e3ec175a28a66f2010169",
"size":... |
from __future__ import unicode_literals
import boto3
import boto
import boto.s3
import boto.s3.key
from botocore.exceptions import ClientError
from moto import mock_cloudformation, mock_s3, mock_sqs
import json
import sure # noqa
# Ensure 'assert_raises' context manager support for Python 2.6
import tests.backport_a... | {
"content_hash": "5b94797ccbfa723c006b464521f507e4",
"timestamp": "",
"source": "github",
"line_count": 638,
"max_line_length": 86,
"avg_line_length": 30.684952978056426,
"alnum_prop": 0.6243040302395668,
"repo_name": "kefo/moto",
"id": "ed2ee833738554d3e6427e1e2a70778bdcea30e8",
"size": "19577",
... |
from django.db import models
from django.core.validators import RegexValidator
from django.utils.functional import lazy
# Constants
REGION_CHOICE = (
('South','South'),
('North','North'),
)
class NorthPlaceChoice(models.Model):
place = models.CharField(max_length=30)
def __unicode__(self):
return self.place
cl... | {
"content_hash": "086bac63d598fe6825cae20ca841b11e",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 142,
"avg_line_length": 38.76315789473684,
"alnum_prop": 0.7576374745417516,
"repo_name": "triump0870/outing",
"id": "a73e7aebd9a28cd8d0805ffff126c360999c4490",
"size": "14... |
from flask import json
from jinja2 import escape
from wtforms.widgets import HTMLString, html_params
from flask_admin._compat import as_unicode
from flask_admin.babel import gettext
from flask_admin.helpers import get_url
from flask_admin.form import RenderTemplateWidget
class InlineFieldListWidget(RenderTemplateWid... | {
"content_hash": "bec1075308e60ecc56ab72f17ac44fff",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 93,
"avg_line_length": 37.032467532467535,
"alnum_prop": 0.5732070839908819,
"repo_name": "janusnic/flask-admin",
"id": "e2cd1544bcf9452db72f03ffa1e8c2220b75a675",
"size":... |
"""
githubimporter
~~~~~~~~~~~~~~
Imports code directly from github.
:copyright: (c) Copyright 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
import imp
import urllib
import urlparse
class GithubImporter(object):
url_template = 'https://raw.github.com/%(u... | {
"content_hash": "915e3eb92946dbb6d944bdb3f3411f3e",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 80,
"avg_line_length": 28.533333333333335,
"alnum_prop": 0.5253115264797508,
"repo_name": "mitsuhiko/badideas",
"id": "c3ecdb33f216677d978f73648996b2a2637e6560",
"size": "2... |
from typing import Dict, List
from joueur.base_game import BaseGame
# import game objects
from games.stardash.body import Body
from games.stardash.game_object import GameObject
from games.stardash.job import Job
from games.stardash.player import Player
from games.stardash.projectile import Projectile
from games.starda... | {
"content_hash": "a2d567d322c68756630d240652b325ec",
"timestamp": "",
"source": "github",
"line_count": 273,
"max_line_length": 207,
"avg_line_length": 32.395604395604394,
"alnum_prop": 0.6073043871551335,
"repo_name": "JacobFischer/Joueur.py",
"id": "11c7ef892fa4325bb4467c75406fd52241f82e43",
"siz... |
"""
.. codeauthor:: Cédric Dumay <[email protected]>
"""
from cdumay_result import Result
from kafka import KafkaProducer
from kser.controller import BaseProducer
class Producer(BaseProducer):
"""Mother class for producers"""
def __init__(self, config):
""" Create new Producer instance using p... | {
"content_hash": "a22535ad320b7662118f344f459691be",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 75,
"avg_line_length": 30.814285714285713,
"alnum_prop": 0.5836810384793695,
"repo_name": "cdumay/kser",
"id": "b0926161d22566198158bc108c69a7d2b287e8b3",
"size": "2205",
... |
from . import base
class Section(base.SectionBase):
def gc(self, *, return_result=True, **kwargs):
"""Removes stored objects that are not pinned from the repo.
.. code-block:: python
>>> client.repo.gc()
[{'Key': 'QmNPXDC6wTXVmZ9Uoc8X1oqxRRJr4f1sDuyQuwaHG2mpW2'},
{'Key': 'QmNtXbF3AjAk59gQKRgEdVabHcSs... | {
"content_hash": "ed3de5da8d4a003380f62b2a0dbcff21",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 69,
"avg_line_length": 31.84931506849315,
"alnum_prop": 0.5690322580645162,
"repo_name": "alexander255/py-ipfs-api",
"id": "65f4a8391dbdfdbdd3a03bf6a400bfd00b00714d",
"size... |
from __future__ import unicode_literals
from django.test import TestCase
from testfixtures import LogCapture
import frame_logging.log as log
class Order(object):
def __init__(self):
self.customer = {'id': 1}
class FrameLoggingTest(TestCase):
def test_default_info(self):
with LogCapture() a... | {
"content_hash": "7139faf48cab4afb9aea8a519c529b06",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 98,
"avg_line_length": 35.45,
"alnum_prop": 0.561706629055007,
"repo_name": "ItsfBisounours/frame_logging",
"id": "a9ad3362171fc8ffa4165e3ea4a8612f7111906f",
"size": "2860"... |
from __future__ import unicode_literals
from django.db import models
# We're adding a Meta option of 'mario' to the defaults so we can set it for these models
# then the MarioRouter can point at the separate database for these specific models
import django.db.models.options as options
options.DEFAULT_NAMES = options.... | {
"content_hash": "8ddf56fdfb3d09cb2056914344f89c21",
"timestamp": "",
"source": "github",
"line_count": 334,
"max_line_length": 170,
"avg_line_length": 92.5119760479042,
"alnum_prop": 0.755331887763358,
"repo_name": "CSCSI/Lost-Visions",
"id": "c8f973af2837529c5f025ae91e496e012cce4a7f",
"size": "31... |
import argparse
import os
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
from tensorflow.python.lib.io.tf_record import TFRecordCompressionType
def dataset_to_file(feature_iter, filename):
writer = tf.python_io.TFRecordWriter(
filename,
options=tf.python_io.TFRecordO... | {
"content_hash": "3befccb51d3cc76cb57f7a838269ea13",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 76,
"avg_line_length": 35.95348837209303,
"alnum_prop": 0.6623544631306598,
"repo_name": "fluxcapacitor/source.ml",
"id": "67040a866933cdda3869f7cdc9297a407e431495",
"size"... |
import time
import numpy.random as npr
from hypergrad.odyssey import omap
objects = [1, (3,4), 1.04, "hello", "it's \n a hard string \\\''\to parse", ((1,'a'), 3)]
def identity(x):
time.sleep(npr.randint(5))
print x
return x
def check_omap():
# This won't work with nosetest. Needs to be run from the ... | {
"content_hash": "f12f186aade7ad7fcc3338928cd6d3fa",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 89,
"avg_line_length": 26.55,
"alnum_prop": 0.608286252354049,
"repo_name": "bigaidream-projects/drmad",
"id": "777df46e71f064e14502129e46a5ac1f325eb06b",
"size": "531",
... |
from argparse import ArgumentParser
import collections
import json
import re
import os
import sys
# TODO: Replace commented-out debugging statements
# with debug or trace level log statements.
# TODO: Handle cases like CollectionObject (Cataloging)
# where there may be multiple, discrepant record type names.
# (E.g. ... | {
"content_hash": "bd998104290ac8a8555d841fc6eaa929",
"timestamp": "",
"source": "github",
"line_count": 356,
"max_line_length": 199,
"avg_line_length": 43.58988764044944,
"alnum_prop": 0.5971774713236242,
"repo_name": "aronr/Tools",
"id": "1a1ee9389ae2c31c557986489514ae8f87bcc9eb",
"size": "15541",... |
import unittest
import numpy as np
import paddle
import paddle.fluid as fluid
from paddle.fluid import core
from paddle.fluid.dygraph.base import to_variable
from test_imperative_base import new_program_scope
from test_imperative_resnet import ResNet
from paddle.fluid.framework import _test_eager_guard
batch_size = 8... | {
"content_hash": "7e6dfd9d3f62dada53ea4a9f6a6009a5",
"timestamp": "",
"source": "github",
"line_count": 257,
"max_line_length": 80,
"avg_line_length": 35.63813229571984,
"alnum_prop": 0.5093350802489355,
"repo_name": "luotao1/Paddle",
"id": "9e203092dc77b46a333f9b883d24dfdd8ee1db61",
"size": "9770"... |
import carsales_pb2
from common import rand_int, rand_double, rand_bool, from_bytes_helper
from random import choice
MAKES = ["Toyota", "GM", "Ford", "Honda", "Tesla"]
MODELS = ["Camry", "Prius", "Volt", "Accord", "Leaf", "Model S"]
COLORS = ["black", "white", "red", "green", "blue", "cyan", "magenta", "yellow", "silv... | {
"content_hash": "ab7fc51a5ba58acbbbb8b5e5aaa289d1",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 90,
"avg_line_length": 30.726315789473684,
"alnum_prop": 0.6132237067488866,
"repo_name": "SymbiFlow/pycapnp",
"id": "c969070122a0b10708d2cbf9705dfd6f0d5ad11e",
"size": "29... |
_matplotlib_backend = None
def set_backend(backend='agg'):
global _matplotlib_backend
if _matplotlib_backend is None:
_matplotlib_backend = backend
import matplotlib
matplotlib.use(_matplotlib_backend)
return
| {
"content_hash": "2083ba2dfc7e915be141eeab27167ba6",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 43,
"avg_line_length": 24.7,
"alnum_prop": 0.680161943319838,
"repo_name": "tskisner/pytoast",
"id": "495348e416455f6953718544cad4de8bc4b3434b",
"size": "443",
"binary": ... |
"""Module which impements the sequence class and a few of its subclasses."""
import os
from typing import List
import tensorflow as tf
from tensorflow.contrib.tensorboard.plugins import projector
from typeguard import check_argument_types
from neuralmonkey.model.model_part import ModelPart, FeedDict, InitializerSpec... | {
"content_hash": "a3283eaf1386d8af8249db357af33323",
"timestamp": "",
"source": "github",
"line_count": 294,
"max_line_length": 79,
"avg_line_length": 40.40816326530612,
"alnum_prop": 0.6111952861952862,
"repo_name": "juliakreutzer/bandit-neuralmonkey",
"id": "40ad7e92f77ef310059fbd55132b9798702b5586... |
from collections import OrderedDict
from dataclasses import dataclass
from copy import deepcopy
import os.path as op
import re
import numpy as np
from ..defaults import HEAD_SIZE_DEFAULT
from .._freesurfer import get_mni_fiducials
from ..viz import plot_montage
from ..transforms import (apply_trans, get_ras_to_neurom... | {
"content_hash": "530530434c516ff1545df0fbf512090c",
"timestamp": "",
"source": "github",
"line_count": 1682,
"max_line_length": 79,
"avg_line_length": 33.76516052318668,
"alnum_prop": 0.5824309333896783,
"repo_name": "olafhauk/mne-python",
"id": "80968a7cf0a3a6ff1cd774a972e8e5ffb1e34507",
"size": ... |
from fabric.api import run, sudo
from fabric.decorators import with_settings
from fabric.context_managers import shell_env # , settings
from fabric.operations import put
from fabric.colors import red, green, yellow
USERNAME = 'takamaru'
FULLUSERNAME = 'Shoei Takamaru'
@with_settings(warn_only=True)
def update_apt_p... | {
"content_hash": "a96093fb4a6099766fdc30c846705a18",
"timestamp": "",
"source": "github",
"line_count": 487,
"max_line_length": 176,
"avg_line_length": 35.4435318275154,
"alnum_prop": 0.534383871154626,
"repo_name": "takamario/fabric",
"id": "e3fc5cabfd96e6201c33e0396bf1c80f23c82cd0",
"size": "1728... |
import logging
from urllib import quote
from pylons import tmpl_context as c, app_globals as g
from pylons import request
from tg import expose, redirect
from tg.decorators import with_trailing_slash, without_trailing_slash
from bson import ObjectId
from ming.utils import LazyProperty
import allura.tasks
from allura... | {
"content_hash": "5d768e70a1a3b54fac57d2525eef9cc5",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 108,
"avg_line_length": 37.98701298701299,
"alnum_prop": 0.552022792022792,
"repo_name": "apache/incubator-allura",
"id": "6e073d9b9dc4f5ea71dd3d2c4836ac9f7b84f090",
"size... |
import os
from core import path_util
from core import perf_benchmark
from telemetry import benchmark
from telemetry import page as page_module
from telemetry.page import legacy_page_test
from telemetry.page import shared_page_state
from telemetry import story
from telemetry.value import list_of_scalar_values
from be... | {
"content_hash": "b4a149b28ab107f159d31d7ac1ff9832",
"timestamp": "",
"source": "github",
"line_count": 338,
"max_line_length": 80,
"avg_line_length": 30.09467455621302,
"alnum_prop": 0.6936688950058986,
"repo_name": "danakj/chromium",
"id": "3cf3d6550da30fffdbd7ab48a1d29e6c4bea75bc",
"size": "1033... |
"""
Support for Clementine Music Player as media player.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.clementine/
"""
import asyncio
from datetime import timedelta
import logging
import time
import voluptuous as vol
import homeassistant... | {
"content_hash": "2db7ccf732d425c7c18b6f36b8b978ed",
"timestamp": "",
"source": "github",
"line_count": 224,
"max_line_length": 79,
"avg_line_length": 31.040178571428573,
"alnum_prop": 0.6109592981446857,
"repo_name": "shaftoe/home-assistant",
"id": "d9688badcd19fd4f986527524dfe50384dfa6fa0",
"size... |
from . import driver
from . import target
from . import config
from . import asm
import shutil, os
import tempfile, logging
import json
import subprocess
import collections
def assemble(input_file, output_file, args):
return driver.run(config.LLVM['as'],
[input_file, '-o=%s' % output_file])
... | {
"content_hash": "b683fe2227e5736bc4f04030e6525740",
"timestamp": "",
"source": "github",
"line_count": 302,
"max_line_length": 106,
"avg_line_length": 36.4271523178808,
"alnum_prop": 0.5193164257794746,
"repo_name": "Wajihulhassan/SelfContainedPrevirt",
"id": "e28abd342b90a924b6544607040705ee3586c89... |
"""
The classes in this file are interfaces for metrics. They are not intended
to be subclassed or created directly by users. To work with and access metrics,
users should use the classes and methods exposed in metric.py.
Available classes:
- Metric - Base interface of a metrics object.
- Counter - Counter metric int... | {
"content_hash": "59c2e9b0e38faee894676a7895cc2eca",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 80,
"avg_line_length": 28.92391304347826,
"alnum_prop": 0.7147688838782412,
"repo_name": "iemejia/incubator-beam",
"id": "e08872f193e3cf664843f65c0164fb5b7d93df88",
"size":... |
import os
from fabric.api import env, task, local, prefix, lcd
env.repo_url = 'https://github.com/tianyi33/fabric_presentation.git'
env.db_name = 'fabric_presentation'
env.requirement_file = 'requirements.txt'
env.project_path = os.path.abspath(os.path.dirname(__file__))
env.virtualenv_path = (env.virtualenv_path
... | {
"content_hash": "85062b6334c1f6e1f80b17d16f5e6318",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 74,
"avg_line_length": 26.12676056338028,
"alnum_prop": 0.6420485175202156,
"repo_name": "tianyi33/tweetnotes",
"id": "b61d2866aa125f550c65583fad082f5554f43eaf",
"size": "1... |
import matplotlib.pyplot as plt
# make a square figure and axes
# pie chart looks best in square figures
# otherwise it looks like ellipses
plt.figure(1, figsize=(8, 8))
ax = plt.axes([0.1, 0.1, 0.8, 0.8])
# The slices will be ordered and plotted counter-clockwise.
labels = 'Spring', 'Summer', 'Autumn', 'Winter'
valu... | {
"content_hash": "3047a5a0c7e6e7dfc1c0871b204db113",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 59,
"avg_line_length": 26,
"alnum_prop": 0.6807692307692308,
"repo_name": "pletisan/python-data-viz-cookbook",
"id": "f20f97378ff71d4a3d9e2795f6a357298773f355",
"size": "52... |
"""
Periscope API for the masses
"""
from periapi.broadcast import Broadcast
class Listener:
"""Class to check notifications stream for new broadcasts and return new broadcast ids"""
def __init__(self, api, check_backlog=False, cap_invited=False):
self.api = api
self.follows = set([i['user... | {
"content_hash": "e8447c14c63baff38bbd38ce5097d4b0",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 93,
"avg_line_length": 31.604166666666668,
"alnum_prop": 0.6209624258404747,
"repo_name": "baliscope/periapi",
"id": "242a9bc212193293072f140677905bea29530f7b",
"size": "30... |
from __future__ import absolute_import, division, print_function
import imp
import os.path
import sys
import cffi.vengine_cpy
import cffi.vengine_gen
def _get_so_suffixes():
suffixes = []
for suffix, mode, type in imp.get_suffixes():
if type == imp.C_EXTENSION:
suffixes.append(suffix)
... | {
"content_hash": "30e9530c74f2b52b4bcbbd1c93d5b239",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 71,
"avg_line_length": 28.131147540983605,
"alnum_prop": 0.6404428904428905,
"repo_name": "alex/pynacl",
"id": "62772202f6195abd82c67040e0c2fc390c902ab9",
"size": "2318",
... |
import thoonk
from thoonk.feeds import Queue
import unittest
from ConfigParser import ConfigParser
class TestQueue(unittest.TestCase):
def setUp(self):
conf = ConfigParser()
conf.read('test.cfg')
if conf.sections() == ['Test']:
self.ps = thoonk.Thoonk(host=conf.get('Test', 'ho... | {
"content_hash": "191b2d17b4b46aa97f43d202aea07a6b",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 93,
"avg_line_length": 30.942857142857143,
"alnum_prop": 0.5373961218836565,
"repo_name": "andyet/thoonk.py",
"id": "49ee5830b1bc2fa89d0613b7252ce8c161319ac0",
"size": "108... |
"""Contains the normalization layer classes and their functional aliases.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
from six.moves import xrange # pylint: disable=redefined-builtin
import numpy as np
from tensorflow.python.framework im... | {
"content_hash": "5c0b49972afba8fb08cccdf957268366",
"timestamp": "",
"source": "github",
"line_count": 307,
"max_line_length": 80,
"avg_line_length": 41.93485342019544,
"alnum_prop": 0.6172129874164983,
"repo_name": "MycChiu/tensorflow",
"id": "19f6a9854788065d918e8b17d8faa627b61f3ff5",
"size": "1... |
"""Contains the TaskNotRunningDep."""
from airflow.ti_deps.deps.base_ti_dep import BaseTIDep
from airflow.utils.session import provide_session
from airflow.utils.state import State
class TaskNotRunningDep(BaseTIDep):
"""Ensures that the task instance's state is not running."""
NAME = "Task Instance Not Runni... | {
"content_hash": "1efbb46f6e218537b7d401afea7c5044",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 78,
"avg_line_length": 31.153846153846153,
"alnum_prop": 0.6604938271604939,
"repo_name": "mtagle/airflow",
"id": "10c5d31c11a3914a7912c146ca524e2da8505751",
"size": "1597"... |
from __future__ import print_function
import cPickle as pickle
import json
import pandas as pd
import numpy as np
from rq.job import Status
from kitchensink.testutils.testrpc import make_rpc, dummy_add
from kitchensink.serialization import (json_serialization,
pickle_serializati... | {
"content_hash": "be0534c0761cf4910698c7bd3668aba1",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 61,
"avg_line_length": 29.794520547945204,
"alnum_prop": 0.5388505747126436,
"repo_name": "hhuuggoo/kitchensink",
"id": "676001b893fb650af9615e3b131801474854585d",
"size": ... |
"""Certificate chain where the target certificate sets the extended key usage
to clientAuth. Neither the root nor the intermediate have an EKU."""
import sys
sys.path += ['../..']
import gencerts
# Self-signed root certificate.
root = gencerts.create_self_signed_root_certificate('Root')
# Intermediate certificate.
... | {
"content_hash": "f45e4c10a7c47152c88e8c7e3ebd99de",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 79,
"avg_line_length": 33.05,
"alnum_prop": 0.7685325264750378,
"repo_name": "chromium/chromium",
"id": "319aaf8a864b7f385f744eff40c7196e4be8f0ea",
"size": "823",
"binary... |
import os
import sys
import json
# import requests
from flask import Flask, request, jsonify
from config import get_DB_URL
from play_new_game import play_game
import random as rd
from models.gen_work_history import gen_rand_work_history
from models.worker_level import worker_level
from models.worker import worker
fro... | {
"content_hash": "dace30e4d79c154e29ad2b2e2fd2b239",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 87,
"avg_line_length": 27.236842105263158,
"alnum_prop": 0.6481159420289855,
"repo_name": "xuanthuong/golfgame",
"id": "d7cdf0f204e9932cb97a24f57dca3bfd85cbbfe4",
"size": ... |
from allauth.socialaccount.providers.oauth2.urls import default_urlpatterns
from .provider import TwentyThreeAndMeProvider
urlpatterns = default_urlpatterns(TwentyThreeAndMeProvider)
| {
"content_hash": "3cc4bd1cc49971e1d605aa450821d40e",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 75,
"avg_line_length": 46,
"alnum_prop": 0.8804347826086957,
"repo_name": "nimbis/django-allauth",
"id": "2b12907cc96c7c69f66b49d92813ec01f3360a23",
"size": "184",
"binary... |
from setuptools import setup
setup(
name='aiovoyager',
version='0.0.1',
description='Python 3\Asyncio based web framework with websockets',
long_description=open('README.rst').read(),
url='https://github.com/GomZik/aiovoyager',
author='Aliaksiej Homza',
author_email='[email protected]... | {
"content_hash": "fbef74cb7b06b602610afaf5b15d07cc",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 71,
"avg_line_length": 30.703703703703702,
"alnum_prop": 0.6139927623642943,
"repo_name": "GomZik/aiovoyager",
"id": "dd087dd8a64a79ab85c93f01606add4e44564b42",
"size": "82... |
class ip6tunnel_args :
ur""" Provides additional arguments required for fetching the ip6tunnel resource.
"""
def __init__(self) :
self._remote = ""
@property
def remote(self) :
ur"""The IPv6 address at which the remote NetScaler appliance connects to the tunnel.<br/>Minimum length = 1.
"""
try :
retur... | {
"content_hash": "de77b18bbf529bf622e03aa777385f4d",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 112,
"avg_line_length": 25.166666666666668,
"alnum_prop": 0.6870860927152318,
"repo_name": "atopuzov/nitro-python",
"id": "52aca21e2fbd3d1ebd6db0e7a56286aa58678c37",
"size"... |
from runner.koan import *
class AboutStrings(Koan):
def test_double_quoted_strings_are_strings(self):
string = "Hello, world."
self.assertEqual(True, isinstance(string, basestring))
def test_single_quoted_strings_are_also_strings(self):
string = 'Goodbye, world.'
self.assertE... | {
"content_hash": "fa6e1a9c4723c901cb6ba64a32705e7b",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 85,
"avg_line_length": 33.55434782608695,
"alnum_prop": 0.6141885325558795,
"repo_name": "thetuxracer/completed-python-koans",
"id": "0647bf6ea19e8fc4abb490fb7422f53a2807514b... |
from swgpy.object import *
def create(kernel):
result = Static()
result.template = "object/static/particle/shared_particle_test_72.iff"
result.attribute_template_id = -1
result.stfName("obj_n","unknown_object")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "c869767f6c9db4a357f9baadd7a5e1b3",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 71,
"avg_line_length": 23.076923076923077,
"alnum_prop": 0.69,
"repo_name": "anhstudios/swganh",
"id": "3b73c0c5013d300210540385ab256b9a2e835247",
"size": "445",
"binary"... |
"""Tests triangle count for ATK against the networkx implementation"""
import unittest
import networkx as nx
from sparktkregtests.lib import sparktk_test
class TriangleCount(sparktk_test.SparkTKTestCase):
@unittest.skip("DPNG-11961")
def test_triangle_counts(self):
"""Build frames and graphs to ex... | {
"content_hash": "a59361ef40c4c899e0b9cdfd519c67dc",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 84,
"avg_line_length": 34.54716981132076,
"alnum_prop": 0.6160567995630802,
"repo_name": "rodorad/spark-tk",
"id": "5f127c6a6653d1900315d4a8ac5e6c4eaccb4285",
"size": "2536... |
"""Support for LightwaveRF switches."""
from homeassistant.components.lightwave import LIGHTWAVE_LINK
from homeassistant.components.switch import SwitchDevice
from homeassistant.const import CONF_NAME
DEPENDENCIES = ['lightwave']
async def async_setup_platform(
hass, config, async_add_entities, discovery_inf... | {
"content_hash": "e2b92b0243dac4b0edea59ec6f308e9d",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 64,
"avg_line_length": 29.066666666666666,
"alnum_prop": 0.6381880733944955,
"repo_name": "nugget/home-assistant",
"id": "d6c00b7fddb66d9cb795e8dd4558808e5caf47ca",
"size":... |
import unittest
from SpiffyWorld.models import Dungeon
from SpiffyWorld import Database
class TestDungeon(unittest.TestCase):
"""
Functional tests for unit model
"""
@classmethod
def setUpClass(cls):
cls._db = Database()
cls.db = cls._db.get_connection()
def test_get_dungeon... | {
"content_hash": "3eb003aaf9ddcc1eff063e8f47b2c18e",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 53,
"avg_line_length": 27.529411764705884,
"alnum_prop": 0.6217948717948718,
"repo_name": "butterscotchstallion/SpiffyRPG",
"id": "f562d38c3c29bd3584a2e9f6e54495196a18d2b4",
... |
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.orm import scoped_session, sessionmaker
db = SQLAlchemy()
session = scoped_session(sessionmaker())
| {
"content_hash": "37c9ffbcd27ca135efd85a9b96e68891",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 55,
"avg_line_length": 32,
"alnum_prop": 0.8125,
"repo_name": "SimpletonPatterns/EasySchedule",
"id": "84870dda888b62cf2acd79e9b27066c325fb2cc9",
"size": "190",
"binary": ... |
import numpy as np
import scipy.sparse as sp
from anemoi import BaseModelDependent, BaseSCCache, MultiFreq, MiniZephyr, Eurus
import SimPEG
from .survey import HelmBaseSurvey, Helm2DSurvey, Helm25DSurvey
from .fields import HelmFields
EPS = 1e-15
class HelmBaseProblem(SimPEG.Problem.BaseProblem, BaseModelDependent, B... | {
"content_hash": "3552c1d6ddfe0414695a85dd011db4b8",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 128,
"avg_line_length": 33.27142857142857,
"alnum_prop": 0.5487333619579219,
"repo_name": "uwoseis/windtunnel",
"id": "4b10558ef5e4bc24cad8fe26dde2f8c18d665a67",
"size": "... |
"""Do a minimal test of all the modules that aren't otherwise tested."""
import importlib
import platform
import sys
from test import support
import unittest
class TestUntestedModules(unittest.TestCase):
def test_untested_modules_can_be_imported(self):
untested = ('encodings', 'formatter')
with sup... | {
"content_hash": "248f3e989766dedeb2e44c86566dcd39",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 78,
"avg_line_length": 37.24561403508772,
"alnum_prop": 0.6015073009891663,
"repo_name": "kikocorreoso/brython",
"id": "2accad1aeebd4f9734835c02c7ee1d3faaf0bf1e",
"size": "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.