content
string
import platform from diffcalc.util import DiffcalcException DEBUG = False try: from gda.device.scannable import ScannableBase except ImportError: from diffcalc.gdasupport.minigda.scannable import ScannableBase from diffcalc.ub.ub import ubcalc, _to_column_vector_triple class _DynamicDocstringMetaclass(type...
import datetime import json import numpy as np import os import sys import tensorflow as tf from tensorflow.contrib.session_bundle import exporter flags = tf.app.flags flags.DEFINE_integer("max_epochs", 100, "Number of steps to run trainer.") flags.DEFINE_string("checkpoint_path", "./checkpoint/", ...
import time import unittest import config import node LEADER = 1 ROUTER = 2 class Cert_5_8_2_KeyIncrement(unittest.TestCase): def setUp(self): self.simulator = config.create_default_simulator() self.nodes = {} for i in range(1,3): self.nodes[i] = node.Node(i, simulator=self.s...
# Databricks notebook source exported at Tue, 28 Jun 2016 09:35:44 UTC # MAGIC %md # MAGIC # MAGIC # [Scalable Data Science](http://www.math.canterbury.ac.nz/~r.sainudiin/courses/ScalableDataScience/) # MAGIC # MAGIC # MAGIC ### prepared by [Paul Brouwers](https://www.linkedin.com/in/paul-brouwers-5365117a), [Raazes...
''' Create final data cubes ''' import glob import os import sys from taskinit import ia output_type = sys.argv[-1] path = "/global/scratch/ekoch/combined/single_channels/" out_path = "/global/scratch/ekoch/combined/cube_images/" if output_type == "image": out_name = os.path.join(out_path, "M33_14B-088_AT0206_...
# -*- coding: utf-8 -*- import os import click import logging import datetime import boto3 import tarfile from shutil import copyfile from hotbackup.utility import save_config, load_config, write_encrypted, read_encrypted from hotbackup.services import get_aws_client __version__ = '0.0.1' log = logging.getLogger...
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.minigame.RubberBand from panda3d.core import CollisionNode, CollisionSphere, Geom, GeomNode, GeomTristrips, GeomVertexData, GeomVertexFormat, GeomVertexWriter, Point3 from toontown.toonbase.ToonBaseGlobal import * from direct.interval.IntervalGlobal...
""" UV sensors ================ """ from rfxcom.protocol.base import BasePacketHandler from rfxcom.protocol.rfxpacketutils import RfxPacketUtils class UltraViolet(BasePacketHandler): """ ==== ==== Byte Meaning ==== ==== 0 Packet Length, 0x09 (excludes this byte) 1 Packet...
from __future__ import division # (p,q)区間をn-1等分するので小数が含まれる場合に対応させる from numpy import linspace from numpy import fabs from mpl_toolkits.axes_grid.axislines import SubplotZero import matplotlib.pyplot as plt # ここから下に変数が入る def f(x, a): return 0.3*(a-x)**2+0.3*fabs(x-10)**1.5+2 p = 0 # xの最小値 q = 20 # xの最大値 n = 16 #...
""" Provides lineage support functions """ import json from functools import wraps from typing import Any, Dict, Optional import attr import jinja2 from cattr import structure, unstructure from airflow.models.base import Operator from airflow.utils.log.logging_mixin import LoggingMixin from airflow.utils.module_loadi...
""" Client.py Defines the UDP Client class. We call "client" the entity that waits for the data sent by the server. """ #!/usr/bin/python3.5 #-*- coding: utf-8 -*- #Standard imports : import socket import time import threading #Specific imports : from ..datahandling import Message from ...constants impor...
# -*- coding: utf-8 -*- """Implement geodisWS.""" import requests from roulier.transport import Transport from roulier.exception import CarrierError import json import logging import hashlib import time log = logging.getLogger(__name__) class GeodisTransportRestWs(Transport): """Implement Geodis Rest WS communi...
#!/usr/bin/python import sys, re, pdb import logging import argparse import json import numpy as np, pandas as pd import datetime from pymongo import MongoClient userIds = {} userIdSeq = 200000 appIds = {} appIdSeq = 300000 def parse_args(): defaultConnString = "mongodb://localhost:27017/" ...
# -*- coding: utf-8 -*- import uuid import importlib import logging import time import functools from threading import local try: from celery import ( Celery, signals, ) except ImportError: raise ImportError('To use queue module, you must install celery.') try: from sqlalchemy import ...
""" Those are helper classes to build arrays containing TLVs """ def sanitycheck(array): mask = (1 << 8) - 1 for i in range(len(array)): if array[i] > ((1 << (8)-1) - 1): array[i] = -(~(array[i]-1) & mask) class Tag(list): def __init__(self, cls=0, constr=False, number=0): i...
"""Utilities for dealing with GNU tools. @see: Cake Build System (http://sourceforge.net/projects/cake-build) @copyright: Copyright (c) 2010 Lewis Baker, Stuart McMahon. @license: Licensed under the MIT license. """ def parseDependencyFile(path, targetSuffix): """Parse a .d file and return the list of dependencies....
from django.db import models from django.template.defaultfilters import slugify import tagging class Category(models.Model): title = models.CharField(max_length=100) slug = models.SlugField(unique=True) class Meta: verbose_name_plural = 'Categories' ordering = ('title',) def save(se...
""" This script contains various views of Atlassian Parse Application views ``````` 1. /create_message 2. /register run the views as http://127.0.0.1:5000/register """ # Import Statements import datetime import json # from numpy import cast import os import sys import messageDecode import ti...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Nov 23 18:29:36 2016 @author: login """ import random, os, sys random.seed(137) from cogent import LoadSeqs, DNA, LoadTree from cogent.db.ncbi import EFetch from cogent.app.muscle import align_unaligned_seqs from cogent.app.fasttree import build_tree_f...
#! /usr/local/bin/proxychains4 python3.6 """ desc : download vedios from youtube via proxy agent. author: Bodhi wang mail : <EMAIL> date : 2017.9.11 Remove proxy agent and modify the call to pytube. modified by Bodhi, 2018.3.23 Check if target file exists. If so, skip its download process. modified by Bodhi, 2018...
#!/usr/bin/python2.7 import argparse import re parser = argparse.ArgumentParser(description='Convierte de formato CodeGraphics a hex.') parser.add_argument('archivo', type=argparse.FileType('r'), help='archivo de entrada') args = parser.parse_args() values = [] for line in args.archivo.readlines(...
import os import subprocess_tee import casadi as C def getIndices(sym): (nr,nc) = sym.shape if (nr,nc) == (1,1): indices = [''] elif 1 in [nr,nc]: indices = ['__'+str(j) for j in range(nr*nc)] else: indices = [] for jc in range(nc): for jr in range(nr): ...
import unittest try: from urlparse import urlparse except ImportError: from urllib.parse import urlparse from IM.tts.tts import TTSClient from mock import patch, MagicMock class TestTTSClient(unittest.TestCase): """ Class to test the TTCLient class """ @classmethod def setUpClass(cls): ...
import Queue as Q from math import * import datetime class MazeAgent(object): ''' Agent that uses path planning algorithm to figure out path to take to reach goal Built for Malmo discrete environment and to use Malmo discrete movements ''' def __init__(self, grid=None): self.__frontier_set...
from Tkinter import * from tkMessageBox import * from tkFileDialog import * from tkFont import * import os class DialogMaker(object): """Methoden zur Erzeugung und Gestaltung von Tkinter-Dialogen""" def __init__(self): """Erzeugt Tkinter-Dialog und setzt Dialogtitel""" self.dia=Tk() def title (self, title): ...
import unittest #+---------------------------------------------------------------------------+ #| Local application imports #+---------------------------------------------------------------------------+ from test_netzob.test_Common.test_Functions import test_Encoding, test_Transformation, test_Visualization def getS...
import math def rotate_point(point, center_point, angle): """Rotate a point <- return list (new point) """ p = [point[0] - center_point[0], point[1] - center_point[1]] print p, center_point x = int(p[0] * math.cos(math.radians(-angle)) - p[1] * math.sin(math.radians(-angle))) y = int(p[0] ...
from django.test import TestCase from restclients.canvas.courses import Courses class CanvasTestCourses(TestCase): def test_course(self): with self.settings( RESTCLIENTS_CANVAS_DAO_CLASS='restclients.dao_implementation.canvas.File'): canvas = Courses() course = can...
import logging import threading import time from django.core.urlresolvers import reverse from django.utils.encoding import force_unicode from django.utils.translation import ugettext as _ from beeswax import hive_site from beeswax.conf import HIVE_SERVER_HOST, HIVE_SERVER_PORT,\ BROWSE_PARTITIONED_TABLE_LIMIT from ...
from omtdrspub.elastic.model.link import Link from omtdrspub.elastic.model.location import Location class ResourceDoc(object): def __init__(self, resync_id=None, resource_set=None, location: Location=None, length: int=None, md5: str=None, mime: str=None, lastmod: str=None, ln: [L...
import mistune import re # from nltk.tag import pos_tag # http://mistune.readthedocs.org/en/latest/ class ParsingRenderer(mistune.Renderer): def __init__(self, **kwargs): super(ParsingRenderer, self).__init__(**kwargs) self.blocks = [] self.headlines = u'' self.doubleemphasiswords ...
#!/usr/bin/python import xmlrpclib import unittest from random import randint from datetime import datetime, timedelta, date from config import * # Should have at least 100 free slots to run these tests, which *should* # return all of those back to the default satellite org once finished. CHANNEL_LABEL = "channel-a...
# 278. First Bad Version Add to List # Difficulty: Easy # # You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are ...
from pythonCah.irc.multiclient import MultiIrcClient import logging logger = logging.getLogger(__name__) class CahBot(MultiIrcClient): def __init__(self, config, dispatcher): self.config = config super(CahBot, self).__init__(self.config.serverList()) self.dispatcher = dispatcher def n...
''' Camera: Backend for acquiring camera image ''' __all__ = ('CameraBase', 'Camera') import pymt from OpenGL.GL import GL_RGB from pymt.logger import pymt_logger from pymt.core import core_select_lib from pymt.baseobject import BaseObject from pymt.graphx import set_color, drawRectangle, drawTexturedRectangle, \ ...
""" pyGunModel Toy computational experiment to Authors ------- - Stephen Andrews (SA) - Andrew M. Fraiser (AMF) Revisions --------- 0 -> Initial class creation (03-16-2016) ToDo ---- None """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __fu...
from django.shortcuts import render from django.http import HttpResponseRedirect from django.shortcuts import render_to_response from django.contrib.auth.decorators import login_required from django.views.decorators.csrf import csrf_protect from user_profile.forms import * from django.template import RequestContext fro...
#!/usr/bin/env py.test """Unit tests for BoundingBoxTree""" # Copyright (C) 2013-2014 Anders Logg # # This file is part of DOLFIN. # # DOLFIN is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either ver...
"""Implements the :py:class:`ShrunkClient` class.""" from typing import Optional, List, Set, Any from datetime import datetime import pymongo from .search import SearchClient from .geoip import GeoipClient from .orgs import OrgsClient from .tracking import TrackingClient from .roles import RolesClient from .links im...
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutIteration(Koan): def test_iterators_are_a_type(self): it = iter(range(1,6)) total = 0 for num in it: total += num self.assertEqual(15, total) def test_iterating_with_next(self): ...
from __future__ import print_function, unicode_literals import json import re import uuid from collections import OrderedDict from random import randint try: from urllib.parse import urlencode, quote_plus from http.client import HTTPSConnection PY2 = False except ImportError: from urllib import urlenc...
#!/usr/bin/env python3 from functions import * from variables import * from qtprofile import * ###################################### # Common setting for all apps and libs ###################################### def SetCommonForAll(pro): # Build type (as directory name) pro.addBuildType(DEBUG_DIR_NAME, PRO...
# coding=utf-8 import unittest """213. House Robber II https://leetcode.com/problems/house-robber-ii/description/ You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. All houses at this place are **arranged in a circle.** That means the first house is ...
import logging import urllib import string import sys import re import traceback import time import util import models import BeautifulSoup __author__ = "Scott Peterson" __version__ = "1.0" __date__ = "$Date: 2005/07/16 00:14:20 $" __copyright__ = "Copyright (c) 2005 Scott Peterson" class LoginPage...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Tests for the optimizer module. @author: Álvaro Barbero Jiménez """ from neurowriter.optimizer import chekpointappend, checkpointload, hypertrain from neurowriter.models import PerceptronModel, SmallWavenet from neurowriter.corpus import Corpus from neurowriter.encod...
"""Test resurrection of mined transactions when the blockchain is re-organized.""" from test_framework.test_framework import SyscoinTestFramework from test_framework.util import assert_equal from test_framework.wallet import MiniWallet class MempoolCoinbaseTest(SyscoinTestFramework): def set_test_params(self): ...
# -*-coding:utf-8-*- """ Question: House Robber You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security system connected and it will automatically con...
import sys sys.path.append("/usr/share/rhui-testing-tools/rhui-tests") from test_rhui_tcms90676 import * from test_rhui_tcms90678 import * from test_rhui_tcms90682 import * from test_rhui_tcms90683 import * from test_rhui_tcms90721 import * from test_rhui_tcms90723 import * from test_rhui_tcms90725 import * from test_...
# -*- coding: utf-8 -*- """ Copyright [2009-2018] EMBL-European Bioinformatics Institute 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...
from mock import patch from decimal import Decimal as D from django.core.urlresolvers import reverse from oscar.test.factories import create_product, create_order from oscar.test.testcases import ClientTestCase, WebTestCase from oscar.core.compat import get_user_model from oscar.apps.basket.models import Basket Use...
from __future__ import (absolute_import, division, print_function) # import iris tests first so that some things can be initialised before # importing anything else import iris.tests as tests import numpy as np import iris import iris.fileformats.abf @tests.skip_data class TestAbfLoad(tests.IrisTest): def setU...
"""ExampleDjango URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Cl...
from oslo_log import log as logging from tempest_lib import exceptions as lib_exc from tempest.common import fixed_network from tempest.common.utils import data_utils from tempest.common import waiters from tempest import config from tempest.scenario import manager from tempest import test CONF = config.CONF LOG = ...
from nepi.execution.ec import ExperimentController from test_utils import skipIfNotAlive, skipInteractive import os import time import tempfile import unittest class LinuxNPingTestCase(unittest.TestCase): def setUp(self): self.fedora_host = "nepi2.pl.sophia.inria.fr" self.fedora_user = "inria_nep...
from __future__ import print_function from hyperopt import Trials, STATUS_OK, tpe from hyperas import optim from hyperas.distributions import choice, uniform from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation from keras.optimizers import RMSprop from keras.datasets import mni...
#!/usr/bin/env/ python # -*- coding: utf-8 -*- """The toy model as defined by Garcia & De Monte 2012.""" import numpy import random import math import pimad.model as model #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Toy model #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
#!/usr/bin/python2 # -*- coding: utf-8 -*- import json import plyvel as leveldb import os import sys import time db = leveldb.DB("_db", create_if_missing=True) wb = db.write_batch() with open("delete.log") as f: wb = db.write_batch(transaction=True) for line in f: line = line.rstrip('\n') val...
import collections import mock from django.http import HttpResponse from django.test import TestCase from django.urls import reverse from base.models.enums.academic_calendar_type import AcademicCalendarTypes from base.tests.factories.academic_calendar import OpenAcademicCalendarFactory from base.tests.factories.acade...
# -*- coding: utf-8 -*- import sqlite3 import hashlib import config def createNewUser(message): tg_id = message.from_user.id password = message.text[10:] role = "user" db = sqlite3.connect(config.db_path) cursor = db.cursor() password = hashlib.sha256(bytes(password, encoding="UTF-8")).hexdig...
import numpy as np from sequences.log_domain import * import ipdb, pdb START = '_START_' END = '_END_' START_TAG = '<START>' END_TAG = '<STOP>' BR = "**" NO_LABELS = [ START, END, START_TAG, END_TAG, BR, ] class SequenceClassificationDecoder(): ''' Implements a sequence classification decoder...
#!/usr/bin/python from OpenSSL import crypto from os.path import exists, join CERT_FILE = "ssl_DSePHR.crt" KEY_FILE = "ssl_DSePHR.key" def create_self_signed_cert(cert_dir): """ If datacard.crt and datacard.key don't exist in cert_dir, create a new self-signed cert and keypair and write them...
__author__ = "elegans.io Ltd" __email__ = "<EMAIL>" import abc from functools import wraps def observable(function): """ observable decorator :param function: :return: """ @wraps(function) def newf(*args, **kwargs): return_value = function(*args, **kwargs) called_class = a...
from __future__ import division import numpy as np import types from optwrapper import nlp class Problem: """ Optimal Control Problem """ def __init__( self, Nstates, Ninputs, Ncons ): """ Arguments: Nstates: number of states Ninputs: number of inputs Ncons: ...
"""Models that represents predefined schools.""" from google.appengine.ext import ndb class School(ndb.Model): """Model that represent a single school.""" #: identifier of the school uid = ndb.StringProperty() #: Full name of the school. name = ndb.StringProperty() #: Country in which the school is lo...
# coding: utf-8 # as per http://www.python.org/dev/peps/pep-0263/ import smtplib from email.MIMEMultipart import MIMEMultipart from email.MIMEBase import MIMEBase from email.MIMEText import MIMEText from email import Encoders import os def send(gmail_user, gmail_pwd, to, subject, text, attach=None): msg = MIMEM...
from util.ncconv.experimental.wrappers import multipolygon_operation import datetime import os from osgeo import ogr import warnings from util.ncconv.experimental.ocg_converter import ShpConverter, KmlConverter,\ CsvConverter, LinkedCsvConverter, LinkedShpConverter import cProfile import pstats import sys from sqla...
#!/usr/bin/env python from __future__ import absolute_import from __future__ import print_function import redhawk.utils.key_value_store as KV import redhawk.scripts.script_util as S import redhawk import nose.tools import glob import os import shelve import sys import tempfile PREFIX = "redhawk-key-value-store-test"...
import logging from piHAlibs import (my_fctname,coroutine) from .parsers import CM15Parsers logger = logging.getLogger() def item2msgs(item): if not item[1].startswith('0x') : return None namedev = item[0] if 'CM15' not in namedev : return None sdata = item[1].split() hd = sdata[0] if hd not ...
import datetime import json import os import re import sqlite3 as lite import subprocess import sys class MoveLine: def __init__(self, initial_hash, move_hashes): self.initial_hash = initial_hash self.move_hashes = move_hashes def build_line(line): cmd = ['../src/tulip', '-bookline', 'rnbqkb...
import gevent import logging from ryu.app import (conf_switch_key, rest_nw_id) from ryu.base import app_manager from ryu.controller import (conf_switch, dpset, handler, network, tunnels)...
import pytest import os import shutil import sys import importlib from markupupdowndown import plugins import env def test_load_plugin_modules(): curdir = os.getcwd() os.chdir(env.TMP_DIR) sys.path.append(env.TMP_DIR) # a config with no 'plugins' key should raise exception config = {} with ...
__revision__ = "test/TEX/biber_biblatex2.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog" """ Test creation of a Tex document that uses the biblatex package It uses the default backend, could be bibtex or biber. Require both be installed Test courtesy Rob Managan. """ import TestSCons import os test = ...
"""Unittests for the ModemManager IContactProvider""" import time import dbus import dbus.mainloop.glib from twisted.trial import unittest from twisted.internet import defer from twisted.python import log from wader.plugins.mm_provider import mm_provider, MMContact from wader.common.consts import (WADER_SERVICE, WAD...
import configparser import logging import sys from irc.client import SimpleIRCClient class IrcClient(SimpleIRCClient): def __init__(self, nick, config): self.nick = nick self.config = config self.loading = False SimpleIRCClient.__init__(self) def on_welcome(self, c, _): ...
import configparser import os import logging import re class Config: """ This class is used to store attributes which are needed again whenever the editor is run in a file Usage: from config import Config config = Config.create("config-test") # No spaces in attribute names! config.cr...
import contextlib from datetime import datetime import gzip import json import re import urllib import cloudstorage as gcs from waterfall.build_info import BuildInfo _MASTER_URL_PATTERN = re.compile(r'^https?://build\.chromium\.org/p/([^/]+)' '(/.*)?$') _BUILD_URL_PATTERN = re.compi...
"""Basic database interfacing mechanisms for Storm. This is the common code for database support; specific databases are supported in modules in L{storm.databases}. """ from storm.expr import Expr, State, compile from storm.tracer import trace from storm.variables import Variable from storm.exceptions import ( Cl...
import numpy as np import pytest from pdepy import parabolic class TestParabolic: @pytest.fixture def inputs(self): xn, xf, yn, yf = 4, 4.0, 5, 0.5 x = np.linspace(0, xf, xn + 1) y = np.linspace(0, yf, yn + 1) init = x ** 2 - 4 * x + 5 bound = 5 * np.exp(-y) ...
#! /usr/local/bin/python import requests import json import sys import os import html2text from itertools import chain from bs4 import BeautifulSoup as bs from datetime import datetime as dt from datetime import timedelta from colors import blue, yellow, red, green from collections import defaultdict event = os.path...
#!/usr/bin/env python import os import sys import math import time import importlib import sysconfig import subprocess import collections if sys.version_info <= (3, 0): print('Much of this script needs py3') sys.exit() # good #import numpy as np #import psi4 # bad import psi4 import numpy as np def test_t...
import raxcloudrest import sys import argparse import time import prettytable def main(): parser = argparse.ArgumentParser() parser.add_argument('base', help='The base hostname to use, 3x512MB' ' servers will be built using this base hostname') parser.add_argument('--dc', required=...
#coding=UTF-8 from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext from pyspark.sql.types import * from datetime import date, datetime, timedelta import sys, re, os st = datetime.now() conf = SparkConf().setAppName('PROC_O_LNA_XDXT_ACCOUNT_INFO').setMaster(sys.argv[2]) sc = SparkContext(conf = con...
from reportlab.pdfgen import canvas from reportlab.pdfbase.pdfmetrics import stringWidth from combine_and_shorten_definition import combine_and_shorten_definition # centers the text to ymid def draw_vertical_text(canvas, font_name, font_size, xto, ymid, text): tw = stringWidth(text, font_name, font_size); canv...
import os import socket if hasattr(socket, "AF_UNIX"): from ._unix import FakeSnapd # noqa: F401 try: from ._unittests import ( # noqa: F401 FakeElf, FakeExtension, FakeMetadataExtractor, FakePlugin, FakeProjectOptions, FakeSnapCommand, FakeSnapcraftctl...
#!/usr/bin/env python """ ___ _ _ / __| |_ ___ __| |__ | (__| ' \/ -_) _| / / \___|_||_\___\__|_\_\. Script que verifica si su algoritmo es correcto """ import os import argparse import numpy as np from spark_image_compressor import run def main(args): QF = 99 bSz = 64 threads = ...
#!/usr/bin/env python3 import sqlalchemy as sa from .GrabberBase import * class GrabberNamespaces(GrabberBase): def __init__(self, api, db): super().__init__(api, db) ins_ns = sa.dialects.postgresql.insert(db.namespace) ins_nsn = sa.dialects.postgresql.insert(db.namespace_name) ...
#!/usr/bin/python # TODO: issues with new oauth2 stuff. Keep using older version of Python for now. # #!/usr/bin/env python from participantCollection import ParticipantCollection import re import datetime import pyperclip # Edit Me! # This script gets run on the first day of the following month, and that month's UR...
import matplotlib.pyplot as plt from collections import Counter import sqlite3 from context import settings def graph2(): totals = [i*10 for i in range(26)] x = [i for i in range(26)] keys = ['keyword', 'parse', 'redirect', 'stem'] table = [] for key in keys: row = [] for total...
#!/usr/bin/env python3 from math import sqrt import matplotlib.pyplot as plt import numpy as np from scipy.optimize import root_scalar from pysisyphus.optimizers.hessian_updates import bfgs_update from pysisyphus.helpers import geom_from_library, shake_coords, geom_from_xyz_file from pysisyphus.calculators.XTB impor...
from __future__ import absolute_import import sys import traceback import getpass as getpass_ from testmill.state import env def prompt(prompt): """Prompt the user for a line of input.""" env._partial_line = True line = raw_input(prompt) env._partial_line = False return line def confirm(message...
# -*- coding: utf-8 -*- """ Created on Mon Oct 31 15:45:22 2016 @author: wang """ import numpy as np from math import sqrt origin=np.load('il_192_matrix.npz') #print 'r_matrix_1=',origin["arr_0"] # this is the first matrix #print 'r_matrix_2=',r["arr_1"] # this is the second matrix #print r["arr_0"] [23][7] test=np....
from __future__ import absolute_import # Copyright (c) 2010-2016 openpyxl """Write worksheets to xml representations.""" # Python stdlib imports from io import BytesIO from openpyxl import LXML # package imports from openpyxl.xml.functions import ( Element, xmlfile, ) from openpyxl.xml.constants import SHEE...
import _plotly_utils.basevalidators class FontValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__( self, plotly_name="font", parent_name="scatter3d.line.colorbar.title", **kwargs ): super(FontValidator, self).__init__( plotly_name=plotly_name, parent...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ An image that stores the data as an (x, y, z, ...) array, with an affine mapping to the world space """ import copy import numpy as np from scipy import ndimage # Local imports from ..transforms.affin...
from SloppyCell.ReactionNetworks import * import Nets traj2a = Dynamics.integrate(Nets.fig2a, [0, 3*60]) traj2b = Dynamics.integrate(Nets.fig2b, [0, 3*60]) traj2c = Dynamics.integrate(Nets.fig2c, [0, 3*60]) traj2d = Dynamics.integrate(Nets.fig2d, [0, 3*60]) traj2e = Dynamics.integrate(Nets.fig2e, [0, 3*60]) Plotting...
"""Define the ``Feed`` class for handling a list of feeds """ import codecs as _codecs import collections as _collections import os as _os import json as _json import pickle as _pickle import sys as _sys from . import LOG as _LOG from . import config as _config from . import error as _error from . import feed as _fee...
import putil.misc, putil.pcsv def main(): ctx = putil.misc.TmpFile with ctx() as fname1: with ctx() as fname2: with ctx() as ofname: # Create first (input) data file input_data = [ ['Item', 'Cost'], [1, 9.99], ...
import numpy as np import uncertainties.unumpy as unp from uncertainties import ufloat from uncertainties.unumpy import nominal_values as noms from uncertainties.unumpy import std_devs as stds from uncertainties import correlated_values import math from scipy.optimize import curve_fit import matplotlib.pyplot as plt fr...
import procrunner import pytest from dxtbx.serialize import load import iotbx.mtz import xia2.Test.regression def split_xinfo(data_dir, tmpdir): split_xinfo_template = """/ BEGIN PROJECT AUTOMATIC BEGIN CRYSTAL DEFAULT BEGIN WAVELENGTH NATIVE WAVELENGTH 0.979500 END WAVELENGTH NATIVE BEGIN SWEEP SWEEP1 WAVELENG...
import os, sys, zipfile dbfarm = os.environ['GDK_DBFARM'] db = os.path.join(dbfarm, os.environ['TSTDB']) archive = os.path.join(dbfarm, 'prevhgechainrel.zip') rev = os.getenv('REVISION') if not os.path.exists(db): print >> sys.stderr, 'database directory %s does not exist' % db sys.exit(1) try: f = open(...