src stringlengths 721 1.04M |
|---|
from yaml import dump
from twisted.internet.defer import fail, succeed
from txaws.s3.client import S3Client
from txaws.s3.exception import S3Error
from txaws.ec2.client import EC2Client
from txaws.ec2.exception import EC2Error
from txaws.ec2.model import Instance, Reservation, SecurityGroup
from juju.lib.mocker impo... |
import errno
import os
from contextlib import contextmanager
def captured_lines(cap):
"""Given a ``capsys`` or ``capfd`` pytest fixture, return
a tuple of the form ``(out_lines, error_lines)``.
See http://doc.pytest.org/en/latest/capture.html
"""
out, err = cap.readouterr()
return (out.rep... |
"""
MasterChess library
Copyright (C) 2013 Jake Hartz
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 distribu... |
# 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 agreed to in writing, software
# d... |
#Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
__version__='''$Id$'''
import reportlab.pdfgen.canvas
from reportlab.lib import colors
from reportlab.lib.units import inch
def run():
c = reportlab.pdfgen.canvas.Canvas('colortest.pdf')
#do a test of CMYK interspersed with RGB
... |
""" Computing Statistic """
from math import sqrt
def mean(numbers):
"""Find the mean using an iterable of numbers
Return None if the iterable is empty
"""
if not numbers:
return None
total = 0
count = 0
for number in numbers:
total += number
count += 1
return t... |
# -*- coding: utf-8 -*-
"""
PHP Tests
~~~~~~~~~
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import unittest
from pygments.lexers import PhpLexer
from pygments.token import Token
class PhpTest(unittest.TestCase):
def setUp(self):... |
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... |
# Generated by Django 2.1.1 on 2018-09-29 17:59
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Record',... |
# -*- encoding: utf-8 -*-
#
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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
#
# ... |
# Generated by Django 2.2.13 on 2020-09-01 17:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('adventures', '0024_auto_20200830_1804'),
]
operations = [
migrations.AlterField(
model_name='adventure',
name='titl... |
import codecs
import locale
import os
import shutil
try:
# TODO: For speedup use additional a http://pypi.python.org/pypi/MarkupSafe
from jinja2 import Environment, FileSystemLoader
except ImportError:
print('jinja2 module missed. Report engine not available')
try:
import numpy
except ImportErr... |
# -*- 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 'Skill.author'
db.add_column(u'gsaudit_skill', 'author',
self.gf('djang... |
# -*- coding: utf-8 -*-
from lxml import etree as et
import sys
import os
# for TTS(default system TTS)
import pyttsx
#coding: utf-8
#function that reads the xhtml file and returns the root of the document
def getData(fname):
with open(fname) as f:
parser = et.XMLParser(load_dtd=True, no_network=False,resolve_... |
# Author: Nic Wolfe <nic@wolfeden.ca>
# Author: Gordon Turner <gordonturner@gordonturner.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the... |
import os
from .dxf import _dxf_loaders
from .svg_io import svg_to_path
from ..path import Path
from . import misc
from ... import util
def load_path(file_obj, file_type=None, **kwargs):
"""
Load a file to a Path file_object.
Parameters
-----------
file_obj : One of the following:
- Pa... |
#!/usr/bin/env python
#@+leo-ver=4
#@+node:@file pbcmds.py
#@@first
"""
pbcmds.py
classes for client progs to send commands to PhoneBookFS,
and get responses back.
"""
#@+others
#@+node:imports
import sys, os, time, random, socket
from pdb import set_trace as trace
#@-node:imports
#@+node:globals
# magic pathname, ... |
# -*- coding: utf-8 -*-
""" Contains functions to fetch info from youtube's API (googleapis.com/youtube/v3/) """
import logging
import util.web
import _track
from util import string_util
API_KEY = 'AIzaSyCPQe4gGZuyVQ78zdqf9O5iEyfVLPaRwZg'
ALLOWED_COUNTRIES = ['DK', 'PL', 'UK']
REFERER = 'https://tinychat.com'
SEA... |
#!/usr/bin/env python
import os
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
SCRIPTDIR = os.path.dirname(__file__) or '.'
PY3 = sys.version_info >= (3, 0, 0)
def read(fname):
""" Return content of specified file """
path = os.path.join(SCRIPT... |
import re
from scripts.features.feature_extractor import FeatureExtractor
from bs4 import BeautifulSoup
class ItemizationCountExtractor(FeatureExtractor):
def extract(self, post, extracted=None):
soup = BeautifulSoup(post.rendered_body, "html.parser")
count = len(soup.find_all("ul"))
ret... |
# -*- coding: utf-8 -*-
import re
import urlparse
from core import scrapertools
from core.item import Item
from platformcode import logger
def mainlist(item):
logger.info()
itemlist = []
itemlist.append(Item(channel=item.channel, title="Pendientes de Votación", action="novedades",
... |
"""
============================
script: filesIO.py
============================
date: 20170615 by Jianrong Deng
purpose:
handle input / output files
various data I/O functions
Input: input dir, date, time
"""
import const
import pickle
import os
#==========================
def getDir (path=const.test_path_ou... |
import logging
from HTMLParser import HTMLParser
from lxml.html.clean import Cleaner
from lxml.etree import XMLSyntaxError
class HTMLSanitizer:
@classmethod
def sanitize_and_parse(cls, data):
if data is not None:
sanitized = HTMLSanitizer._sanitize(data)
parsed = HTMLSanitize... |
import sqlite3
import re
from .champion_info import champion_id_from_name,champion_name_from_id, convert_champion_alias, AliasException
regionsDict = {"NA_LCS":"NA", "EU_LCS":"EU", "LCK":"LCK", "LPL":"LPL",
"LMS":"LMS", "International":"INTL", "NA_ACA": "NA_ACA", "KR_CHAL":"KR_CHAL", "LDL":"LDL"}
inter... |
#!/usr/bin/env python
# Copyright (c) 2014, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import sys
from stix.core import STIXPackage, STIXHeader
def parse_stix( pkg ):
print "== EMAIL =="
for ind in pkg.indicators:
print "---"
print "Title : " + ind.title... |
"Interactions with the Juju environment"
# Copyright 2013 Canonical Ltd.
#
# Authors:
# Charm Helpers Developers <juju@lists.ubuntu.com>
import os
import json
import yaml
import subprocess
import sys
import UserDict
from subprocess import CalledProcessError
CRITICAL = "CRITICAL"
ERROR = "ERROR"
WARNING = "WARNING"
I... |
from pathlib import Path
import pytest
import testing.postgresql
from sqlalchemy import create_engine, text
from sqlalchemy.engine.url import make_url
from testcontainers.postgres import PostgresContainer as _PostgresContainer
tests_dir = Path(__file__).parents[0].resolve()
test_schema_file = Path(tests_dir, 'data', ... |
"""
Tests for ToolBox widget.
"""
from .. import test
from .. import toolbox
from AnyQt.QtWidgets import QLabel, QListView, QSpinBox, QAbstractButton
from AnyQt.QtGui import QIcon
class TestToolBox(test.QAppTestCase):
def test_tool_box(self):
w = toolbox.ToolBox()
style = self.app.style()
... |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
# -*- coding: utf-8 -*-
#!/usr/bin/env python
import os
from os.path import dirname # NOQA
import sys
def disable_packages():
if pkgname == 'OpenBLAS':
"""
PKGNAME=OpenBLAS
PKGNAME=Zlib
find build/src/ -iname CMakeCache.txt -delete
rm -rf build/src/$PKGNAME*
rm -... |
'''
Example: scikits.statsmodels.GLSAR
6 examples for GLSAR with artificial data
Notes
------
These examples were written mostly to cross-check results. It is still being
written, and GLSAR is still being worked on.
'''
import numpy as np
import numpy.testing as npt
from scipy import signal
import scikits.statsmode... |
# -*- coding: utf-8 -*-
# © 2016 Camptocamp SA, Sodexis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
import logging
from odoo import models, api, fields
from odoo.tools.safe_eval import safe_eval
from odoo.addons.sale_automatic_workflow.models.automatic_workflow_job \
import savepoint
_logg... |
""" RemoveNestedFunctions turns nested function into top-level functions. """
from pythran.analyses import GlobalDeclarations, ImportedIds
from pythran.passmanager import Transformation
from pythran.tables import MODULES
from pythran.conversion import mangle
import pythran.metadata as metadata
import gast as ast
c... |
#!/usr/bin/env python
#
# Copyright (C) 2013-2016 DNAnexus, Inc.
#
# This file is part of dx-toolkit (DNAnexus platform client libraries).
#
# 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 a... |
# Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... |
# This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... |
#
# Copyright (C) 2013-2019 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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... |
__author__ = 'Urokhtor'
from Controllers.FormController import FormController
from Tools.JSONFrontEndTool import JSONFrontEndTool as JFET
from Tools.FrontEndElementTool import FrontEndElementTool as FEET
from Tools.TypeMapper import TypeMapper
import json
class ClientManagementFormController(FormController):
de... |
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This module holds utilities which make writing configs easier."""
from __future__ import print_function
import json
class Config(object):
"""Bas... |
import codecs
import config
import unidecode
from pyvirtualdisplay import Display
from time import sleep
from selenium import webdriver, common
user_agent = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36' \
' (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36'
class mdLogger:
def __init... |
# pylint: disable-msg=too-few-public-methods, redefined-outer-name, no-self-use
"""This file contains the classes used to perform integration tests on the
methods in the SoCo class. They access a real Sonos system.
PLEASE TAKE NOTE: All of these tests are designed to run on a Sonos system
without interfering with nor... |
#!/usr/bin/env python
"""mockjson.py: Library for mocking JSON objects from a template."""
__author__ = "James McMahon"
__copyright__ = "Copyright 2012, James McMahon"
__license__ = "MIT"
try:
import simplejson as json
except ImportError:
import json
import random
import re
import string
import sys
from dat... |
# -*- coding: utf-8 -*-
# Copyright(c) 2016-2020 Jonas Sjöberg <autonameow@jonasjberg.com>
# Source repository: https://github.com/jonasjberg/autonameow
#
# This file is part of autonameow.
#
# autonameow is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public L... |
# -*- coding: utf-8 -*-
TITLE = u'LFP'
PREFIX = '/video/lfp'
LFP_BASE_URL = 'http://www.laliga.es'
LFP_MULTIMEDIA = '%s/multimedia' % LFP_BASE_URL
LFP_ICON = 'lfp.png'
ICON = 'default-icon.png'
LFP_HL_ICON = 'highlights.png'
LFP_VIDEO_ICON = 'video.png'
LFP_PHOTO_ICON = 'photo... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-12-19 22:06
from __future__ import unicode_literals
import ckeditor.fields
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('geography', '0007_new_countries_remov... |
# ver 1.01
# .supports multitask simultaneously
import os,sys
import uuid
#Generate uuid to make sure filename unique
task_uuid=str(uuid.uuid1())
#tools path
x264_path=sys.path[0]+"\\x264\\x264.exe"
ffms2_path=sys.path[0]+"\\ffms2\\ffms2.dll"
bepipe_path=sys.path[0]+"\\BePipe\\BePipe.exe"
nero_path=sys.path[0]+"\\ne... |
"""
jobs.py - base notification routines
Author
Sacha Zyto <sacha@csail.mit.edu>
License
Copyright (c) 2010-2012 Massachusetts Institute of Technology.
MIT License (cf. MIT-LICENSE.txt or http://www.opensource.org/licenses/mit-license.php)
"""
import sys,os
import datetime
if "." not in sys.path:
sy... |
from unittest import mock
from django.http import Http404
import pytest
from rest_framework.permissions import SAFE_METHODS
from know_me import permissions
UNSAFE_METHODS = ("DELETE", "PATCH", "POST", "PUT")
ALL_METHODS = SAFE_METHODS + UNSAFE_METHODS
def test_anonymous(api_rf, km_user_factory):
"""
Ano... |
# -*- coding: utf-8 -*-
########################## Copyrights and license ############################
# #
# Copyright 2019-2019 Christian Lupien <christian.lupien@usherbrooke.ca> #
# ... |
# -*- coding: utf-8 -*-
from flask import jsonify, url_for
from flask_restplus import Api as OriginalApi
from werkzeug import exceptions as http_exceptions
from werkzeug.utils import cached_property
from .namespace import Namespace
from .swagger import Swagger
class Api(OriginalApi):
@cached_property
def __... |
# Copyright (c) 2014 Cisco Systems, 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 r... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
# Copyright (c) 2013, MN Technique and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import msgprint, _
from frappe.utils import flt
def execute(filters=None):
if not filters: filters = {}
columns = get_columns(filters)
entries... |
# -*- coding: utf-8 -*-
"""
banner
Description goes here...
:copyright: (c) 2014 by Openlabs Technologies & Consulting (P) Limited
:license: BSD, see LICENSE for more details.
"""
import unittest
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException... |
from datetime import date
import pendulum
from ..conftest import assert_date
def test_equal_to_true():
d1 = pendulum.Date(2000, 1, 1)
d2 = pendulum.Date(2000, 1, 1)
d3 = date(2000, 1, 1)
assert d2 == d1
assert d3 == d1
def test_equal_to_false():
d1 = pendulum.Date(2000, 1, 1)
d2 = pen... |
#####################################################################
# File: processor.py
# Author: Jeremy Mwenda <jmwenda@bu.edu>
# Desc: This file processes messages (sdhashes) from rabbitMQ.
#
#######
import os
import sys
import time
import Queue
import threading
sys.path.append(os.getcwd() + "/../")
from scripts.... |
# Natural Language Toolkit: Distance Metrics
#
# Copyright (C) 2001-2016 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# Steven Bird <stevenbird1@gmail.com>
# Tom Lippincott <tom@cs.columbia.edu>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
#
"""
Distance Me... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Adriano Monteiro Marques
#
# Author: Amit Pal <amix.pal@gmail.com>
#
# This program 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, ei... |
import numpy as np
import time
# from numba import jit
from Orbit_Manager import OrbitManager
class LunarXFerManager(OrbitManager):
def __init__(self):
super().__init__()
self.mode = "LEO"
self.earth = self.KSC.bodies['Earth']
self.moon = self.KSC.bodies['Moon'].orbit
# ... |
from re import sub
from setuptools import setup
from more_itertools import __version__
def get_long_description():
# Fix display issues on PyPI caused by RST markup
readme = open('README.rst').read()
version_lines = []
with open('docs/versions.rst') as infile:
next(infile)
for line ... |
from Acquisition import aq_chain
from Testing import ZopeTestCase
from Testing import makerequest
from Products.OpenPlans.Extensions.create_test_content import create_test_content
from Products.PloneTestCase.layer import PloneSite, ZCML
from Products.PloneTestCase.setup import setupPloneSite
from five.localsitemanager ... |
# -*- python -*-
"""@file
@brief Common test stuff
Copyright (c) 2014-2015 Dimitry Kloper <kloper@users.sf.net>.
All rights reserved.
@page License
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of s... |
#!/usr/bin/env python
"""A file based data store based on the SQLite database.
SQLite database files are created by taking the root of each AFF4 object.
"""
import os
import re
import stat
import tempfile
import thread
import threading
import time
import sqlite3
import logging
from grr.lib import aff4
from grr.l... |
# The Hazard Library
# Copyright (C) 2012-2021 GEM Foundation
#
# This program 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 (at your option) any later version.
#... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, tools, _
class ProductStyle(models.Model):
_name = "product.style"
name = fields.Char(string='Style Name', required=True)
html_class = fields.Char(string='HTML Classes'... |
import os
import numpy
import scipy_data_fitting
class Fig4(scipy_data_fitting.Data):
"""
Use this to load the data from Figure 4 in PhysRevLett.105.167202.
Should not be used directly, but only subclassed.
"""
def __init__(self, subfig):
super().__init__()
self.subfig = subfig
... |
# coding: utf-8
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import si... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models, _
from odoo.exceptions import AccessError
class Digest(models.Model):
_inherit = 'digest.digest'
kpi_account_total_revenue = fields.Boolean('Revenue')
kpi_account_total_rev... |
########
# Copyright (c) 2014-2020 Cloudify Platform Ltd. 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 ... |
"""
Copyright (c) 2008-2015, Jesus Cea Avion <jcea@jcea.es>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of... |
#!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
#
# requester.py
# @Author : Gustavo F (gustavo@gmf-tech.com)
# @Link : https://github.com/sharkguto
# @Date : 17/02/2019 11:06:12
import typing
import requests
from requests_futures.sessions import FuturesSession
from ims24 import logger
from ims24.configuration.... |
#!/usr/bin/python3
FILENAME = input("What's the texture name? (assets/____)\n>")
TEXT = """
{
"version": [
0,1
],
"meshes": [
{
"attributes": [
"POSITION","NORMAL","TEXCOORD0"
],
"vertices": [
-2.000000, 2.000000, 2.000000,-1.000000, 0.000000,-0.000000, 1.000000, 0.00000... |
# Copyright 2001 by Gavin E. Crooks. All rights reserved.
# Modifications Copyright 2004/2005 James Casbon. All rights Reserved.
# Modifications Copyright 2010 Jeffrey Finkelstein. All rights reserved.
#
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that ... |
#!/usr/bin/env python3
"""
This is an real-time frequency meter of two PMUs.
This code connects to two PMUs, plot the frequency of the past 300 time-stamps and update the plot in real-time.
"""
from phasortoolbox import PDC,Client
import matplotlib.pyplot as plt
import numpy as np
import gc
import logging
logging.bas... |
import os
import matplotlib.pyplot as plt
import numpy as np
from scipy.interpolate import splev, splprep, interp1d
from .. import utils
from ..config import logT, logL, mass, age, MODE, EXT
def interpolate_(track, inds, xcol=logT, ycol=logL, paracol=age,
parametric=True, zcol=None, k=3, s=0., tol... |
from django.test import TestCase
from casexml.apps.case.models import CommCareCase
from corehq.apps.casegroups.dbaccessors import get_case_groups_in_domain, \
get_number_of_case_groups_in_domain, get_case_group_meta_in_domain
from corehq.apps.casegroups.models import CommCareCaseGroup
class DBAccessorsTest(TestCa... |
from jqueryui import jq
from browser import document, html
from superpython.virgem.main import Sala, Labirinto, Cena, INVENTARIO # importando do virgem
STYLE = dict(position="absolute", width=300, left=0, top=0, background="blue") # mudar cor do background lá embaixo
STYLE["min-height"] = "300px"
IMAGEM = "http://s1... |
#!/usr/bin/env python
"""A mini key/password manager written in python using the AES encryption algorithm."""
import os
import sys
import time
import os.path
import random
import sqlite3
import hashlib
import getpass
import argparse
import Crypto.Cipher.AES
class KeyBox(object):
TABLE_NAME = "keybox"
MASTE... |
""" ModeController for MPF-MC"""
import logging
import os
from collections import namedtuple
from mpf.core.config_processor import ConfigProcessor
from mpf.core.utility_functions import Util
from mpfmc.core.mode import Mode
RemoteMethod = namedtuple('RemoteMethod',
'method config_section k... |
import pytest
import fauxfactory
from cfme.configure.settings import set_default_view
from cfme.services.catalogs.catalog_item import CatalogItem
from cfme.services.catalogs.catalog import Catalog
from cfme.services.catalogs.orchestration_template import OrchestrationTemplate
from cfme.services.catalogs.service_catalo... |
from __future__ import division
from math import sqrt
#############
# Constants #
#############
DAY_LIST = ["Mon", "Tue", "Wed", "Thu", "Fri"]
###########
# Helpers #
###########
# General
def chunks(l, n):
"""Yields successive ``n``-sized chunks from ``l``
http://stackoverflow.com/a/312464/1798683
... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './E5Network/E5NetworkHeaderDetailsDialog.ui'
#
# Created: Tue Nov 18 17:53:58 2014
# by: PyQt5 UI code generator 5.3.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_E5Netw... |
# Copyright (C) 2013, IBM Corporation
# Copyright (C) 2013-2014, Red Hat, Inc.
#
# 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 ... |
"""
This code has been developed by Baptiste Busch: https://github.com/buschbapti
This module allows you to retrieve Skeleton information from a Kinect device.
It is only the client side of a zmq client/server application.
The server part can be found at: https://bitbucket.org/buschbapti/kinectserver/src
It us... |
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2010, 2013, 2015, 2017, 2020 Rocky Bernstein
#
# 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 op... |
# -*- coding: UTF-8 -*-
# Copyright 2012-2013 Luc Saffre
# License: BSD (see file COPYING for details)
from lino.utils.instantiator import Instantiator, i2d
from django.utils.translation import ugettext_lazy as _
from lino.api import dd
def objects():
#~ slot = Instantiator('courses.Slot','name start_time en... |
# -*- coding: utf-8 -*-
# Copyright (C) 2016 Red Hat, Inc.
# This file is part of the Infinity Note Compiler.
#
# The Infinity Note Compiler 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
... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.8.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... |
from numbers import Integral
from .module import Module
from .. import functional as F
from .utils import _pair
class _UpsamplingBase(Module):
def __init__(self, size=None, scale_factor=None):
super(_UpsamplingBase, self).__init__()
if size is None and scale_factor is None:
raise Val... |
import urllib, json
import datetime as dt
import logging
log = logging.getLogger(__name__)
################################################################################
## REQUIRED parameters:
################################################################################
## data_url - e.g. "http://api.wundergrou... |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... |
# source: http://stackoverflow.com/questions/2758159/how-to-embed-a-python-interpreter-in-a-pyqt-widget
import sys
import os
import re
import traceback
from PyQt5 import QtCore
from PyQt5 import QtGui
from PyQt5 import QtWidgets
from electrum_mona import util
from electrum_mona.i18n import _
from .util import MONO... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2019 The FATE 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/lic... |
# vim:ai:et:ff=unix:fileencoding=utf-8:sw=4:ts=4:
# conveyor/src/main/python/conveyor/client/__init__.py
#
# conveyor - Printing dispatch engine for 3D objects and their friends.
# Copyright © 2012 Matthew W. Samsonoff <matthew.samsonoff@makerbot.com>
#
# This program is free software: you can redistribute it and/or mo... |
"""
Settings template for running two databases:
- Existing Dataverse databases (we only read it)
- Second database for Django core apps + Miniverse apps
Please read through and change the settings where noted
"""
from __future__ import absolute_import
import sys
from os import makedirs, environ
from os.path i... |
#coding: u8
import sys
reload(sys)
sys.setdefaultencoding('u8')
import urllib
import urllib2
import json
import traceback
import datetime
import re
# call format:
class WYLDocFeatureDumpFetcher(object):
serve_url = "http://10.111.0.54:8025/service/feature?docid={0}" #url for doc feature dump
serve_url = "h... |
import logging
from flask_restplus import Namespace, Resource, fields
from flask import jsonify, request
from Service.userInfoService import *
api = Namespace('user', description='User Info API related operations')
LOG = logging.getLogger("userInfoApi")
user_fields = api.model('UserModel', {
'lastLogin': fields.Dat... |
import serial
import threading
from datetime import datetime
from m2x.client import M2XClient
# instantiate our M2X API client
client = M2XClient(key='#REMOVED#')
# instantiate our serial connection to the Arduino
arduino = serial.Serial('/dev/ttyUSB0', 9600)
# instantiate our global variables
temp = 0
light = 0
now... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root
# for license information.
from __future__ import absolute_import, division, print_function, unicode_literals
import contextlib
import os
@contextlib.contextmanager
def cwd(dirnam... |
import bluetooth
import mock
import StringIO
import time
import unittest
import lazyblue
class Config(dict):
def __getattr__(self, key):
return self.get(key, None)
class test_helpers(unittest.TestCase):
def setUp(self):
lazyblue.config = Config(lazyblue.DEFAULT_OPTIONS)
def test_strength_to_state(self... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.