text
stringlengths
17
737k
# coding=utf-8 from __future__ import absolute_import, division, print_function, \ unicode_literals from typing import List, Optional import filters as f from iota import Address, Bundle, ProposedTransaction from iota.commands import FilterCommand, RequestFilter from iota.commands.extended.prepare_transfer import P...
# Copyright (c) 2010-2012, GEM Foundation. # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # OpenQuake is distri...
"""Classes that communicate the results.""" import curses import threading import formatter import executor import functools from i18n import translate as _ # TODO: thread mutex # TODO: cmdline_args, input, tempfile in begin_test # TODO: help page # TODO: summary page # TODO: test info page # TODO: i18n _CALLBACKS...
# Highly Optimized Object-Oriented Molecular Dynamics (HOOMD) Open # Source Software License # Copyright (c) 2008 Ames Laboratory Iowa State University # All rights reserved. # Redistribution and use of HOOMD, in source and binary forms, with or # without modification, are permitted, provided that the following # cond...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010-2013, GEM Foundation. # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the Lice...
""" Django settings for ed_reviews project. Generated by 'django-admin startproject' using Django 1.9.4. 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/ """ import os...
""" Module for reading out CO2Meter USB devices via a hidraw device under Linux """ import sys import fcntl import threading import weakref CO2METER_CO2 = 0x50 CO2METER_TEMP = 0x42 CO2METER_HUM = 0x41 HIDIOCSFEATURE_9 = 0xC0094806 def _co2_worker(weak_self): """ Worker thread that constantly reads from the u...
r""" Metadata template objects (:mod: `qiita_db.metadata_template) ============================================================= ..currentmodule:: qiita_db.metadata_template This module provides the MetadataTemplate base class and the subclasses SampleTemplate and PrepTemplate. Classes ------- ..autosummary:: :...
# Import smorgasbord from __future__ import print_function import pdb import sys import os import copy import dill import re import gc import warnings warnings.filterwarnings('ignore') from difflib import SequenceMatcher import multiprocessing as mp import numpy as np import scipy.stats import scipy.interpolate import ...
# -*- coding: utf-8 -*- # # Python documentation build configuration file # # This file is execfile()d with the current directory set to its containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleable (module imports are okay, they're removed automatically). ...
# Name: GoldFact (/u/GoldFact) # Author: Saroekin (/u/Saroekin) # Version: Python 3.4.3 #Files or importations that are used elsewhere in program. import os import praw import time import sqlite3 from random import randint from random import choice print ("\n\nOpening database...") #SQL database setup/ignition. sql ...
import asyncio import wave import functools import io import numpy import psutil, os import time import scipy.signal as signal from multiprocessing import Value from threading import Thread import pygame import alsaaudio import threading from pydub import AudioSegment import common def audio_loop(wav_data, ratio, sto...
""" picture.py Author: <your name here> Credit: <list sources used, if any> Assignment: Use the ggame library to "paint" a graphical picture of something (e.g. a house, a face or landscape). Use at least: 1. Three different Color objects. 2. Ten different Sprite objects. 3. One (or more) RectangleAsset objects. 4. O...
# # Created as part of the StratusLab project (http://stratuslab.eu), # co-funded by the European Commission under the Grant Agreement # INFSO-RI-261552." # # Copyright (c) 2010, SixSq Sarl # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
""" A set of wrappers that return the JSON bodies you use to interact with the formplayer backend for various sets of tasks. This API is currently highly beta and could use some hardening. """ import json import socket from django.conf import settings from django.http import Http404 import requests from requests imp...
import os.path as op from nose.tools import assert_true import numpy as np from numpy.testing import assert_array_almost_equal, assert_array_equal from mne.fiff import Raw, pick_types from mne import compute_proj_epochs, compute_proj_evoked, compute_proj_raw from mne.fiff.proj import make_projector, activate_proj fro...
import json from flask import Flask, jsonify, request app = Flask(__name__) VERB_TOKENS = frozenset(['am', 'eat']) ADJ_TOKENS = frozenset(['funny', 'yellow']) @app.route('/') def hello(): return jsonify({'yo': 'face'}) @app.route('/annotation/', methods=['POST']) def annotation(): """ Takes in an object re...
from __future__ import absolute_import from __future__ import unicode_literals import six from dimagi.ext import jsonobject from django.conf import settings from copy import copy, deepcopy from datetime import datetime from elasticsearch import TransportError from pillowtop import get_all_pillow_classes from pillowtop...
from __future__ import unicode_literals from datetime import datetime from django.core.management import call_command from django.core.management.base import BaseCommand from django.utils.text import slugify from gzip import GzipFile from tempfile import NamedTemporaryFile from optparse import make_option from remote...
#!/usr/bin/env python ''' This module contains printer/plotter functions for the EV3 components. I/O ports: - A: Large motor, plotter rail - B: Medium motor, plotter head - D: Large motor, roller - 1: Touch sensor, plotter rail reset sensor - 2: Color sensor, paper feed detector - /dev/video0: USB webcam ''' import ...
# -*- encoding: utf-8 -*- from openerp.osv import fields, osv import time from datetime import datetime, date from dateutil.relativedelta import relativedelta from openerp.tools.translate import _ import calendar import openerp.addons.decimal_precision as dp import psycopg2 from openerp.addons.analytic_structure.MetaA...
# MIT License # # Copyright (c) 2017 Jonatan Almén, Alexander Håkansson, Jesper Jaxing, Gmal # Tchaefa, Maxim Goretskyy, Axel Olivecrona # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software with...
import os import sublime from sublime_plugin import WindowCommand, TextCommand from sublime_plugin import EventListener from ..git_command import GitCommand from ...common import util from ...core.settings import SettingsMixin COMMIT_HELP_TEXT_EXTRA = """## ## You may also reference or close a GitHub issue with thi...
#!/usr/bin/python2.5 # # Copyright 2009 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 law or ...
# coding: utf-8 """Custom views.""" import re import time from itertools import chain from django.shortcuts import render from django.utils.translation import ugettext as _ from django.contrib.auth.decorators import ( login_required, user_passes_test, permission_required ) from modoboa.admin.models import Doma...
#!usr/bin/env python # -*- coding: utf-8 -*- """ Authors: Sebastian Burgstaller (sebastian.burgstaller' at 'gmail.com Andra Waagmeester (andra' at ' micelio.be) This file is part of ProteinBoxBot. ProteinBoxBot is free software: you can redistribute it and/or modify it under the terms of the GNU General Public ...
################################################################################ # # MRC FGU Computational Genomics Group # # $Id$ # # Copyright (C) 2009 Andreas Heger # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as publish...
#!/usr/bin/env python2.5 # # Copyright 2011 the Melange authors. # # 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 applic...
#!/usr/bin/env python """ Unofficial Python API for ThePirateBay. Currently supports searching, recent torrents and top 100 torrents. @author Karan Goel @email karan@goel.im Copyright (C) 2013 Karan Goel This program is free software: you can redistribute it and/or modify it under the terms of the GN...
# -*- coding: utf-8 -*- from __future__ import print_function import itertools import os import errno import locale import numpy as np import sys from datetime import date, datetime, timedelta from fnmatch import fnmatch from pkgutil import get_data from threading import Lock from time import time import certifi from...
''' Jennifer's cheatsheet for Python basic syntax and handy tips. - Variables and basic operations - Strings - Console input - Lists - Tuples - Control flow - Functions - Dictionaries - Modules, namespaces and scripts - Text file I/O - Handy modules - date and time, random numbers - Sorting - IPython features - Editor ...
from dynqt import QtCore, QtGui, QtOpenGL import numpy, os, sys import pdftoppm_renderer, slide __version__ = "0.1" w, h = 1024, 768 OVERVIEW_COLS = 5 MARGIN_X = 30 MARGIN_Y = 24 BLEND_DURATION = 150 USE_GL = True # False USE_CACHING = True # False if USE_GL: try: from OpenGL import GL except Impor...
from __future__ import division import numpy as np import scipy.stats as stats from numpy import newaxis as na np.seterr(invalid='raise') import operator from ..basic.distributions import DirGamma from ..util.general import rle ########## # misc # ########## # TODO scaling by self.state_dim in concresampling is th...
''' Created on 2016/11/3 :author: hubo ''' from __future__ import print_function from vlcp.config import manager from vlcp.scripts.script import ScriptModule import vlcp.service.sdn.viperflow as viperflow import vlcp.service.kvdb.objectdb as objectdb from vlcp.server.module import depend, callAPI from vlcp.utils.con...
"""Plotting methods for radar data.""" import numpy import matplotlib matplotlib.use('agg') import matplotlib.pyplot as pyplot import matplotlib.colors from gewittergefahr.gg_utils import grids from gewittergefahr.gg_utils import radar_utils from gewittergefahr.gg_utils import error_checking from gewittergefahr.deep_l...
#!/usr/bin/env python # -*- coding: utf-8 -*- #----------------------------------------------------------------------------------------------------------------------- # INFO: #----------------------------------------------------------------------------------------------------------------------- """ Author: Evan Hubin...
#!/usr/bin/python import time from modules.server import ServerThread import threading import json from modules.location import Location import logging import tornado.websocket import modules.calc import math from modules.calc import direction_to_point import modules.utils import modules.log import socket import sys i...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # [The "New BSD" license] # Copyright (c) 2014 The Board of Trustees of The University of Alabama # All rights reserved. # # See LICENSE for details. from __future__ import print_function import logging logger = logging.getLogger('cfl.main') import sys import os.path i...
"""GStudio implementations of osid objects.""" # pylint: disable=too-many-public-methods,too-few-public-methods # Number of methods are defined in specification # pylint: disable=too-many-ancestors # Inheritance defined in specification import importlib import itertools import uuid from deci...
''' -- Imports from python libraries -- ''' import json import hashlib import magic import subprocess import mimetypes import os # import re import ox import threading from PIL import Image, ImageDraw # install PIL example:pip install PIL from StringIO import StringIO ''' -- imports from installed packages -- ''' fr...
from operator import itemgetter, attrgetter import itertools from nose.tools import assert_true, raises from numpy.testing import assert_array_equal, assert_equal import numpy as np import warnings from . import schema import datajoint as dj class TestFetch: def __init__(self): self.subject = schema.Subje...
from django import forms from django.test import TestCase from .models import JSONNotRequiredModel class JSONModelFormTest(TestCase): def setUp(self): class JSONNotRequiredForm(forms.ModelForm): class Meta: model = JSONNotRequiredModel fields = '__all__' ...
#!/usr/bin/env python # Copyright (c) 2020, Michael Boyle # See LICENSE file for details: <https://github.com/moble/spherical_functions/blob/master/LICENSE> import math import cmath import numpy as np import quaternion import spherical_functions as sf import pytest def test_modes_creation(): for s in range(-2, ...
from disco.test import TestCase, TestPipe from disco.compat import bytes_to_str from disco.worker.pipeline.worker import Stage from disco.worker.task_io import task_input_stream import sys import csv from functools import partial PREFIX='/tmp/' def read(interface, state, label, inp): from disco import util fo...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of sbpipe. # # sbpipe 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 3 of the License, or # (at your option) any later...
from unittest import TestCase from framewirc import exceptions from framewirc.utils import chunk_message, RequiredAttributesMixin, to_bytes, to_unicode class TestToUnicode(TestCase): def test_already_unicode(self): text = 'тнιѕ ιѕ αℓяєα∂у υηι¢σ∂є' result = to_unicode(text) self.assertEqua...
# -*- coding: utf-8; -*- import re from jenkins_autojobs import main def test_filter_jobs(): class Job: def __init__(self, name): self.name = name class jenkins: @staticmethod def view_jobs(x): return { 'v1': [Job('scratch-one'), Job('scratch-...
#!/usr/bin/env python """ Test fitting the velocity dispersion. """ import numpy as np import pylab as plt import logging import dsphsim.instruments import dsphsim.dwarf import dsphsim.vdisp import dsphsim.simulator # More verbose output... logging.getLogger().setLevel(logging.DEBUG) def test_vdisp(): np.rando...
from __future__ import unicode_literals from django.core.urlresolvers import reverse from .helpers import AdminViewPermissionViewsTestCase from .test_app.models import TestModel1 class TestModelAdminViews(AdminViewPermissionViewsTestCase): ## admin index def test_index_view_simple_user(self): self.cl...
""" MakeMKV CLI Wrapper Released under the MIT license Copyright (c) 2012, Jason Millward @category misc @version $Id: 1.4, 2013-04-03 09:41:53 CST $; @author Jason Millward <jason@jcode.me> @license http://opensource.org/licenses/MIT """ import subprocess import imdb import os import re from database i...
#!/usr/bin/env python # -*- coding: utf-8 -*- '''Utilities for spectral processing''' import numpy as np import scipy.fftpack as fft import scipy import scipy.signal import scipy.interpolate import six from . import time_frequency from .. import cache from .. import util from ..util.exceptions import ParameterError ...
## @file REKTUser.py # REKTUser # @author Stephen Longofono # @brief The user class for the recommendation system # @details This file defines the User class which is used to generate and manipulate a user profile from # their Spotify profile import Mutators import traceback import Variance import functools im...
# -*- coding: UTF-8 -*- # Copyright 2009-2016 Luc Saffre # License: BSD (see file COPYING for details) """Defines the model mixins :class:`Sequenced` and :class:`Hierarchical`. A `Sequenced` is something which has a sequence number and thus a sort order which can be manipulated by the user using actions :class:`MoveUp...
# Natural Language Toolkit: Text Trees # # Copyright (C) 2001 University of Pennsylvania # Author: Edward Loper <edloper@gradient.cis.upenn.edu> # URL: <http://nltk.sf.net> # For license information, see LICENSE.TXT # # $Id$ # To do: # - How should we handle traces and/or movement? """ Classes for representing hie...
"""Operations used to convert between S-57 abbreviations and -names, vs. Esri NIS FeatureClass, FCsubtype numbers""" # Ver. 1.0.2 # Last edited 2014-01-14 / MaHvi # History # Ver. 1.0.0 - First working version # Ver. 1.0.1 # Cleaned up the variable naming from FSC to FCS # Introduced a test module # Ver. 1.0.2 #...
import inspect, sys, os, types, time, string _permissionlist = ['admin', 'adminchan', 'mod', 'modchan', 'chanowner', 'chanadmin', 'chanpublic', 'public', 'battlehost', 'battlepublic'] _permissiondocs = { 'admin':'Admin Commands', 'adminchan':'Admin Commands (channel)', 'mod':'Moderator Commands'...
# -*- coding: utf-8 -*- # MusicPlayer, https://github.com/albertz/music-player # Copyright (c) 2012, Albert Zeyer, www.az2000.de # All rights reserved. # This code is under the 2-clause BSD license, see License.txt in the root directory of this project. from utils import UserAttrib, Event, initBy import Traits # Note...
#! /usr/bin/python # -*- coding: cp932 -*- #this Python script is used to parse MPEG-2 TS stream # #Author: Zhaohui Guo (guo.zhaohui@gmail.com) #Copyright(c)2012 Zhaohui GUO """this script is used to parse MPEG-2 TS stream. """ import sys import struct import Tkinter import tkMessageBox import tkFileDialog import sys...
""" Logical Expression Microframework (WIP). """ class PropertyType(type): """ Property type is used to generate Property objets. """ def __getattr__(self, name): return Property(name) def __setattr__(self, name): raise AttributeError('PropertyType is read-only') #FIXME: exception ...
import datetime import json import re import os import time from zashel.winhttp import Requests from functools import partial, wraps from math import floor LOCALPATH = os.path.join(os.environ["LOCALAPPDATA"], "zashel", "gapi") # SCOPES class SCOPE: BLOGGER = "https://www.googleapis.com/auth/blogger" ...
"""Anharmonic modes module for ASE Docs follows Google's python styling guide: http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html Developed by Keld Lundgaard -- keld.lundgaard@gmail.com Supervised by Thomas Bligaard Other contributers: Thomas Nygaard """ from __future__ import division impo...
''' Graph ====== The :class:`Graph` widget is a widget for displaying plots. It supports drawing multiple plot with different colors on the Graph. It also supports a title, ticks, labeled ticks, grids and a log or linear representation on both the x and y axis, independently. To display a plot. First create a graph w...
import base64 import email.utils import os import smtplib import string import time import zlib from Crypto import Random from Crypto.Cipher import Blowfish from Crypto.Hash import SHA from Crypto.Random import random from email.mime.text import MIMEText from flask import Flask, render_template, request, redirect, url_...
import types import xml.etree.cElementTree as ElementTree import numpy as np import Bio.SeqIO import seqtools # import refseq # import sequtils # import alignment # import clustering # import LSF # import params # import analysis # =================== # = DATA STRUCTURES = # =================== class ImmuneChain...
# coding=utf-8 from .mapview import *
# -*- coding:utf8 -*- ''' dsf module for working with the local filesystem @author: Stuart Herbert <stuart@stuartherbert.com> https://devsetup.systems/dsf-framework/ ''' import os import shutil import time import dsf def file_pair(source_file, target_file, cache_for=3600, cwd=None): retval = FilePair(source_file...
#!/bin/env python # (c) Copyright 2014-2016 Hewlett Packard Enterprise Development Company LP # # 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/licen...
#!/usr/bin/env python # Mosflm.py # Copyright (C) 2006 CCLRC, Graeme Winter # # This code is distributed under the terms and conditions of the # CCP4 Program Suite Licence Agreement as a CCP4 Library. # A copy of the CCP4 licence can be obtained by writing to the # CCP4 Secretary, Daresbury Laboratory, Warrin...
#!/usr/bin/env python #-*- coding: utf-8 -*- """ logo_keeper puts feed logos into database """ # @author chengdujin # @contact chengdujin@gmail.com # @created Oct. 29, 2013 import sys reload(sys) sys.setdefaultencoding('UTF-8') sys.path.append('../..') from config.settings import Collection from config.settings imp...
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals """ This module provides so-called "strategies" to determine the coordination environments of an atom in a structure. Some strategies can favour larger or smal...
from collections import OrderedDict from dateutil.rrule import rrule, MONTHLY from django.http.response import Http404 from memoized import memoized from custom.icds_reports.const import AADHAR_SEEDED_BENEFICIARIES from custom.icds_reports.sqldata.agg_awc_monthly import AggAWCMonthlyDataSource from custom.icds_report...
import time from zstacklib.utils import http from zstacklib.utils import log from zstacklib.utils import thread from zstacklib.utils import linux logger = log.get_logger(__name__) class ProgressReportCmd(object): def __init__(self): self.progress = None self.processType = None self.resourc...
# coding=utf-8 import logging import time class HarajsTime(object): """ Converting the string date to time using 'GMT'. """ tm_minute = 0 tm_hour = 0 tm_day = 0 tm_week = 0 tm_month = 0 tm_year = 0 lang = [ "دقيقه", # "minute" "ساعه", # "hour" "يوم", ...
######### # Copyright (c) 2013 GigaSpaces Technologies Ltd. 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...
# Copyright 2014 Open Source Robotics Foundation, 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...
from wxplt import * from plot_objects import * from plot_utility import * from interface import * import plot_objects import plot_utility import wxplt import interface from wxplt import lena
import os import sys import llfuse import errno from time import localtime, mktime from llfuse import FUSEError from os import fsencode, fsdecode from Libfs.misc import * from Libfs.cache import Memcache from Libfs.business_logic import BusinessLogic logger = logging.getLogger(__name__) class Operations(llfuse.Operat...
"""Download flags of countries (with error handling). asyncio version Sample run:: $ python3 flags2_asyncio.py -s ERROR -e -m 200 ERROR site: http://localhost:8003/flags Searching for 676 flags: from AA to ZZ 200 concurrent connections will be used. -------------------- 146 flags downloaded. ...
"""Dashboard functionality for the diamondash web app""" import re import json from urllib import urlencode import yaml from unidecode import unidecode from pkg_resources import resource_stream from twisted.web.template import Element, renderer, XMLFile from exceptions import ConfigError # graph widget defaults GR...
from __future__ import absolute_import from django.conf import settings import git import time from subprocess import Popen, PIPE import os from datetime import datetime import pytz def get_project_info(commits=5): repo = get_project_repo() return {'repo': repo, 'last_commits': get_latest_commit_inf...
from __future__ import absolute_import import sys import traceback import logging LOG_LEVELS = { "CRITICAL": logging.CRITICAL, "ERROR": logging.ERROR, "WARNING": logging.WARNING, "INFO": logging.INFO, "DEBUG": logging.DEBUG } def get_log_level(level): return LOG_LEVELS.get(level, logging.INFO...
from cherrypy import wsgiserver import os import django.core.handlers.wsgi import zerorpc c = zerorpc.Client() c.connect(os.getenv('DIRECTOR_PORT')) password = c.start_dispatcher(os.getenv('HOSTNAME')) if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ipydispatch.settings") server...
# # Copyright (c) 2020 SUNET # All rights reserved. # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the following # conditions are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditi...
""" Init """ from __future__ import unicode_literals import datetime import os import subprocess VERSION = (2, 3, 6, 'final', 0) def get_version(version=None): """ Returns a PEP 386-compliant version number from VERSION. """ if not version: version = VERSION else: assert len(vers...
# All fields except for BlobField written by Jonas Haag <jonas@lophus.org> from django.db import models from django.core.exceptions import ValidationError from django.utils.importlib import import_module __all__ = ('RawField', 'ListField', 'DictField', 'SetField', 'BlobField', 'EmbeddedModelField') class ...
# -*- coding: utf-8 -*- from dlstats.fetchers._commons import (Fetcher, Categories, Series, Datasets, Providers) import urllib import xlrd import csv import codecs from datetime import datetime import pandas from collections import OrderedDict from re import match, sub from time ...
#!/usr/bin/python """ Filter the results of munki's MANAGED_INSTALL_REPORT.plist to these items: 'EndTime', 'StartTime', 'ManifestName', 'ManagedInstallVersion' 'Errors', 'Warnings', 'RunType' """ import plistlib import sys import os import CoreFoundation DEBUG = False # Path to the default munki install dir default...
# -*- coding: utf-8 -*- """ Type inference for NumPy binary ufuncs and their methods. """ from __future__ import print_function, division, absolute_import import numpy as np from numba import * from numba import typesystem from numba.typesystem import numpy_support from numba.type_inference.module_type_inference impo...
import Map tile_information = { 'Farm': { 'image': 'assets/tile_farm.png', 'build': { 'energy': 1, 'food': 1, }, 'consume': { 'water': 1, }, 'produce': { 'food': 3, } }, 'LaunchPad' : { 'image' : ...
from django.shortcuts import render_to_response, get_object_or_404 from django.http import HttpResponseRedirect, get_host from django.template import RequestContext from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User from djang...
# Licensed under an MIT open source license - see LICENSE ''' Test functions for Cramer ''' from unittest import TestCase import numpy as np import numpy.testing as npt from ..statistics import Cramer_Distance from ._testing_data import \ dataset1, dataset2, computed_data, computed_distances class testCramer...
from pylearn2.train import Train from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix from pylearn2.models.model import Model from pylearn2.space import VectorSpace from pylearn2.utils import sharedX from pylearn2.training_algorithms.bgd import BGD from pylearn2.training_algorithms.sgd import EpochCounte...
import os import sys import subprocess import time import unittest if sys.platform != 'win32': sys.path.append(".") from pywinauto.atspi_element_info import AtspiElementInfo app_name = r"gtk_example.py" def _test_app(): test_folder = os.path.join(os.path.dirname (os.path.di...
# -*- coding: utf-8 -*- ''' This module contained a series classes that use for maintain informations of Areca Backup. ''' import pathlib import arrow import zipfile import gzip import io import os.path import xml.etree.ElementTree as etree from . import abhealer def folder_to_int(name): parts = name.split("_")...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # # Library: steady # # Copyright 2015 Kitware, Inc., 28 Corporate Dr., Clifton Park, NY 12065, USA. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); #...
import times from django.db import transaction from django.db import models from django.conf import settings from .job import Job PQ_DEFAULT_JOB_TIMEOUT = 180 if not hasattr( settings, 'PQ_DEFAULT_JOB_TIMEOUT') else settings.PQ_DEFAULT_JOB_TIMEOUT class Queue(models.Model): connection = None name = mod...
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2013 CERN. ## ## Invenio 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) a...
"""Migrate attachments from couchdb to an external blob store ## Running migrations Use the `run_blob_migration` management command to transfer attachments on selected models from couchdb to the external blob database. Run the command without arguments to get a list of possible migrations that can be run: ./mana...
import sublime import sublime_plugin import os import urllib import json import threading import time import pprint import urllib.parse import shutil import datetime from xml.sax.saxutils import unescape from . import requests, context, util from .context import COMPONENT_METADATA_SETTINGS from .util import getUniqueE...
""" sash Activity """ from sugar.activity import activity from sugar.datastore import datastore import pygame import logging _logger = logging.getlogger('Sash') class SashActivity(activity.Activity): def __init__(self, handle): print "running activity init", handle activity.Activity.__init__(sel...