text
stringlengths
17
737k
# coding=utf-8 """ GOAL: Use object-oriented Python to model a public library (w/ three classes: Library, Shelf, & Book). The library should be aware of a number of shelves. Each shelf should know what books it contains. Make the book object have "enshelf" and "unshelf" methods that control what shelf the book is sit...
# -*- coding: utf-8 -*- import pywikibot import pywikibot.data.wikidataquery as pwq import json def item_from_id(repo, identifier): """ Get item from its ID. Args: repo: data repository of the site. identifier (int): ID of an item (eg. 120 for Q120) """ return pywikibot.ItemPage(r...
""" Play random actions in an environment and render a video that demonstrates segmentation. """ import argparse import json import imageio import colorsys import random import numpy as np import matplotlib.cm as cm from PIL import Image import robosuite as suite from robosuite.controllers import load_controller_confi...
""" homeassistant.components.sensor.cpuspeed ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Shows the current CPU speed. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.cpuspeed.html """ import logging from homeassistant.helpers.entity import Entity RE...
# Licensed under an MIT open source license - see LICENSE from .utilities import * from .pixel_ident import * import numpy as np import scipy.ndimage as nd import networkx as nx import operator import string import copy # Create 4 to 8-connected elements to use with binary hit-or-miss struct1 = np.array([[1, 0, 0],...
import numpy as np from itertools import count import warnings from sklearn.base import RegressorMixin from sklearn.exceptions import FitFailedWarning, ConvergenceWarning from sklearn.linear_model import LinearRegression from sklearn.linear_model.base import LinearModel, _rescale_data from sklearn.utils.validation imp...
""" homeassistant.components.sensor.rpi_gpio ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Allows to configure a binary state sensor using RPi GPIO. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.rpi_gpio.html """ import logging from homeassistant.help...
# flake8: noqa import etcd import json import uuid import etcd import gevent from tendrl.commons.objects.job import Job from tendrl.commons import flows from tendrl.commons.event import Event from tendrl.commons.message import Message from tendrl.commons.flows.exceptions import FlowExecutionFailedError from tendrl.c...
import numpy as np import sys import os sys.path.append('/Users/palmer/Documents/python_codebase/') def get_variables(json_filename): import json config = json.loads(open(json_filename).read()) return config ### We simulate a mass spectrum for each sum formula/adduct combination. This generates a set of...
import asyncio import logging import random import textwrap import unicodedata from datetime import datetime from datetime import timedelta from difflib import ndiff from typing import Union import discord import emoji from aiohttp.client_exceptions import ClientError from aiohttp.http_exceptions import HttpProcessing...
# Copyright (c) 2009 Mikael Lind # # 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 without # restriction, including without limitation the rights to use, # copy, modify, merge, publish, distr...
import os import sys import ida_kernwin import ida_diskio import ida_bytes import ida_segment import ida_idaapi import ida_nalt import ida_idp from PyQt5.QtWidgets import (QWidget, QApplication, QCheckBox, QLabel, QComboBox, QSizePolicy, QVBoxLayout, QHBoxLayout) from PyQt5.QtGui import (QPainter, QC...
from expects import expect, equal from primestg.report import Report from primestg.message import MessageS from ast import literal_eval with description('Report S02 example'): with before.all: self.data_filename = 'spec/data/CIR4621247027_0_S02_0_20150901111051' with open(self.data_filename) as d...
pipeline_functions = {} def register_pipeline(function): """Decorator to register a function for the assembly pipeline.""" if function.__name__ in pipeline_functions: raise ExistingFunctionError( '%s is already registered with %s.%s' % ( function.__name__, function.__module...
from pprint import pprint from datetime import timedelta from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.db import connections from django.db.models import Sum from django.shortcuts import render from django.views import View from django.urls import reverse from geral.functions im...
"""AWS S3 Interface used by tests.""" import boto3 import botocore import json class S3Interface(): """Interface to the AWS S3 database.""" def __init__(self, aws_access_key_id, aws_secret_access_key, s3_region_name, deployment_prefix): """Create a new interface to the AWS S3. ...
import unittest import numpy import chainer from chainer import cuda import chainer.functions as F from chainer import gradient_check from chainer import testing from chainer.testing import attr @testing.parameterize(*testing.product_dict( [ {'a_shape': (4, 3, 2), 'b_shape': (3, 2, 5), 'axes': 2, 'gc_sh...
# -*- coding: utf8 -*- import sys import sqlite3 import flask import uuid import re import logging import ConfigParser from fuzzy import fuzzme import requests app = flask.Flask(__name__) app.logger.setLevel(logging.DEBUG) DATABASE = 'dict-amis.sq3' LINE_ENDPOINT = "https://trialbot-api.line.me" USER_LASTWORD = {} d...
#!/usr/bin/env python # -*- coding: utf-8 -*- import vim import re import os import os.path import shutil import itertools import subprocess from .utils import * from .explorer import * from .manager import * if sys.version_info >= (3, 0): import queue as Queue else: import Queue #***************************...
#!/usr/bin/env python """ Create database from ini files I started out using ini files as the first input and primary backup method for the data. I'm changing that to be more database centric, with the backup being done by a file containing a log of the sql statements used to update the database. This ...
# Copyright 2017 reinforce.io. 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...
"""samsungctl and samsungtvws bridge classes.""" from __future__ import annotations from abc import ABC, abstractmethod import asyncio from asyncio.exceptions import TimeoutError as AsyncioTimeoutError from collections.abc import Callable, Iterable, Mapping import contextlib from typing import Any, Generic, TypeVar, c...
""" Property cache: sits on top of the database and keeps known values in memory. (Also keeps known *non*-values in memory; that is, a hit that returns nothing is cached so that we can return that fact.) When a property is changed or deleted, we add a cache entry with the dirty flag. At the end of the task, we call w...
import numpy as np from pandas.tslib import _NaT from transform import * from osgeo import gdal, osr class EnvironmentalModel(object): ''' This class ultimately represents an elevation map + all of the traversable spots on it. Public functions: setMaxSlope(slope) - sets the maximum slope that can be traver...
import os import pyfits import numpy as np import glob import shutil import matplotlib.pyplot as plt USE_PLOT_GUI=False from matplotlib.figure import Figure from matplotlib.backends.backend_agg import FigureCanvasAgg from pyraf import iraf from iraf import iraf import threedhst import threedhst.eazyPy as eazy impo...
from __future__ import division, print_function import abc import numpy as np from menpo.transform import Scale, AlignmentSimilarity from menpo.model.modelinstance import PDM, OrthoPDM from menpo.transform.modeldriven import ModelDrivenTransform, OrthoMDTransform from menpo.visualize import print_dynamic, progress_bar...
import ipgetter from discord.ext import commands from cogs.utils import checks class WhatsMyIP: """ Assign roles based on trust rating """ def __init__(self, bot): self.bot = bot @commands.command(pass_context=True) @checks.is_owner() async def whatsmyip(self, ctx): """P...
from __future__ import print_function, division import numpy as np import matplotlib.pyplot as plt import pandas as pd import scipy.stats as stats import logging import re, os, os.path import numpy.random as rand import copy from astropy import units as u from astropy.units import Quantity from astropy.coordinates i...
import os from hashlib import sha256 import zipfile from py.path import local as Path import pytest from ideascube.mediacenter.models import Document @pytest.fixture( params=[ { 'id': 'foo', 'name': 'Content provided by Foo', 'url': 'http://foo.fr/catalog.yml', ...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function __all__ = [ "__title__", "__summary__", "__uri__", "__version__", "__author__", "__email__", "__license__", "__copyright__", ] __title__ = "pyramid_swagger" __summary__ = "Swag...
from datetime import datetime from django.conf import settings from django.contrib.auth.decorators import login_required from django.core.mail import mail_admins from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponseForbidden, HttpResponseRedirect from django.shortcuts import re...
''' Copyright 2017, Fujitsu Network Communications, 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 agreed to in w...
# # Kiwi: a Framework and Enhanced Widgets for Python # # Copyright (C) 2005-2006 Async Open Source # # 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, ...
import re import numpy as np from src.utils import DataLoader, Download import logging # setting up debugging messages logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG) class Antibody: """ TODO: write description """ def __init__(self, sequence='', name='', numbering=None)...
# # Copyright 2017-2018 European Centre for Medium-Range Weather Forecasts (ECMWF). # # 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...
#!/usr/bin/env python # # tree_conflict_tests.py: testing tree-conflict cases. # # Subversion is a tool for revision control. # See http://subversion.apache.org for more information. # # ==================================================================== # Licensed to the Apache Software Foundation (ASF) under ...
# # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permission. # # # __all__ = ['SearchTypeToolWdg', 'SearchTypeCre...
import numpy as np import scipy.sparse as ss import warnings from base import Graph class EdgePairGraph(Graph): def __init__(self, pairs, num_vertices=None): self._pairs = np.atleast_2d(pairs) # Handle empty-input case if self._pairs.size == 0: self._pairs.shape = (0, 2) self._pairs.dtype =...
# django-salesforce # # by Phil Christensen # (c) 2012-2013 Freelancers Union (http://www.freelancersunion.org) # See LICENSE.md for details # from __future__ import print_function from decimal import Decimal import datetime import pytz import random import string import sys from django.conf import settings from djang...
import matplotlib.pyplot as plt import numpy as np import logging from scipy.interpolate import interp1d from matplotlib.ticker import MaxNLocator import matplotlib.cm as cm import statsmodels.api as sm from scipy.ndimage.filters import gaussian_filter __all__ = ["ChainConsumer"] class ChainConsumer(object): """...
# ------------------------------------------------------------------------------- # Copyright IBM Corp. 2017 # # 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/licens...
# Copyright (C) 2010 Aldo Cortesi # # 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 option) any later version. # # This program is distributed i...
# This file is part of Indico. # Copyright (C) 2002 - 2020 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals import os from io import BytesIO from zipfile import ZipFile fro...
# This file is part of Indico. # Copyright (C) 2002 - 2019 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import unicode_literals from werkzeug.exceptions import BadRequest from indico.core.db i...
import re import time from harmonious.decorators import directive, expression from selenium.webdriver.common.alert import Alert from selenium.common.exceptions import NoSuchElementException, NoAlertPresentException, WebDriverException, StaleElementReferenceException def find_element(browser, element): if type(el...
#!/usr/bin/env python # # Checkout files from the SWIG library into Subversion's proxy directory # import sys, os, re, fileinput, shutil if __name__ == "__main__": parent_dir = os.path.dirname(os.path.abspath(os.path.dirname(sys.argv[0]))) sys.path[0:0] = [ parent_dir, os.path.dirname(parent_dir) ] import generato...
from lab.with_log import WithLogMixIn from lab.with_config import WithConfig class Tims(WithLogMixIn, WithConfig): _OPERATION_ENTITY = 'entity' _OPERATION_UPDATE = 'update' _OPERATION_SEARCH = 'search' def __init__(self, version): import getpass import json import os ...
#!/usr/bin/env python # coding=utf-8 from webapp.web import BaseHandler from model import dbapi class RegisterHandler(BaseHandler): def get(self, error=""): params = {'error_info': error} body = self.wrap_html('templates/register.html', params) self.write(body) def post(self): ...
""" symlink generic tech to klayout """ import os import pathlib import sys if sys.platform == "win32": klayout_folder = "KLayout" else: klayout_folder = ".klayout" def install_generic_tech(src, dest): """ installs generic layermap """ if dest.exists(): print("generic tech already installed...
### $Id: $ ### $URL: $ import os import tempfile import commands from sfa.util.faults import * from sfa.util.misc import * from sfa.util.method import Method from sfa.util.parameter import Parameter, Mixed from sfa.trust.auth import Auth from sfa.util.genitable import * class get_key(Method): """ Generate a ...
# -*- coding: utf-8 -*- """ sphinx-intl ~~~~~~~~~~~ Sphinx utility that make it easy to translate and to apply translation. :copyright: Copyright 2013 by Takayuki SHIMIZUKAWA. :license: BSD, see LICENSE for details. """ from __future__ import with_statement import re import os from glob import glo...
__author__ = 'kgeorge' import re import cStringIO import io from PIL import Image import urlparse from io import BytesIO from cgi import parse_header, parse_multipart import base64 import os import json import cv2 import colorsys #import yaml #import simplejson as json import numpy as np from optparse import OptionPar...
from __future__ import unicode_literals from django.conf import settings from django.db import models from django.utils import timezone from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext as _ @python_2_unicode_compatible class Tag(models.Model): slug = mod...
"""Partial dependence plots for regression and classification models.""" # Authors: Peter Prettenhofer # Trevor Stephens # Nicolas Hug # License: BSD 3 clause from itertools import chain from itertools import count import numbers from collections.abc import Iterable import warnings import numpy as ...
#!/usr/bin/env python # Python 2.7 backward compatibility from __future__ import print_function from __future__ import unicode_literals from __future__ import absolute_import import paramiko import paramiko.py3compat import os import os.path import sys import errno from stat import S_ISDIR, S_ISLNK, S_ISREG, S_IMODE,...
from __future__ import unicode_literals, division, absolute_import import logging from flexget import plugin from flexget.event import event from flexget.plugins.api_tvdb import lookup_series, lookup_episode from flexget.utils.database import with_session log = logging.getLogger('thetvdb_lookup') class PluginThetv...
import re import functools from inspect import isfunction from contextlib import contextmanager from .engine import Engine # Singleton mock engine engine = Engine() def activate(fn=None): """ Enables the HTTP traffic interceptors. This function can be used as decorator. """ engine.activate() ...
""" byceps.services.shop.order.export.service ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Copyright: 2006-2017 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from datetime import datetime from decimal import Decimal from typing import Any, Dict from flask import current_app from .....util....
class Logger(object): """ Wrapper class that enables writing to a log file. Instantiating this class opens a file connection that must be closed. Parameters ---------- path : string The location of the text file to open or create. mode : {'append', 'replace'}, optional, default 'r...
import logging from model_utils import Choices from django.db import models from django.db import transaction from django.utils import timezone from django.utils.translation import ugettext as _ from django.contrib.postgres.fields import JSONField from django.contrib.contenttypes.models import ContentType from django...
from collections import namedtuple import uuid import re from IStorage import IStorage from hdict import StorageDict from hecuba import config, log import numpy as np from hfetch import Hcache class StorageObj(object, IStorage): args_names = ["name", "tokens", "storage_id", "istorage_props", "class_name"] arg...
# (C) Datadog, Inc. 2010-2016 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) """kubernetes check Collects metrics from cAdvisor instance """ # stdlib from collections import defaultdict from fnmatch import fnmatch import numbers import re import simplejson as json # 3rd party import reque...
#!/usr/bin/python # # Copyright (c) 2015 All rights reserved # This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # # http://www.apache.org/licenses/LICENSE-2.0 # # Execute Multisite Tempest test ...
from bs4 import BeautifulSoup def total(page): soup = BeautifulSoup(page) number = len(soup.find_all('tbody')) total = int(number)/2 return total def proposallist(page): soup = BeautifulSoup(page) extras = soup.find_all('tbody') proposals, number = [], [] i, j, k = 0, 0, 0 b_core,...
from __future__ import absolute_import import argparse import os import numpy as np from pprint import pprint import warnings import helper_utils as hutils from file_utils import directory_from_parameters # Seed for random generation -- default value DEFAULT_SEED = 7102 DEFAULT_TIMEOUT = -1 # no timeout DEFAULT_DAT...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from itertools import chain from decimal import Decimal from django.db import models from django.core.validators import MinValueValidator from django.core.urlresolvers import reverse from django.utils.translation import ugettext_lazy as _ from django.uti...
#!/usr/bin/env python ################################################################# # pyusb access for ant devices # By Kyle Machulis <kyle@nonpolynomial.com> # http://www.nonpolynomial.com # # Licensed under the BSD License, as follows # # Copyright (c) 2011, Kyle Machulis/Nonpolynomial Labs # All rights reserved....
# # This file is part of the PyMeasure package. # # Copyright (c) 2013-2019 PyMeasure Developers # # 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 without restriction, including without limit...
import requests import six from django.conf import settings from requests.exceptions import ConnectionError, Timeout from django.core.cache import cache from django.core.exceptions import ImproperlyConfigured try: cache_time = settings.WP_API_BLOG_CACHE_TIMEOUT except AttributeError: cache_time = 0 try: ca...
#!/usr/bin/env python3 import io import os import sys # Add the Python root directory (fusion-engine-client/python/) to the import search path. import numpy as np root_dir = os.path.normpath(os.path.join(os.path.dirname(__file__), '..')) sys.path.append(root_dir) from fusion_engine_client.analysis.file_index import...
# 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 from frappe.utils import cstr, has_gravatar from frappe import _ from frappe.model.document import Document from frappe.core.doctype.dynam...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # FOGLAMP_BEGIN # See: http://foglamp.readthedocs.io/ # FOGLAMP_END """ The sending process is run according to a schedule in order to send reading data to the historian, e.g. the PI system. It’s role is to implement the rules as to what needs to be sent and when, extrac...
""" Simple random Unit Tests """ import random import unittest import simplerandom.iterators as sri #import simplerandom.iterators._iterators_py as sri class Marsaglia1999Tests(unittest.TestCase): """Tests as in Marsaglia 1999 post The Marsaglia 1999 post didn't explicitly set seed values for each RNG...
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Base class for RPC testing # Add python-bitcoinrpc to module search path: import os import sys import ...
import sys import thread import MySQLdb from PyQt4.QtCore import QUrl, QObject, pyqtSignal, pyqtProperty from PyQt4.QtGui import QApplication from PyQt4.QtDeclarative import QDeclarativeView from artgraph.miner import Miner from artgraph.node import NodeTypes class NodeWrapper(QObject): property_changed = pyqtSi...
""" Copyright (c) 2011 Tyler Kenendy <tk@tkte.ch> 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 without restriction, including without limitation the rights to use, copy, modify, merge, publish,...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' The full program is explained in the attached ReadMe.md Copyright (C) 2013 warehouseman.com This program 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 S...
import ovh import ConfigParser import string import warnings from random import choice from prettytable import PrettyTable class EmailManager : ''' This class uses the ovh Python API and provide some functionalities to interact with email accounts Arguments: niceoutput Optional....
import os from optparse import make_option from django.core.management.base import BaseCommand, CommandError class Command(BaseCommand): help = 'Runs lettuce features' option_list = BaseCommand.option_list[1:] + ( make_option('-v', '--verbosity', action='store', ...
"""HTTP Client library""" import json from .exceptions import handle_error try: # Python 3 import urllib.request as urllib from urllib.parse import urlencode from urllib.error import HTTPError except ImportError: # Python 2 import urllib2 as urllib from urllib2 import HTTPError from url...
__version__ = '0.6.0'
from django.contrib import admin from django.contrib.admin.options import IncorrectLookupParameters from django.contrib.admin.views.main import ChangeList, SEARCH_VAR from django.core.paginator import Paginator from django.template import Context, Template from django.test import TestCase from django.test.client import...
import numpy as np import math import os import h5py import dask import dask.array as da import time as ttime from numba import jit from dask.distributed import Client, wait from progress.bar import Bar from .fitting import fit_spectrum import logging logger = logging.getLogger() def dask_client_create(**kwargs): ...
# -*- coding: utf-8 -*- from __future__ import print_function, division from datetime import datetime from qsrlib_io.world_trace import World_Trace from qsrlib_utils.utils import merge_world_qsr_traces from qsrlib_qsrs import * class QSRlib_Response_Message(object): def __init__(self, qsrs, timestamp_request_made...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # ThinkOpen Solutions Brasil # Copyright (C) Thinkopen Solutions <http://www.tkobr.com>. # # This...
""" Databases verification This tool is used as to check the format of each database """ from __future__ import division from __future__ import print_function from cea.scripts import schemas import pandas as pd import re from cea.utilities import simple_memoize from cea.utilities.schedule_reader import get_all_schedul...
# Copyright (c) 2013 Mirantis 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 ...
import numpy tinnitus_yes = [ 1796, 1826, 1856, 1886 ] tinnitus_no = [ 1800, 1830, 1860, 1890 ] tinnitus_sometimes = [ 1798, 1828, 1858, 1888 ] tinnitus = [ tinnitus_yes, tinnitus_no, tinnitus_sometimes ] hearing_yes = [ 1808, 1838, 1868, 1898 ] hearing_no = [ 1812, 1842, 1872, 1902 ] hearing_sometimes = [ 1810, 1...
from pkg_resources import (resource_stream, resource_listdir) from io import StringIO import argparse import datetime import re import os import subprocess import sys import getpass LICENSES = [] for file in sorted(resource_listdir(__name__, '.')): match = re.match(r'template-([a-z0-9_]+).txt', file) if match...
from __future__ import print_function import logging import numpy import pywt import SimpleITK as sitk import six from six.moves import range logger = logging.getLogger(__name__) def getMask(mask, **kwargs): """ Function to get the correct mask. Includes enforcing a correct pixel data type (UInt32). Also su...
import numpy from chainer.functions.connection import deconvolution_2d from chainer import initializers from chainer import link class Deconvolution2D(link.Link): """Two dimensional deconvolution function. This link wraps the :func:`~chainer.functions.deconvolution_2d` function and holds the filter wei...
from abc import ABCMeta from abc import abstractmethod import six import warnings class CommunicatorBase(six.with_metaclass(ABCMeta)): '''Interface definition of all communicators. All communicators that have compatible set of methods with this class is supposed to work in ChainerMN's parallel computatio...
#!/usr/bin/env python """Plays a pseudo-random sequence of songs. Author: Caoilte Guiry Name: random_music.py License: BSD License """ from __future__ import with_statement import os import sys import glob from stat import ST_MTIME from socket import gethostname from random import randint import subprocess import d...
import Coordonnees import Intersection from math import sqrt class Vehicule: distance_minimale_roulant = 150 #cm distance_minimale = 30 #cm proportion_discourtois = 0.8 acceleration_max = 100 # cm.s^(-2) deceleration_conf = 300 # cm.s^{-2} temps_reaction = 1.5 # secondes count = 0 v_max...
############################################################################### # KuzminDiskPotential.py: class that implements Kuzmin disk potential # # - amp # Phi(R, z)= --------------------------- # \sqrt{R^2 + (a + |z|...
# -*- coding: utf-8 -*- # Copyright 2018 Coop IT Easy SCRLfs. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import _, api, fields, models from datetime import date, datetime, timedelta from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT as DTF from openerp.exceptions imp...
""" Takes a site and installs it """ import os import sys import logging import shutil from distutils.errors import DistutilsSetupError from installer.utils import CommandFailed logger = logging.getLogger(__name__) def deploy(venv, site_path, development=False, listen_externally=False, dev_server_port=80...
#!/usr/bin/env python # encoding: utf-8 import os import sys import tarfile import functools import pip import boto3 import click import requests from eregs import run_or_resolve from regparser.commands.pipeline import pipeline from regparser.commands.compare_to import compare_to targets = { 'fec': { '...
#-*- coding: utf-8 -*- from django.contrib import admin from django.contrib import messages from edda.models import Humen, Periodipartecipaziones, HumenSostituzioni from edda.models import HumenBadge, PosixGroup, ALL_POSIX_GROUPS from edda.models import RSHumen, ChiefHumen, Routes, Vclans from edda.models import Humen...
# # Copyright (c) 2008-2009 rPath, Inc. # # This program is distributed under the terms of the Common Public License, # version 1.0. A copy of this license should have been distributed with this # source file in a file called LICENSE. If it is not present, the license # is always available at http://www.rpath.com/perma...