src
stringlengths
721
1.04M
#!/usr/bin/python import agent_bakery import cmk.paths group = "agents/" + _("Agent Plugins") register_rule(group, "agent_config:omd-sane-cleanup", Transform( Alternative( title = _("omd-sane-cleanup agent plugin (Linux)"), help = _("This will deploy the <tt>omd-sane-cleanup ...
from support.handler_fixture import StationHandlerTestCase from groundstation.transfer.request_handlers import handle_listallobjects from groundstation.transfer.response_handlers import handle_terminate import groundstation.transfer.response as response from groundstation.proto.object_list_pb2 import ObjectList cla...
#!/usr/bin/env python """Run the test suite that is specified in the .travis.yml file """ import os import subprocess import yaml from flo.colors import green, red root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) def run_test(command): wrapped_command = "cd %s && %s" % (root_dir, command)...
#!/usr/bin/env python3 """TCP版本的AES加密模块""" """ import sys sys.path.append("../../../") """ import hashlib import os import freenet.lib.base_proto.tunnel_tcp as tunnel import freenet.lib.base_proto.utils as proto_utils import freenet.lib.crypto.aes._aes_cfb as aes_cfb FIXED_HEADER_SIZE = 48 class encrypt(tunnel.bui...
"""website URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-bas...
def openfastx(fpath,mode="rt"): import os gz = False fpathnoext, fext = os.path.splitext(fpath) if fext == '.gz': gz = True fpathnoext, fext = os.path.splitext(fpathnoext) if fext.lstrip(".") in ['fasta','fa']: ftype = 'fasta' elif fext.lstrip(".") in ['fastq','fq']: ...
from mock import patch import unittest import yoda from click.testing import CliRunner class TestSuggestDrink(unittest.TestCase): """ Test for the following commands: | Module: food | command: suggest_drinks """ RANDOM_DRINK = { 'drinks': [{ 'strDrink': 'Oatmeal Co...
# pylint: disable=E1101,E1103,W0232 import datetime import warnings from functools import partial from sys import getsizeof import numpy as np from pandas._libs import index as libindex, lib, Timestamp from pandas.compat import range, zip, lrange, lzip, map from pandas.compat.numpy import function as nv from pandas ...
from django.conf.urls import url from django.views.decorators.cache import cache_page from django.views.generic import TemplateView from . import models from . import views urlpatterns = [ # TemplateView url(r'^template/no_template/$', TemplateView.as_view()), url(r'^template/simple/(?P<foo>\w+)/...
#!/usr/bin/env python3 from __future__ import print_function from __future__ import division import argparse import pickle import time import CCBuilder as ccb import CCBuilder_c as ccb_c import numpy as np import scipy.special def uniform_dist(x): """ Returns uniform distributions of given range """ return la...
# -*- coding: utf-8 -*- """This allows the model to have a :class:`Color` object class without the need for :class:`PyQt5.QtGui.QColor` When running the Qt Application, :class:`QColor` will be used, otherwise an API compatible class is used and exported as a :class:`Color` object Currently :class:`Color` objects are ...
#!/usr/bin/env python # -*- coding: utf-8 -*- from solution import TreeNode from solution import BSTIterator def constructOne(s): s = s.strip() if s == '#': return None else: return TreeNode(int(s)) def createTree(tree): q = [] tree = tree.split(",") root = constructOne(tree[0...
import json from django.test import TestCase from django.test.client import Client class SimpleTest(TestCase): def setUp(self): self.client = Client() def test_mona_lisa_1(self): # TODO(sghiaus): Change test images to png. mona_lisa_1 = open("detection_app/testdata/MonaLisa1.png", "rb...
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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...
# usr/bin/env python # -*- coding: utf-8 -*- """ Created on Wed Jul 12 13:15:05 2017 @author: Vijayasai S """ # Use python3 import Cluster as cl from pymongo import MongoClient import numpy as np from datetime import datetime def centroid(lati=[],longi=[]): x = sum(lati) / len(lati) y = sum(longi) / len(longi) r...
from . import deferred_define from . import Widget, QWidget from . import QMainWindow, QDockWidget from . import QHBoxLayout, SquareLayout from . import WidgetController from . import QSize, QSizeF, QPoint from . import QPicture, QPixmap from . import QPrinter, QPainter @deferred_define def set_central_widget(self: W...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.utils import timezone from django.template.defaultfilters import slugify # Create your models here. class Post(models.Model): """ Here we'll define our Post model """ # author is linked to a regis...
import os import shutil import sys class HostapdMACACL(object): def __init__(self, settings, options): self.debug = options['debug'] assert not (options['mac_whitelist'] is not None and options['mac_blacklist'] is not None) if options['mac_whitelist'] is ...
# ---------------------------------------------------------------------------- # Copyright 2014 Nervana Systems 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.o...
#!/usr/bin/python import TestConfig import _OGAbstractFactory import _WKTParser import _OGGeoTypeFactory ################################################################################ # Copyright (c) QinetiQ Plc 2003 # # Licensed under the LGPL. For full license details see the LICENSE file. #####################...
# Copyright (C) 2017 Equinor ASA, Norway. # # The file 'site_config.py' is part of ERT - Ensemble based Reservoir Tool. # # ERT 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 Lic...
# # This file is protected by Copyright. Please refer to the COPYRIGHT file # distributed with this source distribution. # # This file is part of REDHAWK frontendInterfaces. # # REDHAWK frontendInterfaces is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public Licen...
from elasticsearch import Elasticsearch from flask import current_app class Backend: def connect(self, config): client = Elasticsearch([{'host': 'localhost', 'port': 9200}]) self.create_indexes(client) return client @staticmethod def create_indexes(es): es.indices.create...
# 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) import pytest import contextlib import os.path import jsonschema import llnl.util.cpu import llnl.util.cpu.detect impo...
from django_graph_api.graphql.types import ( BooleanField, CharField, Enum, ENUM, EnumField, INPUT_OBJECT, INTERFACE, List, LIST, ManyEnumField, ManyRelatedField, NON_NULL, Object, OBJECT, RelatedField, SCALAR, UNION, NonNull, ) class DirectiveLo...
# -*- coding: utf-8 -*- import pytest from cfme import test_requirements from cfme.configure.settings import visual from cfme.fixtures import pytest_selenium as sel from cfme.web_ui import ColorGroup, form_buttons from cfme.utils.appliance import current_appliance from cfme.utils.appliance.implementations.ui import na...
from couchpotato import get_session from couchpotato.core.event import fireEvent, addEvent from couchpotato.core.helpers.encoding import toUnicode, simplifyString, ss, sp from couchpotato.core.helpers.variable import getExt, getImdb, tryInt, \ splitString from couchpotato.core.logger import CPLog from couchpotato.c...
#!/usr/bin/env python # This file is part of VoltDB. # Copyright (C) 2008-2013 VoltDB 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, including # without limitati...
# $Id: core.py 8126 2017-06-23 09:34:28Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Calling the ``publish_*`` convenience functions (or instantiating a `Publisher` object) with component names will result in default behavior. For custom beha...
# Copyright 2017 Become Corp. 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...
import argparse import csv import json import pickle import numpy as np from matplotlib.mlab import PCA from mag_data import loadMagData if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('path', help='path to dataset folder') args = parser.parse_args() matrix = [] j...
from L500analysis.data_io.get_cluster_data import GetClusterData from L500analysis.utils.utils import aexp2redshift from L500analysis.plotting.tools.figure_formatting import * from L500analysis.plotting.profiles.tools.profiles_percentile \ import * from L500analysis.plotting.profiles.tools.select_profiles \ imp...
################################################################################ ############################################################################### # Copyright (C) 2013-2014 Jacob Barhak # Copyright (C) 2009-2012 The Regents of the University of Michigan # # This file is part of the MIcroSimulation Tool (...
from __future__ import absolute_import import os import re from svtplay_dl.fetcher.dash import dashparse from svtplay_dl.fetcher.hds import hdsparse from svtplay_dl.fetcher.hls import hlsparse from svtplay_dl.service import Service class Raw(Service): def get(self): filename = os.path.basename(self.url[...
import unittest from Training.tactical_3x3_lobe_slot import * class Tactical3x3LobeTestCase(unittest.TestCase): def setUp(self): self.lobe = TacticalLobe() self.ana_f = [0,0,0,0,0,0,0,0] self.ana_0 = [2,0,0,0,0,0,0,0] self.ana_1 = [0,2,0,0,0,0,0,0] self.ana_2 = [0,0,2,0,0,0...
from merc import message class BaseError(Exception, message.Reply): pass class Error(Exception, message.Message): NAME = "ERROR" FORCE_TRAILING = True def __init__(self, reason): self.reason = reason def as_params(self, client): return [self.reason] class LinkError(Error): NAME = "ERROR" F...
# 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): # Changing field 'ImageMap.auto_geo_polygon' db.alter_column('lizard_levee_imagemap', 'auto_geo_polygon', ...
from braces.views import LoginRequiredMixin, GroupRequiredMixin from django.contrib import messages from django.core.urlresolvers import reverse from django.db.models import Q from django.http import Http404 from django.shortcuts import get_object_or_404, redirect from django.views.generic import ListView, DetailView, ...
"""Process a list of repository arguments.""" # ============================================================================= # CONTENTS # ----------------------------------------------------------------------------- # abdi_processrepoarglist # # Public Functions: # do # determine_max_workers_default # fetch_if_n...
#!/usr/bin/env python """ Name : qconcurrency/models.py Created : Apr 14, 2017 Author : Will Pittman Contact : willjpittman@gmail.com ________________________________________________________________________________ Description : Generic models, and interfaces for models to be used ...
import unittest import logging import model import json_model import tempfile import shutil import copy import json import os.path from common import * import json_model class TestModelSaving(unittest.TestCase): def setUp(self): self.temp_dir = tempfile.mkdtemp() self.model = json_model.ModelAd...
# -*- coding: utf-8 -*- # # Copyright 2016 edX PDR Lab, National Central University, Taiwan. # # http://edxpdrlab.ncu.cc/ # # 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://w...
""" Models for the credentials service. """ import logging import uuid import bleach from django.conf import settings from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation from django.contrib.contenttypes.models import ContentType from django.contrib.sites.models import Site from django.cor...
#!/usr/bin/env python # # A library that provides a Python interface to the Telegram Bot API # Copyright (C) 2015-2017 # Leandro Toledo de Souza <devs@python-telegram-bot.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser Public License as published by #...
# Odds and ends in support of tests from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import os import pytest import numpy as np import copy from astropy import time from pypeit import arcimage from pypeit import trace...
# 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 u...
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2014 The Plaso Project Authors. # Please see the AUTHORS file for details on individual 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 L...
# Copyright 2016 Tecnativa - Pedro M. Baeza # Copyright 2018 Tecnativa - Carlos Dauden # Copyright 2018 ACSONE SA/NV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import api, models from odoo.tools import float_is_zero from odoo.tools.safe_eval import safe_eval class AccountAnalyticInvoic...
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin from django.db import models from django.db.models.signals import post_save from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from openid_provider.models import OpenID from .managers import UserManager, A...
#!/usr/bin/python3 # -*- coding: utf-8 -*- ################################################################################ # DChars Copyright (C) 2012 Suizokukan # Contact: suizokukan _A.T._ orange dot fr # # This file is part of DChars. # DChars is free software: you can redistribute it and/or modify # ...
#! /usr/bin/env python # -*- coding: utf-8 -*- import pykov # Markov chains helpers import time import random import urllib2 import OSC import sys import os.path import json from pyo import * import signal #TODO: addi/use formal loggin # import logging # import logging.handlers from mir.db.FreesoundDB import Freesou...
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
import datetime import csv import json import logging import sys import traceback from collections import defaultdict from django.views.decorators.csrf import csrf_exempt from django.conf import settings from django.contrib.auth.decorators import login_required from django.shortcuts import get_object_or_404 from django...
# coding: utf-8 import random import time from collections import OrderedDict from uuid import uuid4, UUID from dtest import Tester, canReuseCluster, freshCluster from assertions import assert_invalid, assert_one, assert_none, assert_all from tools import since, require, rows_to_list from cassandra import Consistency...
''' Created on 2012-11-05 A simple script that reads a WRF and NARR data and displays it in a proper geographic projection; application here is plotting precipitation in the inner WRF domain. @author: Andre R. Erler ''' ## includes # matplotlib config: size etc. import numpy as np import matplotlib.pylab as pyl impo...
import os import stat from gii.core import * from PyQt4 import QtCore, QtGui from PyQt4.QtCore import QEventLoop, QEvent, QObject from gii.qt.IconCache import getIcon from gii.qt.controls.Window import MainWindow from gii.qt.controls.Menu import MenuManager from gii.qt.QtEditorModule import QtEditorModule ...
from auslib.test.web.api.base import CommonTestBase class TestPublicReleasesAPI(CommonTestBase): def test_get_releases(self): ret = self.public_client.get("/api/v1/releases") got = ret.get_json() self.assertEqual(len(got["releases"]), 3) self.assertIsInstance(got["releases"][0], di...
#! /usr/bin/env python """ Takes a single hit table file and generates a table (or tables) of pathway/gene family assignments for the query sequences (aka 'reads'). Assignments can be for gene families, gene classes, or pathways. Multiple pathway or classification levels can be given. If they are, an assignment will be...
# -*- coding: utf-8 -*- ############################################################################ # 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 ...
#!/usr/bin/python import os import re import platform import string # ----------------------------------------------------------------------- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional informat...
##@package Example # Example of agent-based system based on a supply and a demand curve #@author Sebastien MATHIEU from .agent import Agent from .abstractSystem import AbstractSystem from .layer import Layer from .data import Data import math ## Supply with the target supply function \f$\pi = 0.1 q^2 +2\f...
import sys from jcc import cpp if len(sys.argv) == 1 or '--help' in sys.argv: help = ''' JCC - C++/Python Java Native Interface Code Generator Usage: python -m jcc.__main__ [options] [actions] Input options: --jar JARFILE - make JCC wrap all public classes found in ...
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015-2018 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in ...
# flake8: noqa # 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): # Adding model 'LazyUser' db.create_table('lazysignup_lazyuser', ( ('id', self....
import os import unittest from vsg.rules import entity_specification from vsg import vhdlFile from vsg.tests import utils sTestDir = os.path.dirname(__file__) lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_500_test_input.vhd')) lExpected_lower = [] lExpected_lower.append('') utils.read_fil...
# Copyright 2012 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. import copy import logging import optparse import os import shlex import socket import sys from telemetry.core import browser_finder from telemetry.core imp...
# -*- coding: utf-8 -*- # Scrapy settings for cwfuqs project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # http://doc.scrapy.org/en/latest/topics/settings.html # http://scrapy.readthedocs.org/en/latest/...
import sys import logging import colorama colorama.init() class Logger(object): DEFAULT_LEVEL = logging.INFO LEVEL_MAP = { 'debug': logging.DEBUG, 'info': logging.INFO, 'warn': logging.WARNING, 'error': logging.ERROR } COLOR_MAP = { 'debug': colorama.Fore.BLU...
import sys from PyQt5.QtWidgets import QApplication, QMainWindow, QMessageBox from PyQt5.uic import loadUi from var import values, version import torctl from fn_handle import detect_filename class MainWindow(QMainWindow): def __init__(self, *args): super(MainWindow, self).__init__(*args) # Load .ui file loadUi...
""" :copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved. :license: BSD, see LICENSE_BSD_Simple.txt for details. """ from .listenerbase import ListenerBase, ValidatorBase from .callables import ListenerMismatchError class Listener(ListenerBase): """ Wraps a callable so it...
# -*- coding: utf-8 -*- import os import sys from simpletree import __version__ as release project = 'SimpleTree' sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx'] templates_path = ['_templates'] source_suffix = '.rst' mas...
#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| |/ /...
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Arma una pantalla completa con la ventana de AguBrowse # Pantalla_Completa.py por: # Agustin Zuiaga <aguszs97@gmail.com> # Python Joven - Utu Rafael Peraza # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Ge...
import os, subprocess, re, sys import numpy as np import matplotlib.pyplot as plt import pandas as pd # Modify mesh size for all , we set: # - T_fridge = 0.005 # - T_hot = 0.3 def writeMooseInput(mesh_n): Values = { 'mesh_name': mesh_n } # First part is reading the text file with...
from rit_lib import * from train import * from trainCar import * from Location import * from map import * from mapCursor import * def processCommand(myTrain, myMap, args): """ This function processes the commands inputed. :param myTrain: the train created :param myMap: the map created ...
from allauth.account.adapter import DefaultAccountAdapter, get_adapter from allauth.account.models import EmailAddress from allauth.account.utils import cleanup_email_addresses from allauth.exceptions import ImmediateHttpResponse from allauth.socialaccount.adapter import DefaultSocialAccountAdapter from allauth.sociala...
# Adapted from the NLTK package v3.0.1: # https://github.com/nltk/nltk/blob/3.0.1/nltk/stem/snowball.py # # Natural Language Toolkit: Snowball Stemmer # # Copyright (C) 2001-2014 NLTK Project # Author: Peter Michael Stahl <pemistahl@gmail.com> # Peter Ljunglof <peter.ljunglof@heatherleaf.se> (revisions) # Algo...
# encoding: UTF-8 ''' 本文件中包含的是CTA模块的回测引擎,回测引擎的API和CTA引擎一致, 可以使用和实盘相同的代码进行回测。 History <id> <author> <description> 2017051200 hetajen 样例:策略回测和优化 ''' from __future__ import division '''2017051200 Add by hetajen begin''' import time '''2017051200 Add by hetajen end''' from datetime import d...
""" Instructor Dashboard Views """ import logging import datetime from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey import uuid import pytz from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_POST from django.utils.translation imp...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '.\MetaboliteEntryDisplayWidget.ui' # # Created by: PyQt5 UI code generator 5.8.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MetaboliteEntryDisplayWidget(object): def set...
from __future__ import absolute_import import re import os import xml.etree.ElementTree as ET from svtplay_dl.service import Service, OpenGraphThumbMixin from svtplay_dl.utils import is_py2_old from svtplay_dl.error import ServiceError from svtplay_dl.log import log from svtplay_dl.fetcher.rtmp import RTMP # This is...
#!/usr/bin/python2 import re class BaseValue(object): def __init__(self, value): self.value = value def __str__(self): return value def __repr__(self): return "<%s object: %s>" % (self.__class__.__name__, self.__str__()) def to_value(self): return self.__str__() # Note: # to_value: generates value as ...
# ##### 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...
# Test routines for tinkasm common routines # Scot W. Stevenson <scot.stevenson@gmail.com> # First version: 07. Feb 2019 # This version: 07. Feb 2019 # From this directory, run "python3 -m unittest" import unittest from common import convert_number class TestHelpers(unittest.TestCase): def test_convert_number(...
r"""*File I/O helpers for* ``sphobjinv``. ``sphobjinv`` is a toolkit for manipulation and inspection of Sphinx |objects.inv| files. **Author** Brian Skinn (bskinn@alum.mit.edu) **File Created** 5 Nov 2017 **Copyright** \(c) Brian Skinn 2016-2021 **Source Repository** https://github.com/bskinn/sphob...
#mypa.py import speech_recognition as sr #imports Speech_Recognition Modules from AppKit import NSSpeechSynthesizer #imports Speech Synthesizer for tts from random import randint #imports randint function import time #imports time modules to pause actions import sys #imports system functions import ...
#!/usr/bin/python2 # -*- coding: utf-8 -*- """Client GUI to control youBot robot.""" import Tkinter as tk import ttk import tkMessageBox import rospyoubot from math import radians, degrees class MainApplication(ttk.Frame): u"""Основное окно приложения.""" def __init__(self, parent, *args, **kwargs): ...
from imutils.video import FileVideoStream from pykeyboard import PyKeyboard import cv2 import numpy as np import argparse import imutils import time # argument parser (for video, will use stream/live frames in future) ap = argparse.ArgumentParser() ap.add_argument("-v", "--video", required=True, help="Path to vide...
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 import rapidsms from models import * class App(rapidsms.App): def parse(self, msg): text = msg.text msg.tags = [] # check the contents of this message for EVERY SINGLE # TAG that we know of. TODO: cache this for a little ...
import os import random import logging import arrow import telegram from telegram.error import Unauthorized from leonard import Leonard from modules.menu import GREETING_PHRASES from libs.timezone import local_time from libs.utils import FakeMessage telegram_client = telegram.Bot(os.environ['BOT_TOKEN']) bot = Leona...
# -*- coding: utf-8 -*- from __future__ import print_function, absolute_import, division #from pprint import pprint as print import bali, itertools fp = bali.FileParser() class PercentList(list): ''' A list where each element is a tuple of (percent, weight), that can calculate certain things... ''' ...
# -*- coding: utf-8 -*- # [HARPIA PROJECT] # # # S2i - Intelligent Industrial Systems # DAS - Automation and Systems Department # UFSC - Federal University of Santa Catarina # Copyright: 2006 - 2007 Luis Carlos Dill Junges (lcdjunges@yahoo.com.br), Clovis Peruchi Scotti (scotti@ieee.org), # Guilh...
import os.path import shutil from urlparse import urlparse, urljoin import base64 import requests from bs4 import BeautifulSoup from blue.settings import DOWNLOAD_IMAGE_FOLDER, IMAGE_PREFIX ''' download the image from the article ''' IMAGE_DOWNLOAD_FOLDER = DOWNLOAD_IMAGE_FOLDER def get_absolute_url(article_url, im...
import logging; logger = logging.getLogger("morse." + __name__) import bge import morse.core.actuator class SteerForceActuatorClass(morse.core.actuator.MorseActuatorClass): """ Motion controller using engine force and steer angle speeds This class will read engine force and steer angle (steer, force) as i...
import numpy as np import scipy as sp import os import scipy.optimize as op import cPickle as cpkl import emcee import matplotlib as mpl mpl.use('PS') import matplotlib.pyplot as plt import chippr from chippr import defaults as d from chippr import plot_utils as pu from chippr import utils as u from chippr import sta...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import six from ibeis import constants as const from ibeis.control import accessor_decors, controller_inject from ibeis.control.controller_inject import make_ibs_register_decorator import functools import utool as ut import uuid pr...
import logging from copy import copy from abc import ABCMeta, abstractmethod from collections import OrderedDict from PyQt5.QtCore import QObject pyqtWrapperType = type(QObject) __all__ = ["SimulationModule", "SimulationException", "Trajectory", "Feedforward", "Controller", "Limiter", "ModelMixe...
#!/usr/bin/env python3 import argparse from datetime import datetime import time from create_tables import create_database, main_tables, data_tables,\ events_tables from extractor import QuandlCodeExtract, QuandlDataExtraction,\ GoogleFinanceDataExtraction, YahooFinanceDataExtraction, CSIDataExtractor,\ N...
############################################################################### # This file was copied from cpython/Lib/tests/test_mailcap.py # Some lines have been modified to work without the python test runner ############################################################################### import os import copy impo...
""" ============================================================================ File name: test_pyopencl.py Author: gong-yi@GongTop0 Created on: 2013/12/29 20:45:43 Purpose: To show Copyright: BSD / Apache ------------------...