src
stringlengths
721
1.04M
# 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 ...
# -*- coding: utf-8 -*- from module.plugins.internal.MultiHook import MultiHook class OverLoadMe(MultiHook): __name__ = "OverLoadMe" __type__ = "hook" __version__ = "0.04" __config__ = [("pluginmode" , "all;listed;unlisted", "Use for plugins" , "all"), ...
import os import unittest from vsg.rules import package_body from vsg import vhdlFile from vsg.tests import utils sTestDir = os.path.dirname(__file__) lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_201_test_input.vhd')) lExpected = [] lExpected.append('') utils.read_file(os.path.join(sTest...
""" termcolors.py """ from django.utils import six color_names = ('black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white') foreground = dict((color_names[x], '3%s' % x) for x in range(8)) background = dict((color_names[x], '4%s' % x) for x in range(8)) RESET = '0' opt_dict = {'bold': '1', 'underscore':...
# -*- coding: utf-8 -*- # Copyright 2021 Google 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 ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # File: ponies.py # by Arzaroth Lekva # lekva@arzaroth.com # from collections import OrderedDict PONY_LIST = OrderedDict([ ('Pony_Ace', 'Ace'), ('Pony_Action_Shot', 'Action Shot'), ('Pony_AKYearling', 'AKYearling'), ('Pony_Aloe', 'Aloe'), ('Pony_Appl...
import urllib, urllib2 import re try: import simplejson as json except ImportError: try: import json except ImportError: raise ImportError from datetime import datetime from bson.objectid import ObjectId from werkzeug import Response import pytz def scrape(url): """ Scrapes a url a...
# 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 ...
#coding:utf-8 import re import commands ################################### # # 测试系统日志是否做了权限限制 # #################################### class TvarfileMod: global results,sorce results=[] sorce=60 def setBaseline_main(self,baseline_main): self.baseline_main=baseline_main def start(self): print "[*] Checking Tv...
# Copyright 2013 Red Hat, 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 agr...
#!/usr/bin/python # -*- coding: utf-8 -*- import sys, os import platform import re import csv from PyQt4 import QtGui from PyQt4 import QtCore from CleanMyBib import CleanFileBib from pybtex.database.input import bibtex __version__ = "4.0.0" # Allow to read the picture files in pyinstaller datadir = ".img" if not h...
"""Provides a class for managing BIG-IP FDB tunnel record resources.""" # coding=utf-8 # # Copyright (c) 2017-2021 F5 Networks, 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 # # htt...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys from datetime import datetime from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QApplication, QStyle from anglerfish import (make_logger, check_encoding, make_post_exec_msg, set_process_name, set_single...
''' Copyright 2017, Fujitsu Network Communications, 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 w...
from config import config import json from requests_oauthlib import OAuth2Session from flask import session, abort, url_for, request from titanembeds.utils import redis_store, make_user_cache_key from flask_socketio import disconnect import time from oauthlib.oauth2.rfc6749.errors import InvalidGrantError authorize_ur...
#! /usr/bin/env python from distutils.core import setup setup( version="0.2.41", author="Samuele Carcagno", author_email="sam.carcagno@google.com;", description="Alpha Version of pysoundanalyser, a program for visualizing sounds ", long_description=\ """ Alpha Version of pysoundanalyser, a p...
-import json -import time -import praw -from riotwatcher import Riotwatcher -from riotwatcher import EUROPE_WEST -from riotwatcher import EUROPE_NORDIC_EAST -from riotwatcher import KOREA -from riotwatcher import OCEANIA -from riotwatcher import BRAZIL -from riotwatcher import LATIN_AMERICA_SOUTH -from riotwatcher impo...
""" python_lib_sphinx tests. """ import unittest from python_lib_sphinx.utils import Constants, orbital_speed, circumference, orbital_period class TestUtils(unittest.TestCase): """ Test python_lib_sphinx's utils. """ def setUp(self): pass def test_orbital_speed(self): """ ...
import os,sys,pdb,pickle import numpy as np import cv2 import theano import theano.tensor as T import random #you may try several times to get a good model and the init 'cost' may be quite large, 78 .e.g. class Layer(object): """ a layer is a maxtrix with row = output of this layer and col = output of prev...
import json import unittest from flask import url_for from outreach import app from outreach.models import (db, SaleItem) from fixtures import init_data class TestKharchaAPI(unittest.TestCase): def setUp(self): self.ctx = app.test_request_context() self.ctx.push() db.drop_all() db...
# Copyright 2016 Tesora, 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 ...
"""Common init to get the source root for files.""" __author__ = 'pramodg@room77.com (Pramod Gupta)' __copyright__ = 'Copyright 2012 Room77, Inc.' import inspect import os import sys import traceback # This is needed to build binaries due to a bug in pyinstaller. # May be removed in future if the bug is fixed. impor...
#!/usr/bin/env python import argparse import datetime import matplotlib import matplotlib.pyplot as pyp import os import subprocess import sys from collections import defaultdict def yodict(): return defaultdict(yodict) def main(args): # from cmdline args inputfile = args.inputfile if args.hostfile:...
import copy import json import logging import os import time import tkinter as tk from tkinter import ttk import cv2 import numpy as np from PIL import Image, ImageTk from src.keyhandler import KeyHandler from src.utils import Utils N = 300 LOGGER = logging.getLogger(__name__) class Labeler(tk.Frame, Utils, KeyHand...
''' Created on Dec 28, 2012 @author: nshearer ''' from abc import ABCMeta, abstractmethod from EtlProcessor import EtlProcessor class EtlJoinProcessor(EtlProcessor): '''Join one set of records to another''' def __init__(self): super(EtlJoinProcessor, self).__init__() se...
#!/usr/bin/python # # Copyright (C) 2017 and later, taligen project. # All rights reserved. License: see package. # import re class TaskListParameters: """ Collection of name-value pairs used for parameterizing TaskLists when instantiating TaskListTemplates """ def __init__( self, pairs ): ...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." # Note: Don't use "from appname.models imp...
"""ACME protocol v00 messages. .. warning:: This module is an implementation of the draft `ACME protocol version 00`_, and not the "RESTified" `ACME protocol version 01`_ or later. It should work with `older Node.js implementation`_, but will definitely not work with Boulder_. It is kept for reference purposes...
#!/usr/bin/env python # # @file ExtensionInitFunctions.py # @brief class to create init and typedef functions specific to the # extension class # @author Frank Bergmann # @author Sarah Keating # # <!-------------------------------------------------------------------------- # # Copyright (c) 2013-2015 by the Cali...
""" The MIT License (MIT) Copyright (c) 2014 NTHUOJ team 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, merge, ...
# -*- coding: utf-8 -*- import random import shutil import time import socket def game_preparation(file): """ Prepare the data structures need to play the game based on a .mv file. Return ------ - field: list of lists containing the characters contained in each cases of the board (list). ...
# (c) Copyright 2014 Hewlett-Packard Development Company, L.P. # # 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...
#!/usr/bin/env python """ crate_anon/nlp_manager/cloud_request_sender.py =============================================================================== Copyright (C) 2015-2021 Rudolf Cardinal (rudolf@pobox.com). This file is part of CRATE. CRATE is free software: you can redistribute it and/or modify ...
# Copyright 2011 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...
import unittest2 import pyudev from tuned.hardware.device_matcher_udev import DeviceMatcherUdev class DeviceMatcherUdevTestCase(unittest2.TestCase): @classmethod def setUpClass(cls): cls.udev_context = pyudev.Context() cls.matcher = DeviceMatcherUdev() def test_simple_search(self): try: device = pyudev.D...
import time import functools class TimeCost(object): def __init__(self, unit='s', precision=4, logger=None): self.start = None self.end = None self.total = 0 self.unit = unit self.precision = precision self.__unitfactor = {'s': 1, 'ms': 1000, ...
import gdata.data import gdata.contacts.client import gdata.contacts.data import string import config class Contacts: def __init__(self, credentials): auth2token = gdata.gauth.OAuth2Token(client_id=credentials.client_id, client_secret=credentials.client_secret, scope='https://www.google.c...
# Python imports. from __future__ import print_function from collections import defaultdict try: import pygame except ImportError: print("Warning: pygame not installed (needed for visuals).") import random import sys # Other imports. from simple_rl.planning import ValueIteration from simple_rl.tasks import Fou...
#!/usr/bin/env python from __future__ import print_function """ test_verbosity.py """ temp_dir = "test_verbosity/" import unittest import os import sys # add grandparent to search path for testing grandparent_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")) sys.path.insert(0, grandpar...
from hashlib import md5 import time import threading class Result: def __init__ (self, status, ident = None): self.status = status self.ident = ident self.timeout = 0 self.cached_time = 0 self.remain_secs = 0 self.is_cached = False def is_normal (self): return self.status == 3 def get_status (s...
#!/usr/bin/python import cgi import logging import urllib2 import simplejson import os import sys try: loglevel = sys.argv[1] except IndexError: loglevel = None if loglevel == '-d': logging.basicConfig(level=logging.DEBUG) logging.debug('set logging lvl to debug') scriptdir = os.path.dirname(os.path.abspath(_...
""" Problem 1 Greedy """ import unittest def brute_get_max_profits(yesterday_prices): """ Brute Force method :param yesterday_prices: :return: """ max_price = float('-inf') for i, buy_price in enumerate(yesterday_prices): best_price = float('-inf') for sell_pric...
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + from __future__ import (absolute_import, divi...
# -*- coding: utf-8 -*- # Generated by Django 1.11.24 on 2019-09-27 19:04 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('nomination', '0003_project_archive_url'), ] opera...
from django.contrib.auth.models import User from django.db import models from django import forms import datetime class Plugin(models.Model): author = models.ForeignKey(User, help_text='The user who wrote the plugin.') name = models.SlugField(max_length=255, help_text='The name of the plugin.', u...
# # Authors: Travis Oliphant, Ed Schofield, Robert Cimrman, Nathan Bell, and others """ Test functions for sparse matrices """ __usage__ = """ Build sparse: python setup.py build Run tests if scipy is installed: python -c 'import scipy;scipy.sparse.test()' Run tests if sparse is not installed: python tests/test...
# -*- coding: utf-8 -*- from PIL import Image, ImageDraw, ImageFont import textwrap from unidecode import unidecode from reportlab.graphics import renderPM from reportlab.graphics.barcode import code128 from reportlab.graphics.barcode import createBarcodeDrawing from reportlab.graphics.barcode import createBarcodeImag...
r"""Script for training model. Simple command to get up and running: python train.py --memory_size=8192 \ --batch_size=16 --validation_length=50 \ --episode_width=5 --episode_length=30 """ import logging import os import random from mimic_gen import MimicDataLoader from sklearn.metrics import precision_...
class NoPermissionToAdd(Exception): def __init__(self, container, content_type): self.container = container self.content_type = content_type def __repr__(self): return "Not permission to add {content_type} on {path}".format( content_type=self.content_type, path...
import pygame from pygame.locals import * from input_manager import InputManager, Actions import screens, menu from game_instance import GameInstance from ui_overlay import UIOverlay, TextElement from pyconsole import Console class Game(object): def __init__(self, config): self.max_fps = config.get("max_...
# Copyright 2015 NEC 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 # # Unless required by applicable l...
from sklearn.mixture import DPGMM import sys import logging, os from optparse import OptionParser import numpy as np from tables import * from extract_datasets import extract_unlabeled_chunkrange, extract_chunk_sizes import contextlib,time @contextlib.contextmanager def timeit(): t=time.time() yield print(time....
# -*- encoding: utf-8 -*- # pilas engine: un motor para hacer videojuegos # # Copyright 2010-2014 - Hugo Ruscitti # License: LGPLv3 (see http://www.gnu.org/licenses/lgpl.html) # # Website - http://www.pilas-engine.com.ar from pilasengine.actores.animacion import Animacion class Bomba(Animacion): """Representa un...
# Opus/UrbanSim urban simulation software. # Copyright (C) 2010-2011 University of California, Berkeley, 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.upc.lottery_choices import lottery_choices from scipy.optimize import fmin_l_bfgs_b from opus_core.logger import logger from opus_core impor...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # # To generate DEB package from Python Package: # sudo pip3 install stdeb # python3 setup.py --verbose --command-packages=stdeb.command bdist_deb # # # To generate RPM package from Python Package: # sudo apt-get install rpm # python3 setup.py bdist_rpm --verbose --fix-p...
# Copyright (c) 2012 Paul Tagliamonte <paultag@debian.org> # # 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, modif...
''' MAP Client, a program to generate detailed musculoskeletal models for OpenSim. Copyright (C) 2012 University of Auckland This file is part of MAP Client. (http://launchpad.net/mapclient) MAP Client is free software: you can redistribute it and/or modify it under the terms of the GNU General Publi...
import logging from flask import flash, redirect, request, url_for from flask_login import current_user from scout.server.extensions import store from scout.server.utils import user_institutes from .forms import DashboardFilterForm LOG = logging.getLogger(__name__) def institute_select_choices(): """Return a ...
# Copyright 2020 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
#!/usr/bin/env python """ cythonize Cythonize pyx files into C files as needed. Usage: cythonize [root_dir] Default [root_dir] is 'spacy'. Checks pyx files to see if they have been changed relative to their corresponding C files. If they have, then runs cython on these files to recreate the C files. The script th...
''' This module contains classes responsible for displaying input data in a table (TableFrame and TableFrameWithInputOutputBox). It also contains many classes necessary for TableFrameWithInputOutputBox. Attributes: CELL_WIDTH (int): constant that defined width of a cell in a table ''' from tkinter ...
from .parsepokemon import add_pokemons from .parsejokes import add_jokes from .parsecategories import add_categories from app.models import db, Term, Photo, Location, User, Joke, Category, Termcategories, Description import os import pickle import json if os.path.exists('app/data/pokemon_names_mapping') == False: ...
""" Tests the vuq.CachedFunction decorator. Author: Ilias Bilionis Date: 6/6/2014 """ import numpy as np import time from vuq import * # Test the evaluation of a cached and of an un-cached function # An expensive function def f(x): for i in xrange(1000): x += i x /= 1000000 return 2....
# -*- coding: utf-8 -*- import pygame import random import sys from math import sqrt import classes.board import classes.extras as ex import classes.game_driver as gd import classes.level_controller as lc import classes.simple_vector as sv class Board(gd.BoardGame): def __init__(self, mainloop, speaker, config,...
# /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Headers/LSSharedFileList.h # Fun things: # kLSSharedFileListFavoriteItems # kLSSharedFileListFavoriteVolumes # kLSSharedFileListRecentApplicationItems # kLSSharedFileListRecentDocumentItems # kLSSharedFileList...
#!/usr/bin/env python # Copyright (c) 2012 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. '''Unit tests for grit.format.policy_templates.writers.doc_writer''' import os import re import sys if __name__ == '__main__': ...
""" Django settings for todoapp project. Generated by 'django-admin startproject' using Django 1.9.3. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os #...
import os import time from Tools.CList import CList from SystemInfo import SystemInfo from Components.Console import Console from boxbranding import getBoxType, getMachineBuild import Task def readFile(filename): file = open(filename) data = file.read().strip() file.close() return data def getProcMounts(): try: ...
# Copyright 2016 Jason Horne # # 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, s...
""" Sequence distance metrics (:mod:`skbio.sequence.distance`) ========================================================== .. currentmodule:: skbio.sequence.distance This module contains functions for computing distances between scikit-bio ``Sequence`` objects. These functions can be used directly or supplied to other...
#!/usr/bin/env python # -*- coding: utf-8 -*- import htpc import cherrypy import json import logging import time import math from cherrypy.lib.auth2 import require from htpc.helpers import striphttp, sizeof import requests from requests.auth import HTTPDigestAuth class Qbittorrent(object): session = requests.Ses...
# Copyright 2018 The TensorFlow Probability Authors. # # 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 o...
""" :copyright: (c) 2014 Building Energy Inc :license: see LICENSE for more details. """ #!/usr/bin/env python # encoding: utf-8 """ urls/projects.py Copyright (c) 2013 Building Energy. All rights reserved. """ from django.conf.urls import patterns, url urlpatterns = patterns( 'seed.views.projects', url( ...
from __future__ import print_function import os import shutil from math import floor from ...workspace_factory import workspace_factory from ....utils import in_temporary_directory from ....utils import assert_cmd_success from ....utils import assert_cmd_failure from ....utils import assert_files_exist from ....ut...
#!/usr/bin/env python from __future__ import absolute_import from __future__ import print_function import sys import logging import getdist try: import argparse except ImportError: print('use "module load" to load python 2.7+, or see docs/readme_python.html for how to install') sys.exit() try: from g...
from datetime import datetime import time from django.contrib.auth import get_user_model from django.contrib.auth.models import Group, Permission from django.utils.text import slugify from html5lib.filters._base import Filter as html5lib_Filter from nose.tools import nottest from waffle.models import Flag from kuma....
# -*- coding:utf-8 -*- # Author: hankcs # Date: 2020-08-02 16:51 import logging from typing import Union, List, Dict, Any, Iterable, Tuple import torch from alnlp.modules import util from torch import Tensor from torch.utils.data import DataLoader from hanlp.common.dataset import SamplerBuilder, PadSequenceDataLoader...
#!/usr/bin/python # Software License Agreement (BSD License) # # Copyright (c) 2008, Willow Garage, 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: # # * Redistributions of source code mus...
"""This module defines calendar classes (mostly abstract) for hbcal""" # Copyright 2015, 2016, 2019 Mark Stern # # This file is part of Hbcal. # # Hbcal is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, # as published by the Free Software Foundat...
# coding=utf-8 from __future__ import division import cv2 import numpy as np from pyqtgraph_karl.Qt import QtCore from imgProcessor.transformations import toFloatArray from dataArtist.widgets.Tool import Tool class VideoStream(Tool): ''' Capture the video stream from a connected webcam. ''' icon = ...
# ROBERTO YUBERO DE DIEGO #!/usr/bin/python3 # -*- coding: utf-8 -*- import sys import calcoohija if __name__ == "__main__": fichero = open(sys.argv[1], 'r') #leo todo el fichero lista_lineas = fichero.read() #creamos una lista de lineas sin salto de linea lista_lineas = lista_lineas.splitlin...
# coding=utf-8 """Provider code for EZTV.""" from __future__ import unicode_literals import logging from medusa import tv from medusa.helper.common import convert_size from medusa.indexers.utils import mappings from medusa.logger.adapters.style import BraceAdapter from medusa.providers.torrent.torrent_provider impo...
# -*- coding: utf-8 -*- # Copyright (C) 2015-2020 by Brendt Wohlberg <brendt@ieee.org> # All rights reserved. BSD 3-clause License. # This file is part of the SPORCO package. Details of the copyright # and user license can be found in the 'LICENSE.txt' file distributed # with the package. r"""Classes for ADMM algorith...
import sqlalchemy as sql from sqlalchemy import orm from sqlalchemy import Column from gogdb.legacy.database import Base from gogdb.legacy.model.common import get_systems_list, set_systems_list class Product(Base): __tablename__ = "products" id = Column(sql.Integer, primary_key=True, autoincrement=False) ...
import bpy, bmesh import logging from array import array class dsf_geom_define (object): """utility class for inserting mesh data into blender. """ log = logging.getLogger ('dsf_geom_define') @classmethod def create_vertex_groups (self, geom): """convert the face-groups to a map of vertex-groups. ""...
import os import gtk import user import pango import gobject from threading import Thread, Event class Column: ICON = 0 NAME = 1 DIRECTORY = 2 class FindFiles(gobject.GObject): """Find files tool""" __gtype_name__ = 'Sunflower_FindFiles' __gsignals__ = { 'notify-start': (gobject.SI...
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2003-2006 Donald N. Allingham # Copyright (C) 2009-2010 Gary Burton # Copyright (C) 2010 Nick Hall # # 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 #...
from BoloMass.Arnett82 import tau_0, Lambda, A82LC_full, A82LC_gp from RetroSpect.Plotting import color_ramp import sys import numpy as np import matplotlib.pyplot as pypl def test_A82_Lambda(): """Test plots for Lambda""" y = np.arange(0.7, 1.41, 0.1) c = color_ramp(len(y)) for yi, ci in zip(y, c): ...
# 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 required by applicable law or a...
''' Copyright (c) 2014 Pivotal 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/licenses/LICENSE-2.0. Unless required by applicable law or ...
# go_minecraft.py import sys import time import aikif.toolbox.interface_windows_tools as mod_tool players = ['DynamiteBuilder', 'craftandstore'] #server = '1.9' #server = '1.10' server = '1.11.2' seed = 0 if server == '1.11.2': seed = -7560993781265470572 locations = [ {'name':'home', ...
from __future__ import division import errno import json import os import sys import time import traceback from twisted.internet import defer from twisted.python import log from twisted.web import resource, static import p2pool from bitcoin import data as bitcoin_data from . import data as p2pool_data, p2p from util...
import sys import unittest from tree import TreeNode, null class Codec: def __init__(self): self.tree = '' def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str """ self._preorder(root) return self.tree[:-1]...
from datetime import datetime from openerp.osv import fields,osv from openerp.tools.translate import _ class purchase_requisition_line(osv.osv): _inherit = "purchase.requisition.line" def stock_out(self, cr, uid, ids,stock_out): if self.stock_out: return { 'view_type': 'form', 'flags': {'a...
import sys import readParams_moreoptions as rdp1 import matplotlib import matplotlib.pyplot as plt import matplotlib.ticker as ticker from mom_plot1 import m6plot, xdegtokm import numpy as np from netCDF4 import MFDataset as mfdset, Dataset as dset import time from plot_twamomx_budget_complete_direct_newest import extr...
''' Created on June 28, 2016 This file is subject to the terms and conditions defined in the file 'LICENSE.txt', which is part of this source code package. @author: David Moss ''' import utilities.utilities as utilities import intelligence.index import importlib # This is the maximum number of elements we'll averag...
#! /usr/bin/python """ detect color sequence ren ye 2016-10-21 reference: http://stackoverflow.com/questions/14476683/identifying-color-sequence-in-opencv algorithm: # image preparation 1. subwindowing to light buoy by laser and camera 2. convert to hsv 3. check hue for the blob # detection 1...
################################################################################################################## # Platform for study of IMU features and functionality (using Samsung S3 internal phone IMU) # Demo program (imu.py) # # Copyright (c) 2014 Bernard Chan # chanlhock@gmail.com # # Date Author N...
''' Created on Jun 30, 2013 @author: jurek module used for some specific tasks concerning time and date ''' import datetime class DateTimeUtils(object): """ class with some useful time/date functionality """ def __init(self): self.__start_datetime__ = datetime.datetime.now() self.__...
import os.path import logging import subprocess import shutil import json from gii.core import * from mock import _MOCK from gii.qt.dialogs import requestString, alertMessage, requestConfirm ##----------------------------------------------------------------## class EffectAssetManager( AssetManager ): def getName(...