src
stringlengths
721
1.04M
import numpy as np from mlxtend.classifier import EnsembleClassifier from sklearn.grid_search import GridSearchCV from sklearn import cross_validation from sklearn.linear_model import LogisticRegression from sklearn.naive_bayes import GaussianNB from sklearn.ensemble import RandomForestClassifier import numpy as np f...
import os import sys import datetime import traceback import hashlib import ics import json log = lambda *x, **y: print(*x, **y, file=sys.stderr) CACHE = os.path.expanduser('~/.cache/calendar/{}') FRESH = os.path.expanduser('~/.cache/calendar/fresh/{}') CONFIG = os.path.expanduser('~/.config/calendar/config') def _r...
""" Copyright (C) 2018 SunSpec Alliance Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merg...
import numpy as np def get_keys_in_framerange(pd, framerange): return np.unique(pd.ix[framerange[0]:framerange[-1]].objid) def get_frames_for_key(pd, key): return pd[pd.objid==key].frames.values def get_data_in_framerange(pd, framerange): # pd_subset return pd.ix[framerange[0]:framerange[-1]] de...
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyPyopencl(PythonPackage): """Python wrapper for OpenCL.""" homepage = "https://docu...
from core.himesis import Himesis, HimesisPreConditionPatternLHS class HM5ThenClausePart2CompleteLHS(HimesisPreConditionPatternLHS): def __init__(self): """ Creates the himesis graph representing the AToM3 model HM5ThenClausePart2CompleteLHS. """ # Flag this instance as compiled no...
from __future__ import unicode_literals from unittest import TestCase from wtforms.form import BaseForm, Form from wtforms.meta import DefaultMeta from wtforms.fields import StringField, IntegerField from wtforms.validators import ValidationError from tests.common import DummyPostData class BaseFormTest(TestCase): ...
# Copyright (c) 2017-present, Facebook, 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 or agreed...
import json import time from datetime import timedelta, datetime from dateutil import parser as dateparser from django.http import HttpResponse from django.db.models.aggregates import Count from django.db import connection from catmaid.control.authentication import requires_user_role from catmaid.models import ClassI...
# pylint: disable=C0111,R0903 """Toggle twmn notifications. Requires the following executable: * systemctl contributed by `Pseudonick47 <https://github.com/Pseudonick47>`_ - many thanks! """ import core.module import core.widget import core.input import core.decorators import util.cli class Module(core.modul...
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
import sys from PyQt5.QtWidgets import (QApplication, QWidget, QPushButton, QMessageBox, QDesktopWidget, QMainWindow, QAction, qApp, QTextEdit, QHBoxLayout, QVBoxLayout) # from PyQt5.QtCore import QCoreApplication from PyQt5.QtGui im...
import time import BaseHTTPServer from urlparse import urlparse, parse_qs import subprocess import base64 import qrcode import qrcode.image.svg import cStringIO #1630-1800 HOST_NAME = 'localhost' # !!!REMEMBER TO CHANGE THIS!!! PORT_NUMBER = 8000 # Maybe set this to 9000. class MyHandler(BaseHTTPServer.BaseHTTPReq...
from tensorflow.contrib.keras.api.keras.layers import Conv2D, MaxPooling2D, Flatten from tensorflow.contrib.keras.api.keras.layers import Input, LSTM, Embedding, Dense, concatenate from tensorflow.contrib.keras.api.keras.layers import Input, LSTM, Embedding, Dense, concatenate, Add #from keras.layers import Conv2D, Max...
from setuptools import setup from setuptools import find_packages with open("README.md", "r") as fh: pyaf_long_description = fh.read() setup(name='pyaf', version='3.0-RC1', description='Python Automatic Forecasting', long_description=pyaf_long_description, long_description_content_type...
# Copyright 2016 Google 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 or agreed to in writing, ...
# -*- coding: utf-8 -*- # Define here the models for your spider middleware # # See documentation in: # http://doc.scrapy.org/en/latest/topics/spider-middleware.html from scrapy import signals class SegurarseComArSpiderMiddleware(object): # Not all methods need to be defined. If a method is not defined, # s...
#!/usr/bin/env python # Copyright (C) 2006-2016 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia 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 (FSF), e...
""" Test the partitions and partitions service """ from datetime import datetime from unittest.mock import Mock import pytest from django.test import TestCase from opaque_keys.edx.locator import CourseLocator from stevedore.extension import Extension, ExtensionManager from openedx.features.content_type_gating.mode...
# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions a...
from django.test import TestCase from core.models import ValidationScenario from tests.utils import TestConfiguration SCHEMATRON_PAYLOAD = '''<?xml version="1.0" encoding="UTF-8"?> <schema xmlns="http://purl.oclc.org/dsdl/schematron" xmlns:internet="http://internet.com"> <ns prefix="internet" uri="http://internet.com...
from setuptools import setup, find_packages import codecs from os import path here = path.abspath(path.dirname(__file__)) def long_description(): with codecs.open('README.rst', encoding='utf8') as f: return f.read() setup( name='docopt2ragel', version='0.1.3', description='Convert your doco...
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from conte...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import yaml import roslib roslib.load_manifest("ps4eye"); from sensor_msgs.msg import CameraInfo import rospy import rospkg class CameraInfoPublisher: # Callback of the ROS subscriber. def leftCallback(self, data): left_cam_info_org = data ...
import components, actions import pygame import math from collections import defaultdict from point import Point class DrawingSystem: def __init__(self, screen, camera_target): self.screen = screen self.camera_pos = Point(0,0,0) self.camera_target = camera_target self.tileset = pyga...
import traceback import inspect import os import Queue import string import sys import threading import time import xmlrpclib import socket import struct import copy import re import XendDomain, XendDomainInfo, XendNode, XendDmesg, XendConfig import XendLogging, XendTaskManager, XendAPIStore, XendIOCont...
#encoding=utf-8 ## SOLVED 2014/04/18 ## 121313 # By replacing the 1st digit of the 2-digit number *3, it turns out that six of # the nine possible values: 13, 23, 43, 53, 73, and 83, are all prime. # By replacing the 3rd and 4th digits of 56**3 with the same digit, this # 5-digit number is the first example having se...
import argparse import time import pytest import parsl from parsl.app.app import App from parsl.tests.configs.local_threads import config parsl.clear() parsl.load(config) @App('python') def double(x): return x * 2 def plain_double(x): return x * 2 @pytest.mark.skip('not asserting anything') def test_pl...
import datetime, pytz import re import tzlocal def date2human(when, slack_secs=180): """ Convert timestamp to human-friendly times, like '3 minutes ago' """ if not when: return None now = datetime.datetime.utcnow().replace(tzinfo=pytz.utc) diff = now-when secs = diff.seconds days = diff...
import os import sys from PyQt5.QtWidgets import QApplication, QWidget from PyQt5 import QtCore from PyQt5 import QtGui current_directory = os.path.dirname(os.path.abspath(__file__)) parent_directory = os.path.abspath(os.path.join(current_directory, os.pardir)) resource_directory = os.path.join(current_directory, "re...
"""Material utility.""" import honeybee_plus.radiance.material.bsdf import honeybee_plus.radiance.material.glass import honeybee_plus.radiance.material.glow import honeybee_plus.radiance.material.light import honeybee_plus.radiance.material.metal import honeybee_plus.radiance.material.mirror import honeybee_plus.radian...
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import models, fields, api from .serv...
#! /usr/bin/env python3 """ usage: repo-sync CONFIG Creates a sync repo in PWD. Environment: REPONAME name of the sync repo in workdir (Default: repo-sync.git) Configuration: Sync configuration in json format,defines which branch of "origin.url" will be mirrored to "mirror.url" $name.origin.ref d...
import sys sys.path.insert(1,"../../") import h2o from tests import pyunit_utils # The purpose of this test is to detect a change in the _metric_json of MetricsBase objects. Many of the metric # accessors require _metric_json to have a particular form. def metric_json_check(): df = h2o.import_file(path=py...
#!/usr/bin/env python # encoding: utf-8 """ exp4.py Experiment 4: playing around with brightness/contrast enhancement. Created by Oliver Smith on 2009-08-21. Copyright (c) 2009 Oliver Smith. All rights reserved. """ from getopt import getopt import sys from opencv.cv import * from opencv.highgui import * def quick...
#! /usr/bin/env python # -*- coding: utf-8 -*- from pycket import impersonators as imp from pycket import values from pycket.cont import call_cont from pycket.error import SchemeException from pycket.prims.expose import default, expose, make_callable_label, procedure # Can use this to promote a get_cmk operation to a ...
############################################################################ # Copyright 2015 Skyscanner Ltd # # # # Licensed under the Apache License, Version 2.0 (the "License"); # # you may no...
# -*- coding: utf-8 -*- """ /*************************************************************************** QAD Quantum Aided Design plugin classe base per un comando ------------------- begin : 2013-05-22 copyright : iiiii emai...
import argparse import os import shlex import subprocess import multiprocessing import sys def sketch_call(tup): ss, ks, paths = tup cstr = "flashdans sketch -p1 -k%i -S%i %s" % (ss, ks, " ".join(paths)) subprocess.check_call(shlex.split(cstr)) if __name__ == "__main__": sketch_range = range(10, 24,...
# -*- coding: utf-8 -*- """WSGI middleware initialization for the webui application.""" from webui.config.app_cfg import base_config from webui.config.environment import load_environment __all__ = ['make_app'] # Use base_config to setup the necessary PasteDeploy application factory. # make_base_app will wrap the T...
""" Author: RedFantom Contributors: Daethyra (Naiii) and Sprigellania (Zarainia) License: GNU GPLv3 as in LICENSE Copyright (C) 2016-2018 RedFantom """ # Standard Library from ast import literal_eval import sys # UI Libraries import tkinter as tk from tkinter import ttk from tkinter import messagebox # Project Modules ...
#!/usr/bin/env python # 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 distributed in the hope that ...
# Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Helpful routines for regression testing # # Add python-truthcoinrpc to module search path: import os import sys sys.path.append(o...
# -*- coding: utf-8 -*- #+---------------------------------------------------------------------------+ #| 01001110 01100101 01110100 01111010 01101111 01100010 | #| | #| Netzob : Inferring communication protocol...
# Django settings for devbitstudio project. import os DEBUG = True TEMPLATE_DEBUG = DEBUG DOMAIN = 'devbitstudio.com' EMAIL_HOST = 'localhost' EMAIL_PORT = 25 #~ DEFAULT_FROM_EMAIL = 'contact@devbitstudio.com' SERVER_EMAIL = 'contact@devbitstudio.com' EMAIL_SUBJECT_PREFIX = 'DevBitStudio - ' CURRENT_PATH = os.path...
#!/usr/bin/env python2 # -*- coding: UTF-8 -*- import sys import os import urlparse import urllib class GConf: """global configuration """ GROUP_ID = '10079277' # encodings SHELL_ENCODING = sys.stdout.encoding INTERNAL_ENCODING = 'utf_8' # debug mode DEBUG = False # global d...
from django.contrib.gis.db import models LOCALES = ( ('11', 'City, Large'), ('12', 'City, Mid-size'), ('13', 'City, Small'), ('21', 'Suburb, Large'), ('22', 'Suburb, Mid-size'), ('23', 'Suburb, Small'), ('31', 'Town, Fringe'), ('32', 'Town, Distant'), ('33', 'Town, Remote'), ('4...
import json import datetime import tempfile import logging logger = logging.getLogger("django.request") from django.conf import settings from django.contrib import messages from django.contrib.auth.decorators import login_required, permission_required from django.contrib.contenttypes.models import ContentType from dja...
""" Copyright 2013 Steven Diamond 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...
################################ # 공통 패키지 불러오기 ################################ from keras.datasets import mnist import numpy as np from PIL import Image import math import os import keras.backend as K K.set_image_data_format('channels_first') print(K.image_data_format) ################################ # GAN 모델링 ###...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
info = { "name": "uz-Cyrl", "date_order": "DMY", "january": [ "янв", "январ" ], "february": [ "фев", "феврал" ], "march": [ "мар", "март" ], "april": [ "апр", "апрел" ], "may": [ "май" ], "june": ...
import kindred import os import shutil import tempfile import hashlib class TempDir: def __init__(self): pass def __enter__(self): self.tempDir = tempfile.mkdtemp() return self.tempDir def __exit__(self, type, value, traceback): shutil.rmtree(self.tempDir) def test_loadBioNLP_findDir(): with TempDir() ...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'file_mirrors_list_new.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _...
import datetime from ert.util import BoolVector from ert.test import TestAreaContext from ert.test import ExtendedTestCase from ert.enkf import MeasBlock,MeasData class MeasDataTest(ExtendedTestCase): def test_create(self): ens_size = 10 ens_mask = BoolVector( default_value = True , initial_s...
# -*- coding: utf-8 -*- # Copyright (C) 2010-2014 Avencall # # 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 p...
import os import unittest from skyscraper.scraper_service import ScraperServiceFactory from skyscraper.utils.constants import SPEEDOMETER_KEY, AGE_KEY, CAR_KEY, PRICE_KEY, POWER_KEY, CURRENCY_KEY from common_test_utils import gather_extension_files, VALIDATION_DATA class TestScraping(unittest.TestCase): files_under...
#-*- coding: utf-8 -*- from django.core.files import File as DjangoFile from django.core.management.base import BaseCommand, NoArgsCommand from optparse import make_option import os import sys import time import re from tagging.models import Tag from alibrary.models import Artist, Release, Media, Label, Relation, L...
from prospector2.formatters.base import Formatter __all__ = ( 'TextFormatter', ) # pylint: disable=unnecessary-lambda class TextFormatter(Formatter): summary_labels = ( ('started', 'Started'), ('completed', 'Finished'), ('time_taken', 'Time Taken', lambda x: '%s seconds' % x), ...
""" Consistent Overhead Byte Stuffing (COBS) This version is for Python 3.x. """ class DecodeError(Exception): pass def _get_buffer_view(in_bytes): mv = memoryview(in_bytes) if mv.ndim > 1 or mv.itemsize > 1: raise BufferError('object must be a single-dimension buffer of bytes.') try: ...
import collections import functools from .compat import get_running_loop __all__ = ( 'apartial', 'lru_cache', ) _CacheEntry = collections.namedtuple('_CacheEntry', 'value expire_at') def apartial(coro, *args, **kwargs): """ Wraps a coroutine function with pre-defined arguments (including keyword ...
import pickle import numpy as np import cf_recommender as cf import similarity_functions as sf import movie_reviews_compiler as mrc path = '../data/' def run_test_weighted_sums(cosine=True): '''compute the predictions for masked values in the testing set (user review vectors) using the training set (critic review ma...
# coding: utf-8 # Copyright: (c) 2020, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import absolute_import, division, print_function import glob import os import os.path import pathlib import shutil from tem...
import unittest from feemodel.txmempool import MemBlock from feemodel.tests.pseudoproxy import proxy from feemodel.tests.config import test_memblock_dbfile as dbfile AVAILABLE_HEIGHTS = range(333931, 333954) + [334655, 334656] class PseudoProxyTests(unittest.TestCase): def test_A(self): # Just test that...
from rest_framework.test import APITestCase from biohub.notices import tool from biohub.accounts.models import User class Test(APITestCase): def setUp(self): self.me = User.objects.create_test_user('me') self.you = User.objects.create_test_user('you') self.dispatcher = tool.Dispatcher('t...
import logging import os from typing import TYPE_CHECKING, Optional from qgis.PyQt.QtWidgets import QDialog, QFileDialog, QLineEdit, QPushButton, QWidget from qkan.database.dbfunc import DBConnection logger = logging.getLogger("QKan.tools.dialogs") if TYPE_CHECKING: from qkan.plugin import QKanPlugin class QKa...
"""Schemas to valid user input. Index ----- .. currentmodule:: nanoqm.workflows.schemas .. autosummary:: {autosummary} API --- {autodata} """ __all__ = [ 'schema_cp2k_general_settings', 'schema_derivative_couplings', 'schema_single_points', 'schema_distribute_absorption_spectrum', 'schema_dis...
# coding: utf8 # MediaSanción, aplicación web para acceder a los datos públicos de la # actividad legislativa en Argentina. # Copyright (C) 2010,2011,2012 Renzo Carbonara <renzo @carbonara .com .ar> # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General ...
from django import forms from django.db.models import Q from corporaciones.models import Corporacion , Sede class FormularioRegistroCorporacion(forms.Form): id_corporation = forms.IntegerField( widget=forms.NumberInput(attrs={'class': 'form-control', 'placeholder': 'Escriba aquí el id de la corporación',...
from rest_framework.generics import ListCreateAPIView, RetrieveUpdateAPIView, ListAPIView from rest_framework.response import Response from rest_framework.views import APIView from api.models import Sighting, Picture, Location, Question, Answer, SightingInfo from api.serializers import SightingSerializer, PictureSeria...
from pypif import pif from pypif.obj.common.pio import Pio from pypif.util.serializable import Serializable from six import string_types class PifSearchHit(Serializable): """ Class to store a single PIF search hit. """ def __init__(self, id=None, dataset=None, dataset_version=None, score=None, update...
import roslib; roslib.load_manifest('ar_loc_base') import rospy from numpy import * from numpy.linalg import pinv, inv from math import pi, sin, cos from geometry_msgs.msg import * import tf import bisect import threading from rover_kinematics import * class RoverPF(RoverKinematics): def __init__(self, initial_po...
# 滑块条(QSlider)组件有一个简单的可调节手柄。 import sys from PyQt5.QtWidgets import (QWidget, QSlider, QLabel, QApplication) from PyQt5.QtCore import Qt from PyQt5.QtGui import QPixmap class Example(QWidget): def __init__(self): super().__init__() self.initUI() def initUI(self):...
# -*- coding: utf-8 -*- # Copyright 2014 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. """Unittest-only utility functions library.""" from __future__ import print_function import os from chromite.lib import cros_bu...
# coding: utf-8 """ Qc API Qc API # noqa: E501 The version of the OpenAPI document: 3.0.0 Contact: cloudsupport@telestream.net Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 import six from telestream_cloud_qc.configuration import Configuration class...
# 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...
# -*- coding: UTF-8 -*- from __future__ import absolute_import, unicode_literals import re from json import dumps from collections import defaultdict from .log import mkLogger from .text.utils import contains_emoji, extract_named_entities from .text.utils import most_common_words from .text.spam import is_spam logg...
def sign(x): if x == 0: return x return -1 if x < 0 else 1 class UnionFind: def __init__(self, initial=None): self.uf = initial or {} def union(self, a, b): a_par, b_par = self.find(a), self.find(b) self.uf[a_par] = b_par def find(self, a): if self.uf.get(...
#!/usr/bin/env python # license removed for brevity import rospy from std_msgs.msg import Float32, Int32 sumdata = 0.0 count = 0 def callback(data): global count, sumdata sumdata += data.data count += 1 def listener(): global count, sumdata pub = rospy.Publisher('avg', Float32, queue_size=10)...
# Copyright (c) 2012-2013 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functiona...
from .common import Common from .vocabulary import ThreatDescriptor as td from .vocabulary import ThreatExchange as t class ThreatDescriptor(Common): _URL = t.URL + t.VERSION + t.THREAT_DESCRIPTORS _DETAILS = t.URL + t.VERSION _RELATED = t.URL + t.VERSION _fields = [ td.ADDED_ON, td....
# Copyright 2015 gRPC authors. # # 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...
from .base import CanaryToolsBase from .databundles import DataBundles from dateutil.parser import parse class Devices(object): def __init__(self, console): """Initialize the device :param console: The Console from which API calls are made """ self.console = console def all(...
from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, BooleanField, SubmitField, ValidationError, SelectField, IntegerField, DecimalField from wtforms.validators import Required, Email, Length, Regexp, EqualTo, NumberRange from wtforms import ValidationError from ..models import User class Lo...
""" Django settings for test_sugardough project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ import os import dj_database_url from decouple import Csv, config...
# -*- coding: utf-8 -*- # # VXI-11 for Python documentation build configuration file, created by # sphinx-quickstart on Fri Jul 7 11:57:43 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated f...
from utils import * def computeSSE(data, centers, clusterID): sse = 0 nData = len(data) for i in range(nData): c = clusterID[i] sse += squaredDistance(data[i], centers[c]) return sse def updateClusterID(data, centers): nData = len(data) clusterID = [0] * nD...
#!/usr/bin/env python # # Copyright 2007 Doug Hellmann. # # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software and # its documentation for any purpose and without fee is hereby # granted, provided that the above copyright notice appear in all # copies and tha...
# Example: How to prepare an iDEAL payment with the Mollie API. # import os import time import flask from app import database_write from mollie.api.client import Client from mollie.api.error import Error def main(): try: # # Initialize the Mollie API library with your API key. # ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from __future__ import absolute_import, division, unicode_literals # Copyright (C) 2018 Ben McGinnes <ben@gnupg.org> # # 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 S...
import sys import os import pysos import signal # these two variables should be changed depending on the test drivers PID # and the type of message it will be sending, If you are using the generic_test.c # then it is likely these two values can stay the same TEST_MODULE = 0x81 MSG_TEST_DATA= 33 ALARM_LEN = 60 START_...
#!/usr/bin/python """ Helper classes for constructed data tests. """ from bacpypes.debugging import bacpypes_debugging, ModuleLogger, xtob from bacpypes.errors import MissingRequiredParameter from bacpypes.primitivedata import Boolean, Integer, Tag, TagList from bacpypes.constructeddata import Element, Sequence # s...
import subprocess import pyaudio import os class TenvisAudio(): def __init__(self,ip): self.command=['avconv','-i','rtsp://'+ip+'/11','-ar', '16000','-vn','-f','wav', 'pipe:1'] self.FNULL = open(os.devnull, 'w') self.start_stream() def start_stream(self): self.pipe = subprocess....
#/usr/bin/env python # author: Mylene Campana (mcampana@laas.fr) # Script which goes with hpp-rbprm-corba package. from hpp.corbaserver.rbprm.rbprmbuilder import Builder from hpp.corbaserver.rbprm.rbprmfullbody import FullBody from hpp.corbaserver.rbprm.problem_solver import ProblemSolver from hpp.gepetto import Viewe...
# Copyright 2018 The Kubeflow Authors # # 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...
#!/usr/bin/env python import sys from lib import test_runner, reports def main(testset_file, params): config_file = 'default.cfg' if 'config' in params.keys(): config_file = params['config'] runner = test_runner.instantiate_runner(config_file) if not runner: return False, 'Couldn\'t load configuration file...
#!/usr/bin/env python # # 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 distributed in the hope that...
''' Author: Hans Erik Heggem Email: hans.erik.heggem@gmail.com Project: Master's Thesis - Autonomous Inspection Of Wind Blades Repository: Master's Thesis - CV (Computer Vision) ''' ################### UNIT TEST ######################## import unittest from Settings.TestData import TestData from TestUnits.Test_ma...
# -*- coding: utf-8 -*- ''' Modified on 2017-03-28 @author: javacardos@gmail.com @organization: https://www.javacardos.com/ @copyright: JavaCardOS Technologies. All rights reserved. ''' from pyResMan.BaseDialogs.pyResManCommandDialogBase_MifareAuthentication import CommandDialogBase_MifareAuthentication from pyResMa...
# -*- coding: utf-8 -*- ''' Exodus Add-on Copyright (C) 2016 Exodus 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 l...