content
stringlengths
4
20k
#Boa:Dialog:peringatan import wx def create(parent): return peringatan(parent) [wxID_PERINGATAN, wxID_PERINGATANLABEL_PERINGATAN, wxID_PERINGATANTOMBOL_KEMBALI_KEMENU, ] = [wx.NewId() for _init_ctrls in range(3)] class peringatan(wx.Dialog): def _init_ctrls(self, prnt): # generated method, don't...
from PyQt5 import QtCore, QtWidgets from friture.audiobackend import AudioBackend class StatisticsWidget(QtWidgets.QWidget): def __init__(self, parent, timer): super().__init__(parent) self.setObjectName("tab_stats") self.stats_scrollarea = QtWidgets.QScrollArea(self) self.stats...
from .resource import Resource class NetworkInterface(Resource): """A network interface in a resource group. Variables are only populated by the server, and will be ignored when sending a request. :param id: Resource ID. :type id: str :ivar name: Resource name. :vartype name: str :iv...
from lino.utils.instantiator import Instantiator, i2d from django.utils.translation import gettext_lazy as _ from lino.api import dd def objects(): #~ slot = Instantiator('courses.Slot','name start_time end_time').build #~ #~ kw = dict(monday=True,tuesday=True,wednesday=False,thursday=True,friday=True) ...
from twisted.words.protocols import irc from txircd.modbase import Command irc.RPL_ADMINLOC1 = "257" irc.RPL_ADMINLOC2 = "258" class AdminCommand(Command): def onUse(self, user, data): user.sendMessage(irc.RPL_ADMINME, self.ircd.name, ":Administrative info for {}".format(self.ircd.name)) user.send...
class Bitly(Service): version = '2.0.1' def __init__(self, login=None, apikey=None, password=None): self.login = login self.apikey = apikey self.password = password def _test(self): # prompt for login self.login = raw_input('bitly login: ') # ask i...
"""Model for storing information to look up isolates. An isolate is a way to describe the dependencies of a specific build. More about isolates: https://github.com/luci/luci-py/blob/master/appengine/isolate/doc/client/Design.md """ from __future__ import print_function from __future__ import division from __future__ ...
import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name='tinyrpc', version='1.0.4', description='A small, modular, transport and protocol neutral RPC ' 'library that, among other things, su...
#!/usr/bin/python ############################################################################# # Simple exampes of map names=["Mary", "Isla", "Sam"] name_lengths = map(len, names) print names print name_lengths nums=[0, 1, 2, 3, 4] squares = map(lambda x: x * x, nums) print nums print squares ###################...
################################################################ # This script will generate a segments file from A+B bed files # ################################################################ import csv import json from config import individuals, chromosomes, data_dir joint = {} for chrom in chromosomes: for ...
# -*- coding: utf-8 -*- """ *************************************************************************** AlgorithmExecutor.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *********************...
"""Tests for the resubmit_error_certificates management command. """ import ddt from django.core.management import call_command from django.core.management.base import CommandError from django.test.utils import override_settings from mock import patch from opaque_keys.edx.locator import CourseLocator from six import te...
import types import sys import copy from pyCoderMain import * from pyCoderClass import * from pyCoderFunc import * # =================================================================== oaversioncode='226p084' oaversion='226.20080327' pyoaversion='226.20080508' # ===========================================...
import pytest from selenium.common.exceptions import WebDriverException class TestElementAttribute(object): def testShouldReturnNullWhenGettingTheValueOfAnAttributeThatIsNotListed(self, driver, pages): pages.load("simpleTest.html") head = driver.find_element_by_xpath("/html") attribute =...
import inspect import os.path import sys from _pydev_bundle._pydev_tipper_common import do_find try: xrange except: xrange = range #completion types. TYPE_IMPORT = '0' TYPE_CLASS = '1' TYPE_FUNCTION = '2' TYPE_ATTR = '3' TYPE_BUILTIN = '4' TYPE_PARAM = '5' def _imp(name, log=None): try: return _...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import warnings from django.forms import ( CharField, ChoiceField, Form, HiddenInput, IntegerField, ModelForm, ModelMultipleChoiceField, MultipleChoiceField, RadioSelect, Select, TextInput, ) from django.test import TestCase from django.utils...
import inspect import os import subprocess import time def _webClientResource(): from girder.api import access from girder.api.describe import describeRoute, Description from girder.api.rest import Resource from girder.constants import ROOT_DIR, registerAccessFlag from girder.exceptions import Res...
import os import sys # dashboard from main.models import SIP # archivematicaCommon from custom_handlers import get_script_logger from fileOperations import renameAsSudo def updateDB(dst, sip_uuid): SIP.objects.filter(uuid=sip_uuid).update(currentpath=dst) def moveSIP(src, dst, sipUUID, sharedDirectoryPath): ...
from marshmallow import fields, post_dump from indico.core.marshmallow import mm from indico.modules.categories import Category from indico.modules.events import Event from indico.modules.search.base import SearchTarget from indico.modules.users.models.users import User from indico.util.marshmallow import NoneRemoving...
"""checker for type annotation. """ import astroid from pylint.interfaces import IAstroidChecker from pylint.checkers import BaseChecker class TypeAnnotationChecker(BaseChecker): __implements__ = IAstroidChecker name = 'TypeAnnotationChecker' msgs = {'E9970': ('Function parameter is missing type annota...
#!/usr/bin/env python2 from __future__ import print_function import re import sys import codecs import subprocess import taptaptap success = lambda x: print(' [ OK ] ' + x) def call_module(filepath): """Call TAP file with module loading and return the metrics tuple""" cmd = u'python -R -t -t -m taptaptap...
""" Whitebox tests for TCP APIs. """ from __future__ import division, absolute_import import errno, socket, os try: import resource except ImportError: resource = None from twisted.python.compat import _PY3 from twisted.trial.unittest import TestCase from twisted.python import log from twi...
#!/usr/bin/env python """ This activity will calculate the ratio between CPU request and Memory request by (job ID, task index, event type). These fields are optional and could be null. """ # It will connect to DataStoreClient from sciwonc.dataflow.DataStoreClient import DataStoreClient import math import sys #######...
""" Support for Denon AVR receivers using their HTTP interface. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.denon/ """ from collections import namedtuple import logging import voluptuous as vol from homeassistant.components.media_playe...
from PyQt4.QtGui import * from PyQt4.QtCore import * from ..view.Ui_PipelineSegmentDialog import * from DamageForm import * from MaintenanceForm import * from DocumentForm import * from ..utils.PluginUtils import PluginUtils from ..model.core_classes import ClIntervalUnit, ClOperatingState from ..model.core_classes imp...
# coding:utf-8 # author by @xiaoyusilen import time from datetime import datetime, timedelta def runTask(func, t, day=0, hour=0, min=0, second=0): # Get current time and format strnow = datetime.now().strftime('%Y-%m-%d %H:%M:%S') # Print the current time print "Current time is: ", strnow # Firs...
from gi.repository import Pango, PangoCairo from ..commons import * import cairo from .shape import Shape from .rectangle_shape import RectangleShape import math X_ALIGN_LEFT = 0 X_ALIGN_CENTER = 1 X_ALIGN_RIGHT = 2 Y_ALIGN_TOP = 0 Y_ALIGN_MIDDLE = 1 Y_ALIGN_BOTTOM = 2 class TextShape(RectangleShape): TYPE_NAME ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from oauthlib.common import extract_params from oauthlib.oauth1 import Client, SIGNATURE_HMAC, SIGNATURE_TYPE_AUTH_HEADER from oauthlib.oauth1 import SIGNATURE_TYPE_BODY from requests.compat import is_py3 from requests.utils import to_nati...
#!/usr/bin/env python # A. Pletzer Tue Mar 20 11:42:05 EST 2001 """ Gauss Integration """ _ngmax = 12 _ngmin = 1 _nodes =( (0.,), (-0.5773502691896257, 0.5773502691896257,), (-0.7745966692414834, 0., 0.7745966692414834,), (-0.861136311594053, -0.3399810435848562, 0.3399810435848562, 0.861136311594053,), (-0...
"""This module contains a Google Cloud Translate Speech operator.""" from typing import Optional, Sequence, Union from google.cloud.speech_v1.types import RecognitionAudio, RecognitionConfig from google.protobuf.json_format import MessageToDict from airflow.exceptions import AirflowException from airflow.models impor...
from django.contrib import admin from django.db import models from django import forms from django.contrib.flatpages.admin import FlatPageAdmin as FlatPageAdminOld from django.contrib.flatpages.admin import FlatpageForm as FlatpageFormOld from django.contrib.flatpages.models import FlatPage from django.core.exceptions ...
from essentia_test import * import math class TestFFT(TestCase): def testDC(self): # input is [1, 0, 0, ...] which corresponds to an FFT of constant magnitude 1 signalSize = 512 fftSize = int(signalSize/2) + 1 signalDC = zeros(signalSize).astype(numpy.complex64) signalDC[...
r""" ClangTidy Diff Checker ====================== This script reads input from a unified diff, runs clang-tidy on all changed files and outputs clang-tidy warnings in changed lines only. This is useful to detect clang-tidy regressions in the lines touched by a specific patch. Example usage for git/svn users: git d...
from collections import Mapping from contextlib import contextmanager, closing import json import os import shlex import subprocess import threading from configman.dotdict import DotDict import markus from socorro.lib.util import dotdict_to_dict from socorro.processor.rules.base import Rule class CrashingThreadRule...
import time class MetaTest(type): def __new__(mcs, name, bases, namespace): print("About to define class '{0}' via type '{1}'".format(name, mcs)) print (mcs, name, bases, namespace) now = time.asctime() namespace['time'] = property(lambda self: now) return super(mcs, mcs)._...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import io import os from shutil import rmtree import sys from setuptools import Command, find_packages, setup # Package meta-data. VERSION = __import__("ajax_cbv").__version__ NAME = 'django-ajax-cbv' DESCRIPTION = 'Django module to easily use generic ...
__author__ = 'dat' import subprocess import os import csv TMP_FILE = '/home/dat/rmsd.tmp' def calcRMSD(refLigand, calcLigand): f = open(TMP_FILE, "w") run_cmd = "rms_analysis " + refLigand + " " + calcLigand subprocess.call(run_cmd.split(), stdout=f) def parseRMSDoutput(outputFile = TMP_FILE): ...
from __future__ import absolute_import, division, print_function, unicode_literals from echomesh.command import Show from echomesh.util import Log LOGGER = Log.logger(__name__) def broadcast(echomesh_instance, on_or_off=None): if on_or_off is None: Show.broadcast(echomesh_instance) else: on_o...
# -*- coding: utf-8 -*- import numpy as np import pandas as pd def ks_table(y, quantiles): """Function to produce a K-S table""" if len(set(y)) > 2: raise ValueError('Function only defined for binary classification') df = pd.concat([pd.Series(y), pd.Series(quantiles)], axis=1) df.columns ...
from datetime import datetime import unittest2 from google.appengine.ext import ndb from google.appengine.ext import testbed from consts.notification_type import NotificationType from helpers.event.event_test_creator import EventTestCreator from models.team import Team from tbans.consts.fcm.platform_priority import ...
# -*- coding: utf-8 -*- ######################### # POP VIEWER # ######################### ######################### # IMPORTS # ######################### from evolacc.observer import Observer from evolacc.config import UNIVERSE_SIZE import math import statistics as stats ###############...
import numpy as np import numbers from .base import SelectorMixin from ..base import BaseEstimator, clone, MetaEstimatorMixin from ..exceptions import NotFittedError from ..utils.metaestimators import if_delegate_has_method def _get_feature_importances(estimator, norm_order=1): """Retrieve or aggregate feature ...
import phong import datetime from wikitools import page import subprocess import tempfile import os import shutil import markdown class DocumentsPlugin(phong.Plugin): def availableCommands(self): return [BuildDocumentsCommand,] class BuildDocumentsCommand(phong.Command): def name(self): return "build-docu...
from typing import Pattern from collatex import * from xml.dom import pulldom import string import re import json import glob regexWhitespace = re.compile(r'\s+') regexNonWhitespace = re.compile(r'\S+') regexEmptyTag = re.compile(r'/>$') regexBlankLine = re.compile(r'\n{2,}') regexLeadingBlankLine = re.compile(r'^\n'...
# A Python script to automate th process of sending multiple e-mails using GMAIL. # THIS SCRIPT SHOULD BE RUN FROM THE COMMAND LINE. import os,re,smtplib,getpass # 'regTester' is a function defined to extract "E-MAIL","SUBJECT","MESSAGE" from the text file named 'gmail.txt' . # All the E-Mail addresses will be stor...
from __future__ import absolute_import, division, print_function import os import random import stat import string import sys import time import pywatchman import WatchmanInstance import WatchmanTestCase try: import grp except ImportError: # Windows pass try: import unittest2 as unittest except Imp...
from itertools import izip_longest from django import template import simplejson from django.utils.safestring import mark_safe from django.conf import settings import posixpath from ..charts import Chart, PivotChart try: CHARTIT_JS_REL_PATH = settings.CHARTIT_JS_REL_PATH if CHARTIT_JS_REL_PATH[0] == '/': ...
#!/usr/bin/env python import os import time import io def read(*paths): """Read a text file.""" basedir = os.path.dirname(__file__) fullpath = os.path.join(basedir, *paths) contents = io.open(fullpath, encoding='utf-8').read().strip() return contents try: from setuptools import setup except...
from pyg.vcs.base import VCS from pyg.utils import call_setup, print_output from pyg.core import InstallationError from pyg.log import logger __all__ = ['Git', 'Hg', 'Bzr', 'Svn', 'Local'] class Git(VCS): CMD = 'git' METHOD = 'clone' def __init__(self, url, dest=None): if url.startswith('git+'...
import os import sys import string import traceback import optparse import getpass a = os.path.join("../") sys.path.append(a) a = os.path.join("../../") sys.path.append(a) a = os.path.join("../../..") sys.path.append(a) from zoni.version import * from zoni.extra.util import * def main(): ''' This file sets up the...
import abc import collections import os.path import six import eventlet from oslo_concurrency import lockutils from oslo_config import cfg from neutron.agent.common import config as agent_cfg from neutron.agent.linux import ip_lib from neutron.agent.linux import utils from neutron.i18n import _LE from neutron.opensta...
from openerp.osv import osv, fields import uuid import time import datetime import openerp.addons.decimal_precision as dp class sale_quote_template(osv.osv): _name = "sale.quote.template" _description = "Sale Quotation Template" _columns = { 'name': fields.char('Quotation Template', required=True)...
from __future__ import absolute_import import json, re, shutil, errno, os import slyd.errors from os.path import join, splitext from twisted.web.resource import NoResource, ForbiddenResource from jsonschema.exceptions import ValidationError from .resource import SlydJsonResource from .html import html4annotation from...
import threading import logging import subprocess import queue from pathlib import Path from shutil import which import chess from utilities import DisplayMsg from timecontrol import TimeControl from dgt.api import Message from dgt.util import GameResult, PlayMode, Voice class PicoTalker(object): """Handle the ...
from collections import OrderedDict import functools import re from typing import Dict, Sequence, Tuple, Type, Union import pkg_resources import google.api_core.client_options as ClientOptions # type: ignore from google.api_core import exceptions as core_exceptions # type: ignore from google.api_core import gapic_v1 ...
from abc import abstractmethod from .base import ABCUIElement, Block from .util import clamp, crop_or_expand from .textwrap import wrap class ABCDisplayElement(ABCUIElement): _schemes = { 'left': 'beginning', 'center': 'middle', 'right': 'end', 'top': 'beginning', 'middle'...
from odoo import api, fields, models class MergeOpportunity(models.TransientModel): """ Merge opportunities together. If we're talking about opportunities, it's just because it makes more sense to merge opps than leads, because the leads are more ephemeral objects. But since opport...
from django.contrib.syndication.views import Feed from django.contrib.auth import get_user_model from django.http import HttpResponseRedirect from django.utils.feedgenerator import Atom1Feed from django.db.models.loading import get_model from django.contrib.contenttypes.models import ContentType from django.shortcuts i...
from Components.config import config, ConfigSubsection, ConfigSelection, ConfigPIN, ConfigText, ConfigYesNo, ConfigSubList, ConfigInteger #from Screens.ChannelSelection import service_types_tv from Screens.InputBox import PinInput from Screens.MessageBox import MessageBox from Tools.BoundFunction import boundFunction f...
from test_framework.names import NameTestFramework from test_framework.util import * class NameExpirationTest (NameTestFramework): def checkUTXO (self, ind, name, shouldBeThere): """ Query for a name's coin in the UTXO set and check that it is either there or not. """ data = self.nodes[ind].nam...
import gtk import os from xl import ( event, providers, player, settings, xdg ) from xl.nls import gettext as _ from xlgui import guiutil, main from xlgui.widgets import menu, playback import previewprefs import logging logger = logging.getLogger(__name__) PREVIEW_PLUGIN...
"""Braille translation table names. These have been put in their own module so that we can present them in the correct language when users change the synthesizer language on the fly without having to reload a bunch of modules.""" __id__ = "$Id$" __version__ = "$Revision$" __date__ = "$Date$" __copyright...
__all__ = ['affine_initializer'] import warnings from tempfile import mktemp from .. import utils def affine_initializer(fixed_image, moving_image, search_factor=20, radian_fraction=0.1, use_principal_axis=False, local_search_iterations=10, mask=None, txfn=None ): ...
from django.test import TestCase from django.core.exceptions import ValidationError from django.contrib.auth.models import User from .factories import ArticleFactory from .models import Article import datetime """ Welcome... here are all the tests for the minipub application. minipub models are all abstract, and no...
# -*- coding: utf-8 -*- import hashlib import os from collections import defaultdict from difflib import SequenceMatcher, unified_diff from functools import wraps from io import open from itertools import groupby, zip_longest from os.path import join, dirname from typing import Tuple from junit_xml import TestSuite,...
from a10sdk.common.A10BaseClass import A10BaseClass class GeoLocationMatch(A10BaseClass): """Class Description:: Specify match order of geographic. Class geo-location-match supports CRUD Operations and inherits from `common/A10BaseClass`. This class is the `"PARENT"` class for this module.` ...
# -*- coding: utf-8 -*- """ Created on Mon May 27 11:49:30 2013 @author: mkieszek """ from openerp.osv import fields, osv from openerp.tools.translate import _ from datetime import timedelta import pdb import time import datetime TASK_TYPES = [('call', 'Call'), ('email','Email'), ('meeting', 'Meeting'), ('document', ...
import asyncio import atexit import logging import os import signal import subprocess import time import supriya.exceptions logger = logging.getLogger("supriya.server.protocol") class ProcessProtocol: def __init__(self): self.is_running = False atexit.register(self.quit) def boot(self, opti...
"""Verify that memory usage is minimal in eager mode.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import gc import time from absl.testing import parameterized import six from tensorflow.python.data.kernel_tests import test_base from tensorflow.pyth...
from pytest import raises from unittest.mock import patch from zdict.dictionaries.spanish import SpanishDict from zdict.exceptions import NotFoundError from zdict.zdict import get_args class TestSpanishDict: @classmethod def setup_class(cls): cls.dict = SpanishDict(get_args()) cls.en_word = '...
from __future__ import absolute_import import logging import six from django.contrib.auth.models import update_last_login from django.contrib.auth.signals import user_logged_in from django.db.utils import DatabaseError from sentry.models import UserOption # Set user language if set def set_language_on_logon(reques...
from __future__ import unicode_literals from datetime import timedelta from mock import patch import json from django.core.urlresolvers import reverse from django.utils import timezone from temba.contacts.models import ContactField from temba.flows.models import RuleSet from temba.tests import FlowFileTest from temba....
""" Test the file loading mechanism. """ from __future__ import (absolute_import, division, print_function) from six.moves import (filter, input, map, range, zip) # noqa # import iris tests first so that some things can be initialised before importing anything else import iris.tests as tests import iris @tests.sk...
''' using System; using System.Windows.Forms; using SassyMQ.Lib.RabbitMQ.Payload; using System.Security.Cryptography; using System.Text; using System.IO; using System.Collections.Generic; using RabbitMQ.Client.Events; namespace SassyMQ.Lib.RabbitMQ { public static class ExtensionMethods { public stat...
# -*- coding: utf-8 -*- # Source : Werkov, Github, PyQt4 examples # URL : https://github.com/Werkov/PyQt4/tree/master/examples/dbus/chat from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: _fromUtf8 = lambda s: s class Ui_ChatMainWindow(object): def setupU...
# models.py # email: <EMAIL> from __future__ import unicode_literals, absolute_import import uuid from functools import partial from django.conf import settings from django.db import models from django.db.models import signals from django.db.models.base import ModelBase, Model from django.utils import six from elas...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'mainwindow.ui' # # 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 AttributeError: def _fromUtf8(s): ...
import pylab as p import math from matplotlib.pyplot import Rectangle # Used to make dummy legend scol = str('#FF0000') # Sets color of simulated regions wcol = str('#5FB404') # Sets color of WISE regions # Open CSV File datafile = open('3DHiiRegions.csv', 'r') csvFile = [] for row in datafile: csvFile.append(row...
from datetime import datetime from django.test import TestCase from django.utils.translation import gettext from base.models.enums.academic_calendar_type import EDUCATION_GROUP_EDITION from base.tasks import check_academic_calendar from base.tests.factories.academic_calendar import AcademicCalendarFactory from base.t...
import mock import testtools from openstack.database.v1 import instance from rackspace.database.v1 import backup EXAMPLE = { "status": "COMPLETED", "updated": "2015-09-01T03:23:36Z", "description": "My standalone instance backup1", "datastore": { "version": "5.6", "type": "percona", ...
"""Settings of Zinnia""" from django.conf import settings PING_DIRECTORIES = getattr(settings, 'ZINNIA_PING_DIRECTORIES', ('http://django-blog-zinnia.com/xmlrpc/',)) SAVE_PING_DIRECTORIES = getattr(settings, 'ZINNIA_SAVE_PING_DIRECTORIES', bool(PING_DIRECTORIE...
import sys, os, wsutils from optparse import OptionParser parser = OptionParser(""" usage: %prog [options] file member [ member ... ] calls setConstant on the given item in the workspace found in file Sets the members constant unless the option --non-constant is given """ ) wsutils.addCommonOptions(parser) ...
import pkg_resources import os.path import utils GIT_AUTHOR = utils.capture_shell("git config user.name")[0][:-1] GIT_EMAIL = utils.capture_shell("git config user.email")[0][:-1] PACKAGE_RESOURCE = pkg_resources.resource_filename(__name__, "data") VALID_ACTIONS = ("config", "scan", "gendoc", "genmeta", ...
#!/usr/bin/python ### # # add-idm-group.py # # Troy Axthelm # Advanced Research Computing Center # University of Wyoming # <EMAIL> # # # # Modified: <initials> <day> <month> <year> <change notes> # TA 6 May 2016 modified usage to add-idm-group <groupname> <pi_username> [options] # # JDB 2016.09.19 Adding cluster flag,...
# mock user B) class User: def __init__(self, moderator, level): self.moderator = moderator self.level = level def test_command_permission_mod_only(): from pajbot.models.command import Command tests = [ [ "User with level 100 can execute command with level 100", ...
import os import tarfile from configobj import ConfigObj from twisted.internet.defer import inlineCallbacks from Tribler.Core.CacheDB.SqliteCacheDBHandler import (BasicDBHandler, LimitedOrderedDict) from Tribler.Core.CacheDB.sqlitecachedb import SQLiteCacheDB from Tribler.Core.Config.tribler_config import TriblerConf...
#!/usr/bin/env python #ryan g. coleman <EMAIL> #usage: grab_pdb_chain.py file #grab system, string, regular expression, and operating system modules import sys, string, re, os, math import grab_pdb #for getCode function import pdb #for chain sorting ease def getCodeChain(pdbCode, chain): fileName = grab_pdb.getC...
""" sentry.utils.dates ~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import six from datetime import ( datetime, timedelta, ) import pytz from dateutil.parser import parse...
# Django settings for example project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', '<EMAIL>'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME': '', ...
import tenable_io.util as util from tenable_io.api.exports import ExportsAssetsRequest, ExportsVulnsRequest from tenable_io.api.models import ExportsAssetsStatus, ExportsVulnsStatus class ExportHelper(object): def __init__(self, client): self._client = client def download_vulns(self, path=None, num_...
from gluon import current import os from PIL import Image def SMARTHUMB(image, box, fit=True, name="thumb"): '''Downsample the image. @param img: Image - an Image-object @param box: tuple(x, y) - the bounding box of the result image @param fit: boolean - crop the image to fill the box ''' ...
import win32ui from pywin.mfc import docview from pywin import default_scintilla_encoding import scintillacon import win32con import string import os import codecs import re crlf_bytes = "\r\n".encode("ascii") lf_bytes = "\n".encode("ascii") # re from pep263 - but we use it both on bytes and strings. re_encoding_byte...
# Django imports from django.test import TestCase from django.test.client import RequestFactory from django.contrib.auth.models import AnonymousUser from django.core.exceptions import PermissionDenied # Local Django imports from exam.views import CreateCustomExamsView from user.models import User, Patient, HealthProfe...
import yaml from osbs.repo_utils import ModuleSpec from atomic_reactor.constants import PLUGIN_RESOLVE_COMPOSES_KEY try: from atomic_reactor.plugins.pre_flatpak_update_dockerfile import (ComposeInfo, set_flatpak_compose_info, ...
from __future__ import unicode_literals import frappe, erpnext from frappe import _ from frappe.utils import cint, flt, cstr, now from erpnext.stock.utils import get_valuation_method import json from six import iteritems # future reposting class NegativeStockError(frappe.ValidationError): pass _exceptions = frappe....
import numpy as np import pandas as pd import multiprocessing as mp import json import os import math def iou_with_anchors(anchors_min, anchors_max, box_min, box_max): """Compute jaccard score between a box and the anchors. """ len_anchors = anchors_max - anchors_min int_xmin = np.maximum(anchors_min,...
#! /usr/bin/env python # -*- encoding: UTF-8 -*- import argparse import sys import os import qi from naoqi import ALProxy PEPPER_IP='127.0.0.1' PEPPER_PORT=9559 behaviours = [ ('ALFaceDetection', 'Face_Behavior'), ('ALFaceCharacteristics', 'Char_Behavior'), ('ALPeoplePerception', 'People_Behavior'), ...
# -*- coding: utf-8 -*- ## ajax_views import json import os import shutil from pyramid.response import Response from pyramid.request import Request from pyramid.view import view_config import uuid import Image from sqlalchemy.exc import DBAPIError from sqlalchemy.orm import aliased from pyramid.httpexceptions import ...
"""Support for Envisalink devices.""" import asyncio import logging import voluptuous as vol from homeassistant.core import callback import homeassistant.helpers.config_validation as cv from homeassistant.const import EVENT_HOMEASSISTANT_STOP, CONF_TIMEOUT, CONF_HOST from homeassistant.helpers.entity import Entity fr...
import sys import os import numpy as np import h5py import multiprocessing import cPickle import matplotlib.pyplot as plt import itertools from scipy.stats import sigmaclip from sklearn.gaussian_process import GaussianProcess notes = """ In this case, we do a 3-d gaussian interpolation. The elevations are read from ...