content
string
import uuid import os from twisted.internet import defer from twisted.python import failure from feat.test import common from feat.agencies.net import broker from feat.common import log, manhole, first class DummyAgency(log.LogProxy, manhole.Manhole, log.Logger): log_category = 'dummy_agency' def __init__...
''' This is a sample function to send AWS Health event messages to a Slack channel. Follow these steps to configure the webhook in Slack: 1. Navigate to https://<your-team-domain>.slack.com/apps 2. Search for and select "Incoming WebHooks". 3. Select "Add Configuration" and choose the default channel where m...
#! /usr/bin/env python #adam-example# ./adam_tmp_add_GAIN_to_header.py RXJ2129 import sys,os,re from glob import glob from my_cluster_params import ic_cldata,clusters_refcats data_root=os.environ['SUBARUDIR'] filters=["W-J-B","W-J-V","W-C-RC","W-S-I+","W-C-IC","W-S-Z+"] import astropy import astropy.io.fits fgas_clus...
import json from asyncio import ensure_future, gather, Event import pytest from asynctest import patch from nacl.signing import SigningKey from secret_handshake.network import SHSDuplexStream from ssb.packet_stream import PacketStream, PSMessageType async def _collect_messages(generator): results = [] async...
# --------------------------------------------------------------------------- # Append_RDC.py # Created on: 2012-02-03 16:10:38.00000 # (generated by ArcGIS/ModelBuilder) # Description: # --------------------------------------------------------------------------- # Import arcpy module import arcpy, datetime print ...
"""Production settings and globals.""" from os import environ # from memcacheify import memcacheify # from postgresify import postgresify # from S3 import CallingFormat from common import * ########## EMAIL CONFIGURATION # See: https://docs.djangoproject.com/en/dev/ref/settings/#email-backend EMAIL_BACKEND = 'django....
import json import os import fixtures from tests.software_config import common class HookPuppetTest(common.RunScriptTest): data = { 'id': '1234', 'name': 'fake_resource_name', 'group': 'puppet', 'options': { 'enable_hiera': True, 'enable_facter': True, ...
# -*- coding: utf-8 -*- """ backend managements """ from flask import Blueprint, jsonify from flask import current_app from flask import json from flask import redirect from flask import render_template from flask import request from flask import url_for from werkzeug.security import generate_password_hash, check_passw...
from django.utils.timezone import get_current_timezone from utils import * @transaction.atomic def add_reply_notification(user_post, user_to_remind, reply_type, key): if user_post != user_to_remind: if not Notification.objects.filter(user=user_to_remind).filter(notification_type__startswith="reply").filter(key=key)...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import gc import operator # Dependency imports from absl.testing import parameterized import numpy as np import tensorflow.compat.v1 as tf1 import tensorflow.compat.v2 as tf import tensorflow_probability as t...
""" Utilities for writing plugins. This is different from bokeh.pluginutils because these are ways of patching routes and objects directly into the bokeh server. You would run this type of code using the --script option """ import uuid from flask import abort, render_template from bokeh.exceptions import DataInteg...
''' Copyright 2016, EMC, Inc. Author(s): George Paulos ''' import os import sys import subprocess # set path to common libraries sys.path.append(subprocess.check_output("git rev-parse --show-toplevel", shell=True).rstrip("\n") + "/test/fit_tests/common") import fit_common # Select test group here using @attr from n...
""" This script updates the expected read depths of the input files for the Combined Haplotype Test. GC content biases and peakiness of the data (potentially caused by differences in ChIP efficiency or the expression of a few highly expressed genes) can vary greatly between individuals, sequencing libraries, and la...
import copy import unittest import sys import subprocess sys.path.insert(0, ".") from cotest.ContextManagers import (suppress_stdout, retrieve_stdout, simulate_console_inputs, preserve_sys_path, ...
import json import logging import os import sys import time import datetime from multiprocessing import Process, Queue import joblib import numpy as np import pandas as pd import requests import sqlalchemy as s from sklearn.metrics import (confusion_matrix, f1_score, precision_score, recal...
import os import logging import numpy as np import rosbag import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt from tabulate import tabulate from optparse import OptionParser from bagutils import getAllTopicsMetadata, findBestDataWindow, getDropsTimeDistribution, plotDropsTimeDistribution logger =...
from django.contrib import admin from .models import * class EvaluacionAdmin(admin.ModelAdmin): list_display = ('id', 'curso', 'fecha_evaluacion', 'docente', 'creado_en', 'ultima_modificacion', 'disponible', 'cronometro_inicio') list_editable = ('disponible',) list_filter = ('disponible','curso__asignatura__nombre'...
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Jan Badenhorst <janhendrik.badenhorst()gmail.com>' __copyright__ = 'Copyright 2014 Jan Badenhorst' __license__ = """Eclipse Public License - v 1.0 (http://www.eclipse.org/legal/epl-v10.html)""" try: import json except ImportError: import simplej...
from apgl.graph.SparseGraph import SparseGraph from apgl.graph.GeneralVertexList import GeneralVertexList from apgl.generator.ConfigModelGenerator import ConfigModelGenerator import unittest import numpy class ConfigModelGeneratorTest(unittest.TestCase): def setUp(self): pass def testInit(self): ...
""" ****** Layout ****** Node positioning algorithms for graph drawing. """ # Copyright (C) 2004-2012 by # Aric Hagberg <<EMAIL>> # Dan Schult <<EMAIL>> # Pieter Swart <<EMAIL>> # All rights reserved. # BSD license. import collections import networkx as nx __author__ = """Aric Hagberg (<EMAIL>)\nDan ...
"""Usage: mut-lint <builddir> (--linters=<linter>|--all) [--verbose] mut-lint --version -h --help show this --all run all linter passes --linters=<linter> comma-separated list of linter passes to run --verbose print more verbose debugging information --version ...
""" Tests that work on both the Python and C engines but do not have a specific classification into the other test modules. """ from io import StringIO def test_verbose_read(all_parsers, capsys): parser = all_parsers data = """a,b,c,d one,1,2,3 one,1,2,3 ,1,2,3 one,1,2,3 ,1,2,3 ,1,2,3 one,1,2,3 two,1,2,3""" ...
import sys if 'threading' in sys.modules: # gevent patching since pytests import # the sys library before we do. del sys.modules['threading'] import gevent.monkey gevent.monkey.patch_all() import unittest import os from blist import sortedset from os.path import join from os.path import dirname from os...
import numpy as np def run(self,Input): """ This method computes the final status of this simplified LB LOCA event in time dependent mode @ In, Input, dict, dictionary of inputs from RAVEN @ Out, None """ self.ACC = Input['ACC_sim'] self.time_LPI = Input['time_LPI'] self.time_LPR = Input['ti...
########################### # make_flu_trees.py # # submit script that loops over years and parameters and submits a job to # analyze a year of flu evolution , make a prediction and plot trees ########################### import sys,os import subprocess flutype = 'H3N2' for D in [0.5]: for boost in [0]: f...
#!/usr/bin/env python import copy import tables import numpy as np from scipy.sparse import lil_matrix, csc_matrix, csr_matrix, coo_matrix, hstack, vstack from numbers import Number class Sparse3DMatrix: """ 3-dim sparse matrix designed for "pooled" RNA-seq alignments """ def __init__(self, other=Non...
import logging from collections import defaultdict import webapp2 from google.appengine.ext.deferred import deferred from rogerthat.bizz.messaging import sendMessage from rogerthat.consts import MC_DASHBOARD from rogerthat.models import UserProfile, AppSettings, Message, Branding from rogerthat.models.apps import Def...
""" The MIT License (MIT) Copyright (c) 2013 Niko Skrypnik 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 without limitation the rights to use, copy, modify, merge...
from south.db import db from cthulhubot.models import * import django class Migration: def forwards(self, orm): # Changing field 'Project.tracker_uri' # (to signature: django.db.models.fields.URLField(max_length=255)) db.alter_column('cthulhubot_project', 'tracker_uri', orm['...
from datetime import date, timedelta from collections import OrderedDict from django import template from wagtail.core.models import Page from events.models import EventsArchivePage register = template.Library() @register.inclusion_tag('events/tags/event_breadcrumbs.html', takes_context=True) def breadcrumbs(conte...
# -*- coding: utf-8 -*- from flask import render_template, session, redirect, url_for, request, flash from flask.ext.login import login_required, current_user from .. import db from ..models import Step, Project, User, Commit, Record from . import main import json from datetime import datetime @main.route('/', method...
# -*- coding: utf-8 -*- import logging from flask import (Blueprint, render_template, request, send_from_directory, current_app, Response, stream_with_context) from ..webapp import db from ..action import exporter bp = Blueprint('public', __name__) logger = logging.getLogger(__name__) @bp.route...
from __future__ import unicode_literals import json import requests import sickbeard import six from sickbeard import common, logger from sickrage.helper.exceptions import ex class Notifier(object): SLACK_WEBHOOK_URL = 'https://hooks.slack.com/services/' def notify_snatch(self, ep_name): if sickbe...
"""Helper to create SSL contexts.""" from os import environ import ssl import certifi def client_context() -> ssl.SSLContext: """Return an SSL context for making requests.""" # Reuse environment variable definition from requests, since it's already a requirement # If the environment variable has no valu...
from __future__ import absolute_import, unicode_literals import json from threading import local from time import time from django.utils.encoding import force_text from django.utils import six from debug_toolbar.utils import tidy_stacktrace, get_template_info, get_stack from debug_toolbar import settings as dt_setti...
import optparse import os import sys from util import build_utils def Jar(class_files, classes_dir, jar_path, manifest_file=None): jar_path = os.path.abspath(jar_path) # The paths of the files in the jar will be the same as they are passed in to # the command. Because of this, the command should be run in #...
""" Classes for addresses of various types. """ import struct import socket # Slightly tested attempt at Python 3 friendliness import sys if 'long' not in sys.modules['__builtin__'].__dict__: long = int """ # Unfinished oui name stuff formerly from packet library. oui = int(a[0]) << 16 | int(a[1]) << 8 | int...
from __future__ import print_function from __future__ import unicode_literals import re from netmiko.ssh_connection import SSHConnection class CiscoXrSSH(SSHConnection): def send_config_set(self, config_commands=None, exit_config_mode=True, **kwargs): ''' IOS-XR requires you not exit from confi...
from datetime import datetime import requests from sqlalchemy import Table, Column, PrimaryKeyConstraint, String from cloudbot import hook from cloudbot.util import timeformat, web, database api_url = "https://libre.fm/2.0/?format=json" # Some of the libre.fm API calls do not have equivalent last.fm calls. unsuppor...
from __future__ import print_function import logging import sys from twitter.common.log.formatters.plain import PlainFormatter from apache.aurora.client.cli import CommandLine, ConfigurationPlugin from apache.aurora.client.cli.options import CommandOption from apache.aurora.common.auth.auth_module_manager import reg...
from unittest import mock from heat.common import exception from heat.common import service_utils from heat.engine import stack_lock from heat.objects import stack as stack_object from heat.objects import stack_lock as stack_lock_object from heat.tests import common from heat.tests import utils class StackLockTest(c...
import pygame import os.path import threading import time import subprocess class FortuneMode(object): def __init__(self, assets_path): self.assets_path = assets_path self.font = pygame.font.Font(os.path.join(assets_path, "Helvetica.ttf"), 30) self.white = (255,255,255) original =...
# -*- coding: utf-8 -*- import json import mock import unittest from auto_api.app import app from auto_api.auth import _admin_manager_client KEYS_TO_FIX = { 'json': 'data', 'params': 'query_string' } def _fix_kwargs(verb): def _http_verb(*args, **kwargs): for old_key, new_key in KEYS_TO_FIX.ite...
# Django settings for example project. DEBUG = True TEMPLATE_DEBUG = DEBUG import os, sys APP = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) PROJ_ROOT = os.path.abspath(os.path.dirname(__file__)) sys.path.append(APP) ADMINS = ( # ('Your Name', '<EMAIL>'), ) MANAGERS = ADMINS DATABASES = { 'de...
#!/usr/bin/env python ''' Copyright (C) 2013, Digium, Inc. Jonathan Rose <<EMAIL>> This program is free software, distributed under the terms of the GNU General Public License Version 2. ''' import sys import logging sys.path.append("lib/python") from version import AsteriskVersion LOGGER = logging.getLogger(__nam...
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup class UltraMagicString(object): ''' Taken from http://stackoverflow.com/questions/1162338/whats-the-right-way-to-use-unicode-metadata-in-setup-py ''' def __init__(self, value): self.value = value def __str__(se...
from rest_framework import serializers # wger from wger.weight.models import WeightEntry class WeightEntrySerializer(serializers.ModelSerializer): """ Weight serializer """ user = serializers.PrimaryKeyRelatedField( read_only=True, default=serializers.CurrentUserDefault() ) class Met...
from concurrence.memcache import MemcacheError, MemcacheResult from concurrence.memcache.codec import MemcacheCodec class MemcacheProtocol(object): @classmethod def create(cls, type_): if isinstance(type_, MemcacheProtocol): return type_ elif type_ == 'text': return Mem...
# -*- coding: utf-8 -*- """ Sahana Eden Water Model @copyright: 2011-2019 (c) Sahana Software Foundation @license: MIT 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...
from spack import * class RDeseq2(RPackage): """Estimate variance-mean dependence in count data from high-throughput sequencing assays and test for differential expression based on a model using the negative binomial distribution.""" homepage = "https://www.bioconductor.org/packages/DESeq2/" ...
"""File storage for torrent files, with several backends""" import urlparse import os from rtrss.storage import gcs, localdirectory from rtrss.storage.util import download_and_save_keyfile def make_storage(storage_settings, data_path): """Return file storage based on url scheme""" parsed = urlparse.urlparse...
__revision__ = "src/engine/SCons/Options/EnumOption.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog" __doc__ = """Place-holder for the old SCons.Options module hierarchy This is for backwards compatibility. The new equivalent is the Variables/ class hierarchy. These will have deprecation warnings added ...
# -*- coding: UTF-8 -*- """ Setup module for Pylint plugin for Django. """ from setuptools import setup, find_packages LONG_DESCRIPTION = open('README.rst').read() + "\n" + open('CHANGELOG.rst').read() setup( name='pylint-django', url='https://github.com/PyCQA/pylint-django', author='landscape.io', au...
from numpy.testing import assert_almost_equal from statsmodels.emplike.originregress import ELOriginRegress from statsmodels.datasets import cancer from .results.el_results import OriginResults import numpy as np class GenRes(object): """ Loads data and creates class instance ot be tested. """ @classm...
from __future__ import (absolute_import, division, print_function, unicode_literals) import six import datetime import logging import uuid import functools import itertools from mongoengine import connect from metadatastore.document import Document from metadatastore.commands import (db_conne...
#!/usr/bin/python import os import sys import cmd import json import time import urllib2 class InteractiveOrCommandLine(cmd.Cmd): def do_init(self, _args): with open('/tmp/metadata.json', 'w') as metadata: json.dump({}, metadata) def get_metadata(self): with open("/tmp/metadata.j...
import os import logging import pkg_resources from cliff.app import App from cliff.commandmanager import CommandManager, EntryPointWrapper from fakturo.core import DESCRIPTION from fakturo.core.provider.manager import ProviderManager from fakturo.core.version import version_info LOG = logging.getLogger(__name__) c...
# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: t; python-indent: 4 -*- """ Role ==== Defines the basic interfaces for a plugin. These interfaces are inherited by the *core* class of a plugin. The *core* class of a plugin is then the one that will be notified the activation/deactivation of a plugin via the ``ac...
from pathlib import Path import pytest from pysisyphus.calculators.PySCF import PySCF from pysisyphus.calculators import Turbomole, ORCA, Gaussian16, Psi4 from pysisyphus.helpers import geom_loader from pysisyphus.init_logging import init_logging from pysisyphus.optimizers.RFOptimizer import RFOptimizer from pysisyph...
#!/usr/bin/python from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from bs4 import BeautifulSoup import datetime as dt import feedparser import json import re import sys ...
# coding: utf8 # trdb.py # 8/21/2014 # See: http://zetcode.com/db/sqlitepythontutorial/ if __name__ == '__main__': import sys sys.path.append("..") import sqlite3 from sakurakit.skdebug import dwarn #TABLE_NAME = 'entry' from time import time def current_timestamp(): return int(time()) from sakurakit import skh...
from numpy import greater_equal, less_equal from opus_core.variables.variable import Variable from biocomplexity.land_cover.variable_functions import my_attribute_label class dt(Variable): """UrbanSim development type mixed-use, where(devtype==24) Problem - UrbanSim Development Type Typology HAS NO...
import itertools from django import forms from django.core.exceptions import ValidationError import markdown class BaseMarkdownField(object): """This field handles markdown files. It converts a markdown file into an html string. It also extracts meta data from the file to store them in self.md_meta. ...
from datetime import datetime from django.conf.urls import patterns, include, url from app.forms import BootstrapAuthenticationForm # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Examples: url(r'^$', 'app.views.posts', nam...
""" To be used with a companion fish function like this: function refish set -l _x (python /tmp/bass.py source ~/.nvm/nvim.sh ';' nvm use iojs); source $_x; and rm -f $_x end """ from __future__ import print_function import json import subprocess import sys import traceback BASH = 'bas...
#!/usr/bin/env python3 """Test running an enrichment using any annotation file format.""" from __future__ import print_function __copyright__ = "Copyright (C) 2010-2019, DV Klopfenstein, H Tang. All rights reserved." import os import sys # REPO = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..") def ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ################################################################# # Install the Python client library: pip install influxdb-client ################################################################# ##########################################################################...
import copy from collections import OrderedDict from creditpiggy.core.models import to_dict, VisualMetric class VisualMetrics(OrderedDict): """ Visual metrics information helper """ def __init__(self, visual_metrics): """ Initialize the metrics summarization helper, using the specified iterable collection...
#coding:utf-8 from django import forms from bbs import models from captcha.fields import CaptchaField class ContactForm(forms.Form): CITY = [ ['BJ', "BeiJing"], ['HeBei','ShiJiaZhuang'], ['GanSu','LinTao'], ['SH','ShangHai'], ['NA', 'Others'], ] user_name = forms.CharField(label='您的姓名'...
from ducktape.utils.util import wait_until from ducktape.mark import matrix from ducktape.mark import parametrize from ducktape.mark.resource import cluster from kafkatest.services.zookeeper import ZookeeperService from kafkatest.services.kafka import KafkaService from kafkatest.services.verifiable_producer import Ve...
dic = ee.Dictionary({ 'B1': 182, 'B2': 219, 'B3': 443 }) # Request the server-side ee.Dictionary as a client-side object. print('Client-side object:', dic.getInfo()) print('Using the client-side object (e.g. fetch number of keys):', len(dic.getInfo().keys())) # [END earthengine__apidocs__ee_dictionar...
class ActionModule(object): def __init__(self, runner): self.runner = runner def run(self, conn, tmp, module_name, module_args, inject): ''' transfer the given module name, plus the async module, then run it ''' # shell and command module are the same if module_name == 'shell'...
# -*- coding: UTF-8 -*- """ Lastship Add-on (C) 2019 Credits to Placenta and Covenant; our thanks go to their creators 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, eit...
# -*- coding: utf-8 -*- from itertools import chain from django import forms from django.conf import settings from django.forms.utils import flatatt from django.template.loader import render_to_string from django.contrib.contenttypes.models import ContentType from django.utils.datastructures import MultiValueDict, Mer...
import os from kafka.common import ( FetchRequest, OffsetCommitRequest, OffsetFetchRequest, KafkaTimeoutError ) from test.fixtures import ZookeeperFixture, KafkaFixture from test.testutil import ( KafkaIntegrationTestCase, kafka_versions ) class TestKafkaClientIntegration(KafkaIntegrationTestCase): @...
"""Verify the calls made during rehost.""" import os import mock import pytest import tempfile from pypicloud_tools import rehost from pypicloud_tools import Settings from pypicloud_tools import S3Config from pypicloud_tools import PyPIConfig @pytest.mark.parametrize("include_deps", (True, False)) def test_cleanup...
"""Support for Homekit Alarm Control Panel.""" import logging from homeassistant.components.alarm_control_panel import AlarmControlPanel from homeassistant.const import ( ATTR_BATTERY_LEVEL, STATE_ALARM_ARMED_AWAY, STATE_ALARM_ARMED_HOME, STATE_ALARM_ARMED_NIGHT, STATE_ALARM_DISARMED, STATE_ALA...
from vpp_interface import VppInterface import socket from vpp_papi import mac_pton class VppPppoeInterface(VppInterface): """ VPP Pppoe interface """ def __init__(self, test, client_ip, client_mac, session_id, decap_vrf_id=0): """ Create VPP PPPoE4 interface """ super...
"""My USPS (Informed Deliver) interface.""" import datetime import logging import os.path import pickle import re from bs4 import BeautifulSoup from dateutil.parser import parse import requests from requests.auth import AuthBase import requests_cache from selenium import webdriver from selenium.common.exceptions impor...
from PyQt4.QtGui import * from electrum_cesc import BasePlugin from electrum_cesc.i18n import _ class Plugin(BasePlugin): def fullname(self): return 'Virtual Keyboard' def description(self): return '%s\n%s' % (_("Add an optional virtual keyboard to the password dialog."), _("Warning: do not ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import hashlib import os from django.conf import settings from django.core import urlresolvers from django.core.files.base import ContentFile from django.db import models from django.utils.translation import ugettext_lazy as _ from filer.utils.compatibil...
from dolfin import not_working_in_parallel, facets, vertices __all__ = ['mesh_diameter'] def mesh_diameter(mesh): # FIXME: Quadratic algorithm is too slow! """Return mesh diameter, i.e. \sup_{x,y \in mesh} |x-y|. Algorithm loops quadratically over boundary facets.""" not_working_in_parallel("Functio...
import os from copy import deepcopy from apidoc.service.validator import Validator from apidoc.service.parser import Parser from apidoc.service.merger import Merger from apidoc.service.extender import Extender from apidoc.factory.source.root import Root as RootFactory from apidoc.factory.source.rootDto import RootDt...
# -*- coding: UTF-8 -*- """ This modules provides functions to deal with scores stored on the Web server. Each score is represented as a dict-like object, with the following keys: - ``level`` - ``score`` - ``user``: user's name - ``cause``: the monster's name if the user was killed, the death cause ...
# -*- coding: utf-8 -*- from __future__ import division __author__ = 'christoph.statz <at> tu-dresden.de' from .prototypes import Mesh class UnstructuredMesh(Mesh): def __init__(self, vertices, lines=None, faces=None, cells=None, axes_names=('x', 'y', 'z'), unit='m'): """ UnstructuredMesh defined by a...
# -*- coding: utf-8 -*- import unittest import os from conans.test.utils.test_files import temp_folder from conans.util.files import save, mkdir from conans.server.conf import ConanServerConfigParser from conans.errors import ConanException class ServerConfigParseTest(unittest.TestCase): def test_not_allowed_en...
#!/usr/bin/env python """ pyflex Main starting point for PyFlex. Can be instantiated in another library, or run as a script as shown below. """ import logging from flexconfig import FlexConfig from workers.ucs import UcsWorker class PyFlex: """ Main PyFlex class. Primarily used to ...
import logging import os import shutil from unittest import mock import numpy as np import h5py from cases import XanespyTestCase from xanespy import exceptions from xanespy.txmstore import TXMStore, TXMDataset, merge_stores TEST_DIR = os.path.dirname(__file__) SSRL_DIR = os.path.join(TEST_DIR, 'txm-data-ssrl') APS_...
# -*- coding: utf-8 -*- from decimal import Decimal as D from datetime import datetime as d from django.conf import settings from django.core.management.base import NoArgsCommand from django.core.exceptions import ImproperlyConfigured from openexchangerates import OpenExchangeRatesClient from ...models import Curre...
from chaco.abstract_overlay import AbstractOverlay # ============= standard library imports ======================== import Image from numpy import array # ============= local library imports ========================== class ImageUnderlay(AbstractOverlay): _cached_img = None def __init__(self, component, path...
import collections import json import ApiHttpURLFetcher class ApiRequestMaker: def __init__(self, aso, url, apiKey): self.aso = aso self.url = url self.apiKey = apiKey self.default_user_agent = "Python Wrapper v1" self.default_timeout = 5000 self.contentType = "application/json" def fetchRecommen...
# -*- coding: utf-8 -*- import random from django.utils.translation import ugettext as _ def clean_team_forms(team_form_1, team_form_2): """ Extra validation for Team forms. Checks max number of players and that a player can only play in one team. Adds error messages to the forms. Returns info wheth...
from datetime import datetime import time from celery import group from celery import shared_task from celery.decorators import periodic_task from celery.task.schedules import crontab from celery.utils.log import get_task_logger from craigmine.indexing import delete_items from craigmine.indexing import get_all_search...
from unittest import TestCase import numpy as np import floq.core.fixed_system as fs import floq.errors as er import floq.core.evolution import tests.rabi as rabi from tests.assertions import CustomAssertions from mock import MagicMock class TestFixedSystemInit(CustomAssertions): def setUp(self): self.hf...
# -*- coding: utf-8 -*- import re from module.network.HTTPRequest import BadHeader from module.network.RequestFactory import getURL as get_url from .Crypter import Crypter from .misc import parse_name, parse_time, replace_patterns class SimpleCrypter(Crypter): __name__ = "SimpleCrypter" __type__ = "crypter...
import sys sys.path.insert(1, "../../../") import h2o, tests def binop_minus(): iris = h2o.import_file(path=h2o.locate("smalldata/iris/iris_wheader_65_rows.csv")) rows, cols = iris.dim ################################################################### # LHS: scaler, RHS: H2OFrame res ...
import requests import time from bs4 import BeautifulSoup import pandas as pd import argparse import json # These are set parameters tru_url = "https://www.osti.gov/search/semantic:%22TRU%20waste%22%20OR%20%22transuranic%20waste%22%20OR%20WIPP%20OR%20%22Waste%20Isolation%20Pilot%20Plant%22/product-type:Journal%20Artic...
from __future__ import absolute_import import os import configparser import subprocess from gi.repository import Gtk, Gdk from . import Constants from . import Utils from .canvas.colors import LIGHT_THEME_STYLES, DARK_THEME_STYLES def have_dark_theme(): """ Returns true if the currently selected theme is a ...
from __future__ import unicode_literals import os from django.contrib.auth.models import User from django.contrib.auth.forms import (UserCreationForm, AuthenticationForm, PasswordChangeForm, SetPasswordForm, UserChangeForm, PasswordResetForm, ReadOnlyPasswordHashWidget) from django.contrib.auth.tests.utils imp...
""" MMPI - MPI Interface for Python Copyright (C) 2005 Michael Steder(<EMAIL>) This library 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 version. ...