content string |
|---|
"""
pyshtools Global and Localized Spectral Analysis Routines.
This subpackage of pyshtools defines the following functions:
Global spectral analysis
------------------------
spectrum Calculate the spectrum of a real or complex function.
cross_spectrum Calculate the cross-spectrum of two real or... |
import numpy as np
import pytest
from pandas import Interval, Period, Timedelta, Timestamp
import pandas._testing as tm
import pandas.core.common as com
@pytest.fixture
def interval():
return Interval(0, 1)
class TestInterval:
def test_properties(self, interval):
assert interval.closed == "right"
... |
import logging
import warnings
try:
from urllib.parse import urljoin, urlencode, urlparse # python 3x
except ImportError:
from urllib import urlencode # python 2x
from urlparse import urljoin, urlparse
from django.conf import settings
from django.http import HttpResponse
from django.utils.decorators imp... |
import json
import time
from oslo_config import cfg
from taskflow import task
from poppy.distributed_task.taskflow.task import common
from poppy.distributed_task.utils import exc_loader
from poppy.distributed_task.utils import memoized_controllers
from poppy.model.helpers import provider_details
from poppy.openstack.... |
"""
Librarian tables.
The columns in this module are documented in docs/mc_definition.tex,
the documentation needs to be kept up to date with any changes.
"""
from math import floor
from astropy.time import Time
from sqlalchemy import Column, ForeignKey, Integer, BigInteger, String, Text, Float
from . import MCDecla... |
"""Work with custom color tables.
Contains a tools for reading color tables from files, and creating instances based on a
specific set of constraints (e.g. step size) for mapping.
.. plot::
import numpy as np
import matplotlib.pyplot as plt
import metpy.plots.ctables as ctables
def plot_color_gradients(... |
# stacktask_client
from oslo_serialization import jsonutils as json
from six.moves.urllib import parse as urllib
from tempest.lib.common import rest_client
class StacktaskClient(rest_client.RestClient):
def user_list(self, params=None):
"""Lists all users within the tenant."""
uri = 'openstack... |
import pytest
from .context import db
from .context import footprints
@pytest.fixture("module")
def batch3dfier_db(request):
dbs = db.db(dbname='batch3dfier_db', host='localhost', port='5432',
user='batch3dfier', password='batch3d_test')
def disconnect():
dbs.close()
request.addf... |
from unittest import TestCase
from pystacks.utils.text.vocab import Vocab
__author__ = 'victor'
class TestVocab(TestCase):
def test_unk(self):
v = Vocab(unk=False)
self.assertEqual(len(v), 0)
v = Vocab(unk=True)
self.assertEqual(len(v), 1)
self.assertIn(v.unk, v)
... |
__author__ = 'Zange'
class Monedero:
def __init__(self, cantidad=0):
self._cantidad = cantidad
def getCantidad(self):
return self._cantidad
def setCantidad(self, cantidad):
self._cantidad = cantidad
def __add__(self, other):
if isinstance(other, int):
sel... |
# -*- coding: utf-8 -*-
"""
cookiecutter.utils
------------------
Helper functions used throughout Cookiecutter.
"""
from __future__ import unicode_literals
import contextlib
import errno
import logging
import os
import stat
import shutil
def force_delete(func, path, exc_info):
"""
Error handler for `shuti... |
import os.path
import sys
import smg.config as smgcfg
import smg.mb as smgmb
import smg.store as smgstore
import smg.engine as smgengine
def printUsage(name):
print("Usage: {} [<configfile>] <scriptfile>".format(name))
print(" configfile: XML configuration for run (optional).")
print(" ... |
#!/usr/bin/env python2
"""
Uso:
apache_log_parser_regex.py algun_archivo_log
Este scripts toma un argumento en la linea de comandos: el nombre de un
log a 'parsear'. Entonces lo 'parsea' y genera un reporte que asocia el
host remoto con el numero de bytes transferidos a el
"""
import sys
import re
log_line_re = re.... |
from lib.DriverClass import DriverClass
from lib.SQLite import SQLite
import os , io , random , hashlib , shutil , sqlite3 , gzip , datetime , collections , tempfile
import qrcode
class Controller( DriverClass ) :
def configure( self ) :
self.connection = { }
return self
def prepare( self , account ) :
drive... |
# coding:utf-8
import time
import sys
import os
sys.path.append(os.path.join(sys.path[0], '../'))
from instabot import Bot
if hasattr(__builtins__, 'raw_input'):
input = raw_input
def menu():
ans = True
while ans:
print("""
1.Like hashtags
2.Like followers of
3.Like foll... |
import pandas as pd
import numpy as np
import ml_metrics as metrics
from sklearn.calibration import CalibratedClassifierCV
from sklearn import svm
from sklearn.multiclass import OneVsRestClassifier
from sklearn.cross_validation import StratifiedKFold
from sklearn.metrics import log_loss
print("read training data")
pat... |
import time
from slackclient import SlackClient
from settings import token
sc = SlackClient(token)
team_join_event = 'team_join'
admin_dm_channels = []
with open('template.txt') as f:
template = f.read()
def _get_admin_ids():
users = sc.api_call('users.list')
return [u['id'] for u in users['members'] i... |
"""SQL programming language editing support.
Major mode for editing SQL files.
Supporting actions and minor modes should go here only if they are uniquely
applicable to this major mode and can't be used in other major modes. If
actions can be used with multiple major modes, they should be put in a
separate plugin in... |
"""
Generic linux daemon base class for python 3.x.
"""
import sys, os, time, atexit, signal, errno
class Daemon:
"""A generic daemon class.
Usage: subclass the daemon class and override the run() method."""
def __init__(self, pidfile):
self.pidfile = pidfile
def daemonize(self):
... |
# coding=utf-8
import hashlib
import hmac
import uuid
from .compat import force_u, smart_b, quote, b_str, u_str, smart_u
def get_sign(secret, querystring=None, **params):
"""
Return sign for querystring.
Logic:
- Sort querystring by parameter keys and by value if two or more parameter keys share the ... |
from openerp import models, fields, api, exceptions
from openerp.addons.training_management.models.model_names import ModelNames
from openerp.addons.training_management.utils.date_utils import DateUtils
from openerp.addons.training_management.utils.model_utils import ModelUtils
from openerp.addons.training_management.... |
import requests
from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter,
OAuth2LoginView,
OAuth2CallbackView)
from .provider import RedditProvider
class RedditAdapter(OAuth2Adapter):
... |
from msrest.serialization import Model
class VirtualMachineScaleSetOSDisk(Model):
"""Describes a virtual machine scale set operating system disk.
:param name: The disk name.
:type name: str
:param caching: The caching type. Possible values include: 'None',
'ReadOnly', 'ReadWrite'
:type cachi... |
"""
Minimal Django settings for tests of common/lib.
Required in Django 1.9+ due to imports of models in stock Django apps.
"""
import sys # lint-amnesty, pylint: disable=unused-import
import tempfile
from django.utils.translation import ugettext_lazy as _
from path import Path # lint-amnesty, pylint: disable=unus... |
# -*- coding: utf-8 -*-
from PyQt4.QtGui import QTreeWidget, QTreeWidgetItem, QDesktopServices
from PyQt4 import QtCore
from qtdjango.models import Model
from PyQt4.QtWebKit import QWebView, QWebPage
#noinspection PyUnresolvedReferences
import PyQt4.QtNetwork
from PyQt4.QtCore import QSettings
__author__ = 'darvin'
c... |
"""
This module defines a set of exceptions that can be thrown during the execution
of the commands in the :mod:`~control.commands` module.
"""
from rest_framework.exceptions import APIException
class InvalidFile(APIException):
"""
A base exception for errors in which an invalid file or filepath is
encou... |
{
'name': 'Improved invoice',
'version': '2.0.0.0',
'category': 'Generic Modules/Accounting',
'description': """This module customizes OpenERP to use partner inside invoices.
""",
'author': 'Sergio Corato',
'website': 'http://www.didotech.com',
'license': 'AGPL-3',
"depends": [
'... |
# !/usr/bin/env python
import sys, os, re
# Pass date and base path to main() from airflow
def main(base_path):
# Default to "."
try: base_path
except NameError: base_path = "."
if not base_path:
base_path = "."
APP_NAME = "train_spark_mllib_model.py"
# If there is no SparkSession, create the... |
import yaml
from frozendict import frozendict
from typing import Set, Dict, Tuple, Iterable, List
from mdac.helpers.constants import RESET_YAML_HEADER_ERROR
class CommonRegister: # a static class with all the common registers
__label_set__ = set() # this is all the labels
__constants_set__ = set() # this ... |
# from cloudshell.api.cloudshell_api import ResourceAttributesUpdateRequest, AttributeNameValue
### NOT USED:
# class CloudshellResourceCreator(object):
# def __init__(self, qualipy_helpers):
# self.qualipy_helpers = qualipy_helpers
#
# def create_resource_for_deployed_vm(self, path, vcenter_template, ... |
import unittest
from zope.testing import doctest
pledge_template = """\
I give my pledge, as %s,
to save, and faithfully, to defend from waste,
the natural resources of my %s.
It's soils, minerals, forests, waters, and wildlife.
"""
def pledge():
"""
>>> print pledge_template % ('and earthling', 'planet'),
... |
import os
import pytest
import numpy
from PIL import Image
from src.detection.tensor.detector import Detector
@pytest.fixture(scope="module")
def detector():
return Detector()
def test_detector(detector):
current_dir = os.path.dirname(__file__)
crosswalk_image = Image.open(current_dir + '/img/crosswalk... |
"""Tests for Keras callbacks."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import shutil
import tempfile
import numpy as np
from tensorflow.core.framework import summary_pb2
from tensorflow.python import keras
from tensorflow.python.framew... |
import pytest
from py.error import ENOENT
import cfme.utils.browser
from cfme.fixtures.pytest_selenium import ensure_browser_open, take_screenshot
from fixtures.artifactor_plugin import fire_art_test_hook
from cfme.utils.datafile import template_env
from cfme.utils.path import log_path
from cfme.utils import browser a... |
#!/usr/bin/env python
# coding=utf-8
"""Test base files
"""
import asyncio
import json
import os
import sys
import aiohttp
import arrow
import mock
try:
import yarl
YARL = True
except ImportError:
YARL = False
VERBOSE = os.environ.get("SCRIPTWORKER_VERBOSE_TESTS", False)
ARTIFACT_SHAS = {
"public/... |
"""IpCheck - Ip address Checker script
This module is a part of ipcheck script.
It contains all extensions class
"""
import configparser
import sys
# python 3
if sys.version_info[0] == 3:
string_types = str,
else:
string_types = basestring,
# Project imports
class ExtensionBase:
"""Abstract class tha... |
# python
import logging
import sys
import os
from time import sleep, clock
clock()
import inspect
import struct
import math
# wicked
from wkd import *
from wkd.matrix import *
from wkd.ext import Camera
if __name__ == "__main__":
# logging
"""
wkd_log_stdout = logging.StreamHandler(sys.stdout)
wkd_l... |
from sys import version_info
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
from django.contrib.auth.decorators import login_required, permission_required, user_passes_test
from django.contrib.admin.views.decorators import staff_member_req... |
'''Remote debugger class, useful for multiprocess and distributed debugging.
CellProfiler is distributed under the GNU General Public License,
but this file is licensed under the more permissive BSD license.
See the accompanying file LICENSE for details.
Copyright (c) 2003-2009 Massachusetts Institute of Technology
C... |
#!/usr/bin/env python3
# -*-coding:UTF-8 -*
import os
import sys
import time
import redis
import datetime
from hashlib import sha256
from pyfaup.faup import Faup
sys.path.append(os.path.join(os.environ['AIL_BIN'], 'packages/'))
import Date
sys.path.append(os.path.join(os.environ['AIL_BIN'], 'lib/'))
import ConfigL... |
#pylint: disable=W0703, R0912,W0105
"""The base Controller API
Provides the BaseController class for subclassing.
"""
from pylons.controllers import WSGIController
import logging
from pylons import request
from agent.lib import contextutils, manifestutil
LOG = logging.getLogger(__name__)
class BaseController(WSGIC... |
import os
c = get_config()
## Generic nbgrader options (technically, the exchange directory is not used
## by the formgrader, but it is left in here for consistency with the rest of
## the user guide):
c.NbGrader.course_id = "example_course"
c.TransferApp.exchange_directory = "/tmp/exchange"
c.NbGrader.db_assignment... |
#-------------------------------------------------------------------------------
# Name:GUI Calculator
# Purpose:Simple calculator with GUI using tkinter
#
#
#-------------------------------------------------------------------------------
from tkinter import *
import math
class Calculator:
'''GUI for the calculator... |
"""
[source,python]
----
>>> import pandas as pd
>>> from sklearn.feature_extraction.text import TfidfVectorizer
>>> from nltk.tokenize.casual import casual_tokenize
>>> from nlpia.data.loaders import get_data
>>> pd.options.display.width = 120
>>> sms = get_data('sms-spam')
>>> index = ['sms{}{}'.format(i, '!'*j) for... |
import re
from collections import OrderedDict
from build_dict import Lemmatizer
def _clean_syn(word):
return re.sub(r'\([^)]*\)', '', word).strip()
def _process(word, syns):
word = word.split('|')[0]
syns = [_clean_syn(w) for w in syns.split('|')]
syns = [i for i in syns if i]
return word, syns... |
from pypers.core.step import Step
import os
import re
class MaSuRCA(Step):
spec = {
"version": "2015.06.26",
"descr": [
"""
Run the MaSuRCA assembler for a single fastq file, or paired read fastq files
/software/pypers/KBaseExecutables/prod/deployment/lib/ar_serv... |
import StringIO
import sys
# variable for storing maximum BSON nesting depth, in case this changes.
MAX_BSON_DEPTH = 100
# A reference of what the generated macro should look like for n=3.
# This is for use in testing and documentation.
REFERENCE_MACRO_3 = (
"#define MANGROVE_CHILD3(base, field1, field2, field3) ... |
#!/usr/bin/env python3
from os import path
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
class TrimageTableView(QTableView):
drop_event_signal = pyqtSignal(list)
"""Init the table drop event."""
def __init__(self, parent=None):
super(TrimageTableView, self)... |
import numpy as np
import pyqtgraph as pg
from pyqtgraph import functions as fn
from pyqtgraph import getConfigOption
from ..functions.general import isNumpyDatetime
class ScatterPlotWidget(pg.ScatterPlotWidget):
""" This is a high-level widget for exploring relationships in tabular data.
This plot widg... |
import os
import sys
import csv
import datetime
from time import time
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.Alphabet import Alphabet
if len(sys.argv) < 4:
print('Usage:', str(
sys.argv[0]), '[CSV FILE] [FASTA FILE] [DOWNSTREAM BP VALUE]')
else:
start... |
import os, os.path
from sqlalchemy import select
from sqlalchemy.orm import column_property
from flask import current_app as app
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['SQLALCHEMY_DA... |
"""This module is deprecated. Please use :mod:`airflow.providers.ssh.hooks.ssh`."""
import warnings
from airflow.providers.ssh.hooks.ssh import SSHHook # noqa
warnings.warn(
"This module is deprecated. Please use `airflow.providers.ssh.hooks.ssh`.",
DeprecationWarning,
stacklevel=2,
) |
import os
import json
#import reportlab
from xhtml2pdf import pisa
#from django_xhtml2pdf.utils import generate_pdf
#from reportlab.pdfgen import canvas
from django.http import HttpResponse
#from django.shortcuts import render
from django.views.generic.list import ListView
from django.shortcuts import render_to_respons... |
# coding: latin-1
"""
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 distributed in the hope that it will be ... |
"""Routines for working with OpenGL EGL contexts."""
import ctypes
import logging
from typing import Dict
from typing import Text
import glcontext
import os
log = logging.getLogger(__name__)
class EGL:
EGLAttrib = ctypes.c_ssize_t
EGLBoolean = ctypes.c_bool
EGLConfig = ctypes.c_void_p
EGLContext = ctypes.c... |
from .fields import (
bd01x09x,
bd1xx,
bd20x24x,
bd25x28x,
bd3xx,
bd4xx,
bd5xx,
bd6xx,
bd70x75x,
bd76x78x,
bd84188x,
bd90x99x,
)
from .model import hep, hep2marc
__all__ = ('hep', 'hep2marc') |
"""
Run unittests for a given set of functions
"""
import os
import subprocess as sp
import sys
from termcolor import cprint
from .utils import env_manager
from .utils.findfunc import find_manifest
def fancy_print(header, msg):
cprint(header + ": ", 'blue', end='')
cprint(msg, 'yellow')
def setup_parser(p... |
from gnuradio import gr, gr_unittest
import ofdm_swig as ofdm
class qa_static_mux_c (gr_unittest.TestCase):
def setUp (self):
self.tb = gr.top_block ()
def tearDown (self):
self.tb = None
def test_001_t (self):
# set up fg
self.tb.run ()
# check data
if __name__... |
import css_checker
from os import path as os_path
import re
from sys import path as sys_path
import unittest
_HERE = os_path.dirname(os_path.abspath(__file__))
sys_path.append(os_path.join(_HERE, '..', '..', '..', 'tools'))
import find_depot_tools # pylint: disable=W0611
from testing_support.super_mox import SuperMo... |
import glob
import os
import re
import csv
import operator
from datetime import datetime
# Source: http://stackoverflow.com/questions/3217682/checking-validity-of-email-in-django-python
REGEX_EMAIL = re.compile("[\w\.-]+@[\w\.-]+\.\w{2,4}")
def analyze_2ch():
files = glob.glob(os.path.join("data/2ch/", "*.data"))
... |
"""A sensor to provide information about next departures from Ruter."""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_NAME
from homeassistant.helpers.entity import Entity
fro... |
import datetime
from functools import partial
from django.apps import apps
from django.db import IntegrityError, transaction
from django.db.models import Q
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth import get_user_model
from django.utils import timezone
from django.conf impor... |
#! /usr/bin/python3
# coding:utf-8
'''
获取人力资源和社会保障部的解决夫妻两地分居情况公示的全部数据;
网站主页为:http://www.mohrss.gov.cn/;
'''
from pandas import DataFrame
import requests
from lxml import etree
class MohrssCrawler():
def __init__(self):
pass
def resolve_page(self,url):
data = {'year':[],
'id'... |
#!/usr/bin/env python
"""
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");... |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2014 Alex Forencich
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 righ... |
from django.http.response import HttpResponseRedirect
from django.urls import reverse
from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _
from django.views import generic
from adhocracy4 import phases
from adhocracy4.projects.mixins import ProjectMixin
from adhocracy4.rules imp... |
import sys
import time
import unittest
from spacewalk.common import rhnLib
class Tests(unittest.TestCase):
def _test_timestamp_1(self):
# Start with some timestamp, and verify that
# timestamp(strftime(t)) is # t
t = 85345
increment = 123456
while t < time.time() + incremen... |
import renpy
import random
# TODO: Random start of particles, all at once.
class Particles(renpy.display.core.Displayable):
"""
Supports particle motion.
"""
nosave = [ 'particles' ]
def after_setstate(self):
self.particles = None
def __init__(self, factory, style='de... |
from keras.datasets import mnist
from keras.utils import np_utils
import numpy as np
import h5py
import matplotlib.pylab as plt
def normalization(X):
return X / 127.5 - 1
def inverse_normalization(X):
return (X + 1.) / 2.
def get_nb_patch(img_dim, patch_size, image_dim_ordering):
assert image_dim_... |
# -*- coding: utf-8 -*-
"""
Praat lexer tests
~~~~~~~~~~~~~~~~~
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import unittest
from pygments.token import Token
from pygments.lexers import PraatLexer
class PraatTest(unittest.TestCase):
... |
"""nsx_gw_devices
Revision ID: 19180cf98af6
Revises: 117643811bca
Create Date: 2014-02-26 02:46:26.151741
"""
# revision identifiers, used by Alembic.
revision = '19180cf98af6'
down_revision = '117643811bca'
# Change to ['*'] if this migration applies to all plugins
migration_for_plugins = [
'neutron.plugins.n... |
from typing import List, Any
import re
import os
import collections
import itertools
def expand_file(f: str, recursive: bool):
if os.path.isdir(f):
if recursive:
lst = [expand_file(os.path.join(f, x), recursive) for x in os.listdir(f)]
return [item for sublist in lst for item in s... |
"""
Django settings for mysite 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, ...)
imp... |
from biothings.web.api.es.query_builder import ESQueryBuilder as BiothingsESQueryBuilder
import json
class SmartAPIQueryBuilder(BiothingsESQueryBuilder):
def get_query_filters(self):
_filter = None
if self.options.filters:
try:
terms_filter = json.loads... |
# -*- coding: utf-8 -*-
from djangosanetesting.cases import UnitTestCase
from djangosanetesting.utils import mock_settings
from django.core.cache import cache
from django.conf import settings
from testapp.models import ExampleModel
class TestUnitSimpleMetods(UnitTestCase):
def test_true(self):
self.asser... |
# coding=utf-8
from django.http import HttpResponse
from django.shortcuts import redirect
from pmtour.views.utils import (
get_a_tour,
ret_no_perm,
)
def check_status(request, tour_id):
tour, has_perm = get_a_tour(request, tour_id)
if not has_perm:
return ret_no_perm(request, tour_id)
turn... |
#!/usr/bin/python
"""
Copyright 2015 Stefano Benvenuti <<EMAIL>>
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 o... |
"""
the handlers that respond to requests from browsers or clients.
Each view function is mapped to one or more request URLs.
"""
from flask import render_template, flash, redirect, session, url_for, reqeust, g
from flask.ext.login import login_user, logout_user, current_user, login_required
from app import app, db, l... |
import commands
from commands import add, admin
import json
@admin
def reloadconfig(connection):
new_config = {}
try:
new_config = json.load(open('config.txt', 'r'))
if not isinstance(new_config, dict):
raise ValueError('config.txt is not a mapping type')
except ValueError, v:
... |
import numpy as np
from analyzarr.io_plugins.libs.tifffile import imsave, imread
# Plugin characteristics
# ----------------------
format_name = 'TIFF'
description = 'Import/Export standard image formats Christoph Gohlke\'s tifffile library'
full_suport = False
file_extensions = ['tif', 'tiff']
default_extension = 0 ... |
"""
FILE: fortran.py
AUTHOR: Cody Precord
@summary: Lexer configuration module for Fortran f77 and f95
@todo: check keywords more throughly
"""
__author__ = "Cody Precord <<EMAIL>>"
__svnid__ = "$Id: _fortran.py 63834 2010-04-03 06:04:33Z CJP $"
__revision__ = "$Revision: 63834 $"
#----------------------------------... |
__version__ = "0.1.4"
import heartbeat.Swizzle # NOQA
import heartbeat.Merkle # NOQA
import heartbeat.PySwizzle # NOQA
from .exc import HeartbeatError # NOQA
Heartbeat = heartbeat.Swizzle.Swizzle |
import pytest
from cfme import test_requirements
from cfme.infrastructure.provider import InfraProvider
from cfme.infrastructure.pxe import get_pxe_server_from_config
from cfme.infrastructure.pxe import get_template_from_config
from cfme.utils import testgen
from cfme.utils.appliance.implementations.ui import navigate... |
import base64
import hashlib
import struct
import uuid
from mcfw.properties import azzert
from rogerthat.consts import DEBUG
from rogerthat.utils import now
#### Copied from http://www.codekoala.com/blog/2009/aes-encryption-python-using-pycrypto/ ####
try:
from Crypto.Cipher import AES # @UnresolvedImport
except... |
from django.core.files.uploadhandler import FileUploadHandler, StopUpload
from django.core.cache import cache
from bft import app_settings
#make django validate when file uploads exceed the max upload size
#you can set this to false when you want your web server (APACHE)
# to validate the size of the upload ie-
# Lim... |
# -*- coding: utf-8 -*-
import os
import numpy as np
from glassure.core import Pattern
from glassure.core import calculate_sq
from glassure.gui.model.glassure import GlassureModel
from .utility import data_path, QtTest
class GlassureModelTest(QtTest):
def setUp(self):
self.model = GlassureModel()
... |
import abc
from framework.auth.decorators import collect_auth
from website.util import api_url_for, web_url_for
class AddonSerializer(object):
__metaclass__ = abc.ABCMeta
# TODO take addon_node_settings, addon_user_settings
def __init__(self, node_settings=None, user_settings=None):
self.node_se... |
import flask
import unittest
import json
import uuid
import os
import tempfile
from faafo.api import create_app
class FlaskrTestCase(unittest.TestCase):
def setUp(self):
self.db_fd , self.filepath_db = tempfile.mkstemp()
options = {
'config_dict' : {
'DEBUG' : True,
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime
from getpass import getuser
import json
from os import environ
from pipes import quote
from socket import gethostname
from time import time
from .exceptions import NodeLockedException
from .utils import cached_property, temp... |
"""Test cases for Zinnia's MetaWeblog API"""
try:
from xmlrpc.client import Binary
from xmlrpc.client import Fault
from xmlrpc.client import ServerProxy
except ImportError: # Python 2
from xmlrpclib import Binary
from xmlrpclib import Fault
from xmlrpclib import ServerProxy
from tempfile import... |
import bpy
class LIMaterialExportSettingsOperator(bpy.types.Operator):
bl_idname = "wm.lipsofsuna_material_export_settings"
bl_label = "Material Exporting Settings"
bl_description = 'Control how this material should be exporter and look in-game'
li_file = bpy.props.StringProperty(name='File name', description='Ta... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
requirements = [
# TODO: put package requirements here
]
test_requi... |
from Classification import classification_by_name
from kinds import lowercase_first_word
class Token(object):
"""
Represents the specification for a Token in the TokenSyntax file.
"""
def __init__(self, name, kind, text=None, classification='None',
is_keyword=False):
self.na... |
"""
Title: QR Ticket Generator
Description: Creates 'unique' QR images and files used for
rapid verification of authenticity. It accomplishes this
to the best of (my) ability and given effort.
Copyright (C) 2015 Jacob Sanders
This program is free software; you can redistribute it ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
AUTHOR = '40423141'
SITENAME = '協同產品設計實習40423141黃羿誠'
# 不要用文章所在目錄作為類別
USE_FOLDER_AS_CATEGORY = False
#PATH = 'content'
#OUTPUT_PATH = 'output'
TIMEZONE = 'Asia/Taipei'
DEFAULT_LANG = 'en'
# Feed generation is usually not desire... |
from graphication import default_css, Series
from graphication.text import text_bounds
from graphication.color import hex_to_rgba
from graphication.scales import SimpleScale, VerticalWavegraphScale
class Graph(object):
def set_size(self, width, height):
self.width = width
self.height = height
self.calc_plot... |
from __future__ import (absolute_import, division, print_function)
import systemtesting
from mantid.simpleapi import *
from ISISCommandInterface import *
class LOQTransFitWorkspace2D(systemtesting.MantidSystemTest):
"""
Tests the SANS interface commands TransFit() and TransWorkspace(). Also tests
... |
import tempfile
import os
import shutil
import sys
from io import StringIO
from unittest import TestCase
from subprocess import DEVNULL
from unittest import mock
from configparser import ConfigParser
import sarge
from doc2git import cmdline
from doc2git.cmdline import (get_git_path, get_conf, run, get_remote, main,
... |
import traceback
import time
from avnserial import *
import avnav_handlerList
from avnav_nmea import NMEAParser
from avnav_util import AVNLog
from avnav_worker import AVNWorker
hasSerial=False
try:
import serial
hasSerial=True
except:
pass
#a writer class to write to a serial port using pyserial
#on windows ... |
import os
class Linux_Headers_P1:
conf_lst = {}
e = False
root_dir = ""
def init(self, c_lst, ex, root_dir):
self.conf_lst = c_lst
self.e = ex
self.root_dir = root_dir
self.config = {
"name": "linux", # Name of the package
"version": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.