text stringlengths 4 1.02M | meta dict |
|---|---|
from nova import db
from nova import exception
from nova import objects
from nova.objects import base as obj_base
from nova.objects import fields
FLOATING_IP_OPTIONAL_ATTRS = ['fixed_ip']
# TODO(berrange): Remove NovaObjectDictCompat
class FloatingIP(obj_base.NovaPersistentObject, obj_base.NovaObject,
... | {
"content_hash": "b533c5a28cb1d318c678a8b08418360b",
"timestamp": "",
"source": "github",
"line_count": 220,
"max_line_length": 79,
"avg_line_length": 40.86818181818182,
"alnum_prop": 0.5796908019130241,
"repo_name": "affo/nova",
"id": "1b5fb98ce4575d2712454477990f375dfadbd2c9",
"size": "9600",
"... |
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.list_resource import ListResource
from twilio.base... | {
"content_hash": "09730189da9e834ec491d219eec44919",
"timestamp": "",
"source": "github",
"line_count": 237,
"max_line_length": 95,
"avg_line_length": 28.953586497890296,
"alnum_prop": 0.59895074322355,
"repo_name": "twilio/twilio-python",
"id": "c5205741da28f41f13a1187b70a888cb2a505dc7",
"size": "... |
import sys, os
import json
import cPickle as pck
import itertools as it
# external libraries
import numpy as np
from ray import imio, evaluate, morpho
import networkx as nx
def synapses_to_network(vol, syns):
"""Compute a wiring diagram from a volume and synapse locations."""
network = nx.MultiDiGraph()
f... | {
"content_hash": "ef624bd51644476f74efdac598d59a21",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 71,
"avg_line_length": 25.22222222222222,
"alnum_prop": 0.7026431718061674,
"repo_name": "jni/synapse-geometry",
"id": "6f5ae7d4f01e77a5cb33559691a2e930d68c2e66",
"size": "... |
'''
Python interface to the Spoke API. This is the reference documentation; see
the included README for a higher level overview.
'''
import re
from lxml import etree
import requests
__version__ = '1.0.24'
__all__ = ['Case', 'Comment', 'Image', 'OrderInfo', 'PackSlipCustomInfo', 'Spoke', 'ValidationError', ... | {
"content_hash": "1032808857df7babcf229be9afbcc869",
"timestamp": "",
"source": "github",
"line_count": 570,
"max_line_length": 171,
"avg_line_length": 32.940350877192984,
"alnum_prop": 0.5451640391989774,
"repo_name": "Threadless/python-spoke",
"id": "aece1ce9a3fa284fa459c0eccd323addf57c36ca",
"si... |
import time
import multiprocessing
from collections import namedtuple
from tmex import Session, TMEXException
Command = namedtuple('Command', ['command', 'deviceId'])
Result = namedtuple('Result', ['command', 'deviceId', 'result'])
def oneWireWorker(channel, port=0):
run = True
try:
session = Session... | {
"content_hash": "881a14af2d45d859b73e9e12ee60dbeb",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 91,
"avg_line_length": 35.52272727272727,
"alnum_prop": 0.5169545745361485,
"repo_name": "valnoverm/pytmex-git",
"id": "b0e94246b009a3534afa06cece2f43e532d05b1b",
"size": "... |
from allauth.utils import (import_attribute,
get_user_model,
valid_email_or_none)
import app_settings
class DefaultSocialAccountAdapter(object):
def pre_social_login(self, request, sociallogin):
"""
Invoked just after a user successfully authen... | {
"content_hash": "dd86471cfb4cd8b8cf8b80d1e9df5756",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 70,
"avg_line_length": 33.65217391304348,
"alnum_prop": 0.5742894056847545,
"repo_name": "Suite5/DataColibri",
"id": "266532126c0d549917105eb45e9be67d6f03ea3a",
"size": "15... |
"""Tool for uploading diffs from a version control system to the codereview app.
Usage summary: upload.py [options] [-- diff_options]
Diff options are passed to the diff command of the underlying system.
Supported version control systems:
Git
Mercurial
Subversion
It is important for Git/Mercurial users to spe... | {
"content_hash": "8d188ba4064e8a9c66995d8adbdbb9fe",
"timestamp": "",
"source": "github",
"line_count": 1758,
"max_line_length": 80,
"avg_line_length": 37.0358361774744,
"alnum_prop": 0.6240304719777604,
"repo_name": "stori-es/stori_es",
"id": "ff0657b83d2e83d9b2848c6c11d3e0ba94a492aa",
"size": "65... |
import logging
import isodate
import operator
from abc import ABCMeta, abstractmethod
from concurrent.futures import as_completed
from datetime import timedelta
import six
from azure.mgmt.costmanagement.models import (QueryAggregation,
QueryComparisonExpression,
... | {
"content_hash": "608b43f6f0e3abaaf25d9ded598d2eb6",
"timestamp": "",
"source": "github",
"line_count": 1011,
"max_line_length": 103,
"avg_line_length": 34.44015825914936,
"alnum_prop": 0.582268301789253,
"repo_name": "Sutto/cloud-custodian",
"id": "ac25259cd7340f2f8478a12b051fd056fee988ad",
"size"... |
import logging
import logging.handlers
import logging.config
#from maboss import config
log = logging.getLogger(__name__)
from .lazy_view import LazyView
#function view
def url(app, url_rule, import_name, **options):
view = LazyView('maboss.' + import_name)
app.add_url_rule(url_rule, view_func=view, **opti... | {
"content_hash": "07f58a9933aa88e39b778a26a63671e4",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 109,
"avg_line_length": 30.716666666666665,
"alnum_prop": 0.6044492674986435,
"repo_name": "mabotech/maboss.py",
"id": "7cad9d40128644d7121cd1fe8cb8cf3eae6a1709",
"size": "... |
import sys
from IPython.parallel import Client
rc = Client()
rc.block=True
view = rc[:]
view.run('communicator.py')
view.execute('com = EngineCommunicator()')
# gather the connection information into a dict
ar = view.apply_async(lambda : com.info)
peers = ar.get_dict()
# this is a dict, keyed by engine ID, of the c... | {
"content_hash": "da6e9e953e77d7d24549bcc26b37b6b3",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 88,
"avg_line_length": 31.74418604651163,
"alnum_prop": 0.6981684981684981,
"repo_name": "OSGeo-live/CesiumWidget",
"id": "865c80230e184282d0c24b284956406b193bdd78",
"size"... |
"""
========================================
Regression on continuous data (rER[P/F])
========================================
This demonstrates how rER[P/F]s - regressing the continuous data - is a
generalisation of traditional averaging. If all preprocessing steps
are the same, no overlap between epochs exists, and ... | {
"content_hash": "d28e460f15b0aafb47b9d3551a29431a",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 75,
"avg_line_length": 36.484375,
"alnum_prop": 0.6946466809421842,
"repo_name": "mne-tools/mne-tools.github.io",
"id": "ec3398ad205709cf368b2c939724265f4977c1b8",
"size": ... |
"""
A few bits of helper functions for comment views.
"""
import textwrap
try:
from urllib.parse import urlencode
except ImportError: # Python 2
from urllib import urlencode
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response, resolve_url
from django.template impor... | {
"content_hash": "16d23bc3fe7da25ae5ff32a05ed05077",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 79,
"avg_line_length": 29.057142857142857,
"alnum_prop": 0.6116027531956736,
"repo_name": "mdj2/django",
"id": "da70272282ec403492dabf50d81b4cd6d801aaa3",
"size": "2034",
... |
import datetime
from taskbuffer.DBProxy import DBProxy
import userinterface.Client as Client
# password
from config import panda_config
passwd = panda_config.dbpasswd
# time limit
timeLimit = datetime.datetime.utcnow() - datetime.timedelta(days=1)
# instantiate DB proxies
proxyS = DBProxy()
proxyS.connect('adbpro.us... | {
"content_hash": "6f9f3b3db2cdb6ac6b1abcd897a07914",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 100,
"avg_line_length": 24.26923076923077,
"alnum_prop": 0.7702060221870047,
"repo_name": "RRCKI/panda-server",
"id": "a646ea2028a7c7c62cdf538ac36b24981f435d6d",
"size": "6... |
import os
WATARU_BASE_DIR_PATH = os.path.abspath(os.path.dirname(__file__))
| {
"content_hash": "a0c35308ac480471185812a39f2aad2b",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 65,
"avg_line_length": 25.666666666666668,
"alnum_prop": 0.7142857142857143,
"repo_name": "risuoku/wataru",
"id": "cafc26777458f817863759d2ad2e4a9d0c158541",
"size": "77",
... |
import sys
from robot import utils
from .highlighting import AnsiHighlighter, Highlighter, NoHighlighting
from .loggerhelper import IsLogged
class CommandLineMonitor(object):
def __init__(self, width=78, colors='AUTO', markers='AUTO', stdout=None,
stderr=None):
self._writer = CommandLi... | {
"content_hash": "0c41a8c6c86ba25ddfb3f9524e9057f3",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 86,
"avg_line_length": 34.32367149758454,
"alnum_prop": 0.6015482054890922,
"repo_name": "qitaos/robotframework-mabot",
"id": "174dfd255b6221d2b7c0cd77c647e9d944d7712a",
"... |
import optparse
import subprocess
from kindled.controllers import DefaultController
def bootstrap():
""" Command Line Bootstrap Function """
usage = "%prog or type %prog -h (--help) for help"
description = "Kindled"
version = "v0.1"
parser = optparse.OptionParser(usage=usage, description=descr... | {
"content_hash": "963d32bb0c8da8b0707cae312339a949",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 103,
"avg_line_length": 30.796875,
"alnum_prop": 0.49670218163368846,
"repo_name": "jinglemansweep/Kindled",
"id": "d37cc4db7ca9252a79080747932b3810bde1fabc",
"size": "1971... |
"""The share snapshots api."""
from oslo_log import log
import six
import webob
from webob import exc
from manila.api import common
from manila.api.openstack import wsgi
from manila.api.views import share_snapshots as snapshot_views
from manila import exception
from manila.i18n import _, _LI
from manila import share
... | {
"content_hash": "d199986592a0c2731363c1465eb1a083",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 75,
"avg_line_length": 33.798816568047336,
"alnum_prop": 0.5948879551820728,
"repo_name": "jcsp/manila",
"id": "c5b9acf98af7685c452447178b7f3bd363559815",
"size": "6334",
... |
import os
class Articles(object):
def __init__(self, corpus):
self.corpus = corpus
self.index = dict()
self.articles_count = 0
self.docs_count = 0
def __iter__(self):
corpus = self.corpus
for sub in os.listdir(corpus):
subdir = os.path.join(corpus, sub)
for fname in os.listdir(subdir):
article... | {
"content_hash": "eaa59083b3e13fb44de4538c530c564f",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 81,
"avg_line_length": 27.4390243902439,
"alnum_prop": 0.6524444444444445,
"repo_name": "natsheh/semantic_query",
"id": "affc657836f344a1e9dc6609f5dbe2e53b4dc934",
"size": ... |
"""Logic related to handling dictionaries.
"""
__authors__ = [
'"Sverre Rabbelier" <sverre@rabbelier.nl>',
'"Lennard de Rijk" <ljvderijk@gmail.com>',
]
from google.appengine.ext import db
import datetime
DICT_TYPES = (db.StringProperty, db.IntegerProperty)
STR_TYPES = (datetime.datetime)
def filter(target... | {
"content_hash": "a4ea01cd301466967a53ed27b1686a94",
"timestamp": "",
"source": "github",
"line_count": 283,
"max_line_length": 77,
"avg_line_length": 23.996466431095406,
"alnum_prop": 0.6457075541157414,
"repo_name": "MatthewWilkes/mw4068-packaging",
"id": "1fb369ed76c1c04704d58aee0d62c813580340cd",... |
"""
This tool will invoke the AppRunner to execute a packaged p3d
application. It requires that that the current Panda3D and Python
versions match the version expected by the application.
Normally, you do not need to use this tool; instead, use the provided
standalone panda3d executable to invoke any p3d application... | {
"content_hash": "387569986349172fce37438f06d684da",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 79,
"avg_line_length": 31.31168831168831,
"alnum_prop": 0.6789713811696392,
"repo_name": "ToonTownInfiniteRepo/ToontownInfinite",
"id": "a7807de332f34f90d989c00fa82731520eb7b... |
import json
from oslo_config import cfg
from oslo_utils import importutils
import requests
import six
from heat.api.aws import ec2token
from heat.api.aws import exception
from heat.common import wsgi
from heat.tests import common
class Ec2TokenTest(common.HeatTestCase):
'''
Tests the Ec2Token middleware
... | {
"content_hash": "5908281b74b076c2e8dcc03f99de4eea",
"timestamp": "",
"source": "github",
"line_count": 546,
"max_line_length": 77,
"avg_line_length": 41.556776556776555,
"alnum_prop": 0.5415601586602027,
"repo_name": "rdo-management/heat",
"id": "006dc1f922b7e5a60e5a64ba829b1a6c2d84e3a1",
"size": ... |
import sublime
import sublime_plugin
import re
PATTERN = re.compile(
r'\s*(' +
r'(\(|\[|\{|\)|\]|\})|'
r'(\\?[\w$@]+[?!]?|\$)|' +
# double colon is for not ignoring colon at the end of string (php/python
# conflict)
r'(::|[^\w(){}\[\]])' +
r')\s*'
)
STATEMENT_OPEN = ['(', '{', '[']
STATEMENT_... | {
"content_hash": "558176edeb452608bcf2eed6f086065f",
"timestamp": "",
"source": "github",
"line_count": 509,
"max_line_length": 97,
"avg_line_length": 26.18664047151277,
"alnum_prop": 0.6171505739365294,
"repo_name": "shagabutdinov/sublime-statement",
"id": "dc595e4427cc37fee37be84be087a042afe070f9",... |
from netaddr import IPNetwork
import json
import logging
from pycalico import PyCalicoError
_log = logging.getLogger(__name__)
_log.addHandler(logging.NullHandler())
class AllocationHandle(object):
"""
An allocation handle tracks the blocks and number of addresses allocated
with a particular handle ID. ... | {
"content_hash": "ff7cd90d2164a4406254eead9b84a1d3",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 78,
"avg_line_length": 29.276923076923076,
"alnum_prop": 0.5559642669469259,
"repo_name": "caseydavenport/libcalico",
"id": "891989670e7a144f2c8108cbce2055e06789bbfb",
"si... |
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch.optim import lr_scheduler
import torch.utils.data as data
from torch.nn.utils.rnn import pack_padded_sequence as pack, pad_packed_sequence as unpack
import torchaudio
import torchaudio.trans... | {
"content_hash": "13c93cf7ddbf8ee3ac87d89b77be4f0b",
"timestamp": "",
"source": "github",
"line_count": 551,
"max_line_length": 138,
"avg_line_length": 33.524500907441016,
"alnum_prop": 0.5889995669120831,
"repo_name": "dhpollack/programming_notebooks",
"id": "978b011b224012b04df51bc99977125c401506f7... |
"""A module that provides support for the Covariance Matrix Adaptation
Evolution Strategy.
"""
import copy
import logging
import math
import numpy
import random # Only used to seed numpy.random
import sys # Used to get maxint
numpy.random.seed(random.randint(0, sys.maxint))
_logger = logging.getLogger("eap.c... | {
"content_hash": "6bd56da840762f6471f67e867deec9b7",
"timestamp": "",
"source": "github",
"line_count": 251,
"max_line_length": 80,
"avg_line_length": 43.63745019920319,
"alnum_prop": 0.44499223956906786,
"repo_name": "rainest/dance-partner-matching",
"id": "0729f45645c6e48d1e2c06f7e4a2f6693ab3a40b",... |
"""Runs a BigQuery TensorFlow connector benchmark."""
import time
from absl import app
from absl import flags
from google.cloud import bigquery
import tensorflow as tf
from tensorflow.python.framework import dtypes
from tensorflow_io.bigquery import BigQueryClient
FLAGS = flags.FLAGS
flags.DEFINE_string("project_id... | {
"content_hash": "c67eb716b0ef40777f6f597a32f45672",
"timestamp": "",
"source": "github",
"line_count": 156,
"max_line_length": 156,
"avg_line_length": 32.955128205128204,
"alnum_prop": 0.663100564092589,
"repo_name": "GoogleCloudPlatform/PerfKitBenchmarker",
"id": "dec08933a8176a24cb18b971f7c680b185... |
import os
import webob.dec
import webob.exc
from webob import Request
from webob import Response
from paste.deploy import loadapp
from wsgiref.simple_server import make_server
"""
A filter class factory shall be defined such that:
0. The factory method shall return the filter class itself. By design, the
filter doe... | {
"content_hash": "f5826ea5de7bc7f4240c5fc4249e093e",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 80,
"avg_line_length": 33.920245398773005,
"alnum_prop": 0.6332067281606077,
"repo_name": "sunrenjie/3rd-deadly-technotes",
"id": "6ceaf0675a349bfb7efdb8a7530cd04b0fba0da3",... |
from flask import Flask
from flask.ext.locale import Locale, translate
app = Flask(__name__)
# app.config['DEFAULT_LOCALE'] = 'zh_CN'
locale = Locale(app)
@app.route('/')
def hello():
return translate('Hello')
@locale.localeselector
def loader():
return 'en_US'
if __name__ == "__main__":
app.run(debu... | {
"content_hash": "fe19bde1a6c12fbf36705aa700410f11",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 46,
"avg_line_length": 16.4,
"alnum_prop": 0.6463414634146342,
"repo_name": "scardine/flask-locale",
"id": "c0a55149377a0b4e16541c9aee549439f7cbfebe",
"size": "328",
"bin... |
from builtins import object
class Module(object):
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module that will appear in module menus
'Name': 'Linux MimiPenguin',
# list o... | {
"content_hash": "65e8df738a0d5a7b55a4bf3947805da5",
"timestamp": "",
"source": "github",
"line_count": 318,
"max_line_length": 113,
"avg_line_length": 31.5188679245283,
"alnum_prop": 0.5548239050184576,
"repo_name": "byt3bl33d3r/Empire",
"id": "4dd8ee6e50c189aaf284ea9c281718c16b342a79",
"size": "1... |
from setuptools import setup, find_packages
import os
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.md')) as f:
README = f.read()
# FIXME: Also requires PyQt and SIP for the GUI, not available via pip
requires = [
'pycoin == 0.51',
'bunch',
'python-jsonrpc == 0... | {
"content_hash": "88cded49341f95d45682f10f41d4a199",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 73,
"avg_line_length": 26.75,
"alnum_prop": 0.6532710280373831,
"repo_name": "chromaway/ngcccbase",
"id": "3c6c895d9fe944f850aaf3001e94d5e3bbc42fda",
"size": "1168",
"bin... |
import click
class LogLevel(object):
ERROR = 'ER'
WARN = 'WN'
OK = 'OK'
class Logger(object):
LEVEL_COLORS = {
LogLevel.ERROR: 'red',
LogLevel.WARN: 'yellow',
LogLevel.OK: 'green',
}
def __init__(self, module_name):
self._module_name = module_name
def lo... | {
"content_hash": "911d24b43aa58c071588ab32630d8ed6",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 72,
"avg_line_length": 25.77777777777778,
"alnum_prop": 0.5301724137931034,
"repo_name": "gregflynn/dotsanity",
"id": "ae7daf29863b3cf5632793af98e91acb10ca9072",
"size": "1... |
try:
import unittest2 as unittest
except ImportError:
import unittest
import sourcemap
import json
class IntegrationTestCase(unittest.TestCase):
def get_fixtures(self, base):
source = open('tests/fixtures/%s.js' % base).read()
minified = open('tests/fixtures/%s.min.js' % base).read()
... | {
"content_hash": "211192db562139719999f83aac9349c1",
"timestamp": "",
"source": "github",
"line_count": 67,
"max_line_length": 81,
"avg_line_length": 33.47761194029851,
"alnum_prop": 0.5862683905483728,
"repo_name": "mattrobenolt/python-sourcemap",
"id": "87550764e4fdbe406aea5beb453b2a8a99fda953",
... |
from __future__ import print_function
from itertools import product
import os
import os.path as op
import warnings
from nose.tools import assert_raises, assert_true
import numpy as np
from numpy.testing import (assert_equal, assert_allclose)
from mne.datasets import testing
from mne.io import read_raw_fif, read_raw_... | {
"content_hash": "049c8d5917c736ca1fbe63de42e947bd",
"timestamp": "",
"source": "github",
"line_count": 397,
"max_line_length": 79,
"avg_line_length": 45.931989924433246,
"alnum_prop": 0.5861255826706883,
"repo_name": "nicproulx/mne-python",
"id": "2c7e0a88b8dc95000141ecd0042ab10f0f42b48b",
"size":... |
from sorl.thumbnail.engines.pil_engine import Engine as PILEngine
try:
from PIL import Image, ImageEnhance
except ImportError:
import Image
import ImageEnhance
from .base import WatermarkEngineBase
class Engine(WatermarkEngineBase, PILEngine):
"""PIL based thumbnailing engine with watermark support.... | {
"content_hash": "288f72707f06e62d3d8431693a24627f",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 82,
"avg_line_length": 38.3448275862069,
"alnum_prop": 0.6061151079136691,
"repo_name": "originell/sorl-watermark",
"id": "e60c298e6fa12e881a1c98728d350f4c3a8c984b",
"size"... |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "indaba.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "406771d8ce0e4ef56846db870569088e",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 70,
"avg_line_length": 25.22222222222222,
"alnum_prop": 0.7092511013215859,
"repo_name": "PyZim/indaba",
"id": "164d86f803ff0b05332c72727593dd889cc76718",
"size": "249",
"... |
import sys
import pyarrow as pa
from pyarrow import filesystem
import pytest
def test_filesystem_deprecated():
with pytest.warns(FutureWarning):
filesystem.LocalFileSystem()
with pytest.warns(FutureWarning):
filesystem.LocalFileSystem.get_instance()
@pytest.mark.skipif(sys.version_info < ... | {
"content_hash": "d7057fb39d5864fe0c4b3a737b3446b4",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 62,
"avg_line_length": 26.4,
"alnum_prop": 0.6454545454545455,
"repo_name": "cpcloud/arrow",
"id": "3d54f33e1f2fdd99ca8679fdadf8be46288a43e3",
"size": "2106",
"binary": f... |
from django.test import TestCase
from mailer.models import Message, MessageLog
from mailer.engine import send_all
import smtplib
sent_messages = []
class TestMailerEmailBackend(object):
def __init__(self, **kwargs):
global sent_messages
sent_messages = []
def open(self):
pass
d... | {
"content_hash": "351c1d73ba035c47723711d8d1267d36",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 108,
"avg_line_length": 35.76829268292683,
"alnum_prop": 0.6406409819297647,
"repo_name": "nai-central/django-mailer",
"id": "0c6a99b3252eaa913c541f3da03de1f8de1ab5c8",
"si... |
from __future__ import print_function
import re
import os
import sys
import time
import json
import subprocess
import shlex
import multiprocessing
import traceback
from argparse import ArgumentParser
from multiprocessing import Process
from threading import Thread
from threading import Lock
from pdb import set_trace
... | {
"content_hash": "65661ba4bbccc2ef36cab9348f2cd8c1",
"timestamp": "",
"source": "github",
"line_count": 382,
"max_line_length": 80,
"avg_line_length": 29.829842931937172,
"alnum_prop": 0.604212373848179,
"repo_name": "google/skia",
"id": "9823f15b93d52bc7eb71242536e855801cc18066",
"size": "12262",
... |
from oslo_log import log as logging
from aim import config as aim_cfg
from aim.tools.cli.groups import aimcli
from aim.tools.cli.commands import * # noqa
logging.register_options(aim_cfg.CONF)
aim = aimcli.aim
def run():
aim(auto_envvar_prefix='AIM')
if __name__ == '__main__':
run()
| {
"content_hash": "855a3fa0ca3ddad345718d4133236394",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 44,
"avg_line_length": 18.6875,
"alnum_prop": 0.6923076923076923,
"repo_name": "noironetworks/aci-integration-module",
"id": "015943ddf32b3b942ad21536f142cb3c7a4865c1",
"si... |
"""
Shows backlog count of ScheduledEmail
"""
from typing import Any
from django.core.management.base import BaseCommand
from django.utils.timezone import now as timezone_now
from zerver.models import ScheduledEmail
from datetime import timedelta
class Command(BaseCommand):
help = """Shows backlog count of Sch... | {
"content_hash": "91a55aef9d0b2093bb2d518b264bb7f5",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 82,
"avg_line_length": 28.423076923076923,
"alnum_prop": 0.7320703653585927,
"repo_name": "amanharitsh123/zulip",
"id": "8f9e5f94730c35c89fba08ef23adeb786d63f762",
"size": ... |
import os
import sys
import inspect
__version__ = 'git'
#{ Initialization
def _init_externals():
"""Initialize external projects by putting them into the path"""
if __version__ == 'git':
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'ext', 'gitdb'))
try:
import gitdb
exc... | {
"content_hash": "b9d995bbbba13a27eb7c543ff1256bbe",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 83,
"avg_line_length": 29.208333333333332,
"alnum_prop": 0.5834522111269614,
"repo_name": "expobrain/GitPython",
"id": "58e4e7b65856be98b39745cad8a83fe7b058dfb8",
"size": "... |
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()
setup(
name="Bernard J. Ortcutt",
... | {
"content_hash": "bb8af6e2e9ec2e49cc9d58c446affe37",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 65,
"avg_line_length": 30.666666666666668,
"alnum_prop": 0.5970496894409938,
"repo_name": "leviroth/bernard",
"id": "e769f41fd3cf1f70b8b113a9a0f24aed450647d0",
"size": "128... |
""" Tests for the backup service base driver. """
import uuid
import mock
from oslo_serialization import jsonutils
from cinder.backup import driver
from cinder import context
from cinder import db
from cinder import exception
from cinder import objects
from cinder import test
from cinder.tests.unit.backup import fak... | {
"content_hash": "67aafd9b9841c1ea05b8d69230b4f041",
"timestamp": "",
"source": "github",
"line_count": 357,
"max_line_length": 79,
"avg_line_length": 44.37535014005602,
"alnum_prop": 0.5530867314732988,
"repo_name": "nexusriot/cinder",
"id": "95ca2b446ea1ff9b515a10464b1ffd591b703a86",
"size": "164... |
from msrest.serialization import Model
class StartTask(Model):
"""A task which is run when a compute node joins a pool in the Azure Batch
service, or when the compute node is rebooted or reimaged.
:param command_line: The command line of the start task. The command line
does not run under a shell, a... | {
"content_hash": "8b049f51ae63a0609488a8b2edc82b6c",
"timestamp": "",
"source": "github",
"line_count": 66,
"max_line_length": 160,
"avg_line_length": 59.24242424242424,
"alnum_prop": 0.710230179028133,
"repo_name": "AutorestCI/azure-sdk-for-python",
"id": "fb42d05adbe72b04f93f021acd37fb1179d329fd",
... |
import tensorflow as tf # neural network for function approximation
import gym # environment
import numpy as np # matrix operation and math functions
from gym import wrappers
# GLOBAL SETTINGS
RNG_SEED = 2 # random number generator
ENVIRONMENT = "CartPole-v0"
# ENVIRONMENT = "CartPole-v1"
MAX_EPISODES = 1000
HIDDEN_L... | {
"content_hash": "af7a6bd4a86c8cd838f48b9753080a43",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 76,
"avg_line_length": 31.85496183206107,
"alnum_prop": 0.6484543493889289,
"repo_name": "GitYiheng/reinforcement_learning_test",
"id": "1ff2f9e60a161e3b73b6631ebc3d9b3f8a59... |
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('datastore', '0023_auto_20160525_2043'),
]
operations = [
migrations.RemoveField(
model_name=... | {
"content_hash": "5183b9bdfb26077ec991ff7a13bdfa27",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 98,
"avg_line_length": 29.928571428571427,
"alnum_prop": 0.5767700875099443,
"repo_name": "impactlab/oeem-energy-datastore",
"id": "d40a6de3e4e6e78aa9f21d3fb185f98b1a495ee8",... |
"""
Collects metrics on queues and queue consumers from PgQ, a PostgreSQL-based
queueing mechanism (part of the Skytools utilities released by Skype.)
#### Dependencies
* psycopg2
#### Example Configuration
```
enabled = True
[instances]
[[database1]]
dsn = postgresql://user:secret@localhost
[[database2]]
dsn =... | {
"content_hash": "d9d0cfc16bfbb72f29d19766abaefd5a",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 80,
"avg_line_length": 31.684684684684683,
"alnum_prop": 0.5899914700028434,
"repo_name": "tusharmakkar08/Diamond",
"id": "8697c57ecdcd0ff61f3214d9878a3c4d85168070",
"size... |
"""
Listening to the monkey automaton to open the closet
"""
import random
from evennia import DefaultScript
from evennia.utils import interactive
from ..state import BaseState
from .. import objects
GREETING = """
This is the situation, {name}:
The |rJester|n wants to win your village's yearly |wpie-eating... | {
"content_hash": "c9611087af928bc26f859844375d49b9",
"timestamp": "",
"source": "github",
"line_count": 391,
"max_line_length": 98,
"avg_line_length": 31.437340153452684,
"alnum_prop": 0.6548161405792385,
"repo_name": "evennia/evdemo",
"id": "af7677a2ad793fac2262f9eca3d233076dc73cef",
"size": "1229... |
from saml2.config import IdPConfig
from saml2.config import SPConfig
from saml2.mdstore import MetadataStore
__author__ = 'roland'
def load(insecure, conf, md_conf, typ):
try:
md_conf = conf["metadata"]
del conf["metadata"]
except KeyError:
pass
if typ == 'sp':
_cnf = SPC... | {
"content_hash": "acad17b33655caf80e84bb2690c7a37f",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 78,
"avg_line_length": 21.966666666666665,
"alnum_prop": 0.6145675265553869,
"repo_name": "rohe/saml2test2",
"id": "82443216e7b898c7a007d0e2dcddbe7ba96407b9",
"size": "659"... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('courses', '0006_questions'),
('orders', '0005_product_hola'),
]
operations = [
migrations.RemoveField(
... | {
"content_hash": "07e2fbf64de6d333ab7849c54c07ef10",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 137,
"avg_line_length": 26.291666666666668,
"alnum_prop": 0.5974643423137876,
"repo_name": "pauljherrera/avantiweb",
"id": "a7b45c022b3f6a6dbef59347fcfeb9c5150077d9",
"size... |
import functools
from pyrpc.exceptions import DuplicatedMethodError
from pyrpc.exceptions import DuplicatedServiceError
from pyrpc.exceptions import RPCMethodNotFound
__SERVICES = {}
def get_service(name):
service = __SERVICES.get(name)
if service is None:
raise RPCMethodNotFound
return service
... | {
"content_hash": "f9c42bcb12f961394aea64a79ac9232a",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 79,
"avg_line_length": 26.42391304347826,
"alnum_prop": 0.613739201974496,
"repo_name": "winstonf88/pyrpc",
"id": "86b59c1c987037bfe19b720c762e53a7d25d21d8",
"size": "2431"... |
from basicmvc.tests.basic_test import BasicTest
| {
"content_hash": "5478ae8ee0de32ab2535ad6120c40321",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 47,
"avg_line_length": 48,
"alnum_prop": 0.8541666666666666,
"repo_name": "LiorZ/pygame-mvc",
"id": "196b3031ec5e92932fb46e55911c4a99a37e4ce0",
"size": "48",
"binary": fal... |
from flask import redirect, Module, url_for, request
main = Module(__name__)
@main.route('/')
def index():
return redirect(url_for('zones.zones_list'))
| {
"content_hash": "c79dee85f327c2c04b047cfad5051d65",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 52,
"avg_line_length": 19.875,
"alnum_prop": 0.6729559748427673,
"repo_name": "sysbot/route53manager",
"id": "9d7f0655a541f45a97c5d8901a495898b61f6c49",
"size": "159",
"bi... |
"""
"""
import wikipedia
import pagegenerators, catlib, re, socket, sys
import base64
import struct
class ILO2InventoryBot:
def __init__(self, hosts_generator):
self.hosts_generator = hosts_generator
def run(self):
for page in self.hosts_generator:
if not "." in page.title(): continue
self.processpage(p... | {
"content_hash": "849fac10d06230c7324c04da9a6f0316",
"timestamp": "",
"source": "github",
"line_count": 344,
"max_line_length": 191,
"avg_line_length": 35.69767441860465,
"alnum_prop": 0.6215798045602606,
"repo_name": "sicekit/sicekit",
"id": "86e8902c953f3291f6a78c9b5731bccb68667c60",
"size": "123... |
import os
import sys
import pprint
def dump_environ():
print 'os.environ'
pprint.pprint(dict(os.environ))
print
print 'sys.path'
pprint.pprint(list(sys.path))
print
if __name__ == '__main__':
# from .. import submit_ext
# future = submit_ext('qbfutures.test.environ:dump_envi... | {
"content_hash": "662983c9e4c10649845f817801a0689f",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 123,
"avg_line_length": 26.608695652173914,
"alnum_prop": 0.6633986928104575,
"repo_name": "westernx/qbfutures",
"id": "659b922902cf969c2719c0254e17d9aeab911ea9",
"size": "... |
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
from .classifier import MILBoostClassifier
from .softmax import *
| {
"content_hash": "0e5af0fdbf04a9bbcb3728efaccebcd3",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 42,
"avg_line_length": 30.857142857142858,
"alnum_prop": 0.7824074074074074,
"repo_name": "hbldh/skboost",
"id": "6381a941869d4a3d60a70899d2b296dd4c91d10b",
"size": "216",
... |
from dateutil.parser import parse
from math import modf
from time import mktime
import csv
import StringIO
import sleepdebugger.config as config
from flask import Flask, request, flash, url_for, render_template, redirect, Response
from flask_debugtoolbar import DebugToolbarExtension
from influxdb import InfluxDBClient
... | {
"content_hash": "6a798b3b185cd0dd462b52a62ea07e38",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 131,
"avg_line_length": 33.27,
"alnum_prop": 0.6236850015028554,
"repo_name": "mayhem/sleep-debugger",
"id": "1aa360cad8a68b84a58d45839c78f2bb11176c24",
"size": "3350",
... |
from cloudferrylib.base.action import action
class SnapTransfer(action.Action):
def __init__(self, init, driver,
snap_position):
super(SnapTransfer, self).__init__(init)
self.driver = driver(self.src_cloud, self.dst_cloud)
self.snap_position = snap_position
def run(se... | {
"content_hash": "9617f7029ffaa73468106db5353139df",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 71,
"avg_line_length": 34.46153846153846,
"alnum_prop": 0.6473214285714286,
"repo_name": "mgrygoriev/CloudFerry",
"id": "8888aa1640da44f92b818bd902b60f9b02a571d4",
"size": ... |
import asyncio
import sys
import os
import logging
from colors import color
from bumble.device import Device
from bumble.transport import open_transport_or_link
# -----------------------------------------------------------------------------
async def main():
if len(sys.argv) < 2:
print('Usage: run_scanne... | {
"content_hash": "64f12fbbf75deb2ca40fb9b4d40f2c91",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 222,
"avg_line_length": 40.23076923076923,
"alnum_prop": 0.5587954110898662,
"repo_name": "google/bumble",
"id": "719e58edd13369b391eee74e9a9c74105dadee11",
"size": "2844",... |
from __future__ import absolute_import
import six
from sentry.api.serializers import Serializer, register
from sentry.models import GroupTagKey, TagKey
@register(GroupTagKey)
class GroupTagKeySerializer(Serializer):
def get_attrs(self, item_list, user):
tag_labels = {
t.key: t.get_label()
... | {
"content_hash": "2c0a709933a647aac468e6135cff9af4",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 99,
"avg_line_length": 27.7027027027027,
"alnum_prop": 0.5287804878048781,
"repo_name": "jean/sentry",
"id": "c2638a5a7fa4fac097dd9efc8b424e2e330b7205",
"size": "1025",
"... |
while True:
s = raw_input('command:')
if s == 'exit':
break
print 'Length of string is:', len(s)
else:
print 'I won\'t be executed'
print 'over'
| {
"content_hash": "ab2526bb0cbf37d238176762ce7c8484",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 40,
"avg_line_length": 22.125,
"alnum_prop": 0.536723163841808,
"repo_name": "Akagi201/learning-python",
"id": "598024d25ad4e0d937c9d71fc1a2659b1265cca9",
"size": "177",
"... |
from django.apps import AppConfig
class FinoteApiConfig(AppConfig):
name = 'finote_api'
| {
"content_hash": "ccbcff8d91a6b98dfc686de254e44e83",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 33,
"avg_line_length": 18.8,
"alnum_prop": 0.7553191489361702,
"repo_name": "kentaiwami/FiNote",
"id": "d71cf7da32304b6894e9736bd15535ae2b9a395d",
"size": "94",
"binary": ... |
import ctypes
import pathlib
# refer to https://realpython.com/python-bindings-overview
if __name__ == "__main__":
# Load the shared library into ctypes
libname = pathlib.Path().absolute() / "libtiny_util.so"
print("load " + str(libname))
c_lib = ctypes.CDLL(libname)
num = 2.3
ret = c_lib.rou... | {
"content_hash": "24e0102984baee65853f9ab0b3d60c42",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 78,
"avg_line_length": 26.08695652173913,
"alnum_prop": 0.6166666666666667,
"repo_name": "walterfan/snippets",
"id": "9a36dc9dfb210f2906941d28a39634c1b07cdcac",
"size": "60... |
import unittest
import mock
class TestConnection(unittest.TestCase):
@staticmethod
def _get_target_class():
from google.cloud.storage._http import Connection
return Connection
def _make_one(self, *args, **kw):
return self._get_target_class()(*args, **kw)
def test_extra_hea... | {
"content_hash": "52f6808289aabbb38604715ad1bf6880",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 76,
"avg_line_length": 32.88235294117647,
"alnum_prop": 0.5670840787119857,
"repo_name": "dstrockis/outlook-autocategories",
"id": "cb9344a16389b6d47c261f7626aa1e133347ff42",... |
from webtest import TestApp
from mapproxy.response import Response
from mapproxy.security.referrer import ReferrerFilter, NONE, SELF, REGEX
DENIED=404
class CheckApp(object):
def __init__(self):
self._called = False
def __call__(self, environ, start_response):
self._called = True
... | {
"content_hash": "71dbf0cc8ab7bd1b23749ffa1c1cc459",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 77,
"avg_line_length": 31.49411764705882,
"alnum_prop": 0.5353007097497199,
"repo_name": "Anderson0026/mapproxy",
"id": "f863a8bd79f9cc66515416935abddcf2f3d436d3",
"size": ... |
from .base import HPXMLtoHEScoreTranslatorBase
from .exceptions import TranslationError
def convert_to_type(type_, value):
if value is None:
return value
else:
return type_(value)
class HPXML2toHEScoreTranslator(HPXMLtoHEScoreTranslatorBase):
SCHEMA_DIR = 'hpxml-2.3.0'
def check_hpw... | {
"content_hash": "dc2daaeaa4074d787d8e487dc2b8e308",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 173,
"avg_line_length": 47.61827956989247,
"alnum_prop": 0.618606751721802,
"repo_name": "NREL/hescore-hpxml",
"id": "4b247126b45494cc9204f2b40bbcb4ce8ff7c20c",
"size": "8... |
import glob
import os
import shutil
import stat
import sys
from distutils import log
from distutils import dir_util
from distutils.command.build_clib import build_clib
from setuptools.command.sdist import sdist
from setuptools import setup
from distutils.sysconfig import get_python_lib
# prebuilt libraries for Window... | {
"content_hash": "bb922c237bd190374e5c77abee1ce34e",
"timestamp": "",
"source": "github",
"line_count": 199,
"max_line_length": 136,
"avg_line_length": 32.5929648241206,
"alnum_prop": 0.5630588960838729,
"repo_name": "fvrmatteo/capstone",
"id": "cf8cd2b0ecf74fb444f39da7893b3065ab228c1b",
"size": "6... |
from __future__ import unicode_literals
import unittest
try:
import mock
except ImportError:
import unittest.mock as mock
import contrail_api_cli.schema as schema
from contrail_api_cli.context import Context
from contrail_api_cli.resource import Resource, LinkedResources, LinkType, Collection
BASE = "http://l... | {
"content_hash": "217cd190b58b461fd2cb03a8a9094d62",
"timestamp": "",
"source": "github",
"line_count": 181,
"max_line_length": 108,
"avg_line_length": 42.027624309392266,
"alnum_prop": 0.546601814118575,
"repo_name": "eonpatapon/contrail-api-cli",
"id": "ba0105cdad80c6390ba5e5f077f3588d98610d77",
... |
from django.contrib.syndication.views import Feed
from articles.models import ArticleTranslation
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import get_language
from django.conf import settings
import datetime
class ArticleFeed(Feed):
title = hasattr... | {
"content_hash": "b29861bb27dae89e40b59ace73be38d6",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 150,
"avg_line_length": 39.142857142857146,
"alnum_prop": 0.7235401459854015,
"repo_name": "platypus-creation/django-articles",
"id": "577e1ce11e54f5bde151a77558ad7af8c0545c5... |
"""Tests for `pydzipimport`."""
#-----------------------------------------------------------------------------
# Copyright (C) 2012 Bradley Froehle <brad.froehle@gmail.com>
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#---------... | {
"content_hash": "103592dc1d4e19567768c05334052f84",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 79,
"avg_line_length": 33.432748538011694,
"alnum_prop": 0.5660311352107749,
"repo_name": "bfroehle/pydzipimport",
"id": "f8992a482d23de3a90915085ec3b1007c293a3ad",
"size"... |
import logging
from telemetry.core import exceptions
from telemetry.page import action_runner as action_runner_module
class TestNotSupportedOnPlatformError(Exception):
"""PageTest Exception raised when a required feature is unavailable.
The feature required to run the test could be part of the platform,
hardw... | {
"content_hash": "8ef2f9dd98140de1126446c1c09e396b",
"timestamp": "",
"source": "github",
"line_count": 195,
"max_line_length": 80,
"avg_line_length": 36.85128205128205,
"alnum_prop": 0.7086000556637907,
"repo_name": "Pluto-tv/chromium-crosswalk",
"id": "575c08c86a7c78c908e9ab9d3789f578a4c5ea67",
"... |
""".
This is info messages file, contains all the info messages for the service
"""
from flask import jsonify
from core.handlers.common_handlers import base_response, base_response_token
from core.handlers.common_handlers import base_response_user
from core.messages import successful_messages as info
from flask_api ... | {
"content_hash": "4a189d3aaa2cb7a772ed49ca03d82061",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 76,
"avg_line_length": 33.13095238095238,
"alnum_prop": 0.5749191519942508,
"repo_name": "pcu4dros/pandora-core",
"id": "28f423c23c1c62803ab657553e422c8896c1d130",
"size": ... |
"""
This module implements the configuration for handling CORS requests.
"""
import logging
import re
try:
from falcon import HTTP_METHODS
except ImportError:
from falcon import status_codes as HTTP_METHODS
from .middleware import CORSMiddleware
from .log import get_default_logger
class CORS(object):
""... | {
"content_hash": "7f49c1cc639af8386668503ca3e268ae",
"timestamp": "",
"source": "github",
"line_count": 456,
"max_line_length": 86,
"avg_line_length": 40.875,
"alnum_prop": 0.6118890498417298,
"repo_name": "lwcolton/falcon-cors",
"id": "d76cda46bc52c18c7057e43e20febb16f7f76bc2",
"size": "18639",
... |
import logging
import os
from typing import Any, Dict, Iterable, List, Optional
from fvcore.common.timer import Timer
from detectron2.data import DatasetCatalog, MetadataCatalog
from detectron2.data.datasets.lvis import get_lvis_instances_meta
from detectron2.structures import BoxMode
from detectron2.utils.file_io imp... | {
"content_hash": "d369af6eb8aba2e696c478d48db14ed6",
"timestamp": "",
"source": "github",
"line_count": 256,
"max_line_length": 99,
"avg_line_length": 36.00390625,
"alnum_prop": 0.6432678745795812,
"repo_name": "facebookresearch/detectron2",
"id": "b4af9fa292f445c81dc840ab53d07c1af313dfc7",
"size":... |
from src.model.Sort import Sort
from src.independent.typing_imports import *
class AltUniverseConfig(NamedTuple):
name: str
sort_copies: Dict[str,Sort]
"""
For SAFE and KISS, I THINK just need to simultaneously substitute:
SApp('Dimensioned',NonnegReal,'$'), for SApp('Dimensioned',NonnegReal,'jVar')
Lighte... | {
"content_hash": "d22afd87690b4071df5b56aaa0b50881",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 79,
"avg_line_length": 28.833333333333332,
"alnum_prop": 0.7312138728323699,
"repo_name": "legalese/legalese-compiler",
"id": "2a87aebea66107d15c58f9162a2b980f9d013b61",
"s... |
class UI(object):
def getInput(self, inputQuestion):
pass
def __printMenu(self,dOptionToFunction):
dKeyToOption = dict()
iCnt = 0
for sCurOption in dOptionToFunction:
dKeyToOption[str(iCnt)] = sCurOption[1]
print "%d for %s"%(iCnt, sCurOption[0])
iCnt+=1
return dKeyToOption
... | {
"content_hash": "45f6532bc16b62db22c4c110a35259ad",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 112,
"avg_line_length": 34.69230769230769,
"alnum_prop": 0.6452328159645233,
"repo_name": "ggianna/Foragers",
"id": "42c5065721c24090c5b2ecc924ff102f3250e476",
"size": "137... |
from __future__ import print_function
try: input = raw_input
except: pass
import sys
import csv
import re
#
# Read in distance matrices between raw, clean and perfect graphs for k=...
# output table: kmer,nkmers,raw_nkmers,raw_nreal,clean_nkmers,clean_nreal
#
def usage(argv,err=None):
if err is not None: print(err,... | {
"content_hash": "6d824e90a218bad0d49ef8fb917b853f",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 82,
"avg_line_length": 34.666666666666664,
"alnum_prop": 0.618421052631579,
"repo_name": "mcveanlab/mccortex",
"id": "10138a86e697ee349bdfdcd704f00f218f9d77c9",
"size": "19... |
'''
Contains the concrete implementation of Acssim.Servants.Representations.
BaseRepresentation.
This particular implementation stores method/attribute definitions stored by
the ACS CDB.
'''
#--REGULAR IMPORTS-------------------------------------------------------------
from operator import isSequenceType
from traceba... | {
"content_hash": "84e335913a016b4af95b5f599a0764dd",
"timestamp": "",
"source": "github",
"line_count": 257,
"max_line_length": 92,
"avg_line_length": 39.793774319066145,
"alnum_prop": 0.5341742446465239,
"repo_name": "csrg-utfsm/acscb",
"id": "b7b638c8ab37dba623441ffa272c18556a41efca",
"size": "11... |
"""Module for controlling a Wi-Fi interface using CoreWLAN.
https://developer.apple.com/library/mac/documentation/Networking/Reference/CoreWLANFrameworkRef/_index.html
"""
import logging
import os
import time
from . import cocoadialog
from . import defaults
# pylint: disable=g-import-not-at-top
try:
import objc
... | {
"content_hash": "d08b388d2a93ffeb8fbfa9476487ceeb",
"timestamp": "",
"source": "github",
"line_count": 309,
"max_line_length": 107,
"avg_line_length": 29.01294498381877,
"alnum_prop": 0.6982710540992749,
"repo_name": "netconstructor/macops",
"id": "eb834466a2e887bb8fedd48df4a3e95b45c3648e",
"size"... |
from decimal import Decimal
from django.core.validators import MinValueValidator
from django.db import models
from django.utils.translation import ugettext_lazy as _
PRICE_MAX_DIGITS = 22
PRICE_DECIMAL_PLACES = 10
class UnitPriceMixin(models.Model):
"""
Mixin to expose standardized "unit_price" and "unit" ... | {
"content_hash": "183a06c8df05924d2dcf017d872b114e",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 88,
"avg_line_length": 25.6734693877551,
"alnum_prop": 0.609697933227345,
"repo_name": "opennode/waldur-mastermind",
"id": "7aa1a668dedfded79020ab3646ab1a8c8c2343c2",
"size... |
from django.db import models
from markitup.fields import MarkupField
class Post(models.Model):
title = models.CharField(max_length=50)
body = MarkupField('body of post')
def __unicode__(self):
return self.title
class NoRendered(models.Model):
"""
Test that the no_rendered_field keyword a... | {
"content_hash": "fc20f8293f2c7353c1ce3e97ee8580c7",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 70,
"avg_line_length": 25.333333333333332,
"alnum_prop": 0.6973684210526315,
"repo_name": "sedden/pkg-python-django-markitup",
"id": "7a6a8cc98cdc5159783cafc62aeeb03f6d31c406... |
"""Collecting build artifacts from a Build Events JSON file.
This script will collect test result artifacts from a provided Build Events
JSON file and copy them to a destination directory.
See https://docs.bazel.build/versions/master/build-event-protocol.html
Both source BEP file and destination dir are expected to b... | {
"content_hash": "ebc6d14611a5a30931865f305ee6ab68",
"timestamp": "",
"source": "github",
"line_count": 196,
"max_line_length": 85,
"avg_line_length": 34.19897959183673,
"alnum_prop": 0.6603013576010741,
"repo_name": "google/asylo",
"id": "1226447e596f703ea15615db4ac2dcf0944a8590",
"size": "6703",
... |
from collections import defaultdict
import re
import sys
import time
sys.path.append('../..')
from crawler.crawler import crawl, itemFactory
from engine.data.database.databaseConnection import commit, rollback
from engine.data.database.sourceTable import addSource, sourceExists, urlToLookupId
from engine.data.database... | {
"content_hash": "a0fa3d23a400c1e594e2db7eb15a2939",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 89,
"avg_line_length": 27.435185185185187,
"alnum_prop": 0.6635167060411745,
"repo_name": "TobyRoseman/PS4M",
"id": "b56c67727479f76e91c529f10efa5d8a14aab7a2",
"size": "29... |
_version = "0.13.0"
_description = """
NOTES:
- the property names for the database are the union of those for
all molecules.
- missing property values will be set to 'N/A', though this can be
changed with the --missingPropertyVal argument.
- The property names may be altered on loadin... | {
"content_hash": "f85783a69c80ea6e32234adbdfe8bcb3",
"timestamp": "",
"source": "github",
"line_count": 442,
"max_line_length": 117,
"avg_line_length": 43.047511312217196,
"alnum_prop": 0.649760866137594,
"repo_name": "ptosco/rdkit",
"id": "f62f855dfad88d176fb47373cbb215dd457fedeb",
"size": "20726"... |
from __future__ import absolute_import
import unittest
import os
import io
import warnings
import logging
import uuid
import copy
import random
import json
import signac.contrib
import signac.common.config
from signac.common import six
from signac.errors import DestinationExistsError
from signac.errors import JobsCorr... | {
"content_hash": "549c85e3e6e1842a0a12f9704c2584dd",
"timestamp": "",
"source": "github",
"line_count": 873,
"max_line_length": 87,
"avg_line_length": 35.67124856815578,
"alnum_prop": 0.5757682797598022,
"repo_name": "csadorf/signac",
"id": "c5c7d766e62a8dd9d5e3185d83409fc0f10bfbcc",
"size": "31287... |
'''OpenGL extension SGIX.shadow_ambient
Automatically generated by the get_gl_extensions script, do not edit!
'''
from OpenGL import platform, constants, constant, arrays
from OpenGL import extensions
from OpenGL.GL import glget
import ctypes
EXTENSION_NAME = 'GL_SGIX_shadow_ambient'
_DEPRECATED = False
GL_SHADOW_AMBI... | {
"content_hash": "0ac225855d9532cea2a33de5c24aaebf",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 78,
"avg_line_length": 34.0625,
"alnum_prop": 0.7834862385321101,
"repo_name": "Universal-Model-Converter/UMC3.0a",
"id": "a2d8083e9a60cd128404da5d896051aef8cef837",
"size"... |
from .main import sg_hybrid_decrypt, sg_hybrid_encrypt, sg_hybrid_encrypt_with_auditlog
from .secondguard import RateLimitError, BadRequestError
| {
"content_hash": "b1417bf687bd94a88d788033ce7b7d8b",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 87,
"avg_line_length": 48.666666666666664,
"alnum_prop": 0.8287671232876712,
"repo_name": "secondguard/secondguard-python",
"id": "bf41356257a99de0ef5e645a52a5a4ba77bfcf73",
... |
from datetime import datetime
from binascii import hexlify
from gevent.event import Event
from steam.steamid import SteamID
from steam.enums import EFriendRelationship, EPersonaState, EChatEntryType
from steam.enums.emsg import EMsg
from steam.core.msg import MsgProto
class SteamUser(object):
"""
A data model ... | {
"content_hash": "a2ffd4cd3a6c5c5f9a7c659d8bfc1418",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 196,
"avg_line_length": 31.212903225806453,
"alnum_prop": 0.5725506407606449,
"repo_name": "ValvePython/steam",
"id": "1eebeeac3cd1209257ba440f776ecc39678ba0cb",
"size": "... |
"""
(2.5.3, 2.7.3) Exceptions for ticket validation failure responses
with the set of error codes that all CAS servers must implement.
"""
class ValidationError(Exception):
"""Base exception class for ticket validation failures."""
class InvalidRequest(ValidationError):
"""Not all of the required request pa... | {
"content_hash": "c43da06e59c68ea48e91ec786927e28d",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 72,
"avg_line_length": 27.537037037037038,
"alnum_prop": 0.7262945527908541,
"repo_name": "orbitvu/django-mama-cas",
"id": "dd1c707820a2d7671a398736f211bdc446f061dc",
"size... |
import abc
import six
@six.add_metaclass(abc.ABCMeta)
class ResourceBase(object):
"""Base class for resource."""
@abc.abstractmethod
def get_resource_extra_attributes(self, sample):
"""Extract the metadata from a ceilometer sample.
:param sample: The ceilometer sample
:returns: ... | {
"content_hash": "51b9977db2d88497f144c036f8a36b58",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 57,
"avg_line_length": 22.652173913043477,
"alnum_prop": 0.6487523992322457,
"repo_name": "idegtiarov/gnocchi-rep",
"id": "37d1ed70d82235f7c1a49ddea68852e9fd2fb9d0",
"size"... |
from boto.pyami.config import Config, BotoConfigLocations
from boto.storage_uri import BucketStorageUri, FileStorageUri
import boto.plugin
import datetime
import os
import platform
import re
import sys
import logging
import logging.config
import urlparse
from boto.exception import InvalidUriError
__version__ = '2.25.0... | {
"content_hash": "de6ec8093ae60313bbc470d5db752ee7",
"timestamp": "",
"source": "github",
"line_count": 899,
"max_line_length": 79,
"avg_line_length": 34.550611790878754,
"alnum_prop": 0.6497859051543736,
"repo_name": "dablak/boto",
"id": "0e2752892912912d06786cec2e7e65f464f30106",
"size": "32376",... |
"""
Writing data to a HDF partition.
"""
from copy import deepcopy
from functools import reduce
import json
import logging
import math
import time
import os
import re
from tables import open_file, StringCol, Int64Col, Float64Col, BoolCol, Int32Col
from tables.exceptions import NoSuchNodeError
import numpy as np
impo... | {
"content_hash": "0886b6ae40e82a4d9fd21d72859cc81e",
"timestamp": "",
"source": "github",
"line_count": 1022,
"max_line_length": 115,
"avg_line_length": 31.23972602739726,
"alnum_prop": 0.5464027312306199,
"repo_name": "CivicKnowledge/ambry_sources",
"id": "063eb62e91c84a0e469e6938defe368616de0129",
... |
import subprocess
from django.core.management.base import BaseCommand
from django.utils.encoding import force_str
from ngw.core.models import ContactMsg
class Command(BaseCommand):
help = 'Try to decrypt a message with an AES passphrase'
def add_arguments(self, parser):
parser.add_argument('msgid',... | {
"content_hash": "b11fe3e5731b2fcfef351c9a382398e9",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 60,
"avg_line_length": 27.885714285714286,
"alnum_prop": 0.6004098360655737,
"repo_name": "nirgal/ngw",
"id": "c7516dfe06395d7755e0c1de4459b04ca1fe8985",
"size": "976",
"... |
import os
import shutil
from distutils.command import build as build_module
from setuptools import setup, Command, Extension
import compiler
def _build_rpcz_proto():
compiler.generate_proto('../src/rpcz/proto/rpcz.proto', 'rpcz')
def _build_test_protos():
compiler.generate_proto('../test/proto/search.prot... | {
"content_hash": "e339da56a33c12b51193cdef953bc283",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 78,
"avg_line_length": 28.824324324324323,
"alnum_prop": 0.5785278949835911,
"repo_name": "reinfer/rpcz",
"id": "ab3d4a566de15583b443d826bf5f89d0829ac249",
"size": "2179",
... |
'''
Created on Dec 20, 2012
@author: rtermondt
'''
class WebFactionFixes(object):
"""Sets 'REMOTE_ADDR' based on 'HTTP_X_FORWARDED_FOR', if the latter is
set.
Based on http://djangosnippets.org/snippets/1706/
"""
def process_request(self, request):
if 'HTTP_X_FORWARDED_FOR' in request.... | {
"content_hash": "d1060079944686e12cd347bec5fbf5ae",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 75,
"avg_line_length": 23.526315789473685,
"alnum_prop": 0.6196868008948546,
"repo_name": "richtermondt/inithub-web",
"id": "642d8c8ac1b67e01c8ee0fa302fc4fa6a14c1455",
"siz... |
"""
<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>
A Mobilizer
"""
#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Standards.Walkers.Recruiter"
DecorationModuleStr="ShareYourSystem.Standards.Classors.Classer"
SYS.setSubModule(globa... | {
"content_hash": "956580c0598673c8177e8ffdc325cfc0",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 90,
"avg_line_length": 20.520661157024794,
"alnum_prop": 0.7249295207410391,
"repo_name": "Ledoux/ShareYourSystem",
"id": "d976ecb3602a083f624ee380b1080ffd975ea886",
"size... |
"""
==========================
Cython-Accelerated Metrics
==========================
:Authors:
Moritz E. Beber
:Date:
2016-04-21
:Copyright:
Copyright |c| 2016, Moritz E. Beber, all rights reserved.
:File:
__init__.py
.. |c| unicode: U+A9
"""
from __future__ import absolute_import
from .spatial imp... | {
"content_hash": "cfb1a9ad8f99ac9b72269002a04f6250",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 61,
"avg_line_length": 15.523809523809524,
"alnum_prop": 0.5368098159509203,
"repo_name": "Midnighter/nadist",
"id": "44062d2561ef90b474878da4e6f1bf2fb11db39f",
"size": "35... |
import logging
from sqlalchemy import Table, Column, Integer, String, DateTime, ForeignKey, Float, Numeric, Text
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, relationship
connection_string = ""
Base = declarative_base()
class Sa... | {
"content_hash": "af400703e85e4c9985d3be78e8c1416d",
"timestamp": "",
"source": "github",
"line_count": 255,
"max_line_length": 112,
"avg_line_length": 30.172549019607843,
"alnum_prop": 0.6785807122433065,
"repo_name": "UdS-TelecommunicationsLab/SDNalytics",
"id": "b61b3c7d7b9c572bbca51c7f4a6df7891c5... |
"""module to provide updating installing process function.
.. moduleauthor:: Xiaodong Wang <xiaodongwang@huawei.com>
"""
import logging
from compass.log_analyzor.line_matcher import LineMatcher, IncrementalProgress
from compass.log_analyzor.file_matcher import FileMatcher
from compass.log_analyzor.adapter_matcher ... | {
"content_hash": "80f7c62130b901aae78540abcc0bd890",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 78,
"avg_line_length": 44.62589928057554,
"alnum_prop": 0.46525874576817666,
"repo_name": "SysCompass/compass",
"id": "776f1f4107e46ca88c5e7ef7f184552a129b16ba",
"size": "... |
from __future__ import annotations
from typing import Literal, Mapping, Optional, Sequence, Union
from pydantic import BaseModel, Extra, Field, root_validator, validator
from datadog_checks.base.utils.functions import identity
from datadog_checks.base.utils.models import validation
from . import defaults, validator... | {
"content_hash": "8c8d2c8be8b7c66a66d3a9d631470b1d",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 110,
"avg_line_length": 26.992248062015506,
"alnum_prop": 0.6872487076392878,
"repo_name": "DataDog/integrations-core",
"id": "6eb6abfa206dd7aef4201819b67d4a47dbdb4adb",
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.