src
stringlengths
721
1.04M
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ## All rights reserved. ## Contact: Nokia Corporation (qt-info@nokia.com) ## ## This file is part of the test suite of the Qt Toolkit. ## ## $QT_BEG...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'h:\projects\jukebox-core\src\jukeboxcore\gui\widgets\guerilla\prjadder.ui' # # Created: Tue Jan 13 18:54:57 2015 # by: pyside-uic 0.2.15 running on PySide 1.2.2 # # WARNING! All changes made in this file will be lost! from PySide impor...
# A module for embedding Veusz within another python program # Copyright (C) 2005 Jeremy S. Sanders # Email: Jeremy Sanders <jeremy@jeremysanders.net> # # 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 Fre...
# encoding:utf-8 ''' ———————————————————————————————— back_to_yesterday.py 对备份文件的回档,所谓‘回到昨天’功能。 实现原理:删除源文件。解压备份的zip,自动覆盖。 ———————————————————————————————— ''' import os import zipfile import shutil import time def back_to_yesterday(): where_script = os.path.split(os.path.realpath(__file__))[0] # print(where_...
import numpy as np from .. import util from ..constants import log def fill_orthographic(dense): shape = dense.shape indices = np.stack( np.meshgrid(*(np.arange(s) for s in shape), indexing='ij'), axis=-1) empty = np.logical_not(dense) def fill_axis(axis): base_local_indices ...
# -*- coding: utf-8 -*- ############################################################################## # # Odoo Addon, Open Source Management Solution # Copyright (C) 2014-now Equitania Software GmbH(<http://www.equitania.de>). # # This program is free software: you can redistribute it and/or modify # it un...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import tensorflow as tf import numpy as np from dnn import matmul_3d_2d from dnn import l2_reg class DMNAttentionGate: """ Possible enhancements 1. make scope as an input param 2. get shape f...
from django.db.backends.creation import BaseDatabaseCreation from django.db.backends.util import truncate_name class DatabaseCreation(BaseDatabaseCreation): data_types = { 'AutoField': 'int identity(1,1)', 'BinaryField': 'binary', 'BooleanField': 'bit', 'CharFiel...
#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #---------------------------------------------------------------...
"""Recipe for setting up RabbitMQ.""" import logging import os import pkg_resources import shutil import subprocess import sys import tempfile import urllib import zc.recipe.egg logger = logging.getLogger(__name__) class Recipe(zc.recipe.egg.Eggs): """Buildout recipe for installing RabbitMQ.""" def __init_...
# ##### BEGIN GPL LICENSE BLOCK ##### # # JewelCraft jewelry design toolkit for Blender. # Copyright (C) 2015-2019 Mikhail Rachinskiy # # 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, eith...
# -*- coding: utf-8 -*- # # PyQt documentation build configuration file, created by # sphinx-quickstart on Sat May 30 14:28:55 2009. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All co...
# -*- coding: utf-8 -*- ############################ Copyrights and license ############################ # # # Copyright 2012 Steve English <steve.english@navetas.com> # # Copyright 2012 Vincent Jacques <vincent@vincent-ja...
# coding: utf-8 import os import numpy as np import matplotlib.pyplot as plt from scipy.misc import toimage import pandas as pd import time #from sklearn.model_selection import KFold #from sklearn.model_selection import train_test_split from keras.datasets import cifar10 from keras.models import Sequential from keras...
""" This script submits a test prodJobuction with filter """ import time import os import json from DIRAC.Core.Base import Script Script.setUsageMessage( '\n'.join( [ __doc__.split( '\n' )[1], 'Usage:', ' %s test directory' % Script.scriptName...
"""Test praw.models.redditors.""" import mock from praw.models import Redditor, Subreddit from .. import IntegrationTest class TestRedditors(IntegrationTest): def test_new(self): with self.recorder.use_cassette("TestRedditors.test_new"): profiles = list(self.reddit.redditors.new(limit=300)) ...
from datetime import datetime, timedelta from sqlalchemy import select import py from debit_orders import DebitOrderError, add_two_days, list_pending_transactions, _tstamp from authsys_common.model import meta, pending_transactions, members from authsys_common.scripts import create_db def populate_test_data(): e...
""" Copyright (C) 2016 Quinn D Granfor <spootdev@gmail.com> 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 ...
# Copyright (c) 2019, MD2K Center of Excellence # - Nasir Ali <nasir.ali08@gmail.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above cop...
"""An implementation of mbleven algorithm""" # # Constants REPLACE = 'r' INSERT = 'i' DELETE = 'd' TRANSPOSE = 't' MATRIX = [ ['id', 'di', 'rr'], ['dr', 'rd'], ['dd'] ] MATRIX_T = [ ['id', 'di', 'rr', 'tt', 'tr', 'rt'], ['dr', 'rd', 'dt', 'td'], ['dd'] ] # # Library API def compare(str1, s...
import sqlite3 import json import time import logging import re import os import gevent from DbCursor import DbCursor opened_dbs = [] # Close idle databases to save some memory def dbCleanup(): while 1: time.sleep(60 * 5) for db in opened_dbs[:]: if time.time() - db.last_query_time >...
import tkinter as tk import tkinter.font as tkFont import tkinter.ttk as ttk import tkinter.messagebox as tkMessageBox import pymysql.cursors ## Model Class ############################################################### class Model: """ Right now the only options for variables in the url are: {domain} ...
#!/usr/bin/env python3.4 # # Copyright 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
# -*- coding: utf-8 -*- # Copyright (c) 2007 - 2014 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing the Python debugger interface for the debug server. """ from __future__ import unicode_literals import sys import os import re from PyQt5.QtCore import QObject, QTextCodec, QProcess, QProcessEn...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('app', '0003_create_model_productionform'), ] operations = [ migrations.CreateModel( name='ConnectionSource', ...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import json import frappe.utils from frappe.utils import cstr, flt, getdate, comma_and, cint from frappe import _ from frappe.model.mapper...
#!/usr/bin/env python # Copyright 2015-2016 Yelp Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
# Copyright (C) 2017 Greenweaves Software Pty Ltd # This 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. # This software is distribut...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 1.0.2.7202 on 2016-06-23. # 2016, SMART Health IT. import io import json import os import unittest from . import familymemberhistory from .fhirdate import FHIRDate class FamilyMemberHistoryTests(unittest.TestCase): def instantiate_from(sel...
import datetime from flask_login import UserMixin, AnonymousUserMixin from flask import current_app, request, url_for from hashlib import md5 from werkzeug.security import generate_password_hash, check_password_hash from markdown import markdown import bleach from itsdangerous import TimedJSONWebSignatureSerializer as ...
# Copyright (C) 2013, IBM Corporation # Copyright (C) 2013-2014, Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later ...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from tests import IntegrationTestCase from tests.holodeck import Request from twilio.base.exceptions import TwilioException from twilio.http.response import Response class SyncListPermissionTestCas...
"""Classes to handle SAXS (Small Angle X-ray Scattering) data""" import _modeller from modeller.util.modobject import modobject from modeller.util import modlist, array __docformat__ = "epytext en" class SAXSList(modlist.LinkList): """A list of L{saxsdata} objects""" def __init__(self, edat): self.__...
#!/usr/bin/env python # # Copyright (C) 2011 Evite LLC # This library 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 # version 2.1 of the License, or (at your option) any later version. # This...
# This file is part of MyPaint. # Copyright (C) 2017 by the MyPaint Development Team. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any...
#!/usr/bin/env python3 from distutils.core import setup setup( name='libfnl', version='0.0.1', license='GNU Affero GPL v3', author='Florian Leitner', author_email='florian.leitner@gmail.com', url='https://github.com/fnl/libfnl', description='command-line tools for text mining', long_des...
import datetime class AircraftManufacturerCode(object): def __init__(self, record): self.code = record[:7].strip() self.manufacturer = record[8:38].strip() self.model = record[39:59].strip() self.aircraft_type = record[60].strip() self.engine_type = record[62].strip() ...
# -*- coding: utf-8 -*- from django.shortcuts import render, get_object_or_404 from .models import Servicios from .forms import ServiciosForm import json from django.http import HttpResponse def _queryset_filtrado(request): params = {} if 'tipos_servicios' in request.session: params['tipos_servicios'] ...
# coding: utf-8 # # Copyright © 2012-2014 Ejwa Software. All rights reserved. # # This file is part of gitinspector. # # gitinspector 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 Lic...
import threading from igra import * from minimax import * import time class Racunalnik(): def __init__(self, gui, algoritem): self.gui = gui self.algoritem = algoritem #izbran algoritem, minimax ali alphabeta self.mislec = None #vlakno za razmisljanje self.je_treba_prekiniti = False...
import logging, unittest logger=logging.getLogger('app') from utils.testcases import TestCase import server_8000, json from api.auth import Authen class TestAuthen(unittest.TestCase): ''' Test Authen class ''' def test_generate_auth_token(self): uid = '56840a2db37b6c16a0ef1b6a' s...
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2015-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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...
""" Test the publish code (mostly testing that publishing doesn't result in orphans) """ from xmodule.modulestore.exceptions import ItemNotFoundError from xmodule.modulestore.tests.test_split_w_old_mongo import SplitWMongoCourseBoostrapper from xmodule.modulestore.tests.factories import check_mongo_calls from xmodule.m...
# -*- coding: utf-8 -*- # Copyright 2017 Stein & Gabelgaard ApS # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import api, fields, models, _ class CamposJobberAccomGroup(models.Model): _name = 'campos.jobber.accom.group' _description = 'Campos Jobber Accom Group' # TODO n...
from huegely import ( exceptions, utils ) class FeatureBase(object): """ Base interface for all features, mostly concerned with device state. """ transition_time = None _reset_brightness_to = None def __init__(self, bridge, device_id, name=None, transition_time=None): if not (hasattr(...
# 3p from nose.plugins.attrib import attr # project from checks import AgentCheck from tests.checks.common import AgentCheckTest # sample from /status?json # { # "accepted conn": 350, # "active processes": 1, # "idle processes": 2, # "listen queue": 0, # "listen queue len": 0, # "max active p...
# Topydo - A todo.txt client written in Python. # Copyright (C) 2014 - 2015 Bram Schoenmakers <bram@topydo.org> # # 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,...
from json import JSONEncoder class User(object): def __init__(self, name): self.name = name self.sessions = {} self.queries = [] class VerboseUserEncoder(JSONEncoder): def encode(self, obj): user_dict = {} user_dict['name'] = obj.name session_dict = {} ...
from coco.contract.errors import AuthenticationError, ConnectionError, \ UserNotFoundError from coco.core.helpers import get_internal_ldap_connected, get_user_backend_connected from coco.core.models import BackendGroup, BackendUser, \ CollaborationGroup from django.contrib.auth.models import User from django.co...
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# -*- coding: utf-8 -*- """Click commands.""" import os from glob import glob from subprocess import call import click from flask import current_app from flask.cli import with_appcontext from werkzeug.exceptions import MethodNotAllowed, NotFound HERE = os.path.abspath(os.path.dirname(__file__)) PROJECT_ROOT = os.path...
# see also: http://github.com/tav/scripts/raw/master/validate_jsonp.py # Placed into the Public Domain by tav <tav@espians.com> """Validate Javascript Identifiers for use as JSON-P callback parameters.""" import re from unicodedata import category # -----------------------------------------------------------------...
# Copyright 2014-2017 Canonical Limited. # # This file is part of charms.reactive # # charms.reactive is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 as # published by the Free Software Foundation. # # charms.reactive is distributed in the ...
#-*- coding:utf-8 -*- from models import DBSystemInfo as DB import psutil class Control_System(object): def __init__(self, request): self.request = request def __del__(self): pass def update(self): if self.request.method == 'POST': try: _net_if...
"""Module containing the implementation of the URIMixin class.""" import warnings from . import exceptions as exc from . import misc from . import normalizers from . import validators class URIMixin(object): """Mixin with all shared methods for URIs and IRIs.""" __hash__ = tuple.__hash__ def authority_...
# Copyright 2017 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. from recipe_engine import recipe_api from recipe_engine.internal.global_shutdown import GLOBAL_SHUTDOWN class RuntimeApi(recipe_api.RecipeApi):...
import warnings try: from django.urls import reverse, reverse_lazy except ImportError: from django.core.urlresolvers import reverse, reverse_lazy # NOQA class RemovedInDjango20Warning(DeprecationWarning): pass class CallableBool: # pragma: no cover """ An boolean-like object that is also call...
"""Install dependencies for the project. .. code:: bash fdep install [<files...>] """ from __future__ import print_function import os import sys import time from threading import Thread from fdep.backends import StorageBackend from fdep.commands import ConfigRequiredMixin, SubcommandRunner from fdep.interfaces.p...
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import os i...
# -*- coding: utf-8 -*- import pickle import os # third-party imports import jsonpickle class Submission: def __init__(self): # Source is either Tumblr or Reddit self.source = u'' self.title = u'' self.author = u'' self.subreddit = u'' self.subredditTitle = u'' ...
#!/usr/bin/env python import sys from PyQt4.QtGui import * from PyQt4.QtCore import * from structdata import g_project from structdata import Area from structdata import Event from utils import g_ptransform import os from arearesize import AreaResize class EditorButton(QToolButton): """ classe base per i...
from django.shortcuts import render from django.views.generic import TemplateView, ListView, DetailView from django.views.generic.edit import CreateView, UpdateView, DeleteView, FormView from django.views.generic.dates import WeekArchiveView from django.urls import reverse_lazy, reverse from django.contrib.auth.mixins ...
# Copyright (C) 2015-2021 by the RBniCS authors # # This file is part of RBniCS. # # SPDX-License-Identifier: LGPL-3.0-or-later import inspect from rbnics.eim.backends import OfflineOnlineBackend from rbnics.eim.utils.decorators import (DefineSymbolicParameters, StoreMapFromParametrizedOperatorsToProblem, ...
# -*- coding: utf-8 -*- """ The module provides: * functions used when evaluating signature's features * regexp's constants used when evaluating signature's features """ from __future__ import absolute_import import unicodedata import regex as re from talon.utils import to_unicode from talon.signature.constants im...
from django.core.urlresolvers import reverse from copy import copy class Icon(): """ Represents a Bootstrap icon (<i>) tag. """ def __init__(self, icon, *css): self.icon = icon self.css = css def render(self, extra_css=[]): html = '<i class="%s' % self.icon if ...
import logging import os import pickle from collections import namedtuple import gym import numpy as np from catastrophe_wrapper import * from catastrophe_wrapper import CatastropheWrapper from classifier_tf import (SavedCatastropheBlockerTensorflow, SavedCatastropheClassifierTensorflow) l...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Moodle Development Kit Copyright (c) 2013 Frédéric Massart - FMCorz.net 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 Lic...
# coding=utf-8 # Author: CristianBB # # URL: https://sickrage.github.io # # This file is part of SickRage. # # SickRage 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...
#!/usr/bin/env python # -*- coding: utf-8 -*- from bottle import Bottle, request, static_file, abort import re import time import os import subprocess from io import BytesIO try: import PIL.Image as Image except: from PIL import Image from jobs import lock import adb app = Bottle() @app.get("/") def device...
import os from application import * from application.default_settings import _basedir os.environ['PYTHONINSPECT'] = 'True' # Create database directory if not exists. create_db_dir = _basedir + '/db' if not os.path.exists(create_db_dir): os.mkdir(create_db_dir, mode=0o755) def init_db(): app = create_app() ...
"""Utility methods for paramagnetic observables """ import math from numpy import * def ZXZRot(A, B, G, scal=1.0): """ Builds the ZXZ rotation matrix given 3 Euler Angles. See: http://mathworld.wolfram.com/EulerAngles.html @param A : The (A)lpha angle @type A : float @param B :...
# $Id: __init__.py 6269 2010-03-18 22:27:53Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Simple HyperText Markup Language document tree Writer. The output conforms to the XHTML version 1.0 Transitional DTD (*almost* strict). The output conta...
# coding: utf-8 # In[1]: import pandas as pd import numpy as np import nltk from nltk.corpus import stopwords from nltk.stem import SnowballStemmer import re from sklearn.metrics import accuracy_score import matplotlib.pyplot as plt # In[2]: train = pd.read_csv("../input/train.csv") test = pd.read_csv("../input/te...
# -*- coding: utf-8 -*- """ Main plugin file. """ from __future__ import absolute_import import configparser import requests import webbrowser from builtins import object import os.path import json from qgis.PyQt.QtCore import QSettings, QTranslator, qVersion, QCoreApplication from qgis.PyQt.QtWidgets import QAction...
import discord import sqlite3 as sql import logging import cleverbot import random logging.basicConfig(level=logging.INFO) import urllib3.contrib.pyopenssl urllib3.contrib.pyopenssl.inject_into_urllib3() from apiclient.discovery import build import apiclient.errors # Please refer to the README to find where you should ...
"""Has presets for common items Attributes: random_card (dict): Random card item exp_1 (dict): Exp pill lv 1 exp_2 (dict): Exp pill lv 2 exp_3 (dict): Exp pill lv 3 exp_4 (dict): Exp pill lv 4 """ import Items import Inventory from Util import image_path_main exp_1 = { "item_img": image_path_...
# -*- coding: utf-8 -*- from django.conf import settings from django.core.urlresolvers import resolve, Resolver404 from django.http import Http404 from django.template import RequestContext from django.template.response import TemplateResponse from cms import __version__ from cms.cache.page import set_page_cache from ...
global cur_temperature global low_temperature global high_temperature global todayforecast cur_temperature=0 low_temperature=0 high_temperature=0 todayforecast=0 def Meteo(Town_Parameter): try: if Town_Parameter=="0": Town_Parameter=Town print "http://api.openweathermap.org/data/2.5/weather?q=" + Town_Paramete...
import grp import logging import os import pwd import re import subprocess import stat import shutil from datetime import datetime from ajenti.api import * from ajenti.util import str_fsize from ajenti.plugins import manager from ajenti.plugins.tasks.manager import TaskManager from ajenti.plugins.tasks.tasks import Co...
#!/usr/bin/python # -*- encoding: utf-8 -*- ############################################################################### # Module Writen to OpenERP, Open Source Management Solution # Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>). # All Rights Reserved ############# Credits ######################...
#!/usr/bin/env python # -*- coding:utf-8 -*- # This file is part of the lily-fonts project # https://github.com/openlilylib/lily-fonts # # Copyright (c) 2015 by Urs Liska (ul@openlilylib.org) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
import sys from struct import pack, unpack from time import sleep class KHC(object): NAME = 'KHC' cmd_inc_engine = b'\xae\xae\x01\x00\x01\x08\x00' # увеличить обороты и подтвердить результат cmd_dec_engine = b'\xae\xae\x01\x00\x02\x08\x00' # уменьшить обороты и подтвердить результат cmd_stop_engine = b'\x...
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: diplomacy_tensorflow/contrib/boosted_trees/proto/split_info.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _mess...
# -*- coding: utf-8 -*- # # Copyright 2008-2010 Brett Adams # Copyright 2014-2017 Mario Frasca <mario@anche.no>. # Copyright 2016 Ross Demuth <rossdemuth123@gmail.com> # # This file is part of ghini.desktop. # # ghini.desktop is free software: you can redistribute it and/or modify # it under the terms of the GNU Genera...
#Plotting nickname-change graph is also implemented in this code. import os.path import re import networkx as nx import numpy as np import matplotlib.pyplot as plt import pylab import pygraphviz as pygraphviz import numpy import datetime import time import pandas as pd #added some new libraries rem_time= None #this va...
# pylint: disable=import-error # pylint: disable=invalid-name # pylint: disable=missing-docstring # pylint: disable=wrong-import-position from __future__ import unicode_literals import os import sys import unittest import potr sys.path.append(os.path.join(os.path.dirname(__file__), 'helpers')) from potr_test_helper...
from __future__ import unicode_literals import frappe from frappe.utils.file_manager import save_file import os, base64, re import random import json @frappe.whitelist() def add_node(): ctype = frappe.form_dict.get('ctype') parent_field = 'parent_' + ctype.lower().replace(' ', '_') name_field = ctype.lower().replac...
title = 'Pmw.ButtonBox demonstration' # Import Pmw from this directory tree. import sys sys.path[:0] = ['../../..'] import Tkinter import Pmw class Demo: def __init__(self, parent): # Create and pack the ButtonBox. self.buttonBox = Pmw.ButtonBox(parent, labelpos = 'nw', label_text = 'ButtonBo...
import os import re import shutil import subprocess import sys BASE_DIR = os.path.expanduser('~/.antelope/zen/panel') if not os.path.exists(BASE_DIR): os.makedirs(BASE_DIR) def get_panel_dir(ver, create=True): stripped = ver.strip() if re.match(r'\d+(\.\d+)*', stripped) is not None: d = os.path....
from __future__ import with_statement from cms.api import create_page from cms.toolbar.toolbar import CMSToolbar from cms.middleware.toolbar import ToolbarMiddleware from cms.test_utils.testcases import SettingsOverrideTestCase from cms.test_utils.util.context_managers import SettingsOverride from django.contrib.auth....
from database_config import * from datetime import datetime from py2neo import neo4j, node # Class : Task # Methods: # 1) db_init(self) - Private # 2) getNode(self) - Returns the Task Node # 3) getName(self) - Returns name of task # 4) setDescription(self, description) - Takes descrip...
''' Fields that are used in our UI #.. todo: Make a field specifically for lists ''' from pubs.ui import * import pubs.ui.models as models import pubs.pGraph as pGraph import pubs.pNode as pNode class BaseField(QtWidgets.QWidget): def __init__(self, label, value = None, description = str(), parent = None, attribu...
from __future__ import print_function import json import os import numpy as np import sys import h5py from gensim.models import Word2Vec from gensim.utils import simple_preprocess from keras.engine import Input from keras.layers import Embedding, merge from keras.models import Model from keras.models import Sequential ...
# distrowin.py # script to generate SuperCollider WIX (windows installer xml) source file from template # Copyright (c) 2008 Dan Stowell. All rights reserved. # # 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 F...
from datetime import datetime as dt, timedelta import bson import numpy as np from mock import patch from arctic._util import mongo_count from arctic.arctic import Arctic def test_save_read_bson(library): blob = {'foo': dt(2015, 1, 1), 'bar': ['a', 'b', ['x', 'y', 'z']]} library.write('BLOB', blob) save...
# -*- coding: utf-8 -*- # [HARPIA PROJECT] # # # S2i - Intelligent Industrial Systems # DAS - Automation and Systems Department # UFSC - Federal University of Santa Catarina # Copyright: 2006 - 2007 Luis Carlos Dill Junges (lcdjunges@yahoo.com.br), Clovis Peruchi Scotti (scotti@ieee.org), # Guilh...
""" Django settings for ut_arena_py_api project. Generated by 'django-admin startproject' using Django 1.9.2. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ impo...
#!/usr/bin/env python import os import sys import json import urllib2 import shlex import subprocess class Plz(object): def __init__(self, arg): self.host = 'http://slackware.cs.utah.edu/pub' self.api = 'http://slackware-packages.herokuapp.com/packages' self.target_dir = '/boot/extra' self.arg ...
#!/usr/bin/env python import argparse, itertools, operator, os, os.path, string import nltk.data from nltk.corpus import stopwords from nltk.misc import babelfish from nltk.tokenize import wordpunct_tokenize from nltk.util import ngrams from nltk_trainer import load_corpus_reader, join_words, translate from nltk_traine...
# Copyright (c) Siemens AG, 2014 # # This file is part of MANTIS. MANTIS is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation; either version 2 # of the License, or(at your option) any later version. # # This progr...