src
stringlengths
721
1.04M
""" Module for definition of shared constants between the modules. This file is part of Pisi. Pisi 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 ...
__author__ = "Travis Goldie" __email__ = "test_automation@us.sios.com" __date__ = "11/14/12" __copyright__ = "(c) SIOS Technology Corp 2012" #For unittesting import os import sys from time import sleep sys.path.insert(0, r"C:\Program Files\dk_test\libs") from dkconfig import dkconfig from exect...
# Copyright The IETF Trust 2007, 2009, All Rights Reserved from django.conf.urls import patterns, url from django.contrib.auth.views import login, logout urlpatterns = patterns('ietf.ietfauth.views', url(r'^$', 'index', name='account_index'), # url(r'^login/$', 'ietf_login'), url(r'^login/$', l...
from PyQt4 import QtCore, QtGui, uic import os from implementation.primaries.GUI.helpers import get_base_dir from implementation.primaries.GUI import themedWindow class PlaylistDialog(QtGui.QDialog, themedWindow.ThemedWindow): def __init__(self, app, theme, themes, design_folder): QtGui.QDialog.__init__...
#!/usr/bin/env python3 from flask import Flask, request from flask_restful import Resource, Api from bs4 import BeautifulSoup import requests from time import strptime,strftime,mktime,gmtime,localtime import json import os app = Flask(__name__) api = Api(app) result = [] resultSet = {"present_contests":[],"upcomin...
"""<module> This module generates an html page that lists all classes """ import pdb from PyHtmlGen.gen import * from PyHtmlGen.document import * from PyHtmlGen.htmldoc import * from PyHtmlGen.bar import * # from layoutstyle import * from PyHtmlGen.layouttable import * from PyHtmlGen.table import * from PyHtmlGen.imag...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('snisi_reprohealth', '0002_auto_20141008_1709'), ] operations = [ migrations.RenameField( model_name='aggpfactivi...
# -*- coding: utf-8 -*- ## ## $id$ ## ## This file is part of Indico. ## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN). ## ## Indico 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 Foundati...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Populate bulk metadata tables from delimited text files. """ # # Copyright (C) 2011-2014 University of Dundee. All rights reserved. # # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as p...
import os import logging import claripy from . import ExplorationTechnique, Cacher from .. import BP_BEFORE from ..calling_conventions import SYSCALL_CC from ..errors import AngrTracerError, SimMemoryError, SimEngineError from ..storage.file import SimFile l = logging.getLogger("angr.exploration_techniques.tracer")...
""" deploy with varnish: - apt-get install varnish - create /etc/default/varnish - create /etc/varnish/main.vcl - create /etc/varnish/sites.vcl - create /etc/varnish/sites/ (and require it to contain the correct include!) - create /etc/varnish/sites/{app.name}.vcl - /etc/init.d/varnish restart - adapt nginx site con...
# Copyright (C) 2014-2015 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014-2015 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014-2015 David Barragán <bameda@dbarragan.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 # pub...
#!/usr/bin/python -u # # generate python wrappers from the XML API description # functions = {} lxc_functions = {} qemu_functions = {} enums = {} # { enumType: { enumConstant: enumValue } } lxc_enums = {} # { enumType: { enumConstant: enumValue } } qemu_enums = {} # { enumType: { enumConstant: enumValue } } import os...
def main(j, args, params, tags, tasklet): page = args.page data = {'action': args.getTag('id'), 'class': args.getTag('class') or '', 'deleterow': args.getTag('deleterow') or 'false', 'label': args.getTag('label') or '', } extradata = {} tags = j.data.tags...
# Check every path through every method of UserDict from test import support, mapping_tests import collections d0 = {} d1 = {"one": 1} d2 = {"one": 1, "two": 2} d3 = {"one": 1, "two": 3, "three": 5} d4 = {"one": None, "two": None} d5 = {"one": 1, "two": 1} class UserDictTest(mapping_tests.TestHashMappingProtocol): ...
# Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html from __future__ import annotations import time from typing import Callable, Optional import aqt.forms from aqt.qt import * from aqt.utils import TR, disable_help_button, tr # Progress info #...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 The Ontario Institute for Cancer Research. All rights reserved. # # This program and the accompanying materials are made available under the terms of the GNU Public License v3.0. # You should have received a copy of the GNU General Public License along wi...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # File Title: Aria2.py # Author: Selphia # Mail: LoliSound@gmail.com # Time: 2017年07月29日 星期六 21时49分38秒 # Version: import os import shutil print('\033[32mYou will use the /var/www/html directory !!! y/n\033[0m') confirm=input() while True: if confirm == "y" or con...
from datasets.Loader import register_dataset from datasets.Mapillary.MapillaryLike_instance import MapillaryLikeInstanceDataset from datasets.util.Util import username DEFAULT_PATH = "/fastwork/" + username() + "/mywork/data/mapillary/" NAME = "mapillary_instance" @register_dataset("mapillary_instance_full", resolut...
#!/usr/bin/env python from past.utils import old_div import sys import math import requests class URLError(Exception): pass class RequestError(Exception): pass class DataError(Exception): pass class HSTParser(object): # HSTParser will return a list of articles taken from a HST API # (https:...
# -*- coding: utf-8 -*- # # Copyright 2015-2020 BigML # # 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 ...
# SOCO configuration expName = 'SOCO' # Number of sessions per subject numSessions = 1 isEEG = True playAudio = False ############################# # Exp organization ############################# # Number of trials/lists per session numLists = 4 # Number of target stimuli per trial/list study_listLen = 100 # numb...
# Copyright 2012-2016 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """The MAAS command-line interface.""" import os import sys from maascli.parser import get_deepest_subparser, prepare_parser def snap_setup(): if "SNAP" in os.environ...
#!/usr/bin/env python # Scans twitter for trending terms, populates a database with the results and # then creates a json file showing trends based on the data import CreateJson as j import TwitterSearch as t import KeywordSearch as k import Log as l import logging ProcessResult = False FN_NAME = "TrendingTermsSenti...
__author__ = 'yanbo' HEROES = [{'dt_name': 'DT_DOTA_Unit_Hero_AntiMage', 'id': 2, 'localized_name': 'Anti-Mage', 'name': 'npc_dota_hero_antimage'}, {'dt_name': 'DT_DOTA_Unit_Hero_Axe', 'id': 3, 'localized_name': 'Axe', 'name': 'npc_dota_hero_axe'}, {'dt_name': 'DT_DOTA_Unit...
import maya.cmds as cmds def which (program): ''' If application is found, returns path. This works with both full application paths, and applications available within the OS's defined PATH ''' import os def is_exe (fpath): return os.path.isfile(fpath) and os.access(fpath, os.X_OK) ...
from django.db import models from django.utils.translation import ugettext_lazy as _ # Create your models here. from core.models import Event, User class Crew(models.Model): event = models.ForeignKey(Event) name = models.CharField(max_length=64, verbose_name=_('Name')) description = models.TextField(nul...
import re from gi.repository import Gtk from pychess.widgets.ChatView import ChatView from pychess.widgets.ViewsPanel import ViewsPanel from pychess.widgets.InfoPanel import InfoPanel from pychess.widgets.ChannelsPanel import ChannelsPanel TYPE_PERSONAL, TYPE_CHANNEL, TYPE_GUEST, \ TYPE_ADMIN, TYPE_COMP, TYPE_BL...
# -*- coding: utf-8 -*- # Copyright 2014, 2015 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
""" Classes defining user and item latent representations in factorization models. """ import torch.nn as nn from spotlight.layers import ScaledEmbedding, ZeroEmbedding class BilinearNet(nn.Module): """ Bilinear factorization representation. Encodes both users and items as an embedding layer; the score...
import configobj import validate import os import os.path import inspect CONFIG_DIRECTORY = '~/.pymoldyn/' # MUST be written with ~ to save a path in the config file that is relative to the user's home directory CONFIG_FILE = os.path.expanduser('%s/config.cfg' % CONFIG_DIRECTORY) CONFIG_SPEC_FILE = os.path.expanduse...
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not ...
import uuid from datetime import datetime from django.db import models from django.core.exceptions import ValidationError from django.contrib.auth.models import User from django.utils.translation import ugettext_lazy as _ from depot.models import Depot, Item class Rental(models.Model): """ A rental defines th...
from __future__ import division from __future__ import print_function from scipy.ndimage.filters import generic_filter from collections import defaultdict from raster_ops import extract, reclassify_from_data, geometry_mask, \ write_tif import numpy as np import csv import math import os # Enableing DEBUG will w...
#!/usr/bin/env python #encoding=utf8 #Copyright [2014] [Wei Zhang] #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 ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ :py:mod:`weblayer.base` provides default :py:class:`~weblayer.interfaces.IRequest` and :py:class:`~weblayer.interfaces.IResponse` implementations, based purely on `webob.Request`_ and `webob.Response`_. The two implementations, :py:class:`Request` and :py:...
""" SkCode cosmetics replacement utility code. """ import re # Default cosmetics replacement map (compiled regex) DEFAULT_COSMETICS_MAP = ( (re.compile(r'(\s+)---(\s+)'), r'\1—\2'), (re.compile(r'(\s+)--(\s+)'), r'\1—\2'), (re.compile(r'\.\.\.'), r'…'), (re.compile(r'\(tm\)'), r'™'), ) # Document a...
from __future__ import division import sys from os import listdir from table import * from os.path import isfile, join from settings import * from cart_de import * from sk import * from time import strftime from rf_cart_prediction import * def myrdiv(d): def pre(dist): l=dist.items()[0][-1] k = dist.items()[0][0]...
#---------------------------------------------------------------------- # Name: wx.lib.flashwin # Purpose: A class that allows the use of the Shockwave Flash # ActiveX control # # Author: Robin Dunn # # Created: 22-March-2004 # RCS-ID: $Id: flashwin.py 26301 2004-03-23 05:2...
"""Compare values, fields, and records for similarity""" import collections import logging from dedupe.dale import similarity as dale from dedupe.levenshtein import similarity as levenshtein from dedupe.compat import OrderedDict as _OrderedDict LOG = logging.getLogger('dedupe.sim') class Convert(object): """Ge...
#!/usr/bin/env python3 # -*- mode: python; -*- # # Copyright 2015 Canonical, Ltd. # # 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 lat...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) BrowseInfo (http://browseinfo.in) # Copyright (C) Didotech SRL # This program is free software: you can redistribute it and/or modify # it un...
""" GhIssueStatsSerializer.py - (C) Copyright - 2017 This software is copyrighted to contributors listed in CONTRIBUTIONS.md. SPDX-License-Identifier: MIT Author(s) of this file: J. Harding Serializer for issue stats of a GitHub repo. """ import datetime from rest_framework import serializers as s from ..models i...
""" Functions for running PySnobal as well as SMRF and Pysnobal threaded together 20170731 Micah Sandusky """ from datetime import datetime import numpy as np import pandas as pd import pytz import smrf.framework from topocalc.shade import shade from smrf.envphys import sunang from smrf.utils import queue from awsm...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Mar 15 18:05:20 2017 @author: franklin """ #!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Mar 15 13:30:33 2017 @author: franklin """ ''' Find the time and value of max load for each of the regions COAST, EAST, FAR_WEST, NORTH, NORT...
from logger import logger from perfrunner.helpers.cbmonitor import timeit, with_stats from perfrunner.helpers.worker import ( pillowfight_data_load_task, pillowfight_task, ) from perfrunner.tests import PerfTest from perfrunner.workloads.pathoGen import PathoGen from perfrunner.workloads.tcmalloc import Workloa...
import unittest from mock import patch import alexa_main TEST_APPLICATION_ID = "aPpLiCaTiOnId12345" TEST_REQUEST_ID = "rEqUeStId123" class TestAlexaMain(unittest.TestCase): def setUp(self): alexa_main.config.APPLICATION_ID = TEST_APPLICATION_ID @patch("alexa_main.events.on_session_started") @p...
import csv import sys import json import time import numpy as np sys.path.append('../../utility') import yamanishi_data_util as yam sys.path.append('../cluster/kmedoid') import kmedoid as kmed def main(): if len(sys.argv)!=6: print ("python blmniisvm_experiment.py [e|ic|gpcr|nr] [clustMethod] " ...
import os import sys import re import time import datetime import subprocess import panoptes.utils.logger as logger from .utils.config import load_config @logger.has_logger class AbstractCamera(object): """ Abstract Camera class """ pass def __init__(self, config=dict()): """ Init...
import click from kamcli.cli import pass_context from kamcli.iorpc import command_ctl @click.group( "shv", help="Manage $shv(name) variables", short_help="Manage $shv(name) variables", ) @pass_context def cli(ctx): pass @cli.command("get", short_help="Get the value for $shv(name)") @click.argument("...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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 cop...
""" Copyright 2015 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 agreed to in writing, software di...
#!/usr/bin/python # Combat Simulator Project # Copyright (C) 2002-2009 The Combat Simulator Project # http://csp.sourceforge.net # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version...
from contextlib import contextmanager from copy import deepcopy from pathlib import PosixPath from log import log # WISH: zahodit (z annotate, bootstrap, create_model, majka, makefile, split_corpus a test_configure) ShellPath = PosixPath class ExpandableList(list): def __init__(self, iterable): super()....
config = { "interfaces": { "google.firestore.admin.v1.FirestoreAdmin": { "retry_codes": { "idempotent": ["DEADLINE_EXCEEDED", "INTERNAL", "UNAVAILABLE"], "non_idempotent": [], }, "retry_params": { "default": { ...
#!/usr/bin/env python import sys from setuptools import setup from setuptools.command.test import test as TestCommand requires = ['func_prototypes>=0.5.0', 'docopt', 'delnone', 'future', 'safeoutput>=2.0', 'filetype==1.0.6', "S3Lib>=1.4.0", 'tqdm'] test_requires = ['tox', 'pytest==4.6.8', 'tabulate'] setup( name...
import struct import datetime # File Download CMD_START_FILE_DOWNLOAD = 0x40 CMD_GET_FILE_METADATA = 0x41 CMD_GET_FILE_DOWNLOAD_STATUS = 0x42 CMD_CANCEL_FILE_DOWNLOAD = 0x43 CMD_GET_FILE_DATA = 0x44 class FileMixins(object): def start_file_download(self, fileid): """Start file download :param i...
"""Semantic distance metrics. """ """ ============================== License ======================================== Copyright (C) 2008, 2010-12 University of Edinburgh, Mark Granroth-Wilding This file is part of The Jazz Parser. The Jazz Parser is free software: you can redistribute it and/or modify it under...
import discover.util from mock import patch from nose.tools import eq_ from discover.util import convert_to_milliseconds, DEFAULT_TIMEOUT_MS def test_convert_to_milliseconds_for_timeout_in_hours(): # When: I convert timeout to 'ms' timeout_ms = convert_to_milliseconds('1h') # Then: Expected timeout (int...
#!/usr/bin/env python ############################################################################### # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License...
# Brachyprint -- 3D printing brachytherapy moulds # Copyright (C) 2013-14 James Cranch, Martin Green and Oliver Madge # # 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 ver...
#(C) Copyright Syd Logan 2017-2019 #(C) Copyright Thousand Smiles Foundation 2017-2019 # #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 req...
# Copyright 2015 Novo Nordisk Foundation Center for Biosustainability, DTU. # # 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 requi...
import os import numpy as np from osgeo import gdal import scipy.stats import ospybook as pb # Set this variable to your osgeopy-data directory so that the following # examples will work without editing. We'll use the os.path.join() function # to combine this directory and the filenames to make a complete path. Of # ...
""" Tests installation of our library. """ import glob import os import shutil import sys import tarfile import threading import unittest import stem import stem.util.system import test.util from test.util import only_run_once INSTALL_MISMATCH_MSG = "Running 'python setup.py sdist' doesn't match our git contents i...
# coding: utf-8 """ Cloudbreak API Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloud...
# coding=utf-8 # Copyright 2019 The Interval Bound Propagation 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 ...
# Third-party imports import pytest # Local imports import uplink # Constants BASE_URL = "https://api.github.com" class GitHubError(Exception): pass @uplink.response_handler def github_error(response): if "errors" in response.json(): raise GitHubError() return response @uplink.timeout(10) cl...
# -*- coding: utf-8 -*- """Utilities to evaluate the predictive performance of models Functions named as ``*_score`` return a scalar value to maximize: the higher the better Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better """ # Authors: Alexandre Gramfort <alexandr...
"""Various tests on satisfiability using dimacs cnf file syntax You can find lots of cnf files in ftp://dimacs.rutgers.edu/pub/challenge/satisfiability/benchmarks/cnf/ """ import os from diofant.logic.algorithms.dpll import dpll_satisfiable from diofant.logic.algorithms.dpll2 import \ dpll_satisfiable as dpll2_sa...
# This Python module is part of the PyRate software package. # # Copyright 2020 Geoscience Australia # # 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/...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015 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) any later...
# Criação de amostras de treino (70%) e amostras de avaliação (30%) consideradas ideais para cada um dos factores condicionanes - por ideal entenda-se: cada classe de cada factor tem 70% dos pontos que a intersectam definidos como ocorrências para treino e tem 30% para validação - GRASS GIS def cria_objTable(tab, path...
from openerp import netsvc from openerp import models, fields, api from openerp.tools.translate import _ import openerp.addons.decimal_precision as dp from datetime import datetime from openerp.osv import osv import time class wizard_stock_internal_transfer(models.TransientModel): _name = 'wizard.stock.internal.trans...
#!/usr/bin/env python2 """ This source code is protected by the BSD license. See the file "LICENSE" in the source code root directory for the full language or refer to it here: http://opensource.org/licenses/BSD-3-Clause Copyright 2015, 2016 Will Farmer and Ken Farmer """ from __future__ import division import sys...
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserve. # #Licensed under the Apache License, Version 2.0 (the "License"); #you may not use this file except in compliance with the License. #You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #Unless required by applicable...
# -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. import pytest from pootle_statistics.models...
#!/usr/bin/python # Graphical Kickstart Script # # This script was written by Frank Caviggia, Red Hat Consulting # edit by Jason Ricles, Mikros Systems Corp # Last update was 7 December 2015 # This script is NOT SUPPORTED by Red Hat Global Support Services. # Please contact Josh Waldman for more information. # # Author...
# -*- coding: utf-8 -*- """ Local settings - Run in Debug mode - Use console backend for emails - Add Django Debug Toolbar - Add django-extensions as app """ import socket import os from .base import * # noqa # DEBUG # ------------------------------------------------------------------------------ DEBUG = env.bool...
#!/usr/bin/env python3 import re, itertools, random, copy, os from collections import defaultdict from subprocess import Popen, PIPE from os.path import isfile from types import SimpleNamespace Globals = SimpleNamespace(path=os.path.abspath(__file__)[:-9], unknown_error=True, flat=False, partial=True, keepmeta=True, sp...
#!/usr/bin/python import json import socket import sys import time import os import array import math import sqlite3 import mongo import db import sensor import xdriplib WixelData = {"_id":0,"TransmitterId":"00000","CaptureDateTime":0,"RelativeTime":0,"ReceivedSignalStrength":0,"RawValue":0,"TransmissionId":0,"Batter...
""" Business logic tier regarding social engagement scores """ import logging import sys from collections import defaultdict from datetime import datetime import pytz from django.conf import settings from django.db.models.signals import post_save, pre_save from django.dispatch import receiver from django.http import ...
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <headingcell level=1> # Exploring the Lorenz System of Differential Equations # <markdowncell> # In this Notebook we explore the Lorenz system of differential equations: # # $$ # \begin{aligned} # \dot{x} & = \sigma(y-x) \\ # \dot{y} & = \rho x - y - xz \\ # \do...
from pytest import fixture, mark from transaction import commit @fixture(scope='module') def url(testing): return testing.route_url('password-change') @mark.user('alice') def test_change_password(browser, url, alice): data = dict(password='foo!', current='alice') browser.put_json(url, data) assert a...
# coding=utf8 ''' @author : quanticio44 @contact : quanticio44@gmail.com @license : See with Quanticio44 @summary : metaoperation for rsync complete @since : 22/08/2014 ''' #Standard package import os import hashlib import zipfile import tarfile #Internal package import backupstoredbfile import to...
import json import copy from util.json_request import JsonResponse from django.http import HttpResponseBadRequest from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_http_methods from django_future.csrf import ensure_csrf_cookie from edxmako.shortcuts import rende...
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
"""Metrics to assess performance on classification task given class prediction Functions named as ``*_score`` return a scalar value to maximize: the higher the better Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better """ # Authors: Alexandre Gramfort <alexandre.gramf...
#!/bin/env python # # Obdi - a REST interface and GUI for deploying software # Copyright (C) 2014 Mark Clarkson # # 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...
#! /usr/bin/python3 import sys import os import threading import decimal import time import json import re import requests import collections import logging from logging import handlers as logging_handlers D = decimal.Decimal import apsw import flask from flask.ext.httpauth import HTTPBasicAuth from tornado.wsgi impo...
#!/usr/bin/env python # -*- coding: utf-8 -*- # https://launchpad.net/wxbanker # currconverttests.py: Copyright 2007-2010 Mike Rooney <mrooney@ubuntu.com> # # This file is part of wxBanker. # # wxBanker is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public...
__all__ = ["split_syllable_char", "split_syllables", "join_jamos", "join_jamos_char", "CHAR_INITIALS", "CHAR_MEDIALS", "CHAR_FINALS"] import itertools INITIAL = 0x001 MEDIAL = 0x010 FINAL = 0x100 CHAR_LISTS = { INITIAL: list(map(chr, [ 0x3131, 0x3132, 0x3134, 0x3137, 0x3138, 0x3139, ...
import codecs import csv import json import re import warnings import codecs from openpyxl import load_workbook, Workbook from time import strftime from django.contrib.auth.models import User from django.forms.models import model_to_dict from django.http import JsonResponse, Http404, HttpResponse from django.shortcuts...
# Copyright (c) 2011, Robert Escriva # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of condition...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from __future__ import absolute_import from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponseNotFound, \ HttpResponseForbidden, HttpResponseRedirect from django.shortcuts import redirect, get_object_or_404, get...
# The Hazard Library # Copyright (C) 2012 GEM Foundation # # 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 Software Foundation, either version 3 of the # License, or (at your option) any later version. # # Th...
# Copyright 2009 Lee Harr # # This file is part of pybotwar. # # Pybotwar 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. # # Pybotwar ...
# -*- coding: utf-8 -*- # # This file is part of NINJA-IDE (http://ninja-ide.org). # # NINJA-IDE 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 # any later version. # # NIN...
"""Tests for declarative JSONAPISerializer serialize method.""" import unittest import datetime from sqlalchemy import ( create_engine, Column, String, Integer, ForeignKey, Boolean, DateTime) from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import backref, relationship, sessionmaker fr...
# flake8: noqa # There's no way to ignore "F401 '...' imported but unused" warnings in this # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...