text stringlengths 4 1.02M | meta dict |
|---|---|
"""Tests for image_searcher_dataloader."""
from absl.testing import parameterized
import tensorflow as tf
from tensorflow_examples.lite.model_maker.core.data_util import image_searcher_dataloader
from tensorflow_examples.lite.model_maker.core.data_util import metadata_loader
from tensorflow_examples.lite.model_maker.... | {
"content_hash": "a9158b216b725c966dcba8131ea1ce3e",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 89,
"avg_line_length": 38.82692307692308,
"alnum_prop": 0.7097573055968301,
"repo_name": "tensorflow/examples",
"id": "05adc43f95222cce0f6c2243ea970df15a6ba706",
"size": "2... |
import datetime
# A UTC class, see:
# http://docs.python.org/2/library/datetime.html#tzinfo-objects
class UTC(datetime.tzinfo):
"""UTC"""
def utcoffset(self, dt):
return datetime.timedelta(0)
def tzname(self, dt):
return "UTC"
def dst(self, dt):
return datetime.timedelta(0)
... | {
"content_hash": "fdb36693eb3f7b6a5a47ee621245cfe5",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 77,
"avg_line_length": 21.95,
"alnum_prop": 0.6116173120728929,
"repo_name": "voxpupuli/pypuppetdb",
"id": "6828105856183f162f1b97742f50943526989f28",
"size": "878",
"bin... |
"""
Note: Legacy module which is not actually used any more,
but which is potentially useful for future reference.
Offers theano-implementations of the distance functions used,
for calculating the pairwise distances between two vectors.
"""
import theano
import theano.tensor as T
def get_manhattan_fn():
a = T.f... | {
"content_hash": "69bbf5c6f4b26dce100b72cc497c20ff",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 92,
"avg_line_length": 33.27272727272727,
"alnum_prop": 0.6402550091074681,
"repo_name": "mikekestemont/ruzicka",
"id": "0e3c41f84d1737fc8f59a64d9f0ac161687c6a45",
"size": ... |
__author__ = 'matthewpang'
import serial
import time
import pickle
import struct
serStepper = serial.Serial('/dev/cu.usbmodem14231', 230400)
time.sleep(3)
def output_encoder(value):
"""
Takes a 16 bit integer value, packs it little endian, then encapsulates it in the defined format
[0xAA,LSByte,MSByte,Ox... | {
"content_hash": "ee1926088c46a29334d40318ec4b9681",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 135,
"avg_line_length": 28.481927710843372,
"alnum_prop": 0.6484771573604061,
"repo_name": "matthewpang/stretch_tester",
"id": "77dbb43a96512aa0ad014d7b216a5f23d031e456",
"... |
import _plotly_utils.basevalidators
class ColumnValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(self, plotly_name="column", parent_name="parcats.domain", **kwargs):
super(ColumnValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | {
"content_hash": "5afde383189210092fbefe769e1d96d2",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 85,
"avg_line_length": 36.666666666666664,
"alnum_prop": 0.6068181818181818,
"repo_name": "plotly/plotly.py",
"id": "0f0090ca352af2d77a9b03f25e6eb151bd275c23",
"size": "440... |
"""Fake clock for unit test injection."""
__author__ = '[email protected] (Matt Frantz)'
import datetime
class FakeNow(object):
"""Fake clock for unit test injection as datetime.datetime.now.
Attributes:
now: Next value to return (datetime.datetime)
increment: Amount to increment each call (da... | {
"content_hash": "db9419ddf49d7644dfa7f5a765ae6b59",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 77,
"avg_line_length": 25.775,
"alnum_prop": 0.6828322017458778,
"repo_name": "mhfrantz/alertfeed",
"id": "4cb4b71cb20ce7e1e53b5aea3cee48f1f3c72c0d",
"size": "1630",
"bin... |
from fabric import api as fab
from ..base import Debian, Ubuntu
from ..deployment import _
from ..project import LogRotate
from ..project.cron import CronTab, BCronTab
from ..database import Maria52Database
from .base import Provider
class NetangelsShared(Provider):
shared = True
def __init__(self):
... | {
"content_hash": "4b4f70e26381858add2eb6a84aaa8d49",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 67,
"avg_line_length": 18.616438356164384,
"alnum_prop": 0.6195732155997057,
"repo_name": "suvit/speedydeploy",
"id": "30f609fc16f62a76cf95051f15f8385dfd39cf47",
"size": "1... |
"""
Created by: Lee Bergstrand (2018)
Description: The genome property tree class.
"""
import json
import csv
import pandas as pd
from pygenprop.genome_property import GenomeProperty
class GenomePropertiesTree(object):
"""
This class contains a representation of a set of nested genome properties. Internall... | {
"content_hash": "7617c6e853124ac27bf28b771cb3b6b9",
"timestamp": "",
"source": "github",
"line_count": 284,
"max_line_length": 120,
"avg_line_length": 36.33098591549296,
"alnum_prop": 0.6008916456677651,
"repo_name": "LeeBergstrand/pygenprop",
"id": "c06de9dad80051107803fa106ee54b0a1e7884f9",
"siz... |
import base64
import json
import os
import shutil
import urllib2
from oslo_log import log as logging
from oslo_config import cfg
from bork_api.clients import chef_client, puppet_client, murano_client
LOG = logging.getLogger(__name__)
CONF = cfg.CONF
class LocalStorage:
def __init__(self, path=None):
p... | {
"content_hash": "0aeda735df0c9dde1b2f10a7f47cf06d",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 96,
"avg_line_length": 32.207692307692305,
"alnum_prop": 0.5419154525913542,
"repo_name": "Fiware/ops.Validator",
"id": "5142ce668ca06a227a9b4e84233f6ad945e1dcd9",
"size":... |
import unittest
from komoo import create_app
from settings import Testing
class KomooInstanceTest(unittest.TestCase):
def test_instantiate_app(self):
komoo_app = create_app(Testing)
self.assertTrue(komoo_app)
self.assertTrue(hasattr(komoo_app, 'run'))
app = komoo_app.test_client()... | {
"content_hash": "30b3f052985b470507567045970e1089",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 50,
"avg_line_length": 24.875,
"alnum_prop": 0.6633165829145728,
"repo_name": "it3s/komoo",
"id": "25f6d0c78f3b14a74ac2a153af6a4e32312e0a63",
"size": "398",
"binary": fal... |
""" Module for building specdb files related to FRB spectra
"""
from __future__ import print_function, absolute_import, division, unicode_literals
import numpy as np
import os
from IPython import embed
import h5py
import glob
from pkg_resources import resource_filename
from astropy.coordinates import SkyCoord
from ... | {
"content_hash": "80afa67e2aca629cece0435a634f9388",
"timestamp": "",
"source": "github",
"line_count": 324,
"max_line_length": 101,
"avg_line_length": 32.54012345679013,
"alnum_prop": 0.5332448069809352,
"repo_name": "FRBs/FRB",
"id": "3a546709750d43a25e8ce397dc44c93f2a9d558d",
"size": "10543",
... |
from scrapy.loader import ItemLoader
from scrapy.loader.processors import TakeFirst, MapCompose
from scrapy.spiders import SitemapSpider
from w3lib.html import remove_tags
class MySpider(SitemapSpider):
name = 'my_spider'
sitemap_urls = ['https://www.example.com/sitemap.xml']
sitemap_rules = [
('/... | {
"content_hash": "1518a848d9d4f9377fc635b70035636f",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 69,
"avg_line_length": 32.714285714285715,
"alnum_prop": 0.6986899563318777,
"repo_name": "zseta/scrapy-templates",
"id": "44425930f4c4cec5b46b8e543f8e7a8be6e8f4e8",
"size"... |
__author__ = 'tbeltramelli'
from AHomography import *
from Filtering import *
from UInteractive import *
class TextureMapper(AHomography):
_result = None
_texture = None
_map = None
_texture_position = None
def __init__(self, homography_output_path):
self._homography_output_path = homogr... | {
"content_hash": "4c46175e4cd9499eab3d8666703021a6",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 120,
"avg_line_length": 36.666666666666664,
"alnum_prop": 0.613903743315508,
"repo_name": "tonybeltramelli/Graphics-And-Vision",
"id": "26d641926a7fffb197b10341ca54e2d12c7e1... |
import _plotly_utils.basevalidators
class ShowlakesValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="showlakes", parent_name="layout.geo", **kwargs):
super(ShowlakesValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | {
"content_hash": "a33fbb91f94ea9c288ca43905ced3cab",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 84,
"avg_line_length": 37.583333333333336,
"alnum_prop": 0.614190687361419,
"repo_name": "plotly/python-api",
"id": "5a242c6dcac0e1a066e75824938141ce73da94bf",
"size": "451... |
from flask import Flask
app = Flask(__name__)
@app.route('/scale_up/1', methods=['POST'])
def scale_up():
return "Scaling Up"
@app.route('/scale_down/1', methods=['POST'])
def scale_down():
return "Scaling Down"
if __name__ == '__main__':
app.run(debug=True, port=5001)
| {
"content_hash": "8a5a6a1d144255e9ef2bb4650f1696ca",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 45,
"avg_line_length": 20.428571428571427,
"alnum_prop": 0.6118881118881119,
"repo_name": "stevelle/loadmonitor",
"id": "c0bbe9c4d57a65ea3154ce3fd81be4c2734082dd",
"size": ... |
from django.db import models
from django.contrib.auth.models import User
def validate_not_spaces(value):
if value.strip() == '':
raise ValidationError(u"You must provide more than just whitespace.")
class Admins(models.Model):
id = models.IntegerField(primary_key=True)
username = models.C... | {
"content_hash": "f1e73286d93b63beb0d7c2dbeba787e3",
"timestamp": "",
"source": "github",
"line_count": 1099,
"max_line_length": 146,
"avg_line_length": 53.484986351228386,
"alnum_prop": 0.7246512419190201,
"repo_name": "hughsons/saltwaterfish",
"id": "38cdbcc8f818b2ab16cce46dded3b8d1bc1599bd",
"si... |
from __future__ import absolute_import
import os
import time
import argparse
import traceback
from threading import Thread
from .i18n import i18n
from .core import xeHentai
from .const import *
from .const import __version__
from .util import logger
from . import config as default_config
sys.path.insert(1, FILEPATH)
t... | {
"content_hash": "628aefe865c86de54c5d7171d885df8d",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 126,
"avg_line_length": 44.456647398843934,
"alnum_prop": 0.5670263944870628,
"repo_name": "ChristophorusX/ehentai-downloader",
"id": "b3c8092d42305c01855738fb0cec231d36ddf3... |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('dcim', '0054_site_status_timezone_description'),
]
operations = [
migrations.AlterModelOptions(
name='virtualchassis',
options={'ord... | {
"content_hash": "36ef0218a8d466f4f92f432ddd6f7a9b",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 132,
"avg_line_length": 30.61904761904762,
"alnum_prop": 0.6205287713841369,
"repo_name": "lampwins/netbox",
"id": "ab23f403f7a75df43f301ae44a395f9def13af99",
"size": "716"... |
import sys
import os
import shlex
# 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(".."))
__ve... | {
"content_hash": "affbf8b55cde2b34fe4b19f546c844a9",
"timestamp": "",
"source": "github",
"line_count": 344,
"max_line_length": 88,
"avg_line_length": 33.27906976744186,
"alnum_prop": 0.6906009783368274,
"repo_name": "tswast/google-cloud-python",
"id": "7e5c9d1b4f87cc5334f7b54ffd17e48cf0a442b3",
"s... |
import re
def lexicology_get_all_synsets(input_dict):
if input_dict['corpus'].lower()=='wordnet':
from nltk.corpus import wordnet as wn
synsets = {}
for word in input_dict['words']:
synsets[word] = wn.synsets(word)
return {'synsets' : synsets}
def lexicology_get_word_sy... | {
"content_hash": "70695edfa925743d9ba6ce78ff86b6df",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 109,
"avg_line_length": 29.826923076923077,
"alnum_prop": 0.6054158607350096,
"repo_name": "xflows/textflows",
"id": "57a6954e4ec789b21255949915d80d63e491e742",
"size": "15... |
import _plotly_utils.basevalidators
class TexttemplateValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="texttemplate", parent_name="scattergl", **kwargs):
super(TexttemplateValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent... | {
"content_hash": "ef853ed2e11476f589b38efae0748cb6",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 86,
"avg_line_length": 38.75,
"alnum_prop": 0.6258064516129033,
"repo_name": "plotly/plotly.py",
"id": "8b17b18e00ad9b6a2dd05bf1da0c01b802954afc",
"size": "465",
"binary"... |
from flask import jsonify, request, session
from sqlalchemy.orm import subqueryload, undefer
from werkzeug.exceptions import BadRequest
from indico.core.db import db
from indico.core.db.sqlalchemy.colors import ColorTuple
from indico.core.db.sqlalchemy.protection import ProtectionMode, render_acl
from indico.core.perm... | {
"content_hash": "710203158f83ac98fa05b3818f8c685f",
"timestamp": "",
"source": "github",
"line_count": 320,
"max_line_length": 118,
"avg_line_length": 41.59375,
"alnum_prop": 0.6588279489105935,
"repo_name": "indico/indico",
"id": "e2716bf5f8c2273dc16751b4bf09cb6a06844146",
"size": "13524",
"bin... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.action import ActionBase
from ansible.utils.vars import merge_hash
class ActionModule(ActionBase):
def run(self, tmp=None, task_vars=None):
if task_vars is None:
task_vars = dict()
... | {
"content_hash": "89762b50a4d24d24455cbfd6e1665bc6",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 89,
"avg_line_length": 38.07142857142857,
"alnum_prop": 0.650093808630394,
"repo_name": "abtreece/ansible",
"id": "932ad8309c30fa192390620125f9d36c037d7d58",
"size": "1774"... |
from utils import colors
# Segments colors.
USERATHOST_BG = colors.PASTEL_BLUE #colors.SMERALD
USERATHOST_FG = colors.WHITE
SSH_BG = colors.LIGHT_ORANGE
SSH_FG = colors.WHITE
CURRENTDIR_BG = colors.EXTRA_DARK_GREY
CURRENTDIR_FG = colors.LIGHT_GREY
READONLY_BG = colors.LIGHT_GREY
READONLY_FG = colors.RED
EXITCODE_... | {
"content_hash": "dcff0fc49f44ea97f65d0048f634c682",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 52,
"avg_line_length": 25.07894736842105,
"alnum_prop": 0.7691500524658972,
"repo_name": "egoddard/promptastic",
"id": "76dd858101f7d4a4e18ffb826cfc9a73da690ed1",
"size": "... |
"""Visitor restricting traversal to only the public tensorflow API."""
import re
import six
from tensorflow.python.util import tf_inspect
class PublicAPIVisitor(object):
"""Visitor to use with `traverse` to visit exactly the public TF API."""
def __init__(self, visitor):
"""Constructor.
`visitor` sho... | {
"content_hash": "9b73cd9d354ec071067f11664c6ef338",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 80,
"avg_line_length": 32.801587301587304,
"alnum_prop": 0.6102105008468425,
"repo_name": "Intel-Corporation/tensorflow",
"id": "2aa54816b56f9ca14088e344992568c0b12b4ae4",
... |
from setuptools import setup, find_packages
setup(name='photomanip',
version='0.2.0',
description='average like, all the photos',
author='Andrew Catellier',
author_email='[email protected]',
packages=find_packages(),
include_package_data=True,
package_data={'': ['*.jpg']}
... | {
"content_hash": "6755504f6a9f47d468c60e9eb540b42e",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 49,
"avg_line_length": 29.818181818181817,
"alnum_prop": 0.6310975609756098,
"repo_name": "whlteXbread/photoManip",
"id": "a700a5c3a64e085d39ca5bce2e41d336d57e2022",
"size"... |
from mock import Mock
from mock import mock_open
from mock import patch
from contextlib import nested
from nailgun.test.base import BaseIntegrationTest
from nailgun.utils import reverse
class TestVersionHandler(BaseIntegrationTest):
@patch('nailgun.api.v1.handlers.version.settings.VERSION', {
"release"... | {
"content_hash": "e349f5b7bf3372ea7f779e09fdac809a",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 64,
"avg_line_length": 26.70731707317073,
"alnum_prop": 0.5123287671232877,
"repo_name": "eayunstack/fuel-web",
"id": "6583250d5ee85b21ca9309a25c6cc8fea1d5ce51",
"size": "1... |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Anscombe'] , ['LinearTrend'] , ['Seasonal_DayOfWeek'] , ['NoAR'] ); | {
"content_hash": "c77abec1925a4eb828abda7b4c868ab2",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 90,
"avg_line_length": 40.75,
"alnum_prop": 0.7177914110429447,
"repo_name": "antoinecarme/pyaf",
"id": "fe3e8346e3fb4ef3d25667c0448da8ef0a61bf7e",
"size": "163",
"binary"... |
from __future__ import print_function
from __future__ import unicode_literals
from builtins import str, bytes, dict, int
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
from pattern.en import parse, Text
# The easiest way to analyze the output of the parser is to create ... | {
"content_hash": "f9ba08b2892fdae290a2249385da00ba",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 74,
"avg_line_length": 29.157894736842106,
"alnum_prop": 0.6759927797833934,
"repo_name": "clips/pattern",
"id": "2450601c79672ec3f80e5282d5122741d401c7c7",
"size": "1108",... |
import unittest
import paddle
from test_collective_api_base import TestDistBase
paddle.enable_static()
class TestCollectiveAllreduceAPI(TestDistBase):
def _setup_config(self):
pass
def test_allreduce_nccl(self):
if paddle.fluid.core.is_compiled_with_cuda():
self.check_with_place... | {
"content_hash": "e1dacd51a6be4d8a9ebdb4568a52fb28",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 67,
"avg_line_length": 25.657894736842106,
"alnum_prop": 0.4723076923076923,
"repo_name": "luotao1/Paddle",
"id": "6b2b9c0ade8f401cadd40af0f299bfff8fc34f09",
"size": "2563"... |
"""
WSGI config for bhs_sales project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bhs_sales.settings")
os.environ.setd... | {
"content_hash": "c343c1940acbd7f3e6199fabbde0b705",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 78,
"avg_line_length": 29.933333333333334,
"alnum_prop": 0.7750556792873051,
"repo_name": "Gnewt/bhs_sales",
"id": "a5da1e093eaae2d68aef70aa44cb14fcd74ec0ef",
"size": "449"... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import re
import xml.dom.minidom
import time
import zipfile
DEBUG=False
SourceSpectra=False
#SourceSpectra=True
def findNode(node,path):
o=node
last=path.pop()
for tag in path:
o=o.getElementsByTagName(tag)[0]
return o.getElementsByTagName... | {
"content_hash": "26758ea172d26756c431971de64835d3",
"timestamp": "",
"source": "github",
"line_count": 228,
"max_line_length": 99,
"avg_line_length": 29.43859649122807,
"alnum_prop": 0.6232121573301549,
"repo_name": "belfhi/FP-Spektren",
"id": "9ff68596bb471eac517aadc2583f0b5b1ddac31c",
"size": "6... |
from __future__ import unicode_literals
AUTHOR = u'Garagem'
SITENAME = u'Garagem Hacker 2.0'
SITESUBTITLE = u'Hackerspace'
SITEURL = 'http://localhost:8000'
PATH = 'content'
THEME = 'themes/bricks'
STATIC_PATHS = ['images', 'extra']
EXTRA_PATH_METADATA = {'extra/CNAME': {'path': 'CNAME'}}
ARTICLE_PATHS = ['blog']
ART... | {
"content_hash": "f781ea11be552f9e98a9b82f98ee990b",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 78,
"avg_line_length": 24.71186440677966,
"alnum_prop": 0.691358024691358,
"repo_name": "GaragemHacker/garagemhacker.github.io",
"id": "9cfa11e44cea6523a29948f7b46dfd0368b8f4... |
__author__ = 'yolosec'
class Error(Exception):
"""Generic EB client error."""
class InvalidResponse(Error):
"""Invalid server response"""
class InvalidStatus(Error):
"""Invalid server response"""
class RequestFailed(Error):
"""API request failed"""
class FbError(Error):
def __init__(self, ... | {
"content_hash": "a168b1b2f9507cbfd6ca95eba1f6eb71",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 35,
"avg_line_length": 15.695652173913043,
"alnum_prop": 0.6426592797783933,
"repo_name": "yolosec/zeman-parser",
"id": "4ff68ce05fbb4d36577ae15ff61ad62cb17bb29c",
"size": ... |
from __future__ import absolute_import
import mdtraj
from mdtraj.geometry.dihedral import _get_indices_phi, \
_get_indices_psi, compute_dihedrals, _atom_sequence, CHI1_ATOMS
import numpy as np
import warnings
from itertools import combinations as _combinations, count
from itertools import product as _product
from ... | {
"content_hash": "9b844eaaa92fefd9ad03757bd6c09df5",
"timestamp": "",
"source": "github",
"line_count": 1342,
"max_line_length": 149,
"avg_line_length": 37.89269746646796,
"alnum_prop": 0.5737040824353025,
"repo_name": "trendelkampschroer/PyEMMA",
"id": "37cb5df9cfa45b104be34c527884879ba70c1d3b",
"... |
import unittest
import marked
class MarkedTests(unittest.TestCase):
pass
if __name__ == '__main__':
unittest.main()
| {
"content_hash": "4c552d15255c82ff9d4cf71cd8b21b61",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 37,
"avg_line_length": 11.727272727272727,
"alnum_prop": 0.6511627906976745,
"repo_name": "1stvamp/marked",
"id": "4c932ca3a2b4699577156e7c6b04baeb922bb3b0",
"size": "129",... |
"""
Created on Mon Dec 07 22:08:13 2015
@author: derricw
Demonstrates use of the Sentech DLL using ctypes.
1) Loads the header file and dll.
2) Checks for available cameras.
3) Gets a camera handle.
4) Gets image properties from the camera.
5) Sets up a buffer for the image.
6) Continuously grabs images from the cam... | {
"content_hash": "982e0a7a30833d12e449e9c019cb065f",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 80,
"avg_line_length": 28.59090909090909,
"alnum_prop": 0.6375198728139905,
"repo_name": "derricw/pysentech",
"id": "619472b6fd352abb9dd294526aeb6825b1ef28e0",
"size": "37... |
import random
import time
import sys
#variables
name = input("What's your name? ")
counter = 0
answer = ""
userscore = 0
begin = input("Are you ready? ")
time.sleep(1)
if begin == "yes":
time.sleep(1)
print("Welcome to the Maths Quiz",name,"!")
time.sleep(1)
while counter<10:
number1 = rando... | {
"content_hash": "7a92e8746f93f0d4d525deb86a85c11f",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 74,
"avg_line_length": 20.733333333333334,
"alnum_prop": 0.5731511254019293,
"repo_name": "AlexEaton1105/computerScience",
"id": "8d09e6822743a61c22c6105486d7fd5d62812fe8",
... |
import argparse
import socket
import sys
import string
import random
import time
import numpy
def pong_server(host, port):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
try:
sock.bind((host, port))
except socket.error as err:
print("Socket... | {
"content_hash": "204aa8e5ebfd162f5f16aa75664d3d44",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 118,
"avg_line_length": 28.984126984126984,
"alnum_prop": 0.6486856516976999,
"repo_name": "tbknl/pingpongpy",
"id": "a3a6a93734a21f917dc0513aae9c5f420ac4ed5d",
"size": "3... |
import os
from syncplay import constants
from syncplay.players.mpv import MpvPlayer
from syncplay.utils import playerPathExists
class MpvnetPlayer(MpvPlayer):
@staticmethod
def run(client, playerPath, filePath, args):
constants.MPV_NEW_VERSION = True
constants.MPV_OSC_VISIBILITY_CHANG... | {
"content_hash": "fdb66793c17d8e92368cfed7232f4eb7",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 97,
"avg_line_length": 30.03846153846154,
"alnum_prop": 0.617157490396927,
"repo_name": "Syncplay/syncplay",
"id": "ef28d18b687326010ed56356652c15bda0e9dc39",
"size": "1562... |
"""Support for Met.no weather service."""
import logging
import voluptuous as vol
from homeassistant.components.weather import PLATFORM_SCHEMA, WeatherEntity
from homeassistant.config_entries import SOURCE_IMPORT
from homeassistant.const import (
CONF_ELEVATION,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_NAM... | {
"content_hash": "46066e048a8fe6e01e201c140620e712",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 99,
"avg_line_length": 30.41711229946524,
"alnum_prop": 0.6366033755274262,
"repo_name": "titilambert/home-assistant",
"id": "e2827367757a3f66fa7f5cf7037ee821a16b7c15",
"s... |
from __future__ import print_function
import inspect
import requests
from datetime import datetime, timedelta
import iso8601
import base64
import httplib
import json
import os
import ast
from pprint import pprint
from urlparse import urlparse
import copy
from cloudmesh.config.cm_config import cm_config
from cloudmesh.... | {
"content_hash": "a3f0a7c2f6b7b87f02058d9cd7d2b544",
"timestamp": "",
"source": "github",
"line_count": 1703,
"max_line_length": 120,
"avg_line_length": 32.456253669994126,
"alnum_prop": 0.5238000470392415,
"repo_name": "rajpushkar83/cloudmesh",
"id": "323d93da7c327a9f44a3277b2869a43baa86b73c",
"si... |
"""Implementation of compile_html for HTML source files."""
import os
import shutil
import codecs
from nikola.plugin_categories import PageCompiler
from nikola.utils import makedirs
class CompileHtml(PageCompiler):
"""Compile HTML into HTML."""
name = "html"
def compile_html(self, source, dest, is_two... | {
"content_hash": "ccf5242cd645801434be58efa2d2cff6",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 59,
"avg_line_length": 29.125,
"alnum_prop": 0.5804721030042919,
"repo_name": "Proteus-tech/nikola",
"id": "a309960cfba0ec92a8cfd23e251d6c7a6adbe159",
"size": "2074",
"bi... |
"""Some simple financial calculations
patterned after spreadsheet computations.
There is some complexity in each function
so that the functions behave like ufuncs with
broadcasting and being able to be called with scalars
or arrays (or other sequences).
Functions support the :class:`decimal.Decimal` type unless
othe... | {
"content_hash": "939b13040659e695d11bb7c30a600def",
"timestamp": "",
"source": "github",
"line_count": 967,
"max_line_length": 82,
"avg_line_length": 32.59979317476732,
"alnum_prop": 0.6065220149727192,
"repo_name": "WarrenWeckesser/numpy",
"id": "b055bb1ec7899ffaaabe5ad032ba9571fae5a30e",
"size":... |
import os
from shopify_settings import *
SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
try:
from djangoappengine.settings_base import *
USING_APP_ENGINE = True
except ImportError:
USING_APP_ENGINE = False
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
... | {
"content_hash": "7db302db19cc4506292be088296327e7",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 96,
"avg_line_length": 31.062937062937063,
"alnum_prop": 0.6602881584871679,
"repo_name": "daniyalzade/burgaz",
"id": "b208730b8e590b90d8e30b44e142cb6a2f2e28b8",
"size": "... |
from __future__ import print_function
import os
import operator
import time
import logging
from root_folder_info import RootFolderInfo
logger = logging.getLogger(__name__)
class Sync(object):
def __init__(self, config, src, dest):
self._config = config
self._src = src
self._dest = des... | {
"content_hash": "58257438b9954ede3641da304e61c127",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 115,
"avg_line_length": 39.4054054054054,
"alnum_prop": 0.5888203017832647,
"repo_name": "phdesign/flickr-rsync",
"id": "6dd8b3ec3dbdd7fbe54bd702038efc11516f3140",
"size": ... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import paddle.fluid as fluid
class ArcMarginLoss():
def __init__(self, class_dim, margin=0.15, scale=80.0, easy_margin=False):
self.class_dim = class_dim
self.margin = margin
... | {
"content_hash": "49eaa8f80288ed9b36aea5e3b9c12f5d",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 115,
"avg_line_length": 44.66101694915254,
"alnum_prop": 0.6166982922201139,
"repo_name": "kuke/models",
"id": "b166f7bb2b7aa2d1e318bcab358b7307b779b380",
"size": "2635",
... |
have_multiproc = False
try:
from multiprocessing import Array as array, Process as Thread
from uuid import uuid1 as get_ident
Thread.isAlive = Thread.is_alive
have_multiproc = True
except ImportError:
from threading import Thread
from thread import get_ident
from array import array
from hash... | {
"content_hash": "6043c1ebe3f407fd6acd1b798f3f169e",
"timestamp": "",
"source": "github",
"line_count": 325,
"max_line_length": 138,
"avg_line_length": 40.18769230769231,
"alnum_prop": 0.5644284511140035,
"repo_name": "ucare-uchicago/cass-fate-system",
"id": "fc6c2a5840b6da33feaf728a7ece1cde77c32933"... |
"""Tests."""
import pytest
from pyramid.interfaces import IRoutesMapper
@pytest.mark.parametrize('config_fixture, route_count', (
('simplerouting_config', 3),
('moduled_config', 6),
('two_moduled_config', 9),
('prefixed_config', 9)
))
def test_read_count(request, config_fixture, route_count):
"""... | {
"content_hash": "ca0ff97c76d4e3d2523c74c352e488b1",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 79,
"avg_line_length": 33.067961165048544,
"alnum_prop": 0.6814445096887844,
"repo_name": "fizyk/pyramid_routing",
"id": "1ead720941a08d2e755fc46374c7edb6aa9c3ade",
"size"... |
"""
Abiquo Utilities Module for the Abiquo Driver.
Common utilities needed by the :class:`AbiquoNodeDriver`.
"""
import base64
from libcloud.common.base import ConnectionUserAndKey, PollingConnection
from libcloud.common.base import XmlResponse
from libcloud.common.types import InvalidCredsError, LibcloudError
from l... | {
"content_hash": "039ae202e5017ee63599491440192ffa",
"timestamp": "",
"source": "github",
"line_count": 247,
"max_line_length": 79,
"avg_line_length": 35.80971659919028,
"alnum_prop": 0.6114188807235726,
"repo_name": "ferewuz/libcloud",
"id": "041a9ffea3186c1254f4f5236cda9733a7ca1016",
"size": "962... |
from bulbs.model import Node, Relationship
from bulbs.property import String, Integer, DateTime, List
from bulbs.utils import current_datetime
#print "ID: " , identifier
#print "Name: " , name
#print "Alternate Names: ", alt_names
#print "Subjects: ", subjects
#print "Nationalities: ", nationalities... | {
"content_hash": "948612ab1e22e33540b246f6e2366a88",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 58,
"avg_line_length": 27.688524590163933,
"alnum_prop": 0.6791000592066312,
"repo_name": "deternitydx/SNAC-EAC-Parser",
"id": "5a58d9e62bc959edadaebe4f3e97697c9711ce1c",
"... |
"""Helper module for dealing with datasets loaded from TFDS."""
import copy
import enum
from typing import List, Dict, Optional, Text, Any, Tuple, Callable
import attr
import cv2
import numpy as np
import tensorflow.compat.v1 as tf
import tensorflow_datasets as tfds
def tfds_load_dataset(dataset_name, *args, **kwarg... | {
"content_hash": "a23070bb37e7cf66a44d1176119cd8fa",
"timestamp": "",
"source": "github",
"line_count": 829,
"max_line_length": 91,
"avg_line_length": 34.225572979493364,
"alnum_prop": 0.6513939308497515,
"repo_name": "google-research/google-research",
"id": "44329155534d449740fc0e9965a85e2671e8a2bb"... |
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
ResourceNotModifi... | {
"content_hash": "4f26306d1b46c17d14782e66985620b8",
"timestamp": "",
"source": "github",
"line_count": 344,
"max_line_length": 179,
"avg_line_length": 44.151162790697676,
"alnum_prop": 0.6497893073479062,
"repo_name": "Azure/azure-sdk-for-python",
"id": "17980d374525eab50d8da3ac6884a1232fffd5ee",
... |
"""
Tests for django test runner
"""
import unittest
from unittest import mock
from admin_scripts.tests import AdminScriptTestCase
from django import db
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.management import call_command
from django.core.management.... | {
"content_hash": "999b4943b4e1a72f1e6f238d50a4d117",
"timestamp": "",
"source": "github",
"line_count": 514,
"max_line_length": 119,
"avg_line_length": 40.219844357976655,
"alnum_prop": 0.6060562085812412,
"repo_name": "adamchainz/django",
"id": "5dc31265812581ada39c9f0565a0b0a401ca90db",
"size": "... |
"""
Module for common mock definitions and helpers that are useful across various fixtures and unit tests.
"""
import gzip
import io
from botocore.exceptions import ClientError
import simplejson as json
def create_aws_provisioned_throughput_exceeded_exception():
return ClientError(
{'Error': {'Code': 10... | {
"content_hash": "ff48ffef0e80ee3c5d12a059e1a64194",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 116,
"avg_line_length": 34.87826086956522,
"alnum_prop": 0.5507354774370481,
"repo_name": "Cloudzero/cloudzero-reactor-aws",
"id": "a438402a5cf88a69b9ee8ea55c12ba1b9487baa4"... |
from .user import *
from .admin import *
from .error import *
from .feedback import *
from .letsencrypt import *
from .profile import *
from .test import *
from .welcome import *
from .post import *
from .resource import *
from .recommender import *
from .search import *
from .static_pages import *
from .guide import ... | {
"content_hash": "ad93a5a33ee080323f3a8529ad420c7e",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 27,
"avg_line_length": 21.466666666666665,
"alnum_prop": 0.7329192546583851,
"repo_name": "daspots/dasapp",
"id": "48257e20d82257a636b0ace347e022d7388c6cec",
"size": "339",... |
import datetime
import json
import re
import shlex
import subprocess
from google.api_core.exceptions import NotFound
import google.auth
from google.cloud import bigquery
from google.cloud import storage
from google.cloud.retail import ProductDetail, PurgeUserEventsRequest, \
UserEvent, UserEventServiceClient, Wri... | {
"content_hash": "960728adc681711a67c2016fa4ac82c6",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 119,
"avg_line_length": 34.909574468085104,
"alnum_prop": 0.6756056681395703,
"repo_name": "googleapis/python-retail",
"id": "1e92e3081c1b18213e98dfd64f570301c5310ccc",
"s... |
import unittest
from mock import MagicMock
from tests.tools.client.fixtures import topic_metadata, offset_fetch
from kafka.tools.client import Client
from kafka.tools.exceptions import GroupError
from kafka.tools.models.group import Group
from kafka.tools.models.topic import TopicOffsets
from kafka.tools.protocol.req... | {
"content_hash": "215a123f6c37302cf8bb66e9488f65ff",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 106,
"avg_line_length": 46.75182481751825,
"alnum_prop": 0.6619828259172521,
"repo_name": "toddpalino/kafka-tools",
"id": "14c909036ffcbce54825103b523857ea7017ed22",
"size... |
from model.user import User
testdata = [
User(firstname="Sherlock", lastname="Holmes",
address="221b, Baker Street, London, UK", email="[email protected]",
email2="[email protected]", email3="[email protected]", homephone="321-32-13",
mobilephone="+441712223355", workphone="123 ... | {
"content_hash": "06e3ecae65058ee231838f9ff64d43db",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 96,
"avg_line_length": 46.90909090909091,
"alnum_prop": 0.6715116279069767,
"repo_name": "VanillaPupa/python_training",
"id": "d5e201b31d8f8a7e809cfd789bd76aa9a094d959",
"s... |
import os
import json
from front_base.host_manager import HostManagerBase
class HostManager(HostManagerBase):
def __init__(self, config_fn):
self.config_fn = config_fn
self.info = {}
self.load()
def load(self):
if not os.path.isfile(self.config_fn):
return
... | {
"content_hash": "cc52a2352d63ed03d3349363507ff5a5",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 51,
"avg_line_length": 21.526315789473685,
"alnum_prop": 0.5268948655256723,
"repo_name": "zlsun/XX-Net",
"id": "dec3beac2909517cbfb7dda847c91bc7ebee4d8c",
"size": "818",
... |
class binaryTree(object):
def __init__(self, value):
self.value = value
self.leftBranch = None
self.rightBranch = None
self.parent = None
def setLeftBranch(self, node):
self.leftBranch = node
self.rightBranch = node
self.parent = | {
"content_hash": "0bdddbc20687a6f3a9cb64a3e2a6195c",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 34,
"avg_line_length": 25.333333333333332,
"alnum_prop": 0.569078947368421,
"repo_name": "xpgeng/exercises_of_machine_learning",
"id": "12660c41ee7897052e68b6520f71526646c990... |
import os
from loguru import logger
# logger = logging.getLogger()
import sys
import os.path
import numpy as np
path_to_script = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(path_to_script, "./extern/sPickle"))
# import numpy as np
from io3d.misc import suggest_filename
from io3d.misc imp... | {
"content_hash": "c031120fdfc44320c5d1aa1575ff9833",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 77,
"avg_line_length": 30.369668246445496,
"alnum_prop": 0.5482209737827716,
"repo_name": "mjirik/lisa",
"id": "5dd35f02cf19bdc7bfdf5b1d6a7a8a4cf6a01fc2",
"size": "6475",
... |
"""Tornado request argument parsing module.
Example: ::
import tornado.web
from marshmallow import fields
from webargs.tornadoparser import use_args
class HelloHandler(tornado.web.RequestHandler):
@use_args({'name': fields.Str(missing='World')})
def get(self, args):
respo... | {
"content_hash": "547d0d2b86f695de33c48ef623ca5278",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 86,
"avg_line_length": 33.56687898089172,
"alnum_prop": 0.6280834914611005,
"repo_name": "sloria/webargs",
"id": "e9d9c4b30703713eb79562d44f35ef58f954334b",
"size": "5270"... |
from __future__ import print_function, unicode_literals
__version__ = "0.10.0"
__author__ = "Jan Hajic jr."
STAFF_CROPOBJECT_CLASSES = ['staff_line', 'staff_space', 'staff']
'''It is useful for other tools (esp. visualization) to know
that objects from these classes form the staves.''' | {
"content_hash": "2aea6ff72f70c3d5d63025fca58804ca",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 65,
"avg_line_length": 32.111111111111114,
"alnum_prop": 0.698961937716263,
"repo_name": "hajicj/muscima",
"id": "2a7845a483c7b89be89729c62b6ec802d3bd3005",
"size": "289",
... |
import os
import logging
from gemini import GeminiQuery
from puzzle.models import (Case, Individual)
from puzzle.plugins import BaseCaseMixin
logger = logging.getLogger(__name__)
class CaseMixin(BaseCaseMixin):
"""Class to store methods that deal with Cases in geimni plugin"""
def _add_individual(self... | {
"content_hash": "f8b4fb21541ec8b16ed1e1f0367473b8",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 78,
"avg_line_length": 26.94,
"alnum_prop": 0.5077951002227171,
"repo_name": "robinandeer/puzzle",
"id": "0d4ac1d14a8b9f4ad534e75b7314a02ecb987b3f",
"size": "2694",
"bin... |
import random
def name_to_number(name):
if name == "rock":
return 0
elif name == "Spock":
return 1
elif name == "paper":
return 2
elif name == "lizard":
return 3
elif name == "scissors":
return 4
else:
print "Invalid name argument"
def number_to... | {
"content_hash": "b5ac44004b626e883b92bcf5c1f631f9",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 56,
"avg_line_length": 20.779661016949152,
"alnum_prop": 0.5562805872756933,
"repo_name": "tblong/CodeSkulptor",
"id": "9159f9245ff11a10dee1afafb1b493fdd9d1ba94",
"size": "... |
import WikiwhoRelationships
from copy import deepcopy
from sys import argv,exit
import getopt
import numpy as np
import math
import random
import cgi
from structures.Word import Word
import operator
#from django.utils import simplejson
context = {}
context_obj = {}
random.seed(3)
def getGraph(filename):
# Comp... | {
"content_hash": "b1e7da855b32393973c6699be26eef17",
"timestamp": "",
"source": "github",
"line_count": 1334,
"max_line_length": 346,
"avg_line_length": 47.07646176911544,
"alnum_prop": 0.4312579617834395,
"repo_name": "wikiwho/whovis",
"id": "403a5dd2ea6445a5d65ec6ed530dfe7028192447",
"size": "628... |
"""
Bit of pie in progress.
"""
from gi.repository import Gtk as gtk
from lib import graphics
from contrib.euclid import Vector2
import math
class Sector(graphics.Sprite):
def __init__(self, inner_radius, outer_radius, start_angle = 0, end_angle = 0):
graphics.Sprite.__init__(self, interactive = True)... | {
"content_hash": "f85d320dfef43ca0ff10defe20b904d9",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 83,
"avg_line_length": 28.68695652173913,
"alnum_prop": 0.5813882994846923,
"repo_name": "projecthamster/experiments",
"id": "baa82ea0d2bf7eceefc7ce00a66c579a2ebf3b67",
"s... |
from datetime import datetime as Datetime, timezone as Timezone
from warnings import filterwarnings
import pytest
import pg8000
from pg8000.converters import INET_ARRAY, INTEGER
# Tests relating to the basic operation of the database driver, driven by the
# pg8000 custom interface.
@pytest.fixture
def db_table(re... | {
"content_hash": "2dfd85faf1dca96d2f1659b0eb9b729e",
"timestamp": "",
"source": "github",
"line_count": 340,
"max_line_length": 88,
"avg_line_length": 30.3,
"alnum_prop": 0.6026985051446321,
"repo_name": "tlocke/pg8000",
"id": "e76f93339b364f88414a5332477c58b582cdfd46",
"size": "10302",
"binary":... |
"""
Coalescent methods
A note about population size. In this code all population sizes N or n are
uncorrected. If you need to compute a coalescent for a diploid species
you must multiply N by 2 before passing it to any of these functions.
"""
#==================================================================... | {
"content_hash": "67dac195b57ca8252f8834c465bcd7c8",
"timestamp": "",
"source": "github",
"line_count": 2198,
"max_line_length": 79,
"avg_line_length": 30.297088262056416,
"alnum_prop": 0.527758172780923,
"repo_name": "mdrasmus/argweaver",
"id": "2b6ab957a9a581e84ffa2de647995581cdb6b4b9",
"size": "... |
import logging
from sqlalchemy.inspection import inspect
from aquilon.worker.locks import NoLockKey, PlenaryKey
from aquilon.worker.templates import (Plenary, StructurePlenary,
add_location_info)
from aquilon.worker.templates.panutils import pan_assign, pan_include
from aquilon.a... | {
"content_hash": "d8f329f9d3b87a85666c1c26d388e226",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 96,
"avg_line_length": 41.24657534246575,
"alnum_prop": 0.6054466954500166,
"repo_name": "quattor/aquilon",
"id": "f46b99ad61e150b66aaccd3047c289df59f2343a",
"size": "3730"... |
"""
Functions with single return
Nodes
-----
Func : Function definition
Contains: Declares, Returns, Params, Block
Property: name
Returns : Function return variables
Contains: Var, ...
Params : Function parameter variables
Get : Function call
Example: "y(4)"
Contains: Gets
Property: name
Va... | {
"content_hash": "926ae64f93e78a5ead93e1787c1a8f50",
"timestamp": "",
"source": "github",
"line_count": 243,
"max_line_length": 97,
"avg_line_length": 21.135802469135804,
"alnum_prop": 0.5077881619937694,
"repo_name": "jonathf/matlab2cpp",
"id": "ae0c503023a5ade469d2ce072e8bcf212cb8199a",
"size": "... |
"""Developer helper tool for merging CLs from ToT to branches.
This simple program takes changes from gerrit/gerrit-int and creates new
changes for them on the desired branch using your gerrit/ssh credentials. To
specify a change on gerrit-int, you must prefix the change with a *.
Note that this script is best used f... | {
"content_hash": "1d2dbe416a52972d71fe7576574bde6a",
"timestamp": "",
"source": "github",
"line_count": 313,
"max_line_length": 80,
"avg_line_length": 39.022364217252395,
"alnum_prop": 0.6643196332077943,
"repo_name": "guorendong/iridium-browser-ubuntu",
"id": "7b2be2b14fe764e5360e799cc3f646041f00754... |
import logging
from core.emulator.coreemu import CoreEmu
from core.emulator.data import IpPrefixes, NodeOptions
from core.emulator.enumerations import EventTypes
from core.nodes.base import CoreNode
from core.nodes.lxd import LxcNode
if __name__ == "__main__":
logging.basicConfig(level=logging.DEBUG)
coreemu ... | {
"content_hash": "4dccea58f6ffefbf1bfdd40252bc9e3a",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 78,
"avg_line_length": 30.41176470588235,
"alnum_prop": 0.6789168278529981,
"repo_name": "pexip/os-core-network",
"id": "b41520d8929bd5926428e94b280143f7304f1e7d",
"size": ... |
"""
System-level utilities and helper functions.
"""
import math
import re
import sys
import unicodedata
import six
from cinder.openstack.common.gettextutils import _
UNIT_PREFIX_EXPONENT = {
'k': 1,
'K': 1,
'Ki': 1,
'M': 2,
'Mi': 2,
'G': 3,
'Gi': 3,
'T': 4,
'Ti': 4,
}
UNIT_SYST... | {
"content_hash": "6bd682ddee44836270c68c9315be6d58",
"timestamp": "",
"source": "github",
"line_count": 280,
"max_line_length": 79,
"avg_line_length": 34.23571428571429,
"alnum_prop": 0.6089088253703318,
"repo_name": "github-borat/cinder",
"id": "b39dc1c39473dca28ead50bcdd42c6027173529e",
"size": "... |
from traits.api import \
HasTraits, Int, Directory, Str, List, \
on_trait_change, Dict, Property, cached_property
from traitsui.api import \
View, Item
import numpy as np
from matresdev.db.simdb.simdb import simdb
import os.path
import re
import platform
import time
if platform.system() == 'Linux':
... | {
"content_hash": "6e9de9d831a5f4a90a8c82160229e416",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 102,
"avg_line_length": 32.95890410958904,
"alnum_prop": 0.5978802992518704,
"repo_name": "simvisage/aramis_cdt",
"id": "63f4cfbab2c243c0e24bd83f803ce2b11c04df1f",
"size":... |
from scrapy.item import Item, Field
class FisRaces(Item):
location = Field()
id = Field()
link = Field()
date = Field()
category = Field()
genre = Field()
info = Field()
discipline = Field()
table = Field()
class FisRanking(Item):
id = Field()
link = Field()
info = Fi... | {
"content_hash": "d67f85e189431069b8add1e7ae1aa3c1",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 35,
"avg_line_length": 17.333333333333332,
"alnum_prop": 0.5576923076923077,
"repo_name": "Tooskich/python_core",
"id": "43f20a25ec3592428863c62cb123935113413f54",
"size": ... |
from __future__ import unicode_literals
import pytest
from prompt_toolkit.completion import Completion
from prompt_toolkit.document import Document
@pytest.fixture
def completer():
import pgcli.pgcompleter as pgcompleter
return pgcompleter.PGCompleter(smart_completion=False)
@pytest.fixture
def complete_eve... | {
"content_hash": "354654c0ebd568771c63ad3f06574322",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 74,
"avg_line_length": 32.65,
"alnum_prop": 0.6860643185298622,
"repo_name": "koljonen/pgcli",
"id": "87fc4378d9f4523b95ef7e60f6d4e9498b068380",
"size": "2612",
"binary":... |
from kafka_utils.kafka_check.commands.replica_unavailability import _prepare_output
UNAVAILABLE_REPLICAS = [
('Topic0', 0),
('Topic0', 1),
('Topic13', 13),
]
UNAVAILABLE_BROKERS = [123456, 987456]
def test_prepare_output_ok_no_verbose():
expected = {
'message': "All replicas available for c... | {
"content_hash": "d4ada806599abb7f1edb46711988f2b0",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 99,
"avg_line_length": 28.774647887323944,
"alnum_prop": 0.5315712187958884,
"repo_name": "Yelp/kafka-utils",
"id": "d0b29349b1f6da6f9842f3f57a991044976da459",
"size": "261... |
from django.conf.urls.defaults import *
urlpatterns = patterns('pathfinder.views',
url(r'select/$', 'selector'),
url('select/ward', 'ward_selector'),
url('select/provider', 'provider_selector'),
url('select/hbc', 'hbc_selector'),
url('hbc/', 'home_based_care'),
url('ward/', 'ward_summary'),
... | {
"content_hash": "0683fb3688e13c58ae52663f5238a85c",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 48,
"avg_line_length": 30.166666666666668,
"alnum_prop": 0.6298342541436464,
"repo_name": "SEL-Columbia/commcare-hq",
"id": "d2352d244f646d232b5dae3a977e19a0c1485820",
"siz... |
"""
https://leetcode.com/problems/daily-temperatures/
https://leetcode.com/submissions/detail/137437366/
"""
class Solution:
def dailyTemperatures(self, temperatures):
"""
:type temperatures: List[int]
:rtype: List[int]
"""
temperaturesLength = len(temperatures)
re... | {
"content_hash": "cb102a0ee67e0833542432685575be04",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 80,
"avg_line_length": 25,
"alnum_prop": 0.5548717948717948,
"repo_name": "vivaxy/algorithms",
"id": "a1d41bf484a61bd94d6d22491cbb138914721f06",
"size": "983",
"binary": ... |
from setuptools import setup
if __name__ == '__main__':
with open("README.md", 'r') as f:
readme = f.read()
setup(name="orangeslices",
version="0.0.1",
description="Statusline generator for lemonbar",
long_description=readme,
url="http://github.com/tryone144/or... | {
"content_hash": "c8a3ba396c059154c680bee699b6ae88",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 59,
"avg_line_length": 29.75,
"alnum_prop": 0.5714285714285714,
"repo_name": "tryone144/orangeslices",
"id": "d4a841455f9dc7baa29fd6848f9159e1aa4bdce9",
"size": "567",
"b... |
from django import template
from django.utils.safestring import mark_safe
from tagembed.providers.tedx import TedxEmbed
from tagembed.providers.youtube import YoutubeEmbed
register = template.Library()
@register.filter
def parse_tagembed(text):
ted = TedxEmbed()
youtube = YoutubeEmbed()
parsed_text = te... | {
"content_hash": "c5950c68ccf7274b20f60fcf576f3efd",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 51,
"avg_line_length": 24.352941176470587,
"alnum_prop": 0.7608695652173914,
"repo_name": "ninjaotoko/django-tagembed",
"id": "aada2b8333194a436678025284d6d5fd1cf15845",
"s... |
"""
api/Zapi.py
@author: Josh Williams
Date Added: Tue Feb 21 15:15:15 CST 2006
This API takes care of all ZAPI direct DB access (api keys, account verification, etc)
"""
## STD LIBS
import datetime, md5, xmlrpclib
from pprint import pformat
## OUR LIBS
from AZTKAPI import AZTKAPI
import errors, validation, utils
fr... | {
"content_hash": "ed6e0cfe26b562062a1048a1306ecdbd",
"timestamp": "",
"source": "github",
"line_count": 473,
"max_line_length": 124,
"avg_line_length": 25.858350951374206,
"alnum_prop": 0.6471261548524242,
"repo_name": "kordless/zoto-server",
"id": "e3d0e82ce70bd9cda46274bc9e26b5bca428955a",
"size"... |
import json
import requests
from globalvars import GlobalVars
import threading
import websocket
from collections import Iterable
import sys
import traceback
import time
import os
import datahandling
import parsing
import apigetpost
import spamhandling
class Metasmoke:
@classmethod
def init_websocket(self):
... | {
"content_hash": "59f001d10aed827361f0fca061179c43",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 258,
"avg_line_length": 51.98421052631579,
"alnum_prop": 0.4982282069454288,
"repo_name": "ArtOfCode-/SmokeDetector",
"id": "df467b4de22d071fbf113e0165f9224cd121f58e",
"si... |
""" custom """
from examples.working_init import *
from threatconnect.Config.FilterOperator import FilterOperator, FilterSetOperator
""" Toggle the Boolean to enable specific examples """
enable_example1 = False
enable_example2 = False
enable_example3 = False
enable_example4 = False
enable_example5 = False
owners = ['... | {
"content_hash": "48247142920b7ff93055a826a8a70708",
"timestamp": "",
"source": "github",
"line_count": 323,
"max_line_length": 95,
"avg_line_length": 34.8390092879257,
"alnum_prop": 0.5335466097929441,
"repo_name": "percipient/threatconnect-python",
"id": "167a7b5c0026c0ec9cc61e77b14b1979af71b650",
... |
"""
WSGI config for OpenSource project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "OpenSource.settings")
from django.... | {
"content_hash": "87b272ddda4e9f3dc9ca3f11d2a112bc",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 78,
"avg_line_length": 28.214285714285715,
"alnum_prop": 0.7772151898734178,
"repo_name": "CubicDolphin/LicenseTracker",
"id": "fa303fa812a76f09904e04b7afddf185475a0dc0",
"... |
from __future__ import division
from nltk.tokenize import RegexpTokenizer
import curses
from curses.ascii import isdigit
import nltk
from nltk.corpus import cmudict
import math
d = cmudict.dict()
def countSyllables(word):
return [len(list(y for y in x if isdigit(y[-1]))) for x in d[word.lower()]]
de... | {
"content_hash": "864a79efbdbadacd8b2aed7a5dfef59a",
"timestamp": "",
"source": "github",
"line_count": 149,
"max_line_length": 102,
"avg_line_length": 27.57718120805369,
"alnum_prop": 0.5560963738135799,
"repo_name": "sujithvm/nlp-modules",
"id": "a115d21afc16fdec2e339350a50c810136b69359",
"size":... |
"""A language for manipulating forms using labels."""
import ufl
import functools
import operator
from firedrake import Constant
# ---------------------------------------------------------------------------- #
# Core routines for filtering terms
# ----------------------------------------------------------------------... | {
"content_hash": "d02247c80a0b07bf53dde36d9b0e02a4",
"timestamp": "",
"source": "github",
"line_count": 430,
"max_line_length": 95,
"avg_line_length": 35.38139534883721,
"alnum_prop": 0.5542263704482713,
"repo_name": "firedrakeproject/gusto",
"id": "1117171804a14b3649dc63b1c3bd5376ad8f8184",
"size"... |
""" Testing ``isestimable`` in regression module
"""
from __future__ import absolute_import
import numpy as np
from ..regression import isestimable
from numpy.testing import (assert_almost_equal,
assert_array_equal)
from nose.tools import (assert_true, assert_false, assert_raises,
... | {
"content_hash": "d7879f63528116da67f6815091185031",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 74,
"avg_line_length": 35.642857142857146,
"alnum_prop": 0.6205744822979292,
"repo_name": "alexis-roche/nipy",
"id": "815a530ab0707e5584b6f9b4e9352db194d40328",
"size": "14... |
from .functions import call, popen, check_output, log
LPSTAT = '/usr/bin/lpstat'
LPADMIN = '/usr/sbin/lpadmin'
def reset():
"""Reset this printing system."""
pass
def delete_printer(printer):
log('Deleting printer %s' % printer)
return call(LPADMIN, '-x', printer)
def delete_printers():
"""De... | {
"content_hash": "c927185cfaf1528f5887d4780ad43783",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 69,
"avg_line_length": 24.76,
"alnum_prop": 0.5533117932148627,
"repo_name": "filipp/MacHammer",
"id": "55fd31dd1b4cdc983a67352a8a5925b38ffce267",
"size": "1263",
"binary... |
# -*- coding: utf-8 -*-
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | {
"content_hash": "6bde73db2e14d1fc9cc957e2a049c9a2",
"timestamp": "",
"source": "github",
"line_count": 384,
"max_line_length": 87,
"avg_line_length": 32.6640625,
"alnum_prop": 0.6935342422068086,
"repo_name": "googleapis/python-recommendations-ai",
"id": "77cfe26e30740afef9129db0ca5a678b85a7f412",
... |
'''
Module to handle generating test files.
'''
from __future__ import absolute_import, division, print_function
import shutil
import sys
from os.path import dirname, join, isdir, exists
def create_files(dir_path, m):
"""
Create the test files for pkg in the directory given. The resulting
test files ar... | {
"content_hash": "a7421fbca465f608a0dcbf9656877750",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 80,
"avg_line_length": 35.5045045045045,
"alnum_prop": 0.5041867546308043,
"repo_name": "tacaswell/conda-build",
"id": "f63cf222c2bd4ae387858ef943c249306cc97ddc",
"size": ... |
def extractAutomtlWordpressCom(item):
'''
Parser for 'automtl.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('PRC', 'PRC', 'translated'),
('Loiterous'... | {
"content_hash": "98767825836de4f753a4b44045ae4b58",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 104,
"avg_line_length": 26.333333333333332,
"alnum_prop": 0.6311030741410488,
"repo_name": "fake-name/ReadableWebProxy",
"id": "6805c4e3e3ec8a812239bdb2b7f3854a66d8bf34",
"... |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
# Flag to indicate if this migration is too risky
# to run online and needs to be coordinated for offline
is_dangerous = False
... | {
"content_hash": "797205df46c135fd283d79392a3f52da",
"timestamp": "",
"source": "github",
"line_count": 1251,
"max_line_length": 236,
"avg_line_length": 91.9832134292566,
"alnum_prop": 0.5799549843140323,
"repo_name": "mvaled/sentry",
"id": "36a55a79a64eb4d1447d9b5e6cdeec8402b3ac49",
"size": "11509... |
"""Nova base exception handling.
Includes decorator for re-raising Nova-type exceptions.
SHOULD include dedicated exception logging.
"""
from oslo_log import log as logging
import webob.exc
from webob import util as woutil
import nova.conf
from nova.i18n import _, _LE
LOG = logging.getLogger(__name__)
CONF = n... | {
"content_hash": "91f9b2aaa9d99d4a6980d4869df7d555",
"timestamp": "",
"source": "github",
"line_count": 2155,
"max_line_length": 79,
"avg_line_length": 29.022737819025522,
"alnum_prop": 0.6765956766436428,
"repo_name": "rajalokan/nova",
"id": "42c50ea8e28fdf79880a81a38a02f2f8c12f14a8",
"size": "632... |
from src.emo_cls import EmoClassifier
if __name__ == '__main__':
e = EmoClassifier(is_use_emoticons=True,
is_dump_cls=True,
is_load_cached_cls=True,
verbose=True)
e.terms_cls.show_most_informative_features(10)
e.bigrams_cls.show_most_informative_... | {
"content_hash": "2e6ca26e236a1ef0095d4492ac54f08d",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 84,
"avg_line_length": 43.56,
"alnum_prop": 0.5748393021120294,
"repo_name": "wojtekwalczak/EmoClassifier",
"id": "984f6787876369ca86c6e4efc959134a76335c0f",
"size": "1154"... |
import pytest
@pytest.fixture
def stepwise_testdir(testdir):
# Rather than having to modify our testfile between tests, we introduce
# a flag for whether or not the second test should fail.
testdir.makeconftest(
"""
def pytest_addoption(parser):
group = parser.getgroup('general')
group.add... | {
"content_hash": "7a3b3f1dc153333d8157418cc67df6d6",
"timestamp": "",
"source": "github",
"line_count": 219,
"max_line_length": 113,
"avg_line_length": 28.63013698630137,
"alnum_prop": 0.6271132376395534,
"repo_name": "alfredodeza/pytest",
"id": "3bc77857d9761845586f7f346f883c494895342d",
"size": "... |
import tests.periodicities.period_test as per
per.buildModel((120 , 'BH' , 200));
| {
"content_hash": "781defc091b8ca1c6449774d8086caf1",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 45,
"avg_line_length": 21,
"alnum_prop": 0.7142857142857143,
"repo_name": "antoinecarme/pyaf",
"id": "417b4a0031bb23e0d7716b5523f3abef28388170",
"size": "84",
"binary": fa... |
"""
This Python module implements a spatio-temporal filter method
for correcting interferograms for atmospheric phase screen (APS)
signals.
"""
# pylint: disable=invalid-name, too-many-locals, too-many-arguments
import os
from copy import deepcopy
from collections import OrderedDict
from typing import List
import numpy... | {
"content_hash": "966e2c597435fdc183f25f7653b366e5",
"timestamp": "",
"source": "github",
"line_count": 381,
"max_line_length": 94,
"avg_line_length": 41.6246719160105,
"alnum_prop": 0.6638501797086828,
"repo_name": "GeoscienceAustralia/PyRate",
"id": "9308fab03fe91a2013b16169fc40807d2a6f0af3",
"si... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.