text stringlengths 4 1.02M | meta dict |
|---|---|
import sys
import json
import os
import configparser
import urllib.request
import urllib.parse
import urllib.error
from bs4 import BeautifulSoup
LIBDIR = 'opacclient/opacapp/src/main/assets/bibs/'
TYPES = [
'NONE', 'BOOK', 'CD', 'CD_SOFTWARE', 'CD_MUSIC', 'DVD', 'MOVIE', 'AUDIOBOOK', 'PACKAGE',
'GAME_C... | {
"content_hash": "14dd36537c4a76972697e7ae6d9e3f29",
"timestamp": "",
"source": "github",
"line_count": 449,
"max_line_length": 185,
"avg_line_length": 32.937639198218264,
"alnum_prop": 0.5460139292717561,
"repo_name": "simon04/opacclient",
"id": "e61c195079eb108d25ce8399000a12171cbc0dad",
"size": ... |
import fcntl, termios, struct, os, sys
def getDims():
env = os.environ
def ioctl_GWINSZ(fd):
try:
cr = struct.unpack('hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, '1234'))
except:
return
return cr
return ioctl_GWINSZ(0) or ioctl_GWINSZ(1) or ioctl_GWINSZ(2) or (... | {
"content_hash": "ebf28db2cdb66b5878f3e5bdf1c52743",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 81,
"avg_line_length": 33.03703703703704,
"alnum_prop": 0.6098654708520179,
"repo_name": "Refefer/quickfind",
"id": "37cd1235c879eda93b77bcd22a020356503c64eb",
"size": "892... |
import abc
from molecule import util
from molecule.provisioner.lint import ansible_lint
class Base(object):
__metaclass__ = abc.ABCMeta
def __init__(self, config):
"""
Base initializer for all :ref:`Provisioner` classes.
:param config: An instance of a Molecule config.
:retu... | {
"content_hash": "f6fa6bb2eb56930e54f94b89b260c3a2",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 70,
"avg_line_length": 23.057692307692307,
"alnum_prop": 0.5746455379482902,
"repo_name": "metacloud/molecule",
"id": "944c9045710e7e1e9c23ae4d2065f3c27888c4a4",
"size": "2... |
"""
Interactive Crossfilter
=======================
This example shows a multi-panel view of the same data, where you can interactively
select a portion of the data in any of the panels to highlight that portion in any
of the other panels.
"""
# category: interactive charts
import altair as alt
from vega_datasets impor... | {
"content_hash": "ff5587ab547f4f9126a5a9ede78c554e",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 83,
"avg_line_length": 24.829787234042552,
"alnum_prop": 0.6812339331619537,
"repo_name": "ellisonbg/altair",
"id": "ffe35aea585f1ea5e47dada18a6c6696192e4881",
"size": "116... |
import time
from Axon.ThreadedComponent import threadedcomponent
from Axon.Scheduler import scheduler
class ThreadedTest(threadedcomponent):
def __init__(self):
super(ThreadedTest, self).__init__()
self.last = time.time()
def main(self):
while 1:
t = time.time()
... | {
"content_hash": "6fc6708e676b6038c0ff5881cf80d6d8",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 52,
"avg_line_length": 20.681818181818183,
"alnum_prop": 0.5802197802197803,
"repo_name": "bbc/kamaelia",
"id": "30e701b43e20b2e2082ed6ef61fa6ff65500d29e",
"size": "1285",
... |
"""
TinyDB extensions. PetitDB, a TinyDB with unique fields logics.
requires: tinydb >= v3.0 (note that this is not a stable release yet.)
"""
# -------------------------------------------------------------------------------
# Author: Alexandre Manhaes Savio <alexsavio@gmail.com>
# Nuklear Medizin Department
# Klinikum... | {
"content_hash": "76b260daa26b789b0682ac5e5051aed5",
"timestamp": "",
"source": "github",
"line_count": 569,
"max_line_length": 112,
"avg_line_length": 30.808435852372583,
"alnum_prop": 0.5773531089560753,
"repo_name": "Neurita/boyle",
"id": "033690883c91788e178684d2c01e3e3dc128c083",
"size": "1754... |
from django.core.management.base import BaseCommand, CommandError
from django.utils.timezone import now
from accounting_core.models import AccountingYear
from accounting_tools.models import Subvention, SubventionLine, SubventionLogging, SubventionFile
from units.models import Unit
from users.models import TruffeUser
... | {
"content_hash": "2e3bf5b84f6b9837cc4ed52eafba2ebd",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 221,
"avg_line_length": 45.86904761904762,
"alnum_prop": 0.5362055541136777,
"repo_name": "ArcaniteSolutions/truffe2",
"id": "bb09060b801ce38d7a7b13c76f2fc551881aa8ac",
"si... |
import os
import sys
import datetime
from django.conf import settings
from django.core.mail import EmailMultiAlternatives
from django.template.loader import render_to_string
class single_instance(object):
def __init__(self, pidfile_name):
self.pidfile_name = pidfile_name
def __call__(self, f):
... | {
"content_hash": "3031aafb88a7e5888bcb6629b7c3a448",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 115,
"avg_line_length": 37.41304347826087,
"alnum_prop": 0.6159209761766414,
"repo_name": "dragonfly-science/django-pigeonpost",
"id": "fb0e9961a4285d2f4f56a4a86dc1d410574234... |
"""
Unit Tests for hyperv quantum rpc
"""
import mock
import unittest2
from quantum.agent import rpc as agent_rpc
from quantum.common import topics
from quantum.openstack.common import context
from quantum.openstack.common import rpc
from quantum.plugins.hyperv import agent_notifier_api as ana
from quantum.plugins.hy... | {
"content_hash": "e1b6305863df8769d41de890091c8cde",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 66,
"avg_line_length": 34.824074074074076,
"alnum_prop": 0.5849508109545334,
"repo_name": "rossella/neutron",
"id": "098fcea122d7f0c8c8fd8e72dca5ea55058c27b4",
"size": "44... |
from setuptools import setup
from ike import __version__
def readme():
with open('docs/readme.rst') as f:
return f.read()
setup(name='ike',
version='.'.join('{}'.format(x) for x in __version__),
description='Minimalistic Internet Key Exchange protocol v2 (RFC 5996) library',
long_descri... | {
"content_hash": "214158f3e991a0bfc50f9eb88516b0c6",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 86,
"avg_line_length": 30.84375,
"alnum_prop": 0.5653495440729484,
"repo_name": "kimvais/ike",
"id": "e82e0e91bfce7b702a74d7105065ff843cbf6185",
"size": "1011",
"binary":... |
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import List, Optional
__version__ = "20.0.2"
def main(args=None):
# type: (Optional[List[str]]) -> int
"""This is an internal API only meant for use by pip's own console scripts.
For additional details, se... | {
"content_hash": "754ccefd4034218de468d29d46c713a4",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 79,
"avg_line_length": 25.27777777777778,
"alnum_prop": 0.6901098901098901,
"repo_name": "eammx/proyectosWeb",
"id": "827a4e20a7b0a7824ae863f97f0b0c1c38408030",
"size": "45... |
"""
homeassistant.components.httpinterface
~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides an API and a HTTP interface for debug purposes.
By default it will run on port 8123.
All API calls have to be accompanied by an 'api_password' parameter and will
return JSON. If successful calls will return status code 200 or... | {
"content_hash": "4a8d22db1cf1da52a1d01335cc40cfd4",
"timestamp": "",
"source": "github",
"line_count": 624,
"max_line_length": 79,
"avg_line_length": 32.25801282051282,
"alnum_prop": 0.5758855382781062,
"repo_name": "JMSwag/home-assistant",
"id": "0072e5c2f3817849ed1ed9a669fd808b63eeaa7f",
"size":... |
"""
MSC 3B truncate 1024.
"""
from parlai.core.build_data import built, download_models, get_model_dir
import os
import os.path
def download(datapath):
ddir = os.path.join(get_model_dir(datapath), 'fits')
model_type = 'director_seeker_module'
version = 'v0.1'
if not built(os.path.join(ddir, model_type... | {
"content_hash": "55e2cc77d97d240cafe45c32162e1759",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 82,
"avg_line_length": 32.75,
"alnum_prop": 0.666030534351145,
"repo_name": "facebookresearch/ParlAI",
"id": "fc2540f212329bb675a833784bdf335698dada57",
"size": "723",
"b... |
from twisted.python import log
from twisted.internet.defer import Deferred
from twisted.internet import defer, stdio
from twisted.protocols import basic
from twisted.internet.protocol import Protocol
from twisted.web import server, resource
from twisted.web.http_headers import Headers
from twisted.internet import react... | {
"content_hash": "9c6f20b96c6c7168c776c4fb74ab4b2a",
"timestamp": "",
"source": "github",
"line_count": 259,
"max_line_length": 100,
"avg_line_length": 27.594594594594593,
"alnum_prop": 0.5670910871694417,
"repo_name": "joshuathayer/laggy",
"id": "c2caa3430a1b558eca34ad9eac287310949e6093",
"size": ... |
import doctest
import os
import re
import sys
import pytest
from unittest.mock import DEFAULT, patch
from space_tracer import main
from space_tracer.main import replace_input, TraceRunner, analyze
from test_report_builder import ReportTestCase
EXAMPLE_DRIVER_PATH = os.path.join(os.path.dirname(__file__),
... | {
"content_hash": "f937dff5a61f813481c44b87c431c244",
"timestamp": "",
"source": "github",
"line_count": 1149,
"max_line_length": 88,
"avg_line_length": 25.666666666666668,
"alnum_prop": 0.5314502729646333,
"repo_name": "donkirkby/live-py-plugin",
"id": "bf8d0f15e9733205a98dac7ad4a96609bb04f0ed",
"s... |
"""This contains all local, site-specific configuration options."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
# pylint: disable=unused-import
from grr_response_core.config.local import contexts
| {
"content_hash": "dcc18dbaa4304b69bbcd961cbb813fcd",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 67,
"avg_line_length": 37.714285714285715,
"alnum_prop": 0.7803030303030303,
"repo_name": "demonchild2112/travis-test",
"id": "d126dfb6c23f8ac992b91f36968583a99b47b4b8",
"si... |
r"""Minimal Flask application example for development with globus handler.
SPHINX-START
1. Register a Globus application at `https://developers.globus.org/` with the
`Redirect URL` as `http://localhost:5000/oauth/authorized/globus/`. See
here for more documentation:
`https://docs.globus.org/api/auth/develope... | {
"content_hash": "d922a1a50feec6b49cfee95dee6d05f8",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 86,
"avg_line_length": 29.55223880597015,
"alnum_prop": 0.7381313131313131,
"repo_name": "inveniosoftware/invenio-oauthclient",
"id": "664fb1bca4abe37bb65ea47138d3f344b2aa00... |
def can_build(env, platform):
return True
def configure(env):
pass
def get_doc_classes():
return [
"WebRTCPeer"
]
def get_doc_path():
return "doc_classes"
| {
"content_hash": "6f2fcf6337e6cc1fc5a5d8484286d6f7",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 29,
"avg_line_length": 14.307692307692308,
"alnum_prop": 0.6021505376344086,
"repo_name": "groud/godot",
"id": "5ed245bad28d52716ccee43fa229c2f8aa6860e4",
"size": "186",
... |
from chibitest import TestCase, ok
from misaka import escape_html, Markdown, SaferHtmlRenderer
class EscapeHtmlTest(TestCase):
def test_escape_html(self):
ok(escape_html('a&<>"\'/')) == 'a&<>"'/'
def test_escape_html_slash(self):
ok(escape_html('a&<>"\'/', True)) == 'a&... | {
"content_hash": "b3edb3eb5f92a3c4211f1489195cb5bf",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 110,
"avg_line_length": 38.84920634920635,
"alnum_prop": 0.5662921348314607,
"repo_name": "hepochen/hoedown_misaka",
"id": "e4226682e49ce096d6697266d2c78975bab41bb0",
"siz... |
r"""Runs a binary on the verilated system, which is expected to write
one of "PASS!\r\n" or "FAIL!\r\n" to UART to determine success or failure.
Failing to write either will result in a timeout.
This test requires some configuration options. Use the following steps to run
the test manually after building a Verilator s... | {
"content_hash": "30e189747ca267c3fa875c266214884b",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 114,
"avg_line_length": 36.84,
"alnum_prop": 0.6015200868621065,
"repo_name": "chipsalliance/Surelog",
"id": "4394279e1112c182a5b35241d61769661efab2ee",
"size": "2933",
"... |
from django.conf.urls import patterns, include, url
from django.conf import settings
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^forum/', include('pybb.urls', namespace='pybb')),
url(r'^login/', 'auth.views.loginPrompt'... | {
"content_hash": "f11605a1f4732253cc28e07bdb52b260",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 70,
"avg_line_length": 32.578947368421055,
"alnum_prop": 0.6639741518578353,
"repo_name": "tsitra/ImgurFitWebsite",
"id": "0df0cfef83fc897abeff3af8c16ba45e519c9009",
"size"... |
import pytest
from pycroft.model.base import ModelBase
@pytest.mark.parametrize('value, expected', [
("Noun", "noun"),
("HTML", "html"),
("HTML40", "html40"),
("HTMLParser", "html_parser"),
("HTML40Parser", "html40_parser"),
("SafeHTML", "safe_html"),
("Version2CSV", "version2_csv"),
])
d... | {
"content_hash": "087cd9680207fd6da3c2f255b67a1fac",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 54,
"avg_line_length": 26.4375,
"alnum_prop": 0.6359338061465721,
"repo_name": "agdsn/pycroft",
"id": "d3ce37d65166ef2c58d7595dbb2d05079c1cfcaa",
"size": "631",
"binary":... |
from parsl.channels.ssh.ssh import SSHChannel
from parsl.channels.local.local import LocalChannel
from parsl.channels.ssh_il.ssh_il import SSHInteractiveLoginChannel
__all__ = ['SSHChannel', 'LocalChannel', 'SSHInteractiveLoginChannel']
| {
"content_hash": "58528a2a5fda113c04d428c0aa164110",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 70,
"avg_line_length": 47.6,
"alnum_prop": 0.8151260504201681,
"repo_name": "swift-lang/swift-e-lab",
"id": "8bad4d3ef9737e7ffb0faa0b90cf941dbba85c11",
"size": "238",
"bin... |
"""
Deprecated: This is included only to support the use of the old v1 client
class. It will be removed once v2 is at parity with v1. Do not use this for any
new functionality.
A simple JSON REST request abstraction layer that is used by the
``dropbox.client`` and ``dropbox.session`` modules. You shouldn't need to use... | {
"content_hash": "3bf503de17655f24a4d1a3b2368b6c5e",
"timestamp": "",
"source": "github",
"line_count": 422,
"max_line_length": 99,
"avg_line_length": 35.699052132701425,
"alnum_prop": 0.5994025887819449,
"repo_name": "ewjoachim/dropbox-sdk-python",
"id": "cf39fb51b452111ae4f15cfbb1e9e81a5be2cd79",
... |
__author__ = 'hujin'
import copy
from twisted.python import log
from twisted.internet.defer import succeed, fail
from dockerman.storage import Service
from dockerman.event import Event
class Manager(object):
def __init__(self, client, store, dispatcher):
"""
:type client: dockerman.docker.Clien... | {
"content_hash": "143bd0ed534e7fe58b2ab6ae1993fdf2",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 77,
"avg_line_length": 26.28,
"alnum_prop": 0.5705225773718925,
"repo_name": "bixuehujin/dockerman",
"id": "b748f114beba7f629581f43dfd01c858e31e51ee",
"size": "3942",
"b... |
from distutils import extension
from distutils import util
import errno
import os
import os.path
import pkg_resources
import platform
import re
import shlex
import shutil
import sys
import sysconfig
import setuptools
from setuptools.command import build_ext
# TODO(atash) add flag to disable Cython use
os.chdir(os.pa... | {
"content_hash": "06b49a4367699139ff7124c23c9d26d5",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 93,
"avg_line_length": 37.08387096774194,
"alnum_prop": 0.6917188587334725,
"repo_name": "bogdandrutu/grpc",
"id": "bb1f1cf085b65e3bf06e08d51440fd7e3e37cc21",
"size": "727... |
import abc
from typing import Dict, List, Any, Tuple, cast, Type, Iterator, Union
from cephlib.numeric_types import TimeSeries, DataSource
from cephlib.statistic import StatProps
from cephlib.istorage import IImagesStorage, Storable, ISensorStorage
from cephlib.node import NodeInfo
from cephlib.node_impl import IRPCNo... | {
"content_hash": "6d1cdd7c805d86d8e24dee763d8dcca5",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 92,
"avg_line_length": 29.48780487804878,
"alnum_prop": 0.6192445547284257,
"repo_name": "Mirantis/disk_perf_test_tool",
"id": "f2b84e6a5ec6eed4f902a4339769602b1addb064",
... |
"""
ReplicaExchangeSampler
======================
Derived multi-thermodynamic state multistate class with exchanging configurations between replicas
COPYRIGHT
Current version by Andrea Rizzi <andrea.rizzi@choderalab.org>, Levi N. Naden <levi.naden@choderalab.org> and
John D. Chodera <john.chodera@choderalab.org> whi... | {
"content_hash": "9502f3cf008d446b53486bd84a0f7899",
"timestamp": "",
"source": "github",
"line_count": 441,
"max_line_length": 247,
"avg_line_length": 49.87528344671202,
"alnum_prop": 0.6557854057740395,
"repo_name": "choderalab/openmmtools",
"id": "a1a23c34d8647837e61d56e6465d14dfff48cb70",
"size... |
class openssl:
name = "openssl 1.1.0c"
url = "https://www.openssl.org/source/openssl-1.1.0c.tar.gz"
dirname = "" # leave empty to auto guess
ffmpeg_opts = [ "--enable-openssl" ];
def skip(self, prefix, force):
if force: return False;
if file_exist(prefix + "/bin/openssl"): return Tr... | {
"content_hash": "aaddb53d85449b154632bc572cd266d3",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 80,
"avg_line_length": 31.28,
"alnum_prop": 0.6086956521739131,
"repo_name": "chunying/ffmpeg3",
"id": "1a9d16cd7d25cc5727a4378f1892e1a4601bbabe",
"size": "783",
"binary"... |
"""Module for managing nova instances for share drivers."""
import abc
import os
import socket
import time
import netaddr
from oslo_config import cfg
from oslo_log import log
from oslo_utils import importutils
import six
from manila.common import constants as const
from manila import compute
from manila import conte... | {
"content_hash": "254fc342f3f2b7a34e5ec736f2913d58",
"timestamp": "",
"source": "github",
"line_count": 1042,
"max_line_length": 79,
"avg_line_length": 42.38771593090211,
"alnum_prop": 0.5819597898931353,
"repo_name": "jcsp/manila",
"id": "a39c8a5f27b86590827944361a61dea0ce98ebf8",
"size": "44836",... |
import xlrd
from collections import OrderedDict
import simplejson as json
# Open the workbook and select the first worksheet
wb = xlrd.open_workbook('cnu_major.xls')
sh = wb.sheet_by_index(0)
# Dictionary to hold dictionaries
major_dict = {}
major = {}
# Iterate through each row in worksheet and fetch values into di... | {
"content_hash": "714e6e0ec1b7b399fc9cb766f5695fa8",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 66,
"avg_line_length": 25.93548387096774,
"alnum_prop": 0.6766169154228856,
"repo_name": "haeungun/MealTime_Android",
"id": "934c5823a44473b3980e563c07b90205e81563e5",
"siz... |
import pyxb_114
import pyxb_114.binding.generate
import pyxb_114.utils.domutils
import pyxb_114.binding.saxer
import StringIO
from xml.dom import Node
import os.path
schema_path = '%s/../schemas/substgroup.xsd' % (os.path.dirname(__file__),)
code = pyxb_114.binding.generate.GeneratePython(schema_location=schema_path)... | {
"content_hash": "014cad14623fab69a35c04c44224f60d",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 116,
"avg_line_length": 43.54545454545455,
"alnum_prop": 0.6941544885177453,
"repo_name": "msherry/PyXB-1.1.4",
"id": "155ec687ab9a1e8a3cf2811cc88246c26c81c110",
"size": "3... |
from typing import List, Optional, Tuple
from django.db import connections
from psqlextra.models import PostgresPartitionedModel
from .config import PostgresPartitioningConfig
from .constants import AUTO_PARTITIONED_COMMENT
from .error import PostgresPartitioningError
from .partition import PostgresPartition
from .p... | {
"content_hash": "672ac475554c4e3da10d8c580ca48630",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 78,
"avg_line_length": 33.12408759124087,
"alnum_prop": 0.6121639488761569,
"repo_name": "SectorLabs/django-postgres-extra",
"id": "28aee91ee0bf19af22eb1808590be62006141b2b"... |
from django import forms
from django.core import validators
from django.db.models import get_model
from django.utils.translation import ugettext_lazy as _
from oscar.apps.customer.forms import EmailUserCreationForm, CommonPasswordValidator
from oscar.core.compat import get_user_model
User = get_user_model()
Partner =... | {
"content_hash": "6a30f628c5003ec982ef6d6a4ef78b47",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 84,
"avg_line_length": 30,
"alnum_prop": 0.6445652173913043,
"repo_name": "makielab/django-oscar",
"id": "313decf8d3cc53a7de34318c2b79cc1a8d5eca26",
"size": "2760",
"bina... |
import os
import pexpect
import re
import sys
from hyriseBenchmarkCore import initialize
def main():
build_dir = initialize()
if not os.path.isdir("resources/test_data/tbl"):
print(
"Cannot find resources/test_data/tbl. Are you running the test suite from the main folder of the Hyrise"
... | {
"content_hash": "105df314e6d05a984cd16a2939c335af",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 119,
"avg_line_length": 38.574074074074076,
"alnum_prop": 0.6927508401344215,
"repo_name": "hyrise/hyrise",
"id": "ca86a37f9d0a15b8cab9ec7894ca26e0c39144b7",
"size": "2107"... |
"""
Generates a list of JSON objects, one object for each dataset retrieved from
the HSCIC website.
"""
import os
import string
import json
import logging
import requests
import urllib
import html2text
from bs4 import BeautifulSoup
from urlparse import urlparse
logging.basicConfig(filename='datasets.log',
... | {
"content_hash": "a9289b4cbbe8bf63901032dcde535cf0",
"timestamp": "",
"source": "github",
"line_count": 311,
"max_line_length": 92,
"avg_line_length": 37.237942122186496,
"alnum_prop": 0.563768241084535,
"repo_name": "ntoll/hscic_apiomatic",
"id": "35ac4559e5bcdab94304ebb52e959adcf5df71f8",
"size":... |
import github.GithubObject
class StatusMessage(github.GithubObject.NonCompletableGithubObject):
"""
This class represents status messages as defined in https://status.github.com/api
"""
@property
def body(self):
"""
:type: string
"""
return self._body.value
@p... | {
"content_hash": "3844f0f947259d9a41abe110105d22db",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 85,
"avg_line_length": 28.575,
"alnum_prop": 0.6097987751531059,
"repo_name": "ARMmbed/yotta_osx_installer",
"id": "c0c99903ce74f6fb59381408e43670f51cd50e8b",
"size": "2789... |
"""
Created on Fri Aug 17 13:10:52 2012
Author: Josef Perktold
License: BSD-3
"""
import numpy as np
def clip_evals(x, value=0): #threshold=0, value=0):
evals, evecs = np.linalg.eigh(x)
clipped = np.any(evals < 0)
x_new = np.dot(evecs * np.maximum(evals, value), evecs.T)
return x_new, clipped
def ... | {
"content_hash": "9a501c64025f01df627bf08dce9977f3",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 81,
"avg_line_length": 30.61111111111111,
"alnum_prop": 0.6637931034482759,
"repo_name": "bavardage/statsmodels",
"id": "66645666a1a2f0cc8b2d52fb6394413625bf89ea",
"size":... |
from distutils.core import setup
from distutils.command.build_scripts import build_scripts,first_line_re
from distutils.command.bdist_wininst import bdist_wininst
from distutils.dist import Distribution
from shutil import copyfile,rmtree
from tempfile import mkdtemp
import os
import glob
class Distribution_extended(D... | {
"content_hash": "067336da631da0e0eab7902d9a8fc872",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 153,
"avg_line_length": 35.294117647058826,
"alnum_prop": 0.6420833333333333,
"repo_name": "tema-mbt/tema-tg",
"id": "04b5040c89df07be8b9a56f4ed4770a153e91493",
"size": "5... |
import unittest
import sys, os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)))
import src.parser
class ParserTestCase(unittest.TestCase):
""" Tests for parser methods """
# --------------------------------------------------
# TESTS for parser... | {
"content_hash": "d4822134f4774d81be48f4682b4cceaf",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 154,
"avg_line_length": 38.22727272727273,
"alnum_prop": 0.5386444708680143,
"repo_name": "RyanMaugin/Tachyon",
"id": "dad5db571fc70a010aad63b9669366887bc13738",
"size": "9... |
"""Statistics napp package."""
| {
"content_hash": "9b64c97cf216cbe4446235a495bcace4",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 30,
"avg_line_length": 31,
"alnum_prop": 0.6774193548387096,
"repo_name": "kytos/kyco-core-napps",
"id": "a0c699349ab169c5a3fbc77391215c43da8be996",
"size": "31",
"binary"... |
from __future__ import unicode_literals, print_function
import frappe
import hashlib
from frappe.model.db_schema import DbManager
from frappe.installer import get_root_connection
from frappe.database import Database
import os, subprocess
from bs4 import BeautifulSoup
import jinja2.exceptions
import io
def sync():
... | {
"content_hash": "978a1c94c00a244ea7da1baac328dfcc",
"timestamp": "",
"source": "github",
"line_count": 343,
"max_line_length": 109,
"avg_line_length": 30.21865889212828,
"alnum_prop": 0.6359864930053063,
"repo_name": "ESS-LLP/frappe",
"id": "3a5bc5b308029b5e310508d34b14012158e5f105",
"size": "1049... |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2014 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the... | {
"content_hash": "8a2a40a08237d5bb95bfc9755442b890",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 77,
"avg_line_length": 34.78,
"alnum_prop": 0.6716503737780334,
"repo_name": "getzze/python-ivi",
"id": "8ebc12dccaf137a670b4396b39ff7143bae2e595",
"size": "1739",
"binar... |
import platform
import os
class Constants:
# os
WINDOWS = "Windows"
LINUX = "Linux"
MACOS = "TODO"
OS = platform.system()
# file system
EXPORTER_DIR = ""
EXPORTER_CONFIG_FILE = ""
QTCREATOR_CONFIG_DIR = ""
QTCREATOR_CONFIG_FILE = ""
# sync config file
SYNC_CONFIG_FI... | {
"content_hash": "d661792640e26210f43f8dabcbd787d4",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 94,
"avg_line_length": 27.425,
"alnum_prop": 0.6071103008204193,
"repo_name": "assemblical/qtcreator_settings_sync",
"id": "c4becd82910f351cd947c7f9f6c60adcae8b585f",
"size... |
from msrest.serialization import Model
class ManagementEventAggregationCondition(Model):
"""How the data that is collected should be combined over time.
:param operator: the condition operator. Possible values include:
'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual'
:type operator... | {
"content_hash": "ca35801e07c4661f9cf1014344286c50",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 77,
"avg_line_length": 41.214285714285715,
"alnum_prop": 0.6819757365684576,
"repo_name": "SUSE/azure-sdk-for-python",
"id": "1273fcd1483a200298f580dc7026cfeb91ea5b51",
"si... |
import os
import boto3
import pytest
import simplejson as json
from _pytest.fixtures import fixture
from botocore.exceptions import ClientError
from moto import mock_s3
from lambda_tools import Configuration
from reactor.utils import formatters
from test.data.sample_event_data import KNOWN_VALID_EVENTS, build_event_j... | {
"content_hash": "edf0ed98e335311dcadc80b7d64bf80d",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 109,
"avg_line_length": 32.55,
"alnum_prop": 0.6816436251920123,
"repo_name": "Cloudzero/cloudzero-reactor-aws",
"id": "a0fde433fb938bdf467d9e43b6b4d055c6a221ea",
"size": "... |
from itertools import count
import json
import pytest
from devp2p.peermanager import PeerManager
from ethereum import tester
from ethereum.ethpow import mine
import ethereum.keys
import ethereum.config
from ethereum.slogging import get_logger
from pyethapp.accounts import Account, AccountsService, mk_random_privkey
fro... | {
"content_hash": "67b30745f32ae7e105492ba9a4ab9364",
"timestamp": "",
"source": "github",
"line_count": 446,
"max_line_length": 102,
"avg_line_length": 38.699551569506724,
"alnum_prop": 0.6189455388180765,
"repo_name": "vaporry/pyethapp",
"id": "2c1b1ae5cf73a2a15a2840a6c87a7dd0e18ffd7c",
"size": "1... |
from accelerator.tests.factories import (
CriterionFactory,
CriterionOptionSpecFactory,
)
from accelerator.tests.contexts.judge_feedback_context import (
JudgeFeedbackContext,
)
from accelerator.models import JUDGING_FEEDBACK_STATUS_COMPLETE
import swapper
JudgeApplicationFeedback = swapper.load_model(
... | {
"content_hash": "941369d3616994f430cf1db1fe1b858f",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 75,
"avg_line_length": 34.75925925925926,
"alnum_prop": 0.6014917421417155,
"repo_name": "masschallenge/django-accelerator",
"id": "fe34c6ab0e48c0f327ad940bc6ab7fd965c5e09e",... |
import requests
from collections import OrderedDict
from cattle import from_env
URLS = OrderedDict()
URLS['Stable'] = 'http://stable.release.core-os.net/amd64-usr/'
URLS['Beta'] = 'http://beta.release.core-os.net/amd64-usr/'
URLS['Alpha'] = 'http://alpha.release.core-os.net/amd64-usr/'
DIGEST = 'coreos_production_ope... | {
"content_hash": "a5c7a066e9e73d8beda6183bb2a4902b",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 66,
"avg_line_length": 27.46969696969697,
"alnum_prop": 0.595146166574738,
"repo_name": "ibuildthecloud/stampede",
"id": "f173d3dcdf224cf7abdf0c2c3c2045e57f205334",
"size":... |
from typing import Callable
import demistomock as demisto # noqa: F401
from CommonServerPython import * # noqa: F401
import base64
import copy
from requests import Response
DATE_FORMAT = '%a, %d %b %Y %H:%M:%S GMT'
account_sas_token = ""
storage_account_name = ""
class Client:
"""
API Client
"""
... | {
"content_hash": "d5f9dd69d216eedbe04e9a93a5b0694e",
"timestamp": "",
"source": "github",
"line_count": 875,
"max_line_length": 121,
"avg_line_length": 33.16,
"alnum_prop": 0.6195416164053076,
"repo_name": "VirusTotal/content",
"id": "d7ded6939c9025b5dfe08974699a6a3b310552b6",
"size": "29015",
"b... |
"""Ce fichier contient la classe Attitudes détaillée plus bas."""
from abstraits.obase import BaseObj
from .attitude import Attitude
class Attitudes(BaseObj):
"""Classe conteneur des attitudes sociales.
Cette classe liste tous les items Attitude utilisables dans l'univers
à un instant donné.
Voir : ... | {
"content_hash": "9b80c835f985c710e97dfdf3ea66d9f0",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 73,
"avg_line_length": 27.38095238095238,
"alnum_prop": 0.5982608695652174,
"repo_name": "stormi/tsunami",
"id": "378cdbee5cf85241de02be87598a67f9b90b2deb",
"size": "3298",... |
"""SSD MobilenetV1 FPN Feature Extractor."""
import copy
import functools
import tensorflow as tf
from object_detection.meta_architectures import ssd_meta_arch
from object_detection.models import feature_map_generators
from object_detection.utils import context_manager
from object_detection.utils import ops
from obje... | {
"content_hash": "42c303d722c1b11007d951d5dd532a8d",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 80,
"avg_line_length": 43.96610169491525,
"alnum_prop": 0.643407864302236,
"repo_name": "derekjchow/models",
"id": "b0c149aead313ba97c4997da1f91c5759f6994bb",
"size": "847... |
"""
Tests for the zipline.assets package
"""
import sys
from unittest import TestCase
from datetime import datetime, timedelta
import pickle
import uuid
import warnings
import pandas as pd
from pandas.tseries.tools import normalize_date
from pandas.util.testing import assert_frame_equal
from nose_parameterized impo... | {
"content_hash": "067091452f3e1bc65dcb4843f7ce65f9",
"timestamp": "",
"source": "github",
"line_count": 884,
"max_line_length": 79,
"avg_line_length": 36.328054298642535,
"alnum_prop": 0.5402628137261007,
"repo_name": "chrjxj/zipline",
"id": "ebe11e373eda41e934b973f4455d37ac5b1807e4",
"size": "3269... |
from autobahn.twisted.component import Component, run
from autobahn.twisted.util import sleep
from twisted.internet.defer import inlineCallbacks
import os
url = os.environ.get('CBURL', 'ws://localhost:8080/ws')
realmvalue = os.environ.get('CBREALM', 'realm1')
topic = os.environ.get('CBTOPIC', 'com.myapp.hello')
compo... | {
"content_hash": "4ed61d041bbedd9461d1f754153df307",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 60,
"avg_line_length": 25.258064516129032,
"alnum_prop": 0.6845466155810983,
"repo_name": "crossbario/crossbar-examples",
"id": "db5da3967fe91e88d43dd24608766df12e44812f",
... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tools', '0007_baseuser'),
]
operations = [
migrations.CreateModel(
name='Comment',
fields=[
('id', models.Au... | {
"content_hash": "34df0b432a1a509c71ed27a72284d534",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 114,
"avg_line_length": 24.85,
"alnum_prop": 0.5653923541247485,
"repo_name": "svaswani/STEALTH",
"id": "97343e354a37a5248ec42a361259e9aa72a2aaca",
"size": "569",
"binary... |
from mock import Mock
from mock import patch
import json
import yaml
from nailgun.api.v1.validators.cluster import AttributesValidator
from nailgun.errors import errors
from nailgun.test.base import BaseTestCase
class TestAttributesValidator(BaseTestCase):
def test_generated_attributes_validation(self):
... | {
"content_hash": "abfbd39db48a974e08a89f4b1939aa02",
"timestamp": "",
"source": "github",
"line_count": 320,
"max_line_length": 78,
"avg_line_length": 32.68125,
"alnum_prop": 0.4905335628227194,
"repo_name": "huntxu/fuel-web",
"id": "049b25664db145180e011be8ba32ef62e2728627",
"size": "11091",
"bi... |
"""Define API Queries."""
import six
from gcloud.bigquery._helpers import _TypedProperty
from gcloud.bigquery._helpers import _rows_from_json
from gcloud.bigquery.dataset import Dataset
from gcloud.bigquery.job import QueryJob
from gcloud.bigquery.table import _parse_schema_resource
class _SyncQueryConfiguration(ob... | {
"content_hash": "dfaaa91f8e2ee7609878bc59e9ed4312",
"timestamp": "",
"source": "github",
"line_count": 337,
"max_line_length": 90,
"avg_line_length": 33.961424332344215,
"alnum_prop": 0.6041065967671472,
"repo_name": "waprin/google-cloud-python",
"id": "4dd378af9c95abaf32b8f2a69dd022f4945f346c",
"... |
"""
Verifier that matches JSON content using extended JSON pointer syntax.
JSON pointer syntax is extended as follows:
1) A ~$xxx at the end will result in a test for the string "xxx" in the matching JSON object.
2) A "." as a path segment will match any JSON object member or array item.
"""
import json
from src.jso... | {
"content_hash": "4e84f277fce5fd813f56661c63ff0c65",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 99,
"avg_line_length": 36.043956043956044,
"alnum_prop": 0.48353658536585364,
"repo_name": "fpiotrow/caldav-tester-packaging",
"id": "5ce7b461936bf78657930192840e84631a560d57... |
from plenum.common.types import f
from plenum.common.constants import TARGET_NYM, TXN_TYPE, RAW, DATA, NAME, \
VERSION, ORIGIN
from indy_client.test.state_proof.helper import check_valid_proof, \
sdk_submit_operation_and_get_replies
from indy_common.constants import GET_ATTR, GET_NYM, GET_SCHEMA, GET_CLAIM_DEF... | {
"content_hash": "794a32227975fd3e03a5886f294baf69",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 119,
"avg_line_length": 37.783018867924525,
"alnum_prop": 0.5438202247191011,
"repo_name": "spivachuk/sovrin-node",
"id": "e7d887a663b4dd28218e169fc474306a9f1e1dc8",
"size... |
import logging
import os
import traceback
from typing import Any, Dict, Iterable, List, Mapping, Tuple, Union
from googleapiclient.discovery import Resource
from googleapiclient.errors import HttpError
from service_framework import service_builder
from service_framework import services
from classes import decorators,... | {
"content_hash": "9e763aac58f518088ea50e99bcab669d",
"timestamp": "",
"source": "github",
"line_count": 285,
"max_line_length": 80,
"avg_line_length": 28.698245614035088,
"alnum_prop": 0.6076537474018828,
"repo_name": "google/report2bq",
"id": "d4c020ab236306f4626777c2549871ef534ebe5f",
"size": "87... |
"""
OdCpuDmaLatency - command ``/usr/bin/od -An -t d /dev/cpu_dma_latency``
=======================================================================
This module provides the class ``OdCpuDmaLatency`` which processes
``/usr/bin/od -An -t d /dev/cpu_dma_latency`` command output.
"""
from insights import parser, CommandPa... | {
"content_hash": "fc6c899613268fe7c9a87e97a3cb3ed1",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 88,
"avg_line_length": 30.555555555555557,
"alnum_prop": 0.6245454545454545,
"repo_name": "RedHatInsights/insights-core",
"id": "b8b13e0198e4afea47100db37a8e7019fbc88844",
... |
import sys
import math
import random
import string
import time
import types
import Tkinter
_Windows = sys.platform == 'win32' # True if on Win95/98/NT
_root_window = None # The root window for graphics output
_canvas = None # The canvas which holds graphics
_canvas_xs = None # Size of canvas object
_c... | {
"content_hash": "269252279e4d41f2a1f42632a52b5902",
"timestamp": "",
"source": "github",
"line_count": 385,
"max_line_length": 104,
"avg_line_length": 28.948051948051948,
"alnum_prop": 0.570569762225213,
"repo_name": "chenhw2/AI_Pacman",
"id": "f6b1ab37015b03a55aabbd5387e8cea36963576f",
"size": "1... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Restaurant'
db.create_table(u'mining_restaurant', (
('business_id', self.gf('django.db.models.fields.Cha... | {
"content_hash": "073e9c23b440b7d4763fa1d2a324012d",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 148,
"avg_line_length": 57.525862068965516,
"alnum_prop": 0.5702083021129927,
"repo_name": "thebenwaters/yelp-dataset-geographical-topic-modeling",
"id": "d2a417901c660d3157... |
import copy
from datetime import timedelta # noqa
from django.conf import settings
from django.utils import datetime_safe
from keystoneclient import access
from keystoneclient.v2_0 import ec2
from keystoneclient.v2_0 import roles
from keystoneclient.v2_0 import tenants
from keystoneclient.v2_0 import users
from keys... | {
"content_hash": "cd3a86b9d06e5a83eb89a550b6ef7bcb",
"timestamp": "",
"source": "github",
"line_count": 330,
"max_line_length": 78,
"avg_line_length": 40.875757575757575,
"alnum_prop": 0.527837497219957,
"repo_name": "394954369/horizon",
"id": "1fceceea11150081c68307f982a5c62a2e0fb02c",
"size": "14... |
"""
Website property.
"""
from pkg_resources import resource_stream # @UnresolvedImport
from rebulk.remodule import re
from rebulk import Rebulk, Rule, RemoveMatch
from ..common import seps
from ..common.formatters import cleanup
from ..common.validators import seps_surround
from ...reutils import build_or_pattern
... | {
"content_hash": "28e573bfa6c04953a1fdf257d0f1493d",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 106,
"avg_line_length": 37.7319587628866,
"alnum_prop": 0.5663934426229508,
"repo_name": "pannal/Subliminal.bundle",
"id": "afca57abbabb9388628dc22388587c0c96f1a8d0",
"size... |
import Queue
import threading
logFilePath = './log.txt'
#dummy ajax call
def ajax(line):
print line
#get lines from file
def getLines(filename):
with open(logFilePath, 'r') as file:
lines = file.readlines()
return lines
#single threaded solution
def send(arr):
for line in lines:
ajax... | {
"content_hash": "70b9d6239ab0e33a684bedcac6ef253c",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 47,
"avg_line_length": 19.63235294117647,
"alnum_prop": 0.6584269662921348,
"repo_name": "schandrasekhar/msgWatcher",
"id": "ea1b7042677848e076787e998c6ed35939fb9077",
"siz... |
"""Ansible module for retrieving and setting openshift related facts"""
# pylint: disable=no-name-in-module, import-error, wrong-import-order
import copy
import errno
import json
import re
import os
import yaml
import struct
import socket
import ipaddress
from distutils.util import strtobool
from distutils.version imp... | {
"content_hash": "6f6c8f9d27c474c2fd15ccb541b74450",
"timestamp": "",
"source": "github",
"line_count": 1684,
"max_line_length": 129,
"avg_line_length": 40.308194774346795,
"alnum_prop": 0.5727691922391314,
"repo_name": "openshift/openshift-tools",
"id": "c1968987c0ef6ab713590b229d2d2e650fe11de2",
... |
"""add max tries column to task instance
Revision ID: cc1e65623dc7
Revises: 127d2bf2dfa7
Create Date: 2017-06-19 16:53:12.851141
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy import Column, Integer, String
from sqlalchemy.engine.reflection import Inspector
from sqlalchemy.ext.declarative import ... | {
"content_hash": "b111ad8650d8ffd1d1ef8e2175701f1d",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 106,
"avg_line_length": 39.68468468468468,
"alnum_prop": 0.6152099886492622,
"repo_name": "apache/incubator-airflow",
"id": "95a32c0b443320b8f535de88d489c828e5848b6f",
"si... |
import mock
import datetime
import random
from django.conf import settings
from django.test import SimpleTestCase, TestCase
from django.utils import timezone
from eligibility_calculator.models import CaseData, ModelMixin
from eligibility_calculator.exceptions import PropertyExpectedException
from cla_common.constant... | {
"content_hash": "f29c73c01b3fcec496ae65dda98a02c4",
"timestamp": "",
"source": "github",
"line_count": 1454,
"max_line_length": 119,
"avg_line_length": 39.72352132049519,
"alnum_prop": 0.5377783164236989,
"repo_name": "ministryofjustice/cla_backend",
"id": "52c604155fce3dc960f392053cbd464454e7461d",... |
"""Conditions / splits for non-leaf nodes.
A condition (e.g. a>0.5) is evaluated to a binary value (e.g. True if a=5).
Condition evaluations control the branching of an example in a tree.
"""
import abc
from typing import List, Union, Optional
import six
from tensorflow_decision_forests.component.py_tree import dat... | {
"content_hash": "c130354841927fbb90fb2b238f65bb6d",
"timestamp": "",
"source": "github",
"line_count": 403,
"max_line_length": 103,
"avg_line_length": 34.19106699751861,
"alnum_prop": 0.6545467740764932,
"repo_name": "tensorflow/decision-forests",
"id": "8ecd40008ba57c19490b42493e920e5a7fc45940",
... |
from mongoengine import *
class AggregateRating(EmbeddedDocument):
# Percentage of rating as float value (from 0 to 1.0)
rating = FloatField(min_value=0.0, max_value=1.0, default=0.0)
count = IntField(min_value=0, default=0)
def add_rating(self, rating):
if not 0 <= rating <= 1.0:
... | {
"content_hash": "9358ed84c3830a2f341e35014d477ec9",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 73,
"avg_line_length": 30,
"alnum_prop": 0.6375,
"repo_name": "Mo-Talha/Nomad",
"id": "e45d7570bdfeb0d841c62f3417f7f615ec5df68b",
"size": "480",
"binary": false,
"copie... |
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.core.files import File
from .models import Papermail
from django.conf import settings
import magic
from wand.image import Image
from os import remove
from uuid import uuid4
media_root = getattr(settings, 'ME... | {
"content_hash": "64069ffb603f67cc9550100e6cc4c692",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 91,
"avg_line_length": 39.745098039215684,
"alnum_prop": 0.6206216082881105,
"repo_name": "Humch/django-paperworks",
"id": "a0c5c09fbbd5e8539c2a375f31ba0261ec41130e",
"size... |
'''OpenGL extension ARB.texture_rectangle
This module customises the behaviour of the
OpenGL.raw.GL.ARB.texture_rectangle to provide a more
Python-friendly API
Overview (from the spec)
OpenGL texturing is limited to images with power-of-two dimensions
and an optional 1-texel border. The ARB_texture_rectangle e... | {
"content_hash": "d926b4831c6013f65f34c834927fd6be",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 70,
"avg_line_length": 44.319148936170215,
"alnum_prop": 0.7830052808449351,
"repo_name": "Universal-Model-Converter/UMC3.0a",
"id": "8a9576c88721de3a3a842fd0ae51fed0e9555b79... |
'''Assign some relative luminances to constants.
'''
BLACK = 0.0
WHITE = 1.0
| {
"content_hash": "7d75b8884f90704ca6747f999c76f8a6",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 48,
"avg_line_length": 15.6,
"alnum_prop": 0.6794871794871795,
"repo_name": "nico-hn/color_contrast_calc_py",
"id": "bd62e4d14d244da5376c44acc9bdfdfc100ec211",
"size": "78",... |
"""
Worker that receives input from Piped RDD.
"""
import os
import sys
import time
from inspect import getfullargspec
import importlib
# 'resource' is a Unix specific module.
has_resource_module = True
try:
import resource
except ImportError:
has_resource_module = False
import traceback
from pyspark.accumulat... | {
"content_hash": "77f7128cec88b739577751ab2292c76a",
"timestamp": "",
"source": "github",
"line_count": 634,
"max_line_length": 99,
"avg_line_length": 42.534700315457414,
"alnum_prop": 0.610894797344903,
"repo_name": "ptkool/spark",
"id": "84e5cca5d3c00db7946375368271d3bccdb5a49e",
"size": "27752",... |
import numpy as np
import scipy
from data_handler import gen_graphs
from pte_theano import PTE
import logging
class train_pte(object):
'''
class to train the pte model on the given corpus.
'''
def __init__(self):
'''
define model paramters.
'''
self.graphs = gen_graph... | {
"content_hash": "8202043c83e8dfc9bf307adbef19ab7f",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 83,
"avg_line_length": 36.81132075471698,
"alnum_prop": 0.4805228088159918,
"repo_name": "shashankg7/word2graph2vec",
"id": "d3950cac002b5516c2be519f555fd50f4b57de4a",
"si... |
"""Public section, including homepage and signup."""
from flask import Blueprint, request
from flask_login import login_required, current_user
from data_wrangler.utils import flash_errors, render_extensions
from data_wrangler.models.post import Post
blueprint = Blueprint('admin', __name__, static_folder="../static")
... | {
"content_hash": "6cfb97348aade9ef619ceaffef03dce0",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 71,
"avg_line_length": 26.68421052631579,
"alnum_prop": 0.5818540433925049,
"repo_name": "Eleonore9/data-wrangler",
"id": "9cb075c89cd6fa6586d9e38fd154d22b3cd0ff4e",
"size"... |
def application(environ, start_response):
status = '200 OK'
output = 'Your wsgi is working fine!'
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]
| {
"content_hash": "d52957c8c2ec7053c286899f59c2059a",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 61,
"avg_line_length": 32.333333333333336,
"alnum_prop": 0.6116838487972509,
"repo_name": "tiagoprn/experiments",
"id": "ccee9f3a2c11a2e977a1c0fabe2331a1824a2dab",
"size": "... |
import pygame, sys, random
from pygame.locals import *
# Create the constants (go ahead and experiment with different values)
BOARDWIDTH = 4 # number of columns in the board
BOARDHEIGHT = 4 # number of rows in the board
TILESIZE = 80
WINDOWWIDTH = 640
WINDOWHEIGHT = 480
FPS = 30
BLANK = None
# R G... | {
"content_hash": "d25fc9aea2e7607906247c5e7e6c3647",
"timestamp": "",
"source": "github",
"line_count": 327,
"max_line_length": 116,
"avg_line_length": 36.82262996941896,
"alnum_prop": 0.6142346981147745,
"repo_name": "ABHISHEK2F24/PyGames",
"id": "5759fad6e55d130792360e989b3927bf757db09f",
"size":... |
import os
import sys
import time
from magnolia.utility import *
from magnolia.utility import LOG as L
from magnolia.script.kancolle import testcase_normal
class TestCase(testcase_normal.TestCase_Normal):
def __init__(self, *args, **kwargs):
super(TestCase, self).__init__(*args, **kwargs)
@classmethod... | {
"content_hash": "1a7cb3a470c1b10d2cce7c3fec7a82cc",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 108,
"avg_line_length": 31.87878787878788,
"alnum_prop": 0.5769961977186312,
"repo_name": "setsulla/stir",
"id": "f6957e0ffc628b92579562fdffd65e44e3f45e6e",
"size": "1052",... |
"""
Force10 Backend.
This backend will only work with SSH version 2 capable Force10 switches.
This excludes most, if not all, of the etherscale series.
The backend has been developed for the E series.
The backend has been developed and tested on a Terascale E300 switch.
The switch (or router, depending on your leve... | {
"content_hash": "a55bc70550b4474c85ca17063c36deb9",
"timestamp": "",
"source": "github",
"line_count": 321,
"max_line_length": 134,
"avg_line_length": 31.660436137071652,
"alnum_prop": 0.6367214405195316,
"repo_name": "NORDUnet/opennsa",
"id": "917706b8e84b8309840848e450ced5580b146c28",
"size": "1... |
import unittest
import numpy
import chainer
from chainer import cuda
from chainer import gradient_check
from chainer import links
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
from chainer.utils import array
def _check_forward(e1, e2, f, y_expect):
e1 = chain... | {
"content_hash": "b8bfdd5942e435167bd593d5e285dd50",
"timestamp": "",
"source": "github",
"line_count": 289,
"max_line_length": 76,
"avg_line_length": 26.110726643598618,
"alnum_prop": 0.6040286244367877,
"repo_name": "cemoody/chainer",
"id": "1de470c1d659bc0824be717fa631c3942fe7d0ba",
"size": "754... |
from typing import List, Iterable, Type
import gzip
import numpy as np
def get_string_vector_reader(dtype: Type = np.float32, columns: int = None):
"""Get a reader for vectors encoded as whitespace-separated numbers."""
def process_line(line: str, lineno: int, path: str) -> np.ndarray:
numbers = line.... | {
"content_hash": "4fa7037a442486376d20a2f416975d03",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 79,
"avg_line_length": 37.17948717948718,
"alnum_prop": 0.5524137931034483,
"repo_name": "juliakreutzer/bandit-neuralmonkey",
"id": "d6545b2a3317e896a5bafc7e555baf7f910a8f0c"... |
'''
SMTP/Email publishers
@author: Michael Eddington
@version: $Id$
'''
#
# Copyright (c) 2009 Michael Eddington
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, incl... | {
"content_hash": "e30293d2601d925e50b49c4cc97b7006",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 103,
"avg_line_length": 25.92241379310345,
"alnum_prop": 0.7213169271699368,
"repo_name": "thecrackofdawn/Peach2.3",
"id": "8db5ee5c238c8243a02f8dd71333fe5fcdc75d8a",
"siz... |
import csv
import datetime
from collections import defaultdict
from dateutil import parser
from copy import deepcopy
import sys, getopt
from collections import OrderedDict, Callable
import argparse
#http://stackoverflow.com/questions/6190331/can-i-do-an-ordered-default-dict-in-python
class DefaultOrderedDict(OrderedDi... | {
"content_hash": "2419a7fde643f26e23a20d985d8b0872",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 122,
"avg_line_length": 43.689473684210526,
"alnum_prop": 0.5989639802433442,
"repo_name": "MattTheRed/recurly_retention_reports",
"id": "1851eed1e12d3f2fa2e3d4c2f8f23655f6b... |
"""
Implement and register our stream filters
"""
import base64
import codecs
import io
import zlib
from .stream_filter import StreamFilter
# The best are the ones that are already done for us
def a85decode(data, **kwargs):
return base64.a85decode(data)
def a85encode(data, **kwargs):
return base64.a85decode(d... | {
"content_hash": "b0e48fa978f1aa87d0f293421764fff8",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 72,
"avg_line_length": 28.54385964912281,
"alnum_prop": 0.6631837738168408,
"repo_name": "ajmarks/gymnast",
"id": "a02bf40a2ffa44dc96ff4573aaa767afc3408010",
"size": "1627"... |
import os
from functools import partial
from pathlib import Path
from typing import Tuple, Union
from torchdata.datapipes.iter import FileOpener, IterableWrapper
from torchtext._download_hooks import HttpReader
from torchtext._internal.module_utils import is_module_available
from torchtext.data.datasets_utils import _... | {
"content_hash": "045106942e8b8df3f3a7960d4c09194d",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 117,
"avg_line_length": 34.5655737704918,
"alnum_prop": 0.690538297367797,
"repo_name": "pytorch/text",
"id": "09fba57b04f1e33fcb635fd5d887cc07519f5d06",
"size": "4217",
... |
import json
import logging
import os
import time
from osc_lib.command import command
from osc_lib import utils
from tackerclient.common import exceptions
from tackerclient.i18n import _
from tackerclient.osc import sdk_utils
from tackerclient.osc import utils as tacker_osc_utils
_attr_map = (
('id', 'ID', tacker... | {
"content_hash": "1342dc1a08dce753315de43620593db6",
"timestamp": "",
"source": "github",
"line_count": 593,
"max_line_length": 79,
"avg_line_length": 36.90725126475548,
"alnum_prop": 0.5681257424837796,
"repo_name": "openstack/python-tackerclient",
"id": "2517860e22b0eb3f3d25fcd6e3609b1d59cf6141",
... |
import cv2
from drivers.firmata import *
# Vars
stArea = 20
reqMes = 3
# Pins
diPin = 2
moPin = 3
class Application:
def setup(self):
# OpenCV
self.cam = cv2.VideoCapture(0)
self.face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
cv2.namedWindow("track-tv... | {
"content_hash": "70e7e1d345cc543bcb488a34c7da3dc9",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 88,
"avg_line_length": 27.90909090909091,
"alnum_prop": 0.5175533840028954,
"repo_name": "prozum/track-tv",
"id": "f49f4202d975c42e8ee0d8c13d22e5e9d37cd0da",
"size": "2781"... |
import copy
import uuid
from glanceclient import exc as glance_exceptions
import mock
import mox
from neutronclient.v2_0 import client as neutronclient
import six
from heat.common import exception
from heat.common import template_format
from heat.engine.clients.os import cinder
from heat.engine.clients.os import glan... | {
"content_hash": "0f70eb1a7fe0379e2380b7ad6ad328ed",
"timestamp": "",
"source": "github",
"line_count": 1393,
"max_line_length": 79,
"avg_line_length": 42.74012921751615,
"alnum_prop": 0.5895661521406856,
"repo_name": "rh-s/heat",
"id": "bdf7a84ebd7b4c63c127453175f49060b8d2fa8e",
"size": "60112",
... |
import sqlite3
import urllib
import re
from urllib.request import urlopen
from bs4 import BeautifulSoup
from phyllo.phyllo_logger import logger
# Case 1: Sections split by numbers (Roman or not) followed by a period, or bracketed. Subsections split by <p> tags
def parsecase1(ptags, c, colltitle, title, author, date, ... | {
"content_hash": "73326136c075c852a8b9e9769a4c9a09",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 116,
"avg_line_length": 38.50588235294118,
"alnum_prop": 0.5633974946532233,
"repo_name": "oudalab/phyllo",
"id": "be243d9265597f7636a903f49e99917d9d64348e",
"size": "3273"... |
import argparse
import datetime
import logging
import os
import statistics
import sys
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor, as_completed
from functools import partial
from multiprocessing.pool import ThreadPool
import math
from eviltransform import gcj2wgs_exact
from tq... | {
"content_hash": "824a1a9715484f489131d904d4519291",
"timestamp": "",
"source": "github",
"line_count": 237,
"max_line_length": 92,
"avg_line_length": 39.48945147679325,
"alnum_prop": 0.572283363607223,
"repo_name": "alexzatsepin/omim",
"id": "1374459a6168240d1c4be039724ed2e48659e124",
"size": "938... |
from unittest import mock
import unittest
from parameterized import parameterized
from airflow.exceptions import AirflowException
from airflow.sensors.s3_key_sensor import S3KeySensor
class S3KeySensorTests(unittest.TestCase):
def test_bucket_name_None_and_bucket_key_as_relative_path(self):
"""
... | {
"content_hash": "45f129aff1e49a255b1f7b52372aef96",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 83,
"avg_line_length": 35.83783783783784,
"alnum_prop": 0.6165158371040724,
"repo_name": "r39132/airflow",
"id": "320fff3a1f56460b80597b44989c41d09c2e16ad",
"size": "3464",... |
import lz4.stream
import pytest
import sys
import os
if sys.version_info < (3, ):
from struct import pack, unpack
def _get_format(length, byteorder, signed):
_order = {'l': '<', 'b': '>'}
_fmt = {1: 'b', 2: 'h', 4: 'i', 8: 'q'}
_sign = {True: lambda x: x.lower(), False: lambda x: x.up... | {
"content_hash": "bb054705bc4128c8724bdd7923850897",
"timestamp": "",
"source": "github",
"line_count": 555,
"max_line_length": 151,
"avg_line_length": 34.02162162162162,
"alnum_prop": 0.6379091197966317,
"repo_name": "python-lz4/python-lz4",
"id": "6b49267e262b01f282ed6da27bc3a479278ff026",
"size"... |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_... | {
"content_hash": "dacf0fa3f4297971f67bba6406bc1454",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 134,
"avg_line_length": 27.17910447761194,
"alnum_prop": 0.6977850997620355,
"repo_name": "mahabs/nitro",
"id": "3f5174ed83d969f1abd64e59aa753f086767d43c",
"size": "6077",... |
from django.conf import settings
from django.contrib import messages, auth
from django.contrib.auth import views as django_views
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect
from django.utils.translation import ugettext_lazy as _
from django.template.response import Te... | {
"content_hash": "c53196e40c8951d2c7b2ae841c99d25c",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 80,
"avg_line_length": 38.24590163934426,
"alnum_prop": 0.7261037291041578,
"repo_name": "tfroehlich82/saleor",
"id": "265681ccde629b6d1d2d2356efaced5854db4984",
"size": "2... |
"""\
========================
Session Example
========================
A simple persistent request handler component.
Each time a URL that is handled by this component is requested, the page's
'hit counter' is incremented and shown to the user as text.
"""
from Axon.Component import component
from Axon.Ipc import prod... | {
"content_hash": "6c9c3b34cf2053182b3fd861a9b346b6",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 75,
"avg_line_length": 30.28846153846154,
"alnum_prop": 0.5784126984126984,
"repo_name": "sparkslabs/kamaelia_",
"id": "7e2487f211ed21c283b8388482e5d44f2e8c82f9",
"size": "... |
from . import dao, validator, webserver, updater, api
import yaml
class PrefixListMain:
updaterThread = None
webServerThread = None
def __init__(self, configfile):
with open(configfile, "r") as stream:
config = yaml.load(stream)
if "dao" in config:
# Start databas... | {
"content_hash": "c2504cf1cb339c7748710cddecdaf59f",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 85,
"avg_line_length": 28.342105263157894,
"alnum_prop": 0.6128133704735376,
"repo_name": "emjemj/pre-fixlist",
"id": "e7fa24037ade7db296379150bd0a95cc3a243fe3",
"size": "1... |
import urllib2
from bs4 import BeautifulSoup
import pickle
years = range(1875, 1980)
horse_list = []
def horse_pair(td, year):
name = str(td.string)
a = td.find("a")
if a is not None and "redlink" not in a.get("href"):
url = str("https://en.wikipedia.org" + a.get("href"))
else:
url = ... | {
"content_hash": "cc2ae6d68622ffd8ccccb30f3e06ae22",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 77,
"avg_line_length": 24.25,
"alnum_prop": 0.6050753370340999,
"repo_name": "tjweisman/horseorfris",
"id": "f7bb6a5d27efb95cd6a9a0b78060d63732e102e1",
"size": "1261",
"b... |
from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import AbstractUser
class UserProfile(AbstractUser):
name_cn = models.CharField('中文名', max_length=30)
phone = models.CharField('手机', max_length=11, null=True, blank=True)
class Meta:
verbose_name... | {
"content_hash": "e601010edaef674148934947766e07af",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 72,
"avg_line_length": 26.875,
"alnum_prop": 0.6906976744186046,
"repo_name": "1032231418/python",
"id": "f21f7c91ea6bccd946fb2d8a61e7cc8d66812bff",
"size": "472",
"binar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.