src stringlengths 721 1.04M |
|---|
#
# @file TestReadMathML.py
# @brief Read MathML unit tests
#
# @author Akiya Jouraku (Python conversion)
# @author Ben Bornstein
#
# $Id: TestReadMathML.py 11441 2010-07-09 02:22:23Z mhucka $
# $HeadURL: https://sbml.svn.sourceforge.net/svnroot/sbml/trunk/libsbml/src/bindings/python/test/math/TestReadMathML.py... |
# Copyright 2016 VMware, 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 applicable law or a... |
#!/bin/env python2
# -*- coding: utf-8 -*-
#
# Emanuele Faranda <black.silver@hotmail.it>
#
# 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 Lic... |
import time
from Analysis.ThreeSum_bruteForce import three_sum
def main(source):
a = [int(i.strip()) for i in source if i]
start = time.time()
print(three_sum(a))
print('Elapsed {} seconds'.format(time.time() - start))
if __name__ == "__main__":
while True:
choice = input('What do you ... |
# vim: sw=4:expandtab:foldmethod=marker
#
# Copyright (c) 2006, Mathieu Fenniak
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyrig... |
#!/usr/bin/env python
# -*- coding: latin-1; py-indent-offset:4 -*-
################################################################################
#
# This file is part of Bfplusplus
#
# Bfplusplus is a graphical interface to the Betfair Betting Exchange
# Copyright (C) 2010 Daniel Rodriguez (aka Daniel Rodriksson)
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#
# InstagramPi Gafas for Instagram with Raspberry Pi Zero
#
# Autor: Andrés Sabas @ Feb 2017
#
#
# Use text editor to edit the script and type in valid Instagram username/password
import atexit
import picamera
import os
import time
import random
from os import listdir
fr... |
import re
headers = ('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED',
'HTTP_X_CLUSTERED_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED',
'REMOTE_ADDR')
# Back ported from Django trunk
# This code was mostly based on ipaddr-py
# Copyright 2007 Google Inc. http://code.google.com/p/ipaddr-py/
# L... |
# 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 absolute_import, unicode_literals
import itertools
import logging
import os
import traceback
imp... |
from __future__ import division
from __future__ import with_statement
import math
import numpy as np
def is_odd(x):
return bool(x & 0x01)
def clamp(x, l=None, u=None):
"""return value limited by lower and/or upper bounds"""
if u is not None:
x = min(x, u)
if l is not... |
from kconfig import settings
from kconfig import enablersBook, helpdeskCompBook
from kconfig import trackersBook, workGroupBook
from kernel.DataFactory import DataFactory
__author__ = "Manuel Escriche <mev@tid.es>"
class Data:
@staticmethod
def getUrgentDeskUpcoming():
trackers = ','.join(trackersBo... |
# pylint: disable=C0111,R0903
"""Displays the current song being played in DeaDBeeF and provides
some media control bindings.
Left click toggles pause, scroll up skips the current song, scroll
down returns to the previous song.
Parameters:
* deadbeef.format: Format string (defaults to '{artist} - {title}')
... |
# Copyright (C) 2017 Fujitsu Limited
# 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 requi... |
"""
Django settings for todo project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
impor... |
# Copyright (c) 2015 The Johns Hopkins University/Applied Physics Laboratory
# 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/LICEN... |
##
# Copyright 2013-2020 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... |
# Copyright (C) 2018 Andrew Vitu <a.p.vitu@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.
#
# This ... |
# coding=utf-8
"""
Functions to run an interpreter for expressions containing physical quantities.
Based on the Q class in the quantities module, this provides functions to input and interpret expressions,
calculating their values and showing the steps, and finally storing the quantities so that they can be
used for f... |
from ckan.lib import base
from ckan.common import c, _
from ckan import logic
import ckan.model as model
import ckan.lib.helpers as h
from ckan.plugins import toolkit
from ckan.controllers.package import PackageController as _PackageController
import ckan.lib.navl.dictization_functions as dict_fns
from ckanext.requestd... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014, OneLogin, Inc.
# All rights reserved.
from setuptools import setup
setup(
name='python-saml',
version='2.1.5',
description='Onelogin Python Toolkit. Add SAML support to your Python software using this library',
classifiers=[
... |
# hash_message - submit a message to pepperhash for hash generation
# Copyright (C) 2015 Tryggvi Bjorgvinsson
#
# 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 Lic... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
# ... |
#!/usr/bin/env python
""" Black-box testing on the interface exposed to the average user. """
import os
import pytest
from pyromhackit.rom import ROM
from pyromhackit.hacker import Hacker
from pyromhackit.tree import SimpleTopology
from pyromhackit.roms.persona1usa.dump import sources
package_dir = os.path.dirname... |
# Copyright (C) 2012 - 2014 EMC Corporation.
# 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
#
# Unle... |
#!/usr/bin/env python
# -*- coding: utf-8 -
# remove UI segemnts
# fix grids
# layouts
# files
from flask import Flask
from flask import render_template
from flask.ext.assets import Environment, Bundle
from flask import redirect
app = Flask(__name__)
# app.config.from_pyfile(flask-config.cfg) -- import Config
ass... |
bl_info = {
"name": "PKHG faces",
"author": " PKHG ",
"version": (0, 0, 5),
"blender": (2, 7, 1),
"location": "View3D > Tools > PKHG (tab)",
"description": "Faces selected will become added faces of different style",
"warning": "not yet finished",
"wiki_url": "",
"category": "Mesh",
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from java.util import Date
from java.util.concurrent import Executors, TimeUnit
from GitSearch.Indexer.NewJavaParser import parse
import GitSearch.MyUtils as MyUtils
from java.lang import Runnable
from java.util.concurrent import Callable
pool = Executors.newFixedThreadPo... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
"""
Semantic Machines\N{TRADE MARK SIGN} software.
Creates the prediction files from onmt_translate output for the leaderboard.
"""
import argparse
from typing import List
import jsons
from more_itertools import chunked
from dataflow.core.dia... |
# -*- coding: utf8 -*-
__author__ = 'sergey'
from dedupsqlfs.db.mysql.table import Table
class TableTmpIdCount( Table ):
_engine = "MEMORY"
_table_name = "tmp_id_count"
def create( self ):
c = self.getCursor()
# Create table
c.execute(
"CREATE TABLE IF NOT EXISTS `... |
# Copyright 2017, David Wilson
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2.... |
"""
Tests for the common module.
Run like:
tox -c tox-full.ini -e py27-ubuntu_16_04_64 -- -s burlap/tests/test_common.py::CommonTests::test_satchel_ordering
"""
from __future__ import print_function
import os
import sys
import tempfile
import unittest
import getpass
from pprint import pprint
import six
from b... |
"""
Pushbroom entry point
"""
import argparse
import configparser
import fnmatch
import logging
import os
import re
import sys
from pathlib import Path
from typing import Dict
from pushbroom import __version__, sweep
def run() -> None:
"""Main entry point"""
args = parse_args()
setup_logging(args)
co... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
import time
import threading
class RateTicker:
global_rate_limit = 'X-App-Rate-Limit'
method_rate_limit = 'X-Method-Rate-Limit'
global_rate_limit_count = 'X-App-Rate-Limit-Count'
method_rate_limit_count = 'X-Method-Rate-Limit-Count'
service_reset_time = 3
def __init__(self, usage_limit, reset... |
import tensorflow as tf
from numpy.random import RandomState
batch_size = 8
# 两个输入节点
x = tf.placeholder(tf.float32, shape=(None, 2), name='x-input')
# 回归问题一般只有一个输出节点
y_ = tf.placeholder(tf.float32, shape=(None, 1), name='y-input')
# 定义了一个单层的神经网络前向传播过程,这里就是简单加权和
w1 = tf.Variable(tf.random_normal([2, 1], stddev=1, see... |
import pyexiv2 as exiv # see note about pyexiv2 in notes.txt
import json
from ast import literal_eval
from depth_temp_log_io import *
from configuration import *
from gps_log_io import *
from common import *
# That namespace url doesn't really exist. The custom tags seem to work
# without it. Perhaps I should figure ou... |
import os
import Queue
import threading
import sys
import urllib3
from .settings import PROGRESS_FORMATTER, NUM_THREADS
pool_manager = urllib3.PoolManager()
photo_queue = Queue.Queue()
lock = threading.Lock()
downloaded = 0
def parallel_download(photos, user, size, outdir):
threads = []
# Put photos into `p... |
import json
from .fixtures import *
def test_list_json(process, disable_extractors_dict):
subprocess.run(["archivebox", "add", "http://127.0.0.1:8080/static/example.com.html", "--depth=0"],
capture_output=True, env=disable_extractors_dict)
list_process = subprocess.run(["arch... |
#!/usr/bin/env python
"""Translate the Last.fm data files to JSON.
This script takes the various Last.fm data files and write them out as
JSON. It removes the Last.fm artist URLs.
Attributes:
ARTISTS (dict): A dictionary that stores information about the artists. The
variables are as follows:
... |
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2019-2021
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... |
# Copyright 2018 The Johns Hopkins University Applied Physics Laboratory
#
# 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 ... |
import argparse
import os
import platform
import sys
from distutils.spawn import find_executable
from six.moves import input
wpt_root = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
sys.path.insert(0, os.path.abspath(os.path.join(wpt_root, "tools")))
from . import browser, install, te... |
from .. import irc, var, ini
from ..tools import is_identified
# Only the admin can use these commands.
def ident (f):
def check (user, channel, word):
if user == irc.admin and is_identified(user):
f(user, channel, word)
else:
irc.msg(channel, "{}: You don't have admin right... |
# GUI Application automation and testing library
# Copyright (C) 2006-2018 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# ... |
#
# Python Macro Language for Dragon NaturallySpeaking
# (c) Copyright 1999 by Joel Gould
# Portions (c) Copyright 1999 by Dragon Systems, Inc.
#
# This sample macro file was created for my talk to the Boston Voice Users
# group on November 9, 1999. It is explained in my PowerPoint slides.
#
# natspeak_sample6.py
... |
# -*- coding: utf-8 -*-
"""
@author: kevinhikali
@email: hmingwei@gmail.com
"""
import tensorflow as tf
import numpy as np
import sys
sys.path.append('../../res/')
from mnist import import_mnist
data, label = import_mnist()
x_data = data.reshape(data.shape[0], 784)
x_data /= 255
y_data = label
if x_data.shape[0] > 0... |
#!/usr/bin/env python
"""
Convert a PSR FITS file to a headerless dat text file of Stokes' values
"""
import pyfits as pf
import numpy as n
import os
import sys
if __name__ == "__main__":
from optparse import OptionParser
o = OptionParser()
o.set_usage('%prog [options] [FITS file]')
o.set_description(... |
"""Test of the demo file demos/ebeam/csr_ex.py"""
import os
import sys
import copy
import time
FILE_DIR = os.path.dirname(os.path.abspath(__file__))
REF_RES_DIR = FILE_DIR + '/ref_results/'
from unit_tests.params import *
from laser_heater_conf import *
def test_generate_parray(lattice, p_array, parameter=None, up... |
#
#
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2014 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must retain the above copyri... |
from __future__ import print_function
import os
globe = {}
generateIndex = False
lang = "en"
brackets = ["[&]", "{&}", "(&)", "<&>"]
class compiler():
def __init__(self):
self = self
def languageSupport(self, f):
if "langBuffer" in globe:
langBuffer = globe["langBuffer"]
else:
langBuffer = {}
if not f i... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
class AboutNewStyleClasses(Koan):
class OldStyleClass:
"An old style class"
# Original class style have been phased out in Python 3.
class NewStyleClass(object):
"A new style class"
# Introduced in Python... |
from django.contrib.auth.models import User
from django.test import TestCase
from .models import DropboxAccount, DropboxUser
class TestModelsDropboxAccount(TestCase):
def test_account_str_len(self):
user = User.objects.create_user('John')
dbx_account = DropboxAccount(
user = user,
... |
#
# This file is part of Checkbox.
#
# Copyright 2008 Canonical Ltd.
#
# Checkbox 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.
#
# C... |
import os
import json
import redis
import unittest
import bmemcached
import debris
class User(object):
__metaclass__ = debris.Object
def __init__(self, id, **data):
self.id = str(id)
self.name = data['name']
self.email = data['email']
class Tests(unittest.TestCase):
data = {
... |
import unittest.mock
from typing import ClassVar
from urllib.parse import parse_qs, urlparse
from django.urls import reverse
from ws import models
from ws.tests import TestCase, factories
from ws.tests.helpers import PermHelpers
login_required_routes = [
'all_trips_medical',
'account_change_password',
'm... |
"""
Max heap implementation
https://en.wikipedia.org/wiki/Min-max_heap
Algorithm Average
Build heap O(n)
"""
from __future__ import print_function
from math import log, ceil
class MaxHeap(object):
""" Binary Max heap implementation """
def __init__(self):
self.__data = []
def max_heapify(... |
#!/usr/bin/env python
import pika
import sys
import signal
import json
import logging
from optparse import OptionParser
import eblocal
def createApplication(command):
res = eblocal.createApp(command["name"], command["source"])
if res is None:
logging.error("Can't create application")
return
... |
"""Cement core extensions module."""
import sys
from abc import abstractmethod
from ..core import exc
from ..core.interface import Interface
from ..core.handler import Handler
from ..utils.misc import minimal_logger
LOG = minimal_logger(__name__)
class ExtensionInterface(Interface):
"""
This class defines ... |
##
# Copyright 2013-2021 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... |
# -*- 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 'Instance.last_beat'
db.alter_column(u'fastapp_instance... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-08-03 08:41
from __future__ import unicode_literals
from django.db import migrations
from ovp.apps.core.helpers import generate_slug
def foward_func(apps, schema_editor):
Channel = apps.get_model("channels", "Channel")
channel = Channel.objects.cr... |
# menuthg.py - TortoiseHg shell extension menu
#
# Copyright 2009 Steve Borho <steve@borho.org>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2, incorporated herein by reference.
import os
from mercurial import hg, ui, node, error
from tortoisehg.uti... |
#!/usr/bin/env python
# coding=utf-8
from file_util import *
from pdb import *
import commands
import urllib2
#output = os.popen('ls')
#print output.read()
#print '----------------------------'
#(status, output) = commands.getstatusoutput('ls')
#print status, output
def execute_cmd(cmd):
_result={}
(status, ... |
# pylint: disable=missing-docstring,too-few-public-methods
def test_unused(first, second, _not_used): # [unused-argument, unused-argument]
pass
def test_prefixed_with_ignored(first, ignored_second):
first()
def test_prefixed_with_unused(first, unused_second):
first()
# for Sub.inherited, only the warn... |
# -*- coding: UTF-8 -*-
# Copyright (C) 2003-2010 J. David Ibáñez <jdavid.ibp@gmail.com>
# Copyright (C) 2007-2008 Henry Obein <henry.obein@gmail.com>
# Copyright (C) 2009-2010 David Versmisse <versmisse@lil.univ-littoral.fr>
# Copyright (C) 2009-2010 Hervé Cauwelier <herve@oursours.net>
#
# This program is free softwa... |
# -*- coding: utf-8 -*-
"""
======================
Variance Scaling Plots
======================
:Author:
Moritz Emanuel Beber
:Date:
2013-05-03
:Copyright:
Copyright |c| 2013 Jacobs University Bremen gGmbH, all rights reserved.
:File:
plots.py
.. |c| unicode:: U+A9
"""
__all__ = ["BREWER_SET1", ... |
#!/usr/bin/env python
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""
Demo script showing detections in sample ima... |
# -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Framework Package. This package holds all Data Management, and
# Web-UI helpful to run brain-simulations. To use it, you also need do download
# TheVirtualBrain-Scientific Package (for simulators). See content of the
# documentation-folder for more details. See also http:/... |
import os
import jinja2
import aiohttp_jinja2
from . import views
from . import panels
from .middlewares import middleware
from .utils import APP_KEY, TEMPLATE_KEY, STATIC_ROUTE_NAME, hexlify, \
ToolbarStorage, ExceptionHistory
from .views import ExceptionDebugView
default_panel_names = [
panels.HeaderDebugPa... |
#encoding:utf-8
from django.shortcuts import render, render_to_response, get_object_or_404
from django.http import HttpResponseRedirect
from django.template import RequestContext
#Django Auth
from django.contrib.auth.forms import AuthenticationForm, PasswordChangeForm
from django.contrib.auth import login, authenti... |
"""Tools for estimating the partition function of an RBM"""
import numpy
import theano
from theano import tensor, config
from theano.tensor import nnet
from pylearn2.utils.exc import reraise_as
from pylearn2.utils.rng import make_np_rng, make_theano_rng
from pylearn2.utils.mem import improve_memory_error_message
def ... |
from django import template
from django.utils.encoding import smart_str
import re
from django.template.base import FilterExpression, NodeList
from django.template.loader import get_template
kwarg_re = re.compile( r"(?:(\w+)=)?(.+)" )
class WidgetLibrary(template.Library):
def widget_tag_compile_function(self, cls... |
from common.log import logUtils as log
from common.ripple import scoreUtils
from objects import glob
from common.ripple import userUtils
def getRankInfo(userID, gameMode):
"""
Get userID's current rank, user above us and pp/score difference
:param userID: user
:param gameMode: gameMode number
:return: {"nextUser... |
# -*- coding: utf-8 -*-
'''
Created on 01.12.2014
@author: Simon Gwerder
'''
import json
import timeit
import requests
from ordered_set import OrderedSet
from utilities import utils
from utilities.retry import retry
class IDPreset:
name = None
terms = []
tags = []
def __init__(self):
self.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#Exemplo de tela para montar o jogo SUDOKU
import pygtk
pygtk.require('2.0')
import gtk
class Aplicacao:
def __init__(self):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.set_title("Sudoku")
self.window.connect('destroy', lambda w: gtk.main_quit())
... |
# -*- 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... |
from __future__ import division, print_function, absolute_import
import math
import numpy as np
from abc import ABCMeta, abstractmethod
from sklearn.neighbors import NearestNeighbors
from sklearn.cluster import KMeans
from sklearn.metrics.pairwise import cosine_similarity
from sklearn.neighbors.dist_metrics import M... |
import cocos as c
from cell import Cell
from shared_data import MAP_SIZE
from objects import TestCube, Wall
class DynamicBatch(c.batch.BatchNode):
"""
Batch modification, that allows to change Z level of child object dynamically.
"""
def change_z(self, child, z):
child.set_batch(None)
... |
# Copyright 2013 OpenStack Foundation
# 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 requ... |
from a10sdk.common.A10BaseClass import A10BaseClass
class Wsdl(A10BaseClass):
"""Class Description::
Manage Web Services Definition Language files.
Class wsdl supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param uuid: ... |
# -*- coding: utf-8 -*-
from __future__ import division, print_function
__all__ = ["Model"]
import numpy as np
from .state import State
class Model(object):
def __init__(self, lnlikefn=None, lnpriorfn=None, args=tuple()):
if lnpriorfn is None:
lnpriorfn = _default_lnprior_function
... |
import logging
import os
from openpyxl import Workbook
logging.basicConfig(format='%(levelname)s:%(asctime)s:%(message)s \t', level=logging.INFO)
EXCEL_DIR = '/home/lucasx/PycharmProjects/DataHouse/DataSet/'
def write_excel(list_, filename):
mkdirs_if_not_exists(EXCEL_DIR)
wb = Workbook()
ws = wb.acti... |
#!/usr/bin/env python3
################################################################################
# The matasano crypto challenges
# http://cryptopals.com/sets/1/challenges/4/
# Set 1 Challenge 4
# Detect single-character XOR
################################################################################
# On... |
import operator
from mptt.models import MPTTModel
from reversion.models import Version
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Q
from django.db.models.loading import get_model
from django.views.generic.simple import direct_to_template
from q... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'Subject', removes relation that shouldn't exist at all...
db.delete_table(u'exams_subject'... |
# Copyright (c) 2011 AOL Inc. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merg... |
# -*- encoding: utf-8
"""
Curses user interface.
"""
import os
import sys
import logging
from wcwidth import wcswidth
from .prompt import Prompt, PromptBool, PromptFile, PromptAutocmp
from .key_mappings import key_map
# Curses can't be imported yet but we'll
# predefine it to avoid confusing flake8
curses = None
c... |
from __future__ import division
from collections import namedtuple
from math import sqrt,exp
import pdb
TrajectoryData = namedtuple("TrajectoryData", [
'proposed_lane',
'avg_speed',
'max_acceleration',
'rms_acceleration',
'closest_approach',
'end_distance_to_goal',
'end_lanes_from_goal',
'collides... |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 15 09:58:16 2016
@author: Internet
"""
import unittest
import sys, os.path
path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
if not path in sys.path:
sys.path.insert(1, path)
del path
import queueingDefs as Q
print()
class Test_queuingDefs_sat_... |
# Copyright 2013-2014 MongoDB, Inc.
#
# 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 writin... |
# Copyright (c) 2018 PaddlePaddle Authors. 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 appli... |
import datetime
import os.path
import subprocess
import time
import xml.etree.ElementTree
import dsz
import ops
XALAN = os.path.join(ops.RESDIR, 'ExternalLibraries', 'java-j2se_1.6-sun', 'xalan.jar')
STYLESHEET = os.path.join(ops.DATA, 'DszErrorExtractor.xsl')
class DszCommandError(list, ):
def __init__(self, ti... |
"""
KEY and DATA_KEYS FOR THE API
"""
PROPERTY_VALUES = '-property-values'
PROPERTY_VALUE = '-property-value'
TAGS = '-tags'
TAG = '-tag'
ITEMS = '-items'
ITEM = '-item'
COMMENTS = '-comments'
COMMENT = '-comment'
PAYMENTS = '-payments'
PAYMENT = '-payment'
EMAIL_RECEIVERS = '-email-receivers'
EMAIL_RECEIVER = '-... |
"""
SSN provider for es_MX.
This module adds a provider for mexican SSN, along with Unique Population
Registry Code (CURP) and Federal Taxpayer Registry ID (RFC).
"""
import random
import string
from .. import Provider as BaseProvider
ALPHABET = string.ascii_uppercase
ALPHANUMERIC = string.digits + ALPHABET
VOWELS ... |
# Copyright (c) by it's authors.
# Some rights reserved. See LICENSE, AUTHORS.
import wallaby.FXUI as FXUI
from wallaby.qt_combat import *
from wallaby.frontends.qt.widgets.edits.dateTimeEdit import DateTimeEdit
#============================================================================#
# The group name in desi... |
#
# Honeybee: A Plugin for Environmental Analysis (GPL) started by Mostapha Sadeghipour Roudsari
#
# This file is part of Honeybee.
#
# Copyright (c) 2013-2020, Mostapha Sadeghipour Roudsari <mostapha@ladybug.tools>
# Honeybee is free software; you can redistribute it and/or modify
# it under the terms of the GNU G... |
#!/usr/bin/env python
##############################################################################################
#
#
# regrid_emissions_N96e.py
#
#
# Requirements:
# Iris 1.10, cf_units, numpy
#
#
# This Python script has been written by N.L. Abraham as part of the UKCA Tutorials:
# http://www.ukca.ac.uk/wiki... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import logging
import urllib2
import traceback
import subprocess
class LaunchTests:
def __init__(self):
self.proteins = []
self.configs = []
self.tests = []
self.if_download = True
self.tests_by_protein = 1
self.tests_concurrent = 1
... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.6.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... |
# coding=utf-8
from __future__ import division
class TwoDArraySliceIterator(object):
"""
a simple iterator that build small slices from a big array
>>> import numpy as np
>>> arr = np.random.rand(100,100)
>>> n_pieces = (2,4)
>>> i = TwoDArraySliceIterator( arr.shape, n_pieces )
than i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.