text stringlengths 4 1.02M | meta dict |
|---|---|
import time
import uuid
import sublime_plugin
TOUCH_EVENT_TIME = None
TOUCH_EVENT_HANDLERS = {}
TOUCH_EVENT_HANDLERS_ASYNC = {}
def add_event_handler(view, region, handler=None, handler_id=None, HANDLERS=TOUCH_EVENT_HANDLERS):
if handler_id is None:
handler_id = uuid.uuid4()
HANDLERS.setdefault(vie... | {
"content_hash": "7e82d7bb4a541fbaf3f75bf7f99b0331",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 99,
"avg_line_length": 31.602272727272727,
"alnum_prop": 0.678173318950018,
"repo_name": "sligodave/sublime_games",
"id": "ba13f2c4ab6acd888f3b1c434161840bc00c27ac",
"size"... |
import vcr
class MockSerializer(object):
def __init__(self):
self.serialize_count = 0
self.deserialize_count = 0
self.load_args = None
def deserialize(self, cassette_string):
self.serialize_count += 1
self.cassette_string = cassette_string
return {'interactions... | {
"content_hash": "399d52d488bd249050533fb05487d788",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 79,
"avg_line_length": 29.393939393939394,
"alnum_prop": 0.6288659793814433,
"repo_name": "poussik/vcrpy",
"id": "734f301ee2c56237ce7d3cad4d72316f1ca9b9a5",
"size": "970",
... |
import sys, struct
from test import support
from test.support import import_fresh_module
import types
import unittest
cET = import_fresh_module('xml.etree.ElementTree',
fresh=['_elementtree'])
cET_alias = import_fresh_module('xml.etree.cElementTree',
fresh=['_e... | {
"content_hash": "62c76a6db23859e50aa8d0c54e0e4582",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 76,
"avg_line_length": 32.36296296296296,
"alnum_prop": 0.6280613412680247,
"repo_name": "batermj/algorithm-challenger",
"id": "bfced1225e0faeccde684ea1f85725b6e5ad9506",
... |
from __future__ import unicode_literals
from django.apps import AppConfig
class ConstructionConfig(AppConfig):
name = 'construction'
| {
"content_hash": "ef4d5f91b2e363ae94195099081c0980",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 39,
"avg_line_length": 20,
"alnum_prop": 0.7714285714285715,
"repo_name": "j-windsor/thebeau",
"id": "1523c1d20ea895deb2816dd34edc063df4413e45",
"size": "140",
"binary": f... |
from fjord.base.tests import TestCase
from fjord.search.models import Record
from fjord.search.tests import RecordFactory
class TestRecord(TestCase):
def test_mark(self):
"""Test marking as fail/success."""
r = RecordFactory()
assert Record.objects.filter(status=Record.STATUS_NEW).count()... | {
"content_hash": "644450e6679be6a241f9beb782802945",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 79,
"avg_line_length": 43.78260869565217,
"alnum_prop": 0.6852035749751738,
"repo_name": "hoosteeno/fjord",
"id": "e3749bdddd3ddc07393e0f914e8366d6253fede5",
"size": "1007"... |
from django import forms
from usuarios.models import Usuario
from corporaciones.models import Corporacion
from votantes.models import Votante
"""
Este formulario se encuentran los datos para registrar el votante
"""
class FormularioRegistroVotante(forms.Form):
cedula_usuario = forms.IntegerField(
widget=f... | {
"content_hash": "ea76e8c93535749f6ff55d68fa01c9a1",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 169,
"avg_line_length": 48.80952380952381,
"alnum_prop": 0.7079674796747968,
"repo_name": "Jorgesolis1989/SIVORE",
"id": "25387407a8bbc6a1ba393be78e61c825f4dafc24",
"size":... |
import urllib2
from xml.dom import minidom
import xml.etree.ElementTree as ET
from cinder.volume.drivers.violin.vxg.core.error import *
class XGRequest(object):
"""Request to XML gateway."""
def __init__(self, type="query", nodes=[], action=None, event=None,
flat=False, values_only=False):
... | {
"content_hash": "b686eaf9dff271b6682f57f3de5880f9",
"timestamp": "",
"source": "github",
"line_count": 238,
"max_line_length": 76,
"avg_line_length": 28.113445378151262,
"alnum_prop": 0.566432521297265,
"repo_name": "rlucio/cinder-violin-driver-icehouse",
"id": "6080bf34b385988b5b01e9ed20ba3d49a707e... |
"""Defines the public namespace for SQL expression constructs.
Prior to version 0.9, this module contained all of "elements", "dml",
"default_comparator" and "selectable". The module was broken up
and most "factory" functions were moved to be grouped with their associated
class.
"""
__all__ = [
'Alias', 'Any',... | {
"content_hash": "e3ad3f5302a2ebb667ee35bc545ee287",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 80,
"avg_line_length": 44.21052631578947,
"alnum_prop": 0.7409863945578231,
"repo_name": "davidjb/sqlalchemy",
"id": "79d25a39ebafc6be39288d6ab1e89d9672d74769",
"size": "6... |
'''
Control Apache Traffic Server
=============================
.. versionadded:: 2015.8.0
'''
def __virtual__():
'''
Only load if the Traffic Server module is available in __salt__
'''
return 'trafficserver' if 'trafficserver.set_var' in __salt__ else False
def bounce_cluster(name):
'''
Bo... | {
"content_hash": "ecbe86d601def0a71b1785e86b98d556",
"timestamp": "",
"source": "github",
"line_count": 392,
"max_line_length": 79,
"avg_line_length": 23.9515306122449,
"alnum_prop": 0.5659814676749387,
"repo_name": "stephane-martin/salt-debian-packaging",
"id": "9588dda0038ae8a53fb3c559ecd76a8c9d6e0... |
from google.maps.routing import gapic_version as package_version
__version__ = package_version.__version__
from google.maps.routing_v2.services.routes.async_client import RoutesAsyncClient
from google.maps.routing_v2.services.routes.client import RoutesClient
from google.maps.routing_v2.types.fallback_info import (
... | {
"content_hash": "fbfdf901b866d207ed35fe547dc84070",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 85,
"avg_line_length": 31.511627906976745,
"alnum_prop": 0.7627306273062731,
"repo_name": "googleapis/google-cloud-python",
"id": "3525247e0abdcf1fe285887904a69ec06d1c2400",
... |
"""Plugin for TV4 Play, swedish TV channel TV4's streaming service."""
import re
from streamlink.compat import urlparse
from streamlink.plugin import Plugin
from streamlink.plugin.api import http, validate
from streamlink.stream import HDSStream, RTMPStream
ASSET_URL = "http://prima.tv4play.se/api/web/asset/{0}/play... | {
"content_hash": "a94fd930ca47d20d9c29039b9ebd5a3d",
"timestamp": "",
"source": "github",
"line_count": 73,
"max_line_length": 78,
"avg_line_length": 27.835616438356166,
"alnum_prop": 0.5285433070866141,
"repo_name": "mmetak/streamlink",
"id": "c6bed2f5eda9602141799c161df0304c5f44cc34",
"size": "20... |
"""Class to run the redmapper randoms
"""
| {
"content_hash": "3c2ff468e04b7829274b6c46232f2c63",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 37,
"avg_line_length": 14.333333333333334,
"alnum_prop": 0.6744186046511628,
"repo_name": "erykoff/redmapper",
"id": "f81aa4843052037e47fc87f07ee9aee0bda582e8",
"size": "43"... |
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.6.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class V1Probe(o... | {
"content_hash": "2986ec58fedf1e7953b2bba803a3a5c9",
"timestamp": "",
"source": "github",
"line_count": 294,
"max_line_length": 186,
"avg_line_length": 32.40816326530612,
"alnum_prop": 0.5990764063811923,
"repo_name": "skuda/client-python",
"id": "74a4748eba9c3fa946305d5506ccb14b1079a3a7",
"size": ... |
import sys
import asyncio
import random
from telepot import glance
import telepot.aio
import telepot.aio.helper
from telepot.namedtuple import InlineKeyboardMarkup, InlineKeyboardButton
from telepot.aio.delegate import (
per_chat_id, per_callback_query_origin, create_open, pave_event_space)
"""
$ python3.5 quiza.p... | {
"content_hash": "4dfc275c29a32cfffa9684bf30dadf94",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 105,
"avg_line_length": 33.831460674157306,
"alnum_prop": 0.603786117568914,
"repo_name": "mpunkenhofer/irc-telegram-bot",
"id": "0c55492efba333aa55c23e3e91a33b1f938bf475",
... |
from .base import Config
from django.utils.functional import SimpleLazyObject
__version__ = '1.0'
try:
from django.apps import AppConfig # noqa
except ImportError:
config = SimpleLazyObject(Config)
else:
default_app_config = 'constance.apps.ConstanceConfig'
| {
"content_hash": "77b62c631eeac45f80c71192b064eb26",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 57,
"avg_line_length": 22.833333333333332,
"alnum_prop": 0.7481751824817519,
"repo_name": "metalpriest/django-constance",
"id": "3c35abb7806319fd1088faad4ddb7853cc531158",
... |
import product
import website
import sale_order
| {
"content_hash": "570ddacf9ab1b72ae5b17c52cbba9763",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 17,
"avg_line_length": 16,
"alnum_prop": 0.8541666666666666,
"repo_name": "vileopratama/vitech",
"id": "ed23b1cd13311c1f9672b3dcf05aa31704127960",
"size": "48",
"binary": ... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Message'
db.create_table('swtopics_message', (
('id', self.gf('django.db.models.fields.AutoField... | {
"content_hash": "1ae739c775c06ca8a23efc0164a76c41",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 85,
"avg_line_length": 28,
"alnum_prop": 0.5714285714285714,
"repo_name": "snswa/swsites",
"id": "e90667c3496329c21eb0e29af1211ef26d48e8ce",
"size": "914",
"binary": fals... |
import unittest
from rfdevices.protocol import BasebandValue, Protocol, PulseOrder
class TestProtocol(unittest.TestCase):
@staticmethod
def get_test_protocol(repeat: int=None):
kwargs = {}
if repeat is not None:
kwargs['repeat'] = repeat
return Protocol(pulse_length=1,
... | {
"content_hash": "e49f558162e4d2147768d7cb7e19029b",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 67,
"avg_line_length": 36.06666666666667,
"alnum_prop": 0.618607516943931,
"repo_name": "milas/rfdevices",
"id": "e6d7db0061dc708bedd657a59ed45152603a8687",
"size": "1623",... |
"""Stores all of the different word classes
The base Word class is inherited by all of the other classes. It contains
the logic to store the string of the word in particular, as well of the index
of where that word appeared in the user's command.
Any instance of any of these classes can be referred to as a word obje... | {
"content_hash": "ee7b56af7e22836003609aedd23731d7",
"timestamp": "",
"source": "github",
"line_count": 79,
"max_line_length": 83,
"avg_line_length": 28.50632911392405,
"alnum_prop": 0.5404085257548845,
"repo_name": "huntermalm/SevenStories",
"id": "d80ef13ee70fecfff6531fc940503de63a3715ac",
"size"... |
from . import bestfriend | {
"content_hash": "7acadce410ba7ca498f4a7bcb71b1738",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 24,
"avg_line_length": 24,
"alnum_prop": 0.8333333333333334,
"repo_name": "budihartono/odoo_addons",
"id": "2f179d76d303ee3bf0ac1820f935c56c7b39b74b",
"size": "24",
"binar... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('todo', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='item',
name='created_date',
field=mo... | {
"content_hash": "12201737a7caa2eb8b3d13ba3348bcf3",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 50,
"avg_line_length": 22.565217391304348,
"alnum_prop": 0.558766859344894,
"repo_name": "carlosedb/django-todo",
"id": "a346e88d4b7b31cfd4f32f55ac42e849b2608ee3",
"size": ... |
from django.db import models
from django.contrib.auth.models import User
class AccountHead(models.Model):
HEAD_TYPES = (
("ast", 'asset'),
("lib", 'liability'),
("oe", 'owners equity'),
("exp", 'expense'),
("inc", 'income'),
)
user = models.ForeignKey(User, on_dele... | {
"content_hash": "21cfde2423e8941d972e91a11f6dad64",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 103,
"avg_line_length": 31.871794871794872,
"alnum_prop": 0.6427996781979083,
"repo_name": "pyprism/MoneyBag",
"id": "0e604ba5c504704d2642042710a1b2176b1ed331",
"size": "24... |
"""
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2010 Nathanael C. Fritz
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
from sleekxmpp.xmlstream import ElementBase, ET
class Error(ElementBase):
"""
XMPP stanzas of type 'error' should include an <error> ... | {
"content_hash": "3cefd5c143b32f9cda15d73188d952e9",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 78,
"avg_line_length": 35.672413793103445,
"alnum_prop": 0.5798292250684711,
"repo_name": "isandlaTech/cohorte-devtools",
"id": "56558ba814a747b4c29622494e3ed6c884c6f556",
... |
"""The YAWT extension package.
This file contains utility classes in use by various extensions in YAWT
"""
import os
import jsonpickle
from flask import g, request
from yawt.utils import load_file, save_file, abs_state_folder, cfg,\
single_dict_var, ReprMixin, EqMixin, fullname, content_folder
class Plugin(obje... | {
"content_hash": "dd536002ff2c6c936f75d28fb2e47a7e",
"timestamp": "",
"source": "github",
"line_count": 214,
"max_line_length": 86,
"avg_line_length": 33.822429906542055,
"alnum_prop": 0.5991986736667587,
"repo_name": "drivet/yawt",
"id": "28b381040b3bbfde1ae430ee3cc92f584a84d96a",
"size": "7238",
... |
from __future__ import absolute_import
from .core import (
get_stations,
get_station_data,
get_station_parameters,
)
| {
"content_hash": "49ee70b9ce7aa005e618cf3cf45aa5a0",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 38,
"avg_line_length": 24.166666666666668,
"alnum_prop": 0.6137931034482759,
"repo_name": "ocefpaf/ulmo",
"id": "9f8c3fe76b4059939e72e989352be6d862cd2718",
"size": "145",
... |
import _plotly_utils.basevalidators
class LinecolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="linecolor", parent_name="layout.scene.yaxis", **kwargs
):
super(LinecolorValidator, self).__init__(
plotly_name=plotly_name,
paren... | {
"content_hash": "c80fdaf9572f717f0e45f1b665eac420",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 81,
"avg_line_length": 33.714285714285715,
"alnum_prop": 0.5995762711864406,
"repo_name": "plotly/python-api",
"id": "a08a2df324ad3f1dd3b4fbcb33e46bdc8a32e6b6",
"size": "47... |
import mock
from ironic.common import exception
from ironic.drivers import base as driver_base
from ironic.tests import base
class FakeVendorInterface(driver_base.VendorInterface):
def get_properties(self):
pass
@driver_base.passthru(['POST'])
def noexception(self):
return "Fake"
@d... | {
"content_hash": "549117f52a96f58b7106c0bb542a6d2e",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 60,
"avg_line_length": 28.153846153846153,
"alnum_prop": 0.671448087431694,
"repo_name": "Tehsmash/ironic",
"id": "1f4f35f139c907b889c9bfaceea5f2502d416ae2",
"size": "2099"... |
"""Pasta enables AST-based transformations on python source code."""
# Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENS... | {
"content_hash": "c303c45c46c7ca5dda933292d6eed16b",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 74,
"avg_line_length": 31.275862068965516,
"alnum_prop": 0.7574421168687983,
"repo_name": "google/pasta",
"id": "69ed8575d58c45892d71748deafefdaf4db8100c",
"size": "922",
... |
DEBUG = True
SECRET_KEY = 'super-secret-key'
SQLALCHEMY_DATABASE_URI = "postgresql://localhost/sup"
| {
"content_hash": "096c4764aa82492c85355f83c5eae6ed",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 54,
"avg_line_length": 25.25,
"alnum_prop": 0.7425742574257426,
"repo_name": "dfm/sup",
"id": "f28abd6d2739d23ddaeb0c4647ef2453a1871834",
"size": "126",
"binary": false,
... |
"""
Implementation of an OpenFlow flow table
"""
from libopenflow_01 import *
from pox.lib.revent import *
from pox.core import core
import time
import math
# FlowTable Entries:
# match - ofp_match (13-tuple)
# counters - hash from name -> count. May be stale
# actions - ordered list of ofp_action_*s to apply ... | {
"content_hash": "bf52da99d71bb6b45a2ff00eefb63719",
"timestamp": "",
"source": "github",
"line_count": 347,
"max_line_length": 79,
"avg_line_length": 33.69740634005764,
"alnum_prop": 0.6263576498759942,
"repo_name": "felipetomm/POX-Django",
"id": "4aff52dfb013d865678539377a03d26c662c312d",
"size":... |
import sys
import time
import logging
from datetime import timedelta, datetime
import elasticsearch
# This solves https://github.com/elasticsearch/curator/issues/12
try:
from logging import NullHandler
except ImportError:
from logging import Handler
class NullHandler(Handler):
def emit(self, reco... | {
"content_hash": "1e1e8193f1f23cb765b0d4a1be461951",
"timestamp": "",
"source": "github",
"line_count": 401,
"max_line_length": 240,
"avg_line_length": 50.0498753117207,
"alnum_prop": 0.6610861983059293,
"repo_name": "waja/elasticsearch-curator",
"id": "fdcf75819e4740ad16f34c84d83c866ba17c953d",
"s... |
def getPeaks(vs, ts, threshV=1):
"""This function loops through lists of Voltage and Time and returns one
array containing the voltage peaks, and one with their respective time
points.
:param vs: voltage data
:param ts: time data
:param threshV: threshold value for peak detection
:return: P... | {
"content_hash": "53814d29c58b33cbe4b075f78ea05d90",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 77,
"avg_line_length": 32.47142857142857,
"alnum_prop": 0.5714914210294765,
"repo_name": "qidizhai/bme590hrm",
"id": "a7eb99cb4ddd2c5db8a445cde4eb6aab15d9dce9",
"size": "22... |
import discord
from discord.ext import commands
from cogs.utils.checks import embed_perms, cmd_prefix_len
'''Module for the info command.'''
class Userinfo:
def __init__(self, bot):
self.bot = bot
@commands.group(invoke_without_command=True, aliases=['user', 'uinfo', 'info', 'ui'])
async def us... | {
"content_hash": "07196a69c2a718562fd6535cbaf2275e",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 361,
"avg_line_length": 45.53061224489796,
"alnum_prop": 0.5186015239802779,
"repo_name": "appu1232/Selfbot-for-Discord",
"id": "7e5c6362b1e83b1935fd476cb4b3181547ac1845",
... |
import itertools
import jmespath
from c7n.exceptions import PolicyExecutionError, PolicyValidationError
from c7n import utils
from .core import Action
class ModifyVpcSecurityGroupsAction(Action):
"""Common action for modifying security groups on a vpc attached resources.
Security groups for add or remove c... | {
"content_hash": "f70c5af3d1010226a8ce8f8ae95e5b7e",
"timestamp": "",
"source": "github",
"line_count": 227,
"max_line_length": 89,
"avg_line_length": 38.91189427312775,
"alnum_prop": 0.5651534020151704,
"repo_name": "thisisshi/cloud-custodian",
"id": "815b34baf6b73dc1cda8a352a053802507d6e307",
"si... |
from django.db import models
from cms.models.fields import PlaceholderField
from managers import ChunkManager
class Chunk(models.Model):
name = models.CharField(max_length=200)
tags = models.CharField(max_length=200)
code = PlaceholderField('chunk_placeholder', related_name="chunks")
priority = models... | {
"content_hash": "03725f6fc3c26df07460c4d9393814c6",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 71,
"avg_line_length": 29.476190476190474,
"alnum_prop": 0.6833602584814217,
"repo_name": "devartis/django-cms-chunks",
"id": "73f59d8cb6c1344528ad843a681f5db7e0807a6b",
"s... |
import pymysql.cursors
from fixture.orm import ORMFixture
#
# connection = pymysql.connect(host="127.0.0.1", database="addressbook", user="root", password="")
#
# try:
# cursor = connection.cursor()
# cursor.execute("select * from group_list")
# for row in cursor.fetchall():
# print(row)
# finally:
... | {
"content_hash": "9d7ab0bd41805df20b8769bb41b8c304",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 98,
"avg_line_length": 24.17391304347826,
"alnum_prop": 0.6276978417266187,
"repo_name": "zr4x/pythonTests",
"id": "3adb01c644f9cf80c5bd8e0259bff1098197851c",
"size": "556"... |
# Copyright 2017 Tate M. Walker
# 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 agree... | {
"content_hash": "392ee673913e329b071c61082e27a9a5",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 259,
"avg_line_length": 31.61392405063291,
"alnum_prop": 0.6592592592592592,
"repo_name": "TateWalker/Galactic-Data",
"id": "b33851b66368a65a9163d8fa8632d6f35fd9bc5c",
"si... |
import pathlib
import setuptools
import ghb
here = pathlib.Path(__file__).parent.resolve()
long_description = (here / "README.md").read_text(encoding="utf-8")
setuptools.setup(
name="ghb",
version=ghb.__version__,
description="A collection of useful GitHub commands",
long_description=long_descriptio... | {
"content_hash": "5fd1229925d812f65747ca06ed590947",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 67,
"avg_line_length": 27.304347826086957,
"alnum_prop": 0.6624203821656051,
"repo_name": "keith/ghb",
"id": "0003d46aca28bf0060ff15755821612d8f1a6d77",
"size": "628",
"b... |
from setup import tc, rm, get_sandbox_path
def test_load_csv_with_missing_values_infer_schema(tc):
# Load frame with missing values, inferring the schema
path = "../datasets/missing_values.csv"
frame = tc.frame.import_csv(path, header=False, infer_schema=True)
# Check row count
assert(5 == frame.c... | {
"content_hash": "9a7db533cde68d1e4878c37817704ec8",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 103,
"avg_line_length": 38.08641975308642,
"alnum_prop": 0.5507293354943273,
"repo_name": "dmsuehir/spark-tk",
"id": "ba73d27eec80d4cfa159b8cbb939cc8fe760bf44",
"size": "37... |
"""Quotas for instances, volumes, and floating ips."""
from nova import db
from nova import exception
from nova import flags
FLAGS = flags.FLAGS
flags.DEFINE_integer('quota_instances', 10,
'number of instances allowed per project')
flags.DEFINE_integer('quota_cores', 20,
'nu... | {
"content_hash": "b4e80cc9d47e9964b512e364bd204fc4",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 79,
"avg_line_length": 42.443708609271525,
"alnum_prop": 0.6275550007801529,
"repo_name": "salv-orlando/MyRepo",
"id": "771477747e0002ac3a4601318dceef9944b69248",
"size": ... |
import six
from six import text_type
import time
import warnings
from mwclient.util import parse_timestamp
import mwclient.listing
import mwclient.errors
class Page(object):
def __init__(self, site, name, info=None, extra_properties=None):
if type(name) is type(self):
return self.__dict__.upd... | {
"content_hash": "79e29b11ec26a63c7a0519c41b625726",
"timestamp": "",
"source": "github",
"line_count": 360,
"max_line_length": 152,
"avg_line_length": 40.78888888888889,
"alnum_prop": 0.5765459002996459,
"repo_name": "semplea/characters-meta",
"id": "ea54f3a80da1e00914c79bd6efbcfe6e14c3bde8",
"siz... |
import pytest
import mock
from android_build_system.run import pre_check
class TestPreCheck():
@mock.patch("android_build_system.pre_checks.env_check.CmdCheck.check",
new=mock.Mock(return_value=True))
@mock.patch("android_build_system.pre_checks.env_check.EnvCheck.check",
new... | {
"content_hash": "898d91dad9807bcb33e1a27bb55a540d",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 80,
"avg_line_length": 42.1,
"alnum_prop": 0.6603325415676959,
"repo_name": "letter113/android-build-system",
"id": "e8cdd44e93a55ee574ebe4b46e3e1a70dea83663",
"size": "126... |
"""ovirt-host-setup apache plugin."""
from otopi import util
from . import core
from . import misc
from . import selinux
from . import ssl
@util.export
def createPlugins(context):
core.Plugin(context=context)
misc.Plugin(context=context)
selinux.Plugin(context=context)
ssl.Plugin(context=context)
... | {
"content_hash": "3ad902829085ec1e172be45afcfac161",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 39,
"avg_line_length": 17.238095238095237,
"alnum_prop": 0.7320441988950276,
"repo_name": "eayun/ovirt-engine",
"id": "07f7d08d7ea7851fe53b77e207ab63030b1dd653",
"size": "9... |
from __future__ import unicode_literals
import os
import hiyapyco
import yaml
from cumulusci.core.config import BaseProjectConfig
from cumulusci.core.exceptions import NotInProject
from cumulusci.core.exceptions import ProjectConfigNotFound
class YamlProjectConfig(BaseProjectConfig):
config_filename = 'cumulusc... | {
"content_hash": "0c9ff60ce3af44d9e58708e5afb0bf1f",
"timestamp": "",
"source": "github",
"line_count": 86,
"max_line_length": 128,
"avg_line_length": 37.406976744186046,
"alnum_prop": 0.6216972334473112,
"repo_name": "e02d96ec16/CumulusCI",
"id": "d31e319457e9545302f8db4f2b4669bc03d9a18f",
"size":... |
import mock
import six
from heat.common import exception
from heat.common import template_format
from heat.engine.clients.os import cinder as c_plugin
from heat.engine.clients.os import keystone as k_plugin
from heat.engine import rsrc_defn
from heat.engine import stack as parser
from heat.engine import template
from ... | {
"content_hash": "b2f1a30cb5cd9e1e656da1d11e1ee870",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 79,
"avg_line_length": 38.705263157894734,
"alnum_prop": 0.608784335055752,
"repo_name": "noironetworks/heat",
"id": "62b3f9cbbb2cb7ee10e37d25c4e71ef05b83d1d5",
"size": "7... |
import os
def get_package_data():
paths_test = [os.path.join('data', '*.xml')]
return {'astroquery.svo_fps.tests': paths_test}
| {
"content_hash": "5d3a0bee1a9531a96777538a55e776a6",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 51,
"avg_line_length": 22.833333333333332,
"alnum_prop": 0.635036496350365,
"repo_name": "imbasimba/astroquery",
"id": "21968ea2a2c2e765cb1e1bdd6dbcaf128c40e623",
"size": "2... |
from .base import PageObject
class IndexPage(PageObject):
path = "/"
def is_browser_on_page(self):
return self.browser.title == \
"PyPI - the Python Package Index · Warehouse"
| {
"content_hash": "e0c57aeb76d3884825624568297fb089",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 57,
"avg_line_length": 20.8,
"alnum_prop": 0.625,
"repo_name": "alex/warehouse",
"id": "13a00ef6b7d4e525106bbf8f14254757b9997e1f",
"size": "750",
"binary": false,
"copi... |
from ...Deep.strings import StringCompiler
def strset(commands, data, node):
""" Компиляция built-in функции strset (задание символа строки) """
node.args.elements[2].compile_vm(commands, data)
commands.clean_type()
node.args.elements[1].compile_vm(commands, data)
commands.clean_type()
array_t... | {
"content_hash": "6f71d3d26bd5806b76d619c98087ecc0",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 71,
"avg_line_length": 37.916666666666664,
"alnum_prop": 0.7142857142857143,
"repo_name": "PetukhovVictor/compiler",
"id": "b9aa0eddcaa6677bbb531ae578ca961a0f585d1e",
"size... |
import webob
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova.api.openstack import xmlutil
from nova import db
from nova import exception
from nova.openstack.common.db import exception as db_exc
from nova.openstack.common.gettextutils import _
class ExtraSpecsTemplate(xmlutil.T... | {
"content_hash": "38aa50fe248591014de58dfe32b81a6d",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 79,
"avg_line_length": 39.48412698412698,
"alnum_prop": 0.6263316582914573,
"repo_name": "SUSE-Cloud/nova",
"id": "9ced7d037fca75be39f5fbf04d382c2f42135414",
"size": "5656... |
import os
import unittest
import shutil
from django.conf import settings
from django.utils.safestring import mark_safe
from django_webpack.exceptions import BundlingError
from django_react import ReactComponent, ReactBundle, render_component
from django_react.exceptions import (
RenderingError, PropSerializationErr... | {
"content_hash": "9121178053cb8ef21eaf709cef73b204",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 102,
"avg_line_length": 38.56944444444444,
"alnum_prop": 0.6863521786100109,
"repo_name": "fanscribed/django-react",
"id": "03b67d07fd0bb7f62ceac53796136715d96943c2",
"siz... |
import ConfigLoader
import ConfigParser
'''
Loads values from config file
'''
config_file_parser = ConfigParser.ConfigParser()
config_file_parser.readfp(open(r'' + ConfigLoader.CONFIG_FILE))
# ******************** BASIC SETTINGS ***************
CENTRAL_WALLET = config_file_parser.get('Basic', 'CENTRAL_WALLET')
COIND... | {
"content_hash": "cdd58868745878d9d03ed6f5321fb949",
"timestamp": "",
"source": "github",
"line_count": 210,
"max_line_length": 138,
"avg_line_length": 48.595238095238095,
"alnum_prop": 0.7038706516413523,
"repo_name": "tuaris/TidePool",
"id": "e366dcf6a23089411f6cf2a46d2f704750d87f6a",
"size": "10... |
from sqlalchemy import event as sqla_event
from flask.signals import Namespace
from .models import (
Organization,
Team,
User,
UserEmail,
UserEmailClaim,
UserPhone,
UserPhoneClaim,
)
lastuser_signals = Namespace()
model_user_new = lastuser_signals.signal('model-user-new')
model_user_edit... | {
"content_hash": "05188915f4ce8083362d0baea5b84ecc",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 81,
"avg_line_length": 32.721518987341774,
"alnum_prop": 0.7665377176015474,
"repo_name": "hasgeek/lastuser",
"id": "bf27dd153f5b224f51a5c5dd50622fee7631552c",
"size": "51... |
'''
@author: sheng
@contact: sinotradition@gmail.com
@copyright: License according to the project license.
'''
NAME='wushen41'
SPELL='wùshēn'
CN='戊申'
SEQ='45'
if __name__=='__main__':
pass
| {
"content_hash": "edafec2362f5a5533f1f4537fe1c84fe",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 53,
"avg_line_length": 14.76923076923077,
"alnum_prop": 0.671875,
"repo_name": "sinotradition/sinoera",
"id": "777ceda8e8d960f73b3c8aeadd6bb26d1c299772",
"size": "231",
"... |
from glob import glob
from PIL import Image
from os import rename
import sqlite3 as db
con = db.connect('wolfe.db')
# Create the media table if it does not exist.
con.execute("""CREATE TABLE IF NOT EXISTS "media" (
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
`tg_id` TEXT,
`path` INTEGER NOT NULL UNIQUE,
`fil... | {
"content_hash": "33ba00f47acfec2c8580b3ae5c6f3553",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 109,
"avg_line_length": 23.137254901960784,
"alnum_prop": 0.6610169491525424,
"repo_name": "TNTINC/WolfeBot",
"id": "b25e23f0d7301caecd6b238b037243954e8c31f4",
"size": "118... |
import cPickle as pickle
from smart import *
import sys, os
import copy
import re
NOTHING = object()
class SysConfig(object):
"""System configuration class.
It has three different kinds of opition maps, regarding the
persistence and priority that maps are queried.
hard - Options are persistent.
... | {
"content_hash": "d2628867d87857a161c5b60d4b136973",
"timestamp": "",
"source": "github",
"line_count": 322,
"max_line_length": 78,
"avg_line_length": 33.16459627329193,
"alnum_prop": 0.4811311920591816,
"repo_name": "blackPantherOS/packagemanagement",
"id": "23d061ee69877934812fa2f4f2f762ebbd5e30c9"... |
from flask import Blueprint
searcher = Blueprint('searcher', __name__)
import views
| {
"content_hash": "aaab6d99180aa3129c42ac5f26b105fb",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 42,
"avg_line_length": 17.2,
"alnum_prop": 0.7441860465116279,
"repo_name": "stultus/PeARS",
"id": "6c18bb1d7a19e83f00e80905af4c1f87118bb8fc",
"size": "86",
"binary": fals... |
__author__ = 'Greg Albrecht <gba@splunk.com>, C. Scott Andreas <s@boundary.com>, and Clint Sharp'
__copyright__ = 'Copyright 2013 Boundary and Splunk, Inc.'
__license__ = 'Apache License 2.0'
import os
import csv
import time
import json
import base64
import urllib2
import logging
import ConfigParser
logger = logging... | {
"content_hash": "6b52200ab36daa13f42177a9a76fb458",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 120,
"avg_line_length": 42.57948717948718,
"alnum_prop": 0.570757557509334,
"repo_name": "boundary/boundary-event-plugins",
"id": "eda4d3f8a16dbef27fd9a3184d100d7ea321138b",... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('csyllabusapi', '0014_courseresult'),
]
operations = [
migrations.CreateModel(
name='CourseFaculty',
... | {
"content_hash": "ca23bf414d7ef90885a6abec1f7456ee",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 114,
"avg_line_length": 34.71875,
"alnum_prop": 0.5675067506750675,
"repo_name": "CSyllabus/webapp",
"id": "b852dca71ac8b62213e7743ba11defaf1543014c",
"size": "2295",
"bi... |
class ListNode(object):
def __init__(self, x):
self.val = x
self.next = None
# Definition for a binary tree node.
class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution(object):
def sortedListToBST(self, head):
... | {
"content_hash": "db03b5d7a2e9da3291767bccbcc9a82b",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 51,
"avg_line_length": 26.023809523809526,
"alnum_prop": 0.5397987191216834,
"repo_name": "rx2130/Leetcode",
"id": "c2cba4787c566da695d435d3e751f5da23147b03",
"size": "1130... |
"""
sentry.db.models.fields.node
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import collections
import logging
import six
import warnings
from django.c... | {
"content_hash": "71b09d120aeb3a9c1650f34eaf498439",
"timestamp": "",
"source": "github",
"line_count": 177,
"max_line_length": 94,
"avg_line_length": 28.141242937853107,
"alnum_prop": 0.5894398715117446,
"repo_name": "fotinakis/sentry",
"id": "fc43e6f8872e3b4344495462acd4450e911a4b9c",
"size": "49... |
import functools
import os.path
import astropy.io.registry as io_registry
from astropy.table import Table
from astropy.utils.misc import NOT_OVERWRITING_MSG
__all__ = ["PANDAS_FMTS"]
# Astropy users normally expect to not have an index, so default to turn
# off writing the index. This structure allows for astropy-s... | {
"content_hash": "f485850b2bf35b9f47755019ab1b5a49",
"timestamp": "",
"source": "github",
"line_count": 114,
"max_line_length": 82,
"avg_line_length": 31.69298245614035,
"alnum_prop": 0.657625242181013,
"repo_name": "mhvk/astropy",
"id": "f6867b8570be41efdf85d89f0cd5b68d823ac297",
"size": "3752",
... |
from __future__ import absolute_import
import copy
import logging
import random
import time
import kafka.common as Errors
from kafka.common import BrokerMetadata
from .future import Future
log = logging.getLogger(__name__)
class ClusterMetadata(object):
DEFAULT_CONFIG = {
'retry_backoff_ms': 100,
... | {
"content_hash": "0d2a30d34e8099607e9155fa37bbfd96",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 78,
"avg_line_length": 35.66839378238342,
"alnum_prop": 0.5964555490993608,
"repo_name": "gamechanger/kafka-python",
"id": "1cdc8dd40f3aacda43875fca1bada897a201b169",
"siz... |
from tasks.meta import OBSTable, OBSColumn, current_session, GEOM_REF
from tasks.base_tasks import ColumnsTask, GeoFile2TempTableTask, RepoFileUnzipTask, TableTask
from tasks.util import shell
from tasks.poi import POIColumns
from tasks.us.ny.nyc.columns import NYCColumns
from tasks.us.ny.nyc.tags import NYCTags
from l... | {
"content_hash": "3d4f350f1bff2c7163b80412e196cbe8",
"timestamp": "",
"source": "github",
"line_count": 896,
"max_line_length": 113,
"avg_line_length": 46.338169642857146,
"alnum_prop": 0.46060839615597676,
"repo_name": "CartoDB/bigmetadata",
"id": "5aaebd3a069760704aa8079fb7d556b287ad9ba2",
"size"... |
import asyncio
import builtins
import io
import logging
import pytest
from mitmproxy.addons import termlog
from mitmproxy.test import taddons
from mitmproxy.utils import vt_codes
@pytest.fixture(autouse=True)
def ensure_cleanup():
yield
assert not any(
isinstance(x, termlog.TermLogHandler)
f... | {
"content_hash": "f97ae4cdc99c78e065feb7e68d304da5",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 69,
"avg_line_length": 23.906666666666666,
"alnum_prop": 0.6525376464026771,
"repo_name": "mitmproxy/mitmproxy",
"id": "62573e218cf288fac458a30ecc985b4ce4489a75",
"size": "... |
import os
import unittest
from mako import util
from test import eq_
class UtilTest(unittest.TestCase):
def test_fast_buffer_write(self):
buf = util.FastEncodingBuffer()
buf.write("string a ")
buf.write("string b")
eq_(buf.getvalue(), "string a string b")
def test_fast_buffer_t... | {
"content_hash": "f8e5ab6943bf2ae7cebd9fa6cea54bd0",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 68,
"avg_line_length": 32.53846153846154,
"alnum_prop": 0.5886524822695035,
"repo_name": "hortonworks/hortonworks-sandbox",
"id": "5c4f95fde6e22b9e4029ac5198d727b1ddc27378",
... |
from contextlib import contextmanager
from scinet3.modellist import (DocumentList, KeywordList)
from collections import Counter
@contextmanager
def evaluation_manager(desired_docs, desired_kws, session):
evaluator = GoalBasedEvaluator()
evaluator.setGoal(desired_docs, desired_kws)
yield
eval_re... | {
"content_hash": "0dd2bcc574ab9e7dcb45f6513583b2d4",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 118,
"avg_line_length": 37.607142857142854,
"alnum_prop": 0.6096866096866097,
"repo_name": "xiaohan2012/rl-search",
"id": "fce813e0d90e1ce7aee860338fd7c6262767b4a1",
"size"... |
import logging
from django.core.management.base import NoArgsCommand
import amo
from mkt.constants.regions import WORLDWIDE
log = logging.getLogger('z.task')
class Command(NoArgsCommand):
help = 'Migrate free apps without a world AER to enable_new_regions=True.'
def handle_noargs(self, *args, **options):
... | {
"content_hash": "89dcabb2de613a9e493a1f14f7fb415e",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 78,
"avg_line_length": 34.75,
"alnum_prop": 0.6310380267214799,
"repo_name": "Joergen/zamboni",
"id": "92e5f30574bcfa04f3c8e2fcad82a289bcf9d010",
"size": "973",
"binary":... |
import collections
from neutron_lib import constants as lib_const
from neutron_lib.plugins.ml2 import ovs_constants as ovs_consts
from neutron_lib.services.logapi import constants as log_const
from os_ken.base import app_manager
from os_ken.lib.packet import packet
from oslo_config import cfg
from oslo_log import form... | {
"content_hash": "930db5d134483fe4915ac85e77f34f19",
"timestamp": "",
"source": "github",
"line_count": 463,
"max_line_length": 78,
"avg_line_length": 39.377969762419006,
"alnum_prop": 0.5857832382623958,
"repo_name": "openstack/neutron",
"id": "ff87f252db0e62030b3d59d9ded2a8b58aa93a54",
"size": "1... |
from pyroute2.common import AddrPool
class TestAddrPool(object):
def test_alloc_aligned(self):
ap = AddrPool(minaddr=1, maxaddr=1024)
for i in range(1024):
ap.alloc()
try:
ap.alloc()
except KeyError:
pass
def test_alloc_odd(self):
... | {
"content_hash": "ee52baa194e7b4c40a25feb3ae71f8f3",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 60,
"avg_line_length": 24.339805825242717,
"alnum_prop": 0.5273234942161946,
"repo_name": "nazarewk/pyroute2",
"id": "356bd31a5ccd675b839afea87ac22d57dbdcb37f",
"size": "2... |
import os, sys; sys.path.insert(0, os.path.join("..", ".."))
import time
from pattern.vector import Document, Model, KNN
from pattern.db import Datasheet
# Long documents contain lots of words.
# Models with lots of long documents can become slow,
# because calculating cosine similarity then takes a long time.
# Lat... | {
"content_hash": "b919bb73393d17bdf4c0a7fecb3a849e",
"timestamp": "",
"source": "github",
"line_count": 99,
"max_line_length": 95,
"avg_line_length": 37.5959595959596,
"alnum_prop": 0.722729715206878,
"repo_name": "EricSchles/pattern",
"id": "19cfbabf7ff17217cf90589e938f29e280a4d4f7",
"size": "3722... |
from datetime import date
from django.forms.models import model_to_dict
from nose.tools import eq_, ok_
from remo.base.tests import RemoTestCase
from remo.profiles.tests import FunctionalAreaFactory, UserFactory
from remo.reports import ACTIVITY_CAMPAIGN
from remo.reports.forms import NGReportForm
from remo.reports.m... | {
"content_hash": "427f830c2537101e8d573bf16b34600d",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 77,
"avg_line_length": 37.87356321839081,
"alnum_prop": 0.6100151745068285,
"repo_name": "mozilla/remo",
"id": "9e5ad2d9e13733b1691b2274ef247762d2e3c869",
"size": "3295",
... |
import math
class THAssistant:
def __init__(self, players=None, prizepool=None, payable=None):
if players and prizepool and payable:
self.players = int(players)
self.prizepool = int(prizepool)
self.payablePlayers = int(payable)
self.distFuncs = {"uniform" : self... | {
"content_hash": "16479ff6a4e8efe506fd666a23ae6d7d",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 150,
"avg_line_length": 29.67948717948718,
"alnum_prop": 0.5323974082073434,
"repo_name": "tolo137/TourneyHelper",
"id": "ac5ff0f9213b61729db79572b69ecfdecce498ff",
"size"... |
"""
Scrapy signals
These signals are documented in docs/topics/signals.rst. Please don't add new
signals here without documenting them there.
"""
engine_started = object()
engine_stopped = object()
spider_opened = object()
spider_idle = object()
spider_closed = object()
spider_error = object()
request_scheduled = obj... | {
"content_hash": "be162814179416eb934f9ae1ba34e078",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 77,
"avg_line_length": 24.548387096774192,
"alnum_prop": 0.7608409986859396,
"repo_name": "eLRuLL/scrapy",
"id": "cd7ed7fb167866f898fb6626e6bccd131146caf2",
"size": "761",
... |
import logging
from tempest.api.orchestration import base
from tempest.common.utils import data_utils
from tempest.test import attr
LOG = logging.getLogger(__name__)
class StacksTestJSON(base.BaseOrchestrationTest):
_interface = 'json'
template = """
HeatTemplateFormatVersion: '2012-12-12'
Description: |
... | {
"content_hash": "f332014ca4fae310a5dde13897c2a4bd",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 79,
"avg_line_length": 42.13157894736842,
"alnum_prop": 0.572891942535915,
"repo_name": "ntymtsiv/tempest",
"id": "11d01f76a53321f0c15a7710a5f8aec2e8125630",
"size": "8578... |
import abc
from typing import Any, Dict, Union
import numpy as np
import scipy.sparse
from autosklearn.pipeline.components.data_preprocessing.feature_type import (
FeatTypeSplit,
)
class AbstractDataManager:
__metaclass__ = abc.ABCMeta
def __init__(self, name: str):
self._data = dict() # type... | {
"content_hash": "d78739ceda211cbccec5689d150fe0ac",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 77,
"avg_line_length": 27.416666666666668,
"alnum_prop": 0.5314083080040527,
"repo_name": "automl/auto-sklearn",
"id": "0837d59ad09dfd66788d565e1e1b92e479fd82a3",
"size": "... |
zones = dict()
zones["ZONES HAVE NOT BEEN IMPLEMENTED FOR SONEL"] = set([
"Seriously, don't use this zone."
])
| {
"content_hash": "dc5a530a25d4441895f64a1398767622",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 58,
"avg_line_length": 28.75,
"alnum_prop": 0.6608695652173913,
"repo_name": "gragas/gpsbro",
"id": "4ba8e951400a93afa16d7c91c4c03f95c5b6a6a3",
"size": "115",
"binary": fa... |
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('..'))
sys.path.append(os.path.... | {
"content_hash": "697ae6c14f2dff7c80dde1be7c98c2ab",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 84,
"avg_line_length": 32.86842105263158,
"alnum_prop": 0.7055244195356285,
"repo_name": "avilaton/flask-jwt",
"id": "cd41762f12b3de86250ad1bc1cacc370f97ef914",
"size": "6... |
import synapse
from synapse.server import HomeServer
from synapse.config._base import ConfigError
from synapse.config.logger import setup_logging
from synapse.config.homeserver import HomeServerConfig
from synapse.http.site import SynapseSite
from synapse.metrics.resource import MetricsResource, METRICS_PREFIX
from sy... | {
"content_hash": "0bbcb39e9baab7cb4813a02eb7c53071",
"timestamp": "",
"source": "github",
"line_count": 293,
"max_line_length": 81,
"avg_line_length": 33.80546075085324,
"alnum_prop": 0.5811206461383139,
"repo_name": "TribeMedia/synapse",
"id": "073f2c248900b08a96e4c58655c5142634c1b9f8",
"size": "1... |
from django.contrib import admin
from models import Bookmarklet, Vote, Category, Comment
admin.site.register(Bookmarklet)
admin.site.register(Vote)
admin.site.register(Category)
admin.site.register(Comment) | {
"content_hash": "f89bf95b7a82aa2f6dff28033889570d",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 55,
"avg_line_length": 29.571428571428573,
"alnum_prop": 0.8309178743961353,
"repo_name": "assertnotnull/bookmarklets",
"id": "161108676ffedbd410def3b24e715941264107a7",
"si... |
import requests
headers = {
'Content-Type': 'text/xml;charset=UTF-8',
}
response = requests.get('http://postman-echo.com/get', headers=headers)
| {
"content_hash": "92ac14aa93fcdd355dab341d187c0fa0",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 71,
"avg_line_length": 21.428571428571427,
"alnum_prop": 0.6933333333333334,
"repo_name": "NickCarneiro/curlconverter",
"id": "be1f3fc324de51108b4eeb04b452ec9d17c5df37",
"si... |
from setuptools import setup
requires = [
'Werkzeug==0.8.3',
'Fabric==1.5.1',
]
setup(
name='Finance Web Application',
version='1.0',
description='Website tracking accounts',
author='Greg Reinbach',
author_email='greg@reinbach.com',
url='https://github.com/reinbach/finance',
instal... | {
"content_hash": "f9f4c7c11ec74d5818491ee1c4abe016",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 46,
"avg_line_length": 21.375,
"alnum_prop": 0.6578947368421053,
"repo_name": "reinbach/finance",
"id": "d4d7dd9c925e4b8f608e7dc32de8b4ff26b39cb1",
"size": "364",
"binary... |
import argparse
import babel.messages.catalog as catalog
import babel.messages.pofile as pofile
# NOTE: This implementation has been superseded by the pseudo_translate
# management command, and will be removed in Queens (13.0) when run_tests.sh
# is also removed.
def translate(segment):
prefix = u""
# When ... | {
"content_hash": "cdae8711da7a7f745979b5742254dbd4",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 76,
"avg_line_length": 32.26865671641791,
"alnum_prop": 0.6262719703977798,
"repo_name": "kogotko/carburetor",
"id": "4a5ef1a0dfa86e46c21d5320352e13a725aa061f",
"size": "27... |
def _import():
from .classorinterfacetype import ClassOrInterfaceType
from .primitivetype import PrimitiveType
from ..expr.integerliteralexpr import IntegerLiteralExpr
from ..expr.nameexpr import NameExpr
from ..expr.annotationexpr import AnnotationExpr
return locals()
| {
"content_hash": "36062149edd13dbb60a74f5de12446d6",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 60,
"avg_line_length": 32.888888888888886,
"alnum_prop": 0.7736486486486487,
"repo_name": "plum-umd/java-sketch",
"id": "a59b170e2c48e172bb2d8863adc9fea0f491bc74",
"size": "... |
from io import StringIO
from mock import patch
from twisted.python.log import startLoggingWithObserver, removeObserver
from twisted.trial import unittest
from scrapyrt.log import ScrapyrtFileLogObserver, msg
@patch('twisted.python.log.FileLogObserver.emit')
class TestLogObserver(unittest.TestCase):
def setUp(s... | {
"content_hash": "cad122982357a5d243bdc65acee2c4c4",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 79,
"avg_line_length": 35.82222222222222,
"alnum_prop": 0.6873449131513648,
"repo_name": "pawelmhm/scrapyrt",
"id": "149ba0919eafea3ab54f26f0329b0b3f772562b5",
"size": "164... |
import configparser
import logging
import logging.handlers
import optparse
import os
import pwd
import random
import re
import signal
import subprocess
import sys
import time
import urllib.error
import urllib.parse
import urllib.request
def ping(host):
fd = os.open(os.devnull, os.O_RDWR)
try:
ping_cmd... | {
"content_hash": "0aa05d7816da63fcd9b5106b315e4623",
"timestamp": "",
"source": "github",
"line_count": 443,
"max_line_length": 95,
"avg_line_length": 34.433408577878104,
"alnum_prop": 0.6075127835321883,
"repo_name": "MathieuTurcotte/ipupdate",
"id": "ce599e44b53b6d1f74cb729d658c0cbc962a12eb",
"si... |
import numpy as np
import os
import urllib.request
import gzip
import struct
def download_data(url, force_download=True):
if not os.path.isdir('data'):
os.makedirs('data')
fname = os.path.join('data', url.split("/")[-1])
if force_download or not os.path.exists(fname):
urllib.request.urlret... | {
"content_hash": "35571d857ab71fe78c56bbbf8aad9463",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 90,
"avg_line_length": 32.44,
"alnum_prop": 0.654747225647349,
"repo_name": "boofhead/sghnt_example",
"id": "359f13284930f29d102936a01e2ca5876257b709",
"size": "811",
"bi... |
from collections.abc import Collection
from dataclasses import dataclass, field
from typing import List
from omegaconf import II
from fairseq.dataclass import FairseqDataclass
from fairseq.optim.lr_scheduler import FairseqLRScheduler, register_lr_scheduler
@dataclass
class InverseSquareRootLRScheduleConfig(FairseqD... | {
"content_hash": "9df458a07511fb7adf44c48c641d311c",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 87,
"avg_line_length": 38.125,
"alnum_prop": 0.6616393442622951,
"repo_name": "pytorch/fairseq",
"id": "987c905a23d50342dd7e809e0eddb5a6df2ebe90",
"size": "3228",
"binary... |
__doc__ = """Security Proxy for OGC Services like WPS."""
__author__ = """Carsten Ehbrecht"""
__email__ = 'ehbrecht@dkrz.de'
__version__ = '0.7.0'
| {
"content_hash": "e387ec07d9f4800fb15d6acd80a50eea",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 57,
"avg_line_length": 36.75,
"alnum_prop": 0.5918367346938775,
"repo_name": "bird-house/twitcher",
"id": "895fe895fb39060f38495190ff492b4005d87980",
"size": "396",
"binar... |
import importlib
import sys
import warnings
from inspect import isabstract
from unittest import TestCase, mock
import pytest
from parameterized import parameterized
from airflow.models.baseoperator import BaseOperator
from tests.deprecated_classes import ALL, RENAMED_ALL
class TestDeprecations(TestCase):
@stati... | {
"content_hash": "3f8c0482b9afbd0ec6945b8d900bdd88",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 103,
"avg_line_length": 41.91588785046729,
"alnum_prop": 0.6115942028985507,
"repo_name": "mistercrunch/airflow",
"id": "c519b7a3df97dabe858b48674733d28982d73989",
"size":... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import os.path
from tensorflow.python.framework import test_util
from tensorflow.python.platform import gfile
from tensorflow.python.platform import googletest
from tensorflow.python.summary import e... | {
"content_hash": "e3b1a726d52861fe91b2431108c39ce6",
"timestamp": "",
"source": "github",
"line_count": 263,
"max_line_length": 80,
"avg_line_length": 32.28136882129277,
"alnum_prop": 0.676678445229682,
"repo_name": "EvenStrangest/tensorflow",
"id": "bf8851aa52c7640bde50f1666e4677d9806b8deb",
"size... |
import pytz
from datetime import datetime
from mock import mock, patch
import sys
from .base import TestCase
from django.conf import settings
from graphite.render.datalib import TimeSeries, fetchData, _merge_results, prefetchData
from graphite.util import timebounds
from six.moves import range
class TimeSeriesTest... | {
"content_hash": "b4e883e4ebf47c6694e6c698569920ee",
"timestamp": "",
"source": "github",
"line_count": 394,
"max_line_length": 364,
"avg_line_length": 43.7005076142132,
"alnum_prop": 0.636194679986061,
"repo_name": "DanCech/graphite-web",
"id": "df1767401e4915b52760263923c8faaf1988dc23",
"size": "... |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
#from django.test import LiveServerTestCase
#from django.test import TestCase
from django.utils import unittest
from selenium.webdriver.f... | {
"content_hash": "d8e1f848d5cb888481d148086cf515da",
"timestamp": "",
"source": "github",
"line_count": 1149,
"max_line_length": 150,
"avg_line_length": 29.186248912097476,
"alnum_prop": 0.5241985984792008,
"repo_name": "jpardobl/naman",
"id": "577af250d9315b5a59db1fe2b5b3617def556524",
"size": "33... |
import re
from unittest import TestCase, mock
import pytest
from google.api_core.exceptions import NotFound
from google.cloud.secretmanager_v1.types import AccessSecretVersionResponse
from parameterized import parameterized
from airflow.exceptions import AirflowException
from airflow.models import Connection
from air... | {
"content_hash": "89a8b88c76e1f8c5834296a040ff2f06",
"timestamp": "",
"source": "github",
"line_count": 235,
"max_line_length": 108,
"avg_line_length": 51.10212765957447,
"alnum_prop": 0.6872345740694479,
"repo_name": "Acehaidrey/incubator-airflow",
"id": "ebe3f4e01af920c3a8f8709864cf1fed4cc73ac5",
... |
import json
import plotly
import pytest
from dash import __version__, Dash
from dash import html
from dash.development.base_component import Component
from dash import dcc, Input, Output
Component._prop_names = ("id", "a", "children", "style")
Component._type = "TestComponent"
Component._namespace = "test_namespace"... | {
"content_hash": "141bca173b64ad52486e5ab1f27beb32",
"timestamp": "",
"source": "github",
"line_count": 541,
"max_line_length": 93,
"avg_line_length": 29.75785582255083,
"alnum_prop": 0.5282315671780856,
"repo_name": "plotly/dash",
"id": "cefde04fdec38cf2418b0459d23bef9bf1873bba",
"size": "16099",
... |
from oslo_config import cfg
from oslo_log import log as logging
import six
from sahara import conductor as c
from sahara import context
from sahara import exceptions as ex
from sahara.i18n import _LE
from sahara.plugins import base as plugin_base
from sahara.service.edp.binary_retrievers import dispatch
from sahara.se... | {
"content_hash": "1301cdddf4120279e8cd160910dd61d0",
"timestamp": "",
"source": "github",
"line_count": 231,
"max_line_length": 78,
"avg_line_length": 29.22077922077922,
"alnum_prop": 0.6481481481481481,
"repo_name": "ekasitk/sahara",
"id": "ecfbe85c679600c12c60fac6daa6acd3d18681fb",
"size": "7333"... |
from datetime import datetime
from datafeed.exchange import Security
__all__ = ['Report', 'Day', 'Minute', 'SecurityList']
class _Struct(object):
def __init__(self, security, adict):
assert isinstance(security, Security)
self.__dict__.update(adict)
self.security = security
def asse... | {
"content_hash": "09f156bb0bd1bdfff111e1ac96d632a6",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 68,
"avg_line_length": 21.06122448979592,
"alnum_prop": 0.5872093023255814,
"repo_name": "yinhm/datafeed",
"id": "077289c9f0d17705267576146292c3efb702a18e",
"size": "1057",... |
"""myapp URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-base... | {
"content_hash": "fbb7bfda04aa12a4de3ceee88384c622",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 79,
"avg_line_length": 36.285714285714285,
"alnum_prop": 0.699475065616798,
"repo_name": "HolubTom/SpektrumDuhy",
"id": "bdc834f2ffd57011441f43e8d75fdbd83a6015dc",
"size": ... |
__all__ = ['ttypes', 'constants', 'Service', 'AdapterService']
| {
"content_hash": "87e0d1941830a3753a8edafa93eef68f",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 62,
"avg_line_length": 63,
"alnum_prop": 0.6190476190476191,
"repo_name": "facebook/fbthrift",
"id": "208c67726cd684cd24aafdc0f73b9ff8d4fcc78b",
"size": "176",
"binary": f... |
"""Tests for SparseAdd."""
import timeit
import numpy as np
from tensorflow.python.client import session
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import errors_impl
from tensorflow.python.framework import ops
from tensorflow.p... | {
"content_hash": "36695fcd6d01b9190e06c565f920c6db",
"timestamp": "",
"source": "github",
"line_count": 238,
"max_line_length": 80,
"avg_line_length": 36.19327731092437,
"alnum_prop": 0.6054097980032506,
"repo_name": "Intel-Corporation/tensorflow",
"id": "61ad45fb5e273e2b197cbcf685ffb20d100c12b4",
... |
import time
import unittest
import node
import config
import command
LEADER = 1
DUT_ROUTER1 = 2
ROUTER2 = 3
ROUTER3 = 4
class Cert_5_3_5_RoutingLinkQuality(unittest.TestCase):
def setUp(self):
self.nodes = {}
for i in range(1,5):
self.nodes[i] = node.Node(i)
self.nodes[LEADER... | {
"content_hash": "489e46c270a9ed743b4a3ca99846ba5b",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 108,
"avg_line_length": 39.96363636363636,
"alnum_prop": 0.6480891719745223,
"repo_name": "xiaom-GitHub/openthread",
"id": "d4e721a0f5491264e1882d95e46b9053dbc91f49",
"siz... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.