content
string
#!/usr/bin/python """ this is interface module (c) 2018, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """ from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status...
ANSIBLE_METADATA = {'metadata_version': '1.0', 'status': ['preview'], 'supported_by': 'community'} try: from distutils.version import LooseVersion from f5.bigip.contexts import TransactionContextManager from f5.bigip import ManagementRoot from icontrol.session i...
from __future__ import division, absolute_import, print_function import sys if 'setuptools' in sys.modules: import setuptools.command.install as old_install_mod have_setuptools = True else: import distutils.command.install as old_install_mod have_setuptools = False from distutils.file_util import write...
__author__ = 'bromix' class AbstractContextUI(object): def __init__(self): pass def create_progress_dialog(self, heading, text=None, background=False): raise NotImplementedError() def set_view_mode(self, view_mode): raise NotImplementedError() def get_view_mode(self): ...
import os import sys import storm class EmitterBase(object): DEFAULT_PYTHON = 'python%d.%d' % (sys.version_info.major, sys.version_info.minor) def __init__(self, script): # We assume 'script' is in the current directory. We simply get the # base part and turn it into a .py name for inclusion ...
# -*- coding: utf-8 -*- from multiprocessing import pool import multiprocessing import contextlib import clipboard import traceback import parmap import signal import time import pdb import sys __version__ = "$Id: task.py 2130 2015-09-11 16:56:55Z fmullall $" __URL__ = "$URL: svn+ssh://flux/home/fmullall/svn/kepler...
import os, sys; sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) import unittest import time import math from pattern import metrics try: PATH = os.path.dirname(os.path.realpath(__file__)) except: PATH = "" #------------------------------------------------------------------------------------...
from __future__ import unicode_literals import frappe from frappe import _ from erpnext.accounts.report.accounts_receivable.accounts_receivable import get_ageing_data from frappe.utils import getdate, flt def execute(filters=None): if not filters: filters = {} validate_filters(filters) columns = get_columns(filter...
class AscPosition: def __init__(self): pass def get_ASC_POS(self, DATA_output): asc_down = set('r1') asc_up = set('r2') for asc_state in DATA_output: if asc_down & set(asc_state): print("ASC nozzle lowered.") elif asc_up & set(asc_state): print('ASC nozzle raised.') else: print("ERROR. ...
from webkitpy.tool.commands.commandtest import CommandsTest from webkitpy.tool.commands.applywatchlistlocal import ApplyWatchListLocal class ApplyWatchListLocalTest(CommandsTest): def test_args_parsing(self): expected_logs = """MockWatchList: determine_cc_and_messages No bug was updated because no id was ...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from identityprovider.models import InvalidatedEmailAddress class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'InvalidatedEmailAddress.date_invalidated...
"""View to accept incoming websocket connection.""" import asyncio from contextlib import suppress from functools import partial import json import logging from aiohttp import web, WSMsgType import async_timeout from homeassistant.const import EVENT_HOMEASSISTANT_STOP from homeassistant.core import callback from home...
# -*- coding: utf-8 -*- """ pygments.styles.fruity ~~~~~~~~~~~~~~~~~~~~~~ pygments version of my "fruity" vim theme. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Token, Co...
from __future__ import absolute_import from rest_framework import serializers from rest_framework.response import Response from sentry.api.bases.organization import OrganizationEndpoint from sentry.api.exceptions import ResourceDoesNotExist from sentry.models import ( AuditLogEntryEvent, OrganizationAccessRequest...
import re class PdfString(str): ''' A PdfString is an encoded string. It has a decode method to get the actual string data out, and there is an encode class method to create such a string. Like any PDF object, it could be indirect, but it defaults to being a direct object. '''...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ # This module defines the dictionary of countries (ISO-3166) supported by # Braintree, with Alpha2 codes as keys and translatable country names as values # Data originally copied from # https://de...
from common import NoRepo, checktool, commandline, commit, converter_source from mercurial.i18n import _ from mercurial import util import os, shutil, tempfile, re # The naming drift of ElementTree is fun! try: from xml.etree.cElementTree import ElementTree, XMLParser except ImportError: try: from xml...
import base64 def main(): module = AnsibleModule( argument_spec = dict( src = dict(required=True, aliases=['path']), ), supports_check_mode=True ) source = os.path.expanduser(module.params['src']) if not os.path.exists(source): module.fail_json(msg="file not...
#!/usr/bin/env python # SOME UGLY CODE HERE import sys lines_gaff = sys.stdin.readlines() dihedral_style_name = 'fourier' in_dihedral_coeffs = [] for i in range(0, len(lines_gaff)): line = lines_gaff[i] atypes = line[:11].split('-') atype1 = atypes[0].strip() atype2 = atypes[1].strip() atype3 =...
import threading from time import time as _time from collections import deque class TimeOut(Exception): pass class AsyncQueue(object): def __init__(self, maxsize=0): self._init(maxsize) self.mutex = threading.Lock() self.empty_cond = threading.Condition(self.mutex) self.full...
import numpy as np import unittest import chainer from chainer.backends.cuda import to_cpu from chainer.function import Function from chainer import testing from chainer.testing import attr from chainercv.links import PickableSequentialChain from chainercv.utils.testing import ConstantStubLink class DummyFunc(Funct...
#! /usr/bin/env python # encoding: utf-8 # Federico Pellegrin, 2017 (fedepell) """ Provides Java Unit test support using :py:class:`waflib.Tools.waf_unit_test.utest` task via the **javatest** feature. This gives the possibility to run unit test and have them integrated into the standard waf unit test environment. It ...
""" This module defines the database schema of the node. Each model class defines a table in the database. The fields define the columns of this table. """ # library import from django.db.models import * from django.core.exceptions import ValidationError from vamdctap import bibtextools import re import datetime ...
"""Generates out a Closure deps.js file given a list of JavaScript sources. Paths can be specified as arguments or (more commonly) specifying trees with the flags (call with --help for descriptions). Usage: depswriter.py [path/to/js1.js [path/to/js2.js] ...] """ import logging import optparse import os import posixp...
"""Support gathering system information of hosts which are running netdata.""" from datetime import timedelta import logging import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_HOST, CONF_ICON, CONF_NAME, CONF_PORT, CONF_RESOURCES) from homea...
import xbmc, xbmcgui import os import util, config from util import * ACTION_CANCEL_DIALOG = (9,10,51,92,110) CONTROL_BUTTON_EXIT = 5101 class DialogBaseEdit(xbmcgui.WindowXMLDialog): def getControlById(self, controlId): try: control = self.getControl(controlId) except: return None...
import datetime import mock from oslo_utils import timeutils from nova.api.openstack.placement import exception from nova.db.sqlalchemy import resource_class_cache as rc_cache from nova import rc_fields as fields from nova import test from nova.tests import fixtures class TestResourceClassCache(test.TestCase): ...
""" Utilities for manipulating Geometry WKT. """ from django.utils import six def precision_wkt(geom, prec): """ Returns WKT text of the geometry according to the given precision (an integer or a string). If the precision is an integer, then the decimal places of coordinates WKT will be truncated t...
from django.http import HttpResponse from django.utils import six from .loader import get_template, select_template class ContentNotRenderedError(Exception): pass class SimpleTemplateResponse(HttpResponse): rendering_attrs = ['template_name', 'context_data', '_post_render_callbacks'] def __init__(self...
""" pyyaml legacy Copyright (c) 2001 Steve Howell and Friends; All Rights Reserved (see open source license information in docs/ directory) """ import re import string def indentLevel(line): n = 0 while n < len(line) and line[n] == ' ': n = n + 1 return n class LineNumberStream: ...
#!/usr/bin/env python from __future__ import print_function import json import os import sys import urllib2 import ast import csv def main(transfer_path): basename = os.path.basename(transfer_path) try: comp_num, comp_id, obj_id = basename.split('---') except ValueError: return 1 # pr...
"""Test utils for factorization_ops.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import random import numpy as np from tensorflow.python.framework import constant_op from tensorflow.python.framework import sparse_tensor from tensorflow.python.ops i...
"""Defines interfaces and default implementations for compiling and flashing code.""" import abc import glob import os import re from tvm.contrib import binutil import tvm.target from . import build from . import class_factory from . import debugger from . import transport class DetectTargetError(Exception): ""...
# coding: utf-8 import pytest import itertools import string from pandas import Series, DataFrame, MultiIndex from pandas.compat import range, lzip import pandas.util.testing as tm import pandas.util._test_decorators as td import numpy as np from numpy import random import pandas.plotting as plotting from pandas.t...
DATE_FORMAT = 'j F Y' TIME_FORMAT = 'H:i:s' DATETIME_FORMAT = 'j F Y H:i:s' YEAR_MONTH_FORMAT = 'F Y' MONTH_DAY_FORMAT = 'j F' SHORT_DATE_FORMAT = 'j N Y' SHORT_DATETIME_FORMAT = 'j N Y H:i:s' FIRST_DAY_OF_WEEK = 1 # Monday # The *_INPUT_FORMATS strings use the Python strftime format syntax, # see http://docs.python.o...
from __future__ import unicode_literals from __future__ import print_function from constants import * from functions import * from facture import * from ooffice import * class ExportTabletteModifications(object): title = "Export tablette" template = "Export tablette.ods" def __init__(self, site, date): ...
"""Unit test utilities for Google C++ Testing Framework.""" __author__ = '<EMAIL> (Zhanyong Wan)' import atexit import os import shutil import sys import tempfile import unittest _test_module = unittest # Suppresses the 'Import not at the top of the file' lint complaint. # pylint: disable-msg=C6204 try: import sub...
from modules.module_base import ModuleBase import requests from lxml import html from urllib.parse import urljoin from urllib.request import urlretrieve class ModuleXKCD(ModuleBase): def __init__(self, bot): ModuleBase.__init__(self, bot) self.name = "xkcd" def getXKCDImage(self, chat, path = ...
from tuskar.common import utils from tuskar.storage import models from tuskar.tests import base class CommonUtilsTestCase(base.TestCase): def test_resolve_role_extra_name_from_path(self): expected = [{"/path/to/FOO": "extra_FOO_"}, {"/hieradata/config.yaml": "extra_config_yaml"}, ...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from os.path import isdir, isfile, isabs, exists, lexists, islink, samefile, ismount from ansible import errors class TestModule(object): ''' Ansible file jinja2 tests ''' def tests(self): return { # ...
""" EasyBlock for installing Java, implemented as an easyblock @author: Jens Timmerman (Ghent University) """ from easybuild.easyblocks.generic.packedbinary import PackedBinary class EB_Java(PackedBinary): """Support for installing Java as a packed binary file (.tar.gz) Use the PackedBinary easyblock and set...
"""Class returned by TLSConnection.makefile().""" class FileObject: """This class provides a file object interface to a L{tlslite.TLSConnection.TLSConnection}. Call makefile() on a TLSConnection to create a FileObject instance. This class was copied, with minor modifications, from the _fileobject...
import webob.exc from nova.api.openstack import extensions import nova.cert.rpcapi from nova import exception from nova.i18n import _ authorize = extensions.extension_authorizer('compute', 'certificates') def _translate_certificate_view(certificate, private_key=None): return { 'data': certificate, ...
import mojom # mojom_pack provides a mechanism for determining the packed order and offsets # of a mojom.Struct. # # ps = mojom_pack.PackedStruct(struct) # ps.packed_fields will access a list of PackedField objects, each of which # will have an offset, a size and a bit (for mojom.BOOLs). class PackedField(object): ...
"""**Tests for map creation in QGIS plugin.** """ __author__ = 'Tim Sutton <<EMAIL>>' __revision__ = '$Format:%H$' __date__ = '01/11/2010' __license__ = "GPL" __copyright__ = 'Copyright 2012, Australia Indonesia Facility for ' __copyright__ += 'Disaster Reduction' import unittest from unittest import expectedFailure...
from django.conf import settings from django.core.signals import got_request_exception from rest_framework import status from rest_framework.exceptions import APIException, ParseError as DRFParseError from rest_framework.response import Response from rest_framework.views import exception_handler class AlreadyPurchas...
from __future__ import unicode_literals from .common import InfoExtractor from .youtube import YoutubeIE class WimpIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?wimp\.com/(?P<id>[^/]+)/' _TESTS = [{ 'url': 'http://www.wimp.com/maruexhausted/', 'md5': 'ee21217ffd66d058e8b16be340b74883', ...
#!/usr/bin/env python """ Spacewalk external inventory script ================================= Ansible has a feature where instead of reading from /etc/ansible/hosts as a text file, it can query external programs to obtain the list of hosts, groups the hosts are in, and even variables to assign to each host. To use...
from django.contrib import messages as msg from django.core.exceptions import PermissionDenied from django.http import HttpResponseRedirect from django.utils.translation import ugettext as _ from django.views.generic.detail import SingleObjectMixin from django.views.generic.edit import FormView, ProcessFormView from n...
from functools import wraps, update_wrapper from unittest import TestCase import warnings from django.contrib.admin.views.decorators import staff_member_required from django.contrib.auth.decorators import login_required, permission_required, user_passes_test from django.http import HttpResponse, HttpRequest, HttpRespo...
import unittest from swift.common.middleware.s3api.utils import Config class TestS3ApiCfg(unittest.TestCase): def test_config(self): conf = Config( { 'a': 'str', 'b': 10, 'c': True, } ) conf.update( { ...
"""Feeds for documents""" import datetime import json from django.conf import settings from django.db.models import F from django.contrib.syndication.views import Feed from django.utils.html import escape from django.utils.feedgenerator import (SyndicationFeed, Rss201rev2Feed, A...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.module_utils.six import string_types def pct_to_int(value, num_items, min_value=1): ''' Converts a given value to a percentage if specified as "x%", otherwise converts the given value to an integer. '...
import copy import operator import warnings from functools import total_ordering, wraps from django.utils import six from django.utils.deprecation import RemovedInDjango20Warning # You can't trivially replace this with `functools.partial` because this binds # to classes and returns bound instances, whereas functools...
import datetime from blaze.compute.pyfunc import symbol, lambdify, cos, math, broadcast from blaze.compute.pyfunc import _print_python from blaze.expr.broadcast import broadcast_collect t = symbol('t', '{x: int, y: int, z: int, when: datetime}') def test_simple(): f = lambdify([t], t.x + t.y) assert f((1, ...
from browser import document as doc from browser.html import * trans_menu = { 'menu_console':{'en':'Console','es':'Consola','fr':'Console', 'pt':'Console'}, 'menu_editor':{'en':'Editor','es':'Editor','fr':'Editeur', 'pt':'Editor'}, 'menu_gallery':{'en':'Gallery','es':'Galería','fr':'Galerie', 'pt':'Galeri...
import re import os import base64 try: # Python 3 from urllib.parse import urlencode except (ImportError): # Python 2 from urllib import urlencode from .json_api_client import JSONApiClient from ..downloaders.downloader_exception import DownloaderException # Used to map file extensions to formats _r...
from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, connections from django.db.migrations.executor import MigrationExecutor from django.db.migrations.loader import AmbiguityError class Command(BaseCommand): help = "Prints the SQL statements for the named migra...
""" An example of how to use DataFrame for ML. Run with:: bin/spark-submit examples/src/main/python/ml/dataframe_example.py <input> """ from __future__ import print_function import os import sys import tempfile import shutil from pyspark.sql import SparkSession from pyspark.mllib.stat import Statistics from pyspa...
""" Functions to display an error (error, warning or information) message. """ from lib.hachoir_core.log import log from lib.hachoir_core.tools import makePrintable import sys, traceback def getBacktrace(empty="Empty backtrace."): """ Try to get backtrace as string. Returns "Error while trying to get back...
""" These are tests for disabling and enabling student accounts, and for making sure that students with disabled accounts are unable to access the courseware. """ import unittest from student.tests.factories import UserFactory, UserStandingFactory from student.models import UserStanding from django.conf import setting...
""" Use this class to fork off a thread to recieve event callbacks from the bitbake server and queue them for the UI to process. This process must be used to avoid client/server deadlocks. """ import socket, threading, pickle, collections from xmlrpc.server import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler class ...
#!/usr/bin/env python import os import shutil import glob import time import sys import subprocess import string from optparse import OptionParser, make_option SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) PKG_NAME = os.path.basename(SCRIPT_DIR) PARAMETERS = None #XW_ENV = "export DBUS_SESSION_BUS_ADDRESS=...
from __future__ import absolute_import import warnings from .. import exc as sa_exc from .. import util import re def testing_warn(msg, stacklevel=3): """Replaces sqlalchemy.util.warn during tests.""" filename = "sqlalchemy.testing.warnings" lineno = 1 if isinstance(msg, util.string_types): ...
#!/usr/bin/env python # Written by <EMAIL> # 2014-04-29 import json import os import sys from pprint import pprint import commands paramList = sys.argv if len(paramList) <= 1: print "USAGE " + paramList[0] + " <ELB name>" sys.exit(2) elbName = paramList[1] cmd = "/usr/local/bin/aws --profile nagiosro elb d...
from ._base import Node __all__ = ["Comment"] class Comment(Node): """Represents a hidden HTML comment, like ``<!-- foobar -->``.""" def __init__(self, contents): super().__init__() self.contents = contents def __str__(self): return "<!--" + self.contents + "-->" @property ...
""" Module-wide logging configuration for spinel package. """ import logging import logging.config DEBUG_ENABLE = 0 DEBUG_TUN = 0 DEBUG_HDLC = 0 DEBUG_STREAM_TX = 0 DEBUG_STREAM_RX = 0 DEBUG_LOG_PKT = DEBUG_ENABLE DEBUG_LOG_SERIAL = DEBUG_ENABLE DEBUG_LOG_PROP = DEBUG_ENABLE DEBUG_CMD_RESPONSE = 0 DEBUG_EXPERIMENT...
from absl import flags import googleapiclient.discovery # GCP PROJECT = flags.DEFINE_string("project", default=None, help="GCP Project ID. Required") NAMESPACE = flags.DEFINE_string( "namespace", default=None, help="Isolate GCP resources using giv...
import numpy as np import ctypes as ct import matplotlib.pyplot as plt import sys import time import os sys.path.insert(1, os.path.dirname(os.path.realpath(__file__))+'/..') from modules.example_helpers import * # Record settings number_of_records = 1000 samples_per_record = 512 # Plot data if set to True plot_dat...
""" Test the views served by third_party_auth. """ import ddt from lxml import etree from onelogin.saml2.errors import OneLogin_Saml2_Error import unittest from django.conf import settings from .testutil import AUTH_FEATURE_ENABLED, SAMLTestCase # Define some XML namespaces: from third_party_auth.tasks import SAML_...
"""A setuptools based setup module. See: https://packaging.python.org/en/latest/distributing.html https://github.com/pypa/sampleproject """ # To use a consistent encoding from codecs import open from os import path # Always prefer setuptools over distutils from setuptools import setup, find_packages here = path.abs...
ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} from xml.etree import ElementTree from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.network.cloudengine.ce import get_nc_config, set_nc_config, ce_argu...
from Structure import Structure; # http://www.w3.org/Graphics/GIF/spec-gif89a.txt class GIF_EXTENSION_COMMENT(Structure): type_name = 'COMMENT_EXTENSION'; def __init__(self, stream, offset, max_size, parent, name): import C; from GIF_BLOCK import GIF_BLOCK; Structure.__init__(self, stream, offs...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os, traceback, glob, threading import datetime as dt import numpy as np from . import printutil as pu DEFAULTVECTOR_DIR = os.path.expanduser('~/workspace/img-buff/motions/vector') MACROSQURE = 16 # 人間が...
from __future__ import unicode_literals import datetime from django.forms import TimeField, ValidationError from django.test import SimpleTestCase from . import FormFieldAssertionsMixin class TimeFieldTest(FormFieldAssertionsMixin, SimpleTestCase): def test_timefield_1(self): f = TimeField() s...
import sys import xml.dom import xml.dom.minidom import string from os.path import dirname from compiler import parse, walk import types import pprint import pyunparse import compiler.ast as ast from types import ListType, TupleType class ClassNotFound: def __init__(self, name): self.name = name ...
#!/usr/bin/env python3 import csv import os import multiprocessing import multiprocessing.pool import sys import tempfile import traceback import threading import gi gi.require_version('Gdk', '3.0') gi.require_version('PangoCairo', '1.0') gi.require_version('Poppler', '0.18') from paperwork_backend import config fro...
""" Package providing filter rules for GRAMPS. """ from ._allnotes import AllNotes from ._hasidof import HasIdOf from ._regexpidof import RegExpIdOf from ._matchesregexpof import MatchesRegexpOf from ._matchessubstringof import MatchesSubstringOf from ._hasreferencecountof import HasReferenceCountOf from ._noteprivate...
"""Fix incompatible renames Fixes: * sys.maxint -> sys.maxsize """ # based on Collin Winter's fix_import # Local imports from .. import fixer_base from ..fixer_util import Name, attr_chain MAPPING = {"sys": {"maxint" : "maxsize"}, } LOOKUP = {} def alternates(members): return "(" + "|".join(map(rep...
"""Utility module for reftests.""" from HTMLParser import HTMLParser class ExtractReferenceLinkParser(HTMLParser): def __init__(self): HTMLParser.__init__(self) self.matches = [] self.mismatches = [] def handle_starttag(self, tag, attrs): if tag != "link": retur...
#!/usr/bin/env python from PySide import QtGui, QtCore from PySide.QtCore import Qt, QEventLoop, QEvent, QObject from juma.core import * from juma.core.ModelManager import * from juma.qt.helpers import addWidgetWithLayout, restrainWidgetToScreen from juma.qt.IconCache import getIcon from ui.array_view_container...
# Python stubs generated by omniidl from ../idl/EventChannelAdmin.idl import omniORB, _omnipy from omniORB import CORBA, PortableServer _0_CORBA = CORBA _omnipy.checkVersion(2,0, __file__) # #include "CosNaming.idl" import CosNaming_idl _0_CosNaming = omniORB.openModule("CosNaming") _0_CosNaming__POA = omniORB.openM...
""" __init__.py Initialization of the module signetsim.views.json.validators """ from .MathValidator import MathValidator from .FloatValidator import FloatValidator from .SbmlIdValidator import SbmlIdValidator from .UnitIdValidator import UnitIdValidator from .ModelNameValidator import ModelNameValidator from .User...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } DOCUMENTATION = r''' --- module: vmware_tag short_description: Manage VMware tags description: - This module can be use...
""" Verify the settings that cause a set of programs to be created in a specific build directory, and that no intermediate built files get created outside of that build directory hierarchy even when referred to with deeply-nested ../../.. paths. """ import TestGyp # TODO(mmoss): Make only supports (theoretically) a s...
#!/usr/bin/env python from __future__ import division import sys; sys.path.insert(1, "../..") import h2o from tests import pyunit_utils def test_load_sparse(): try: import scipy.sparse as sp except ImportError: return A = sp.csr_matrix([[1, 2, 0, 5.5], [0, 0, 3, 6.7], [4, 0, 5, 0]]) f...
import uuid from datetime import datetime import hmac from base64 import b64encode from django.conf import settings from django.utils import timezone from zeep import Client, xsd from agir.payments.models import Subscription from agir.system_pay import SystemPayError from agir.system_pay.utils import get_recurrence_r...
""" Base IO code for all datasets """ # Copyright (c) 2007 David Cournapeau <<EMAIL>> # 2010 Fabian Pedregosa <<EMAIL>> # 2010 Olivier Grisel <<EMAIL>> # License: BSD 3 clause import os import csv import shutil from os import environ from os.path import dirname from os.path import join fro...
#!/usr/bin/env python3 import os import re import math import json import yaml import numpy as np import tensorflow as tf from . import dataset def test(sess, network, mesh_type, mesh_size, model_dir, input_path, output_path): # Initialise global variables ...
#!/usr/bin/python #coding=utf-8 import sys import os import utils from core.common import GlobalVar from config_nginx import generate_config_file def copy_file(opts, src_file, ip, dst): try: os.system("sshpass -p %s scp -r %s %s %s@%s:%s" % (opts.pwd, " ".join(utils.ssh_args()), src_file, opts.user, ip, ds...
import time import rb from gi.repository import GObject, Gio, GLib, Peas from gi.repository import RB from zeitgeist.client import ZeitgeistClient from zeitgeist.datamodel import Event, Subject, Interpretation, Manifestation try: IFACE = ZeitgeistClient() except RuntimeError as e: print("Unable to connect to...
# data fixing script # # as you can imagine, the data entries may contain some semi-correct # values, which we need to adapt. this is done in this file. def fix_data(data): """ updates given input with modifications. input: empiresdat object, vanilla, fully read. output: empiresdat object, fixed. ...
# -*- coding: utf-8 -*- import os import base64 import logging import pymongo from modularodm import fields from framework.auth import Auth from website.addons.base import exceptions from website.addons.base import AddonUserSettingsBase, AddonNodeSettingsBase, GuidFile from website.addons.base import StorageAddonBas...
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. """ from django.core.urlresolvers import reverse from django.test import TestCase from django.test.utils import override_settings from django...
import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk from collections import OrderedDict GRID_MARGIN = 5 ICON_SIZE = Gtk.IconSize.MENU class ModifyGrid(Gtk.Grid): def __init__(self): Gtk.Grid.__init__(self) self.generate_labels() self.generate_entries() self.at...
# -*- coding: utf-8 -*- """ file: keyIO.py Description: an IO module for CoNLL-formatted files when column identifiers are available. author: Yoann Dupont MIT License Copyright (c) 2018 Yoann Dupont Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated docume...
import json from django.contrib.postgres import forms, lookups from django.contrib.postgres.fields.array import ArrayField from django.core import exceptions from django.db.models import Field, TextField, Transform from django.utils import six from django.utils.translation import ugettext_lazy as _ __all__ = ['HStore...
import functools from django.core.exceptions import PermissionDenied from olympia.access.acl import action_allowed from olympia.amo.decorators import login_required def admin_required(reviewers=False, theme_reviewers=False): """ Admin, or someone with AdminTools:View, required. If reviewers=True ...
# valueIterationAgents.py # ----------------------- # Licensing Information: Please do not distribute or publish solutions to this # project. You are free to use and extend these projects for educational # purposes. The Pacman AI projects were developed at UC Berkeley, primarily by # John DeNero (<EMAIL>) and Dan Klein...
from __future__ import unicode_literals from django.db.transaction import atomic class Migration(object): """ The base class for all migrations. Migration files will import this from django.db.migrations.Migration and subclass it as a class called Migration. It will have one or more of the follow...