code
stringlengths
1
199k
from ..view.Ui_NetworkDialog import * from ..model.core_classes import CoNetwork, ClNominalPressure from DocumentForm import * class NetworkDialog(QDialog, Ui_NetworkDialog, DatabaseHelper): def __init__(self, network_id, parent=None): super(NetworkDialog, self).__init__(parent) DatabaseHelper.__ini...
from distutils.core import setup, Extension import os setup (name = 'sparsehc_dm', version = '', description = 'Python wrapper for sparsehc_dm with STXXL sorting integrated', packages=['sparsehc_dm'], package_dir={'sparsehc_dm':''}, package_data={'sparsehc_dm':['sparsehc_dm.so',]}, ...
''' ThunderGate - an open source toolkit for PCI bus exploration Copyright (C) 2015-2016 Saul St. John 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 Licen...
import logging import multiprocessing as multi import traceback from kombu import mixins from tribble.common.db import zone_status from tribble.common import rpc from tribble.common import system_config from tribble.engine import constructor from tribble.engine import engine_maps CONFIG = system_config.ConfigurationSet...
"""Long option name example. """ import argparse parser = argparse.ArgumentParser(description='Example with long option names') parser.add_argument('--noarg', action="store_true", default=False) parser.add_argument('--witharg', action="store", dest="witharg") parser.add_argument('--witharg2', action="store", dest="with...
import meshplex import meshzoo import numpy as np from scipy.sparse import linalg import pyfvm from pyfvm.form_language import Boundary, dS, dV, integrate, n_dot_grad def test(): class Singular: def apply(self, u): return ( integrate(lambda x: -1.0e-2 * n_dot_grad(u(x)), dS) ...
from django.db import migrations def refactor_languages_field(apps, schema_editor): # We can't import the JournalInformation model directly as it may be a newer # version than this migration expects. We use the historical version. JournalInformation = apps.get_model('erudit', 'JournalInformation') for j...
from __future__ import unicode_literals from django.db import models from django.contrib.auth.models import User class Perfil(models.Model): nome = models.CharField(max_length=70, null=False) #email = models.CharField(max_length=70, null=False) telefone = models.CharField(max_length=20, null=False) cargo = models.C...
from django.db import models from django.dispatch import receiver from django.utils.translation import ugettext_lazy as _ import django_monitor from livinglots_notify.helpers import notify_facilitators from livinglots_steward.models import (BaseStewardProject, BaseStewardNotificat...
import random import copy class EnteroArbitrario: numero = [] def __init__(self, base = 10, numero = 0): self.base = base self.signo = 1 self.l = 0 if(numero != 0): self.numero = self.decToBase(numero) def decToBase(self, num): target = [] while(num >= self.base): target.append(num%self.base) nu...
from .base import * DEBUG = False CSRF_COOKIE_SECURE = True SESSION_COOKIE_SECURE = True EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = config.get('email', 'EMAIL_HOST', fallback='smtp.sparkpostmail.com') EMAIL_PORT = config.get('email', 'EMAIL_PORT', fallback='587') EMAIL_HOST_USER = config...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('econdata', '0005_auto_20170520_2232'), ] operations = [ migrations.CreateModel( name='ProductsInListing', ...
"""Error handling with character map encodings. """ import codecs from codecs_invertcaps_charmap import encoding_map text = u'pi: π' for error in [ 'ignore', 'replace', 'strict' ]: try: encoded = codecs.charmap_encode(text, error, encoding_map) except UnicodeEncodeError, err: encoded = str(err) ...
import glob import os import re """ Automatically read and store variables in a header file formatted as follows: description ; variable_name{(array_element)} ; variable_value where the delimiter is a semicolon and elements of multi-dimensional Fortran arrays are written with curved brackets (). The array is the...
import unittest import os from ...workbook import Workbook from ..helperfunctions import _compare_xlsx_files class TestCompareXLSXFiles(unittest.TestCase): """ Test file created by XlsxWriter against a file created by Excel. """ def setUp(self): self.maxDiff = None filename = 'set_column...
import numpy as np import matplotlib.pyplot as plt import networkx as nx import hemo.sims as sims import scipy.integrate import system import importlib import time import os def surface_area(G): """Total surface area of vessels in the network Parameters ---------- G Graph Structure Returns ...
"""Process Google ngram data. Google ngram data can be found at http://books.google.com/ngrams/datasets This was used to generate the word list included with this code. It generates a list of the most commonly used words in the chosen set by inputing 1-gram files from Google. This can be used to generate other word lis...
""" LIC - Instruction Book Creation software Copyright (C) 2010 Remi Gagne Copyright (C) 2015 Jeremy Czajkowski This file (LicPovrayWrapper.py) is part of LIC. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published b...
from cloudapp import Application, BaseUser from cloudapp.api import Blueprint as APIBlueprint, Envelope from cloudapp.config import DebugConfig from cloudapp.permissions import valid_user from flask import Blueprint, request, redirect, render_template, g, url_for, json www = Blueprint("www", __name__) api = APIBlueprin...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('posgradmin', '0057_auto_20200215_1737'), ] operations = [ migrations.AlterField( model_name='academico', name='nivel_SNI', field=models.CharField(blank=True,...
from .pair_generator import AdaptivePairGenerator def generate_pair(scored_objects=[], comparison_pairs=[], log=None): pair_algorithm = AdaptivePairGenerator() pair_algorithm.log = log return pair_algorithm.generate_pair(scored_objects, comparison_pairs)
"""new_gtf_genome_wide_parser.py: New gtf parses much faster and more effecient.""" __authos__ = "Israa Alqassem" __copyright__ = "Copyright 2017, McSplicer" import csv import numpy as np from pandas import * import time def get_all_genes_dict(gtf_file): gene_dict = {} with open(gtf_file, "rb") as f: ...
import tkinter as tk #导入tkinter模块 class MyDialog: #自定义对话框 def __init__(self, master): self.top = tk.Toplevel(master) #生成Toplevel组件 self.label1 = tk.Label(self.top, text='版权所有') #创建标签组件 self.label1.pack() self.label2 = tk.Label(self.top...
from ExtempFiles.update import MainUpdate def update(): paper = "haaretz" feeds = ("http://www.haaretz.com/feed/enewsRss.xml", "http://www.haaretz.com/feed/edefenseRss.xml", "http://www.haaretz.com/feed/enationalRss.xml", "http://www.haaretz.com/feed/ejewishworldRss.xml") #Get lin...
""" Collect time series to store them in an Analyzer-readable file. .. todo:: Merge the node into the :class:`~pySPACE.missions.nodes.time_series_sink.TimeSeriesSinkNode` and the collection as special storage format into the :class:`~pySPACE.resources.dataset_defs.time_series.TimeSeriesDataset` """ ...
import sys, os extensions = [] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = u'oranj' copyright = u'2009, Pavel Panchekha' version = '0.7' release = '0.7' exclude_trees = ['_build'] pygments_style = 'sphinx' highlight_language = "oranj" html_theme = 'default' html_style = "styles...
import os, sh from tabulate import tabulate from datetime import datetime import time import tempfile import collections import ipdb def _get_dirs(dir_path): ''':returns: list of directories in *dir_path*''' return filter((lambda x:os.path.isdir(dir_path+"/"+x)), os.listdir(dir_path)) dir = _get_dirs(".") def g...
from osv import osv, fields from openerp import netsvc from tools.translate import _ import time class production(osv.osv): _name = 'mrp.production' _inherit = 'mrp.production' def action_confirm(self, cr, uid, ids, context=None): # original """ Confirms production order. @return: Ne...
"""Models for "dev" menu.""" from datetime import date from django.db import models from weechat.common.tracker import commits_links, tracker_links from weechat.common.templatetags.localdate import localdate from weechat.download.models import Release class Task(models.Model): """A task (a new feature or bug to fix...
import numpy as np import re import itertools from collections import Counter import cPickle as pickle import os def clean_str(string): """ Tokenization/string cleaning for all datasets except for SST. """ string = re.sub(r"[^A-Za-z0-9:(),!?\'\`]", " ", string) string = re.sub(r" : ", ":", string) ...
import copy import json from pathlib import Path from typing import TypeVar, BinaryIO, Dict, Any import construct from construct import (Struct, Int32ub, Const, CString, Byte, Rebuild, Float32b, Flag, Short, PrefixedArray, Switch, If, VarInt, Float64b, Compressed) from randovania.game_description...
mcinif='mcini_XI_2' runnamex='colpachB' mcpick='colpach.pick' pathdir='/beegfs/work/ka_oj4748/echoRD' wdir='/beegfs/work/ka_oj4748/gen_tests' import sys from pathlib import Path import numpy as np sys.path.append(pathdir) update_mf='moist_testcase2.dat' macscale=0.7 aref='geogene2' runname=runnamex+str(int(np.round(mac...
''' Task Coach - Your friendly task manager Copyright (C) 2004-2013 Task Coach developers <developers@taskcoach.org> Task Coach 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 (...
from vsg.token import index_subtype_definition as token from vsg.vhdlFile import utils from vsg.vhdlFile.classify import type_mark def classify(iToken, lObjects): ''' index_subtype_definition ::= type_mark range <> ''' iCurrent = type_mark.classify(iToken, lObjects) iCurrent = utils....
from pyPdf import PdfFileWriter, PdfFileReader execfile("../config.py") from variousfct import * import glob if os.path.isfile(plotdir + "Combined_pdf.pdf"): print "Removing existing stuff" print "rm "+plotdir+"Combined_pdf.pdf" os.system("rm "+plotdir+"Combined_pdf.pdf") files = sorted(glob.glob(plotdir + "*.pdf"))...
from pyramid.scaffolds import PyramidTemplate class TravelcrmProjectTemplate(PyramidTemplate): _template_dir = 'travelcrm' summary = 'Extension app scaffold for TravelCRM'
import glob, os def scanfolder(): for path, dirs, files in os.walk('/home/ravindra/'): print path print dirs print files #for _dir in dirs: # os.chdir(path+"/"+_dir) # if os.path.isfile('vasprun.xml') & os.path.isfile('vasprun.xml') : #os.system('cp /media/r...
import math N = 50 M = 30 def f1(x): return math.sin(N * x[0]) * math.cos(M * x[1]) + 1 def f2(x): return math.sin(M * x[0]) * math.cos(N * x[1]) + 1 name = 'EWA2' dims = [(0, 1), (0, 1)] fitnesses = [f1, f2] pareto_front = [[0.0, 0.0]] pareto_set = []
from setuptools import setup from setuptools.command.build_ext import build_ext as _build_ext class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_options(self) # Prevent numpy from thinking it is still in its setup process: __builtins__.__NUMPY_SETUP__ = False ...
"""Test verifiers for cloud-init main features. See configs/main/README.md for more information """
''' Filename: lemiprotocol Part of package: acquisition Type: Part of data acquisition library PURPOSE: This package will initiate LEMI025 / LEMI036 data acquisition and streaming and saving of data. CONTAINS: *LemiProtocol: (Class - twisted.protocols.basi...
from anillo.http import Ok from .controller import Controller import logging class Index(Controller): def get(self, request): logging.info("[GET] Index") return Ok({"message": "Welcome to this API.", "api-version": "1.0"}) def post(self, request): return Ok({"message": "Welcome to this A...
""" WSGI config for lighthouse project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lighthouse.settings") from django.core...
""" .. module:: common :platform: Unix, Windows, OSX :synopsis: Backbone components for Crog .. moduleauthor:: Andres Ruiz <afruizc@gmail.com> """ class Problem(object): """Represents a problem on any online judge. This is a generic class, and should be totally independent from any online judge. ...
from django.http import HttpResponse from wechat.official import WxApplication, WxTextResponse from django.views.decorators.csrf import csrf_exempt class WxApp(WxApplication): """把用户输入的文本原样返回。 """ SECRET_TOKEN = '' APP_ID = '' ENCODING_AES_KEY = '' def on_text(self, req): return WxTextRe...
import getpass import sys import telnetlib HOST = "192.168.122.10" user = raw_input("Enter your telnet account: ") password = getpass.getpass() tn = telnetlib.Telnet(HOST) tn.read_until("Username: ") tn.write(user + "\n") if password: tn.read_until("Password: ") tn.write(password + "\n") tn.write("enable\n") tn...
"""Transforms raw features into fMLLR features This function is inspired from kaldi/egs/wsj/s5/steps/decode_fmllr.sh. """ import os import subprocess from abkhazia.kaldi.path import kaldi_path from abkhazia.utils.path import list_directory def extract_fmllr(corpus_dir, feat_dir, trans_dir, output_dir): """Creates f...
""" general ocelot description """ __version__ = '21.12.1' __all__ = ['Twiss', "Beam", "Particle", "get_current", "get_envelope", "generate_parray", # beam "ellipse_from_twiss", "ParticleArray", "global_slice_analysis", 'gauss_from_twiss', # beam "save_particle_array", "load_partic...
from __future__ import unicode_literals import frappe from frappe.model.document import Document class TaxWithholdingCategory(Document): def validate(self): if not frappe.db.get_value("Tax Withholding Category", {"is_default": 1, "name": ("!=", self.name)}, "name"): self.is_default = 1
from django import get_version as django_version from sys import version as python_version from settings import BASE_URL, SPRINGWHIZ_VERSION def platform_version_info(request): return {'version_springwhiz': SPRINGWHIZ_VERSION, 'version_python': python_version.split()[0], 'version_django': dj...
from kivy.uix.widget import Widget from kivy.uix.boxlayout import BoxLayout from kivy.properties import ObjectProperty, ReferenceListProperty from kivy.properties import NumericProperty from kivy.graphics import Line, Color class BorderBehavior(Widget): borders = ObjectProperty(None) border_origin_x = NumericPr...
import sys import os.path import urllib2 import re from pyquery import PyQuery as pq import common def getId(url): arr = url.split("/") id = arr[len(arr) - 2] return id def getSiteUrl(id, monitor, rcbUrl): urlRequest = "http://{0}/go/lid/{1}/".format(monitor, id) result = "" print("REQUEST: {0}".format(urlRequest...
import json import re import zipfile from collections import defaultdict, OrderedDict from inspect import isclass from typing import Iterator, Generator, Optional import xlsxwriter from ..constants import ( GEO_QUESTION_TYPES, TAG_COLUMNS_AND_SEPARATORS, UNSPECIFIED_TRANSLATION, ) from ..schema import CopyF...
""" This module defines the following classes: * Session: takes into account flags passed by the command line instruction, reads config files and data directory * Feed: Sanitizes and organizes a particular feed and makes it available for the subcommands * Placeholders: Calculates and stores the values of placeholders "...
from main.settings import LEN_SALT, KEYS_DIRS from django import template import locale locale.setlocale(locale.LC_ALL, "ru_RU.UTF-8") register = template.Library() @register.filter(name='free') def free(value): u""" Тип лицензии: коммерческая или беспланая """ return u"беспланая" if value else u"коммер...
""" 配置分类: 1. Django使用的配置文件,写到settings中 2. 程序需要, 用户不需要更改的写到settings中 3. 程序需要, 用户需要更改的写到本config中 """ import os import re import sys import types import errno import json import yaml import copy from importlib import import_module from django.urls import reverse_lazy from urllib.parse import urljoin, urlparse from django....
import bpy scn = bpy.context.scene longitud=10 cuantos_segmentos=70 calidad_de_colision=20 substeps=50 cuantos_segmentos += 1 def deseleccionar_todo(): bpy.ops.object.select_all(action='DESELECT') def seleccionar_todo(): bpy.ops.object.select_all(action='SELECT') def reset_scene(): seleccionar_todo() bp...
import unidecode import unicodedata import re def char_filter(string): latin = re.compile('[a-zA-Z]+') for char in unicodedata.normalize('NFC', string): decoded = unidecode.unidecode(char) if latin.match(decoded): yield char else: yield decoded def clean_string(st...
""" Demo of class psychopy.visual.BufferImageStim() - take a snapshot of a multi-item screen image - save and draw as a BufferImageStim - report speed of BufferImageStim to speed of drawing each item separately """ from psychopy import visual, event, core win = visual.Window(fullscr=False, monitor='testMonitor') clock ...
from __future__ import absolute_import, division, print_function import types import numpy as np from liam2 import config from liam2.compat import with_metaclass from liam2.context import context_length from liam2.expr import (FunctionExpr, not_hashable, getdtype, as_simple_expr, as_string, get_default_value, ispresent...
from __future__ import unicode_literals from django.db import models from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, PermissionsMixin class UserManager(BaseUserManager): def _create_user(self, username, email, password, is_staff, is_superuser, **extra_fields): email = self.normaliz...
import os import pytest from ecl.util.test import TestAreaContext from tests import ResTest from res.test import ErtTestContext from res.enkf import EnkfFs from res.enkf import EnKFMain from res.enkf.enums import EnKFFSType @pytest.mark.equinor_test class EnKFFSTest(ResTest): def setUp(self): self.mount_poi...
job = { 'id': '123', 'job_id': '13', 'time': 1424915923, 'desc': { 'global_desc': { # these three itemes are useless for action, but only for desc 'department': 'ad', 'server_type': 'web_server', 'software_module': 'zsh'...
"""Installation script for all1input.""" from setuptools import setup, find_packages setup( name='all1input', version='1.0alpha', description='software kvm', author='nihlaeth', author_email='info@nihlaeth.nl', python_requires='>=3.5', packages=find_packages(), package_data={'': ['*.crt',...
from django.contrib import admin from .models import * class ScheduleAdmin(admin.ModelAdmin): list_display = ( 'group_id', 'week', 'day', 'numb', 'name', 'room', 'teacher') search_fields = ['group_id', 'teacher'] list_filter = ['group_id'] class GroupsAdmin(admin.ModelAdmin): search_fields = ['g...
from openstates.utils import LXMLMixin from datetime import timedelta import datetime as dt import lxml.etree import pytz import re from billy.scrape.events import EventScraper, Event event_page = "http://app.leg.wa.gov/mobile/MeetingSchedules/Committees?AgencyId=%s&StartDate=%s&EndDate=%s&ScheduleType=2" class WAEvent...
""" This file is part of Giswater 3 The 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. """ __author__ = 'Luigi Pirelli' __date__ = '...
desc="""Report orthologs in means of best reciprocal hits (BRH) between two proteomes. TBD: - 2x faster if subprocess implemented """ epilog="""Author: l.p.pryszcz+git@gmail.com Bratislava, 11/04/2016 """ import os, sys from datetime import datetime import numpy as np def psl2best(handle, overlap): """Report best m...
from five import grok from Products.CMFCore.utils import getToolByName from eea.facetednavigation.browser.app.view import FacetedContainerView from plone.registry.interfaces import IRegistry from zope.component import getMultiAdapter from zope.component import queryUtility from genweb.serveistic.interfaces import IGenw...
import re from operator import add, sub, mul, truediv from array_stack import ArrayStack, EmptyStackError def calculate(tokens): end = {')':'(', ']':'[', '}':'{'} operate = {'+': add, '-': sub, '*': mul, '/': truediv} stack = ArrayStack() #print(stack._data) for t in tokens: try: ...
import mppy.force as force def lamp_2d(data_matrix, sample_indices=None, sample_proj=None, tol=1e-4, proportion=1): import numpy as np import time instances, dim = data_matrix.shape matrix_2d = np.random.random((instances, 2)) start_time = time.time() if sample_indices is None: sample_in...
""" Created on Sat Mar 18 12:54:46 2017 @author: chosenone """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import nltk import re import numpy as np import os import random CORPUS_PATH = 'corpus/' batch_size = 1 documents = [] filenames = os.listdir(CORPUS...
from django.test import TestCase, override_settings from django.urls import reverse from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from wagtail.core.models import Page, Site as WagtailSite from wagtail.tests.utils import WagtailTe...
"""TurboGears project related information""" version = "2.1" description = "Next generation TurboGears built on Pylons" long_description=""" TurboGears brings together a best of breed python tools to create a flexible, full featured, and easy to use web framework. TurboGears 2 provides and integrated and well tested se...
from __future__ import division, print_function; __metaclass__ = type import time import os import numpy as np import scipy import west from west.propagators import WESTPropagator from west import Segment, WESTSystem from westpa.binning import VoronoiBinMapper from westext.stringmethod import DefaultStringMethod from w...
from __future__ import unicode_literals import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('management', '0009_auto_20170705_1055'), ] operations = [ migrations.AddField( model_name='contact', name='teleri...
import fnmatch import os import sys import re import subprocess import ansible.constants as C from ansible.inventory.ini import InventoryParser from ansible.inventory.script import InventoryScript from ansible.inventory.dir import InventoryDirectory from ansible.inventory.group import Group from ansible.inventory.host ...
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "bowls.settings.production") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
''' Task Coach - Your friendly task manager Copyright (C) 2004-2010 Task Coach developers <developers@taskcoach.org> Copyright (C) 2008 Rob McMullen <rob.mcmullen@gmail.com> Task Coach 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 S...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ["preview"], 'supported_by': 'community'} DOCUMENTATION = ''' --- module: gcp_compute_global_address description: - Represents a Global Address resource. Global addresses are us...
"""Django models definition for App systems. Author: Melanie Desaive, desaive@gmx.de Copyrigh (c) 2016, Melanie Desaive All rights reserved. Licensed under the GNU General Public License. See: COPYING.txt in project root. This program is free software: you can redistribute it and/or modify it under the terms of the GNU...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('parliament', '0019_person_bio'), ] operations = [ migrations.RemoveField( model_name='constituency', name='country', ), ]
import corr,time,struct,sys,logging,pylab,matplotlib import mad_conf_parse import os import numpy as n config_file='.' fpga = [] roach='feng' katcp_port=7147 def get_complex_fp(coeff, bitwidth, bp, signed=True): if signed: clipbits = bitwidth-1 else: clipbits = bitwidth real = n.clip(n.round...
""" Quadratic Programming """ import numpy as np import cvxpy as cvx def TRQP(g, H, T, delta, A=None, b=None, Aeq=None, beq=None): """ Trust Region Quadratic Program min g'x + 0.5 x'Hx subject to ||Tx|| < delta Optionally Ax <= b and/or Aeq x == b """ n = len(g) x = cvx.Variable(n) J = g*x ...
from __future__ import (absolute_import, division, print_function) import sys from functools import partial from qtpy import QtGui from qtpy.QtCore import QVariant, Qt, Signal, Slot from qtpy.QtGui import QKeySequence from qtpy.QtWidgets import (QAction, QHeaderView, QItemEditorFactory, QMenu, QMessageBox, ...
def main(): dic1 = {1:10, 2:20} dic2 = {3:30, 4:40} dic3 = {5:50, 6:60} dic1.update(dic2) dic1.update(dic3) print dic1 main()
from trytond.model import ModelSQL, Workflow, fields __all__ = [ 'WorkflowedModel', ] class WorkflowedModel(Workflow, ModelSQL): 'Workflowed Model' __name__ = 'test.workflowed' state = fields.Selection([ ('start', 'Start'), ('running', 'Running'), ('end', 'End'), ...
import sys import os import numpy as np sys.path.append(os.path.join(os.getcwd(), "..")) from run_utils import run_kmc, parse_input from ParameterJuggler import ParameterSet def main(): controller, path, app, cfg, n_procs = parse_input(sys.argv) F0s = ParameterSet(cfg, "F0\s*=\s*(.*)\;") F0s.initialize_set(...
import logging import gtk, sys, pango logger = logging.getLogger(__name__) def label(text=None, textmn=None, markup=None, x=0, y=0.5, \ wrap=False, select=False, w=-1, h=-1): # Defaults to left-aligned, vertically centered tmplabel = gtk.Label() if text: tmplabel.set_text(text) elif ma...
""" @file ProgressBar.py @author Sascha Krieg @author Daniel Krajzewicz @author Michael Behrisch @date 2008-06-19 A simple progress bar for the console SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ Copyright (C) 2008-2013 DLR (http://www.dlr.de/) and contributors All rights reserved """ ...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('investments', '0010_data_from_oto_to_abs'), ] operations = [ migrations.RemoveField( model_name='oldinvestment', name='basic_data', ...
import dbus bus = dbus.SessionBus() streetlightd = bus.get_object('ch.bbv.streetlightd', '/ch/bbv/streetlightd') streetlightd.timeout(dbus_interface='ch.bbv.timer')
import os, sys, platform def determine_path (): try: root = __file__ if os.path.islink (root): root = os.path.realpath (root) return os.path.dirname (os.path.abspath (root)) except: print "Unable to determinate application path." sys.exit () os.chdir(determine...
""" Downloads lyrics and returns the complexity of the chosen song Decoded binary to string form """ import sys import urllib.request as ur while True: rl = 0 s = str(input("\nPick a song(or type 0 to exit): ")) if s == '0': print("Goodbye!") sys.exit(0) else: s = s.replace(' ','-')+'-lyrics' a = input('Who ...
from os import environ from datetime import datetime import pylast from twisted.internet.threads import deferToThread from twisted.python import log USER = environ.get('TXPLAYA_LASTFM_USER') PASS = environ.get('TXPLAYA_LASTFM_PASS') KEY = environ.get('TXPLAYA_LASTFM_KEY') SECRET = environ.get('TXPLAYA_LASTFM_SECRET') d...
import argparse from nvm import MemoryTool from nvm import Config __author__ = 'andreas.dahlberg90@gmail.com (Andreas Dahlberg)' __version__ = '0.1.0' def handle_get(args): """Get configuration values.""" config = Config.from_eep_file(args.file) for field in args.field: value = getattr(config, field...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('MSG', '0033_bm_policy_weight'), ] operations = [ migrations.CreateModel( name='Student_marks', fields=[ ('id', mo...
from __future__ import print_function import os import time import dbus import shlex import subprocess import tempfile from ipapython.ipa_log_manager import root_logger from ipaplatform.paths import paths from ipaplatform import services DBUS_CM_PATH = '/org/fedorahosted/certmonger' DBUS_CM_IF = 'org.fedorahosted.certm...
from __future__ import (absolute_import, division, print_function) import unittest import os from mantid.simpleapi import * from isis_reflectometry import settings ''' RAII Test helper class. Equivalent to the ScopedFileHelper. If this proves useful. It would be sensible to make it more accessible for other testing cla...
import os import sys argv = sys.argv import gettext from gettext import gettext as _ gettext.textdomain('quickly') from quickly import configurationhandler, templatetools, commands option = 'quickly add help-guide <guide-name>' help_text=_("""adds a help guide to your project. To edit the guide, run: $ quickly edit All...