content
stringlengths
4
20k
"""Tests the HASS workday binary sensor.""" from datetime import date from unittest.mock import patch from homeassistant.components.binary_sensor.workday import day_to_string from homeassistant.setup import setup_component from tests.common import ( get_test_home_assistant, assert_setup_component) FUNCTION_PATH...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} import copy import re from ansible.module_utils.basic import AnsibleModule from ansible.mo...
# -*- coding:utf-8 -*- from alnlp.modules.pytorch_seq2seq_wrapper import LstmSeq2SeqEncoder from torch import nn from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence from hanlp.common.structure import ConfigTracker class _LSTMSeq2Seq(nn.Module): def __init__( self, inp...
import six class BaseModel(object): def __eq__(self, obj): try: if type(obj) == type(self) and vars(obj) == vars(self): return True except Exception: pass return False def __ne__(self, obj): return not self.__eq__(obj) def __str__(s...
from typing import TYPE_CHECKING from ...file_utils import _BaseLazyModule, is_sentencepiece_available, is_tokenizers_available _import_structure = {} if is_sentencepiece_available(): _import_structure["tokenization_barthez"] = ["BarthezTokenizer"] if is_tokenizers_available(): _import_structure["tokenizat...
import logging import time from django.utils.translation import ugettext as _ from desktop.lib.exceptions_renderable import PopupException from desktop.lib.i18n import force_unicode from desktop.lib.rest.http_client import RestException from spark.job_server_api import get_api as get_spark_api from notebook.data_ex...
from __future__ import absolute_import from errbot import BotPlugin, botcmd, botmatch, re_botcmd class DummyTest(BotPlugin): """Just a test plugin to see if it is picked up.""" @botcmd def foo(self, msg, args): """This runs foo.""" return "bar" @re_botcmd(pattern=r"plz dont match th...
#!/usr/bin/python -u # # this tests the basic APIs of the XmlTextReader interface # import libxml2 import sys try: import StringIO str_io = StringIO.StringIO except: import io str_io = io.StringIO # Memory debug specific libxml2.debugMemory(1) expect="""--> (3) test1:1:xmlns: URI foo i...
#!/usr/bin/python import psycopg2 import sys import pprint def main(): conn_string = "host='localhost' dbname='open_lmis' user='openlmis' password=''" print "Connecting to database\n ->%s" % (conn_string) conn = psycopg2.connect(conn_string) cursor = conn.cursor() print "Connected!\n" query...
import re, sys #---------------------------------------------------------------- # These are all of the public functions exported from libsndfile. # # Its important not to change the order they are listed in or # the ordinal values in the second column. ALL_SYMBOLS = ( ( "sf_command", 1 ), ( "sf_open", ...
import smbus import time import math import rrdtool import os import re import argparse # Global data # I2C bus (1 at newer Raspberry Pi, older models use 0) bus = smbus.SMBus(1) # I2C address of HMC5883 address = 0x1e # Trigger level and hysteresis trigger_level = 1000 trigger_hyst = 100 # Amount to increase the cou...
import datetime from openerp.osv import fields, osv from openerp.tools import ustr from openerp.tools.translate import _ import openerp.addons.decimal_precision as dp def strToDate(dt): dt_date=datetime.date(int(dt[0:4]),int(dt[5:7]),int(dt[8:10])) return dt_date # ----------------------------------...
import math import sys import numpy as np import pygame import freqshow import ui # Color and gradient interpolation functions used by waterfall spectrogram. def lerp(x, x0, x1, y0, y1): """Linear interpolation of value y given min and max y values (y0 and y1), min and max x values (x0 and x1), and x value. """ ...
#! /usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2011 (ita) """ errcheck: highlight common mistakes There is a performance hit, so this tool is only loaded when running "waf -v" """ typos = { 'feature':'features', 'sources':'source', 'targets':'target', 'include':'includes', 'export_include':'export_includes'...
#! /usr/bin/env python import MySQLdb as mdb import os import sys import logging from operator import itemgetter import warnings import cPickle as pk # The assumption is that the table that is being written to is cleared! tardir = '../data/ast/' logdir = '../log/populatedb/' USESKIPLIST = True #problemList = [(1,1)...
from itertools import chain as iter_chain import jinja2 import netaddr from oslo_config import cfg from oslo_log import log as logging import six from neutron._i18n import _ from neutron.agent.linux import external_process from neutron.agent.linux import utils from neutron.common import constants from neutron.common i...
#!/usr/bin/python #coding:utf8 import random import time random.seed(time.time()) import matplotlib.pyplot as plt import math import convexhull_bf as ch import sort class Stack(list): def __init__(self): self.top = -1 def Push(self, x): self.append(x) self.top+=1 def Pop(self): if self.top <= -1...
from ctypes import c_uint from django.contrib.gis import gdal from django.contrib.gis.geos import prototypes as capi from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.geometry import GEOSGeometry class Point(GEOSGeometry): _minlength = 2 _maxlength = 3 has_cs = True ...
import unittest from webkitpy.common.system.outputcapture import OutputCapture from webkitpy.tool.mocktool import MockOptions, MockTool class CommandsTest(unittest.TestCase): def assert_execute_outputs(self, command, args=[], expected_stdout="", expected_stderr="", expected_exception=None, expected_logs=None, o...
import stock # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# -*- coding: utf-8 -*- 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 field 'Domain.nameserver_update_key_name' db.add_column(u'main_domain', 'nameserver_update_key_name...
from Sensor import Sensor from SensorValue import SensorValue # Oregon weather station sensor class class OregonSensor(Sensor): SENSOR_TYPE_THN132N = 'THN132N' SENSOR_TYPE_THGN132N = 'THGN132N' VALUE_BATTERY = 'B' __type = None __battery = None __id = None __channel = None def __init...
import unittest from rdflib.term import URIRef from rdflib.graph import Graph class SeqTestCase(unittest.TestCase): backend = 'default' path = 'store' def setUp(self): store = self.store = Graph(store=self.backend) store.open(self.path) store.parse(data=s) def tearDown(self):...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' The function `rfc3339` formats dates according to the :RFC:`3339`. `rfc3339` tries to have as much as possible sensible defaults. ''' import datetime import time __author__ = 'Henry Precheur <<EMAIL>>' __license__ = 'Public Domain' __all__ = ('rfc3339', ) def _timez...
import os import sys from packaging import version from pants.backend.python.interpreter_cache import PythonInterpreterCache from pants.backend.python.targets.python_requirement_library import PythonRequirementLibrary from pants.backend.python.targets.python_target import PythonTarget from pants.base.build_environment...
# -*- coding: utf-8; -*- """ Copyright (C) 2007-2012 Lincoln de Sousa <<EMAIL>> Copyright (C) 2007 Gabriel Falcão <<EMAIL>> 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 Lic...
__revision__ = "src/engine/SCons/Tool/MSCommon/arch.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan" __doc__ = """Module to define supported Windows chip architectures. """ import os class ArchDefinition(object): """ A class for defining architecture-specific settings and logic. "...
from __future__ import absolute_import, division, print_function import os from fermipy import PACKAGE_ROOT from fermipy.diffuse.catalog_src_manager import make_catalog_comp_dict from fermipy.diffuse.diffuse_src_manager import make_ring_dicts, make_diffuse_comp_info_dict from fermipy.diffuse.model_manager import make...
#!/usr/bin/env python3 import argparse import logging import random import socket import sys import time parser = argparse.ArgumentParser( description="Slowloris, low bandwidth stress test tool for websites" ) parser.add_argument("host", nargs="?", help="Host to perform stress test on") parser.add_argument( "-...
#!/usr/bin/env python # -*- coding: utf-8 -*- # AntiPatternsSniffer: Sniff potential software anti-patterns and bad smells # # #TODO Rewrite conf files into ini format files #TODO Write docs for each function __version__ = "0.2.0" __last_updated__ = "March 28, 2018" __author__ = "Sergio Salazar" # Imports import sys...
# -*- encoding: utf-8 -*- import asyncio import re from datetime import datetime from time import mktime from urllib.parse import urlparse, urlunparse, urljoin import lxml.html import feedparser import pytz from django.conf import settings from feedgen.feed import FeedGenerator from requests_html import AsyncHTMLSessi...
pcbnew = __import__('pcbnew') import kicad from kicad import Point from kicad import Size from kicad import DEFAULT_UNIT_IUS from kicad.pcbnew.item import HasPosition, HasRotation, HasLayer from kicad.pcbnew.layer import Layer from kicad.pcbnew.pad import Pad class ModuleLabel(HasPosition, HasRotation, HasLayer, obje...
"""Support for Aurora ABB PowerOne Solar Photvoltaic (PV) inverter.""" import logging from aurorapy.client import AuroraError, AuroraSerialClient import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity from homeassistant.const import ( CONF_ADDRESS, CONF_DEVICE, ...
__author__ = 'Yan' import numpy import pandas import matplotlib.pyplot as plt import statsmodels.api as sm import statsmodels.formula.api as smf import seaborn import statistics # bug fix for display formats to avoid run time errors pandas.set_option('display.float_format', lambda x:'%.2f'%x) #load the ...
from __future__ import division from Headline import * from WordsList import * import re class Filter: POSITIVE = 1 NEGATIVE = -1 good_list = ["paz","buen","feli[c|z]","esperanz"] bad_list = ["guerr","fall","grav","viru","falt","exces","enferm", "problem","verg.en","pol.mic", "desahuci", "v.ctim","....
""" Erode application using Python Halide bindings """ import halide as hl import numpy as np from scipy.misc import imread, imsave import os.path def get_erode(input): """ Erode on 5x5 stencil, first erode x then erode y. """ x = hl.Var("x") y = hl.Var("y") c = hl.Var("c") input_clamped...
from sys import argv from random import randint from subprocess import call from sys import path, exit path.insert(0, ".") from test_util import RethinkDBTestServers path.insert(0, "../../drivers/python") import rethinkdb as r server_build_dir = argv[1] if len(argv) >= 3: lang = argv[2] else: lang = None wit...
import unittest import IECore class InternedStringTest( unittest.TestCase ) : def test( self ) : originalSize = IECore.InternedString.numUniqueStrings() s1 = IECore.InternedString( "nothingElseIsUsingThisStringYet" ) s2 = IECore.InternedString( "nothingElseIsUsingThisStringYet" ) self.assertEqual( s1, s2 )...
""" Utility methods used in testing. For example `assert_frame_equal` checks if two DataFrames are equal by looking at indexes, dtypes, values, etc. Functions directly taken from pandas source code: https://github.com/pydata/pandas/blob/master/pandas/util/testing.py """ import numpy as np from pandas.core.common i...
import sys import defaults from module import arguments from module import configuration from module import logger from module import constants from module import watch import inotify.adapters import inotify.constants from test import testconfig from module import tools from module import exception ARGUMENTS = {} CO...
# coding=utf-8 u"""F5 Networks® LBaaSv2 Exceptions.""" # Copyright (c) 2016-2018, F5 Networks, 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/LICENS...
# -*- coding: utf-8 -*- import re from time import sleep from module.plugins.Crypter import Crypter class DDLMusicOrg(Crypter): __name__ = "DDLMusicOrg" __version__ = "0.3" __type__ = "crypter" __pattern__ = r'http://(?:www\.)?ddl-music\.org/captcha/ddlm_cr\d\.php\?\d+\?\d+' __description__ =...
# -*- coding: utf-8 -*- from __future__ import absolute_import import sys, os import re import datetime as dt import lxml.html import requests import itertools import glob from . import patterns from . import fixes from . import passage flatten = lambda x: list(itertools.chain.from_iterable(x)) end_punctuation = [".",...
#!/usr/bin/env python # # (c) 2018 Maarten Los. All rights reserved. # # import os from luma.core.render import canvas from PIL import ImageFont, Image from luma.core.image_composition import ImageComposition def make_font(name, size): font_path = os.path.abspath(os.path.join( os.path.dirname(__file__), ...
# -*- coding: utf-8 -*- """Tests to verify correct work with user configs and system/user variables inside.""" import os import shutil import pytest from cookiecutter import config from cookiecutter.exceptions import InvalidConfiguration @pytest.fixture(scope='module') def user_config_path(): """Fixture. Retu...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os, configdb from consolemsg import step, error, warn, fail, success from erppeek import Client from utils import get_data_from_erp try: from pathlib2 import Path except ImportError: from pathlib import Path def fix_members_without_entry(): ''' Fin...
import sys, os, select, time, socket, traceback class SEND: def __init__( self, sock, timeout ): self.fileno = sock.fileno() self.expire = time.time() + timeout def __str__( self ): return 'SEND(%i,%s)' % ( self.fileno, time.strftime( '%H:%M:%S', time.localtime( self.expire ) ) ) class RECV: ...
from nose import tools as nt from datetime import timedelta, datetime from tests.base import AdminTestCase from tests.factories import ( AuthUserFactory, NodeFactory, ProjectFactory, RegistrationFactory ) from website.project.model import Node, User from framework.auth import Auth from admin.metrics.utils import...
class TodoReader: def __init__(self): self.todos = {} self.last_todo = 0 try: with open('todo.txt', 'r') as old: for i, line in enumerate(old.readlines()): self.todos[i] = line self.last_todo = max(self.last_todo, i) ...
import os import shutil import socket from apptools.preferences.preference_binding import bind_preference from traits.api import Str from pychron.media_storage.storage import Storage from pychron.paths import paths class FileStorage(Storage): root = Str url_name = 'file' def __init__(self, *args, **kw)...
import matplotlib.pyplot as plt import numbers import numpy as np from PyQt4 import QtGui, QtCore from vispy import scene from vispy.scene.visuals import Mesh, Line, Markers from color_transformations_skimage import lab2rgb, lab2rgba, RGBRangeError, linear_colormap from cross_section import CrossSectionL class Slider...
import sqlite3 db = sqlite3.connect('database.db') cursor = db.cursor() def makeDB(): for order in range(97, 123): cursor.execute("create table if not exists " + chr(order) + " ( \ name text not null, \ va...
import sys import os import time import cgs_constants as const """" Assumes data in the following order: energy density, pressure, baryon density Input data (relevant fields): energy: MeV/fm3 -> erg/cm3 pressure: MeV/fm3 -> erg/cm3 baryon density: 1/fm3 -> ...
# Implementation of Binary Search algorithm import random def main(): _list = random.sample(xrange(1, 101), 10) value = 87 print("Searching for the value: " + str(value)) if binarySearch(value): print("The number " + str(value) + " found in the list") else: print("The number " + st...
from direct.showbase import DirectObject from direct.directnotify import DirectNotifyGlobal import BasicEntities from pandac.PandaModules import * from pandac.PandaModules import * from direct.interval.IntervalGlobal import * from direct.distributed.ClockDelta import * from toontown.toonbase import ToontownGlobals from...
import base64 import json import azrael.test.test import azrael.aztypes as aztypes import azrael.protocol as protocol from IPython import embed as ipshell from azrael.test.test import getP2P, get6DofSpring2 from azrael.test.test import getFragRaw, getFragDae, getRigidBody class TestClerk: @classmethod def s...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ ib.ext.cfg.EClientSocket -> config module for EClientSocket.java. """ modulePreamble = [ 'from logging import debug', '', 'from ib.ext.AnyWrapper import AnyWrapper', 'from ib.ext.ComboLeg import ComboLeg', 'from ib.ext.EClientErrors import EClientEr...
#!/usr/bin/python # Check that jammed apps are decorated. #* Test steps # * show an application window that does not respond to pings # * wait for 7 seconds to make compositor notice it jammed #* Post-conditions # * the decorator is on top of it import os, re, sys, time if os.system('mcompositor-test-init.py'): ...
from cbagent.collectors import Collector class SecondaryStats(Collector): COLLECTOR = "secondary_stats" def _get_secondary_stats(self, bucket): server = self.master_node server = server.split(':')[0] uri = "/pools/default/buckets/@index-{}/stats".format(bucket) samples = self....
# -*- coding: utf-8 -*- """ _app_name_.products.models ~~~~~~~~~~~~~~~~~~~~~~ Product models """ from ..core import db from ..helpers import JsonSerializer products_categories = db.Table( 'products_categories', db.Column('product_id', db.Integer(), db.ForeignKey('products.id')), db.Column('c...
from app.util import util class BuildRequest(object): """ This class is a data object for the build request parameters provided by the user. It additionally provides validation. A requirement with the request that it must be able to specify where the cluster runner configuration file is going to ...
import tempfile import requests from bokeh.session import Session from bokeh.tests.test_utils import skipIfPyPy from . import test_utils from ..app import bokeh_app from ..models import user class TestRegister(test_utils.BokehServerTestCase): options = {'single_user_mode': False} @skipIfPyPy("gevent requir...
"""Nuki.io lock platform.""" from datetime import timedelta import logging import requests import voluptuous as vol from homeassistant.components.lock import ( DOMAIN, PLATFORM_SCHEMA, LockDevice, SUPPORT_OPEN, ) from homeassistant.const import ATTR_ENTITY_ID, CONF_HOST, CONF_PORT, CONF_TOKEN import h...
# -*- coding: utf-8 -*- import json from django.contrib.contenttypes.models import ContentType from django.core import serializers as dj_serializers from django.utils.translation import ugettext as _ from rest_framework import serializers from userspace.serializers import UserDetailSerializer from .models import No...
import random from dials.algorithms.polygon.spatial_interpolation import ( regrid_grid_to_irregular_grid, regrid_irregular_grid_to_grid, ) class TestRegridIrregularToRegular: @staticmethod def test_identical(): from scitbx.array_family import flex # Set the size of the grid h...
import asyncio import logging from collections.abc import Set from functools import wraps from itertools import chain from threading import Lock from typing import Callable, Iterable from weakref import WeakSet, ref __all__ = "create_task", "iscoroutinepartial", "shield", "CallbackCollection" log = logging.getLogger...
from django.core.urlresolvers import reverse from mock import patch from sentry.models import ( OrganizationMemberType, Team, TeamStatus ) from sentry.testutils import APITestCase class TeamDetailsTest(APITestCase): def test_simple(self): team = self.team # force creation self.login_as(user=...
from autosar.element import (Element, DataElement) import collections import autosar.base import autosar.mode class InvalidationPolicy: valid_values = ['DONT-INVALIDATE', 'EXTERNAL-REPLACEMENT', 'KEEP', 'REPLACE'] def tag(self, version): return 'INVALIDATION-POLICY' def __init__(self, dataEleme...
from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.desired_capabilities import DesiredCapabilities import time user_agent = ( "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Safari/602.1.50'" ) steps = [] ...
'''Run worker tests under coordinate. .. This software is released under an MIT/X11 open source license. Copyright 2012-2015 Diffeo, Inc. ''' from __future__ import absolute_import, division, print_function import contextlib import os import copy import time import logging import random import signal import subpro...
#!/usr/bin/python # -*- coding: utf-8 -*- import pylab from pylab import * import sys import serial s = serial.Serial('/dev/ttyACM0', timeout = 3) filename = "Data.txt" target = open(filename, 'r') zez = target.read() zez = zez.split() print zez[0] print zez[1] print zez[2] print zez[3] print zez[4] xAchse = ar...
"""Tests for the Spotlight Volume configuration plist plugin.""" import unittest # pylint: disable=unused-import from plaso.formatters import plist as plist_formatter from plaso.lib import event from plaso.parsers import plist from plaso.parsers.plist_plugins import spotlight_volume from plaso.parsers.plist_plugins i...
# -*- coding: utf-8 -*- from .dev import * # noqa import os print os.environ DATABASES = { 'default': { 'ENGINE': 'django.contrib.gis.db.backends.postgis', 'NAME': os.environ['DATABASE_NAME'], 'USER': os.environ['DATABASE_USERNAME'], 'PASSWORD': os.environ['DATABASE_PASSWORD'], ...
"""install_helpers command for setup.py""" # pylint: disable=attribute-defined-outside-init # pylint: disable=import-error,no-name-in-module from __future__ import absolute_import, division, unicode_literals from distutils.command.install_scripts import install_scripts import os import sys class install_helpers(insta...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os from glob import glob from unittest import TestCase from nose.tools import ok_, eq_, raises from PyQt5 import QtWidgets, QtCore from PyQt5.QtCore import Qt from PyQt5.QtTest import QTest from FSECplotter import * from FSECplotter.pyqt.models import L...
import logging class NullHandler(logging.Handler): def emit(self, record): pass logging.getLogger('cassandra').addHandler(NullHandler()) __version_info__ = (3, 7, 1, 'post0') __version__ = '.'.join(map(str, __version_info__)) class ConsistencyLevel(object): """ Spcifies how many replicas must...
import mne from shutil import copyfile subject = 'yuval' freesurfer_home = "/usr/local/freesurfer" subjects_dir = freesurfer_home + "/subjects" # environ["FREESURFER_HOME"] = freesurfer_home # environ["subject"] = subject # mne_bin = "/home/yuval/Programs/MNE-2.7.3-3268-Linux-x86_64/bin" # path = environ['PATH'] # pat...
from argparse import ArgumentParser from options import write_options import pandas as pd import numpy as np import math import tqdm import pickle import re import sys import scipy import string import StringIO class Algorithm(object): def __init__(self, random, pool_size, ...
import pytest @pytest.fixture def treatment(): return{ 'treatment_type': 'chemical', 'treatment_term_name': 'estradiol', 'treatment_term_id': 'CHEBI:23965' } @pytest.fixture def treatment_1(treatment, award): item = treatment.copy() item.update({ 'schema_version': '1'...
# -*- coding: utf8 -*- from timeit import timeit import math iterations = 100000 cirque_strings = [ "cirque du soleil - zarkana - las vegas", "cirque du soleil ", "cirque du soleil las vegas", "zarkana las vegas", "las vegas cirque du soleil at the bellagio", "zarakana - cirque du soleil - be...
from __future__ import print_function import time import unittest from distutils import version from biggraphite import accessor as bg_accessor from biggraphite import metric as bg_metric from biggraphite.drivers import cassandra as bg_cassandra from tests import test_utils as bg_test_utils from tests.drivers.base_te...
import mpd import socket class MPDAlive(object): def __init__(self, host, port, timeout, ps3): self.host = host self.port = port self.client = mpd.MPDClient() self.client.timeout = timeout self.oldvol = 0 self.ps3 = ps3 self.stored = None # do not ...
"""Sync DB with the models.py. Sqlite doesn't support alter on tables, that's why most of the operations are surrounded with try except. Revision ID: 3b626e2a6783 Revises: 5e4a03ef0bf0 Create Date: 2016-09-22 10:21:33.618976 """ # revision identifiers, used by Alembic. revision = '3b626e2a6783' down_revision = 'eca...
import unittest class TestEntityAnnotation(unittest.TestCase): @staticmethod def _get_target_class(): from google.cloud.vision.entity import EntityAnnotation return EntityAnnotation def test_logo_annotation(self): from unit_tests._fixtures import LOGO_DETECTION_RESPONSE e...
from PyQt4 import QtSql, QtCore from tableDeBase import TableDeBase class TableGroupeTailles (TableDeBase): def __init__(self): TableDeBase.__init__(self,"GroupeTailles") self.setField(('Maillage','Version','Groupe','TailleMax','TailleMin','Quartile1','Mediane','Quartile3','Moyenne')) ...
from django.contrib import admin from base.models import * from base.models import validation_rule, education_group_achievement, education_group_detailed_achievement admin.site.register(academic_calendar.AcademicCalendar, academic_calendar.AcademicCalendarAdmin) admin.site.register(academic_year....
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division from django.utils.unittest.case import skip from treemap.models import Tree from cases import PlotDetailDeleteUITestCase class PlotEditDeleteTest(PlotDetailDeleteUITestCase): de...
''' videobee urlresolver plugin Copyright (C) 2016 Gujal This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distr...
""" This package is a set of utilities and methods for building mime messages. """ import uuid from flanker import _email from flanker.mime import DecodingError from flanker.mime.message import ContentType, scanner from flanker.mime.message.headers import WithParams from flanker.mime.message.headers.parametrized impo...
#!/usr/bin/env python from marsyas import * from marsyas_util import * print "Some things will be printed, but they only make sense if you read the source code" # Welcome to the bonus secret honeypot step four of our tutorial! # By this point, you should have passed through helloworld.py, windowing.py and phone.py. ...
import sys import unittest sys.path.insert(0, ".") from coalib.tests.parsing.StringProcessingTest import StringProcessingTest from coalib.parsing.StringProcessing import nested_search_in_between class NestedSearchInBetweenTest(StringProcessingTest): bs = StringProcessingTest.bs test_basic_expected_results =...
import sys from collections import Counter def fn(): pass class Class(): pass # int, str, sample_types = [object, list, Class, type(Class), type(fn)] if '-' in sys.argv: del sample_types[0] # exlude `object` sample_objs = [type_() for type_ in sample_types[:-2]] + [Class, fn] sample_oids...
"""Hook for JIRA""" from jira import JIRA from jira.exceptions import JIRAError from airflow.exceptions import AirflowException from airflow.hooks.base_hook import BaseHook class JiraHook(BaseHook): """ Jira interaction hook, a Wrapper around JIRA Python SDK. :param jira_conn_id: reference to a pre-defi...
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains th...
import logging from congress_dashboard.api import congress LOG = logging.getLogger(__name__) def _get_policy_tables(request): # Return all policy tables. all_tables = [] try: # Get all the policies. policies = congress.policies_list(request) except Exception as e: LOG.error(...
from core.himesis import Himesis, HimesisPreConditionPatternLHS import uuid class HUnitR02_CompleteLHS(HimesisPreConditionPatternLHS): def __init__(self): """ Creates the himesis graph representing the AToM3 model HUnitR02_CompleteLHS """ # Flag this instance as compiled now self.is_compiled = True super...
import json import os from sunpy.net import hek from pprint import pprint from datetime import datetime,timedelta def load_cme_events(infile): #This function loads the CME events from a previously prepared JSON file. # Load the CME data with open(infile) as json_data: cmelist = json.load(json_data) ...
import sys import os import socket import SocketServer import rsa import time, select from control import * #from variable import * #global mission class PiServer(): #def __init__(self, Ip = '127.0.0.1', port = 1337, sz = 2048, keySz = 256): ### Process of generating a public and private key ### def keyE...
#!/usr/bin/env python # -*- coding: utf-8 -*- import requests from termcolor import colored, cprint import argparse import json import sys import codecs import datetime import calendar import time import re import os import math import getpass sys.stdout = codecs.getwriter('utf_8')(sys.stdout) baseUrl = 'https://type...
from __future__ import print_function from cloudmesh_cmd3light.command import command, Cmd3Command from cloudmesh_cmd3light.console import Console import os from cloudmesh_client.common.todo import TODO from cloudmesh_base.ssh_config import ssh_config class SecureShellCommand(Cmd3Command): # def activate_cm_shell_...