text stringlengths 4 1.02M | meta dict |
|---|---|
from __future__ import print_function
import bitstring
import errno
import glob
import io
import os
import sys
from signal import signal, SIG_DFL, SIGINT
import time
import usb
signal(SIGINT, SIG_DFL)
# make sure we're using >=pyusb-1
if usb.version_info[0] < 1:
print("pyusb-1 or newer is required")
sys.exit... | {
"content_hash": "141834e4e3fc842cbbb88fa08ad28e0f",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 97,
"avg_line_length": 23.435114503816795,
"alnum_prop": 0.6342019543973941,
"repo_name": "analogdevicesinc/m1k-fw",
"id": "118b8f6affbc21c9ac4d496386f62ad8af1a6e05",
"siz... |
from jax._src.distributed import (initialize, shutdown)
| {
"content_hash": "d3ebc5d1f75cc904ad3488295b67aac7",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 55,
"avg_line_length": 56,
"alnum_prop": 0.8035714285714286,
"repo_name": "google/jax",
"id": "284ae6f95f48fb828a6001a3d532b32bfb4a0db9",
"size": "638",
"binary": false,
... |
from django.test import SimpleTestCase
from .utils import render, setup
class CommentSyntaxTests(SimpleTestCase):
@setup({'comment-syntax01': '{# this is hidden #}hello'})
def test_comment_syntax01(self):
output = render('comment-syntax01')
self.assertEqual(output, 'hello')
@setup({'com... | {
"content_hash": "09c059f56d6c0ad240897bd16721f41e",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 86,
"avg_line_length": 35.869565217391305,
"alnum_prop": 0.5987878787878788,
"repo_name": "andyzsf/django",
"id": "35c720efd7906d3acbaa57f6b91c455fb6099afd",
"size": "3300"... |
from __future__ import absolute_import
from chaco.default_colormaps import *
| {
"content_hash": "1487d46a82fc240307f4c293fb39ff77",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 38,
"avg_line_length": 38.5,
"alnum_prop": 0.7922077922077922,
"repo_name": "enthought/etsproxy",
"id": "c041b32faf4383229b020f92d27a9ede13a092ff",
"size": "92",
"binary":... |
from queue import Empty, Queue
from threading import Lock
from time import time
import pkg_resources
cb_version = pkg_resources.get_distribution("couchbase").version
if cb_version[0] == '3':
from datetime import timedelta
from couchbase.cluster import (
Cluster,
ClusterOptions,
Cluste... | {
"content_hash": "6c2d23853027f9b0297d33bb22574ed7",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 84,
"avg_line_length": 30.393548387096775,
"alnum_prop": 0.5758862237316917,
"repo_name": "couchbase/perfrunner",
"id": "12adca8bc6f966dbdda0368cf30ae764b0efc7fd",
"size":... |
from bson import ObjectId
from bson.errors import InvalidId
from pymongo import MongoClient
def get_id_filter(item_id):
"""
Function that returns a dict with an ObjectId stored as value for the key '_id'
:param item_id: the id used when creating the ObjectId
:return: the resulting dict.
"""
t... | {
"content_hash": "1520c93607cfde758021a7baa8bdfa46",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 97,
"avg_line_length": 24.310344827586206,
"alnum_prop": 0.6425531914893617,
"repo_name": "xyder/kivy-tasks-server",
"id": "a1c4e788f914ea5f143ef83c294f77802e6a691e",
"size... |
"""
Use this module to get and run all tk tests.
tkinter tests should live in a package inside the directory where this file
lives, like test_tkinter.
Extensions also should live in packages following the same rule as above.
"""
import os
import sys
import unittest
import importlib
import test.support
this_dir_path ... | {
"content_hash": "0b1afcd2c35bbb201dd6ea446e38de4c",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 78,
"avg_line_length": 31.788732394366196,
"alnum_prop": 0.590607000443066,
"repo_name": "ms-iot/python",
"id": "dbe5e88c1430e9630c285f6395dc884d60035759",
"size": "2257",
... |
'''Run a perceptual diff test locally.
To run:
source ./common.sh
./dpxdt/tools/local_pdiff.py test dpxdt/tools/local_pdiff_demo
This will run the tests described in dpxdt/tools/local_pdiff_demo/*.yaml.
See those files for details.
'''
import copy
import fnmatch
import glob
import json
import logging
import ... | {
"content_hash": "c0f98133cb0f34c0de1c5daf0a5c53bb",
"timestamp": "",
"source": "github",
"line_count": 517,
"max_line_length": 97,
"avg_line_length": 34.72147001934236,
"alnum_prop": 0.5939501977605705,
"repo_name": "weeksghost/dpxdt",
"id": "bd906254c8a94603f847df9b02571c8f2483e3e0",
"size": "179... |
from plenum.common.constants import DOMAIN_LEDGER_ID
from plenum.common.messages.fields import BlsMultiSignatureValueField, TimestampField
from plenum.common.util import get_utc_epoch
from plenum.test.input_validation.utils import b58_by_len
validator = BlsMultiSignatureValueField()
state_root_hash = b58_by_len(32)
po... | {
"content_hash": "23568ff12be46d543735f35e4fcb0023",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 85,
"avg_line_length": 35.03389830508475,
"alnum_prop": 0.4765360425737784,
"repo_name": "evernym/plenum",
"id": "731155a58f531a2e23fb4ead35d42b19220e744c",
"size": "2067",... |
from oslo_concurrency import processutils
from oslo_config import cfg as openstack_cfg
from trove.cmd.common import with_initialize
opts = [
openstack_cfg.BoolOpt('fork', short='f', default=False, dest='fork'),
openstack_cfg.StrOpt('pid-file', default='.pid'),
openstack_cfg.StrOpt('override-logfile', def... | {
"content_hash": "68ada6967e5b4c14e163db9ecd831519",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 73,
"avg_line_length": 30.442307692307693,
"alnum_prop": 0.6538218572331017,
"repo_name": "fabian4/trove",
"id": "30ffadaefefd2c64628bd70304a8653b64094bec",
"size": "2218",... |
""" Configuration utilities.
"""
# Copyright © 2015 Jürgen Hermann <jh@web.de>
#
# 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 r... | {
"content_hash": "6138ae02fa5387369d3c0a98aec13ca8",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 110,
"avg_line_length": 34.661764705882355,
"alnum_prop": 0.6682223165040305,
"repo_name": "jhermann/gh-commander",
"id": "2096c1115106b344d561ef66958518eb79826058",
"size"... |
"""Tokenization help for Python programs.
This module exports a function called 'tokenize()' that breaks a stream of
text into Python tokens. It accepts a readline-like method which is called
repeatedly to get the next line of input (or "" for EOF) and a "token-eater"
function which is called once for each token foun... | {
"content_hash": "ebd2f69b9a623eba2e0be2b5222ae0f0",
"timestamp": "",
"source": "github",
"line_count": 240,
"max_line_length": 80,
"avg_line_length": 42.525,
"alnum_prop": 0.47070350774054476,
"repo_name": "Integral-Technology-Solutions/ConfigNOW-4.3",
"id": "2af595daea44425dc0a46b9717d836d8ebfd9197... |
import scrollphat
from pijobs.scrollphatjob import ScrollphatJob
class MatrixJob(ScrollphatJob):
# matrix is an array of strings with 55 1 or 0
def run(self):
for matrix_string in self.options['matrix']:
matrix = self.convert_to_matrix(list(matrix_string))
self.update_matrix(mat... | {
"content_hash": "4a6e7aff275a9ed1bf14b3ccad60d5f4",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 65,
"avg_line_length": 33.125,
"alnum_prop": 0.5728301886792453,
"repo_name": "ollej/piapi",
"id": "a8e8edd52f042ca7ac8c47712d8e42e1380f52a5",
"size": "1325",
"binary": f... |
"""
Copyright (c) 2021 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute... | {
"content_hash": "9f5386766d95d52160ad8c37bc51f5c9",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 128,
"avg_line_length": 29.493506493506494,
"alnum_prop": 0.667107001321004,
"repo_name": "alexforencich/xfcp",
"id": "12a06efa0a5efb08951b982a17eae5bee33fc288",
"size": "... |
import wallaby.backends.couchdb as couch
import wallaby.backends.elasticsearch as es
from wallaby.frontends.qt.baseWindow import *
from wallaby.pf.peer.searchDocument import *
import wallaby.frontends.qt.resource_rc as resource_rc
from UI_mainWindow import *
import app_rc
class MainWindow(BaseWindow, Ui_MainWindow... | {
"content_hash": "97615faaa54edec8039279784cbd891d",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 104,
"avg_line_length": 33.6,
"alnum_prop": 0.6711309523809523,
"repo_name": "FreshXOpenSource/wallaby-app-inspector",
"id": "807c478a2394b3ea64acc1768ab6204ad76bef73",
"si... |
class Solution(object):
def wordPattern(self, pattern, str):
"""
:type pattern: str
:type str: str
:rtype: bool
"""
words = str.split()
# set default returns the value if it exists, if not sets the default
f = lambda keys: map({}.setdefault, keys, xran... | {
"content_hash": "63cf601e3b3bdd5e0cc858e503e7fc33",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 77,
"avg_line_length": 33.90909090909091,
"alnum_prop": 0.5576407506702413,
"repo_name": "young-geng/leet_code",
"id": "c6b02f8cb6781db3d0571f10978337999dcdc535",
"size": "... |
from nova import block_device
from nova.cells import opts as cells_opts
from nova.cells import rpcapi as cells_rpcapi
from nova import db
from nova import exception
from nova.i18n import _
from nova import objects
from nova.objects import base
from nova.objects import fields
from nova.openstack.common import log as log... | {
"content_hash": "0a681b71a5cdd4168de2297005d1e0c1",
"timestamp": "",
"source": "github",
"line_count": 238,
"max_line_length": 79,
"avg_line_length": 39.78151260504202,
"alnum_prop": 0.5799535276721588,
"repo_name": "jumpstarter-io/nova",
"id": "218fea742c561a5b20e9f5a575a11e50bd107cd3",
"size": "... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import json
import os
from pants.base.exceptions import TaskError
from pants.task.repl_task_mixin import ReplTaskMixin
from pants.util.contextutil import pushd, tempo... | {
"content_hash": "1768e1ac3ed9355438565c893bf3cc6d",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 96,
"avg_line_length": 43.08974358974359,
"alnum_prop": 0.6878905087771496,
"repo_name": "fkorotkov/pants",
"id": "6e5516548d53f318a0dfb2fbb5dc11bc4023b82f",
"size": "3508"... |
import hashlib
import os
import shutil
import sys
script_dir = os.path.dirname(os.path.realpath(__file__))
src_build_dir = os.path.abspath(os.path.join(script_dir, os.pardir))
sys.path.insert(0, src_build_dir)
import vs_toolchain
def _HexDigest(file_name):
hasher = hashlib.sha256()
afile = open(file_name, 'rb')... | {
"content_hash": "bf1332dce2f0f26b4f8161747c12705b",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 79,
"avg_line_length": 34.535353535353536,
"alnum_prop": 0.6809008482012284,
"repo_name": "danakj/chromium",
"id": "ea6ab3f4b304c1cf5fa0f28dfe6156362d5c038d",
"size": "3604... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('sprints', '0001_initial'),
('tasks', '0002_auto_20140830_2253'),
]
operations = [
migrations.AddField(
model_name='task',
... | {
"content_hash": "82d649a786d763665a28157699b5c5fc",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 80,
"avg_line_length": 23.7,
"alnum_prop": 0.5822784810126582,
"repo_name": "mc706/task-burndown",
"id": "74d2e914f21f7559d2af7c3616690ca9fefa39d5",
"size": "498",
"binar... |
"""flavors: an implementation of the flavor management storage
controller for sqlalchemy.
"""
import oslo_db.exception
import sqlalchemy as sa
from zaqar.storage import base
from zaqar.storage import errors
from zaqar.storage.sqlalchemy import tables
from zaqar.storage.sqlalchemy import utils
class FlavorsControll... | {
"content_hash": "5f24365da13a3d204c9e0371eede83b2",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 79,
"avg_line_length": 31.984375,
"alnum_prop": 0.5967269174401564,
"repo_name": "openstack/zaqar",
"id": "819bee37a876e3b2072d4fed574d98e6e89b6770",
"size": "4684",
"bi... |
import os.path
from pex.build_system.pep_517 import build_sdist
from pex.build_system.testing import assert_build_sdist
from pex.common import touch
from pex.pip.version import PipVersion
from pex.resolve.configured_resolver import ConfiguredResolver
from pex.result import Error
from pex.testing import make_project
fr... | {
"content_hash": "77adb0fa61aff9aa452ac038780a64b2",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 98,
"avg_line_length": 32.2,
"alnum_prop": 0.7035573122529645,
"repo_name": "pantsbuild/pex",
"id": "391de30be354a10acbcb8fcdea3130bf06eaadc0",
"size": "1903",
"binary": ... |
"""Run a server displaying the administrative UI for the application."""
import logging
import os.path
import google
import jinja2
import webapp2
from google.appengine.tools.devappserver2.admin import admin_request_handler
from google.appengine.tools.devappserver2.admin import blobstore_viewer
from google.appengine... | {
"content_hash": "ee7b5811086462688e4c51d9fac1cb0c",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 80,
"avg_line_length": 47.34905660377358,
"alnum_prop": 0.722056186491333,
"repo_name": "elsigh/browserscope",
"id": "96d82e12f33d3c10e2a6fe26dab1b9c0641d3cad",
"size": "5... |
from http import HTTPStatus
from unittest import mock
import ddt
import webob
from cinder.api.contrib import qos_specs_manage
from cinder import context
from cinder import db
from cinder import exception
from cinder import objects
from cinder.tests.unit.api import fakes
from cinder.tests.unit import fake_constants as... | {
"content_hash": "663a011fabf96b34d4333c0439396108",
"timestamp": "",
"source": "github",
"line_count": 785,
"max_line_length": 79,
"avg_line_length": 47.38980891719745,
"alnum_prop": 0.5682911749684149,
"repo_name": "mahak/cinder",
"id": "1590ddff60db19651a42b1c01d95abec12f7dabe",
"size": "37864",... |
'''
Created on 6 janv. 2014
@author: didia
'''
from shop.handlers.base_handler import RpcBaseHandler
from market.handlers.main import RpcMainGetEvents
from market.lib import event_review
from market.lib.attendance import AttendanceManager
from market.lib.event import EventManager
from market.market_exceptions import ... | {
"content_hash": "104a3bf42943c7d8f21495623246b8db",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 91,
"avg_line_length": 36.513888888888886,
"alnum_prop": 0.6146823887409661,
"repo_name": "EventBuck/EventBuck",
"id": "1fce365349897e57418dc29457d3dd3207775612",
"size": "... |
from ipdb import launch_ipdb_on_exception
from packagesample import start
with launch_ipdb_on_exception():
start.main()
| {
"content_hash": "501fceefcc60c667d4957efe393dea66",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 41,
"avg_line_length": 25,
"alnum_prop": 0.776,
"repo_name": "lovato/machete",
"id": "c269bee975fcb74fd396911b0b0f2aa322b17665",
"size": "187",
"binary": false,
"copies"... |
import inspect
import inflection
from marshmallow import Schema, fields
from pillowtalk.exceptions import PillowtalkError
from pillowtalk.relationship import Relationship
from pillowtalk.utils import validate_init
# TODO: Ability to add relationships without relationship string interpretation
# TODO: Wrap model col... | {
"content_hash": "d2282644b29428a431a9996bceaa061f",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 131,
"avg_line_length": 39.71219512195122,
"alnum_prop": 0.6197027392212259,
"repo_name": "jvrana/Pillowtalk",
"id": "fcc704b12c082adcc02b5950dccb2f9e5b638de7",
"size": "8... |
from cms.admin.dialog.forms import get_copy_dialog_form
from django.shortcuts import render_to_response, get_object_or_404
from django.contrib.admin.views.decorators import staff_member_required
from django.http import Http404, HttpResponse
from django.conf import settings
from cms.models import Page
@staff_member_req... | {
"content_hash": "9c24cc55d10ddf102eee42bd233f2159",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 73,
"avg_line_length": 37.84,
"alnum_prop": 0.7029598308668076,
"repo_name": "emiquelito/django-cms-2.0",
"id": "f7264d89247663cd466f161ae8db1fc4b69e2f6a",
"size": "946",
... |
import roslib;
import rospy
import smach
import smach_ros
import os
from gazebo_msgs.srv import (
SpawnModel,
DeleteModel,
)
import os
from sensor_msgs.msg import JointState
import struct
import rospy
from std_msgs.msg import Header
from baxter_core_msgs.srv import (
SolvePositionIK,
Sol... | {
"content_hash": "cec8c3955151f0327e50462ff547ae38",
"timestamp": "",
"source": "github",
"line_count": 649,
"max_line_length": 150,
"avg_line_length": 41.59784283513097,
"alnum_prop": 0.5236507760121495,
"repo_name": "abr-ijs/baxter_smacha",
"id": "c9e28f1b1a374f93794bcf7b39e142018ff4d5fb",
"size"... |
"""Creates files required to feed into trybot_commit_size_checker"""
import argparse
import json
import logging
import os
import shutil
import subprocess
_SRC_ROOT = os.path.normpath(
os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
_RESOURCE_SIZES_PATH = os.path.join(_SRC_ROOT, 'build', 'android',
... | {
"content_hash": "e051e9b477b6414deeefa08978cf099b",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 80,
"avg_line_length": 35.6875,
"alnum_prop": 0.6553804242070441,
"repo_name": "scheib/chromium",
"id": "ca2b7cebefb8a17a7f64d45231a1fc4b29d188fa",
"size": "5344",
"bina... |
"""Implementation of the Image-to-Image Translation model.
This network represents a port of the following work:
Image-to-Image Translation with Conditional Adversarial Networks
Phillip Isola, Jun-Yan Zhu, Tinghui Zhou and Alexei A. Efros
Arxiv, 2017
https://phillipi.github.io/pix2pix/
A reference implementa... | {
"content_hash": "a8a44b34abde7d15faba40fc41001320",
"timestamp": "",
"source": "github",
"line_count": 279,
"max_line_length": 80,
"avg_line_length": 32.34767025089606,
"alnum_prop": 0.639224376731302,
"repo_name": "tombstone/models",
"id": "9e0e5708145f953a0b947fec85d53f30e1106c20",
"size": "9709... |
"""Support for the Hive alarm."""
from datetime import timedelta
from homeassistant.components.alarm_control_panel import AlarmControlPanelEntity
from homeassistant.components.alarm_control_panel.const import (
SUPPORT_ALARM_ARM_AWAY,
SUPPORT_ALARM_ARM_NIGHT,
)
from homeassistant.config_entries import ConfigEn... | {
"content_hash": "4accde3da59fa15ba1901f4343a97b60",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 84,
"avg_line_length": 32.40384615384615,
"alnum_prop": 0.6670623145400594,
"repo_name": "rohitranjan1991/home-assistant",
"id": "4a0ad577f90f88f900418ddf3efe7ff693900e8b",
... |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
from django.conf import settings
from django.db import IntegrityError
from spirit.signals.topic import topic_viewed
from ..utils import paginator
class CommentBookmark(models.Model):
... | {
"content_hash": "7b6b3f1762ed7aeb855ae7895a7b3e90",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 101,
"avg_line_length": 34.89090909090909,
"alnum_prop": 0.6310578426263679,
"repo_name": "bjorncooley/rainforest_makers",
"id": "66863dbdf71f546244418eda58b620371816983f",
... |
from django.db import connection
def make_key(key, key_prefix, version):
"""
Tenant aware function to generate a cache key.
Constructs the key used by all other methods. Prepends the tenant
`schema_name` and `key_prefix'.
"""
return '%s:%s:%s:%s' % (connection.schema_name, key_prefix, version... | {
"content_hash": "6f40dc6af90189cbce782a98adef5377",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 77,
"avg_line_length": 25.5,
"alnum_prop": 0.6588235294117647,
"repo_name": "honur/django-tenant-schemas",
"id": "9a4a536c5a798f418c117bb454fd9e85dffdadb6",
"size": "510",
... |
import re
def pointer(string):
string = str(string)[::-1]
splitted = re.split("(\d\d\d)", string)
final = [x for x in splitted if x is not '']
return ".".join(final)[::-1]
print pointer( raw_input("Your number ->") )
| {
"content_hash": "5e52a75a25ca354c2aecd2b393a6ca13",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 48,
"avg_line_length": 26.22222222222222,
"alnum_prop": 0.5847457627118644,
"repo_name": "SGanT/olymp",
"id": "7d41b275a297349bc041257adb35e2c095ed543e",
"size": "236",
"b... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('zilencer', '0008_customer_billing_user'),
]
operations = [
migrations.CreateModel(
name='Plan',
fields=[
('id', models.AutoField(auto_created=True, p... | {
"content_hash": "f8d9c5b5764866b5c5f9c7860ffb4fbc",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 114,
"avg_line_length": 29.789473684210527,
"alnum_prop": 0.5671378091872792,
"repo_name": "brainwane/zulip",
"id": "05c73567459f87ee2678f94da6826cfb5654dfa4",
"size": "617... |
import subprocess
from radiopadre.file import FileBase
from radiopadre.render import render_url, render_error
from radiopadre import imagefile
class PDFFile(FileBase):
def __init__(self, *args, **kw):
FileBase.__init__(self, *args, **kw)
def render_html(self,**kw):
return self.render_thumb(**... | {
"content_hash": "75b05c11b9087cc1ddeaa507deff06f1",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 113,
"avg_line_length": 39.48148148148148,
"alnum_prop": 0.6303939962476548,
"repo_name": "radio-astro/radiopadre",
"id": "9c8ba414f45620da3e17c8a4d11e591bdf4b4cc0",
"size"... |
import bee
from bee.segments import *
import spyder, Spyder
import spyder.formtools
import libcontext
class externblock(object):
metaguiparams = {"spydertype": "type"}
def __new__(cls, spydertype):
assert spyder.validvar2(spydertype), spydertype
class externblock(bee.worker):
blo... | {
"content_hash": "cdd32d11d7347a96546fe1dca643e6cd",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 67,
"avg_line_length": 25.954545454545453,
"alnum_prop": 0.5350262697022767,
"repo_name": "agoose77/hivesystem",
"id": "ba24219eb741c77d70350a4ce620a771a56f71bb",
"size": "... |
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):
def forwards(self, orm):
# Deleting field 'InstitutionUserProfile.user'
db.delete_column(u'heliosinstitution_institutionus... | {
"content_hash": "80f3a4bd3bec0a7af1df3aa0d18920a7",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 166,
"avg_line_length": 59.25806451612903,
"alnum_prop": 0.5860097985846489,
"repo_name": "shirlei/helios-server",
"id": "7d645e0ca94a0d953a09be4d1721373d33c04aeb",
"size":... |
from __future__ import division, absolute_import, print_function
# Code common to build tools
import sys
from os.path import join
import warnings
import copy
import binascii
from distutils.ccompiler import CompileError
#-------------------
# Versioning support
#-------------------
# How to change C_API_VERSION ?
# ... | {
"content_hash": "5b6ddb4b95468f9e03619cd49d6cff95",
"timestamp": "",
"source": "github",
"line_count": 305,
"max_line_length": 86,
"avg_line_length": 39.22950819672131,
"alnum_prop": 0.5691600501462599,
"repo_name": "ogrisel/numpy",
"id": "1f3e6b44edc4a694e2aed1ce3ebf60e5c927fc48",
"size": "11965"... |
"""
Django settings for blog project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
impor... | {
"content_hash": "73f80b5611f44c45c9a8f141e3c4c38c",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 71,
"avg_line_length": 24.476190476190474,
"alnum_prop": 0.7232490272373541,
"repo_name": "caulagi/django-adminapi",
"id": "d259abd34e804088c5551ed68fcdf72393c8b1cf",
"size... |
import sys
import unittest
import unittest.mock
from test import support
from test.support import import_helper
from test.support import os_helper
from test.support import socket_helper
from test.support import threading_helper
from test.support import warnings_helper
import socket
import select
import time
import enum... | {
"content_hash": "a0c57d1d8227b69d8fa288c99f58de22",
"timestamp": "",
"source": "github",
"line_count": 5072,
"max_line_length": 118,
"avg_line_length": 42.57117507886435,
"alnum_prop": 0.5686061105682171,
"repo_name": "brython-dev/brython",
"id": "3b3b869bb53acdc4130ca949d9df92e3c2babfed",
"size":... |
from oslo_log import log as logging
from trove.common import cfg
from trove.common import exception
from trove.common.remote import create_nova_client
from trove.common import utils
from trove.db import get_db_api
from trove.db import models as dbmodels
from trove.flavor.models import Flavor as flavor_model
LOG = lo... | {
"content_hash": "c0c010f0f53dce10ba903b6507a86ce5",
"timestamp": "",
"source": "github",
"line_count": 651,
"max_line_length": 79,
"avg_line_length": 32.70353302611367,
"alnum_prop": 0.5881634570220761,
"repo_name": "fabian4/trove",
"id": "d23771a6f5f4bd1b526ca4b22cfca8df811f5428",
"size": "22020"... |
from __future__ import division, absolute_import, print_function
import numpy as np
import unittest
from svgpathtools.bezier import *
from svgpathtools.path import bpoints2bezier
class HigherOrderBezier:
def __init__(self, bpoints):
self.bpts = bpoints
def bpoints(self):
return self.bpts
... | {
"content_hash": "9a64bd8f481af116024ea66aeb2d1b7b",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 80,
"avg_line_length": 30.103448275862068,
"alnum_prop": 0.56815578465063,
"repo_name": "jpcofr/svgpathtools",
"id": "4c82e93e83447edf4186ee7bbce239abb64a2e78",
"size": "17... |
import os
import ycm_core
flags = [
'-x',
'c++',
'-D_REENTRANT',
'-I/usr/include/SDL2',
'-Wall',
'-std=c++11',
]
# Set this to the absolute path to the folder (NOT the file!) containing the
# compile_commands.json file to use that instead of 'flags'. See here for
# more details: http://clang.... | {
"content_hash": "93a55602c9f1dd7b1f1a1ffd3aa267c5",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 79,
"avg_line_length": 30.10091743119266,
"alnum_prop": 0.6747942700396221,
"repo_name": "gentili/glogin",
"id": "baf666860f72d2ecb47ebcd811f4868ea377798a",
"size": "4741"... |
from setuptools import setup, find_packages
setup(name='nlptoolkit',
version='0.1',
description='My minimal NLP tools for Biocreative IV contest',
author='Chia-Jung, Yang',
author_email='jeroyang@gmail.com',
packages=find_packages(),
url = "https://github.com/jeroyang/nlptoolkit",
)... | {
"content_hash": "1c24db2ae5a8058bac92abb395207537",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 68,
"avg_line_length": 29.272727272727273,
"alnum_prop": 0.6708074534161491,
"repo_name": "jeroyang/nlptoolkit",
"id": "e772d096107323ec502e44a57847251d6d4b1499",
"size": "... |
"""Implementation of Unix-like stat command for cloud storage providers."""
from __future__ import absolute_import
import logging
import sys
from gslib.bucket_listing_ref import BucketListingObject
from gslib.cloud_api import AccessDeniedException
from gslib.cloud_api import NotFoundException
from gslib.command impo... | {
"content_hash": "a7c30c53c27cc7681b3106a61baea847",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 80,
"avg_line_length": 35.856115107913666,
"alnum_prop": 0.6936195826645265,
"repo_name": "dtjackson/gsutil",
"id": "4d215f77f79a7c552499aa2aebe69359106e2182",
"size": "56... |
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):
def forwards(self, orm):
# Adding model 'TenenciaEntre'
db.create_table(u'monitoreo_tenenciaentre', (
(u'id', ... | {
"content_hash": "8bd5b0b2bd2424773790d7856f3be559",
"timestamp": "",
"source": "github",
"line_count": 349,
"max_line_length": 195,
"avg_line_length": 65.28939828080229,
"alnum_prop": 0.580839111735276,
"repo_name": "shiminasai/ciat_plataforma",
"id": "31397010bac945b50fbe48c05eec38cac4d7ca0c",
"s... |
from __future__ import division
import numpy as np
import LightFields
# def lf_to_depth(lightfield):
# """
# convert light field data into a 3D volume
# NOT YET IMPLEMENTED
# """
# pass | {
"content_hash": "39e74492f328f71d9d35ca0276971e67",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 45,
"avg_line_length": 13.2,
"alnum_prop": 0.6717171717171717,
"repo_name": "thanasi/pylifi",
"id": "ef1acc5f6b24f46b02f20ea8f78e5dd5f1f1ca37",
"size": "384",
"binary": f... |
import six
from nova import objects
from nova.objects import base
from nova.objects import fields
from nova.objects import instance as obj_instance
from nova.virt import hardware
@base.NovaObjectRegistry.register
class RequestSpec(base.NovaObject):
# Version 1.0: Initial version
# Version 1.1: ImageMeta vers... | {
"content_hash": "0d85cb946ef7549a49546ad1d0880965",
"timestamp": "",
"source": "github",
"line_count": 366,
"max_line_length": 79,
"avg_line_length": 44.50273224043716,
"alnum_prop": 0.6218688605108055,
"repo_name": "devendermishrajio/nova",
"id": "12c6554d68f4121e669e7ad61fca7231870944ac",
"size"... |
from insights.combiners.krb5 import AllKrb5Conf
from insights.parsers.krb5 import Krb5Configuration
from insights.tests import context_wrap
KRB5CONFIG = """
# Configuration snippets may be placed in this directory as well
includedir /etc/krb5.conf.d/
include /etc/krb5test.conf
module /etc/krb5test.conf:residual
[log... | {
"content_hash": "2e620f1e1233ea295b3a44d95f09afff",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 91,
"avg_line_length": 31.10112359550562,
"alnum_prop": 0.7102601156069365,
"repo_name": "wcmitchell/insights-core",
"id": "f3a22315faacf33ce95e1049204cf2f08c4d70a9",
"size... |
import os
import django
def populate():
alltags = {
'python': add_tag('python'),
'tutorial': add_tag('tutorial'),
'django': add_tag('django'),
'bottlepy': add_tag('bottlepy'),
'bottle': add_tag('bottle'),
'flask': add_tag('flask')
}
add_link(tags=[alltags['p... | {
"content_hash": "2be875c7453fcbf8b5987da52441531a",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 73,
"avg_line_length": 30.865671641791046,
"alnum_prop": 0.6058994197292069,
"repo_name": "gmeyer1/CMPUT410lab7",
"id": "0fd77a35f5ebab5a7aae136540d2b017664219c7",
"size": ... |
from dnutils import logs
from .infer import Inference
from .exact import EnumerationAsk
logger = logs.getlogger(__name__)
class IPFPM(Inference):
""" the iterative proportional fitting procedure applied at the model level (IPFP-M) """
def __init__(self, mrf):
# check if there's any soft eviden... | {
"content_hash": "6a59c0dcd7d06167616d904328800047",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 243,
"avg_line_length": 54.425,
"alnum_prop": 0.6132292145153881,
"repo_name": "danielnyga/pracmln",
"id": "74278cf56105d8b2935c1d85b1eb55b831f3e5bd",
"size": "3339",
"bi... |
from msrest.serialization import Model
class SecurityGroupViewResult(Model):
"""The information about security rules applied to the specified VM.
:param network_interfaces: List of network interfaces on the specified VM.
:type network_interfaces:
list[~azure.mgmt.network.v2017_09_01.models.SecurityG... | {
"content_hash": "05dd70df4c5983cc2f48a5ffdfef8cc3",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 102,
"avg_line_length": 37.27777777777778,
"alnum_prop": 0.7034277198211625,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "f577cd5e908bc9436c5f3a33bfb87e6ae8f87bd4",
... |
'''
XXX missing doc string
'''
class NoResponseError(Exception):
pass
class UsageError(Exception):
pass
class PlayerNotFound(Exception):
pass
class ServerPasswordNotSet(Exception):
pass
| {
"content_hash": "e7b338e68d4102d3ba74225ca569ebc4",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 38,
"avg_line_length": 12.235294117647058,
"alnum_prop": 0.7211538461538461,
"repo_name": "JnyJny/PyRcon",
"id": "2eecb2e4600e0f1adf92f42491ee209602d43645",
"size": "208",
... |
from pysnmp.proto import errind, error
class AbstractAuthenticationService:
serviceID = None
def hashPassphrase(self, authKey):
raise error.ProtocolError(errind.noAuthentication)
def localizeKey(self, authKey, snmpEngineID):
raise error.ProtocolError(errind.noAuthentication)
# 7.2.4.... | {
"content_hash": "2ad6c1964ddf27e5ef9ea922a20c97c6",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 73,
"avg_line_length": 32.611111111111114,
"alnum_prop": 0.7427597955706985,
"repo_name": "mith1979/ansible_automation",
"id": "4f57559d90288027328bc98fe029f43f4e117793",
"... |
import concurrent
import copy
import functools
import importlib
import itertools
import logging
import os
import sys
logger = logging.getLogger(__name__)
def update(dictionary, other = (), **kwargs):
'''Update ``dictionary`` and return result.
Used dict.update, and those semantics apply. We extend that beh... | {
"content_hash": "1d17bf7789dcae75df47b15029ba8c19",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 199,
"avg_line_length": 26.331491712707184,
"alnum_prop": 0.5778430549727235,
"repo_name": "alunduil/muniments",
"id": "29b898705a178600fd351f4335ed4bc1487b5cb9",
"size": ... |
import sys
import os
__all__ = [u'project_configuration']
class LazyConfiguration(object):
def __init__(self):
self._configuration = None
def _get_confuguration_class(self):
from jetee.runtime.app import dispatcher
sys.path.insert(0, os.getcwd())
try:
configurati... | {
"content_hash": "2a85e4093c3d48db24a29571abe39fba",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 119,
"avg_line_length": 37.073170731707314,
"alnum_prop": 0.6059210526315789,
"repo_name": "WhackoJacko/Jetee",
"id": "cd7cc014f03cf617089dd168fdc09663a296a001",
"size": "1... |
__author__ = 'satish'
from xml.dom import minidom
import pickle
'''
Feature List:
title
gd:feedLink --- countHint
media:description
yt:duration --- seconds
gd:rating --- average --- max --- numRaters
yt:statistics (--- favoriteCount) --- viewCount
yt:rating --- numDislikes --- numLikes
Feature Tuple:
(title,mediaD... | {
"content_hash": "2ef822a942fa1a650199a1612f54e064",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 100,
"avg_line_length": 23.974683544303797,
"alnum_prop": 0.6246040126715945,
"repo_name": "tpsatish95/Youtube-Comedy-Comparison",
"id": "8ad3e6a92825c275930e38e8dc15c3215d4b... |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def ClusterConfigSpec(vim, *args, **kwargs):
'''A complete cluster configuration. All fiel... | {
"content_hash": "f4ec2f43bee4d1f0340111cd74542752",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 124,
"avg_line_length": 33.88235294117647,
"alnum_prop": 0.609375,
"repo_name": "xuru/pyvisdk",
"id": "6b20f8126884936df9f05ab161770766fbb0a60d",
"size": "1153",
"binary"... |
import json, requests, hashlib
from requests.auth import HTTPBasicAuth
config = json.load(open("config.json"))
philds = {
"email_addr":"emails",
"phone_num":"phones",
"bitcoin_addr":"bitcoins",
"pgp_key_ls":"pgps",
"pgp_key_hash": "pgp hashes",
"org": "organizations",
"person_name":"people",
"gpe": "g... | {
"content_hash": "76b6436c264b798bbb0a54a1bbfb21b4",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 188,
"avg_line_length": 34.375,
"alnum_prop": 0.6318181818181818,
"repo_name": "jgawrilo/butler_server",
"id": "9bfc55936af293eeee588f7960de830bbea314d6",
"size": "1100",
... |
from django.db import models
from django.core.urlresolvers import reverse
from django.contrib.contenttypes.models import ContentType
try: # new import added in Django 1.7
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.fields import GenericRelation
except Impor... | {
"content_hash": "9025fe198e4288f27c3fb9ae20365cb6",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 79,
"avg_line_length": 31.32894736842105,
"alnum_prop": 0.7303653926921462,
"repo_name": "saulshanabrook/django-dumper",
"id": "8d5580d54e3396f66169806cc2638644edb49513",
"... |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
def check_array_result(object_array, to_match, expected):
"""
Pass in array of JSON objects, a dictionary with key/value pairs
to match against, and another dictionary with expected key/value
pairs.
""... | {
"content_hash": "25bf9bed75513c1bdbcf8b5125c00af8",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 105,
"avg_line_length": 48.37362637362637,
"alnum_prop": 0.5070422535211268,
"repo_name": "bitcoinsSG/zcash",
"id": "4df8d795d051004b5ee32a245b9a1379f9464e50",
"size": "464... |
from django.db import transaction
from django.dispatch import Signal
try:
import thread
except ImportError:
import dummy_thread as thread
class BadlyBehavedTransactionSignalHandlerError(Exception):
'''
Exception raised when a post_commit or post_rollback handler updates the
current transaction an... | {
"content_hash": "b7da04c7b8f7b9716aac07e95a5f6ee2",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 78,
"avg_line_length": 32.41847826086956,
"alnum_prop": 0.667393126571668,
"repo_name": "davehughes/django-transaction-signals",
"id": "68921ace0aac8988c1cc0cf36a5bf91f81e2e... |
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
# Create your models here.
class StorageLocation(models.Model):
name = models.CharField(max_length=50)
def __str__(self):
return self.name
class Category(models.Model):
class Meta:
verbose_name_plu... | {
"content_hash": "4067fd7ea82d08c5753c7e55ec493ff9",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 78,
"avg_line_length": 27.795454545454547,
"alnum_prop": 0.6925592804578904,
"repo_name": "Feasoron/red-squirrel",
"id": "3b7efab4eea6df9b2fe465b0ea498660605a2e1f",
"size":... |
"""
Code for computing edit distances.
"""
import sys
import operator
from typing import Optional, Sequence
INSERT: str = "insert"
DELETE: str = "delete"
EQUAL: str = "equal"
REPLACE: str = "replace"
# Cost is basically: was there a match or not.
# The other numbers are cumulative costs and matches.
def lowest_co... | {
"content_hash": "1ebfe3e77e3987e99a66cbfc5af6068c",
"timestamp": "",
"source": "github",
"line_count": 401,
"max_line_length": 88,
"avg_line_length": 31.600997506234414,
"alnum_prop": 0.5420612373737373,
"repo_name": "belambert/edit-distance",
"id": "6119bc1ea1e8a93c930b0667d9198ef903d02a37",
"siz... |
from nailgun.db.sqlalchemy.models.cluster_plugin_link import ClusterPluginLink
from nailgun.test.base import BaseIntegrationTest
from nailgun.utils import reverse
from oslo_serialization import jsonutils
class TestHandlers(BaseIntegrationTest):
def setUp(self):
super(TestHandlers, self).setUp()
s... | {
"content_hash": "2cbd9ac9db01f3f3053bc6b0f312d85f",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 78,
"avg_line_length": 39.87128712871287,
"alnum_prop": 0.5776011919543084,
"repo_name": "huntxu/fuel-web",
"id": "33be3b3ba07e689884221a9cc0b85f1e446df9c1",
"size": "4662... |
from __future__ import division
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
import time, re, datetime
import jinja2
import os
import json
import math
import numpy
jinja_environment = jinja2.Environment(loader=jinja2.FileSystem... | {
"content_hash": "a26230af55d48904be63295149f54e2a",
"timestamp": "",
"source": "github",
"line_count": 370,
"max_line_length": 172,
"avg_line_length": 30.437837837837836,
"alnum_prop": 0.6924169774462795,
"repo_name": "jfitz/interact-data-analysis",
"id": "fb7b2d11d649f8240efcba94a049304120456dd8",
... |
from unittest import TestCase
import datetime
import sys
if sys.version_info[0] == 3:
unicode_str = '\u2603'
else:
unicode_str = unicode('snowman')
import validictory
class TestType(TestCase):
def test_schema(self):
schema = {
"type": [
{"type": "array", "minItems": ... | {
"content_hash": "21ea92a8fd2330ffabdf7e058f79f5a5",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 75,
"avg_line_length": 32.972972972972975,
"alnum_prop": 0.5286885245901639,
"repo_name": "ahassany/validictory",
"id": "e65381a8d0ca474bdc9a64180ec3a6de643c314e",
"size":... |
__author__ = 'abdul'
import os
from mongoctl.processes import create_subprocess
from mongoctl.mongoctl_logging import *
from mongoctl import repository
from mongoctl.utils import execute_command
###############################################################################
# CONSTS
#################################... | {
"content_hash": "27954d3fc8d96fee8d127756007b2149",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 79,
"avg_line_length": 36.333333333333336,
"alnum_prop": 0.4831804281345566,
"repo_name": "mongolab/mongoctl",
"id": "c4460f267ad91b788d98ab92e3debb62041fd3d4",
"size": "19... |
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('private_sharing', '0015_auto_20190124_1849'),
]
operations = [
migrations.AddField(
model_name='datarequestprojectmember',
name... | {
"content_hash": "e75001bf87c43722912e1d7cb222b7f1",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 207,
"avg_line_length": 40.72727272727273,
"alnum_prop": 0.6808035714285714,
"repo_name": "OpenHumans/open-humans",
"id": "5b5cf5d15e111c761b4de72a59e52182c10f052c",
"size"... |
from django import forms
from django.core.exceptions import PermissionDenied
from django.db import router
from django.http import HttpResponse, HttpResponseRedirect
from django.template import loader
from django.template.response import TemplateResponse
from django.utils import six
from django.utils.encoding import for... | {
"content_hash": "92cfdfa94d86b080383742eceea8d0f6",
"timestamp": "",
"source": "github",
"line_count": 292,
"max_line_length": 142,
"avg_line_length": 37.69178082191781,
"alnum_prop": 0.6073051063056515,
"repo_name": "cupen/django-xadmin",
"id": "1d6248cf6028200feec3c86e096d7b7a3bfa5858",
"size": ... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('front', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='lien',
name='disabled',
field=models.... | {
"content_hash": "e17427111df713f7aa6e272e020f44a5",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 53,
"avg_line_length": 20.333333333333332,
"alnum_prop": 0.5846994535519126,
"repo_name": "ahemery/ezreports",
"id": "9bb72730c20c5ee76a1ed49900f2a9ee374a0f92",
"size": "43... |
from flask import Flask
from flask import render_template, redirect, session, request
app = Flask(__name__)
app.secret_key = 'ThisIsSecret'
@app.route('/')
def nothing():
return render_template('noninja.html')
@app.route('/ninja')
def ninja():
x = 'tmnt'
return render_template('ninja.html', x=x)
@app.rout... | {
"content_hash": "2eabc47f0d7a26830d96177c4124af03",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 103,
"avg_line_length": 22.266666666666666,
"alnum_prop": 0.6482035928143712,
"repo_name": "jiobert/python",
"id": "238d58b83fbc0922eb45a09c3b9552b66f8865d0",
"size": "668"... |
from functools import wraps
import os.path
import shutil
def ensure_file_exists(file_path):
if not file_exists(file_path):
raise IOError('File does not exist: %s' % file_path)
def ensure_directory_exists(directory_path):
if not directory_exists(directory_path):
raise IOError('Directory does no... | {
"content_hash": "f13cc53170e893a6691650e7e7a985f9",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 87,
"avg_line_length": 34.018181818181816,
"alnum_prop": 0.7306253340459647,
"repo_name": "FranDepascuali/wikiquotes-python-api",
"id": "2b367a7e44efaad58f4273f4338e7e680285c... |
from swgpy.object import *
def create(kernel):
result = Static()
result.template = "object/static/structure/general/shared_poi_corl_corral_half_64x64_s03.iff"
result.attribute_template_id = -1
result.stfName("obj_n","unknown_object")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return res... | {
"content_hash": "8c41b9c73ef0bb323f221c8f7397aad8",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 94,
"avg_line_length": 24.846153846153847,
"alnum_prop": 0.6996904024767802,
"repo_name": "anhstudios/swganh",
"id": "23538664e69898f7c35eaba9133183dbf907f7bb",
"size": "46... |
from base64 import urlsafe_b64encode
from datetime import datetime, timedelta
from hashlib import sha512
from botocore.exceptions import ClientError as BotoClientError
from flask import current_app
from notifications_utils.letter_timings import LETTER_PROCESSING_DEADLINE
from notifications_utils.postal_address import ... | {
"content_hash": "682c324169cdda520dc5597624489379",
"timestamp": "",
"source": "github",
"line_count": 559,
"max_line_length": 120,
"avg_line_length": 42.658318425760285,
"alnum_prop": 0.6532751824205317,
"repo_name": "alphagov/notifications-api",
"id": "6851b9f6b814d3bcd3afb2286ac86d4dc5f50a3a",
... |
from django.test import TestCase
from homes_to_let.factories.letting_factory import LettingFactory
from homes_to_let.factories.letting_feature_factory import LettingFeatureFactory
from homes_to_let.factories.letting_picture_factory import LettingPictureFactory
from homes_to_let.factories.letting_media_factory import L... | {
"content_hash": "1473bd86c1bec56ff30d7b777cea8e46",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 106,
"avg_line_length": 32.53333333333333,
"alnum_prop": 0.766905737704918,
"repo_name": "signalfire/django-property",
"id": "b86d1e66e6e4a744b1ab1d5b0363f829f24af85c",
"si... |
import angr
class tzset(angr.SimProcedure):
# emulate as a no-op
# important because on my libc this contains inlined iolib ops and thus can't be executed when simprocs are enabled.
def run(self): # pylint: disable=arguments-differ
pass
| {
"content_hash": "fc6edc2a8894c2674788c423c2b6bc05",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 120,
"avg_line_length": 37,
"alnum_prop": 0.7181467181467182,
"repo_name": "angr/angr",
"id": "788d22ea8c9f25f24024d8cb058cbb9afcbb0bcc",
"size": "259",
"binary": false,
... |
from dataclasses import dataclass
class MissingSecretError(RuntimeError):
pass
def strip_keys_not_in_dataclass(data_dict: dict, dc: dataclass) -> dict:
"""Return a copy of `data_dict` removing any keys that are not
properties of the dataclass dc.
"""
return {k: v for k, v in data_dict.items() if... | {
"content_hash": "10b44edf14f6f7ef2820fb2030f95a9e",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 86,
"avg_line_length": 29.833333333333332,
"alnum_prop": 0.6927374301675978,
"repo_name": "potatolondon/djangae",
"id": "23dd47d8cf318c8f2ba5a3c0c36e1e11f01519fe",
"size": ... |
import datetime
import io
from os import linesep
import re
import sys
from pip._vendor.toml.tz import TomlTz
if sys.version_info < (3,):
_range = xrange # noqa: F821
else:
unicode = str
_range = range
basestring = str
unichr = chr
def _detect_pathlib_path(p):
if (3, 4) <= sys.version_info:
... | {
"content_hash": "71058cc794ba4a9eabd16a9b594de23a",
"timestamp": "",
"source": "github",
"line_count": 945,
"max_line_length": 80,
"avg_line_length": 37.10793650793651,
"alnum_prop": 0.4189694014315453,
"repo_name": "davidharvey1986/pyRRG",
"id": "20be459122dfc93ab8d844fd6dc964b1931a33c9",
"size":... |
from __future__ import print_function
import numpy as np
import sqaod as sq
N0 = 8
N1 = 8
# 1. set problem. As an example, a matrix filled with 1. is used.
b0 = np.ones(N0)
b1 = np.ones(N1)
W = np.ones((N1, N0))
# 2. choosing solver .
sol = sq.cpu # use CPU annealer
# If you want to use CUDA, check CUDA availa... | {
"content_hash": "e1316e2455865c846a09b402393cfc36",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 93,
"avg_line_length": 28.151515151515152,
"alnum_prop": 0.6903480444922856,
"repo_name": "shinmorino/quant_sandbox",
"id": "a1dc04d6d10639314ed30d57de33830a9b7b3f29",
"siz... |
class Solution(object):
def isPowerOfThree(self, n):
"""
:type n: int
:rtype: bool
"""
from math import log
l = round(log(n, 3))
return n == 3 ** l
if __name__ == '__main__':
print(Solution().isPowerOfThree(28))
print(Solution().isPowerOfThree(27))
... | {
"content_hash": "65342dab252b8cb2cad665f5e9c270ef",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 41,
"avg_line_length": 25.125,
"alnum_prop": 0.5522388059701493,
"repo_name": "moonfruit/leetcode",
"id": "6dbd08d196544c11f1a578c38266648843be6d8b",
"size": "446",
"bina... |
"""CVなど。"""
from __future__ import annotations
import logging
import typing
import numpy as np
import sklearn.model_selection
import pytoolkit as tk
FoldsType = typing.Sequence[
typing.Tuple[
typing.Union[typing.Sequence[int], np.ndarray],
typing.Union[typing.Sequence[int], np.ndarray],
]
]
... | {
"content_hash": "70823e5ecc8a387f7cc05f46ab0ffaa8",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 87,
"avg_line_length": 29.28965517241379,
"alnum_prop": 0.590534494937603,
"repo_name": "ak110/pytoolkit",
"id": "43b3df741f47c26384deb5833d16df2dd97c8d02",
"size": "4775"... |
import argparse
import sqlite3
from hashlib import sha1
from os import walk
from os.path import abspath, basename, exists, expanduser, isdir, join
from time import asctime, localtime, time
DATABASE_FILE_PATH = expanduser('~/.prot.sql')
DATA_TABLE_NAME = 'files'
METADATA_TABLE_NAME = 'metadata'
STATUS_OK = 0
STATUS_... | {
"content_hash": "eaf420c4ea23472638d17bbd3eca4114",
"timestamp": "",
"source": "github",
"line_count": 283,
"max_line_length": 123,
"avg_line_length": 42.30035335689046,
"alnum_prop": 0.538300893826748,
"repo_name": "voynix/saprotect",
"id": "bf2cc04bcd0386deeb923559c146a83a933a4d3e",
"size": "119... |
__Author__ = "Yoshihiro Tanaka"
__date__ = "2014-11-21"
import json, sys, os, commands
dirs = commands.getoutput("ls " + sys.argv[1]).split("\n")
readDirs = []
for i in range(len(dirs)):
if "tag_" in dirs[i]:
dirname = sys.argv[1].rstrip("/") + "/" + dirs[i]
if os.path.isdir(dirname):
... | {
"content_hash": "198c6370279a9f81f128f18bb6a466d3",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 109,
"avg_line_length": 32.83018867924528,
"alnum_prop": 0.46206896551724136,
"repo_name": "CORDEA/niconico-visualization",
"id": "f960c6fa26d79ea75a678df70f01edf598f002d5",
... |
from distutils.core import setup
setup(
name='numtiff',
version='0.1',
description='Load and save NumPy arrays from and to TIFF images',
author='Mark A. Tsuchida',
author_email='mark@tsuchida.org',
packages=['numtiff'],
)
| {
"content_hash": "9d622b9e13c42cbf0beaafd9f03eaebf",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 71,
"avg_line_length": 26.4,
"alnum_prop": 0.625,
"repo_name": "marktsuchida/numtiff",
"id": "0c83e60fd65cb0dc18f31b5773dce7fe57cf5424",
"size": "1365",
"binary": false,
... |
import logging
import numpy as np
import math
from copy import copy
from random import random, uniform
__author__ = 'azu'
class Competitive:
logging.basicConfig(filename='logger.log', level=logging.DEBUG)
def compet(self, p):
wp = self.w * p
m = max(wp)
for i in range(len(wp)):
... | {
"content_hash": "01cdb951cab9d4f793be4180eea2d183",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 77,
"avg_line_length": 31.47826086956522,
"alnum_prop": 0.47513812154696133,
"repo_name": "blankazucenalg/NeuralNetworks",
"id": "7fabd27772e7e31764c70808fcf0531af01cf956",
... |
"""
Get all users
"""
# import the basic python packages we need
import os
import sys
import tempfile
import pprint
import traceback
# disable python from generating a .pyc file
sys.dont_write_bytecode = True
# change me to the path of pytan if this script is not running from EXAMPLES/PYTAN_API
pytan_loc = "~/gh/pyta... | {
"content_hash": "7a7aa954743122424fe013fdb827cfea",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 198,
"avg_line_length": 32.88429752066116,
"alnum_prop": 0.6956521739130435,
"repo_name": "tanium/pytan",
"id": "25bc9a412c52f6f4e41f8ccbb0c0c87081c054f6",
"size": "4001",... |
from . import layer
from .. import opr as O
import functools
__all__ = ['make_resnet', 'make_resnet_18', 'make_resnet_34', 'make_resnet_50',
'make_resnet_101', 'make_resnet_152']
def residual_first(name, src, increase_dim=False, is_bottleneck=False):
_ = src
shape = _.static_shape
if not is_bott... | {
"content_hash": "bc4be2e13d3903eceb2ee77d3bd90976",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 157,
"avg_line_length": 36.2,
"alnum_prop": 0.5832675611681136,
"repo_name": "vacancy/TensorArtist",
"id": "133e5927d2ca48a5d79b4b5455c129a7e87941b7",
"size": "5227",
"b... |
import mock
from oslo_policy import policy as oslo_policy
import six
import webob
from nova.api.openstack.compute import extension_info
from nova.api.openstack.compute import servers \
as server_v21
from nova.compute import api as compute_api
from nova import db
from nova import exception
from nova import poli... | {
"content_hash": "2c5024941674433c5e7236850eda303a",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 76,
"avg_line_length": 42.84688995215311,
"alnum_prop": 0.6141820212171971,
"repo_name": "vmturbo/nova",
"id": "c7624e7656b155b92d544d304f2ffe4ce147158f",
"size": "9571",
... |
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: f5bigip_ltm_profile_ocsp_stapling_params
short_description: BIG-IP ltm profile ocsp stapling params module
description:
- Configures an OCSP Stapling Params profile.
vers... | {
"content_hash": "3368a9b909678d7290597d8960a20497",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 119,
"avg_line_length": 36.37647058823529,
"alnum_prop": 0.6447283311772316,
"repo_name": "GabrielFortin/ansible-module-f5bigip",
"id": "4bc51f3941ec1beeda989aa24c1d74746a30... |
import shippo
shippo.auth = ('wissam+test@mit.edu', 'wissamtest')
print "Creating address..."
resp = shippo.Address.create(
object_purpose='QUOTE',
name='Laura Behrens Wu',
street1='Clayton St.',
company='Shippo',
street_no=215,
phone='+1 555 341 9393',
city='San Francisco',
state='CA... | {
"content_hash": "067c0d165afd05ed1b78c669d8fd45f7",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 51,
"avg_line_length": 21.045454545454547,
"alnum_prop": 0.6241900647948164,
"repo_name": "bosswissam/shippo-python",
"id": "d27140261fd369729f7c53d01c0cd7eb1655ea16",
"siz... |
from django.apps import AppConfig
class PosConfig(AppConfig):
name = 'pos'
| {
"content_hash": "7d9dc8ff0ff36a259a6df3cf49733605",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 33,
"avg_line_length": 16.2,
"alnum_prop": 0.7283950617283951,
"repo_name": "Epse/EpPos",
"id": "6ec62a9a1105fd6b1772fdca93adb20adc5e40bb",
"size": "81",
"binary": false,
... |
import rospy
from flexbe_core import EventState, Logger
from flexbe_core.proxy import ProxyServiceCaller, ProxyActionClient
from motion_editor_core.srv import ExecuteMotion, ExecuteMotionRequest, ExecuteMotionResponse
from actionlib import SimpleActionClient
from motion_editor_core.msg import ExecuteMotionAction, Exec... | {
"content_hash": "a03f195dcd56a9a5c518c523c5ea6d1f",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 116,
"avg_line_length": 38.177083333333336,
"alnum_prop": 0.6163710777626193,
"repo_name": "team-vigir/vigir_behaviors",
"id": "c7ee590e48d681d8548ed807069f4e3ca9eff9dd",
"... |
import io
import mimetypes
import os
import stat
import magic
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import SuspiciousOperation
from django.http import HttpResponse
from django.http import StreamingHttpResponse
from django.shortcuts impor... | {
"content_hash": "e7ec8c7599a6a1f6bf79d00bf8cf7621",
"timestamp": "",
"source": "github",
"line_count": 321,
"max_line_length": 115,
"avg_line_length": 33.33956386292835,
"alnum_prop": 0.639319753317137,
"repo_name": "coll-gate/collgate",
"id": "d923218e95cd858ebf7ba12e386504fcec59efd5",
"size": "1... |
"""
Classes for working with fragment distribution
@author: Alicia Schep, Greenleaf Lab, Stanford University
"""
import numpy as np
import pyximport
pyximport.install(setup_args={"include_dirs":np.get_include()})
from pyatac.fragments import getAllFragmentSizes, getFragmentSizesFromChunkList
class FragmentSizes:
... | {
"content_hash": "2d57043ee9908939554504f393283a12",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 108,
"avg_line_length": 34.416666666666664,
"alnum_prop": 0.5541335178139052,
"repo_name": "GreenleafLab/NucleoATAC",
"id": "4fd6ba00d56c6acfec46a847cd4db5ec67c89927",
"siz... |
import numpy as np
from .abstract import _AbstractMicrostructureBasis
class PrimitiveBasis(_AbstractMicrostructureBasis):
r"""
Discretize the microstructure function into `n_states` local states such
that:
.. math::
\frac{1}{\Delta x} \int_{H} \int_{s} \Lambda(h - l)
m(h, x) dx dh = m... | {
"content_hash": "6a333f4b066f08fa069c370a79336fce",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 79,
"avg_line_length": 35.43065693430657,
"alnum_prop": 0.5558302430984755,
"repo_name": "XinyiGong/pymks",
"id": "b3319026b94596b08f6466b44b527457ba4d90bf",
"size": "4854... |
import wx
from cairis.core.armid import *
from TargetDialog import TargetDialog
from cairis.core.Target import Target
__author__ = 'Shamal Faily'
class TargetListCtrl(wx.ListCtrl):
def __init__(self,parent,winId,boxSize=wx.DefaultSize):
wx.ListCtrl.__init__(self,parent,winId,size=boxSize,style=wx.LC_REPORT)
... | {
"content_hash": "5ab35c3e713377f77d293a5393c9962b",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 107,
"avg_line_length": 40.24545454545454,
"alnum_prop": 0.7239665687824712,
"repo_name": "nathanbjenx/cairis",
"id": "1c92cd752518e6ecd4084c7292d6b2f13ef5bae2",
"size": "... |
"""Support for BloomSky weather station."""
from datetime import timedelta
import logging
from aiohttp.hdrs import AUTHORIZATION
import requests
import voluptuous as vol
from homeassistant.const import (
CONF_API_KEY,
HTTP_METHOD_NOT_ALLOWED,
HTTP_OK,
HTTP_UNAUTHORIZED,
)
from homeassistant.helpers im... | {
"content_hash": "2026b389e5bd0005924c16e8de3825ef",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 88,
"avg_line_length": 31.452380952380953,
"alnum_prop": 0.6627554882664648,
"repo_name": "partofthething/home-assistant",
"id": "76ed9cdd12a0abac14793e410790b724448c273f",
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.