src stringlengths 721 1.04M |
|---|
#!/usr/bin/env python
# encoding: utf-8
"""
sorted_array_to_binary_tree.py
Created by Shengwei on 2014-07-03.
"""
# https://oj.leetcode.com/problems/convert-sorted-array-to-binary-search-tree/
# tags: easy, tree, array, sorted, convert, D&C
"""
Given an array where elements are sorted in ascending order, convert it ... |
""" Invoke the Model in validation mode and perform a run over the valid set."""
import argparse
import json
from DeeProtein import DeeProtein
import helpers
def main():
with open(FLAGS.config_json) as config_fobj:
config_dict = json.load(config_fobj)
# set the gpu context
if not FLAGS.gpu:
... |
from django.contrib.auth.models import User
from whatisit.apps.wordfish.models import (
Annotation,
AllowedAnnotation,
Report,
ReportCollection,
ReportSet
)
from rest_framework import serializers
class ReportSerializer(serializers.ModelSerializer):
class Meta:
model = Report
f... |
#!/usr/bin/env python
"""
runtests.py [OPTIONS] [-- ARGS]
Run tests, building the project first.
Examples::
$ python runtests.py
$ python runtests.py -s {SAMPLE_SUBMODULE}
$ python runtests.py -t {SAMPLE_TEST}
$ python runtests.py --ipython
$ python runtests.py --python somescript.py
$ python... |
# The Challenge
# Given a string S and a set of words D, find the longest word in D that is a subsequence of S.
# Word W is a subsequence of S if some number of characters, possibly zero, can be deleted from S to form W, without reordering the remaining characters.
# Note: D can appear in any format (list, hash table... |
import os
from concurrent.futures import ThreadPoolExecutor
from tornado.queues import PriorityQueue, QueueEmpty
from tornado.gen import sleep, coroutine
from tokit import Event, on, logger
from inspect import iscoroutinefunction
from email.mime.text import MIMEText
import smtplib
from email.header import Header
from ... |
#!/usr/bin/env python
from __future__ import division
import os
import itertools as it
import pytest
import numpy as np
import minipnm as mini
def test_print():
network = mini.Delaunay.random(100)
print( network )
def test_prune():
delaunay = mini.Delaunay(np.random.rand(100,3))
original_size = dela... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
import client
import requests
def read_config(config_files, **predata):
cfg = {}
for config_file in config_files:
cfg.update(_read_config_file(
config_file, predata))
return cfg
def _read_config_file(_config_file, predata):
_file = open(_config_file)
exec(_file, globals(), pr... |
#service.data.provider
from service.data.factory.baseProvider import BaseProvider
#TODO: Add textwrap to a query post processor
from model.workflow import *
class Provider(BaseProvider):
def __init__(self, log, connectionSettings):
self._log = log
#pass to the base connectionSettings
self... |
"""Code to generate noun to adjective dictionary"""
import nltk
from nltk.tokenize.treebank import TreebankWordTokenizer
from bert_setup import Bert
class NounToAdjGen:
"""Add adjectives for nouns in dictionary noun_to_adj.
Attributes:
noun_to_adj : Noun to adjective dictionary.
tokenizer : An... |
from django.shortcuts import get_object_or_404
from django.http import Http404
from functools import wraps
from bierapp.accounts.models import User
from bierapp.core.models import Transaction, ProductGroup, Product, \
TransactionTemplate
from bierapp.utils.types import get_int
def resolve_user(func):
@wraps... |
from cartoframes.auth import Credentials
from cartoframes.viz import Map, Layer, popup_element, constants
from cartoframes.viz.source import Source
from cartoframes.io.managers.context_manager import ContextManager
from .utils import build_geodataframe
from ..mocks.kuviz_mock import KuvizPublisherMock
def setup_mo... |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created: ? 2? 20 17:07:44 2012
# by: The Resource Compiler for PyQt (Qt v4.7.4)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = b"\
\x00\x00\x00\xf6\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48... |
from lib.flyingcow import Model, Property
from datetime import datetime
from tornado.options import options
import comment
import sharedfile
class Conversation(Model):
user_id = Property()
sharedfile_id= Property()
muted = Property(default=0)
created_at = Property()
updated_at = P... |
# -*- coding: utf-8 -*-
##Copyright (C) [2003-2005] [Jürgen Hamel, D-32584 Löhne]
##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 Foundation; either version 3 of the License, or (at your option) any later v... |
import os
import logging
import win32file
import win32con
import win32event
import pywintypes
import winnt
from threading import Thread
from dumper.file_uploader import FileUploader
class DirMonitor(Thread):
def __init__(self, config):
Thread.__init__(self)
self._max_size ... |
import yaml
from collections import OrderedDict
from js9 import j
from .SerializerBase import SerializerBase
testtoml="""
name = 'something'
multiline = '''
these are multiple lines
next line
'''
nr = 87
nr2 = 34.4
"""
# from .PrettyYAMLDumper import PrettyYaml
class SerializerYAML(SerializerBase):
d... |
# Copyright (C) 2012 Universidad Tecnica Federico Santa Maria
#
# This file is part of Monitores.
#
# Monitores 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 Foundation, either version 3 of the License, or
# (at your op... |
# -*- coding: utf-8 -*-
from pyload.utils import json_loads
from pyload.plugin.internal.MultiHoster import MultiHoster
class MyfastfileCom(MultiHoster):
__name = "MyfastfileCom"
__type = "hoster"
__version = "0.08"
__pattern = r'http://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/dl/'
__config = [(... |
# -*- coding: utf-8 -*-
#
# Copyright 2017-2021 AVSystem <avsystem@avsystem.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
"""JSON implementations of id objects."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods,too-few-public-methods
# Number of methods are defined in specification
# pylint: disable=protected-access
# Access to protected methods allowed in packag... |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import print_function
from itertools import islice
import logging
import sys
import threading
import tr... |
# -*- coding: utf-8 -*-
"""
Serializer module with a slightly improved versions of the Turtle and Pretty XML serializers.
Both are, actually, almost verbatim copy of the RDFLib Turtle and pretty XML serializer module, respectively.
For more detailed on how serializers work and are registered by RDFLib, please refer to... |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from pant... |
# $Id$
##
## This file is part of pyFormex 0.8.9 (Fri Nov 9 10:49:51 CET 2012)
## pyFormex is a tool for generating, manipulating and transforming 3D
## geometrical models by sequences of mathematical operations.
## Home page: http://pyformex.org
## Project page: http://savannah.nongnu.org/projects/pyformex/
##... |
from rez.packages_ import get_developer_package, iter_packages
from rez.exceptions import BuildProcessError, BuildContextResolveError, \
ReleaseHookCancellingError, RezError, ReleaseError, BuildError
from rez.resolved_context import ResolvedContext
from rez.release_hook import create_release_hooks
from rez.resolver... |
#
# Albow - Table View
#
#-# Modified by D.C.-G. for translation purpose
from pygame import Rect
from layout import Column
from palette_view import PaletteView
from utils import blit_in_rect
from translate import _
class TableView(Column):
columns = []
header_font = None
header_fg_color = None
header_... |
import socket
import struct
import math
class client:
def init_client(self, address, port):
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
self.sock.connect((address.strip(), int(port)))
except socket.error, e:
print 'error:%s' % e
def main_loop(self):
while True:
cmd = raw_inp... |
"""
This script updates database records in the interval, variant, sample tables to
recover from various kinds of transient errors fixable errors
such as cluster filesystem problems, some previously-generated files being deleted, etc.
"""
import os
import sys
from mysql.connector import MySQLConnection
from utils.cons... |
#!/usr/bin/env python2.7
#_*_ coding: utf-8 _*_
__version__ = '0.1'
""" This file contains all available modules and the depending bootloader. Also the available filesystems (rootfs),
especially for linux to be flashed.
Currently implemented Modules: TX25, TX28, TX28S, TX48, TX53, TX6U,
TX6Q, CompactTFT (all KaRo)... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
from ..composition import LabeledDataSource
from .images import ImageFileSource
from .labels import TransformMatrixSource
class KittiOdometrySource(LabeledDataSource):
"""Read images and ground truth poses of the Kitti dataset.
http:/... |
#!/usr/bin/env python
# coding=utf-8
import os
from os.path import join, dirname, exists
from os import makedirs, utime, unlink, walk
from heapq import heappush, heappop, heappushpop
import platform
import sys
def default_dist():
(a, b, c) = platform.dist()
return c
def default_arch():
mapping = { 'x86_6... |
import logging
from pytos.common.base_types import XML_List, XML_Object_Base, Comparable
from pytos.common.definitions.xml_tags import Elements
from pytos.common.logging.definitions import XML_LOGGER_NAME
from pytos.common.functions import get_xml_int_value, get_xml_text_value, get_xml_node, create_tagless_xml_objects... |
#!/usr/bin/python
import numpy as np
from numpy.random import randn,dirichlet
from scipy.linalg import det, inv
from scipy.cluster import vq
from scipy.special import psi,gammaln
from core import normalize
try:
from _vbgmm1d import _evaluateHiddenState_C, _lnPD_C
ext_imported = True
except:
ext_imported = False
... |
#!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test multiple RPC users."""
from test_framework.test_framework import BitcoinTestFramework
from test_f... |
"""Internal module with utility functions to support argparse."""
from __future__ import print_function, absolute_import
import argparse
def check__int_range(value, min_, max_):
"""
Test the input value for type int within defined range.
Parameters
input string, min integer value, max integer v... |
from .TestCollectVersionInfo import TestCollectVersionInfo
from .TestConstants import TestConstants
from .TestEmptyBin import TestEmptyBin
from .TestNullComponent import TestNullComponent
from .TestDumpParameters import TestDumpParameters
from .TestDumpParametersAscii import TestDumpParametersAscii
from .TestDumpParame... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Location.parent'
db.alter_column(u'operation_location'... |
# -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... |
#
# pGRAPH
# Copyright (C) 2006 Pedram Amini <pedram.amini@gmail.com>
#
# 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 Foundation; either version 2 of the License, or (at your option) any later
# version.
#
... |
from django.core.urlresolvers import reverse
from django.forms.models import modelformset_factory
from django.shortcuts import get_object_or_404
from django.http import HttpResponseRedirect, HttpResponse
from django.views.generic import simple
from django.views.generic import list_detail, simple
from django.views.gener... |
#!/usr/bin/env python
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from utils import take_screenshot, prepare_image
from utils import XboxController
import tensorflow as tf
import model
from termcolor import cprint
import numpy as np
PORT_NUMBER = 8082
# Start session
sess = tf.InteractiveSession()
... |
"""Class for the quaternions with inversion."""
import numpy as np
import utils
# quaternion parameters for the group O from Table 71.1 in:
# Simon L. Altmann, Peter Herzig, "Point-Group Theory Tables",
# Second Edition (corrected), Wien (2011)
V12 = np.sqrt(0.5) # sqrt(1/2)
# [[ lambda, Lambda_1, Lambda_2, Lambd... |
# -*- coding: UTF-8 -*-
__author__ = 'Administrator'
import struct
acfun_magic_num=689
def acfunencode(d):
"""
类似urllib.urlencode()的功能 不过是给ACFUN用的
:param d: @type dict
:return: str
"""
#print d
result=""
if isinstance(d,dict):
for k,v in d.items():
result += "%s@... |
#!/usr/bin/env python
#coding=utf-8
"""
Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import os
from lib.core.agent import agent
from lib.core.common import checkFile
from lib.core.common import dataToStdout
from lib.core.common import Backend
fro... |
from __future__ import absolute_import, division, print_function
from tests.core import mock
from tests.core.helpers import assert_url
from trakt import Trakt, TraktClient
from httmock import HTTMock
from threading import Event
import calendar
import datetime
import pytest
def test_authorize_url():
Trakt.site_u... |
#
#
# Copyright (C) 2007 Google Inc.
#
# 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 Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed ... |
#!/usr/bin/python
"""Delete file not in Solr ..."""
import os
import requests
import json
import sys
import os.path
import sys
import argparse
import shutil
from common import splitString
from DirectoryWalker import DirectoryWalker
import itertools
from OmeroPropertiesParser import OmeroPropertiesParser
responseFail... |
import unittest
from common import get_context
class TestCase(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.ctx = get_context()
def test_1(self):
buf = self.ctx.buffer(b'abc')
with self.assertRaises(Exception):
buf.read(4)
with self.assertRaises... |
#----------------------------------------------------------------------
# Copyright 2012, 2013 Arndt Droullier, Nive GmbH. All rights reserved.
#
# 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 Foundation, ... |
"""
Microsoft Bitmap picture parser.
- file extension: ".bmp"
Author: Victor Stinner
Creation: 16 december 2005
"""
from resources.lib.externals.hachoir.hachoir_parser import Parser
from resources.lib.externals.hachoir.hachoir_core.field import (FieldSet,
UInt8, UInt16, UInt32, Bits,
String, RawBytes, Enum,
... |
'''
Demo Popup with a ColorPicker
'''
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
from kivy.uix.colorpicker import ColorPicker
from kivy.uix.popup import Popup
from kivy.uix.label import Label
class ColorPopup(App):
'''
This class represent you applicat... |
"""Test all questions."""
import os
import sys
import unittest
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from pythonometer.quiz import all_questions
from pythonometer.questions.base import WrongAnswer
class TestQuestions(unittest.TestCase):
"""Test the questions.
A... |
regs = ["B", "C", "D", "E", "H", "L", "(HL)", "A"]
d = 0x80
for i in range(0, 8):
print('\tSET_OP(0x%02X, "ADD A,%s", op_add, A, %s, 4);' % (i+d, regs[i % 8], regs[i % 8]));
for i in range(8, 16):
print('\tSET_OP(0x%02X, "ADC A,%s", op_adc, A, %s, 4);' % (i+d, regs[i % 8], regs[i % 8]));
d = 0x90
for i in range... |
from contrib import bglib
from collections import namedtuple
from modules import types
import time
class BleHandles():
"""docstring for BleHandles"""
def __init__(
self,
connection = -1,
service_start = -1,
service_end = -1,
timestamp = -1,
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Script to import XML data to current SICol database
# Obs: This script must be executed on root directory
# Author:Renato Arnellas Coelho renatoac at gmail dot com
import sys
import os
from xml.dom.minidom import Document,parse
def importSQLite(xml,sqlite_path='./db/sql... |
from datetime import datetime
from werkzeug.security import generate_password_hash, check_password_hash
from katzenblog import db
from katzenblog.util import slugify
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String)
passwordhash = db.Column(db.String)
... |
# Copyright (c) 2015-2016 Tigera, 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/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"module_name": "Item",
"_doctype": "Item",
"color": "#f39c12",
"icon": "octicon octicon-package",
"type": "link",
"link": "List/Item"
},
{
"module_name": "Customer",
"_doctype": "Customer",
"color"... |
symbols = [' ', 'O', 'X']
EMPTY = 0
J1 = 1
J2 = 2
NB_CELLS=9
class grid:
cells = []
def __init__(self):
self.cells = []
for i in range(NB_CELLS):
self.cells.append(EMPTY)
def play(self, player, cellNum):
assert(0<= cellNum and cellNum < NB_CELLS)
assert(self.... |
import logging
import os
import shutil
import tempfile
import unittest
from Bio import SeqIO
from phylotyper.config import PhylotyperOptions
from phylotyper.run import build_pipeline, check_gene_names
from phylotyper.subtypes_index import SubtypeConfig
from phylotyper.tree.seq import SeqDict
from phylotyper.tree.seqal... |
#!/usr/bin/python
# *-* coding: utf-8 *-*
# Author: Thomas Martin <thomas.martin.1@ulaval.ca>
# File: fft.py
## Copyright (c) 2010-2020 Thomas Martin <thomas.martin.1@ulaval.ca>
##
## This file is part of ORB
##
## ORB is free software: you can redistribute it and/or modify it
## under the terms of the GNU General Pu... |
# -*- coding: utf-8 -*-
from Components.Converter.Converter import Converter
from enigma import iServiceInformation, iPlayableService, iPlayableServicePtr
from Components.Element import cached
class ServiceOrbitalPosition(Converter, object):
FULL = 0
SHORT = 1
def __init__(self, type):
Converter.__init__(self, t... |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
from abc i... |
#!/bin/python
import socket
import struct
import sys
import signal
import time
import datetime
import argparse
import threading
class McastSocket(socket.socket):
def __init__(self, local_port='', reuse=False):
socket.socket.__init__(self, socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
if(reuse):
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Crea los campos y actualiza los productos para las nuevas etiquetas de la
norma del 1 de julio de 2013.
"""
import os, sys
sys.path.insert(0, (os.path.join(os.path.abspath(os.path.dirname(__file__)),
"..", "..", "ginn")))
os.chdir(os.path.join(os... |
"""
ZAP CLI.
"""
import sys
import click
from zapcli import __version__
from zapcli import helpers
from zapcli.commands.context import context_group
from zapcli.commands.policies import policies_group
from zapcli.commands.scanners import scanner_group
from zapcli.commands.scripts import scripts_group
from zapcli.com... |
import collections
import datetime
import hashlib
import logging
from sanic import exceptions
import aiopg.sa
import sqlalchemy as sa
from discode_server.utils import baseconv
from discode_server.utils import highlight
log = logging.getLogger(__file__)
meta = sa.MetaData()
paste = sa.Table(
'pastes', meta,
... |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
QAD Quantum Aided Design plugin
funzioni per creare cerchi
-------------------
begin : 2018-04-08
copyright : iiiii
emai... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... |
import plotly.plotly as py
import plotly.graph_objs as go
#Get data
data = open('Real_Final_database_02.csv')
alldata = data.readlines()
listdata = []
for i in alldata:
listdata.append(i.strip().split(','))
#Seperate information
year = []
affect = []
damage = []
death =[]
for j in listdata:
if j[0] == 'Malays... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
##... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import timedelta
from odoo import fields
from odoo.tests import common
class TestSaleExpectedDate(common.TransactionCase):
def test_sale_order_expected_date(self):
""" Test expected date and ... |
#!/usr/bin/env python
# This is a visualizer which pulls TPC-C benchmark results from the MySQL
# databases and visualizes them. Four graphs will be generated, latency graph on
# sinigle node and multiple nodes, and throughput graph on single node and
# multiple nodes.
#
# Run it without any arguments to see what argu... |
############################################################################
#
# Copyright (C) 2016 The Qt Company Ltd.
# Contact: https://www.qt.io/licensing/
#
# This file is part of Qt Creator.
#
# Commercial License Usage
# Licensees holding valid commercial Qt licenses may use this file in
# accordance with the co... |
# The following parse_* methods are from bitcoin-abe
import base58
def parse_TxIn(vds):
d = {}
d['prevout_hash'] = vds.read_bytes(32)
d['prevout_n'] = vds.read_uint32()
d['scriptSig'] = vds.read_bytes(vds.read_compact_size())
d['sequence'] = vds.read_uint32()
return d
def parse_TxOut(vds):
d = {}
d['... |
# -*- coding: utf-8 -*-
'''
Approximate the Unix find(1) command and return a list of paths that
meet the specified criteria.
The options include match criteria:
name = file-glob # case sensitive
iname = file-glob # case insensitive
regex = file-regex #... |
import numpy as np
from scipy.optimize import leastsq
def derivatives(x, y):
num_x = len(x);
deriv = np.zeros((len(x)))
# If there for two input points, use a straight line as the derivative.
if num_x == 2:
deriv[0] = (y[1] - y[0]) / (x[1] - x[0])
deriv[1] = deriv[0]
return deriv
# Calculate ... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from types import MethodType
import os
import io
import sys
from codecs import open as codec_open
from itertools import count
from six import PY2, string_types, iteritems, StringIO
import numpy as np
if PY2:
integer_types = (int, long, np.int32, np.in... |
u'''
Created on Nov 9, 2010
@author: Mark V Systems Limited
(c) Copyright 2010 Mark V Systems Limited, All rights reserved.
'''
from arelle import ModelVersObject, XbrlConst, ValidateXbrl, ModelDocument
from arelle.ModelValue import qname
conceptAttributeEventAttributes = {
u"conceptAttributeDelete"... |
from SBaaS_base.postgresql_orm_base import *
class data_stage02_isotopomer_fittedExchangeFluxes(Base):
__tablename__ = 'data_stage02_isotopomer_fittedExchangeFluxes'
id = Column(Integer, Sequence('data_stage02_isotopomer_fittedExchangeFluxes_id_seq'), primary_key=True)
simulation_id = Column(String(500))
... |
import os
import unittest
from pyresample import utils
import numpy as np
def tmp(f):
f.tmp = True
return f
class Test(unittest.TestCase):
def test_area_parser(self):
ease_nh, ease_sh = utils.parse_area_file(os.path.join(os.path.dirname(__file__),
... |
# This file is part of project Sverchok. It's copyrighted by the contributors
# recorded in the version control history of the file, available from
# its original location https://github.com/nortikin/sverchok/commit/master
#
# SPDX-License-Identifier: GPL3
# License-Filename: LICENSE
import bpy
from bpy.props impor... |
#!/usr/bin/env python
import socket
import sys
import yaml
from boto3.session import Session
def genhosts(elbip, sysdomain, outfile=sys.stdout):
SYS_PREFIXES = [
'console',
'uaa',
'apps',
'login',
'api',
'loggregator',
'doppler']
print >>outfile, elbip,... |
from typing import Callable
from plenum import config
from plenum.common.message_processor import MessageProcessor
from stp_core.common.log import getlogger
from stp_core.network.auth_mode import AuthMode
from stp_raet.util import getHaFromLocalEstate
from plenum.common.util import randomString
from stp_core.crypto.u... |
#!/usr/bin/env python
#
# Copyright 2016 Google 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/licenses/LICENSE-2.0
#
# Unless require... |
"""
"""
# Author: Valerio Maggio <valeriomaggio@gmail.com>
# Copyright (c) 2015 Valerio Maggio <valeriomaggio@gmail.com>
# License: BSD 3 clause
from IPython.utils.coloransi import TermColors, color_templates
from .settings import SERVER_ADDR, SERVER_PORT, CONNECTION_ID_SEP
COLORS = [color[1] for color in color_templ... |
# -*- coding: utf-8 -*-
# Copyright (C) 2010 Eduardo Robles Elvira <edulix AT gmail DOT com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at yo... |
# =========================================================================
# Copyright 2012-present Yunify, Inc.
# -------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this work except in compliance with the Licens... |
#############################################################################
##
## Copyright (C) 2016 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the test suite of PySide2.
##
## $QT_BEGIN_LICENSE:GPL-EXCEPT$
## Commercial License Usage
## Licensees holding valid commercial ... |
#!/usr/bin/env python
''' Slowdraw watches an image file and makes animations out of the changes
'''
import sys
import cv2
import cv
import numpy as np
import logging
import time
import argparse
import watchdog
import os.path
import pickle
import math
from watchdog.observers import Observer
parser = argparse.Argument... |
"""
SELinux
=======
Combiner for more complex handling of SELinux being disabled by any means
available to the users. It uses results of
:class:`insights.parsers.sestatus.SEStatus`, and
:class:`insights.parsers.selinux_config.SelinuxConfig` parsers and
:class:`insights.combiners.grub_conf.GrubConf` combiner.
It conta... |
import os, common, colors, loaders, arcpy
BANDS = ('r', 'g', 'b')
class ColorDecomposer(loaders.FunctionUpdater):
requiredInputSlots = ['color']
requiredOutputSlots = BANDS
@staticmethod
def translate(inprow={'color' : 'ffffff'}):
try:
rgb = colors.hexToRGB(inprow['color'])
except colors.Color... |
# -*- coding: utf-8 -*-
# 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 Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope tha... |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import
import os
from telemetry.internal.util import webpagereplay_go_server
from telemetry.internal.util import ts_proxy_se... |
""" Unit tests for raster functions """
import unittest
import os
import numpy as np
import numpy.testing as npt
from test_helper import TESTDATA
import karta
from karta import RegularGrid
class RegularGridTests(unittest.TestCase):
def setUp(self):
pe = peaks(n=49)
self.rast = RegularGrid((0.0, ... |
# MOE:insert #!/usr/bin/env python
# Copyright 2018 Google 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/licenses/LICENSE-2.0
#
# Unl... |
# Under MIT License, see LICENSE.txt
import unittest
from ai.InfoManager import InfoManager
from RULEngine.Game import Ball, Field, Team, Player
from RULEngine.Util.Position import Position
from RULEngine.Framework import GameState
__author__ = 'RoboCupULaval'
class TestInfoManager(unittest.TestCase):
def setUp... |
from dicttypes import onlynewkeysdict
from core import LinkingCore
from linkers import ModelParametersLink
from deepmonster.nnet.network import Feedforward
from deepmonster.utils import flatten
def build_group(group):
"""Architecture decorator a build method. It is usually very handy to be able
to access a who... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.