src
stringlengths
721
1.04M
# tests.test_utils.test_statistics # Testing for the statistics utility module. # # Author: Benjamin Bengfort <bengfort@cs.umd.edu> # Created: Tue Aug 23 13:40:49 2016 -0400 # # Copyright (C) 2016 University of Maryland # For license information, see LICENSE.txt # # ID: test_statistics.py [] benjamin@bengfort.com $ ...
""" List of layer classes for building protobuf layer parameters from python """ from .layer_headers import Layer, LossLayer, DataLayer from .layer_helpers import assign_proto, Filler from apollocaffe.proto import caffe_pb2 class CapSequence(Layer): def __init__(self, name, sequence_lengths, **kwargs): su...
#!/usr/bin/env python """ Seed demonstration ================== """ from datetime import datetime, timedelta import numpy as np from opendrift.models.oceandrift import OceanDrift from opendrift.models.openoil import OpenOil o = OceanDrift(loglevel=50) #%% # We do not care about landmask or current for this seeding d...
from django.contrib import admin from stocks.models import * class StockAdmin(admin.ModelAdmin): list_display = ['name', 'unit_measure', 'unit_price', 'category_slug'] ordering = ['name'] search_fields = ('name',) class DonorAdmin(admin.ModelAdmin): list_display = ['name', 'contact_no', 'address', 'r...
""" Module to plot profile data. For memory time-line with memory usage and number of blocks through time you can use the following command: python -m profiling memory timeline DATA_ROOT/*_memory.data For the latency of sampling, you can use the following plot: python -m profiling latency scatter DATA_ROOT/...
"Database cache backend." from django.core.cache.backends.base import BaseCache from django.db import connection, transaction, DatabaseError import base64, time from datetime import datetime try: import cPickle as pickle except ImportError: import pickle class CacheClass(BaseCache): def __init__(self, tab...
import unittest from kbmod import * class test_search(unittest.TestCase): def setUp(self): # test pass thresholds self.pixel_error = 0 self.velocity_error = 0.05 self.flux_error = 0.15 # image properties self.imCount = 20 self.dim_x = 80 self.dim_y = 60 self.n...
# Copyright 2015 Google Inc. 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 a...
import os from os.path import dirname, realpath, join import random from queue import Queue import aiohttp import demjson import re import asyncio import io import telepot import telepot.aio from telepot.aio.loop import MessageLoop from message import Message WD = dirname(realpath(__file__)) plugins = [] public_plu...
import fractions from . import primitives from . import exceptions from .defaults import default_crypto_random from .primes import get_prime, DEFAULT_ITERATION class RsaPublicKey(object): __slots__ = ('n', 'e', 'bit_size', 'byte_size') def __init__(self, n, e): self.n = n self.e = e ...
from django.utils.translation import ugettext_lazy as _, string_concat ATTRIBUTES = ( ('crazy', _('Crazy')), ('cool', _('Cool')), ('hot', _('Hot')), ('deep', _('Deep')), ('fun', _('Fun')), ('classic', _('Classic')), ) def attributeToString(attribute): return dict(ATTRIBUTES)[attribute] CARD_TY...
# coding: utf-8 from __future__ import unicode_literals, division import shutil import time """ This module implements error handlers for QChem runs. Currently tested only for B3LYP DFT jobs. """ import copy import glob import json import logging import os import re import tarfile from pymatgen.core.structure impor...
# Copyright (C) 2014 Saggi Mizrahi, Red Hat Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY...
# Written by Sam Deans. # Twitter/GitHub: @sdeans0 # Licensed under the Apache License, Version 2.0 (see below) # This program is for turning matching type Moodle questions to Cloze type questions in # Moodle xml format. # Run it from the command line by importing the moduleand running the # matchToCloze.main('file...
"""Tests suite for Period handling. Parts derived from scikits.timeseries code, original authors: - Pierre Gerard-Marchant & Matt Knox - pierregm_at_uga_dot_edu - mattknow_ca_at_hotmail_dot_com """ from datetime import datetime, date, timedelta from numpy.ma.testutils import assert_equal from pandas import Timesta...
from __future__ import absolute_import, division, print_function, unicode_literals import pytest from gratipay.testing import Harness from gratipay.models.team.tip_migration import AlreadyMigrated, migrate_all_tips class Tests(Harness): def setUp(self): self.admin = self.make_participant('admin', is_adm...
"""Hook specifications for tox - see https://pluggy.readthedocs.io/""" import pluggy hookspec = pluggy.HookspecMarker("tox") @hookspec def tox_addoption(parser): """ add command line options to the argparse-style parser object.""" @hookspec def tox_configure(config): """Called after command line options ar...
# -*- coding: utf-8 -*- import os.path from datetime import datetime from djzbar.settings import INFORMIX_EARL as INFORMIX_EARL DEBUG = False INFORMIX_DEBUG = '' REQUIRED_ATTRIBUTE = False ADMINS = ( ('', ''), ) MANAGERS = ADMINS DATABASES = { 'default': { 'HOST': '127.0.0.1', ...
# Copyright 2015, Aiven, https://aiven.io/ # # This file is under the Apache License, Version 2.0. # See the file `LICENSE` for details. from . import geohash, statsd from .daemon import ServiceDaemon from .senders import ( AWSCloudWatchSender, ElasticsearchSender, FileSender, GoogleCloudLoggingSender, KafkaSender,...
#! /usr/bin/env python from __future__ import print_function from openturns import * from cmath import * TESTPREAMBLE() RandomGenerator.SetSeed(0) try: # Instanciate one distribution object distribution = FisherSnedecor(5.5, 10.5) print("Distribution ", repr(distribution)) print("Distribution ", dist...
#!/usr/bin/python import nltk import nltk.data from nltk.util import ngrams from nltk.tokenize import word_tokenize import MySQLdb mHost = "10.240.119.20" mUser = "root" mPasswd = "cis700fall2014" mDb = "cis700" mCharset = "utf8" conn = MySQLdb.connect(host=mHost,user=mUser,passwd=mPasswd,db=mDb,charset=mCharset) c...
# -*- coding: UTF-8 -*- # Copyright 2017 Rumma & Ko Ltd # License: GNU Affero General Public License v3 (see file COPYING for details) """ This started as a copy of :mod:`lino.modlib.bootstrap`. .. autosummary:: :toctree: views renderer models """ from lino.api.ad import Plugin class Plugin(Plugin)...
# -*- coding: utf-8 -*- # This file is part of Shoop. # # Copyright (c) 2012-2015, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. import os from django.core.exceptions import ImproperlyConfigured from sho...
# Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import os.path from UM.Resources import Resources from UM.Application import Application from UM.PluginRegistry import PluginRegistry from UM.View.RenderPass import RenderPass from UM.View.RenderBatch import RenderBatch f...
""" Tests absolute box size with ignored selection """ import os import pytest dir = os.path.dirname(__file__) + "/" #============================================================================== @pytest.mark.skip(reason="Missing input file") def test_absolute_box(tmpdir): """ Tests the absolute box size for...
#!/usr/bin/python2 # Julien Michel june 2007 # usage is getAverageProfile.py file1.dat file2.dat file3.dat # where fileX can be an electron density profile, or a lateral pressure profile. # can probably be used for other outputs like electron pressure profile etc... import os,sys averages = [] resized = False for f...
from __future__ import unicode_literals import base64 from datetime import datetime import pytz from moto.core import BaseBackend, BaseModel from moto.core.utils import iso_8601_datetime_without_milliseconds from .exceptions import IAMNotFoundException, IAMConflictException, IAMReportNotPresentException from .utils i...
#! /usr/bin/python from __future__ import print_function import os import sys import time import random import string import subprocess from _lib.bootstrapping import bootstrap_env, from_project_root, requires_env, from_env_bin from _lib.ansible import ensure_ansible bootstrap_env(["base"]) from _lib.params import ...
import DeepFried2 as df import numpy as _np from warnings import warn as _warn from numbers import Number as _Number def create_param_state_as(other, initial_value=0, prefix='state_for_'): return df.th.shared(other.get_value()*0 + initial_value, broadcastable=other.broadcastable, name=prefix + str...
from django.conf import settings from django.contrib import messages from django.contrib.auth.views import password_change from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404 from django.views.generic import FormView, RedirectView fro...
import github_api import util from config.config import CONFIG_VARS as cvar from datetime import datetime, timedelta def flag_if_submitted_through_github(repo_username, repo_id, issue): return False # temporarily disabling ionitron """ Flags any issue that is submitted through github's UI, and not the Io...
import re from datetime import datetime from dateutil.relativedelta import relativedelta import engine import data.search.elastic as elastic from models.exceptions import DataIntegrityError from models.employer import Employer from models.job import Job from models.applicant import Applicant from models.location imp...
########## # LD 22 # The theme is alone # it's a dumb theme # fiona wrote this ########## # System and Python lib imports import sys sys.path += ['.'] # Game engine imports from myrmidon.myrmidon import MyrmidonGame, MyrmidonProcess from myrmidon.consts import * from pygame.locals import * # Game imp...
#coding=UTF-8 from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext from pyspark.sql.types import * from datetime import date, datetime, timedelta import sys, re, os st = datetime.now() conf = SparkConf().setAppName('PROC_M_MID_PER_ASSETS').setMaster(sys.argv[2]) sc = SparkContext(conf = conf) sc.s...
# yellowbrick.utils.helpers # Helper functions and generic utilities for use in Yellowbrick code. # # Author: Benjamin Bengfort <bbengfort@districtdatalabs.com> # Created: Fri May 19 10:39:30 2017 -0700 # # Copyright (C) 2017 District Data Labs # For license information, see LICENSE.txt # # ID: helpers.py [79cd8cf] ...
# Copyright (C) 2013 Johannes Dewender # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is dis...
# -*- coding: utf-8 -*- # # Copyright 2015 Telefonica Investigación y Desarrollo, S.A.U # # This file is part of fiware-cygnus (FI-WARE project). # # fiware-cygnus 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 Foun...
# -*- coding: utf-8 -*- import datetime import logging from sqlalchemy import and_, func from base_manager import BaseManager from ..models import Scan, scan_records, Genre # All scans with no activity for this long are considered stalled INACTIVITY_PERIOD = datetime.timedelta(seconds=600) # Update interval UPDATE_...
""" homeassistant.util.template ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Template utility methods for rendering strings with HA data. """ # pylint: disable=too-few-public-methods import json import logging import jinja2 from jinja2.sandbox import ImmutableSandboxedEnvironment from homeassistant.const import STATE_UNKNOWN from home...
# Copyright 2014 Red Hat, 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 agr...
# -*- coding: utf-8 -*- ''' Manage EC2 .. versionadded:: 2015.8.0 This module provides an interface to the Elastic Compute Cloud (EC2) service from AWS. The below code creates a key pair: .. code-block:: yaml create-key-pair: boto_ec2.key_present: - name: mykeypair - save_private: /root/ ...
""" Note: this is a really abbreviated version of sebastian's full pubchem bot that simply gets the pubchem ID from an inchikey Adapted from: https://github.com/sebotic/cdk_pywrapper/blob/master/cdk_pywrapper/chemlib.py """ import json import time import requests import wikidataintegrator.wdi_core as wdi_core clas...
from django.db import models class JobGroup(models.Model): name = models.TextField() nanny_creation_date = models.DateTimeField('date created', auto_now_add=True) def new_job(self, **args): return Job.objects.create(group=self, **args) def __repr__(self): return "<Job group: {name} ({n_jobs} jobs)>".format(n...
# -*- coding: utf-8 -*- """ Created on 2017-4-25 @author: cheng.li """ import os SKIP_ENGINE_TESTS = True if not SKIP_ENGINE_TESTS: try: DATA_ENGINE_URI = os.environ['DB_URI'] except KeyError: DATA_ENGINE_URI = "mysql+mysqldb://reader:Reader#2020@121.37.138.1:13317/vision?char...
from itertools import product import numpy as np import theano from theano import tensor from pylearn2.models.mlp import (MLP, Linear, Softmax, Sigmoid, exhaustive_dropout_average, sampled_dropout_average, CompositeLayer) from pylearn2.space import Vec...
# -*- coding: utf-8 -*- from __future__ import absolute_import from ..init import compilecards from .common import fsdecode from .posix import has_hidden_attribute as _has_hidden_attribute from .posix import has_archive_attribute, is_archived WILDCARDS = ( '*.DS_Store', '.AppleDouble', '.LSOverride', 'Icon', '....
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'aboutwin.ui' # # Created: Mon Feb 18 04:26:37 2013 # by: PyQt4 UI code generator 4.9.6 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except Attrib...
from unittest import TestCase from mediawords.languages.ro import RomanianLanguage # noinspection SpellCheckingInspection class TestRomanianLanguage(TestCase): def setUp(self): self.__tokenizer = RomanianLanguage() def test_language_code(self): assert self.__tokenizer.language_code() == "ro...
# -*- coding: utf-8 -*- """Shared functionality for delimiter separated values output modules.""" from __future__ import unicode_literals from plaso.output import formatting_helper from plaso.output import interface class DSVEventFormattingHelper(formatting_helper.EventFormattingHelper): """Delimiter separated va...
# coding=utf-8 """ Similar to syntax_color.py but this is intended more for being able to copy+paste actual code into your Django templates without needing to escape or anything crazy. http://lobstertech.com/2008/aug/30/django_syntax_highlight_template_tag/ Example: {% load highlighting %} <style> @import url("h...
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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...
# alignlib - a library for aligning protein sequences # # $Id: test_Alignment.py,v 1.3 2004/01/23 17:34:58 aheger Exp $ # # Copyright (C) 2004 Andreas Heger # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Softw...
#!/usr/local/bin/python import solr import sys, traceback # This file is for (for example) Apache with mod_wsgi. import sys, os # import sys # sys.path.insert(0, '../configuration/') # The purpose of this file is to take the standard # datafiles and load them into SOLR in such a way that they # will be searchable....
#!/usr/bin/python import contextlib import datetime import os import sys from time import time, gmtime import unicodedata import dropbox #from dropbox.files import FileMetadata, FolderMetadata #################################### def upload(dbx, fullname, folder, subfolder, name, overwrite=False): """Upload a f...
import sst # Define SST core options sst.setProgramOption("timebase", "1ps") sst.setProgramOption("stopAtCycle", "0 ns") # Define the simulation components comp_cpu = sst.Component("cpu", "miranda.BaseCPU") comp_cpu.addParams({ "verbose" : 0, "generator" : "miranda.SingleStreamGenerator", "generatorParams.verbose"...
# -*- coding: utf-8 -*- from PyQt5.QtCore import QCoreApplication from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QPushButton ''' @author : Zhou Jian @email : zhoujian@hust.edu.cn @version : V1.1 @date : 2018.04.22 ''' class BaseButton(QPushButton): ''' 基类按钮 ''' def __init__(self, name...
from __future__ import print_function import datetime import os.path import test_lib as test import sys import unittest sys.path.insert(1, os.path.abspath('..')) sys.path.insert(1, os.path.abspath('../lib')) from sickbeard.name_parser import parser import sickbeard sickbeard.SYS_ENCODING = 'UTF-8' DEBUG = VERBOSE ...
from functools import lru_cache from django.conf import settings from elasticsearch import TransportError from questionnaire.models import Questionnaire from .index import get_elasticsearch from .utils import get_alias, ElasticsearchAlias es = get_elasticsearch() def get_es_query( filter_params: list=None,...
# Copyright 2015 The Tornado Authors # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
from django.db import migrations from extras.choices import CustomFieldTypeChoices def deserialize_value(field, value): """ Convert serialized values to JSON equivalents. """ if field.type in (CustomFieldTypeChoices.TYPE_INTEGER): return int(value) if field.type == CustomFieldTypeChoices....
# # The Qubes OS Project, https://www.qubes-os.org/ # # Copyright (C) 2015 Joanna Rutkowska <joanna@invisiblethingslab.com> # Copyright (C) 2015 Wojtek Porczyk <woju@invisiblethingslab.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License ...
from django.forms import Form, ModelForm, CharField, ChoiceField from django.forms.models import ( modelformset_factory, inlineformset_factory, BaseInlineFormSet, ) from django.forms.formsets import formset_factory, BaseFormSet import selectable.forms as selectable from awards.models import LocalAwar...
# -*- coding: utf-8 -*- from django.core.exceptions import ValidationError from django.db.models import Q from django.forms import ModelForm, TextInput, Textarea, NumberInput, ModelChoiceField, DateTimeInput, Select, SelectMultiple \ , ModelMultipleChoiceField, FileInput, HiddenInput from django.forms.models import...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Leave Management', 'version': '1.5', 'category': 'Human Resources', 'sequence': 85, 'summary': 'Holidays, Allocation and Leave Requests', 'website': 'https://www.odoo.com/page/employee...
"""Python API for the lab streaming layer. The lab streaming layer provides a set of functions to make instrument data accessible in real time within a lab network. From there, streams can be picked up by recording programs, viewing programs or custom experiment applications that access data streams in real time. The...
import unittest from typing import Type from nichtparasoup_placeholders import DummyImage from nichtparasoup.imagecrawler import BaseImageCrawler from nichtparasoup.testing.imagecrawler import ImageCrawlerLoaderTest _DUMMYIMAGE_RIGHT_CONFIG = {'width': 800, 'height': 600} class DummyImageConfigCorrect(unittest.Tes...
# Copyright (c) 2021 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...
# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ from django.views.generic import View, ListView from django.http import HttpResponse from django.utils import simplejson as json from filizver.forms import TopicForm class ExtraContextMixin(View): """ A mixin that passes ``extra_c...
from pyramid.response import Response from pyramid.view import view_config from pyramid.httpexceptions import HTTPForbidden from pyramid import request from sqlalchemy.exc import DBAPIError from ..models.mymodel import MyModel, request_log, access_log, banlist from ..settings import get_settings import datetime @view...
#!/usr/bin/env python3 import sqlite3 from sqlite3 import IntegrityError import logging from pepe import Pepe queries = {"init_pepe_hashes_tbl": "CREATE TABLE IF NOT EXISTS pepe_hashes (" "hash VARCHAR(128) NOT NULL," "banned BIT DEFAULT 'TRUE'," ...
#!/usr/bin/env python import sys import vtk from PyQt4 import QtGui from vtk.qt4.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor class MainWindow(QtGui.QMainWindow): def __init__(self, parent=None): QtGui.QMainWindow.__init__(self, parent) self.frame = QtGui.QFrame() self....
# Copyright 2021 Google LLC. 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 o...
from random import choice class Player(object): """ A base Python class to represent game players. """ def __init__(self, chameleon): super(Player, self).__init__() self.hand = [] # the five cards that the player has. self.penalty = [] # the penalty pile that belongs to the pl...
# Copyright 2015 Google Inc. 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 ag...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org) # 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 witho...
import unittest from six.moves import StringIO from robot.running import TestSuite from robot.utils.asserts import assert_equals, assert_raises_with_msg def run(suite, **config): result = suite.run(output=None, log=None, report=None, stdout=StringIO(), stderr=StringIO(), **config) retu...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function, absolute_import, division from logging.handlers import SysLogHandler import logging import os import signal import sys import time import atexit import psutil from pwd import getpwnam from grp import getgrnam from signal import SIGT...
""" Django settings for the mail.api project. Rename this file to settings.py and replace the "CHANGEME" string in configuration options to use these sample settings. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see http...
# Standard library imports from typing import List from enum import Enum # Third party imports import numpy as np # Local application imports # -------------------- class MW_SRC_MODE(str, Enum): """ Operating mode for the microwave source. SINGLE - outputs at fixed frequency with fixed power SWEEP - ...
import argparse from bottle import get, run, response, static_file, redirect from jinja2 import Environment, PackageLoader import config parser = argparse.ArgumentParser(prog=config.name, description=config.description) parser.add_argument('--port', type=int, ...
from direct.directnotify import DirectNotifyGlobal from toontown.toonbase import ToontownGlobals from toontown.toonbase import TTLocalizer from otp.nametag import NametagGlobals from direct.gui.DirectGui import * from pandac.PandaModules import * from direct.showbase import DirectObject from toontown.toon import ToonAv...
# -*- coding: utf-8 -*- # This file is part of Shoop. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals from decimal import Decimal import...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os class FileNotFoundError(Exception): def __init__(self, filename): Exception.__init__(self, filename) class StatInfo(object): '''The r...
#-*- coding:utf-8 -*- from django import forms from django.contrib.auth.models import User from app.userApp.models import AikeUser, MessageBoard class UserRegisterForm(forms.ModelForm): username = forms.EmailField(label=u"*用户名(邮箱)") password = forms.CharField(widget=forms.PasswordInput,label=u"*密码") ...
import base64 import datetime import sys import argparse from azure.keyvault.generated.models import KeyVaultErrorException from python.key_vault_agent import KeyVaultAgent from azure.keyvault.generated import KeyVaultClient CLIENT_ID = '8fd4d3c4-efea-49aa-b1de-2c33c22da56e' class KeyVaultCryptoAgent(KeyVaultAgent...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # button.py # # Copyright 2016 notna <notna@apparat.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the Licens...
#!/usr/bin/env python # # Use the raw transactions API to spend bitcoins received on particular addresses, # and send any change back to that same address. # # Example usage: # spendfrom.py # Lists available funds # spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00 # # Assumes it will talk to a bitcoind or Bit...
""" GANs with Autoencoder based on a combined cost function. """ from keras.models import Sequential from keras.layers import Dense, Merge from keras.layers import Reshape from keras.layers.core import Activation from keras.layers.normalization import BatchNormalization from keras.layers.convolutional import UpSampli...
""" .. module:: analyze :synopsis: Extract data from chains and produce plots .. moduleauthor:: Karim Benabed <benabed@iap.fr> .. moduleauthor:: Benjamin Audren <benjamin.audren@epfl.ch> Collection of functions needed to analyze the Markov chains. This module defines as well a class :class:`Information`, that sto...
# Copyright 2019 Microsoft Corporation # # 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...
#!/usr/bin/env python3 # RAAED Server software: v1.0 # A GUI RAAED Server # Detects a reverse SSH connection bound to port 22 from an RAAED Client. # # DESCRIPTION # The server is designed to continually check for the prescence of a reverse SSH session on port 22. # The GUI will then reflect the presence of the revers...
# This file is part of the Juju GUI, which lets users view and manage Juju # environments within a graphical interface (https://launchpad.net/juju-gui). # Copyright (C) 2012-2013 Canonical Ltd. # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public...
# encoding: utf-8 """ USAGE: twitter [action] [options] ACTIONS: authorize authorize the command-line tool to interact with Twitter follow follow a user friends get latest tweets from your friends (default action) help print this help text that you are currently reading leave ...
from django.conf.urls import include, url from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.contrib import admin from django.conf import settings import xbrowse_server.base.views.igv_views import xbrowse_server.base.views.family_group_views import xbrowse_server.base.views.reference_views...
import io import os from distutils.file_util import copy_file from setuptools import setup, find_packages __version__ = None with open('sendgrid/version.py') as f: exec(f.read()) def getRequires(): deps = [ 'python_http_client>=3.2.1', 'starkbank-ecdsa>=1.0.0' ] return deps dir_path...
from __future__ import print_function import sys from setuptools import find_packages from setuptools import setup v = sys.version_info if v[:2] < (3, 6): error = "ERROR: jupyterhub-kubespawner requires Python version 3.6 or above." print(error, file=sys.stderr) sys.exit(1) setup( name='jupyterhub-k...
from bs4 import BeautifulSoup import gethtml import re import urlparse #gets titles def getURLs (rss): Titles = [] soup = BeautifulSoup(gethtml.getHtmlText(rss)) for item in soup.findAll('item'): #link tag cut off after stripping for item... only </link> is there for i in item.findAll('title...
# -*- coding: utf-8 -*- from model.contact import * import re import pytest # фикстуры теста def test_add_contact(app, db, json_contacts_personinfo, json_contacts_contactinfo, check_ui): personinfo = json_contacts_personinfo contactinfo = json_contacts_contactinfo with pytest.a...
#!/usr/bin/env python2 ################################################## # GNU Radio Python Flow Graph # Title: Output Window # Generated: Sat Apr 30 16:45:27 2016 ################################################## if __name__ == '__main__': import ctypes import sys if sys.platform.startswith('linux'): ...