text stringlengths 4 1.02M | meta dict |
|---|---|
from quadpwm_partial import get_ip_name
from quadpwm_partial import QUADPWM | {
"content_hash": "ee295678fb2981022ef589fb2f39116b",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 39,
"avg_line_length": 37.5,
"alnum_prop": 0.8533333333333334,
"repo_name": "hakehuang/pycpld",
"id": "868133232aeff8c4494df0bda70057aee628923e",
"size": "75",
"binary": f... |
"""The Bond integration."""
from asyncio import TimeoutError as AsyncIOTimeoutError
from http import HTTPStatus
import logging
from typing import Any
from aiohttp import ClientError, ClientResponseError, ClientTimeout
from bond_api import Bond, BPUPSubscriptions, start_bpup
from homeassistant.config_entries import Co... | {
"content_hash": "7eb2282b7efcdfd0b13684a7f5095a46",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 88,
"avg_line_length": 31.123966942148762,
"alnum_prop": 0.6879978757302178,
"repo_name": "rohitranjan1991/home-assistant",
"id": "062c1d844c4381598f96b8bcfc07c71936851cd9",... |
from __future__ import absolute_import
import datetime
import math
import operator
import uuid
import warnings
from lxml.builder import E
import lxml.etree
from .dates import datetime_from_w3_datestring
from .strings import RawString, SolrString, WildcardString
try:
import pytz
except ImportError:
warnings.... | {
"content_hash": "276d736c1e0cf2152393e725a0b0a8ad",
"timestamp": "",
"source": "github",
"line_count": 852,
"max_line_length": 124,
"avg_line_length": 33.906103286384976,
"alnum_prop": 0.5794447521462199,
"repo_name": "pixbuffer/sunburnt-spatial",
"id": "5600d6e255929c8017dc93dbe1064b47a1436d1f",
... |
""" Defines the XAxis and YAxis classes.
"""
import numpy as np
from traits.api import (Float, Instance, Property, cached_property,
on_trait_change)
from .artist.base_artist import BaseArtist
from .layout.bbox_transform import (
BaseTransform, BboxTransform, IdentityTransform, blend_xy_tra... | {
"content_hash": "4ed88069359b4c0a4c95b89d73b903ca",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 79,
"avg_line_length": 36.44827586206897,
"alnum_prop": 0.543046357615894,
"repo_name": "tonysyu/deli",
"id": "6173b4eb3039c9bff40633e15f3d36551f1ff538",
"size": "6342",
... |
from flask import current_app, Blueprint, render_template, request, url_for, redirect, g
from flask.ext.babel import gettext as _
from app.model.airportinfo import AirportInfo
from app.model.system_settings import SystemSetting
__author__ = 'windschord.com'
blueprint = Blueprint('SystemSetting', __name__, url_prefi... | {
"content_hash": "2fc6874b877ec1c1c7cad6ca3beee104",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 134,
"avg_line_length": 35.45454545454545,
"alnum_prop": 0.6600732600732601,
"repo_name": "windschord/airport_weather",
"id": "77f8429cad1bda44d23e596e0a2d741a49337245",
"s... |
"""Tests for Generalized Pareto distribution."""
# Dependency imports
import hypothesis as hp
import hypothesis.strategies as hps
import numpy as np
from scipy import stats as sp_stats
import tensorflow.compat.v2 as tf
from tensorflow_probability.python.distributions import generalized_pareto as gp
from tensorflow_p... | {
"content_hash": "5131f7c9114b5375c1ced292987855e5",
"timestamp": "",
"source": "github",
"line_count": 384,
"max_line_length": 110,
"avg_line_length": 39.247395833333336,
"alnum_prop": 0.6559617809037224,
"repo_name": "tensorflow/probability",
"id": "fa779f3fa1f6bf83187b753b7ccb257ad69fbfb8",
"siz... |
"""
Class that describes a CDN
"""
from SMDS.user import *
from SMDS.content import *
class MDCDN:
"""
Interface for communicating with a CDN's brain to add/remove users and content.
"""
def __init__(self):
pass
def setup(self, api):
return 1
def shutdown(self):
return ... | {
"content_hash": "749d8e9ecfb1192a101df7789dd13a5f",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 82,
"avg_line_length": 17,
"alnum_prop": 0.5668449197860963,
"repo_name": "jcnelson/syndicate",
"id": "6dcb7e138092bcc223d6f29d7b5500ec95dd187d",
"size": "748",
"binary":... |
"""Package contenant la commande 'décor' et ses sous-commandes.
Dans ce fichier se trouve la commande même.
"""
from primaires.interpreteur.commande.commande import Commande
from .creer import PrmCreer
from .edit import PrmEdit
from .installer import PrmInstaller
from .liste import PrmListe
from .retirer import PrmR... | {
"content_hash": "692fcf17215c00a995fd0c7ee6b3a84a",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 69,
"avg_line_length": 29.857142857142858,
"alnum_prop": 0.6555023923444976,
"repo_name": "stormi/tsunami",
"id": "74f4893b1ddf31aa4dd039db55d65cc0778999eb",
"size": "2618"... |
from setuptools import setup, find_packages
setup(
name="covertrack",
version="0.1",
packages=find_packages(),
# packages=["covertrack"],
author='Takamasa Kudo',
author_email='kudo@stanford.edu',
license="MIT License",
entry_points={
"console_scripts": [
"covertrack=... | {
"content_hash": "ba71d24a21c40232a120fbb4d2874d69",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 48,
"avg_line_length": 19.31578947368421,
"alnum_prop": 0.5967302452316077,
"repo_name": "braysia/covertrack",
"id": "ce19b63125f309a4ad4caffad95531fdcdb03bce",
"size": "36... |
import jobinfo
__author__ = 'Masataka'
class JobMaya(jobinfo.JobInfo):
def __init__(self, param):
jobinfo.JobInfo.__init__(self, param)
class JobMayaSw(JobMaya):
def __init__(self, param):
JobMaya.__init__(self, param)
class JobMayaMr(JobMaya):
def __init__(self, param):
JobMa... | {
"content_hash": "72794b4c76c4d68cf9782a07ea47b2e3",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 45,
"avg_line_length": 19.304347826086957,
"alnum_prop": 0.6058558558558559,
"repo_name": "plinecom/JobManager",
"id": "08ac5e969f53c24a9067c0241fb770d0d291d6ae",
"size": "... |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class CreateAuthenticatedPost(Choreography):
def __init__(self, temboo_session):
"""
... | {
"content_hash": "763604f2e4e79e18eac392e0ec10298a",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 271,
"avg_line_length": 49.42156862745098,
"alnum_prop": 0.6964887919063678,
"repo_name": "jordanemedlock/psychtruths",
"id": "fbd217b512a78870ea5b9dae326ba8e9908c2a08",
"... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/ship/crafted/weapon/shared_min_damage_intensifier_mk1.iff"
result.attribute_template_id = 8
result.stfName("space_crafting_n","min_damage_intensifier_mk1")
#### BEGIN MODIFICATIONS ####
#### END MODIFICAT... | {
"content_hash": "289447198fdf20298ca622dc0b66b5f4",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 94,
"avg_line_length": 26.692307692307693,
"alnum_prop": 0.7175792507204611,
"repo_name": "anhstudios/swganh",
"id": "43653e5d14b188ddf4357a5dd9e9e396ed0338b2",
"size": "49... |
"""
Copyright (c) 2015-2020 Raj Patel(raj454raj@gmail.com), StopStalk
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
... | {
"content_hash": "870410a4044c060cd3144b95d275d0d6",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 163,
"avg_line_length": 35.435483870967744,
"alnum_prop": 0.6927628584433319,
"repo_name": "stopstalk/stopstalk-deployment",
"id": "f71e041b4adf8e3e90f5927ee502d16b93e75667",... |
import unittest
import six
import mock
from webtest import TestApp
from pyramid import testing
from pyramid.config import Configurator
from pyramid.url import route_path
from pyramid.response import Response
from nefertari.view import BaseView
from nefertari.renderers import _JSONEncoder
def get_test_view_class(na... | {
"content_hash": "a4c1d71cb5b7a9398086ba4143278a2d",
"timestamp": "",
"source": "github",
"line_count": 663,
"max_line_length": 78,
"avg_line_length": 32.37556561085973,
"alnum_prop": 0.5698579082226881,
"repo_name": "postatum/nefertari",
"id": "e1586f36ab76d127ff762f5be4f80ba848c6f577",
"size": "2... |
from __future__ import unicode_literals
import frappe
from frappe.integrations.doctype.social_login_key.social_login_key import BaseUrlNotSetError
import unittest
class TestSocialLoginKey(unittest.TestCase):
def test_adding_frappe_social_login_provider(self):
provider_name = "Frappe"
social_login_key = make_soci... | {
"content_hash": "c6fe6e123bc6ecd051236a39bd3314bd",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 92,
"avg_line_length": 34.628571428571426,
"alnum_prop": 0.7615511551155115,
"repo_name": "vjFaLk/frappe",
"id": "8a71045ff12c627e37b7b65d144d4945b4a08f9f",
"size": "1313",... |
""" Interface to the C++ Murtagh hierarchic clustering code
"""
from rdkit.ML.Cluster import Clusters
from rdkit.ML.Cluster.Clustering import MurtaghCluster, MurtaghDistCluster
import numpy
# constants to select the clustering algorithm
WARDS = 1
SLINK = 2
CLINK = 3
UPGMA = 4
MCQUITTY = 5
GOWER = 6
CENTROID = 7
# de... | {
"content_hash": "2d375c1b0218c5b580abdd45b4fa2516",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 86,
"avg_line_length": 27.1010101010101,
"alnum_prop": 0.6470368989936638,
"repo_name": "jandom/rdkit",
"id": "852d2b53a3472f3dd78f9f2d530d4c04de7ef9c6",
"size": "2981",
... |
"""A distributed computation library for TF.
See [tensorflow/contrib/distribute/README.md](
https://www.tensorflow.org/code/tensorflow/contrib/distribute/README.md)
for overview and examples.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# pylint: di... | {
"content_hash": "1857f9d788aad565bcd9c8e4f191bf59",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 107,
"avg_line_length": 37.03448275862069,
"alnum_prop": 0.7886405959031657,
"repo_name": "brchiu/tensorflow",
"id": "8ec73654e30e4967f318c558ba94301e84a206e4",
"size": "28... |
import os
import pandas
import unittest
import inspect
from px4tools.analysis import *
from px4tools.mapping import *
from px4tools.ulog import *
have_control = False
try:
from px4tools.logsysid import *
have_control = True
except ImportError as e:
print(e)
TEST_PATH = os.path.dirname(os.path.abspath(
... | {
"content_hash": "167f68c238429cd976da31698323f179",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 81,
"avg_line_length": 35.2875,
"alnum_prop": 0.581650726177825,
"repo_name": "dronecrew/px4tools",
"id": "91dcbf6b2a0a9d1dfd65c6f1020f280b128d5d40",
"size": "2823",
"bin... |
from haystack import indexes
from speeches.models import Section, Speech
# @note We want to use decay functions to decrease the relevance of older
# speeches, but Haystack doesn't support scoring out-of-the-box.
# @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-function-score-que... | {
"content_hash": "8262102d6941cfc09346a2b6d76d58c1",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 139,
"avg_line_length": 45.171875,
"alnum_prop": 0.6911103424420616,
"repo_name": "ciudadanointeligente/openhousens.ca",
"id": "55f164debf73c2f0bf3f9b114bdcd0ebc9f8aa23",
"... |
"""
opbeat.utils
~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2011-2015 Opbeat
Large portions are
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from opbeat.utils import six
default_ports = {
"https": 433,
"http": 80,
"postgresql": 5432
}
... | {
"content_hash": "c85757146a6d8c89446e2cb8e6329c5e",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 83,
"avg_line_length": 26.080645161290324,
"alnum_prop": 0.6196660482374768,
"repo_name": "tarkatronic/opbeat_python",
"id": "3dee433258aa80f02161ddde5b62e5ca99b23cec",
"si... |
"""
This module provides
"""
from __future__ import unicode_literals, division, print_function
from collections import namedtuple, OrderedDict
from monty.string import is_string
from monty.json import MSONable #, MontyEncoder
from monty.functools import lazy_property
from pymatgen.core.libxcfunc import LibxcFunc
__au... | {
"content_hash": "1a9177477140d322b38288cc6f93820b",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 105,
"avg_line_length": 39.396153846153844,
"alnum_prop": 0.5768817729180904,
"repo_name": "tallakahath/pymatgen",
"id": "2eb710ad76d9465cfae831eafc3c9b699f953b96",
"size"... |
from yaml import load
import os
DEFAULT_CONFIG_DIR = os.path.dirname(os.path.realpath(__file__))
CONFIG_DIR = os.environ.get('WW_CONFIG_DIR', DEFAULT_CONFIG_DIR)
CONFIG_PATH = os.path.join(CONFIG_DIR, 'config.yml')
# Open our yaml config and override settings values with it's config
try:
config_file = open(CONFI... | {
"content_hash": "bccd5385b227955470494f81a6549c84",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 70,
"avg_line_length": 33.705882352941174,
"alnum_prop": 0.6928446771378709,
"repo_name": "osu-cass/working-waterfronts-api",
"id": "32656d8d924097fc8cfcd0ede9d57c0b6874d1d7"... |
""" Missing statistics functions"""
from _NetworKit import gini
| {
"content_hash": "fb265b0793d104f30e8fd3a5325d930e",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 35,
"avg_line_length": 21.666666666666668,
"alnum_prop": 0.7538461538461538,
"repo_name": "fmaschler/networkit",
"id": "9a16206ed9db2e4a4f17ce258147ea79a5661a44",
"size": "6... |
import importlib
import os
from . import global_settings as gl
class _Settings:
def __init__(self):
settings = os.environ.get("GLUE_SETTINGS_MODULE")
self.settings = importlib.import_module(settings)
self._setup()
def _setup(self):
for d in dir(self.settings):
if ... | {
"content_hash": "101250f453a84ec70021f3cdab41fe0e",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 89,
"avg_line_length": 26.267857142857142,
"alnum_prop": 0.504418762746431,
"repo_name": "WhatDo/FlowFairy",
"id": "ef63be908a5dea4bdc2e4546afc3127bea6e5b25",
"size": "1472... |
import ctypes
# Binary Ninja components
import binaryninja
from binaryninja import highlight
from binaryninja import _binaryninjacore as core
from binaryninja.enums import BranchType, HighlightColorStyle, HighlightStandardColor, InstructionTextTokenType
# 2-3 compatibility
from binaryninja import range
class BasicB... | {
"content_hash": "539dd6c77df28a6c94e5690f321fec85",
"timestamp": "",
"source": "github",
"line_count": 521,
"max_line_length": 133,
"avg_line_length": 32.339731285988485,
"alnum_prop": 0.7232476704848952,
"repo_name": "joshwatson/binaryninja-api",
"id": "2394f25f936dfe07cf24b1402296564f8b586dc7",
... |
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
import json
import copy
import re
def is_job_finished(job):
if 'status' in job:
desiredNumberScheduled = job['status'].get('desiredNumberScheduled',1)
numberReady = job['status'].get('numberReady',0)
if desiredNumberScheduled == numberReady an... | {
"content_hash": "6ef155245e628a79f182c0c76838d4ef",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 117,
"avg_line_length": 41.67605633802817,
"alnum_prop": 0.6610341331530922,
"repo_name": "GoogleCloudPlatform/metacontroller",
"id": "3393ec737c64ac08f68ead1c1833264f13fc241... |
import re
from django.db.models import Q
def normalize_query(query_string,
findterms=re.compile(r'"([^"]+)"|(\S+)').findall,
normspace=re.compile(r'\s{2,}').sub):
return [normspace(' ', (t[0] or t[1]).strip()) for t in findterms(query_string)]
def get_query(query_string, ... | {
"content_hash": "457b0d1329a4f03aee7e408db0580fb2",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 84,
"avg_line_length": 30.115384615384617,
"alnum_prop": 0.5261813537675607,
"repo_name": "cedricmeston/pierrecedric",
"id": "4081133d3694a119b12decfd9a62b8d0caef4b32",
"si... |
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 'MediaBase'
db.create_table('multimedia_mediabase', (
('id', self.gf('django.db.models.fields.Aut... | {
"content_hash": "243c5da3dbbe973df53ed6f543a67bc2",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 182,
"avg_line_length": 77.72413793103448,
"alnum_prop": 0.5614463176574978,
"repo_name": "jbittel/django-multimedia",
"id": "600721c9011fc9c410bbc63e2b9a1d5e4f24533e",
"s... |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import TestSCons
_python_ = TestSCons._python_
test = TestSCons.TestSCons()
test.subdir('sub1', 'sub2')
test.write('build.py', r"""
import sys
contents = open(sys.argv[2], 'rb').read()
file = open(sys.argv[1], 'wb')
file.write(contents)
file.close()
"""... | {
"content_hash": "314c4d591a5a5ee43cdecc1f494905fb",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 62,
"avg_line_length": 21.940298507462686,
"alnum_prop": 0.6312925170068027,
"repo_name": "Distrotech/scons",
"id": "57c08534c657e854c852f9fdc3e8b0799d6b7fc0",
"size": "257... |
"""
SoftLayer.tests.CLI.modules.call_api_tests
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:license: MIT, see LICENSE for more details.
"""
from SoftLayer import testing
import json
class CallCliTests(testing.TestCase):
def test_options(self):
mock = self.set_mock('SoftLayer_Service', 'metho... | {
"content_hash": "39ab274f32fd13fb9fd887cb860062a9",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 68,
"avg_line_length": 38.16279069767442,
"alnum_prop": 0.42514726792606133,
"repo_name": "underscorephil/softlayer-python",
"id": "14164efa7b69c58d2507f2510e97f307cd2271cc"... |
import collections
import re
from importlib import import_module
from django import forms
from django.core import checks
from django.core.exceptions import ImproperlyConfigured
from django.template.loader import render_to_string
from django.utils.encoding import force_str
from django.utils.safestring import mark_safe... | {
"content_hash": "e1e3d9fdaa27ad8d1d3a933b95d28490",
"timestamp": "",
"source": "github",
"line_count": 608,
"max_line_length": 114,
"avg_line_length": 41.7203947368421,
"alnum_prop": 0.622486793345423,
"repo_name": "kaedroho/wagtail",
"id": "af3881570e9d41007dfee49fdf3f01decebec2bf",
"size": "2536... |
from app import app
app.run(debug=True,host="0.0.0.0",threaded=True)
| {
"content_hash": "5f8c42d895670b994527f9ee9f80a030",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 48,
"avg_line_length": 34.5,
"alnum_prop": 0.7391304347826086,
"repo_name": "Illinois-tech-ITM/ITMT-492-593",
"id": "ecc911a1dbfaaa4fa4181409a67cddcad1c8a04d",
"size": "104"... |
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import now, cint
from frappe.model import no_value_fields
from frappe.model.document import Document
from frappe.model.db_schema import type_map
from frappe.core.doctype.property_setter.property_setter import make_property_se... | {
"content_hash": "fb615e23ead3ca81802a2b637a4ce787",
"timestamp": "",
"source": "github",
"line_count": 393,
"max_line_length": 132,
"avg_line_length": 35.55216284987277,
"alnum_prop": 0.6802891497280275,
"repo_name": "rohitw1991/smarttailorfrappe",
"id": "e52aaa6804c03507d51d14de034357970b8383c2",
... |
import sys
from colors import Colors
class Log:
@classmethod
def print_msg(cls, title, msg, color, new_line = True):
Log.raw("{0}{1}{2}: {3}".format(color, title, Colors.NORMAL, msg), new_line)
@classmethod
def msg(cls, msg, new_line = True):
Log.print_msg("Message", msg, Colors.MAGENTA_FG, new_line)... | {
"content_hash": "8983930204510801866abed025e27231",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 80,
"avg_line_length": 26.923076923076923,
"alnum_prop": 0.6323809523809524,
"repo_name": "JBarberU/python-utils",
"id": "dc1163d61bf2b27f533b34e1a9fe05eed7810a2c",
"size":... |
import wmi # Tim Golden's wmi module.
computer = wmi.WMI()
for item in computer.Win32_Process()[:2]:
print item
| {
"content_hash": "f2a41adbd2fd0f17abc61b819a151078",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 41,
"avg_line_length": 19.666666666666668,
"alnum_prop": 0.6864406779661016,
"repo_name": "nzavagli/UnrealPy",
"id": "d434174b5cca0f9449b224b0e63d32b4b72ac378",
"size": "118... |
import sys
# Import renderdoc if not already imported (e.g. in the UI)
if 'renderdoc' not in sys.modules and '_renderdoc' not in sys.modules:
import renderdoc
# Alias renderdoc for legibility
rd = renderdoc
def printVar(v, indent = ''):
print(indent + v.name + ":")
if len(v.members) == 0:
valstr = ""
for r i... | {
"content_hash": "bb32088783dd3cd0662b5ef714307c7a",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 104,
"avg_line_length": 24.489795918367346,
"alnum_prop": 0.71125,
"repo_name": "moradin/renderdoc",
"id": "f5f5c01d9b5ca45d7c5b976041ac173eced3fc7a",
"size": "2400",
"bi... |
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseForbidden
from django.utils.translation import ugettext_lazy as _
from django.views.generic import ListView, UpdateView, CreateView
from pretix.base.models import Organizer, OrganizerPermission
from pre... | {
"content_hash": "f58553a40a8098ef7494430b91a04aa7",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 80,
"avg_line_length": 34.470588235294116,
"alnum_prop": 0.6945392491467577,
"repo_name": "Unicorn-rzl/pretix",
"id": "53250be2c4bc408e54fca91e7923a785266426e4",
"size": "2... |
from oslo_log import log as logging
from tempest.lib import exceptions
from magnum.tests.functional.api.v1.models import bay_model
from magnum.tests.functional.common import client
from magnum.tests.functional.common import utils
class BayClient(client.MagnumClient):
"""Encapsulates REST calls and maps JSON to/f... | {
"content_hash": "3fbef7d4a9c3d45fccebf54cda7b066e",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 72,
"avg_line_length": 33.41139240506329,
"alnum_prop": 0.5847698427732525,
"repo_name": "openstack/magnum",
"id": "844ed4a2bafafdac19b6808ca17ea81f2ab954d2",
"size": "582... |
"""
This script differs from extract-unassembled-reads.py in that it only tags
the assembly, not the reads. This is more efficient (and streaming for
the reads!) but it will erroneously extract some small fraction of reads
because they miss the tags for reasons of length or errors.
Procedure:
* hard trim the reads a... | {
"content_hash": "2a97e7589a44c74ba292cde7dfce06b4",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 76,
"avg_line_length": 30.257142857142856,
"alnum_prop": 0.6279508970727101,
"repo_name": "souravsingh/khmer",
"id": "be993481a734224b7d1cfe293e2c4711dba9451a",
"size": "21... |
"""
Demonstrates the various Barbican API calls, against an unauthenticated local
Barbican server. This script is intended to be a lightweight way to demonstrate
and 'smoke test' the Barbican API via it's REST API, with no other dependencies
required including the Barbican Python client. Note that this script is not
in... | {
"content_hash": "15caefa2d300773cb62209a95fc07ce3",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 79,
"avg_line_length": 29.186147186147185,
"alnum_prop": 0.6404627706911895,
"repo_name": "openstack/barbican",
"id": "6bff3308289636505d5257b75d86ab1785ebc41c",
"size": "... |
"""This file implements a VFS abstraction on the client."""
import functools
import platform
from typing import Any, Optional, Callable, Dict, Type
from grr_response_client.unprivileged.filesystem import vfs as unprivileged_vfs
from grr_response_client.vfs_handlers import base as vfs_base
from grr_response_client.vf... | {
"content_hash": "859c6f8c9dfcb15eba950c10144b5576",
"timestamp": "",
"source": "github",
"line_count": 296,
"max_line_length": 104,
"avg_line_length": 35.648648648648646,
"alnum_prop": 0.719294920394238,
"repo_name": "google/grr",
"id": "a20049ab89d097db06b879ed241f499feb01fd2f",
"size": "10574",
... |
import time
def test_delete(test_awscc):
factory = test_awscc.replay_flight_data("awscc_log_delete")
p = test_awscc.load_policy(
{
"name": "log-del",
"resource": "awscc.logs_loggroup",
"filters": [{"LogGroupName": "/aws/apigateway/welcome"}],
"actions": ... | {
"content_hash": "493e52a50f379acf37f63bd19b64d663",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 85,
"avg_line_length": 27.397058823529413,
"alnum_prop": 0.5217391304347826,
"repo_name": "thisisshi/cloud-custodian",
"id": "01a8ea258482f3cfaeb06949529b6e78ff1a6b00",
"si... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('forms', '0005_auto_20170613_0824'),
]
operations = [
migrations.AlterField(
model_name='filledform',
name='data',
... | {
"content_hash": "9229846c768db46bfead9e49200eae64",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 249,
"avg_line_length": 33.26086956521739,
"alnum_prop": 0.6052287581699346,
"repo_name": "aniketp41/Gymkhana-Nominations",
"id": "3df069d33b150620ac340bb10e5f4c970a37a38d",
... |
"""Support for IoTaWatt Energy monitor."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
import logging
from iotawattpy.sensor import Sensor
from homeassistant.components.sensor import (
STATE_CLASS_MEASUREMENT,
STATE_CLASS_TOTAL,
SensorEntity,
... | {
"content_hash": "2b635edab3df8b323aa1859340167002",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 88,
"avg_line_length": 33.00986842105263,
"alnum_prop": 0.6316890881913303,
"repo_name": "lukas-hetzenecker/home-assistant",
"id": "ec2918b0ce655f0b60fe1cb00e11c19056b1b401"... |
__author__ = "Osman Baskaya"
"""
Useful functions for Wordnet 3.0
"""
import sys
from nltk.corpus import wordnet as wn
w_synsets = dict()
def get_synsets_for_sent(sentence):
if not isinstance(sentence, list):
sentence = sentence.split()
s = []
for token in sentence:
if token in w_synse... | {
"content_hash": "5284adfb1bebdc529cd65e3d1ba7411d",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 57,
"avg_line_length": 23.325581395348838,
"alnum_prop": 0.6201395812562313,
"repo_name": "osmanbaskaya/semeval14-task3",
"id": "bd1fd406b0f7e95b652fbec7bfccc7785b040afd",
... |
''' Provide a request handler that returns a page displaying a document.
'''
from __future__ import absolute_import, print_function
import logging
log = logging.getLogger(__name__)
from six.moves.urllib.parse import urlparse
from tornado import gen
from bokeh.core.templates import AUTOLOAD_JS
from bokeh.util.string... | {
"content_hash": "b363a61d79ce71aa27948d07b7e8e798",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 106,
"avg_line_length": 34.111111111111114,
"alnum_prop": 0.6430898092135877,
"repo_name": "rs2/bokeh",
"id": "2f71e5463477a61c046bc3d2544e505595e4ac3c",
"size": "2149",
... |
"""Unit Tests: Forseti Server."""
from builtins import object
import argparse
import unittest
import unittest.mock as mock
from tests.unittest_utils import ForsetiTestCase
from google.cloud.forseti.common.util import file_loader
from google.cloud.forseti.services import server
class NameSpace(object):
def __ini... | {
"content_hash": "ca6a18bef1c7decbb69651e6cac0222d",
"timestamp": "",
"source": "github",
"line_count": 132,
"max_line_length": 103,
"avg_line_length": 39.67424242424242,
"alnum_prop": 0.6257399274393737,
"repo_name": "forseti-security/forseti-security",
"id": "c3174ae4784a3107b51c4da400667a5e5ec1cc8... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_thune.iff"
result.attribute_template_id = 9
result.stfName("monster_name","thune")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result | {
"content_hash": "bc98dc9cd7f3ab09547e1162478c629a",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 51,
"avg_line_length": 21.46153846153846,
"alnum_prop": 0.6845878136200717,
"repo_name": "obi-two/Rebelion",
"id": "5d3c9b2c6d308a27016281d64c35a2a03b9f3961",
"size": "424"... |
import argparse
import os
import time
from typing import Any, Iterator, Tuple
from tools.wpt.testfiles import get_git_cmd
here = os.path.dirname(__file__)
wpt_root = os.path.abspath(os.path.join(here, os.pardir, os.pardir))
def calculate_cutoff_date(until: int, epoch: int, offset: int) -> int:
return ((((until ... | {
"content_hash": "ec588e94a41190d3034e81dd274883e6",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 83,
"avg_line_length": 40.89719626168224,
"alnum_prop": 0.5808957952468007,
"repo_name": "scheib/chromium",
"id": "b3f1f3486f7df0b39085573ef725035cbe50b9bc",
"size": "4376... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'certified'}
DOCUMENTATION = '''
module: na_ontap_aggregate
short_description: NetApp ONTAP manage aggr... | {
"content_hash": "c0dae6722a4baa71ce84b29ff3577038",
"timestamp": "",
"source": "github",
"line_count": 469,
"max_line_length": 135,
"avg_line_length": 39.002132196162044,
"alnum_prop": 0.6010824404111087,
"repo_name": "thaim/ansible",
"id": "ac76e77abd6d1768770b11e156b4ebca3f2b5ffc",
"size": "1843... |
from __future__ import print_function
from __future__ import absolute_import
import __builtin__
import errno
from itertools import chain, count
import os
import logging
import stat
import sys
import fuse
from pyfs.mapping import (
add_module,
add_symlink,
is_dir,
is_executable,
is_file,
is_sy... | {
"content_hash": "dde66d3fd6e87e7aba80d370a4cde61d",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 78,
"avg_line_length": 31.311377245508982,
"alnum_prop": 0.5207496653279786,
"repo_name": "mknecht/pyfs",
"id": "365e541b75cf3a21051b3c590f619eaf29666f8d",
"size": "5377",... |
"""
Django settings for sscore 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, ...)
imp... | {
"content_hash": "0755642e884359e57bd333dbb3cad2f5",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 78,
"avg_line_length": 23.965811965811966,
"alnum_prop": 0.7097004279600571,
"repo_name": "andremrsantos/s-score-view",
"id": "ab486e65429a88323c3d2bb0800489eae91d6d05",
"... |
import unittest
import usaddress
class TestTagging(unittest.TestCase) :
def test_broadway(self) :
s1 = '1775 Broadway And 57th, Newyork NY'
usaddress.tag(s1)
| {
"content_hash": "7353d03236d7dd4065d484b7d53b911d",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 49,
"avg_line_length": 18.2,
"alnum_prop": 0.6813186813186813,
"repo_name": "yl2695/usaddress",
"id": "87b37eae4d76c7523b009dabde93a66d5f097f89",
"size": "182",
"binary":... |
from common import startfile, SIZES, classname, cells, mklabel
if __name__ == '__main__':
fd = startfile("functions", "Transpose")
def line(s=""):
print >> fd, s
for rows in SIZES:
for cols in SIZES:
line("import org.dnikulin.jula.fixed.%s;" % classname(rows, cols))
line()... | {
"content_hash": "3708baac832b2335cfaf45ff18ad081a",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 97,
"avg_line_length": 28.838709677419356,
"alnum_prop": 0.5134228187919463,
"repo_name": "dnikulin/jula",
"id": "3d428e830d89e7e90644827cd91a530a732e603d",
"size": "1477",... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("warehouse", "0014_remove_warehouse_company_name"),
]
operations = [
migrations.AlterField(
model_name="stock",
name="quantity",
field=models.IntegerField... | {
"content_hash": "e8e6652fd7f6b8feb355abb181ff72cc",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 60,
"avg_line_length": 21.875,
"alnum_prop": 0.5857142857142857,
"repo_name": "mociepka/saleor",
"id": "1943d386d94badfcfe81cbc2a9e922982326a0ef",
"size": "399",
"binary"... |
import pykintone.structure as ps
class Organization(ps.kintoneStructure):
def __init__(self):
super(Organization, self).__init__()
self.organization_id = ""
self.code = None
self.name = ""
self.description = ""
self.local_name = ""
self.local_name_locale = ... | {
"content_hash": "d7280beb865ea6fef924f5ee6c3d1afd",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 65,
"avg_line_length": 31.157894736842106,
"alnum_prop": 0.5912162162162162,
"repo_name": "icoxfog417/pykintone",
"id": "ef672e07c6311af804f0fd3886f5884c096ef3af",
"size": ... |
from StringIO import StringIO
import logging
import tarfile
from tempfile import mkdtemp
from abc import abstractmethod
from mcloud.util import Interface
from twisted.internet import reactor, defer
logger = logging.getLogger('mcloud.application')
from twisted.python import log
class IContainerBuilder(Interface):
... | {
"content_hash": "0a5dd95bb128a8424774ee44b0f1b623",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 90,
"avg_line_length": 26.22222222222222,
"alnum_prop": 0.6078878748370273,
"repo_name": "modera/mcloud",
"id": "fdfa525b69b9d585ba30d49345b9c761d756fa09",
"size": "3068",... |
from os.path import dirname, join
import pypd
def preload():
path = join(dirname(dirname(dirname(__file__))), 'api.key')
pypd.set_api_key_from_file(path)
| {
"content_hash": "47a4616dc310a107676c45697ef314c3",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 63,
"avg_line_length": 20.625,
"alnum_prop": 0.6727272727272727,
"repo_name": "PagerDuty/pagerduty-api-python-client",
"id": "21e552e4649511d3e909bbe108b3bdc99a520c90",
"siz... |
import json
from rest_framework.test import APIClient
from rest_framework import status
from rest_framework.test import APITestCase
# TODO broken in myhpom ("oauthlib.oauth2.rfc6749.endpoints.resource: DEBUG: Dispatching token_type Bearer request")
# class TestUniversities(APITestCase):
# def setUp(self):
# ... | {
"content_hash": "736fc59d83c14c1935c3fc510e68710b",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 116,
"avg_line_length": 42.17391304347826,
"alnum_prop": 0.7041237113402062,
"repo_name": "ResearchSoftwareInstitute/MyHPOM",
"id": "23c52e0812fe65e11bfdf4506e43f4b34809a198"... |
from django.contrib.auth.models import User
from rest_framework import viewsets
from rest_framework.decorators import list_route
from rest_framework.exceptions import AuthenticationFailed
from rest_framework.response import Response
from posts.models import StarredJob, Alarm
from posts.permissions import IsSelf, IsOwn... | {
"content_hash": "cda990b8091314b4e4aa74741e09461d",
"timestamp": "",
"source": "github",
"line_count": 69,
"max_line_length": 73,
"avg_line_length": 31.405797101449274,
"alnum_prop": 0.7503461005999077,
"repo_name": "alpayOnal/flj",
"id": "ce81b6980d53f551b6650777357e9c1e60f77f98",
"size": "2167",... |
""" Database code for Swift """
from __future__ import with_statement
from contextlib import contextmanager
import hashlib
import logging
import operator
import os
from uuid import uuid4
import sys
import time
import cPickle as pickle
import errno
from tempfile import mkstemp
from eventlet import sleep, Timeout
impor... | {
"content_hash": "5d6f92350d8c7f0d0456ac135ef74d52",
"timestamp": "",
"source": "github",
"line_count": 1675,
"max_line_length": 79,
"avg_line_length": 39.90089552238806,
"alnum_prop": 0.5090822036687913,
"repo_name": "garvenshen/zeda-swift",
"id": "ce7dcb264e4eee725a8f7ce3fca41662111e1e48",
"size"... |
from cla_public.app import create_app
app = create_app(config_file="config/deployment.py")
| {
"content_hash": "5dfa9fb7c0421d5950f67b6867d51a5b",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 52,
"avg_line_length": 30.666666666666668,
"alnum_prop": 0.7717391304347826,
"repo_name": "ministryofjustice/cla_public",
"id": "612b7798d633caf137e6b103d056b954fccc4d0d",
"... |
from org.gluu.model.custom.script.type.user import UserRegistrationType
from org.gluu.ldap.model import GluuStatus
from org.gluu.util import StringHelper, ArrayHelper
from java.util import Arrays, ArrayList
import java
class UserRegistration(UserRegistrationType):
def __init__(self, currentTimeMillis):
se... | {
"content_hash": "944b49a68eb5c7ed3d696e211412b7ce",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 112,
"avg_line_length": 37.57142857142857,
"alnum_prop": 0.7239543726235741,
"repo_name": "GluuFederation/oxExternal",
"id": "ba6b9d6c82871b1d1cc1e638f4790fa110b7340e",
"si... |
"""Simple functional APIs for TF2."""
from sonnet import optimizers as oo_optimizers
from sonnet.src.functional import haiku
from sonnet.src.functional import jax
from sonnet.src.functional import optimizers
# Utilities for converting Sonnet code into pure functions.
variables = haiku.variables
transform = haiku.tran... | {
"content_hash": "9300fca608c19c81e35ec20003d08611",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 59,
"avg_line_length": 24.541666666666668,
"alnum_prop": 0.7275042444821732,
"repo_name": "deepmind/sonnet",
"id": "2ad678fb258c5c11b655105b9f5d6491656654fb",
"size": "1861... |
"""
Transformations between QuantumChannel representations.
"""
import numpy as np
from qiskit.exceptions import QiskitError
from qiskit.quantum_info.operators.predicates import is_hermitian_matrix
from qiskit.quantum_info.operators.predicates import ATOL_DEFAULT
def _transform_rep(input_rep, output_rep, data, inpu... | {
"content_hash": "4fa12d7be24b2d4adcf2b643eb567173",
"timestamp": "",
"source": "github",
"line_count": 451,
"max_line_length": 94,
"avg_line_length": 36.60532150776053,
"alnum_prop": 0.6103337573444788,
"repo_name": "QISKit/qiskit-sdk-py",
"id": "2d980942550bc1312cd539c20ef2f09e76dd7546",
"size": ... |
import pyblish.api
class ValidateMindbenderProjectEditInfo(pyblish.api.ContextPlugin):
"""Checks your scene with editorial info
All the info that gets validated has been set by the projects bat files.
If you are certain that the info is incorrect, talk to your project
Supervisor with haste!
"""
... | {
"content_hash": "0e2b4ff29c706be3cfcbb7faf135991e",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 76,
"avg_line_length": 32,
"alnum_prop": 0.5705818965517241,
"repo_name": "mindbender-studio/config",
"id": "e4879205d6669df12c8506f349457af8d0fbf8bb",
"size": "1893",
"b... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/medicine/shared_medpack_enhance_strength.iff"
result.attribute_template_id = 7
result.stfName("medicine_name","medpack_enhance_strength")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
retu... | {
"content_hash": "3de97b07eab1a9fbd1fb5c114128c6f8",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 81,
"avg_line_length": 25.307692307692307,
"alnum_prop": 0.7173252279635258,
"repo_name": "obi-two/Rebelion",
"id": "5a476eacd66f164d695edc59a2a6198449217fba",
"size": "474... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('workshops', '0106_auto_20160701_0246'),
]
operations = [
migrations.AddField(
model_name='trainingrequest',
name='comment',
... | {
"content_hash": "d0d0d1373da10ce9e53dc03d722405dd",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 278,
"avg_line_length": 37.69565217391305,
"alnum_prop": 0.6412918108419838,
"repo_name": "vahtras/amy",
"id": "dfa9d589888230932687570bf271989dc083b32c",
"size": "939",
... |
'''
catalog_harvesting/__init__.py
'''
import logging
import os
__version__ = '1.2.0'
LOGGER = None
def get_logger():
'''
Returns an initialized logger
'''
global LOGGER
if LOGGER is None:
LOGGER = logging.getLogger(__name__)
return LOGGER
def get_redis_connection():
redis_u... | {
"content_hash": "9bf16c5ef10698fea40d1b67042fd694",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 71,
"avg_line_length": 20,
"alnum_prop": 0.5972972972972973,
"repo_name": "ioos/catalog-harvesting",
"id": "24a2a1f936e6682c742b8c78d27fc836605dde2a",
"size": "762",
"bin... |
import telnetlib
from time import sleep
TELNET_PORT = 23
TELNET_TIMEOUT = 6
def main():
print "Hello"
time.sleep(6)
print "Hello6"
ip_addr = '10.7.192.169'
username = 'pete4027'
password = 'Intel1000'
remote_conn = telnetlib.Telnet(ip_addr, TELNET_PORT, TELNET_TIMEOUT)
output = remot... | {
"content_hash": "da63cb699bc9846334b255d1f81a59f2",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 72,
"avg_line_length": 23.48148148148148,
"alnum_prop": 0.6577287066246057,
"repo_name": "peternemec/peterPYTHON",
"id": "c1ae45b7321e60e3785fb6d2172e10d605a083b4",
"size":... |
"""Benchmark for split and grad of split."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import itertools
import random
import time
import tensorflow as tf
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_boolean("use_gpu", True, """Run GPU benchmarks.""... | {
"content_hash": "1d84964654320aae67934cd6576ab5b3",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 79,
"avg_line_length": 33.265625,
"alnum_prop": 0.5875998121183654,
"repo_name": "nanditav/15712-TensorFlow",
"id": "00dd9b107631604f31473ee59cb7f57f9eab63d2",
"size": "49... |
import threading
from abc import ABCMeta, abstractmethod
from hqlib.rabbitmq import ExchangeType
import logging
from pika.exceptions import AMQPConnectionError
class Subscriber(threading.Thread):
__metaclass__ = ABCMeta
def __init__(self, rabbitmq, exchange_name, routing_key, queue_name="", qos=0, auto_delet... | {
"content_hash": "0ec95ace3811262f3b18a16fa6c8fa67",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 169,
"avg_line_length": 40.527272727272724,
"alnum_prop": 0.6195603409600717,
"repo_name": "herqles-io/hq-lib",
"id": "bd2a9d4e8cc42d1b5f373af13b48097cccc8b3b0",
"size": "... |
import os
from java.io import File
from ij import ImagePlus
from ij import IJ
from ij.measure import Measurements
from ij.measure import ResultsTable
from ij.plugin.frame import RoiManager
table = ResultsTable()
x_axis_calibration = 0.160 # um
y_axis_calibration = 5 # sec
save_roi = True
kymo_extension = ".tif"
pa... | {
"content_hash": "e73155f741a1a90f02fdce3887742bad",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 97,
"avg_line_length": 25.52857142857143,
"alnum_prop": 0.7011751538891998,
"repo_name": "hadim/fiji_tools",
"id": "6e8e53bc97eff016d6022ca93524d423ffd70bba",
"size": "1981... |
"""
worker.py
~~~~~~~~~
EnergyPlus worker. This contains the basic code required to watch a folder for
incoming jobs, then run them and place the results ready to be fetched by the
client.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ i... | {
"content_hash": "d1c66ee6ef85dccf08faf13309626aef",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 79,
"avg_line_length": 25.75657894736842,
"alnum_prop": 0.5923371647509579,
"repo_name": "jamiebull1/eplus_worker",
"id": "74f17ebf496542d089619912027713f585ec6bb1",
"size... |
"""
Application to convert MAF file to AXT file, projecting to any two species.
Reads a MAF file from standard input and writes an AXT file to standard out;
some statistics are written to standard error. The user must specify the
two species of interest.
usage: %prog primary_species secondary_species < maf_file >... | {
"content_hash": "cd3c685f8d917a2e0115e6e9d83da423",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 78,
"avg_line_length": 22.807339449541285,
"alnum_prop": 0.6516492357200322,
"repo_name": "bxlab/HiFive_Paper",
"id": "3c5aa3d6c5d38e907a10be16b7f0be6b94e10ec9",
"size": "... |
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: f5bigip_gtm_topology
short_description: BIG-IP gtm topology module
description:
- Configures a topology statement.
version_added: "2.4"
author:
- "Eric Jacob (@erjac7... | {
"content_hash": "82a7f01390b0f441e1c836153c70b060",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 110,
"avg_line_length": 27.99122807017544,
"alnum_prop": 0.630836728298339,
"repo_name": "GabrielFortin/ansible-module-f5bigip",
"id": "b7d0d0a6a4ecb93de832eb53bd798a82ae9f1... |
'''Django has several of these built-in but they are annoying to use.
:attr:`WEEK_MAP_MID`: This is a map of the days of the week along with the
mid-length string for that value. For example:
.. code-block:: python
WEEK_MAP_MID = {
0: 'Mon',
1: 'Tue',
...
}
:attr:`WEEK_MAP_SHORT`: This is... | {
"content_hash": "b034b94729008e164355f426af5373e4",
"timestamp": "",
"source": "github",
"line_count": 344,
"max_line_length": 78,
"avg_line_length": 27.122093023255815,
"alnum_prop": 0.5810289389067524,
"repo_name": "AeroNotix/django-timetracker",
"id": "27eb984592238ff88ca70e89e1db10c9af49b14b",
... |
"""
MINDBODY Public API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Upc... | {
"content_hash": "e34039cc5a2ca2ee271b2691e0ffb97f",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 123,
"avg_line_length": 31.541463414634148,
"alnum_prop": 0.588617383235385,
"repo_name": "mindbody/API-Examples",
"id": "31962d5bcfdf7794cd7386615abdc6d0a7c21f1c",
"size"... |
"""Gradient tape utilites."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import contextlib
from tensorflow.python import pywrap_tensorflow
from tensorflow.python.util.lazy_loader import LazyLoader
# There is a circular dependency between this, ops.py... | {
"content_hash": "d26e2c00521dee9f0e292581a0938e99",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 99,
"avg_line_length": 31.440298507462686,
"alnum_prop": 0.7298836933301686,
"repo_name": "alsrgv/tensorflow",
"id": "66a58af371bfc10490e3dfe45d1b68dc54f9fae3",
"size": "4... |
from globals import WORLD_INFO, ITEMS, LIFE
import alife
def is_life(entity):
_life = (not 'prefix' in entity)
if _life:
_id_key = 'id'
else:
_id_key = 'uid'
return _life, _id_key
def create(entity, action, time):
_life, _id_key = is_life(entity)
_new_timer = {'action': action,
'time': WOR... | {
"content_hash": "e6b309fa2cd2f74683650f2228aeed53",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 62,
"avg_line_length": 21.227272727272727,
"alnum_prop": 0.6009992862241256,
"repo_name": "flags/Reactor-3",
"id": "4617037491cd48d15ae2b7523a0cb1adf8d60cb5",
"size": "1401... |
import unittest
import numpy
import chainer
from chainer.backends import cuda
import chainer.functions as F
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
@testing.parameterize(*testing.product({
'shape': [(), (3, 2)],
}))
class Log1pFunctionTest(unittest.TestCas... | {
"content_hash": "73178818e107b91519107e3b4ac471ea",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 79,
"avg_line_length": 29.671875,
"alnum_prop": 0.6456029489204844,
"repo_name": "aonotas/chainer",
"id": "2a3a69eb70b04000c5a1473f181c92a13b854cf9",
"size": "1899",
"bin... |
from RPi import GPIO
from time import sleep
GPIO.setmode(GPIO.BOARD)
PINS = (22, 24, 26)
latest_states = {}
for p in PINS:
GPIO.setup(p, GPIO.IN)
latest_states[p] = GPIO.input(p)
try:
while True:
for p in PINS:
state = GPIO.input(p)
if state and state != latest_states[p]:... | {
"content_hash": "3aff91a603d28dc9e48743ba1ed89014",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 51,
"avg_line_length": 20.272727272727273,
"alnum_prop": 0.5672645739910314,
"repo_name": "madebymany/isthetoiletfree",
"id": "b892ccf64c1b8f6f7e5d5d1bb6a3fa7435af1844",
"s... |
"""Print standard input or files, omitting repeated lines"""
import os
import sys
import fileinput
import argparse
def main(args):
ap = argparse.ArgumentParser()
ap.add_argument('files', nargs='*', help='files to unique (must be sorted first)')
ns = ap.parse_args(args)
def _print(lines):
if l... | {
"content_hash": "cae3b67bd60f3a9056a7e7aa6b9426ce",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 86,
"avg_line_length": 23.972972972972972,
"alnum_prop": 0.552423900789177,
"repo_name": "jsbain/stash",
"id": "4090f0f2a48e7d555c763100a0f290f86f039916",
"size": "887",
... |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name=... | {
"content_hash": "2386fc03997afea69eaa2de21fe5fd33",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 114,
"avg_line_length": 35.3125,
"alnum_prop": 0.5327433628318584,
"repo_name": "MaximeRaynal/SimpleNote",
"id": "14ab5e9e063682addc7cbdf81bbb79ab99379a3d",
"size": "1719",... |
"""
An annotation library that draws overlays on the Raspberry Pi's camera preview.
Annotations include bounding boxes, text overlays, and points.
Annotations support partial opacity, however only with respect to the content in
the preview. A transparent fill value will cover up previously drawn overlay
under it, but ... | {
"content_hash": "bdd9af88834b30baf804f2c8e849ec66",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 84,
"avg_line_length": 41.191616766467064,
"alnum_prop": 0.6373019334205553,
"repo_name": "google/aiyprojects-raspbian",
"id": "efb4ab8f470f77033970385ea427b743bec13b0f",
... |
"""SCons.Util
Various utility functions go here.
"""
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# 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
# wit... | {
"content_hash": "53060be9341e4a65e43fa232b1ce491f",
"timestamp": "",
"source": "github",
"line_count": 1523,
"max_line_length": 98,
"avg_line_length": 33.0059093893631,
"alnum_prop": 0.6007201400493356,
"repo_name": "EmanueleCannizzaro/scons",
"id": "2370a9c35f29691ce28d39328ffbd42b675f4b6b",
"siz... |
import os
import pytest
from conda_build import api
from .utils import thisdir
@pytest.fixture()
def recipe():
return os.path.join(thisdir, 'test-recipes', 'go-package')
@pytest.mark.sanity
def test_recipe_build(recipe, testing_config, testing_workdir, monkeypatch):
# These variables are defined solely for ... | {
"content_hash": "45a4434655118a7701f95b7b7ea40641",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 76,
"avg_line_length": 27.80952380952381,
"alnum_prop": 0.7328767123287672,
"repo_name": "pelson/conda-build",
"id": "3f4b3ad0bb2b99916336fe93e8275ef4ac0fdddc",
"size": "58... |
"""
ircd.configure
~~~~~~~~~~~~~~
Command-line configuration script for XinIRCd.
"""
import yaml
from ircd.constants import *
OPTIONS = {}
DEFAULTS = {
"MODULE_DIR": os.path.abspath(
os.path.dirname(__file__) + os.sep + "modules"),
"MAX_CLIENT": 1024,
"NICK_LENGTH": 32,
"CHAN_LE... | {
"content_hash": "91990f83a785df24c50f722d9f793a6e",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 78,
"avg_line_length": 30.068376068376068,
"alnum_prop": 0.5409323479249574,
"repo_name": "failedxyz/xinircd",
"id": "e817c8172ea8730b1588ce5517a2b9b095f74c84",
"size": "3... |
from wtforms import (DateField, DecimalField, IntegerField, TextField,
validators, FileField)
from finance.forms import BaseForm, Form
from finance.models.account import Account
class DateLocaleField(DateField):
"""Overload DateField to handle locale format, if applicable"""
def process_... | {
"content_hash": "1b3574c20aa6455c4dd62d660fa7e871",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 79,
"avg_line_length": 35.145833333333336,
"alnum_prop": 0.6354475400118553,
"repo_name": "reinbach/finance",
"id": "9bbca49bc3c5763472f0753fdc318958f39eb461",
"size": "168... |
"""
Test suite for VMware VMDK driver volumeops module.
"""
import ddt
import mock
from oslo_utils import units
from oslo_vmware import exceptions
from oslo_vmware import vim_util
from cinder import test
from cinder.volume.drivers.vmware import exceptions as vmdk_exceptions
from cinder.volume.drivers.vmware import vo... | {
"content_hash": "f961dc2e464550e3433f386c2754f11f",
"timestamp": "",
"source": "github",
"line_count": 1830,
"max_line_length": 79,
"avg_line_length": 44.94808743169399,
"alnum_prop": 0.5667011123943834,
"repo_name": "ge0rgi/cinder",
"id": "f5dedfcdb5612ddf22c89aae840f7c5124b8f1c3",
"size": "82887... |
"""
The :mod:`sklearn.manifold` module implements data embedding techniques.
"""
from .locally_linear import locally_linear_embedding, LocallyLinearEmbedding
from .isomap import Isomap
from .mds import MDS
| {
"content_hash": "ffae3a8a486dd210adf5ec81ff64d820",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 76,
"avg_line_length": 29.571428571428573,
"alnum_prop": 0.7971014492753623,
"repo_name": "sgenoud/scikit-learn",
"id": "7ae011739adf46649ec2d487f5e3c7e70a4a9347",
"size": "... |
import _plotly_utils.basevalidators
class XpadValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(self, plotly_name="xpad", parent_name="surface.colorbar", **kwargs):
super(XpadValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | {
"content_hash": "ed9225f9f2820e5b0bcde2c66b101132",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 85,
"avg_line_length": 36.25,
"alnum_prop": 0.6022988505747127,
"repo_name": "plotly/plotly.py",
"id": "234b9cb0a70d67857ee78541e8c9bffdbf15132d",
"size": "435",
"binary"... |
import pg
import random
SPEED = 250
COUNT = 10000
FIELD_SIZE = 2000
FIELD_DEPTH = 2500
class Window(pg.Window):
def setup(self):
data = []
shape = pg.Plane((0, 0, 0), (0, 0, 1), 0.5, False)
for _ in xrange(COUNT):
x = (random.random() - 0.5) * FIELD_SIZE
y = (random... | {
"content_hash": "af8e3675c8f4b211655d515b39965a5c",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 65,
"avg_line_length": 32.53125,
"alnum_prop": 0.5369836695485111,
"repo_name": "fogleman/pg",
"id": "7bfdaf75412933f65581e0d43e103612f497ec7d",
"size": "1041",
"binary":... |
import os
import os.path
import fs
from .setup import *
def test_listdirs():
dirs = [ os.path.join(TEST_DIR,f) for f in os.listdir(TEST_DIR)
if os.path.isdir(os.path.join(TEST_DIR,f)) ]
fs_dirs = list( fs.listdirs(TEST_DIR) )
assert len(dirs) is len(fs_dirs)
assert sorted(dirs) == sorted(... | {
"content_hash": "cc79e2936bbb8e7a2926539d6155d455",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 68,
"avg_line_length": 21.866666666666667,
"alnum_prop": 0.6463414634146342,
"repo_name": "chaosmail/python-fs",
"id": "df7664eb5e1ccdd7a0f62d8e46a009f5481711eb",
"size": "... |
#!/usr/bin/python
import os, stat, string, sys, time
from xml.sax import make_parser, handler
class AccessorDefHandler ( handler.ContentHandler ):
indexCount = { "field" : 1, \
"repetition" : 2, \
"component" : 2, \
"su... | {
"content_hash": "700e5d6d5cae7471b3c5c70565fa3ef8",
"timestamp": "",
"source": "github",
"line_count": 357,
"max_line_length": 169,
"avg_line_length": 40.27450980392157,
"alnum_prop": 0.46028654889414383,
"repo_name": "jcomellas/hl7parser",
"id": "efc251518c585c87e7ee04943e32e14284380983",
"size":... |
from bson import ObjectId
from django.views.decorators.csrf import csrf_exempt
import pymongo
from PenBlog.func import *
__author__ = 'quanix'
def show_all(request):
db = connect_mongodb_database(request)
info = db.infos.find_one()
categories = list(db.categories.find(sort=[('Order', pymongo.ASCENDING)]))... | {
"content_hash": "dd743a12c7d498c7326f7306a76b0ffb",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 82,
"avg_line_length": 29.061068702290076,
"alnum_prop": 0.5763068032571579,
"repo_name": "quanix/PenBlog",
"id": "67568d8adb1d99412e8008baa4be853ea8c3a7e7",
"size": "4050... |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import collections
import operator
import sympy as sym
import z3
import utils as U
from utils import print
def sympy2z3(sympy_exprs):
"""
convert a sympy expression to a z3 expression. This return... | {
"content_hash": "ebef8455e2613e215f6cfb6f93d879ae",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 77,
"avg_line_length": 30.55944055944056,
"alnum_prop": 0.6160183066361556,
"repo_name": "zutshi/S3CAMR",
"id": "834d18cce3443c726ba6dec57f4805be57fa58ec",
"size": "4370",... |
from ftw import ruleset, errors
import pytest
def test_output():
with pytest.raises(errors.TestError) as excinfo:
ruleset.Output({})
assert(excinfo.value.args[0].startswith('Need at least'))
with pytest.raises(errors.TestError) as excinfo:
ruleset.Output({'status': 'derp'})
assert(exci... | {
"content_hash": "ef0481010a9701fb78e629a75ecf6a43",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 70,
"avg_line_length": 33.15555555555556,
"alnum_prop": 0.6260053619302949,
"repo_name": "CRS-support/ftw",
"id": "d2d503585eb81a02a04b816cf87d09d20d9b0069",
"size": "1492"... |
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Subtitl... | {
"content_hash": "5609470a3dde7a48a86d8fa529e262bf",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 119,
"avg_line_length": 27.871559633027523,
"alnum_prop": 0.5375246872942725,
"repo_name": "Royal-Society-of-New-Zealand/NZ-ORCID-Hub",
"id": "f8a7e349d85f87d57b9f03a6d090ab... |
"""
Flask application for serving poolvr.
"""
import os
import logging
import json
import shutil
import subprocess
from copy import deepcopy
from flask import Flask, request, Markup
from jinja2 import Environment, FileSystemLoader
_logger = logging.getLogger(__name__)
_here = os.path.dirname(os.path.abspath(__file_... | {
"content_hash": "5350d45fd60f5ad825f94854788a0578",
"timestamp": "",
"source": "github",
"line_count": 265,
"max_line_length": 187,
"avg_line_length": 38.64905660377359,
"alnum_prop": 0.5727396992774849,
"repo_name": "jzitelli/poolvr",
"id": "4e86a8680a494cc65fc6ba872875c23332f12dc7",
"size": "102... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.