text stringlengths 4 1.02M | meta dict |
|---|---|
from .._util import weak_method
from ..api_wrapper_interface import ApiWrapperInterface
from ..helpers import log_and_show_message
from ..server_resource_interface import ServerStatus
from .api_decorator import register_decorated_handlers
from .interface import ClientHandlerInterface
from functools import partial
from ... | {
"content_hash": "31fcd4a455e5b61bc4a59851716243c2",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 119,
"avg_line_length": 39.406976744186046,
"alnum_prop": 0.5824727058129242,
"repo_name": "dmilith/SublimeText3-dmilith",
"id": "4bb280e572703d68763d9b02431e251018a220f1",
... |
from sublime_plugin import TextCommand
from ..libraries.tools import add_library_to_sketch
class DeviotInsertLibraryCommand(TextCommand):
def run(self, edit, path):
add_library_to_sketch(self.view, edit, path)
| {
"content_hash": "74aebebc60746d485931604186b8b0b2",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 52,
"avg_line_length": 32,
"alnum_prop": 0.7589285714285714,
"repo_name": "gepd/Deviot",
"id": "0d9d5744a190bae82a70f9450cf0646d0a32fbce",
"size": "224",
"binary": false,
... |
import ddt
import six
from tempest import config
from tempest.lib.common.utils import data_utils
from tempest.lib import exceptions as lib_exc
import testtools
from testtools import testcase as tc
from manila_tempest_tests.tests.api import base
from manila_tempest_tests import utils
CONF = config.CONF
@ddt.ddt
clas... | {
"content_hash": "47fde86028ab642135b754cc9a0912f1",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 78,
"avg_line_length": 37.6258064516129,
"alnum_prop": 0.6195130315500685,
"repo_name": "vponomaryov/manila",
"id": "a93f737f0dc6a445a7b6408edcdaca6836066f85",
"size": "64... |
import importlib
from django.conf import settings
class DefaultSettings(object):
@property
def LOGIN_URL(self):
"""
REQUIRED. Used to log the user in.
"""
return None
@property
def SITE_URL(self):
"""
REQUIRED. The OP server url.
"""
r... | {
"content_hash": "e2c7cae480deaa343095781279db9e9d",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 92,
"avg_line_length": 26.84313725490196,
"alnum_prop": 0.5965424884343803,
"repo_name": "wayward710/django-oidc-provider",
"id": "26b5e94ec0e30093b9eac58dd5b212d910a00184",... |
"""Unit tests for Superset"""
import json
from unittest.mock import patch
from superset import security_manager
from tests.integration_tests.base_tests import SupersetTestCase
meUri = "/api/v1/me/"
class TestCurrentUserApi(SupersetTestCase):
def test_get_me_logged_in(self):
self.login(username="admin")
... | {
"content_hash": "c9d362e181019e60c3e525c4f71d4d9f",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 67,
"avg_line_length": 34.12765957446808,
"alnum_prop": 0.6514962593516209,
"repo_name": "airbnb/caravel",
"id": "f4c897b6a0ca1254c6fc4ef001c7462718a4a49f",
"size": "2405",... |
import ctypes
import os
import subprocess
import time
import shlex
import signal as signal_module
from robot.utils import (ConnectionCache, abspath, encode_to_system,
decode_output, is_falsy, is_truthy, secs_to_timestr,
timestr_to_secs, IRONPYTHON, JYTHON)
from robot.v... | {
"content_hash": "f7338c6f79b64cccc997ad04f69fafd8",
"timestamp": "",
"source": "github",
"line_count": 875,
"max_line_length": 111,
"avg_line_length": 44.374857142857145,
"alnum_prop": 0.6162305552693932,
"repo_name": "Colorfulstan/robotframework",
"id": "637680629088c9a20a59340666a8d34e78f11d5a",
... |
"""
@version: python3.6
@author: ‘sj‘
@contact: songjie1217@hotmail.com
@file: boll-trend-2.0.py
@time: 12/11/17 3:26 PM
"""
from backtest.core.backteststrategy_test import *
from backtest.optimizer.optimizer import *
from backtest.tools.ta import *
from datetime import datetime as dtL
class BollStrategyTrend(Backtes... | {
"content_hash": "083c57ef1dfa0d09a405c068bdaaac78",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 198,
"avg_line_length": 45.62376237623762,
"alnum_prop": 0.5893012152777778,
"repo_name": "sjsj0101/backtestengine",
"id": "a5a3b90fa50ba94697b96a586c758e9d9e6a03c3",
"siz... |
import logging,sys,multiprocessing,time,os,pwd,grp
logger = logging.getLogger(__name__)
from django.db import connections,DEFAULT_DB_ALIAS
from django.db.utils import load_backend
from django.conf import settings
from argo import models,QueueMessage
from common import db_tools
from common import MessageReceiver,Seria... | {
"content_hash": "8b21de0a2aad40d7a46e7827153e2ce8",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 284,
"avg_line_length": 50.40625,
"alnum_prop": 0.5829200247985121,
"repo_name": "hep-cce/hpc-edge-service",
"id": "4e47770eb741b8b755841a2d2cbb6219a4c76dc8",
"size": "645... |
import pytest
import jwe
from jwe import validation
from cryptography.exceptions import InvalidTag
class TestValidation:
def test_correct_header(self):
try:
validation.validate_header({
'alg': 'dir',
'enc': 'A256GCM'
})
except Exception as... | {
"content_hash": "bed2d4637df7173b359a55c1652a6573",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 83,
"avg_line_length": 34.191489361702125,
"alnum_prop": 0.6014312383322962,
"repo_name": "chrisseto/pyjwe",
"id": "67df6bfb38ec286b167f4776ef766bc461cd4103",
"size": "3214... |
import riffle
import time
import os
import sys
import random
import argparse
import json
import math
import struct
import binascii
parser = argparse.ArgumentParser(description="A script for spamming the Exis node backend with random data")
parser.add_argument('-p','--parser',default='../app/parser.json',help="Location... | {
"content_hash": "b90a09f5b077001bd54e5751aa208bc3",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 162,
"avg_line_length": 39.628571428571426,
"alnum_prop": 0.596731554914684,
"repo_name": "jonahpelfrey/Badgerloop_Competition_Dashboard",
"id": "5e43c8dc2ef0e8cf16434f47e0a... |
import pscheduler
import tempfile
import time
from pschedulerapiserver import application
from flask import request
from flask import send_file
from .dbcursor import dbcursor_query
from .json import *
from .limitproc import *
from .log import log
from .response import *
from .tasks import task_exists
from .util impo... | {
"content_hash": "03bebe934039907967775303f8b8b82e",
"timestamp": "",
"source": "github",
"line_count": 279,
"max_line_length": 96,
"avg_line_length": 27.835125448028673,
"alnum_prop": 0.5207313932526397,
"repo_name": "perfsonar/pscheduler",
"id": "c4548037a4ef4a06d3f447fb9081538133533f3b",
"size":... |
import phoneme_features, utterance_load, os, prosody, pos
from error_messages import SiReError
class Utterance(object):
"""An object representing an utterance."""
#Create an empty utt.
#The proto utterance follows the following conventions:
#It is a dictionary with two keys, id giving the name of the utt,
#... | {
"content_hash": "2e997d15ef22289c76a08ab39075c0cb",
"timestamp": "",
"source": "github",
"line_count": 475,
"max_line_length": 213,
"avg_line_length": 37.98736842105263,
"alnum_prop": 0.6568942584792729,
"repo_name": "RasmusD/SiRe",
"id": "e4b79732bd9c252473d1a217670b6fbf719906d4",
"size": "19170"... |
from tastypie.authentication import SessionAuthentication
from tastypie.authorization import DjangoAuthorization
from spa.api.v1.BaseResource import BaseResource
from spa.models.notification import Notification
from spa.models.userprofile import UserProfile
class NotificationResource(BaseResource):
class ... | {
"content_hash": "3f70f1c21a2200814a567b98a0971dd4",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 118,
"avg_line_length": 45,
"alnum_prop": 0.67003367003367,
"repo_name": "fergalmoran/dss",
"id": "5562e42ef4680889e675b8e9b387a79b6bf29557",
"size": "1485",
"binary": fa... |
from itertools import chain
import unittest
import numpy as np
import scipy.sparse
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.preprocessing.data import scale
from ParamSklearn.implementations.StandardScaler import StandardScaler
from ParamSklearn.util import get_dataset
matrix1 = [[0, 1... | {
"content_hash": "7a608706c4ec59e9c50f0ba52a96f0cd",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 103,
"avg_line_length": 41.54430379746835,
"alnum_prop": 0.5825716026812919,
"repo_name": "automl/paramsklearn",
"id": "09f9d7fbd74ba398987ce60fb5cb29580c509441",
"size": ... |
"""Unit test for sysinfo.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import collections
import os
import sys
import unittest
import mock
import six
import treadmill
import treadmill.appenv
from treadmill im... | {
"content_hash": "c47e0094c9308a7570ceb9bc4b15af22",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 78,
"avg_line_length": 27.697080291970803,
"alnum_prop": 0.594808275135064,
"repo_name": "Morgan-Stanley/treadmill",
"id": "ee36a1cfab0691349add378ad309e671cb4dfd41",
"siz... |
import os
from world import world
from bigml.api import HTTP_OK
#@step(r'I get the evaluation "(.*)"')
def i_get_the_evaluation(step, evaluation):
resource = world.api.get_evaluation(evaluation)
world.status = resource['code']
assert world.status == HTTP_OK
world.evaluation = resource['object']
| {
"content_hash": "b4987c9a640aec8dea2cb644ffd2aa68",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 51,
"avg_line_length": 28.545454545454547,
"alnum_prop": 0.7070063694267515,
"repo_name": "xaowoodenfish/python-1",
"id": "36abb890763274a898264a2405f44a72a0476976",
"size"... |
import csv as csv
import numpy as np
#Open up the csv file in to a Python object
csv_file_object = csv.reader(open('data/train.csv', 'rb'))
header = csv_file_object.next() #The next() command just skips the
#first line which is a header
data=[] #Create a va... | {
"content_hash": "7c260c2ea9d4179e17f5a8125301f9e4",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 106,
"avg_line_length": 53.38383838383838,
"alnum_prop": 0.47473982970671713,
"repo_name": "saran87/machine-learning",
"id": "0c86f43e83ce0dcdaa0283821aebdc145bc4223d",
"si... |
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
import timezone_field.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Crea... | {
"content_hash": "cc84e88c15f6b555aae63347cd4c2c1e",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 201,
"avg_line_length": 50.01980198019802,
"alnum_prop": 0.5671021377672208,
"repo_name": "patrick91/pycon",
"id": "fb7882f4b9dfe485d3463f3fbbad6efdf59f4cd4",
"size": "510... |
import os
import re
import socket
import sys
import time
from optparse import make_option
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django_extensions.management.utils import setup_logger, RedirectHandler
from django_extensions.management.technical_response... | {
"content_hash": "cd44c0312acd50eb9626ba182f8445c7",
"timestamp": "",
"source": "github",
"line_count": 299,
"max_line_length": 161,
"avg_line_length": 41.91638795986622,
"alnum_prop": 0.5466368786403893,
"repo_name": "WillisXChen/django-oscar",
"id": "b00bd95e729a77186a0147ddbcf96a20f8d81dfa",
"si... |
from collections import Sequence, Iterator
class PagedIterator(Iterator):
def __init__(self, parent):
self._parent = parent
self._index = -1
self._len = len(parent)
def __iter__(self):
return self
def next(self):
self._index += 1
if self._index == self._le... | {
"content_hash": "0af5d9a423229785ef6c616f884b8ed0",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 76,
"avg_line_length": 29.17117117117117,
"alnum_prop": 0.5546633724521309,
"repo_name": "naveenvhegde/pytmdb3",
"id": "3d99010063facfce4df778fd6e0c68be60d973de",
"size": ... |
import sys
import os
import argparse
import inspect
sys.path.append( os.environ['CMSSW_BASE']+"/src/" )
from CMSSW_Utils.Utils_Types.pluginStdVector import * ## For stl containers
from CMSSW_Utils.Utils_Types.CmdParser import * ## For advanced cmd parser class
from CMSSW_Utils.Utils_Functions.util... | {
"content_hash": "d629a04d109484b015d0e4bce85811c6",
"timestamp": "",
"source": "github",
"line_count": 294,
"max_line_length": 124,
"avg_line_length": 38.62244897959184,
"alnum_prop": 0.5971818582122413,
"repo_name": "enochnotsocool/TstarAnalysis_in_CMS",
"id": "12a064d904b2e2e8c5517222612d37ffbaeba... |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Marker(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "choropleth.unselected"
_path_str = "choropleth.unselected.marker"
_valid_props = {"opacity"}... | {
"content_hash": "4631855ffa3ec2c33b5ef22c49a4db8e",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 82,
"avg_line_length": 27.95098039215686,
"alnum_prop": 0.5222728867064188,
"repo_name": "plotly/plotly.py",
"id": "5b1f9b9c4c327df08cc6830198a9017bf845ed82",
"size": "285... |
from scrapy.spider import Spider
from scrapy.selector import Selector
from my_settings import name_file, test_mode, difference_days
from datetime import datetime, timedelta
print "Run spider NewenglandFilm"
file_output = open(name_file, 'a')
email_current_session = []
email_in_file = open(name_file, 'r')... | {
"content_hash": "56cfb76e1500b95b398cecb449646b58",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 138,
"avg_line_length": 43.916666666666664,
"alnum_prop": 0.5863377609108159,
"repo_name": "dcondrey/scrapy-spiders",
"id": "773895fc34e701280227c2f7d83dcbb9ec6231fb",
"siz... |
# Copyright 2020 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | {
"content_hash": "8ddb6d979fc4440a1f4ff12be2e41015",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 164,
"avg_line_length": 45.80434782608695,
"alnum_prop": 0.646733111849391,
"repo_name": "HewlettPackard/python-ilorest-library",
"id": "1b584257c4f061fad0065603165f6c19b908... |
from django.template import loader
class BaseRenderer:
def generate_body(self, intermediate):
body = []
for item in intermediate:
for key, values in item.items():
body.append(self.render_item(key, values).strip())
return '\n'.join(body)
def render_item(sel... | {
"content_hash": "a46c4c49f1706c1b8b7344c1d1739942",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 78,
"avg_line_length": 39,
"alnum_prop": 0.630579297245964,
"repo_name": "theonion/django-bulbs",
"id": "27fb11aaa6b6a822b071f67e4173e7b4c0444223",
"size": "2106",
"binar... |
"""The command-line entry point for combining images into a single image."""
from framer import combine_vertical_from_iterable
from PIL import Image
import argparse
import os
def main():
"""Combine images vertically given file names on the command line."""
parser = argparse.ArgumentParser(description='''Make... | {
"content_hash": "fcb19de5c8cb40a88c5b4c080ef65a36",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 79,
"avg_line_length": 42.44444444444444,
"alnum_prop": 0.5909685863874345,
"repo_name": "vr2262/framer",
"id": "19ef126d17e1daea8ae2d5d9f3e3a8b86d25f207",
"size": "1551",
... |
import argparse
import os
from math import sqrt
from PIL import Image
import numpy as np
parser = argparse.ArgumentParser(
description='converts gray scale raw image to png image',
formatter_class=argparse.ArgumentDefaultsHelpFormatter
)
parser.add_argument('infile', nargs='+', help='input filename')
parser.ad... | {
"content_hash": "9ddff35fd62f0d1cfb8af1db1116a537",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 71,
"avg_line_length": 31.72222222222222,
"alnum_prop": 0.6409807355516638,
"repo_name": "silverneko/HWs",
"id": "43c71a7c9ed45e03ff6419c8fb776e3bf7a70ace",
"size": "1166",... |
import threading
import logging
import websocket
class WebsocketListener:
def __init__(self, websocket_link, on_message_callback, notifications=None):
self.websocket_link = websocket_link
self.on_message_callback = on_message_callback
self.notifications = notifications
self.closed... | {
"content_hash": "f0532c3dcccfbe7f2878c465c7ab4f77",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 80,
"avg_line_length": 29.974358974358974,
"alnum_prop": 0.613344739093242,
"repo_name": "Fortunate-MAN/PulseMonitor",
"id": "99e959c8c078a9c12ba9af7db93826757d81628b",
"si... |
"""
Summary
=======
Walks through your blog root figuring out all the available monthly
archives in your blogs. It generates html with this information and
stores it in the ``$(archivelinks)`` variable which you can use in
your head and foot templates.
Install
=======
This plugin comes with douglas. To install, d... | {
"content_hash": "9a65131ebab82f3d5198138ad2ed79e3",
"timestamp": "",
"source": "github",
"line_count": 120,
"max_line_length": 79,
"avg_line_length": 28,
"alnum_prop": 0.6014880952380952,
"repo_name": "willkg/douglas",
"id": "f3ee560ec91531f68a21ecca52d4b362c8dc95de",
"size": "3360",
"binary": f... |
import _plotly_utils.basevalidators
class ExponentformatValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="exponentformat", parent_name="layout.scene.xaxis", **kwargs
):
super(ExponentformatValidator, self).__init__(
plotly_name=plotly_nam... | {
"content_hash": "3075d391b151e43c91d8d57fac51967a",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 86,
"avg_line_length": 37.714285714285715,
"alnum_prop": 0.5984848484848485,
"repo_name": "plotly/plotly.py",
"id": "52ef25e76dddfa433db7519a77941cb5c28301af",
"size": "528... |
"""
Django settings for demo_project project.
Generated by 'django-admin startproject' using Django 2.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import ... | {
"content_hash": "2ce1dac13c17047e54813d88799292ff",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 91,
"avg_line_length": 25.527131782945737,
"alnum_prop": 0.6838748861220771,
"repo_name": "shamanu4/dal_admin_filters",
"id": "94eebb675eff6b59cafc0f99628ecfcfcc33c9a4",
"... |
import code
import cpp_util
from model import Platforms
from schema_util import CapitalizeFirstLetter
from schema_util import JsFunctionNameToClassName
import json
import os
import re
def _RemoveDescriptions(node):
"""Returns a copy of |schema| with "description" fields removed.
"""
if isinstance(node, dict):
... | {
"content_hash": "0de5c41f932c12eccc96105310264188",
"timestamp": "",
"source": "github",
"line_count": 312,
"max_line_length": 79,
"avg_line_length": 36.36538461538461,
"alnum_prop": 0.6178388859509959,
"repo_name": "chromium2014/src",
"id": "91ae920c32d79b31b49423f983c92c2078b5ba34",
"size": "115... |
from django.apps import AppConfig
class CartelisandsConfig(AppConfig):
name = 'cartelisands'
| {
"content_hash": "c08cd23d569af8fbfe9b8b6049015b6a",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 36,
"avg_line_length": 19.8,
"alnum_prop": 0.7777777777777778,
"repo_name": "austing/cartels",
"id": "dc25ea432f0df38d88dc3c0dea73ffdad9bb3d5d",
"size": "99",
"binary": fa... |
from thefuck.utils import for_app
@for_app('man', at_least=1)
def match(command):
return True
def get_new_command(command):
if '3' in command.script:
return command.script.replace("3", "2")
if '2' in command.script:
return command.script.replace("2", "3")
split_cmd2 = command.script... | {
"content_hash": "53758578d867a2d8e4decbf9f164a9da",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 53,
"avg_line_length": 22.761904761904763,
"alnum_prop": 0.6192468619246861,
"repo_name": "PLNech/thefuck",
"id": "ead1361b088c45cd270a722cc9efd68198e67aab",
"size": "478",... |
import time
import mock
import unittest
from nose.tools import * # noqa
import webtest
import furl
import itsdangerous
from modularodm import storage
from framework.auth import signing
from framework.auth.core import Auth
from framework.exceptions import HTTPError
from framework.sessions.model import Session
from fr... | {
"content_hash": "ad68ca778315844918c35c6378ea5cbc",
"timestamp": "",
"source": "github",
"line_count": 767,
"max_line_length": 98,
"avg_line_length": 33.84354628422425,
"alnum_prop": 0.5924955697665459,
"repo_name": "lyndsysimon/osf.io",
"id": "438b52b98a598719e1e889684f07931371f3bb78",
"size": "2... |
"""Array operations for RaggedTensors."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_util
from tensorflow.python.o... | {
"content_hash": "a4c5f7a4bfd2d8bcf23399a36baf9877",
"timestamp": "",
"source": "github",
"line_count": 631,
"max_line_length": 87,
"avg_line_length": 41.608557844690964,
"alnum_prop": 0.6174442963245096,
"repo_name": "chemelnucfin/tensorflow",
"id": "af9e7c278a21f2dba632e7c2681e07759c0ab3a4",
"siz... |
import warnings
from typing import Dict, List, Optional, Sequence, Set, Tuple
from flask import current_app, g
from flask_appbuilder.security.sqla import models as sqla_models
from flask_appbuilder.security.sqla.manager import SecurityManager
from flask_appbuilder.security.sqla.models import Permission, PermissionView... | {
"content_hash": "dfbf5012e7968b2b40adc20f5a7896c7",
"timestamp": "",
"source": "github",
"line_count": 893,
"max_line_length": 110,
"avg_line_length": 40.06494960806271,
"alnum_prop": 0.6143160601486948,
"repo_name": "sekikn/incubator-airflow",
"id": "0dfc0b133e8a9a9abb2958ca21e6a48ffc1ec237",
"si... |
import gym
from gym.spaces import Box, Dict, Discrete
import numpy as np
import random
class ParametricActionsCartPole(gym.Env):
"""Parametric action version of CartPole.
In this env there are only ever two valid actions, but we pretend there are
actually up to `max_avail_actions` actions that can be tak... | {
"content_hash": "16934f4f01ab49f67d881b0de211a1c0",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 79,
"avg_line_length": 39.02597402597402,
"alnum_prop": 0.5930116472545757,
"repo_name": "pcmoritz/ray-1",
"id": "ec98b78e2bc92ea1524b7dd0b73e105d24ffba8c",
"size": "3005",... |
import functools
import six
from essential import funcutils
from essential import test
class FuncutilsTestCase(test.BaseTestCase):
def _test_func(self, instance, red=None, blue=None):
pass
def test_all_kwargs(self):
args = ()
kwargs = {'instance': {'uuid': 1}, 'red': 3, 'blue': 4}
... | {
"content_hash": "c68f23eb7d82a8484fcd36e1eacffd30",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 74,
"avg_line_length": 36.12396694214876,
"alnum_prop": 0.606726149622512,
"repo_name": "gaolichuang/py-essential",
"id": "93589fee35f20d9345e541476e39b0983b03baf3",
"size... |
from pyface.image_list import *
| {
"content_hash": "a6d78f0f129d2d71d7fd620578ba57ed",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 31,
"avg_line_length": 32,
"alnum_prop": 0.78125,
"repo_name": "enthought/etsproxy",
"id": "ac8cf468acd8580718478adf21d618edcb7fdaa0",
"size": "47",
"binary": false,
"co... |
import os
import tempfile
from os import getcwd
from os.path import join
from nose.tools import raises
from parameterized import param, parameterized
from rsmtool import run_summary
from rsmtool.configuration_parser import Configuration
from rsmtool.test_utils import (check_run_summary,
... | {
"content_hash": "45cb740aa602be8dbd9fe111eeed1d0a",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 92,
"avg_line_length": 33.21383647798742,
"alnum_prop": 0.6076500662753267,
"repo_name": "EducationalTestingService/rsmtool",
"id": "9551ee680bd3a0ace3a1850142dd677225ec970c... |
"""
Some utilities and tools for using RBNWorld with other libraries, e.g. PyAChemKit
"""
import AChemKit
import AChemKit.utils
import AChemKit.utils.utils
from AChemKit.utils.utils import long_subseq
import reaction
def sufficiently_similar(mols, proportion = 0.5):
"""
Function for determining if a collect... | {
"content_hash": "1d2bd3df28725b0238f4c7ed524c0d7a",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 82,
"avg_line_length": 22.21951219512195,
"alnum_prop": 0.6114160263446762,
"repo_name": "afaulconbridge/PyRBNWorld",
"id": "19fd95151de28cc8b61cea5f84ca634fff80dade",
"siz... |
"""Various text used throughout the website, e.g. status messages, errors, etc.
"""
# Status Messages
#################
# NOTE: in status messages, newlines are not preserved, so triple-quotes strings
# are ok
# Status message shown at settings page on first login
# (upon clicking primary email confirmation link)
W... | {
"content_hash": "5552aea7e434480b2f43efbe50828711",
"timestamp": "",
"source": "github",
"line_count": 202,
"max_line_length": 243,
"avg_line_length": 43.32178217821782,
"alnum_prop": 0.7420866186721518,
"repo_name": "Nesiehr/osf.io",
"id": "ad698038b0a65fe2e3624f5dc96ff5d785224378",
"size": "8775... |
from south.db import db
from django.db import models
from myblog.comments.models import *
class Migration:
def forwards(self, orm):
# Adding model 'Comment'
db.create_table('comments_comment', (
('id', orm['comments.Comment:id']),
('content_type', orm['comments... | {
"content_hash": "176b46161f6e4a2c99ea257a65871f16",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 190,
"avg_line_length": 64.4795918367347,
"alnum_prop": 0.5415413831302421,
"repo_name": "wahaha02/myblog",
"id": "a72fe36e5ba18fd8dac1f1ef8c4df3ce34729f2b",
"size": "6320"... |
from distutils.core import setup
from Cython.Build import cythonize
setup(
ext_modules = cythonize(["./src/*.pyx","./examples/sv_model_nsmc.pyx","./examples/lgss_model_nsmc.pyx","./examples/nlss_model*.pyx"])
)
| {
"content_hash": "809025f6dd3516c2618958991434e69a",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 137,
"avg_line_length": 31,
"alnum_prop": 0.7096774193548387,
"repo_name": "can-cs/smcpy",
"id": "e7e69d2fce4c284f4af4a764c1b345aaec6f7443",
"size": "217",
"binary": false... |
import os
import sys
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath + '/../')
import unittest
import meterbus
from meterbus.exceptions import *
class TestSequenceFunctions(unittest.TestCase):
def setUp(self):
self.vib_empty = meterbus.ValueInformationBlock()
self.v... | {
"content_hash": "9a0400980426b15e3f043c3daa6b694e",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 69,
"avg_line_length": 30.414634146341463,
"alnum_prop": 0.6896551724137931,
"repo_name": "ganehag/pyMeterBus",
"id": "5e502e118d78ac9773a8691f0f16b6e70d959a3e",
"size": "1... |
from __future__ import print_function, unicode_literals
from voodoo.dbutil import get_table_kwargs
from sqlalchemy import Column, Integer, String, Index
from weblab.core.coordinator.sql.model import Base, RESERVATION_ID_SIZE
TABLE_KWARGS = get_table_kwargs()
SUFFIX = 'ILAB_BATCH_'
class ILabBatchReservation(Base)... | {
"content_hash": "34a7105f53206a40dec3b993bc3b3a8c",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 110,
"avg_line_length": 35.611111111111114,
"alnum_prop": 0.6310452418096724,
"repo_name": "porduna/weblabdeusto",
"id": "9d3357dc70e712c37b9bc4b2ccd9cd1758c0b775",
"size":... |
import os
import gslevels
from . import gsocr
from process import process
class ckbroke(process):
ready_state = 3
def process_ep(self, ep):
exts = self.options.upload_formats
for ext in exts:
src_pathname = os.path.join( self.show_dir, ext,
"%s.%s"%(ep.slug,ext))... | {
"content_hash": "0ce9de30c694fd84a40c962db3b4b7e0",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 72,
"avg_line_length": 28.333333333333332,
"alnum_prop": 0.49480968858131485,
"repo_name": "yoe/veyepar",
"id": "db968e7661974935eb8ff2b30c936897e6d9d151",
"size": "1688",
... |
"""
django-helpdesk - A Django powered ticket tracker for small enterprise.
(c) Copyright 2008 Jutda. All Rights Reserved. See LICENSE for details.
models.py - Model (and hence database) definitions. This is the core of the
helpdesk structure.
"""
try:
from django.contrib.auth import get_user_model
... | {
"content_hash": "be5c4c356a412f76eac089da36c053f1",
"timestamp": "",
"source": "github",
"line_count": 1281,
"max_line_length": 144,
"avg_line_length": 29.87431693989071,
"alnum_prop": 0.5762627714337976,
"repo_name": "gjedeer/django-helpdesk-issue-164",
"id": "e0c8e6c8988715c85cc4a1f14a77b1f6a22e08... |
"""
Copyright 2010 Rusty Klophaus <rusty@basho.com>
Copyright 2010 Justin Sheehy <justin@basho.com>
Copyright 2009 Jay Baird <jay@mochimedia.com>
This file is provided to you under the Apache License,
Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain
a copy o... | {
"content_hash": "c26d6bc2edd13e8b5644cc11fc79d265",
"timestamp": "",
"source": "github",
"line_count": 521,
"max_line_length": 110,
"avg_line_length": 36.24568138195777,
"alnum_prop": 0.5565028595636518,
"repo_name": "richleland/riak-python-client",
"id": "92d534b4e300ee801d830efa4f1b91664cfee4bc",
... |
import ggrc.builder
from blinker import Namespace
from flask import redirect, request, render_template, current_app
from ggrc.rbac import permissions
from ggrc.services.common import \
ModelView, as_json, inclusion_filter, filter_resource
from ggrc.utils import view_url_for, benchmark
from werkzeug.exceptions impor... | {
"content_hash": "8c1387f409e29cbd99dbaeb18e943976",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 78,
"avg_line_length": 35.38513513513514,
"alnum_prop": 0.6257399274393737,
"repo_name": "VinnieJohns/ggrc-core",
"id": "268dd2dbc582e01a87772eda2fb09a9179a13267",
"size":... |
import numpy as np
__ver__ = '1.0'
class dust_wrapper(object):
""" dust_wrapper class. EzGal wraps this class around the dust function. It takes care of the
details of passing or not passing parameters """
func = '' # sfh function
args = () # extra arguments to pass on call
has_ar... | {
"content_hash": "8cc33009e9b2513facc600d03635b62f",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 100,
"avg_line_length": 30.526315789473685,
"alnum_prop": 0.5614942528735632,
"repo_name": "dpgettings/ezgal",
"id": "150b566fe245daff4547214a60b6764b5f1795e9",
"size": "17... |
"""
Utilities for using the Online Learning Library for Next.Discovery
author: Kevin Jamieson, kevin.g.jamieson@gmail.com
last updated: 2/17/2015
######################################
Serves as a library of utilities for all the adaptive and online learning applications on next.dicovery.
There exist a few distinct s... | {
"content_hash": "d3035d158d04aaeed6686a4bde0012ff",
"timestamp": "",
"source": "github",
"line_count": 349,
"max_line_length": 142,
"avg_line_length": 31.33810888252149,
"alnum_prop": 0.6766023589649812,
"repo_name": "crcox/NEXT",
"id": "9b96ac961ec299d0bf979063f680de0c0a571350",
"size": "10937",
... |
_base_ = './faster_rcnn_s50_fpn_syncbn-backbone+head_mstrain-range_1x_coco.py'
model = dict(
backbone=dict(
stem_channels=128,
depth=101,
init_cfg=dict(type='Pretrained',
checkpoint='open-mmlab://resnest101')))
| {
"content_hash": "f108e5339227b28476e70e7a68bae13d",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 78,
"avg_line_length": 37.285714285714285,
"alnum_prop": 0.5977011494252874,
"repo_name": "open-mmlab/mmdetection",
"id": "40a2f1f2c9d62f173e88893e4ef809e70e2cbf5b",
"size":... |
from __future__ import absolute_import, unicode_literals
from requests.exceptions import HTTPError
from django.test.client import RequestFactory
from django.test.utils import override_settings
from django.urls import reverse
from allauth.socialaccount.models import SocialToken
from allauth.socialaccount.tests import... | {
"content_hash": "77e9453b51b81e1f24c8da33400f87dc",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 65,
"avg_line_length": 33.298507462686565,
"alnum_prop": 0.6024204392649036,
"repo_name": "bittner/django-allauth",
"id": "d18f0ec4a24000931a0ed817e886101b55fca8a0",
"size"... |
from __future__ import absolute_import, unicode_literals
import pytest
from case import Mock, patch
from kombu import Connection, Exchange, Queue
from kombu import compat
from t.mocks import Transport, Channel
class test_misc:
def test_iterconsume(self):
class MyConnection(object):
drain... | {
"content_hash": "a2ec5975f7bdc3a4e25b44374e32c0bb",
"timestamp": "",
"source": "github",
"line_count": 333,
"max_line_length": 76,
"avg_line_length": 33.885885885885884,
"alnum_prop": 0.5414746543778802,
"repo_name": "kawamon/hue",
"id": "485625d0b8e0780dc515838a83933820d2256fff",
"size": "11284",... |
from __future__ import unicode_literals
from django.views.generic import DetailView, ListView
from .models import JST
class JSTDetailView(DetailView):
model = JST
class JSTListView(ListView):
model = JST
def get_queryset(self, *args, **kwargs):
qs = super(JSTListView, self).get_queryset(*args, ... | {
"content_hash": "0fd92945fc33ff08b9788f93e34cdfca",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 67,
"avg_line_length": 24.133333333333333,
"alnum_prop": 0.7016574585635359,
"repo_name": "watchdogpolska/bliski_publikator",
"id": "534988e8975790432ec68406a05255d45e126d8f"... |
from swgpy.object import *
def create(kernel):
result = Static()
result.template = "object/static/structure/general/shared_streetlamp_small_blue_style_01_on.iff"
result.attribute_template_id = -1
result.stfName("obj_n","unknown_object")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return ... | {
"content_hash": "3c7f84996796b1566796ee137e42b59a",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 97,
"avg_line_length": 25.076923076923077,
"alnum_prop": 0.7024539877300614,
"repo_name": "obi-two/Rebelion",
"id": "d4c85e7514e046cd956c896b8d45e3315e42451f",
"size": "471... |
import re
import sys
from types import FrameType
from unittest import mock
import pytest
from _pytest._code import Code
from _pytest._code import ExceptionInfo
from _pytest._code import Frame
from _pytest._code import Source
from _pytest._code.code import ExceptionChainRepr
from _pytest._code.code import ReprFuncArgs
... | {
"content_hash": "ebb7356a79b92478e2f2094fdc86a8f7",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 86,
"avg_line_length": 25.393364928909953,
"alnum_prop": 0.5865994774169466,
"repo_name": "JoelMarcey/buck",
"id": "bae86be347fa3e06b7c0e7d8f1ea9177b3cc4be0",
"size": "536... |
"""
Copyright 2014-2020 Parsely, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | {
"content_hash": "1908c6a972bf4b02fdfcc23b35d67215",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 82,
"avg_line_length": 32.109756097560975,
"alnum_prop": 0.6410938093429548,
"repo_name": "Parsely/streamparse",
"id": "38ef7286758e138fe90a4dd9f2f1a0f170aef47f",
"size": "... |
"""
A Django app enabling cross-origin resource sharing in views.
Developed by Mohawk.
<http://www.mohawkhq.com/>
Contributors
------------
- Dave Hall <http://blog.etianen.com/>
"""
__version__ = (0, 9, 0) | {
"content_hash": "a212c4673bd6ce8958a9c72945a49111",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 61,
"avg_line_length": 13.3125,
"alnum_prop": 0.6291079812206573,
"repo_name": "mohawkhq/django-cross-origin",
"id": "90f280dfe2c4ff6f0d4eeb96da1171387183a0ff",
"size": "21... |
import os
import mock
from datadog_checks.dev import get_here
from datadog_checks.postfix import PostfixCheck
MOCK_VERSION = '1.3.1'
def test__get_postqueue_stats(aggregator):
check = PostfixCheck('postfix', {}, [])
common_tags = ['instance:/etc/postfix', 'foo:bar']
filepath = os.path.join(get_here(),... | {
"content_hash": "25016a63e1af7ecd7cc39a8a6a18c7a4",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 100,
"avg_line_length": 37.80327868852459,
"alnum_prop": 0.6569817866435386,
"repo_name": "DataDog/integrations-core",
"id": "4b7ce1110684e07741f235f233a13db304426bf6",
"si... |
from ofx.builder import *
import datetime
import uuid
class Request:
def __init__(self, cookie=4, app_name="Money", app_version="1400"):
# Note that American Express, at least, requires the app name
# to be titlecase, and not all uppercase, for the request to
# succeed. Memories of Mozilla... | {
"content_hash": "1446a084a0ec350ec434ffc2d5e4756a",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 101,
"avg_line_length": 42.507462686567166,
"alnum_prop": 0.514747191011236,
"repo_name": "wesabe/fixofx",
"id": "d82fb3b0509bb88a76d3bed2e0eb75a7f1838a19",
"size": "6332"... |
from django.conf.urls import url
from django_comments.views.comments import post_comment, comment_done
from . import views
urlpatterns = [
url(r'^post/$', post_comment, name='comments-post-comment'),
url(r'^posted/$', comment_done, name='comments-comment-done'),
url(r'^cr/(\d+)/(.+)/$', views.post_redir... | {
"content_hash": "8d3fe296ff3990d3dba9a31b6f362909",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 80,
"avg_line_length": 29.833333333333332,
"alnum_prop": 0.6843575418994413,
"repo_name": "HMSBeagle1831/rapidscience",
"id": "8f43bb04131f5fe90e7ff647dfd1e18f4d623972",
"s... |
"""sysdescrparser.brocade."""
from sysdescr import SysDescr
# pylint: disable=no-name-in-module
class Brocade(SysDescr):
"""Class Brocade.
This class is only for vendor definition.
"""
def __init__(self, raw):
"""Constructor."""
super(Brocade, self).__init__(raw)
self.vend... | {
"content_hash": "86ffd457e09e0eb58130cbf5a92a12d1",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 45,
"avg_line_length": 20.8,
"alnum_prop": 0.5942307692307692,
"repo_name": "mtoshi/sysdescrparser",
"id": "dd536b8481877f1534ded7055c045a0f40926003",
"size": "545",
"bin... |
from __future__ import absolute_import, division, print_function, unicode_literals
import jmespath
from unittest import TestCase
from .common import event_data, BaseTest, TestConfig as Config
from c7n.cwe import CloudWatchEvents
class CloudWatchRuleTarget(BaseTest):
def test_target_cross_account_remove(self):... | {
"content_hash": "df7e505773c7d77bc0fc37281a8f23e1",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 87,
"avg_line_length": 36.75449101796407,
"alnum_prop": 0.4604105571847507,
"repo_name": "ewbankkit/cloud-custodian",
"id": "9cade51aec1f93a0c47b10b126f2f7331e59bc7a",
"si... |
from django.utils.translation import ugettext_lazy as _
from debug_toolbar.panels import DebugPanel
from debug_toolbar.utils import get_name_from_obj
class RequestVarsDebugPanel(DebugPanel):
"""
A panel to display request variables (POST/GET, session, cookies).
"""
name = 'RequestVars'
template =... | {
"content_hash": "55f6daa503f83e901405db232b1a2624",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 102,
"avg_line_length": 31.433333333333334,
"alnum_prop": 0.574761399787911,
"repo_name": "mozilla/popcorn_maker",
"id": "4f85052c7ec882f78f58738cc4f3ca703b4cd311",
"size":... |
async def get_users(request):
users = await request.app.m.user.get_list(fields=['username', 'email'])
return users
| {
"content_hash": "9294ecd8d65f91806d5784058fc27f46",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 75,
"avg_line_length": 41,
"alnum_prop": 0.6910569105691057,
"repo_name": "dvhbru/dvhb-hybrid",
"id": "acef2ecc76f109afae226b3d1d8a1579a8c7e8b3",
"size": "123",
"binary": ... |
import pysam
import numpy as np
import argparse
import sys
ap = argparse.ArgumentParser(description="Compute expected insert size")
ap.add_argument("bam", help="Input bam file.")
ap.add_argument("-n", help="Num samples", type=int, default=100000)
ap.add_argument("-M", help="Max isize", type=int, default=10000)
ap.add... | {
"content_hash": "2156cd738a36bee180072bfd118d2aeb",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 98,
"avg_line_length": 27.058823529411764,
"alnum_prop": 0.6217391304347826,
"repo_name": "yunlongliukm/chm1_scripts",
"id": "da499256f071610faad656915b0af05007cf7886",
"si... |
import warnings
from django.conf import settings
from django.core.urlresolvers import reverse, NoReverseMatch
from oscar.core import prices
from oscar.core.loading import get_class, get_model
from rest_framework import serializers, exceptions
from django.utils.translation import ugettext_lazy as _
from oscarapi.baske... | {
"content_hash": "d02b201ee3e43504f7d819c549829fe4",
"timestamp": "",
"source": "github",
"line_count": 203,
"max_line_length": 79,
"avg_line_length": 37.69950738916256,
"alnum_prop": 0.6632693061544492,
"repo_name": "KuwaitNET/django-oscar-api",
"id": "c93227b69b5e3c8eb9048f9c24e6332c46264c14",
"s... |
"""This module contains utilities for methods."""
import logging
from math import ceil
import numpy as np
import scipy.stats as ss
import elfi.model.augmenter as augmenter
from elfi.clients.native import Client
from elfi.model.elfi_model import ComputationContext
logger = logging.getLogger(__name__)
def arr2d_to_... | {
"content_hash": "4ea10dccd5b986ede1b831d10effe777",
"timestamp": "",
"source": "github",
"line_count": 420,
"max_line_length": 96,
"avg_line_length": 30.366666666666667,
"alnum_prop": 0.5776227066018504,
"repo_name": "lintusj1/elfi",
"id": "9c3c4edc5d465dec2f230e24c9a7f9ec584bfc3b",
"size": "12754... |
from ..core import fileoperations
from ..objects.exceptions import ValidationError
from ..resources.strings import strings
AUTH_BUCKET_KEY = 'Bucket'
AUTH_KEY = 'Authentication'
AUTHKEY_KEY = 'Key'
CONTAINER_PORT_KEY = 'ContainerPort'
IMG_NAME_KEY = 'Name'
IMG_KEY = 'Image'
IMG_UPDATE_KEY = 'Update'
JSON_FALSE = 'fal... | {
"content_hash": "ee11696bbbab65e53dc8f771467d73e8",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 77,
"avg_line_length": 27.79268292682927,
"alnum_prop": 0.6904344010530935,
"repo_name": "ianblenke/awsebcli",
"id": "abc51f75753922588fc9b1a2804fa1f819c4d9a1",
"size": "5... |
from JumpScale import j
j.base.loader.makeAvailable(j, 'system.platform.lxc')
from Lxc import Lxc
j.system.platform.lxc = Lxc()
| {
"content_hash": "1cf6b0b294dc7ff76a31781636f0492c",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 53,
"avg_line_length": 25.8,
"alnum_prop": 0.7674418604651163,
"repo_name": "Jumpscale/jumpscale6_core",
"id": "463ccfc0f165839f81f22d3d1cdfdff080d3185c",
"size": "129",
"... |
"""
This module can do slight modifications to tidy a wiki page's source code.
The changes are not supposed to change the look of the rendered wiki page.
If you wish to run this as an stand-alone script, use scripts/cosmetic_changes.py
For regular use, it is recommended to put this line into your user-config.py:
... | {
"content_hash": "4fc56b64511cb75fdbdb18fde7a20ea5",
"timestamp": "",
"source": "github",
"line_count": 955,
"max_line_length": 127,
"avg_line_length": 42.39057591623037,
"alnum_prop": 0.5199713459970852,
"repo_name": "trishnaguha/pywikibot-core",
"id": "e6b5213a36b343f811c2c5d0c70dbe7dea596e11",
"... |
import errno
import socket
from utils import require_user
from utils import get_simple_bpf_program
from utils import skip_if_not_supported
from pyroute2 import IPRoute
from pyroute2 import protocols
from pyroute2.common import uifname
from pyroute2.netlink import NetlinkError
from pyroute2.iproute import RTM_NEWQDISC
f... | {
"content_hash": "13ae56b5f67cd511ea932f99648f3a9a",
"timestamp": "",
"source": "github",
"line_count": 284,
"max_line_length": 74,
"avg_line_length": 35.651408450704224,
"alnum_prop": 0.5248395061728395,
"repo_name": "nazarewk/pyroute2",
"id": "fb38a2dd062b17935390b957a81bd415c6e1e5d2",
"size": "1... |
"""
==============================================
A demo of the Spectral Co-Clustering algorithm
==============================================
This example demonstrates how to generate a dataset and bicluster it
using the the Spectral Co-Clustering algorithm.
The dataset is generated using the ``make_biclusters`` f... | {
"content_hash": "e70d3be15356ec99b138b98f09cf9737",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 70,
"avg_line_length": 32.129629629629626,
"alnum_prop": 0.7170028818443804,
"repo_name": "fspaolo/scikit-learn",
"id": "00c4cc474dd3df7d756b463543a24d07f5a9a5d5",
"size": ... |
import sys, os, re, shutil
import argparse
from importlib import import_module
from cog.config import Profiles
path = os.path.dirname(os.path.abspath(__file__))
def find_subcommands():
for filename in os.listdir(path + os.sep + 'cli'):
name, ext = os.path.splitext(filename)
if ext.endswith('.py') ... | {
"content_hash": "aebe57fba929e371d9508b4035557fe5",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 120,
"avg_line_length": 35.55882352941177,
"alnum_prop": 0.6116625310173698,
"repo_name": "Demonware/cog",
"id": "b3977e5a1ef914a60a227ef9adb6c9c02c26f8de",
"size": "2626",... |
"""
Generic support for objects with full-featured Parameters and
messaging.
"""
import copy
import re
import sys
import inspect
import random
import numbers
import operator
from collections import namedtuple, OrderedDict
from operator import itemgetter,attrgetter
from types import FunctionType
from functools import ... | {
"content_hash": "94b96423e19a4c36c252d6d1dae66b92",
"timestamp": "",
"source": "github",
"line_count": 2841,
"max_line_length": 131,
"avg_line_length": 37.54347060894052,
"alnum_prop": 0.6119012572542917,
"repo_name": "ioam/param",
"id": "d9abd0462787cf20feff1efaa1367d96dcc05f13",
"size": "106661"... |
import webbrowser
import time
n_Break = 3
n_count = 1
print ("This program started on:"+ time.ctime())
#print ("Let's go to watch the movie!")
while (n_count<= n_Break):
time.sleep(2*60*60)
webbrowser.open("https://www.youtube.com/watch?v=10r9ozshGVE", new=0, autoraise=True)
n_count+=1
| {
"content_hash": "0120ba13c64e498010cb113ddf540c15",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 89,
"avg_line_length": 25.083333333333332,
"alnum_prop": 0.6777408637873754,
"repo_name": "jungjung917/ProgramingFundation",
"id": "8ddec195d85d67d112cb6ad3998edc2396434d50",... |
from google.cloud import dialogflow_v2
async def sample_list_versions():
# Create a client
client = dialogflow_v2.VersionsAsyncClient()
# Initialize request argument(s)
request = dialogflow_v2.ListVersionsRequest(
parent="parent_value",
)
# Make the request
page_result = client.l... | {
"content_hash": "4a699b2653da210c6833456b5e817e27",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 70,
"avg_line_length": 25.6,
"alnum_prop": 0.708984375,
"repo_name": "googleapis/python-dialogflow",
"id": "05bf63aaf06123446afe9b6ec9bc570bae078b70",
"size": "1522",
"bi... |
import logging
from .sim_state import SimState
from .calling_conventions import DEFAULT_CC, SimRegArg, SimStackArg, PointerWrapper
from .callable import Callable
from .errors import AngrAssemblyError
l = logging.getLogger("angr.factory")
_deprecation_cache = set()
def deprecate(name, replacement):
def wrapper(... | {
"content_hash": "56e4165714e98030b95b3324860e5a29",
"timestamp": "",
"source": "github",
"line_count": 332,
"max_line_length": 142,
"avg_line_length": 52.09036144578313,
"alnum_prop": 0.6250722794032613,
"repo_name": "tyb0807/angr",
"id": "f07ed2709437f2fdc645a3d662775c9795243c98",
"size": "17294"... |
"""
sphinx.builders.qthelp
~~~~~~~~~~~~~~~~~~~~~~
Build input files for the Qt collection generator.
:copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import re
import codecs
import posixpath
from os import path
from docutils i... | {
"content_hash": "8dfe4adbe7bc8e9048be66a6f519a79e",
"timestamp": "",
"source": "github",
"line_count": 295,
"max_line_length": 80,
"avg_line_length": 36.59322033898305,
"alnum_prop": 0.558406669754516,
"repo_name": "SurfasJones/icecream-info",
"id": "ce07315dbd29db917d2cc2a18fc35940ea5857c5",
"siz... |
import time
import datetime
from app import models
import config
from sqlalchemy.sql import func
def get_columns_model_record():
columnCollection = models.CdrRecord.__table__.columns
columns = []
for c in columnCollection._all_columns:
column = {
'key': c.key,
'info_name':... | {
"content_hash": "bf1dc2bebdfc1d04bc6f9513afd5926d",
"timestamp": "",
"source": "github",
"line_count": 167,
"max_line_length": 109,
"avg_line_length": 34.19760479041916,
"alnum_prop": 0.42707056557520573,
"repo_name": "m2xim/collogisco",
"id": "aaaa5de92f1e383caef83c088b7c295379999b54",
"size": "5... |
from nose.tools import *
import unittest
import shoppingtrends.receipt as receipt
from shoppingtrends.receipt import Receipt, Item
from shoppingtrends.localization import Province, Store
class test_Item(unittest.TestCase):
def setUp(self):
self.bananas = receipt.Item('Bananas', 0.79, 1.8)
sel... | {
"content_hash": "3e571a748ff48d619015ec0ca73300a2",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 67,
"avg_line_length": 33.33846153846154,
"alnum_prop": 0.6340562990309183,
"repo_name": "jhooey/shopping-cart-trends",
"id": "70cefe902f01dc6345a58cfb431018dce02ebb6c",
"s... |
import os
import shutil
import tempfile
import unittest
from trac.attachment import Attachment
from trac.mimeview.api import Context
from trac.resource import Resource
from trac.search.web_ui import SearchModule
from trac.test import MockPerm
from trac.web.href import Href
from trac.wiki.tests import formatter
SEARCH... | {
"content_hash": "23acb2582f29b3b617b53082290940ee",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 347,
"avg_line_length": 54.68108108108108,
"alnum_prop": 0.6416567813364966,
"repo_name": "dokipen/trac",
"id": "e176a7554c3169a74c4949bbf965e8290286a71f",
"size": "10116"... |
from pymongo import MongoClient
MONGO_DB_HOST = 'localhost'
MONGO_DB_PORT = '27017'
DB_NAME = 'test'
USER_NAME = "tester"
PWD = "099484"
client = MongoClient('%s:%s' % (MONGO_DB_HOST, MONGO_DB_PORT))
mongodb = client[DB_NAME]
def getDB(db= DB_NAME):
mongodb.authenticate(name=USER_NAME, password=PWD)
return ... | {
"content_hash": "4f5dc51fe49190cb9ccbca871d490a76",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 62,
"avg_line_length": 21.866666666666667,
"alnum_prop": 0.6951219512195121,
"repo_name": "stevensshi/smart-realestate",
"id": "f95f6fc6fb53a7a8fcde3f4787bc51816d738bd0",
"... |
from django import forms
from .models import Report
class ReportForm(forms.ModelForm):
class Meta:
model = Report
exclude = ('geometry',)
widgets = {
'location': forms.TextInput(attrs={'style': 'width:88%'}),
'description': forms.Textarea(attrs={'rows': '7'}),
... | {
"content_hash": "74d77ac76f50453d550a85c5adf6b678",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 70,
"avg_line_length": 27.857142857142858,
"alnum_prop": 0.5666666666666667,
"repo_name": "codeforamerica/straymapper",
"id": "2d334a4a15cee14bed051045aaccfc3376f7ec4d",
"s... |
from django.contrib.auth.models import User
from junction.base.models import AuditModel
from django.db import models
class Profile(AuditModel):
'''
It stores the City/Phone Details of the User.
'''
user = models.OneToOneField(User)
city = models.CharField(max_length=100, blank=True, null=True)
... | {
"content_hash": "440a2bb92e129a3a6b5cce404deb3a68",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 71,
"avg_line_length": 30.066666666666666,
"alnum_prop": 0.7095343680709535,
"repo_name": "ChillarAnand/junction",
"id": "db5e4198901c61646a67474cc00ec5507b24f6b0",
"size":... |
import unittest
from unittest import mock
import pytest
from parameterized import parameterized
from airflow.exceptions import AirflowException
from airflow.providers.google.cloud.operators.spanner import (
SpannerDeleteDatabaseInstanceOperator,
SpannerDeleteInstanceOperator,
SpannerDeployDatabaseInstance... | {
"content_hash": "54be0280c2d5ac29430e075a6c7c37be",
"timestamp": "",
"source": "github",
"line_count": 562,
"max_line_length": 108,
"avg_line_length": 41.855871886120994,
"alnum_prop": 0.6218169451175445,
"repo_name": "sekikn/incubator-airflow",
"id": "6347fd24be4b90bea3ed1a5278a6ceaba8985535",
"s... |
import mock
from nova import objects
from nova.scheduler.filters import core_filter
from nova import test
from nova.tests.unit.scheduler import fakes
class TestAggregateCoreFilter(test.NoDBTestCase):
@mock.patch('nova.scheduler.filters.utils.aggregate_values_from_key')
def test_aggregate_core_filter_value_e... | {
"content_hash": "a3bc41d89345bb7af42e9d4ce730658f",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 73,
"avg_line_length": 47.63461538461539,
"alnum_prop": 0.6459426725878078,
"repo_name": "rahulunair/nova",
"id": "05ac1cf984a8fc16c4662e368dc6af5c1b4583d2",
"size": "3050"... |
import unittest
from SimPEG import *
import simpegDCIP as DC
class DCProblemTests(unittest.TestCase):
def setUp(self):
mesh, survey, problem = DC.Examples.WennerArray.example()
mSynth = np.ones(mesh.nC)
survey.makeSyntheticData(mSynth)
# Now set up the problem to do some minim... | {
"content_hash": "2bc316d3804c0b11570cdeebdb5c784c",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 117,
"avg_line_length": 32.15873015873016,
"alnum_prop": 0.6174728529121422,
"repo_name": "simpeg/simpegdc",
"id": "97e92383a31b19f4e3d57eb685141ea8d6c17d6a",
"size": "2026... |
import argparse
import json
import logging
import subprocess
import yaml
import re
import collections
import os
import time
import requests
import urllib
from distutils.spawn import find_executable
import teuthology
from . import misc
from . import provision
from .config import config
from .lockstatus import get_statu... | {
"content_hash": "0d9ee34c2c41f87cc0366e16df0e4d71",
"timestamp": "",
"source": "github",
"line_count": 698,
"max_line_length": 79,
"avg_line_length": 36.5214899713467,
"alnum_prop": 0.5517024949003609,
"repo_name": "tchaikov/teuthology",
"id": "02a83e4434586dda1abcfb40c23513f93de758b2",
"size": "2... |
import unittest
import happy
class TestSquare(unittest.TestCase):
def setUp(self):
self.squares = happy.squares
def test_accuracy(self):
''' calculates the squares correctly '''
for n in xrange(10):
self.assertEqual(self.squares[str(n)], n**2)
class TestBin_search(unittest... | {
"content_hash": "9ae9603a1873b01003f5a6502df1a41b",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 75,
"avg_line_length": 31.175,
"alnum_prop": 0.6054530874097834,
"repo_name": "shiandy/happy",
"id": "8e8a5531dff308cd871a2a49aea1fbe064bbf034",
"size": "1247",
"binary":... |
'''
Author: Hans Erik Heggem
Email: hans.erik.heggem@gmail.com
Project: Master's Thesis - Autonomous Inspection Of Wind Blades
Repository: Master's Thesis - CV (Computer Vision)
'''
################### UNIT TEST ########################
import unittest
from Settings.TestData import TestData
from TestUnits.Test_ma... | {
"content_hash": "ca2df46fa791b314bae915d46f9db5ed",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 118,
"avg_line_length": 29.042857142857144,
"alnum_prop": 0.6945400885391048,
"repo_name": "hansehe/Wind-Blade-Inspection",
"id": "5b270fade10e47b65bcadaf7e626d12b5b7608b4",
... |
from SetExpression import *
class SymbolicSet(SetExpression):
def __init__(self):
SetExpression.__init__(self)
def getSymbolName(self, codeGenerator):
return self.generateCode(codeGenerator)
def getDependencies(self, codeGenerator):
return []
def setupEnvironment(self, codeSe... | {
"content_hash": "8e50e953ddb4ea6caeea053b78ca6bdf",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 50,
"avg_line_length": 24.379310344827587,
"alnum_prop": 0.6195190947666195,
"repo_name": "rafaellc28/Latex2MiniZinc",
"id": "e49239126173e59a8b5ace93ef50a4201a6c12f5",
"si... |
"""Module for the admin pages."""
from google.appengine.api import taskqueue
from google.appengine.ext import db
from google.appengine.ext import ndb
from django import forms as djangoforms
from django import http
from django.utils.translation import ugettext
from melange.models import profile as profile_model
from ... | {
"content_hash": "e9ff0b5101741bf88182072ee8e24112",
"timestamp": "",
"source": "github",
"line_count": 1301,
"max_line_length": 97,
"avg_line_length": 31.926979246733282,
"alnum_prop": 0.5959505982617906,
"repo_name": "rhyolight/nupic.son",
"id": "99138b3d20eaec08b233450b6573052c3b7d446f",
"size":... |
"""
Contains classes for basic HTTP (authenticated) transport implementations.
"""
from suds.transport.http import HttpTransport
from logging import getLogger
from urllib.request import (
HTTPPasswordMgrWithDefaultRealm,
HTTPBasicAuthHandler)
log = getLogger(__name__)
class HttpAuthenticated(HttpTransport):... | {
"content_hash": "befb978e934670ff54f3346e3abc0179",
"timestamp": "",
"source": "github",
"line_count": 83,
"max_line_length": 79,
"avg_line_length": 33.626506024096386,
"alnum_prop": 0.621282694374776,
"repo_name": "ronreiter/interactive-tutorials",
"id": "4bb39a3f75a4bfe55f2c8fc4f499f959699219ba",
... |
import os
import sys
import time
import json
import socket
import urlparse
import datetime
import firefly
import firefox_startup
from pyvirtualdisplay import Display
if __name__ == '__main__':
# quick argument sanity check
if len(sys.argv) < 3:
print 'usage: %s profile_name port' % sys.argv[0]
... | {
"content_hash": "84e28b9a8794a2b0c4d23424f15b3cc1",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 71,
"avg_line_length": 26.742857142857144,
"alnum_prop": 0.5389957264957265,
"repo_name": "ACAHNN/adscape",
"id": "dc60d64baded98cfa3b3001a32c7662058cc9286",
"size": "1872"... |
try:
from bashmu.FormatSock import FormatSocket
from bashmu.serverconstants import *
except ImportError:
from .FormatSock import FormatSocket
from .serverconstants import *
from threading import Lock, Condition
import dill
import queue
class WorkerManager:
def __init__(self):
self.mutex =... | {
"content_hash": "3fecb8d11b010e5141d2334aaba9eb09",
"timestamp": "",
"source": "github",
"line_count": 159,
"max_line_length": 85,
"avg_line_length": 29.836477987421382,
"alnum_prop": 0.5427908937605397,
"repo_name": "Renmusxd/Bashmu",
"id": "8f4b3dcd9dd2635992ce1cc1c32d12fae2bd0103",
"size": "474... |
install_requires = ['Sphinx', 'invoke', 'argh', 'six',
'future', 'Babel', 'unipath',
'python_dateutil', 'gitpython', 'pytest-cov']
# Explicitly install `importlib` under Python 2.6. Thanks to
# http://stackoverflow.com/questions/9418064
try:
import importlib
except ImportErr... | {
"content_hash": "ce869d47ca1daa150e0cde99ae730d07",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 91,
"avg_line_length": 35.670731707317074,
"alnum_prop": 0.7172649572649573,
"repo_name": "khchine5/atelier",
"id": "4afc9722ca33d16fe723182fa4db861729cd3795",
"size": "316... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.