text stringlengths 4 1.02M | meta dict |
|---|---|
from agithub.base import VERSION, STR_VERSION
__all__ = ["VERSION", "STR_VERSION"]
| {
"content_hash": "6f82c3b076ecf253718e4d5c88c281db",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 45,
"avg_line_length": 28,
"alnum_prop": 0.6904761904761905,
"repo_name": "mozilla/agithub",
"id": "e47e18b0e11b798d0e3284c2b66cee8bbd301b56",
"size": "172",
"binary": fal... |
import re
from django.core.exceptions import ObjectDoesNotExist
from django.template import Library, Node, Variable
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from wakawaka.models import WikiPage
from wakawaka.urls import WIKI_SLUG
register = Library()
WIKI_WORDS_REGEX ... | {
"content_hash": "45fc80eadf45bc69e85d13a63dbb4e88",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 89,
"avg_line_length": 31.741935483870968,
"alnum_prop": 0.6158536585365854,
"repo_name": "pythonchelle/pycon",
"id": "8685cb1056643b376cd93c39eb7fd8c391575ebc",
"size": "2... |
from contextlib import contextmanager
from random import random, randrange
import os
import subprocess
import sys
import time
import unittest
import urllib as url
# 3p
from mock import patch
from nose.plugins.attrib import attr
# project
# needed because of the subprocess calls
sys.path.append(os.getcwd())
from ddage... | {
"content_hash": "c26a03e99ee3cd933bbe5b84052a358f",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 99,
"avg_line_length": 28.58048780487805,
"alnum_prop": 0.5777436422597713,
"repo_name": "cberry777/dd-agent",
"id": "c42a0ab46dbf1f388233eae0ffa1a54daee7888a",
"size": "5... |
r"""Tests for detection_inference.py."""
import os
import StringIO
import numpy as np
from PIL import Image
import tensorflow as tf
from object_detection.core import standard_fields
from object_detection.inference import detection_inference
from object_detection.utils import dataset_util
def get_mock_tfrecord_path... | {
"content_hash": "6bd2ebfba0ccd58c34c08c2cba23ccf7",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 80,
"avg_line_length": 35.388888888888886,
"alnum_prop": 0.5951508808651665,
"repo_name": "cshallue/models",
"id": "eabb6b474d672a48139cb4cdeebd388a4d5c4fca",
"size": "642... |
"""Fichier contenant la fonction route."""
from primaires.scripting.fonction import Fonction
from primaires.scripting.instruction import ErreurExecution
class ClasseFonction(Fonction):
"""Retourne la route entre deux salles, si trouvée."""
@classmethod
def init_types(cls):
cls.ajouter_types(cls.... | {
"content_hash": "dedc5509ab68a4b10c1692be7d53a93c",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 72,
"avg_line_length": 35.67857142857143,
"alnum_prop": 0.6356356356356356,
"repo_name": "vlegoff/tsunami",
"id": "70dda25d2986cfc3c1863df51e15bce3dfa0cc9b",
"size": "3588"... |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.core.urlresolvers import reverse
from django.test import TestCase
from django.contrib.auth import get_user_model
from django.... | {
"content_hash": "6bced4f0dd8f6744a6cac487c960537f",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 105,
"avg_line_length": 30.11111111111111,
"alnum_prop": 0.6507883260650789,
"repo_name": "brajput24/fabric-bolt",
"id": "aceef8654be8a9f4046b81b31ddc5876568691af",
"size":... |
from flask_wtf.form import Form
from wtforms.fields import TextAreaField, PasswordField
from wtforms.fields.html5 import EmailField
from wtforms.widgets.core import TextArea
from wtforms.validators import input_required
class CKEditorWidget(TextArea):
def __call__(self, field, **kwargs):
if kwargs.get('cl... | {
"content_hash": "46bb1d30f91565a7376e43db6cad4905",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 68,
"avg_line_length": 28.96153846153846,
"alnum_prop": 0.6985391766268261,
"repo_name": "ap13p/elearn",
"id": "cc9304a6705d05958e20d31bedfb1c22cae97ec8",
"size": "753",
... |
class MonitorTimer:
def __init__(self, monitor, metric):
pass
def __enter__(self):
pass
def __exit__(self, type, value, traceback):
pass
class Monitor:
def __init__(self, settings):
pass
def put(self, metric, value, units):
pass
def count(self, metric):
pass
def time(self, metric):
return M... | {
"content_hash": "7ab7f8ce7c7bba25c4717462e14c00a3",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 44,
"avg_line_length": 14.375,
"alnum_prop": 0.6550724637681159,
"repo_name": "oskgeek/liftpass",
"id": "e9cde4e504b709f48df6612ce0d82ccb659be1da",
"size": "347",
"binary... |
import _plotly_utils.basevalidators
class FamilyValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="family", parent_name="pie.title.font", **kwargs):
super(FamilyValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | {
"content_hash": "19ec38a66640a9e2f80e5a285408d1ed",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 85,
"avg_line_length": 39.666666666666664,
"alnum_prop": 0.5882352941176471,
"repo_name": "plotly/python-api",
"id": "8b658bcaf83a662a724ec51588f44eb568d39656",
"size": "59... |
import numpy as np
from numpy.testing import (assert_equal, assert_almost_equal,
assert_raises)
from skimage.transform._geometric import _stackcopy
from skimage.transform._geometric import GeometricTransform
from skimage.transform import (estimate_transform, matrix_transform,
... | {
"content_hash": "3497378381aecde2a24cc096f4293c2f",
"timestamp": "",
"source": "github",
"line_count": 321,
"max_line_length": 77,
"avg_line_length": 33.504672897196265,
"alnum_prop": 0.6710367271036727,
"repo_name": "vighneshbirodkar/scikit-image",
"id": "98bb75243e30ecf22cafc242fc2f67916787bb16",
... |
from django.contrib.auth.models import User, Permission
from rest_framework import serializers
from core.models import Client, Project, Entry
from core.fields import DurationField
from core.models import Task
class PermissionSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Permis... | {
"content_hash": "3a83398963a097737011b05fc1f31932",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 67,
"avg_line_length": 24.944444444444443,
"alnum_prop": 0.5676105631562202,
"repo_name": "overshard/timestrap",
"id": "478364bd7fe605b57938e7b366716c76b8e6ed42",
"size": ... |
from pycocotools.coco import COCO
import numpy as np
import skimage.io as io
import os.path
import sys
if len(sys.argv) <= 1:
print("Data Type argument needs to be `val2014` or `train2014`.")
sys.exit(1)
dataDir = './data'
dataType = sys.argv[1]
fdir = '%s/%s' % (dataDir, dataType)
if not os.path.exists(fdir):
... | {
"content_hash": "478337d09cbdd87aedf201b2fdf7f00d",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 73,
"avg_line_length": 23.885714285714286,
"alnum_prop": 0.6519138755980861,
"repo_name": "pbrazdil/deepmask",
"id": "4db0470277e0579be25c21fcd80a1c66fdfe2862",
"size": "83... |
from __future__ import absolute_import, print_function
import logging
from datetime import datetime, timedelta
from changes.config import db
from changes.db.utils import try_create
from changes.lib.flaky_tests import get_flaky_tests
from changes.models import FlakyTestStat, Project, TestCase
import urllib2
def log... | {
"content_hash": "7a5e4dca37c5d577676b575c112d4998",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 93,
"avg_line_length": 32.7887323943662,
"alnum_prop": 0.5094501718213058,
"repo_name": "bowlofstew/changes",
"id": "4df60e7770ad40ef21d9f7c80c2e0fc81fe9b5f8",
"size": "235... |
'''
Created on Apr 16, 2009
@author: bolme
'''
from pyvision.point.DetectorROI import DetectorROI
#import pyvision as pv
#from scipy import weave
import cv
def ExtractSURF(im,min_hessian=300):
'''
Uses OpenCV to extract SURF keypoints. Currently does not compute SURF features.
TODO: An option should... | {
"content_hash": "aee963fcb055756f2e2e62215f3706f6",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 114,
"avg_line_length": 36.632183908045974,
"alnum_prop": 0.6027612174458739,
"repo_name": "hitdong/pyvision",
"id": "6c1a7c825f4f982e71347b53cda8b21fcc3058f6",
"size": "31... |
import re
import glob
import json
from scripts.migrate_piwik import utils
from scripts.migrate_piwik import settings
def main():
"""Verification of batching/anonymization script.
Asserts:
* Expected number of batch files exist for both public and private collections.
* No extra batch files exist f... | {
"content_hash": "957ba26c7c3da3d001cf8d05e2aaeed3",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 110,
"avg_line_length": 35.99009900990099,
"alnum_prop": 0.5570839064649243,
"repo_name": "emetsger/osf.io",
"id": "9c6849b9b52c1c7ba8160e3b6b067504ef2992a0",
"size": "363... |
"""This is used by run_tests.py to create cpu load on a machine"""
while True:
pass
| {
"content_hash": "ca7b2d7c942683052477b0772ac782d8",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 66,
"avg_line_length": 21.5,
"alnum_prop": 0.6976744186046512,
"repo_name": "grani/grpc",
"id": "857addfb38658a80f344a75d7526f8c5a1cc5ba0",
"size": "1640",
"binary": false... |
'''
Created on Aug, 5 2015
@author: mlaptev
'''
class CallCount(object):
'''
This class provides functionality that can be used like a decorator
that calculates how many times decorated method has been called
'''
global_counter = 0
def __init__(self, function):
'''
Constructo... | {
"content_hash": "883489359d78c6c54c3b2f0977f6ccf5",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 78,
"avg_line_length": 23.25,
"alnum_prop": 0.5794504181600956,
"repo_name": "MikeLaptev/sandbox_python",
"id": "da2eaa861add0263f63b970a5826692e0fb0e087",
"size": "837",
... |
from __future__ import print_function
import sys
import re
import argparse
import logging
try:
from itertools import izip_longest as zip_longest # py2
except ImportError:
from itertools import zip_longest # py3
from xigt.codecs import xigtxml
from xigt import Item, Tier, xigtpath as xp
from odinxigt import... | {
"content_hash": "5e57307d31e2d9c7c5b766e7a68c45c9",
"timestamp": "",
"source": "github",
"line_count": 708,
"max_line_length": 119,
"avg_line_length": 37.559322033898304,
"alnum_prop": 0.5082731648616126,
"repo_name": "xigt/odin-utils",
"id": "81bbae90d0d0962c318de47c71f993b6f8c7fda3",
"size": "26... |
"""
Handler for Huawei device specific information through YANG.
Note that for proper import, the classname has to be:
"<Devicename>DeviceHandler"
...where <Devicename> is something like "Default", "Huawei", etc.
All device-specific handlers derive from the DefaultDeviceHandler, which implements the
generic inf... | {
"content_hash": "1d1d8a316fc3c9df8b10a91e40301205",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 87,
"avg_line_length": 33.5625,
"alnum_prop": 0.6964618249534451,
"repo_name": "earies/ncclient",
"id": "00569b1d1867aa8c3d1b4d3c99d2b0674c864a62",
"size": "1611",
"binar... |
from google.cloud import datacatalog_v1beta1
async def sample_list_tags():
# Create a client
client = datacatalog_v1beta1.DataCatalogAsyncClient()
# Initialize request argument(s)
request = datacatalog_v1beta1.ListTagsRequest(
parent="parent_value",
)
# Make the request
page_resu... | {
"content_hash": "f3c03f89f047c75c1a76eeb9f9c67a02",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 64,
"avg_line_length": 25.75,
"alnum_prop": 0.7126213592233009,
"repo_name": "googleapis/python-datacatalog",
"id": "b1e4a2729fb4385e6926ee2c9e440ffd50a176c5",
"size": "190... |
from __future__ import print_function, division, absolute_import
import logging
from tornado import gen
from .plugin import SchedulerPlugin
from ..core import connect, write, coerce_to_address
from ..worker import dumps_function
logger = logging.getLogger(__name__)
class EventStream(SchedulerPlugin):
""" Ma... | {
"content_hash": "bd2408bfc6749d75fa9499c5b0f110c2",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 79,
"avg_line_length": 30.465753424657535,
"alnum_prop": 0.5908273381294964,
"repo_name": "amosonn/distributed",
"id": "6b5677a22bdba1f9560e3c317eca5afa5c0ba44a",
"size": "... |
from flask import jsonify, request, session
from webargs import fields
from werkzeug.exceptions import Forbidden
from indico.core.db import db
from indico.modules.rb.controllers import RHRoomBookingBase
from indico.modules.rb.models.blocked_rooms import BlockedRoom
from indico.modules.rb.models.blockings import Blocki... | {
"content_hash": "afa4f56471c869d8b93680631752b467",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 103,
"avg_line_length": 36.716981132075475,
"alnum_prop": 0.6700924974306269,
"repo_name": "ThiefMaster/indico",
"id": "b26bd5002a7f2d383cdf949d7b936a74edf50490",
"size": ... |
"""Pylons environment configuration"""
import os
from mako.lookup import TemplateLookup
from genshi.template import TemplateLoader
from jinja2 import ChoiceLoader, Environment, FileSystemLoader
from pylons.configuration import PylonsConfig
from pylons.error import handle_mako_error
from sqlalchemy import engine_from_... | {
"content_hash": "6f70455b9e65b36d33bb1813eea8cfdd",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 78,
"avg_line_length": 37.15873015873016,
"alnum_prop": 0.7035454933788979,
"repo_name": "Pylons/pylons",
"id": "9a6dccac79d85ce31ee58d5abe1ada8cdfbe8863",
"size": "2341",
... |
import tornado.web as web
import tornado.template as template
import tornado.ioloop as ioloop
import os,sys,mimetypes
import rarfile,zipfile
supported_archive = [".zip", ".rar"]
supported_image = [".jpe", ".jpg", ".jpeg", ".gif", ".png"]
work_dir = os.getcwd()
list_template = template.Template(
"""<html>
<head>... | {
"content_hash": "0acc15c4b4ecd04312db8e4adfdec374",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 106,
"avg_line_length": 28.3781512605042,
"alnum_prop": 0.558187740598164,
"repo_name": "chaserhkj/PyComicCast",
"id": "b4714ca463f46e6e705c038ef2bd9ae0decb2152",
"size": ... |
from unittest import mock
import octavia # noqa H306
from octavia.common import constants
from octavia.controller.worker.v2.tasks import notification_tasks
import octavia.tests.unit.base as base
class MockNOTIFIER(mock.MagicMock):
info = mock.MagicMock()
@mock.patch('octavia.common.rpc.NOTIFIER',
ne... | {
"content_hash": "9baabe34fc3626f2b738b4fd3b876c19",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 75,
"avg_line_length": 42.191489361702125,
"alnum_prop": 0.6898638426626323,
"repo_name": "openstack/octavia",
"id": "e336ced359f9a84f3a8d1deab2baf78463eb26eb",
"size": "25... |
from JumpScale import j
import JumpScale.grid.zdaemon
j.application.start("zdaemon")
j.logger.consoleloglevel = 2
j.core.zdaemon.initSSL4Server("myorg", "servertest")
j.application.stop()
| {
"content_hash": "1fbcd6c3446c069032e691488fb0fe9d",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 52,
"avg_line_length": 17.545454545454547,
"alnum_prop": 0.7772020725388601,
"repo_name": "Jumpscale/jumpscale6_core",
"id": "d3fa945a60b45870d42e9907895414a3db55698e",
"si... |
from setuptools import setup
VERSION = '0.2.1'
install_reqs = [
'elasticsearch-dsl',
'requests',
'pandas'
]
setup(
name='sharepa',
packages=['sharepa'],
version=VERSION,
description='A library for browsing and analyzing SHARE data',
author='Fabian von Feilitzsch',
author_email='fab... | {
"content_hash": "7bd520bdcbbaa241fe05a0a3879b54d1",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 82,
"avg_line_length": 24.95,
"alnum_prop": 0.6753507014028056,
"repo_name": "erinspace/sharepa",
"id": "cd13743879c12cb8c6b51a22d299f8f080268084",
"size": "499",
"binary... |
import sys
import os, os.path
import shutil
import ConfigParser
import subprocess
import re
from contextlib import contextmanager
def _check_ndk_root_env():
''' Checking the environment NDK_ROOT, which will be used for building
'''
try:
NDK_ROOT = os.environ['NDK_ROOT']
except Exception:
... | {
"content_hash": "e5c59058cf76d218abebf9ae1d6fdbad",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 132,
"avg_line_length": 34.425925925925924,
"alnum_prop": 0.5809575040344271,
"repo_name": "musenshen/SandBoxLua",
"id": "9cbb3c9888b4da8a43f9f79613c38cd4c9899d06",
"size"... |
from tululbot.utils.kbbi import lookup_kbbi_definition
def test_lookup_kbbi(mocker):
class FakeResponse:
def json(self):
return {
'kateglo': {
'definition': [
{
'lex_class_ref': 'nomina',
... | {
"content_hash": "bec8c495069842dd39cdf52ca62e9680",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 92,
"avg_line_length": 28.75409836065574,
"alnum_prop": 0.44982896237172176,
"repo_name": "tulul/tululbot",
"id": "53f4821cb2300f34ce3a95e189bab9c74faeff95",
"size": "1754"... |
"""Tests for the moderation app"""
| {
"content_hash": "b38fb587b09633cff67bc04452525da3",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 34,
"avg_line_length": 35,
"alnum_prop": 0.6857142857142857,
"repo_name": "lpatmo/actionify_the_news",
"id": "4a0f727e0489ab5c9dbe11634154d02c1375ef49",
"size": "35",
"bin... |
from pysyncobj import SyncObj, replicated
import logging
from .config import Config
logger = logging.getLogger(__name__)
class ClusterNode():
def __init__(self, task_id, config=None):
if config is None:
config = Config()
sync_address = config.get('cluster_bind_address')
... | {
"content_hash": "a6531f1be96ed92f7df7adb8d25b673b",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 110,
"avg_line_length": 40.075471698113205,
"alnum_prop": 0.5955743879472694,
"repo_name": "kevenli/scrapydd",
"id": "d049051e1113774265726072a1344b5c057641a2",
"size": "21... |
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
from typing import Any, Iterable, Set, cast
from pants.backend.python.pip_requirement import PipRequirement
from pants.backend.python.util_rules.interpreter_constraints import InterpreterConstraints
from pants.core.util_rules.l... | {
"content_hash": "596832e6669ae5a498df6fc5b0881cc7",
"timestamp": "",
"source": "github",
"line_count": 319,
"max_line_length": 100,
"avg_line_length": 38.78369905956113,
"alnum_prop": 0.6703847397348852,
"repo_name": "benjyw/pants",
"id": "f614b12dd8d7cbb2d520f14828f70d2423704362",
"size": "12504"... |
"""
Django settings for expirationDate 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, ... | {
"content_hash": "4c559e2aa3f5067f5ecc3abf63a4de78",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 74,
"avg_line_length": 24.546153846153846,
"alnum_prop": 0.7082419304293325,
"repo_name": "BontaVlad/ExpirationDate",
"id": "93bb5f5ebbf3f7b79cf13c74cc0a8f929c08cbc8",
"si... |
from __future__ import print_function
import os
import os.path
import signal
import subprocess
import sys
GCMOLE_PATH = os.path.dirname(os.path.abspath(__file__))
CLANG_BIN = os.path.join(GCMOLE_PATH, 'gcmole-tools', 'bin')
CLANG_PLUGINS = os.path.join(GCMOLE_PATH, 'gcmole-tools')
LUA = os.path.join(GCMOLE_PATH, 'gcm... | {
"content_hash": "cb7636b5b8839bfff07f3ed7fc354250",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 83,
"avg_line_length": 26.736842105263158,
"alnum_prop": 0.7145669291338582,
"repo_name": "enclose-io/compiler",
"id": "6f2a091c3c7e62c8d48d5d82a1fcced0817baef0",
"size": "... |
"These module contains some additional functions for string manipulation."
def reverse(s):
"Reverts string s."
return s[::-1]
def distinct_len(s):
"Counts number of distinct chars in string s."
return len(set(s))
| {
"content_hash": "f35e3c9a3197376a6175539eafcaa29d",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 74,
"avg_line_length": 19.5,
"alnum_prop": 0.6837606837606838,
"repo_name": "gvasold/gdp17",
"id": "7716ad3968d59039cbdeaa622a37e6c69991d61f",
"size": "234",
"binary": fa... |
import six
from olympia.addons.models import Category
from olympia.amo.tests import TestCase
from olympia.constants.applications import APPS
from olympia.constants.base import ADDON_EXTENSION, ADDON_PERSONA
from olympia.constants.categories import CATEGORIES
from olympia.landfill.categories import generate_categories
... | {
"content_hash": "66818f3f4c8c6d46c756eb27f7a80e5d",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 78,
"avg_line_length": 39.542857142857144,
"alnum_prop": 0.6893063583815029,
"repo_name": "wagnerand/olympia",
"id": "79b54bfe34884a8de11a95395bebad199bf57dbe",
"size": "14... |
from mock import patch
def load_settings(cls, settings):
return patch.object(cls, '_retrieve_stored_settings', return_value=settings)
| {
"content_hash": "8b9b24974f983e7611852cce2dd5f550",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 80,
"avg_line_length": 28,
"alnum_prop": 0.7571428571428571,
"repo_name": "MD-Studio/MDStudio",
"id": "df6c74109a33a315da506e4083e38c82839c1228",
"size": "165",
"binary": ... |
from __future__ import annotations
from textwrap import dedent
from typing import Callable
import pytest
from pants.backend.python.goals.publish import (
PublishPythonPackageFieldSet,
PublishPythonPackageRequest,
rules,
)
from pants.backend.python.macros.python_artifact import PythonArtifact
from pants.b... | {
"content_hash": "109cf833abae90cd6424fbd103e4f669",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 94,
"avg_line_length": 31.210526315789473,
"alnum_prop": 0.5905258316725434,
"repo_name": "pantsbuild/pants",
"id": "1f0ee49b478b72317828524a74747dae95386611",
"size": "66... |
from __future__ import absolute_import
from google.cloud.oslogin_v1 import types
from google.cloud.oslogin_v1.gapic import enums
from google.cloud.oslogin_v1.gapic import os_login_service_client
class OsLoginServiceClient(os_login_service_client.OsLoginServiceClient):
__doc__ = os_login_service_client.OsLoginSer... | {
"content_hash": "ebcfc00e88e06582a57ff3fbc2788b8d",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 73,
"avg_line_length": 31.692307692307693,
"alnum_prop": 0.7621359223300971,
"repo_name": "tseaver/google-cloud-python",
"id": "83a5ac2635377b56a180adf7be09600c5135a48b",
"... |
'''
Check resolution effects of masking process.
Degrade an image to match the resolution of a more distant one,
then compare the outputs.
'''
from fil_finder import fil_finder_2D
import numpy as np
from astropy.io.fits import getdata
from astropy import convolution
import matplotlib.pyplot as p
# We want to compare ... | {
"content_hash": "4f467fb64b233b7f8812a878326503be",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 115,
"avg_line_length": 36.88837209302326,
"alnum_prop": 0.626780986004287,
"repo_name": "dcolombo/FilFinder",
"id": "421fc5d84cda562fd26c0d319de90c7ac370eed7",
"size": "7... |
"""Provide methods to bootstrap a Home Assistant instance."""
import asyncio
import logging
import logging.handlers
import os
import sys
from time import time
from collections import OrderedDict
from typing import Any, Optional, Dict
import voluptuous as vol
import homeassistant.components as core_components
from ho... | {
"content_hash": "01ad0a8eb5220c71d30c8f2984622b53",
"timestamp": "",
"source": "github",
"line_count": 300,
"max_line_length": 77,
"avg_line_length": 34.346666666666664,
"alnum_prop": 0.6304347826086957,
"repo_name": "MungoRae/home-assistant",
"id": "7831036ff597e6f68403e718deffe2f7256ed582",
"siz... |
"""Custom template tags."""
from six.moves.urllib.parse import urlencode
from django import template
from django.urls import reverse
from django.template.loader import render_to_string
from django.utils.encoding import smart_str
from django.utils.safestring import mark_safe
from django.utils.translation import ugette... | {
"content_hash": "2b77083b68d4cb1123a58378cec2eaaf",
"timestamp": "",
"source": "github",
"line_count": 311,
"max_line_length": 79,
"avg_line_length": 33.81028938906753,
"alnum_prop": 0.5078459343794579,
"repo_name": "modoboa/modoboa-webmail",
"id": "ad897862457f584da504c6081dfbb07432526944",
"size... |
"""Confusion matrix widget"""
from math import isnan, isinf
import unicodedata
from PyQt4.QtGui import (
QGridLayout, QTableView, QStandardItemModel, QStandardItem,
QItemSelectionModel, QItemSelection, QFont, QHeaderView, QBrush, QColor,
QStyledItemDelegate)
from PyQt4.QtCore import Qt, QSize
import nump... | {
"content_hash": "3a7f57e388c61da21584a6efcdea37cf",
"timestamp": "",
"source": "github",
"line_count": 482,
"max_line_length": 80,
"avg_line_length": 37.27800829875519,
"alnum_prop": 0.5619434550311665,
"repo_name": "qPCR4vir/orange3",
"id": "6126453904f9fe23fcb3374e7d14879a83df3a82",
"size": "179... |
"""
Django settings for django_webapp project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ..... | {
"content_hash": "90a3ac89429db623e04bc53454a35135",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 71,
"avg_line_length": 22.678571428571427,
"alnum_prop": 0.7192913385826771,
"repo_name": "data-tsunami/NodeJS-SocketIO-Redis-Python-Nginx",
"id": "bb73d21ab62102d36a857cb45... |
"""Test schedule handling cases in the SchedulableTask class."""
import os, sys
from threading import Thread
from datetime import timedelta, datetime
from django.test import TestCase
from norc.core.models import Scheduler, Schedule, CronSchedule
from norc.core.constants import Status, Request
from norc.norc_utils im... | {
"content_hash": "9813ed0f1df38d2c116cd2218031516b",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 78,
"avg_line_length": 36.280575539568346,
"alnum_prop": 0.5843743803291691,
"repo_name": "darrellsilver/norc",
"id": "0bb16a00261ddac1db666e57402c0f32d1f7b5f8",
"size": "... |
import abc
from neutron_lib.api.definitions import portbindings
from neutron_lib.callbacks import resources
from neutron_lib import constants as const
from neutron_lib.plugins.ml2 import api
from oslo_log import log
import six
from neutron._i18n import _
from neutron.db import provisioning_blocks
LOG = log.getLogger... | {
"content_hash": "17d8d0d438f6c6022213e31985e616f2",
"timestamp": "",
"source": "github",
"line_count": 281,
"max_line_length": 79,
"avg_line_length": 42.95017793594306,
"alnum_prop": 0.6048554146988151,
"repo_name": "noironetworks/neutron",
"id": "ee1fa12e8e325f4b6125c01a6d8fbca50826103a",
"size":... |
from pprint import pprint
from lmnotify import LaMetricManager
def main():
# create an instance of the LaMetricManager
lmn = LaMetricManager()
# --- test cloud ---
# get the user
print("USER\n")
pprint(lmn.get_user(), indent=2)
# get devices
devices = lmn.get_devices()
print("... | {
"content_hash": "4a696eb94dd1fd686603950e9ed671ec",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 47,
"avg_line_length": 20.77358490566038,
"alnum_prop": 0.6167120799273388,
"repo_name": "keans/lmnotify",
"id": "5c4d336e2810f1fcab3708e365ed0833478e4d6d",
"size": "1148",... |
import random
import mock
from neutron.openstack.common import uuidutils
from neutron.plugins.nec.common import ofc_client
from neutron.plugins.nec.db import models as nmodels
from neutron.plugins.nec import drivers
from neutron.tests import base
class TestConfig(object):
"""Configuration for this test."""
... | {
"content_hash": "af14972e6761db5b58f93bf82b9cbd9d",
"timestamp": "",
"source": "github",
"line_count": 332,
"max_line_length": 79,
"avg_line_length": 38.25301204819277,
"alnum_prop": 0.5451968503937008,
"repo_name": "zhhf/charging",
"id": "0eb219f985cf0a15f575cccafd3752f1db8440e2",
"size": "13398"... |
"""Define tests for the Nettigo Air Monitor config flow."""
import asyncio
from unittest.mock import patch
from nettigo_air_monitor import ApiError, AuthFailed, CannotGetMac
import pytest
from homeassistant import data_entry_flow
from homeassistant.components import zeroconf
from homeassistant.components.nam.const im... | {
"content_hash": "aa6bdc1a9c3ceee01b00abf3132be5e7",
"timestamp": "",
"source": "github",
"line_count": 411,
"max_line_length": 84,
"avg_line_length": 33.80778588807786,
"alnum_prop": 0.6251889168765743,
"repo_name": "jawilson/home-assistant",
"id": "015c645a3e776a54b9053ff93b33e937e8e29ca7",
"size... |
"""
Created on Fri Oct 18 14:48:56 2014
@author: jb
"""
def sqlQueryMetatags(style,f):
import sqlalchemy
orcl_engine = sqlalchemy.create_engine('oracle+cx_oracle://jbragato:Blu3f!y@192.168.30.66:1531/dssprd1')
connection = orcl_engine.connect()
querymake_metatags="""SELECT DISTINCT
POMGR_SNP.PRO... | {
"content_hash": "0a15aefcb802846e98c444c2b5aa3d76",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 108,
"avg_line_length": 34.52197802197802,
"alnum_prop": 0.5976444373706828,
"repo_name": "relic7/prodimages",
"id": "b359b78ddbe2f18a4ba68aa55a25401e53fba0cc",
"size": "6... |
"""This code example gets an order by its id. To determine which orders exist,
run get_all_orders.py."""
__author__ = 'api.shamjeff@gmail.com (Jeff Sham)'
# Locate the client library. If module was installed via "setup.py" script, then
# the following two lines are not needed.
import os
import sys
sys.path.insert(0, ... | {
"content_hash": "cf7e05927cef9d4dc975026a14231625",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 80,
"avg_line_length": 30.903225806451612,
"alnum_prop": 0.6711899791231732,
"repo_name": "krux/adspygoogle",
"id": "5f560eacee03de1684605358798ab6d4d72e5eaf",
"size": "157... |
#!/usr/bin/env python3
# -*- coding: utf-8; -*-
# This is autogenerated python file DO NOT try to edit
/* [[[cog
import cog
import json
json_package_path = './emoji.json'
data_dict = json.loads(open(json_package_path).read())
unicode_replace = {}
shortcode_replace = {}
ascii_replace = {}
for key, value in data_di... | {
"content_hash": "555e9f36df84e00e5370d001f2f04499",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 68,
"avg_line_length": 27.878048780487806,
"alnum_prop": 0.6517935258092739,
"repo_name": "launchyard/emojipy",
"id": "e52dbf75175ce5df7956c505e2f4356160379cda",
"size": "1... |
import roomai.games.common
from roomai.games.common.AbstractPlayer import AbstractPlayer
from roomai.models.algorithms import AbstractA3C
logger = roomai.get_logger()
import numpy as np
class Texasholdem_A3CPlayer(AbstractPlayer):
def __init__(self, state_spec, n_a):
self.state_spec = state_spec
s... | {
"content_hash": "fa02c5a2137c01b78836bb6cac9565ba",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 95,
"avg_line_length": 40.5,
"alnum_prop": 0.6129898013955984,
"repo_name": "roomai/RoomAI",
"id": "8fee6b036d88c588fe693ec37625e54bec0de270",
"size": "2054",
"binary": f... |
from cirq.contrib.bayesian_network.bayesian_network_gate import BayesianNetworkGate
| {
"content_hash": "f7f52be2c67f9e653b115ef4f53e8a5c",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 83,
"avg_line_length": 84,
"alnum_prop": 0.8809523809523809,
"repo_name": "quantumlib/Cirq",
"id": "4e030d410d56bf9701bfdf29ef4c4aa434092b7a",
"size": "669",
"binary": fal... |
from azuremodules import *
import argparse
import sys
#for error checking
parser = argparse.ArgumentParser()
parser.add_argument('-d', '--distro', help='Please mention which distro you are testing', required=True, type = str)
args = parser.parse_args()
distro = args.distro
def verify_default_targetpw(distro):
RunL... | {
"content_hash": "ecd1217addae9755ebc2bb421a081bf5",
"timestamp": "",
"source": "github",
"line_count": 373,
"max_line_length": 159,
"avg_line_length": 41.9544235924933,
"alnum_prop": 0.7077129529043389,
"repo_name": "konkasoftci/azure-linux-automation",
"id": "059e28c1d63e1f50c3aee83c6d42feddd1771ad... |
import hmac
import hashlib
import time
import requests
import pandas as pd
import numpy as np
import inspect
import logging
import sys
# need to deal with version
version= '0.1.2'
class Binance:
def __init__(self, logger=None):
# set up logging handler and suppress 'No handlers' message by adding NullHandler
# n... | {
"content_hash": "d1ff5591fb48f3400aae0503d80ea39e",
"timestamp": "",
"source": "github",
"line_count": 808,
"max_line_length": 156,
"avg_line_length": 37.95792079207921,
"alnum_prop": 0.6766547114444083,
"repo_name": "js7558/pyBinance",
"id": "bbfa8b0a4c9a589ee11984930cf26d3891a248e9",
"size": "32... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tempfile
import numpy as np
import six
from tensorflow.contrib.summary import summary_ops
from tensorflow.contrib.summary import summary_test_util
from tensorflow.core.framework import graph_pb2
from t... | {
"content_hash": "02466a73180ebd3a30fefe8623e9fe45",
"timestamp": "",
"source": "github",
"line_count": 246,
"max_line_length": 79,
"avg_line_length": 36.39430894308943,
"alnum_prop": 0.6632413716072825,
"repo_name": "Xeralux/tensorflow",
"id": "c756f8b27055f9cf86a311e485d97745a3c7a95b",
"size": "9... |
from quantum.common import exceptions as q_exc
from quantum.common.utils import find_config_file
from quantum.db import api as db
from quantum.db import db_base_plugin_v2
from quantum.db import l3_db
from quantum.db import models_v2
class Fake1(db_base_plugin_v2.QuantumDbPluginV2,
l3_db.L3_NAT_db_mixin):
... | {
"content_hash": "935a889d813ff9ba9550bde20b8231e6",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 75,
"avg_line_length": 33.526315789473685,
"alnum_prop": 0.6347462061747776,
"repo_name": "psiwczak/quantum",
"id": "98a9884bcfb29d64ac61925c6209592eff3d2a71",
"size": "257... |
import win32com.client
import argparse
import win32security
import win32net
import win32netcon
import re
import string
from impacket.structure import Structure
from impacket.nmb import NetBIOSTimeout
from impacket.dcerpc import transport
from impacket import uuid
from struct import pack
# Get arguments to run the scri... | {
"content_hash": "0129361508af4b9b1f6b6cb3955708df",
"timestamp": "",
"source": "github",
"line_count": 259,
"max_line_length": 111,
"avg_line_length": 33.75289575289575,
"alnum_prop": 0.6514527568062228,
"repo_name": "codewatchorg/p2e",
"id": "4c169f888e61edbddf48f3dd9f0264cc74b1946a",
"size": "10... |
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from ...sipmessaging import SIPHeaderField
from ...sipmessaging import classproperty
class CallInfoSIPHeaderField(SIPHeaderField):
# noinspection PyNestedDecorators
@classproperty
@classmethod
def canonical_f... | {
"content_hash": "643c4630d77dbd0cea8ff2c23872a7ab",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 116,
"avg_line_length": 27.897435897435898,
"alnum_prop": 0.6893382352941176,
"repo_name": "bobjects/BobStack",
"id": "dae8e703c50b5d169e366e6c1aa2fdb49ae96848",
"size": "1... |
import pygame
from constants import SCREEN, SCREEN_WIDTH, SCREEN_HEIGHT, SHOW_FPS, MAX_FPS, CHROMA_KEY
from level import Level
from load_level import Read_File
from misc_functions import show_fps
from confirmation import Confirmation
import sound
def Save_Level(map_data, archivo):
for linea in map_data['mapa']:
arc... | {
"content_hash": "8c65310f71ea3906a5fcbf521eeba4d6",
"timestamp": "",
"source": "github",
"line_count": 287,
"max_line_length": 159,
"avg_line_length": 32.944250871080136,
"alnum_prop": 0.6268640930724484,
"repo_name": "AsparagusEdu/GraviSwitch",
"id": "cc208409a4b887052881576efb347675ba0d1016",
"s... |
import logging
from airflow.contrib.hooks.bigquery_hook import BigQueryHook
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
class BigQueryOperator(BaseOperator):
"""
Executes BigQuery SQL queries in a specific BigQuery database
"""
template_fields = ('bql',... | {
"content_hash": "446fff8ff51ce0c482fecdb7ddff5611",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 90,
"avg_line_length": 41.90625,
"alnum_prop": 0.6196868008948546,
"repo_name": "mylons/incubator-airflow",
"id": "b4e4b0e89884b582578227d0b7368806317fa5f4",
"size": "3249"... |
import django.contrib.gis.db.models.fields
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Counties',
fields=[
('id', models.AutoField(auto_... | {
"content_hash": "d3da2aaf0ddeab518459fa2589513ea7",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 114,
"avg_line_length": 29.96153846153846,
"alnum_prop": 0.55198973042362,
"repo_name": "ngageoint/geoq",
"id": "bfe6ee954dba6b6331cae9d2ee018f5edbda9625",
"size": "828",
... |
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/user/account
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = Client(account, token)
notification = client.notify.services("ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.notifications.create(identity="00000... | {
"content_hash": "e2d8fa649c8b40a02131e6a36d1c8321",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 77,
"avg_line_length": 33.18181818181818,
"alnum_prop": 0.7917808219178082,
"repo_name": "teoreteetik/api-snippets",
"id": "0864b2640e7cec9aa296021f75340e857c6c0b47",
"size... |
from celery import Celery
def make_celery(app):
celery = Celery(app.import_name, backend=app.config['CELERY_RESULT_BACKEND'],
broker=app.config['CELERY_BROKER_URL'])
celery.conf.update(app.config)
celery.config_from_object('celeryconfig')
TaskBase = celery.Task
class ContextTa... | {
"content_hash": "476288112c217c703962f1a6ec302c0a",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 81,
"avg_line_length": 32.611111111111114,
"alnum_prop": 0.6030664395229983,
"repo_name": "rtx3/Microburst",
"id": "9260d31da76f8c2ec70c78d874ca5648a1ea6a8c",
"size": "1198... |
from flask import jsonify
from . import api
@api.app_errorhandler(400)
def bad_request(e):
response = jsonify({"error": "bad request"})
response.status_code = 400
return response
@api.app_errorhandler(403)
def forbidden(e):
response = jsonify({"error": "forbidden"})
response.status_code = 403
... | {
"content_hash": "527976a49c4915e9ca7440a15747f7fb",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 58,
"avg_line_length": 22.054054054054053,
"alnum_prop": 0.6850490196078431,
"repo_name": "a-rank/avaandmed",
"id": "37b1587d0597d3d74c611fbca2001d0fdc8825a4",
"size": "139... |
import eHive
from ReseqTrackDB import Attribute
from ReseqTrackDB import ReseqTrackDB
class StoreAttribute(eHive.BaseRunnable):
"""Store an Attribute or a list of Attributes in the DB"""
def fetch_input(self):
hostname = self.param_required('hostname')
username = self.param_required('usernam... | {
"content_hash": "69fefde731e214f68e9a6f7c20928157",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 95,
"avg_line_length": 32.23529411764706,
"alnum_prop": 0.6386861313868614,
"repo_name": "igsr/igsr_analysis",
"id": "e3bf64e0d3481b066488cc321b68c394521d41f1",
"size": "10... |
import sys
import os
import inspect
import subprocess
import time
import tempfile
import getpass
import shutil
from klab.fs.fsio import read_file, write_temp_file
class RInterface(object):
@staticmethod
def _runRScript(r_script_filename, cwd = '.', remove_output = True):
# Reset to new current workin... | {
"content_hash": "5706ca2024d8bb472e501144f1a6b73c",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 125,
"avg_line_length": 32.93589743589744,
"alnum_prop": 0.6006228104320748,
"repo_name": "Kortemme-Lab/klab",
"id": "ec4aefba42d79d0fbc03fcd2a53184a5453957d1",
"size": "25... |
from verta._swagger.base_type import BaseType
class UacIsSelfAllowedResponse(BaseType):
def __init__(self, allowed=None):
required = {
"allowed": False,
}
self.allowed = allowed
for k, v in required.items():
if self[k] is None and v:
raise ValueError('attribute {} is required'.fo... | {
"content_hash": "59b7245ee2f547e70ef5dc694f66761d",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 62,
"avg_line_length": 22.545454545454547,
"alnum_prop": 0.6270161290322581,
"repo_name": "mitdbg/modeldb",
"id": "04d527c6a949c635f5f6b61fd54cbabba00b8319",
"size": "539",... |
'''
Created on Oct 19, 2012
Script to test regex against a file containing values
to match.
@author 1aN0rmus@tekdefense.com
'''
import re
fileImport =open('example.txt')
strFile=''
for line in fileImport
strFile += line
print(strFile)
regexValue = re.compile('Regex Here')
regexSearch = re.search(regexValue,s... | {
"content_hash": "d08b3dab7f496444ad3a1ff3b73340a7",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 54,
"avg_line_length": 14.303030303030303,
"alnum_prop": 0.6822033898305084,
"repo_name": "kryan762/TekDefense",
"id": "e797287e1dcff8313738138f1aba0a65d62606fb",
"size": "... |
import multiprocessing
import random
import re
import string
import uuid
from ceilometerclient import exc as ceilometer_exc
from glanceclient import exc
import mock
from neutronclient.common import exceptions as neutron_exceptions
from novaclient import exceptions as nova_exceptions
import six
from swiftclient import ... | {
"content_hash": "49139e13c4e0eb3abadc32352b057aa1",
"timestamp": "",
"source": "github",
"line_count": 1799,
"max_line_length": 81,
"avg_line_length": 29.5964424680378,
"alnum_prop": 0.5903012546014574,
"repo_name": "vganapath/rally",
"id": "4c195b6c01a0720bc4ad2cb59105ac220dc96fd2",
"size": "5387... |
"""
Hillslope & uplift example case for PY_ICE_CASCADE landscape evolution model
"""
import py_ice_cascade
import numpy as np
def run_example():
"""
Run hillslope diffusion with uplift example, save results to file, and
return output file name
"""
ny = 50
nx = 100
lx = 1.0
delta = lx/... | {
"content_hash": "73169e9f2694aec34ac80f4f7a7c4664",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 100,
"avg_line_length": 29.425531914893618,
"alnum_prop": 0.6290672451193059,
"repo_name": "keithfma/py_ice_cascade",
"id": "c189062909a024372c067b413c91b37caf13ecf0",
"siz... |
import os
import ycm_core
# These are the compilation flags that will be used in case there's no
# compilation database set (by default, one is not set).
# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR.
flags = [
'-Wall',
'-Wextra',
'-Werror',
'-fexceptions',
'-DNDEBUG',
# THIS IS IMPORTA... | {
"content_hash": "56f42ef53e57d251e776d1964fbc9d97",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 103,
"avg_line_length": 33.265625,
"alnum_prop": 0.6930483795209018,
"repo_name": "RongbinZhuang/simpleOS",
"id": "189f2873dc7bf90eaf0e08ca2904e14a648802a6",
"size": "4935... |
from django.conf.urls.defaults import *
from django.conf import settings
from django.views.generic.simple import direct_to_template
from django.contrib import admin
from account.openid_consumer import PinaxConsumer
import os.path
from microblogging.feeds import TweetFeedAll, TweetFeedUser, TweetFeedUserWithFriends
t... | {
"content_hash": "30e5b94e6e928f88722fedb991f408f4",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 138,
"avg_line_length": 38.27358490566038,
"alnum_prop": 0.6736504806507272,
"repo_name": "ingenieroariel/pinax",
"id": "b031d716fc8f8936af3af8d6db957424ca535034",
"size":... |
import numpy as np
from plantcv.plantcv import fatal_error
from plantcv.plantcv import outputs
def within_frame(mask, border_width=1, label="default"):
"""
This function tests whether the plant touches the edge of the image, i.e. it is completely in the field of view.
Input:
mask = a binary im... | {
"content_hash": "75a33cf651611c0220ff677069966f21",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 116,
"avg_line_length": 36.702127659574465,
"alnum_prop": 0.6562318840579711,
"repo_name": "danforthcenter/plantcv",
"id": "74d2b638834e7bacd33387bf3ba4f1c9921a5b43",
"size... |
"""
The database table controller.
"""
import logging
from sqlite3 import Connection
from typing import Any, Mapping
from snippy.data.dbtypes import Table
from snippy.data.sqlgenerator import SqlGenerator
from snippy.data.sqlite import Sqlite
from snippy.utils.loggingtools import get_logger
class TableCon... | {
"content_hash": "53c16b7e946c6f2330ee04c94b507a7c",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 74,
"avg_line_length": 35.66981132075472,
"alnum_prop": 0.5879396984924623,
"repo_name": "pauljxtan/snippy",
"id": "e4c2a7fd708c5705bf7de014dfe7f8ac172828b3",
"size": "378... |
import unittest
from robot.reporting.jsexecutionresult import JsExecutionResult
from robot.reporting.jswriter import JsResultWriter
from robot.utils import StringIO
from robot.utils.asserts import assert_equal, assert_true
def get_lines(suite=(), strings=(), basemillis=100, start_block='',
end_block=''... | {
"content_hash": "fdcbb23b014584dbda5439be299f2bfd",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 110,
"avg_line_length": 43.10576923076923,
"alnum_prop": 0.5670310060227526,
"repo_name": "jaloren/robotframework",
"id": "dc0a0393d22c6aec52ed68a5d1db35d2de178959",
"size... |
import traceback
from oslo_log import log as logging
from oslo_utils import strutils
import six
import webob
from webob import exc
from nova.api.openstack import common
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova import compute
from nova.compute import vm_states
from nova i... | {
"content_hash": "ba4b0a370b413d000f68d47fb621f91b",
"timestamp": "",
"source": "github",
"line_count": 388,
"max_line_length": 79,
"avg_line_length": 42.121134020618555,
"alnum_prop": 0.6171449550266169,
"repo_name": "cernops/nova",
"id": "ebd3c43e80e13015e910a4c330089cdfab98deff",
"size": "16948"... |
import datetime
from pony.orm import *
from pony import orm
from typing import Optional, Dict, Union
from ..core import HorseFaxBot, ModuleTools, BaseModule
from ..db import db
from horsefax.telegram.types import (Message, User, Chat, UsersJoinedMessage, UserLeftMessage, ChatMigrateFromIDMessage,
... | {
"content_hash": "40c1b6a28f5a8030da16845632d9741e",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 144,
"avg_line_length": 42.65022421524664,
"alnum_prop": 0.6260119861213332,
"repo_name": "TallonRain/horsefaxbot",
"id": "ced7ea31abd543710e88900f7dac0c85145ab1c2",
"size... |
from msrest.service_client import ServiceClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.container_services_operations import ContainerServicesOperations
from .operations.managed_clusters_operations import ManagedClustersOperati... | {
"content_hash": "2daae1c14a5b1afad338dcf7c1135194",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 99,
"avg_line_length": 42.782051282051285,
"alnum_prop": 0.7329937069223854,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "a1c73e58daf58606fed329d20761f6a5f5bf402b",... |
import npyscreen
class TestApp(npyscreen.NPSApp):
def main(self):
# These lines create the form and populate it with widgets.
# A fairly complex screen in only 8 or so lines of code - a line for each control.
npyscreen.setTheme(npyscreen.Themes.ColorfulTheme)
F = npyscreen.SplitForm(... | {
"content_hash": "2b186a29496cb29d1407fe7b72ee50a6",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 90,
"avg_line_length": 39.88235294117647,
"alnum_prop": 0.6297935103244838,
"repo_name": "t1g0r/npyscreen",
"id": "c0ea2aef1804a4688d18ba3142e6321eee40f93c",
"size": "700",... |
"""
Demonstrates how to implement a custom transformation of the data.
"""
import os
import FlowCytometryTools
from FlowCytometryTools import FCMeasurement
from pylab import *
# Locate sample data included with this package
datadir = os.path.join(FlowCytometryTools.__path__[0], 'tests', 'data', 'Plate01')
datafile = ... | {
"content_hash": "ee3a7e00111b33d0a4050348aa249eca",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 82,
"avg_line_length": 28.638297872340427,
"alnum_prop": 0.7080237741456167,
"repo_name": "eyurtsev/FlowCytometryTools",
"id": "566d87a14ba1a5038098fbb2f4da353f2089c89b",
"... |
import os
import re
import csv
import obonet
import pickle
from collections import Counter
def get_synonyms(syns_entry):
synonyms = []
for synonym in syns_entry:
match = re.match(r'^\"(.+)\" (EXACT|RELATED|NARROW|BROAD)',
synonym)
syn, status = match.groups()
... | {
"content_hash": "1f407d885dd5c1181e3edb47ac80a300",
"timestamp": "",
"source": "github",
"line_count": 145,
"max_line_length": 87,
"avg_line_length": 29.055172413793102,
"alnum_prop": 0.597911227154047,
"repo_name": "clulab/bioresources",
"id": "a863240b507606eec6c16ab1068cb0a1d69828b1",
"size": "... |
from copy import copy
import os
import xml.etree.ElementTree as ET
import six
from leather.axis import Axis
from leather.data_types import Date, DateTime
from leather.scales import Scale, Linear, Temporal
from leather.series import Series, CategorySeries
from leather.shapes import Bars, Columns, Dots, Line
import lea... | {
"content_hash": "e46c7b7d0cbf777431724e75db07c774",
"timestamp": "",
"source": "github",
"line_count": 394,
"max_line_length": 126,
"avg_line_length": 32.66243654822335,
"alnum_prop": 0.5595617375087419,
"repo_name": "onyxfish/leather",
"id": "e27218344a8e4d2d09a291c9f41e6943e31a9834",
"size": "12... |
import subprocess
import optparse
import os
import sys
# TODO: Add Windows functionality.
SCRIPT_NAME = "picarro.R"
class ScriptException(Exception):
def __init__(self, returncode, stdout, stderr, script):
self.returncode = returncode
self.stdout = stdout
self.stderr = stderr
Exce... | {
"content_hash": "437644f2a350ee57d145ee87e8dd2895",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 102,
"avg_line_length": 30.37704918032787,
"alnum_prop": 0.6702644360496492,
"repo_name": "wdonahoe/picarro",
"id": "ab530e88a0e9a3cace4743ec49f9bca00eec1cb5",
"size": "187... |
from __future__ import absolute_import
import unittest
import pytest
lupa = pytest.importorskip("lupa")
from . import test_render, test_redirects, test_har
from .utils import NON_EXISTING_RESOLVABLE
class Base:
# a hack to skip test running from a mixin
class EmulationMixin(test_render.BaseRenderTest):
... | {
"content_hash": "0f2c5bae585f2bd7e895738378744429",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 86,
"avg_line_length": 40.957264957264954,
"alnum_prop": 0.669449081803005,
"repo_name": "kod3r/splash",
"id": "f857e25f875964a5362b2864a031a433cec755de",
"size": "4816",
... |
"""Tests for convolution related functionality in tensorflow.ops.nn."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.py... | {
"content_hash": "6eeabe6a30a6e91f32374680f2f0ce60",
"timestamp": "",
"source": "github",
"line_count": 219,
"max_line_length": 80,
"avg_line_length": 41.94063926940639,
"alnum_prop": 0.5790963527490474,
"repo_name": "annarev/tensorflow",
"id": "1aa0b0315f83dfb4cd6fe1449993060a362a9498",
"size": "9... |
import conf
import g
import os
import sys
from item import item_base
from item.jobsq import work_item
from item.util.item_type import Item_Type
__all__ = ['One', 'Many',]
log = g.log.getLogger('work_item_dl')
class One(work_item.One):
# Base class overrides
local_defns = [
]
attr_defns = work_item... | {
"content_hash": "9ad9ae1c3974a48200cbad079dbdcf53",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 76,
"avg_line_length": 24.698795180722893,
"alnum_prop": 0.5980487804878049,
"repo_name": "lbouma/Cyclopath",
"id": "b68cdae316352a8952e0e2e87fbde6e389f127f0",
"size": "216... |
import re
from fabric.api import env, run, hide, task
from envassert import detect, file, group, package, port, process, service, \
user, text
def apache2_is_responding():
with hide('running', 'stdout'):
wget_cmd = (
"wget --quiet --output-document - --header='Host: example.com' "
... | {
"content_hash": "e067df8901477658244b49cbe70128ce",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 79,
"avg_line_length": 30.173333333333332,
"alnum_prop": 0.6129032258064516,
"repo_name": "prometheanfire/nodejs-multi",
"id": "dc9fab6ca935942a808877003cb0339df5cc7c54",
"... |
"""Support for the AccuWeather service."""
from __future__ import annotations
from typing import Any, cast
from homeassistant.components.sensor import SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ATTR_ATTRIBUTION,
ATTR_DEVICE_CLASS,
ATTR_ICON,
CON... | {
"content_hash": "74a882251658ca253de8b32d87abd889",
"timestamp": "",
"source": "github",
"line_count": 184,
"max_line_length": 93,
"avg_line_length": 37.141304347826086,
"alnum_prop": 0.622329528826456,
"repo_name": "kennedyshead/home-assistant",
"id": "09e9cda30adbb1e5ac1f7636819ab0db5c76036a",
"... |
from webtools.management.base import Command
from webtools.database import Base
class SyncdbCommand(Command):
"""
Syncronize all available sqlalchemy defined tables
to a database server.
"""
def take_action(self, options):
if not self.cmdapp.conf:
raise RuntimeError("For start... | {
"content_hash": "20ce3998cea01c22f2cb849c8f307b11",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 71,
"avg_line_length": 26.46551724137931,
"alnum_prop": 0.5589576547231271,
"repo_name": "niwinz/tornado-webtools",
"id": "48a545939d8cb31b4050a5b2ecd7cca1bcc675b6",
"size"... |
'''osmizer: convert simple GeoJSON-schema feature layers to the OSM XML format.
Documentation available at https://github.com/OpenSidewalks/osmizer.
'''
import re
import sys
from setuptools import setup, find_packages
# Check python versions
if sys.version_info.major < 3:
print('osmizer is currently compatible ... | {
"content_hash": "8965fac47d16e22efa3c607d0b213bd6",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 79,
"avg_line_length": 30.70909090909091,
"alnum_prop": 0.5648312611012434,
"repo_name": "OpenSidewalks/osmizer",
"id": "c0c4af1113f7941a35bf919d46f1f79a3350c1a2",
"size": ... |
"""Unit tests for the Container driver module."""
import ddt
import functools
import mock
from oslo_config import cfg
from manila.common import constants as const
from manila import context
from manila import exception
from manila.share import configuration
from manila.share.drivers.container import driver
from manil... | {
"content_hash": "e4ad3a83e9cc53cf78c64c2e1dc9c0b1",
"timestamp": "",
"source": "github",
"line_count": 334,
"max_line_length": 79,
"avg_line_length": 39.31137724550898,
"alnum_prop": 0.5852246763137853,
"repo_name": "vponomaryov/manila",
"id": "57877ff028ded9624daad0a9d1e6d02414570b25",
"size": "1... |
import sqlalchemy as sa
from neutron.db import api as db
from neutron.db import model_base
from neutron.db import models_v2
from neutron.db import securitygroups_db as sg_db
from neutron.extensions import securitygroup as ext_sg
from neutron import manager
from neutron.openstack.common import log as logging
from neutr... | {
"content_hash": "c728d8da8ce22685ae332637e8ceffd9",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 78,
"avg_line_length": 33.64351851851852,
"alnum_prop": 0.6157974404843815,
"repo_name": "kaiweifan/neutron",
"id": "e606861ff2247cdb9298fb66b587cd6c247c4c19",
"size": "79... |
from __future__ import division, unicode_literals
from math import sin, cos, asin, pi, degrees, radians
import os
import collections
import numpy as np
import json
from pymatgen.core.spectrum import Spectrum
from pymatgen.symmetry.analyzer import SpacegroupAnalyzer
from pymatgen.util.plotting import add_fig_kwargs
... | {
"content_hash": "b042e4e2e9cd5f8fa3d11fd2bb6de70f",
"timestamp": "",
"source": "github",
"line_count": 457,
"max_line_length": 89,
"avg_line_length": 37.74398249452954,
"alnum_prop": 0.5567859006319207,
"repo_name": "setten/pymatgen",
"id": "08d1188342352f370fdcf877307a5477ded86d9c",
"size": "1735... |
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server.models.tapi_oam_oam_constraint import TapiOamOamConstraint # noqa: F401,E501
from tapi_server.models.tapi_oam_oam_serv... | {
"content_hash": "71b0f3ae7e7782d5e0cedd5454f101ef",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 106,
"avg_line_length": 31.675,
"alnum_prop": 0.6521967903183373,
"repo_name": "OpenNetworkingFoundation/ONFOpenTransport",
"id": "33019201dec4ad59ba3b621c3f13534e986f08bc",... |
import unittest
from ignite.engine import Engine
class TestPytorchIgnite(unittest.TestCase):
def test_engine(self):
def update_fn(engine, batch):
pass
engine = Engine(update_fn)
engine.run([0, 1, 2])
| {
"content_hash": "17b3b3d5b6d22aac5d36065255849c88",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 43,
"avg_line_length": 18.846153846153847,
"alnum_prop": 0.6326530612244898,
"repo_name": "Kaggle/docker-python",
"id": "aef07ff6d381098ec347e8c8f7719df956bf8e04",
"size": ... |
"""
Photo problem in Google CP Solver.
Problem statement from Mozart/Oz tutorial:
http://www.mozart-oz.org/home/doc/fdt/node37.html#section.reified.photo
'''
Betty, Chris, Donald, Fred, Gary, Mary, and Paul want to align in one
row for taking a photo. Some of them have preferences next to whom
they want... | {
"content_hash": "5989fc9be8c06e8631240c8f3fa539ad",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 79,
"avg_line_length": 27.00709219858156,
"alnum_prop": 0.6100315126050421,
"repo_name": "google/or-tools",
"id": "6a513d848019f534cd506a8596f4e612a1c3cfce",
"size": "4408... |
import ConfigParser
import fixtures
import os
import testtools
import urlparse
from plexpiry import plexpiry
FAKE_DICT = {'a': 1,
'b': 2,
'c': 3,
'd': 4,
}
# FIXME: Check this against a real response
FAKE_SECTIONS = {'show': {'key': '2', 'title': 'TV Shows'},
... | {
"content_hash": "d77a121db661c3b44a95aa6ba2fa067d",
"timestamp": "",
"source": "github",
"line_count": 439,
"max_line_length": 79,
"avg_line_length": 42.66970387243736,
"alnum_prop": 0.549167200512492,
"repo_name": "cmsj/plexpiry",
"id": "6ccd27a63a2295e9272c7dd9a5dad3321421e95f",
"size": "18732",... |
"""
PySpark supports custom serializers for transferring data; this can improve
performance.
By default, PySpark uses L{PickleSerializer} to serialize objects using Python's
C{cPickle} serializer, which can serialize nearly any Python object.
Other serializers, like L{MarshalSerializer}, support fewer datatypes but ca... | {
"content_hash": "8aaadd9f398c37858e442ea6f4cd2796",
"timestamp": "",
"source": "github",
"line_count": 691,
"max_line_length": 100,
"avg_line_length": 31.781476121562953,
"alnum_prop": 0.6202358726833933,
"repo_name": "ericvandenbergfb/spark",
"id": "37e7cf3fa662eb4cdca85a7130f4c1a3a4f1d5c5",
"siz... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.