text stringlengths 4 1.02M | meta dict |
|---|---|
"""General utility functions for devappserver2."""
import wsgiref.headers
def get_headers_from_environ(environ):
"""Get a wsgiref.headers.Headers object with headers from the environment.
Headers in environ are prefixed with 'HTTP_', are all uppercase, and have
had dashes replaced with underscores. This s... | {
"content_hash": "e5860283436507555217601609a0d8a3",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 78,
"avg_line_length": 32.71739130434783,
"alnum_prop": 0.707641196013289,
"repo_name": "ychen820/microblog",
"id": "115efd30f22ae475df48ed2b89478dfc05c6dd04",
"size": "210... |
import unittest, StringIO, sys
from libgsync.output import Channel, Debug, Itemize, Progress, Critical
class TestCaseStdStringIO(unittest.TestCase):
def setUp(self):
self.stdout, sys.stdout = sys.stdout, StringIO.StringIO()
self.stderr, sys.stderr = sys.stderr, StringIO.StringIO()
def tearDown... | {
"content_hash": "958776f1d35b80e2e480c3cba0e7676a",
"timestamp": "",
"source": "github",
"line_count": 292,
"max_line_length": 92,
"avg_line_length": 27.756849315068493,
"alnum_prop": 0.5643429981492906,
"repo_name": "iwonbigbro/gsync",
"id": "0d9e1e6b19e320e21278d98f8113dc33991c3cd9",
"size": "81... |
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from frappe.desk.doctype.notification_settings.notification_settings import (is_notifications_enabled, is_email_notifications_enabled_for_type, set_seen_value)
class NotificationLog(Document):
def aft... | {
"content_hash": "2589e88ebd7fdfcd1a2a75ef7f97c846",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 159,
"avg_line_length": 31.61832061068702,
"alnum_prop": 0.7170449058425882,
"repo_name": "adityahase/frappe",
"id": "c4c6077e855866db61a586fda31b382c9d7e6633",
"size": "4... |
from JumpScale import j
descr = """
Check on average cpu
"""
organization = "jumpscale"
author = "deboeckj@codescalers.com"
license = "bsd"
version = "1.0"
period = 15*60 # always in sec
startatboot = True
order = 1
enable = True
async = True
log = False
queue ='process'
roles = ['master']
def action():
try:
... | {
"content_hash": "1a4b3610b466258a5714f36dc98e5fc8",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 107,
"avg_line_length": 26.9,
"alnum_prop": 0.6171003717472119,
"repo_name": "Jumpscale/jumpscale6_core",
"id": "ac456eb4462138315ab3d0779f626a9d8c346023",
"size": "1077",
... |
import pandas as pd
import warnings
import weakref
def lazy_property(fn):
'''Decorator that makes a property lazy-evaluated.
'''
attr_name = fn.__name__
@property
def _lazy_property(self):
if attr_name not in self._values.keys():
self._values[attr_name] = fn(self)
retu... | {
"content_hash": "e5360453ce36a22d9c9eb1bdfc99bd93",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 87,
"avg_line_length": 29.344444444444445,
"alnum_prop": 0.5876561908368042,
"repo_name": "Vitens/epynet",
"id": "28c0a40a68c9b1e9e34aa14ccfd1c0ec7452fd45",
"size": "2641",... |
from ctypes import *
class onion_amount(Union):
_fields_ = [
("brown_long", c_long),
("brown_int", c_int),
("brown_char", c_char * 8)
]
value = raw_input("Enter the number of onions to union:")
onions = onion_amount(int(value))
print "Onion amount as long: %ld" % onions.brown_long
pri... | {
"content_hash": "c49fdaa0d4130b319fd73031532f916a",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 57,
"avg_line_length": 28.066666666666666,
"alnum_prop": 0.6270783847980997,
"repo_name": "JordanRobinson/books",
"id": "fcef32e83ef59bb6470f112dd8d15e96f7b2a39d",
"size": ... |
from sqlalchemy import Column
from sqlalchemy.orm import relationship
from . import Base
__all__ = ['Habits']
class Habits(Base):
__tablename__ = 'habits'
name = Column()
habit_groups = relationship('Routines', back_populates='habit')
attempts_logs = relationship('AttemptsLogs', back_populates='h... | {
"content_hash": "d43807ea4072b20dcb4066d15cd97233",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 72,
"avg_line_length": 23.9811320754717,
"alnum_prop": 0.5546813532651456,
"repo_name": "dnguyen0304/mfit",
"id": "a733e9b448b8b05d60dc829511b5c19eb611c337",
"size": "1296"... |
from copy import deepcopy
import os
import StringIO
import subprocess
import textwrap
import urllib2
import requests
import six
import yaml
import mock
from mock import patch
from fuel_upgrade import errors
from fuel_upgrade.tests.base import BaseTestCase
from fuel_upgrade import utils
from fuel_upgrade.utils import... | {
"content_hash": "f9004fcf4185aa41a263ba52149915b4",
"timestamp": "",
"source": "github",
"line_count": 772,
"max_line_length": 79,
"avg_line_length": 36.32772020725388,
"alnum_prop": 0.5798538063825994,
"repo_name": "SmartInfrastructures/fuel-web-dev",
"id": "7f73163d508ad131baf71e7867cb0c0513763111... |
import os
from setuptools import setup
setup(
name = "python-django-horizon-sina",
version = "2013.1",
description = ("A sina auth plugin for django-horizon."),
maintainer = "Yingjun Li",
maintainer_email = 'liyingjun1988@gmail.com',
license = "Apache 2.0",
keywords = "sina django",
url... | {
"content_hash": "7b831f49bb8c04f1ba08a81402998fd2",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 66,
"avg_line_length": 32.23529411764706,
"alnum_prop": 0.6259124087591241,
"repo_name": "foolself/python-django-horizon-sina",
"id": "76ffd45cf47bcacc4395ed78fb30e3a5efa33ae... |
import argparse
import math
import re
class Experiment(object):
def __init__(self, commit):
self.commit = commit
self.outputs = []
class Results(dict):
def __init__(self, *args, **kwargs):
super(Results, self).__init__(*args, **kwargs)
class LogReader(object):
def __init__(self, f... | {
"content_hash": "a297a70cdf6b3b686c8fea464b4ca388",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 90,
"avg_line_length": 29.916083916083917,
"alnum_prop": 0.5002337540906966,
"repo_name": "fding/llama",
"id": "371668e3e3e742f105b31c8b836aeb0d0a9c84e6",
"size": "4278",
... |
"""The version component."""
| {
"content_hash": "b2c2910e0d2dfbb6537861c259283662",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 28,
"avg_line_length": 29,
"alnum_prop": 0.6551724137931034,
"repo_name": "molobrakos/home-assistant",
"id": "eb257007f7cc20cc7d0525b563554c46341ae379",
"size": "29",
"bin... |
"""Options for BigMLer source processing
"""
def get_source_options(defaults=None):
"""source-related options
"""
if defaults is None:
defaults = {}
options = {
# Path to the training set.
'--train': {
"action": 'store',
"dest": 'training_set',
... | {
"content_hash": "11bbaff1d5b12477d2542e9c56f139f2",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 79,
"avg_line_length": 38.67910447761194,
"alnum_prop": 0.5199691298475786,
"repo_name": "brokendata/bigmler",
"id": "ed9a38013d4e8d5fd87bb0236f0c58d0089113e2",
"size": "5... |
import hashlib
import logging
import time
import json
import requests
logger = logging.getLogger(__name__)
class QobuzAPI(object):
APP_ID = '214748364'
APP_SECRET = '6fdcbccb7a073f35fbd16a193cdef6c4'
FLAC_FORMAT_ID = 6
def __init__(self, username, password, load_state, save_state):
"""
... | {
"content_hash": "df3947e4ec8c0272d8a58ba085a43830",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 95,
"avg_line_length": 35.02985074626866,
"alnum_prop": 0.6003408606731998,
"repo_name": "MADindustries/WhatManager2",
"id": "2b9eea4bf31fbceb9dd74a474e82ca0460649cf5",
"si... |
"""
Takes as input a 2-column (x,y) CSV file and outputs
a single 2-column (x+y,x*y) output CSV file.
"""
from argparse import FileType, ArgumentParser
import csv
import os
# In order to work with kive, scripts that have a inputs
# and b outputs must have a+b command line arguments, the first a
# arguments specifying... | {
"content_hash": "e644faccd2f44dfae61a0fd9bf176134",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 69,
"avg_line_length": 33.7027027027027,
"alnum_prop": 0.652766639935846,
"repo_name": "cfe-lab/Kive",
"id": "24f187c2363ab2947fb9df73991a737e4796cce9",
"size": "1271",
"... |
"""
This platform provides sensors for OpenUV data.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.openuv/
"""
import logging
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homea... | {
"content_hash": "40998bc785217ef6c689766551434a60",
"timestamp": "",
"source": "github",
"line_count": 148,
"max_line_length": 79,
"avg_line_length": 34.182432432432435,
"alnum_prop": 0.5961652500494169,
"repo_name": "tinloaf/home-assistant",
"id": "63527db42a6b8ea2a0da7357b4366691c6e31639",
"size... |
__author__ = 'Deathnerd'
| {
"content_hash": "c7948110b984f6a8e557aae47136522f",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 24,
"avg_line_length": 25,
"alnum_prop": 0.6,
"repo_name": "Deathnerd/RPG",
"id": "cdea0ffce8188ac99bab38011f54b0afb3bc99f7",
"size": "25",
"binary": false,
"copies": "4... |
import copy
import getopt
import string
import sys
import mpfit
import Numeric
from ppgplot import *
import BonnLogger
def phot_funct_2(p, fjac=None, y=None, err=None):
model = p[0]
status = 0
return([status, (model-y)/err])
def phot_funct_1(p, fjac=None, color=None, y=None, err=None):
model = p... | {
"content_hash": "9e97399d663c117fa01407762181a4c9",
"timestamp": "",
"source": "github",
"line_count": 443,
"max_line_length": 279,
"avg_line_length": 38.09480812641083,
"alnum_prop": 0.5478786442284902,
"repo_name": "deapplegate/wtgpipeline",
"id": "7b5822f20da4e54c0d06d0eae9719c6ab701370c",
"siz... |
from sublime_plugin import WindowCommand
from ..api import deviot
from ..libraries.tools import create_sketch, get_setting, save_setting
class DeviotNewSketchCommand(WindowCommand):
def run(self):
from ..libraries.I18n import I18n
_ = I18n().translate
caption = _('caption_new_sketch')
... | {
"content_hash": "aaf75dd6069efe0408b9cdc726f05038",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 76,
"avg_line_length": 27.954545454545453,
"alnum_prop": 0.6650406504065041,
"repo_name": "gepd/Deviot",
"id": "81a795ca735d0d87f6b80acffebef0f4c92359d3",
"size": "615",
... |
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
from mock import Mock, patch
from c7n_mailer import utils
class FormatStruct(unittest.TestCase):
def test_formats_struct(self):
expected = '{\n "foo": "bar"\n}'
actual = utils.format_struct({'foo... | {
"content_hash": "bce6d39d0bc9603fd04dc796fee98c8f",
"timestamp": "",
"source": "github",
"line_count": 224,
"max_line_length": 92,
"avg_line_length": 29.638392857142858,
"alnum_prop": 0.48425967766229855,
"repo_name": "ewbankkit/cloud-custodian",
"id": "2ecf88281f7bf868b9c6052c3375a8e03a7f94df",
"... |
import csv
import numpy as np
import matplotlib.pyplot as plt
with open('/Users/tunder/Dropbox/GenreProject/python/piketty/badvolids.txt', encoding = 'utf-8') as f:
badids = [x.rstrip() for x in f.readlines()]
alldistribution = dict()
targetdistribution = dict()
def pricesymbol(snippet):
if ' $ ' in snippet:... | {
"content_hash": "8eeaa24f1f2eb0d3c2fddcc78cfa19c9",
"timestamp": "",
"source": "github",
"line_count": 125,
"max_line_length": 102,
"avg_line_length": 25.608,
"alnum_prop": 0.6004373633239612,
"repo_name": "tedunderwood/GenreProject",
"id": "f804a420f62cd779522f04aa2ce06ef6ff196cf6",
"size": "3528... |
import os
import random
import uuid
from keystone.common.sql import migration
from keystone import config
from keystone import contrib
from keystone.openstack.common import importutils
from keystone.openstack.common import jsonutils
from keystone.openstack.common import log
from keystone.tests import mapping_fixtures
... | {
"content_hash": "dd51cd5ed60f804560595f54d6c71c55",
"timestamp": "",
"source": "github",
"line_count": 549,
"max_line_length": 79,
"avg_line_length": 37.8816029143898,
"alnum_prop": 0.5591191037168822,
"repo_name": "dsiddharth/access-keys",
"id": "107a6045e7771047cb2631294cf6d272b6fd2074",
"size":... |
import numpy as np
import pandas as pd
import pandas.util.testing as tm
import pytest
from pandas import CategoricalIndex, Index, MultiIndex
from pandas.compat import range
def assert_matching(actual, expected, check_dtype=False):
# avoid specifying internal representation
# as much as possible
assert len... | {
"content_hash": "d0e107a613766f4e36d3fd32f25995eb",
"timestamp": "",
"source": "github",
"line_count": 413,
"max_line_length": 75,
"avg_line_length": 35.73365617433414,
"alnum_prop": 0.6271852554546686,
"repo_name": "cython-testbed/pandas",
"id": "99ab54a83636c9c7c50ed88462051a685d6f0cc2",
"size":... |
'''
Module: player
Author: David Frye
Description: Contains the Player class.
'''
class Player:
'''
'''
def __init__(self):
'''
'''
return | {
"content_hash": "96cb1251a52ff5ec9fd8fac879ca08ca",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 39,
"avg_line_length": 10,
"alnum_prop": 0.5866666666666667,
"repo_name": "DFrye333/DynamicMaze",
"id": "32ae43250819ff0921859dd79242f798df68dd3c",
"size": "150",
"binary... |
from colorama import Fore
import math
import os
import requests
import subprocess
import tqdm
from dotgen import hashing
rank = 0
def handle(output_dir, config):
for download in config:
print(Fore.WHITE + "download: " + download + Fore.RESET)
cfg = config[download]
download_path = os.pat... | {
"content_hash": "9af30ac66be603bd2020126be2086c38",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 72,
"avg_line_length": 28.46,
"alnum_prop": 0.5558678847505271,
"repo_name": "f-koehler/dotgen",
"id": "b0fd12f147d9e8b3d5442dcb63f1edb53fd1df4e",
"size": "1447",
"binary... |
from setuptools import setup, find_packages
setup(
name="double_down",
version="1.0.1",
author="Stephen Melnicki",
author_email="smelnicki3@gmail.com",
packages=find_packages(),
description="A silly example of a python decorator",
long_description=open("README.rst").read(),
keywords="sa... | {
"content_hash": "d79890ad5828040df3174dc249f2323d",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 56,
"avg_line_length": 30.642857142857142,
"alnum_prop": 0.682983682983683,
"repo_name": "smelnicki/double_down",
"id": "8998465d5a729b5917b3633ad29081064851996f",
"size": ... |
import typing as t
from datetime import timedelta
import pytest
from pycroft.lib import user as lib_user
from pycroft.model.facilities import Room
from pycroft.model.task import Task, UserTask, TaskStatus, TaskType
from pycroft.model.task_serialization import UserMoveParams
from pycroft.model.user import User
from te... | {
"content_hash": "512d3abf70ffedd2e73b64894c5d120e",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 86,
"avg_line_length": 33.702127659574465,
"alnum_prop": 0.6132154882154882,
"repo_name": "agdsn/pycroft",
"id": "105b6f6ee1dc52d50ea2b118610913ea9b474ffc",
"size": "4752"... |
"""Base Modin Dataframe classes related to its partitioning."""
| {
"content_hash": "be342f7e2f0ad5a34d16aa664216b77a",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 63,
"avg_line_length": 64,
"alnum_prop": 0.765625,
"repo_name": "modin-project/modin",
"id": "a7992787753cd627748b9d74af1f67ab4d347f25",
"size": "847",
"binary": false,
... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('nomi', '0135_auto_20170806_1111'),
('nomi', '0135_auto_20170806_1015'),
]
operations = [
]
| {
"content_hash": "0f08ef68fdfcc2611de16bb03f901346",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 44,
"avg_line_length": 18.5,
"alnum_prop": 0.6254826254826255,
"repo_name": "SummerCamp17/Gymkhana-Nominations",
"id": "901fb06cac66f00f30208b01978268567bef8151",
"size": "... |
"""This module contains test objects with unexpected __name__ attributes.
It is used for testing aeta.logic.
"""
__author__ = 'jacobltaylor@google.com (Jacob Taylor)'
import unittest
# Change the module's __name__. The module's __name__ no longer starts with
# 'test_'; nevertheless, it should be included in the t... | {
"content_hash": "33380b5dd799c26c81c0a7983f6bc0c7",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 79,
"avg_line_length": 26.06779661016949,
"alnum_prop": 0.7366710013003901,
"repo_name": "zenlambda/aeta",
"id": "77b887c6e8c87592fc0c0315f5ab0dbe0e7bec3b",
"size": "2132",... |
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union
import warnings
from google.api_core import gapic_v1, grpc_helpers_async, operations_v1
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.... | {
"content_hash": "c586e61c999d129090dbdf7066808f19",
"timestamp": "",
"source": "github",
"line_count": 378,
"max_line_length": 91,
"avg_line_length": 44.473544973544975,
"alnum_prop": 0.617452858247576,
"repo_name": "googleapis/python-run",
"id": "55ee1fd98d39ffd388c883c50d486113ba78f46c",
"size":... |
import logging
import re
import urlparse
import smtplib
from django.conf import settings
from django import template
from django.template import loader
from django.core import mail
from common import exception
from common import util
def is_allowed_to_send_email_to(email):
if settings.EMAIL_LIMIT_DOMAIN:
limit... | {
"content_hash": "473566806bab6bad89ec4642bd004e41",
"timestamp": "",
"source": "github",
"line_count": 179,
"max_line_length": 85,
"avg_line_length": 35.64804469273743,
"alnum_prop": 0.7016141670584548,
"repo_name": "jimpick/jaikuengine",
"id": "01f883ff8a3ad1fd2d8bbba1fe839b8f34413d8f",
"size": "... |
from os_win import constants
from os_win import exceptions as os_win_exc
from os_win import utilsfactory
from oslo_config import cfg
from oslo_log import log as logging
from designate.backend.agent_backend import base
from designate import exceptions
LOG = logging.getLogger(__name__)
class MSDNSBackend(base.AgentBa... | {
"content_hash": "d827d480368add2af7bba714f80c89e1",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 77,
"avg_line_length": 35.48275862068966,
"alnum_prop": 0.5999352121801101,
"repo_name": "openstack/designate",
"id": "182f2d3c177baec7f09288e07eaae7b96eb0b589",
"size": "3... |
"""Statewide Crime Data"""
from statsmodels.datasets import utils as du
__docformat__ = 'restructuredtext'
COPYRIGHT = """Public domain."""
TITLE = """Statewide Crime Data 2009"""
SOURCE = """
All data is for 2009 and was obtained from the American Statistical Abstracts except as indicated below.
"""
DE... | {
"content_hash": "ef69562acba91782679dd54e8787f9b3",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 104,
"avg_line_length": 33.770270270270274,
"alnum_prop": 0.6802721088435374,
"repo_name": "bashtage/statsmodels",
"id": "7d5530b8fe21279ee9c25370e7881a62b27ef31d",
"size":... |
"""Core eval alignment algorithms
"""
import warnings
from functools import partial, wraps
from pandas.compat import zip, range
import numpy as np
import pandas as pd
from pandas import compat
from pandas.errors import PerformanceWarning
from pandas.core.common import flatten
from pandas.core.computation.common impo... | {
"content_hash": "dbdd6942ba4790af8728381307532eac",
"timestamp": "",
"source": "github",
"line_count": 179,
"max_line_length": 79,
"avg_line_length": 31.39664804469274,
"alnum_prop": 0.5982206405693951,
"repo_name": "zfrenchee/pandas",
"id": "2e912b0075bfd3d623cb0828c11832c92b52cd3f",
"size": "562... |
class Liegewiese(object):
loc_index = 0
def enter(self):
if first_visit:
print "Du befindest die auf der Liegewiese des Schwimmbads."
else:
print "Du warst schon eimal hier."
class GertrudesBaum(object):
loc_index = 1
loc_name = 'Gertrude\'s Baum'
def enter(s... | {
"content_hash": "6f99288f80d61a63b3ab4ee5e7913ef4",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 72,
"avg_line_length": 25.676923076923078,
"alnum_prop": 0.5835829838226483,
"repo_name": "empea-careercriminal/the_pool",
"id": "f4f2d52a2204a94ee5e20bf0a071bf3a7d8f8fd3",
... |
import os
from flask import Flask, request, Response
app = Flask(__name__)
SLACK_WEBHOOK_SECRET = ""
SLACK_WEBHOOK_SECRET = os.environ.get('SLACK_TOKEN')
if (SLACK_WEBHOOK_SECRET==""):
print "ERROR: Missing environment variable: SLACK_WEBHOOK_SECRET"
exit()
SLACK_WEBHOOK_SECRET = os.environ.get('SLACK_WEBH... | {
"content_hash": "240dfb063ffa8d9e9f4a93167a3442d1",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 72,
"avg_line_length": 23.9,
"alnum_prop": 0.6234309623430963,
"repo_name": "BartGo/python-slack-drafts",
"id": "4fdde9eee00c40c4963c4bc0a9f78eb86eeb7977",
"size": "956",
... |
from utils import run_cmd
from utils import enter_depend_test
enter_depend_test()
from depend_test_framework.core import Action, ParamsRequire, Provider, Consumer
@Action.decorator(1)
@ParamsRequire.decorator(['guest_name', 'target_host'])
@Consumer.decorator('$guest_name.active', Consumer.REQUIRE)
@Consumer.decorat... | {
"content_hash": "546fbf5208636ca814140d7f40feafbb",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 80,
"avg_line_length": 36.80952380952381,
"alnum_prop": 0.7218628719275549,
"repo_name": "LuyaoHuang/depend-test-framework",
"id": "512452bf627ef2ae9d4d7e908d2d810d08b717ba",... |
""" Sahana Eden Module Automated Tests - HRM005 Add Staff To Organization
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in... | {
"content_hash": "ee6791a9a2aebe1da614ae6b374b0925",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 110,
"avg_line_length": 39.75675675675676,
"alnum_prop": 0.6203263086335826,
"repo_name": "ashwyn/eden-message_parser",
"id": "ce0715511024edfe0b4e2d93da7bcb6ce5c986b8",
"s... |
"""
Crossfilter
------
Crossfilter.
"""
from jinja2 import Template
import json
#from .utilities import color_brewer, _parse_size, legend_scaler, _locations_mirror, _locations_tolist, write_png,\
# image_to_url
#from .six import text_type, binary_type
from folium.element import Figure, JavascriptLink, CssLink, Di... | {
"content_hash": "2feec77b8b886c7422710f6c470bbd42",
"timestamp": "",
"source": "github",
"line_count": 616,
"max_line_length": 115,
"avg_line_length": 43.574675324675326,
"alnum_prop": 0.4758214738097012,
"repo_name": "BibMartin/folium",
"id": "d919ae4985e98d1fa1f4764fb38254f788e7d230",
"size": "2... |
import pkgutil
from io import StringIO
import numpy as np
import pandas as pd
from scattertext.Common import DEFAULT_BACKGROUND_SCALER_ALGO, DEFAULT_BACKGROUND_BETA
from scattertext.termscoring import ScaledFScore
class TermCategoryFrequencies(object):
'''
This class allows you to produce scatter plots of raw term... | {
"content_hash": "056530a8f962ae2f22f45d1c1eddcec3",
"timestamp": "",
"source": "github",
"line_count": 225,
"max_line_length": 161,
"avg_line_length": 32.83111111111111,
"alnum_prop": 0.6925680249086232,
"repo_name": "JasonKessler/scattertext",
"id": "e8fce4c345066634f1c2b1faf8e2f018c1e62a1c",
"si... |
def Execute():
pass
| {
"content_hash": "c802c9ae7f0dcaaaf54566c803fdfbb6",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 14,
"avg_line_length": 12,
"alnum_prop": 0.5833333333333334,
"repo_name": "TeradataCenterForHadoop/ambari-presto-service",
"id": "244ed0dbac6f6997ddef2bc5ce039049b220e51b",
... |
import unittest2
from .test_data import * # flake8: noqa
from onfido import Api
class DummyApiRequestor(object):
def post(self, url, params, file=None):
return {
"url": url,
"params": params,
"method": "post",
"file": file
}
def get(self, url, p... | {
"content_hash": "e51d9bc1426b5f0bd69dce87dd780547",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 120,
"avg_line_length": 37.574074074074076,
"alnum_prop": 0.5832101199277148,
"repo_name": "AdamStelmaszczyk/pyonfido",
"id": "4f87d2ddddffe7ad66576f37719ca21efa3b10f9",
"... |
import unittest
import tempfile
import os
from calvin.utilities.calconfig import CalConfig
class TestBase(unittest.TestCase):
def setUp(self):
self.filepath = None
f, self.filepath = tempfile.mkstemp()
os.unlink(self.filepath)
self._env = os.environ
print "hej"
def t... | {
"content_hash": "023bf6abb88545a36967285dfe1f5983",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 115,
"avg_line_length": 34.436974789915965,
"alnum_prop": 0.5671059053196681,
"repo_name": "MalmoUniversity-DA366A/calvin-base",
"id": "ee98de0eca98389cbf33ef1a6310dc0d47071... |
"""
Smart energy channels module for Zigbee Home Automation.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/zha/
"""
import logging
import zigpy.zcl.clusters.smartenergy as smartenergy
from homeassistant.core import callback
from .. import registries... | {
"content_hash": "8b0cda12b78324e80e91e32f2bd7e992",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 88,
"avg_line_length": 28.86813186813187,
"alnum_prop": 0.6543585839360487,
"repo_name": "Cinntax/home-assistant",
"id": "8e2fa7e3d5a3f2a00f47e23900bf71b8ceb169a9",
"size"... |
from collections import deque
import math
import numpy as np
from scipy import signal
class Channel:
def __init__(self, name, min, max, maxNum, offset=0.0):
self.name = name
self.min = min
self.max = max
self.num = 0
self.sum = 0
self.buffersum = 0
self.size = maxNum
self.buffer = deque(maxlen=maxNu... | {
"content_hash": "dca408b33017e58c82f6272784383034",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 68,
"avg_line_length": 24.75206611570248,
"alnum_prop": 0.6200333889816361,
"repo_name": "Psychedelic-Engineering/sleep-machine",
"id": "1c1650544667d5cb657eeeb3602f19410500... |
from pool import Pool
from server import start_server
| {
"content_hash": "892670e1cba40c8edc33f2485e19ea6e",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 31,
"avg_line_length": 14,
"alnum_prop": 0.8035714285714286,
"repo_name": "paraVerifier/paraVerifier",
"id": "4e4385144e410378c1049cb439975a0099f80c5a",
"size": "71",
"bin... |
from toolbox import guild_utilities, selection_utilities
from sklearn.metrics import roc_auc_score, average_precision_score
from selection_utilities import generate_samples_from_list_without_replacement
import numpy
def get_balanced_auc(predictions_true, predictions_false, replicable = None):
if replicable is not... | {
"content_hash": "a93749ac54b535eb1e15c4f57f2ff57c",
"timestamp": "",
"source": "github",
"line_count": 313,
"max_line_length": 245,
"avg_line_length": 44.43130990415335,
"alnum_prop": 0.6433450780182642,
"repo_name": "quimaguirre/diana",
"id": "9075327d2e2630675c777e4a53240aea9a11b75c",
"size": "1... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Item',
fields=[
('id', models.AutoField(auto_create... | {
"content_hash": "db17aaeee48a608fdee30d861a30fed5",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 114,
"avg_line_length": 20.8,
"alnum_prop": 0.5745192307692307,
"repo_name": "ejpreciado/superlists",
"id": "a419fa172d616e46398a387f6bf38194e0da59e5",
"size": "489",
"bi... |
"""
Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved.
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including with... | {
"content_hash": "5568f0f41a60be5d08f68af770b44933",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 83,
"avg_line_length": 48.666666666666664,
"alnum_prop": 0.7893835616438356,
"repo_name": "frankyao47/open-hackathon",
"id": "f260be7ba15ac6814279aff42c3eb9b5534380ba",
"si... |
"""
This module contains the 'email_address' menu node.
"""
from random import choice
from textwrap import dedent
from services import email
from typeclasses.players import Player
def email_address(caller, input):
"""Prompt the user to enter a valid email address."""
text = ""
options = (
{
... | {
"content_hash": "6db71eaf69e154cac6c764fea8c39cb3",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 71,
"avg_line_length": 34.26829268292683,
"alnum_prop": 0.5655990510083037,
"repo_name": "vlegoff/mud",
"id": "e5ecfeb1ba9bbfba55403235471f033165dcb415",
"size": "4217",
... |
import collections
import os
import re
import subprocess
import base64
import os.path as osp
import pickle as pickle
import inspect
import hashlib
import sys
from contextlib import contextmanager
import errno
from io import StringIO
import datetime
import dateutil.tz
import json
import time
import numpy as np
from rll... | {
"content_hash": "9cf1b9081d43d3be7401175f5eb955ed",
"timestamp": "",
"source": "github",
"line_count": 1377,
"max_line_length": 174,
"avg_line_length": 39.75816993464052,
"alnum_prop": 0.5357005863334977,
"repo_name": "nosyndicate/pytorchrl",
"id": "fa7475a26487b08628c5873b3afa235761c88694",
"size... |
'''
This script is a check for lookup at another check over ssh without
having an agent on the other side
'''
import os
import sys
import optparse
import base64
import subprocess
try:
import paramiko
except ImportError:
print "ERROR : this plugin needs the python-paramiko module. Please install it"
sys.ex... | {
"content_hash": "b94b81ec0e2e37dd06c2adeeb37c8c90",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 103,
"avg_line_length": 29.813953488372093,
"alnum_prop": 0.6396255850234009,
"repo_name": "robinfourdeux/check-linux-by-ssh",
"id": "a1a38ca4cfac7f4a5c1fb271b1cbf41353f28d2b... |
__author__ = "orim"
import re
import pytest
import json
import inspect
import itertools
import sys
from attrdict import AttrDict
from pyfiglet import figlet_format
from pytest_scenario.exceptions import ImproperlyConfigured
from os.path import abspath
TEST_SCENARIOS_DIR = './sut/scenarios'
def pytest_addoption(parse... | {
"content_hash": "77ce0b44f9d8fc66ae5849ae5522cd0a",
"timestamp": "",
"source": "github",
"line_count": 328,
"max_line_length": 119,
"avg_line_length": 47.35670731707317,
"alnum_prop": 0.5406553788707912,
"repo_name": "OriMenashe/pytest-scenario",
"id": "f40361991a59b988770ce3d534259435a1694dac",
"... |
import time
from datetime import timedelta
import logging
from traceback import format_exc
from django.utils import timezone
from django.db.utils import ProgrammingError
from django.core.cache import cache
from .models import RepeatingTask
from .utils import redis_connection
logger = logging.getLogger('cq')
def p... | {
"content_hash": "e9267f28a43ea4c8c51bbd3478c32e94",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 97,
"avg_line_length": 33.88709677419355,
"alnum_prop": 0.6358876725368872,
"repo_name": "furious-luke/django-cq",
"id": "1a38c3d9858de002d98c3cc80dc2056a867eafe0",
"size":... |
import os
import numpy as np
from tqdm import tqdm
import cv2
import glob
from utils import *
from constants import *
from models.model_bce import ModelBCE
def test(path_to_images, path_output_maps, model_to_test=None):
list_img_files = [k.split('/')[-1].split('.')[0] for k in glob.glob(os.path.join(path_to_image... | {
"content_hash": "95f02390541a6b87f12ee80b952d73c8",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 125,
"avg_line_length": 37.86666666666667,
"alnum_prop": 0.6716549295774648,
"repo_name": "imatge-upc/saliency-salgan-2017",
"id": "0701fc60672d2e35027442de2fa28eb4d29e1f93",... |
"""Support for Google Domains."""
import asyncio
from datetime import timedelta
import logging
import aiohttp
import async_timeout
import voluptuous as vol
from homeassistant.const import CONF_DOMAIN, CONF_PASSWORD, CONF_TIMEOUT, CONF_USERNAME
from homeassistant.core import HomeAssistant
from homeassistant.helpers.ai... | {
"content_hash": "6997a392d40b668f2eb3804441633a42",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 87,
"avg_line_length": 29.896551724137932,
"alnum_prop": 0.6770472895040369,
"repo_name": "toddeye/home-assistant",
"id": "c7f7e632bd66b15fc6f352ffc40c7ed35bcca2f7",
"size"... |
"""
Module which implements propagation modelling functions.
Created on Sun Feb 26 19:56:10 2017
@author: Ashiv Dhondea
Edits:
26/02/17: created file and added the function fnCalculate_LinkTime
26/02/17: created the function fnCalculate_DownlinkTime_Iter
02/03/17: included the module MathsFn which is cal... | {
"content_hash": "5cbe0ee191dd7c9abd71650bc62417eb",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 118,
"avg_line_length": 40.01204819277108,
"alnum_prop": 0.6341463414634146,
"repo_name": "AshivDhondea/SORADSIM",
"id": "8184a89f52e08c5f4ede506af7276e7adf1fec5e",
"size"... |
"""Apache Configuration based off of Augeas Configurator."""
import logging
import os
import re
import shutil
import socket
import subprocess
import zope.interface
from acme import challenges
from letsencrypt import achallenges
from letsencrypt import constants as core_constants
from letsencrypt import errors
from l... | {
"content_hash": "33ab00256199ec71b657685f20063c67",
"timestamp": "",
"source": "github",
"line_count": 1186,
"max_line_length": 80,
"avg_line_length": 38.822091062394605,
"alnum_prop": 0.5892535238798514,
"repo_name": "tdfischer/lets-encrypt-preview",
"id": "c8083b4064fa0b099b6208c3f4acfb8e3fc633a9"... |
import tests.periodicities.period_test as per
per.buildModel((60 , 'H' , 400));
| {
"content_hash": "f5106835d367da98dc546ef6f2ceb046",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 45,
"avg_line_length": 20.5,
"alnum_prop": 0.7073170731707317,
"repo_name": "antoinecarme/pyaf",
"id": "5a87e2c16fe49a56ae3998d0fb66eba99aeeae1b",
"size": "82",
"binary": ... |
from textwrap import dedent
import tempfile
import yaml
import os
import subprocess as sp
import conda_build.api
def ensure_missing(package):
"""
Delete a package if it exists and re-index the conda-bld dir.
If a package is deleted from the conda-bld directory but conda-index is not
re-run, it remai... | {
"content_hash": "5bb47e9ff42970284aaffd5cac48d149",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 79,
"avg_line_length": 32.025862068965516,
"alnum_prop": 0.5695827725437416,
"repo_name": "bioconda/bioconda-utils",
"id": "35a78b07ba9da8428a87ef254cb0ad78fa8e1993",
"siz... |
from celery.utils.log import get_task_logger
from celerydemo import app
logger = get_task_logger(__name__)
print("other's logger is %s" % logger)
@app.task
def multi(x, y):
logger.info('x * y')
return x * y
| {
"content_hash": "0801450e36d01b138360b3c2bc0e2606",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 44,
"avg_line_length": 16.923076923076923,
"alnum_prop": 0.6636363636363637,
"repo_name": "hugoxia/Python",
"id": "16ac71b79017301b0b8d2eb249afb49ee724bf27",
"size": "220",... |
"""Worry-free YAML configuration files.
"""
from __future__ import unicode_literals
import platform
import os
import pkgutil
import sys
import yaml
import types
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
UNIX_DIR_VAR = 'XDG_CONFIG_HOME'
UNIX_DIR_FALLBACK = ... | {
"content_hash": "37297e7b74310d451bf541667f90bc29",
"timestamp": "",
"source": "github",
"line_count": 897,
"max_line_length": 79,
"avg_line_length": 33.96321070234114,
"alnum_prop": 0.5892663712456918,
"repo_name": "iamdankaufman/beets",
"id": "3693f39f4b29f133856b2ee88bbe310a5a41d86a",
"size": "... |
import mxnet as mx
import numpy as np
import os
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
class MApMetric(mx.metric.EvalMetric):
"""
Calculate mean AP for object detection task
Parameters:
---------
ovp_thresh : float
overlap threshold for TP
use_difficul... | {
"content_hash": "1dd55aceea3cefb99e661dfffe2e690c",
"timestamp": "",
"source": "github",
"line_count": 307,
"max_line_length": 107,
"avg_line_length": 37.06188925081433,
"alnum_prop": 0.48242221831604853,
"repo_name": "zhreshold/mxnet-ssd",
"id": "796bee8b8f1183fe7c9743f266cf076188e3c278",
"size":... |
import functools
import unittest2
from sentry import app
from sentry.db import get_backend
def with_settings(**settings):
def wrapped(func):
@functools.wraps(func)
def _wrapped(*args, **kwargs):
defaults = {}
for k, v in settings.iteritems():
defaults[k] = a... | {
"content_hash": "d41c188062e22e13410397be22b5d04d",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 64,
"avg_line_length": 28.63157894736842,
"alnum_prop": 0.5220588235294118,
"repo_name": "dcramer/sentry-old",
"id": "638773d4a16ef222861fe146799b95b1a538f7e4",
"size": "10... |
import os
import sys
from urlparse import urlparse
import pymongo
from pyramid.paster import (
bootstrap,
setup_logging
)
def usage(argv):
cmd = os.path.basename(argv[0])
print('usage: %s <config_uri>\n'
'(example: "%s development.ini")' % (cmd, cmd))
sys.exit(1)
def main(argv=sys.argv... | {
"content_hash": "00ba09d1acf6e4b5e587b5a657271a59",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 71,
"avg_line_length": 26.38888888888889,
"alnum_prop": 0.6,
"repo_name": "wwitzel3/pinto",
"id": "0b989982324322dbf322ac8a54375cc16c9445d1",
"size": "950",
"binary": fal... |
class BlurayRating(object):
def __init__(self):
self.__video = None
self.__audio = None
self.__extras = None
self.__link = None
@property
def video(self):
return self.__video
@video.setter
def video(self, video):
self.__video = video
@property
... | {
"content_hash": "11ca41140e50df7acedd1ce40fba96f3",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 100,
"avg_line_length": 20.73170731707317,
"alnum_prop": 0.5341176470588235,
"repo_name": "jeremyrea/caterblu",
"id": "497b158748e6693fd24a6128605aeab7fd6f2c09",
"size": "8... |
import json
import py
import requests
issues_url = "https://api.github.com/repos/pytest-dev/pytest/issues"
def get_issues():
issues = []
url = issues_url
while 1:
get_data = {"state": "all"}
r = requests.get(url, params=get_data)
data = r.json()
if r.status_code == 403:
... | {
"content_hash": "459488e2f8be6f1ac26eeab39ef0e695",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 81,
"avg_line_length": 26.870588235294118,
"alnum_prop": 0.5521015761821366,
"repo_name": "txomon/pytest",
"id": "25bfc3e9a0925c5a22b6150919ce8d6551cbddb7",
"size": "2284",... |
import collections
import os
from typing import List
from typing import Tuple
from paddle.utils import download
from paddle.dataset.common import DATA_HOME
from .dataset import AudioClassificationDataset
__all__ = []
class TESS(AudioClassificationDataset):
"""
TESS is a set of 200 target words were spoken i... | {
"content_hash": "ac48531bef5d113fea9b907c263f5311",
"timestamp": "",
"source": "github",
"line_count": 142,
"max_line_length": 128,
"avg_line_length": 34.82394366197183,
"alnum_prop": 0.5518705763397371,
"repo_name": "luotao1/Paddle",
"id": "46ee1425ec9fb30376c1678e8bc188328bf3711d",
"size": "5555... |
from math import log2
from yace.util.math import is_power_of_two
class AddressDecoder:
"""Maps components into equally sized blocks in address space"""
def __init__(self, address_bits, masked_bits):
"""
Create a new decoder instance.
:param address_bits: the number of bits in this ad... | {
"content_hash": "ed05e8616ed8ff2820ad8888730ac417",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 85,
"avg_line_length": 36.56603773584906,
"alnum_prop": 0.6171310629514963,
"repo_name": "tobier/yace",
"id": "b9f5ddaa35b19622a16dbf1f219a89505809c6c8",
"size": "3049",
... |
class EmitterCallbacks(object):
def __init__(self, emitter):
self._emitter = emitter
def emitter(self, data):
self._emitter(data)
##############
### Runner ###
##############
'''
Called when task in playbook fails.
'''
def on_failed(self, host, res, ignore_errors=F... | {
"content_hash": "e020751bbc022d4b1fe7f28785411723",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 192,
"avg_line_length": 27.271604938271604,
"alnum_prop": 0.5665459483929379,
"repo_name": "RoboPython/neontower",
"id": "abf9b4da79d6792c4dfd558e9528fae6b21d0132",
"size"... |
"""mysql_float_to_timestamp
Revision ID: 5c4f93e5bb4
Revises: 7e6f9d542f8b
Create Date: 2016-07-25 15:36:36.469847
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import func
from gnocchi.indexer import sqlalchemy_base
# revision identifiers, used by Alembic.
revision = '5c4f93e5bb4'
down_re... | {
"content_hash": "b1d7b6e552dcc4e1f58a67379015f5a9",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 79,
"avg_line_length": 38.983333333333334,
"alnum_prop": 0.5027789653698161,
"repo_name": "leandroreox/gnocchi",
"id": "824a3e93a516353247a20b3526bca89a245dd05a",
"size": "... |
import abc
import weakref
from datetime import datetime
class TaskDetail(object):
"""Task details have the bare minimum of these fields/methods."""
def __init__(self, name, metadata=None):
self.date_created = datetime.utcnow()
self.name = name
self.metadata = metadata
self.da... | {
"content_hash": "b2943683589715d7d20fa77a2d89a751",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 79,
"avg_line_length": 30.86842105263158,
"alnum_prop": 0.6288718385905087,
"repo_name": "JohnGarbutt/taskflow-1",
"id": "943896e8ff981d630945466b92101711cf267a28",
"size"... |
from django.db import models
class Pais(models.Model):
nome = models.CharField(max_length=100, unique=True)
sigla = models.CharField(max_length=2, unique=True)
class Meta:
verbose_name = 'País'
verbose_name_plural = 'Países'
def __unicode__(self):
return '%s' % self.sigla
cl... | {
"content_hash": "d7ddcefed0a36ecf6ffd3970b6df223a",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 105,
"avg_line_length": 27.895833333333332,
"alnum_prop": 0.6445108289768484,
"repo_name": "pydawan/protetores_bucais",
"id": "54133cb6e0f89ab41fa1acd4c4be5ef14025c026",
"s... |
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
__version__ = (0, 0, 1)
try:
conf = settings.PAUTH
except AttributeError:
raise ImproperlyConfigured("django-pauth requires configuration.")
prefer = conf.get('check_first... | {
"content_hash": "9a34d808fd91543b54cbabe2ef494478",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 109,
"avg_line_length": 30.85185185185185,
"alnum_prop": 0.6686674669867947,
"repo_name": "spuriousdata/django-pauth",
"id": "b1a4ba945c66713d8a1dcd88f66a541f3ed1ced8",
"si... |
from tempest.api.volume import base
from tempest import config
from tempest.openstack.common import log as logging
from tempest import test
CONF = config.CONF
LOG = logging.getLogger(__name__)
class ExtensionsV2TestJSON(base.BaseVolumeTest):
@test.attr(type='gate')
def test_list_extensions(self):
... | {
"content_hash": "04b7d1c2e4ce0f5a249a69765f26868a",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 79,
"avg_line_length": 31.75,
"alnum_prop": 0.684251968503937,
"repo_name": "queria/my-tempest",
"id": "4fc6ee40f4b77df96148a6eda9d4cead9c1acd99",
"size": "1896",
"binary... |
from compose.config.errors import DependencyError
from compose.config.sort_services import sort_service_dicts
from compose.config.types import VolumeFromSpec
from tests import unittest
class SortServiceTest(unittest.TestCase):
def test_sort_service_dicts_1(self):
services = [
{
... | {
"content_hash": "3a5e8010170992ef1257923b516f4d81",
"timestamp": "",
"source": "github",
"line_count": 239,
"max_line_length": 67,
"avg_line_length": 29.13389121338912,
"alnum_prop": 0.4486571879936809,
"repo_name": "TomasTomecek/compose",
"id": "8d0c3ae4080c101b3ffa0760598a96f9e82adfd0",
"size": ... |
from astropy.version import version as astropy_version
if astropy_version < '3.0':
# With older versions of Astropy, we actually need to import the pytest
# plugins themselves in order to make them discoverable by pytest.
from astropy.tests.pytest_plugins import *
else:
# As of Astropy 3.0, the pytest p... | {
"content_hash": "8d21bc59dcde5a1e87739a6d257f970f",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 84,
"avg_line_length": 44.629629629629626,
"alnum_prop": 0.7331950207468879,
"repo_name": "crawfordsm/pyspectrograph",
"id": "ebab8a1b9be21080a438a2636dab4e9f4462939b",
"si... |
import os
from django.db import models
from django.db.models import Q
from django.contrib.contenttypes.fields import GenericRelation
from django.core.exceptions import PermissionDenied
# from geoposition.fields import GeopositionField
from core.models import PlCoreBase,PlCoreBaseManager,PlCoreBaseDeletionManager,ModelL... | {
"content_hash": "c24bf6daf930f665350fcb3e20ab8d56",
"timestamp": "",
"source": "github",
"line_count": 342,
"max_line_length": 191,
"avg_line_length": 42.26900584795322,
"alnum_prop": 0.6812396236856668,
"repo_name": "zdw/xos",
"id": "069fec99450692c431e66fc38b50d952712af622",
"size": "14456",
"... |
from storlets.sbus.client.client import SBusClient, SBusResponse
__all__ = [
'SBusClient',
'SBusResponse'
]
| {
"content_hash": "52ad759bb0d3929e7271203484dd7995",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 64,
"avg_line_length": 19.5,
"alnum_prop": 0.6923076923076923,
"repo_name": "openstack/storlets",
"id": "adf9e742043d942b1fc2293926279b09f3d71ecd",
"size": "707",
"binary"... |
"""Model module for MinDiff Keras integration.
This Module provides the implementation of a MinDiffModel, a Model that
delegates its call method to another Model and adds a `min_diff_loss`
during training and optionally during evaluation.
"""
import inspect
import dill
import tensorflow as tf
from tensorflow_model_r... | {
"content_hash": "c6993d1828a2fc3d0443ddcb3e147e81",
"timestamp": "",
"source": "github",
"line_count": 850,
"max_line_length": 84,
"avg_line_length": 39.35764705882353,
"alnum_prop": 0.679589884617684,
"repo_name": "tensorflow/model-remediation",
"id": "92a0a78d488a0273a10ba357e1986ac313742625",
"... |
from declined_transaction_exception import DeclinedTransactionException
class DeclinedRefundException(DeclinedTransactionException):
"""
Represents an error response from a refund call.
"""
def __init__(self, status_code, response_body, errors):
if errors is not None:
super(Declin... | {
"content_hash": "60ddc5598b388740af36ab68f9a67908",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 99,
"avg_line_length": 42,
"alnum_prop": 0.454004329004329,
"repo_name": "Ingenico-ePayments/connect-sdk-python2",
"id": "b7fda5ad33534baa4a9aa928e6caa82d445ed843",
"size":... |
import re
import sys
import unicodedata
import StringIO
# An unsafe character is one outside the range that everybody can handle; we
# escape them in groups so that when we escape them legitimate surrogate pairs
# get represented as \Uxxxxyyyy escapes.
_UNSAFE_CHARACTERS = re.compile(u"[^\u0001-\ud7ff\ue000-\ufdcf\ufd... | {
"content_hash": "5c4ce613b210f0f7c95d8668fb8a6b4f",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 109,
"avg_line_length": 33.74045801526717,
"alnum_prop": 0.5938914027149321,
"repo_name": "alexey4petrov/reinteract",
"id": "4dff6987ddcf3c62ee0fb787617568d5f46c79dc",
"si... |
from twisted.plugin import IPlugin
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implementer
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
@implementer(IPlugin, IModuleData, IMode)
class SecretMode(ModuleData... | {
"content_hash": "980f9f7feb461487c0ace27ac27d63c4",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 172,
"avg_line_length": 42.48837209302326,
"alnum_prop": 0.7197591680350302,
"repo_name": "Heufneutje/txircd",
"id": "79fa44c4b65be49d84a7e34269406b86fa459d5a",
"size": "18... |
from __future__ import absolute_import
import threading
import sys
def merge_dicts(*dicts):
out = {}
for d in dicts:
if not d:
continue
for k, v in iteritems(d):
out[k] = v
return out
class memoize(object):
"""
Memoize the result of a property call.
... | {
"content_hash": "d67598b66cb4e21a9a24ec3231ae8d45",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 54,
"avg_line_length": 20.453125,
"alnum_prop": 0.5019098548510313,
"repo_name": "harkishan81001/py-instrumenting",
"id": "8b43c3b82b48ba99395920c63418f1342ac857a3",
"size"... |
"""
Django settings for project_template project.
Generated by 'django-admin startproject' using Django 1.9.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
impor... | {
"content_hash": "462ad6a5473fdf5cb67799bea81c401b",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 78,
"avg_line_length": 26.68807339449541,
"alnum_prop": 0.6789274664833276,
"repo_name": "CorrosiveKid/django_project_template",
"id": "827495b76861ccfd9e88f18a4f7b6ef72cf17... |
import os
import multiprocessing
from setuptools import setup, find_packages
with open(
os.path.join(
os.path.dirname(__file__),
'requirements.txt'
)
) as f:
required = f.read().splitlines()
setup(
name='twoline-utils',
version='0.1',
url='http://github.com/latestrevision/twol... | {
"content_hash": "3807eb8fd5755bfdae7b5561e52a32a0",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 70,
"avg_line_length": 25.82857142857143,
"alnum_prop": 0.625,
"repo_name": "coddingtonbear/twoline-utils",
"id": "0162584a601a3a20dfe056ec08970378cf5bc7dd",
"size": "904",... |
import unittest
import os
import time
from lib.util.mysqlBaseTestCase import mysqlBaseTestCase
server_requirements = [[],[],[]]
server_requests = {'join_cluster':[(0,1), (0,2)]}
servers = []
server_manager = None
test_executor = None
class basicTest(mysqlBaseTestCase):
def test_basic1(self):
self.server... | {
"content_hash": "4d79a29a57c728766d63482c2d57ceb0",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 98,
"avg_line_length": 38.05714285714286,
"alnum_prop": 0.5998498498498499,
"repo_name": "jonzobrist/Percona-Server-5.1",
"id": "6531f27d64b8347d49e9d93ac31a907e6f9bbc95",
... |
def read_part_of_speech_file(filename):
'''Read a part-of-speech file and return a list of (pos, word) pairs.'''
with open(filename) as pos_file:
return [line.split() for line in pos_file]
def get_predictions(test_filename, predict_sentence):
'''Given an HMM, compute predictions for each word in the test da... | {
"content_hash": "8c23c44702404b7488d283331613e262",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 74,
"avg_line_length": 36,
"alnum_prop": 0.6309523809523809,
"repo_name": "Unknowncmbk/HiddenMarkovModel",
"id": "000cd1482645a3fe2247f6b7b722af3e36154e1e",
"size": "890",
... |
""" Tests for the Deep explainer.
"""
from urllib.error import HTTPError
from packaging import version
import numpy as np
import pandas as pd
import pytest
import shap
from shap import DeepExplainer
#os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
# pylint: disable=import-outside-toplevel, no-name-in-module, import-error
... | {
"content_hash": "7e1022a8f436fb84b46805247f0285af",
"timestamp": "",
"source": "github",
"line_count": 604,
"max_line_length": 124,
"avg_line_length": 37.28145695364238,
"alnum_prop": 0.5724753530508926,
"repo_name": "slundberg/shap",
"id": "f5bae4b085caad511fcc9f397fa3d2c8a2386ec0",
"size": "2251... |
from flask_wtf import FlaskForm
from json import loads
from wtforms import StringField, IntegerField, DateTimeField, SelectField
from wtforms.validators import DataRequired, Length, EqualTo
from project.server import db
from project.server.models import Track
class NewScheduleForm(FlaskForm):
name = StringField(
... | {
"content_hash": "895de26a424865a8b7f8c0998dc1e385",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 73,
"avg_line_length": 24.774193548387096,
"alnum_prop": 0.5924479166666666,
"repo_name": "runozo/palinsesto-fire",
"id": "32ea4f1dd1115a0e9861d329c7eb6410fba194d2",
"size"... |
"""
Generic traversal of a tree-structured type
"""
class Traversal(object):
def visit_list(self, xs):
return [self.visit(x) for x in xs]
def visit_tuple(self, xs):
return tuple(self.visit_list(xs))
def visit_generic(self, x):
assert False, \
"Unsupported %s : %s" % (x, x.__class__.__name... | {
"content_hash": "457576114a767ab4f7c1a891345e54ef",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 55,
"avg_line_length": 23.125,
"alnum_prop": 0.5891891891891892,
"repo_name": "iskandr/dsltools",
"id": "4f12bc3c7b81e2c659960552c6093e5dcd04c251",
"size": "555",
"binary... |
import pytest
from tests.common.test_vector import ImpalaTestDimension
from tests.common.impala_test_suite import ImpalaTestSuite
MT_DOP_VALUES = [0, 1, 2, 8]
class TestParquetStats(ImpalaTestSuite):
"""
This suite tests runtime optimizations based on Parquet statistics.
"""
@classmethod
def get_workload(... | {
"content_hash": "40a078608b1f4ae78afbed394e4ad928",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 86,
"avg_line_length": 36.607142857142854,
"alnum_prop": 0.7375609756097561,
"repo_name": "michaelhkw/incubator-impala",
"id": "9b9d6d77e6ffcd194230105001650147844cdec4",
"... |
import unittest
import os
import sys
import commands
import comm
class TestSampleAppFunctions(unittest.TestCase):
def test_launch(self):
comm.setUp()
app_name = "Helloworld"
cmd = "adb -s " + comm.device + " shell am start -n org.xwalk.%s/.%sActivity" % \
(app_name.lower(), ap... | {
"content_hash": "f6d61a5e9a7e7b34d7400aea412d6c06",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 89,
"avg_line_length": 22.833333333333332,
"alnum_prop": 0.6082725060827251,
"repo_name": "XiaosongWei/crosswalk-test-suite",
"id": "fd60f3a11f309f04ec62701c49246e6ce57f6396"... |
"""Nova common internal object model"""
import collections
import contextlib
import copy
import datetime
import functools
import traceback
import netaddr
from oslo_log import log as logging
import oslo_messaging as messaging
from oslo_utils import timeutils
from oslo_versionedobjects import base as ovoo_base
import s... | {
"content_hash": "8a276422c542186ca89e509247591b4a",
"timestamp": "",
"source": "github",
"line_count": 818,
"max_line_length": 79,
"avg_line_length": 41.12347188264059,
"alnum_prop": 0.5994530158447041,
"repo_name": "bgxavier/nova",
"id": "8018ec5b9a1c33c4a23f5e6d6d7f99ab29886676",
"size": "34244"... |
from django.utils import timezone
from haystack.indexes import SearchIndex, CharField, DateTimeField, Indexable
from .models import Channel
class ChannelIndex(SearchIndex, Indexable):
text = CharField(document=True, use_template=True)
date_available = DateTimeField(model_attr='date_available')
date_updat... | {
"content_hash": "e3a865a9db4e9b344915247373dfa77b",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 77,
"avg_line_length": 30.19047619047619,
"alnum_prop": 0.7050473186119873,
"repo_name": "williamroot/opps",
"id": "71e476766cca002258bca5413d9e1c8e46729b9d",
"size": "680"... |
"""Script to parse CNV files
"""
from bigquery_etl.utils import gcutils
from bigquery_etl.extract.gcloud_wrapper import GcsConnector
from bigquery_etl.utils.logging_manager import configure_logging
def parse_cnv(project_id, bucket_name, filename, outfilename, metadata):
"""Download and convert blob into dataframe
... | {
"content_hash": "e85c3847713720344d081a0854ee7a29",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 145,
"avg_line_length": 44.317460317460316,
"alnum_prop": 0.666189111747851,
"repo_name": "isb-cgc/ISB-CGC-data-proc",
"id": "da114a031a712813cb67514475eeee1204316312",
"si... |
import logging
import lldb
log = logging.getLogger('disassembly')
MAX_INSTR_BYTES = 8 # Max number of instruction bytes to show.
NO_SYMBOL_INSTRUCTIONS = 32 # How many instructions to show when there isn't a symbol associated
# with the PC location.
# bisect_left with get_key
def lower_bo... | {
"content_hash": "73bf390724f547c5e03fa37c9784d859",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 109,
"avg_line_length": 39.559322033898304,
"alnum_prop": 0.5974721508140531,
"repo_name": "NeroProtagonist/vscode-lldb",
"id": "cddb57a3e73db5a8b1013417f15790b4fe306ee1",
... |
import pytest
from paleomix.common.layout import Layout, LayoutError
def test_layout__minimal():
layout = Layout({})
assert layout.kwargs == {}
assert list(layout) == []
def test_layout__simple_layout():
layout = Layout({"{root}": "my_file"}, root="/root")
assert layout.kwargs == {"root": "/r... | {
"content_hash": "fc1c4d29620854b7f027e4a351e0f9e7",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 81,
"avg_line_length": 29.46043165467626,
"alnum_prop": 0.5914529914529915,
"repo_name": "MikkelSchubert/paleomix",
"id": "a832b73e95d92ccf8914ae0c87ed09523e0132ac",
"size... |
"""
filterAnnotatedSV
~~~~~~~~~~~~~~~~~
:Description: This module will filter calls from the merged file
"""
'''
Created on Mar 17, 2015
Description: This module will filter calls from the merged file
@author: Ronak H Shah
::Inputs::
inputTxt: Filter Text File
outputDir: Output directory
outPrefix: Prefix of the out... | {
"content_hash": "759a2679ba78709beadc499b37a50dea",
"timestamp": "",
"source": "github",
"line_count": 183,
"max_line_length": 177,
"avg_line_length": 35.33879781420765,
"alnum_prop": 0.6349157259935055,
"repo_name": "rhshah/iCallSV",
"id": "dd8e4b083e72e7f1567464709762e26080e41eef",
"size": "6467... |
"""
Wavefront REST API Documentation
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST API... | {
"content_hash": "680117b47b8cc8672fe7419d1f030297",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 409,
"avg_line_length": 38.28947368421053,
"alnum_prop": 0.7498281786941581,
"repo_name": "wavefrontHQ/python-client",
"id": "c76f269ce1ef9749fe3313c8e5fc114bf759d045",
"si... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.