src
stringlengths
721
1.04M
# -*- coding: utf-8 -*- from django.utils import timezone from django.shortcuts import render, redirect, get_object_or_404 from django.contrib import messages from django.utils.translation import gettext as _ from spirit.core.utils.views import is_post from spirit.core.utils.decorators import moderator_required from ...
# Created by CubicVirtuoso # Any problems feel free to drop by #l2j-datapack on irc.freenode.net import sys from net.sf.l2j.gameserver.model.quest import State from net.sf.l2j.gameserver.model.quest import QuestState from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest #NPCs JASMINE = 7134 ROSE...
#!/usr/bin/python import dbus import sys, os import time import gobject from dbus.mainloop.glib import DBusGMainLoop WPAS_DBUS_SERVICE = "fi.w1.wpa_supplicant1" WPAS_DBUS_INTERFACE = "fi.w1.wpa_supplicant1" WPAS_DBUS_OPATH = "/fi/w1/wpa_supplicant1" WPAS_DBUS_INTERFACES_INTERFACE = "fi.w1.wpa_supplicant1...
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 License, or (at your option) any later version. # # This program is distrib...
# -*- coding: utf-8 -*- """ tox._quickstart ~~~~~~~~~~~~~~~~~ Command-line script to quickly setup tox.ini for a Python project This file was heavily inspired by and uses code from ``sphinx-quickstart`` in the BSD-licensed `Sphinx project`_. .. Sphinx project_: http://sphinx.pocoo.org/ L...
#!/usr/bin/env python3 # # Copyright (c) 2015-2017 Nest Labs, Inc. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/lice...
from Tools.Profile import profile from Screen import Screen from Components.Button import Button from Components.ServiceList import ServiceList from Components.ActionMap import NumberActionMap, ActionMap, HelpableActionMap from Components.MenuList import MenuList from Components.ServiceEventTracker import ServiceEvent...
# encoding: 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): # Deleting field 'Trip.inbound' db.delete_column('gtfs_trip', 'inbound') # Deleting field 'Trip.outbound...
"""Celery tasks for squarelet app""" # Django from celery.task import task # Standard Library import logging import sys # Third Party import requests # MuckRock from muckrock.accounts.models import Profile from muckrock.core.utils import squarelet_get from muckrock.organization.models import Organization logger = l...
from collections import namedtuple import datetime import logging from django.conf import settings from django.db import models from django.db.models.signals import post_save, m2m_changed from django.dispatch import receiver from django.utils import timezone from july.people.models import Project, Location, Team, Com...
from django.conf.urls.defaults import patterns from localtv import models urlpatterns = patterns( 'localtv.inline_edit', (r'^video/(?P<id>[0-9]+)/name/$', 'simple.edit_field', {'model': models.Video, 'field': 'name'}, 'localtv_admin_video_edit_name'), (r'^video/(?P<id>[0-9]+)/when_published/$',...
import emcee as mc from pearce.emulator import OriginalRecipe, ExtraCrispy from pearce.mocks import cat_dict import numpy as np from os import path training_file = '/home/users/swmclau2/scratch/PearceRedMagicXiCosmo.hdf5' a = 1.0 z = 1./a-1.0 fixed_params = {'z':z, 'r':24.06822623} n_leaves, n_overlap = 10, 2 em_metho...
# # Copyright (c) 2013-2014, Scott J Maddox # # This file is part of openbandparams. # # openbandparams is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # ...
# Copyright (c) 2015 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
#!/usr/bin/python import numpy as np import os import sys import math import matplotlib matplotlib.use('Pdf') import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable from matplotlib.backends.backend_pdf import PdfPages import matplotlib.font_manager as fm ## 7-20-15 ## Simple code to ...
import os, sys, re, json import platform import shutil from datetime import datetime is_verbose = False class MyEncoder(json.JSONEncoder): def default(self, obj): from transaction import Transaction if isinstance(obj, Transaction): return obj.as_dict() return super(MyEncoder, s...
from google.appengine.api import users from google.appengine.ext import webapp from google.appengine.ext import db from google.appengine.api import memcache from google.appengine.ext.webapp import template import logging import models import os class SlashRedirectHandler(webapp.RequestHandler): """Strip off slash...
import os from ase import Atom, Atoms from gpaw import GPAW from gpaw.test import equal from gpaw.wannier import Wannier import numpy as np # GPAW wannier example for ethylene corresponding to the ASE Wannier # tutorial. a = 6.0 # Size of unit cell (Angstrom) ethylene = Atoms([Atom('H', (-1.235,-0.936 , 0 )), ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of Karesansui. # # Copyright (C) 2012 HDE, Inc. # # 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, incl...
#!/usr/bin/env python # # Copyright 2017 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
from AccessControl import Unauthorized from Acquisition import aq_base, aq_parent from castle.cms.behaviors.location import ILocation from castle.cms.interfaces import (IHasDefaultImage, IReferenceNamedImage, ITrashed) from collective.elasticsearch.interfaces import IReindexActive fro...
from django.conf.urls import patterns, url from django.views.generic.base import TemplateView from pombola.kenya.views import KEPersonDetail, KEPersonDetailAppearances from pombola.experiments.views import ExperimentShare, ExperimentSurvey from .views import (CountyPerformanceView, CountyPerformanceSenateSubmission, ...
# Copyright 2011 OpenStack LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
# coding=utf-8 import json from captcha.helpers import captcha_image_url from captcha.models import CaptchaStore from cms.models import CMSPlugin from django.views.generic import View from django.http import HttpResponse from django.utils.translation import ugettext_lazy as _ from .signals import form_submited VALI...
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
import kivy.app import kivy.lang import traceback from threading import Thread from PySide.QtGui import * from Queue import Queue from creator_ui import Ui_MainWindow from kvparser import * def ErrorHandler(func): '''Function decorator for displaying exceptions''' def wrapper(*args, **kwargs): try...
from __future__ import unicode_literals import datetime import pytz import lxml.etree from .two_hourly_forecast import TwoHourlyForecast """ The Norwegian weather service API 1.9 returns a pretty cool data format, albeit encoded in XML. It contains two types of forecasts: 1. point-in-time (from="2014-08-03T19...
from common import * # NOQA from gdapi import ApiError TEST_IMAGE = 'ibuildthecloud/helloworld' TEST_IMAGE_LATEST = TEST_IMAGE + ':latest' TEST_IMAGE_UUID = 'docker:' + TEST_IMAGE if_docker = pytest.mark.skipif("os.environ.get('DOCKER_TEST') == 'false'", reason='DOCKER_TEST is not set'...
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
#!/usr/bin/python import RPi.GPIO as GPIO import time import os GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(27,GPIO.OUT) GPIO_PIR = 7 print "PIR Module Test (CTRL-C to exit)" # Set pin as input GPIO.setup(GPIO_PIR,GPIO.IN) # Echo Current_State = 0 Previous_State = 0 try: print "Waiting for PI...
import RPi.GPIO as GPIO, time, os #Constants NUM_TESTS = 3 NUM_TESTS_PER_VALUE = 5 def readResistance(RCpin): ''' Read the resistance with the pin stated in the input, returns an integer with the number of clock cycles passed ''' #Discharge the pins and capacitor GPIO.setup(RCpin...
"""Settings that need to be set in order to run the tests.""" import os DEBUG = True SITE_ID = 1 APP_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) DATABASES = { 'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } LOGIN_REDIRECT_URL = '/hello' HIJA...
# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2009 by the FIFE team # http://www.fifengine.de # This file is part of FIFE. # # FIFE is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General P...
#!/usr/bin/env python import gflags import os import sys import unittest from ct.crypto import cert from ct.crypto import error from ct.crypto import verify from ct.proto import client_pb2 from ct.serialization import tls_message import mock FLAGS = gflags.FLAGS gflags.DEFINE_string("testdata_dir", "../test/testdata...
# coding=utf-8 import os import helper from google.appengine.ext.webapp import template from google.appengine.ext import webapp from google.appengine.ext.webapp import util from google.appengine.api import users class MainHandler(webapp.RequestHandler): def get(self): user = users.get_current_user() ...
# -*- coding: utf-8 -*- from django.test import client from lettuce import before, after, world, step from lettuce.django import django_url import os import time from django.conf import settings try: from lxml import html from selenium import webdriver from selenium.webdriver.firefox.firefox_profile import...
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup import v2ex_daily_mission try: import pypandoc long_description = pypandoc.convert('README.md', 'rst') except (IOError, ImportError): with open('README.md') as f: long_description = f.read() setup( name='v2ex_daily_mi...
import json import subprocess from importlib import import_module import ansiconv import sys from channels import Group from channels.auth import channel_session_user_from_http from channels.sessions import channel_session from django.conf import settings from fabric_bolt.projects.models import Project, Deployment f...
"""API test utilities.""" # pylint: disable=too-many-arguments from __future__ import absolute_import import os import json from six.moves import urllib from attrdict import AttrDict BASEPATH = "/rotest/api/" def request(client, path, method="post", json_data=None, params=None, ...
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
#!/usr/bin/python """ The MIT License (MIT) Copyright (c) 2014 Leon Jacobs 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, cop...
#!/usr/bin/env python """ Get a system setting by name """ # import the basic python packages we need import os import sys import tempfile import pprint import traceback # disable python from generating a .pyc file sys.dont_write_bytecode = True # change me to the path of pytan if this script is not running from EXAM...
# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
"""This file is part of DING0, the DIstribution Network GeneratOr. DING0 is a tool to generate synthetic medium and low voltage power distribution grids based on open data. It is developed in the project open_eGo: https://openegoproject.wordpress.com DING0 lives at github: https://github.com/openego/ding0/ The docume...
import os import shutil import logging def write_jobscript(filename, name=None, queue="low.q", num_tasks=24, num_cpu=24, num_walks=24, outdir="out_files", delete=False): directory = os.path.dirname(os.path.abspath(filename)) executable = os.path.basename(filename) if name is None: ...
#-*- coding:utf-8 -*- import MySQLdb class MySqlHelper: @staticmethod def FetchSql(host, user, password, database, sql, port=3306): try: conn = MySQLdb.connect (host=host, user=user, passwd=password, ...
import pytest from click.testing import CliRunner @pytest.mark.parametrize("yaml, pipfreeze, output, exit_code", [ ('tests/reqs.yml', 'tests/pipfreeze_no_matching_req.txt', '', 0), ('tests/reqs.yml', 'tests/pipfreeze_satisfied_matching_req.txt', '', 0), ('tests/reqs.yml', 'tests/pipfreeze_unsatisfied_matc...
"""Class to hold all lock accessories.""" import logging from pyhap.const import CATEGORY_DOOR_LOCK from homeassistant.components.lock import ( ATTR_ENTITY_ID, DOMAIN, STATE_LOCKED, STATE_UNLOCKED) from homeassistant.const import ATTR_CODE, STATE_UNKNOWN from . import TYPES from .accessories import HomeAccessory...
from ..baseindex import Index import numpy as np import math from annoy import AnnoyIndex class Annoy(Index): """ AnnoyIndex from annoy package. """ def __init__(self): self.algorithm = "AnnoyIndex" self.idx_to_vector = {} self.valid_types = [np.uint8, np.uint16, np.uint32, np...
# # Newfies-Dialer License # http://www.newfies-dialer.org # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2014 Star2Billing S.L. # # The primar...
# -*- coding: utf-8 -*- """ Created on Mon Apr 2 15:24:59 2018 @author: root """ import cPickle as pkl import numpy import cv2 import matplotlib.pyplot as plt import matplotlib.cm as cm import skimage import skimage.transform import skimage.io from PIL import Image, ImageEnhance import scipy.misc import tensorfl...
# Copyright 2013, Michael H. Goldwasser # # Developed for use with the book: # # Data Structures and Algorithms in Python # Michael T. Goodrich, Roberto Tamassia, and Michael H. Goldwasser # John Wiley & Sons, 2013 # # This program is free software: you can redistribute it and/or modify # it under the terms of...
__copyright__ = 'Copyright 2017-2018, http://radical.rutgers.edu' __author__ = 'Vivek Balasubramanian <vivek.balasubramaniana@rutgers.edu>' __license__ = 'MIT' # pylint: disable=unused-argument from ..base.resource_manager import Base_ResourceManager import radical.utils as ru # ------------------------------...
# ----------------------------------------------------------------------------- # http://pythonhosted.org/django-auth-ldap/ # ----------------------------------------------------------------------------- from django_auth_ldap.config import LDAPSearch, PosixGroupType import ldap LDAP_BASE_DC = 'dc=dighum,dc=kcl,dc=ac...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ **models.py** **Platform:** Windows, Linux, Mac Os X. **Description:** Defines the :class:`sibl_gui.components.core.inspector.inspector.Inspector` Component Interface class Models. **Others:** """ from __future__ import unicode_literals import foundat...
# Generated by Django 2.2.13 on 2020-08-30 15:50 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ebooks', '0109_auto_20200821_1049'), ] operations = [ migrations.AlterField( model_name='book', name='color', ...
import sys import hashlib import urlparse import urllib2 from os.path import abspath, expanduser from egginst.utils import human_bytes, rm_rf from enstaller import __version__ from enstaller.verlib import NormalizedVersion, IrrationalVersionError def abs_expanduser(path): return abspath(expanduser(path)) def c...
import numpy as np from gensim import corpora, models, matutils from Orange.data.table import Table from Orange.data.domain import Domain, ContinuousVariable, StringVariable from orangecontrib.text.topics import Topics def chunk_list(l, num): num = min(len(l), num) avg = len(l) / float(num) out = [] l...
#!/usr/bin/env python import os import pygame import wargame.engine from wargame.scene import Scene from wargame.nodes import ImageNode from wargame.tweens import ChainedTween, MoveTween # example of moving Node2d def game(): resources = os.path.join(os.getcwd(), '../') controller = wargame.engine.init(re...
# -*- coding: utf-8 -*- from freezegun import freeze_time from odoo.addons.account.tests.common import AccountTestInvoicingCommon from odoo.tests.common import Form from odoo.tests import tagged @tagged('post_install', '-at_install') class TestReconciliationMatchingRules(AccountTestInvoicingCommon): @classmetho...
# coding: utf-8 """ Copyright (c) 2013 João Bernardo Vianna Oliveira This file is part of Discoder. Discoder 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 ...
# -*- coding: utf-8 -*- """Tests around the functions to select templates.""" import unittest try: from unittest import mock except ImportError: import mock from piecutter.engines.django import DjangoEngine from piecutter.engines.jinja import Jinja2Engine from pyramid.httpexceptions import HTTPNotAcceptable f...
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
#!/usr/bin/env python import feedparser, sys, hashlib, os from lxml import etree from StringIO import StringIO from datetime import datetime def get_log_file_location(): file_dir = os.path.dirname(os.path.realpath(__file__)) return os.path.join(file_dir, "work_log.html") def make_table_header_row(table): row = etr...
from __future__ import absolute_import from minos.errors import ValidationError from minos.validator import Validator class InclusionValidator(Validator): """ Validate whether a field's value is in a list of accepted values. """ def _validate(self, instance, field, **kwargs): """Validate whe...
import pytest import tests.models.utils as tutils from pytorch_lightning import Trainer from tests.models import ( TestModelBase, LightningTestModel, LightEmptyTestStep, LightValidationMultipleDataloadersMixin, LightTestMultipleDataloadersMixin, LightTestFitSingleTestDataloadersMixin, Light...
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2018-04-04 18:06 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migratio...
from django.db import models from taggit.managers import TaggableManager from django.core.urlresolvers import reverse from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django.contrib.auth import get_user_model User = get_user_model() class Knot(models.Mo...
# -*- coding: iso-8859-15 -*- # ================================================================= # # Authors: Tom Kralidis <tomkralidis@gmail.com> # # Copyright (c) 2011 Tom Kralidis # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files...
from astroquery.simbad import Simbad from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QMessageBox from pyui.object_properties_dialog import Ui_ObjectPropertiesDialog import re from PyQt5.QtCore import Qt, QObject, pyqtSignal, QDateTime from astropy.coordinates import SkyCoord from astropy import units as u from o...
# -*- coding: utf-8 -*- """ glashammer.examples.notes ~~~~~~~~~~~~~~~~~~~~~~~~~ A simple note application. :copyright: 2010 Glashammer Developers :license: MIT """ from os.path import dirname from glashammer.application import make_app from glashammer.utils import run_very_simple, render_response from glashammer.bu...
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( clean_html, parse_iso8601, float_or_none, int_or_none, compat_str, determine_ext, ) class HitboxIE(InfoExtractor): IE_NAME = 'hitbox' _VALID_URL = r'https?://(?:www\.)?(?:hitbox|smashcas...
#!/usr/bin/env python """ Copyright (C) 2015 Louis Dijkstra This file is part of gonl-sv 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 lat...
""" Django settings for scirius 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/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) fr...
# -*- coding: utf-8 -*- # Copyright 2018 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Compile the Build API's proto. Install proto using CIPD to ensure a consistent protoc version. """ from __future__ import pri...
from decimal import Decimal as D from django.utils import unittest from django.test.client import Client from oscar.apps.shipping.methods import FreeShipping, FixedPriceShipping from oscar.apps.shipping.models import OrderAndItemLevelChargeMethod from oscar.apps.basket.models import Basket from oscar.test.helpers imp...
#!/home/oleg/Web/Hack70/env/bin/python3 # # The Python Imaging Library # $Id$ # # this demo script illustrates pasting into an already displayed # photoimage. note that the current version of Tk updates the whole # image every time we paste, so to get decent performance, we split # the image into a set of tiles. # tr...
# https://github.com/strongrandom/awesome-fedora # # This is a quick-and-dirty tool to convert packages.yml into README.md. It is not pretty. It is not efficient. It is # nowhere near my best work... but it works. # # Use Python 3. Install PyYAML. # import operator import textwrap import dnf import yaml def write_pa...
import unittest import route53 from route53.exceptions import AlreadyDeletedError from route53.transport import BaseTransport from tests.utils import get_route53_connection import datetime import os class BaseTestCase(unittest.TestCase): """ A base unit test class that has some generally useful stuff for the ...
# -*- coding: utf-8 -*- """ Created on Wed Aug 30 19:07:37 2017 @author: AmatVictoriaCuramIII """ import numpy as np import random as rand import pandas as pd import time as t from DatabaseGrabber import DatabaseGrabber from YahooGrabber import YahooGrabber Empty = [] Dataset = pd.DataFrame() Portfolio =...
from __future__ import print_function __module_name__ = 'Regex Kickban' __module_version__ = '0.2' __module_description__ = 'Kickbans clients from specified channels on regex match against their message or notice to channel' __author__ = 'Daniel A. J.' # TODO: # When ChanServ-type services are available, ask for op...
import logging log = logging.getLogger() logging.basicConfig(level=logging.DEBUG) class StorageObject(object): def __init__(self, storage): self._dict = storage def get(self, fieldName): return self._dict.get(fieldName) def set(self, fieldName, value): return self._dict.__setitem...
"""Module containing the base Lifemapper object class. """ import glob import inspect import json import os import sys import traceback from LmCommon.common.lmconstants import LMFormat # ............................................................................ class LMObject: """Base class for all objects in ...
import datetime import time import re import redis from collections import defaultdict from operator import itemgetter from pprint import pprint from utils import log as logging from utils import json_functions as json from django.db import models, IntegrityError from django.db.models import Q, F from django.db.models ...
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
import time from ..utils.log import log, INFO, ERROR, PASS from ..utils.isaac import answer_symbolic_q_text_entry, open_accordion_section, submit_login_form, assert_logged_in from ..utils.i_selenium import assert_tab, image_div from ..utils.i_selenium import wait_for_xpath_element from ..tests import TestWithDependency...
import os from .dataset import IterableImageDataset, ImageDataset def _search_split(root, split): # look for sub-folder with name of split in root and use that if it exists split_name = split.split('[')[0] try_root = os.path.join(root, split_name) if os.path.exists(try_root): return try_root ...
# # Copyright 2017 Pixar # # Licensed under the Apache License, Version 2.0 (the "Apache License") # with the following modification; you may not use this file except in # compliance with the Apache License and the following modification to it: # Section 6. Trademarks. is deleted and replaced with: # # 6. Trademarks. T...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Requirements: python packages: websocket-client # Installation: pip install websocket-client # https://pypi.python.org/pypi/websocket-client/ class StateTableRecord: def __init__(self, recordId): self.recordId = recordId self.fields = {} # map...
"""AMQPStorm Connection.Channel0.""" import logging import platform from pamqp import specification from pamqp.heartbeat import Heartbeat from amqpstorm import __version__ from amqpstorm.base import AUTH_MECHANISM from amqpstorm.base import FRAME_MAX from amqpstorm.base import LOCALE from amqpstorm.base import MAX_C...
#=============================================================================== # # FILE: kicadtoNgspice.py # # USAGE: --- # # DESCRIPTION: This define all configuration used in Application. # # OPTIONS: --- # REQUIREMENTS: --- # BUGS: --- # NOTES: --- # AUTHOR: F...
''' Created on 9 Jan 2014 @author: Jamie ''' import math import requests import re from pygeocoder import Geocoder import stations from g_directions import GoogleDirections ''' Distance conversion constants ''' CHAINS_PER_MILE = 0.0125 KM_PER_MILE = 1.6093 EARTH_RADIUS = 6378137 # earth radius in meters ''' GCD_UPL...
""" In this module, the similarity classes of the item-based approach are defined. The most important classes are the CombinedRecordSimilarity, the CollaborativeRecordSimilarity and the ContentRecordSimilarity. The first one combines the record similarity values of two underlying item based similarity classes. The seco...
from collections import namedtuple from vim_turing_machine.constants import BACKWARDS from vim_turing_machine.constants import DO_NOT_MOVE from vim_turing_machine.constants import FORWARDS from vim_turing_machine.constants import INVALID_STATE_CHARACTERS from vim_turing_machine.constants import VALID_CHARACTERS clas...
from setuptools import setup setup(name='portcache', version='0.3 ', description='A simple cache for port from remote service', url='https://github.com/oneraghavan/portcache', author='Raghavan', author_email='oneraghavan@gmail.com', license='MIT', packages=['portcache'],...
"""INSTEON Climate Control Device Class.""" import logging from insteonplm.devices import Device from insteonplm.constants import COMMAND_EXTENDED_GET_SET_0X2E_0X00 from insteonplm.messages.extendedSend import ExtendedSend from insteonplm.messages.userdata import Userdata from insteonplm.states.thermostat import ( ...
import unittest import json import random import subprocess import logging try: import unittest.mock as mock except ImportError: import mock import docker import attr from cachet import Cachet from stature import main @attr.s class FakeContainer(object): name = attr.ib() labels = attr.ib() sta...
from __future__ import absolute_import from .MockPrinter import MockPrinter from redeem.Path import Path class M83_Tests(MockPrinter): def test_gcodes_M83_from_absolute(self): """ set state as it should be after a G90, all axes absolute """ self.printer.axes_absolute = ["X", "Y", "Z", "E", "H", "A", "B", "...
# Copyright 2010-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 __all__ = ( 'LocationsManager', ) import collections import io import warnings import portage from portage import os, eapi_is_supported, _encodings, _unicode_encode from portage.const import CUSTOM_PROFILE_PAT...
import sys def is_python3(): return sys.version_info[0] == 3 if is_python3(): import urllib.parse import http.client else: import urllib import httplib import simplejson as json API_VERSION = '2.0' API_HOST = 'api.defensio.com' LIB_VERSION = '0.9.1' ROOT_NODE = 'defensio-result' FORMAT = 'json' ...