src
stringlengths
721
1.04M
__author__ = 'rcj1492' __created__ = '2016.11' __license__ = 'MIT' ''' APScheduler Documentation https://apscheduler.readthedocs.io/en/latest/index.html APScheduler Trigger Methods https://apscheduler.readthedocs.io/en/latest/modules/triggers/date.html https://apscheduler.readthedocs.io/en/latest/modules/tr...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import base64 import logging import os import re import zlib import babelfish import guessit from . import Provider from .. import __version__ from ..compat import ServerProxy, TimeoutTransport from ..exceptions import ProviderError, AuthenticationError, D...
from setuptools import setup, find_packages import os version = '0.2.dev0' install_requires = [ 'setuptools', # -*- Extra requirements: -*- ] tests_require = [ 'mocker', ] setup(name='zettwerk.users', version=version, description="Additional user information for Plone", ...
from operator import le, lt import textwrap import numpy as np from pandas._config import get_option from pandas._libs.interval import Interval, IntervalMixin, intervals_to_interval_bounds from pandas.compat.numpy import function as nv from pandas.util._decorators import Appender from pandas.core.dtypes.cast import...
from conf import config from util import * import settings import base64 qpat = re.compile(r'\?') if settings.DEBUG: import logging logging.basicConfig() log = logging.getLogger('PyGoogleVoice') log.setLevel(logging.DEBUG) else: log = None class Voice(object): """ Main voice instance for...
import sys from naoqi import ALProxy # To get the constants relative to the video. import vision_definitions import cv2 import numpy as np import imageresolve.puzzlesolver.solver as slv import imageextractor.imageextractor as ext import imageresolve.puzzlesolver.model.puzzle as pzl import imageresolve.puzzlesolver.mod...
""" Run with -m filter_weather_data.start_filtering_pipe if you want to see the demo. """ import os import logging from gather_weather_data.husconet import GermanWinterTime from .filters import PROCESSED_DATA_DIR from .filters import StationRepository from .filters.preparation.average_husconet_radiation import ave...
# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import reverse from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit, Layout, Button, Field from crispy_forms.bootstrap import FormActions import floppyforms as forms from .models ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import math import random import itertools from datetime import datetime from collections import deque from argparse import ArgumentParser from tabulate import tabulate from spark import * # parse arguments parser = ArgumentParser() parser.add_argument("--rat...
import abc import base64 import collections import copy import hashlib import json import os import re import shutil import stat import subprocess import zipfile from distutils.version import LooseVersion import git import portalocker import pystache import six from dcos import (constants, emitting, errors, http, mara...
# -*- coding: utf-8 -*- """ Wrapper around sklearn k-neighbors estimators that can work in batches on pytables arrays (or other disk-backed arrays that support slicing) """ import numpy as np from sklearn.neighbors import NearestNeighbors as SKNN from meteography.dataset import PIXEL_TYPE class NearestNeighbors: ...
""" Three distinct points are plotted at random on a Cartesian plane, for which -1000 <= x, y <= 1000, such that a triangle is formed. Consider the following two triangles: A(-340,495), B(-153,-910), C(835,-947) X(-175,41), Y(-421,-714), Z(574,-645) It can be verified that triangle ABC contains the origin, whereas ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2014, Red Hat, Inc. # License: GPL-2.0+ <http://spdx.org/licenses/GPL-2.0+> # See the LICENSE file for more details on Licensing """ This is a module for downloading fedora cloud images (and probably any other qcow2) and then booting them locally with qemu. """...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import config import requests from requests_oauthlib import OAuth1 from base64 import b64encode def get_access_token(): token = config.twitter_app_key + ':' + config.twitter_app_secret h = {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8', ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # written for python 3 but also run on python 2 from __future__ import absolute_import, division, print_function, unicode_literals import os import shutil import jsngram.jsngram import jsngram.dir2 import jsngram.text2 def test(): base_dir = os.path.realpath('/scratc...
"""tests of joined-eager loaded attributes""" from sqlalchemy.testing import eq_, is_, is_not_ import sqlalchemy as sa from sqlalchemy import testing from sqlalchemy.orm import joinedload, deferred, undefer, \ joinedload_all, backref, eagerload, Session, immediateload from sqlalchemy import Integer, String, Date, ...
# -*- coding: utf-8 -*- from django.conf import settings class Conf: """ Класс конфигурации для робокассы, берёт настройки из settings.ROBOKASSA_CONF """ # todo: в большинстве случаев 1 магазин на 1 сайт - сделать необязательным параметр token # обязательные параметры - реквизиты магазина LOGIN ...
from __future__ import division import math from sorl.thumbnail.engines.base import EngineBase from sorl.thumbnail.compat import BufferIO try: from PIL import Image, ImageFile, ImageDraw, ImageChops, ImageFilter except ImportError: import Image, ImageFile, ImageDraw, ImageChops def round_corner(radius, fill...
# coding=utf-8 def global_survived(kp, demands): s = 0 for K in kp: if len(K) == len(demands): s += 1 return s / float(len(kp)) def survived_dem(kp): sk = [] for k in kp: sk.append(len(k)) return sk def failed_dem(kp, demands): fk = [] for k in kp: ...
import data_io import CausalityFeatureFunctions as f from sklearn.ensemble import RandomForestRegressor from sklearn.pipeline import Pipeline class CausalityTrainer: def __init__(self, directionForward=True): self.directionForward = directionForward def getFeatureExtractor(self, features): com...
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from tests import IntegrationTestCase from tests.holodeck import Request from twilio.base.exceptions import TwilioException from twilio.http.response import Response class WorkerStatisticsTestCase(...
""" Single figure and axes with two items ======================================= Only the pressure q[0] is plotted. In this example the line and points are plotted in different colors by specifying a second item on the same axes. """ #-------------------------- def setplot(plotdata): #--------------------------...
#!/usr/bin/python # -*- coding: utf-8 -*- import os import sys import subprocess import time import shutil import glob from rettescript import print_failed class Devilry_Sort: def __init__(self, rootDir, execute=True, delete=False, log=False, ...
""" Django settings for twitcher 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 configparser import os from os.path import dirname, join config =...
import sys, os, time, string, types if os.environ.has_key('SIMICS_PYCHECKER'): os.environ['PYCHECKER'] = ('--no-shadowbuiltin --no-argsused' + ' --no-implicitreturns --no-shadow') import pychecker.checker from cli import * from refmanual import * from re import * from string imp...
import requests import cfscrape import xmlrpc.client import hashlib import time import platform import json import os import sys import logging from .regexp import * from .exceptions import * from .parser import * from .tapatalk import * from .user import * from . import __version__, __title__, __author__ class sessio...
import logging import os import time import unittest from contextlib import contextmanager from golem.core.databuffer import DataBuffer from golem.network.transport.message import Message, MessageHello, init_messages from golem.network.transport.network import ProtocolFactory, SessionFactory, SessionProtocol ...
""" Sponge Knowledge Base Remote API security """ from org.openksavi.sponge.remoteapi.server.security import User # Simple access configuration: role -> knowledge base names regexps. ROLES_TO_KB = { "admin":[".*"], "guest":["example"], "anonymous":["example"]} # Simple access configuration: role -> event names regexp...
__author__ = 'Amin' # COMPLETED # PYTHON 3.x import sys import math class Floor: def __init__(self, width, contains_exit=False, exit_position=-1): self.width = width self.__contains_elevator = False self.__elevator_position = -1 self.__contains_exit = contains_exit self._...
import urlparse from collections import defaultdict def sanitize_log_data(secret, data=None, leave_characters=4): """ Clean private/secret data from log statements and other data. Assumes data and secret are strings. Replaces all but the first `leave_characters` of `secret`, as found in `data`, with ...
from grow.pods import pods from grow.pods import storage import click import os @click.command() @click.argument('pod_path', default='.') @click.option('--include-obsolete/--no-include-obsolete', default=False, is_flag=True, help='Whether to include obsolete messages. If false, obsolete' ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ This module is part of the Clemson ACM Auto Grader Copyright (c) 2016, Robert Underwood All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistribut...
from threading import Thread from celery import Celery from . import tasks from .celery import app __all__ = ('TaskApi', ) def watch_task(task, callback, kwargs=None): """ watch task until it ends and then execute callback: callback(response, **kwargs) where response is a result of task :...
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:...
""" Author: Timothy Moore Created On: 31th August 2017 Defines a two-dimensional quadtree of arbitrary depth and bucket size. """ import inspect import math from collections import deque from pygorithm.geometry import (vector2, polygon2, rect2) class QuadTreeEntity(object): """ This is the minimum informatio...
import datetime from huey import crontab from huey import exceptions as huey_exceptions from huey import RedisHuey from huey.api import Huey from huey.api import QueueTask from huey.registry import registry from huey.storage import RedisDataStore from huey.storage import RedisQueue from huey.storage import RedisSchedu...
# # 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 # ...
# -*- coding: utf-8 -*- from django.urls import reverse from django.test import TestCase from helpdesk.models import KBCategory, KBItem, Queue, Ticket from helpdesk.tests.helpers import (get_staff_user, reload_urlconf, User, create_ticket, print_response) class KBTests(TestCase): def setUp(self): self.q...
#!/usr/bin/env python # vim: set fileencoding=utf-8 : # Andre Anjos <andre.anjos@idiap.ch> # Tue May 31 16:55:10 2011 +0200 # # Copyright (C) 2011-2014 Idiap Research Institute, Martigny, Switzerland """Tests on the machine infrastructure. """ import os, sys import nose.tools import math import numpy from . import M...
# -*- coding: utf-8 -*- # Copyright (c) 2009, Popego Corporation <contact [at] popego [dot] com> # All rights reserved. # # This file is part of the Meaningtool Web Services Python Client project # # See the COPYING file distributed with this project for its licensing terms. """ Meaningtool Category Tree REST API v0....
#!/usr/bin/env python """ desnp.py January 9, 2012 Dave Walton - dave.walton@jax.org This program is part of a CGD toolkit for manipulating expression data. This specific piece of code will take a file of probes, a set of strains, and a file of SNPS and filter out all the probes that have a SNP in one or more of the ...
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017, 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any...
def extractJingletranslationsWordpressCom(item): ''' Parser for 'jingletranslations.wordpress.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('Breaking Off the Engagement… Bring it on!', ...
import csv from os.path import basename, splitext from django.core.management.base import BaseCommand, CommandError from django.core.validators import URLValidator, ValidationError from django.db.transaction import atomic from django.utils import translation from mpconstants.mozilla_languages import LANGUAGES from m...
import copy import logging from typing import List, Optional, Union, Dict from slack_sdk.models.basic_objects import JsonObject, JsonValidator from slack_sdk.models.blocks import Block, TextObject, PlainTextObject, Option class View(JsonObject): """View object for modals and Home tabs. https://api.slack.com...
from templeplus.pymod import PythonModifier from toee import * import tpdp import logbook import roll_history debug_enabled = False def debug_print(*args): if debug_enabled: for arg in args: print arg, return def handle_sanctuary(to_hit_eo, d20a): tgt = d20a.target if tgt == OBJ_H...
#!/usr/bin/env python from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from absl import app import mock from grr_response_client import comms from grr_response_client import fleetspeak_client from grr_response_core.lib import communicator from grr_response...
from setuptools import setup, find_packages import sys, os version = '0.2' setup(name='pymetrics', version=version, description="A metrics library to time and count what happens during a process.", long_description="""\ """, classifiers=[ 'Development Status :: 3 - Alpha', ...
# -*- coding: utf-8 -*- # 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, softw...
import sys import time import multiprocessing import mantid.simpleapi as api import numpy as np from reflectivity_ui.interfaces.data_handling import instrument def load_data(run="REF_M_30769"): if run.startswith("/SNS"): filepath = run else: filepath = '/SNS/REF_M/IPTS-21391/nexus/' + run + ...
# Copyright (C) 2020 Jason Anderson, Lunatixz # # # This file is part of PseudoTV Live. # # PseudoTV Live 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...
#!/usr/bin/env python #Time-stamp: <Last updated: Zhao,Yafan zhaoyafan@mail.thu.edu.cn 2013-11-25 20:20:08> """ A script to get the optimized geometry from ADF DFTB calculation out file. """ import sys, re if (len(sys.argv) < 2): print "Usage: ADFDFTB2xyz.py [adf.out]" exit(0) ADFOUT = sys.argv[1] inp = open(AD...
""" Base and utility classes for tseries type pandas objects. """ from datetime import datetime from typing import TYPE_CHECKING, Any, List, Optional, Tuple, Type, TypeVar, Union, cast import numpy as np from pandas._libs import NaT, Timedelta, iNaT, join as libjoin, lib from pandas._libs.tslibs import BaseOffset, Re...
from liealgebra import * #L0 L0Struct = LieStructureConstantTable(4) L0Struct.AutoComplete() L0 = LieAlgebra(4, "L0") L0.LieAlgebraByStructureConstants(L0Struct) #L1 L1Struct = LieStructureConstantTable(4) L1Struct.SetEntry(0,1, [0,0,1,0]) L1Struct.AutoComplete() L1 = LieAlgebra(4,"L1") L1.LieAlgebraByStructureCon...
# encoding: utf-8 """ tokeniser.py Created by Thomas Mangin on 2014-06-22. Copyright (c) 2014-2015 Exa Networks. All rights reserved. """ from exabgp.util import coroutine from exabgp.configuration.engine.location import Location from exabgp.configuration.engine.raised import Raised # convert special caracters @cor...
#!/usr/bin/env python ''' mavlink python parse functions Copyright Andrew Tridgell 2011 Released under GNU GPL version 3 or later ''' from __future__ import print_function from builtins import range from builtins import object import errno import operator import os import sys import time import xml.parsers.expat PRO...
""" Decorators ~~~~~~~~~~ A collection of decorators for identifying the various types of route. """ from __future__ import absolute_import import odin from odin.exceptions import ValidationError from odin.utils import force_tuple, lazy_property, getmeta from .constants import HTTPStatus, Method, Type from .data_s...
#!/usr/bin/env python from datetime import datetime from itertools import chain import re import numpy as np import click from labman.db.process import ( SamplePlatingProcess, GDNAExtractionProcess, GDNAPlateCompressionProcess, LibraryPrep16SProcess, NormalizationProcess, QuantificationProcess, LibraryPr...
""" Package containing all pip commands """ # The following comment should be removed at some point in the future. # mypy: disallow-untyped-defs=False from __future__ import absolute_import import importlib from collections import OrderedDict, namedtuple from pipenv.patched.notpip._internal.utils.typing import MYPY...
# pylint: disable=missing-docstring # pylint: disable=bad-whitespace import os import sys import time import atexit from signal import SIGTERM # based on: # https://web.archive.org/web/20160305151936/http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/ class Daemon(object): ...
# Copyright (c) Pedro Matiello <pmatiello@gmail.com> # # 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, m...
# 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 -*- # Copyright 2021 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 agr...
#!/home/mworden/uframes/ooi/uframe-1.0/python/bin/python __author__ = 'mworden' from mi.core.log import get_logger log = get_logger() from mi.idk.config import Config import unittest import os from mi.dataset.driver.flord_l_wfp.sio.flord_l_wfp_sio_telemetered_driver import parse from mi.dataset.dataset_driver impo...
# -*- coding: utf-8 -*- from __future__ import absolute_import from bs4 import BeautifulSoup from .chat_objects import * def get_emails_html(path_to_html='emails.html'): "returns the html from the emails file" html = None with open(path_to_html, 'r') as emails_file: html = emails_file.read() ...
"""popup_menu.py - A low-fuss, infinitely nested popup menu with simple blocking behavior, and more advanced non-blocking behavior. Classes: PopupMenu -> A blocking menu. NonBlockingPopupMenu -> A non-blocking menu. Menu -> The graphics and geometry for a menu panel. Note: You'll typically ...
""" Register an iFrame front end panel. For more details about this component, please refer to the documentation at https://home-assistant.io/components/panel_iframe/ """ import asyncio import voluptuous as vol from homeassistant.const import (CONF_ICON, CONF_URL) import homeassistant.helpers.config_validation as cv...
""" Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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 la...
from numpy.random import randn import numpy as np import scipy as sp from matrix_util import * def Ginibre(M, N, COMPLEX=False): if COMPLEX==True: out=(randn(M,N) + 1j*randn(M,N) )/ sp.sqrt(2*N) else: out=randn(M,N)/ sp.sqrt(N) return np.matrix(out) def haar_unitary(M, COMPLE...
 # define const variable _MAX_LETTER_SIZE = 27; _STRING_END_TAG = '#'; class TireNode(object): def __init__(self,x): self.value = x self.childNodes = {} class WordDictionary(object): def __init__(self): """ Initialize your data structure here. """ self.root =...
import logging from threading import Event import boto3 from botocore.exceptions import ClientError from cwlogs.push import EventBatchPublisher, EventBatch, LogEvent from cwlogs.threads import BaseThread from six.moves import queue as Queue logger = logging.getLogger(__name__) class BatchedCloudWatchSink(BaseThre...
""" xModule implementation of a learning sequence """ # pylint: disable=abstract-method import collections import json import logging from datetime import datetime from lxml import etree from pkg_resources import resource_string from pytz import UTC from xblock.completable import XBlockCompletionMode from xblock.core...
# -*- coding: utf-8 -*- """Description""" import json import sys import os import click from postcard.postcard import Postcard from postcard.mailer import Mailman import postcard.templater as templater @click.command() @click.option('--config', type=click.Path(exists=True), help="Path to configuration file") @click.a...
import pygame from const import * from vector import Vector2 as Vec2 import random class Way(list): def __init__(self, d_in = 0, d_out = 0, *args, **kwargs): super(Way, self).__init__(*args, **kwargs) super(Way, self).append(d_in) super(Way, self).append(d_out) def append(...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """HTML checkboxes for monster hit points.""" import argparse import json import numpy as np import random import sys def roll(n, d): """Roll n d-sided dice.""" r = 0 for i in range(n): r += random.randint(1, d) return r def parse(hitdice): ...
# # las2demPro.py # # (c) 2013, martin isenburg - http://rapidlasso.com # rapidlasso GmbH - fast tools to catch reality # # uses las2dem.exe to raster a folder of LiDAR files # # LiDAR input: LAS/LAZ/BIN/TXT/SHP/BIL/ASC/DTM # raster output: BIL/ASC/IMG/TIF/DTM/PNG/JPG # # for licensing see http://lasto...
# -*- coding: utf-8 -*- # Copyright(C) 2010-2014 Romain Bignon # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your...
#! /usr/bin/env python from time import sleep import subprocess import cmd import thread import os def switch_ids(): """ Switch IDS1 with IDS2. """ print('switch_ids() activated, waiting 10s before trigger') sleep(20) print('switch_ids() wait complete. Trigger the IDS switch.') cmds = [] c...
#!/usr/bin/python # coding: utf-8 from __future__ import absolute_import, unicode_literals ''' Local settings - Use djangosecure ''' from .common import * # noqa print("DEBUG: Loading settings from staging") # Because we're behind a reverse proxy, pay attention to where the request is coming from USE_X_FORWARDED...
#! /usr/bin/env python """ The MIT License (MIT) Copyright (c) 2015 creon (creon.nu@gmail.com) 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...
#!/usr/bin/python # coding=UTF-8 # # DIMAC (Disk Image Access for the Web) # Copyright (C) 2014 # All rights reserved. # # This code is distributed under the terms of the GNU General Public # License, Version 3. See the text file "COPYING" for further details # about the terms of this license. # # This is the main disk...
############################################################################### ## ## Copyright (C) 2014-2015, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## ...
import jinja2 import webapp2 import os import json import random from settings import * from google.appengine.api import memcache from apis.pyechonest import config as enconfig from apis.pyechonest import * #from apis.rdio import Rdio JINJA_ENVIRONMENT = jinja2.Environment( loader=jinja2.FileSystemLoader(os.path.dirn...
""" ``django-teamwork`` template tags, loaded like so: {% load teamwork_tags %} """ from __future__ import unicode_literals from django import template from django.contrib.auth import get_user_model from django.contrib.auth.models import Group, AnonymousUser from django.template import get_library from django.temp...
#!/usr/bin/env python """ This is a module contains scripts for generating compact, upper-triangle and full matrices of HiC interaction data. Concepts -------- These functions rely on the :class:`HiC` class in conjunction with the :class:`Fend` and :class:`HiCData` classes. Data can either be arranged in compact, c...
import os def getenv(key): if key == "CLUSTER_NAME": return os.environ.get("CLUSTER_NAME", "docklet-vc") elif key == "FS_PREFIX": return os.environ.get("FS_PREFIX", "/opt/docklet") elif key == "CLUSTER_SIZE": return int(os.environ.get("CLUSTER_SIZE", 1)) elif key == "CLUSTER_NET...
#!/usr/bin/env python ## # @file trajectory_capture.py # @author Artur Wilkowski <ArturWilkowski@piap.pl> # # @section LICENSE # # Copyright (C) 2015, Industrial Research Institute for Automation and Measurements # Security and Defence Systems Division <http://www.piap.pl> import roslib roslib.load_manifest('img_to...
"""Settings that need to be set in order to run the tests.""" import os DEBUG = True SITE_ID = 1 APP_ROOT = os.path.abspath( os.path.join(os.path.dirname(__file__), '..')) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } ROOT_URLCONF = 'active_...
#Copyright (c) 2011 Yahoo! Inc. All rights reserved. Licensed under the BSD License. # See accompanying LICENSE file or http://www.opensource.org/licenses/BSD-3-Clause for the specific language governing permissions and limitations under the License. """ Main class here is Serp (Search Engine Results Page) This is a...
from django.db import models from django.contrib.auth.models import User from rest_framework.authtoken.models import Token from django.db.models.signals import post_save from django.dispatch import receiver from django.core.validators import MinValueValidator @receiver(post_save, sender=User) def create_auth_token(sen...
import functools def ratelimited(user=None, guest=None, redis_key_format="ratelimited.%s"): """Rate limit decorator ### Headers X-RateLimit-Limit: 1000 X-RateLimit-Remaining: 567 X-RateLimit-Reset: 1242711173 ### Status when rate limited Status: 403 Forbidden """ if user: ...
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import os i...
import tempfile from datetime import datetime import numpy as np import pandas as pd import pytest import pytz from eemeter.testing.mocks import MockWeatherClient from eemeter.weather import ISDWeatherSource from eemeter.modeling.formatters import ModelDataBillingFormatter from eemeter.structures import EnergyTrace ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ :mod:`account` ======================= List of bank account number formats from `Bankgirot <https://www.bankgirot.se/globalassets/dokument/anvandarmanualer/bankernaskontonummeruppbyggnad_anvandarmanual_sv.pdf>`_. .. moduleauthor:: hbldh <henrik.blidh@swedwise.com> Cre...
# Lab 11 MNIST and Deep learning CNN import tensorflow as tf from lib.ensemble.ensemble_core import EnsembleCore from lib.ensemble.mnist_core import MnistCore from lib.ensemble.cnn_core import CNNCore class MyCNN (CNNCore): def init_network(self): self.set_placeholder(784, 10, 28, 28) self.DO = tf...
# nltk_based_segmenter_tokeniser.py import nltk import regex, sys, codecs, unicodedata, string from recluse import utils def subtokenise(token, abbreviation_list=[]): """ Returns a tuple of disjoint, non-overlapping substrings that cover the token string. Subtokens are determined as follows: All...
""" [7/2/2014] Challenge #169 [Intermediate] Home-row Spell Check https://www.reddit.com/r/dailyprogrammer/comments/29od55/722014_challenge_169_intermediate_homerow_spell/ #User Challenge: Thanks to /u/Fruglemonkey. This is from our idea subreddit. http://www.reddit.com/r/dailyprogrammer_ideas/comments/26pak5/interme...
#!/usr/bin/env python # -*- encoding UTF-8 -*- # THIS CODE DERIVED FORM cma.py import gdb import signal import re import threading from .Heap import Heap #----------------------------------------------------------------------- #Archs # TODO: Update all arch classes to use gdb.Architecture checks instead of this # ...
from collections import namedtuple entry = namedtuple('entry', 'qname flag rname pos mapq cigar rnext pnext tlen seq qual') VALID_HD_TAGS = ['VN', 'SO'] VALID_SQ_TAGS = ['SN', 'LN', 'AS', 'M5', 'SP', 'UR'] REQUIRED_HD_TAGS = ['VN'] REQUIRED_SQ_TAGS = ['SN', 'LN'] class SamHeader( object ): def __init__(self, l...
#!/usr/bin/env python import os import sys import breakdancer from breakdancer import Condition, Effect, Action, Driver TESTKEY = 'testkey' ###################################################################### # Conditions ###################################################################### class ExistsConditio...