code
stringlengths
1
199k
import argparse import optparse import sys import unittest import mock from telemetry.command_line import parser from telemetry import benchmark from telemetry import project_config class ParserExit(Exception): pass class ParserError(Exception): pass class ExampleBenchmark(benchmark.Benchmark): @classmethod def...
from __future__ import absolute_import __version__ = '1.0b4' from . import exceptions from .client import StorymarketClient from .categories import Category, CategoryManager, SubcategoryManager from .subtypes import Subtype, SubtypeManager from .content import (Audio, Data, Photo, Text, Video, AudioManager, ...
from django.db import models from apps.titulos.models.CarreraJurisdiccional import CarreraJurisdiccional from apps.titulos.models.EstadoCarreraJurisdiccional import EstadoCarreraJurisdiccional import datetime """ Representa los estados por los que pasa cada carrera jurisdiccional """ class CarreraJurisdiccionalEstado(m...
from functools import partial from itertools import product from pgcli.packages.parseutils.meta import FunctionMetadata, ForeignKey from prompt_toolkit.completion import Completion from prompt_toolkit.document import Document from unittest.mock import Mock import pytest parametrize = pytest.mark.parametrize qual = ["if...
""" PASSIVE Plugin for Testing for Web Application Fingerprint (OWASP-IG-004) """ from owtf.managers.resource import get_resources from owtf.plugin.helper import plugin_helper DESCRIPTION = "Third party resources and fingerprinting suggestions" def run(PluginInfo): mapping = [ ["All", "CMS_FingerPrint_All"]...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('accounts', '0003_auto_20150227_2158'), ] operations = [ migrations.AlterField( model_name='userprofile', name='email_on_comment_a...
""" pyClanSphere.upgrades ~~~~~~~~~~~~~~~~~~~~~ This package implements various classes and functions used to manage the database. :copyright: (c) 2010 by the Zine Team, (c) 2010 by the pyClanSphere Team, see AUTHORS for more details. :license: BSD, see LICENSE fo...
import six from agate import Table from agate.data_types import Boolean, Date, DateTime, Number, Text, TimeDelta from agate.testcase import AgateTestCase from agate.type_tester import TypeTester class TestJSON(AgateTestCase): def setUp(self): self.rows = ( (1, 'a', True, '11/4/2015', '11/4/2015 ...
from nose.tools import assert_raises import gevent from zerorpc import zmq import zerorpc def test_close_server_socket(): endpoint = 'ipc://test_close_server_socket_' server_events = zerorpc.Events(zmq.XREP) server_events.bind(endpoint) server = zerorpc.ChannelMultiplexer(server_events) client_event...
from optparse import OptionParser import networkx as nx from geo_graph import geo_stats, geo_cluster, geo_reduce, geo_filter_nones from geo_graph import GeoGraphProcessor, geo_check_for_isolated from geo_graph import geo_box_reduce, CITIES_WORLD, CITIES_AMERICA, CITIES_WESTCOAST, CITIES_EUROPE from geo_graph import CIT...
""" Support for MQTT locks. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/lock.mqtt/ """ import asyncio import logging import voluptuous as vol from homeassistant.core import callback from homeassistant.components.lock import LockDevice from homeassistan...
""" Django settings for councilmatic project. Generated by 'django-admin startproject' using Django 1.8.3. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ import os f...
from jsonrpc import ServiceProxy import sys import string rpcuser = "" rpcpass = "" if rpcpass == "": access = ServiceProxy("http://127.0.0.1:8332") else: access = ServiceProxy("http://"+rpcuser+":"+rpcpass+"@127.0.0.1:8332") cmd = sys.argv[1].lower() if cmd == "backupwallet": try: path = raw_input("Enter destinat...
""" Implementation of the class `Force`. A `Force` object contains information about an instantaneous force (e.g., fx or fy). """ import numpy from scipy import signal class Force(object): """ Contains info about an instantaneous force. """ def __init__(self, times=None, values=None, label=None): """ In...
from .helpers.aspherical_lens import check_point as check_point_asph from .helpers.spherical_lens import check_point as check_point_sph from .helpers.dimensions import mm2px from .helpers.output import output_array_to_file, output_png size_x = 8000 size_y = 6000 lam = 0.6 # mm lam_px = 100 n_sph = 3.14 n_asph = 1.5 d_...
import requests def get_data(zipcode): payload = {'zip': zipcode, 'units': 'imperial', 'appid': 'b73db8c0f065450acf87c6598cbfd37c', 'cnt': '16'} r = requests.get('http://api.openweathermap.org/data/2.5/forecast/daily', params=payload) if r.status_code != 200: print('problem getting data') ex...
import requests from allauth.socialaccount.providers.oauth2.views import ( OAuth2Adapter, OAuth2CallbackView, OAuth2LoginView, ) from .provider import InstagramProvider class InstagramOAuth2Adapter(OAuth2Adapter): provider_id = InstagramProvider.id access_token_url = 'https://api.instagram.com/oauth...
from django.contrib import admin from models import * class AulaAdmin(admin.ModelAdmin): pass admin.site.register(Aula, AulaAdmin)
import unittest from tornado.httputil import HTTPConnection, HTTPHeaders, HTTPServerRequest from airbrake.airbrake import _traceback_line class Context(object): remote_ip = "127.0.0.1" def http_request(uri, method="GET", body=None, headers=None): _headers = headers or dict() conn = HTTPConnection() conn...
from argparse import ArgumentParser class GooeyParser(object): def __init__(self, **kwargs): self.__dict__['parser'] = ArgumentParser(**kwargs) self.widgets = {} @property def _mutually_exclusive_groups(self): return self.parser._mutually_exclusive_groups @property def _actions(sel...
''' Configuration object ==================== The :class:`Config` object is an instance of a modified Python ConfigParser. See the `ConfigParser documentation <http://docs.python.org/library/configparser.html>`_ for more information. Kivy has a configuration file which determines the default settings. In order to chang...
"""Shared functionality useful across multiple structural variant callers. Handles exclusion regions and preparing discordant regions. """ import collections from contextlib import closing import os import numpy import pybedtools import pysam import toolz as tz import yaml from bcbio import bam, utils from bcbio.distri...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('competition', '0004_auto_20150511_1246'), ] operations = [ migrations.AlterField( model_name='competition', name='enforce_payment...
""" Django settings for demo project. 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 https://docs.djangoproject.com/en/1.6/ref/settings/ """ import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) SECRET_KEY = '0+...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/lair/eopie/shared_lair_eopie_mountain.iff" result.attribute_template_id = -1 result.stfName("lair_n","eopie_mountain") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
question = "What did you have for lunch?" print (question) answer = input() #You should use "input()" in python 3.x, because python 3.x #doesn't have a function named "raw_input". print ("You had " + answer + "! That sounds delicious!")
from msrest.serialization import Model class RegenerateCredentialParameters(Model): """The parameters used to regenerate the login credential. :param name: Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' :type name: s...
import sys import textwrap import py, pytest import _pytest.assertion as plugin from _pytest.assertion import reinterpret from _pytest.assertion import util needsnewassert = pytest.mark.skipif("sys.version_info < (2,6)") PY3 = sys.version_info >= (3, 0) @pytest.fixture def mock_config(): class Config(object): ...
from chainer.backends import cuda from chainer import optimizer _default_hyperparam = optimizer.Hyperparameter() _default_hyperparam.lr = 0.01 _default_hyperparam.momentum = 0.9 class NesterovAGRule(optimizer.UpdateRule): """Update rule for Nesterov's Accelerated Gradient. See :class:`~chainer.optimizers.Nester...
""" starter code for the evaluation mini-project start by copying your trained/tested POI identifier from that you built in the validation mini-project the second step toward building your POI identifier! start by loading/formatting the data """ import pickle import sys sys.path.append("../ud120-pro...
import hashlib import sys import os from random import SystemRandom import base64 import hmac if len(sys.argv) < 2: sys.stderr.write('Please include username as an argument.\n') sys.exit(0) username = sys.argv[1] cryptogen = SystemRandom() salt_sequence = [cryptogen.randrange(256) for i in range(16)] hexseq = l...
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Verify that invoking scons-test with an unknown argument generates the appropriate error message and exits non-zero. """ import os import TestSCons_time test = TestSCons_time.TestSCons_time() expect = """\ scons-time: Unknown subcommand "unknown". Type "...
''' Biligrab Lite 0.21 Beining@ACICFG cnbeining[at]gmail.com http://www.cnbeining.com MIT licence ''' import sys import os from StringIO import StringIO import gzip import urllib2 import hashlib from xml.dom.minidom import parseString global vid global cid global partname global title global videourl global part_now gl...
""" Utilities for local system calls, everything here is cross-platform. become_daemon was originally taken from Django: https://github.com/django/django/commit/5836a5771f2aefca83349b111f4191d6485af1d5#diff-f7d80be2ccf77f4f009d08dcac4b7736 We might want to refactor this into: system/__init__.py system/posix.py system/w...
from . import base class ShardProc(base.TestProcFilter): """Processor distributing tests between shards. It simply passes every n-th test. To be deterministic it has to be placed before all processors that generate tests dynamically. """ def __init__(self, myid, shards_count): """ Args: myid: id...
import platform import re from awscli.compat import urlopen, URLError from awscli.customizations.codedeploy.systems import System, Ubuntu, Windows, RHEL from socket import timeout MAX_INSTANCE_NAME_LENGTH = 100 MAX_TAGS_PER_INSTANCE = 10 MAX_TAG_KEY_LENGTH = 128 MAX_TAG_VALUE_LENGTH = 256 INSTANCE_NAME_PATTERN = r'^[A-...
from __future__ import print_function class Solution: # @return an integer def trailingZeroes(self, n): result = 0 while n > 0: result += n / 5 n /= 5 return result if __name__ == "__main__": print(Solution().trailingZeroes(100))
from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_wookiee_lifeday_female1.iff" result.attribute_template_id = 9 result.stfName("npc_name","wookiee_base_female") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
import os import subprocess import shutil OBJDUMP = "objdump" DLL_NAME_PREFIX = 'DLL Name:' paths = filter(lambda line: not "windows" in line.lower(), os.environ['PATH'].split(os.pathsep)) def find_in_path(file): for path in paths: fullpath = os.path.join(path, file) if os.path.isfile(fullpath)...
import http.server import string import click import pathlib import urllib.parse import os @click.command() @click.argument("port", required=False) @click.option("-s", "--server", default="0.0.0.0") def main(port, server): if not port: port = 8888 http_server = http.server.HTTPServer((server, port), Pos...
import pymongo import re from passlib.hash import md5_crypt from datetime import datetime conn = pymongo.Connection("localhost", 27017) members = conn["continue"]["members"] members_init_fields = ["member_id", "fullname", "password"] def insert_to_db(line): infos = line.split() member = { "fullname": in...
from matplotlib.widgets import Lasso import matplotlib.path as mplpa from matplotlib.pyplot import gca from numpy import nonzero,array class lasso_plot: """ The class is designed to select the datapoints by drawing the region around it. Example: plot(xs, ys, ps=3 ) # first plot the data las = lasso_...
import os import sys import gemstone sys.path.insert(0, os.path.abspath('.')) autoclass_content = 'both' extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.todo', 'sphinx.ext.viewcode' ] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = 'gemstone' copyright = '2016, Vlad Ca...
import yaml import sys from glob2 import glob class Cli(object): """Command-line Application""" file_path = '**/locale/en.yaml' def __init__(self): self.text = yaml.load(open(glob(self.file_path)[0]).read()) self.option = False self.args = [] def dashboard(self): print se...
from sklearn_pmml import pmml from sklearn_pmml.convert.features import Feature, NumericFeature, CategoricalFeature, RealNumericFeature from sklearn_pmml.convert.gbrt import * from sklearn_pmml.convert.tree import * from sklearn_pmml.convert.random_forest import * from sklearn_pmml.convert.model import * from sklearn_p...
from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/draft_schematic/food/shared_dessert_ryshcate.iff" result.attribute_template_id = -1 result.stfName("string_id_table","") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
import sys import os extensions = [] templates_path = ['_templates'] source_suffix = '.rst' master_doc = 'index' project = 'BitEx' copyright = '2016, Nils Diefenbach' author = 'Nils Diefenbach' version = '0.08' release = '0.08' language = None exclude_patterns = ['_build'] pygments_style = 'sphinx' todo_include_todos =...
"""we_are_social URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Cla...
import nltk, re, shelve, time ''' written by Joe Wallace, October 2017 use 'help(type(self)) for list of methods ''' class Play(): def __init__(self, filename='FirstFolio.txt', title=None): '''initializer produces list of titles, full text of play and, if it has regular act breaks, individual acts a...
import sys, string, os from xml.dom import minidom, Node from datetime import datetime, timedelta from Core.Common.FUtils import FindXmlChild, GetXmlContent, ParseDate from StandardDataSets.scripts import JudgeAssistant tagLst = ['library_visual_scenes', 'visual_scene', 'asset', 'modified'] attrName = '' attrVal = '' d...
from .resource import Resource class Snapshot(Resource): """Snapshot resource. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Resource Id :vartype id: str :ivar name: Resource name :vartype name: str :ivar type: Resource type :vartyp...
__all__ = ['RenderPackage'] import os from pyasm.common import * from pyasm.prod.biz import FrameRange class RenderPackage(Base): '''A package that is delivered to render submissions which contains all the information needed to render''' def __init__(self, policy=None): self.sobject = None s...
"""Common support for editable text. @note: If you want editable text functionality for an NVDAObject, you should use the EditableText classes in L{NVDAObjects.behaviors}. """ import time import api from baseObject import ScriptableObject import braille import speech import config import eventHandler from scriptHandle...
""" EasyBuild support for software that uses the GNU installation procedure, i.e. configure/make/make install, implemented as an easyblock. @author: Stijn De Weirdt (Ghent University) @author: Dries Verdegem (Ghent University) @author: Kenneth Hoste (Ghent University) @author: Pieter De Baets (Ghent University) @author...
from __future__ import absolute_import from __future__ import division from functools import partial import logging import os from vdsm.network.ipwrapper import Link from vdsm.network.link import bridge as br from .misc import visible_devs BRIDGING_OPT = '/sys/class/net/%s/bridge/%s' bridges = partial(visible_devs, Lin...
import logging from autotest.client.shared import error from spice.lib import act from spice.lib import stest from lib4x import driver from lib4x.admin_portal import admin_login logger = logging.getLogger(__name__) @error.context_aware def run(vt_test, test_params, env): """Download SeleniumHQ server, and copy it t...
""" This is an special module, it provides stuff used by setup.py and by pygit2 at run-time. """ from binascii import crc32 import codecs import os from os import getenv from os.path import abspath, dirname import sys __version__ = '0.22.1' def _get_libgit2_path(): # LIBGIT2 environment variable takes precedence ...
from gi.repository import Gtk from gramps.gui.editors import EditSource, EditCitation from gramps.gui.listmodel import ListModel, NOSORT from gramps.gen.plug import Gramplet from gramps.gui.dbguielement import DbGUIElement from gramps.gen.errors import WindowActiveError from gramps.gen.const import GRAMPS_LOCALE as glo...
import gtk from confpacupdate import ConfPacupdate class PreferencesWindows: conf_options = [['update_interval', '60'], ['notification_delay', '10']] def destroy(self, widget): ''' Destroy a window ''' self.window.destroy() def create_frame(self, parent, label): ...
from baseilc import BaseILC from util import * class physsim(BaseILC): """ Responsible for the physsim installation. """ def __init__(self, userInput): BaseILC.__init__(self, userInput, "physsim", "physsim") self.hasCMakeBuildSupport = False self.hasCMakeFindSupport = False self....
""" This module stores the RotationDialog class which controls the rotation dialog. The module contains only the RotationDialog class. It controls the behaviour of the data-rotation dialog. """ from gi.repository import Gtk from matplotlib.figure import Figure from matplotlib.gridspec import GridSpec from matplotlib.ba...
from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import QApplication from rpg import Base from rpg.gui.wizard import Wizard import logging import sys def main(): base = Base() app = QApplication(sys.argv) base.conf.parse_cmdline() if base.conf.load_dnf: base.sack = base.dnf_load_s...
""" Basic TestCases for BTree and hash DBs, with and without a DBEnv, with various DB flags, etc. """ import os import errno import string from pprint import pprint import unittest import time from test_all import db, test_support, verbose, get_new_environment_path, \ get_new_database_path DASH = '-' class Vers...
import re import os.path import logging import sys import requests reload(sys) sys.setdefaultencoding("utf-8") class Joomla_rce(object): def __init__(self): print("[*] Checking Joomla 1.5 - 3.4.5 Remote Code Execution...") def check(self, url): if not url.endswith('/'): url += '/' ...
"""twisted.conch.ui is home to the UI elements for tkconch. This module is unstable. Maintainer: U{Paul Swartz<mailto:z3p@twistedmatrix.com>} """
import os import shutil import subprocess import tempfile import unittest import asyncio import qubes import qubes.tests VM_PREFIX = "test-" @unittest.skipUnless(os.path.exists('/usr/bin/rpmsign') and os.path.exists('/usr/bin/rpmbuild'), 'rpm-sign and/or rpm-build not installed...
"""Record librarie data.""" from apiary.tasks import BaseApiaryTask import requests import logging import HTMLParser import re import semantic_version LOGGER = logging.getLogger() class RecordLibrariesTask(BaseApiaryTask): def run(self, site_id, sitename, api_url): """Get extensions from the website and wri...
""" Copyright (C) 2018-2018 plugin.video.youtube SPDX-License-Identifier: GPL-2.0-only See LICENSES/GPL-2.0-only for more information. """ from .json_store import JSONStore from .api_keys import APIKeyStore from .login_tokens import LoginTokenStore __all__ = ['JSONStore', 'APIKeyStore', 'LoginTokenStore']
import sys import pdb as bp def F(): a,b = 0,1 yield a yield b while True: a, b = b, a + b bp.set_trace() yield b def SubFib(startNumber, endNumber): for cur in F(): if cur > endNumber: return if cur >= startNumber: yield cur if __name__ == '__main__': ...
from ..helpers import arguments from ..helpers.orm import Ignore from ..helpers.command import Command @Command('abuse', ['config', 'db', 'handler'], admin=True) def cmd(send, msg, args): """Shows or clears the abuse list Syntax: {command} <--clear|--show> """ parser = arguments.ArgParser(args['config']...
import os os.chdir(os.getcwd()) fileOne = open("sql_keywords") fileTwo = open("sql_reserved_words") newFileOne = open("new_sql_keywords", "w+") newFileTwo = open("new_sql_reserved_words", "w+") fileOneContents = [] fileTwoContents = [] for line in fileOne: lineContents = line.split(", ") for word in lineContent...
from __future__ import absolute_import from __future__ import division """ This isn't really integral to the way VDSM works this is just an example on how to do permutations. """ from testlib import permutations, expandPermutations from testlib import VdsmTestCase as TestCaseBase def recSum(lst): if not lst: ...
import multiprocessing N_CPU = multiprocessing.cpu_count() from threading import Thread try: import queue except ImportError: import Queue as queue import numpy import numba def bilinear_interp(data, xCoords, yCoords, interpArray, bounds_check=True): """ A function which deals with numba interpolation. ...
from django.forms.widgets import ClearableFileInput from django.utils.encoding import force_text from django.utils.safestring import mark_safe from ckeditor.widgets import CKEditorWidget from django.forms import ModelForm from django.contrib.admin.widgets import FilteredSelectMultiple from .models import TaskSubmission...
""" This script contains the timings in dictionary formats for runs -- see the files run_mgs2_d_1024_k20c.txt, run_mgs2_d_2048_k20c.txt, run_mgs2_d_3072_k20c.txt, run_mgs2_d_4096_k20c.txt, and run_mgs2_d_5120_k20c.txt for the raw outputs of time and the command line arguments of run_mgs2_d --- with run_mgs2_d ...
import cherrypy import os from symbol import * import random from mako.lookup import TemplateLookup _curdir = os.path.join(os.getcwd(), os.path.dirname(__file__)) if 'OPENSHIFT_REPO_DIR' in os.environ.keys(): # 表示程式在雲端執行 data_dir = os.environ['OPENSHIFT_DATA_DIR'] tmp_dir = data_dir + 'tmp' templates_di...
from pyknyx.common import config DEVICE_NAME = "modbus" DEVICE_IND_ADDR = "1.1.1" DEVICE_VERSION = "0.1" config.LOGGER_LEVEL = "info" MODBUS_HOST = "plc" MODBUS_PORT = 502 MODBUS_TIMEOUT = 2. # s MODBUS_UNIT = 180 MODBUS_REFRESH_RATE = 10 # s KNX_TO_MODBUS = { "reg_1": 1, "reg_2": 2, "reg_3": 3, } MODBUS_...
"""DNS Messages""" from __future__ import absolute_import from io import StringIO import struct import time import dns.edns import dns.exception import dns.flags import dns.name import dns.opcode import dns.entropy import dns.rcode import dns.rdata import dns.rdataclass import dns.rdatatype import dns.rrset import dns....
import os import sys from django.utils.translation import ugettext_lazy as _ PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), './')) SITE_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) sys.path.append(os.path.join(PROJECT_ROOT, 'modules')) sys.path.append(os.path.join(PROJEC...
from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } DOCUMENTATION = r''' --- module: ldap_attrs short_description: Add or remove multiple LDAP attribute values description: ...
import gobject import goocanvas import gcompris import gcompris.utils import gcompris.skin import gcompris.admin import gtk import gtk.gdk import random import cairo import pango from gcompris import gcompris_gettext as _ class Gcompris_pythontest: """Testing gcompris python class""" def __init__(self, gcomprisBoar...
type = "passive" def handler(fit, container, context): fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Heavy Assault Missiles"), "thermalDamage", container.getModifiedItemAttr("damageMultiplierBonus"))
""" General description: --------------------- This script shows how to add an individual constraint to the oemof solph OperationalModel. The constraint we add forces a flow to be greater or equal a certain share of all inflows of its target bus. Moreover we will set an emission constraint. Installation requirements: -...
"""Basic tests for the CherryPy core: request handling.""" import os import sys import types import cherrypy from cherrypy._cpcompat import ntou from cherrypy import _cptools, tools from cherrypy.lib import httputil, static from cherrypy.test._test_decorators import ExposeExamples from cherrypy.test import helper local...
""" Provides PlugIn class functionality to develop extentions for xmpppy """ import logging log = logging.getLogger('nbxmpp.plugin') class PlugIn: """ Abstract xmpppy plugin infrastructure code, providing plugging in/out and debugging functionality Inherit to develop pluggable objects. No code change on...
from django import forms from django.contrib.gis import admin from mediastore.admin import MediaAdmin from mediastore.mediatypes.download.models import Download class DownloadAdmin(MediaAdmin): list_display = ('id', 'name', 'file_extension', 'file_size', 'created') list_filter = ('file_extension',) admin.site....
""" Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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 lat...
from __future__ import absolute_import from flask import jsonify from flask_restful import Api, Resource from flask_cors import cross_origin from flask_login import login_required class HemanAPI(Api): pass class BaseResource(Resource): """Base resource """ def options(self, *args, **kwargs): ret...
#!/usr/bin/env python from __future__ import print_function import os import sys sys.path.append(os.getcwd()) import libsimpa as ls import unittest class TestImportSurfaceReceiver(unittest.TestCase): def test_import(self): dat=ls.rsurf_data() resourceFile = os.path.join(os.path.dirname(os.path.real...
from __future__ import unicode_literals from markupsafe import Markup, escape from indico.util.i18n import _ from indico.util.placeholders import Placeholder from indico.web.flask.util import url_for class EventTitlePlaceholder(Placeholder): name = 'event_title' description = _("The title of the event") @cl...
class Parser(object): """ Parser is the base class for all parser implementations. A Parser will parse data and send it to its subscribers. Exactly what an item of data is depends on the particular implementation. The subscribers are then responsible for deciding if they are interested in that particula...
import logging import json import urllib from django.views.generic.base import View from django.views.decorators.csrf import csrf_exempt from django.http import HttpResponse from django.conf import settings from .signals import webhook_signal log = logging.getLogger(__name__) SECURITY_TOKEN = getattr(settings, "WEBHOOK...
from setuptools import find_packages, setup setup( name="pyscript", version="0.6.1", description="Helper functions for WekaPyScript package for WEKA", author="Christopher Beckham", author_email="christopher dot j dot beckham at gmail dot com", platforms=["any"], license="GPLv3", url="htt...
from __future__ import unicode_literals from django.conf import settings import django.contrib.postgres.fields import django.core.validators from django.db import migrations, models import django.db.models.deletion import django.utils.timezone forward = """ SELECT drop_history_view_for_table('catmaid_userprofile'::...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Country' db.create_table('app_country', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=T...
import numpy, os, sys, unittest sys.path.append("@CMAKE_LIBRARY_OUTPUT_DIRECTORY@") import bornagain as ba class Histogram2DTest(unittest.TestCase): def test_constructFromNumpyInt(self): """ Testing construction of 2D histogram from numpy array. Automatic conversion under Python3 is not work...
from abjad.tools import markuptools from abjad.tools import schemetools from abjad.tools.topleveltools import attach from abjad.tools.topleveltools import override def make_dynamic_spanner_below_with_nib_at_right(dynamic_text): r'''Makes dynamic spanner below with nib at right. .. container:: example :...
""" tiponpython Simulacion de ensayos de acuiferos Copyright 2012 Mathias Chubrega This file is part of tiponpython. tiponpython 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 Licens...
""" Library of commonly used functions in kajgps and elsewhere """ from functools import wraps from collections import namedtuple import datetime import codecs import sys import errno import os import csv import kajfmt as fmt import kajhtml from kajhtml import td, tdr, th, thr _debug_object = kajhtml.HTML def start_log...
from pylons import request, response from sqlalchemy import orm from mediadrop.lib.auth.util import viewable_media from mediadrop.lib import helpers from mediadrop.lib.base import BaseController from mediadrop.lib.decorators import (beaker_cache, expose, observable, paginate, validate) from mediadrop.lib.helpers im...