text stringlengths 4 1.02M | meta dict |
|---|---|
#!/usr/bin/python
#
# Generate build parameter files based on build information.
# A C header is generated for C code, and a JSON file for
# build scripts etc which need to know the build config.
#
import os
import sys
import json
import optparse
import dukutil
if __name__ == '__main__':
parser = optparse.Option... | {
"content_hash": "8c00b62ce648cbcbec224d0e9d3bc7de",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 77,
"avg_line_length": 28.846153846153847,
"alnum_prop": 0.6702222222222223,
"repo_name": "JoshEngebretson/duktape",
"id": "db448833b81d4fc90250b14a699c17c1183b4aa5",
"size... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
from collections import OrderedDict
from .exceptions import (DatasetNotFound, InitException, ModelNotFound, WrongParameter)
from sklearn.externals import jobli... | {
"content_hash": "ea4f965935658bc0306b74f06b2aa360",
"timestamp": "",
"source": "github",
"line_count": 198,
"max_line_length": 101,
"avg_line_length": 33.08585858585859,
"alnum_prop": 0.562051595176309,
"repo_name": "kcompher/FreeDiscovUI",
"id": "92aa91ed8a0c8c7a20d909443ba367892ce2f44a",
"size":... |
import socket
import sys
import time
from ploxys import main
host = input("Type the master's ip: ")
porta = 600
ok = True #the ok is again, for avoid excessive printing
while True:
time.sleep(0.1) #basic time waiting so it wont flood the connection
while True:
resultado = 0 #reset data
final = ... | {
"content_hash": "6ef14db05aee36b7d8aa4790b832cc2e",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 120,
"avg_line_length": 38.885714285714286,
"alnum_prop": 0.5470242468772961,
"repo_name": "victor-cortez/Heimdall",
"id": "45d2aa60ffc52d9e1c83e8868ee310963a5230aa",
"size... |
import _plotly_utils.basevalidators
class OffsetValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="offset", parent_name="funnel", **kwargs):
super(OffsetValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
ar... | {
"content_hash": "ca1547924aa1bd34bf9ea89055f97529",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 77,
"avg_line_length": 37.083333333333336,
"alnum_prop": 0.6089887640449438,
"repo_name": "plotly/plotly.py",
"id": "32304632b4b60526f56f262c30b2d406973f498c",
"size": "445... |
import datetime
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = 'django-controlcenter'
copyright = ('{}, Django-controlcenter developers and contributors'
.format(datetime.date.today().year))
version = '0.2.9'
release = '0.2.9'
exclude_patterns = ['_bu... | {
"content_hash": "49022ed777c0f4bb8b7e1b8528d6d3a0",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 78,
"avg_line_length": 32.86666666666667,
"alnum_prop": 0.7058823529411765,
"repo_name": "byashimov/django-controlcenter",
"id": "4c242f33850e825e19c719547e4a57695ffc9b74",
... |
import os
import urllib2, json
from urlparse import urlparse
def ParseURL(agsURL):
ags = []
print agsURL
ags = urlparse(agsURL)
return ags
def GetFolders(agsURL):
f = urllib2.urlopen(agsURL)
j = json.loads(f.read())
for item in j["folders"]:
print item
def MapServic... | {
"content_hash": "149b628f07c15d7b5feb71243731bf4d",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 31,
"avg_line_length": 21.454545454545453,
"alnum_prop": 0.6101694915254238,
"repo_name": "ACueva/Avi-Playground",
"id": "4913c3ea285b469820f3898e3feff4274634fe9e",
"size":... |
"""
Landing page controller var miscellaneous pages.
"""
from flask import render_template
def create_landing_page_routes(app):
@app.route('/')
def root():
return 'Hello from BeamIt!!'
@app.route('/android/download')
def android_download():
return render_template('androidAppDownload.... | {
"content_hash": "7e8c48e36ab21d0957e41f0c091279d9",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 57,
"avg_line_length": 21.8,
"alnum_prop": 0.6697247706422018,
"repo_name": "ksweta/BeamIt-Server",
"id": "626b91cc39a74d60acc87ea13e826385a9e5e77d",
"size": "327",
"bina... |
from .dr7 import DR7
from .dr8 import DR8
from .dr9 import DR9
from .dr10 import DR10
from .common import band_name, band_index, band_names, cas_flags
from .common import photo_flags1_info, photo_flags2_info, photo_flags1_map, photo_flags2_map
from .common import munu_to_radec_deg, AsTransWrapper, AsTrans
from .field... | {
"content_hash": "20275f241e9cfcb47813febc81c61b2c",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 92,
"avg_line_length": 33.1,
"alnum_prop": 0.7764350453172205,
"repo_name": "olebole/astrometry.net",
"id": "2cc4f27eaf2b7583c39d5a01afce2ff8bafc66b3",
"size": "440",
"bi... |
from warnings import warn
from avocado.core import loader
class BaseOperatorMetaclass(type):
def __new__(cls, name, bases, attrs):
new_cls = type.__new__(cls, name, bases, attrs)
new_cls.uid = ('-' if new_cls.negated else '') + new_cls.lookup
return new_cls
class BaseOperator(object):
... | {
"content_hash": "6e890e48d4cf8956906cdb1e102a539e",
"timestamp": "",
"source": "github",
"line_count": 290,
"max_line_length": 77,
"avg_line_length": 25.110344827586207,
"alnum_prop": 0.6606701455644054,
"repo_name": "murphyke/avocado",
"id": "4b38e5bfa61ccab2e86418e0f22379fd77dca983",
"size": "72... |
from neutron_lib.api import converters
from neutron_lib import constants
from neutron_lib.db import constants as db_const
NAME = 'Neutron L3 Subnet Pool'
ALIAS = 'subnetpool'
DESCRIPTION = "Layer 3 subnet pool abstraction"
UPDATED_TIMESTAMP = "2012-01-01T10:00:00-00:00"
RESOURCE_NAME = 'subnetpool'
COLLECTION_NAME ... | {
"content_hash": "8cdcb9fbd6eff8941523432bf6c964c2",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 73,
"avg_line_length": 40.87155963302752,
"alnum_prop": 0.43389450056116724,
"repo_name": "openstack/neutron-lib",
"id": "136f4423294341bd0634a3c436c1212254fde820",
"size"... |
import imp
import os
from contextlib import redirect_stderr, redirect_stdout
from optparse import OptionParser
import lldb
def __lldb_init_module(debugger, dict):
filePath = os.path.realpath(__file__)
lldbHelperDir = os.path.dirname(filePath)
commandsDirectory = os.path.join(lldbHelperDir, "commands")
... | {
"content_hash": "6117e7ef4f2a5edad992c9c3e454cadf",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 85,
"avg_line_length": 32.50246305418719,
"alnum_prop": 0.5621400424371021,
"repo_name": "facebook/chisel",
"id": "585527b3f03ea5e425b97d7fe7f1fec467b7c42e",
"size": "6815... |
from __future__ import division, absolute_import, print_function
import os
import sys
import argparse
import redmapper
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Compute random weights')
parser.add_argument('-c', '--configfile', action='store', type=str, required=True,
... | {
"content_hash": "e5547e9382e2afd443b2d942b4791ccd",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 86,
"avg_line_length": 39.96153846153846,
"alnum_prop": 0.6458132820019249,
"repo_name": "erykoff/redmapper",
"id": "b0e70b739f48b0ae2956751f14449a87bc139e8b",
"size": "106... |
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('historias', '0016_auto_20150429_2315'),
]
operations = [
migrations.AlterField(
model_name='historias',
name... | {
"content_hash": "3cc94241ecf23f5c35e36dc3b29b52b8",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 159,
"avg_line_length": 32.69230769230769,
"alnum_prop": 0.6105882352941177,
"repo_name": "btenaglia/hpc-historias-clinicas",
"id": "75a8adbd51a0a6a5922e61154522081fd7812af9"... |
"""Your job is to write a speech for your CEO. You have a list of meaningful
phrases that he is fond of such as "knowledge optimization initiatives" and
your task is to weave them in to a speech.
You also have the opening words "Our clear strategic direction is to invoke..."
and some useful joining phrases such as "wh... | {
"content_hash": "8b1c4558d337d1d03e0a8e23c5ccf1f1",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 91,
"avg_line_length": 43.31578947368421,
"alnum_prop": 0.5826245443499393,
"repo_name": "manahl/PythonTrainingExercises",
"id": "99dd4c8e155520dc44438fa121b6d252ee6717ee",
... |
from __future__ import absolute_import, unicode_literals
import math
import re
import django
from django import forms
from django.core.exceptions import ImproperlyConfigured
from django.db.models.fields import FieldDoesNotExist
from django.forms.models import fields_for_model
from django.template.loader import render... | {
"content_hash": "4278918696d9fc370e13f31a7c66cef2",
"timestamp": "",
"source": "github",
"line_count": 865,
"max_line_length": 117,
"avg_line_length": 33.57225433526011,
"alnum_prop": 0.6256198347107438,
"repo_name": "Toshakins/wagtail",
"id": "68e02ce6fe1fcf5922fa53d495e840f6de736939",
"size": "2... |
"""
.. moduleauthor:: Gabriel Martin Becedillas Ruiz <[email protected]>
"""
from pyalgotrade import dataseries
class BarDataSeries(dataseries.SequenceDataSeries):
"""A DataSeries of :class:`pyalgotrade.bar.Bar` instances.
:param maxLen: The maximum number of values to hold.
Once a bounde... | {
"content_hash": "f5ac447d8325f3dcd6c9f0b3ebcbd3cc",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 133,
"avg_line_length": 41.67123287671233,
"alnum_prop": 0.690664036817883,
"repo_name": "cgqyh/pyalgotrade-mod",
"id": "bdc2c9ef1b689a9a9d7b9057b196c1ff12e3ad7d",
"size": ... |
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpR... | {
"content_hash": "db43ba774631bc776c7ac84a15928d1d",
"timestamp": "",
"source": "github",
"line_count": 569,
"max_line_length": 179,
"avg_line_length": 49.86467486818981,
"alnum_prop": 0.6372960208649068,
"repo_name": "Azure/azure-sdk-for-python",
"id": "2176b2fa1cb809bdff63030c38c55cfd589c2d30",
"... |
import csv
from BeautifulSoup import BeautifulSoup
from constants import PATH, TEAMS
def scraping(year, category, division, team):
players = []
path = PATH % (year, category, division, team)
f = open(path)
html = f.read()
soup = BeautifulSoup(html)
rows = soup.findAll('tr', {'class': 'ststats'... | {
"content_hash": "146c93e443115ce2a2d2fac005cbbebe",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 72,
"avg_line_length": 29.22222222222222,
"alnum_prop": 0.5736013036393265,
"repo_name": "who-you-me/baseball",
"id": "c5f1323855964024204a1102124464bbe55c45d1",
"size": "1... |
"""Version."""
# (major, minor, micro, release type, pre-release build, post-release build)
version_info = (4, 5, 1, 'final', 0, 0)
def _version():
"""
Get the version (PEP 440).
Version structure
(major, minor, micro, release type, pre-release build, post-release build)
Release names are na... | {
"content_hash": "d07bb5bbdcc48b9c9b8b9145ac9c5422",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 102,
"avg_line_length": 36.666666666666664,
"alnum_prop": 0.6468531468531469,
"repo_name": "nimzco/Environment",
"id": "e2a9fe2cc6059358f717fc1289ae7adbfe9e5963",
"size": "... |
from azure.identity import DefaultAzureCredential
from azure.mgmt.logic import LogicManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-logic
# USAGE
python delete_a_workflow.py
Before run the sample, please set the values of the client ID, tenant ID and client secre... | {
"content_hash": "2ecc94aa9c69d11216e7c070cbda24ba",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 123,
"avg_line_length": 32.666666666666664,
"alnum_prop": 0.7282003710575139,
"repo_name": "Azure/azure-sdk-for-python",
"id": "d33fd211fc5a2f076a9b804f14aff9b669490d11",
"... |
from CIM15.IEC61970.Core.IdentifiedObject import IdentifiedObject
class ErpInventoryCount(IdentifiedObject):
"""This is related to Inventory physical counts organized by AssetModel. Note that a count of a type of asset can be accomplished by the association inherited by AssetModel (from Document) to Asset. It enab... | {
"content_hash": "8dd2b888078befe72af8f39cfceea809",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 733,
"avg_line_length": 41.265625,
"alnum_prop": 0.6815600151457781,
"repo_name": "rwl/PyCIM",
"id": "47da5a765831bf01dd19cdf89b45993246671f06",
"size": "3741",
"binary":... |
from supybot.test import *
import copy
import pickle
import supybot.conf as conf
import supybot.irclib as irclib
import supybot.ircmsgs as ircmsgs
# The test framework used to provide these, but not it doesn't. We'll add
# messages to as we find bugs (if indeed we find bugs).
msgs = []
rawmsgs = []
class IrcMsgQue... | {
"content_hash": "a2031bf7e5b042f1c96786e44011e6c0",
"timestamp": "",
"source": "github",
"line_count": 508,
"max_line_length": 262,
"avg_line_length": 36.98031496062992,
"alnum_prop": 0.5858085808580858,
"repo_name": "Ban3/Limnoria",
"id": "ca78d6285f0fa88959d349d8c1cf85fdfacc58f7",
"size": "20374... |
import time
import pymongo
from mongotools.pubsub import Channel
cli = pymongo.MongoClient()
chan = Channel(cli.test, 'mychannel')
chan.ensure_channel()
def printer(chan, msg):
print chan, msg
chan.sub('foo', printer)
chan.sub('bar', printer)
while True:
chan.handle_ready(await=True)
time.sleep(0.1... | {
"content_hash": "898e6935dcf19af260caee7b4ddf2d7b",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 37,
"avg_line_length": 17.88888888888889,
"alnum_prop": 0.7080745341614907,
"repo_name": "rick446/MongoTools",
"id": "1f014564175a6c09df52267e9ae2ba4cd1e1cc36",
"size": "33... |
from .resource_update import ResourceUpdate
class DiskUpdate(ResourceUpdate):
"""Disk update resource.
:param tags: Resource tags
:type tags: dict[str, str]
:param sku:
:type sku: ~azure.mgmt.compute.v2018_04_01.models.DiskSku
:param os_type: the Operating System type. Possible values include... | {
"content_hash": "ac0a0ea32d804ccd0782ae1b7e13dc95",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 102,
"avg_line_length": 43.60526315789474,
"alnum_prop": 0.660229330114665,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "7364769892bfd2ea7d6d763610b54b5a28f99ee1",
"... |
from model.group import Group # Модель группы контактов адресной книги
import pytest # Исполнение тестов
# Использование тестовых данных из py-файла
def test_add_group_data(app, db, check_ui, data_groups):
... | {
"content_hash": "7603d923401ddad06392873eb4308d30",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 153,
"avg_line_length": 70.32352941176471,
"alnum_prop": 0.6035131744040151,
"repo_name": "NovikovMA/python_training",
"id": "d442085f67ed142009260218adf0340ce86680f0",
"si... |
import json
from DataBaseService import DataBaseService
class APIManager:
def __init__(self):
self.db = DataBaseService()
def registerNewClient(self, info):
try:
newUserData = json.loads(info)
username = newUserData['username']
firstName = newUserData['firstn... | {
"content_hash": "3f9e49ff22689e20f07439a8d09be7c2",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 91,
"avg_line_length": 38.21052631578947,
"alnum_prop": 0.5661157024793388,
"repo_name": "lyubomir1993/AlohaServer",
"id": "2b7170de85d09c3428483178dc7f8f3a88d311e1",
"size... |
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_installed_packages(host):
assert host.package('logstash').is_installed
assert host.package('logstash').version == '1:6.6.0-1'
... | {
"content_hash": "73592468a8133a1f45b71d5ccfdd2912",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 63,
"avg_line_length": 26.096774193548388,
"alnum_prop": 0.6736711990111248,
"repo_name": "sansible/logstash",
"id": "5b921ccceb5620efda89b674d0c086b1015c6dfb",
"size": "80... |
from django.db import models, transaction, IntegrityError
from django.utils.timezone import now
from . import app_settings
from . import utils
class PasswordChangeManager(models.Manager):
def get_or_create_for_user(self, user):
return self.get_or_create(user=user)
def is_required_for_user(self, user... | {
"content_hash": "8e9f61c1acb0be37999e9aed9e3a7630",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 73,
"avg_line_length": 33.84,
"alnum_prop": 0.5862884160756501,
"repo_name": "ulule/django-safety",
"id": "6e6f0d2f60e44ab1df98b6d4692763a687369516",
"size": "1716",
"bin... |
"""Replaces the template markup (PHP, Jinja, Mako) from an HTML file.
It replaces the markup so the lines and positions of actual HTML content is
preserved.
It uses Regexes to do the replacements so it is prone to errors in some corner
cases.
"""
from __future__ import absolute_import
from __future__ import division... | {
"content_hash": "8aa4b90b681836194f99b63a76ff64a4",
"timestamp": "",
"source": "github",
"line_count": 270,
"max_line_length": 80,
"avg_line_length": 36.67407407407408,
"alnum_prop": 0.6047263179155726,
"repo_name": "deezer/template-remover",
"id": "a8a60cdd15dc4f5318b50f54105a89a7f19a5c28",
"size... |
from pudzu.charts import *
df = pd.read_csv("datasets/flagsspain.csv")
array = [[dict(r) for _,r in rows] for rows in generate_batches(df.iterrows(), 5)]
data = pd.DataFrame(array)
FONT = calibri
fg, bg="black", "#EEEEEE"
default_img = "https://s-media-cache-ak0.pinimg.com/736x/0d/36/e7/0d36e7a476b06333d9fe9960572b66... | {
"content_hash": "254311202f03a33f1aacb21b1b16779e",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 123,
"avg_line_length": 47.03448275862069,
"alnum_prop": 0.6686217008797654,
"repo_name": "Udzu/pudzu",
"id": "c1da9d5c088780be9d8e2c2519790c93714b2e3c",
"size": "1364",
... |
import argparse
import json
import logging
import os
import re
import shutil
import subprocess
import sys
import tempfile
import time
from hooks import install
from py_utils import binary_manager
from py_utils import dependency_util
from py_utils import xvfb
# Path to dependency manager config containing chrome bin... | {
"content_hash": "01940883346d7868c9c3320f22745bd4",
"timestamp": "",
"source": "github",
"line_count": 229,
"max_line_length": 80,
"avg_line_length": 35.122270742358076,
"alnum_prop": 0.6273778440880269,
"repo_name": "catapult-project/catapult-csm",
"id": "596f34582199d3e03d8a39612e286e93a2814ac7",
... |
from distutils.core import setup
setup(
name='mbutil',
version='0.0.2',
author='Tom MacWright',
author_email='[email protected]',
packages=['mbutil'],
scripts=['mb-util'],
url='https://github.com/mapbox/mbutil',
license='LICENSE.md',
description='An importer and exporter for MBTil... | {
"content_hash": "5c895c7c52cba334b825b5489932c000",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 55,
"avg_line_length": 26.714285714285715,
"alnum_prop": 0.6524064171122995,
"repo_name": "rouault/mbutil",
"id": "f6d347e19f19d76ea1549976f86745010272d95a",
"size": "374",... |
import unittest
from dart.client.python.dart_client import Dart
from dart.engine.no_op.metadata import NoOpActionTypes
from dart.model.action import ActionData, Action, ActionState
from dart.model.datastore import Datastore, DatastoreData, DatastoreState
from dart.model.trigger import Trigger, TriggerState
from dart.m... | {
"content_hash": "e8b562da1393960afd50e8c5a0f523f0",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 151,
"avg_line_length": 57.138888888888886,
"alnum_prop": 0.7207097715119105,
"repo_name": "RetailMeNotSandbox/dart",
"id": "35a07d6f246a7857d082763c7efc434122104575",
"siz... |
import random
rand_num = random.randint(1, 10);
guessed_nums = []
allowed_guesses = 5
| {
"content_hash": "60d6e68e9d909967c32cff202ce17b3a",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 33,
"avg_line_length": 17.4,
"alnum_prop": 0.7011494252873564,
"repo_name": "Zenira/Treehouse",
"id": "b60ea72a2424467030000900f50d28d3c0ad7223",
"size": "87",
"binary": f... |
"""
oauthlib.openid.connect.core.endpoints.pre_configured
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various endpoints needed
for providing OpenID Connect servers.
"""
from __future__ import absolute_import, unicode_literals
from oauthlib.oauth2.rfc6749.endpoints import ... | {
"content_hash": "40a6fe01ccb804760bcede24d6bcf0b8",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 139,
"avg_line_length": 49.5,
"alnum_prop": 0.6077441077441077,
"repo_name": "javier-ruiz-b/docker-rasppi-images",
"id": "fde2739e851a25d4ba8bce435018c00278b1b20c",
"size"... |
from django.shortcuts import render, redirect
from django import forms
from ref.models.instances import ComponentInstance, Environment
from ref.creation import duplicate_envt
from django.forms.formsets import formset_factory
from django.contrib.auth.decorators import permission_required
from django.db.transaction impor... | {
"content_hash": "00722ef84e4f69ff6d43a0f91b9c6aad",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 170,
"avg_line_length": 46.27272727272727,
"alnum_prop": 0.6497333707549817,
"repo_name": "marcanpilami/MAGE",
"id": "1c0394d29006db583a53d9ad3daedaad09de053d",
"size": "35... |
'''Generate simConst.py from simConst.h distributed from CoppeliaSim
$ ./generate_simConst.py > ../pyrep/backend/simConst.py
'''
import contextlib
import importlib
import os
import os.path as osp
import re
import shlex
import shutil
import subprocess
import sys
import tempfile
try:
import CppHeaderParser
exc... | {
"content_hash": "420d3a27cf6f484a154f6bdd78e61176",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 75,
"avg_line_length": 28.20138888888889,
"alnum_prop": 0.5875400147746861,
"repo_name": "stepjam/PyRep",
"id": "b90fa7e04f9e51f5b0d2c8da8b7a4e60347bd2d9",
"size": "4083",... |
from __future__ import unicode_literals
from django.utils import six
from djblets.webapi.errors import INVALID_FORM_DATA, PERMISSION_DENIED
from reviewboard.attachments.models import (FileAttachment,
FileAttachmentHistory)
from reviewboard.webapi.resources import resources
... | {
"content_hash": "7ee25e12e34a498a4f330fb9c50a3c17",
"timestamp": "",
"source": "github",
"line_count": 298,
"max_line_length": 79,
"avg_line_length": 41.29865771812081,
"alnum_prop": 0.5877955635004469,
"repo_name": "chipx86/reviewboard",
"id": "0d946cc9f56a9ed677f0460f4e65a1820921fede",
"size": "... |
import confluent.config.attributes as attrscheme
import confluent.interface.console as console
import confluent.exceptions as exc
import confluent.messages as msg
import confluent.noderange as noderange
import confluent.shellmodule as shellmodule
import itertools
import os
import sys
pluginmap = {}
def seek_element(c... | {
"content_hash": "e3d0c1bc3aca79d23cd7a7e49d61352d",
"timestamp": "",
"source": "github",
"line_count": 483,
"max_line_length": 81,
"avg_line_length": 36.56521739130435,
"alnum_prop": 0.6043825377951418,
"repo_name": "michaelfardu/thinkconfluent",
"id": "b97ac7a4979e5ad1b4e5c13f892c6a3f1e2475bc",
"... |
import board as b
import list as l
import card as c
class Project(object):
def __init__(self, name):
self.name = name
self.boards = []
# self.cards = []
self.description = ""
self.start_date = ""
self.end_date = ""
self.prefix = self.name[0:3].upper()
def addBoard(self, board_name):
self.boards.ap... | {
"content_hash": "3e7341b0890b97170a2ed3990fc138dc",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 41,
"avg_line_length": 17.324324324324323,
"alnum_prop": 0.6536661466458659,
"repo_name": "matthew-nolan/cardception",
"id": "6aa3054c3a7ff212f42bd89e4c1c16191376d601",
"si... |
from google.cloud import networkconnectivity_v1
async def sample_delete_spoke():
# Create a client
client = networkconnectivity_v1.HubServiceAsyncClient()
# Initialize request argument(s)
request = networkconnectivity_v1.DeleteSpokeRequest(
name="name_value",
)
# Make the request
... | {
"content_hash": "8ed728b18220d7d29dccf7ff11bea9e3",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 69,
"avg_line_length": 25.217391304347824,
"alnum_prop": 0.7206896551724138,
"repo_name": "googleapis/python-network-connectivity",
"id": "a964fe348735522c83f5d51ccace3f7a8d2... |
from __future__ import annotations
import json
import re
import unittest
from unittest import mock
from unittest.mock import patch
import pytest
from parameterized import parameterized
from trino.transaction import IsolationLevel
from airflow import AirflowException
from airflow.models import Connection
from airflow... | {
"content_hash": "b06fb1d00e1686dff774413c40188e25",
"timestamp": "",
"source": "github",
"line_count": 309,
"max_line_length": 108,
"avg_line_length": 38.22006472491909,
"alnum_prop": 0.622099915325995,
"repo_name": "nathanielvarona/airflow",
"id": "a30087952089d0985c550fd7bbc1ddc3464151f9",
"size... |
"""
Collection of functions related to geographical datasets.
Especially:
* converting coordinates between coordinate systems
* getting the value at a specific point of a dataset
"""
# greatly inspired from
# http://gis.stackexchange.com/questions/6669/converting-projected-geotiff-to-wgs84-with-gdal-and-python
# an... | {
"content_hash": "0c437d23871a722c84fea16c5a692228",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 112,
"avg_line_length": 36.6,
"alnum_prop": 0.7051131928181108,
"repo_name": "superbob/YunoSeeMe",
"id": "ea2582e7e7dc3e7ff0e8d70d4e7f77ff73699308",
"size": "5124",
"bin... |
from setuptools import setup
setup(
name='django-jux',
version='1.1.2',
description='JUnit-style XML output for Django tests',
author='Sean Myers',
author_email='[email protected]',
url='https://bitbucket.org/seandst/django-jux',
packages=['juxd'],
license='MIT Expat License',
long... | {
"content_hash": "1b05184f978e1e4ca5a7058289e16000",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 58,
"avg_line_length": 32.6551724137931,
"alnum_prop": 0.5987328405491025,
"repo_name": "RideCo/django-jux",
"id": "737aa2d900d50924e1145a836a80b0c7c025e06e",
"size": "947"... |
import arff
import argparse
import ConfigSpace
import copy
import fanova.fanova
import fanova.visualizer
import json
import matplotlib.cm
import matplotlib.pyplot as plt
import numpy as np
import logging
import openmlcontrib
import openmlpimp.configspaces
import os
import sklearnbot
import typing
# to plot: <openml_p... | {
"content_hash": "a9c0cd42b8fb5895434138d3f6d81f41",
"timestamp": "",
"source": "github",
"line_count": 271,
"max_line_length": 112,
"avg_line_length": 47.11439114391144,
"alnum_prop": 0.5762061403508771,
"repo_name": "janvanrijn/openml-pimp",
"id": "75edd088d5249e93011503fa8fb274b844240152",
"size... |
"""Tests for model sparsity handling / switching."""
import pytest
import numpy as np
from parameters import T_VALUES, KPT
import tbmodels
@pytest.mark.parametrize("t1", T_VALUES)
def test_simple(t1, get_model):
"""
Check that a simple model set up as sparse and dense creates
the same Hamiltonians.
... | {
"content_hash": "134edc65d8363c1eb393ee2dddc04f9d",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 85,
"avg_line_length": 31.065573770491802,
"alnum_prop": 0.6849604221635884,
"repo_name": "Z2PackDev/TBmodels",
"id": "8878e753fccfd7cb8094529823c857f5266df809",
"size": "2... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('problem', '0003_auto_20170429_1802'),
]
operations = [
migrations.RemoveField(
model_name='problem',
name='problem_desc',
... | {
"content_hash": "31ce14971e8d3288e60300555c3c8010",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 103,
"avg_line_length": 24.545454545454547,
"alnum_prop": 0.5851851851851851,
"repo_name": "io07/BOJ-V4",
"id": "7c770a7d8b63d2b50eb5422b4ea9a7d573534a44",
"size": "564",
... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import with_statement
from ..base import ServerFrame
class Receipt(ServerFrame):
abstract = True
class Receipt10(Receipt):
version = '1.0'
... | {
"content_hash": "a5342d4ae30ddba54cceedca8560cc6e",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 39,
"avg_line_length": 19.12,
"alnum_prop": 0.694560669456067,
"repo_name": "skippyprime/stimpi",
"id": "8e4f4319e2ed93ba7dbaca33da35f9698aa15f12",
"size": "1058",
"binar... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='item',
fields=[
('item_id', models.CharField(max_le... | {
"content_hash": "d44c06cb68174294f5ec299dc9d9d6d1",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 96,
"avg_line_length": 30.444444444444443,
"alnum_prop": 0.5413625304136253,
"repo_name": "mpiplani/Online-Pharmacy",
"id": "d9f1e20005370a1fb71438c09656f8afd24d43a8",
"siz... |
"""Auto-generated file, do not edit by hand. KN metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_KN = PhoneMetadata(id='KN', country_code=1, international_prefix='011',
general_desc=PhoneNumberDesc(national_number_pattern='[589]\\d{9}', possible_number_pattern='\\... | {
"content_hash": "759ac8a71a742cb8de1884a2562ddea5",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 188,
"avg_line_length": 83.84210526315789,
"alnum_prop": 0.7011927181418707,
"repo_name": "vicky2135/lucious",
"id": "8932b97f685cd16039ba873a2d319e96cb3f191f",
"size": "15... |
import functools
import time
import unittest
from concurrent import futures
from mock import mock
from mock import patch
from oslo_serialization import jsonutils
import pika
import oslo_messaging
from oslo_messaging._drivers.pika_driver import pika_engine
from oslo_messaging._drivers.pika_driver import pika_message a... | {
"content_hash": "44576eb1949d22f8be348c311c2c9af3",
"timestamp": "",
"source": "github",
"line_count": 608,
"max_line_length": 79,
"avg_line_length": 36.73848684210526,
"alnum_prop": 0.5927385056184805,
"repo_name": "dukhlov/oslo.messaging",
"id": "0cc1b869d675b5f6f77a068ada4f09a857f060ed",
"size"... |
"""
PyCOMPSs Testbench
========================
"""
# Imports
from pycompss.api.task import task
from pycompss.api.mpi import mpi
from pycompss.api.constraint import constraint
from pycompss.api.api import compss_wait_on
@constraint(computing_units="2")
@mpi(runner="mpirun", computing_nodes="1")
@task(returns=list)
d... | {
"content_hash": "dad4f2576538f0994a7e93aa94aaf7d4",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 137,
"avg_line_length": 22.9,
"alnum_prop": 0.6626637554585153,
"repo_name": "mF2C/COMPSs",
"id": "20b8bf22ffdbd4f4114f356134f9dcc79058475b",
"size": "960",
"binary": fal... |
""" swagger format declartion """
import venusian
from .interfaces import CATEGORY
__all__ = ('format', 'SwaggerFormat')
class SwaggerFormat(object):
def __init__(self, name):
self.format = name
def to_wire(self, item):
raise NotImplementedError
def to_python(self, value):
rais... | {
"content_hash": "9f732e85b3e1e5bd00b17d1ae7b1c204",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 69,
"avg_line_length": 21.542857142857144,
"alnum_prop": 0.6392572944297082,
"repo_name": "fafhrd91/mdl",
"id": "ba5524898550636ab03a148f4d2ff965e28e0950",
"size": "754",
... |
from entity.Entity import Entity
from statisticalDistributions import *
class InventoryEntity(Entity):
__metaclass__ = ABCMeta
def __init__(self, simSystem, Type, id, inputPointer, outputPointer):
super(InventoryEntity, self).__init__(simSystem, Type, id, inputPointer, outputPointer)
@abstra... | {
"content_hash": "e42df385988ab7bdac793e72d246d4c3",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 95,
"avg_line_length": 26,
"alnum_prop": 0.6855203619909502,
"repo_name": "mrhsce/simPython",
"id": "00cc284f4bda0fdad22c454bd2622e73e191a975",
"size": "442",
"binary": f... |
import os, random
import queue
# In[2]:
def hierachy_generator(k, size):
index = 0
hierachy_dict = {}
sub_ordinates_dict = {}
employees = []
root = 'e'+str(index)
index+=1
employees.append(root)
hierachy_dict[root] = []
sub_ordinates_dict[root] = []
return_nodes = queue.Queue... | {
"content_hash": "1304b5f5a60b9776260b6033e3c529f8",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 175,
"avg_line_length": 27.907801418439718,
"alnum_prop": 0.5786531130876748,
"repo_name": "gfarnadi/FairPSL",
"id": "fb69f31975721b03737c716646762059ad7bef51",
"size": "3... |
from django.db import models
from django.conf import settings
from estudios_socioeconomicos.models import Estudio
class Retroalimentacion(models.Model):
""" The model that represents the feedback on a study.
This model contains the feedback left either by the admin or
by a capturista on a study during t... | {
"content_hash": "567f52d0060269a964478b11e064302a",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 82,
"avg_line_length": 37.53846153846154,
"alnum_prop": 0.6325136612021858,
"repo_name": "erikiado/jp2_online",
"id": "664ac93bb7aa48c7afb638c56110b205be31d1b6",
"size": "1... |
import re
from abc import abstractmethod
from datetime import date, datetime, time, timedelta
from enum import Enum
from json.encoder import JSONEncoder as BaseJSONEncoder
from .base import AccessMode
from .fields import MultiTypeField
from .model_types import ListModel
from .models import BaseModel
__all__ = ['under... | {
"content_hash": "41cb0b322695c1c6e8330cd7bfc8c578",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 104,
"avg_line_length": 27.15909090909091,
"alnum_prop": 0.6194560669456067,
"repo_name": "alfred82santa/dirty-models",
"id": "eb215b582439aab7aa761c9d23f44ceb68d89518",
"... |
"""
Module showing amount of windows at the scratchpad.
@author shadowprince
@license Eclipse Public License
"""
import i3
from time import time
def find_scratch(tree):
if tree["name"] == "__i3_scratch":
return tree
else:
for x in tree["nodes"]:
result = find_scratch(x)
... | {
"content_hash": "b1c5d0dad4a5ad54c79718f073367444",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 77,
"avg_line_length": 24.131147540983605,
"alnum_prop": 0.5645380434782609,
"repo_name": "FedericoCeratto/debian-py3status",
"id": "0ee9a4939d38de3581706855e7f909eea803ea41"... |
import common.ot_utils
def find_reports_dist(r1,r2):
my_loc1 = r1.my_loc
my_loc2 = r2.my_loc
result = common.ot_utils.latlon_to_meters(my_loc1.lat, my_loc1.lon, my_loc2.lat, my_loc2.lon)
return result
def find_distance_in_reports(reports,full=False):
reports = list(reports)
result = []
for ... | {
"content_hash": "b560b3f50deceb462a0d6564403370ee",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 123,
"avg_line_length": 47.4,
"alnum_prop": 0.6215856095936043,
"repo_name": "hasadna/OpenTrain",
"id": "7ee8ecccb4e38eb0209b63bf6692b2194621ff24",
"size": "4503",
"binar... |
from nose.plugins.attrib import attr
from test.integration.base import DBTIntegrationTest, use_profile
class TestSimpleCopy(DBTIntegrationTest):
@property
def schema(self):
return "simple_copy_001"
@staticmethod
def dir(path):
return "test/integration/001_simple_copy_test/" + path.ls... | {
"content_hash": "43d519cbbe695e284609e068efaecfb3",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 89,
"avg_line_length": 33.61951219512195,
"alnum_prop": 0.5959082994776552,
"repo_name": "nave91/dbt",
"id": "f99ab209efc8e6f9127e0c6f578b63f373139073",
"size": "6892",
... |
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""
Test file created by XlsxWriter against a file created by Excel.
"""
def setUp(self):
self.set_filename('chart_format15.xlsx')
def test_create_f... | {
"content_hash": "acacd5592c15feeba7c5381dfadbf9a9",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 76,
"avg_line_length": 24.90566037735849,
"alnum_prop": 0.5416666666666666,
"repo_name": "jmcnamara/XlsxWriter",
"id": "961fd570c65fc0f626adffa75462a6f3c37d0350",
"size": "... |
from __future__ import unicode_literals
import datetime
import os
import re
import sys
import types
from django.conf import settings
from django.core.urlresolvers import resolve, Resolver404
from django.http import (HttpResponse, HttpResponseNotFound, HttpRequest,
build_request_repr)
from django.template import T... | {
"content_hash": "499c40a3684556101bc3ad5196fbe0d4",
"timestamp": "",
"source": "github",
"line_count": 1264,
"max_line_length": 124,
"avg_line_length": 36.9248417721519,
"alnum_prop": 0.5714867268013627,
"repo_name": "gdi2290/django",
"id": "09cc5c462efce689da7d9033630c8ab3324ec763",
"size": "4667... |
import os, tweepy, time, sys, json, requests, random, imp, datetime, schedule, time, random
def twit_auth():
# Authenticate the twitter session.
# Should only be needed once at the initiation of the code.
CONSUMER_KEY = os.environ['CONSUMER_KEY']
CONSUMER_SECRET = os.environ['CONSUMER_SECRET']
ACCES... | {
"content_hash": "0e52ab678e7fe1a456418d0d8f470f00",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 316,
"avg_line_length": 49.751196172248804,
"alnum_prop": 0.6847470667436045,
"repo_name": "SimonGoring/NeotomaBot",
"id": "8381a6213cc3d3908ef643042504dbfa7fccd3b8",
"siz... |
from graphviz import Digraph
import argparse
import os
import pydot
import sys
import warnings
def gen_graph_from_gv(ifile, odir, oformat="png"):
(graph,) = pydot.graph_from_dot_file(ifile)
gen_graph_func = getattr(graph, "write_" + oformat)
filename = os.path.basename(ifile)
ofile = odir + "/" + os.pa... | {
"content_hash": "5a780901d5c181f17c943689c5ebb381",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 70,
"avg_line_length": 30.071428571428573,
"alnum_prop": 0.6098574821852731,
"repo_name": "explora26/zephyr",
"id": "28871b4a295f34b8ee7f70fb9d52cf32705b2018",
"size": "168... |
"""Self-test suite for Crypto.Hash.keccak"""
import unittest
from binascii import hexlify, unhexlify
from Crypto.SelfTest.loader import load_tests
from Crypto.SelfTest.st_common import list_test_cases
from StringIO import StringIO
from Crypto.Hash import keccak
from Crypto.Util.py3compat import b, tobytes, bchr
cla... | {
"content_hash": "a843a6ad8451f522970118c574b018e0",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 88,
"avg_line_length": 34.502262443438916,
"alnum_prop": 0.5589508196721311,
"repo_name": "ininex/geofire-python",
"id": "4fce1782666b62940b9d0f65857c8b9d8725f82b",
"size"... |
from django.contrib import admin
from pixelpuncher.enemy.models import EnemyCategory, EnemyType, Enemy, EnemySpawn
class EnemyCategoryModelAdmin(admin.ModelAdmin):
list_display = ("code", "name", )
search_fields = ("code", "name", )
list_per_page = 25
class EnemyTypeCategoryModelAdmin(admin.ModelAdmin)... | {
"content_hash": "73adfa362430e5ead51ad866e067143f",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 100,
"avg_line_length": 37.1875,
"alnum_prop": 0.7,
"repo_name": "ej2/pixelpuncher",
"id": "8efc939a20d4172e3cbbacf02c693b332e3fe173",
"size": "1190",
"binary": false,
... |
import gym
from random import choice
import unittest
import ray
import ray.rllib.agents.a3c as a3c
import ray.rllib.agents.dqn as dqn
import ray.rllib.agents.pg as pg
from ray.rllib.examples.env.multi_agent import MultiAgentCartPole
from ray.rllib.utils.test_utils import framework_iterator
class TestTrainer(unittest... | {
"content_hash": "e09d6f1613650f15fc62f84f15bfd63f",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 78,
"avg_line_length": 36.638888888888886,
"alnum_prop": 0.525587566338135,
"repo_name": "pcmoritz/ray-1",
"id": "2e3f5afe87d7c8ebc7d4805a95f28a9774398f6a",
"size": "5276"... |
from __future__ import absolute_import
from concurrent.futures import as_completed
from ..maya import Executor
def get_type(node):
from maya import cmds
return node, cmds.nodeType(node)
def submit():
from maya import cmds
executor = Executor(clone_environ=True, create_tempfile=True)
with exec... | {
"content_hash": "f94b5ac9b497df5121fae2504dfc617d",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 83,
"avg_line_length": 25.21875,
"alnum_prop": 0.6753407682775713,
"repo_name": "westernx/qbfutures",
"id": "d1643973ce9b00bea3e5de5f37498a09ebd97395",
"size": "807",
"bi... |
from sklearn2sql_heroku.tests.regression import generic as reg_gen
reg_gen.test_model("DecisionTreeRegressor" , "RandomReg_500" , "oracle")
| {
"content_hash": "2366d69c1d226cad6dea19bd8d016cc5",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 72,
"avg_line_length": 35.5,
"alnum_prop": 0.7816901408450704,
"repo_name": "antoinecarme/sklearn2sql_heroku",
"id": "0292f6192af33687b5db7bdc2826d5ff71dcd9d5",
"size": "142... |
import logging
from io import BytesIO
from .psparser import PSStackParser
from .psparser import PSSyntaxError
from .psparser import PSEOF
from .psparser import KWD
from . import settings
from .pdftypes import PDFException
from .pdftypes import PDFStream
from .pdftypes import PDFObjRef
from .pdftypes import int_value
fr... | {
"content_hash": "6efd7916781ba1eeafe188c5c7d8b0c6",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 78,
"avg_line_length": 31.211764705882352,
"alnum_prop": 0.5358085186581228,
"repo_name": "goulu/pdfminer",
"id": "ee64c2ee42e3237ba1f5437b230ccecc9fd46c99",
"size": "5306... |
from os import getenv
from unittest import TestCase
from selenium.webdriver import Remote
from horace.driver import Driver
from config import html_fixture_url
class TestDriver(TestCase):
config = {
'driver': getenv('BROWSER', 'phantomjs'),
'platform': getenv('PLATFORM', 'ANY')
}
def test_... | {
"content_hash": "9fd2d5cd31498832cd083b0d3579e724",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 73,
"avg_line_length": 29.015873015873016,
"alnum_prop": 0.6198030634573304,
"repo_name": "lawrencec/horace",
"id": "cefc383ee8810f21debfe087c1c1a76c534e3111",
"size": "182... |
from .get_handler import get_handler_class, get_handler # noqa
from .handler_shortcuts import i18n_reverse, transform_url_to_languagecode # noqa
from .i18n_urlpatterns import i18n_patterns, I18nLocalePrefixPattern # noqa
| {
"content_hash": "2140d73b5280cb02b2ac28ba42d5d7ee",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 82,
"avg_line_length": 74.66666666666667,
"alnum_prop": 0.8035714285714286,
"repo_name": "appressoas/ievv_opensource",
"id": "ecff829ffdeba21b5534ff870f0eeaede6e26716",
"siz... |
from heatclient.common import base
from heatclient.v1 import stacks
DEFAULT_PAGE_SIZE = 20
class Event(base.Resource):
def __repr__(self):
return "<Event %s>" % self._info
def update(self, **fields):
self.manager.update(self, **fields)
def delete(self):
return self.manager.delet... | {
"content_hash": "28890390a7eef240559131e1bef1058f",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 78,
"avg_line_length": 34.40816326530612,
"alnum_prop": 0.5747330960854092,
"repo_name": "neumerance/cloudloon2",
"id": "85f43b9a3b3662a8526ea7a8c250ad453c3425ef",
"size": ... |
"Use 2.X/3.X keyword args deletion with defaults"
import sys
def print3(*args, **kargs):
sep = kargs.pop('sep', ' ')
end = kargs.pop('end', '\n')
file = kargs.pop('file', sys.stdout)
if kargs: raise TypeError('extra keywords: %s' % kargs)
output = ''
first = True
for arg in args:
... | {
"content_hash": "4f329257a765a370116731012483b821",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 59,
"avg_line_length": 29.714285714285715,
"alnum_prop": 0.5769230769230769,
"repo_name": "dreadrel/UWF_2014_spring_COP3990C-2507",
"id": "1ffad8380ff2f1d3e249cd2862e4f440ded... |
from contextlib import contextmanager
import os
import requests
from astropy import coordinates
import pytest
from ...utils import commons
from ...utils.testing_tools import MockResponse
from ... import alfalfa
DATA_FILES = {'catalog': 'alfalfa_cat_small.txt',
'spectrum': 'alfalfa_sp.fits'}
class MockR... | {
"content_hash": "bf9cf830b37db83a1fe4dd6fd95ca7f7",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 79,
"avg_line_length": 27.1875,
"alnum_prop": 0.6841379310344827,
"repo_name": "ceb8/astroquery",
"id": "81c8f5b112c0b22272cd6974bb47c8ec2c39cedc",
"size": "2239",
"binar... |
from __future__ import print_function, division
import pytest
from changelog.util import default_get, get_change_text
class TestUtil():
def test_default_get(self):
d = {}
x = default_get(d, "x", dict)
assert "x" in d
assert d["x"] is x
a = default_get(default_get(d, "x"... | {
"content_hash": "10b8b339af7014602849ba335e158787",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 72,
"avg_line_length": 24.629032258064516,
"alnum_prop": 0.5180091683038638,
"repo_name": "spacecowboy/changelog-writer",
"id": "70d1ac9e5519a3fc3708972f4ab7a769497f91f8",
... |
"""This module implements the USB_Port class which allows the pyboard to
implement bioloid devices using the pyboard's USB Serial.
"""
from pyb import USB_VCP
class USB_Port:
"""Implements a port which can be used to receive bioloid device commands
from a host.
"""
def __init__(self):
self.u... | {
"content_hash": "8f3574117715bcbb2814326b35c8b2c0",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 77,
"avg_line_length": 31.607843137254903,
"alnum_prop": 0.619727047146402,
"repo_name": "dhylands/bioloid3",
"id": "6d3a680d12f5c0981ed446f4846fd3ee15f6c1fd",
"size": "161... |
import numpy as np
import GPpref
from scipy.stats import beta
import plot_tools as ptt
def calc_ucb(fhat, vhat, gamma=2.0, sigma_offset=0.0):
return fhat + gamma * (np.sqrt(np.atleast_2d(vhat.diagonal()).T) - sigma_offset)
def softmax_selector(x, tau=1.0):
ex = np.exp((x - x.max())/tau)
Px = ex/ex.sum()
... | {
"content_hash": "6e1e26e2eeb1a3f7c8e47cdbcb8b1a59",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 126,
"avg_line_length": 44.05855855855856,
"alnum_prop": 0.5848072794192822,
"repo_name": "nrjl/GPN",
"id": "0be43b64adc83b327fc804afe50cf2792af0a08e",
"size": "9781",
"... |
"""
Rest API for Home Assistant.
For more details about the RESTful API, please refer to the documentation at
https://home-assistant.io/developers/api/
"""
import asyncio
import json
import logging
from aiohttp import web
import async_timeout
import homeassistant.core as ha
import homeassistant.remote as rem
from ho... | {
"content_hash": "885f381f0ed5cfe2d5b38e984316aba6",
"timestamp": "",
"source": "github",
"line_count": 360,
"max_line_length": 79,
"avg_line_length": 30.894444444444446,
"alnum_prop": 0.6164358928250314,
"repo_name": "alexmogavero/home-assistant",
"id": "8205029bd21a722a5e3ece6f1f64ee71e7984ce7",
... |
"""Module loader file for /ciscripts/deploy/conan."""
| {
"content_hash": "cabc41608d4db2467cf88086b0f749c6",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 53,
"avg_line_length": 54,
"alnum_prop": 0.7222222222222222,
"repo_name": "polysquare/polysquare-ci-scripts",
"id": "a0df194b4f94e3f8e1105562daa666969de4cfe9",
"size": "190"... |
from pnc_cli import makemead
import random
import string
def test_sso():
makemead.make_mead(config="configs/sso.cfg", product_name="sso", product_version="7.1", run_build=True, suffix=get_suffix())
def get_suffix():
return "-" + ''.join(random.choice(string.ascii_uppercase + string.digits)
... | {
"content_hash": "64032a0495c7f103588465340a8f944d",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 128,
"avg_line_length": 34.6,
"alnum_prop": 0.6589595375722543,
"repo_name": "project-ncl/pnc-cli",
"id": "c88bf7b2fca1aae757af85304c6015e7e0779a26",
"size": "346",
"bina... |
from objects import PadStorage
__author__ = 'Taras Drapalyuk <[email protected]>'
__date__ = '24.05.2015'
import uuid
from datetime import datetime, timedelta
import tornado.web
import tornado.ioloop
from gorinich import logger
from gorinich.utils import get_server_address
class Application(tornado.web.Applicat... | {
"content_hash": "5eea23736b5cbeab17e2d9056beef9ad",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 95,
"avg_line_length": 31.29813664596273,
"alnum_prop": 0.567176026989482,
"repo_name": "kulapard/Gorinich",
"id": "6ed4488cb7da53bc9e3676e6e8b418a8dc993928",
"size": "506... |
# course: ECE 1160
# laboratory: 2
# date: 10/04/18
# username: zmm15
# name: Zachary M. Mattis
# title: Raspberry Pi SenseHat Joystick
# description: SenseHat G-Force Detection
#from sense_hat import SenseHat
import color
import time | {
"content_hash": "dc5e7844708c9ec5787289f57a04ca2e",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 45,
"avg_line_length": 22.416666666666668,
"alnum_prop": 0.6617100371747212,
"repo_name": "zmattis/University-of-Pittsburgh",
"id": "909e9f79d8618e04a98cb7e2fa2e0ee60ce9078c"... |
"""
Tests for confab data model.
"""
from os.path import dirname, join
from nose.tools import eq_
from unittest import TestCase
from confab.data import import_configuration, DataLoader
from confab.definitions import Settings
class TestData(TestCase):
def setUp(self):
self.settings = Settings()
s... | {
"content_hash": "7033153543d8605a36e4e0588f4abcf9",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 85,
"avg_line_length": 32.69285714285714,
"alnum_prop": 0.536596023596242,
"repo_name": "locationlabs/confab",
"id": "cd0554fdc357a2e4a91404bc392dc2aba10216d0",
"size": "4... |
"""
CUSF Simulator Utilities
"""
| {
"content_hash": "30b2bbc86339ffde8f72033731e490c5",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 24,
"avg_line_length": 8.5,
"alnum_prop": 0.6470588235294118,
"repo_name": "cuspaceflight/firefish",
"id": "a8c8cd04a69ee3290601be04cd4c933d83d11d7e",
"size": "34",
"binar... |
from azure.identity import DefaultAzureCredential
from azure.mgmt.logic import LogicManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-logic
# USAGE
python gets_the_integration_service_environment_network_health.py
Before run the sample, please set the values of the... | {
"content_hash": "fd4f7c24f2c63f017cfd406829e2bce3",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 151,
"avg_line_length": 36.78787878787879,
"alnum_prop": 0.7537067545304778,
"repo_name": "Azure/azure-sdk-for-python",
"id": "99bffc1e881d7d8dd64662eb4844fcb65806da0b",
"s... |
from unittesting import DeferrableTestCase
from GitSavvy.tests.mockito import when, verify
from GitSavvy.tests.parameterized import parameterized as p
from GitSavvy.core.git_mixins.history import HistoryMixin
examples = [
("from commit to working dir", "abc", None, ["abc", None]),
("from commit to commit", "... | {
"content_hash": "e4fa4738ee8e0f59760f539a9a64383b",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 74,
"avg_line_length": 39.5625,
"alnum_prop": 0.6058451816745656,
"repo_name": "divmain/GitSavvy",
"id": "2fcf2390409a0d3c446f4d275b60a889b1146d28",
"size": "1266",
"bina... |
from __future__ import annotations
import sys
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
# noinspection PyProtectedMember
from build.__main__ import build_package
from build.util import project_wheel_metadata
from tests.testutils import subprocess_run
from tests.testutils import tempor... | {
"content_hash": "e9cecee31691b3dd40c1ceeca253b993",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 87,
"avg_line_length": 27.755102040816325,
"alnum_prop": 0.6713235294117647,
"repo_name": "python-poetry/poetry-core",
"id": "0706112ba8e03b88abf2a2e73f7ca4ec34d080e1",
"si... |
from django.core.urlresolvers import reverse_lazy
from django.views.generic import TemplateView
from django.http import HttpResponse, HttpResponseRedirect
from django.contrib.auth import logout
from apps.landing.models import Landing
from apps.base.views import (BaseView, LoginRequiredMixin)
class UserProfileView(Ba... | {
"content_hash": "823cab23c84e6b72a73c9b872d40bcce",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 66,
"avg_line_length": 31.59090909090909,
"alnum_prop": 0.6805755395683454,
"repo_name": "pythonvietnam/nms",
"id": "dfe60db10b9571b50037df86ae1de6f79642e05e",
"size": "695... |
""" lightCurve.py
This purpose of this program is to produce a light curve from data for time and brightness.
Language: Python 3
Tanner Leighton
Written for CIERA Summer Internship, Northwestern University.
6/22/17
"""
"""First let's import the libraries that will provide you with some useful ... | {
"content_hash": "16478488c3598adeb46f95fb89a471bc",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 96,
"avg_line_length": 25.790123456790123,
"alnum_prop": 0.7185256103398755,
"repo_name": "krispmort/NUREU17",
"id": "0995015bf881dc5638f23302f0e100fd9486a808",
"size": "20... |
from hanzo.httptools.messaging import RequestMessage, ResponseMessage, HTTP09Response
__all__ = [
"RequestMessage",
"ResponseMessage",
"HTTP09Response",
]
| {
"content_hash": "21cddf7a170d391b037125839f90dbe2",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 85,
"avg_line_length": 21.125,
"alnum_prop": 0.7218934911242604,
"repo_name": "internetarchive/warctools",
"id": "85ced342cfc90b329ffde0f59e05d16c92842f5d",
"size": "169",
... |
from google.cloud import gaming_v1
def sample_fetch_deployment_state():
# Create a client
client = gaming_v1.GameServerDeploymentsServiceClient()
# Initialize request argument(s)
request = gaming_v1.FetchDeploymentStateRequest(
name="name_value",
)
# Make the request
response = c... | {
"content_hash": "9a58a6a8e662effa3a71e4d6418efd18",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 88,
"avg_line_length": 26.473684210526315,
"alnum_prop": 0.73558648111332,
"repo_name": "googleapis/python-game-servers",
"id": "4738e23782e739180ed1039559740a52865999b9",
... |
def agregar_una_vez(lista, elemento):
try:
if elemento not in lista:
lista.append(elemento)
else:
raise ValueError
except ValueError:
print('Error: Imposible añadir elementos duplicados => {}'.format(elemento))
lista_prueba = [1, 5, "Hola",-2]
elemento1 = int(inp... | {
"content_hash": "596580569bb07e4f2f75520452783c99",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 84,
"avg_line_length": 33,
"alnum_prop": 0.6755793226381461,
"repo_name": "maumg1196/PythonRandomExercices",
"id": "c6d0f9ad787baeeb97de0c39cc011bafac0e0eb2",
"size": "562"... |
"""Fichier contenant le type viande."""
from .nourriture import Nourriture
class Viande(Nourriture):
"""Type d'objet: viande.
"""
nom_type = "viande"
def __init__(self, cle=""):
"""Constructeur de l'objet"""
Nourriture.__init__(self, cle)
self.nourrissant = 3
| {
"content_hash": "e9a7ac8b1d2c176b572ca117ac1ed559",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 39,
"avg_line_length": 21.133333333333333,
"alnum_prop": 0.5646687697160884,
"repo_name": "vlegoff/tsunami",
"id": "d4369a8326b5714bcc85280bfd5d3259698546e2",
"size": "1887... |
import numpy as np
from pandas.util._decorators import Appender, Substitution
from pandas.core.dtypes.cast import maybe_downcast_to_dtype
from pandas.core.dtypes.common import is_integer_dtype, is_list_like, is_scalar
from pandas.core.dtypes.generic import ABCDataFrame, ABCSeries
import pandas.core.common as com
fro... | {
"content_hash": "4bf97b2fbddc7e1b1a92a3e7708696aa",
"timestamp": "",
"source": "github",
"line_count": 684,
"max_line_length": 88,
"avg_line_length": 31.480994152046783,
"alnum_prop": 0.5675010449078159,
"repo_name": "kushalbhola/MyStuff",
"id": "3d93042486c8a37815b5ee69b6ac05920e27bbb5",
"size": ... |
class Event(object):
_propagation_stopped = False
def __init__(self, data=None):
self.data = data or {}
def stop_propagation(self):
self._propagation_stopped = True
def is_propagation_stop(self):
return self._propagation_stopped
def get(self, name):
return self.da... | {
"content_hash": "e06dd6c49884c2a232a9fce1f195c665",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 90,
"avg_line_length": 26.860759493670887,
"alnum_prop": 0.5711592836946278,
"repo_name": "rande/python-simple-ioc",
"id": "e261b84759c1414e1ffb22d7bc9ddc824046f65c",
"size... |
"""
Onshape REST API
The Onshape REST API consumed by all clients. # noqa: E501
The version of the OpenAPI document: 1.113
Contact: [email protected]
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
import sys # noqa:... | {
"content_hash": "e2e871e0e102f73474435d3e8897109d",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 80,
"avg_line_length": 34.02564102564103,
"alnum_prop": 0.5619819140919367,
"repo_name": "onshape-public/onshape-clients",
"id": "b800dcb60b64724beabae59e1fcde48013dd6c55",
... |
"""
This object contains a list of PolarizedPhoton objects, characterized by energy, direction vector and Stokes vector.
This object is used as input to and output from the passive crystal widget.
"""
import numpy
from crystalpy.util.PhotonBunch import PhotonBunch
class PolarizedPhotonBunch(PhotonBunch):
"""
... | {
"content_hash": "dd58bac91ef082d1dae07c601e7bab37",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 116,
"avg_line_length": 35.47540983606557,
"alnum_prop": 0.6182994454713494,
"repo_name": "edocappelli/crystalpy",
"id": "3645202955243f58d53434cb65d6c472dd981f76",
"size":... |
from datab import database_binding
from router import router_module
'''
################################################################################
Server-Client Text Protocol (SCTP)
Case in Server
Serves as a medium layer between the core algorithm machine and tr... | {
"content_hash": "f9ea2115198995eb2c9ed956b2ad25e0",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 82,
"avg_line_length": 37.375,
"alnum_prop": 0.572463768115942,
"repo_name": "niwtr/map-walker",
"id": "68bea0e44d09c61f985c17042b4e997be63144e7",
"size": "3588",
"binary... |
from gzip import open as gzip_open
from shutil import copyfileobj, move
def gzip_decompress_file(gzip_file_path):
with gzip_open(gzip_file_path, mode="rt") as gzip_file:
file_path = gzip_file_path[: -len(".gz")]
file_path_temporary = "{}.temporary".format(file_path)
with open(file_path... | {
"content_hash": "087abe07aa72ac386161ff5aef5ed2ee",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 68,
"avg_line_length": 25.157894736842106,
"alnum_prop": 0.6652719665271967,
"repo_name": "UCSD-CCAL/ccal",
"id": "a03b330acf2eab6fc74a1b6b6170f8fe8dc6971f",
"size": "478",... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.