content
string
#!/usr/bin/env python # -*- mode:python; sh-basic-offset:4; indent-tabs-mode:nil; coding:utf-8 -*- # vim:set tabstop=4 softtabstop=4 expandtab shiftwidth=4 fileencoding=utf-8: # import shotfirst import fnmatch import hashlib import importlib import json import logging import mimetypes import multiprocessing import os...
""" Plots stellar mass error and stellar mass vs. mass and redshift """ import sys import os import numpy as n import astropy.io.fits as fits import matplotlib matplotlib.rcParams['agg.path.chunksize'] = 2000000 matplotlib.rcParams.update({'font.size': 13}) #matplotlib.use('Agg') import matplotlib.pyplot as p from cyc...
# coding: utf-8 from __future__ import unicode_literals from django.test import SimpleTestCase from django.utils.translation import ugettext_lazy as _, override from localflavor.dk.forms import ( DKPhoneNumberField, DKPostalCodeField, DKMunicipalitySelect ) class DKLocalFlavorTests(SimpleTestCase): ...
#!/usr/bin/env python from setuptools import setup, find_packages version = '0.2.2dev' REQUIREMENTS = [ 'SQLAlchemy>=0.7.8', ] setup(name = 'ordenley', version = version, long_description = open('README.rst').read(), author = 'Oscar Ramirez', author_email = '<EMAIL>', de...
# -*- coding: utf-8 -*- import re; from xml.dom import minidom from feedreader import *; findPicLink = re.compile("src=\".*?\""); class AtomFeed (Feed): def updateFeed(self): self.gui.log("Load: "+self.feedUrl); xmlPage = self.loadPage(self.feedUrl); if(xmlPage is None): return; xmlDocument...
from django.utils.translation import ugettext as _ from mezzanine.conf import register_setting register_setting( name="WIKI_DEFAULT_INDEX", label=_("Wiki default index page"), description=_("Wiki default index page"), editable=True, default="Main_page", ) register_setting( name="WIKI_USE_FEA...
from sympy.core import S, Add, sympify, Basic, PoleError, Mul, oo, C from gruntz import gruntz def limit(e, z, z0, dir="+"): """ Compute the limit of e(z) at the point z0. z0 can be any expression, including oo and -oo. For dir="+" (default) it calculates the limit from the right (z->z0+) and for...
import requests import io import zipfile from contextlib import closing from rdflib import Graph from bs4 import BeautifulSoup, SoupStrainer import pprint from wikidataintegrator import wdi_core, wdi_login, wdi_property_store from SPARQLWrapper import SPARQLWrapper, JSON from time import gmtime, strftime import copy im...
import os import subprocess import textwrap import yaml as yaml_utils from testtools.matchers import Contains, Equals from tests import integration class SnapcraftctlSetVersionTestCase(integration.TestCase): def test_set_version(self): self.construct_yaml( version=None, adopt_inf...
from flask import Blueprint from flask import request from flask import jsonify from database import db_session from models import Release from models import Team from models import User import simplejson as json rest_api = Blueprint('rest_api', __name__) def date_handler(obj): return obj.isoformat() if hasatt...
# This code is so you can run the samples without installing the package import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) # testinfo = "dt 0.1, q" tags = "debugging" import summa from summa.director import director from summa.sprite import Sprite from summa.actions import * impor...
import uuid from website.util import api_v2_url from django.db import models from osf.models import base from website.security import random_string from framework.auth import cas from website import settings from urlparse import urljoin def generate_client_secret(): return random_string(length=40) class Api...
from flask import jsonify, request, g, url_for, current_app from .. import db from ..models import Post, Permission from . import api from .decorators import permission_required from .errors import forbidden @api.route('/posts/') def get_posts(): page = request.args.get('page', 1, type=int) pagination = Post....
""" Parser for to pofile translation format. """ from datetime import datetime from django.utils import timezone import polib from pontoon.sync import KEY_SEPARATOR from pontoon.sync.exceptions import ParseError from pontoon.sync.formats.base import ParsedResource from pontoon.sync.vcs.models import VCSTranslation ...
"""The Simple class implements a simple debugger used for testing pyclewn and for giving an example of a simple debugger. The debuggee is running in another thread as a Target instance. To display the frame sign, add a breakpoint first and then run the step command, or run the continue command and send an interrupt. ...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTATION = r''' --- module: aci_l3out_route_tag_policy short_description: Manage route t...
import random #f = open('big_overall_flows_training_data.arff','w') g = open('clean_all_convos','r') training, clean, waledac, storm, zeus = [], [], [], [], [] for line in g: line = line.split(',') line.pop() line.append('CLEAN\n') line = ",".join(line) clean.append(line) g.close() g = open('waledac/waledac.pcap.c...
""" Copyright (C) 2015 Quinn D Granfor <<EMAIL>> This program 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 Foundation. This program is distributed in the hope that it will be useful, but WI...
#!/usr/bin/env python import unittest from fastparser import* from bike.parsing.load import* from bike.parsing.fastparserast import* from bike.testutils import * class TestFastParser(BRMTestCase): def test_doesntGetClassDeclsInMLStrings(self): src = trimLines(''' """ class foo bah "...
"""Adversarial training to learn trivial encryption functions, from the paper "Learning to Protect Communications with Adversarial Neural Cryptography", Abadi & Andersen, 2016. https://arxiv.org/abs/1610.06918 This program creates and trains three neural networks, termed Alice, Bob, and Eve. Alice takes inputs in_m ...
# Code from Chapter 6 of Machine Learning: An Algorithmic Perspective (2nd Edition) # by Stephen Marsland (http://stephenmonika.net) # You are free to use, change, or redistribute the code in any way you wish for # non-commercial purposes, but please maintain the name of the original author. # This code comes with no ...
#!/usr/bin/python # -*-coding:UTF-8 -*- import sys _ver = sys.version_info is_py2 = (_ver[0] == 2) is_py3 = (_ver[0] == 3) if is_py2: from urllib import urlopen, urlencode elif is_py3: from urllib.request import urlopen, Request from urllib.parse import urlencode from datetime import datetime, timedelta ...
import torch import torch.nn as nn import torch.nn.functional as F class BilinearSeqAttn(nn.Module): def __init__(self, x_size, y_size, normalize=True): super(BilinearSeqAttn, self).__init__() self.normalize = normalize self.linear = nn.Linear(y_size, x_size) def forward(self, x, y, x...
import html5lib from .pages import IndexPage def test_robots_txt(webtest): resp = webtest.get("/robots.txt") assert resp.status_code == 200 assert resp.content_type == "text/plain" assert resp.body.decode(resp.charset) == ( "Sitemap: http://localhost/sitemap.xml\n\n" "User-agent: *\n"...
#!usr/bin/env python #encoding: utf-8 __author__="luzhijun" ''' cma restart test ''' import math import cma import numpy as np import pickle from multiprocessing import Pool from scipy import ndimage import matplotlib.pyplot as plt l=2 D=21 result_list = [] def log_result(result): result_list.append(result) def X...
import re from fedmsg_meta_fedora_infrastructure import BaseProcessor from fedmsg_meta_fedora_infrastructure.fasshim import avatar_url from fedmsg_meta_fedora_infrastructure.conglomerators.bodhi import \ requests as bodhi_requests from fedmsg_meta_fedora_infrastructure.conglomerators.bodhi import \ co...
"""The Session class allows for a unified (and simplified) view of interfacing with a PostgreSQL database server. Connection details are passed in as a PostgreSQL URI and connections are pooled by default, allowing for reuse of connections across modules in the Python runtime without having to pass around the object h...
from django.contrib import admin from ESSArch_Core.agents.models import ( AgentIdentifierType, AgentNameType, AgentNoteType, AgentPlaceType, AgentRelationType, AgentTagLinkRelationType, AgentType, AuthorityType, MainAgentType, RefCode, ) class AgentNoteTypeAdmin(admin.ModelAdm...
import pygame, sys from Balloon import Balloon from Button import Button from Kitten import Kitten from random import random class Engine(): def __init__(self, screen, settings, scoreboard, balloons, kittens, sword): self.screen = screen self.settings = settings self.scoreboard = scoreboar...
from __future__ import print_function import os import sys import argparse import json import xml.etree.ElementTree _SCRIPT_DIR = os.path.realpath(os.path.dirname(__file__)) _CHROME_SOURCE = os.path.realpath( os.path.join(_SCRIPT_DIR, *[os.path.pardir] * 6)) sys.path.append(os.path.join(_CHROME_SOURCE, 'build/an...
#!/usr/bin/env python # -*- coding: UTF-8 -*- #----------------------------------------------------------------------------- """pyietfrfc unit test suite.""" __author__ = ('Lance Finn Helsten',) __version__ = '1.0' __copyright__ = """Copyright 2011 Lance Finn Helsten (<EMAIL>)""" __license__ = """ Licensed under the Ap...
import unittest from intern.resource.dvid.resource import DataInstanceResource class TestDataInstanceResource(unittest.TestCase): def setUp(self): UUID = "822524777d3048b8bd520043f90c1d28" ALIAS = "grayscale" self.name = "some_data_instance" self.uuid = UUID self.a...
import os from aging import Aging from global_values import START_NUM_AGENT, NUMBER_OF_RUNS, OUTPUT_DIR from cyclic_data import CyclicData if __name__ == "__main__": print '------------------',OUTPUT_DIR if not os.path.exists(OUTPUT_DIR): os.makedirs(OUTPUT_DIR) # stop the execution of the p...
#!/usr/bin/python from distutils.core import setup import subprocess, glob, os.path from DistUtilsExtra.command import * #mo_files = [] ## HACK: make sure that the mo files are generated and up-to-date #subprocess.call(["make", "-C", "po", "build-mo"]) #for filepath in glob.glob("po/mo/*/LC_MESSAGES/*.mo"): # la...
import subprocess import io import json import os import tempfile """ IBM Streams utilities using `streamtool`. Requires a local IBM Streams installation located by the environment varible `STREAMS_INSTALL`. """ if 'STREAMS_INSTALL' in os.environ: _install = os.environ['STREAMS_INSTALL'] _has_local_install = ...
import subprocess import argparse import re import paramiko import time parser = argparse.ArgumentParser(description='move pool to online') parser.add_argument('--pool', help='pool to move') args = parser.parse_args() # print(args.accumulate(args.integers)) def move_pool_to_online(pool): if pool == 'default': pr...
#!/usr/bin/env python # -*- coding: utf-8 -*- import time from utils import filecache from utils import _http_call, _HTTP_GET, _HTTP_POST, _HTTP_FILE from utils import _Callable try: import memcache except Exception, e: print '\033[95mWrining: %s. use local filecache.\033[0m' %e import sqlobject from Connec...
#!/usr/bin/env python # plotPSD ver 0.0 - a command line utility to plot a wildcarded argument # list of files containing time series data, and plot the # Power Spectral Density (PSD) of them. # This version averages the data from multiple files. import sys, os import numpy as np import matplotlib.pyplot as plt impor...
""" This example outputs a custom waveform and records the waveform on Channel A. The output of the AWG must be connected to Channel A. """ import os import numpy as np # if matplotlib is available then plot the results try: import matplotlib.pyplot as plt except ImportError: plt = None from msl.equipment i...
""" Utilities for text-to-HTML conversion. """ def textile(text, **kwargs): """ Applies Textile conversion to a string, and returns the HTML. This is simply a pass-through to the ``textile`` template filter included in ``django.contrib.markup``, which works around issues PyTextile has with U...
import copy from itertools import chain from lib.CurrencyManager import cm from lib.ItemHelper import get_price, Item from lib.Utility import round_up import multiprocessing import os import sys try: # Python 3.4+ if sys.platform.startswith('win'): import multiprocessing.popen_spawn_win32 as forking ...
""" Created on Tue Nov 04 16:04:17 2014 @author: Vidar Tonaas Fauske """ import sys try: from qtconsole.rich_jupyter_widget import RichJupyterWidget from qtconsole.inprocess import QtInProcessKernelManager except ImportError: from IPython.qt.console.rich_ipython_widget import RichIPythonWidget as \ ...
#!/usr/bin/env python ''' acron.py -- a cron replacement tool This is designed to be a replacement for the system cron. You can run acron and it will behave almost exactly like you expect the system cron to work, except there are some more advanced behaviors that can be expressed. Rationale: many...
import datetime from cStringIO import StringIO from nose.tools import eq_, ok_ from crashstats.crashstats import utils from unittest import TestCase from ordereddict import OrderedDict import json class TestUtils(TestCase): def test_unixtime(self): format = '%Y-%m-%d' value = datetime.datetime.st...
import numpy as np import pytest import pandas as pd from pandas import DataFrame, Series, concat from pandas.util import testing as tm def test_rank_apply(): lev1 = tm.rands_array(10, 100) lev2 = tm.rands_array(10, 130) lab1 = np.random.randint(0, 100, size=500) lab2 = np.random.randint(0, 130, size...
import sys sys.path.append('./trainer') import argparse import nutszebra_cifar10 import fractal_net import nutszebra_data_augmentation import nutszebra_optimizer if __name__ == '__main__': parser = argparse.ArgumentParser(description='cifar10') parser.add_argument('--load_model', '-m', ...
#!src/env/bin/python """Initialize and launch the OnRamp Server REST server.""" import logging import os import signal import socket import sys #from wsgi import application import cherrypy from cherrypy.process.plugins import Daemonizer, PIDFile from configobj import ConfigObj from validate import Validator from w...
from typing import TYPE_CHECKING import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpR...
from neutron.common import constants from neutron.extensions import portbindings from neutron.openstack.common import jsonutils from neutron.plugins.ml2 import db from neutron.plugins.ml2 import driver_api as api class MechanismDriverContext(object): """MechanismDriver context base class.""" def __init__(self...
import struct import sys import os from s3d import S3DArchive from wld import WLDData def stringhex(s): return " ".join(["%08x" % struct.unpack("I",s[i*4:i*4+4]) for i in range(0, len(s)//4)]) if len(sys.argv) < 2: print("usage: %s <.S3D file> [WLD name]" % sys.argv[0]) s3dPath = sys.argv[1] if len(sys.argv) ...
import h5py import sys import numpy as np """ sl files use an lz4 compression filter for which a plugin needs to be installed Mac: sudo port install hdf5-lz4-plugin Ubuntu: (http://gisaxs.com/index.php/HDF5) sudo add-apt-repository ppa:eugenwintersberger/pni sudo apt-get update sudo apt-get install hdf5-plugin-lz4 ...
from canvas_sdk import client, utils def list_observees(request_ctx, user_id, per_page=None, **request_kwargs): """ List the users that the given user is observing. *Note:* all users are allowed to list their own observees. Administrators can list other users' observees. :param request_ct...
import pints import pints.toy import unittest import numpy as np import scipy.stats class TestHighDimensionalGaussianLogPDF(unittest.TestCase): """ Tests the high-dimensional Gaussian log-pdf toy problem. """ def test_high_dimensional_log_pdf(self): # Test basic usage f = pints.toy.Hi...
"""Tests for tensorflow.ops.random_ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from six.moves import xrange # pylint: disable=redefined-builtin from tensorflow.python.eager import context from tensorflow.python.framework imp...
"""celeryconfig wrapper. .. moduleauthor:: Xiaodong Wang <<EMAIL>> """ import logging import os.path from compass.utils import setting_wrapper as setting CELERY_RESULT_BACKEND = 'amqp://' BROKER_URL = 'amqp://guest:guest@localhost:5672//' CELERY_IMPORTS = ('compass.tasks.tasks',) if setting.CELERYCONFIG_FILE...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'about.ui' # # by: PyQt4 UI code generator 4.8.6 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: _fromUtf8 = lambda s: s ...
from __future__ import absolute_import import os import sys import json # insert the root dir into the system path sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) from transformer import registry from transformer.util import APIError from flask import Flask, jsonify, request # Create our Flask App a...
from django.db import models from datetime import datetime, timedelta from songs.models import Song import pytz import requests thedate = pytz.utc # Create your models here. class Playlist(models.Model): playlistid = models.IntegerField(primary_key=True) name = models.CharField(default='The name of the pl...
"""Train a simple model for the Iris dataset; Export the model and weights.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import keras import numpy as np import tensorflowjs as tfjs import iris_data def train(epochs, artif...
from Lima import module_helper mod_path = __path__ depends_on = 'Core' has_dependent = False cleanup_data = module_helper.load_prepare(mod_path, depends_on, has_dependent) from Lima import Core cleanup_data = module_helper.load_dep_cleanup(cleanup_data) from Lima.Mythen.limamythen import Mythen as _P globals().upd...
""" Imports file :file:`sihtnumbrid.csv` which you can obtain from `Estonian Post office <http://www.post.ee/ariklient_sihtnumbrid_allalaadimiseks>`_. A copy of file :file:`sihtnumbrid.csv` was accidentally published here between June 2010 and May 2012, until we realized that this wasn't allowed due to copyright res...
# -*- coding: utf-8 -*- from __future__ import (absolute_import, unicode_literals, division) """ ===================== Metabolic Null Models ===================== :Authors: Moritz Emanuel Beber :Date: 2011-07-01 :Copyright: Copyright(c) 2011 Jacobs University of Bremen. All rights reserved. :File: ...
from asynctest import TestCase, patch, ignore_loop, exhaust_callbacks, Mock import json from jsonschema import ValidationError import os from nose.tools import eq_, assert_true, assert_not_equal, assert_raises import tempfile from nyuki import Nyuki from nyuki.api.config import ApiConfiguration from nyuki.config impor...
from senf import fsnative from tests.plugin import PluginTestCase from quodlibet.formats import AudioFile class TCovers(PluginTestCase): def test_cover_path(self): song = AudioFile({"musicbrainz_albumid": u"foobar"}) song2 = AudioFile() # missing Soup if "lastfm-cover" in self.p...
# !/user/bin/python # -*- coding: utf-8 -*- # You are required to write a program to sort the (name, age, height) # tuples by ascending order where name is string, age and height are numbers. # The tuples are input by console. The sort criteria is: # 1: Sort based on name; # 2: Then sort based on age; # 3: Then sort ...
#!/usr/bin/env python import sys # Simple python version test major,minor = sys.version_info[:2] py_version = sys.version.split()[0] if major != 2 or minor < 7: # SystemExit defaults to returning 1 when printing a string to stderr raise SystemExit("You are using python %s, but version 2.7 or greater is required" ...
import os from setuptools import setup, find_packages local_file = lambda f: open(os.path.join(os.path.dirname(__file__), f)).read() if __name__ == '__main__': setup( name='%(PACKAGE_NAME)s', version='0.0.1', description='PrettyDict', long_description=local_file('README.md'), ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tempfile import numpy as np import tensorflow as tf from tensorflow import flags from tensorflow.examples.tutorials.mnist import input_data from tensorflow.lite.experimental.examples.lstm.rnn import bid...
""" Simple roster implementation. Can be used though for different tasks like mass-renaming of contacts. """ from .plugin import PlugIn from .protocol import * class Roster(PlugIn): """ Defines a plenty of methods that will allow you to manage roster. Also automatically track presences from remote JIDs ...
"""astng manager: avoid multiple astng build of a same module when possible by providing a class responsible to get astng representation from various source and using a cache of built modules) """ __docformat__ = "restructuredtext en" import os from os.path import dirname, join, isdir, exists from logilab.common.mod...
from rest_framework import serializers import geodata from api.generics.serializers import DynamicFieldsModelSerializer from api.region.serializers import RegionSerializer from api.fields import JSONField from api.activity.aggregation import AggregationsSerializer class CountrySerializer(DynamicFieldsModelSerializer)...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import six _NUMERIC_TYPES = six.integer_types + (float,) def operator_same_class(method): """ Intended to wrap operator methods, this decorator ensures the `other` parameter is of the same type as the `self` parameter. :param metho...
#python3 ''' A Blackjack simulation 5 rounds, one player, 100 beginning points aces are worth 1, face cards worth 10 if a player busts, 21 is subtracted from their total score ''' from random import shuffle from collections import OrderedDict __author__ = 'thepotatocoder' #Deck dictionary pydeck = Or...
#!/usr/bin/env python """Show the contents of a FIFF file. Examples -------- .. code-block:: console $ mne show_fiff test_raw.fif To see only tag 102: .. code-block:: console $ mne show_fiff test_raw.fif --tag=102 """ # Authors : Eric Larson, PhD import codecs import sys import mne def run(): """...
''' cdrMethods processes the CDR formula functions in the context of an XBRL DTS and instance. For description of CDR formula see: http://http://www.ffiec.gov/find/taxonomy/call_report_taxonomy.html (c) Copyright 2014 Mark V Systems Limited, California US, All rights reserved. Mark V copyright applies to this softw...
#!/usr/bin/env python3 import argparse import os import codecs import datetime import matplotlib import matplotlib.pyplot as plt from matplotlib.dates import date2num, num2date cpu = {'time': [], 'cpu': []} def parse_raw(file_path): initialized = False with codecs.open(file_path, 'r', 'iso-8859-1') as temp_f...
""" Settings for minimum reputation required for a variety of actions on the askbot askbot """ from askbot.conf.settings_wrapper import settings from askbot.conf.super_groups import REP_AND_BADGES from askbot.deps import livesettings from django.utils.translation import ugettext as _ MIN_REP = livesettings.Configurat...
from gettext import gettext as _ import logging import time import uuid #+---------------------------------------------------------------------------+ #| Related third party imports #+---------------------------------------------------------------------------+ from gi.repository import Gtk, Gdk import gi from netzob.C...
import sys import output import pipeline class SourceLine: def __init__(self, row_number, line): self.row_number = row_number self.line = line class SourceFile: def __init__(self, file_name, raw_lines, raw_flags): self.file_name = file_name self.lines = [] for row_nu...
import logging import join_data import config import load_data import pandas as pd import numpy as np import region_utils def export_data(config_dict=None, export_path=None): aggregated_config_dict = config.filter_by_aggregate_data(config_dict, aggregate_data=True) non_aggregated_config_dict = config.filter_b...
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # create a rendering window and renderer ren1 = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer(ren1) renWin.StereoCapableWindowOn() iren = vtk.vtkRende...
import numpy as np import matplotlib.pyplot as plt import scipy.misc import scipy.signal import subprocess import sys sys.path.append("../") sys.path.append("../S3DGLPy") from VideoTools import * from PCAGL import * def getTimeDerivative(I, Win): dw = np.floor(Win/2) t = np.arange(-dw, dw+1) sigma = 0.4*d...
#!/usr/bin/env python ################################################## # Gnuradio Python Flow Graph # Title: Top Block # Generated: Thu Apr 3 22:02:03 2014 ################################################## from gnuradio import blocks from gnuradio import eng_notation from gnuradio import gr from gnuradio.eng_optio...
# pylint: disable=missing-docstring # pylint: disable=redefined-outer-name # Disable the "wildcard import" warning so we can bring in all methods from # course helpers and ui helpers # pylint: disable=wildcard-import # Disable the "Unused import %s from wildcard import" warning # pylint: disable=unused-wildcard-impor...
from openerp import api, fields, models from .. import exceptions class EventEvent(models.Model): _inherit = "event.event" forbid_duplicates = fields.Boolean( help="Check this to disallow duplicate partners in this event's " "registrations", ) @api.multi @api.constrains("for...
# # notify.py # Common code for being notified of an alert system change # import os, threading, time, calendar, textwrap import m3u, speak # The digits for each letter on a touch tone pad DTMF_map = { 'a': 2, 'b': 2, 'c': 2, 'd': 3, 'e': 3, 'f': 3, 'g': 4, 'h': 4, 'i': 4, 'j': 5, 'k': 5, 'l': 5, '...
from touchdown.core import errors from touchdown.core.goals import Goal, register class Get(Goal): """ Get a configuration variable """ name = "get" mutator = False def get_plan_class(self, resource): plan_class = resource.meta.get_plan("get") if not plan_class: plan_cla...
# -*- coding: utf-8 -*- """ Preferences dialog and configuration settings """ # Copyright (C) 2020 - Peter Bittner and contributors # # 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 versi...
import datetime import json import time import traceback from django.core import exceptions from django.core.management.base import BaseCommand, CommandError from django.utils import timezone from jetere import jenkins from reports import models from . import configure # TODO: should be configurable in DB (maybe per...
from django.contrib.auth.decorators import login_required from django.contrib import messages from django.core.paginator import Paginator from django.db import transaction from django.db.models import Count, Q from django.http import HttpRequest, HttpResponse from django.shortcuts import render, get_object_or_404, redi...
from ....common.db.sql import VARCHAR, Numeric as NUMBER, DateTime as DATETIME, Column, BaseModel, CLOB, DATE VARCHAR2 = VARCHAR class UnlistedInsuranceCashFlow(BaseModel): """ 4.67 非上市保险现金流量表 Attributes ---------- object_id: VARCHAR2(100) 对象ID s_info_compcode: VARCHAR2(40) ...
# coding: utf-8 # This file is a part of VK4XMPP transport # © simpleApps, 2014 — 2015. from __main__ import * from __main__ import _ import forms @utils.threaded def initializeUser(user, cl, iq, kwargs): result = iq.buildReply("result") connect = False resource = iq.getFrom().getResource() source = user.source ...
# ############################################################ # IMPORT TOOLS # ############################################################ from tquakes import * from matplotlib import use use('Agg') import matplotlib.pyplot as plt from matplotlib.colors import LogNorm from mpl_toolkits.basemap import Basemap ...
import optparse from evaluate_calibration_box import plot_results import cPickle as pickle import os from matplotlib import pyplot as plt def main(): usage = "usage: %prog [options]" # handle the commands line options parser = optparse.OptionParser(usage=usage) parser.add_option("-i", "--input", dest...
#! /usr/bin/python # coding=utf-8 # pycoact/tests/test.py # Last modified: 12 August 2013 import os import sys import thread import BaseHTTPServer import StringIO sys.path.insert(1, "../..") from pycoact.server.table import SharedTableServer from pycoact.client.table_csv import SharedTableCSV #======================...
# -*- coding: utf-8 -*- import datetime as dt import time import hashlib import json from chorizoweb.extensions import bcrypt from chorizoweb.database import ( Column, db, Model, ReferenceCol, relationship, SurrogatePK, ) from sqlalchemy.ext.orderinglist import ordering_list from sqlalchemy.sq...
import unittest from unittest.mock import patch, MagicMock from lutris.runners.pcsx2 import pcsx2 class TestPCSX2Runner(unittest.TestCase): def setUp(self): self.runner = pcsx2() @patch('lutris.util.system.path_exists') def test_play_iso_does_not_exist(self, mock_path_exists): main_file...
import sys from itertools import chain from OCC.Display.SimpleGui import init_display sys.path.append('..') from OCCUtils.Common import points_to_bspline from OCCUtils.Construct import gp_Pnt, make_edge, make_n_sided, make_vertex display, start_display, add_menu, add_function_to_menu = init_display() def n_sided_p...
import os from subprocess import call from django.conf import settings from django.core.files.temp import NamedTemporaryFile from django.core.mail import EmailMultiAlternatives from django.core.management.base import BaseCommand # sudo -u postgres psql # CREATE DATABASE ptidej OWNER pi; # gunzip ptidej-db.bak.XYZT.gz...
#!/usr/bin/python # -*- coding: utf-8 -*- ######################################### #import ######################################### import os import sys import win32com from win32com.client import Dispatch, constants ######################################### #founctions ######################################### def ...