text stringlengths 4 1.02M | meta dict |
|---|---|
import logging
from six.moves.urllib.parse import urljoin
from xml.etree import ElementTree
import recurly
import recurly.js as js
from recurly.errors import *
from recurly.resource import Resource, Money, PageError
"""
Recurly's Python client library is an interface to its REST API.
Please see the Recurly API doc... | {
"content_hash": "98c4cd83c6e449f77e576abc33003efe",
"timestamp": "",
"source": "github",
"line_count": 952,
"max_line_length": 99,
"avg_line_length": 27.98424369747899,
"alnum_prop": 0.5847753462707856,
"repo_name": "tbartelmess/recurly-client-python",
"id": "77ea59fadc59781f92a0b3723997770b4db2af19... |
"""Import linear python op for backward compatibility."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
linear = tf.nn.linear
| {
"content_hash": "fd16fa2ec8ad7d17d6893967c92c5b34",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 57,
"avg_line_length": 26.875,
"alnum_prop": 0.7581395348837209,
"repo_name": "moonboots/tensorflow",
"id": "b711fca170b8daec26cdb7849739b4069719773f",
"size": "892",
"bin... |
'''
Pypelib Database settings for SQLAlchemy
@author: SergioVidiella
'''
#
# Database parameters.
# DATABASE_HOST: it is usually 'localhost' (or 127.0.0.1).
# DATABASE_DIALECT: 'mysql', 'sqlite', 'postgresql', etc...
# DATABASE_DIALECT: use the form '+driver' e.g. '+psycopg2'. If any driver is used don't change it.
#... | {
"content_hash": "5d684b413ee9c0e21fffb0bfb8289238",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 99,
"avg_line_length": 26.944444444444443,
"alnum_prop": 0.709278350515464,
"repo_name": "ict-felix/stack",
"id": "1852acd041c8a2124696903812b96ff26f34e67d",
"size": "485",... |
from flask import request
from flask.ext.classy import FlaskView, route
from sqlalchemy.exc import IntegrityError
from smsgw.models import Tag
from smsgw.lib.utils import response
from smsgw.resources import decorators
from smsgw.resources.tags.schemas import post, put
from smsgw.resources.error.api import ErrorResou... | {
"content_hash": "4cab72e8611e4457c760c87e48bce739",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 70,
"avg_line_length": 25.928571428571427,
"alnum_prop": 0.5694608421881149,
"repo_name": "VojtechBartos/smsgw",
"id": "cd73b72af596771d2946102103765cc458eba565",
"size": "... |
import os
import subprocess
import sys
import warnings
from cinder import objects
# NOTE(geguileo): Sphinx will fail to generate the documentation if we are
# using decorators from any OVO in cinder.objects, because the OVOs are only
# added to the cinder.objects namespace when the CLI programs are run. So we
# nee... | {
"content_hash": "5825270b52f3c0655410ff5702c1c38d",
"timestamp": "",
"source": "github",
"line_count": 249,
"max_line_length": 79,
"avg_line_length": 33.12449799196787,
"alnum_prop": 0.6921677982541222,
"repo_name": "NetApp/cinder",
"id": "f47fc2fee87e284a84d3455705e26c8f7a55aea5",
"size": "9214",... |
__author__ = 'sstober'
import logging
log = logging.getLogger(__name__)
from pylearn2.utils.timing import log_timing
from pylearn2.train_extensions import TrainExtension
from pylearn2.space import CompositeSpace
import theano
from sklearn.metrics import confusion_matrix, classification_report
import numpy as np
c... | {
"content_hash": "3853d3b6dcc42f53d509bd05dd732c06",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 92,
"avg_line_length": 32.82432432432432,
"alnum_prop": 0.5282009057225195,
"repo_name": "sstober/deepthought",
"id": "06f327da3860edad724a6b317df927cbb209e653",
"size": "... |
import angr
import logging
l = logging.getLogger('angr.procedures.stubs.CallReturn')
class CallReturn(angr.SimProcedure):
NO_RET = True
def run(self):
l.info("A factory.call_state-created path returned!")
return
| {
"content_hash": "410441a2a41907252ed9cfc83453ee26",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 61,
"avg_line_length": 21.727272727272727,
"alnum_prop": 0.694560669456067,
"repo_name": "tyb0807/angr",
"id": "23c9380bc1f29534ab9685017fe26d23ae2676d3",
"size": "239",
... |
""" Utilities to read namelist file
Originally adapted from
https://github.com/leifdenby/namelist_python
"""
from __future__ import print_function
import re
import warnings
from itertools import groupby
from .parameters import Param, Params
CONVERT_LOWERCASE = True
class Namelist(Params):
""" Parse / Format met... | {
"content_hash": "d2ea50f66182edc8254d26b053e840b3",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 115,
"avg_line_length": 34.11981566820276,
"alnum_prop": 0.5436250675310643,
"repo_name": "perrette/pyglacier",
"id": "ee3e155cc232e0b2a71a494b40c75710ec0af31b",
"size": "... |
import unittest
from datetime import date
import holidays
class TestRussia(unittest.TestCase):
def setUp(self):
self.holidays = holidays.RU()
def test_before_2005(self):
self.assertIn(date(2004, 11, 7), self.holidays)
self.assertNotIn(date(2004, 11, 4), self.holidays)
def test_... | {
"content_hash": "5cd7507941285ef3b45a4163a6b69071",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 65,
"avg_line_length": 38.4375,
"alnum_prop": 0.6390243902439025,
"repo_name": "ryanss/holidays.py",
"id": "e5825b61e3ec0c3edb1138af5f09641470fcd182",
"size": "1732",
"bi... |
from twisted.internet.defer import inlineCallbacks, returnValue
from flask_restful import fields, marshal
from floranet.models.model import Model
class Reflector(Model):
"""LoRa reflector application server interface
This appserver interface bounces any messages received
from a device back to that de... | {
"content_hash": "4ce6a05cd171ca80fd241a5bbd54dcfc",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 91,
"avg_line_length": 29.96153846153846,
"alnum_prop": 0.5952075310226786,
"repo_name": "Fluent-networks/floranet",
"id": "480267d7a2adbe70d8893fa65d29a2f91501c1ff",
"size... |
import argparse
import os
import dawn4py
from dawn4py.serialization import SIR, AST
from dawn4py.serialization import utils as serial_utils
from google.protobuf.json_format import MessageToJson, Parse
OUTPUT_NAME = "global_var_stencil"
OUTPUT_FILE = f"{OUTPUT_NAME}.cpp"
OUTPUT_PATH = f"{OUTPUT_NAME}.cpp"
def main(a... | {
"content_hash": "b496c7c1c2c0dbb2bd677a5af0983e86",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 104,
"avg_line_length": 29.67948717948718,
"alnum_prop": 0.5805615550755939,
"repo_name": "MeteoSwiss-APN/dawn",
"id": "36b7d300866b0894f9603cf7d99736dc60f1d6c9",
"size": "... |
'''This program aims to generate the first 10 elements of a Fibonacci series of integers'''
import numpy
x = numpy.zeros(10, dtype=int)
a = 0
b = 1
c = a + b
ratio = c/b
i = 0
while ratio>10e-10:
ratio = c/b
i = i+1
#temp = a
a = b
b = c
c = a+b
print 'Value of Golden ratio is %f after %d it... | {
"content_hash": "b18b3bfd73454fb0a0de77738bcc6150",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 91,
"avg_line_length": 21.25,
"alnum_prop": 0.6,
"repo_name": "fsbd1285228/PythonCodes",
"id": "28967d7d8446d5cb2ca12103edff143f9c750b1a",
"size": "340",
"binary": false,... |
"""SunPy Maps"""
from __future__ import absolute_import
__author__ = "Keith Hughitt"
__email__ = "[email protected]"
import os
import numpy as np
from sunpy.map.map import Map
from sunpy.map.header import MapHeader
from sunpy.map.mapcube import MapCube
from sunpy.map.compositemap import CompositeMap
from sunpy.m... | {
"content_hash": "30eda9adfd0d53b35f766c6b787dbf2c",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 80,
"avg_line_length": 31.923076923076923,
"alnum_prop": 0.5583789704271632,
"repo_name": "jslhs/sunpy",
"id": "2501a0978753bc51625a5150673fd962f500fcc4",
"size": "4565",
... |
"""
test_permutive
----------------------------------
Tests for `permutive` module.
"""
import sys
import unittest
from permutive import Permutive
class TestPermutive(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_permutive(self):
permutive = Per... | {
"content_hash": "eb8a05a57497d63d78379c8b1f79a7f9",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 57,
"avg_line_length": 15.76,
"alnum_prop": 0.6116751269035533,
"repo_name": "tailsdotcom/permutive-sdk",
"id": "a1ceee44c7b3bb7a8c8e654b4e83288fa1149fc9",
"size": "441",
... |
"""Generic testing tools.
Authors
-------
- Fernando Perez <[email protected]>
"""
from __future__ import absolute_import
#-----------------------------------------------------------------------------
# Copyright (C) 2009 The IPython Development Team
#
# Distributed under the terms of the BSD License. T... | {
"content_hash": "d4c48448e8c2eacfeca07aad7ed8e86d",
"timestamp": "",
"source": "github",
"line_count": 439,
"max_line_length": 110,
"avg_line_length": 30.05239179954442,
"alnum_prop": 0.5977412264079436,
"repo_name": "marcoantoniooliveira/labweb",
"id": "0bd3f7ae9310c44cd6636ca9acc6c1c39febd123",
... |
from django.db import models
from softdeletes.models import SoftDeletable
class Animal(SoftDeletable, models.Model):
CARNIVORE = 'c'
HERIVORE = 'h'
OMNIVORE = 'o'
EAT_CHOICES = (
(CARNIVORE, 'c'),
(HERIVORE, 'h'),
(OMNIVORE, 'o')
)
name = models.CharField(max_length=10... | {
"content_hash": "3b726e2b2559874b93b61cb09f41144a",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 63,
"avg_line_length": 27.17241379310345,
"alnum_prop": 0.6890862944162437,
"repo_name": "upgrad/django-deletes",
"id": "d50cd7b5459051fbbdb2ea4aee7205e138b3b11e",
"size": ... |
""" io on the clipboard """
from pandas import compat, get_option, option_context, DataFrame
from pandas.compat import StringIO
def read_clipboard(**kwargs): # pragma: no cover
"""
Read text from clipboard and pass to read_table. See read_table for the
full argument list
If unspecified, `sep` defaul... | {
"content_hash": "b3c4e78c3b85b00b8e71110d383bbe11",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 76,
"avg_line_length": 30.071428571428573,
"alnum_prop": 0.5924669155072956,
"repo_name": "stevenzhang18/Indeed-Flask",
"id": "dfa46156aaead4bd92895fd4ca65fba63474c092",
"s... |
"""
tests.atom
~~~~~~~~~~
Tests the cache system
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import datetime
import pytest
from werkzeug.contrib.atom import format_iso8601, AtomFeed, FeedEntry
class TestAtomFeed(object):
"""
Testcase for the ... | {
"content_hash": "e7daf6e7abc882f3c151e2ff23bbde63",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 72,
"avg_line_length": 28.548672566371682,
"alnum_prop": 0.5796652200867948,
"repo_name": "pjknkda/werkzeug",
"id": "e79e6c68fd47114818a4f179f4ec6efa338c24eb",
"size": "32... |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from oslo_log import log as logging
from congress.api import base
from congress.api import error_codes
from congress.api import webservice
from congress import exception
LOG = logging.getLogger(__name__)
cl... | {
"content_hash": "d6517be58c6ff0518ba2f42d39d5c8d9",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 78,
"avg_line_length": 40.710344827586205,
"alnum_prop": 0.5763171268846349,
"repo_name": "openstack/congress",
"id": "9f4c62aa483e97f600e4915e3e599763f299b202",
"size": "... |
'''
Counter enabled Ansible callback plugin (See DOCUMENTATION for more information)
'''
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible import constants as C
from ansible.plugins.callback import CallbackBase
from ansible.utils.color import colorize, hostcolor
f... | {
"content_hash": "f2342d6bfe01e3dabd3285df8e4f26bf",
"timestamp": "",
"source": "github",
"line_count": 245,
"max_line_length": 147,
"avg_line_length": 43.522448979591836,
"alnum_prop": 0.5496576948325987,
"repo_name": "thaim/ansible",
"id": "1c6e6697881d1c2ecd63951af1cae6ffc1a166d3",
"size": "1082... |
FUNCTION( 'void nom_send_initial_message( ANY context, ANY this, ANY that )', """
nom_send_message( context, this, this, that ) ;
""" )
FUNCTION( 'void nom_send_message( ANY context, ANY action, ANY this, ANY that )', """
nom_do_sync( FRAME__TASK_new( $CA(FRAME__APPLICATION_new( context, this )), action, that ) ) ... | {
"content_hash": "b69ef325e740f38d8e633238f5e4c086",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 96,
"avg_line_length": 29.75,
"alnum_prop": 0.5588235294117647,
"repo_name": "thomasmf/nomenine",
"id": "33a8d6491c349a8a8dc3c444425c828b9a9bff2b",
"size": "716",
"binary... |
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('polls', '0023_auto_20150831_1711'),
]
operations = [
migrations.AddField(
model_name='pollrun',
... | {
"content_hash": "f1322a8811ad4f5356fb02e4648b9313",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 180,
"avg_line_length": 39.65,
"alnum_prop": 0.5737704918032787,
"repo_name": "xkmato/tracpro",
"id": "4ef79b17fb25e38f1b9222068205c06f2ab1451e",
"size": "1610",
"binary"... |
"""example URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | {
"content_hash": "76685153998627495c94350168ecaedf",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 79,
"avg_line_length": 33.958333333333336,
"alnum_prop": 0.694478527607362,
"repo_name": "herald-it/django-yamaps",
"id": "92f73478004bc4cba393329ef32a80b752f0cbc5",
"size"... |
"""
test_mimpy
----------------------------------
Tests for `mimpy` module.
"""
from __future__ import absolute_import
import unittest
import mimpy
class TestMimpy(unittest.TestCase):
def setUp(self):
pass
def test_something(self):
pass
def tearDown(self):
pass
if __name__ =... | {
"content_hash": "e4ec9bae3dcd9289821b7fc954960599",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 38,
"avg_line_length": 13.615384615384615,
"alnum_prop": 0.5480225988700564,
"repo_name": "ohinai/mimpy",
"id": "a177ef0fbdc981288c61832fcd7a4550ab35fa75",
"size": "401",
... |
import os
import shutil
import htmlmin
import cssmin
import jsmin
from frozenweb.renderer import Renderer
from frozenweb.utils import read_text_file, read_binary_file, ensure_folder, to_bytes, write_binary_file
from frozenweb.config import FileConfig, FolderConfig
class Builder:
def __init__(self, config):
... | {
"content_hash": "4e252794bee0cc03c03de47125f0184f",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 104,
"avg_line_length": 33.76119402985075,
"alnum_prop": 0.6074270557029178,
"repo_name": "rufrozen/frozenweb",
"id": "4efcab5df9ffbe69b396764d2b7bf1d9a9360b74",
"size": "2... |
import datetime
import jsonpatch
import pecan
from pecan import rest
import six
import wsme
from wsme import types as wtypes
import wsmeext.pecan as wsme_pecan
from ironic.api.controllers import base
from ironic.api.controllers import link
from ironic.api.controllers.v1 import collection
from ironic.api.controllers.v... | {
"content_hash": "2904797a57c35f2bc5bb2f4b66390d93",
"timestamp": "",
"source": "github",
"line_count": 281,
"max_line_length": 79,
"avg_line_length": 37.30960854092527,
"alnum_prop": 0.5608546356352537,
"repo_name": "JioCloud/ironic",
"id": "62025357857860263515656d468f21ad30aa7e1b",
"size": "1111... |
from django.contrib import admin
from sitegeist.data.census.models import Tract
class TractAdmin(admin.ModelAdmin):
list_display = ('tract', 'county', 'state')
admin.site.register(Tract, TractAdmin) | {
"content_hash": "c7be792794fb58698461f100225c3ab7",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 47,
"avg_line_length": 29.142857142857142,
"alnum_prop": 0.7696078431372549,
"repo_name": "sunlightlabs/sitegeist",
"id": "37fd7715fa513d72e51d895a1195bbaf6aaa5284",
"size":... |
import logging
import struct
import six
from six.moves import xrange
from kafka.codec import (
gzip_encode, gzip_decode, snappy_encode, snappy_decode
)
from kafka.common import (
Message, OffsetAndMessage, TopicAndPartition,
BrokerMetadata, TopicMetadata, PartitionMetadata,
MetadataResponse, ProduceR... | {
"content_hash": "e16ecc858e3346939d3c39fd55d97dfc",
"timestamp": "",
"source": "github",
"line_count": 604,
"max_line_length": 84,
"avg_line_length": 36.067880794701985,
"alnum_prop": 0.5592380078035345,
"repo_name": "docker-hub/kafka-python",
"id": "b34a95d1d2d37f8822e014ff44b62047b1283cc5",
"siz... |
"""
WSGI config for duckiehunt project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SE... | {
"content_hash": "baca313d452d5df8f8e3a5e397c5ab9a",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 24.8125,
"alnum_prop": 0.7732997481108312,
"repo_name": "lastcoolnameleft/duckiehunt",
"id": "a2506ea92105641bdd662303d68ab91ca4b3c17b",
"size": "397... |
import re
from typing import Pattern
import requests_mock
from tests.fixture_data import (
EVENT_RESPONSE_DATA,
EXECUTION_DATA,
OUTPUT_DATUM_DATA,
OUTPUT_DATUM_DOWNLOAD_RESPONSE_DATA,
OUTPUT_DATUM_RESPONSE_DATA,
PROJECT_DATA,
)
API_PREFIX = 'https://app.valohai.com/api/v0/'
def get_startswi... | {
"content_hash": "ce995b1a74c4e86281d55f41b20c7bfc",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 102,
"avg_line_length": 37.973684210526315,
"alnum_prop": 0.6846846846846847,
"repo_name": "valohai/valohai-cli",
"id": "1dff86e5948557b98da43b45a528b5477a8de68e",
"size": ... |
"""
Buffer editing for both ST2 and ST3 that 'just works'.
Copyright, SublimeXiki project <https://github.com/lunixbochs/SublimeXiki>
"""
import inspect
import sublime
import sublime_plugin
try:
sublime.edit_storage
except AttributeError:
sublime.edit_storage = {}
def run_callback(func, *args, **kwargs):
... | {
"content_hash": "6d8f699cc6ad82f73f417fab980e2266",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 74,
"avg_line_length": 24.8,
"alnum_prop": 0.5619501466275659,
"repo_name": "teedoo/dotfiles",
"id": "436395d9204ee68ace03a9c6d213a692855d1659",
"size": "2728",
"binary"... |
from __future__ import print_function, division, absolute_import
import imageio
import imgaug as ia
import imgaug.augmenters as iaa
def main():
aug = iaa.BlendAlphaMask(
iaa.SomeColorsMaskGen(),
iaa.OneOf([
iaa.TotalDropout(1.0),
iaa.AveragePooling(8)
])
)
... | {
"content_hash": "dcdd610982d7d9f04f7137d6577e0a9f",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 78,
"avg_line_length": 35,
"alnum_prop": 0.6190476190476191,
"repo_name": "aleju/imgaug",
"id": "78820fff5a0911baf744031276397c4d07bdaa38",
"size": "1575",
"binary": fals... |
_contracts = {}
class Contract:
@classmethod
def __init_subclass__(cls):
_contracts[cls.__name__] = cls
def __set__(self, instance, value):
self.check(value)
instance.__dict__[self.name] = value
def __set_name__(self, owner, name):
self.name = name
@classmethod
... | {
"content_hash": "51308276a87f1500892fbe5877c3c9eb",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 84,
"avg_line_length": 22.508196721311474,
"alnum_prop": 0.57319737800437,
"repo_name": "kjihee/lab_study_group",
"id": "5d00ec47e718da6419d3f44c51a16a5102dc6bdf",
"size":... |
"""
github.com/mikedh/trimesh
----------------------------
Library for importing, exporting and doing simple operations on triangular meshes.
"""
from . import ray
from . import util
from . import units
from . import poses
from . import graph
from . import sample
from . import repair
from . import convex
from . impor... | {
"content_hash": "2267fb2d63a2e7ef868985f06e3d32cf",
"timestamp": "",
"source": "github",
"line_count": 3040,
"max_line_length": 86,
"avg_line_length": 32.03980263157895,
"alnum_prop": 0.5591626369339124,
"repo_name": "mikedh/trimesh",
"id": "5e63e6bc0adeb86ae919c06d78e9a1644132ed88",
"size": "9740... |
"""
Interfaces with Egardia/Woonveilig alarm control panel.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/alarm_control_panel.egardia/
"""
import logging
import requests
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.c... | {
"content_hash": "e3312eb668a06d3b0fc82f6462200a28",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 74,
"avg_line_length": 34.359154929577464,
"alnum_prop": 0.6247181799549087,
"repo_name": "PetePriority/home-assistant",
"id": "dfd60c4abde14df03ee52648e646066338c55628",
... |
from __future__ import print_function
from subprocess import call
import sys
from os import access, listdir, makedirs, X_OK
from os.path import dirname, isdir, isfile, join, normcase, normpath
from shutil import rmtree, copy
# A hackish way to import the configuration
sys.path.append(dirname(__file__))
from configurat... | {
"content_hash": "e0e46cf9c10bc544370d67f529fecf4e",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 86,
"avg_line_length": 36.31325301204819,
"alnum_prop": 0.621765096217651,
"repo_name": "baharev/CSV_Test",
"id": "59a82f97d9dc387a7501a29a8c3d0e3927018eda",
"size": "6192... |
import sys, serial
import numpy as np
from time import sleep
from collections import deque
from matplotlib import pyplot as plt
# class that holds analog data for N samples
class AnalogData:
# constr
def __init__(self, maxLen):
self.v1 = deque([0.0]*maxLen)
self.v2 = deque([0.0]*maxLen)
self.v3 = deque([0.0]*... | {
"content_hash": "b7a839fd3e2b8e6a01c93e5564b0b941",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 75,
"avg_line_length": 23.181818181818183,
"alnum_prop": 0.6649237472766885,
"repo_name": "zxc2694/STM32F429_Quadrotor",
"id": "2bb92b8bfed18d537af004190d3f4a38527f4343",
"... |
import os
import tempfile
import zipfile
from azure.common import AzureMissingResourceHttpError
try:
from azure.storage.blob import BlobService
except ImportError:
from azure.storage.blob import BlockBlobService as BlobService
from shutil import unpack_archive
from threading import Event
# TODOS: use Azure sn... | {
"content_hash": "611749edadb183f7beaf70f7631c4f5b",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 91,
"avg_line_length": 38.714285714285715,
"alnum_prop": 0.5699429721569943,
"repo_name": "brain-research/mirage-rl-bpttv",
"id": "76380f4f66e5d7b53a0db82251ffc93407056a0c",... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_kaadu_hue.iff"
result.attribute_template_id = 9
result.stfName("monster_name","kaadu")
#### BEGIN MODIFICATIONS ####
result.setStringAttribute("radial_filename", "radials/player_pet.py")
result.optio... | {
"content_hash": "ac1bf8e016d55d2e83234ea287d9b61e",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 70,
"avg_line_length": 26.8125,
"alnum_prop": 0.7202797202797203,
"repo_name": "anhstudios/swganh",
"id": "a5735756583f887da380e89bbe90e591b133250b",
"size": "574",
"bina... |
import unittest2
from exam.decorators import fixture
from mock import Mock
from expect.core.args import AnyArgs
from expect.core.args import Args
from expect.core.expectation import ShouldReceiveExpectation
from expect.core.stub import Stub
from expect.core.test_environment import TestEnvironment
class TestEnvironm... | {
"content_hash": "b6a3344339b4c5b6ffece25d634b974c",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 80,
"avg_line_length": 37.36619718309859,
"alnum_prop": 0.6607614021862043,
"repo_name": "sumeet/expect",
"id": "bb6258d237599483b1e230c8b5eadf43a85695de",
"size": "2653",
... |
import re
from .output_formatter_style import OutputFormatterStyle
from .output_formatter_style_stack import OutputFormatterStyleStack
class OutputFormatter(object):
FORMAT_PATTERN = '(?isx)(\\\\?)<(/?)([a-z][a-z0-9_=;-]*)?>((?: [^<\\\\]+ | (?!<(?:/?[a-z]|/>)). | .(?<=\\\\<) )*)'
def __init__(self, decorat... | {
"content_hash": "93728a2fa53795bb2047560e811331bc",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 118,
"avg_line_length": 30.475728155339805,
"alnum_prop": 0.5466709143039185,
"repo_name": "Romibuzi/cleo",
"id": "abeaf9ba364c33fb830f85ef26b44c7380a0b6b5",
"size": "3164... |
import os
import logging
import logging.handlers
log = logging.getLogger('imc')
console = logging.StreamHandler()
formatter = logging.Formatter(
'%(asctime)s - %(name)s - %(levelname)s - %(message)s')
console.setFormatter(formatter)
def enable_file_logging(filename="imcsdk.log"):
file_handler = logging.handl... | {
"content_hash": "bfce351d046f838ffeb5171e986dd655",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 92,
"avg_line_length": 22.52173913043478,
"alnum_prop": 0.6708494208494209,
"repo_name": "ragupta-git/ImcSdk",
"id": "f6cfa18418a4236f467e39d427e1314034bf62fe",
"size": "16... |
""" Module that holds a general kervi application module threading class"""
from kervi.utility.thread import KerviThread
from kervi.spine import Spine
class ModuleThread(KerviThread):
def __init__(self):
KerviThread.__init__(self)
self.spine = Spine()
self.spine.register_command_handler("s... | {
"content_hash": "34cd7bc1f6a9cbf7fb1186f43ec320ef",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 79,
"avg_line_length": 27.85,
"alnum_prop": 0.6552962298025135,
"repo_name": "kervi/kervi",
"id": "6dbe9e54dc6becda375a76ee24876a575bafc562",
"size": "655",
"binary": fal... |
"""
Some models for pulling data from Trac.
Initially generated by inspectdb then modified heavily by hand, often by
consulting http://trac.edgewall.org/wiki/TracDev/DatabaseSchema.
These are far from perfect: many (most?) Trac tables have composite primary
keys, which Django can't represent. This means a lot of buil... | {
"content_hash": "a2a1345575cee4ae8de1ba7da94d8765",
"timestamp": "",
"source": "github",
"line_count": 282,
"max_line_length": 106,
"avg_line_length": 30.929078014184398,
"alnum_prop": 0.6536344875028663,
"repo_name": "alawnchen/djangoproject.com",
"id": "ed6c4e817eebe30dcbc5a363e46c00d4a7ada49e",
... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "codery.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "fd4ea7a936cba77cc10ed47a5beb8790",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 70,
"avg_line_length": 25.22222222222222,
"alnum_prop": 0.7092511013215859,
"repo_name": "inducer/codery",
"id": "ec4b46af971c884651339564e3a07b7877ac962d",
"size": "249",
... |
from __future__ import absolute_import
from zipfile import ZipFile
from django.core.files.uploadedfile import SimpleUploadedFile
def unzip(file_obj):
"""
Take a path to a zipfile and checks if it is a valid zip file
and returns...
"""
files = []
# TODO: implement try-except here
zip = Zi... | {
"content_hash": "0ea7a00b228c1a2ad5cf4dc1ef06104f",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 87,
"avg_line_length": 30.153846153846153,
"alnum_prop": 0.6543367346938775,
"repo_name": "skirsdeda/django-filer",
"id": "5cc90836ae649408699af4335115a5b65b2b4e86",
"size"... |
from swgpy.object import *
def create(kernel):
result = Weapon()
result.template = "object/weapon/melee/2h_sword/crafted_saber/shared_sword_lightsaber_two_handed_s11_gen3.iff"
result.attribute_template_id = 10
result.stfName("weapon_name","sword_lightsaber_2h_type11")
#### BEGIN MODIFICATIONS ####
#### EN... | {
"content_hash": "b4e28f385bd1ce5edbb70af2f6b39cc2",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 111,
"avg_line_length": 27.53846153846154,
"alnum_prop": 0.7178770949720671,
"repo_name": "anhstudios/swganh",
"id": "c2bad136c36ae6c878bf467a4828b1f38d3db906",
"size": "50... |
from functools import partial
from nose.tools import eq_
from bleach import clean
clean = partial(clean, tags=['p'], attributes=['style'])
def test_allowed_css():
tests = (
('font-family: Arial; color: red; float: left; '
'background-color: red;', 'color: red;', ['color']),
('border: ... | {
"content_hash": "8af66843eb212e05794e2301496432cc",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 84,
"avg_line_length": 45.1505376344086,
"alnum_prop": 0.5398904501071684,
"repo_name": "kiawin/bleach",
"id": "588c8ce154cf83292c37f5c475efcb958863dbff",
"size": "4199",
... |
"""websocket cmd client for wssrv.py example."""
import argparse
import base64
import hashlib
import os
import signal
import sys
import asyncio
try:
import selectors
except ImportError:
from asyncio import selectors
import aiohttp
from aiohttp import websocket
WS_KEY = b"258EAFA5-E914-47DA-95CA-C5AB0DC85B11"... | {
"content_hash": "d957474933a0367b0a716f2131e58acb",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 72,
"avg_line_length": 29.201923076923077,
"alnum_prop": 0.6187026671056964,
"repo_name": "saghul/aiohttp",
"id": "3a75a28fc92766651ff4b2726260962fc4866bd4",
"size": "3060... |
"""Minor cleanup
Revision ID: 182eb89ec642
Revises: 2614c3bbec2a
Create Date: 2014-11-19 15:09:45.727348
"""
# revision identifiers, used by Alembic.
import base64
import uuid
revision = '182eb89ec642'
down_revision = '2614c3bbec2a'
from alembic import op
import sqlalchemy as sa
from sqlalchemy import text
def u... | {
"content_hash": "eaee0f022847e62b5d9abdd44503eb23",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 90,
"avg_line_length": 26.647058823529413,
"alnum_prop": 0.6401766004415012,
"repo_name": "morelab/appcomposer",
"id": "081ed3a87d469f750e955f8b6c838cd95ac97df6",
"size": "... |
import unittest
import IECore
import IECoreScene
import Gaffer
import GafferTest
import GafferScene
import GafferSceneTest
class CustomAttributesTest( GafferSceneTest.SceneTestCase ) :
def test( self ) :
sphere = IECoreScene.SpherePrimitive()
input = GafferSceneTest.CompoundObjectSource()
input["in"].setVal... | {
"content_hash": "5f3e6dfba8cd5fe009c50b5d8c377cb8",
"timestamp": "",
"source": "github",
"line_count": 337,
"max_line_length": 182,
"avg_line_length": 38.519287833827896,
"alnum_prop": 0.653955781526847,
"repo_name": "boberfly/gaffer",
"id": "b1ce641a01854a3ea8315e32ed383fcec896ad94",
"size": "148... |
"""Contains TF-Slim code for training models.
This script contains various functions for training models. These include
manipulating gradients, creating a `train_op` (an operation that computes the
loss and applies the gradients) and a training loop function. The training loop
allows the user to pass in the `train_op`... | {
"content_hash": "998621dcdddbf8bf69e31e55b783ee92",
"timestamp": "",
"source": "github",
"line_count": 752,
"max_line_length": 80,
"avg_line_length": 38.80452127659574,
"alnum_prop": 0.6707103937493575,
"repo_name": "chris-chris/tensorflow",
"id": "b70d612f55b595be028c8c79bf9fdc9b69c8df32",
"size"... |
from srttimeadjuster import main
if __name__ == '__main__':
main.main()
| {
"content_hash": "1ac2100c0eb999868dbf244c58f5903f",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 32,
"avg_line_length": 19.25,
"alnum_prop": 0.6103896103896104,
"repo_name": "ArchibaldBienetre/srttimeadjuster",
"id": "eb09f587a7b08204a52e18ae83cc48d23ca2f9bf",
"size": "... |
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import io
import os
import re
import shutil
import time
import warnings
from unittest import SkipTest, skipUnless
from django.conf import settings
from django.core import management
from django.core.management import execute_from_command_line
from djan... | {
"content_hash": "04c8a28ce8d79c50d112db3485c36cb3",
"timestamp": "",
"source": "github",
"line_count": 764,
"max_line_length": 194,
"avg_line_length": 46.738219895287955,
"alnum_prop": 0.6339475747731601,
"repo_name": "joequery/django",
"id": "b9c4b4fc3e5f0480e421523755c3b145c47dac51",
"size": "35... |
import ldap
import config
SCOPE = ldap.SCOPE_SUBTREE
class LdapApi:
def __init__(self, uri, nia=None, password=None, port="389"):
self.port = port
self.ldapCon = ldap.initialize(uri + ":" +self.port)
self.nia = nia
self.password = password
def search(self, dn, filt='(objectCla... | {
"content_hash": "ffcf88d8eead827f135c43d884ca0b39",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 95,
"avg_line_length": 29.625,
"alnum_prop": 0.5949367088607594,
"repo_name": "Patataman/StudentApi",
"id": "d3ff643436bd9bd2e7cb8e15b4d49831fdc66b57",
"size": "736",
"bi... |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("algorithms", "0012_auto_20210728_1019"),
]
operations = [
migrations.AlterModelOptions(
name="job",
options={
"ordering": ("created",),
"permi... | {
"content_hash": "5a4f02b8f224508bfbfd3ddc2229d5a0",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 73,
"avg_line_length": 23.764705882352942,
"alnum_prop": 0.5099009900990099,
"repo_name": "comic/comic-django",
"id": "15037e4de55ddb47a193d8a579fa0cd7ffa5926b",
"size": "4... |
import os
import sys
import logging
import angr
import psutil
from common import bin_location
def test_memory_watcher():
binary = os.path.join(bin_location, 'tests', 'x86_64', 'veritesting_a')
proj = angr.Project(binary, auto_load_libs=False)
simgr = proj.factory.simulation_manager()
memory_watcher ... | {
"content_hash": "15625d90bc5cc976ebc594d861817ec6",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 91,
"avg_line_length": 28.9375,
"alnum_prop": 0.6558675305975522,
"repo_name": "angr/angr",
"id": "70040768a4df7fb64feaf876a2d2bf87d9980506",
"size": "1389",
"binary": fa... |
import unittest
import os
import pprint
import dataclasses
import xml.etree.ElementTree as ET
# from vkxml2rs.elements import *
# from vkxml2rs.parse import *
from vkxml2rs import *
from modules.parse import *
class TestConverter(unittest.TestCase):
def test_parse_basetype(self):
xml = (
'<ty... | {
"content_hash": "c1ef877926251feddc71d5cace353642",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 173,
"avg_line_length": 51.21546961325967,
"alnum_prop": 0.5294498381877023,
"repo_name": "tsukushibito/tempura",
"id": "9db56744632ebafd72fc3b69e4aa0f08688a0127",
"size":... |
import os
import sys
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
basedir = os.path.abspath(os.path.join(os.path.dirname(__fil... | {
"content_hash": "b143c226070b2bbeeb1ab6c856a79f17",
"timestamp": "",
"source": "github",
"line_count": 319,
"max_line_length": 80,
"avg_line_length": 32.77742946708464,
"alnum_prop": 0.6836266258607498,
"repo_name": "Lemma1/MAC-POSTS",
"id": "f0e28a7c0b83567f9f9fc881a634fe9a114a4662",
"size": "108... |
import hashlib
import os
import random
import re
import string
import time
from base64 import decodestring
from contextlib import contextmanager
from datetime import datetime
from django import dispatch, forms
from django.conf import settings
from django.contrib.auth.hashers import BasePasswordHasher, mask_hash
from d... | {
"content_hash": "f192bfc4d12a33e33be412e3cdb97793",
"timestamp": "",
"source": "github",
"line_count": 666,
"max_line_length": 79,
"avg_line_length": 36.63813813813814,
"alnum_prop": 0.6120650793000287,
"repo_name": "mdaif/olympia",
"id": "cb6a043806b65c97f18f3b852e2cb718aaa4a99b",
"size": "24401"... |
from a5288.reports import MissedCallbackReport
CUSTOM_REPORTS = (
('Custom Reports', (
MissedCallbackReport,
)),
)
| {
"content_hash": "944e6ae1502abfb57bbd2a9fc2fb2803",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 46,
"avg_line_length": 18.857142857142858,
"alnum_prop": 0.6666666666666666,
"repo_name": "puttarajubr/commcare-hq",
"id": "d7b9bf54eda985ea87c9dee9de9e92d36b487185",
"size"... |
"""
Django settings for kuiqblog project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
from __future__ import absolute_import, unicode_literals
import environ
... | {
"content_hash": "26f29dbbc03390f003af56c779361c85",
"timestamp": "",
"source": "github",
"line_count": 240,
"max_line_length": 114,
"avg_line_length": 36.15833333333333,
"alnum_prop": 0.6106245678727817,
"repo_name": "drxos/kuiqblog",
"id": "7ae54189587686ae6fc925340822c012e4f94d6e",
"size": "8702... |
"""
Tests for `logsucker` module.
"""
import pytest
from logsucker import logsucker
class TestLogsucker(object):
@classmethod
def setup_class(cls):
pass
def test_something(self):
pass
@classmethod
def teardown_class(cls):
pass
| {
"content_hash": "846e01ed0ae214211eb0ac984362cbb6",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 31,
"avg_line_length": 14.526315789473685,
"alnum_prop": 0.6376811594202898,
"repo_name": "qba73/logsucker",
"id": "07584dfeb02c7d8d579fd97e4660b5357fc0d592",
"size": "276"... |
import numpy
from chainer import backend
from chainer import initializer
from chainer import utils
_orthogonal_constraints = { # (assert emb., assert proj.)
'auto': (False, False),
'projection': (False, True),
'embedding': (True, False),
'basis': (True, True),
}
# Original code forked from MIT lic... | {
"content_hash": "0683e1c88073fd965dd8073d13a3f894",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 78,
"avg_line_length": 39.774193548387096,
"alnum_prop": 0.5988104893214382,
"repo_name": "tkerola/chainer",
"id": "e15dade78331c0d33167558aeea403fe8ee6948f",
"size": "3699... |
"""Provides functionality to notify people."""
from __future__ import annotations
import asyncio
import voluptuous as vol
import homeassistant.components.persistent_notification as pn
from homeassistant.const import CONF_NAME, CONF_PLATFORM
from homeassistant.core import HomeAssistant, ServiceCall
import homeassista... | {
"content_hash": "983c41574b4ae5911c4e42a7ea214aed",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 85,
"avg_line_length": 31.475,
"alnum_prop": 0.7088959491660047,
"repo_name": "mezz64/home-assistant",
"id": "52864dd001d65e4cac57bc3d7818ae24b069adb0",
"size": "2518",
"... |
"""
pygments.console
~~~~~~~~~~~~~~~~
Format colored console output.
:copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
esc = "\x1b["
codes = {}
codes[""] = ""
codes["reset"] = esc + "39;49;00m"
codes["bold"] = esc + "01m"
codes["faint... | {
"content_hash": "3056865967fd5c403747ede284abcec8",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 88,
"avg_line_length": 24.242857142857144,
"alnum_prop": 0.5427224513847967,
"repo_name": "tmm1/pygments.rb",
"id": "8dd08abebce13dd43c7e5340e0f91d8c6cf400b4",
"size": "169... |
from os.path import abspath, dirname, basename, join
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ROOT_PATH = abspath(dirname(__file__))
PROJECT_NAME = basename(ROOT_PATH)
ADMINS = (
# ('Your Name', '[email protected]'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3... | {
"content_hash": "04e556b91d0a9e53357f10d998402f27",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 70,
"avg_line_length": 26.02127659574468,
"alnum_prop": 0.7072771872444807,
"repo_name": "thesealion/django-social-auth",
"id": "93267dfa4aef73ffcdece7f12f34ba7289eaf364",
... |
"""Test harness for diff_match_patch.py
Copyright 2006 Google Inc.
http://code.google.com/p/google-diff-match-patch/
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/license... | {
"content_hash": "2260ad7fa25e7d9c830d3f71340cca76",
"timestamp": "",
"source": "github",
"line_count": 871,
"max_line_length": 408,
"avg_line_length": 47.956371986222734,
"alnum_prop": 0.6454393105099354,
"repo_name": "kkujawinski/sublime-text-3-live-demo",
"id": "bece5ef3c4688ed5727b065b7edfd1736c4... |
import os
import re
import sys
import platform
import subprocess
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
from distutils.version import LooseVersion
class CMakeExtension(Extension):
def __init__(self, name, sourcedir=''):
Extension.__init__(self, name, so... | {
"content_hash": "423e2afd11fecd8e21694b8519336d40",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 98,
"avg_line_length": 36.666666666666664,
"alnum_prop": 0.5829545454545455,
"repo_name": "papabricole/Pololu_Maestro",
"id": "28e21a5a71322ae235535bc88cae47be5bd24c0a",
"s... |
from __future__ import division, print_function, unicode_literals, absolute_import
"""
This module implements classes for processing Lammps output files:
1. log file: contains the thermodynamic data with the format set by the
'thermo_style' command
2. trajectory file(dump file): the file generated by... | {
"content_hash": "638a6da2c6a581ff7144e8a01f890f4b",
"timestamp": "",
"source": "github",
"line_count": 556,
"max_line_length": 93,
"avg_line_length": 39.419064748201436,
"alnum_prop": 0.5308208240178857,
"repo_name": "nisse3000/pymatgen",
"id": "b3e073e502a6034b5110d50bc9e5ae0f1cea6b19",
"size": "... |
import wx
from wx.lib.wordwrap import wordwrap
import wx.grid as gridlib
import os
import sys
__program__ = sys.modules['__main__'].__program__
__version__ = sys.modules['__main__'].__version__
import re
PTN_TITLE = re.compile('(?P<author>[^\[]+)[\]-](?P<title>.+)')
#-------------------------------------... | {
"content_hash": "180408b6a880c87ab931d2583bc60966",
"timestamp": "",
"source": "github",
"line_count": 680,
"max_line_length": 153,
"avg_line_length": 40.84264705882353,
"alnum_prop": 0.5096316566449429,
"repo_name": "hojel/epubia",
"id": "f0eb25cff01dba7f646206ad6edc868a92cf7fa8",
"size": "28167"... |
"""
A collection of various helper tools for PyChamberFlux
(c) 2016-2017 Wu Sun <[email protected]>
"""
import math
def convert_unit_names(output_unit_list):
"""
A helper function to convert units to text representation.
Parameters
----------
output_unit_list : list of float
A list of the... | {
"content_hash": "ad28fe432703217063d60ee8a38190b3",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 78,
"avg_line_length": 34.1551724137931,
"alnum_prop": 0.5126198889449772,
"repo_name": "geoalchimista/chflux",
"id": "5633ea56ea75f09ff87318859dd3f629d7a333ff",
"size": "... |
from __future__ import print_function
import time, sys, signal, atexit
from upm import pyupm_nmea_gps as sensorObj
def main():
# Instantiate a NMEA_GPS UBLOX based i2c sensor on i2c bus 0 at
# address 0x42
sensor = sensorObj.NMEAGPS(0, 0x42)
## Exit handlers ##
# This function stops python from pr... | {
"content_hash": "b54d2d046b72fcaab99eb2e0960291b3",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 82,
"avg_line_length": 28,
"alnum_prop": 0.6450892857142857,
"repo_name": "whbruce/upm",
"id": "c4615f2fc8bd549ebe8f1a911eb70096a7ea51cc",
"size": "2055",
"binary": false... |
import hashlib
from messente.api.sms.api import verification_widget
def test_calculate_signature():
user = "test"
password = "test12"
api = verification_widget.VerificationWidgetAPI(
username=user,
password=password,
)
data = dict(
user=user,
callback_url="http://te... | {
"content_hash": "215d14ebec906b3c307167153bb4349d",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 68,
"avg_line_length": 28.743589743589745,
"alnum_prop": 0.6440677966101694,
"repo_name": "messente/messente-python",
"id": "ee45c7fdde7e9bef32bf56b70c2f3049ebe757c8",
"siz... |
import numpy as np
from bokeh.io import curdoc, show
from bokeh.models import CircleDot, ColumnDataSource, Grid, LinearAxis, Plot
N = 9
x = np.linspace(-2, 2, N)
y = x**2
sizes = np.linspace(10, 20, N)
source = ColumnDataSource(dict(x=x, y=y, sizes=sizes))
plot = Plot(
title=None, plot_width=300, plot_height=30... | {
"content_hash": "b8f9bf348c0f612fa112d50d7231c9ce",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 84,
"avg_line_length": 23.774193548387096,
"alnum_prop": 0.7082767978290366,
"repo_name": "ericmjl/bokeh",
"id": "0ed8295bda4095ae571001d13626afbf3f30087f",
"size": "737",
... |
def saturate_color(color):
red, green, blue = color
red = min(red, 255)
green = min(green, 255)
blue = min(blue, 255)
return red, green, blue
| {
"content_hash": "8b00e5b7ef30a1884bd23249bba6b2ea",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 29,
"avg_line_length": 28.166666666666668,
"alnum_prop": 0.5798816568047337,
"repo_name": "kevin-teddy/Beginning-Game-Development-with-Python-and-Pygame",
"id": "e92e4d0f2faea... |
from nuage_horizon.dashboards.admin.networks.subnets import views # noqa
| {
"content_hash": "5fc5b6990d69fca87f1ddb058b507193",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 73,
"avg_line_length": 74,
"alnum_prop": 0.8243243243243243,
"repo_name": "nuagenetworks/nuage-openstack-horizon",
"id": "36e45ecdbcae385b34055e317225e0c2af7d80aa",
"size": ... |
import requests
respuesta = requests.get("http://api.open-notify.org/astros.json")
data = respuesta.json()
print(data)
cantidad_astronautas = data["number"]
if cantidad_astronautas > 4:
print("Party en el espacio")
else:
print("Invita a la gente")
cant_astro_iss = 0
for person in data['people']:
if perso... | {
"content_hash": "dd2692f3ec37f83084ddf6a553062c48",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 88,
"avg_line_length": 23.09090909090909,
"alnum_prop": 0.6850393700787402,
"repo_name": "FreddyGJ/Portafolio-de-prog-3",
"id": "2b5104dd0d1d8e6faa81d033a079d88bad1f1907",
... |
"""Python API Bindings for the Monty server monitoring Go library"""
__version__ = "0.0.01"
__author__ = [
"Mek <[email protected]>"
]
__license__ = "Apache 2"
__contributors__ = "see AUTHORS"
from montypy.monty import Monty | {
"content_hash": "c8c4c25ff8063b70326a373af447788a",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 68,
"avg_line_length": 22.9,
"alnum_prop": 0.6550218340611353,
"repo_name": "hackerlist/monty-python",
"id": "51a7f100628c6efd3b3854b34389cb3b36f21eac",
"size": "252",
"b... |
import logging
from flask import Flask, jsonify, redirect
from flask_swagger import swagger
import os
import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration
from datalake_api.v0 import v0
from datalake_api import settings
LOGGER = logging.getLogger(__name__)
app = Flask(__name__)
app.config.f... | {
"content_hash": "830800a1784a5f32c9f24085441920a9",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 71,
"avg_line_length": 22.30909090909091,
"alnum_prop": 0.6951915240423798,
"repo_name": "planetlabs/datalake",
"id": "1178095e55a2f34a3b7bdd5fcef1f67e3e4c759f",
"size": "1... |
import copy
import os
import ConfigParser
import ooinstall.cli_installer as cli
from test.fixture import OOCliFixture, SAMPLE_CONFIG, build_input, read_yaml
from mock import patch
MOCK_FACTS = {
'10.0.0.1': {
'common': {
'ip': '10.0.0.1',
'public_ip': '10.0.0.1',
'hos... | {
"content_hash": "239f911a07d8656d6ca1cace1b140f2b",
"timestamp": "",
"source": "github",
"line_count": 934,
"max_line_length": 98,
"avg_line_length": 40.33832976445396,
"alnum_prop": 0.5926584563117103,
"repo_name": "LutzLange/openshift-ansible",
"id": "ea380d5658cd47f909f033fa57fd8f91765f9010",
"... |
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configurat... | {
"content_hash": "8038987463dd01b43f708083ae152500",
"timestamp": "",
"source": "github",
"line_count": 250,
"max_line_length": 80,
"avg_line_length": 32.496,
"alnum_prop": 0.7088872476612507,
"repo_name": "codergma/CodeIgniter",
"id": "c054490c31b2179890d7b043aec217e8df9768d8",
"size": "8546",
"... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = """
---
module: aws_direct_connect_link_aggregation_group
short_description: Manage Direct Connect LAG bundles.
description:
- Create, delete, or modify a Direct... | {
"content_hash": "d9659660af847ed1a57d6025360fdfbf",
"timestamp": "",
"source": "github",
"line_count": 452,
"max_line_length": 150,
"avg_line_length": 39.79203539823009,
"alnum_prop": 0.6150895140664961,
"repo_name": "thaim/ansible",
"id": "8d1d449ee3fbbc7954dcdae2baf3ff02a6104365",
"size": "18135... |
from django.contrib import admin
from .models import (UserProfile, Service, Shift,
ServiceStatusSnapshot, StatusCheck, StatusCheckResult,
Instance, AlertAcknowledgement)
from .alert import AlertPluginUserData, AlertPlugin
admin.site.register(UserProfile)
admin.site.register(Shift)
admin.site.register(Service)... | {
"content_hash": "1b5bacc85f8eb419447463e3d249f6ef",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 58,
"avg_line_length": 36.3125,
"alnum_prop": 0.8416523235800344,
"repo_name": "xinity/cabot",
"id": "63185903893783129600ff48a19d2af0fd0fa472",
"size": "581",
"binary": ... |
def create_screen(rows, columns):
'''
Creates a screen of rows x columns pixels
'''
grid = []
for row in range(rows):
grid.append([0] * columns)
return grid
# From lecture
def print_screen(screen):
''' Prints the screen to the console.
When a pixel == 0, then a '*' is displ... | {
"content_hash": "c876c7e2b4defc5911b0212f94c7d357",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 73,
"avg_line_length": 28.709302325581394,
"alnum_prop": 0.6306196840826246,
"repo_name": "ucsb-cs8-s18/ucsb-cs8-s18.github.io",
"id": "ff9a8b5d9a38de015df0b29c75fee63dfd4d47... |
"""
Forms for test execution.
"""
import json
from django.core.exceptions import ValidationError, ObjectDoesNotExist
import floppyforms.__future__ as forms
from ... import model
class EnvironmentSelectionForm(forms.Form):
"""Form for selecting an environment."""
def __init__(self, *args, **kwargs):
... | {
"content_hash": "3ae1f2a10af7b0749dafa2a2bb6cbfdb",
"timestamp": "",
"source": "github",
"line_count": 154,
"max_line_length": 80,
"avg_line_length": 36.05844155844156,
"alnum_prop": 0.6000360165676211,
"repo_name": "shinglyu/moztrap",
"id": "a3f48bb280418999419e8c2d46e59fd6e7c7d9a2",
"size": "555... |
from framework.core.registry import plugin_registry
from framework.core.util import extract_artifact_id, listify_duplicate_keys
from framework.types import Artifact, Parameterized, Primitive
from framework.types.parameterized import List, ChooseMany
import framework.db as db
import datetime
class Executor(object):
... | {
"content_hash": "cc8fa5c83a71b647651e5f4f315804bb",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 124,
"avg_line_length": 41.11764705882353,
"alnum_prop": 0.631378159275155,
"repo_name": "biocore/metoo",
"id": "4cc1b0899c0a2212d8317ef79216609092d25619",
"size": "2097",
... |
"""Huawei LTE constants."""
DOMAIN = "huawei_lte"
CONF_TRACK_WIRED_CLIENTS = "track_wired_clients"
DEFAULT_DEVICE_NAME = "LTE"
DEFAULT_NOTIFY_SERVICE_NAME = DOMAIN
DEFAULT_TRACK_WIRED_CLIENTS = True
UPDATE_SIGNAL = f"{DOMAIN}_update"
CONNECTION_TIMEOUT = 10
NOTIFY_SUPPRESS_TIMEOUT = 30
SERVICE_CLEAR_TRAFFIC_STATI... | {
"content_hash": "af5676c46ae768b33e0b4d8695c80dd6",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 69,
"avg_line_length": 26.83783783783784,
"alnum_prop": 0.7376636455186304,
"repo_name": "kennedyshead/home-assistant",
"id": "7e34b3dbd160dd98068b62488a5d957c3b139b8b",
"s... |
queries = {
"dbtype": "mysql",
"column": {
"head": "select {column} from {schema}.{table} limit {n};",
"all": "select {column} from {schema}.{table};",
"unique": "select distinct {column} from {schema}.{table};",
"sample": "select {column} from {schema}.{table} order by rand() li... | {
"content_hash": "94554d808d8d05f4deb3fdd0a977cd4b",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 93,
"avg_line_length": 35.26,
"alnum_prop": 0.46199659671015314,
"repo_name": "yhat/db.py",
"id": "05f3c9b63752a0b71a6b00fcb13905af48f2ff23",
"size": "3526",
"binary": f... |
"""Demo fan platform that has a fake fan."""
from __future__ import annotations
from homeassistant.components.fan import (
SUPPORT_DIRECTION,
SUPPORT_OSCILLATE,
SUPPORT_PRESET_MODE,
SUPPORT_SET_SPEED,
FanEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import H... | {
"content_hash": "ebb96847dc8013c148a3f2e4ad69b131",
"timestamp": "",
"source": "github",
"line_count": 296,
"max_line_length": 84,
"avg_line_length": 29.45608108108108,
"alnum_prop": 0.5543066865466223,
"repo_name": "GenericStudent/home-assistant",
"id": "8fcc6a810ed19768b1dcd906bc41ac8dacf4f73d",
... |
def fetch_environment(file_id, files=None, module_names=None):
"""Return module environment dictionary from *file_id*.
*file_id* represent the identifier of the file.
*files* is an optional list of the other file names stored in the same
directory as the one analyzed.
*module_names* is an optiona... | {
"content_hash": "edb36ab2c50cdddc16da18ace560d6a5",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 74,
"avg_line_length": 28.26086956521739,
"alnum_prop": 0.5712820512820512,
"repo_name": "buddly27/champollion",
"id": "1710383d8869cfdae1165404200a4ef63f775eeb",
"size": "... |
"""
* *******************************************************
* Copyright VMware, Inc. 2016-2018. All Rights Reserved.
* SPDX-License-Identifier: MIT
* *******************************************************
*
* DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, WHETHER ... | {
"content_hash": "4440c31bfc0fe4a706297359de8bb880",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 94,
"avg_line_length": 46.90243902439025,
"alnum_prop": 0.7113884555382215,
"repo_name": "pgbidkar/vsphere-automation-sdk-python",
"id": "e5e48b99cd58efbd8123651f78659e75a2f1... |
import uuid
import testtools
from heat.common import short_id
class ShortIdTest(testtools.TestCase):
def test_byte_string_8(self):
self.assertEqual('\xab', short_id._to_byte_string(0xab, 8))
self.assertEqual('\x05', short_id._to_byte_string(0x05, 8))
def test_byte_string_16(self):
... | {
"content_hash": "20acb615f31a34389c320f07244ad7eb",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 74,
"avg_line_length": 37.03389830508475,
"alnum_prop": 0.6530892448512586,
"repo_name": "redhat-openstack/heat",
"id": "0cb74704a4fa3346853357c23e47c703e8769eeb",
"size": ... |
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from JeuxView import JeuxView
from UsersView import UsersView
from Session import Session
from ConnexionWidget import ConnexionWidget
from Utilisateur import Utilisateur
from functools import partial
from EmpruntsView import EmpruntsView
from ProfileView import Profi... | {
"content_hash": "ac21f2dad07af55a7616588109acdbd4",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 82,
"avg_line_length": 29.723958333333332,
"alnum_prop": 0.6379884352549501,
"repo_name": "Darkyler/Piscine",
"id": "0aec1ea254306ba14499d19bcb000afbdc553f3d",
"size": "57... |
"""Provide tests for mysensors notify platform."""
from __future__ import annotations
from collections.abc import Callable
from unittest.mock import MagicMock, call
from mysensors.sensor import Sensor
from homeassistant.components.notify import DOMAIN as NOTIFY_DOMAIN
from homeassistant.core import HomeAssistant
fr... | {
"content_hash": "7a08d1dc6b2081f9eaa1fc23e7264067",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 87,
"avg_line_length": 28.894736842105264,
"alnum_prop": 0.6378870673952641,
"repo_name": "toddeye/home-assistant",
"id": "e96b463cc783a48426e12c96fc2b0b09ab104b65",
"size"... |
import numpy as np
import theano
import theano.d3viz as d3v
from theano import tensor
from blocks import roles
from blocks.roles import OUTPUT
from blocks.model import Model
from blocks.extensions import saveload
from blocks.filter import VariableFilter
from utils import MainLoop
from config import config
from model im... | {
"content_hash": "03c3f7a2f8f1fb3bd1e9fcc0da1b7b6e",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 162,
"avg_line_length": 43.12820512820513,
"alnum_prop": 0.6329369797859691,
"repo_name": "rrahmati/roboinstruct-2",
"id": "538e697d4593def0f53036dd515e484252dfb777",
"siz... |
import errno
import os
import re
import subprocess
import sys
def get_keywords():
# these strings will be replaced by git during git-archive.
# setup.py/versioneer.py will grep for the variable names, so they must
# each be defined on a line of their own. _version.py will just call
# get_keywords().
... | {
"content_hash": "fab59faafa1ce043526b0cd5d645aa42",
"timestamp": "",
"source": "github",
"line_count": 450,
"max_line_length": 79,
"avg_line_length": 34.01777777777778,
"alnum_prop": 0.5717925267833812,
"repo_name": "pyannote/pyannote-metrics",
"id": "b2d4fa9890b77ca5af887d84e08ab2ce973e818f",
"si... |
import sys
import signal
import subprocess
import logging
from time import sleep
from threading import Thread
from datetime import datetime
from termcolor import colored, cprint
from errors import DeviceError, KernelError
class Filter():
LAN_INTERFACE = "eth0"
WAN_INTERFACE = "eth1"
DEF_HTB_RATE = "100... | {
"content_hash": "53a4db57f8d85089bdcdf4b24288fe73",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 79,
"avg_line_length": 39.11797752808989,
"alnum_prop": 0.5461726267413471,
"repo_name": "ABalanuta/TrafficShapingRouter",
"id": "aed4200862abad591756fab32d4181aab09df829",
... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0005_addparentchild'),
]
operations = [
migrations.AlterField(
model_name='category',
name='name',
field=models.CharField(max_length=100, unique=... | {
"content_hash": "7a1eea90a0b2a56745f229efa71f073e",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 64,
"avg_line_length": 21.5,
"alnum_prop": 0.5755813953488372,
"repo_name": "bmihelac/django-import-export",
"id": "dc9c57681ee106e647d09d0cbce46a1d6f7b1bf0",
"size": "344"... |
from nameko.rpc import rpc
class GreetingService:
name = "greeting_service"
@rpc
def hello(self, name):
return "Hello, {}!".format(name)
| {
"content_hash": "0b3321f9f05f2c18a3ceea5b92981aac",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 40,
"avg_line_length": 17.77777777777778,
"alnum_prop": 0.63125,
"repo_name": "adamcharnock/lightbus",
"id": "76bf41f23aaf5578582a41b24556677cb5a60a09",
"size": "160",
"bi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.