text stringlengths 4 1.02M | meta dict |
|---|---|
import OSC #de pyosc
import RPi.GPIO as GPIO
import time
import argparse
import errno
import datetime
import sys
__author__ = 'gllmAr'
# gestion des arguments
parser = argparse.ArgumentParser(description='RPI Gpio interrupt OSC')
parser.add_argument('-g','--gpioBoard', help='gpio Board Mode (0=GPIO.BCM,... | {
"content_hash": "fde2cdd27e4315e4781ca891fffb72e6",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 126,
"avg_line_length": 33.260162601626014,
"alnum_prop": 0.6770960645318993,
"repo_name": "gllmAR/rpi-interuptOsc",
"id": "a5de18557b7e3f577d357a8fb088ec87301bcf33",
"siz... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
unified_strdate,
)
class NormalbootsIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?normalboots\.com/video/(?P<videoid>[0-9a-z-]*)/?$'
_TEST = {
'url': 'http://normalboots.com/video/home... | {
"content_hash": "67c993a1307dcaac448beb29fbe21040",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 384,
"avg_line_length": 44.82,
"alnum_prop": 0.6010709504685409,
"repo_name": "Grassboy/plugin.video.plurkTrend",
"id": "25e71a56e196d9cf7f9d2423c47293b01e46cd24",
"size": ... |
"""Unit tests for INFINIDAT InfiniBox volume driver."""
import mock
from oslo_utils import units
from cinder import exception
from cinder import test
from cinder.volume import configuration
from cinder.volume.drivers import infinidat
TEST_WWN_1 = '00:11:22:33:44:55:66:77'
TEST_WWN_2 = '11:11:22:33:44:55:66:77'
tes... | {
"content_hash": "f42dfdbc43bcf62941f99e42eabba3d0",
"timestamp": "",
"source": "github",
"line_count": 616,
"max_line_length": 79,
"avg_line_length": 48.62987012987013,
"alnum_prop": 0.6260849245560155,
"repo_name": "eharney/cinder",
"id": "76cd068fbd59b5080081912c7f4b3ce9d2c2fcea",
"size": "30585... |
from __future__ import print_function
from web_app import app
if __name__ == '__main__':
import logging
from logging.handlers import RotatingFileHandler
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
app_log = RotatingFileHandler('./play.log', maxBytes=100*1024*1... | {
"content_hash": "3ac390734a1148de4b0f919ddc3ac668",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 89,
"avg_line_length": 32.925925925925924,
"alnum_prop": 0.5973003374578177,
"repo_name": "qiyiping/othello",
"id": "b9d584adc2634f9eb3166982ab4f269f1090e751",
"size": "913... |
from gevent.server import StreamServer
from utils import green, red
from messages import parser, builder
transactions = []
def transfer(message, socket):
_from, to, how_many, date = message[1:]
if _from in transactions or to in transactions:
socket.send(builder('retry'))
transactions.append(_from)
tr... | {
"content_hash": "3abecefcd3f1f52d84bd8f29d789cef9",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 59,
"avg_line_length": 20.96551724137931,
"alnum_prop": 0.6291118421052632,
"repo_name": "vtemian/university_projects",
"id": "c6b3ab04befb4178d87761f62d3f4bb5996fcdcd",
"s... |
import os
import shelve
def save_game(player, entities, game_map, message_log, game_state):
with shelve.open('savegame.dat', 'n') as data_file:
data_file['player_index'] = entities.index(player)
data_file['entities'] = entities
data_file['game_map'] = game_map
data_file['message_lo... | {
"content_hash": "d88090c3c0693ece6e635a1e43c1f037",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 67,
"avg_line_length": 32.96153846153846,
"alnum_prop": 0.6336056009334889,
"repo_name": "LordRhys/Game-Development",
"id": "997787847daa86067fe88577996b94aebd2f6fff",
"siz... |
""" Part of weight_app
:copyright: (c) 2012 by Andreas Madsack.
:license: BSD, see LICENSE for more details.
"""
from flask.ext.testing import TestCase
from flask import Flask
import datetime
from main import db, create_app
import models
import utils
import StringIO
def add_some_data(username):
# add te... | {
"content_hash": "1d3a387f4f9aa5ea905c7d2d4a26238f",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 68,
"avg_line_length": 32.13076923076923,
"alnum_prop": 0.4986832655015561,
"repo_name": "mfa/weight-app",
"id": "92d8a59ef33d9593cb2865f05c821125f73928e5",
"size": "4178"... |
from collections import OrderedDict
import os
import re
from typing import (
Dict,
Mapping,
MutableMapping,
MutableSequence,
Optional,
Sequence,
Tuple,
Type,
Union,
cast,
)
from google.api_core import client_options as client_options_lib
from google.api_core import exceptions as... | {
"content_hash": "9b234ecf08ed8fb471280caed3e93e9e",
"timestamp": "",
"source": "github",
"line_count": 565,
"max_line_length": 120,
"avg_line_length": 39.87433628318584,
"alnum_prop": 0.6207110834923876,
"repo_name": "googleapis/python-apigee-connect",
"id": "217c0405870fa508ba09ccdba710d91cfd80afa7... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['deprecated'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: cs_nic
short_description: Manages NICs and secondary IPs of an instance on Apache CloudStack based clouds.
description:
- Add and remove sec... | {
"content_hash": "a9780dc8cb81613f401d4294f3e6f4fa",
"timestamp": "",
"source": "github",
"line_count": 279,
"max_line_length": 131,
"avg_line_length": 28.42293906810036,
"alnum_prop": 0.6021437578814628,
"repo_name": "e-gob/plataforma-kioscos-autoatencion",
"id": "d5ce700df2c1c99185a911ac029050a1708... |
import os
import pandas as pd
from pathlib import Path
def pwd():
return Path.cwd()
def ls(path='.', ls=False):
""" returns files in current directory"""
if ls:
return os.listdir()
else:
return pd.Series(os.listdir(Path.cwd() / path))
def cd(path, full_path=False):
"""full path""... | {
"content_hash": "025b5f85dbf73b749a1b273eb6dc8801",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 73,
"avg_line_length": 25.555555555555557,
"alnum_prop": 0.6159420289855072,
"repo_name": "Duke-LeTran/practice-and-notes",
"id": "0f29321b063879258b222df0854ef8788c61339b",
... |
import datetime
from blist import sortedlist
from elasticsearch.client import Elasticsearch
from util import dt_to_ts
from util import EAException
from util import elastalert_logger
from util import format_index
from util import hashable
from util import lookup_es_key
from util import pretty_ts
from util import ts_now... | {
"content_hash": "0952c12df5c4fc1f16a4381f7d1ee53c",
"timestamp": "",
"source": "github",
"line_count": 640,
"max_line_length": 161,
"avg_line_length": 43.109375,
"alnum_prop": 0.5789054005074302,
"repo_name": "iamrudra/elastalert",
"id": "c09c38aed50667b7743e7164e39933ddeb192fc2",
"size": "27614",... |
from __future__ import unicode_literals
# 3rd Party
from model_utils.managers import PassThroughManager
class SendableManager(PassThroughManager):
pass
| {
"content_hash": "aafcbe93ea0b14f2cb6bf67da11228ab",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 51,
"avg_line_length": 19.875,
"alnum_prop": 0.7987421383647799,
"repo_name": "craiglabenz/django-grapevine",
"id": "9f137934f987a9dbb92e4e840adbfa3957d97fe1",
"size": "159"... |
class InlineClass(object):
def __init__(self, dict):
self.__dict__ = dict
| {
"content_hash": "0e962d7b37751aa3764c02af0568ea05",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 29,
"avg_line_length": 28.666666666666668,
"alnum_prop": 0.5697674418604651,
"repo_name": "ingrammicro/fallball-connector",
"id": "04de875708dde6ef1f13b0c0c3805ac980c105b2",
... |
import warnings
from typing import Callable, Dict, Optional, Sequence, Tuple
from google.api_core import grpc_helpers
from google.api_core import gapic_v1
import google.auth # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # ty... | {
"content_hash": "26370de0f82213b196c39eaf83106f23",
"timestamp": "",
"source": "github",
"line_count": 409,
"max_line_length": 99,
"avg_line_length": 44.775061124694375,
"alnum_prop": 0.6107137006498116,
"repo_name": "googleads/google-ads-python",
"id": "a115263ec5f46c53b93cb89f8c05e21b7896cdff",
... |
"""Tests for tensorflow.python.client.session.Session."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import random
import os
import sys
import threading
import time
import warnings
import numpy as np
import six
from six.moves import ... | {
"content_hash": "fa69f144988525793ee6b8da5e264bd4",
"timestamp": "",
"source": "github",
"line_count": 2030,
"max_line_length": 92,
"avg_line_length": 39.21527093596059,
"alnum_prop": 0.6252716469657191,
"repo_name": "jendap/tensorflow",
"id": "da6218663de8b02fcda3f3e67e68bb46e47e914a",
"size": "8... |
"""
Emoji Example
===============
A simple example that shows how to include emoji. Note that this example does not seem to work on OS X, but does
work correctly in Ubuntu.
There are 3 important steps to follow to include emoji:
1) Read the text input with io.open instead of the built in open. This ensures that it i... | {
"content_hash": "40b3fac2da420dee473a53baa7e3db89",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 113,
"avg_line_length": 45.520833333333336,
"alnum_prop": 0.7263157894736842,
"repo_name": "amueller/word_cloud",
"id": "ab949cabd72d8adf6d32166f8af7fb56da9d9756",
"size": ... |
import requests
import sys
def main(args):
newStr = args[1] + "-" + args[2];
host = "https://www.birchbox.com/shop/birchbox-1/{d}/{d}-bb"
host = host.replace("{d}", newStr);
for x in range(1,71):
response = requests.head(host + str(x))
if response.status_code != 404:
... | {
"content_hash": "3c5b53d08e062bfaa3648b3437a1b69f",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 104,
"avg_line_length": 30.555555555555557,
"alnum_prop": 0.5581818181818182,
"repo_name": "ThePolymath/PublicUtils",
"id": "7431ee84e3aa8d42b1943d16aced535944b750f3",
"siz... |
from __future__ import unicode_literals
import conference.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('conference', '0012_add_vototalk_timestamps'),
]
operations = [
migrations.AddField(
model_name='stripepayment',... | {
"content_hash": "27ad654cc4a3238e6b78fa2811f8647f",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 62,
"avg_line_length": 22.68421052631579,
"alnum_prop": 0.6241299303944315,
"repo_name": "EuroPython/epcon",
"id": "4c1099b4df00cc583458a728ae74445ac0a1a367",
"size": "505"... |
import numpy as np
import scipy.ndimage
#from scipy.signal import convolve2d
#from scipy.signal import fftconvolve
#from numpy.fft import rfftn
#from numpy.fft import irfftn
import mahotas
import time
import h5py
def _centered(arr, newsize):
# Return the center newsize portion of the array.
newsize = np.asarra... | {
"content_hash": "5acb763738850ee1e898a5855a4da6ea",
"timestamp": "",
"source": "github",
"line_count": 259,
"max_line_length": 148,
"avg_line_length": 37.87258687258687,
"alnum_prop": 0.5713120603527373,
"repo_name": "Rhoana/membrane_cnn",
"id": "22149eb7a2da9e5f5737f85c4738fd723cdc7766",
"size": ... |
from supplychainpy.inventory.units import SKU, Package
class Pallet:
def __init__(self):
self.length = None
self.width = None
self.height = None
self.weight = None
self.package = []
def recalculate_weight(self):
pass
def recalculate_height(self):
p... | {
"content_hash": "d16f1a0f717741262bc88692e8f69501",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 90,
"avg_line_length": 27.224137931034484,
"alnum_prop": 0.642811906269791,
"repo_name": "KevinFasusi/supplychainpy",
"id": "761164ec16568a2435151d8a82cfe78ac7e00dca",
"siz... |
import argparse
import os
import subprocess
import pandas as pd
import mummer_two_bins
def get_all_bin_paths():
bin_info = pd.read_csv('./support_files/available_bins.csv')
return bin_info['bin path']
def query_bin_file_to_list(filepath):
print('load paths at {}'.format(filepath))
with open(file... | {
"content_hash": "c59e7778ff70f1a8401acf4e6fef51a1",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 77,
"avg_line_length": 32.8,
"alnum_prop": 0.5810975609756097,
"repo_name": "JanetMatsen/meta4_bins_janalysis",
"id": "188bf1c97824a5a68ddabe9c4c609e9e0432ecd2",
"size": "... |
from lxml.builder import E
# module packages
from jnpr.junos.cfg import Resource
from jnpr.junos import jxml as JXML
from jnpr.junos.cfg.user_ssh_key import UserSSHKey
class User(Resource):
"""
[edit system login user <name>]
Resource name: str
<name> is the user login name
Manages resources... | {
"content_hash": "3153529494a836ba9b8ff4d72b9a9886",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 87,
"avg_line_length": 31.119565217391305,
"alnum_prop": 0.4841075794621027,
"repo_name": "Juniper/py-junos-eznc",
"id": "549b92ebf683a8771f116dfffe2e4ceade0e1053",
"size":... |
from . import scalar
from .exception import ProphyError
from .base_array import base_array
def optional(cls):
if issubclass(cls, bytes):
raise ProphyError("optional bytes not implemented")
if issubclass(cls, base_array):
raise ProphyError("optional array not implemented")
if cls._DYNAMIC:
... | {
"content_hash": "9fafd53b80619b1cad7798e87c3e9d4a",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 78,
"avg_line_length": 33.75,
"alnum_prop": 0.7022222222222222,
"repo_name": "cislaa/prophy",
"id": "37154c34554dff38515b6823b5a113e964321f09",
"size": "675",
"binary": f... |
from __future__ import print_function, division
import xml.etree.ElementTree as ET
import glob
import sys
import re
import os
import os.path
import argparse
import subprocess
import shutil
desc= """run tests"""
def warn(*objs):
print(*objs, file=sys.stderr)
dirRe = re.compile("\$dir")
outdirRe = re.compile("\$ou... | {
"content_hash": "e8e20de4d937d3deb66ce57eec4d01a7",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 80,
"avg_line_length": 34.22981366459627,
"alnum_prop": 0.5200508074759572,
"repo_name": "chemalot/chemalot",
"id": "9f990647b27853829bd8195763855ee2fe419fcf",
"size": "55... |
""" @package antlr3
@brief ANTLR3 runtime package
This module contains all support classes, which are needed to use recognizers
generated by ANTLR3.
@mainpage
\note Please be warned that the line numbers in the API documentation do not
match the real locations in the source code of the package. This is an
unintended... | {
"content_hash": "a1409a1deb0b6df63a124e515315624c",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 79,
"avg_line_length": 33.473684210526315,
"alnum_prop": 0.769916142557652,
"repo_name": "ateska/pyless",
"id": "da56d922de7850066bf4df8805d5864cd1b55758",
"size": "5724",... |
from __future__ import print_function
import os
import sys
import traceback
from bloom.logging import debug
from bloom.logging import error
from bloom.logging import fmt
from bloom.logging import info
try:
from catkin_pkg.packages import find_packages
except ImportError:
debug(traceback.format_exc())
err... | {
"content_hash": "f49b186ec261ea6f95ff7228257c2660",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 91,
"avg_line_length": 30.975609756097562,
"alnum_prop": 0.6359580052493439,
"repo_name": "wjwwood/bloom_homebrew",
"id": "378c74a50fadcaaeee7688ec2ce6e1492c5de47e",
"size... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .message import *
from .message_parser import *
from .message_serializer import *
from .ping_message import *
from .ping_message_parser import *
from .ping_message_serializer import *
from .pong_message ... | {
"content_hash": "7e0b707d533aaebed6e8fcb56e4a4b81",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 38,
"avg_line_length": 23.57894736842105,
"alnum_prop": 0.7589285714285714,
"repo_name": "foxdog-studios/pyddp",
"id": "2a341f6713e3906b88da8db86acc6edaf905eaf9",
"size": "... |
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.8.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import sys
import os
import re
# python... | {
"content_hash": "463e14895e436be333fd80f806b42e04",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 119,
"avg_line_length": 34.69672131147541,
"alnum_prop": 0.5379163713678242,
"repo_name": "mbohlool/client-python",
"id": "a49258c74cca71ce54d2e9cbaf280456da32fbe7",
"size... |
this_version = '0.2.5'
stable_version = '0.2.5'
readme = '''-----------------------------
dill: serialize all of python
-----------------------------
About Dill
==========
Dill extends python's 'pickle' module for serializing and de-serializing
python objects to the majority of the built-in python types. Serializatio... | {
"content_hash": "0f49261d4bb997c8b468f3de2e3c4934",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 86,
"avg_line_length": 35.66350710900474,
"alnum_prop": 0.7464451827242525,
"repo_name": "jlcarmic/producthunt_simulator",
"id": "e3304f82dbd466e6d7dae61a03acd2c1d8682b81",
... |
from .util import DummyDict
from .util import tprint
import deepdish as dd
import numpy as np
# CAFFE WEIGHTS: O x I x H x W
# TFLOW WEIGHTS: H x W x I x O
def to_caffe(tfW, name=None, shape=None, color_layer='', conv_fc_transitionals=None, info=DummyDict()):
assert conv_fc_transitionals is None or name is not No... | {
"content_hash": "3ab3f52d0cd752cb2d975fec29bbccff",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 112,
"avg_line_length": 37.544973544973544,
"alnum_prop": 0.5022547914317925,
"repo_name": "gustavla/self-supervision",
"id": "6de438d9a6150c8592a64f95df5b14db5bf0ab59",
"... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from collections import namedtuple
from textwrap import dedent
from pants.backend.jvm.tasks.jvm_compile.zinc.zinc_compile import ZincCompile
from pants.base... | {
"content_hash": "60d55140ffba5b4a2be3620fa0aaf64a",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 100,
"avg_line_length": 41.48936170212766,
"alnum_prop": 0.6095726495726496,
"repo_name": "dturner-tw/pants",
"id": "58d0d41a434df8fd001963606a50578cca4f4b05",
"size": "59... |
import re
import subprocess
def test_create_product():
output = str(
subprocess.check_output("python import_user_events_inline.py", shell=True)
)
assert re.match(
'.*import user events from inline source request.*?parent: "projects/.*?/locations/global/catalogs/default_catalog.*',
... | {
"content_hash": "363476d62349598da3ce95f9ab1fa6df",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 127,
"avg_line_length": 36.708333333333336,
"alnum_prop": 0.6606129398410897,
"repo_name": "googleapis/python-retail",
"id": "79546b4038a0189a4b01d776e87766c44acc4791",
"si... |
from django.conf.urls import url
from . import views, models
from Grundgeruest.views import ListeMitMenue
app_name = 'Veranstaltungen'
urlpatterns = [
url(r'^$',
ListeMitMenue.as_view(
template_name='Bibliothek/liste_alle.html',
model=models.Buch,
context_... | {
"content_hash": "240f7fca1e509f297b9216f64363ed2e",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 84,
"avg_line_length": 29.36842105263158,
"alnum_prop": 0.6021505376344086,
"repo_name": "wmles/scholarium",
"id": "67e1400e5b84eb0b4d14846e8b99f1f9817654b6",
"size": "558"... |
import unittest
import mock
import tempfile
from test import safe_repr
from test.unit import MockTrue
from swift.common.swob import HTTPBadRequest, Request, HTTPException
from swift.common.http import HTTP_REQUEST_ENTITY_TOO_LARGE, \
HTTP_BAD_REQUEST, HTTP_LENGTH_REQUIRED
from swift.common import constraints
cl... | {
"content_hash": "8a387c9892173a1f8c9fcd08e214634e",
"timestamp": "",
"source": "github",
"line_count": 315,
"max_line_length": 79,
"avg_line_length": 46.30793650793651,
"alnum_prop": 0.581408103105505,
"repo_name": "NeCTAR-RC/swift",
"id": "9abf153db6a4b38220fe9760fdf31141b8d6ed2d",
"size": "15182... |
import sys
import 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('.'))
sys.path.insert(0,... | {
"content_hash": "5d2d7487de1f71ecd4847aab6a5faa5f",
"timestamp": "",
"source": "github",
"line_count": 257,
"max_line_length": 79,
"avg_line_length": 31.486381322957197,
"alnum_prop": 0.7040286702916461,
"repo_name": "rnelsonchem/gcmstools",
"id": "3f96e9815625b53b85aef7345812ae36c5e9824b",
"size"... |
"""SPC Outlook JSON service."""
import datetime
import json
from pymemcache.client import Client
import pytz
import pandas as pd
from pandas.io.sql import read_sql
from paste.request import parse_formvars
from pyiem.nws.products.spcpts import THRESHOLD_ORDER
from pyiem.util import get_dbconn, get_sqlalchemy_conn, html... | {
"content_hash": "2b5c2a15cb27f380204729d4ecfa8848",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 77,
"avg_line_length": 33.292397660818715,
"alnum_prop": 0.5678903917091165,
"repo_name": "akrherz/iem",
"id": "5b561a3f1a0563e5968c9209b25906532d945fde",
"size": "5693",
... |
from ics_demo.dao.interfaces import base
from ics_demo.dao.orm.demo import Carrot
from ics_demo.helpers import uuidgen
def get_all():
return base.class_get_all_to_dict(Carrot)
def get_one(uuid):
return base.class_get_one_by_uuid_to_dict(Carrot, uuid)
def get_obj(uuid):
return base.class_get_one_by_uuid_... | {
"content_hash": "1109a6daa3bbc1fa1d354a0df56d9aef",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 59,
"avg_line_length": 25.833333333333332,
"alnum_prop": 0.7032258064516129,
"repo_name": "lielongxingkong/ics_demo",
"id": "1db4747531680bc6dafe8feaca0ac9d5ddf6e24a",
"siz... |
from collections import defaultdict
from prettytable import PrettyTable
import FirstYear
import Range
import URL
import MySQLdb
Details=defaultdict(lambda:defaultdict(lambda:'-'))
Branch_Switchers=defaultdict(lambda:defaultdict(lambda:'-'))
inputdata=open('InputFile.txt','r')
t=int(inputdata.readline().s... | {
"content_hash": "8ba0f81e43d80dde2fa8b0d2542d6868",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 206,
"avg_line_length": 41.40251572327044,
"alnum_prop": 0.5726872246696035,
"repo_name": "atulac/KNIT-Training-And-Placement-Cell-Automation",
"id": "a0e9c3cc27ad42221c8eb5... |
from marshmallow_jsonapi import Schema, fields
from marshmallow import validate
from app.basemodels import db, CRUD_MixIn
from datetime import datetime
class Users(db.Model, CRUD_MixIn):
id = db.Column(db.Integer, primary_key=True)
email = db.Column(db.String(250), nullable=False,unique=True)
password =... | {
"content_hash": "e8dfb5582174f783bca2ba75bd3d67e3",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 81,
"avg_line_length": 33.61538461538461,
"alnum_prop": 0.6710526315789473,
"repo_name": "Leo-g/Flask-Scaffold",
"id": "42b80f93aa36d6ae2f838158ea1728492dd33122",
"size": "... |
from __future__ import division, absolute_import, print_function
from numpy.distutils.fcompiler import FCompiler
compilers = ['HPUXFCompiler']
class HPUXFCompiler(FCompiler):
compiler_type = 'hpux'
description = 'HP Fortran 90 Compiler'
version_pattern = r'HP F90 (?P<version>[^\s*,]*)'
executables ... | {
"content_hash": "f30fd0e21e49281841d3a5b2c0aeb973",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 64,
"avg_line_length": 27.358490566037737,
"alnum_prop": 0.5875862068965517,
"repo_name": "DailyActie/Surrogate-Model",
"id": "32ffa8e662bcf790413a1884d29ad8f07ea4c745",
"s... |
import profile
class d_profile(profile):
def __init__(self):
# super(profile.__init__(self))
self.name = "default"
def get(self):
# self.name = "default"
return self | {
"content_hash": "8394e9141e9edf1f09c8c99a7ce26cd7",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 39,
"avg_line_length": 20.7,
"alnum_prop": 0.5507246376811594,
"repo_name": "Ganben/parrot",
"id": "2c0c846a83c2513a19555e23884b067a5e61ccc6",
"size": "236",
"binary": fa... |
from __future__ import print_function # (at top of module)
import time
import sys
import os
import pandas as pd
import numpy as np
import pickle
PROJ_ROOT = os.path.join(os.getcwd(), os.pardir, os.pardir)
pd.set_option('display.max_columns', 500)
pd.set_option('display.width', 1000)
pd.options.display.float_format ... | {
"content_hash": "c6303faddd07e33027383fbb4b92998d",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 94,
"avg_line_length": 30.48780487804878,
"alnum_prop": 0.66,
"repo_name": "tomsyouruncle/DJ_suggest",
"id": "20a228596ed07e930cbaef7c835ff8c545552e2a",
"size": "2518",
"... |
"""This module provides the default commands for beets' command-line
interface.
"""
from __future__ import (division, absolute_import, print_function,
unicode_literals)
import os
import re
from collections import namedtuple, Counter
from itertools import chain
import beets
from beets import u... | {
"content_hash": "1333a13702a0703b7be78c5fe878dda3",
"timestamp": "",
"source": "github",
"line_count": 1709,
"max_line_length": 79,
"avg_line_length": 34.153306026916326,
"alnum_prop": 0.5760176809210527,
"repo_name": "parapente/beets",
"id": "c6846e92f4ad685fe0249f4e4f6f4f3f751d2eba",
"size": "59... |
import random
from typing import List
from parlai.core.message import Message
from parlai.core.mutators import ManyEpisodeMutator, register_mutator
@register_mutator("flatten")
class FlattenMutator(ManyEpisodeMutator):
"""
Flattens the entire conversation history.
Simply concatenates all turns in the con... | {
"content_hash": "a5e8ad8a56f547fb80ffa2abfe4251fe",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 87,
"avg_line_length": 33.40909090909091,
"alnum_prop": 0.689795918367347,
"repo_name": "facebookresearch/ParlAI",
"id": "741825c735e8c21ff14baa4c0439741d9af4ac7c",
"size":... |
from .ips120 import Ips120
from .itc503 import Itc503
from .mercuryips import MercuryIps
from .triton200 import Triton200
| {
"content_hash": "4f428901cd6f4d2b20af3019dc4dba7c",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 34,
"avg_line_length": 30.5,
"alnum_prop": 0.8360655737704918,
"repo_name": "masonlab/labdrivers",
"id": "d4998372ea2f407921f15f77745ddab290d3e3cb",
"size": "122",
"binary... |
""" file: rotation.py
author: Jess Robertson
CSIRO Mineral Resources Flagship
date: Wednesday April 01, 2015
description: rotation functions
"""
import numpy
import scipy.sparse
def rotation_matrix(angles_list=None, angles_array=None):
""" Returns a rotation matrix in n dimensions
... | {
"content_hash": "fa599426ea83501d94e9daded73a8b75",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 79,
"avg_line_length": 37.63793103448276,
"alnum_prop": 0.6003206596426935,
"repo_name": "jesserobertson/pymaxion",
"id": "0e6522e6816b4f9bcc57fd3fe3d9915801c9215f",
"size... |
"""Shows the crash in the faucet log produced by given input"""
import logging
import os
import sys
from faucet import faucet
from ryu.controller import dpset
from faucet import faucet_experimental_api
import Fake
def main():
# go through all files in directory
# read file and store in string
with open(sy... | {
"content_hash": "a18dfb18224e851235b51563d349b504",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 125,
"avg_line_length": 28.479166666666668,
"alnum_prop": 0.662033650329188,
"repo_name": "wackerly/faucet",
"id": "1a3b0364b77c3415bf6f9be676f40ca8ea091de4",
"size": "1391... |
from __future__ import unicode_literals
import random
import string
from datetime import timedelta
from django.utils import timezone
from django import forms
from django.utils.translation import ugettext as _
from django.utils.safestring import mark_safe
from django.forms.util import flatatt
try:
from django.util... | {
"content_hash": "289474e8be150c7c2abf34a00ee41b91",
"timestamp": "",
"source": "github",
"line_count": 473,
"max_line_length": 229,
"avg_line_length": 46.23467230443975,
"alnum_prop": 0.5893730851890804,
"repo_name": "powellc/hacklabs-wiki",
"id": "9839e5bf061229962c475b1f394dc3edce3f51a5",
"size"... |
from google.appengine.api import memcache
from webapp2_extras.security import generate_random_string
import jinja2
import json
import os
import webapp2
MEMCACHE_EXPIRE = 24 * 60 * 60 # seconds
JINJA_ENVIRONMENT = jinja2.Environment(
loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
)
class MainPage(web... | {
"content_hash": "141c02a86c3e0bfc9ab32a7fd3d5bf36",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 97,
"avg_line_length": 32.96666666666667,
"alnum_prop": 0.6359959555106168,
"repo_name": "seguri/json-beautifier",
"id": "d15b39dd6150f0654858c0ba21aef007c3a22e3f",
"size":... |
import requests, time, re
from lxml import html
import logging, os, platform, sys
import xml.dom.minidom, xml.sax.saxutils
#ENVIRONMENTAL INFORMATION
__author__ = "[email protected] (George Starcher)"
_MI_APP_NAME = 'TA-laundryview'
_SPLUNK_HOME = os.getenv("SPLUNK_HOME")
if _SPLUNK_HOME == None:
_SPLUNK_H... | {
"content_hash": "47931975236114c454f84acf92cebdc0",
"timestamp": "",
"source": "github",
"line_count": 178,
"max_line_length": 250,
"avg_line_length": 35.87640449438202,
"alnum_prop": 0.633103664265581,
"repo_name": "georgestarcher/TA-laundryview",
"id": "504c63b93e3dd88447ad95b9156e14eb8ad72f83",
... |
class SDoc(object):
pass
class SLine(SDoc):
__slots__ = ('indent', )
def __init__(self, indent):
assert isinstance(indent, int)
self.indent = indent
def __repr__(self):
return f'SLine({repr(self.indent)})'
class SAnnotationPush(SDoc):
__slots__ = ('value', )
def __... | {
"content_hash": "55ed1b35b04fa78fe57e9a55d9c96857",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 53,
"avg_line_length": 19.484848484848484,
"alnum_prop": 0.5567651632970451,
"repo_name": "tommikaikkonen/peprint",
"id": "75c4fb8036bdd2d043b7b1ef13fe3a5689646106",
"size"... |
import re
import hashlib
import uuid
from decimal import Decimal
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.conf import settings as django_settings
from django.utils.datastructures import SortedDict
from django.core.exceptions import ImproperlyConfigured
from form... | {
"content_hash": "0a5bd14a81739bbccc6d5154476707c8",
"timestamp": "",
"source": "github",
"line_count": 379,
"max_line_length": 377,
"avg_line_length": 46.32981530343008,
"alnum_prop": 0.6314140896406402,
"repo_name": "housleyjk/django-form-designer",
"id": "724c2a2db32c12a78348526c25d96c65c259c777",... |
import os
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import datetime
print ("Packages loaded")
# Load them!
cwd = os.getcwd()
loadpath = cwd + "/custom_data_signs.npz"
l = np.load(loadpath)
# See what's in here
print (l.files)
# Parse data
trainimg = l['trainimg']
trainlabel = l['trai... | {
"content_hash": "c1fee3df5b3691281073fb540d9b0213",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 97,
"avg_line_length": 29.993243243243242,
"alnum_prop": 0.6010362694300518,
"repo_name": "stefanbo92/maleChildren",
"id": "5c633c0845def009824c21e99aacd8c795ec04a7",
"siz... |
import collections
class defaultdict_noinsert(collections.defaultdict):
def __missing__(self, key):
if self.default_factory is None:
raise KeyError((key,))
return self.default_factory()
| {
"content_hash": "482436438fbdc89aef87db512ca56114",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 52,
"avg_line_length": 27.5,
"alnum_prop": 0.6636363636363637,
"repo_name": "bigblindbais/pytk",
"id": "4b444a14d93651ef8a294471625f0e30e9651bc8",
"size": "220",
"binary":... |
__author__ = 'huanpc'
import constant
import argparse
from random import randint
# Duong dan toi thu muc output file dataseed
DIR_OUTPUT_PATH = './output'
# Chon gia tri cho id trong bang customer
customer_id_begin = 5
product_id_begin = 0
# So ban ghi can tao
num_of_row = 100
#def createProductData():
def createCus... | {
"content_hash": "74ee44b1ace7ec3f6757c031ed77dd62",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 185,
"avg_line_length": 40.869565217391305,
"alnum_prop": 0.6420212765957447,
"repo_name": "huanpc/lab_cloud_computing",
"id": "30ef5d15a62b0f308f6865d41a8dfe7d47c74e38",
"... |
import os.path as osp
from grasp_fusion_lib.contrib import grasp_fusion
import train_common
here = osp.dirname(osp.abspath(__file__))
def main():
parser = train_common.get_parser()
parser.add_argument(
'--exclude-arc2017',
action='store_true',
help='Exclude ARC2017 objects from syn... | {
"content_hash": "15248165b96bb64cb7b2ff4006a29fb6",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 67,
"avg_line_length": 23.732142857142858,
"alnum_prop": 0.5989465763732129,
"repo_name": "pazeshun/jsk_apc",
"id": "b63e20b5ad4bd69b846e06ff47db7ab288b96092",
"size": "135... |
from google.cloud import tpu_v1
async def sample_reimage_node():
# Create a client
client = tpu_v1.TpuAsyncClient()
# Initialize request argument(s)
request = tpu_v1.ReimageNodeRequest(
)
# Make the request
operation = client.reimage_node(request=request)
print("Waiting for operatio... | {
"content_hash": "e698cba0ad0d6aedd56b8c31c3d30c27",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 52,
"avg_line_length": 21.59090909090909,
"alnum_prop": 0.6884210526315789,
"repo_name": "googleapis/python-tpu",
"id": "a19f27082ff0be1e6c14c34b6d9b1c61b02a418a",
"size": ... |
import hashlib
import json
import logging
import optparse
import os
import re
import sys
import unittest
import urllib2
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
import local_gae
class TestCase(unittest.TestCase):
def setUp(self):
super(TestCase, self).setUp()
# Restart the server on each test... | {
"content_hash": "ec67cfeecd8e142e961efe4dd44edba0",
"timestamp": "",
"source": "github",
"line_count": 343,
"max_line_length": 80,
"avg_line_length": 34.15743440233236,
"alnum_prop": 0.6341754865141687,
"repo_name": "nicko96/Chrome-Infra",
"id": "d601aff895103e4afb13ff5de8e42fd1613f0117",
"size": ... |
from guardian.shortcuts import remove_perm
from core.tests.base import LoggedTestCase
from core.tests.fixtures import ServerRoleFactory, DepartmentFactory, EnvironmentFactory
from .fixtures import *
class TaskTest(LoggedTestCase):
def setUp(self):
super(TaskTest, self).setUp()
self.application = A... | {
"content_hash": "d5d20651520266cf592a185a282195de",
"timestamp": "",
"source": "github",
"line_count": 147,
"max_line_length": 104,
"avg_line_length": 49.91156462585034,
"alnum_prop": 0.6731634182908546,
"repo_name": "senkal/gunnery",
"id": "d55d44b364584a1fd2b17a48aa5443e9b1407464",
"size": "7337... |
from distantbes.proto.proto import build_event_stream_pb2 as bes
from distantbes.utils import dict_to_workspace_status, get_current_timestamp
from distantbes.enums import CPU, CompilationMode, EXIT_CODES
from platform import node
def file_message(name, contents):
file_msg = bes.File()
file_msg.name = name
... | {
"content_hash": "b699962549415eae4f4cd403e5c74abc",
"timestamp": "",
"source": "github",
"line_count": 176,
"max_line_length": 84,
"avg_line_length": 30.75,
"alnum_prop": 0.6951219512195121,
"repo_name": "antmicro/distant-bes",
"id": "ec687ebff0ec19b97e1a384d668fcaa4dcf7ac74",
"size": "5412",
"b... |
def prime_or_not():
x = int(input("Enter a number: ")) # input a number
y = x-(x-2) # subtract because we know that the number is divisible by itself and one
while(y < x): # initiate while loop, since the numder is divisible by itself,skip it
... | {
"content_hash": "96c7000e9a2b6bdb62251212740aa40f",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 116,
"avg_line_length": 46.35,
"alnum_prop": 0.4919093851132686,
"repo_name": "NaveenK11/prime_or_not",
"id": "a5ad80eef0e3eab0188da8a6bb73c3e0d110def4",
"size": "971",
"... |
"""
Display Cores per socket options based on CPU selection
"""
from functools import reduce
def factors(n):
return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(pow(n, 0.5) + 1)) if n % i == 0)))
def get_options_list(field, **kwargs):
cpus = kwargs.get('control_value', None)
if cpus:
... | {
"content_hash": "d7c5a0efe4f4c1863f99ff037d31fd65",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 105,
"avg_line_length": 19.8,
"alnum_prop": 0.6060606060606061,
"repo_name": "CloudBoltSoftware/cloudbolt-forge",
"id": "d1a15a55ba08958a4173e2fece7ce96f4861225c",
"size": ... |
"""r2
This file loads the finished app from r2.config.middleware.
"""
# _strptime is imported with PyImport_ImportModuleNoBlock which can fail
# miserably when multiple threads try to import it simultaneously.
# import this here to get it over with
# see "Non Blocking Module Imports" in:
# http://code.google.com/p/mo... | {
"content_hash": "9bed427d35a618f81ca1ad8fe278887c",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 72,
"avg_line_length": 38.63157894736842,
"alnum_prop": 0.7615803814713896,
"repo_name": "h2oloopan/easymerge",
"id": "0deeaaf9b3bd5e02ee8475f3aab0afb3468ed6cb",
"size": "1... |
def wait_for_enabled(self, timeout=None):
"""
DEPRECATED! Use wait_until_enabled command instead.
"""
self.logger.warning('"wait_for_enabled" command is deprecated, use "wait_until_enabled" instead!')
self.wait_until_enabled(timeout=timeout)
return self
| {
"content_hash": "6a6efe54d506e36d36615fa0c2e151f7",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 102,
"avg_line_length": 34.875,
"alnum_prop": 0.6989247311827957,
"repo_name": "lukas-linhart/pageobject",
"id": "a94956d2dadee4ae7d38adc01c72cf7afe4082cf",
"size": "279",
... |
from .aws import Action as BaseAction
from .aws import BaseARN
service_name = "Apache Kafka APIs for Amazon MSK clusters"
prefix = "kafka-cluster"
class Action(BaseAction):
def __init__(self, action: str = None) -> None:
super().__init__(prefix, action)
class ARN(BaseARN):
def __init__(self, resour... | {
"content_hash": "bad9c24961294cee498462099814ac21",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 88,
"avg_line_length": 37.10526315789474,
"alnum_prop": 0.7595744680851064,
"repo_name": "cloudtools/awacs",
"id": "79d6a36c87edc1dd6186e46bd987e360742836af",
"size": "1526... |
"""The Coolmaster integration."""
import logging
from pycoolmasternet_async import CoolMasterNet
from homeassistant.components.climate import SCAN_INTERVAL
from homeassistant.const import CONF_HOST, CONF_PORT
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers.update_coordinator import... | {
"content_hash": "76a010f1ef9ca1e4580bf2f47ffe9dd4",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 88,
"avg_line_length": 31.970588235294116,
"alnum_prop": 0.6895124195032198,
"repo_name": "kennedyshead/home-assistant",
"id": "e6cf6f362777a188455f8649342243d509c426ee",
"... |
from __future__ import print_function
import time
import numpy as np
import os
import keras
from keras.datasets import cifar10
from keras import backend as K
import tensorflow as tf
from tensorflow.python.saved_model import loader
from tensorflow.python.saved_model import tag_constants, signature_constants
np.rand... | {
"content_hash": "6990b409cd2697ce150414dad235fd22",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 79,
"avg_line_length": 33.43801652892562,
"alnum_prop": 0.6638655462184874,
"repo_name": "eth-n/keras-in-tf",
"id": "3e184b123668922ebcac85a50e45aa1de072a84d",
"size": "40... |
from django.apps import AppConfig
class MotorsportConfig(AppConfig):
name = 'motorsport'
| {
"content_hash": "19d46e4910870563da3e63b9235d1534",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 34,
"avg_line_length": 19,
"alnum_prop": 0.7684210526315789,
"repo_name": "SphinxNZ/game-on",
"id": "8f5701a0faa2951de2ee93ba07e64c2eac4f9afe",
"size": "95",
"binary": fal... |
"""
Description : Simple Python implementation of the Apriori Algorithm
Usage:
$python apriori.py -f DATASET.csv -s minSupport -c minConfidence
$python apriori.py -f DATASET.csv -s 0.15 -c 0.6
"""
import sys
from itertools import chain, combinations
from collections import defaultdict
from optparse imp... | {
"content_hash": "dbed55b7fda8de10cb7a6f875843c5e8",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 103,
"avg_line_length": 30.924324324324324,
"alnum_prop": 0.6198217094913476,
"repo_name": "asaini/Apriori",
"id": "ff77470b349d27dc465e2efd35820b438cad5a43",
"size": "572... |
import os
from distutils.core import setup
import platform
from datetime import datetime
import py2exe
# Leave out any package not strictly necessary.
# TODO: There are almost certainly some more that can be removed.
# Definitely leave in the _ssl module, because CherryPy relies on
# it even though we're no... | {
"content_hash": "092b270d924232d260806c9f539f54b2",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 80,
"avg_line_length": 32.104166666666664,
"alnum_prop": 0.6164828033744322,
"repo_name": "tgross/gilamon",
"id": "11290cac5c10e152702174fa9259c94c6fdced3e",
"size": "3082"... |
from django import forms
from django.contrib import auth
from models import UserInfo, RoleList, PermissionList
from django.contrib.auth.forms import ReadOnlyPasswordHashField, PasswordResetForm
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
class LoginUserForm(forms.Form):
email = forms.CharFiel... | {
"content_hash": "9a919ee36ed21aa92d7423d7d0481839",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 119,
"avg_line_length": 40.16541353383459,
"alnum_prop": 0.6233620366903782,
"repo_name": "JiaLei123/Tuna",
"id": "845db10c13a5e7e95377955dcb1447053a2bcbe4",
"size": "5390... |
from __future__ import absolute_import
from math import log, ceil
import myhdl
from myhdl import (Signal, ResetSignal, intbv, modbv, concat,
always_comb, always_seq,)
from rhea.system import FIFOBus
from .fifo_mem import fifo_mem
from .fifo_syncers import sync_reset, sync_mbits
@myhdl.block
def ... | {
"content_hash": "dca4dc56682601623c6d916a8d1c6bb9",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 76,
"avg_line_length": 34.838235294117645,
"alnum_prop": 0.6076403545799915,
"repo_name": "NickShaffner/rhea",
"id": "93c7c0b7beb1728c67ec7d4ec8ccb86c1753c5bc",
"size": "4... |
import wx
from cairis.core.armid import *
from ComponentViewPanel import ComponentViewPanel
from cairis.core.ComponentViewParameters import ComponentViewParameters
import DialogClassParameters
__author__ = 'Shamal Faily'
class ComponentViewDialog(wx.Dialog):
def __init__(self,parent,parameters):
wx.Dialog.__ini... | {
"content_hash": "c8247b85e1689034fd651a5ee51b88cc",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 163,
"avg_line_length": 37.13636363636363,
"alnum_prop": 0.7168502651978784,
"repo_name": "nathanbjenx/cairis",
"id": "dbd43e7be733183c21f75c578a1aeb859c8b2bda",
"size": "3... |
__version__ = '1.0.0'
from flask import Flask
app = Flask(__name__)
from app.views import main_views
| {
"content_hash": "4bd59c4fb7ec2aa539e76b22f089b033",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 32,
"avg_line_length": 11.777777777777779,
"alnum_prop": 0.6509433962264151,
"repo_name": "yangwii/graphql_py_client",
"id": "4653cbbe2811a753eaed464f1207948b93c7e402",
"siz... |
import copy
from .. import create_aiexperiment
from .constants import (
DEFAULT_CLASSIFICATION_METRIC,
DEFAULT_EARLY_STOPPING_ROUNDS,
DEFAULT_EVALS_NAME,
DEFAULT_ITERS_PER_DIM,
DEFAULT_NUM_BOOST_ROUND,
DEFAULT_REGRESSION_METRIC,
DEFAULT_SEARCH_PARAMS,
MAX_BO_ITERATIONS,
METRICS_OPTIMIZATION_STRATEGY,... | {
"content_hash": "9bdd1c64b2b8dce237da67dbac8a201b",
"timestamp": "",
"source": "github",
"line_count": 239,
"max_line_length": 119,
"avg_line_length": 41.63598326359833,
"alnum_prop": 0.6721937493719224,
"repo_name": "sigopt/sigopt-python",
"id": "885472abbf179549815836a382da81bba66b5ad5",
"size":... |
import pytest
from rdflib.graph import Graph
from rdflib.namespace import RDFS
from rdflib.term import BNode, Literal
remove_me = (BNode(), RDFS.label, Literal("remove_me"))
@pytest.fixture(scope="function")
def get_store(request):
store = Graph(store="default")
store.open("store")
store.add(remove_me)
... | {
"content_hash": "78a5d8a4a3342820c17384e2cfc7aabd",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 55,
"avg_line_length": 19.13888888888889,
"alnum_prop": 0.6632801161103048,
"repo_name": "RDFLib/rdflib",
"id": "e37530647a00cc3f756b3871939ed767cc7412cf",
"size": "689",
... |
import sys
import pyodbc
import codecs
import re
reload(sys)
sys.setdefaultencoding('utf8')
class FileMakerFmpDoc:
meta = ''
data = []
def __init__(self, meta, data):
self.meta = fmpMeta = FileMakerFmpMeta(meta)
for record in data:
self.data.append(FileMakerFmpRow(record))
def toXml(self):
... | {
"content_hash": "59069700dddb66ac53ff9278c9b83ed4",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 147,
"avg_line_length": 29.02857142857143,
"alnum_prop": 0.6161417322834646,
"repo_name": "Edelweiss/hgv",
"id": "7385a4f435beaebb4eb56c6b4ae872719d104d81",
"size": "2049",... |
"""Unit tests for the bytes and bytearray types.
XXX This is a mess. Common tests should be moved to buffer_tests.py,
which itself ought to be unified with string_tests.py (and the latter
should be modernized).
"""
import os
import re
import sys
import copy
import functools
import pickle
import tempfile
import unitt... | {
"content_hash": "59b63c06d73b04c45682589902b1904e",
"timestamp": "",
"source": "github",
"line_count": 1433,
"max_line_length": 765,
"avg_line_length": 38.65317515701326,
"alnum_prop": 0.5657699945838599,
"repo_name": "OptimusGitEtna/RestSymf",
"id": "43b6c824a8383a33567b734c9434d8895e9d795f",
"si... |
from django.core.management.base import BaseCommand
from django.db.models import Q
from contactbox.models import Message
from datetime import datetime, timedelta
class Command(BaseCommand):
help = "Remind about Contact message"
args = ''
def handle(self, *options, **extras):
yesterday = datetim... | {
"content_hash": "aa4407849218cd30256bf0fba76a96a2",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 114,
"avg_line_length": 31.555555555555557,
"alnum_prop": 0.6496478873239436,
"repo_name": "ArabellaTech/contactBox",
"id": "d42bf44259f964ba13428cd5fd743266a3b32c81",
"siz... |
"""
Implements a Nexus-OS NETCONF over SSHv2 API Client
"""
import re
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import excutils
from oslo_utils import importutils
from neutron.i18n import _LW
from networking_cisco.plugins.ml2.drivers.cisco.nexus import (
config as conf)
fro... | {
"content_hash": "5664798774c067dc647bbd9e6807ff04",
"timestamp": "",
"source": "github",
"line_count": 397,
"max_line_length": 78,
"avg_line_length": 42.82367758186398,
"alnum_prop": 0.5771425210281748,
"repo_name": "hareeshpc/networking-cisco",
"id": "e937ccce1efd9c3747e9c5c797a80462f0df6119",
"s... |
extensions = []
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
# source_encoding = 'utf-8'
# The master toctree document.
master_doc = 'index'
# General information abo... | {
"content_hash": "fe4f0e4fda035ce4c3704aa3aaba93e9",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 86,
"avg_line_length": 32.45294117647059,
"alnum_prop": 0.7107123436650353,
"repo_name": "django-extensions/django-extensions",
"id": "442c1986e18cd861bf932ad765350b5bc1812a... |
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.25
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from kubernete... | {
"content_hash": "a589db44e4e05deeb75e01e0ccebc2c0",
"timestamp": "",
"source": "github",
"line_count": 401,
"max_line_length": 328,
"avg_line_length": 35.52618453865337,
"alnum_prop": 0.6228414993682437,
"repo_name": "kubernetes-client/python",
"id": "8a55ca2011a1cbac8d018380a772397cbf1c331b",
"si... |
from datetime import datetime
from sqlalchemy import desc
from flask_login import UserMixin
from werkzeug.security import check_password_hash, generate_password_hash
from reason import db
from sqlalchemy.util import KeyedTuple
class User(db.Model, UserMixin):
__bind_key__ = 'userDb'
__tablename__ = 'User'
... | {
"content_hash": "c1c262f94635995d27436ebdfca9317b",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 77,
"avg_line_length": 31.708333333333332,
"alnum_prop": 0.6780551905387647,
"repo_name": "pombredanne/reason",
"id": "180a661a4adc1d27301ebebc815e791b9796339f",
"size": "1... |
from daemonx.daemon import Daemon
class Daemon1(Daemon):
def __init__(self, *args, **kwargs):
super(Daemon1, self).__init__(*args, **kwargs)
self.string1 = self.conf['string1']
self.string2 = self.conf['string2']
self.string3 = self.global_conf['common1']['string3']
def run_on... | {
"content_hash": "feb8fd199f80b25ba21873770e12f4d1",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 61,
"avg_line_length": 32.61538461538461,
"alnum_prop": 0.5966981132075472,
"repo_name": "greglange/daemonx",
"id": "dcf32f1dd23e3230d2a9bf89e2bec6061efff367",
"size": "100... |
from flask import make_response, current_app
from ultrajson import dumps
def output_html(data, code=200, headers=None):
if type(data) is dict:
data = dumps(data)
resp = make_response(data, code)
resp.headers.extend(headers or {})
resp.headers['Content-Type'] = 'text/html; charset=utf-8'
ret... | {
"content_hash": "65eb6138de56d922ed7bdf9efda8af80",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 78,
"avg_line_length": 35.166666666666664,
"alnum_prop": 0.6691943127962086,
"repo_name": "openmaraude/APITaxi_utils",
"id": "b69410b64f2d4b2b1f95b1481fc066d569113be0",
"si... |
#!/usr/bin/env python3
# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
from idlnode import *
def render(idl_node, indent_str=' '):
output = []
... | {
"content_hash": "3490ff7433877c7c125a697696831f3b",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 80,
"avg_line_length": 32.5,
"alnum_prop": 0.41971153846153847,
"repo_name": "dart-lang/sdk",
"id": "ba095dd2871b456ec8f45df0ba2ed65efde9a83b",
"size": "6240",
"binary":... |
"""
Provides features to support a Tintri storage array.
Servers in environments that have a Tintri store will have a "Tintri" tab on
their detail view. This tab exposes storage performance metrics as well as some
actions users can take on the server, such as taking a snapshot.
"""
import os
import datetime
import jso... | {
"content_hash": "40a732e324b570740db2c79e7a52a3f4",
"timestamp": "",
"source": "github",
"line_count": 613,
"max_line_length": 112,
"avg_line_length": 32.52691680261012,
"alnum_prop": 0.5907517929685541,
"repo_name": "CloudBoltSoftware/cloudbolt-forge",
"id": "8b65ea8e0cbbb6a8f08488fbfb68e2e54da5804... |
__author__ = "George Chantzialexiou"
__copyright__ = "Copyright 2012-2013, The SAGA Project"
__license__ = "MIT"
""" A Simple Mandelbrot Fractal Generator.
We use this example to explore the distributed capabilites of
the Pilot Job and Filesystem APIs. The mandelbrot module
calculates partial mande... | {
"content_hash": "ca3adc55b002a21c817aa0b8a5547145",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 80,
"avg_line_length": 29.1010101010101,
"alnum_prop": 0.556056924678931,
"repo_name": "georgeha/mandelbrot",
"id": "d4fd957b331e2e23bcba4a1acb7f1785c4fc49f5",
"size": "288... |
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.orm import relationship
from base import Base
class Address(Base):
__tablename__ = 'addresses'
id = Column(Integer, primary_key=True)
email_address = Column(String, nullable=False)
user_id = Column(Integer, ForeignKey('users.id'... | {
"content_hash": "1167413bbf0b099d62d034c33a7a2db9",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 59,
"avg_line_length": 30.625,
"alnum_prop": 0.6632653061224489,
"repo_name": "b-ritter/python-notes",
"id": "fb6fac1dec130b12a43f46b7edb85a1edb355c05",
"size": "490",
"b... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Comment'
db.create_table('comments_comment', (
('id', self.gf('django.db.models.fields.AutoField... | {
"content_hash": "5b090532c31c691ba17f396e83a21565",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 182,
"avg_line_length": 69.54545454545455,
"alnum_prop": 0.549281045751634,
"repo_name": "linkfloyd/linkfloyd",
"id": "c43a4d8b486ec725d599e45e5af0a80d7925fa9a",
"size": "... |
from typing import Optional, TypedDict
from backend.common.sitevars.sitevar import Sitevar
class ContentType(TypedDict):
api_key: str
class GoogleApiSecret(Sitevar[ContentType]):
@staticmethod
def key() -> str:
return "google.secrets"
@staticmethod
def description() -> str:
ret... | {
"content_hash": "843b454da2bd0c92cb0ab84849fddc03",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 71,
"avg_line_length": 23.96153846153846,
"alnum_prop": 0.6645264847512039,
"repo_name": "the-blue-alliance/the-blue-alliance",
"id": "2074644cf2b42f92e0a8337a41c6b7108eb8fb9... |
FIELD_TYPES = {
# u'java.lang.String': 'string',
# u'java.util.Date': 'date',
# u'com.atlassian.jira.project.version.Version': 'version[*]',
# u'com.atlassian.jira.issue.issuetype.IssueType': 'enum[1]',
# u'com.atlassian.jira.issue.priority.Priority': 'enum[1]',
# u'com.atlassian.jira.issue.status.Sta... | {
"content_hash": "45bc06689197a26b9023f560ac9e7907",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 94,
"avg_line_length": 44.57142857142857,
"alnum_prop": 0.5885416666666666,
"repo_name": "softintouch/python-youtrack-api",
"id": "86b0090dbd4bdb9912395f5bb77679a216bedc14",
... |
import os
path = os.path.dirname(__file__)
| {
"content_hash": "9174f76718a867cbef09c1bcf5273993",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 32,
"avg_line_length": 14.666666666666666,
"alnum_prop": 0.6590909090909091,
"repo_name": "westernx/sgfs",
"id": "5d73876c7051fef48e61e90fd889bf37a00a47b2",
"size": "44",
... |
import numpy as np
import matplotlib.pylab as plt
from MulLayer import MulLayer
class AddLayer:
def __init__ (self):
pass
def forward(self, x, y):
out = x + y
return out
def backward(self, dout):
dx = dout * 1
... | {
"content_hash": "c33b39bd02cfc50d1f790e4ca3327128",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 73,
"avg_line_length": 24.23404255319149,
"alnum_prop": 0.6453028972783144,
"repo_name": "leejw51/BumblebeeNet",
"id": "62d42a9436f1d10dfd3bd547d3921a8c811e5679",
"size": "... |
import ddt
import mock
from rally import exceptions
from rally.plugins.openstack.scenarios.vm import vmtasks
from tests.unit import test
BASE = "rally.plugins.openstack.scenarios.vm.vmtasks"
@ddt.ddt
class VMTasksTestCase(test.ScenarioTestCase):
def setUp(self):
super(VMTasksTestCase, self).setUp()
... | {
"content_hash": "54e0530a1da0ea18c3de6a77862945db",
"timestamp": "",
"source": "github",
"line_count": 221,
"max_line_length": 79,
"avg_line_length": 46.09502262443439,
"alnum_prop": 0.5354864042406989,
"repo_name": "vganapath/rally",
"id": "c0cc01b2bc39b97782303a462aa197efa473b56d",
"size": "1081... |
print "Hello"
print "World"
print '' | {
"content_hash": "db2a8ff6b8b6aba4302b343345cdcf2f",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 13,
"avg_line_length": 9.25,
"alnum_prop": 0.6756756756756757,
"repo_name": "janusnic/dj-21v",
"id": "7afc8aba1d6dd6e7d616eaee49a971f1e5fdacc1",
"size": "60",
"binary": fa... |
from pandaloginvestigator.core.workers import worker_translator
from pandaloginvestigator.core.utils import utils
from multiprocessing import Pool
import logging
import time
logger = logging.getLogger(__name__)
def translate_logs(dir_pandalogs_path, dir_unpacked_path, syscall_dict, dir_translated_path, core_num, max... | {
"content_hash": "76ab09c1978d3cf5250a8c4a99ef4420",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 120,
"avg_line_length": 37.130434782608695,
"alnum_prop": 0.6627634660421545,
"repo_name": "ClonedOne/pandalog_investigator",
"id": "9e6589e5467dabe536d0b280ffca04f154ac769e"... |
import unittest
from telemetry.timeline import chrome_trace_category_filter
class ChromeTraceCategoryFilterTest(unittest.TestCase):
def CheckBasicCategoryFilters(self, cf):
self.assertEquals(set(['x']), set(cf.included_categories))
self.assertEquals(set(['y']), set(cf.excluded_categories))
self.assertE... | {
"content_hash": "a8d94fb877bc4af177aa5b55c4d2f6fd",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 80,
"avg_line_length": 41.651162790697676,
"alnum_prop": 0.7205471803461754,
"repo_name": "catapult-project/catapult-csm",
"id": "df7e3667d77d5d447d75469a275ffd7444216ab1",
... |
from django.conf.urls.defaults import *
from django.conf import settings
from manager import VarnishManager
urlpatterns = patterns('varnishapp.views',
(r'', 'management'),
)
| {
"content_hash": "1674db7d2836c0f34d4fe72fbd247930",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 42,
"avg_line_length": 22.5,
"alnum_prop": 0.7555555555555555,
"repo_name": "vdmann/cse-360-image-hosting-website",
"id": "643d8b2d6957ba67e551b8af395dd902be276e3a",
"size":... |
from django.conf.urls import patterns, include, url
from django.conf import settings
from django.views.generic import TemplateView
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'cloudfuzzy.views.home', name='home'),
# url(r'^blog/', include('blo... | {
"content_hash": "a0360aa0cb97b2dfd148de3e0952ff3c",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 95,
"avg_line_length": 32.06060606060606,
"alnum_prop": 0.6512287334593573,
"repo_name": "arruda/cloudfuzzy",
"id": "239e30736fcf71fa45c63b142f847306ea1ea4c4",
"size": "105... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.