content stringlengths 4 20k |
|---|
""" People and Companies evolution per quarters """
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
from vizgrimoire.analysis.analyses import Analyses
from vizgrimoire.metrics.query_builder import DSQuery
from vizgrimoire.metrics.metrics_filter import MetricFilters
from vizg... |
from SipAddressHF import SipAddressHF
class SipReferTo(SipAddressHF):
hf_names = ('refer-to', 'r') |
from typing import List, NamedTuple
from marshmallow import Schema, fields
class ConfigOptionSchema(Schema):
"""Config Option Schema"""
key = fields.String(required=True)
value = fields.String(required=True)
class ConfigOption(NamedTuple):
"""Config option"""
key: str
value: str
class C... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import tests_common as common
from cpmoptimize import cpmoptimize, xrange
start = 32
step = 43
def naive(count):
res = 0
for elem in xrange(start, start + step * count, step):
res += elem
return res
def formula(count):
return (start * 2 + step... |
"""
Tests for L{twisted.conch.client.default}.
"""
try:
import Crypto.Cipher.DES3
import pyasn1
except ImportError:
skip = "PyCrypto and PyASN1 required for twisted.conch.client.default."
else:
from twisted.conch.client.agent import SSHAgentClient
from twisted.conch.client.default import SSHUserAuth... |
#!/usr/bin/env python
#
# Wrapper script for Java Conda packages that ensures that the java runtime
# is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128).
#
# Program Parameters
#
import os
import s... |
"""Utilties to deal with introspecting gGRC models for publishing, creation,
and update from resource format representations, such as JSON."""
from sqlalchemy.sql.schema import UniqueConstraint
from ggrc.utils import get_mapping_rules
from ggrc.utils import title_from_camelcase
from ggrc.utils import underscore_from_... |
import shapefile
from shapely.geometry import *
class assignIDs():
def assignIDsMethod(self, idShapeFile):
# Generate a list of Shapely polygons from the coordinates of the boundary-ID polygons.
self.boundaryIDList = []
self.idShapeFile = idShapeFile
self.IDPolygons = []
if idShapeFile:
for j in rang... |
from __future__ import unicode_literals
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'j. F Y H:i:s'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j. F'
SHORT_DATE_FORMAT = 'd.m.Y'
SHORT_DATETIME_FORMAT = 'd.m.Y H:i:s'
FIRST_DAY_OF_WEEK = 1 # Monday
# The *_INPUT_FORMATS strings use the Python strfti... |
import syslog
import os.path
import re
import tempfile
def is_pubkey(string):
"""Verifies if string is a pubkey"""
pgp_regex = ".*?(-----BEGIN PGP PUBLIC KEY BLOCK-----.*?-----END PGP PUBLIC KEY BLOCK-----).*"
return re.match(pgp_regex, string, re.DOTALL)
class RpmKey:
def __init__(self, module):
... |
import os
import pipes
from ansible.utils import template
from ansible import utils
from ansible import errors
from ansible.runner.return_data import ReturnData
import base64
class ActionModule(object):
TRANSFERS_FILES = True
def __init__(self, runner):
self.runner = runner
def run(self, conn, t... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import url
from django.contrib import admin
from django.db.models import Sum
from django.forms import models, ValidationError
from django.http import HttpResponse
from django.template.loader import select_template
from django.urls im... |
import mock
import pecan
import unittest
from webob import exc
from st2common.models.api import base
class FakeModel(base.BaseAPI):
model = None
schema = {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"a": {"type": "string"}
... |
from ... import Parser, parser
from .. import get_active_lines
@parser('systemctl_list-unit-files')
class UnitFiles(Parser):
"""
A parser for working with data gathered from `systemctl list-unit-files` utility.
"""
def __init__(self, *args, **kwargs):
self.services = {}
"""dict: Dictio... |
# script to generate the generateKey tests
import os
here = os.path.dirname(__file__)
successes_html = """<!DOCTYPE html>
<meta charset=utf-8>
<meta name="timeout" content="long">
<title>WebCryptoAPI: generateKey() Successful Calls</title>
<link rel="author" title="Charles Engelke" href="mailto:<EMAIL>">
<link rel="... |
def get_view_builder(req):
base_url = req.application_url
return ViewBuilder(base_url)
class ViewBuilder(object):
"""ViewBuilder for QoS, derived from neutron.views.networks."""
def __init__(self, base_url):
"""Initialize builder.
:param base_url: url of the root wsgi application
... |
"""
===========================================
Sparse coding with a precomputed dictionary
===========================================
Transform a signal as a sparse combination of Ricker wavelets. This example
visually compares different sparse coding methods using the
:class:`sklearn.decomposition.SparseCoder` esti... |
import time
from ddapp import segmentationroutines
from ddapp import segmentation
from ddapp.timercallback import TimerCallback
from ddapp.visualization import *
class TrackDrillOnTable(object):
def __init__(self):
self.tableCentroid = None
def updateFit(self):
# get and display: .1sec
... |
from m5.params import *
from CheckerCPU import CheckerCPU
class DummyChecker(CheckerCPU):
type = 'DummyChecker'
cxx_header = 'cpu/dummy_checker.hh' |
"""\
====================================
Lossy connections between components
====================================
A component that passes on any data it receives, but will throw it away if the
next component's inbox is unable to accept new items.
Example Usage
-------------
Using a lossy connector to drop excess ... |
#!/usr/bin/env python
# encoding: utf-8
"""
binary_tree_inorder.py
Created by Shengwei on 2014-07-04.
"""
# https://oj.leetcode.com/problems/binary-tree-inorder-traversal/
# tags: easy, tree, traversal, dfs
"""
Given a binary tree, return the inorder traversal of its nodes' values.
For example:
Given binary tree {1... |
import unittest2 as unittest
from webkitpy.common.system.filesystem_mock import MockFileSystem
from webkitpy.common.system.outputcapture import OutputCapture
from webkitpy.common.net.layouttestresults import LayoutTestResults
from webkitpy.common.host_mock import MockHost
from .layouttestresultsreader import LayoutTe... |
from oslo_utils import timeutils
from sqlalchemy import DateTime, Enum, Integer, String, ForeignKeyConstraint
from sqlalchemy.schema import Column, MetaData, Table
from sqlalchemy.sql import select
from migrate.changeset.constraint import UniqueConstraint
from designate import utils
from designate.sqlalchemy.types im... |
Import ('plugin_base')
Import ('env')
PLUGIN_NAME = 'rasterlite'
plugin_env = plugin_base.Clone()
plugin_sources = Split(
"""
%(PLUGIN_NAME)s_datasource.cpp
%(PLUGIN_NAME)s_featureset.cpp
""" % locals()
)
# Link Library to Dependencies
libraries = [env['PLUGINS']['rasterlite']['lib']]
libraries.append(env['... |
from zorg.driver import Driver
from PIL import Image
import pytesseract
class OCR(Driver):
def __init__(self, options, connection):
super(OCR, self).__init__(options, connection)
# An attribute to hold the last text item read by the camera
self.text_cache = ""
self.commands = [
... |
"""The binary_sensor tests for the nexia platform."""
from homeassistant.const import STATE_OFF, STATE_ON
from .util import async_init_integration
async def test_create_binary_sensors(hass):
"""Test creation of binary sensors."""
await async_init_integration(hass)
state = hass.states.get("binary_senso... |
from __future__ import unicode_literals
from django.db import migrations
from django.utils import six
class MigrationOptimizer(object):
"""
Powers the optimization process, where you provide a list of Operations
and you are returned a list of equal or shorter length - operations
are merged into one i... |
"""
Tutorial - Multiple objects
This tutorial shows you how to create a site structure through multiple
possibly nested request handler objects.
"""
import cherrypy
class HomePage:
def index(self):
return '''
<p>Hi, this is the home page! Check out the other
fun stuff on this si... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.compat.tests import unittest
from ansible.errors import AnsibleError
from ansible.parsing import vault
from ansible.parsing.yaml.loader import AnsibleLoader
# module under test
from ansible.parsing.yaml import objec... |
STATUS_ETH_RUNNING = "10"
STATUS_FS_HEALTH = "1"
STATUS_FS_RUNNING = "27"
STATUS_FSSNAPSHOT_HEALTH = '1'
STATUS_JOIN_DOMAIN = '1'
STATUS_EXIT_DOMAIN = '0'
STATUS_SERVICE_RUNNING = "2"
QOS_STATUSES = (STATUS_QOS_ACTIVE,
STATUS_QOS_INACTIVATED,
STATUS_QOS_IDLE) = ('2', '45', '46')
DEFAUL... |
# Note: Work in progress
from __future__ import absolute_import
import os
import os.path
import re
import codecs
import textwrap
from datetime import datetime
from functools import partial
from collections import defaultdict
from xml.sax.saxutils import escape as html_escape
try:
from StringIO import StringIO
exc... |
import os, sys, time
# usage: parse_log.py log-file [socket-index to focus on]
socket_filter = None
if len(sys.argv) >= 3:
socket_filter = sys.argv[2].strip()
if socket_filter == None:
print "scanning for socket with the most packets"
file = open(sys.argv[1], 'rb')
sockets = {}
for l in file:
if not 'our_d... |
from osv import fields, osv
class account_payment_term_type(osv.osv):
_name = 'account.payment.term.type'
_description = 'Payment term type list'
_columns = {
'name' : fields.char('Codice', size=16),
'description' : fields.char('Descrizione', size=64),
}
account_payment_term_type()
class account_payment... |
__author__ = 'traff'
import os
import sys
import tempfile
import threading
from _prof_imports import pkgutil, Stats, FuncStat, Function
try:
execfile=execfile #Not in Py3k
except NameError:
#We must redefine it in Py3k if it's not already there
def execfile(file, glob=None, loc=None):
if glob is ... |
#! /usr/bin/env python
import rospy, math
import sys, termios, tty, select, os
from geometry_msgs.msg import Twist
from std_msgs.msg import UInt16
import sys
from geometry_msgs.msg import Point, Pose, Quaternion, Twist, Vector3
import signal
from GestureModel import*
from Creator import*
from Classifier import*
from nu... |
from django.template import defaultfilters as filters
from django.utils.translation import pgettext_lazy
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy
from horizon import tables
from horizon.utils import filters as utils_filters
from openstack_dashboard im... |
""" The interface for an interactive Python shell. """
# Enthought library imports.
from enthought.traits.api import Event
# Local imports.
from key_pressed_event import KeyPressedEvent
from i_widget import IWidget
class IPythonShell(IWidget):
""" The interface for an interactive Python shell. """
#### 'IP... |
#!/usr/bin/env python3
# coding=utf-8
"""
This module is used to configure the host in the database it creates host entry and configures root folders
"""
import argparse
import logging
import socket
import sys
from sqlalchemy import create_engine
from sqlalchemy.exc import OperationalError
from sqlalchemy.orm import s... |
from tempest.api.compute import base
from tempest import test
class AbsoluteLimitsTestJSON(base.BaseV2ComputeTest):
_interface = 'json'
@classmethod
def setUpClass(cls):
super(AbsoluteLimitsTestJSON, cls).setUpClass()
cls.client = cls.limits_client
@test.attr(type='gate')
def tes... |
import discord
from discord.ext import commands
import random
description = '''An example bot to showcase the discord.ext.commands extension
module.
There are a number of utility commands being showcased here.'''
bot = commands.Bot(command_prefix='?', description=description)
@bot.event
async def on_ready():
pri... |
"""This module is deprecated. Please use `airflow.providers.slack.operators.slack_webhook`."""
import warnings
# pylint: disable=unused-import
from airflow.providers.slack.operators.slack_webhook import SlackWebhookOperator # noqa
warnings.warn(
"This module is deprecated. Please use `airflow.providers.slack.op... |
# coding: utf-8
# In[6]:
#TCP ftotal
import os
import pandas as pd
import matplotlib.pyplot as plt
import seaborn
seaborn.set()
path= os.path.expanduser("~/Desktop/ece671/ntcp3")
num_files = len([f for f in os.listdir(path)if os.path.isfile(os.path.join(path, f))])
print(num_files)
t3=[]
i=0
def file_len(fname):
... |
'''
This code is forked from https://github.com/fchollet/keras/blob/master/examples/mnist_mlp.py
and modified to use as MXNet-Keras integration testing for functionality and sanity performance
benchmarking.
Trains a simple deep NN on the MNIST dataset.
Gets to 98.40% test accuracy after 20 epochs
(there is *a lot* of... |
from openerp import tools
from openerp.osv import fields, osv
from .. import hr_recruitment
from openerp.addons.decimal_precision import decimal_precision as dp
class hr_recruitment_report(osv.Model):
_name = "hr.recruitment.report"
_description = "Recruitments Statistics"
_auto = False
_rec_name = 'd... |
__all__ = []
import os
import sys
import socket
import threading
import _multiprocessing
from multiprocessing import current_process
from multiprocessing.forking import Popen, duplicate, close, ForkingPickler
from multiprocessing.util import register_after_fork, debug, sub_debug
from multiprocessing.connection import... |
"""Bibencode daemon submodule"""
import os
import re
import shutil
from invenio.jsonutils import json_decode_file
from invenio.bibencode_utils import generate_timestamp, getval
from invenio.bibtask import (
task_low_level_submission,
task_get_task_param,
... |
"""Generate __all__ from a module docstring."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import re as _re
import sys as _sys
from tensorflow.python.util import tf_inspect as _tf_inspect
_reference_pattern = _re.compile(r'^@@(\w+)$', flags=_re.MULTI... |
import logging
import psycopg2
import psycopg2.extras
import psycopg2.extensions as ext
import sqlparse
from .packages import pgspecial as special
from .encodingutils import unicode2utf8, PY2
_logger = logging.getLogger(__name__)
# Cast all database input to unicode automatically.
# See http://initd.org/psycopg/docs/... |
import logging
from queue import Queue
from threading import Thread
logger = logging.getLogger('analyser.reactor')
class Reactor(object):
"""
Kicks off the thread which accepts requests on the queue where each request is a 2 item tuple ( request type,
tuple of args )
"""
def __init__(self, name=... |
import importlib
from django.conf import settings
from django.contrib.sitemaps import ping_google
from django.core.mail import send_mail
from django.db import models
DESCRIPTION_HELP_TEXT = ("Please consider filling this field to provide "
"proper information to social media, e.g.: Facebook share. This "
"desc... |
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
class SessionManager(models.Manager):
use_in_migrations = True
def encode(self, session_dict):
"""
Return... |
"""Variables. See the @{python/state_ops} guide.
@@Variable
@@global_variables
@@local_variables
@@model_variables
@@trainable_variables
@@moving_average_variables
@@global_variables_initializer
@@local_variables_initializer
@@variables_initializer
@@is_variable_initialized
@@report_uninitialized_variables
@@assert_va... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# only needed if not using gunicorn gevent
if __name__ == '__main__':
import gevent.monkey
gevent.monkey.patch_all()
# start new relic if instructed to do so
from .extensions import factory
from .extras import enewrelic
from .server import env
enewrelic.boot(env.s... |
{
'name': 'Google Drive™ integration',
'version': '0.2',
'author': 'OpenERP SA',
'website': 'https://www.odoo.com',
'category': 'Tools',
'installable': True,
'auto_install': False,
'data': [
'security/ir.model.access.csv',
'res_config_user_view.xml',
'google_drive... |
from spack import *
import os
class Memkind(AutotoolsPackage):
"""The memkind library is a user extensible heap manager built on top of
jemalloc which enables control of memory characteristics and a partitioning
of the heap between kinds of memory. The kinds of memory are defined by
operating system m... |
# encoding=utf-8
import time
import numpy
import logging
from .basebot import DIRECTIONS, LightCycleBaseBot
from .worker import RemoteInstance
logger = logging.getLogger(__name__)
class LightCycleArena(object):
PLAYING = 0
LOST = 1
WINNER = 2
def __init__(self, players, width=100, height=100):
... |
import os
import sys
PY3 = sys.version_info[0] == 3
class ShamirSecret(object):
"""
This performs Shamir Secret Sharing operations in an incremental way
that is useful for PolyPasswordHasher. It allows checking membership, genering
shares one at a time, etc.
Creates an object. One must provide... |
import errno
import hashlib
import hmac
import os
import time
from six.moves import configparser
from swift import gettext_ as _
from swift.common.utils import get_valid_utf8_str
class ContainerSyncRealms(object):
"""
Loads and parses the container-sync-realms.conf, occasionally
checking the file's mtim... |
from __future__ import print_function
import unittest
import numpy as np
from op_test import OpTest
class TestMultiplexOp(OpTest):
def setUp(self):
self.op_type = "multiplex"
rows = 4
index = np.arange(0, rows).astype('int32')
np.random.shuffle(index)
index = np.reshape(in... |
#!/usr/bin/env python
'''
$Id: tzfile.py,v 1.8 2004/06/03 00:15:24 zenzen Exp $
'''
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
from datetime import datetime, timedelta
from struct import unpack, calcsize
from pytz.tzinfo import StaticTzInfo, DstTzInfo, memorized_ttinfo
fro... |
#!/usr/bin/python
import argparse
import rosbag
import rospy
import cv2
from geometry_msgs.msg import PoseStamped
from nav_msgs.msg import Odometry
from cv_bridge import CvBridge, CvBridgeError
import os
# only required for simulated scenes
try:
import OpenEXR, Imath
import numpy as np
except ImportError, e:
... |
import Image as pil
from numpy import load, uint8
# ============= standard library imports ========================
# ============= local library imports ==========================
def main():
im = load('/Users/ross/Desktop/image_uint32.npy')
print im.shape, im.dtype
raw = im.view(uint8).reshape(im.shape... |
#
# providers.py
#
# script to be invoked via
#
# cd <your-buildout-root-dir>
# bin/instance run src/pcp.cregsync/src/pcp/cregsync/providers.py
#
# run with --help to see available options
import logging
from Products.PlonePAS.utils import cleanId
from pcp.cregsync import utils
from pcp.cregsync import config
def... |
"""Module to handle /pkgs"""
import httplib
import logging
import urllib
from google.appengine.api import memcache
from google.appengine.ext import blobstore
from google.appengine.ext.webapp import blobstore_handlers
from simian.mac import models
from simian.mac.common import auth
from simian.mac.munki import common... |
from test_framework import BitcoinTestFramework
from util import *
import json
try:
import http.client as httplib
except ImportError:
import httplib
try:
import urllib.parse as urlparse
except ImportError:
import urlparse
def http_get_call(host, port, path, response_object = 0):
conn = httplib.HTT... |
from datetime import datetime, timedelta
from django.template.defaultfilters import timeuntil_filter
from django.test import SimpleTestCase
from django.test.utils import requires_tz_support
from ..utils import setup
from .timezone_utils import TimezoneTestCase
class TimeuntilTests(TimezoneTestCase):
# Default ... |
#!/usr/bin/env python
'''Stdnet asynchronous test suite. Requires pulsar.'''
import sys
import os
from multiprocessing import current_process
## This is for dev environment with pulsar and dynts.
## If not available, some tests won't run
p = os.path
dir = p.dirname(p.dirname(p.abspath(__file__)))
try:
import pulsa... |
import codecs
import os
import re
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
here = os.path.abspath(os.path.dirname(__file__))
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.tes... |
from __future__ import unicode_literals
from django.core.urlresolvers import resolve, get_script_prefix
def get_breadcrumbs(url):
"""
Given a url returns a list of breadcrumbs, which are each a
tuple of (name, url).
"""
from rest_framework.settings import api_settings
from rest_framework.view... |
import parser |
"""Provides Jinja Views
This module provides views that utilize the Jinja templating
system for serialization. For more information on Jinja, please
see http://jinja.pocoo.org/ .
"""
import copy
import jinja2
class JinjaView(object):
"""A Jinja View
This view renders the given model using the provided Ji... |
"""histogram.py - Draw histograms (RGB) from pixbufs."""
import Image
import ImageDraw
import ImageOps
from mcomix import image_tools
def draw_histogram(pixbuf, height=170, fill=170, text=True):
"""Draw a histogram from <pixbuf> and return it as another pixbuf.
The returned prixbuf will be 262x<height> px.
... |
from sklearn import svm
from sklearn.feature_extraction import DictVectorizer
from collections import defaultdict
import pickle
v = DictVectorizer()
#TODO : need to tokenize the words before using them as features!
def main():
def munge(s):
ps = s.split()
label = int(ps[0])
ws = defaultdi... |
import boto
from boto.kms.exceptions import NotFoundException
from tests.compat import unittest
class TestKMS(unittest.TestCase):
def setUp(self):
self.kms = boto.connect_kms()
def test_list_keys(self):
response = self.kms.list_keys()
self.assertIn('Keys', response)
def test_hand... |
# -*- coding:UTF-8 -*-
# !/usr/bin/env python
#########################################################################
# File Name: get_candidate_nodules.py
# mail: <EMAIL>
# Created Time: 2017年04月26日 星期三 11时20分01秒
#########################################################################
import SimpleITK as sitk
imp... |
"""Support for Locative."""
import logging
from typing import Dict
import voluptuous as vol
from aiohttp import web
import homeassistant.helpers.config_validation as cv
from homeassistant.components.device_tracker import \
DOMAIN as DEVICE_TRACKER
from homeassistant.const import HTTP_UNPROCESSABLE_ENTITY, ATTR_LA... |
# python standard library
import os
import socket
# this package
from base_storage import BaseStorage
#from ape import BaseClass
from theape import ApeError
from theape.infrastructure.code_graphs import module_diagram, class_diagram
NEWLINE = '\n'
SPACE = ' '
EOF = ''
IN_PWEAVE = __name__ == '__builtin__'
TIMED_OUT ... |
class Instance(object):
def __init__(self, connection=None):
self.connection = connection
self.instance_id = None
self.health_status = None
self.launch_config_name = None
self.lifecycle_state = None
self.availability_zone = None
self.group_name = None
def... |
from argparse import ArgumentParser
from base64 import urlsafe_b64encode
from binascii import hexlify
from getpass import getpass
from os import urandom
import hmac
def generate_salt(size):
"""Create size byte hex salt"""
return hexlify(urandom(size)).decode()
def generate_password():
"""Create 32 byte b... |
"""
USAGE: %(program)s LANGUAGE METHOD
Generate topic models for the specified subcorpus. METHOD is currently one \
of 'tfidf', 'lsi', 'lda', 'rp'.
Example: ./gensim_genmodel.py any lsi
"""
import logging
import sys
import os.path
import re
from gensim.corpora import sources, dmlcorpus, MmCorpus
from gensim.mo... |
#===========================================================================
#
# StrConverter
#
#===========================================================================
"""StrConverter module containing class StrConverter."""
#===========================================================================
# Place al... |
import httplib
from flask import request
from boto import exception
from website.addons.s3 import utils
from website.project.decorators import must_have_addon
from website.project.decorators import must_have_permission
from website.project.decorators import must_be_contributor_or_public
@must_be_contributor_or_pub... |
import uwsgi
import time
import sys
import os
sys.path.insert(0, '/opt/apps')
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
#import django.core.handlers.wsgi
#uwsgi.load_plugin(0, "plugins/example/example_plugin.so", "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAa")
from threading import Thread
class testthrea... |
# Credit to gnilson
# https://github.com/gnilson/ProbitScale
#
import matplotlib.scale as mscale
import matplotlib.transforms as mtransforms
from matplotlib.ticker import FormatStrFormatter
from scipy.stats import norm
import matplotlib.ticker as ticker
from numpy import *
class ProbitScale (mscale.ScaleBase):
n... |
import os,sys,pickle,inspect,locale
from StringIO import StringIO
from hotwire.fs import FilePath
from hotwire.builtin import Builtin, BuiltinRegistry, InputStreamSchema
import simplejson
class LossyObjectJSONDumper(simplejson.JSONEncoder):
def __init__(self, *args, **kwargs):
super(LossyObjectJSONDumpe... |
__version__=''' $Id $ '''
__doc__='''Superclass for renderers to factor out common functionality and default implementations.'''
from reportlab.graphics.shapes import *
from reportlab.lib.validators import DerivedValue
from reportlab import rl_config
def inverse(A):
"For A affine 2D represented as 6vec return 6ve... |
'''
A minimal http server for basic audio feedback
'''
import atexit
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
from SocketServer import ThreadingMixIn
import threading
#import argparse
import re
import cgi
__version__ = '0.1.0'
# Events handlers
_on_buzzer_command = None
class HTTPRequestHandler(... |
from django.conf.urls import include, patterns, url
from . import views, feeds
from stats.urls import collection_stats_urls
edit_urls = patterns('',
url('^$', views.edit, name='collections.edit'),
url('^addons$', views.edit_addons, name='collections.edit_addons'),
url('^privacy$', views.edit_privacy, nam... |
"""The foscam component."""
import asyncio
from libpyfoscam import FoscamCamera
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT, CONF_USERNAME
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_registry impo... |
DEPS = [
'core',
'recipe_engine/path',
'recipe_engine/properties',
'recipe_engine/python',
'recipe_engine/step',
'run',
'vars',
]
TEST_BUILDERS = {
'client.skia.fyi': {
'skiabot-linux-housekeeper-000': [
'Housekeeper-PerCommit',
'Housekeeper-PerCommit-Trybot',
],
},
}
def RunSt... |
import sys
from grass.script import core as grass
def main():
env = grass.gisenv()
mapset = env['MAPSET']
ret = 0
vectors = grass.list_grouped('vect')[mapset]
num_vectors = len(vectors)
if grass.verbosity() < 2:
quiet = True
else:
quiet = False
i = 1
f... |
"""
Tools for remote interaction with the server/datastore
"""
__author__ = 'lorenzo'
import sys
sys.path.insert(0, '../..')
from config.config import _CLIENT_TOKEN
def dump_to_ds_post(url, data):
"""
NOTE: better to use PYcURL for this operations, avoid a lot of encoding and conflicts
:param url: the s... |
from math import atan, tan, sin, cos, pi, sqrt, atan2, acos, asin
from geopy.units import radians
from geopy import units, util
from geopy.point import Point
# Average great-circle radius in kilometers, from Wikipedia.
# Using a sphere with this radius results in an error of up to about 0.5%.
EARTH_RADIUS = 6372.795
... |
"""
OAI Harvest utility functions.
"""
__revision__ = "$Id$"
import os
import re
import time
import urlparse
import calendar
from invenio.ext.logging import register_exception
from invenio.legacy.oaiharvest import getter
from invenio.config import (CFG_SITE_URL,
CFG_SITE_ADMIN_EMAIL,
... |
from openerp.osv import fields, orm
class stock_picking(orm.Model):
_inherit = "stock.picking"
_columns = {
'incoterm': fields.many2one(
'stock.incoterms',
'Incoterm',
help="International Commercial Terms are a series of predefined "
"commercial terms u... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = r'''
---
module: wakeonlan
version_added: '2.2'
short_description: Send a ma... |
from twister_geom import *
from hpp.corbaserver.rbprm.rbprmbuilder import Builder
from hpp.corbaserver.rbprm.rbprmfullbody import FullBody
from hpp.gepetto import Viewer
from hpp.gepetto import PathPlayer
from numpy import array, sort
from numpy.linalg import norm
import twister_spidey_path as path_planner
import spid... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para adfly (acortador de url)
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
# ------------------------------------------------------------
import urllib
from core import logger
fr... |
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask.ext.httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':
return 'python'
return Non... |
import sys
import types
import newrelic.api.transaction
import newrelic.api.transaction_name
import newrelic.api.function_trace
import newrelic.api.error_trace
import newrelic.api.object_wrapper
import newrelic.api.import_hook
def name_controller(self, environ, start_response):
action = environ['pylons.routes_dic... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.