text stringlengths 4 1.02M | meta dict |
|---|---|
"""\
==================================
Parsing of Linux-DVB channels.conf
==================================
ParseChannelsConf parses lines from a channels.conf file and returns python
outputs a python dictionary for each line - containing the parsed tuning
information.
Example Usage
-------------
Extract from a ... | {
"content_hash": "5a5b9a60cb7ce755326e9a7d086771d4",
"timestamp": "",
"source": "github",
"line_count": 339,
"max_line_length": 106,
"avg_line_length": 34.91740412979351,
"alnum_prop": 0.5894229956914758,
"repo_name": "bbc/kamaelia",
"id": "9ec8cac8acdd6d6631da69ffe8b856d00e8b6b77",
"size": "12740"... |
"""Test the flow classes."""
import asyncio
from unittest.mock import patch
import pytest
import voluptuous as vol
from homeassistant import config_entries, data_entry_flow
from homeassistant.core import HomeAssistant
from homeassistant.util.decorator import Registry
from tests.common import async_capture_events
@... | {
"content_hash": "9b1194d024fe654a5f8e76fb432377e9",
"timestamp": "",
"source": "github",
"line_count": 489,
"max_line_length": 102,
"avg_line_length": 34.8200408997955,
"alnum_prop": 0.6182533623069243,
"repo_name": "jawilson/home-assistant",
"id": "b4b40b6b6c61839e205aa290aee0ffc3f750a3c7",
"size... |
from . import browser
from . import users
from . import messages
from . import rooms
from . import events
from . import client
from . import _utils
Browser = browser.Browser
Client = client.Client
__all__ = [
'browser', 'users', 'messages', 'rooms', 'events', 'client',
'Browser', 'Client']
| {
"content_hash": "07efa7c8a34e9931253fcdcce3b87478",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 64,
"avg_line_length": 17.88235294117647,
"alnum_prop": 0.6710526315789473,
"repo_name": "ByteCommander/ChatExchange6",
"id": "743a9aeb6b2b36d89fa6b93258003c659ea34e5c",
"s... |
import re
from marshmallow import Schema, fields, ValidationError
def must_not_be_blank(data):
if not data:
raise ValidationError('Data not provided.')
class KahaResourceSchema(Schema):
active = fields.Boolean(attribute='is_active')
contact_number = fields.Method('format_contactnumber')
conta... | {
"content_hash": "c33230d6a6c4b2064d797518c44758c8",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 85,
"avg_line_length": 29.413793103448278,
"alnum_prop": 0.5310668229777257,
"repo_name": "kahaco/kahadata",
"id": "cb75c72621b3212793aa82d25c14124ef60a6341",
"size": "1706... |
import os
import sys
import arcpy
import _winreg
from datetime import datetime
from xml.dom import minidom
scriptPath = os.path.dirname(__file__)
try:
import MDCS_UC
except Exception as inf:
print 'User-Code functions disabled.'
class Base(object):
#begin - constansts
const_general_text = 0
const_w... | {
"content_hash": "a4610bf6df8b816124b6dea1d0abf85f",
"timestamp": "",
"source": "github",
"line_count": 715,
"max_line_length": 178,
"avg_line_length": 33.71608391608392,
"alnum_prop": 0.4985688804081802,
"repo_name": "rkelson/weighted-raster-overlay-service-toolbox",
"id": "c968a2cfb328b6680e96cddd7... |
"""
Tests of errors that are common across a wide group of pywbemcli groups and
commands.
This includes:
1. Tests of connection timeout on bad server with all commands. Note that the
command options in these tests are just sufficient to pass command parsing
since all tests should fail with connection error.
2. Test ... | {
"content_hash": "93dab4c71f35bc0899c6fc8db86abaae",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 79,
"avg_line_length": 36.07096774193548,
"alnum_prop": 0.6206403147916294,
"repo_name": "pywbem/pywbemtools",
"id": "b67fb9451963e9797a9c20e713a68c2dd8cd17eb",
"size": "5... |
from setuptools import setup, find_packages
setup(
name = 'django-redis-sessions',
version = '0.1',
author = 'David Paccoud',
author_email = 'dpaccoud@gmail.com',
description = 'Redis Sessions Backend for Django',
license = 'BSD',
url = 'http://bitbucket.org/dpaccoud/django-redis-sessions/... | {
"content_hash": "f17c3e7318d725782f0667e3c58fee98",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 79,
"avg_line_length": 34.370370370370374,
"alnum_prop": 0.6120689655172413,
"repo_name": "dpaccoud/django-redis-sessions",
"id": "dd75d616e24fb9f8ea978f51e77c1dbc5c867ee9",
... |
import zstackwoodpecker.test_state as ts_header
import os
TestAction = ts_header.TestAction
def path():
return dict(initial_formation="template5", checking_point=8, path_list=[
[TestAction.create_vm, 'vm1', ],
[TestAction.create_volume, 'volume1', 'flag=scsi'],
[TestAction.attach_volume, 'vm1', 'volume1'],
... | {
"content_hash": "fcc7be53adadfea3809a244db515c111",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 150,
"avg_line_length": 39.714285714285715,
"alnum_prop": 0.7014388489208633,
"repo_name": "zstackio/zstack-woodpecker",
"id": "43c7fdd5a15e6f1a0cc3a74523157f22ca8f1980",
"... |
import traceback
from dateutil.parser import parse as dateparse
import string
import datetime
import time
import praw
import sqlite3
import re
""" USER CONFIG """
USERAGENT = ""
#Describe the bot and what it does. Include your username
APP_ID = ""
APP_SECRET = ""
APP_URI = ""
APP_REFRESH = ""
# https://www.reddit.com... | {
"content_hash": "da331be7d7ec4f50f0798e370754c285",
"timestamp": "",
"source": "github",
"line_count": 516,
"max_line_length": 153,
"avg_line_length": 31.436046511627907,
"alnum_prop": 0.6672831514703162,
"repo_name": "voussoir/reddit",
"id": "42a8c50adc6ec8df6a495284eba9863676794e1f",
"size": "16... |
"""
Classes representing uploaded files.
"""
import os
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
__all__ = ('UploadedFile', 'TemporaryUploadedFile', 'InMemoryUploadedFile')
class UploadedFile(object):
"""
A abstract uploaded file (``TemporaryUploadedFile`` ... | {
"content_hash": "22b33e53ba86d73860f9d4e956fd14d7",
"timestamp": "",
"source": "github",
"line_count": 190,
"max_line_length": 124,
"avg_line_length": 31.189473684210526,
"alnum_prop": 0.5892676341545731,
"repo_name": "diofeher/django-nfa",
"id": "637609d0850567c4dd7439c778d46ce0dcaadb8a",
"size":... |
import os
import aiohttp_jinja2
import jinja2
from aiohttp import web
from aiohttp.test_utils import AioHTTPTestCase
from app.routes import routes
from config import UPLOAD_FOLDER, TEMPLATES_FOLDER
class BaseTestCase(AioHTTPTestCase):
test_files = ["somebook.pdf", "someotherbook.pdf"]
test_paths = []
fo... | {
"content_hash": "1a4483a94a6be802c543d6e7c3eb2aa9",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 83,
"avg_line_length": 28.24390243902439,
"alnum_prop": 0.6355785837651122,
"repo_name": "bndr/basic-uploader",
"id": "fbf4af1fd6370fa838bcb7415704a81a380a67ee",
"size": "1... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ik_links', '0006_authorlink_exclude_from_contributions'),
]
operations = [
migrations.AddField(
model_name='authorlink',
nam... | {
"content_hash": "01d6080e468bad0cf456bf5c77fc344c",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 125,
"avg_line_length": 27.333333333333332,
"alnum_prop": 0.6443089430894309,
"repo_name": "ic-labs/django-icekit",
"id": "d686d9f57d24cb1e4afbec6de17b5af50e40a9e2",
"size"... |
import krpc
import json
import time
from collections import OrderedDict, defaultdict
import threading
class TelemetryController(threading.Thread):
def __init__(self, a_ship, a_graphite, in_telems, interval=1):
super(TelemetryController,self).__init__(group=None, target=None, name=None, args=(), kwargs={})
... | {
"content_hash": "59125f14233095b9c1c8631aa63a0663",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 101,
"avg_line_length": 34.96,
"alnum_prop": 0.6664759725400458,
"repo_name": "uiuc-cs-ksp/krpc_telemetry_server",
"id": "f6f634e281a19fd0123346cd0a81e86ae030986f",
"size":... |
import os
import copy
from robot.errors import DataError
from robot.variables import is_var
from robot.output import LOGGER
from robot.writer import DataFileWriter
from robot.utils import abspath, is_string, normalize, NormalizedDict
from .comments import Comment
from .populators import FromFilePopulator, FromDirecto... | {
"content_hash": "4634a0c56b544d2b372680563718e53f",
"timestamp": "",
"source": "github",
"line_count": 693,
"max_line_length": 90,
"avg_line_length": 34.08080808080808,
"alnum_prop": 0.6019984757388432,
"repo_name": "userzimmermann/robotframework",
"id": "fb78ffa55e6059597c40f4b4513eccfde2e09912",
... |
import matplotlib.pyplot as plt
import pytest
import seaborn as sns
class TestPlotterMixin(object):
pass
class TestScatterPlotter(object):
pass
@pytest.fixture
def iris(self):
return sns.load_dataset('iris')
def test_scatterplots(self, iris):
"""Smoke test of high level scatterp... | {
"content_hash": "a57dbd7fc2659a55c0e43e2582816f39",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 58,
"avg_line_length": 20.941176470588236,
"alnum_prop": 0.6306179775280899,
"repo_name": "olgabot/cupcake",
"id": "366dd1fe183044e6b2fad0c5ada00decbcc027e0",
"size": "712"... |
#!/usr/bin/env python3
# Copyright (c) 2014-2018 The Machinecoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test longpolling with getblocktemplate."""
from decimal import Decimal
from test_framework.test_... | {
"content_hash": "22320cca04c1ea0eaae2f51369a3bb40",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 112,
"avg_line_length": 43.17333333333333,
"alnum_prop": 0.6738727609635577,
"repo_name": "machinecoin-project/machinecoin",
"id": "0c74b38ff957fd8d0fe80a85f147db174d9335eb",... |
from django.conf.urls import patterns, url
from moderation.views import FlagObjectView
urlpatterns = patterns('',
url(r'^flag/$', FlagObjectView.as_view(), name='moderation_flagobject'),
) | {
"content_hash": "eb9a3b45bf2e41dfca1d5403dd280270",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 76,
"avg_line_length": 32.166666666666664,
"alnum_prop": 0.7512953367875648,
"repo_name": "nikdoof/vapemap",
"id": "1b19c5dce192b1385b351072b5155981f8b57708",
"size": "193",... |
from frappe.tests.utils import FrappeTestCase
class TestLogSettingUser(FrappeTestCase):
pass
| {
"content_hash": "c52d502004e61adc4c9f3ef39e01320e",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 45,
"avg_line_length": 19.2,
"alnum_prop": 0.84375,
"repo_name": "StrellaGroup/frappe",
"id": "556dc36dc908ee0d0588794042c69a4638e1f735",
"size": "199",
"binary": false,
... |
from gfregression import (
Family,
Font,
FontStyle,
family_from_googlefonts,
family_from_github_dir,
familyname_from_filename,
get_families,
diff_families,
families_glyphs_all,
)
import tempfile
import os
import shutil
import unittest
from glob import glob
class TestFamily(unittes... | {
"content_hash": "c648535b422b9bf307e1e6b1fef20970",
"timestamp": "",
"source": "github",
"line_count": 229,
"max_line_length": 111,
"avg_line_length": 35.157205240174676,
"alnum_prop": 0.6435225437833809,
"repo_name": "googlefonts/gfregression",
"id": "55717ae1fae79a1f92ef2de76850c695627331b0",
"s... |
import re
import mechanize
from bs4 import BeautifulSoup
import smtplib
import os.path
from time import *
lt = localtime()
print "################## Neuer Durchgang ######################"
print strftime("Datum: %d.%m.%Y", lt)
print strftime("Uhrzeit: %H:%M:%S", lt)
#--------------------------------------------------... | {
"content_hash": "245bd5c4060cf730102338d6caa65a2c",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 186,
"avg_line_length": 36.6764705882353,
"alnum_prop": 0.5396952686447474,
"repo_name": "lasrie/Noten",
"id": "d7fcbe9d54929e3bac416d6f21fd870eada45653",
"size": "5079",
... |
from __future__ import unicode_literals
import django
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sms', '0042_infobip_pinpoint_backends'),
]
operations = [
migrations.AlterField(
model_name='email',
name='mes... | {
"content_hash": "5386064fd0b1bbf354458e1a8133aa13",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 91,
"avg_line_length": 25.6,
"alnum_prop": 0.595703125,
"repo_name": "dimagi/commcare-hq",
"id": "57857b1b9302e9ee79c364b168608d689d4c021a",
"size": "586",
"binary": fals... |
"""
Root url's map for application
"""
from django.conf.urls import *
from datebook.views import IndexView
from datebook.views.author import DatebookAuthorView
from datebook.views.year import DatebookYearView
from datebook.views.month import DatebookMonthView, DatebookMonthGetOrCreateView, DatebookMonthCurrentView, Da... | {
"content_hash": "ce88458bbbe8df1af1509b47e539f9d4",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 162,
"avg_line_length": 64.89473684210526,
"alnum_prop": 0.6516626115166261,
"repo_name": "sveetch/django-datebook",
"id": "987c21a3cf2bd0e7b72d8ae1b7cf0f44b66bba9a",
"size... |
"""A simple filter that thresholds on input data.
"""
# Author: Prabhu Ramachandran <prabhu_r@users.sf.net>
# Copyright (c) 2005, Enthought, Inc.
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# Copyright (c) 2010, Enthought, Inc.
# License: BSD Style.
import numpy as np
# Enthought library imports.
from t... | {
"content_hash": "9ac45564dc92504a837942d0c897743a",
"timestamp": "",
"source": "github",
"line_count": 289,
"max_line_length": 94,
"avg_line_length": 36.9204152249135,
"alnum_prop": 0.510215557638238,
"repo_name": "liulion/mayavi",
"id": "66b12a709a0a874f28233e439bc02d6bcc926ae5",
"size": "10670",... |
import SokoMap
class HashTable:
def __init__(self):
self.table = {}
# sm is SokoMap
def checkAdd(self, sm):
key = str(sm.getBlocks() + [sm.getPlayer()])
if key in self.table:
return True
else:
self.table[key] = True
return False
| {
"content_hash": "a71c67c632b82be837b3b1657c97662f",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 52,
"avg_line_length": 19.5625,
"alnum_prop": 0.5111821086261981,
"repo_name": "lrei/willy",
"id": "b3a16f186c0cfff1fc49d6b399dcac51903b2f37",
"size": "313",
"binary": fa... |
from __future__ import division
import numpy as np
from .uiOmBase import *
########################################################################
class ScenarioValueMonitor(QtWidgets.QTableWidget):
"""情景分析监控工具,某一个数值"""
#----------------------------------------------------------------------
def __init... | {
"content_hash": "eb567b221da3aabdb822599c646134fd",
"timestamp": "",
"source": "github",
"line_count": 205,
"max_line_length": 118,
"avg_line_length": 38.863414634146345,
"alnum_prop": 0.45186393874733277,
"repo_name": "wisfern/vnpy",
"id": "156486dd88e28950acae42412619a95998415c19",
"size": "8234... |
"""
A simple sample of using a wx.Overlay to draw a rubberband effect
"""
import wx
print(wx.version())
class TestPanel(wx.Panel):
def __init__(self, *args, **kw):
wx.Panel.__init__(self, *args, **kw)
self.Bind(wx.EVT_PAINT, self.OnPaint)
self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
... | {
"content_hash": "5820d7a522d3095eac2d5afcfd681d61",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 80,
"avg_line_length": 30.25,
"alnum_prop": 0.581893313298272,
"repo_name": "dnxbjyj/python-basic",
"id": "861f701b299f325409bac46bf423472e68c93065",
"size": "2662",
"bin... |
import copy
from nailgun.db.sqlalchemy.models import NeutronConfig
from nailgun.db.sqlalchemy.models import NovaNetworkConfig
from nailgun.objects import ClusterCollection
from nailgun.objects import MasterNodeSettings
from nailgun.objects import NodeCollection
from nailgun.settings import settings
from nailgun.statis... | {
"content_hash": "feb45b85786443d77a49c6de231a1f67",
"timestamp": "",
"source": "github",
"line_count": 308,
"max_line_length": 79,
"avg_line_length": 41.62662337662338,
"alnum_prop": 0.5455892676078309,
"repo_name": "SmartInfrastructures/fuel-web-dev",
"id": "d7f7121d220c6e99b6087e0aceb4829cee940f37... |
"""Unit tests for wx.Colour and wx.Color.
Methods yet to test:
__del__, __eq__, __getitem__, __len__, __ne__, __nonzero__, __reduce__,
__repr__, __str__, GetAsString, GetPixel"""
import unittest
import wx
import wxtest
def getColourEquivalents():
# doesn't include wx.Colour instances, only ... | {
"content_hash": "3172b3663713ff92805ba80ff38e8aad",
"timestamp": "",
"source": "github",
"line_count": 135,
"max_line_length": 92,
"avg_line_length": 36.43703703703704,
"alnum_prop": 0.5741004269160398,
"repo_name": "ifwe/wxpy",
"id": "c39969f11f35517e5faa6b9d0a550af74c762ead",
"size": "4919",
"... |
import functools
import threading
import time
import traceback
from pystachio import Default, Integer, String
from thrift.protocol import TJSONProtocol
from thrift.transport import TTransport
from twitter.common import log
from twitter.common.concurrent import Timeout, deadline
from twitter.common.quantity import Amou... | {
"content_hash": "6655c05b813802cbf7dc8f732c6dc247",
"timestamp": "",
"source": "github",
"line_count": 320,
"max_line_length": 100,
"avg_line_length": 38,
"alnum_prop": 0.6804276315789474,
"repo_name": "rosmo/aurora",
"id": "8e91788d8cb69ef21df6b045cd07f8cb111b95b3",
"size": "12709",
"binary": f... |
import abc
import bisect
import copy
import math
import six
from rally.common import costilius
from rally.common import streaming_algorithms as streaming
from rally import exceptions
from rally.task.processing import utils
@six.add_metaclass(abc.ABCMeta)
class Chart(object):
"""Base class for charts."""
de... | {
"content_hash": "daa7777ead188b2760f8520b99a43afc",
"timestamp": "",
"source": "github",
"line_count": 324,
"max_line_length": 79,
"avg_line_length": 37.94753086419753,
"alnum_prop": 0.5628304188694592,
"repo_name": "group-policy/rally",
"id": "a38293b265426965a4b33fa64ee9fe52c2a7ba73",
"size": "1... |
"""
This module contains classes that help to emulate xcodebuild behavior on top of
other build systems, such as make and ninja.
"""
import gyp.common
import os.path
import re
import shlex
import subprocess
import sys
from gyp.common import GypError
class XcodeSettings(object):
"""A class that understands the gyp '... | {
"content_hash": "100eba7a4e323b29f3e6a1770b37db20",
"timestamp": "",
"source": "github",
"line_count": 1080,
"max_line_length": 191,
"avg_line_length": 39.56944444444444,
"alnum_prop": 0.658032058032058,
"repo_name": "cfsghost/stemmer",
"id": "ed5e27fa686dd256e4e047b9bd27adbaf71dbb3e",
"size": "42... |
__author__ = '0xCCCCCCCC'
from socket import *
SERVER_NAME = '127.0.0.1'
SERVER_PORT = 9876
def main():
buffer_size = 2048
client_socket = socket(AF_INET, SOCK_DGRAM)
while True:
message = input('Please input a sentence:')
if message == 'exit':
break
client_socket.sen... | {
"content_hash": "d7f3dfb736925f0d13f5ba1bb59c2af6",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 81,
"avg_line_length": 26.041666666666668,
"alnum_prop": 0.6016,
"repo_name": "kingsamchen/Eureka",
"id": "477b06ad88b01e59cef1181741801a91b8104770",
"size": "649",
"bina... |
from sahara.plugins.vanilla import confighints_helper as ch_helper
from sahara.plugins.vanilla.hadoop2 import edp_engine
from sahara.utils import edp
class EdpOozieEngine(edp_engine.EdpOozieEngine):
@staticmethod
def get_possible_job_config(job_type):
if edp.compare_job_type(job_type, edp.JOB_TYPE_HIV... | {
"content_hash": "5d9730d21f6e6efc119469bed1be25a9",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 79,
"avg_line_length": 54,
"alnum_prop": 0.6425925925925926,
"repo_name": "ekasitk/sahara",
"id": "5d7c208c2ed19c6fda1f0cc9ab272977c6dd1b0c",
"size": "1663",
"binary": fa... |
import sys
# [START storage_remove_file_owner]
from google.cloud import storage
def remove_blob_owner(bucket_name, blob_name, user_email):
"""Removes a user from the access control list of the given blob in the
given bucket."""
# bucket_name = "your-bucket-name"
# blob_name = "your-object-name"
#... | {
"content_hash": "3bfb10e663fcb73c4d55438c983e9535",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 83,
"avg_line_length": 29.485714285714284,
"alnum_prop": 0.6569767441860465,
"repo_name": "googleapis/python-storage",
"id": "315a747adbcc6771e297f51ec931e3277472208f",
"si... |
NET_STATUS_ACTIVE = 'ACTIVE'
NET_STATUS_BUILD = 'BUILD'
NET_STATUS_DOWN = 'DOWN'
NET_STATUS_ERROR = 'ERROR'
PORT_STATUS_ACTIVE = 'ACTIVE'
PORT_STATUS_BUILD = 'BUILD'
PORT_STATUS_DOWN = 'DOWN'
PORT_STATUS_ERROR = 'ERROR'
PORT_STATUS_NOTAPPLICABLE = 'N/A'
FLOATINGIP_STATUS_ACTIVE = 'ACTIVE'
FLOATINGIP_STATUS_DOWN = 'DO... | {
"content_hash": "83a3805616cae9a32a44b7b7dba3c621",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 78,
"avg_line_length": 31.132530120481928,
"alnum_prop": 0.7380030959752322,
"repo_name": "alexandrucoman/vbox-neutron-agent",
"id": "67847feb022b7e04014a77cda120501483a3915... |
from muntjac.api import VerticalLayout, ListSelect
from muntjac.data.property import IValueChangeListener
class ListSelectMultipleExample(VerticalLayout, IValueChangeListener):
_cities = ['Berlin', 'Brussels', 'Helsinki', 'Madrid', 'Oslo',
'Paris', 'Stockholm']
def __init__(self):
super(... | {
"content_hash": "357a653a29bdce752d815baebb18544a",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 70,
"avg_line_length": 30.466666666666665,
"alnum_prop": 0.6487964989059081,
"repo_name": "rwl/muntjac",
"id": "75f82181760686c5f9ab65c6da4373be89fe044c",
"size": "915",
... |
"""this module contains exceptions used in the astng library
"""
__doctype__ = "restructuredtext en"
class ASTNGError(Exception):
"""base exception class for all astng related exceptions"""
class ASTNGBuildingException(ASTNGError):
"""exception class when we are unable to build an astng representation"""
c... | {
"content_hash": "178f3fc26b76f53d8e7edeea6e06b635",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 77,
"avg_line_length": 28.06896551724138,
"alnum_prop": 0.7297297297297297,
"repo_name": "tlksio/tlksio",
"id": "db33f8b9df618dfd6f14b136a71d5829574ff675",
"size": "1650",
... |
from castellan import options as castellan_opts
from keystoneauth1 import loading as ks_loading
from oslo_config import cfg
key_manager_group = cfg.OptGroup(
'key_manager',
title='Key manager options')
key_manager_opts = [
cfg.StrOpt(
'fixed_key',
deprecated_group='keymgr',
hel... | {
"content_hash": "bb2487fb88434f08c3d0e8087909e26f",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 79,
"avg_line_length": 35.670731707317074,
"alnum_prop": 0.6485470085470085,
"repo_name": "xuweiliang/Codelibrary",
"id": "9de5fa3c90b7cf6a3ee0ad8e8962487001fab537",
"size"... |
import dragonfly
import dragonfly.pandahive
import bee
from bee import connect
import math, functools
from panda3d.core import NodePath
import dragonfly.scene.unbound
import dragonfly.std
import dragonfly.io
import dragonfly.canvas
import Spyder
# ## random matrix generator
from random import random
def random_m... | {
"content_hash": "91bb84a6fd1e8e13b8ac52b78c0bd020",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 109,
"avg_line_length": 27.83977900552486,
"alnum_prop": 0.6471522127406232,
"repo_name": "agoose77/hivesystem",
"id": "53ecb12ec7f2d3f163f6e7e78b535cb9eac6beac",
"size": ... |
'''
Test Monitors
@author: Michael Eddington
@version: $Id: test.py 780 2008-03-23 02:58:49Z meddingt $
'''
#
# Copyright (c) 2007 Michael Eddington
#
# 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 th... | {
"content_hash": "1170280a0323188326a3aad8518b4d1e",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 79,
"avg_line_length": 26.43421052631579,
"alnum_prop": 0.7272274763563962,
"repo_name": "thecrackofdawn/Peach2.3",
"id": "574ea2768381a5c44e8ed188d49bdbf02f224ad5",
"size"... |
from nose.tools import *
from dateutil.parser import parse as time_parse
import yawhois
class TestWhoisCentralnicComGrComStatusRegistered(object):
def setUp(self):
fixture_path = "spec/fixtures/responses/whois.centralnic.com/gr.com/status_registered.txt"
host = "whois.centralnic.com"
... | {
"content_hash": "3df0205f76bff8ebf1e5b8d6a9d4412c",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 676,
"avg_line_length": 52.52173913043478,
"alnum_prop": 0.6668046357615894,
"repo_name": "huyphan/pyyawhois",
"id": "ce49b0cd52cc0b8368abbb597e97ceda1dc7e055",
"size": "51... |
"""
Dumps info about switches when they first connect
"""
from pox.core import core
import pox.openflow.libopenflow_01 as of
from pox.lib.util import dpid_to_str
log = core.getLogger()
# Formatted switch descriptions we've logged
# (We rememeber them so that we only print them once)
_switches = set()
# .. unless al... | {
"content_hash": "697278d387b0b1cdcb2e4983b23b8c60",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 71,
"avg_line_length": 26.098360655737704,
"alnum_prop": 0.6664572864321608,
"repo_name": "damomeen/pox-datapath",
"id": "15cdb574ebe1c80c7c1da97f94153530850c5863",
"size":... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Info',
fields=[
('id', models.AutoField(auto_create... | {
"content_hash": "62c1937b06349bb5d35ec88e075d50ab",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 114,
"avg_line_length": 25.583333333333332,
"alnum_prop": 0.5342019543973942,
"repo_name": "t-mertz/slurmCompanion",
"id": "1997f95686faf3e3a30a99832c03e7245fcbdc05",
"size... |
from django.db import models
from django.contrib.auth.models import User
class Theme(models.Model):
name = models.CharField(max_length=100)
slug = models.SlugField(unique=True, max_length=100)
author = models.CharField(max_length=100, default='')
repoUrl = models.URLField(default=None, max_length=250)
def ... | {
"content_hash": "22468050b7440980b21f36244e861843",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 103,
"avg_line_length": 37.107142857142854,
"alnum_prop": 0.7439846005774784,
"repo_name": "stlim0730/glide",
"id": "d156bdf3524ecb206de344417dbe470c828a143f",
"size": "103... |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_dathomir_sing_mt_clan_outcast.iff"
result.attribute_template_id = 9
result.stfName("theme_park_name","singing_mt_clan_outcast")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
r... | {
"content_hash": "d791a9cb67d582786285a52ed8acf6e1",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 83,
"avg_line_length": 25.53846153846154,
"alnum_prop": 0.7078313253012049,
"repo_name": "obi-two/Rebelion",
"id": "b65109d48bcd8f44f62dcf8c5cfad93b95ff4b42",
"size": "477"... |
"""
Proxies for entities in other twinterpreters
"""
from cpy2py.kernel.exceptions import TwinterpeterUnavailable
from cpy2py.kernel import state
from cpy2py.proxy import tracker
class UnboundedMethodProxy(object):
"""
Proxy for unbounded methods
:param real_method: the unbounded method object to be pro... | {
"content_hash": "462bae6db0a209df18f1c921024265eb",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 119,
"avg_line_length": 37.36082474226804,
"alnum_prop": 0.5736754966887417,
"repo_name": "maxfischer2781/cpy2py",
"id": "803f391a71ee4332b457544fee0827ab417584d8",
"size":... |
VERSION_STRING = '1.0.0.0'
MAJOR_VERSION = 1
MINOR_VERSION = 0
RELEASE_VERSION = 0
SUBREL_VERSION = 0
VERSION = (MAJOR_VERSION, MINOR_VERSION, RELEASE_VERSION,
SUBREL_VERSION, '') | {
"content_hash": "67b10f20208feb1830e70c2d9b3887f0",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 57,
"avg_line_length": 24.625,
"alnum_prop": 0.6598984771573604,
"repo_name": "karadalex/PythonOrganizerAppProject",
"id": "6a5883ad0d613fd0ec6bf8a6ba02c448901f14cc",
"size"... |
__all__ = ["StreamCapturer","FileCapturer"]
from .StreamCapturer import StreamCapturer
from .FileCapturer import FileCapturer
| {
"content_hash": "0837c2de19761f1ec09742a8aa7418bf",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 43,
"avg_line_length": 21.5,
"alnum_prop": 0.7829457364341085,
"repo_name": "detorto/mariobot",
"id": "d3ec1cc0238ed5d23e81adc27e4f561eee4aad0c",
"size": "129",
"binary": ... |
"""Exceptions used in climatecontrol."""
class SettingsValidationError(ValueError):
"""Failed to validate settings."""
class SettingsLoadError(ValueError):
"""Settings file is neither path nor content."""
class ContentLoadError(SettingsLoadError):
"""Contents could not be loaded."""
class FileLoadEr... | {
"content_hash": "a37714ca6a07d06cd217138f02b91e26",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 79,
"avg_line_length": 24.80952380952381,
"alnum_prop": 0.7428023032629558,
"repo_name": "daviskirk/climatecontrol",
"id": "eb32e95d5d51e8bbec8d5f6010f82564110c9574",
"size... |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("modeladmintest", "0007_friend"),
]
operations = [
migrations.CreateModel(
name="SoloBook",
fields=[
(
... | {
"content_hash": "ed6538e98b3eaee24c18d1c4a8ca1601",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 68,
"avg_line_length": 27.264705882352942,
"alnum_prop": 0.39805825242718446,
"repo_name": "wagtail/wagtail",
"id": "f7b9689fa465d29f977b5fe9e08a860ca16e36f0",
"size": "977... |
class MongoHandler(object):
def insert(db,table,data):
print "Insert in mongo db" | {
"content_hash": "9d296349be2ab15c46644d0388573a01",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 34,
"avg_line_length": 23.5,
"alnum_prop": 0.6702127659574468,
"repo_name": "labs-js/air-check",
"id": "365f5b9e41d9672a66203d2e310bdc9c855bf0a6",
"size": "94",
"binary": ... |
import os
import sys
import collections
import unittest
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
BUILD_TOOLS_DIR = os.path.dirname(SCRIPT_DIR)
CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(BUILD_TOOLS_DIR)))
import mock
sys.path.append(BUILD_TOOLS_DIR)
import build_version
ProcInfo = c... | {
"content_hash": "12864edb755e695f4272fe15ca450057",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 79,
"avg_line_length": 28.92,
"alnum_prop": 0.7257952973720608,
"repo_name": "ric2b/Vivaldi-browser",
"id": "fdb9ec36ffd98d23df2460fb2fce240c6d5f02c7",
"size": "3082",
"... |
import pytest
from marshmallow import (
Schema,
fields,
pre_dump,
post_dump,
pre_load,
post_load,
validates,
validates_schema,
ValidationError,
EXCLUDE,
INCLUDE,
RAISE,
)
@pytest.mark.parametrize("partial_val", (True, False))
def test_decorated_processors(partial_val):... | {
"content_hash": "96f075a6928b9df50a150962f5142cae",
"timestamp": "",
"source": "github",
"line_count": 896,
"max_line_length": 87,
"avg_line_length": 34.526785714285715,
"alnum_prop": 0.5608675976208948,
"repo_name": "mwstobo/marshmallow",
"id": "0d2ffc6baff0c7f6002ed23a44950a25672bb65a",
"size": ... |
"""Test desiutil.census.
"""
import unittest
from unittest.mock import call, patch, Mock
class TestCensus(unittest.TestCase):
"""Test desiutil.census.
"""
@classmethod
def setUpClass(cls):
from os.path import dirname, join
cls.data_dir = join(dirname(__file__), 't')
@classmethod
... | {
"content_hash": "3e70d3917cca30bb59849ef1458269df",
"timestamp": "",
"source": "github",
"line_count": 213,
"max_line_length": 135,
"avg_line_length": 41.586854460093896,
"alnum_prop": 0.539173628358546,
"repo_name": "desihub/desiutil",
"id": "6dc3d43ba539f824be0a018a579f21ee20c1d488",
"size": "89... |
import os
import sys
import re
import msvc_common
if __name__ == '__main__':
script, workingDir, logPath, installDir, arch, rspPath = sys.argv
def shell_escape_path(path):
return path.replace(" ", "\\ ")
def link():
cmd = "link \"@%s\" > \"%s\" 2>&1 " % (rspPath, logPath)
exitc... | {
"content_hash": "5000beee9caa80e580a37301e78c55d7",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 69,
"avg_line_length": 23.945945945945947,
"alnum_prop": 0.5711060948081265,
"repo_name": "fifoforlifo/pynja",
"id": "83d19ce5dbadcb3da2fa3550dc5cec3664fd4236",
"size": "88... |
# -*- coding: utf-8 -*-
import pygame #@UnresolvedImport
from vec2d import vec2d
import os
class Creep(pygame.sprite.Sprite):
"""Representerar ett fiende-kryp."""
# Static
explosion_sound = None
def __init__(self, screen, img_filename, init_position,
... | {
"content_hash": "f7f9e9c62bbdb21be68205f7e2b3e777",
"timestamp": "",
"source": "github",
"line_count": 304,
"max_line_length": 112,
"avg_line_length": 21.220394736842106,
"alnum_prop": 0.5307704231902031,
"repo_name": "saintdragon2/python-3-lecture-2015",
"id": "e83c0ccabe04feccfb8f4a702d2bad8b19ecc... |
import errno
import logging.handlers
import json
import os
import socket
import subprocess
import sys
import gevent
from datetime import datetime
from threading import Timer
from send_alert import send_alert
WORKING_DIR = os.path.dirname(os.path.realpath(__file__))
ALERT_FILE_HEADING = 'alert_'
class PingTimeout... | {
"content_hash": "384edd26ec7fd30205a147e262fc3449",
"timestamp": "",
"source": "github",
"line_count": 307,
"max_line_length": 79,
"avg_line_length": 34.60912052117264,
"alnum_prop": 0.4896,
"repo_name": "tuaminx/ping_server",
"id": "9b2ca601a639592f2fdccd8e594fb0ca9b91d64f",
"size": "10625",
"b... |
import sys
from .event import ET
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
class EventWriter(object):
"""``EventWriter`` writes events and error messages to Splunk from a modular input.
Its two important methods are ``writeEvent``, which takes an ``Event``... | {
"content_hash": "8bffd51cf9fff7baacaa76783f453b02",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 100,
"avg_line_length": 30.285714285714285,
"alnum_prop": 0.6113207547169811,
"repo_name": "domeger/SplunkTAforPuppetEnterprise",
"id": "418405fcebbe1973af6365931619ed657ffa1... |
from __future__ import unicode_literals
from filer.models.imagemodels import Image
from cmsplugin_filer_tests_shared.base import (
BasePluginTestMixin, CmsPluginsFilerBaseTestCase,
)
class CmsPluginFilerVideoTestCase(BasePluginTestMixin,
CmsPluginsFilerBaseTestCase):
plugin... | {
"content_hash": "811141cd17181be27f300606dddd0131",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 71,
"avg_line_length": 29.105263157894736,
"alnum_prop": 0.6672694394213382,
"repo_name": "creimers/cmsplugin-filer",
"id": "8575a5c962ff8b1bbcefda954003d16c717ff0d6",
"siz... |
from django.shortcuts import render, redirect, get_object_or_404
from bootcamp.feeds.views import feeds
from django.contrib.auth.models import User
from bootcamp.feeds.models import Feed
from bootcamp.feeds.views import FEEDS_NUM_PAGES
from django.core.paginator import Paginator
from django.contrib.auth.decorators impo... | {
"content_hash": "0dd696c72de94f534c456d50fc2ef190",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 109,
"avg_line_length": 37.43571428571428,
"alnum_prop": 0.658271322266743,
"repo_name": "o5k/bootcamp-ihealth",
"id": "d237026fa5c2af47d4824d4584d41401ccf0e83a",
"size": ... |
from datetime import datetime
from person import Person
class Book(object):
def __init__(self, title):
self.created_at = datetime.now()
self.title = title
self.author = Person()
self.description = 'No Description available'
| {
"content_hash": "068dcceea413aed7b4959079e1560c17",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 53,
"avg_line_length": 23.90909090909091,
"alnum_prop": 0.6463878326996197,
"repo_name": "ReneVolution/pycologne-deserializing-using-python",
"id": "a38e5ed8b60b7ef4dfc73c5ae... |
"""End to end tests for lib.flows.general.memory."""
from grr.endtoend_tests import base
from grr.lib import aff4
from grr.lib import config_lib
from grr.lib import rdfvalue
class TestGrepMemory(base.AutomatedTest):
"""Test ScanMemory."""
platforms = ["Windows", "Darwin"]
flow = "ScanMemory"
test_output_pat... | {
"content_hash": "bf9468fa641e2422b32a83e1fa72e2f4",
"timestamp": "",
"source": "github",
"line_count": 138,
"max_line_length": 80,
"avg_line_length": 35.8768115942029,
"alnum_prop": 0.6822864067865078,
"repo_name": "ksmaheshkumar/grr",
"id": "98c5b5bfec6ac42db0d0ec220cf538aba75c6e77",
"size": "497... |
"""
Analysis Framework Presentation by Nathan
Motiviation
- Interact with data
- Easy access to many files
- Structure s.t. no code has to be rewritten, i.e. well-designed generic
base classes
- Standardized plots
Main features we discussed:
- Plotting methods of the analysis objects can take ax... | {
"content_hash": "ab63a7bb488efef90e79c8f4d09b2ce2",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 78,
"avg_line_length": 42.26315789473684,
"alnum_prop": 0.7210460772104608,
"repo_name": "QudevETH/PycQED_py3",
"id": "05e6cf7c6c9581b4eb81911ea748dcc036f410c1",
"size": "1... |
from .binary import BinaryModelWithShareParams as BinaryModel
from beastling.util import xml
class PseudoDolloCovarionModel(BinaryModel):
package_notice = ("Pseudo-Dollo Covarion", "Babel")
def __init__(self, model_config, global_config):
BinaryModel.__init__(self, model_config, global_config)
... | {
"content_hash": "bd238562deec9795122796d4da3cf7b4",
"timestamp": "",
"source": "github",
"line_count": 238,
"max_line_length": 96,
"avg_line_length": 37.57983193277311,
"alnum_prop": 0.5154293381037567,
"repo_name": "lmaurits/BEASTling",
"id": "ee45fc1a8f859a92118fa9bee16025b50d051db5",
"size": "8... |
import requests
from ..ontology_graph import IndraOntology
class VirtualOntology(IndraOntology):
"""A virtual ontology class which uses a remote REST service to perform
all operations. It is particularly useful if the host machine has limited
resources and keeping the ontology graph in memory is not desir... | {
"content_hash": "99c8f62ba30b3166014c0cd3224d2b9a",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 77,
"avg_line_length": 35.68627450980392,
"alnum_prop": 0.5807692307692308,
"repo_name": "bgyori/indra",
"id": "c31a737a35a4c48b3cfec344999b7b95c0d054e0",
"size": "1820",
... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.views.generic import TemplateView
from django.contrib.auth.decorators import user_passes_test
from core.views import HomePageView, DashboardView
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'cs490.views.home... | {
"content_hash": "c84d2515ae666579d8d51a237d08136d",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 68,
"avg_line_length": 37.95238095238095,
"alnum_prop": 0.6687578419071518,
"repo_name": "thebenwaters/openclickio",
"id": "1aa3e311d52d6925529d6fb4470ffe7b1ae95050",
"size... |
from __future__ import absolute_import
from copy import deepcopy
from uuid import uuid4
import six
from confluent_kafka import Producer
from django.conf import settings
from django.core import mail
from django.test.utils import override_settings
from exam import fixture
from freezegun import freeze_time
from sentry.... | {
"content_hash": "3220ee5bb655289151da43b3a0481525",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 99,
"avg_line_length": 35.43333333333333,
"alnum_prop": 0.6284101599247413,
"repo_name": "beeftornado/sentry",
"id": "f24a837e6ec32e428ae806d2473f00604c0b1c68",
"size": "5... |
__author__ = 'dorota'
# -*- coding: utf-8 -*-
from model.group import Group
import random
def test_delete_some_group(app, db, check_ui):
if len(db.get_group_list()) == 0:
app.group.create(Group(name = "test"))
old_groups = db.get_group_list()
group = random.choice(old_groups)
app.group.delete_... | {
"content_hash": "217a796d00fdca9dd45d652a5af2a2ac",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 113,
"avg_line_length": 34.77777777777778,
"alnum_prop": 0.645367412140575,
"repo_name": "dorotan/pythontraining",
"id": "5200e45f965883eb152b57a9d1a1ab35d8ba1fa2",
"size":... |
"""
The majority of this code is based/inspired or directly taken from
SublimeLinter plugin. Because that, SublimeLinter license file has
been added to this package.
This doesn't meant that anaconda is a fork of SublimeLinter in any
way or that anaconda is going to be updated with latest SublimeLinter
updates. Anacond... | {
"content_hash": "261fdae18565f1ba684a3650533c70de",
"timestamp": "",
"source": "github",
"line_count": 388,
"max_line_length": 79,
"avg_line_length": 32.654639175257735,
"alnum_prop": 0.5184688239936859,
"repo_name": "prisis/sublime-text-packages",
"id": "f011d6e3aae43bb853ffcdf36660b92a33c67759",
... |
import unittest
from datetime import time, timedelta
import pytest
from airflow import DAG, exceptions, settings
from airflow.exceptions import AirflowException, AirflowSensorTimeout
from airflow.models import DagBag, TaskInstance
from airflow.operators.bash import BashOperator
from airflow.operators.dummy_operator i... | {
"content_hash": "06fb62803f8fc70d42ea9dc609c36c16",
"timestamp": "",
"source": "github",
"line_count": 483,
"max_line_length": 97,
"avg_line_length": 35.86128364389234,
"alnum_prop": 0.5275099590092951,
"repo_name": "wileeam/airflow",
"id": "a575ee91a06aacb2cbb43fd6f1ea4757bec87d11",
"size": "1810... |
import logging
from cinder.scheduler import filters
LOG = logging.getLogger(__name__)
class IgnoreAttemptedHostsFilter(filters.BaseHostFilter):
"""Filter out previously attempted hosts
A host passes this filter if it has not already been attempted for
scheduling. The scheduler needs to add previously a... | {
"content_hash": "468e76c552d5b77f6e53bf0111f2e316",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 73,
"avg_line_length": 30.785714285714285,
"alnum_prop": 0.5699922660479505,
"repo_name": "apporc/cinder",
"id": "db1071d820acfba4f451311fbf62fd277910fc61",
"size": "1934",... |
from ...maths import (
parametricEllipse, parametricSuperEllipse,
parametricHippopede, parametricCassini)
from .arc import ArclikePathElement
class _EllipticPathElement(ArclikePathElement):
"""
Base PathElement for elliptic shapes.
"""
def initialize(self, **config):
super().initialize(**config)
self.hrad... | {
"content_hash": "9e906865d5df15bc6f28c0f6332dab67",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 78,
"avg_line_length": 22.864197530864196,
"alnum_prop": 0.7435205183585313,
"repo_name": "FCDM/py-dml",
"id": "4a82b45caa087450766a5d8b01afad6a9edb9157",
"size": "1852",
... |
from m5.defines import buildEnv
from m5.params import *
from m5.proxy import *
from System import System
class MipsSystem(System):
type = 'MipsSystem'
console = Param.String("file that contains the console code")
bare_iron = Param.Bool(False, "Using Bare Iron Mode?")
hex_file_name = Param.String("test... | {
"content_hash": "4718f32b29fb288452fe866bfe6abbb5",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 94,
"avg_line_length": 33.96296296296296,
"alnum_prop": 0.6706652126499455,
"repo_name": "liangwang/m5",
"id": "d271bd3872eab50cedcd155f8709da7693642e52",
"size": "2501",
... |
import os
from flask import Flask
from flask_sslify import SSLify
from scytale.views import bp
from scytale import jinja, login, models
def boolify(s):
if s.lower() == 'true':
return True
if s.lower() == 'false':
return False
raise ValueError("%s is not one of 'True' or 'False'" % s)
d... | {
"content_hash": "7cf1fc4858cf09d5ffa39d60c61644b7",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 62,
"avg_line_length": 19.547619047619047,
"alnum_prop": 0.5980511571254568,
"repo_name": "WilliamMayor/scytale.xyz",
"id": "ce05937649cc66b72d520069940225f099e8d620",
"siz... |
"""
This package includes tools to predict and plot neighborhoods.
"""
import nbdpred
| {
"content_hash": "902078aca5527bf946dafe6bfbd4a563",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 62,
"avg_line_length": 14.666666666666666,
"alnum_prop": 0.75,
"repo_name": "gautsi/gentrySeattle",
"id": "6cfd8dbf693fa9893b40d3705d62340001ab24e9",
"size": "88",
"binary... |
import logging
import tornado.escape
import tornado.ioloop
import tornado.options
import tornado.web
import tornado.websocket
import os.path
import uuid
from tornado.options import define, options
define("port", default=8888, help="run on the given port", type=int)
class Application(tornado.web.Application):
de... | {
"content_hash": "b608946ae7be3ba10a61cfadf87b9ff7",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 79,
"avg_line_length": 27.829545454545453,
"alnum_prop": 0.6153532053899551,
"repo_name": "dragondjf/DouyuApp",
"id": "570dc1ba50ddfe9d8680cd005a462f1e8c93321f",
"size": "3... |
import math, sys
import maya.OpenMaya as OpenMaya
import maya.OpenMayaMPx as OpenMayaMPx
import maya.OpenMayaAnim as OpenMayaAnim
kPluginNodeName = "brownie"
kPluginNodeId = OpenMaya.MTypeId(0x531AB36)
kPluginAuthor = "Bazillou2011"
kPluginVersion = "0.37"
nurbIntersect = OpenMaya.MNurbsIntersector()
surfMFn = OpenM... | {
"content_hash": "72b5ca19afd24b38a962f81036682db0",
"timestamp": "",
"source": "github",
"line_count": 544,
"max_line_length": 141,
"avg_line_length": 40.46139705882353,
"alnum_prop": 0.5270092226613966,
"repo_name": "cedricB/circeCharacterWorksTools",
"id": "dec4937c8e0655fa23e0f87fd965d7da57b16453... |
"""
Provides various string-related commands.
"""
import supybot
import supybot.world as world
# Use this for the version of this plugin. You may wish to put a CVS keyword
# in here if you're keeping the plugin in CVS or some similar system.
__version__ = "%%VERSION%%"
__author__ = supybot.authors.jemfinch
# This ... | {
"content_hash": "c4bf3b8efd361d63e2c2015b9dd2a2e6",
"timestamp": "",
"source": "github",
"line_count": 31,
"max_line_length": 78,
"avg_line_length": 25.774193548387096,
"alnum_prop": 0.7471839799749687,
"repo_name": "kblin/supybot-gsoc",
"id": "8dc45d5c061595f3fb6287b2d9527a004035fd3e",
"size": "2... |
"""module to run the harvester"""
import subprocess
class Theharvester():
"""module class"""
def __init__(self):
#init lists
self.theharvester_result = []
self.harvester_sources = ['google', 'linkedin']
def run(self, args, lookup, report_directory):
"""main function"""
... | {
"content_hash": "e6153e95018d7dec7ff8e061d62656a2",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 197,
"avg_line_length": 45.8,
"alnum_prop": 0.5664379288833438,
"repo_name": "bharshbarger/AutOSINT",
"id": "3783c679989c3fbe766c2c1768ef540511e6da33",
"size": "1625",
"b... |
from __future__ import absolute_import
import markdown
from django.utils.encoding import smart_unicode, smart_str
from django import forms
from django.utils.safestring import mark_safe
from django.forms import widgets, Select
from django.forms.fields import DateField
from django.db.models import Q
from coreExtend.mod... | {
"content_hash": "f8a94cc9d540c7c69feeca565a2599e6",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 164,
"avg_line_length": 42.75,
"alnum_prop": 0.693609022556391,
"repo_name": "underlost/Replica",
"id": "faa8aa5fdafc337a0b2a8355f1f023ccbd46330d",
"size": "4788",
"bina... |
import functools
import json
import logging
import os
import re
import shutil
import stat
import subprocess
import sys
import tempfile
from typing import (IO, Any, Callable, Iterable, List, MutableMapping, Text,
Tuple, Union, cast)
import shellescape
from . import docker
from .builder import Build... | {
"content_hash": "4878735c4deca7aaa4e482115e02cd1f",
"timestamp": "",
"source": "github",
"line_count": 496,
"max_line_length": 120,
"avg_line_length": 37.33467741935484,
"alnum_prop": 0.5476833351333837,
"repo_name": "SciDAP/cwltool",
"id": "60573cbad8e542f7aef5d36737b973310b3c5e67",
"size": "1851... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from hashlib import sha1
from pants.backend.jvm.targets.jar_library import JarLibrary
from pants.backend.jvm.tasks.jar_import_products import JarImportProdu... | {
"content_hash": "af30ed300f68566e5fbfeb401b9bb1f8",
"timestamp": "",
"source": "github",
"line_count": 257,
"max_line_length": 120,
"avg_line_length": 54.0739299610895,
"alnum_prop": 0.6869108440670648,
"repo_name": "fkorotkov/pants",
"id": "7873bba2fd3a76fb54c018cb1deb46195d3c1887",
"size": "1404... |
from rest_framework import permissions
from api.base.utils import get_user_auth
from api.comments.serializers import CommentReport
from website.models import Node, Comment
class CanCommentOrPublic(permissions.BasePermission):
def has_object_permission(self, request, view, obj):
assert isinstance(obj, (No... | {
"content_hash": "67afb97f802c8dd99b290cc775063a24",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 119,
"avg_line_length": 38,
"alnum_prop": 0.6638023630504833,
"repo_name": "hmoco/osf.io",
"id": "8d9ed751a8725ab95c938e80ab8625f00bd1c043",
"size": "1886",
"binary": fal... |
import os
import sys
import zmq
import pprint
import logging
logger = logging.getLogger("python_client")
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter("%(asctime)s - %(name)s - %(message)s")
ch.setFormatter(formatter)
logger.addHandler(ch)
if __na... | {
"content_hash": "a848652918b627f1eae69a6651685c49",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 81,
"avg_line_length": 26.235294117647058,
"alnum_prop": 0.6412556053811659,
"repo_name": "asimihsan/masspinger",
"id": "8d5caf1fec0038ff6c1c9ee20146e4889521d4f1",
"size": ... |
"""
test_django-publica-templates
------------
Tests for `django-publica-templates` models module.
"""
import unittest
from templates import models
from django.template import loader, Context
import test_settings as settings
from templates.utils.cache import get_cache_key
from templates.utils.template import check... | {
"content_hash": "8392ee25f75e4dec4f09ca910a2494e1",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 79,
"avg_line_length": 38.175824175824175,
"alnum_prop": 0.6462291306850892,
"repo_name": "publica-io/django-publica-templates",
"id": "58e725b27647b09cc5bab59f66adf6de48dfc8... |
from a10sdk.common.A10BaseClass import A10BaseClass
class Policy(A10BaseClass):
"""Class Description::
Manage WAF Policy files.
Class policy supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param uuid: {"description": "u... | {
"content_hash": "e9d258dc4e11432534b72a1abb7780f9",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 258,
"avg_line_length": 34.32432432432432,
"alnum_prop": 0.6307086614173228,
"repo_name": "a10networks/a10sdk-python",
"id": "4bfef0cdf3c0c9b33e1c83fc1ac8483e32d334b7",
"si... |
from Queue import Queue
from threading import Thread
from pyglet.window import mouse
import time
from pyglet.gl import *
import math
import numpy as np
import os
import random
import urllib2
import pyglet
from os.path import expanduser
from geoplotlib import utils
from geoplotlib.utils import BoundingBox, parse_raw_str... | {
"content_hash": "91a1e9ef6b00884109250a6c0f78ff71",
"timestamp": "",
"source": "github",
"line_count": 895,
"max_line_length": 142,
"avg_line_length": 35.67039106145251,
"alnum_prop": 0.5317462803445575,
"repo_name": "andrea-cuttone/geoplotlib",
"id": "a52769c2b7d998ca41514a6c9a26bdc090968ac0",
"s... |
import logging
from sn_agent.job.job_descriptor import JobDescriptor
from sn_agent.service_adapter import ServiceAdapterABC
logger = logging.getLogger(__name__)
class EntityExtracter(ServiceAdapterABC):
type_name = "EntityExtracter"
def perform(self, job: JobDescriptor):
item_count = 0
for ... | {
"content_hash": "2f637f956291d9bad6c79cc14b0084bb",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 54,
"avg_line_length": 31,
"alnum_prop": 0.5852534562211982,
"repo_name": "singnet/singnet",
"id": "f864b8bfd89653b31492adcb6493b9b1371bd7e8",
"size": "823",
"binary": fa... |
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
testinfo = "s, t 2, s, t 5.1, s, q"
tags = "ShakyTiles3D"
import pyglet
import cocos
from cocos.director import director
from cocos.actions import *
from cocos.layer import *
class BackgroundLayer(cocos.layer.Layer):
def __... | {
"content_hash": "43fb62cee13ef2412e292ec66364aa17",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 74,
"avg_line_length": 25.75,
"alnum_prop": 0.6446601941747573,
"repo_name": "eevee/cocos2d-mirror",
"id": "b6099a5d951542e95f83900a35bb5f6fe85d4674",
"size": "1103",
"bi... |
"""
Functions to convert between NMR file formats
"""
import datetime
from warnings import warn
import numpy as np
from . import pipe
from . import varian
from . import bruker
from . import sparky
from . import rnmrtk
from . import fileiobase
class converter(object):
"""
Object which allows conversion betw... | {
"content_hash": "d53b877f0b8e5e6ea595e6f34625f10e",
"timestamp": "",
"source": "github",
"line_count": 584,
"max_line_length": 142,
"avg_line_length": 30.65582191780822,
"alnum_prop": 0.5362229793889293,
"repo_name": "jjhelmus/nmrglue",
"id": "9e8188fd17273f2ae272d3ef6579b77891ed9199",
"size": "17... |
from __future__ import unicode_literals
import adminsortable.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('portfolio', '0014_auto_20170102_0508'),
]
operations = [
migrations.AlterField(
... | {
"content_hash": "2894441ce2b68c7cd78d1d4c4ff13d60",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 135,
"avg_line_length": 37.06153846153846,
"alnum_prop": 0.6093814860938148,
"repo_name": "Arlefreak/ApiArlefreak",
"id": "4a19f2f37f5f3faee70274b14593e80475d15b02",
"size"... |
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 'CellCountInstance'
db.create_table('main_cellcountinstance', (
('id', self.gf('django.db.models.fields.A... | {
"content_hash": "1f85e1292d1d1516d60b1933e7f30c01",
"timestamp": "",
"source": "github",
"line_count": 294,
"max_line_length": 182,
"avg_line_length": 66.55102040816327,
"alnum_prop": 0.5951650822855975,
"repo_name": "haematologic/cellcountr",
"id": "0a9464569fed2d9b71b1d6a54ba7193d20a6a0b0",
"siz... |
"""Unit test utilities for Google C++ Mocking Framework."""
__author__ = 'wan@google.com (Zhanyong Wan)'
import os
import sys
# Determines path to gtest_test_utils and imports it.
SCRIPT_DIR = os.path.dirname(__file__) or '.'
# isdir resolves symbolic links.
gtest_tests_util_dir = os.path.join(SCRIPT_DIR, '../googl... | {
"content_hash": "bcb05801918c5fc9600a55c200e2101d",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 79,
"avg_line_length": 26.358024691358025,
"alnum_prop": 0.7128805620608899,
"repo_name": "FALCONN-LIB/FALCONN",
"id": "b51300015a312d70a39a84486e43ba6a9118d9d1",
"size": "... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/ship/components/shield_generator/shared_shd_incom_rayshield_x1.iff"
result.attribute_template_id = 8
result.stfName("space/space_item","shd_incom_rayshield_x1_n")
#### BEGIN MODIFICATIONS ####
#### END MO... | {
"content_hash": "9a05f1a456c3a82ef9cafae5f0086abf",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 103,
"avg_line_length": 27.23076923076923,
"alnum_prop": 0.7175141242937854,
"repo_name": "obi-two/Rebelion",
"id": "ee1ffd23f541f4e0de1130c0d97b66fe3f3723c3",
"size": "499... |
import yaml
import os
import logging
import html2text
class HugoPrinter:
def __init__(self, *args, **kwargs):
accept_attributes = ["meta", "categories", "tags", "posts", "drafts", "basedir"]
for attr in accept_attributes:
setattr(self, attr, None)
for k, v in kwargs.items():
... | {
"content_hash": "1b34c51cddd0abcf684ac539cd4a8f5c",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 113,
"avg_line_length": 32.369565217391305,
"alnum_prop": 0.525520483546004,
"repo_name": "hzmangel/wp2hugo",
"id": "918ea548e4e30701d785269c63ef2bce7d6728dc",
"size": "297... |
from __future__ import absolute_import
# Copyright (c) 2010-2019 openpyxl
"""
Richtext definition
"""
from openpyxl.compat import unicode
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
Alias,
Typed,
Integer,
Set,
NoneSet,
Bool,
String,
Seq... | {
"content_hash": "6ae1ac20c3b0d3cc9e568d33629f4e9e",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 123,
"avg_line_length": 23.946236559139784,
"alnum_prop": 0.5273911091154019,
"repo_name": "kawamon/hue",
"id": "b3abf99d18c10223f864783b886cf09600ed1547",
"size": "4454",... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0002_auto_20150828_1427'),
]
operations = [
migrations.CreateModel(
name='LoginCode',
fields=[
(... | {
"content_hash": "269de330c184fa50fd5e6c0747ae0be4",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 114,
"avg_line_length": 32.13636363636363,
"alnum_prop": 0.5841584158415841,
"repo_name": "slava-sh/messenger",
"id": "16ff429a81608ccebbf46f4229806d10e0fc515c",
"size": "7... |
'''
Chosen plaintext attack
'''
import sys
import os
#Adding directory to the path where Python searches for modules
cmd_folder = os.path.dirname('/home/arvind/Documents/Me/My_Projects/Git/Crypto/modules/')
sys.path.insert(0, cmd_folder)
#Importing common crypto module
import block
if __name__ == "__main__":
plai... | {
"content_hash": "2e109872e7897e24ff56c65437f07cdb",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 89,
"avg_line_length": 27.96875,
"alnum_prop": 0.6067039106145251,
"repo_name": "arvinddoraiswamy/blahblah",
"id": "910581fc1d1f7d02fc540152b2258e9704acfaa8",
"size": "895"... |
from .canque import Submission # NOQA
| {
"content_hash": "3825403f8e786f62a302b340f0624515",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 38,
"avg_line_length": 39,
"alnum_prop": 0.7692307692307693,
"repo_name": "jonathansick/canque",
"id": "cf29ca9844e7b40ec4d098e3fd77f226a30cc946",
"size": "39",
"binary": ... |
"""
Volume driver for NetApp NFS storage.
"""
import os
import uuid
from oslo_log import log as logging
from oslo_utils import excutils
import six
from cinder import exception
from cinder.i18n import _
from cinder.image import image_utils
from cinder import interface
from cinder.objects import fields
from cinder imp... | {
"content_hash": "355e155c6565c3061b22a9d58aea50a5",
"timestamp": "",
"source": "github",
"line_count": 860,
"max_line_length": 79,
"avg_line_length": 43.30232558139535,
"alnum_prop": 0.5797261009667025,
"repo_name": "j-griffith/cinder",
"id": "fd1d1c6a61a132350f8569a30fc286349c88e33c",
"size": "38... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.