content
string
from sympy import * var('x y z t') var('Re') u = Function('u')(x,y,z,t) v = Function('v')(x,y,z,t) w = Function('w')(x,y,z,t) # Eq_continuity = diff(u,x)+diff(v,y)+diff(w,z) == 0 ---------------------------------------------- diff(u,x)+diff(v,y)+diff(w,z) == 0 Lo= diff(u,x)+diff(v,y)+diff(w,z) L1=diff(u,x) L2=+d...
def Setup(Settings,DefaultModel): # set1-test_of_models_against_datasets/osm.py Settings["experiment_name"] = "set1b_Mix_model_versus_datasets_640px" Settings["graph_histories"] = ['together'] #['all','together',[],[1,0],[0,0,0],[]] # 5556x_minlen30_640px 5556x_minlen20_640px 5556x_reslen20_299px 555...
import io import os import pytest from release import cibuild def test_buildenviron_live(): be = cibuild.BuildEnviron.from_env() assert be.release_dir def test_buildenviron_common(): be = cibuild.BuildEnviron( system="Linux", root_dir="/foo", travis_branch="master", ) a...
from __future__ import absolute_import, division import json import logging import random from threading import Lock from tornado.ioloop import PeriodicCallback from .constants import DEFAULT_THROTTLER_REFRESH_INTERVAL from .metrics import Metrics, MetricsFactory from .utils import ErrorReporter MINIMUM_CREDITS = 1....
#!/usr/bin/python -u # -*- coding: utf-8 -*- from django.db import models from os import * import uuid import os import shutil import Image from listasTematicas.models import * from datetime import datetime from django.db.models import Q from smart_selects.db_fields import ChainedForeignKey # Creat...
#!/usr/bin/env python from setuptools import setup, find_packages # Loads version.py module without importing the whole package. def get_version_and_cmdclass(package_path): import os from importlib.util import module_from_spec, spec_from_file_location spec = spec_from_file_location('version', ...
from collections import namedtuple from operator import attrgetter from threading import Event from .stoppablethread import StoppableThread, StoppableLoopThread from .pypot_time import time Point2D = namedtuple('Point2D', ('x', 'y')) Point3D = namedtuple('Point3D', ('x', 'y', 'z')) Point = Point3D Vector3D = namedtu...
# -*- coding: utf-8 -*- ''' Exodus Add-on Copyright (C) 2016 lambda 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 opti...
""" (c) 2013 LinkedIn Corp. 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 agreed to in writing...
"""This module contains analysis module helpers to solve path constraints.""" from z3 import sat, unknown, FuncInterp import z3 from mythril.laser.smt import simplify, UGE, Optimize, symbol_factory from mythril.laser.ethereum.time_handler import time_handler from mythril.exceptions import UnsatError from mythril.laser...
#!/usr/bin/env python usage = """Usage: python example-service.py & python example-client.py python example-async-client.py python example-client.py --exit-service """ # Copyright (C) 2004-2006 Red Hat Inc. <http://www.redhat.com/> # Copyright (C) 2005-2007 Collabora Ltd. <http://www.collabora.co.uk/> # # Permission ...
import unittest from esridump import esri2geojson class TestEsriJsonToGeoJson(unittest.TestCase): def setUp(self): self.maxDiff = None def assertEsriJsonBecomesGeoJson(self, esrijson, geojson): out_json = esri2geojson(esrijson) self.assertDictEqual(out_json, geojson) class TestGeoJs...
import os from typing import Dict from gtdbtk.biolib_lite.common import make_sure_path_exists from gtdbtk.config.config import RED_DIST_ARC_DICT, RED_DIST_BAC_DICT from gtdbtk.config.output import PATH_AR122_RED_DICT, PATH_BAC120_RED_DICT class REDDictFile(object): """Store the GTDB-Tk RED dictionary.""" de...
import numpy as nm from linear_elastic import \ filename_mesh, materials, regions, fields, ebcs, \ integrals, solvers options = { 'ts' : 'ts', 'save_steps' : -1, } variables = { 'u' : ('unknown field', 'displacement', 0, 'previous'), 'v' : ('test field', 'displacement', 'u'), } # Put densit...
# -*- coding: utf-8 -*- import sys from os import mkdir from os.path import join, dirname, exists, basename from sphinx.ext.intersphinx import fetch_inventory import warnings __author__ = 'vahid' this_dir = dirname(__file__) cache_dir = join(this_dir, '_inv-cache') if not exists(cache_dir): mkdir(cache_dir) def...
"""Django rest framework pagination classes.""" from rest_framework.pagination import LimitOffsetPagination, _positive_int def get_query_param(request, key): """Get query parameter uniformly for GET and POST requests.""" value = request.query_params.get(key) or request.data.get(key) if value is None: ...
import sqlite3 import os from colored import * from time import * print '%s Loading Skype Metadata Module%s' % (fg(3), attr(0)) sleep(4) print '\n\tSkype Metadata [\033[1;31mforensic/skypedata\033[1;m] | * this script will able\n\t to automate extraction process and extra information from\n\t several different columns...
#!/usr/bin/env python """Clients-related part of GRR API client library.""" from grr.gui.api_client import flow from grr.gui.api_client import utils from grr.gui.api_client import vfs from grr.proto import api_pb2 class ClientApprovalBase(object): """Base class for ClientApproval and ClientApprovalRef.""" def _...
import time from mcrouter.test.MCProcess import Memcached from mcrouter.test.McrouterTestCase import McrouterTestCase from mcrouter.test.mock_servers import SleepServer from mcrouter.test.mock_servers import ConnectionErrorServer class TestDevNull(McrouterTestCase): config = './mcrouter/test/test_dev_null.json' ...
from twisted.internet import defer from twisted.internet import reactor from twisted.web import html from twisted.web.util import DeferredResource from twisted.web.util import Redirect import time import urllib from buildbot import interfaces from buildbot import util from buildbot.schedulers.forcesched import ForceS...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'acceptance_template.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fr...
"""Constants used in various parts of QL, mostly strings.""" import sys import os # MSYS2 defines MSYSTEM which changes os.sep/os.path.sep for the mingw # Python build. Unset here and restart.. (does not work for py.test etc.) # XXX: do this here since it gets executed by all scripts if os.name == "nt" and "MSYSTEM"...
""" NephoScale Cloud driver (http://www.nephoscale.com) API documentation: http://docs.nephoscale.com Created by Markos Gogoulos (https://mist.io) """ import base64 import time import os import binascii from libcloud.utils.py3 import httplib from libcloud.utils.py3 import b from libcloud.utils.py3 import urlencode f...
from zope.interface import implements from zope.component import adapts # Zenoss Imports from Products.Zuul.interfaces import IReportable, IReportableFactory # Analytics Imports from ZenPacks.zenoss.ZenETL.reportable import ( BaseReportable, DeviceReportable, DeviceReportableFactory, MARKER_LENGTH, ...
import os from collections import OrderedDict import sys fil = open('energy.xvg').readlines() GMX_dat = [float(f)/4.184 for f in fil[-1].split()[1:-1]] nfil = open('LOG_NAMD').readlines() for line in nfil: if 'ENERGY: 1000' in line: NAMD_DAT = [float(f) for f in line.split()[2:12]] #print(NAMD_DAT) ...
# Set up a basic scene for rendering. from paraview.simple import * import sys script = """ import vtk def setup_data(view): # Don't actually need any data pass def render(view, width, height): canvas = vtk.vtkImageCanvasSource2D() canvas.SetExtent(0, width-1, 0, height-1, 0, 0) canvas.SetNumberOfScalarCom...
from datetime import datetime from flask import render_template, g, request, flash, redirect, url_for from flask.ext.login import LoginManager, login_required, login_user, logout_user, current_user from app import app, db, login_manager from models import User from forms import LoginForm login_manager.login_view = 'l...
from spack import * class RRio(RPackage): """Streamlined data import and export by making assumptions that the user is probably willing to make: 'import()' and 'export()' determine the data structure from the file extension, reasonable defaults are used for data import and export (e.g., 'stringsAsFact...
import json import pytest from ehb_datasources.drivers.redcap.formBuilderJson import FormBuilderJson @pytest.fixture() def form_builder(): return FormBuilderJson() def test_construct_form(form_builder, redcap_metadata_json, redcap_record_json): form = form_builder.construct_form( json.loads(redcap_m...
import sys try: from django.conf import settings settings.configure( DEBUG=True, USE_TZ=True, DATABASES={ 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'django_users2', } }, ROOT_URLCONF='users.urls'...
import json import os import logging from flask import Flask, render_template from flask_ask import Ask, statement, question from flask_ask.verifier import VerificationError from dotenv import load_dotenv, find_dotenv from yelp import Yelp from flask_dotenv import DotEnv load_dotenv(find_dotenv()) app = Flask(__name__...
# -*- coding: utf-8 -*- import hashlib, os, sys, tempfile, time from ctp.futures import ApiStruct, MdApi class MyMdApi(MdApi): def __init__(self, brokerID, userID, password, instrumentIDs): self.requestID = 0 self.brokerID = brokerID self.userID = userID self.password = password ...
from __future__ import print_function import notifier import notifier.threads as nfthreads import os import random import sys import time def done_with_it(thread, result): print("-> Thread '%s' is finished" % thread.name) if isinstance(thread.result, BaseException): print(" Error occurred during thread process...
from lib.common import helpers class Module: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Invoke-InveighRelay', 'Author': ['Kevin Robertson'], 'Description': ('Relays incoming HTTP NTLMv2 authentication requests to an SMB target. ' 'If the a...
""" The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? """ def prime_gen(): from itertools import count primes = [] yield 2 for n in count(3,2): comp = False for p in primes: if not n % p: comp = Tru...
from odoo import api, fields, models, _ from datetime import datetime import pytz class CrmTeam(models.Model): _inherit = 'crm.team' team_type = fields.Selection(selection_add=[('pos', 'Point of Sale')]) pos_config_ids = fields.One2many('pos.config', 'crm_team_id', string="Point of Sales") pos_sessio...
from array import * class approximatedmedian: registered = True # Value to define db operator def __init__(self): self.n = 0 self.totalnums = 0 self.numberofcolumns = 5 self.colname = [] self.buckets = [] self.minvalues = [] self.maxvalues = [] ...
ANSIBLE_METADATA = { 'supported_by': 'community', 'status': ['preview'] } from ansible.module_utils.basic import * def main(): module = AnsibleModule( argument_spec=dict( config_path=dict(default=None, required=True), state=dict(default="present") ), su...
import unittest import mock import uvtool.libvirt.simplestreams as simplestreams # Some tests use more recent features of mock that are not available with mock # 0.7.2-1 as shipped with Ubuntu Precise, but for the next six months, we still # want backports to be possible. Skip tests on builds that don't have a recen...
from CIM14.CDPSM.Balanced.IEC61970.Core.ConductingEquipment import ConductingEquipment class DistributionTransformerWinding(ConductingEquipment): """Conducting connection point of a distribution / unbalanced transformer winding instance. This class differs from Wires::TransformerWinding as follows: - the eight P...
from .base import BaseElement, BaseContainer from ..utils import html_property class Image(BaseElement): """ A simple image widget. """ html_tag = "img" source = html_property('src') """ Path of the image file """ def build(self, img_url): super(Image, self).build() ...
import os import unittest from vsg.rules import architecture from vsg import vhdlFile from vsg.tests import utils sTestDir = os.path.dirname(__file__) lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_020_test_input.vhd')) lExpected_lower = [] lExpected_lower.append('') utils.read_file(os.path...
import datetime import pytest from six.moves import urllib from gsi.verification import _helpers class SourceClass(object): def func(self): # pragma: NO COVER """example docstring""" def test_copy_docstring_success(): def func(): # pragma: NO COVER pass _helpers.copy_docstring(Sourc...
#!/usr/bin/python import pentai.db.games_mgr as gm_m import pentai.db.openings_book as ol_m import pentai.base.human_player as h_m import pentai.db.players_mgr as pm_m import pentai.db.zodb_dict as z_m import pentai.ai.ai_genome as aig_m from pentai.base.defines import * import pentai.base.logger as log import sys im...
"""Example of using timeit programatically. Time various ways to populate and check a dictionary using a long list of strings and integers. """ __version__ = "$Id$" #end_pymotw_header import timeit # using setitem t = timeit.Timer("print 'main statement'", "print 'setup'") print 'TIMEIT:' print t.timeit(2) print ...
# -*- coding: utf-8 -*- from point import Point from triangulation import Triangulation from coloring import Coloring import threading #import time class ArtGallery(object): """ This class resolves The art gallery problem. It is a visibility problem in computational geometry. Guarding an art gallery with...
# 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 = "s, t 1.1, s, q" tags = "CallFuncS" import summa from summa.director import director from summa.actions import CallFuncS, Show, Delay from summa....
"""Generational ClusterFuzz fuzzer. It generates IPC messages using GenerateTraits. Support of GenerateTraits for different types will be gradually added. """ import os import random import subprocess import sys import utils FUZZER_NAME_OPTION = '--fuzzer-name=generate' MAX_IPC_MESSAGES_PER_TESTCASE = 1500 class Ge...
# Create your tests here. from django.test.client import Client from django.test import TestCase from django.contrib.auth.models import User from socialnet.models import * from rest_framework import status from rest_framework.test import APITestCase, APIRequestFactory, APIClient from .viewsauthors import * from .viewsp...
""" The :class:`~openstack.connection.Connection` class is the primary interface to the Python SDK it maintains a context for a connection to a cloud provider. The connection has an attribute to access each supported service. The service attributes are created dynamically based on user profiles and the service catalog...
import sys # Adicionar o caminho do MAP FACTORY sys.path.insert(0, '../Modelos/') sys.path.insert(0, '../Modelos/Mapa/') from Game import * from Map import * from MapFactory import * import json """ Metodo principal para rodar o cliente """ if __name__ == "__main__": fct = MapFactory() with open('../Recursos/M...
<<<<<<< HEAD <<<<<<< HEAD """test script for a few new invalid token catches""" import unittest from test import support class EOFTestCase(unittest.TestCase): def test_EOFC(self): expect = "EOL while scanning string literal (<string>, line 1)" try: eval("""'this is a test\ ...
from __future__ import unicode_literals import json from django.conf import settings from django.contrib import messages from django.contrib.auth.decorators import login_required try: from django.contrib.auth import get_user_model # Django 1.5 except ImportError: from postman.future_1_5 import get_user_model...
from django.shortcuts import render_to_response from django.template import RequestContext, Context from django.http import HttpResponseRedirect, HttpResponse from django import forms from django.contrib.auth.decorators import login_required from django.contrib.auth import authenticate, login, logout from django.shortc...
import copy import json import os from platform import system from platformio.managers.platform import PlatformBase from platformio.util import get_systype class Ststm32Platform(PlatformBase): def configure_default_packages(self, variables, targets): board = variables.get("board") board_config =...
import html from gi.repository import GObject, Gtk class TagCloud(Gtk.Layout): __gsignals__ = { 'selected': (GObject.SignalFlags.RUN_LAST, None, (GObject.TYPE_STRING,)) } def __init__(self, min_size=20, max_size=36): Gtk.Layout.__init__(self) self._mi...
#!/usr/bin/python import xmpp class xmppInterface(): username = "" password = "" xmppConnection = None incomingMessageHandler = None def connect(self): jid = xmpp.protocol.JID(self.username) self.xmppConnection = xmpp.Client(jid.getDomain(), debug=[]) if self.xmppConnectio...
#!/usr/bin/env phenix.python """ This is simplified version of iotbx.reflection_file_editor. Cut resolution ranges. Maybe useful for e.g. removing ice ring resolutions. """ import sys, os, optparse import string import re import iotbx.mtz from cctbx.array_family import flex from iotbx.reflection_file_editor import gue...
import logging from stevedore import driver from cauth.service import base from cauth.model import db as auth_map logger = logging.getLogger(__name__) class UserDetailsCreator: def __init__(self, conf): self.services = [] for service in conf.services: try: plugin = d...
from django.db import models from django.contrib.auth.models import User from django.utils.text import slugify from .uniqueslug import unique_slugify from django.utils import timezone # Create your models here. class Post(models.Model): author = models.ForeignKey(User) link = models.CharField(max_length=2083,...
#!/usr/bin/python3 """ message_handlers.py: """ # Import Required Libraries (Standard, Third Party, Local) ******************** import asyncio import logging # Authorship Info ************************************************************* __author__ = "Christopher Maue" __copyright__ = "Copyright 2017, The B.O.B. Pro...
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: ai ts=4 sts=4 et sw=4 nu from __future__ import (unicode_literals, absolute_import, division, print_function) import logging from snisi_malaria import get_domain logger = logging.getLogger(__name__) def provider_is_allowed(prole, plocatio...
import sys import os.path import pprint sys.path.append(os.path.abspath(__file__ + "\..\..")) import windows import windows.test import windows.debug import windows.native_exec.simple_x86 as x86 from windows.generated_def.winstructs import * class MyDebugger(windows.debug.Debugger): def __init__(self, *args, **...
#!/usr/bin/python # -*- coding: utf-8 -*- """Tests for the Windows XML EventLog (EVTX) parser.""" import unittest from plaso.formatters import winevtx as _ # pylint: disable=unused-import from plaso.lib import eventdata from plaso.lib import timelib from plaso.parsers import winevtx from tests.parsers import test_l...
import logging import uuid from c7n_azure.actions.firewall import SetFirewallAction from c7n_azure.filters import FirewallRulesFilter, FirewallBypassFilter from c7n_azure.provider import resources from c7n_azure.resources.arm import ArmResourceManager from c7n_azure.utils import ThreadHelper from netaddr import IPRang...
import re import pprint hex_re = r'(?:[a-f0-9]{16})' hex_rec = re.compile(hex_re) reg_re = r'\b(?:(?:x|w)(\d+))\b' reg_rec = re.compile(reg_re) fun_re = r'(?P<func_addr>' + hex_re + ') <(?P<func_name>[^>]+)>:$' fun_rec = re.compile(fun_re) ident_re = r'(?:[a-zA-Z_][a-zA-Z0-9_]*)' ident_rec = re.compile(ident_re) c...
#!/usr/bin/python ''' ECE 358: Computer Networks Project: M/D/1 and M/D/1/K Queue Simulation Author: Simarpreet Singh (<EMAIL>) Louisa Chong (<EMAIL>) ''' import sys import numpy import subprocess rhoValues = 0 testList = [] times = 1 # TODO: We can do another argparse here but whatever....
import os from sqlalchemy.exc import IntegrityError from werkzeug.datastructures import FileStorage from shuttl.Models.Reseller import Reseller from shuttl.Models.organization import Organization from shuttl.Models.Website import Website from shuttl.Models.FileTree.Directory import Directory from shuttl.Models.FileTre...
from pygen.cgen import Assignment, CallStatement, IfStatement from .arithgen import ArithGen from utils import eval_branches, FunctionGenerator import pgen class TailRecursionGenerator(FunctionGenerator): """This generates some code to test tail recursion handling.""" def __init__(self, module, stats, opts...
import os import time import cawa_utils as cu import cawa_tcwv_land as cawa_land import cawa_tcwv_ocean as cawa_ocean class CawaTcwvModisCore: """ The CAWA core class for total water vapour column retrieval. Basically a wrapper which determines the valid mask and land/water distinction and calls the ...
#!/usr/bin/python # -*- coding: utf8 -*- """ ADE Web API Test Copyright (C) 2011-2015 "Sébastien Celles" <<EMAIL>> 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' CPU実装に利用する汎用関数を提供します。 ''' import random import logging def get_random_index(xs, value, else_value=None, excludes_index=[]): ''' xsの中の値がvalueであるindexをランダムに選んで返します。 存在しない場合はelse_valueが返ります。 また、結果として除外するindexがある場合、excludes_indexにそのindexを含めてください。 ''' if value ...
#!/usr/bin/env python import os import zipfile, sys import xml.dom.minidom from lxml import etree from androguard.core.bytecodes import apk from androguard.core.bytecodes import dvm from androguard.core.analysis import analysis from android_test import testAndroid def addElement(parent, name, value): e = etree.Elem...
""" Module for Confluence text processing. """ try: # Python 3 from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest def bold(text): """Make Confluence bold text. """ return "*{0}*".format(text) def heading(title, level=1): """Make a Conf...
from django.test import LiveServerTestCase import json import requests from constants import NODE_HOSTNAMES import inspect from util.utilities import print_message from django.contrib.auth.models import User from web_fe.models import Notification from django.test import Client class TestUploadToViewer(LiveServerTestC...
import os import ssl from oslo.config import cfg from octavia.openstack.common.gettextutils import _ ssl_opts = [ cfg.StrOpt('ca_file', help="CA certificate file to use to verify " "connecting clients."), cfg.StrOpt('cert_file', help="Certificate file to use...
from setuptools import setup, find_packages from distutils.command.install import INSTALL_SCHEMES from os import sys, path import os import shutil import re from glob import glob for scheme in INSTALL_SCHEMES.values(): scheme['data'] = scheme['purelib'] from imp import find_module try: find_module('numpy') ex...
#!/usr/bin/env python # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>' import json from collections import defaultdict from PyQt5.Qt import ( Q...
# -*- coding:utf-8 -*- from __future__ import absolute_import from unittest import TestCase from yaya.const import TAG_BIGIN, TAG_END from yaya.seg.wordnet import WordNet, gen_word_net, Vertex, new_tag_vertex __author__ = 'tony' class TestWordNet(TestCase): def test_gen_word_net(self): text = u"一举成名天下知"...
#!/usr/bin/env python "Load data, create the validation split, optionally scale data, train a linear model, evaluate" import pandas as pd from sklearn.pipeline import Pipeline from sklearn.preprocessing import Normalizer, PolynomialFeatures from sklearn.preprocessing import MaxAbsScaler, MinMaxScaler, StandardScaler...
"""Run test matrix.""" import argparse import multiprocessing import os import sys import python_utils.jobset as jobset import python_utils.report_utils as report_utils from python_utils.filter_pull_request_tests import filter_tests _ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..')) os.chdi...
# -*- encoding: utf-8 -*- from django.db import transaction from django.shortcuts import redirect from django.views.generic import TemplateView from apps.user_dashboard.models import ScriptForm from apps.user_dashboard.shortcuts import create_package, \ populate_package_forms from apps.user_dashboard.views import ...
from bambou import NURESTFetcher class NUWANServicesFetcher(NURESTFetcher): """ Represents a NUWANServices fetcher Notes: This fetcher enables to fetch NUWANService objects. See: bambou.NURESTFetcher """ @classmethod def managed_class(cls): """ Return...
import sys, os sys.path.insert(1, "../../") import h2o, tests import random def pub_444_spaces_in_filenames(): # tempdir = "smalldata/jira/" # if was okay to write to smalldata, it's okay to write to the current directory # probably don't want to, but can't find what the standard temp directory ...
import collections from django import forms from django.template.loader import render_to_string from kitsune.products.models import Topic from kitsune.wiki.models import Document class ProductTopicsAndSubtopicsWidget(forms.widgets.SelectMultiple): """A widget to render topics organized by product and with subto...
from django.shortcuts import render, redirect from django.http import HttpResponse,HttpResponseRedirect from django.template import RequestContext, loader from django.shortcuts import render from django.core.urlresolvers import reverse from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger # Create y...
from sys import version_info import vim import re from glob import glob from os import walk from os.path import join, isdir, basename, splitext from subprocess import Popen, PIPE, check_output from .vim_interface import get_setting, get_save_dir class CollatorCache(object): def __init__(self): self.data =...
import shesha.config as conf simul_name = "bench_scao_sh_16x16_8pix" # loop p_loop = conf.Param_loop() p_loop.set_niter(100) p_loop.set_ittime(0.002) # =1/500 # geom p_geom = conf.Param_geom() p_geom.set_zenithangle(0.) # tel p_tel = conf.Param_tel() p_tel.set_diam(4.0) p_tel.set_cobs(0.12) p_tel.set_type_ap("E...
# Grade: 13.5 / 14 # Sean Moriarty # 2016-05-31 # Homework 3 # TA-COMMENT: (-0.5) Technically, you've created a tuple, not a list. Remember, lists have [ ]! countries = ('Micronesia', 'Bahrain', 'Chad', 'Comorosa', 'Tonga', 'England', 'Japan') ) print(countries) for country in countries: print(country) countries ...
# -*- coding: utf-8 -*- import pytest import time import sys from .as_status_codes import AerospikeStatus from aerospike import predexp as as_predexp from aerospike import exception as e aerospike = pytest.importorskip("aerospike") try: import aerospike except: print("Please install aerospike python client.") ...
from struct import Struct import pytest from cps2zmq.process import Tile TEST_ADDR = '' TEST_DATA = 'F1F2F3F4F1F2F3F4F1F2F3F4F1F2F3F4F1F2F3F4F1F2F3F4F1F2F3F4F1F2F3F4' TEST_DATA16 = TEST_DATA * 4 TEST_PALETTE_DATA = '100200300510620730840A60C80EA0FB3FD3FE4FF7FFA012FFFFFFFFFFFFFFFF' ROW_FMT = Struct(8 * 'c') TILE_PACK_F...
from iris.coord_systems import RotatedGeogCS, GeogCS from iris.analysis.cartography import unrotate_pole from iris.coords import DimCoord import iris import h5py import numpy as np import pdb #experiment_ids = ['dklyu', 'dkmbq'] #experiment_ids = ['djznw', 'djzny', 'djznq', 'djzns', 'dklyu', 'dkmbq', 'dklwu', 'dklz...
""" This file is part of Candela. Candela 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. Candela is distributed in the hope that it will b...
#!/usr/bin/python #import getpass import imaplib import time import sys import getopt import random import os import types SERVER = "localhost" USER = "ftfstest" PASS = "ftfstest" def usage() : print sys.argv[0] + \ ''': [-t # num threads (1)] [ -w # write operation fraction out of 100 (0)] [ -...
""" Copyright 2011 Marcus Fedarko Contact Email: <EMAIL> This file is part of CAIP. CAIP 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...
import base64 from django.views.generic import CreateView, DeleteView from django.http import HttpResponse, HttpResponseRedirect from django.utils import simplejson from django.core.urlresolvers import reverse from django.conf import settings from youtune.fileupload.forms import FileForm from youtune.fileupload.model...
# -*- coding: utf-8 -*- # 이 파일은 단순히 새로운 소스코드를 실험하고, 보완하기 위해서 만들었음. # 필요 라이브러리 임포트 import sys # 트러블 슈팅을 위한 리스트 """ 1. sys.version의 구현과 인덱신 2. sys.version으로의 한계(?) 3. sys.version과 sys.version_info의 장단점과 스크립트상 용이점 4. sys모듈을 사용하여 스크립트를 2.x와 3.x에서 호환성 스크립트를 개발하지 않고 다른 방법으로.. 5. 호환성 관련하여 타 모듕 임포트 시의 문제 ...
__all__ = [] from pyasm.common import Environment, Common, jsonloads from pyasm.biz import Project from pyasm.web import Widget, DivWdg, HtmlElement, WebContainer from pyasm.widget import SelectWdg, TextWdg from pyasm.search import Search, SearchType from tactic.ui.common import BaseRefreshWdg import types # DEPRECA...
""" This script implements a CNN to train a car to drive autonomously. """ # See http://matplotlib.org/2.0.0rc1/_sources/faq/howto_faq.txt import matplotlib matplotlib.use('Agg') import csv import cv2 import matplotlib.pyplot as plt import numpy as np import tensorflow as tf from keras import backend as K from kera...
""" This config is where you would initialize your importers with personal info like account number or credit card last4 digit. you may also define CONFIG:List[ImporterProtocol] for other beancount tools like bean-identify, bean-file, and other beancount scripts to use eg. `bean-identify _config.py ~/Downloads` to ide...