content string |
|---|
#encoding: utf-8
"""
tools.images -- Toolbox functions for creating image output
Exported namespace: image_blast, array_to_rgba, array_to_image, diffmap
Written by Joe Monaco
Center for Theoretical Neuroscience
Copyright (c) 2007-2008 Columbia Unversity. All Rights Reserved.
"""
import os as _os
import numpy as _N... |
"""Transform a roidb into a trainable roidb by adding a bunch of metadata."""
import numpy as np
from fast_rcnn.config import cfg
import utils.cython_bbox
def prepare_roidb(imdb):
"""Enrich the imdb's roidb by adding some derived quantities that
are useful for training. This function precomputes the maximum
... |
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class ValueAPIEmptyClassTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@add_test_categories(['pyapi'])
def test(self):
self.build()
exe = self.getBui... |
import os, sys, traceback, struct, random, math, time, io, imp, os.path
import ply_preprocessor_parse as ppp
def preprocess_text_intern(data, filename, working_dir=None):
#kill \r's
data = data.replace("\r", "")
lexer = ppp.lexer
p = ppp.Preprocessor(lexer)
p.parse(data, filename);
s = ""
s2 = ""
... |
from oslo_versionedobjects import fields
from cinder import objects
from cinder.objects import fields as c_fields
from cinder.tests.unit import fake_constants as fake
def fake_db_volume(**updates):
db_volume = {
'id': fake.VOLUME_ID,
'size': 1,
'name': 'volume-%s' % fake.VOLUME_ID,
... |
r"""
Testing the Jupyter notebook parser
"""
from __future__ import division, absolute_import, print_function
import json
import tempfile
import os
import pytest
import sphinx_gallery.gen_rst as sg
from sphinx_gallery.notebook import (rst2md, jupyter_notebook, save_notebook,
pytho... |
"""
Local Shared Object implementation.
Local Shared Object (LSO), sometimes known as Adobe Flash cookies, is a
cookie-like data entity used by the Adobe Flash Player and Gnash. The players
allow web content to read and write LSO data to the computer's local drive on
a per-domain basis.
:see: `Local Shared Object on ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_casetagger
----------------------------------
Tests for `casetagger` module.
"""
import os
from casetagger.config import config
from casetagger.db import DbHandler
from casetagger.models import Cases, Case, CaseFromCounter
class TestDatabase(object):
@cla... |
from behave import given, when, then
from test_setup import register_type
register_type()
@given("QMatrix is accessible")
def step(context):
from dcprogs.likelihood import QMatrix
context.QMatrix = QMatrix
@when("we instantiate QMatrix without arguments")
def step(context):
context.qmatrix = context.QMatrix()
... |
# coding: utf-8
from unittest import mock
from django.db import models
from django.test import RequestFactory
from yaat.models import Column
from yaat.resource import YaatModelResource
def generate_columns(user=None):
retval = [
Column(resource='test_resource', key='first', value='First', is_shown=True... |
import World
import threading
import time
from Variabile import *
from Functii_aux import *
import matplotlib.pyplot as plt
#initializari
#astea se modifica dupa apelarea init_variables()
actions = World.actions
directions = {"up" : (-1, 0), "down" : (1, 0), "left" : (0, -1), "right" : (0 , 1)}
states = [] #st... |
from setuptools import setup, find_packages
import os
description = ""
if os.path.exists('readme.md'):
description = open('readme.md').read()
setup(
name="c7n_guardian",
version='0.3.3',
description="Cloud Custodian - Multi Account Guard Duty Setup",
long_description=description,
long_descrip... |
""" This module contains the CallbackQueryHandler class """
from .handler import Handler
from telegram import Update
from telegram.utils.deprecate import deprecate
class CallbackQueryHandler(Handler):
"""
Handler class to handle Telegram callback queries.
Args:
callback (function): A function th... |
"""check via google if file is a plagiarism"""
# TODO:
# - introduce a more or less objective "rating" value replacing the current "count" value, so the eval function has some boundaries
# - define a clear data structure for the rating format (e.g. dict with word and rating)
# - make the whole file thing a little more... |
from random import randint
from oppgavegen.models import Template, UserLevelProgress, User
from oppgavegen.utility.decorators import Debugger
@Debugger
def get_question(user, template_id, topic=''):
"""Gets a template from the database at a appropriate rating.
:param user: The user requesting a template
... |
__author__ = 'Richard Lincoln, <EMAIL>'
""" This example demonstrates how to produce a publication plot of generator
costs using matplotlib. """
import matplotlib
#matplotlib.use('WXAgg')#'TkAgg')
#matplotlib.rc('font', **{'family': 'sans-serif',
# 'sans-serif': ['Computer Modern Sans serif']... |
#!/usr/bin/python3
# -*- coding: UTF-8 -*-
import sys
import re
# Include custom libs
sys.path.append( '../../include/python' )
import serverutils.config as config
import serverutils.mongohelper as mongohelper
import pymongo
quiet = False
while '-q' in sys.argv:
quiet = True
sys.argv.remove('-q')
if '--help' in ... |
from setuptools import setup, find_packages
description="""
Core module of django orm extensions package. Is a collection of third party plugins build in one unified package.
"""
setup(
name = "djorm-ext-core",
version = '0.7',
url = 'https://github.com/niwibe/djorm-ext-core',
license = 'BSD',
pla... |
{
"name": "Suspend security",
"version": "10.0.1.0.0",
"author": "Therp BV, Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Hidden/Dependency",
"summary": "Suspend security checks for a call",
"depends": [
'base',
],
} |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: PTB-LSTM.py
import argparse
import numpy as np
import os
import tensorflow as tf
from tensorpack import *
from tensorpack.tfutils import gradproc, optimizer, summary
from tensorpack.utils import logger
from tensorpack.utils.argtools import memoized_ignoreargs
from... |
"""
Tests for verified track content views.
"""
from __future__ import absolute_import
import json
import six
from django.http import Http404
from django.test.client import RequestFactory
from openedx.core.djangolib.testing.utils import skip_unless_lms
from student.tests.factories import UserFactory, AdminFactory
f... |
import dilap.core.base as db
import dilap.core.qtgui as qg
from dilap.geometry.vec3 import vec3
from dilap.geometry.quat import quat
import dilap.modeling.scenegraph as dsg
import dilap.modeling.model as dmo
import dilap.io.io as dio
import random,pdb
###############################################################... |
"""
WSGI config for brunosato project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`... |
# -*- coding: utf-8 -*-
"""
plnt.utils
~~~~~~~~~~
The planet utilities.
:copyright: 2007 Pallets
:license: BSD-3-Clause
"""
import re
from os import path
from jinja2 import Environment
from jinja2 import FileSystemLoader
from werkzeug._compat import unichr
from werkzeug.local import Local
from we... |
import unittest
import unittest.mock
from GitManager.commands import status
from GitManager.repo import description
from GitManager.utils import format
class TestStatus(unittest.TestCase):
""" Tests that the status command works properly """
@unittest.mock.patch(
'GitManager.repo.implementation.Loca... |
from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
from openpyxl.xml.functions import (
Element,
SubElement,
ConditionalElement,
tostring,
)
from openpyxl.xml.constants import (
CHART_NS,
DRAWING_NS,
REL_NS,
PKG_REL_NS
)
from openpyxl.compat import (
... |
from lxml import etree
def recipient_country_budget(organisation, _request):
"""
Generate the recipient-country-budget elements.
:param organisation: Organisation object
:param _request: Django request (not used)
:return: A list of Etree elements
"""
recipient_country_budget_elements = []... |
from decimal import Decimal
from datetime import timedelta
from django.test import TestCase
from django.utils.timezone import now
from accounts.utils import bootstrap_permissions
from currency.currencies import quantize_usd
from shipments.models import Package, Shipment, PackageDBView, ShipmentDBView
from shipments.t... |
import numpy as np
import tensorflow as tf
class tfSom:
"""tfSom Class
This is an implementation of a Self-Organizing Map (SOM) in Tensorflow.
It provides low level funcion and utilities for assembling diffeent type of som.
"""
def __init__(self, tot_rows, tot_cols, depth, low=0.0, high=1.0, verb... |
from django.db import models
from django.template.defaultfilters import slugify
from gc_apps.core.models import TimeStampedModel
from gc_apps.layer_types.static_vals import DV_FILE_TYPE_CHOICES
class IncomingFileTypeSetting(TimeStampedModel):
"""
Settings that determine whether handling for incoming Dataverse... |
'''
Created on 27/03/2014
@author: arobinson
'''
import imp
def loadModule(name, path):
return imp.load_source(name, path) |
#!/usr/bin/python
from math import sqrt
def compute_dijkstra(dijkstra, current, graph):
'''compute_dijkstra(dijkstra, str, graph)
dijkstra - dictionary without the key current
current - starting node for dijkstra algorithm
graph - graph[begin][end] != 0 if the edge exists
Returns:
for de... |
"""Add sync status columns to foldersync
Revision ID: 159609404baf
Revises: 1d7374c286c5
Create Date: 2014-06-10 19:50:59.005478
"""
# revision identifiers, used by Alembic.
revision = '159609404baf'
down_revision = '4085dd542739'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.ext.declarative import... |
from argparse import ArgumentParser, FileType
from string import upper
import pb_parser
import pcs_parser
import pyll_parser
__authors__ = ["Katharina Eggensperger", "Matthias Feurer"]
__contact__ = "automl.org"
def main():
# python convert.py --from SMAC --to TPE -f space.any -s space.else
prog = "python ... |
def renormalize(elementName,lowerBound,higherBound,wantedSpins):
minimum = 9999999999999999999
for element in elementName:
for i in range(lowerBound,higherBound+1):
filenameopen = (str(i)+str(element)+wantedSpins+"_Fil.dat").replace("/","_")
datafile = open("Output/gnuPlot/"+fil... |
#!/usr/bin/env python
# coding: utf-8
"""
Copyright 2015 SYSTRAN Software, Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licen... |
# -*- coding: UTF-8 -*-
from flask import g, jsonify
from flask.ext.restful import reqparse, abort, Resource, Api
from qpid.messaging import Connection, Message
from qpid.messaging.exceptions import ConnectError
from enviosms.gateway import app, exceptions
from enviosms.gateway.config import Config
from enviosms.subm... |
from flask import Flask, g
from proxypool.storages.redis import RedisClient
from proxypool.setting import API_HOST, API_PORT, API_THREADED
__all__ = ['app']
app = Flask(__name__)
def get_conn():
"""
get redis client object
:return:
"""
if not hasattr(g, 'redis'):
g.redis = RedisClient()... |
import sys, os, subprocess
# Not really re-creating the images ever, cannot make sure they are binary
# identical, so made this optional.
if "logo" in sys.argv:
assert 0 == os.system("convert -background none misc/Logo/Nuitka-Logo-Vertical.svg images/Nuitka-Logo-Vertical.png")
assert 0 == os.system("convert -... |
from collections import OrderedDict
from distutils import util
import os
import re
from typing import Dict, Optional, Sequence, Tuple, Type, Union
from google.api_core import client_options as client_options_lib # type: ignore
from google.api_core import exceptions # type: ignore
from google.api_core import gapic_v1... |
import tvm
from tvm import te
import numpy
def test_makeapi():
"""Not yet working, mock design"""
n = te.size_var("n")
A = te.placeholder((n,), name="A")
B = te.placeholder((n,), name="B")
C = te.compute(A.shape, lambda *i: A(*i) + B(*i), name="C")
s = te.create_schedule(C.op)
bounds = tv... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
Explode.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*******************************... |
#!/usr/bin/env python
import copy
import time
import math
import numpy
#from matplotlib import pyplot
import scipy.ndimage.measurements
from pyami import ellipse
from appionlib.apCtf import ctftools
from appionlib.apImage import imagefilter
debug = False
#=========================================
def showImage(imag... |
from datetime import date, timedelta
from openerp import models, fields, api, exceptions
from openerp.tools import _
class LibraryBook(models.Model):
_name = 'library.book'
name = fields.Char('Name', required=True)
author_ids = field.Many2many('res.partner')
class LibraryMember(models.Model):
_name... |
# -*- coding: utf-8 -*-
"""
flask-rst.modules.tags
~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2011 by Christoph Heer.
:license: BSD, see LICENSE for more details.
"""
from math import log
from flask import Blueprint, render_template
from jinja2 import Markup
from flaskrst.modules.blog import posts
d... |
''' This module will enable/disable debug for ST Voice switches and
Voice switches, Phones and any generic machine using MS Windows.
_________________________________________________________________________________
|-- startdebug(self,device="switch",argv)
| argv option... |
import pytest
import botocore
from botocore.exceptions import ClientError
import boto3
import requests
# Test that trying to perform an operation signed with a wrong key
# will not succeed
def test_wrong_key_access(request, dynamodb):
print("Please make sure authorization is enforced in your Scylla installation: a... |
import sys
import random
import contextlib
import itertools as it
def rsample(iterator, k):
"""Reservoir-sample k elements from iterator.
Load and shuffle k elements in memory.
http://propersubset.com/2010/04/choosing-random-elements.html
"""
sample = []
for n, item in enumerate(iterator):
... |
import glob
from itertools import izip
from multiprocessing import Pool
import os
import sys
CS_TRANS = {'A': ['A','C','G','T'],
'C': ['C','A','T','G'],
'G': ['G','T','A','C'],
'T': ['T','G','C','A']}
def main():
"""
Filter SOLiD reads per qual scores and trim to 36bp.
... |
# -*- coding: utf-8 -*
"""nodoctest
Configure and Start a Notebook Server
The :class:`NotebookObject` is used to configure and launch a Sage
Notebook server.
"""
#############################################################################
# Copyright (C) 2007 William Stein <<EMAIL>>
# Distributed under the ter... |
from steam import WebAPI as steam
import time
from sigma.plugin import Plugin
from sigma.utils import create_logger
from config import SteamAPI
class Steam(Plugin):
is_global = True
log = create_logger('steam')
async def on_message(self, message, pfx):
if message.content.startswith(pfx+'steam'):... |
__author__ = 'eneldoserrata'
import urllib2
import httplib
import json
# have to export the DER certify recived from azul to base64
# openssl x509 -inform der -in MYCERT.cer -out my_cert.crt
# I ended up solving this by concatenating
# the private key you use to generate crs with your converted cert
# cat my_key.key ... |
from io import BytesIO
from hashlib import sha1
from base64 import urlsafe_b64encode
# pylint: disable=F0401
from paste.deploy.converters import asint
# pylint: enable=F0401
class EtagMiddleware(object):
""" Add Etag header if missing """
def __init__(self, app, config):
self.app = app
self.... |
import pytest
from tests.utils import randstring
def test_accounts_list(client):
accounts = client.admin.list_accounts()
assert len(accounts) > 0
def test_server_info(client):
info = client.admin.server_info()
assert 'version' in info
@pytest.mark.parametrize('password', [randstring(6)])
@pytest.... |
DEFAULT_FILE_TYPES = {
'.php': 'php',
'.c': 'clike',
'.h': 'clike',
'.cpp': 'clike',
'.m': 'clike',
'.mm': 'clike',
'.ino': 'clike',
'.cs': 'text/x-csharp',
'.java': 'text/x-java',
'.clj': 'clojure',
'.coffee': 'coffeescript',
'.css': 'css',
'.diff': 'diff',
'.ecl... |
#!/usr/bin/env python
import os
import time
from decimal import Decimal
# Return CPU temperature as a character string
def getCPUtemperature():
res = os.popen('vcgencmd measure_temp').readline()
return(res.replace("temp=","").replace("'C\n",""))
# Return RAM information (u... |
"""
Media Reference class for GRAMPS.
"""
#-------------------------------------------------------------------------
#
# GRAMPS modules
#
#-------------------------------------------------------------------------
from secondaryobj import SecondaryObject
from privacybase import PrivacyBase
from citationbase import Cita... |
# MyLibrary.py
import sys, time, random, math, pygame
from pygame.locals import *
# calculates distance between two points
def distance(point1, point2):
delta_x = point1.x - point2.x
delta_y = point1.y - point2.y
dist = math.sqrt(delta_x*delta_x + delta_y*delta_y)
return dist
# calcul... |
#!/usr/bin/python
from macaroon.playback import *
import utils
sequence = MacroSequence()
#sequence.append(WaitForDocLoad())
sequence.append(PauseAction(5000))
sequence.append(KeyComboAction("<Control>Home"))
sequence.append(utils.StartRecordingAction())
sequence.append(KeyComboAction("Tab"))
sequence.append(utils.... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
OSRM
A QGIS plugin
Find a route with OSRM
-------------------
begin : 2015-09-29
copyright : (C) 2015... |
from . import BaseChain
class X13Chain(BaseChain):
"""
A blockchain that hashes block headers using the X13 algorithm.
The current implementation requires the x13_hash module.
https://github.com/mindfox/x13-hash
"""
def block_header_hash(chain, header):
import x13_hash
return x... |
import random
from gi.repository import Gtk, GLib
from quodlibet import _
from quodlibet import app
from quodlibet import config
from quodlibet.plugins.events import EventPlugin
from quodlibet import util
from quodlibet.util import print_d
from quodlibet.browsers.playlists import PlaylistsBrowser
try:
from quodli... |
import asyncio
import asynctest
import asynctest.mock as amock
from aiohttp import ClientOSError
from opsdroid.cli.start import configure_lang
from opsdroid.core import OpsDroid
from opsdroid.matchers import match_sapcai
from opsdroid.events import Message
from opsdroid.parsers import sapcai
from opsdroid.connector i... |
import os
from keystoneclient.v3 import client
try:
OS_SERVICE_ENDPOINT = os.environ['OS_SERVICE_ENDPOINT']
OS_SERVICE_TOKEN = os.environ['OS_SERVICE_TOKEN']
except KeyError as e:
raise SystemExit('%s environment variables not set.' % e.message)
def tear_down_service_catalog(admin_client):
for endp... |
import datetime
import os
from collections import defaultdict
from django import forms
from django.conf import settings
from django.utils.safestring import mark_safe
import basket
import happyforms
from tower import ugettext as _, ugettext_lazy as _lazy
import mkt
from mkt.comm.utils import create_comm_note
from mkt... |
"""
Customizations of Django i18n functions for Kuma.
Django language code is lower case, like 'en-us'.
Kuma language code is mixed case, like 'en-US'.
"""
from collections import OrderedDict
from django.apps import apps
from django.conf import settings
from django.conf.locale import LANG_INFO
from django.utils impor... |
#!/usr/bin/python
# @author: vektor dewanto
# @obj: simulate ray-casting on a grid map whose individual grid is a square, note: y+ axis points downward
import math
import decimal
import numpy as np
from shapely.geometry import LineString
from shapely.geometry import box
from shapely.geometry import Point
def get_tip... |
from __future__ import absolute_import
import os
import re
import subprocess
import tempfile
import sys
from .errors import NetworkVisualizationError
from .framework import Framework
import origae
from origae import utils
from origae.model.tasks import TensorflowTrainTask
from origae.utils import subclass, override, ... |
from gnuradio import gr, gr_unittest
from gnuradio import blocks
import ofdm_swig as ofdm
import random
class qa_scfdma_subcarrier_demapper_vcvc (gr_unittest.TestCase):
def setUp (self):
self.tb = gr.top_block ()
def tearDown (self):
self.tb = None
def test_001_t (self):
# set u... |
"""
Common functions for search-related external modules.
"""
import datetime
import json
import socorro.lib.external_common as extern
from socorro.external import BadArgumentError, MissingArgumentError
from socorro.lib import datetimeutil
"""Operators description:
* '' -> 'has one of the terms'
* '=' -> ... |
"""Code to take coordinates of each side and fold line and determine the
plane of the fold line perpendicular to the base. Each side's coordinates are
transformed onto this plane, and then the program checks for intersecting sides
to determine whether or not to fold/unfold the sides."""
import numpy as np
import ma... |
from django.db import IntegrityError
from django.shortcuts import render
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from .models import Greeting
from .models import ShortUrl, Hit
from .forms import UrlForm
def index(request):
if request.method == 'POST':
f... |
_LIGHT_SENSOR_MIN_VALUE = 290
_LIGHT_SENSOR_MAX_VALUE = 1023
class Error(Exception):
pass
class LightSensorLowError(Error):
pass
class LightSensor(object):
"""Wrapper for light sensor."""
def __init__(self, adc, channel):
"""Creates a new LightSensor wrapper.
Args:
ad... |
import os
import re
import tempfile
from typing import Optional
import click
def open_editor(filename: str, return_contents: bool = False) -> Optional[str]:
click.edit(filename=filename)
if return_contents:
with open(filename, "r") as fh:
return fh.read()
else:
return None
... |
import socket, re, sys
from codecs import encode, decode
from . import shared
def get_whois_raw(domain, server="", previous=None, rfc3490=True, never_cut=False, with_server_list=False, server_list=None):
previous = previous or []
server_list = server_list or []
# Sometimes IANA simply won't give us the right root W... |
# Django settings for cigar_example project.
from os.path import dirname, abspath, join
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
)
MANAGERS = ADMINS
DJANGO_ROOT = dirname(dirname(abspath(__file__)))
def root(*x):
return abspath(join(abspath(DJANGO_ROOT), *x))
DATABASES = {
'default': {
'ENG... |
import sys
from oslo.config import cfg
from quantum.common import config
from quantum.plugins.nicira.nicira_nvp_plugin import NvpApiClient
from quantum.plugins.nicira.nicira_nvp_plugin import nvplib
from quantum.plugins.nicira.nicira_nvp_plugin import QuantumPlugin
config.setup_logging(cfg.CONF)
def help():
pr... |
from Quartz import *
from PyObjCTools.TestSupport import *
class TestIKCameraDeviceView (TestCase):
@min_os_level('10.6')
def testConstants10_6(self):
self.assertEqual(IKCameraDeviceViewDisplayModeTable, 0)
self.assertEqual(IKCameraDeviceViewDisplayModeIcon, 1)
self.assertEqual(IKCame... |
import tensorflow as tf
import tensorblock as tb
### 2D Max Pooling
def maxpool2d( x , pars ):
if not pars['pooling_ksize' ]: pars['pooling_ksize'] = pars['pooling']
if not pars['pooling_strides']: pars['pooling_strides'] = pars['pooling']
if not pars['pooling_padding']: pars['pooling_padding'] = pars[... |
"""
Django settings for inventory project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
... |
# -*- coding:utf-8 -*-
__author__ = '东方鹗'
from flask import render_template, request, jsonify
from . import admin
@admin.app_errorhandler(403)
def forbidden(e):
if request.accept_mimetypes.accept_json and \
not request.accept_mimetypes.accept_html:
response = jsonify({'error': 'forbidden'})
... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Measure performances of a basic tax-benefit system to compare to other OpenFisca implementations."""
import argparse
import collections
import datetime
import logging
import sys
import time
import numpy as np
from numpy.core.defchararray import startswith
from ope... |
import os
from django.db import models
from ..jenkins import get_job_status
from .base import StatusCheck, StatusCheckResult
class JenkinsStatusCheck(StatusCheck):
jenkins_config = models.ForeignKey('JenkinsConfig')
@property
def check_category(self):
return "Jenkins check"
@property
d... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import logging
import traceback
import sys
from difflib import HtmlDiff
import os
'''
This Script is useful for making diff files between specific commits.
How to make diff files.
(1) git archive --format=zip <CommitID1> `git diff <CommitID1>..<CommitID2> --name-only` -o afte... |
# -*- python -*-
# ex: set syntax=python:
from buildbot.plugins import *
c = {}
c['change_source'] = []
c['schedulers'] = []
c['builders'] = []
repourl = 'git://github.com/nextgis/docs_ng.git'
langs = ['ru', 'en']
poller_name = 'docs'
git_project_name = 'nextgis/docs_ng'
git_poller = changes.GitPoller(project = git... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
'''Pychemqt, Chemical Engineering Process simulator
Copyright (C) 2009-2017, Juan José Gómez Romera <<EMAIL>>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundatio... |
# -*- coding: utf-8 -*-
from functools import wraps
from logging import getLogger
from .log_msg import LogMsg
from .query import Manipulation
from .query import Query
from .query import QueryCursor
from .query import Select
from .query import SelectIterator
from .query import SelectOne
_LOG = getLogger(__name__)
c... |
# -*- coding: utf-8 -*-
from odoo import models, fields, api
from odoo.exceptions import UserError
import itertools
class Cowin_settings_approval_flow_settings(models.Model):
_name = 'cowin_settings.approval_flow_settings'
name = fields.Char(string=u'审批流名称')
tache_id = fields.Many2one('cowi... |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
depends_on = (
('stores', '0010_auto__add_itemimage__add_item'),
)
def forwards(self, orm):
# Adding model 'SocialTag'
... |
from __future__ import unicode_literals
from traceback import print_exc
from copy import deepcopy
import re
import logging
from docutil.str_util import find_list
from docutil.etree_util import HierarchyXPath, SingleXPath, FlatXPath
from doc.parser.generic_parser import GenericParser
from doc.parser.parser_util import J... |
"""
Fantasy sports team page
"""
from bs4 import BeautifulSoup
from datetime import datetime
SPORT_URLS = {
'nba': 'http://basketball.fantasysports.yahoo.com/nba'
}
def url(sport, league_id, team_id, start_date=None):
"""
Given sport name, league_id, team_id, and optional start date (YYYY-MM-DD),
r... |
"""
Tests for app.models
"""
from app import config
from app import models
from test import base
class BlobKeyMappingTests(base.BlobMigratorTestCase):
"""
Tests for BlobKeyMapping
"""
def test_get_kind_uses_configuration(self):
config.config.MAPPING_DATASTORE_KIND_NAME = 'foo'
kind = models.BlobKeyMap... |
"""
Explanation class, with visualization functions.
"""
from io import open
import os
import os.path
import json
import string
import numpy as np
from .exceptions import LimeError
from sklearn.utils import check_random_state
def id_generator(size=15, random_state=None):
"""Helper function to generate random di... |
import logging
import tornado
import tornado.template
import os
from tornado.options import define, options
import environment
import logconfig
# Make filepaths relative to settings.
path = lambda root,*a: os.path.join(root, *a)
ROOT = os.path.dirname(os.path.abspath(__file__))
define("port", default=8089, help="run... |
from unipath import Path
PROJECT_ROOT = Path(__file__).ancestor(2)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('afein', '<EMAIL>'),
('mastergreg', '<EMAIL>')
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3... |
__version__ = "0.4.0"
from .constants import AlertLevel, AlertDescription, Fault
from .errors import *
from .checker import Checker
from .handshakesettings import HandshakeSettings
from .session import Session
from .sessioncache import SessionCache
from .tlsconnection import TLSConnection
from .verifierdb import Verifi... |
import itertools
import sys
from test import source
from tools import runfiles
_results = None
def check(left, right, result):
result = result.rstrip('\n')
global _results
if _results is None:
pairs = list(source.pairs())
with runfiles.open('test/reference.data') as f:
data ... |
from msrest.service_client import ServiceClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from msrest.pipeline import ClientRawResponse
import uuid
from . import models
class AutoRestReportServiceForAzureConfiguration(AzureConfiguration):
"... |
"""
This is the misc component of the application, which contains miscellaneous functions
to support the application.
"""
from __future__ import print_function
from pox.core import core
import pox.openflow.libopenflow_01 as of
from bucket import bucket
import pox.lib.packet as pkt
from pox.lib.addresses import IPAddr,... |
import os
import sys
from PyQt4.QtCore import (Qt, SIGNAL,QUrl)
from PyQt4.QtGui import (QApplication, QDialog, QHBoxLayout, QVBoxLayout,
QListWidget, QListWidgetItem, QSplitter, QTableWidget, QPushButton,QGraphicsView)
from PyQt4 import QtDeclarative
import geigerWrap
import workflowManager
class Form(QD... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.