src
stringlengths
721
1.04M
from .. import settings from .. import logging as logg from .utils import strings_to_categoricals, vcorrcoef from .velocity_pseudotime import velocity_pseudotime from scipy.sparse import issparse import numpy as np def get_mean_var(X, ignore_zeros=False, perc=None): data = X.data if issparse(X) else X mask_n...
# -*- coding: utf-8 -*- """This is a generated class and is not intended for modification! """ from datetime import datetime from infobip.util.models import DefaultObject, serializable from infobip.api.model.omni.Price import Price from infobip.api.model.omni.Status import Status from infobip.api.model.omni.OmniChann...
# Copyright (C) 2010-2011 Richard Lincoln # # 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, publish...
#!/usr/bin/env python #-*- coding:utf-8 -*- #Copyright (C) 2012-2013 Thecorpora 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 v...
""" ex_type1_nomo_1.py Simple nomogram of type 1: F1 + F2 + F3 = 0 Copyright (C) 2007-2009 Leif Roschier 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...
from flask import Flask from flask_bootstrap import Bootstrap #from flask_mail import Mail from flask_moment import Moment from flask_sqlalchemy import SQLAlchemy from flask_restful import Api from flask_login import LoginManager from flask_jwt_extended import JWTManager, jwt_required from config import config bootstr...
# -*- coding: utf-8 -*- # # GRID_LRT documentation build configuration file, created by # sphinx-quickstart on Mon Feb 5 09:40:38 2018. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
# -*- coding: utf-8 -*- # © 2014-2016 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import time import re import odoo.tests.common as test_common from odoo.report import render_report class TestPaymentSlip(test_common.TransactionCase): _compile_get_ref = re.compile(r'[^0-9]') ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from datetime import datetime from re import sub from bottle import Bottle, default_app, redirect, request, route from ..db import Feed, FeedItem from ..util.web import urlfor __all__ = ['app'] app = Bottle() with app: assert app is default_app() JANDAN_PAGE...
# -*- coding: utf-8 -*- import re import mock from typing import Dict, Any, Set from django.conf import settings import zerver.lib.openapi as openapi from zerver.lib.test_classes import ZulipTestCase from zerver.lib.openapi import ( get_openapi_fixture, get_openapi_parameters, validate_against_openapi_schema...
import IMP import IMP.test import IMP.algebra import IMP.em from io import BytesIO class Tests(IMP.test.TestCase): def test_rasterization(self): """Test creation DensityMap from grid""" t = IMP.algebra.Vector3D(1., 2., 3.) r = IMP.algebra.get_identity_rotation_3d() tran = IMP.algeb...
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser 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 that it will ...
from django.db import models from django.db.models.signals import post_save from django.db.utils import DatabaseError from django.dispatch import receiver from django.contrib.auth.models import User STANDARD_EMAIL = "anonymous@readthedocs.org" class UserProfile (models.Model): """Additional information about a Us...
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006-2010 (ita) "ocaml support" import os, re from waflib import Utils, Task from waflib.Logs import error from waflib.TaskGen import feature, before_method, after_method, extension EXT_MLL = ['.mll'] EXT_MLY = ['.mly'] EXT_MLI = ['.mli'] EXT_MLC = ['.c'] EXT_ML...
''' Convert meter data from EU format to our anomly detection input format. ''' '''A script to read data from inCSV, and write it to outCSV''' import csv, os, datetime, operator from os.path import join as pJoin #import json, pprint, random #import matplotlib.pyplot as plt #import numpy as np # Path variables...
''' Created on Sep 12, 2017 @author: arnon ''' import logging import time import os class Step(object): ''' Basic building block for sequent steps with precistency ''' def __init__(self,): pass def __call__(self, *args, **kwargs): try: self.at_start(*args, **kwa...
#!/usr/bin/env python # wikid, Copyright (c) 2010, R. P. Dillon <rpdillon@etherplex.org> # This file is part of wikid. # # wikid 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * import random class DiceSet(object): def __init__(self): self._values = [] @property def values(self): return self._values def roll(self, n): self._values = [] for i in range(0, n): ...
# -*- coding: utf-8 -*- # # Copyright 2004-2006 André Malo or his licensors, as applicable # # 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 #...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import jsonschema from future.utils import PY2 from future.backports.http import client as backport_client import re import os import sys import yaml import logging import...
from __future__ import absolute_import, division, print_function from datashape.predicates import iscollection, isscalar, isnumeric from toolz import partial, unique, first import datashape from datashape import dshape, DataShape, Record, Var, Option, Unit from .expressions import ElemWise, Label, Expr, Symbol, Field...
#!/usr/bin/python import os import json, sqlite3 import initdb import builddb import requests, zipfile import shutil import discordBot APP_PATH = "/etc/destinygotg" DBPATH = f"{APP_PATH}/guardians.db" def check_db(): """Check to see if a database exists""" return os.path.isfile(os.environ['DBPATH']) def init...
# Copyright (C) 2008 Google, Inc. All Rights Reserved. # Copyright (C) 2012 Michael Bryant. # # 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 opt...
import os.path import sys import twitter from dateutil.parser import parse from configparser import ConfigParser from pypump import PyPump from pypump import Client from pypump.exceptions import ClientException from requests.exceptions import ConnectionError def simple_verifier(url): print('Please follow the instruct...
# -*- coding: utf8 -*- # SDAPS - Scripts for data acquisition with paper based surveys # Copyright(C) 2008, Christoph Simon <post@christoph-simon.eu> # Copyright(C) 2008, Benjamin Berg <benjamin@sipsolutions.net> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Ge...
######## # Copyright (c) 2014 GigaSpaces Technologies Ltd. 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...
#!/usr/bin/python import sys import numpy as np import matplotlib matplotlib.use('cairo') from yt.mods import load as yt_load from pylab import * THRESHOLD = 1e-9 FIELD = "cr1" def _myplot(diff, fname, ext, clbl): v = abs(diff).max() figure(1, (6, 8)) imshow(diff, vmin=-v, vmax=v, extent=ext, cmap='RdBu'...
#- # Copyright (c) 2013 Colin Rothwell # All rights reserved. # # This software was developed by and Colin Rothwell as part of his summer # internship. # # @BERI_LICENSE_HEADER_START@ # # Licensed to BERI Open Systems C.I.C. (BERI) under one or more contributor # license agreements. See the NOTICE file distributed wi...
# Copyright 2017 The TensorFlow 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 applica...
import pylab import time import sys import os # get the utils from the parent directory try: from utils import (PCircle, PEllipse) except ImportError: sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from utils import (PCircle, PEllipse) # fix large image error import PIL PIL.I...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015, 2016 CERN. # # Invenio 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...
# -*- coding: utf-8 -*- # # # TheVirtualBrain-Scientific Package. This package holds all simulators, and # analysers necessary to run brain-simulations. You can use it stand alone or # in conjunction with TheVirtualBrain-Framework Package. See content of the # documentation-folder for more details. See also http://www...
#!/usr/bin/python -uB # -*- coding: utf-8 -*- # Classes of methods base_vers = ['TransE', 'ScalE'] scaltrans_vers = ['ScalTransE'] xi_vers = ['XiTransE', 'XiScalE'] semixi_vers = ['XiScalTransSE', 'XiTransScalSE'] xiscaltrans_vers = ['XiScalTransE'] simple_method_set = base_vers + xi_vers #+ scaltrans_vers + semixi_v...
################################################################################################################ # Authors: # # Kenny Young (kjyoung@ualberta.ca) ...
from api_engine import APIEngine from objects.obj_address import AddressObj import consts.paths as paths import consts.switches as switches import time from common.globals import handle_err_msg class PropertyParser(object): address_index = -1 city_index = -1 state_index = -1 zip_index = -1 price_...
# coding=utf-8 import numpy as np from scipy import integrate as intgrt import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from math import sqrt # 计算半球的体积 def ballVolume(): def halfBall(x, y): return sqrt(1 - x**2 - y**2) def halfCircle(x): return sqrt(1 - x**2) (vol, error) = intgrt.dblqua...
""" @name: /home/briank/workspace/PyHouse/Project/src/Modules/House/Family/Reolink/reolink_device.py @author: D. Brian Kimmel @contact: D.BrianKimmel@gmail.com @copyright: (c) 2013-2019 by D. Brian Kimmel @license: MIT License @note: Created on Jan 26, 2020 @summary: """ __updated__ = '2020-01-26' __...
"Melting a copper cluster." from numpy import * from asap3 import Atoms, EMT, units from ase.visualize.primiplotter import * from ase.lattice.cubic import FaceCenteredCubic from asap3.md.langevin import Langevin # Create the atoms atoms = FaceCenteredCubic(size=(5,5,5), symbol="Cu", pbc=False) # Associate the EMT p...
#===islucyplugin=== # -*- coding: utf-8 -*- # lucy plugin # delirium.py # Initial Copyright © 2007 Als <Als@exploit.in> # Modifications Copyright © 2014 x-team <x-team@muc.xtreme.im> # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as...
from __future__ import print_function import json from prettytable import PrettyTable from jirafs import utils from jirafs.plugin import CommandPlugin from jirafs.ticketfolder import TicketFolder class Command(CommandPlugin): """Search for users matching the specified search term""" MIN_VERSION = '1.0a1' ...
#!/usr/bin/env python # -*- coding: UTF-8 -*- ########## ## Fan control for odroid xu4 ## when hit hiTmp manage fan speed until hit loTmp then stop. ## steps make fan wants to speed down more than speed up, for silence. ## recommanded governor : conservative ############################ import os, sys, signal, re, tim...
from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext import numpy as np setup( cmdclass = {'build_ext':build_ext}, include_dirs = [np.get_include()], ext_modules = [Extension("interp",["interp.pyx", "par_interp.cpp"], ...
# -*- coding: utf-8 -*- # Generated by Django 1.9.6 on 2016-09-05 08:50 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependen...
from django.db import models from django.utils import timezone from django.conf import settings from jsonfield import JSONField class Project(models.Model): # e.g. mozilla/socorro github_full_name = models.CharField(max_length=200) # This'll match '^Headsup: ...' trigger_word = models.CharField(defa...
from flask import g, jsonify, request, abort from flask_cors import cross_origin from soundem import app from .decorators import auth_token_required from .models import Artist, Album, Song, User @app.route('/api/v1/login', methods=['POST']) @cross_origin(headers=['Content-Type', 'Authorization']) def login(): d...
# -*- coding: utf-8 -*- # # Copyright (C) 2015 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. # # This software consists o...
"""\ OWConcurent =========== General helper functions and classes for Orange Canvas concurrent programming """ import threading import atexit import logging from contextlib import contextmanager from AnyQt.QtCore import ( Qt, QObject, QMetaObject, QThreadPool, QThread, QRunnable, QEventLoop, QCoreApplicat...
import PySide from API import P18F4550 from UI.Main import Ui_MainWindow from UI.FrmAgregarEvento import Ui_FrmAgregarEvento from PySide.QtGui import * from PySide.QtCore import * from Commons import Db import sys import os ROOT_DIR = os.path.abspath(sys.path[0]) CONF_DIR = os.path.join(ROOT_DIR,"Commons") class FrmAg...
#!/usr/bin/python # Dependencies import sys import os import time import json import tarfile import shutil import requests # Help text if len(sys.argv) < 2: print "Usage:" print " python restore.py (indexname)" print " python restore.py (indexname) (elasticsearch host)" print " python restore.py (indexname) (elas...
#!/usr/bin/python # -*- coding: utf-8 -*- import os import sys import time import feedparser import requests import json from datetime import datetime from datetime import timedelta from send_notify import send_notify_mail # files in this project from setting import AUTO_UPDATE_SECS from setting import SEND_EMAIL from...
""" Tests for L{imaginary.action.LookAt} and L{imaginary.action.LookAround}. """ from __future__ import print_function from textwrap import dedent from twisted.trial.unittest import TestCase from zope.interface import implementer from characteristic import attributes as has_attributes from axiom import store, item, ...
import setuptools with open('VERSION.txt', 'r') as f: version = f.read().strip() setuptools.setup( name="odoo12-addons-oca-reporting-engine", description="Meta package for oca-reporting-engine Odoo addons", version=version, install_requires=[ 'odoo12-addon-bi_sql_editor', 'odoo12-a...
# Copyright (C) 2012 Mark Burnett, David Morton # # 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. # # ...
# 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 # ...
#!/usr/bin/env python3 import unittest import sys import subprocess import random import logging logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) sys.path.append("..") from symbols import __main__ as symbols from symbols import x86_decode as decode from symbols import errors class Arch: def ...
import argparse import importlib import logging import os import pprint import pickle as pkl from functools import reduce from core.detection_module import DetModule from utils import callback from utils.memonger_v2 import search_plan_to_layer from utils.lr_scheduler import LRScheduler, WarmupMultiFactorScheduler, LRS...
# -*- coding: utf8 -*- """Flask endpoints provide the URL endpoints for the auth system. :license: AGPL v3, see LICENSE for more details :copyright: 2014-2021 Joe Doherty """ # 3rd party imports from flask import ( current_app as app, flash, redirect, render_template, request, url_for, session, jsonify, Blu...
import sys import e32 import urllib import string from socket import * import telephone import time # for contacts import contacts import re # ==================================== # Contacts Search Engine #===================================== contacts_cache = [] new_call = 0 settings = {} #######...
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013, John McNamara, jmcnamara@cpan.org # import unittest from ...compatibility import StringIO from ..helperfunctions import _xml_to_list from ...worksheet import Worksheet from ...sharedstring...
import sys sys.path.append('/opt/py') from datetime import datetime import json import minecraft from wurstminebot import nicksub import os import os.path import re import requests import subprocess import threading import time from datetime import timezone import traceback import tzlocal import xml.sax.saxutils cla...
# 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 # # Unless required by applicable law or a...
import xml.etree.ElementTree as ET import os, shutil import datetime import openpyxl tree = ET.parse('Meeting Plan Generator.xml') root = tree.getroot() from PyPDF2.PyPDF2.pdf import PdfFileReader while 1: today = datetime.date.today() daysToNextWednesday = datetime.timedelta((2 - datetime.date.weekday(today)) % 7)...
""" Testing a simple case of production compilation. The compilation also allows for utility learning, shown in the model below, as well. """ import warnings import pyactr as actr class Compilation1(object): """ Model testing compilation -- basic cases. """ def __init__(self, **kwargs): actr...
#!/usr/bin/python import os import datetime import cherrypy from jinja2 import Environment, FileSystemLoader, TemplateNotFound import arrow def arrow_humanize(value): obj = arrow.get(value) return obj.humanize() def template(filename=None): # , *args, **kwargs def wrap(f, *args, **kwargs): def ...
""" Debugging utilities for constructs """ import sys import traceback import pdb import inspect from construct.core import Construct, Subconstruct from construct.lib import HexString, Container, ListContainer class Probe(Construct): """ A probe: dumps the context, stack frames, and stream content to the sc...
import unittest import os import json from processes.insert_movies2companies import Main from processes.postgres import Postgres try: DB_SERVER = os.environ['DB_SERVER'] DB_PORT = os.environ['DB_PORT'] DB_DATABASE = os.environ['DB_DATABASE'] DB_USER = os.environ['DB_USER'] DB_PASSWORD = os.environ...
#Provides interface functions to create and save models import numpy import re import nltk import sys from sklearn.feature_extraction.text import CountVectorizer import pickle import os import sklearn.ensemble from itertools import chain base_path = os.path.dirname(__file__) sys.path.append(base_path) from .essay_s...
import discord_logging import utils from classes.key_value import KeyValue log = discord_logging.get_logger() class _DatabaseKeystore: def __init__(self): self.session = self.session # for pycharm linting self.log_debug = self.log_debug def save_keystore(self, key, value): if self.log_debug: log.debug(...
# This Python module is part of the PyRate software package. # # Copyright 2020 Geoscience Australia # # 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/...
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import models class account_report_...
from airflow.models import DAG from airflow.operators.python import PythonOperator from airflow.utils.dates import days_ago from airflow_multi_dagrun.operators import TriggerMultiDagRunOperator from airflow_multi_dagrun.sensors import MultiDagRunSensor def generate_dag_run(): return [{'timeout': i} for i in rang...
#!/usr/bin/python # -*- coding: utf-8 -*- import os import json import logging import copy try: from crawler.runtime_environment import IRuntimeEnvironment except ImportError: from runtime_environment import IRuntimeEnvironment logger = logging.getLogger('crawlutils') class CloudsightEnvironment(IRuntimeEn...
# coding=utf-8 """ 卡布列克数 http://group.jobbole.com/26887/ 有一种数被称为卡布列克数,其形式如:45 * 45 = 2025 并且 20+25=45,这样 45 就是一个 卡布列克数。 它标准定义如下: 若正整数X在N进制下的平方可以分割为二个数字,而这二个数字相加后恰等于X,那么X就是 N进制下的卡布列克数。 分解后的数字必须是正整数才可以,例如:10*10=100 并且 10+0=10,因为0不是正整数, 所以10不是卡布列克数。 现在题目的要求是给定你一个范围[a,b](b大于等于a,a大于等于0),你需要把这个范围内的 卡布列克数全...
''' Plugin for CudaText editor Authors: Andrey Kvichansky (kvichans on github.com) Version: '2.3.15 2021-04-02' ToDo: (see end of file) ''' import re, os, sys, json, collections, itertools, webbrowser, tempfile, html, pickle, time, datetime from itertools import * from pathlib import PurePath as ...
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # 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 #...
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-06-12 10:21 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Crea...
import os.path as op import numpy as np import numpy.testing as npt import nibabel as nib import nibabel.tmpdirs as nbtmp from AFQ.utils import streamlines as aus import dipy.tracking.utils as dtu import dipy.tracking.streamline as dts from dipy.io.stateful_tractogram import StatefulTractogram, Space def test_bundles...
import json from django.utils.translation import ugettext_lazy as _ from swiftclient import ClientException from horizon import exceptions from openstack_dashboard.api import keystone from openstack_dashboard.api import swift from crystal_dashboard.api import filters as api_filters from crystal_dashboard.api import p...
# 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...
# pylint: disable=missing-docstring from lettuce import step, world SELECTORS = { 'spinner': '.video-wrapper .spinner', 'controls': '.video-controls', } # We should wait 300 ms for event handler invocation + 200ms for safety. DELAY = 0.5 @step('I have uploaded subtitles "([^"]*)"$') def i_have_uploaded_sub...
## # Copyright (c) 2011-2014 Apple 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 l...
#! /usr/bin/python # -*- coding:utf-8 -*- import sys import numpy as np import random import logging __all__ = [ 'TransFeatFromFloats', 'Mean', 'Gradient', 'GradientAngle', 'ConNum', 'ContinousIncrease', 'PairsIncrease', 'CoutNonNeg', 'GradientsBySample', 'ConinousPotiveCount'...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # This file is part of solus-sc # # Copyright © 2013-2018 Ikey Doherty <ikey@solus-project.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 Founda...
# -*- coding: utf-8 -*- # Copyright 2012-2013 UNED # # 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...
import numpy as np """ It is created for using MTC in Mujoco. The dynamics in this model is not continuous. The integration error will be accumulated overtime. And the system might get unstable if the timestep is too large. It is recommended to set the timestamp lower than 5e-4 to get decent results. The model is cre...
#!/usr/bin/env python # encoding: utf-8 #Created by gic on 2007-03-02. # Copyright (C) 2007 Graham I Cummins # 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 ...
# -*- coding: utf-8 -*- # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
""" Tablib - HTML export support. """ import codecs from io import BytesIO from MarkupPy import markup class HTMLFormat: BOOK_ENDINGS = 'h3' title = 'html' extensions = ('html', ) @classmethod def export_set(cls, dataset): """HTML representation of a Dataset.""" stream = Bytes...
import pickle import matplotlib import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec # make sample spectra plot(dataset.wl, dataset.tr_flux[2,:], alpha=0.7, c='k') title(r"Typical High-S/N LAMOST Spectrum", fontsize=27) xlim(3500, 9500) tick_params(axis='x', labelsize=27) tick_para...
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance wi...
#! /usr/bin/env python # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2010-2014 Intel Corporation # from __future__ import print_function import sys import os import getopt import subprocess from os.path import exists, abspath, dirname, basename # The PCI base class for all devices network_class = {'Class': '...
# -*- coding: utf-8 -*- import atexit import json import os import re import six from collections import namedtuple from datetime import date from math import ceil from tempfile import NamedTemporaryFile from wait_for import wait_for from cached_property import cached_property from jsmin import jsmin from lxml.html im...
# 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, software # distributed under the Li...
""" The event module provides a simple system for properties and events, to let different components of an application react to each-other and to user input. In short: * The :class:`HasEvents <flexx.event.HasEvents>` class provides objects that have properties and can emit events. * There are three decorators to cr...
# Copyright 2015 Mirantis 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 writing,...
#!/usr/bin/env python3 # Copyright (c) 2015-2019 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 BIP66 (DER SIG). Test that the DERSIG soft-fork activates at (regtest) height 1251. """ from tes...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import frappe.defaults from frappe.utils import cint, flt from frappe import _, msgprint, throw from erpnext.accounts.party import get_par...
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de> # # License: Simplified BSD import os.path as op import numpy as np from numpy.testing import (assert_array_almost_equal, assert_allclose, assert_array_less, assert_array_...
import argparse import gym import os import numpy as np from gym.monitoring import VideoRecorder import baselines.common.tf_util as U from baselines import deepq from baselines.common.misc_util import ( boolean_flag, SimpleMonitor, ) from baselines.common.atari_wrappers_deprecated import wrap_dqn from baselin...
import os import sys import numpy as np from copy import deepcopy import argparse #Parallel import subprocess as sp import multiprocessing as mp sys.path.append(os.path.join(os.path.dirname(__file__),"../projects/tools")) import msh import executable_paths as exe def parse(): parser = argparse.ArgumentParser(de...