text stringlengths 4 1.02M | meta dict |
|---|---|
import logging
class Logging(object):
def log(self):
return logging.getLogger('.'.join((self.__class__.__module__,
self.__class__.__name__)))
| {
"content_hash": "a6c0ca8ef9b5a7849fc9a1fb52a050c5",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 69,
"avg_line_length": 25,
"alnum_prop": 0.475,
"repo_name": "fakedrake/WikipediaBase",
"id": "f2b52055aca6c582d765e60f5412320ffcc98f74",
"size": "200",
"binary": false,
... |
from google.cloud import bigquery_datatransfer_v1
def sample_get_transfer_run():
# Create a client
client = bigquery_datatransfer_v1.DataTransferServiceClient()
# Initialize request argument(s)
request = bigquery_datatransfer_v1.GetTransferRunRequest(
name="name_value",
)
# Make the ... | {
"content_hash": "9fb98a399910b7bd07cbe5ab1d1e144e",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 81,
"avg_line_length": 27.05263157894737,
"alnum_prop": 0.7354085603112841,
"repo_name": "googleapis/python-bigquery-datatransfer",
"id": "08f00c3b76d80e61b0119fb0832c0caec45... |
"""
* The <code>LoadTest</code> is a test decorator that runs
* a test with a simulated number of concurrent users and
* iterations.
* <p>
* In its simplest form, a <code>LoadTest</code> is constructed
* with a test to decorate and the number of concurrent users.
* </p>
* <p>
* For example, to create a load t... | {
"content_hash": "b5aaa82e32695c50353a89b81f5a3e4e",
"timestamp": "",
"source": "github",
"line_count": 239,
"max_line_length": 86,
"avg_line_length": 32.36401673640167,
"alnum_prop": 0.6989010989010989,
"repo_name": "nmondal/pyunitperf",
"id": "f430c355c12588ce9e6350af460fcba8e2a6956a",
"size": "7... |
"""Plot 7 Day Precipitation Totals"""
import datetime
import sys
from pandas import read_sql
from pyiem.plot import MapPlot
from pyiem.util import get_dbconnstr
def fmter(val):
"""Make pretty text"""
if val is None:
return 0
if 0 < val < 0.009:
return "T"
return "%.2f" % (val,)
def ... | {
"content_hash": "c2f6179feb5ff67756d1134bdf27a3f0",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 71,
"avg_line_length": 26.420289855072465,
"alnum_prop": 0.5441579813494241,
"repo_name": "akrherz/iem",
"id": "cf85c5312082c62971c1d94a5f68094a75ad3cf1",
"size": "1823",
... |
import Inline
info = {
"friendly_name": "Preformatted text (Block)",
"summary": "Prints child paragraphs in a monospace typeface, while still interpreting them as markup.",
}
def SublanguageHandler(args, doc, renderer):
text = doc.reconstruct_child_text().as_string()
(fragments, rest) = Inline.parse(t... | {
"content_hash": "3977032a2f5436857c01445937b746a3",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 107,
"avg_line_length": 35.63636363636363,
"alnum_prop": 0.7066326530612245,
"repo_name": "CymaticLabs/Unity3D.Amqp",
"id": "bc18d39c6915802641b3d5a6583ac4a6e82ada0a",
"siz... |
"""
Copyright (c) 2014, Samsung Electronics Co.,Ltd.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and... | {
"content_hash": "c25d6b09e438fe081cbbcbecd368c0e9",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 79,
"avg_line_length": 35.26851851851852,
"alnum_prop": 0.5992386453137306,
"repo_name": "ajkxyz/jpeg4py",
"id": "f98eee318c6822fe70e4a26249fec58f4c702419",
"size": "7618"... |
r"""
Give Python the ability to decode some common, flawed encodings.
Python does not want you to be sloppy with your text. Its encoders and decoders
("codecs") follow the relevant standards whenever possible, which means that
when you get text that *doesn't* follow those standards, you'll probably fail
to decode it. ... | {
"content_hash": "9c758886ce5b2f83252f0e39efb629c1",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 79,
"avg_line_length": 34.12903225806452,
"alnum_prop": 0.7110901071203529,
"repo_name": "timokoola/finnkinotxt",
"id": "0984bd525265ee1ae8ba397ddc15bc4cdd2f497c",
"size": ... |
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 'Series'
db.create_table('series_series', (
('id', self.gf('django.db.models.fields.AutoField')(primary_k... | {
"content_hash": "170268b7a669d248ee13a764d97037d4",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 161,
"avg_line_length": 48.26229508196721,
"alnum_prop": 0.5737092391304348,
"repo_name": "armstrong/armstrong.apps.series",
"id": "cd35bddc74c4d8c53beadef5e5afef3254d4322d",... |
'''
File created on Aug 7, 2012
@author: jhc02
'''
# Samtools module provides functions for various samtools operations
from subprocess import call
samtools_exec = '/usr/local/bio/samtools-0.1.19/samtools'
bcftools_exec = '/usr/local/bio/samtools-0.1.19/bcftools/bcftools'
def set_samtools_exec(samtools_location):... | {
"content_hash": "c9421f875fbee25f6be57a9b1162f8f4",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 90,
"avg_line_length": 38.58108108108108,
"alnum_prop": 0.6339754816112084,
"repo_name": "london-escience/libhpc-cf",
"id": "132f3854ed94f6348349879050ce00553e1a5324",
"siz... |
import re
def parseClangCompileParams(args):
className = ''
objectCompilation = ''
arch = ''
isysroot = ''
Lparams = []
Fparams = []
minOSParam=''
idx = 0
for arg in args:
# print('arg is %s' % arg)
if (re.match('.*\w+\.mm?$', arg)):
className = arg
... | {
"content_hash": "26c1f659d54c4589f754bfae88696204",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 82,
"avg_line_length": 29.170212765957448,
"alnum_prop": 0.48067104303428154,
"repo_name": "xuvw/dyci-main",
"id": "9876444104f8a2f763f01eaf86c19c6b706c835b",
"size": "1371... |
import math
# Project Coins
quarters = int(input("How many quarters do you have? "))
print()
dimes = int(input("How many dimes do you have? "))
print()
nickles = int(input("How many nickles do you have? "))
print()
pennies = int(input("How many pennies do you have? "))
print()
quarters_new = quarters ... | {
"content_hash": "c4c0850f0681c508bca42231da3503a0",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 119,
"avg_line_length": 14.724137931034482,
"alnum_prop": 0.6083138173302107,
"repo_name": "NoahFlowa/CTC_Projects",
"id": "10267dbe4df05dd563e50a3336098575b27c2c94",
"siz... |
import os
import logging
from datetime import datetime, timedelta
import requests
from flask import Flask, request, session, url_for, redirect, abort, jsonify, render_template
app = Flask(__name__)
app.secret_key = os.environ['FLASK_SECRET_KEY']
logging.basicConfig(level='DEBUG')
GITLAB_HOST = os.environ['GITLAB_... | {
"content_hash": "ecc2effa8c98969748933e1a2c3db20b",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 111,
"avg_line_length": 31.29383886255924,
"alnum_prop": 0.5623201575041648,
"repo_name": "beastbikes/GitlabCalendar",
"id": "4198c43d9cc9da543228911051332027d5e8deeb",
"s... |
""" This script compares the solution time in the presence and absence of
interpolation.
"""
# standard library
import time
import shutil
import glob
import sys
import os
# virtual environment
if not hasattr(sys, 'real_prefix'):
raise AssertionError('Please use a virtual environment for testing')
# PYTHONPATH
s... | {
"content_hash": "5f474f7e3dfc1a04380f5409bf7b4698",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 78,
"avg_line_length": 21.474358974358974,
"alnum_prop": 0.6680597014925374,
"repo_name": "peisenha/computational_coffee",
"id": "f5b10e6d536fd7be3448d85c24159cec5884d662",
... |
import unittest
import json
from unittest.mock import patch
from main import app
import routes.api.shared as shared_api
import routes.api.choropleth as choropleth_api
class TestChoroplethPlaces(unittest.TestCase):
@patch('routes.api.choropleth.place_api.parent_places')
@patch('routes.api.choropleth.place_api.ge... | {
"content_hash": "6bea105a26a8c3d10d28e5cbcf3ad1c7",
"timestamp": "",
"source": "github",
"line_count": 465,
"max_line_length": 84,
"avg_line_length": 32.27956989247312,
"alnum_prop": 0.5473017988007994,
"repo_name": "datacommonsorg/website",
"id": "3fc084aecd403ef700819848905a211193c53a0c",
"size"... |
'''
@author: sheng
@contact: sinotradition@gmail.com
@copyright: License according to the project license.
'''
NAME='guichou33'
SPELL='guǐchǒu'
CN='癸丑'
SEQ='50'
if __name__=='__main__':
pass
| {
"content_hash": "bc14cde3269cd02c77ee0ff7228acfef",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 53,
"avg_line_length": 14.923076923076923,
"alnum_prop": 0.6752577319587629,
"repo_name": "sinotradition/sinoera",
"id": "30549eec8bc785868da95b7c6da46d6465515c6b",
"size":... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import image.models
import image.storage
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
... | {
"content_hash": "5139273e751a1936cdbb40f9b171c769",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 142,
"avg_line_length": 41.69047619047619,
"alnum_prop": 0.597372929754426,
"repo_name": "vollov/django-blog",
"id": "cbf495bf84a1a39972d47b23aa0e243c9f3a3d28",
"size": "18... |
from optics.driver.abstract_driver_setting import AbstractDriverSetting
class SRWDriverSetting(AbstractDriverSetting):
def __init__(self):
from code_drivers.SRW.SRW_driver import SRWDriver
AbstractDriverSetting.__init__(self,
driver=SRWDriver())
| {
"content_hash": "20c3b32cf2ce54ffd7ce34bf3815d63b",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 71,
"avg_line_length": 43.714285714285715,
"alnum_prop": 0.6633986928104575,
"repo_name": "radiasoft/optics",
"id": "f2eeccd94cf15a462c3f0d2b249857c0fa50db20",
"size": "306"... |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_... | {
"content_hash": "6ee9217af66d37f520b37ca94e0f504e",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 134,
"avg_line_length": 27.09036144578313,
"alnum_prop": 0.6931287525016678,
"repo_name": "mahabs/nitro",
"id": "f97702ab488e0d17adf487a302202507c657c141",
"size": "5111",... |
from django import shortcuts
from django.views import generic
import models
class ArticleListView(generic.ListView):
paginate_by = 8
kind = None
def get_queryset(self):
if self.kind:
return models.Article.objects.published().filter(kind=self.kind)
else:
return mo... | {
"content_hash": "6298a3faf0ced388c4a82c3ce28820d4",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 78,
"avg_line_length": 28.54,
"alnum_prop": 0.6306937631394534,
"repo_name": "megaprojectske/megaprojects.co.ke",
"id": "509538ab1d5e79e77ec227f8d94b8ed975277d81",
"size": ... |
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
setup(
name = 'twarkov',
version = '0.0.2',
description = 'Markov generator built for generating Tweets from timelines',
license = 'MIT',
author = 'Amanda Pickering',
author... | {
"content_hash": "03d162f9957020be66110ac0abe683c6",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 78,
"avg_line_length": 29.61111111111111,
"alnum_prop": 0.7054409005628518,
"repo_name": "amanda/twarkov",
"id": "7d6cc110a669df85939b4a07390e2fbf146dd9d6",
"size": "533",
... |
from django.contrib import admin
from hunts import models
admin.site.register(models.Business)
admin.site.register(models.Hunt)
admin.site.register(models.Follow)
admin.site.register(models.Comment)
| {
"content_hash": "6ad079704f417ad82607ed5a33836ff9",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 36,
"avg_line_length": 28.571428571428573,
"alnum_prop": 0.83,
"repo_name": "srohatgi/cloud",
"id": "9c53855753fe3ac015a52709c3f1c449cc92bdd4",
"size": "200",
"binary": fa... |
import copy
import re
from cloudify import ctx
from cloudify.exceptions import NonRecoverableError
from openstack_plugin_common import (
get_resource_id,
use_external_resource,
delete_resource_and_runtime_properties,
validate_resource,
validate_ip_or_range_syntax,
OPENSTACK_ID_PROPERTY,
OP... | {
"content_hash": "6b7d78350601a1c08fef55f1b4a4be89",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 79,
"avg_line_length": 34.12781954887218,
"alnum_prop": 0.6276712932363957,
"repo_name": "szpotona/cloudify-openstack-plugin",
"id": "0fa21aa149fa99a30056caf65a940fab35fa9d3... |
import re
from datetime import datetime
import json #???
#libs
from sqlalchemy import create_engine
from sqlalchemy import Integer
from sqlalchemy import DateTime
from sqlalchemy import MetaData
from sqlalchemy import Column
from sqlalchemy import Table
from sqlalchemy import select
from sqlalchemy.orm import session... | {
"content_hash": "e8f849f462576fc93e081423790a1d87",
"timestamp": "",
"source": "github",
"line_count": 240,
"max_line_length": 116,
"avg_line_length": 28.0875,
"alnum_prop": 0.5525886367007863,
"repo_name": "meantheory/optio",
"id": "c126e92c0cfb3340d2e4c279d36e334f99d16d31",
"size": "6749",
"bi... |
import argparse
import cv2
import numpy as np
import os.path
def generateColormapsCv2(S):
names = {
"autumn",
"bone",
"cool",
"hot",
"hsv",
"jet",
"ocean",
"pink",
"rainbow",
"spring",
"summer",
"winter",
}
col... | {
"content_hash": "1566002b3475ab502090da3526641930",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 228,
"avg_line_length": 31.64406779661017,
"alnum_prop": 0.6256025709694697,
"repo_name": "dhaase-de/dh-python-dh",
"id": "965148d68e51069a76292e37d6b8e6b4868973d0",
"size"... |
import sys
import traceback
from .exceptions import RetryException
import logging
logger = logging.getLogger('sqjobs.worker')
class Worker(object):
DEFAULT_TIMEOUT = 20 # seconds
def __init__(self, broker, queue_name, timeout=None):
self.broker = broker
self.queue_name = queue_name
... | {
"content_hash": "2635872322428b6a3bf783512b8405fc",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 100,
"avg_line_length": 31.957894736842107,
"alnum_prop": 0.5770750988142292,
"repo_name": "gnufede/sqjobs",
"id": "4f3e7b7fa0266309bac45468e21383bca8114e9f",
"size": "3036... |
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('bankaccounts', '0001_initial'),
('banktransactiontags', '0001_initial'),
]
operations = [
m... | {
"content_hash": "4b89810a9cddb75d7211f5686d8d9a28",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 307,
"avg_line_length": 61.829268292682926,
"alnum_prop": 0.6276134122287969,
"repo_name": "ychab/mymoney",
"id": "0a687e91b7e1d149c850259e91476505247b69e3",
"size": "2559"... |
"""
Blocks World domain definition for Pyhop 1.1.
Author: Dana Nau <nau@cs.umd.edu>, November 15, 2012
This file should work correctly in both Python 2.7 and Python 3.2.
"""
import pyhop
"""Each Pyhop planning operator is a Python function. The 1st argument is
the current state, and the others are the planning operat... | {
"content_hash": "8af24107d9286565300fbf46ff0efcae",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 96,
"avg_line_length": 33.278688524590166,
"alnum_prop": 0.6576354679802956,
"repo_name": "jhomble/electron435",
"id": "725fffe2f1fcba168ed8acdd62cf3abd989527d3",
"size": "... |
from __future__ import unicode_literals
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
SITEURL = 'http://cms-big-data.github.io'
RELATIVE_URLS = False
FEED_ALL_ATOM = 'feeds/all.atom.xml'
CA... | {
"content_hash": "115ab6b367999c4f8f60d989d9e238e9",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 53,
"avg_line_length": 22.227272727272727,
"alnum_prop": 0.7382413087934561,
"repo_name": "cms-big-data/cms-big-data.github.io-source",
"id": "51b5d3b84a6bab71a3da92a139b52e4... |
from functools import reduce
from datetime import datetime
from operator import and_
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django.db.models import Q
from django.contrib.contenttypes.models import ContentType
from celery import states
from pytz import utc
from v... | {
"content_hash": "95909fcfaffc7ab32180aa12ef603f92",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 118,
"avg_line_length": 39.2421875,
"alnum_prop": 0.6336850487756321,
"repo_name": "erigones/esdc-ce",
"id": "5b2041faf7e1807322390ad186b94cb4c2a0ff8c",
"size": "5023",
... |
from django.template import TemplateSyntaxError
from django.template.base import Token
import re
__all__ = (
'parse_as_var', 'parse_token_kwargs'
)
kwarg_re = re.compile('^(?P<name>\w+)=')
def parse_as_var(parser, token):
"""
Parse the remainder of the token, to find a "as varname" statement.
:par... | {
"content_hash": "ca4673f146305b23272b00a6e7c6e088",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 158,
"avg_line_length": 37.264367816091955,
"alnum_prop": 0.6403454657618753,
"repo_name": "steventimberman/masterDebater",
"id": "c9c9c7b5f95700232747fde7159016cc13b687f0",
... |
"""Builds the MNIST network.
Implements the inference/loss/training pattern for model building.
1. inference() - Builds the model as far as is required for running the network
forward to make predictions.
2. loss() - Adds to the inference model the layers required to generate loss.
3. training() - Adds to the loss mode... | {
"content_hash": "a02832ce0a19598bad4ba5e77722d6bf",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 79,
"avg_line_length": 38.233333333333334,
"alnum_prop": 0.6857018308631212,
"repo_name": "miyamotok0105/deeplearning-sample",
"id": "8cef566c041003cc38b0167feac6255a36126f9... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User as DjangoUser
from anaf.core.models import Group, Perspective, ModuleSetting
class NewsViewsTest(TestCase):
username = "test"
password = "password"
def setUp(self):
self.group... | {
"content_hash": "bb60b7081e4d9e41114afef2eefa16f9",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 100,
"avg_line_length": 43.256410256410255,
"alnum_prop": 0.6052163604030824,
"repo_name": "tovmeod/anaf",
"id": "cea24b546b66e889e357adaec2bcf5fa4856db6c",
"size": "3374",... |
from __future__ import absolute_import
import idiokit
from .. import events, bot, taskfarm
class Handler(object):
def __init__(self, log):
self.log = log
@idiokit.stream
def transform(self):
while True:
event = yield idiokit.next()
yield idiokit.send(event)
@id... | {
"content_hash": "56a5e351b95c1fffd6c4d85cd93dd476",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 78,
"avg_line_length": 26.095744680851062,
"alnum_prop": 0.5658377496942519,
"repo_name": "abusesa/abusehelper",
"id": "0b8aa660d45fb81257f397afc4524476e06872dc",
"size": "... |
"""Transport implementation using requests package.
"""
import logging
from typing import cast, Callable, Dict, MutableMapping, Optional
import requests
from looker_sdk.rtl import transport
class RequestsTransport(transport.Transport):
"""RequestsTransport implementation of Transport."""
def __init__(
... | {
"content_hash": "c01e62cf251fd27717aedd4f9840e86d",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 86,
"avg_line_length": 32.25,
"alnum_prop": 0.587737843551797,
"repo_name": "looker-open-source/sdk-codegen",
"id": "03667d84af7ae4a7f40391006d4990414be2e920",
"size": "397... |
import ddt
import six
from cinder.api.openstack import api_version_request
from cinder import exception
from cinder import test
@ddt.ddt
class APIVersionRequestTests(test.TestCase):
def test_init(self):
result = api_version_request.APIVersionRequest()
self.assertIsNone(result._ver_major)
... | {
"content_hash": "bd0c7f409d1d0d802a0af3734806e1e3",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 77,
"avg_line_length": 34.37593984962406,
"alnum_prop": 0.6034558180227472,
"repo_name": "scottdangelo/RemoveVolumeMangerLocks",
"id": "a087eb08bc4964894f1c4df6182382b7b3ba7... |
"""Mixin for Matter Pressure Measurement cluster test suite."""
from mobly import asserts
class PressureMeasurementClusterTestSuite:
"""Mixin for Matter Pressure Measurement cluster test suite.
The mixin assumes self.endpoint is set.
"""
def test_measured_value_attribute(self):
"""Tests the MeasuredValu... | {
"content_hash": "cea76b06e534286eae28e54cf1589595",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 67,
"avg_line_length": 37.074074074074076,
"alnum_prop": 0.7282717282717283,
"repo_name": "google/gazoo-device",
"id": "47ec829caa2cc928fc00ad089b526f59000f6ef6",
"size": "... |
import os
from django.test import TestCase
from domain.models import Domain
from xformmanager.models import FormDefModel
from buildmanager.tests.util import setup_build_objects, create_build
from buildmanager.models import Project, ProjectBuild, BuildDownload, BuildForm
from xformmanager.storageutility import... | {
"content_hash": "88b5442bfd05cd0ffeeff0f69615c56b",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 94,
"avg_line_length": 42.42696629213483,
"alnum_prop": 0.6054025423728814,
"repo_name": "commtrack/temp-aquatest",
"id": "1ed1a25ed398974ea90013cad4bafeba6841bbfb",
"size"... |
from logging import getLogger
from django.db import connection
from uw_canvas.models import CanvasSection, CanvasRole
from restclients_core.exceptions import DataFailureException
from canvas_users.dao.canvas import (
get_user_by_sis_id, create_user, enroll_course_user)
from canvas_users.views import UserRESTDispatc... | {
"content_hash": "d175f8364267e472889834aa248b31dd",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 78,
"avg_line_length": 38.011428571428574,
"alnum_prop": 0.5055622369212267,
"repo_name": "uw-it-aca/django-canvas-users",
"id": "5c4aaea3586f92c7a9e928f4f0f78c56e72095c0",
... |
import warnings
try: # Python 3
import http.client as httplib
from urllib.parse import parse_qsl
from functools import partial
to_bytes = lambda value, *args, **kwargs: bytes(value, "utf-8", *args, **kwargs)
except ImportError: # Python 2
import httplib
from urlparse import parse_qsl
to_b... | {
"content_hash": "4579d70e82bbd591d111bdb0700aae19",
"timestamp": "",
"source": "github",
"line_count": 381,
"max_line_length": 122,
"avg_line_length": 34.71653543307087,
"alnum_prop": 0.5941634535419974,
"repo_name": "sidecars/python-quickbooks",
"id": "dd7da2e81e20672d58613804e0357d417719d039",
"... |
from name_utilities import enum_key_for_css_keyword
import json5_generator
import template_expander
import gperf
class CSSValueKeywordsWriter(json5_generator.Writer):
_FILE_BASENAME = 'css_value_keywords'
def __init__(self, file_paths, output_dir):
json5_generator.Writer.__init__(self, file_paths, o... | {
"content_hash": "33e21a2e4da07992997d39f22ead3261",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 76,
"avg_line_length": 37.54320987654321,
"alnum_prop": 0.5695494902992436,
"repo_name": "chromium/chromium",
"id": "de0f837caa7dafa160ea7c7aa22096564138bdfc",
"size": "306... |
import os
import pytest
import apistar
filenames = [
'testcases/openapi/api-with-examples.yaml',
# 'testcases/openapi/callback-example.yaml',
# 'testcases/openapi/link-example.yaml',
'testcases/openapi/petstore-expanded.yaml',
'testcases/openapi/petstore.yaml',
'testcases/openapi/uspto.yaml',... | {
"content_hash": "49b58fa2f482870e3241317dbafce2e8",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 66,
"avg_line_length": 27.5,
"alnum_prop": 0.696969696969697,
"repo_name": "tomchristie/apistar",
"id": "a48a39ba738597c952f3b101e3a6d0ed74234e2e",
"size": "660",
"binary... |
from django.shortcuts import render
from web.data import *
from web.models import User, SharedTask
from web.berg import getQRCodeUrl
import base64
import datetime
import hashlib
import hmac
import json
import random
import string
import uuid
# TODO: add AWS credentials here
AWS_ACCESS_KEY_ID = 'XXX'
AWS_SECRET_KEY =... | {
"content_hash": "8812e13472f6a8d57e604829662bc250",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 67,
"avg_line_length": 30.50467289719626,
"alnum_prop": 0.6084558823529411,
"repo_name": "savageinternet/hoedown",
"id": "1388f639ee33ff8376af07f795e024396ea04b60",
"size"... |
"""
По всем этим урлам отдаётся простая html-страничка,
вся логика веб-интерфейса находится в джсе.
Исключение — 'zoo.views.task_log'. Для скорости богатый цветной лог таска рендерится на сервере,
с помощью шаблона.
"""
from web.zoo.views import home, server, gallery, install, install_application
from web.zoo.views im... | {
"content_hash": "29bc8272382af0f7c2b00b518d333334",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 119,
"avg_line_length": 79.81818181818181,
"alnum_prop": 0.41275626423690204,
"repo_name": "helicontech/zoo",
"id": "612e14a978c4c4c0d36b196b0889c0691c1a63ad",
"size": "457... |
'''
Created on Feb 24, 2014
@author: Chunwei Yan @ PKU
@mail: yanchunwei@outlook.com
'''
from __future__ import division
import sys
sys.path.append('..')
import unittest
import numpy
from models.recursive_autoencoder import BinaryAutoencoder
class TestBinaryAutoencoder(unittest.TestCase):
def setUp(self):
... | {
"content_hash": "a7d77dbd17e686b79aaab4491fe157d3",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 65,
"avg_line_length": 24.306451612903224,
"alnum_prop": 0.5600530856005309,
"repo_name": "Superjom/NeuralNetworks",
"id": "71af3ed0b6d547976a6f3c76ed81fd722da66c16",
"size... |
from opensfm.actions import create_tracks
from . import command
import argparse
from opensfm.dataset import DataSet
class Command(command.CommandBase):
name = "create_tracks"
help = "Link matches pair-wise matches into tracks"
def run_impl(self, dataset: DataSet, args: argparse.Namespace) -> None:
... | {
"content_hash": "783d166e21e0518a355fdc2465039c27",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 75,
"avg_line_length": 27.9375,
"alnum_prop": 0.727069351230425,
"repo_name": "mapillary/OpenSfM",
"id": "d5ee6e6ac9d403bc594892f50f726362f079c9ce",
"size": "447",
"binar... |
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
__all__ = [
"network_split_edge",
]
def network_split_edge(network, u, v, t=0.5):
"""Split and edge by inserting a node along its length.
Parameters
----------
u : str
The key of... | {
"content_hash": "234aae3c0351f456fa01858c63bc31ef",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 59,
"avg_line_length": 22.217391304347824,
"alnum_prop": 0.5772994129158513,
"repo_name": "compas-dev/compas",
"id": "04fb9a20944274e7f7aa7290075ee40b0a02dfee",
"size": "15... |
"""
web storage for posting and getting data for a given pubkeyid.
The following requests are handled:
POST /PUBKEYID (content-type=application-json)
{"key": FULL_PUBLIC_KEY, # must match pubkeyid,
"message": json_blob,
"signature": signature for data blob,
}
GET /PUBKEYID ... | {
"content_hash": "9e44f96ee293d896cd299e2912a0c073",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 76,
"avg_line_length": 32.097345132743364,
"alnum_prop": 0.612351805900193,
"repo_name": "hpk42/p4p",
"id": "0514662ccaea849e66ae3c42f3a6c695fda6628b",
"size": "3627",
"... |
from functools import partial
import threading
from PyQt4.Qt import Qt
from PyQt4.Qt import QGridLayout, QInputDialog, QPushButton
from PyQt4.Qt import QVBoxLayout, QLabel, SIGNAL
from electrum_cesc_gui.qt.main_window import StatusBarButton
from electrum_cesc_gui.qt.util import *
from .plugin import TIM_NEW, TIM_RECOV... | {
"content_hash": "c9a94243d161afd13933429e8a488899",
"timestamp": "",
"source": "github",
"line_count": 636,
"max_line_length": 83,
"avg_line_length": 41.74842767295598,
"alnum_prop": 0.592912021693281,
"repo_name": "Marcdnd/electrum-cesc",
"id": "3091b3875aa32eada4e147d829f8925a3c8accf9",
"size": ... |
from __future__ import absolute_import
import unittest
from ossimdb_to_json.db import Db as AvDb
from ossimdb_to_json.db import DbConnectionError
# Configure your testing database here.
HOST = 'X.X.X.X'
USER = 'user'
PWD = 'password'
DB = 'alienvault'
class DbTest(unittest.TestCase):
"""Test basic database con... | {
"content_hash": "6c474f48a731f56cce6ac9831b47fa17",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 77,
"avg_line_length": 29.103448275862068,
"alnum_prop": 0.5740521327014217,
"repo_name": "rarguelloF/ossimdb-to-json",
"id": "ee348cc05f6dd3dc30a2eeea21209c9d989e3980",
"s... |
"""RNN utils for RLlib.
The main trick here is that we add the time dimension at the last moment.
The non-LSTM layers of the model see their inputs as one flat batch. Before
the LSTM cell, we reshape the input to add the expected time dimension. During
postprocessing, we dynamically pad the experience batches so that ... | {
"content_hash": "f83002f16e53cca7390fe06c106a5677",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 78,
"avg_line_length": 37.37888198757764,
"alnum_prop": 0.5744433366566966,
"repo_name": "stephanie-wang/ray",
"id": "6f4c97c93086f9d37e0091f79ef6514a45330509",
"size": "6... |
import sys
sys.dont_write_bytecode=True
def upcase(context, str):
return str.upper()
extensions = {('http://example.org/e', 'upcase'): upcase}
| {
"content_hash": "7aa541925616c31cfe29f899eef2c267",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 57,
"avg_line_length": 21.285714285714285,
"alnum_prop": 0.6912751677852349,
"repo_name": "hisashim/pyxsltp",
"id": "f395518dd036cb58ea133367683f2bc0fc49dd8d",
"size": "168"... |
"""
===============================
aiohttp_middlewares.annotations
===============================
Type annotation shortcuts for ``aiohttp_middlewares`` library.
"""
from typing import (
Any,
Awaitable,
Callable,
Collection,
Dict,
Pattern,
Type,
Union,
)
from aiohttp import web
from... | {
"content_hash": "dd523d59f4c245cdbb364a74224ec6d6",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 78,
"avg_line_length": 20.906976744186046,
"alnum_prop": 0.6829810901001112,
"repo_name": "playpauseandstop/aiohttp-middlewares",
"id": "506b4ccc3afeb5f68d0f40df79bc33bd69cac... |
from collections import defaultdict
from django.conf import settings
from django.db.models import Q
from django.shortcuts import redirect
from django.utils.encoding import smart_str
import commonware.log
import jingo
from tower import ugettext as _
from mobility.decorators import mobile_template
import amo
import ba... | {
"content_hash": "f55217d098fae317f1208a59b1d69596",
"timestamp": "",
"source": "github",
"line_count": 647,
"max_line_length": 79,
"avg_line_length": 33.19938176197836,
"alnum_prop": 0.5625698324022347,
"repo_name": "jbalogh/zamboni",
"id": "e7c5681371eaa6e996277ceca7d7cee5d3057aad",
"size": "2148... |
import jsonschema
from unittest.mock import MagicMock
from unittest.mock import Mock
from unittest.mock import patch
from testtools.matchers import Is, Equals
from trove.cluster import models
from trove.cluster.models import Cluster, DBCluster
from trove.cluster.service import ClusterController
from trove.cluster.task... | {
"content_hash": "3ab572368c80439fbd840815ffff62c6",
"timestamp": "",
"source": "github",
"line_count": 455,
"max_line_length": 79,
"avg_line_length": 37.03956043956044,
"alnum_prop": 0.5431673885955023,
"repo_name": "openstack/trove",
"id": "1d7453772b4f5835223bd33edf2f6516c2022ecc",
"size": "1749... |
project = "KumaROOT"
author = "Shota TAKAHASHI"
copyright = "2015 - 2022, Shota TAKAHASHI"
version = "1.6.0"
release = "1.6.0"
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
extensions = [
"sphinx... | {
"content_hash": "9e12b86feca143011d7d3c91ca46bb60",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 88,
"avg_line_length": 29.361702127659573,
"alnum_prop": 0.6007246376811595,
"repo_name": "shotakaha/kumaroot",
"id": "b327107f0fd0671463d51f24427d6536b2f2abc7",
"size": "... |
"""Simulation bootstrapper for contour plot"""
from formation_flight.formation import handlers as formation_handlers
from formation_flight.aircraft import handlers as aircraft_handlers
from formation_flight.aircraft import generators
from formation_flight.hub import builders
from formation_flight.hub import allocators... | {
"content_hash": "1dff05196fff846c79016ce5b4332d2d",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 78,
"avg_line_length": 29.728813559322035,
"alnum_prop": 0.6664766248574686,
"repo_name": "mauzeh/formation-flight",
"id": "fb1d5a334e13bd5d258381ec06f763f780991100",
"size... |
import time
import unittest
import command
from command import CheckType
import config
import mle
import network_layer
import node
LEADER = 1
ROUTER1 = 2
class Cert_5_1_06_RemoveRouterId(unittest.TestCase):
def setUp(self):
self.simulator = config.create_default_simulator()
self.nodes = {}
... | {
"content_hash": "423cb4ea7a597a91f552fdbf1cb71262",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 114,
"avg_line_length": 33.90526315789474,
"alnum_prop": 0.6584911518162061,
"repo_name": "erja-gp/openthread",
"id": "7646ec312864748e185400ab18d14f274986461a",
"size": "4... |
import re
import logging
from datetime import datetime, timedelta, date
from django.db import models
from django.db.models.query_utils import Q
from django.utils.translation import ugettext_lazy as _, ugettext
from django.utils.text import Truncator
from django.contrib.contenttypes import generic
from django.contrib.au... | {
"content_hash": "aed1ff0b82da61afac131fb146d1680f",
"timestamp": "",
"source": "github",
"line_count": 530,
"max_line_length": 108,
"avg_line_length": 41.3811320754717,
"alnum_prop": 0.5838956775487871,
"repo_name": "OriHoch/Open-Knesset",
"id": "b88b075cf2d0b48fa697a1cf6a2014dabe51d566",
"size": ... |
import io
import os
import requests
from tacker import auth
import time
import zipfile
from oslo_config import cfg
from oslo_log import log as logging
LOG = logging.getLogger(__name__)
def config_opts():
return [('connect_vnf_packages', VnfPackageRequest.OPTS),
('connect_grant', GrantRequest.OPTS)]
... | {
"content_hash": "838ff62712451590f36f0a2a3d38e4fe",
"timestamp": "",
"source": "github",
"line_count": 336,
"max_line_length": 78,
"avg_line_length": 34.70238095238095,
"alnum_prop": 0.5722984562607204,
"repo_name": "openstack/tacker",
"id": "00be84129088bfb00c54d1056bd10dc73e218c23",
"size": "122... |
import os
import sys
from glob import glob
from inspect import isclass
from importlib import import_module
from collections import namedtuple
import logging
class Workload(object):
"""
Base class for Android related workloads
"""
_availables = None
# Setup logger
logger = logging.getLogger(... | {
"content_hash": "c17bef275cfbd987e2ff8feb1f2fb956",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 83,
"avg_line_length": 33.3046875,
"alnum_prop": 0.5740089139103918,
"repo_name": "JaviMerino/lisa",
"id": "8b097a162453ba1dea7edd25709374a9455db79d",
"size": "4900",
"b... |
import subprocess
class LocalIP:
def __init__(self):
pass
def getIps(self):
ip_lines = self.getIpLines()
return self.parseIps(ip_lines)
def getIpLines(self):
# get ip lines
arg='ip route list'
p=subprocess.Popen(arg,shell=True,stdout=subprocess.PIPE)
data ... | {
"content_hash": "824c07fe3096824052aca441492acfb9",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 65,
"avg_line_length": 27.333333333333332,
"alnum_prop": 0.5636856368563685,
"repo_name": "AlbertPumarola/raspberrypi_scripts",
"id": "488ae6614eb59babc1d95d5b4f6d6d77ccbf7e1... |
import unittest
import pandas as pd
from banpei.sst import SST
class TestSST(unittest.TestCase):
def setUp(self):
self.raw_data = pd.read_csv('tests/test_data/periodic_wave.csv')
self.data = self.raw_data['y']
def test_detect_by_svd(self):
model = SST(w=50)
results = model.de... | {
"content_hash": "34ad0b6f68dd50ec2be394c71c55b5f8",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 72,
"avg_line_length": 26.655172413793103,
"alnum_prop": 0.6274256144890039,
"repo_name": "tsurubee/banpei",
"id": "cba90a2ba8604f89f0daa00646d546ade2e1fe65",
"size": "773"... |
import unittest
from boundary import AlarmCreate
class TestCommand(unittest.TestCase):
def setUp(self):
self.alarm_create = AlarmCreate()
pass
def test_cli_description(self):
self.assertEqual('Creates a alarm definition in an Boundary account',
self.alarm_crea... | {
"content_hash": "646c9f3dc1183c1cee8cde7eec3dded7",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 93,
"avg_line_length": 31.166666666666668,
"alnum_prop": 0.6818181818181818,
"repo_name": "wcainboundary/boundary-api-cli",
"id": "223b393021c10f077d6cd07cd12c74e7148ec761",
... |
from django.contrib.auth.forms import UserCreationForm
from django import forms
from django.contrib.auth.models import User
class RegisterForm(UserCreationForm):
class Meta:
model = User
fields = ['email', 'first_name', 'last_name']
def save(self, commit=True):
user = super().save(Fals... | {
"content_hash": "bdcb862a327b084ed1abb152fa17803e",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 69,
"avg_line_length": 28.27777777777778,
"alnum_prop": 0.6247544204322201,
"repo_name": "aabmass/pswebsite_django",
"id": "4363687875f67ca9051e2292875d72ba58f87eb7",
"size... |
import os
import kfp.compiler as compiler
import kfp.components as components
from kfp.azure import use_azure_secret
import kfp.dsl as dsl
import argparse
parser = argparse.ArgumentParser(description='Process inputs.')
parser.add_argument('--image_name', type=str, default='kubeflow_synapse_component')
parser.add_argum... | {
"content_hash": "9c4847e967e62f0a80998b7a0f13f122",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 114,
"avg_line_length": 45.515151515151516,
"alnum_prop": 0.5745672436750998,
"repo_name": "kubeflow/pipelines",
"id": "3bcb5419f476d568f7490c0753206df3429db413",
"size": "... |
"""
Necessary bindings for Pybuild files.
"""
from __future__ import absolute_import, division, print_function
from mybuild._compat import *
import inspect
from mybuild import core
from mybuild.util.deco import constructor_decorator
__author__ = "Eldar Abusalimov"
__date__ = "2013-07-29"
__all__ = ['module', 'proj... | {
"content_hash": "d6486fd4fe5b60479e7c85e389912dc5",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 82,
"avg_line_length": 32.42446043165467,
"alnum_prop": 0.5870867539383182,
"repo_name": "abusalimov/mybuild",
"id": "f6b84cbbf3657b4b4957cd0b410a28ad9e4a087d",
"size": "4... |
"""
Find regions of first bed file that overlap regions in a second bed file. The
output preserves all fields from the input.
NOTE: -u and -d options are currently not functional!
usage: %prog bed_file_1 bed_file_2
-m, --mincols=N: Require this much overlap (default 1bp)
-u, --upstream_pad=N: upstream interv... | {
"content_hash": "864eef863e3a4d1ef3bc7520a7124157",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 94,
"avg_line_length": 29.106060606060606,
"alnum_prop": 0.631441957313899,
"repo_name": "bxlab/HiFive_Paper",
"id": "52e1bab5acf5b39ec4501e40df0201f67c652820",
"size": "19... |
import json
def break_into_words(keystrokes):
words = []
word = ""
for keystroke in keystrokes:
if keystroke == " " or keystroke == " ": #keeping residual "double option" because it could be either thumb that hits the "keyboard"
words.append(word)
word = ""
else:
... | {
"content_hash": "0d3f4a4c67686a10344154bf2fd539f0",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 153,
"avg_line_length": 41.93478260869565,
"alnum_prop": 0.6884396060134785,
"repo_name": "ctlewitt/Invisible-Keyboard",
"id": "81e69d8ec2fa241a69e0b3e0af5f3bcc1a96828d",
"... |
import string
#Open text file and remove punctuation and set to lower case
lines = sc.textFile("test1.txt")
punc = lines.map(lambda text: text.lower())
punc = punc.map(lambda text: text.translate({ord(c): None for c in string.punctuation}))
#Split lines into words
split = punc.flatMap(lambda line: line.split())
#Map ... | {
"content_hash": "baa39efaf091e12a38853287999ea61e",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 88,
"avg_line_length": 25.2,
"alnum_prop": 0.7142857142857143,
"repo_name": "gjwajda/Computational-Tools-For-Big-Data",
"id": "c6ea865134a4bfc80fcb6e698a5fe8d54af65170",
"s... |
import argparse
import sys
import os
# Make utilities folder available
sys.path.append(os.path.abspath("../"))
from utilities.runner import exec_in_row
#==============================================================================
#Command line options==========================================================
#=======... | {
"content_hash": "45d0eeaa8470a9fe81b9fe2e72ba5f46",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 79,
"avg_line_length": 32.916666666666664,
"alnum_prop": 0.5529113924050633,
"repo_name": "qfma/ohnolog-dc",
"id": "0a4fd72b35d1969a22e43846de2611465da591e6",
"size": "2129... |
import getopt
import fnmatch
import os
import re
import sys
# The default path to the Subversion configuration file.
SVN_CONFIG_FILENAME = os.path.expandvars('$HOME/.subversion/config')
# The name of Subversion's private directory in working copies.
SVN_WC_ADM_DIR_NAME = '.svn'
# The name this script was invoked as.... | {
"content_hash": "8322c903bcf465bb9e6952f9e4aa37c1",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 71,
"avg_line_length": 26.62130177514793,
"alnum_prop": 0.6374749944432097,
"repo_name": "YueLinHo/Subversion",
"id": "061c5c501465d6f1ec2a3ac2a11832898ccadd08",
"size": "... |
from __future__ import unicode_literals
import argparse
import errno
from io import open
import os
import subprocess
import yaml
"""Generate a changelog entry file in git project root.
Automatically stages the file and amends the previous commit if the `--amend` argument is used.
"""
def get_title():
return su... | {
"content_hash": "1d6028f9a627c1caf09e8fa78b6b0cba",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 108,
"avg_line_length": 31.380434782608695,
"alnum_prop": 0.6328368548666435,
"repo_name": "istarion/changelog-helper",
"id": "46dcbb7d6747e18fea6e530c4a55c397ac3c6ccf",
"s... |
from __future__ import absolute_import
from datetime import datetime, timedelta
from dateutil.parser import parse
from flask import jsonify
def fmt_date(date):
return date.strftime("%Y%m%d")
def datetime_iterator(from_date=None, to_date=None, delta=timedelta(days=1)):
from_date = from_date or datetime.now()... | {
"content_hash": "b93a92803d9aa6fc2d7b7f6483ab6925",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 79,
"avg_line_length": 32.93382352941177,
"alnum_prop": 0.5733422638981915,
"repo_name": "practo/r5d4",
"id": "ec0c5dfcba4d342dae39e4cd48d3902033bbb26c",
"size": "4479",
... |
import argparse
import json
class Inventory:
'''
Ansible inventory , generated from config file
'''
def __init__(self, fname):
self.__load_config__(fname)
def __load_config__(self, name):
with open(name) as f:
# this function is a bit ugly and should be rewritten
... | {
"content_hash": "429658927177eb5f7f2ce2022150db99",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 126,
"avg_line_length": 34.792792792792795,
"alnum_prop": 0.5406525116519938,
"repo_name": "eranr/storlets-swift-install",
"id": "77a5802fa4759fed1ec09e1d7e57432583a8b546",
... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('democracylab', '0006_auto_20200427_2336'),
('civictechprojects', '0029_projectcommit'),
]
operations = [
mi... | {
"content_hash": "cb570b3b67f5fdbc70babb724d898358",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 190,
"avg_line_length": 55.31395348837209,
"alnum_prop": 0.6056338028169014,
"repo_name": "DemocracyLab/CivicTechExchange",
"id": "e5f4d7db913ceaedff9f16563f67566543551f60",
... |
import os, sys, struct
from pyscarphase.proto import data_pb2 as data_pb
class DataReader:
'''
Read scarphase protobuf data file
<size of header>
<header>
<size of window 0>
<window 0>
<size of window 1>
<window 1>
...
'''
def __init__(self, filename, uuid=None):
... | {
"content_hash": "f8763096cbc1d1b35c3d88ba517aa2bd",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 72,
"avg_line_length": 23.27,
"alnum_prop": 0.5030081650193382,
"repo_name": "uart/scarphase",
"id": "93b55d1552d34f88cd30890584598228fa17fba6",
"size": "6240",
"binary"... |
import datetime as dt
import logging
import sys
from ..remittance import RemittanceException
def today_as_string():
now = dt.datetime.now()
return dt.datetime.strftime(now, '%Y-%m-%d')
class SageImportFile:
"""This is the code that glues a remittance document to a SageImport file. By using the methods... | {
"content_hash": "0bae89ed23b1521328afeb3fe522b1ab",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 123,
"avg_line_length": 43.97794117647059,
"alnum_prop": 0.559438221033272,
"repo_name": "drummonds/remittance",
"id": "57e7c9ec478b5bf23ba76a6694c17e996547e779",
"size": ... |
from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class Image(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout"
_path_str = "layout.image"
_valid_props = {
"layer",
"name",
... | {
"content_hash": "8fd4ff91d19e26343142d552683b798f",
"timestamp": "",
"source": "github",
"line_count": 652,
"max_line_length": 84,
"avg_line_length": 31.302147239263803,
"alnum_prop": 0.5378019501200451,
"repo_name": "plotly/python-api",
"id": "af443856fc8fae8e4c2f4998093648b7b0180752",
"size": "2... |
from m5.objects import *
from Benchmarks import *
from m5.util import *
class CowIdeDisk(IdeDisk):
image = CowDiskImage(child=RawDiskImage(read_only=True),
read_only=False)
def childImage(self, ci):
self.image.child.image_file = ci
class MemBus(CoherentXBar):
badaddr_resp... | {
"content_hash": "53ab9a26fd993b07874dbbca92f0422b",
"timestamp": "",
"source": "github",
"line_count": 524,
"max_line_length": 79,
"avg_line_length": 36.48664122137404,
"alnum_prop": 0.6175009153198389,
"repo_name": "lokeshjindal15/gem5_transform",
"id": "014849dab8f83cc1e726563ba4ed1c15dca1829e",
... |
import json
import scrapy
class DocumentItem(scrapy.Item):
# define the fields for your item here like:
name = scrapy.Field()
filename = scrapy.Field()
link = scrapy.Field()
category = scrapy.Field()
| {
"content_hash": "a6f4b0a3952fc35ca4e73cd4ac0c00b9",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 48,
"avg_line_length": 20.272727272727273,
"alnum_prop": 0.6771300448430493,
"repo_name": "JayvicWen/Crawler",
"id": "f115d20c7de1b353e6f2f0cdb291fbeead96e48b",
"size": "37... |
from __future__ import print_function
import argparse
import doctest
import fnmatch
import os
import os.path
import subprocess
import sys
import pickle
# Things to do
# ============
#
# * Cross platform build support? How can I solve the different exe suffix of Windows and Linux?
# Actually, the .exe suffix also wor... | {
"content_hash": "b25c9cc12e0381b4a05f6c00f411ad8d",
"timestamp": "",
"source": "github",
"line_count": 771,
"max_line_length": 113,
"avg_line_length": 30.61348897535668,
"alnum_prop": 0.5505656060670254,
"repo_name": "leonardoce/predo",
"id": "0302ef8a2569f36b70157b16f564fc6774b4e5b7",
"size": "23... |
from OpenGLCffi.GL import params
@params(api='gl', prms=['pname', 'param'])
def glPNTrianglesiATI(pname, param):
pass
@params(api='gl', prms=['pname', 'param'])
def glPNTrianglesfATI(pname, param):
pass
| {
"content_hash": "7fd9c39e3089526937f4206bab4e30da",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 42,
"avg_line_length": 19,
"alnum_prop": 0.6985645933014354,
"repo_name": "cydenix/OpenGLCffi",
"id": "f530dce22e8a9b5c6fbd51dfc6f654e10e6a20fa",
"size": "209",
"binary":... |
from sklearn.neural_network import MLPRegressor
from sklearn.externals import joblib # for saving parameters
from sklearn.preprocessing import StandardScaler # for feature scaling
import json
from sin_approx import get_sinusoid_params
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomposition impor... | {
"content_hash": "f51929fc6b137e426be6f23c805dc452",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 105,
"avg_line_length": 32.72093023255814,
"alnum_prop": 0.6229566453447051,
"repo_name": "vincekurtz/gracenet",
"id": "8ffefb3a76bd8c24e95d8546d2ecd734267a4493",
"size": ... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('studentgroups', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='mslstudentgroup',... | {
"content_hash": "dcd97c242bc90343e245d9196034f44a",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 143,
"avg_line_length": 29.05,
"alnum_prop": 0.5679862306368331,
"repo_name": "sussexstudent/falmer",
"id": "24293d9fe33f93bc8ad02af4a4f342826f1577f2",
"size": "1235",
"b... |
import click
from urls import IMAGES
from base_request import DigitalOcean, print_table, CONTEXT_SETTINGS
@click.group()
def image_actions_group():
"""
image actions command group
"""
pass
def validate(dic, option_list):
"""
image actions command validation
"""
for key in dic.viewkeys():
if key in option_... | {
"content_hash": "9b2da9d19a185e0fcc574992b34f57fb",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 253,
"avg_line_length": 41.026785714285715,
"alnum_prop": 0.6498367791077257,
"repo_name": "yspanchal/docli",
"id": "3d9f64adcfe0b56393800dfb485565b2c9859545",
"size": "46... |
from django.shortcuts import render
from django.http import HttpResponse
from django.template import loader
# Create your views here.
def hello_world(request):
return HttpResponse("Hello World!")
def profile(request):
template = loader.get_template('myProfile/profile.html')
context = {
'context':... | {
"content_hash": "97e2e7379b9bbe1da1d941bd1ad5043c",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 60,
"avg_line_length": 25.933333333333334,
"alnum_prop": 0.7300771208226221,
"repo_name": "kenjones21/kenWeaver",
"id": "b9abbbb07ae51f84275a5ccb3a054e84126fbbe6",
"size": ... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Article',
fields=[
... | {
"content_hash": "ddcfc71fffc2feaec04e091a904aedda",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 132,
"avg_line_length": 41.389830508474574,
"alnum_prop": 0.5581490581490581,
"repo_name": "WolfWW/django-simple-blog",
"id": "d68a8958a12136b0b2dfba0b81ec0de0032e6c82",
"s... |
import h5py
import numpy as np
import matplotlib.pyplot as plt
import scipy.integrate
filename = 'contour_0000100.h5'
h5file = h5py.File( filename, mode = "r" )
def get_source_current( h5file ):
time_step = h5file["/TimeGrid"].attrs["time_step_size"][0]
charge = h5file["/ParticleSources/cathode_emitter"].attr... | {
"content_hash": "8a56c685207434b28e0edd127c26b34c",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 87,
"avg_line_length": 38.11594202898551,
"alnum_prop": 0.6433460076045627,
"repo_name": "epicf/ef",
"id": "4b090a5fc9c89686597cbb18c452353ed43516d1",
"size": "2630",
"bi... |
"""Unit tests for datasets."""
from absl.testing import absltest
from absl.testing import parameterized
import jax
import jax.numpy as jnp
import ml_collections
from scenic.projects.vivit.data import video_tfrecord_dataset
class VideoTFRecordDatsetTest(parameterized.TestCase):
"""Unit tests for video_tfrecord_data... | {
"content_hash": "990dcd27ea11c86ddb2d719223f2eaee",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 78,
"avg_line_length": 36.70786516853933,
"alnum_prop": 0.6580961126415672,
"repo_name": "google-research/scenic",
"id": "add6ac88f1004090a8e1a6f52a26dc60226c5fca",
"size":... |
"""Fit and plot primaray beam from FHD output"""
from multiprocessing import Pool, Array
import matplotlib
import numpy as np
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from astropy.io import fits
from astropy.modeling import fitting, models
from opstats.utils.settings import MWA_FREQ_EOR_ALL_80KHZ
CENP... | {
"content_hash": "c709d131df6bb9c88e995bb849f5515d",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 78,
"avg_line_length": 30.78082191780822,
"alnum_prop": 0.6444147752558967,
"repo_name": "piyanatk/sim",
"id": "aef4ed58f55de2f20486ac9efdb379d135f72295",
"size": "2247",
... |
from setuptools import setup, find_packages
from server_tracking import __version__
setup(
name='server-side-tracking',
version=__version__,
packages=find_packages(),
url='',
license='MIT',
author='Matthias Erll',
author_email='matthias@erll.de',
install_requires=['requests', 'six'],
... | {
"content_hash": "fe4ceff90810c85ddd0ad5502c51f57d",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 80,
"avg_line_length": 26.8,
"alnum_prop": 0.6840796019900498,
"repo_name": "merll/server-side-tracking",
"id": "93ee2bd90df3e3f0651a8724c2c5954785328886",
"size": "426",
... |
import json
import re
import warnings
from os import path
import neo4j
import neo4j.api
from neo4j._async_compat.util import Util
from .. import (
fromtestkit,
test_subtest_skips,
totestkit,
)
from .._warning_check import warning_check
from ..exceptions import MarkdAsDriverException
class FrontendError(... | {
"content_hash": "947d89528a6fec6722e5e6da203247c9",
"timestamp": "",
"source": "github",
"line_count": 633,
"max_line_length": 79,
"avg_line_length": 34.11058451816746,
"alnum_prop": 0.6281956280103742,
"repo_name": "neo4j/neo4j-python-driver",
"id": "d226d1525a9be7370f14c15e5f01a4aed84f4cf7",
"si... |
__title__ = 'crossword'
__version__ = '0.1.2'
__author__ = 'Simeon Visser'
__email__ = 'simeonvisser@gmail.com'
__license__ = 'MIT'
__copyright__ = 'Copyright 2014 Simeon Visser'
from crossword.core import Crossword
from crossword.exceptions import CrosswordException
from crossword.format_ipuz import from_ipuz, to_ipu... | {
"content_hash": "2bfcc2e8531a8b6a9f24f91e2b420c97",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 52,
"avg_line_length": 33.81818181818182,
"alnum_prop": 0.7338709677419355,
"repo_name": "century-arcade/xd",
"id": "63b7acb8b458116b81ced9fb1572770fcb596748",
"size": "397... |
from fun_views.requests import make_req_data
from fun_views.views.generic.redirect import redirect_view
from tests.utils.defaults_for_tests import (default_query_string,
default_response, default_url)
from tests.utils.requests import call_view, FakeRequest
this_req_data = ma... | {
"content_hash": "cbe8a7d9dcc1ba59c83af6792fd4ac5e",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 83,
"avg_line_length": 36.4,
"alnum_prop": 0.5521978021978022,
"repo_name": "keithasaurus/django_fun_views",
"id": "a2c464fa6ade4948d8dbe4a8b9038d17970bde90",
"size": "2912... |
import os
import re
import sys
import math
import signal
import socket
import timeit
import platform
import threading
__version__ = '0.3.4'
# Some global variables we use
user_agent = None
source = None
shutdown_event = None
scheme = 'http'
# Used for bound_interface
socket_socket = socket.socket
try:
import x... | {
"content_hash": "a4828ee0515d66c2c3ea4b1b1643e9f3",
"timestamp": "",
"source": "github",
"line_count": 783,
"max_line_length": 80,
"avg_line_length": 31.30779054916986,
"alnum_prop": 0.5374887819205352,
"repo_name": "nabw/InternetControl",
"id": "07abea08f812c06af1b0910420e530d0447e1ae7",
"size": ... |
import argparse
import json
import logging
import requests
from time import sleep
class HueButtonNotPressed(Exception):
pass
###############################################################################
## START LIGHT SECTION ##
##########################################################... | {
"content_hash": "3616e62fe40d0e1bd75ddaf6f274674f",
"timestamp": "",
"source": "github",
"line_count": 502,
"max_line_length": 100,
"avg_line_length": 23.4601593625498,
"alnum_prop": 0.5772267979960941,
"repo_name": "zpriddy/zPyHue",
"id": "697e061f121160461a026415869741aa6bc12ad9",
"size": "11873... |
"""ANGLE implementation of //build/skia_gold_common/skia_gold_properties.py."""
import os
import sys
import subprocess
import sys
d = os.path.dirname
THIS_DIR = d(os.path.abspath(__file__))
ANGLE_SRC_DIR = d(d(d(d(THIS_DIR))))
sys.path.insert(0, os.path.join(ANGLE_SRC_DIR, 'build'))
CHROMIUM_SRC_DIR = d(d(ANGLE_SRC_D... | {
"content_hash": "88f2dd8cdf2826a48cbae40caf3518f5",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 81,
"avg_line_length": 29.451612903225808,
"alnum_prop": 0.6308871851040526,
"repo_name": "ppy/angle",
"id": "752de9a0e4c8ef563bb9651cd6da81b1b6a85c4d",
"size": "1080",
"... |
import csv
import timeit
import datetime
import plugin_interface as plugintypes
class PluginCSVCollect(plugintypes.IPluginExtended):
def __init__(self, file_name="collect.csv", delim=",", verbose=False):
now = datetime.datetime.now()
self.time_stamp = '%d-%d-%d_%d-%d-%d' % (
now.year,... | {
"content_hash": "482befd5eab15466bce83e02e0cc3fa7",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 75,
"avg_line_length": 30.721311475409838,
"alnum_prop": 0.5341515474919958,
"repo_name": "neurotechuoft/Wall-EEG",
"id": "d688428eda8bb358535ac3b581a6a100af364e6d",
"size"... |
from django.test import TestCase, RequestFactory
from bambu_analytics import track_event, events
class AnalyticsTrackingTestCase(TestCase):
def setUp(self):
self.factory = RequestFactory()
def test_track_page(self):
request = self.factory.get('/')
track_event(request, events.PAGE)
... | {
"content_hash": "fceb3b62df7fcff9ef637ad28a711f69",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 53,
"avg_line_length": 29.75609756097561,
"alnum_prop": 0.5360655737704918,
"repo_name": "iamsteadman/bambu-analytics",
"id": "e53fe0ac93f85c4bc6d3604ccfaf1796e9b24936",
"s... |
import logging
import abc
from sft.common.commands.base import ProgramFinished
from sft.common.config import Config
from prompt_toolkit.shortcuts import prompt, create_eventloop
from prompt_toolkit import AbortAction
from .cli.commands import Dispatcher
from .cli import is_cli_input_disabled
LOG = logging.getLogge... | {
"content_hash": "bebb4f5c14d1e448dac9e86eac39e4ec",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 81,
"avg_line_length": 25.238095238095237,
"alnum_prop": 0.6094339622641509,
"repo_name": "AlexeiBuzuma/LocalComputeNetworks",
"id": "695d003ba1d54d7eec090381b2baec706890de1f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.